/* ============================================================================
   ScanTags app stylesheet — brand-matched to the marketing site (navy/teal)
   ========================================================================== */
:root {
  --navy:        #0B1628;
  --navy-soft:   #16243c;
  --teal:        #0A7A62;   /* primary CTA fill — darkened so white text passes WCAG AA (was #00B894, 2.5:1) */
  --teal-bright: #00B894;   /* decorative accents / dots / focus rings only (not text/CTAs) */
  --teal-dim:    #0A7A62;   /* text + links on white — 5.3:1 (was #009E80, 3.4:1) */
  --white:       #FFFFFF;
  --off-white:   #F6F8F8;
  --grey-100:    #EEF1F0;
  --grey-200:    #D9DEDC;
  --grey-400:    #8B9896;
  --grey-600:    #4A5654;
  --danger:      #e74c3c;
  --amber:       #E8840A;
  --text:        #0B1628;
  --text-soft:   #4A5654;
  --muted:       #6B7775;   /* 4.65:1 on white (was #8B9896, 2.99:1) */

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  /* flatter, more premium shadows */
  --shadow-sm: 0 1px 2px rgba(11,22,40,0.05), 0 1px 1px rgba(11,22,40,0.04);
  --shadow-md: 0 4px 14px rgba(11,22,40,0.07);
  --shadow-lg: 0 12px 30px rgba(11,22,40,0.10);

  /* One clean humanist sans (Syne dropped — read too "design studio"). DM Sans
     for both display + body; system stack as the zero-load fallback. */
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--text); background: var(--off-white); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--teal-dim); text-decoration: none; }
a:hover { text-decoration: underline; }
img, canvas { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; }
h1 { font-size: clamp(1.55rem, 3.6vw, 2.05rem); font-weight: 800; }
h2 { font-size: 1.35rem; margin-bottom: .5rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.req { color: var(--danger); }
fieldset { border: none; }
code { background: var(--grey-100); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .7em 1.3em; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 20px rgba(0,184,148,.28); }
.btn-primary:hover { background: var(--teal-dim); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--grey-200); }
.btn-ghost:hover { background: var(--grey-100); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(231,76,60,.4); }
.btn-danger:hover { background: rgba(231,76,60,.08); }
.btn-lg { padding: .85em 1.7em; font-size: 1.05rem; }
.btn-sm { padding: .5em .9em; font-size: .85rem; }
.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ============================================================================
   APP CHROME (auth / dashboard / admin)
   ========================================================================== */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
  background: #fff; border-bottom: 1px solid var(--grey-100); box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
  /* The bar itself stays full-bleed so the background and bottom border run
     edge to edge, but its CONTENTS are boxed to the same 1080px column as
     .app-main below — otherwise the logo and the log-out button hang outside
     the content box on wide screens. Padding does the boxing so no wrapper
     element is needed in the markup. */
  padding-inline: calc(max(0px, (100% - 1080px) / 2) + clamp(20px, 4vw, 40px));
}
.app-dark .app-nav { background: var(--navy); border-bottom-color: rgba(255,255,255,.08); }
.app-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.app-dark .app-logo { color: #fff; }
.app-logo:hover { text-decoration: none; }
.app-logo .dot, .pv-brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal-bright); display: inline-block; box-shadow: 0 0 0 4px rgba(0,184,148,.18); }
.app-nav-links { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.app-nav-links a { color: var(--navy); font-weight: 500; }
.app-dark .app-nav-links a { color: rgba(255,255,255,.85); }
.app-nav-user { color: var(--muted); font-size: .9rem; }
.app-dark .app-nav-user { color: rgba(255,255,255,.5); }
.app-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 40px); }
.app-foot { text-align: center; padding: 28px; color: var(--muted); font-size: .9rem; display: flex; gap: 10px; justify-content: center; }

/* ---- Cards & forms ------------------------------------------------------- */
.card { background: #fff; border: 1px solid var(--grey-100); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.stack label, .inline-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; color: var(--navy); }
input, textarea, select {
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  padding: .7em .85em; border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm);
  background: #fff; width: 100%; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,184,148,.15); }
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.form-actions.center { justify-content: center; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.inline-form input { flex: 1; min-width: 200px; }

/* ---- Flash messages ------------------------------------------------------ */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .95rem; border: 1px solid transparent; }
.flash-success { background: rgba(0,184,148,.10); color: #0a6b56; border-color: rgba(0,184,148,.3); }
.flash-error   { background: rgba(231,76,60,.08); color: #a82a1d; border-color: rgba(231,76,60,.3); }
.flash-warn    { background: rgba(232,132,10,.10); color: #8a4d04; border-color: rgba(232,132,10,.3); }

/* ---- Dashboard ----------------------------------------------------------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { margin-bottom: 4px; }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.tag-card { background: #fff; border: 1px solid var(--grey-100); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.tag-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
/* Header: only the type + status live here (consistent across every card); the
   colour is the sole per-type difference. Nickname/code/stats move to the body. */
.tag-card-top { color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tag-type { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: .98rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-type .tag-emoji { font-size: 1.25rem; flex: 0 0 auto; }
.tag-status { flex: 0 0 auto; background: rgba(255,255,255,.24); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
/* Item name: full width under the colour bar, so long names have room to breathe. */
.tag-card-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--navy); padding: 14px 16px 0; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
/* QR (left, slightly bigger) + reference/scans/claim/messages (right). */
.tag-card-body { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px 16px; }
.tag-qr { width: 100px; height: 100px; flex: 0 0 100px; border: 1px solid var(--grey-100); border-radius: 10px; }
.tag-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; padding-top: 0; }
.tag-info-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: var(--grey-100); color: var(--text-soft); padding: 2px 8px; border-radius: 6px; letter-spacing: .5px; }
.tag-stat { font-size: .95rem; color: var(--text-soft); }
.tag-stat strong { font-size: 1.05rem; color: var(--navy); font-weight: 700; }
.tag-claimed { font-size: .82rem; color: var(--muted); }
/* Actions: full-width "View public page", then a 2x2 grid of the other four. */
.tag-card-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px; }
.tag-btn-full { width: 100%; justify-content: center; }
.tag-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tag-btn-grid > .btn { width: 100%; justify-content: center; }
.tag-btn-grid > form { display: block; margin: 0; }
.tag-btn-grid > form > .btn { width: 100%; justify-content: center; }

/* ---- Claim type picker --------------------------------------------------- */
.type-picker { display: grid; gap: 12px; margin: 6px 0; }
.type-picker legend { font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.type-option { cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-chip { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  border: 1.5px solid var(--grey-200); border-radius: var(--radius); padding: 14px 16px; transition: border-color .2s, background .2s, box-shadow .2s; }
.type-chip .type-emoji { grid-row: 1 / 3; font-size: 1.8rem; }
.type-name { font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.type-blurb { color: var(--muted); font-size: .88rem; }
.type-option input:checked + .type-chip { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }

/* ---- Edit page ----------------------------------------------------------- */
.edit-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.edit-main, .edit-side { min-width: 0; }   /* let grid columns shrink instead of overflowing on mobile */
.edit-side .card { position: sticky; top: 90px; }
.preview-frame { width: 100%; height: 420px; border: 1px solid var(--grey-100); border-radius: var(--radius); margin: 10px 0; background: #fff; }
@media (max-width: 860px) { .edit-wrap { grid-template-columns: 1fr; } .edit-side .card { position: static; } .preview-frame { height: 360px; } }

/* ---- QR page ------------------------------------------------------------- */
.qr-stage { display: flex; justify-content: center; margin: 22px 0 10px; }
#qrBig { width: 280px; height: 280px; border: 1px solid var(--grey-100); border-radius: var(--radius); padding: 10px; background: #fff; }
.qr-url { word-break: break-all; }

/* ---- Admin --------------------------------------------------------------- */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--grey-100); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-n { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--teal-dim); }
.stat-l { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.type-bars { display: grid; gap: 12px; margin-top: 12px; }
.type-bar-row { display: grid; grid-template-columns: 170px 1fr 32px; align-items: center; gap: 12px; }
.type-bar-track { background: var(--grey-100); border-radius: 999px; height: 12px; overflow: hidden; }
.type-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.type-bar-n { text-align: right; font-weight: 600; }

.table-card { padding: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--grey-100); font-size: .92rem; }
.data-table th { background: var(--off-white); font-family: var(--font-display); font-weight: 600; color: var(--navy); }
.data-table tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill-on { background: rgba(0,184,148,.12); color: #0a6b56; }
.pill-off { background: var(--grey-100); color: var(--grey-600); }
.row-actions details { position: relative; }
.row-actions summary { list-style: none; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-menu { position: absolute; right: 0; z-index: 10; background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.install-log { margin: 14px 0; padding-left: 20px; color: var(--text-soft); font-size: .9rem; }
.install-log li { margin: 3px 0; }

/* ============================================================================
   PUBLIC SCAN PAGE
   ========================================================================== */
/* Solid, readable ground — a soft cool grey so the white cards separate clearly
   (no navy/off-white gradient, which hid white footer text on long pages). */
.public { background: #e9edee; min-height: 100vh; }
.pv-wrap { max-width: 460px; margin: 0 auto; padding: 20px 16px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.pv-brand { color: var(--navy); font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 9px; margin-bottom: 16px; letter-spacing: -.01em; }
.pv-card { background: #fff; border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(11,22,40,.05), 0 8px 24px rgba(11,22,40,.07); overflow: hidden; }
/* One consistent gap above every stacked block (identity, details, contact, conversation) */
.pv-wrap > .pv-card, .pv-wrap > .pv-contact { margin-top: 16px; }
.pv-head { color: #fff; padding: 22px 24px; display: flex; align-items: center; gap: 12px; }
.pv-emoji { font-size: 2rem; }
.pv-type { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.pv-body { padding: 8px 24px 20px; }
.pv-body.center { padding: 32px 24px; }
.pv-body.center h1 { font-size: 1.4rem; margin-bottom: 10px; }
.pv-body.center .btn { margin: 14px 0 6px; }
.pv-row { padding: 14px 0; border-bottom: 1px solid var(--grey-100); }
.pv-row:last-child { border-bottom: none; }
.pv-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.pv-val { font-size: 1.12rem; color: var(--navy); font-weight: 500; }
.pv-action { font-weight: 700; color: var(--teal-dim); }
a.pv-action[href^="tel:"]::before { content: "📞 "; }
a.pv-action[href^="mailto:"]::before { content: "✉️ "; }
.pv-updated { background: var(--off-white); padding: 12px 24px; font-size: .8rem; color: var(--muted); text-align: center; border-top: 1px solid var(--grey-100); }
/* Footer under the cards — dark, readable, well-spaced */
.pv-help-foot { text-align: center; margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.pv-help-foot p { color: var(--text-soft); font-size: .9rem; margin: 0; line-height: 1.5; }
.pv-report-link { color: var(--muted); font-size: .82rem; text-decoration: underline; }
.pv-report-link:hover { color: var(--text-soft); }
.pv-foot { margin-top: auto; padding-top: 22px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---- Public: photo, temperament, banners, contact + location ------ */
.pv-photo { padding: 20px 24px 18px; text-align: center; }
.pv-photo img { width: 100%; max-width: 320px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); margin: 0 auto; box-shadow: var(--shadow-sm); display: block; }
.pv-temperament { text-align: center; color: var(--muted); padding: 0 24px 18px; font-size: .95rem; }
.pv-temperament strong { color: var(--type-colour); }
.pv-banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.pv-banner-ok { background: rgba(0,184,148,.15); color: #06584a; }
.pv-banner-warn { background: rgba(232,132,10,.15); color: #7a4404; }

.pv-contact { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 20px 22px; margin-top: 16px; }
.pv-contact-title { font-size: 1.1rem; margin-bottom: 14px; }
.pv-contact-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-contact { width: 100%; padding: .9em 1.2em; font-size: 1rem; background: var(--navy); color: #fff; }
.btn-contact:hover { background: var(--navy-soft); }
.btn-wa { background: #25D366; color: #06351b; }
.btn-wa:hover { background: #1eb957; }
.btn-loc { background: #fff; color: var(--navy); border-color: var(--grey-200); }
.btn-loc:hover { background: var(--grey-100); }
.pv-loc-status { margin-top: 12px; font-size: .9rem; background: rgba(0,184,148,.1); color: #06584a; padding: 10px 12px; border-radius: var(--radius-sm); }
.pv-loc-status.is-error { background: rgba(232,132,10,.12); color: #7a4404; }
.pv-found-form { margin-top: 16px; border-top: 1px solid var(--grey-100); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.pv-found-note { font-size: .82rem; color: #0a5c48; background: rgba(0,184,148,.10); border-radius: var(--radius-sm); padding: 8px 11px; margin: 2px 0 0; line-height: 1.5; }
.pv-loc-check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; color: var(--navy); font-weight: 500; cursor: pointer; margin: 4px 0 2px; line-height: 1.4; }
.pv-loc-check input { width: auto; margin: 2px 0 0; flex: 0 0 auto; }
.pv-loc-check .muted { color: var(--muted); font-weight: 400; }
.pv-found-row { display: flex; gap: 10px; }
.pv-found-row input { flex: 1; min-width: 0; }
@media (max-width: 420px) { .pv-found-row { flex-direction: column; } }

/* ---- Owner: contact settings + sightings -------------------------------- */
.contact-settings { border: 1.5px dashed var(--grey-200); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.contact-settings legend { font-family: var(--font-display); font-weight: 700; color: var(--navy); padding: 0 6px; }
.field-note { display: block; font-weight: 400; font-size: .82rem; color: #8a4d04; background: rgba(232,132,10,.1); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 6px; }
.info-callout { background: rgba(232,132,10,.07); border: 1px solid rgba(232,132,10,.25); border-left: 4px solid var(--amber); border-radius: var(--radius-sm); padding: 20px 22px; margin: 12px 0 22px; }
.info-callout strong { display: block; color: var(--navy); font-size: 1rem; margin-bottom: 12px; }
.info-callout p { margin: 14px 0 0; font-size: .9rem; color: var(--text-soft); line-height: 1.7; }
.info-callout p:first-of-type { margin-top: 0; }

/* field label + required asterisk on one line — the label wraps every direct
   child (incl. the input) as its own flex row, so the caption text and the
   asterisk must live inside ONE span, or the flex-column layout splits them
   onto separate lines. */
.field-label-text { display: inline-block; }

/* airport combobox (replaces native <datalist> — unstyleable + unreliable on mobile) */
.airport-combo { position: relative; display: block; }
.airport-combo input { width: 100%; }
.airport-combo-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto; }
.airport-combo-list[hidden] { display: none; }
.airport-combo-list li { padding: 10px 12px; border-radius: 8px; font-size: .92rem; cursor: pointer; }
.airport-combo-list li:hover, .airport-combo-list li:active { background: var(--off-white); }

.airport-mirror-btn { margin: -8px 0 4px; align-self: flex-start; }
.lost-mode { border: 1.5px solid var(--grey-200); border-radius: var(--radius); padding: 14px 16px; transition: border-color .2s, background .2s; }
.lost-mode.is-on { border-color: var(--danger); background: rgba(231,76,60,.06); }
.lost-toggle { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 500; cursor: pointer; }
.lost-toggle input { width: auto; margin-top: 3px; }
.lost-toggle .muted { display: block; margin-top: 3px; }
.lost-pill { background: rgba(231,76,60,.9); color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .3px; }
.code-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.code-row { display: flex; align-items: center; gap: 10px; font-size: .92rem; flex-wrap: wrap; }
.code-tag { font-family: var(--font-display); font-weight: 700; color: var(--navy); min-width: 90px; }
.code-row code { background: var(--grey-100); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
.transfer-offer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--teal); }
.transfer-actions { display: flex; gap: 8px; }
.transfer-actions form { display: inline; }
.photo-field { display: flex; gap: 18px; align-items: flex-start; padding: 4px 0; }
.photo-preview { flex: 0 0 96px; width: 96px; height: 96px; border-radius: var(--radius); overflow: hidden; background: var(--grey-100); display: flex; align-items: center; justify-content: center; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { font-size: 2.4rem; opacity: .5; }
.photo-controls { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.photo-label { font-weight: 600; font-size: .92rem; color: var(--navy); display: flex; flex-direction: column; gap: 6px; }
.push-status { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--grey-100); color: var(--text-soft); font-size: .92rem; margin: 6px 0; }
.push-status.is-ok { background: rgba(0,184,148,.12); color: #06584a; }
.push-status.is-warn { background: rgba(232,132,10,.12); color: #7a4404; }
.sighting-badge { display: inline-block; background: rgba(232,132,10,.14); color: #8a4d04; font-weight: 600; font-size: .82rem; padding: 2px 10px; border-radius: 999px; margin-top: 4px; }
.sighting-badge:hover { text-decoration: none; background: rgba(232,132,10,.22); }
.report-list { display: flex; flex-direction: column; gap: 14px; }
.report-item { margin-bottom: 0; }
.report-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.report-when { color: var(--muted); font-size: .85rem; }
.report-msg { font-size: 1.05rem; color: var(--navy); margin-bottom: 10px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--text-soft); font-size: .92rem; }


/* ============================================================================
   APP SHELL — bottom tab bar (mobile) + notification onboarding
   ========================================================================== */
.app-tabbar {
  display: none; /* shown on mobile only */
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--grey-100);
  box-shadow: 0 -2px 12px rgba(11,22,40,0.06);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.app-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--grey-400); font-size: .68rem; font-weight: 600; text-decoration: none; letter-spacing: .01em; }
.app-tab:hover { text-decoration: none; color: var(--grey-600); }
.app-tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-tab.is-active { color: var(--teal-dim); background: none; border: 0; }

@media (max-width: 859px) {
  .app-nav-links { display: none; }          /* primary nav lives in the bottom bar */
  body.has-tabs .app-main { padding-bottom: 88px; }
  body.has-tabs .app-tabbar { display: flex; }
}

/* Notification onboarding card */
.push-onboard { border: 1.5px solid var(--teal); background: color-mix(in srgb, var(--teal) 7%, white); display: flex; align-items: flex-start; gap: 16px; }
.push-onboard .po-icon { font-size: 1.8rem; line-height: 1; }
.push-onboard .po-body { flex: 1; }
.push-onboard h2 { margin: 0 0 4px; }
.push-onboard .po-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.push-onboard .po-dismiss { background: none; border: none; color: var(--muted); font-size: .9rem; cursor: pointer; }

/* ============================================================================
   PUBLIC SCAN PAGE — finder-first additions (lost banner, name, contact-first,
   sticky call bar, emergency note, semantic dl, tap targets)
   ========================================================================== */
/* Primary name shown prominently in the identity card */
.pv-name { text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--navy); padding: 18px 24px 12px; letter-spacing: -0.02em; }
.pv-photo + .pv-name { padding-top: 2px; }   /* tighter when it sits right under the photo */

/* Lost-mode alert banner — impossible to miss for a finder */
.pv-lost { display: flex; align-items: flex-start; gap: 12px; background: #b3261e; color: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(179,38,30,.35); line-height: 1.45; font-size: .96rem; }
.pv-lost .pv-lost-emoji { font-size: 1.4rem; line-height: 1; }
.pv-lost strong { display: block; font-size: 1.02rem; margin-bottom: 2px; }

/* Demo-page label. Deliberately NOT alarm-red like .pv-lost — this is an explanation, not an
   emergency — but high-contrast and above the identity card so it is read before the name. */
.pv-demo { background: #FFF4D6; color: #4A3A05; border: 1px solid #E8CE84; border-left: 4px solid #C9971B; border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 14px; font-size: .9rem; line-height: 1.5; }
.pv-demo strong { color: #3B2E04; }

/* Semantic definition list for the detail rows (dd default margin removed) */
dl.pv-body { margin: 0; }
.pv-body dt, .pv-body dd { margin: 0; }

/* Emergency disclaimer on medical/child pages + report-abuse link */
.pv-emergency { text-align: center; color: var(--text-soft); background: var(--off-white); border: 1px solid var(--grey-100); border-radius: var(--radius-sm); font-size: .84rem; margin-top: 14px; padding: 10px 14px; line-height: 1.5; }
.pv-report { text-align: center; margin-top: 12px; font-size: .82rem; }
.pv-report a { color: var(--muted); text-decoration: underline; }
.pv-report a:hover { color: var(--text-soft); }

/* (The old sticky call bar was removed — the contact card holds the actions.) */
.pv-callbar { display: none; }

/* WCAG tap-target minimum on mobile: small buttons grow to 44px */
@media (max-width: 859px) {
  .btn-sm { min-height: 44px; padding-top: .55em; padding-bottom: .55em; }
}

/* Danger zone on the edit page (Release lives here, away from safe actions) */
.danger-zone { border: 1.5px solid rgba(231,76,60,.35); border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; }
.danger-zone h3 { color: var(--danger); margin-bottom: 6px; }

/* Edit-page section heading */
.edit-section-h { font-size: 1.1rem; margin: 8px 0 2px; padding-top: 8px; border-top: 1px solid var(--grey-100); color: var(--navy); }

/* Two-way conversation (public scan page + dashboard) */
.pv-convo { padding: 20px 22px; margin-top: 16px; }
.pv-convo-title { font-size: 1.1rem; margin-bottom: 12px; }
.chat-thread { display: flex; flex-direction: column; gap: 10px; }
.chat-row { display: flex; }
.chat-row.chat-theirs { justify-content: flex-start; }
.chat-row.chat-mine { justify-content: flex-end; }
.chat-bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 1rem; line-height: 1.45; }
.chat-theirs .chat-bubble { background: var(--grey-100); color: var(--navy); border-bottom-left-radius: 5px; }
.chat-mine .chat-bubble { background: var(--teal); color: #fff; border-bottom-right-radius: 5px; }
.chat-meta { font-size: .72rem; opacity: .75; margin-top: 5px; }
.chat-mine .chat-meta a { color: #fff; text-decoration: underline; }

/* Item status pills on the dashboard card */
.status-pill { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .3px; }
.status-found { background: #0A7A62; color: #fff; }
.status-returned { background: rgba(255,255,255,.35); color: #fff; }

/* Per-field visibility selector (edit page) */
/* Compact per-field editor row: label + a small visibility control side by side,
   instead of a repeated full-width "Finders see this:" block under every field. */
.field-block { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-block .field-label-text { display: inline; font-weight: 600; font-size: .92rem; color: var(--navy); }
.field-vis-select { width: auto; flex: 0 0 auto; max-width: 48%; padding: 5px 10px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--off-white); border: 1.5px solid var(--grey-200); border-radius: 999px; }
.field-vis-select.is-restricted { color: #8a4d04; background: rgba(232,132,10,.08); border-color: rgba(232,132,10,.5); }
#returnTripFill { align-self: flex-start; margin: 2px 0 10px; white-space: normal; text-align: left; height: auto; line-height: 1.35; }

/* Collapsible info note (replaces the big always-open luggage callout) */
.info-note { border: 1px solid var(--grey-200); border-left: 3px solid var(--amber); border-radius: var(--radius-sm); background: rgba(232,132,10,.05); margin: 8px 0 14px; }
.info-note > summary { cursor: pointer; padding: 12px 15px; font-weight: 600; font-size: .9rem; color: var(--navy); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.info-note > summary::-webkit-details-marker { display: none; }
.info-note > summary::after { content: "▸"; color: var(--amber); font-weight: 700; }
.info-note[open] > summary::after { content: "▾"; }
.info-note-body { padding: 0 15px 13px; }
.info-note-body p { margin: 0 0 8px; font-size: .88rem; color: var(--text-soft); line-height: 1.5; }
.info-note-body p:last-child { margin-bottom: 0; }

/* Reward line inside the lost banner */
.pv-reward { margin-top: 8px; font-weight: 700; background: rgba(255,255,255,.18); border-radius: 8px; padding: 6px 10px; display: inline-block; }

/* Post-claim onboarding checklist */
.onboard-card { border: 1.5px solid var(--teal); background: color-mix(in srgb, var(--teal) 6%, white); }
.onboard-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.onboard-steps li { display: flex; align-items: center; gap: 12px; font-size: .95rem; }
.onboard-tick { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 700; background: var(--grey-100); color: var(--muted); }
.onboard-tick.is-done { background: var(--teal); color: #fff; }

/* Visually hidden, still read by screen readers. Used to label the finder form
   inputs, which previously relied on placeholders alone — those aren't reliably
   announced and disappear as soon as you start typing. The person who finds a
   lost pet or a fallen stranger may be blind or low-vision themselves. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
