/* CitizensWatch — one stylesheet for the whole app. */
:root {
  --ink: #0E1A14;
  --ink-2: #33433A;
  --text-2: #4A5A50;
  --muted: #5E6E64;
  --faint: #7A897F;
  --line: #E3E8E4;
  --line-2: #CDD5CF;
  --soft: #F1F4F1;
  --soft-2: #F7F9F7;
  --ground: #E3E9E4;
  --white: #FFFFFF;

  --red: #D92D20;
  --red-ink: #B42318;
  --red-icon: #C8221A;
  --red-soft: #FEF0EE;
  --amber-ink: #B54708;
  --amber-soft: #FFF6E5;
  --green: #067647;
  --green-soft: #E9F7EF;
  --blue: #175CD3;
  --blue-dark: #1849A9;
  --blue-soft: #EAF2FF;
  --neutral-soft: #EEF2EF;

  --e1: 0 1px 2px rgba(14, 26, 20, .06), 0 1px 3px rgba(14, 26, 20, .10);
  --e2: 0 2px 4px -2px rgba(14, 26, 20, .08), 0 10px 24px -6px rgba(14, 26, 20, .20);
  --e3: 0 -12px 32px -8px rgba(14, 26, 20, .20);

  --font: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.1px;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(23, 92, 211, .55); outline-offset: 2px; }
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Map ---------- */
#map { position: fixed; inset: 0; background: var(--ground); }
.map-fallback {
  position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(150px + var(--safe-top)) 24px 0; color: var(--muted); text-align: center; line-height: 1.5;
}
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { bottom: 0; }

/* ---------- Floating top controls ---------- */
.topbar {
  position: fixed; left: 16px; right: 16px; top: calc(16px + var(--safe-top)); z-index: 20;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.search {
  position: relative; display: flex; align-items: center; gap: 10px; height: 52px;
  padding: 0 6px 0 16px; background: var(--white); border-radius: 26px; box-shadow: var(--e2);
}
.search input {
  border: 0; outline: none; flex: 1; min-width: 0; font-size: 16px; background: transparent;
}
.search input::-webkit-search-cancel-button { display: none; }
.round-btn {
  width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--soft); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none;
}
.round-btn.float { width: 44px; height: 44px; border-radius: 22px; background: var(--white); color: var(--ink); box-shadow: var(--e2); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 0 6px; margin-right: -16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--white); color: var(--ink);
  font-size: 14px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--e1); flex: none;
}
.chip.on { background: var(--ink); color: var(--white); }

.results {
  position: absolute; left: 0; right: 0; top: 58px; background: var(--white); border-radius: 18px;
  box-shadow: var(--e2); padding: 6px 0; max-height: 60vh; overflow-y: auto; z-index: 5;
}
.result {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 14px;
  border: 0; background: transparent; text-align: left;
}
.result:hover, .result.active { background: #F4F7FB; }
.result-ic {
  width: 34px; height: 34px; border-radius: 10px; background: var(--soft); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.result-ic.street { background: var(--blue-soft); color: var(--blue); }
.result b { font-weight: 600; display: block; }
.result small { font-size: 13px; color: var(--muted); }
.results-note { display: block; margin: 4px 14px; padding-top: 8px; border-top: 1px solid var(--soft); font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---------- Report button and locate ---------- */
.fab {
  position: fixed; right: 16px; z-index: 15; height: 52px; padding: 0 22px 0 18px; border-radius: 26px; border: 0;
  background: var(--red); color: var(--white); display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 16px; text-decoration: none; box-shadow: var(--e2);
  transition: transform .25s ease;
}
.locate { position: fixed; left: 16px; z-index: 15; transition: transform .25s ease; }

/* ---------- Bottom sheet ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(100% - 136px - var(--safe-top));
  background: var(--white); border-radius: 24px 24px 0 0; box-shadow: var(--e3);
  display: flex; flex-direction: column; transform: translateY(var(--sheet-y, 55%));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1); touch-action: none;
}
.sheet.dragging { transition: none; }
.sheet-grab { padding: 8px 0 4px; display: flex; justify-content: center; cursor: grab; }
.sheet-grab span { width: 36px; height: 5px; border-radius: 3px; background: var(--line-2); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding-bottom: calc(88px + var(--safe-bottom)); }
.sheet-head { padding: 8px 16px 0 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.title-btn { border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; gap: 4px; text-align: left; }
.sub { font-size: 13px; color: var(--muted); }

.metrics { margin: 14px 20px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; }
.metric { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric b { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.metric span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.section-label { display: block; padding: 18px 20px 4px; font-size: 12px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }

.row-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--ink); text-decoration: none;
  width: 100%; border: 0; background: transparent; text-align: left;
}
.row-link:hover { background: var(--soft-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-weight: 600; }
.row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 24px 20px; color: var(--muted); line-height: 1.5; }

/* Category icon tiles */
.ct { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.ct.sm { width: 32px; height: 32px; border-radius: 9px; }
.ct.lg { width: 44px; height: 44px; border-radius: 13px; }
.ct.red { background: var(--red-soft); color: var(--red-icon); }
.ct.amber { background: var(--amber-soft); color: var(--amber-ink); }
.ct.green { background: var(--green-soft); color: var(--green); }
.ct.grey { background: var(--neutral-soft); color: var(--text-2); }
.cat-red { color: var(--red-icon); } .cat-amber { color: var(--amber-ink); } .cat-green { color: var(--green); } .cat-grey { color: var(--text-2); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.unverified { background: var(--neutral-soft); color: var(--text-2); }
.badge.corroborated { background: var(--blue-soft); color: var(--blue); }
.badge.disputed { background: var(--amber-soft); color: var(--amber-ink); }
.badge.live { background: var(--red-soft); color: var(--red-ink); }
.badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: var(--red); }
.badge.past { background: var(--soft); color: var(--muted); }

/* Help tips */
.tip {
  width: 24px; height: 24px; border: 0; padding: 0; border-radius: 12px; background: transparent; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center; position: relative; flex: none;
}
.tip::after { content: ''; position: absolute; inset: -10px; }
.tip.inherit { color: inherit; }
.tipbox {
  position: fixed; z-index: 100; width: min(288px, calc(100vw - 32px)); background: var(--ink); color: var(--white);
  border-radius: 14px; padding: 14px 16px 8px; box-shadow: var(--e2); display: flex; flex-direction: column; gap: 6px;
}
.tipbox b { font-weight: 600; font-size: 14px; }
.tipbox p { margin: 0; font-size: 13.5px; line-height: 1.45; color: rgba(255, 255, 255, .84); }
.tipbox button { align-self: flex-end; height: 32px; padding: 0 8px; border: 0; background: transparent; color: #8CB8FF; font-size: 14px; font-weight: 600; }
.tipbox .arrow { position: absolute; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; }

/* Area panel */
.stat-row { padding: 14px 20px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.stat.tipped { padding-right: 6px; }
.stat b { font-weight: 700; }
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; background: var(--soft); border-radius: 12px; padding: 3px; }
.seg button { height: 36px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: var(--e1); }
.card {
  display: flex; gap: 12px; padding: 14px 20px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--neutral-soft);
}
.card:hover { background: var(--soft-2); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--soft); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--white); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb.blurred img { filter: blur(10px) brightness(.7); transform: scale(1.2); }
.thumb .over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ---------- Full-screen pages (detail, report, moderate) ---------- */
.page {
  position: fixed; inset: 0; z-index: 40; background: var(--white); display: flex; flex-direction: column;
  padding-top: var(--safe-top); animation: pageIn .22s ease-out;
}
.page.transparent { background: transparent; pointer-events: none; }
.page.transparent > * { pointer-events: auto; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-head { height: 60px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; background: var(--white); }
.page-head h1, .page-head .t { font-size: 17px; font-weight: 600; margin: 0; }
.page-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.page-foot { flex: none; padding: 14px 20px calc(18px + var(--safe-bottom)); border-top: 1px solid var(--neutral-soft); background: var(--white); display: flex; flex-direction: column; gap: 10px; }
.wrap { max-width: 640px; margin: 0 auto; width: 100%; }

.btn {
  height: 54px; border-radius: 27px; border: 0; background: var(--ink); color: var(--white); font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; width: 100%; padding: 0 20px;
}
.btn.red { background: var(--red); }
.btn.blue { background: var(--blue); }
.btn.ghost { height: 48px; border: 1px solid var(--line-2); background: var(--white); color: var(--ink); font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.small-note { font-size: 12.5px; color: var(--muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 2px; }

h1.big { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.1; text-wrap: balance; }
.lead { color: var(--muted); line-height: 1.45; margin: 6px 0 0; }
.steps { padding: 0 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.steps span { height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--ink); }
.field-label { font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.textarea {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.45;
  resize: none; background: var(--white); outline: none;
}
.textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23, 92, 211, .12); }
.input {
  height: 48px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 14px; font-size: 16px; background: var(--white); outline: none; width: 100%;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23, 92, 211, .12); }
.error-text { color: var(--red-ink); font-size: 13.5px; line-height: 1.4; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile {
  min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; position: relative;
}
.tile[aria-checked="true"] { border: 2px solid var(--ink); padding: 7px 9px; background: #FBFCFB; }
.tile .tick {
  position: absolute; right: -7px; top: -7px; width: 22px; height: 22px; border-radius: 11px; background: var(--ink); color: var(--white);
  display: none; align-items: center; justify-content: center; border: 2px solid var(--white);
}
.tile[aria-checked="true"] .tick { display: flex; }
.pill-choice {
  height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line-2); background: var(--white);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.pill-choice[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 600; }
.wrap-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Report step 1 sits on top of the live map */
.pick-top { position: fixed; left: 0; right: 0; top: 0; z-index: 41; background: var(--white); padding-top: var(--safe-top); box-shadow: var(--e1); }
.pick-pin { position: fixed; left: 50%; top: 50%; z-index: 30; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 4px 6px rgba(14, 26, 20, .3)); }
.pick-ring { position: fixed; left: 50%; top: 50%; z-index: 29; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 60px; background: rgba(23, 92, 211, .10); border: 1.5px dashed rgba(23, 92, 211, .6); pointer-events: none; }
.pick-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; padding: 12px 16px calc(16px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.pick-bottom > * { pointer-events: auto; }
.place-card { background: var(--white); border-radius: 16px; padding: 12px 14px; box-shadow: var(--e2); display: flex; flex-direction: column; gap: 6px; }

/* Media */
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.media-tile { height: 100px; border-radius: 16px; position: relative; overflow: hidden; background: var(--soft); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .x { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 14px; border: 0; background: rgba(14, 26, 20, .7); color: var(--white); display: flex; align-items: center; justify-content: center; }
.media-tile .busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(14, 26, 20, .6); color: var(--white); font-size: 12px; font-weight: 600; text-align: center; padding: 6px; }
.add-tile { height: 100px; border: 1.5px dashed #B7C2BA; border-radius: 16px; background: #FBFCFB; color: var(--ink-2); font-size: 14px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: relative; overflow: hidden; }
.add-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-row { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 6px 0; line-height: 1.4; font-size: 14.5px; cursor: pointer; }
.check-row + .check-row { border-top: 1px solid var(--neutral-soft); }
.check-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); flex: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: 14.5px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; background: var(--white); box-shadow: var(--e1); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .2s; }

/* Photo-age warning */
.old-tag { position: absolute; left: 6px; right: 6px; bottom: 6px; background: var(--amber-ink); color: var(--white); font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 3px 5px; text-align: center; }
.old-banner { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13.5px; font-weight: 500; line-height: 1.4; }

/* Updates added by other people */
.updates { margin: 18px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.updates-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.update { display: flex; gap: 12px; }
.update-rail { display: flex; flex-direction: column; align-items: center; flex: none; width: 12px; padding-top: 6px; }
.update-rail i { width: 10px; height: 10px; border-radius: 5px; background: var(--blue); }
.update-rail b { flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.update-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.update-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.update-media .cell { position: relative; height: 110px; border-radius: 12px; overflow: hidden; background: #2A2422; }
.update-media img, .update-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.update-media .cell.blurred img, .update-media .cell.blurred video { filter: blur(16px) brightness(.6); transform: scale(1.2); }
.update-media .cell button { position: absolute; inset: 0; border: 0; background: transparent; color: var(--white); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }

/* Detail */
.hero-media { margin: 0 16px; height: 240px; border-radius: 18px; position: relative; overflow: hidden; background: #2A2422; color: var(--white); }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.hero-media.blurred img, .hero-media.blurred video { filter: blur(24px) brightness(.6); transform: scale(1.15); }
.hero-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.hero-over .ring { width: 48px; height: 48px; border-radius: 24px; background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; }
.pill-light { height: 36px; padding: 0 16px; border-radius: 18px; border: 0; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; }
.hero-tag { position: absolute; bottom: 12px; height: 24px; padding: 0 9px; border-radius: 12px; background: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; color: var(--white); }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 18px; border: 0; background: rgba(0, 0, 0, .45); color: var(--white); display: flex; align-items: center; justify-content: center; }
.verify { margin: 14px 20px 0; padding: 14px 16px; border-radius: 16px; background: var(--soft-2); display: flex; flex-direction: column; gap: 10px; }
.bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.bars span { height: 6px; border-radius: 3px; background: #DCE3DE; }
.bars span.on { background: var(--blue); }
.info-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--neutral-soft); border-bottom: 1px solid var(--neutral-soft); font-size: 14px; }
.done-note { display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: 27px; background: var(--blue-soft); color: var(--blue); font-weight: 600; }

/* Modal sheet (time range, categories, flag, help) */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(14, 26, 20, .45); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--white); border-radius: 24px 24px 0 0;
  max-height: 88vh; display: flex; flex-direction: column; padding-bottom: calc(20px + var(--safe-bottom)); animation: up .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 14px 16px 6px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.modal-body { overflow-y: auto; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 20px; border: 0; background: transparent; width: 100%; text-align: left; font-size: 16px; }
.opt[aria-checked="true"] { background: var(--soft-2); font-weight: 600; }
.radio { width: 22px; height: 22px; border-radius: 11px; border: 2px solid #B7C2BA; flex: none; }
.opt[aria-checked="true"] .radio { border: 7px solid var(--ink); }
.box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #B7C2BA; flex: none; display: flex; align-items: center; justify-content: center; color: var(--white); }
.opt[aria-checked="true"] .box { border: 0; background: var(--ink); }
.note-box { margin: 10px 20px 0; padding: 12px 14px; border-radius: 14px; background: var(--soft-2); display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.help-body { padding: 4px 20px 8px; line-height: 1.55; color: var(--ink-2); }
.help-body h3 { margin: 18px 0 6px; font-size: 15px; color: var(--ink); }
.help-body p { margin: 0 0 8px; }
.emergency { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--red); color: var(--white); display: flex; gap: 12px; align-items: center; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); z-index: 120; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--white); padding: 12px 16px; border-radius: 14px; font-size: 14px; box-shadow: var(--e2); animation: up .2s ease-out;
}

/* Success page */
.success { padding: 72px 28px 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.share-card { background: var(--ink); color: var(--white); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 32px -8px rgba(14, 26, 20, .28); text-align: left; }

/* Moderator */
.mod { background: #F4F6F4; }
.mod-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; width: 100%; }
.mod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mod-stat { background: var(--white); border-radius: 16px; padding: 14px 16px; box-shadow: var(--e1); display: flex; flex-direction: column; gap: 4px; }
.mod-stat b { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 15px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tab[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.cnt { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--neutral-soft); color: var(--text-2); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.mod-card { background: var(--white); border-radius: 18px; padding: 16px; box-shadow: var(--e1); display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.mod-media { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-media img, .mod-media video { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; background: #000; }
.mod-actions { flex: 1 1 280px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.act { height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line-2); background: var(--white); font-size: 14px; font-weight: 600; white-space: nowrap; }
.act.pri { background: var(--ink); border-color: var(--ink); color: var(--white); }
.act.danger { color: var(--red-ink); border-color: #F3B8B1; }
.flagchip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--red-soft); color: var(--red-ink); }

/* ---------- Wide screens: the sheet becomes a side panel ---------- */
@media (min-width: 900px) {
  .topbar { left: 432px; right: auto; width: min(520px, calc(100vw - 460px)); }
  .chips { margin-right: 0; }
  .sheet {
    left: 16px; top: calc(16px + var(--safe-top)); bottom: 16px; width: 400px; height: auto; border-radius: 20px;
    transform: none !important; box-shadow: var(--e2);
  }
  .sheet-grab { display: none; }
  .fab { bottom: 24px !important; transform: none !important; }
  .locate { left: 432px; bottom: 24px !important; transform: none !important; }
  .modal { left: 50%; right: auto; width: 440px; transform: translateX(-50%); bottom: 24px; border-radius: 20px; animation: fade .2s; }
  .page:not(.mod):not(.transparent) { left: 50%; right: auto; width: 480px; transform: translateX(-50%); top: 16px; bottom: 16px; border-radius: 20px; box-shadow: var(--e2); animation: fade .2s; }
  .pick-top { left: 50%; right: auto; width: 480px; transform: translateX(-50%); top: 16px; border-radius: 20px; box-shadow: var(--e2); }
  .pick-bottom { left: 50%; right: auto; width: 480px; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* "Is this the same incident?" */
.same-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.same-cap { line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
