/* Dog detail page: urgency banner, shelter contact, visits log, share panel,
   social-post links, interest forms (foster CTA), and the legacy enrich form. */

/* Two-column layout on desktop: dog photo on left, info/actions on right.
   Stacks to single column on mobile so the photo doesn't take half the
   narrow screen while the text gets squeezed into the other half. */
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; }
.detail-grid img { width: 100%; border-radius: 8px; background: #ece6da; }
@media (max-width: 680px) {
  .detail-grid { grid-template-columns: 1fr; gap: 1rem; }
  /* Cap the hero image height so a tall portrait shot doesn't push everything
     down two screens. The photo gallery below still shows it full-size. */
  .detail-grid > div:first-child img { max-height: 360px; object-fit: cover; }
}
.field-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.field-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; }
.field-list li .k { color: var(--muted); }

/* Photo gallery — shelter image + any volunteer-uploaded photos. The shelter
   one always shows first with a small "shelter" badge; user uploads come after
   in sort_order. Click any tile to open at full size in a new tab. */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin: 0.4rem 0 0.6rem;
}
/* Wrapper used for uploaded photos so the delete button + uploaded-by
   pill can be position:absolute relative to the tile without sitting
   inside the clickable <button>. */
.photo-tile-wrap { position: relative; }

.photo-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #ece6da;
  text-decoration: none;
  color: inherit;
  /* Reset the <button> defaults so it looks like the old <a> tile. */
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.photo-tile:hover img { transform: scale(1.04); }
.photo-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-tile .photo-source {
  position: absolute; bottom: 0.3rem; left: 0.3rem;
  font-size: 0.65rem; padding: 0.1rem 0.4rem;
  background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em;
  pointer-events: none;
}
.photo-tile-wrap .photo-by {
  position: absolute; bottom: 0.3rem; left: 0.3rem;
  font-size: 0.65rem; padding: 0.1rem 0.4rem;
  background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em;
  pointer-events: none;
}
.photo-del-form { position: absolute; top: 0.3rem; right: 0.3rem; margin: 0; padding: 0; z-index: 2; }
.photo-del {
  width: 22px; height: 22px;
  padding: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 0; border-radius: 50%;
  font-size: 0.95rem; line-height: 1;
  cursor: pointer;
}
.photo-del:hover { background: var(--bad); }

.fb-conversation { margin: 1.5rem 0; padding: 1rem 1.1rem; background: #f7f9fc; border: 1px solid #dde3ec; border-left: 4px solid #1877f2; border-radius: 6px; }
.fb-conversation h2 { margin: 0 0 0.2rem; display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; }
.fb-conversation-icon { font-size: 1rem; }
.fb-conversation .small { font-size: 0.8rem; }
.fb-conversation > p { margin: 0 0 0.8rem; }
.fb-comments { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.fb-comment { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 0.55rem 0.75rem; }
.fb-comment-reply { margin-left: 1.5rem; border-left: 2px solid #c8d3e3; }
.fb-comment-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; margin-bottom: 0.2rem; }
.fb-comment-body { font-size: 0.92rem; line-height: 1.4; white-space: pre-wrap; }
.fb-comment-actions { margin-top: 0.3rem; }
.fb-comment-actions a { font-size: 0.78rem; }

.photo-tile.is-hero { outline: 2px solid var(--accent); outline-offset: -2px; }
.hero-badge {
  position: absolute;
  top: 0.3rem; left: 0.3rem;
  background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.hero-form { position: absolute; bottom: 0.3rem; left: 0.3rem; margin: 0; padding: 0; z-index: 2; }
.hero-btn-set {
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.hero-btn-set:hover { background: var(--accent); }

.photo-upload { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.3rem 0 1rem; padding: 0.6rem 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.photo-upload-input { flex: 1 1 260px; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; color: var(--muted); }
.photo-upload-input input[type=file] { padding: 0.25rem 0; font-size: 0.85rem; }
.photo-upload input[type=text] { flex: 1 1 200px; padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 5px; font-size: 0.9rem; }

/* Outcome banner — shown when a dog has left the shelter. Adopted gets a
   celebratory tone, RTO/transferred stays neutral, deceased gets a memorial
   treatment. Always near the top so visitors know the current state first. */
.outcome-banner {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1rem;
  margin: 0.6rem 0 1rem;
  border-radius: 8px;
  background: #f1ede3;
  color: var(--fg);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.outcome-banner strong { display: block; font-size: 1rem; }
.outcome-banner small { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.outcome-banner .outcome-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.outcome-banner.adopted {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}
.outcome-banner.adopted small { color: #166534; }
.outcome-banner.rto,
.outcome-banner.transferred {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}
.outcome-banner.memorial {
  background: #2a2a2a;
  border-color: #444;
  color: #f5f5f5;
  font-style: normal;
}
.outcome-banner.memorial strong { color: #fff; }
.outcome-banner.memorial small { color: #c4c4c4; }
/* Interim "outcome pending" — neither celebratory nor memorial.
   Soft amber/sand so it reads as "in progress" not "alarming". */
.outcome-banner.pending {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}
.outcome-banner.pending small { color: #92400e; }

/* Bite / dangerous-dog hold — serious, not adoptable. */
.outcome-banner.bite-hold {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #7f1d1d;
}
.outcome-banner.bite-hold strong { color: #7f1d1d; }
.outcome-banner.bite-hold small  { color: #991b1b; }
.outcome-banner.bite-hold .outcome-icon { color: #b91c1c; font-size: 1.5rem; }

/* Hero badge variant for bite-hold dogs. Stronger than the foster
   green — should be unmistakable. */
.detail-hero-badge.bite-hold {
  background: rgba(185,28,28,0.94);
  color: #fff;
}

/* Photo-overlay badge — anchored to the corner of the hero image
   so it instantly communicates a context that the photo alone
   doesn't (currently fostered, etc.). */
.detail-hero-wrap { position: relative; }
.detail-hero-badge {
  position: absolute;
  top: 0.7rem; left: 0.7rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.detail-hero-badge.foster {
  background: rgba(22,101,52,0.92);
  color: #fff;
}

/* /outcomes page — 'Pending confirmation' section. Same amber as the
   detail banner so the visual language is consistent. */
.outcome-pending {
  margin: 1rem 0 2rem;
  padding: 1rem 1.1rem;
  background: #fef9eb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.outcome-date-heading.pending { color: #78350f; }
.outcome-date-heading.pending small { font-weight: 500; color: #92400e; font-size: 0.85rem; }
.outcome-date-icon { margin-right: 0.35rem; }
.outcome-pending-blurb { font-size: 0.85rem; margin: 0.25rem 0 0.85rem; }
.outcome-pending-list { display: flex; flex-direction: column; gap: 0.45rem; }
.outcome-row.pending {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none; color: var(--fg);
  transition: background 0.1s ease;
}
.outcome-row.pending:hover { background: #fffbe6; text-decoration: none; }
.outcome-row.pending img {
  width: 48px; height: 48px;
  object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
.outcome-row.pending strong { display: block; font-size: 0.95rem; }
.outcome-row.pending small { display: block; font-size: 0.8rem; }

/* Outcomes timeline (/outcomes route) — reverse-chrono feed of dogs that
   left the shelter, grouped by date. */
.outcome-filters { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.6rem 0 0.85rem; }
.outcome-filters .chip { text-decoration: none; }
.outcome-filters .chip.active { background: var(--accent); color: #fff; }

.outcome-totals { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.outcome-total {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  min-width: 90px;
}
.outcome-total strong { display: block; font-size: 1.4rem; line-height: 1; }
.outcome-total small { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.outcome-total-adopted_altered, .outcome-total-adopted { background: #dcfce7; border-color: #86efac; }
.outcome-total-deceased { background: #2a2a2a; border-color: #444; color: #f5f5f5; }
.outcome-total-deceased small { color: #c4c4c4; }
.outcome-total-rto { background: #f3f4f6; border-color: #d1d5db; }
.outcome-total-transferred { background: #fef3c7; border-color: #fde68a; }

.outcome-date-heading { font-size: 1.05rem; margin: 1rem 0 0.4rem; color: var(--muted); font-weight: 600; }
.outcome-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.outcome-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.outcome-row img,
.outcome-row .outcome-no-img {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  background: #ece6da;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.outcome-row.outcome-row-deceased { background: #fafafa; border-color: #e5e5e5; }
.outcome-row.outcome-row-deceased .outcome-no-img { background: #2a2a2a; color: #f5f5f5; }
.outcome-meta { flex: 1; min-width: 0; }
.outcome-name { font-weight: 600; font-size: 0.95rem; }
.outcome-name a { color: var(--fg); }
.outcome-name .muted { font-weight: normal; font-size: 0.8rem; }
.outcome-descriptors { font-size: 0.82rem; color: var(--muted); }
.outcome-reason { font-size: 0.8rem; color: var(--bad); margin-top: 0.15rem; }
.outcome-pill {
  font-size: 0.78rem; font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #f0eadd;
  white-space: nowrap;
}
.outcome-row-adopted .outcome-pill,
.outcome-row-adopted_altered .outcome-pill { background: #dcfce7; color: #14532d; }
.outcome-row-rto .outcome-pill { background: #f3f4f6; color: #374151; }
.outcome-row-transferred .outcome-pill { background: #fef3c7; color: var(--warn); }
.outcome-row-deceased .outcome-pill { background: #2a2a2a; color: #fff; }

/* Urgency banner — varies by severity. Critical = solid red for euth deadline ≤3d. */
.urgency-banner { padding: 0.6rem 0.85rem; border-radius: 6px; margin: 0.6rem 0 1rem; font-size: 0.9rem; background: #fef3c7; color: var(--warn); border: 1px solid #fde68a; }
.urgency-banner.warn { background: #fed7aa; color: #9a3412; border-color: #fdba74; }
.urgency-banner.critical { background: var(--bad); color: #fff; border-color: var(--bad); font-weight: 500; }
.urgency-banner.stale { background: #fef3c7; color: var(--warn); border-color: #fde68a; }
/* Moderator-only auto "watch" signal (api/risk.py). Purple = internal marker. */
.urgency-banner.watch { background: #ede9fe; color: #5b21b6; border: 1px dashed #8b5cf6; }
.urgency-banner.watch.elevated { background: #ddd6fe; border-style: solid; }
.urgency-banner.watch .watch-note { display: block; margin-top: 0.2rem; font-size: 0.78rem; opacity: 0.8; }
/* Post-to-Facebook panel (social_media only) */
.fb-post-panel { margin: 0.5rem 0 1rem; }
.fb-post-details > summary { cursor: pointer; font-weight: 600; color: #1877f2; padding: 0.4rem 0; }
.fb-post-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.fb-post-form textarea { width: 100%; font: inherit; padding: 0.5rem; border: 1px solid #cbd5e1; border-radius: 6px; resize: vertical; }
.btn-fb-post { align-self: flex-start; background: #1877f2; color: #fff; border: none; padding: 0.45rem 1rem; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-fb-post:hover { background: #145dbf; }
.fb-post-warn { color: #9a3412; font-size: 0.85rem; margin: 0.3rem 0; }
.fb-post-flash { padding: 0.5rem 0.7rem; border-radius: 6px; font-size: 0.9rem; }
.fb-post-flash.ok { background: #dcfce7; color: #166534; }
.fb-post-flash.err { background: #fee2e2; color: #991b1b; }

/* Shelter contact panel (Foster / Rescue / Adopt with mailto + tel). */
.shelter-contact { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.85rem 1rem; margin: 0.5rem 0 1rem; }
.shelter-contact header h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.shelter-contact header p { margin: 0 0 0.5rem; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.6rem; }
.contact-card { padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: #fafaf7; display: flex; flex-direction: column; gap: 0.3rem; }
.contact-card.foster { border-color: var(--accent); background: var(--accent-soft); }
.contact-card h3 { margin: 0 0 0.2rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.contact-card .btn { font-size: 0.85rem; padding: 0.35rem 0.6rem; text-align: center; }
@media (max-width: 680px) {
  /* Bump tap targets to ~44px so contact buttons are reliably tappable
     on touch screens (Apple HIG minimum). */
  .contact-card .btn { padding: 0.65rem 0.6rem; font-size: 0.9rem; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; gap: 0.5rem; }
}
.contact-card a:not(.btn) { font-size: 0.8rem; color: var(--accent); }
.contact-address { margin: 0.5rem 0 0; font-size: 0.85rem; }

/* Social posts links list (aggregator for FB/Insta/TikTok/etc. crossposts). */
.links { list-style: none; padding: 0; margin: 0.4rem 0 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.links li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; font-size: 0.9rem; }
.links li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links li .muted { font-size: 0.8rem; white-space: nowrap; }

/* Brand-colored chips for each social platform (icons via SimpleIcons CDN). */
.platform {
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem 0.18rem 1.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  background-color: #e5e1d5;
  color: var(--fg);
  background-repeat: no-repeat;
  background-position: 0.4rem center;
  background-size: 0.8rem 0.8rem;
}
.platform-facebook  { background-color: #dbeafe; color: #1e40af; background-image: url('https://cdn.simpleicons.org/facebook/1877F2'); }
.platform-instagram { background-color: #fce7f3; color: #be185d; background-image: url('https://cdn.simpleicons.org/instagram/E1306C'); }
.platform-nextdoor  { background-color: #d1fae5; color: #047857; background-image: url('https://cdn.simpleicons.org/nextdoor/00BC4F'); }
.platform-tiktok    { background-color: #fafafa; color: #111;     border: 1px solid #111; background-image: url('https://cdn.simpleicons.org/tiktok/000000'); }
.platform-youtube   { background-color: #fee2e2; color: var(--bad); background-image: url('https://cdn.simpleicons.org/youtube/FF0000'); }
.platform-twitter   { background-color: #e0f2fe; color: #075985; background-image: url('https://cdn.simpleicons.org/x/000000'); }
.platform-threads   { background-color: #f3f4f6; color: #111;    background-image: url('https://cdn.simpleicons.org/threads/000000'); }
.platform-reddit    { background-color: #ffe4cc; color: #c2410c; background-image: url('https://cdn.simpleicons.org/reddit/FF4500'); }
.link-del { background: transparent; color: var(--muted); border: 0; padding: 0 0.3rem; font-size: 1.1rem; cursor: pointer; }
.link-del:hover { color: var(--bad); }

/* Facebook embed list items: vertical layout (iframe on top, metadata strip
   below). The parent `.links li` uses align-items:center for one-line text
   links — embeds need stretch + column so the iframe isn't cropped. */
.links li.link-item-facebook {
  flex-direction: column;
  align-items: stretch;
  padding: 0.55rem;
  gap: 0.45rem;
}
.link-item-facebook .fb-post { width: 100%; max-width: 500px; }
.link-item-facebook .fb-post > span,
.link-item-facebook .fb-post iframe { max-width: 100% !important; }
.link-item-facebook .link-meta {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.8rem;
}

.social-posts { margin: 1rem 0 1.25rem; }
.social-posts > h2 { margin-bottom: 0.25rem; }

.link-form { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.link-form input[type=url] { flex: 2 1 320px; padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 5px; font-size: 0.9rem; }
.link-form input[type=text] { flex: 1 1 180px; padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 5px; font-size: 0.9rem; }
.link-form textarea {
  flex: 1 1 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 2.5em;
}
/* Honeypot: must be in the DOM (so bots fill it) but invisible + unreachable
   to real humans. Don't use display:none — some bots skip those. */
.link-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Share panel — pre-composed Facebook-style post text + copy/share buttons. */
.share-panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.85rem; margin: 0.5rem 0 1rem; }
.share-panel summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.share-panel textarea { width: 100%; padding: 0.6rem; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: 0.85rem; background: #fafaf7; resize: vertical; margin-top: 0.4rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.share-actions .btn, .share-actions button { font-size: 0.85rem; padding: 0.4rem 0.7rem; }

/* Profile form (/me page) styles live in profile.css. */

/* Interest forms — foster-as-primary CTA + secondary adopt/transport/daycare. */
.interest-form { display: flex; gap: 0.5rem; align-items: end; margin-top: 1rem; flex-wrap: wrap; }
.interest-form label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 0.25rem; }
.interest-form textarea { width: 100%; min-height: 60px; padding: 0.4rem; }

.interest-existing { background: var(--accent-soft); border: 1px solid #f3c8a8; padding: 0.6rem 0.85rem; border-radius: 6px; margin: 1rem 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.interest-existing p { margin: 0; }
.interest-existing .small { font-size: 0.8rem; flex-basis: 100%; }

.cta-disclaimer { background: #fff8ec; border-left: 4px solid var(--accent); padding: 0.7rem 0.9rem; border-radius: 4px; margin: 0.6rem 0 1rem; font-size: 0.88rem; line-height: 1.45; }
.cta-disclaimer strong { color: var(--accent); }

.cta-foster { background: linear-gradient(135deg, #fde7d8 0%, #fff 100%); border: 2px solid var(--accent); border-radius: 10px; padding: 1.1rem 1.2rem; margin: 0.5rem 0 1rem; }
.cta-foster h3 { margin: 0 0 0.3rem; font-size: 1.15rem; color: var(--accent); }
.cta-foster p { margin: 0.2rem 0 0.7rem; font-size: 0.92rem; }
.cta-foster label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; }
.cta-foster label em { font-style: normal; color: var(--muted); }
.cta-foster textarea { width: 100%; padding: 0.45rem; border: 1px solid var(--line); border-radius: 5px; font-family: inherit; font-size: 0.9rem; margin-top: 0.2rem; }
.cta-foster-btn { background: var(--accent); font-size: 1rem; padding: 0.6rem 1.2rem; font-weight: 600; }

.cta-other { margin: 0.5rem 0 1rem; }
.cta-other summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 0.35rem 0; }
.cta-other summary:hover { color: var(--fg); }
.cta-row { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.4rem; }
.cta-inline { display: flex; gap: 0.4rem; align-items: center; }
.cta-inline input[type=text] { flex: 1; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.85rem; }
.cta-inline button { white-space: nowrap; }

.shelter-journey { margin: 0.8rem 0 1rem; font-size: 0.85rem; }
.shelter-journey > summary {
  cursor: pointer; padding: 0.4rem 0; color: var(--muted); user-select: none;
}
.shelter-journey > summary:hover { color: var(--text); }
.journey-list {
  list-style: none; padding: 0.4rem 0 0 0.6rem; margin: 0;
  border-left: 2px solid var(--line);
}
.journey-entry {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.6rem;
  padding: 0.45rem 0.2rem 0.45rem 0.8rem;
  position: relative;
  border-bottom: 1px dashed var(--line);
}
.journey-entry:last-child { border-bottom: 0; }
.journey-entry::before {
  content: ""; position: absolute; left: -0.45rem; top: 0.7rem;
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--muted);
}
.journey-intake::before { background: #1e9f5b; }
.journey-outgoing::before { background: #b45309; }
.journey-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.journey-body strong { font-weight: 600; }
.journey-detail {
  display: block; color: var(--muted); font-size: 0.8rem;
}

.history { font-size: 0.85rem; }
.history li { padding: 0.3rem 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.history .when { color: var(--muted); }

/* Visit form ("I met this dog today") + visit log entries below. */
.visit-form { background: var(--accent-soft); border: 1px solid #f3c8a8; border-radius: 8px; padding: 1rem; margin: 0.4rem 0 1rem; }
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin-bottom: 0.6rem; }
@media (max-width: 680px) {
  /* Two-column at 390px gives ~160px per column — too tight for the
     dropdowns + a meaningful label. Stack single column on mobile. */
  .visit-grid { grid-template-columns: 1fr; }
}
.visit-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--fg); }
.visit-form label.visit-full { display: block; margin-top: 0.2rem; }
.visit-form select, .visit-form input, .visit-form textarea {
  padding: 0.35rem 0.45rem; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-family: inherit; font-size: 0.9rem;
}
.visit-form textarea { width: 100%; font-size: 0.9rem; }
.visit-form input[type=file] { padding: 0.25rem; background: #fff; }
.visit-form button { margin-top: 0.5rem; }

.visits { list-style: none; padding: 0; margin: 0.3rem 0 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.visits > li { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.85rem; }
.visit-head { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; }
.visit-video { width: 100%; max-width: 480px; border-radius: 6px; background: #000; margin-bottom: 0.4rem; }
.visit-traits { list-style: none; padding: 0; margin: 0.2rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.visit-traits li { font-size: 0.75rem; background: #f1ede3; color: var(--fg); padding: 0.15rem 0.5rem; border-radius: 999px; }
.visit-notes { font-size: 0.9rem; margin: 0.4rem 0 0; white-space: pre-wrap; }

/* Legacy "Profile notes" form — admin-style fine-tune of enrichment fields. */
.enrich-form { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem; margin: 0.5rem 0 1rem; }
.enrich-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin-bottom: 0.6rem; }
.enrich-form label { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; gap: 0.5rem; }
.enrich-form label.enrich-full { flex-direction: column; align-items: stretch; gap: 0.2rem; margin-top: 0.4rem; }
.enrich-form select, .enrich-form textarea { padding: 0.25rem 0.4rem; border: 1px solid var(--line); border-radius: 4px; }
.enrich-form textarea { width: 100%; font-family: inherit; font-size: 0.85rem; }
.enrich-form button { margin-top: 0.3rem; }

/* Admin-only inline edit cells in the facts list. Each row carries a
   small "Save" button (POST → /dogs/{id}/overrides) and, if the field
   is already locked, a sibling "release" mini-form (POST → .../release).
   Subtle yellow tint differentiates editable cells from read-only ones. */
.override-row {
  background: rgba(254, 252, 232, 0.55);
  /* When the JS-disabled fallback POSTs and the redirect lands on
     #field-<name>, the browser would otherwise stick the row right at
     the top under the sticky header. Push it down a bit. */
  scroll-margin-top: 80px;
  transition: background-color 1.2s ease, border-left-color 1.2s ease;
  border-left: 3px solid transparent;
}
/* Strong, unmissable confirmation pulse after a save/release. */
.override-row.saved-flash {
  background: rgba(134, 239, 172, 0.85);   /* brighter green */
  border-left-color: #16a34a;
}

/* "Saved ✓" badge injected by base.html's htmx:afterSwap listener.
   Pops in next to the input and fades out via the animation below. */
.saved-badge {
  display: inline-flex;
  align-items: center;
  background: #16a34a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.3rem;
  white-space: nowrap;
  animation: saved-badge-pop 1.8s ease forwards;
  pointer-events: none;
}
@keyframes saved-badge-pop {
  0%   { opacity: 0; transform: scale(0.85) translateY(2px); }
  10%  { opacity: 1; transform: scale(1)    translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: scale(0.95); }
}
.override-cell {
  display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.inline-edit { display: inline-flex; gap: 0.3rem; align-items: center; margin: 0; }
.inline-edit input {
  padding: 0.2rem 0.4rem; border: 1px solid var(--line);
  border-radius: 4px; font: inherit; min-width: 9rem;
}
.inline-edit button { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.inline-release { display: inline; margin: 0; }
.release-btn {
  background: transparent; border: 1px solid var(--line);
  border-radius: 4px; padding: 0.2rem 0.5rem; font-size: 0.75rem;
  color: var(--muted); cursor: pointer;
}
.release-btn:hover { background: var(--card); color: var(--text); }
.override-row .locked {
  font-size: 1em;
  line-height: 1;
  /* Sits at the start of the right column so the admin sees it
     adjacent to the input rather than buried in the label. */
}

/* Click-through link cards for social posts. All platforms render this
   way — inline embeds turned out to be too fragile (FB Reels broken
   since Sep 2025, IG videos blocked by music licensing). The card is
   a clear CTA that lands the visitor on the actual post, which is
   better for the shelter's social engagement anyway. */
.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  transition: background 0.15s ease, border-color 0.15s ease;
  max-width: 540px;
}
.link-card:hover { background: #f6f3ec; border-color: #d4d0c5; }
.link-card-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; align-self: start; padding-top: 0.1rem; }
.link-card-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
/* Caption: the volunteer's description of what's at the link. Preserve
   newlines so a multi-paragraph caption renders as written. */
.link-card-caption {
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
  color: var(--text);
}
.link-card-cta { font-size: 0.8rem; font-weight: 600; }
/* When no caption, center the CTA vertically with the icon — looks
   intentional rather than off-balance. */
.link-card-bare { align-items: center; }
.link-card-bare .link-card-cta { font-size: 0.95rem; }

.link-card-reactions {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #c2410c;
  background: #fff1ea;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  align-self: center;
}
/* On the bare/title-only cards the reactions pill sits on the right
   edge of the row, away from the body text. */
.link-card:not(.link-card-rich) .link-card-reactions { margin-left: auto; }

/* Rich card layout — thumbnail + multi-line message + footer row.
   Triggered when Graph API enrichment has populated fb_post_message
   (and usually fb_post_thumb_url too). Falls back to bare card when
   enrichment is missing. */
.link-card-rich { align-items: stretch; gap: 0.85rem; }
.link-card-thumb {
  flex: 0 0 96px;
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 6px;
  background: #ece6d8;
  align-self: center;
}
.link-card-rich .link-card-body {
  gap: 0.4rem;
  flex: 1; min-width: 0;
}
.link-card-message {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem; line-height: 1.4;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}
.link-card-footrow {
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  font-size: 0.8rem;
}
.link-card-rich .link-card-cta { margin-left: auto; }

@media (max-width: 480px) {
  .link-card-thumb { flex: 0 0 72px; width: 72px; height: 72px; }
  .link-card-message { font-size: 0.85rem; -webkit-line-clamp: 4; }
}

.link-fb-post-id {
  display: flex; align-items: center; gap: 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
}
.link-fb-post-id input[type=text] {
  flex: 1; min-width: 0;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: monospace;
}
.link-fb-post-id button {
  padding: 0.2rem 0.55rem; font-size: 0.75rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer;
}
.link-fb-post-id button:hover { background: #fff; }

.feature-toggle { display: inline-block; margin: 0.4rem 0 0.6rem; }
.feature-toggle button {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
}
.feature-toggle button:hover { background: #fff; }
.feature-toggle .feature-on  { background: var(--accent); color: #fff; border-color: var(--accent); }
.feature-toggle .feature-on:hover { background: #a8350a; }

/* Featured badge in detail h1 (matches the public list card pill). */
h1 .badge.featured { background: var(--accent); color: #fff; }

/* Animal ID chip — shelter staff key off this number, so we display
   it prominently right under the name. Monospace so the digits scan
   cleanly when you're reading a phone number to a kennel tech. */
.dog-id-chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  margin-right: 0.4rem;
  background: #ece6d8;
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: help;
}

.deadline-time-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin: 0.5rem 0 0.8rem;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
}
.deadline-time-form label { font-weight: 600; color: var(--fg); }
.deadline-time-form input[type=text] {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: #fff;
  font: inherit; font-size: 0.9rem; color: var(--fg);
  width: 120px;
}
.deadline-time-form input[type=text]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(194,65,12,0.18);
}
.deadline-time-form > button {
  padding: 0.4rem 0.95rem;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
}
.deadline-time-form > button:hover { background: #a8350a; border-color: #a8350a; }
.deadline-time-form .deadline-time-clear {
  background: transparent; color: var(--muted); border: 0;
  text-decoration: underline; padding: 0.35rem 0.3rem;
  font-weight: 500;
}
.deadline-time-form .deadline-time-clear:hover {
  background: transparent; color: var(--bad);
}
.deadline-time-quick {
  display: inline-flex; gap: 0.3rem;
  margin-left: 0.3rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
}
.deadline-time-form .deadline-time-preset {
  padding: 0.3rem 0.6rem;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
}
.deadline-time-form .deadline-time-preset:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
@media (max-width: 520px) {
  .deadline-time-quick {
    margin-left: 0; padding-left: 0; border-left: 0;
    width: 100%;
  }
}

/* Per-platform accents — left border + CTA color match the brand. */
.link-card-facebook  { border-left: 4px solid #1877F2; } .link-card-facebook  .link-card-cta { color: #1877F2; }
.link-card-instagram { border-left: 4px solid #E1306C; } .link-card-instagram .link-card-cta { color: #C13584; }
.link-card-tiktok    { border-left: 4px solid #000;    } .link-card-tiktok    .link-card-cta { color: #111; }
.link-card-youtube   { border-left: 4px solid #FF0000; } .link-card-youtube   .link-card-cta { color: #c00; }
.link-card-twitter   { border-left: 4px solid #1DA1F2; } .link-card-twitter   .link-card-cta { color: #1DA1F2; }
.link-card-threads   { border-left: 4px solid #000;    } .link-card-threads   .link-card-cta { color: #111; }
.link-card-nextdoor  { border-left: 4px solid #00BC4F; } .link-card-nextdoor  .link-card-cta { color: #047857; }
.link-card-reddit    { border-left: 4px solid #FF4500; } .link-card-reddit    .link-card-cta { color: #FF4500; }
.link-card-other     { border-left: 4px solid var(--muted); } .link-card-other .link-card-cta { color: var(--muted); }

/* Photo lightbox — full-screen overlay, click outside / Esc / × to
   close. Arrow keys + side buttons cycle through the gallery. */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: lightbox-fade 0.18s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.lightbox-img {
  max-width: min(95vw, 1200px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  color: #fff; font-size: 0.9rem; max-width: 600px;
  text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
/* Controls — close (top-right) and prev/next (side). All round
   translucent dark buttons with high contrast. */
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 44px; height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(0,0,0,0.8); transform: scale(1.05); }
.lightbox-close { top: 1rem; right: 1rem; font-size: 1.6rem; }
.lightbox-prev  { left: 1rem; }
.lightbox-next  { right: 1rem; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.05); }
/* Tap-friendly sizes on mobile. */
@media (max-width: 540px) {
  .lightbox-close, .lightbox-nav { width: 38px; height: 38px; font-size: 1.3rem; }
  .lightbox-prev  { left: 0.5rem; }
  .lightbox-next  { right: 0.5rem; }
}

/* ---- /shelter-snapshot page ---- */
.snapshot-summary {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 0.4rem;
}
.snapshot-stat {
  flex: 1 1 220px;
  padding: 1.1rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.snapshot-stat-n {
  font-size: 2rem; font-weight: 800; line-height: 1.1;
  color: var(--fg);
}
.snapshot-stat-label {
  font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.snapshot-card {
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 6px;
}
.snapshot-card-n {
  font-size: 1.5rem; font-weight: 700; line-height: 1;
  color: var(--fg);
}
.snapshot-card-label {
  font-size: 0.82rem; color: var(--muted);
  margin-top: 0.25rem;
}

/* Kind-based accent colors — each bucket category gets a left-border
   tint so the grid scans visually as related groups. */
.snapshot-kind-kennel     { border-left-color: var(--good); }
.snapshot-kind-foster     { border-left-color: #16a34a; }
.snapshot-kind-vet_care   { border-left-color: #2563eb; }
.snapshot-kind-quarantine { border-left-color: #ef4444; }
.snapshot-kind-hold       { border-left-color: #a855f7; }
.snapshot-kind-transit    { border-left-color: var(--accent); }
.snapshot-kind-assessment { border-left-color: #f59e0b; }
.snapshot-kind-other      { border-left-color: var(--muted); }

.snapshot-help summary {
  cursor: pointer; color: var(--accent);
  font-weight: 600; font-size: 0.9rem;
}
.snapshot-help summary:hover { color: #a8350a; }
.snapshot-help p { margin: 0.4rem 0; }
