/* ============================================================================
   SANKOFA — design system  ·  CALM edition
   Quiet, dignified, investigative. Warm green-black surfaces, muted gold,
   clean system type, thin rules, no glows. (Recent-map styling.)
   ============================================================================ */

:root {
  /* Surfaces (warm near-black with a green cast) */
  --bg:        #0f1310;
  --surface-1: #161b17;
  --surface-2: #1c221d;
  --surface-3: #232b24;
  --border:    #2a322b;
  --border-lo: #222a23;

  /* Text */
  --text:      #e9ede8;
  --text-mid:  #b7c0b8;
  --text-dim:  #8b968c;

  /* Muted, meaning-carrying accents */
  --gold:   #c9a227;   /* highlight / verification / archive */
  --green:  #4ea36b;   /* verified / resolved */
  --red:    #d06b5c;   /* urgent / missing / violence */
  --crimson:#c05a4a;   /* police / custody / jail */
  --purple: #a06bc0;   /* unresolved / suspicious */
  --blue:   #6f9fd8;   /* discrimination */
  --teal:   #3fa89a;   /* exoneration */
  --orange: #d0913f;   /* judicial */
  --rose:   #c76b9a;   /* policing */

  /* Flat fills (no loud gradients) */
  --grad-gold:  #c9a227;
  --grad-tri:   linear-gradient(90deg, #d06b5c 0%, #c9a227 50%, #4ea36b 100%);
  --grad-warm:  #c9a227;
  --grad-earth: #4ea36b;
  --glow-gold:  none;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 38px rgba(0,0,0,.5);
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- App shell ----------------------------------------------------------- */
.app { display: flex; flex-direction: column; height: 100vh; }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 18px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  z-index: 800; position: relative;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold); border: 1px solid #a9871a;
  display: grid; place-items: center;
}
.brand .mark span { font-weight: 800; color: #1a1600; font-size: 22px; }
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.brand .sub { font-size: 10.5px; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }

.searchwrap { flex: 1; max-width: 640px; position: relative; }
.searchwrap input {
  width: 100%; padding: 12px 14px 12px 42px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.searchwrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.14); }
.searchwrap .ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.searchwrap input::placeholder { color: var(--text-dim); }

.topbar-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.btn {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--gold); }
.btn-primary { background: var(--gold); color: #1a1600; border-color: #a9871a; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.06); }

/* ---- Demo banner --------------------------------------------------------- */
.demo-banner {
  background: #12160f;
  border-bottom: 1px solid var(--border); color: var(--text-mid);
  font-size: 12px; text-align: center; padding: 7px 14px; letter-spacing: .01em;
}
.demo-banner strong { color: var(--gold); }

/* ---- Body: sidebar + map + detail --------------------------------------- */
.body { flex: 1; display: flex; min-height: 0; position: relative; }

/* Sidebar (filters) */
.sidebar {
  width: 320px; flex-shrink: 0; background: var(--surface-1);
  border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 14px 40px;
}
.sidebar::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }

.panel-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim);
  margin: 18px 4px 10px; display: flex; align-items: center; justify-content: space-between;
}
.panel-title:first-child { margin-top: 4px; }

/* Color-coded, icon-led group headers (hierarchy) */
.group-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--gc); margin: 16px 2px 7px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border-lo);
}
.group-head .gh-ico {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--gc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 45%, transparent);
}
.group-head .gh-ico svg { width: 12px; height: 12px; color: var(--gc); }

/* Category rows: persistent color-coded left edge + checked state */
.filter-group .chk { border-left: 3px solid transparent; padding-left: 7px; }
.filter-group .chk:hover { border-left-color: var(--rc, var(--border)); }
.filter-group .chk:has(input:checked) { background: var(--surface-2); border-left-color: var(--rc, var(--gold)); }
.filter-group .chk:has(input:checked) .lbl { color: var(--text); font-weight: 500; }
.filter-group .chk:has(input:checked) .cnt { color: var(--rc, var(--gold)); font-weight: 600; }

/* Tone dots for status / flags */
.sdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; padding: 8px; border: none; background: transparent; color: var(--text-dim);
  border-radius: 999px; font-size: 12.5px; font-weight: 500; transition: all .15s;
}
.seg button.on { background: var(--surface-3); color: var(--text); }

.filter-group { display: flex; flex-direction: column; gap: 2px; }
.chk {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s; user-select: none;
}
.chk:hover { background: var(--surface-2); }
.chk input { accent-color: var(--gold); width: 15px; height: 15px; flex-shrink: 0; }
.chk .glyph { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.chk .glyph svg { width: 13px; height: 13px; }
.chk .lbl { font-size: 13px; color: var(--text-mid); flex: 1; }
.chk .cnt { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.select-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.field label { font-size: 11px; color: var(--text-dim); letter-spacing: .04em; }
.field select, .field input {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; outline: none; width: 100%;
}
.field select:focus, .field input:focus { border-color: var(--gold); }

.reset { width: 100%; margin-top: 6px; }

/* ---- Map ----------------------------------------------------------------- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #0b0e0c; }
.leaflet-container { background: #0b0e0c; font-family: var(--sans); }

/* Cluster bubbles — calm dark + muted gold ring */
.marker-cluster { background: transparent; }
.marker-cluster div {
  background: #1a1f1b;
  color: var(--gold); font-family: var(--sans); font-weight: 700; font-size: 12px;
  border: 2px solid var(--gold);
  box-shadow: 0 3px 8px rgba(0,0,0,.5);
}
.marker-cluster span { line-height: 30px; }

/* Custom pin markers (icon-based) */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), 0 3px 8px rgba(0,0,0,.5);
  display: grid; place-items: center;
}
.pin svg { transform: rotate(45deg); width: 15px; height: 15px; color: #fff; }
.pin.urgent-ring { animation: pulse 2.4s infinite; }
.pin.community-ring { box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0,0,0,.5); }
@keyframes pulse { 0%,100% { box-shadow: 0 3px 8px rgba(0,0,0,.5), 0 0 0 0 rgba(208,107,92,.5); } 50% { box-shadow: 0 3px 8px rgba(0,0,0,.5), 0 0 0 7px rgba(208,107,92,0); } }

.leaflet-popup-content-wrapper { background: var(--surface-2); color: var(--text); border-radius: 10px; border: 1px solid var(--border); }
.leaflet-popup-tip { background: var(--surface-2); border: 1px solid var(--border); }
.mini-pop { font-size: 13px; min-width: 160px; }
.mini-pop b { display: block; margin-bottom: 3px; }
.mini-pop .m { color: var(--text-dim); font-size: 12px; }
.mini-pop button { margin-top: 8px; width: 100%; padding: 7px; background: var(--gold); color: #1a1600; border: none; border-radius: 6px; font-weight: 600; font-size: 12px; }

/* Floating map controls */
.map-float { position: absolute; z-index: 600; }
.legend { right: 14px; bottom: 14px; background: rgba(22,27,23,.95); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; max-width: 220px; backdrop-filter: blur(6px); }
.legend h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 8px; }
.legend .row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-mid); margin: 4px 0; }
.legend .dot { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; flex-shrink: 0; }
.legend .dot svg { width: 10px; height: 10px; color: #fff; }

.count-pill { left: 14px; top: 14px; background: rgba(22,27,23,.96); border: 1px solid var(--border); border-top: 2px solid var(--gold); border-radius: 999px; padding: 8px 15px; font-size: 13px; color: var(--text-mid); backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.count-pill b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* Floating-panel pops */
.patterns { border-top: 2px solid var(--crimson); }
.patterns h4 { color: var(--rose); }
.patterns .inst .n { background: var(--crimson); color: #fff; }
.legend { border-top: 2px solid var(--green); }
.legend h4 { color: var(--gold); }

/* Patterns / institution tracking panel */
.patterns { left: 14px; top: 56px; width: 250px; background: rgba(22,27,23,.95); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; backdrop-filter: blur(6px); }
.patterns h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.patterns .hint { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.patterns .inst { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 5px 0; border-top: 1px solid var(--border-lo); color: var(--text-mid); }
.patterns .inst .n { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.patterns .empty { font-size: 12px; color: var(--text-dim); }
#inst-list { max-height: 240px; overflow-y: auto; }
#inst-list::-webkit-scrollbar { width: 7px; }
#inst-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }

/* ---- Fact ticker (calm) -------------------------------------------------- */
.ticker {
  flex-shrink: 0; height: 42px; display: flex; align-items: stretch; position: relative; z-index: 650;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
}
.ticker-tag {
  flex-shrink: 0; display: flex; align-items: center; gap: 9px; padding: 0 18px;
  font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--gold); text-transform: uppercase;
  background: #12160f;
  border-right: 1px solid var(--border); white-space: nowrap;
}
.ticker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.ticker-viewport {
  flex: 1; overflow: hidden; display: flex; align-items: center; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.ticker-track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform; animation: ticker-scroll linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-fact { font-size: 13px; color: var(--text-mid); padding: 0 2px; }
.tk-src { color: var(--gold); font-style: normal; font-size: 11px; opacity: .8; }
.tk-sep { color: var(--gold); opacity: .45; padding: 0 20px; font-size: 9px; }
@media (max-width: 860px) { .ticker-tag { font-size: 10px; padding: 0 12px; letter-spacing: .1em; } .tk-fact { font-size: 12px; } }

/* ---- Detail panel (case card / city profile) ---------------------------- */
.detail {
  position: absolute; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw;
  background: var(--surface-1); border-left: 1px solid var(--border);
  transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
  z-index: 700; overflow-y: auto; box-shadow: var(--shadow);
}
.detail.open { transform: translateX(0); }
.detail::-webkit-scrollbar { width: 9px; }
.detail::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }

.detail-head { position: relative; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.detail-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-mid); }
.detail-close:hover { background: var(--surface-3); }

.case-id { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.case-person { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.avatar { width: 62px; height: 62px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.avatar svg { width: 34px; height: 34px; color: var(--text-dim); }
.case-person h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.case-person .meta { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.badge { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-mid); display: inline-flex; align-items: center; gap: 5px; }
.badge.cat { color: #fff; border: none; }
.badge.status-verified { border-color: var(--green); color: #8fd8ab; }
.badge.status-resolved { border-color: var(--green); color: #8fd8ab; background: rgba(78,163,107,.12); }
.badge.status-neutral { border-color: var(--border); color: var(--text-mid); }
.badge.flag { border-color: var(--gold); color: var(--gold); }

.detail-body { padding: 18px 20px 40px; }
.section { margin-bottom: 20px; }
.section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-dim); margin-bottom: 10px; }
.summary { font-size: 14px; line-height: 1.55; color: var(--text); }

.kv { display: grid; grid-template-columns: 116px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-dim); }
.kv dd { color: var(--text); }

/* Evidence bar */
.evidence-list { display: flex; flex-direction: column; gap: 6px; }
.ev { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-mid); }
.ev .tier { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.ev .tier.hi { background: var(--green); } .ev .tier.mid { background: var(--gold); } .ev .tier.lo { background: var(--text-dim); }
.cred-meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 10px; }
.cred-meter > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--green)); }
.cred-label { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }

.sources a { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; color: var(--text-mid); }
.sources a:hover { border-color: var(--gold); text-decoration: none; color: var(--text); }

.detail-actions { display: flex; gap: 8px; margin-top: 8px; }
.detail-actions .btn { flex: 1; text-align: center; justify-content: center; }

.verified-stamp { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; display: flex; align-items: center; gap: 6px; }

/* Missing-child urgent styling */
.urgent-head { border-left: 3px solid var(--red); background: linear-gradient(90deg, rgba(208,107,92,.10), transparent); }
.amber-note { font-size: 12px; color: #ecc7bf; background: rgba(208,107,92,.10); border: 1px solid #3f302c; border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }

/* ---- Modal (submission) -------------------------------------------------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(6,9,7,.72); backdrop-filter: blur(3px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-scrim.open { display: flex; }
.modal { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--border); position: relative; }
.modal-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.modal-head p { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.modal-body { padding: 18px 22px 22px; }
.modal-body .field { margin-bottom: 14px; }
.modal-body textarea { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 10px; font-size: 13px; font-family: inherit; width: 100%; min-height: 84px; resize: vertical; outline: none; }
.modal-body textarea:focus { border-color: var(--gold); }
.pipeline { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); margin: 4px 0 16px; flex-wrap: wrap; }
.pipeline .step { padding: 4px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.pipeline .step.first { border-color: var(--gold); color: var(--gold); }
.consent { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-mid); margin-bottom: 8px; }
.consent input { accent-color: var(--gold); margin-top: 2px; }

/* ---- Toast --------------------------------------------------------------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--green); color: #06170e; padding: 12px 20px; border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 1200; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ---- First-load hero (shareable landing) --------------------------------- */
.intro { position: fixed; inset: 0; z-index: 2000; overflow-y: auto; padding: 30px 24px;
  background: radial-gradient(120% 90% at 50% -10%, #14180f, #0b0e0c 62%);
  display: flex; align-items: center; justify-content: center; }
.intro.hidden { display: none; }
.intro-card { max-width: 560px; text-align: center; animation: rise .5s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.intro-mark { width: 74px; height: 74px; border-radius: 18px; background: var(--gold); border: 1px solid #a9871a;
  display: grid; place-items: center; margin: 0 auto 20px; font-weight: 800; font-size: 40px; color: #1a1600; }
.intro-card h1 { font-size: 46px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; line-height: 1; color: var(--text); }
.intro-tag { font-size: 16px; color: var(--text-mid); line-height: 1.55; max-width: 470px; margin: 0 auto; }
.intro-stat { margin: 24px 0 20px; }
.intro-stat b { font-size: 42px; font-weight: 800; color: var(--gold); display: block; line-height: 1; }
.intro-stat span { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .1em; }
.intro-points { text-align: left; max-width: 470px; margin: 0 auto 26px; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.intro-points li { font-size: 13.5px; color: var(--text-mid); padding-left: 22px; position: relative; line-height: 1.45; }
.intro-points li::before { content: "◆"; position: absolute; left: 0; top: 3px; color: var(--gold); font-size: 10px; }
.intro-go { font-size: 15px; padding: 13px 28px; }
.intro-note { font-size: 12px; color: var(--text-dim); margin-top: 20px; font-style: italic; }
@media (max-width: 600px) { .intro-card h1 { font-size: 36px; } .intro-tag { font-size: 14.5px; } .intro-stat b { font-size: 34px; } }

/* ---- Responsive ---------------------------------------------------------- */
.hamburger { display: none; }
@media (max-width: 860px) {
  html, body, .app, .body { max-width: 100vw; overflow-x: hidden; }
  .brand h1 { font-size: 15px; } .brand .sub { display: none; }
  .topbar { gap: 10px; padding: 10px 12px; }
  .sidebar { position: absolute; z-index: 750; height: 100%; width: 86%; max-width: 340px; transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
  .patterns { display: none; }
  .legend { display: none; }
  .seg { display: none; }
  #about-btn { display: none; }
  .topbar-actions .label { display: none; }
  .searchwrap { min-width: 0; }
  .demo-banner { font-size: 11px; padding: 6px 10px; }

  /* Mobile detail = bottom sheet (map stays visible above it) */
  .detail {
    top: auto; bottom: 0; left: 0; right: auto;
    width: 100vw; max-width: 100vw; height: 90vh; max-height: 90vh;
    border-left: none; border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    transform: translateY(105%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 -14px 40px rgba(0,0,0,.6);
    overscroll-behavior: contain;
    overflow-x: hidden;
  }
  .detail.open { transform: translateY(0); }
  /* drag-handle affordance */
  .detail-head { padding-top: 22px; }
  .detail-head::before {
    content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 5px; border-radius: 999px; background: var(--text-dim); opacity: .45;
  }
  .detail-close { top: 16px; width: 34px; height: 34px; }

  .count-pill { font-size: 12px; padding: 6px 12px; }
  /* keep the count pill clear of the bottom sheet's reach on small screens */
  .map-float.count-pill { top: 12px; left: 12px; }
}

/* Very small phones: tighten the profile readouts + hero */
@media (max-width: 480px) {
  .brand .mark { width: 34px; height: 34px; }
  .brand .mark span { font-size: 18px; }
  .searchwrap input { padding: 10px 12px 10px 38px; font-size: 13px; }
  .searchwrap input::placeholder { font-size: 12px; }
  .btn-primary { padding: 9px 12px; font-size: 12px; }
  .detail-body { padding: 16px 15px 40px; }
  .case-person h2 { font-size: 19px; }
}

/* Respect users who prefer reduced motion (turn off the anchor pulse etc.) */
@media (prefers-reduced-motion: reduce) {
  .sca-pill { animation: none !important; }
  .pin.urgent-ring { animation: none !important; }
  .ticker-track { animation-duration: 120s; }
}
