/* Fonts: Figtree for reading (clean, friendly) and Bricolage Grotesque for headlines (a bit of personality). */
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

/* TTnow. One set of colour tokens; dark mode follows the phone unless the person picks Light or Dark. */
:root {
  color-scheme: light;
  --page: #ffffff; --bg: #f2f2f7; --panel: #ffffff; --elevated: #ffffff; --well: #f2f2f7;
  --ink: #1c1c1e; --muted: #6c6c70; --faint: #aeaeb2; --line: #e3e3e8; --chip: #eeeef3;
  --accent: #d6262b; --accent-ink: #fff; --accent-soft: rgba(214, 38, 43, .1); --live: #d6262b;
  --blue: #0a66d6; --green: #1f8a3f; --amber: #b7791f; --scrim: rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --murder: #c0262d; --shooting: #e2571e; --robbery: #b7791f; --breakin: #8a6d3b; --kidnap: #7b2fbf;
  --assault: #c2185b; --missing: #1f6fd1; --arrest: #2f7d4f; --traffic: #5b6573; --fire: #d99a00; --court: #6d7f99; --notice: #455a64; --wanted: #0e7490;
  --accent-fill: #d6262b; --thumb: #ffffff; --ring: rgba(10, 102, 214, .45); --sun: #f5a000; --rain: #0a84ff;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  --ease: cubic-bezier(.2, .9, .25, 1); --t-fast: .12s; --t: .2s; --t-slow: .32s;
  --dock-h: 60px;
  --sans: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage", "Figtree", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #000000; --bg: #000000; --panel: #1c1c1e; --elevated: #1c1c1e; --well: #161618;
    --ink: #f2f2f7; --muted: #a1a1a8; --faint: #636366; --line: #38383b; --chip: #2c2c2e; --thumb: #636366; --ring: rgba(75, 161, 255, .55); --sun: #ffc233; --rain: #5eb0ff;
    --accent: #ff4b51; --accent-fill: #d92d33; --accent-soft: rgba(255, 75, 81, .16); --live: #ff453a;
    --blue: #4ba1ff; --green: #34c759; --amber: #e0a43a; --scrim: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .4);
    --traffic: #7d8792; --court: #7f93ad; --notice: #6f8592; --breakin: #a8865a; --kidnap: #9b5de5; --arrest: #359b62; --wanted: #22a3c3;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000; --bg: #000000; --panel: #1c1c1e; --elevated: #1c1c1e; --well: #161618;
  --ink: #f2f2f7; --muted: #a1a1a8; --faint: #636366; --line: #38383b; --chip: #2c2c2e; --thumb: #636366; --ring: rgba(75, 161, 255, .55); --sun: #ffc233; --rain: #5eb0ff;
  --accent: #ff4b51; --accent-fill: #d92d33; --accent-soft: rgba(255, 75, 81, .16); --live: #ff453a;
  --blue: #4ba1ff; --green: #34c759; --amber: #e0a43a; --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .4);
  --traffic: #7d8792; --court: #7f93ad; --notice: #6f8592; --breakin: #a8865a; --kidnap: #9b5de5; --arrest: #359b62; --wanted: #22a3c3;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); display: flex; flex-direction: column;
  font: 16px/1.45 var(--sans); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom));
}
a { color: inherit; }
button, select, input { font: inherit; color: var(--ink); }
button { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img { -webkit-user-drag: none; }
.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.chev { opacity: .5; margin-left: 2px; }

/* ---------- Safety top bar + tabs ---------- */
.top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; background: var(--panel); }
.brand { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.3px; white-space: nowrap; }
.brand b { color: var(--accent); }
.logo { width: 24px; height: 24px; vertical-align: -5px; border-radius: 6px; margin-right: 2px; }
.status { margin-left: auto; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; background: var(--chip); padding: 5px 10px; border-radius: var(--r-full); }
.status #statusText { overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 199, 89, .6); animation: pulse 2s infinite; }
.dot.stale { background: var(--amber); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }
.sos { display: inline-grid; place-items: center; min-height: 36px; background: var(--accent-fill); color: var(--accent-ink); text-decoration: none; font-weight: 800; padding: 0 12px; border-radius: var(--r-full); letter-spacing: .3px; transition: transform var(--t-fast); }
.sos:active { transform: scale(.95); }
.sos.small { font-size: 13px; padding: 5px 9px; }

.tabwrap { background: var(--panel); padding: 0 16px; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--chip); border-radius: var(--r-md); }
.tabs button { flex: 1; border: 0; background: none; min-height: 34px; padding: 6px 2px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 9px; cursor: pointer; transition: background var(--t), color var(--t), box-shadow var(--t); }
.tabs button.on { color: var(--ink); background: var(--thumb); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 2px 8px rgba(0, 0, 0, .06); }
.live { font-size: 9px; font-weight: 700; color: #fff; background: var(--live); border-radius: 3px; padding: 1px 4px; vertical-align: 2px; }

.filters { padding: 12px 16px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.row { display: flex; gap: 8px; margin-top: 6px; }
.row select, .row input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); font-size: 15px; transition: border-color var(--t), box-shadow var(--t); }
.row select { -webkit-appearance: none; appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; }
.row select:focus-visible, .row input:focus-visible, .searchbox input:focus-visible { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.row button, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--chip); cursor: pointer; font-weight: 600; transition: transform var(--t-fast), background var(--t); }
.row button:active, .ghost:active { transform: scale(.97); }
.savebtn[aria-pressed="true"] { color: var(--accent); }
.savebtn[aria-pressed="true"] svg { fill: currentColor; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; border: 1px solid var(--line); background: var(--chip); border-radius: var(--r-full); padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity var(--t), background var(--t), color var(--t), transform var(--t-fast); }
.chip:active { transform: scale(.96); }
.chip.off { opacity: .4; }
.chip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.chip .x { margin-left: 2px; opacity: .55; }
.chips.wrap { flex-wrap: wrap; margin-top: 8px; }

.banner { margin: 8px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-fill); color: #fff; font-weight: 600; cursor: pointer; }
.install { display: flex; align-items: center; gap: 10px; margin: 8px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; cursor: pointer; }
.install[hidden] { display: none; }
.install span { flex: 1; }
.install .x { flex: none; display: grid; place-items: center; border: 0; background: var(--chip); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: var(--muted); }

/* ---------- views ---------- */
main { flex: 1; position: relative; min-height: 0; }
.view { display: none; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.view.on { display: block; animation: viewIn .22s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } }
#view-map.on { display: flex; flex-direction: column; position: relative; animation: none; }
#map { flex: 1; min-height: 340px; background: var(--well); }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.unplaced { font-size: 12px; color: var(--muted); padding: 6px 16px; }
.note { color: var(--muted); font-size: 13px; margin: 10px 16px; }
.note.pad { margin: 24px 16px; }

/* ---------- crime cards ---------- */
.cards { list-style: none; margin: 0; padding: 8px 16px 24px; display: grid; gap: 10px; }
.cards.flat { padding: 8px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; cursor: pointer; transition: transform var(--t-fast), border-color var(--t), box-shadow var(--t); }
.card:active { transform: scale(.985); }
.card.fresh { border-color: var(--accent); }
.card.mine { box-shadow: inset 3px 0 0 var(--blue); }
.card h3 { margin: 2px 0 4px; font-family: var(--display); font-size: 17px; line-height: 1.22; font-weight: 650; letter-spacing: -.2px; }
.card p { margin: 0 0 6px; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.type { color: #fff; font-weight: 700; border-radius: 6px; padding: 2px 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.trust { border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, currentColor 12%, transparent); }
.trust.ok, .trustline.ok { color: var(--green); } .trust.mid, .trustline.mid { color: var(--blue); } .trust.low, .trustline.low { color: var(--muted); }
.trustline { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.srcs { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; list-style: none; }

/* ---------- map ---------- */
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pin.fresh { animation: ping 1.5s infinite; }
@keyframes ping { 50% { transform: scale(1.5); } }
.station-pin { width: 18px; height: 18px; border-radius: 5px; background: var(--blue); color: #fff; font: 700 11px/18px var(--sans); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.mapbar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 500; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; border: .5px solid var(--line); background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); color: var(--ink); border-radius: var(--r-full); padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: var(--shadow); transition: transform var(--t-fast), background var(--t), color var(--t); }
.pill:active { transform: scale(.96); }
.pill.on, .pill[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.leaflet-container { background: var(--well); font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--elevated); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--ink); border-color: var(--line); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }

.sortbar { display: flex; margin: 10px 16px 0; padding: 2px; background: var(--chip); border-radius: 10px; width: max-content; }
.seg { border: 0; background: none; min-height: 32px; padding: 6px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); border-radius: 8px; transition: background var(--t), color var(--t); }
.seg.on { background: var(--thumb); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- panels (Alerts, Stats) ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); margin: 12px 16px; padding: 16px; }
.panel h2 { font-family: var(--display); font-size: 19px; margin: 0 0 4px; letter-spacing: -.3px; font-weight: 700; }
.panel .note { margin: 0 0 10px; }
.panel .row { margin: 6px 0; }
.primary { display: inline-block; min-height: 44px; text-align: center; background: var(--accent-fill); color: #fff; border: 0; border-radius: var(--r-md); padding: 12px 18px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform var(--t-fast), opacity var(--t-fast), background var(--t); }
.primary:active { transform: scale(.98); opacity: .9; }
.primary:disabled { background: var(--chip); color: var(--muted); font-weight: 600; font-size: 14.5px; cursor: default; }
.check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 14px; }
.check input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nums a { text-decoration: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); background: var(--well); }
.nums b { display: block; font-size: 18px; color: var(--ink); }
.segctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; background: var(--chip); border-radius: var(--r-md); }
.segctl button { border: 0; background: none; min-height: 36px; padding: 8px 4px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); transition: background var(--t), color var(--t); }
.segctl button[aria-pressed="true"] { background: var(--thumb); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.links { display: grid; }
.links a { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 12px 0; text-decoration: none; border-top: 1px solid var(--line); font-size: 15.5px; font-weight: 500; }
.links a:first-child { border-top: 0; }
.links a::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border: solid var(--faint); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.fineprint { color: var(--muted); font-size: 12px; margin: 8px 16px 28px; line-height: 1.5; }

.stats { padding-bottom: 16px; }
.stats > .note { margin: 4px 16px 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 11px; color: var(--muted); font-weight: 500; text-align: left; padding: 4px 0; }
.tbl td { padding: 7px 0; border-top: 1px solid var(--line); }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .up { color: var(--accent); } .tbl .down { color: var(--green); }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.bar { display: grid; grid-template-columns: 110px 1fr 28px; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 0; cursor: pointer; font-size: 14px; text-align: left; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar i { height: 10px; border-radius: 5px; background: var(--murder); opacity: .85; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
p.big { font-family: var(--display); font-size: 38px; font-weight: 800; margin: 0; letter-spacing: -1px; }

/* ---------- story / incident sheet ---------- */
body.locked { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 2000; }
.sheet-back { position: absolute; inset: 0; background: var(--scrim); animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--elevated); border-radius: 20px 20px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .3); animation: sheetUp .32s cubic-bezier(.2, .9, .25, 1); }
.sheet-card.dragging { transition: none; animation: none; }
.sheet-card.snap { transition: transform .25s cubic-bezier(.2, .9, .25, 1); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.grab { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--faint); opacity: .7; z-index: 2; }
.sheet-card h2 { font-family: var(--display); font-size: 23px; margin: 6px 0; line-height: 1.25; padding-right: 34px; letter-spacing: -.2px; }
.sheet-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 8px; }
.sheet-card p { color: var(--muted); margin: 0 0 8px; }
.sheet-x { position: absolute; top: 12px; right: 12px; z-index: 3; border: 0; background: color-mix(in srgb, var(--chip) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; display: grid; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline time, .timeline span { font-size: 12px; color: var(--muted); }
.timeline a { font-weight: 600; text-decoration: none; }
.station { display: flex; gap: 8px; align-items: center; }
.station div { flex: 1; display: grid; font-size: 14px; }
.station span { font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 8px; margin: 18px 0 8px; }
.actions .primary { flex: 1; }
.sharebtn { display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; }
.sharebtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: -2px; }
.actions .ghost { flex: none; border-radius: 12px; }
.sheet-img { margin: -22px -18px 14px; border-radius: 20px 20px 0 0 !important; aspect-ratio: 16 / 9; }
.story-title { font-family: var(--display); font-size: 28px !important; line-height: 1.12 !important; font-weight: 700; letter-spacing: -.6px; }
.lede { font-size: 17.5px; line-height: 1.55; color: var(--ink) !important; }
.primary.block { display: block; margin: 16px 0 4px; }

/* ---------- news: Today / Sections / Saved / Search / Alerts ---------- */
body:not([data-mode="safety"]) .tabwrap, body:not([data-mode="safety"]) #filters, body:not([data-mode="safety"]) .top, body:not([data-mode="safety"]) #advSafety { display: none; }
.view.nv { background: var(--page); }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; display: flex; height: calc(var(--dock-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--panel) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line); user-select: none; -webkit-user-select: none; }
.dock button { position: relative; flex: 1; min-width: 0; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: color var(--t); }
.dock button::before { content: ""; position: absolute; top: 6px; left: 50%; width: 52px; height: 30px; margin-left: -26px; border-radius: var(--r-full); background: var(--accent-soft); opacity: 0; transform: scaleX(.5); transition: opacity var(--t), transform var(--t-slow) var(--ease); }
.dock svg { position: relative; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; transition: transform var(--t-fast); }
.dock button:active svg { transform: scale(.86); }
.dock button.on { color: var(--accent); font-weight: 700; }
.dock button.on::before { opacity: 1; transform: none; }
.dock button.on svg { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke-width: 2; }

/* Large title that hands over to a compact bar on scroll, like iOS. */
.minibar { position: fixed; top: 0; left: 0; right: 0; z-index: 1400; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; text-align: center; font-weight: 600; font-size: 16px;
  background: color-mix(in srgb, var(--page) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .18s, transform .18s; }
body.scrolled:not([data-mode="safety"]) .minibar { opacity: 1; transform: none; pointer-events: auto; }

.masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 16px 10px; }
.masthead h1 { margin: 0; font-family: var(--display); font-size: 38px; line-height: 1; letter-spacing: -1px; font-weight: 800; }
.dateline { margin: 0 0 3px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.mast-r { display: flex; align-items: center; gap: 8px; }
.mast-logo { width: 34px; height: 34px; border-radius: 9px; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--chip); cursor: pointer; color: var(--ink); transition: transform var(--t-fast); }
.iconbtn:active { transform: scale(.92); }
.iconbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back { border: 0; background: none; color: var(--accent); font-size: 16px; font-weight: 600; min-height: 32px; padding: 0 8px 6px 0; cursor: pointer; }

.nsec { padding: 4px 16px 16px; border-top: 8px solid var(--well); }
.masthead + div > .nsec:first-child, .masthead + .nsec { border-top: 0; }
.nsec-h { margin: 16px 0 10px; font-family: var(--display); font-size: 25px; font-weight: 800; letter-spacing: -.6px; color: var(--accent); }
.nsec-h button { all: unset; cursor: pointer; display: inline-flex; align-items: center; }
.nsec-h .chev { opacity: .45; stroke-width: 2.6; }

.story { cursor: pointer; display: block; transition: opacity .12s; }
.story:active { opacity: .6; }
.story h2, .story h3 { font-family: var(--display); margin: 4px 0 0; color: var(--ink); }
.story h2 { font-size: 25px; line-height: 1.12; font-weight: 700; letter-spacing: -.5px; }
.story h3 { font-size: 17.5px; line-height: 1.2; font-weight: 650; letter-spacing: -.2px; }
.story p { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.byline { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.byline b { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--oc, var(--muted)); }
:root[data-theme="dark"] .byline b { color: color-mix(in srgb, var(--oc, #888) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .byline b { color: color-mix(in srgb, var(--oc, #888) 55%, #fff); } }
.ph { background: var(--well); border-radius: 12px; overflow: hidden; position: relative; }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; animation: fadeIn .35s ease-out; }
.ph.noimg { display: none; }
.ph.wide { aspect-ratio: 16 / 10; margin-bottom: 10px; }
.hero { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hero:last-child { border-bottom: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pair:last-child { border-bottom: 0; }
.tile .ph { aspect-ratio: 4 / 3; margin-bottom: 8px; }
.tile h3 { font-size: 15.5px; }
.srow { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .sbody { flex: 1; min-width: 0; }
.ph.thumb { flex: none; width: 92px; height: 92px; border-radius: 10px; }

.safety-card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer; margin-top: 12px;
  background: linear-gradient(135deg, #1b2530, #3a1418); color: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.safety-card div { flex: 1; display: grid; gap: 3px; }
.safety-card span { font-size: 13px; opacity: .8; }
.safety-card .go { display: inline-flex; align-items: center; font-weight: 700; opacity: 1; color: #ff8a8e; white-space: nowrap; }
.tip { display: flex; gap: 12px; align-items: center; margin: 4px 16px 12px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); }
.tip div { flex: 1; font-size: 14px; }
.tip b { display: block; font-size: 15px; margin-bottom: 2px; }
.tip .primary { padding: 8px 12px; font-size: 14px; }
.tip .x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; }

.secgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 20px; }
.sectile { position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 16px; overflow: hidden; padding: 0; cursor: pointer; text-align: left; transition: transform .12s;
  background: linear-gradient(160deg, var(--c, #3a4656), #11161c); }
.sectile:active { transform: scale(.97); }
.sectile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sectile span { position: absolute; inset: auto 0 0 0; padding: 34px 12px 11px; color: #fff; font-size: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); display: grid; }
.sectile b { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.4px; }

.searchbox { position: relative; margin: 0 16px 6px; }
.searchbox svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.searchbox input { width: 100%; min-height: 44px; padding: 10px 12px 10px 38px; border: 1px solid transparent; border-radius: var(--r-md); background: var(--chip); font-size: 16px; -webkit-appearance: none; appearance: none; transition: border-color var(--t), box-shadow var(--t); }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; }
.kicker { margin: 18px 16px 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 16px; }
mark { background: color-mix(in srgb, var(--amber) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.emptystate { text-align: center; padding: 60px 32px; color: var(--muted); }
.emptystate svg { width: 44px; height: 44px; fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linejoin: round; margin-bottom: 10px; }
.emptystate b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Loading placeholders */
.sk { background: linear-gradient(90deg, var(--well) 25%, var(--chip) 37%, var(--well) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk.img { aspect-ratio: 16 / 10; border-radius: 12px; margin-bottom: 12px; }
.sk.line { height: 16px; margin: 8px 0; }
.sk.short { width: 40%; height: 12px; }
.sk.mid { width: 75%; }

/* Pull to refresh + toast */
.ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); z-index: 1450; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%;
  background: var(--elevated); box-shadow: var(--shadow); display: grid; place-items: center; opacity: 0; transform: translateY(-40px); pointer-events: none; }
.ptr svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.ptr.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 14px); z-index: 2500; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- wide screens ---------- */
@media (min-width: 900px) {
  main { display: grid; grid-template-columns: 1fr 440px; }
  #view-map { display: flex !important; flex-direction: column; grid-column: 1; grid-row: 1; position: relative; }
  .view.on:not(#view-map) { display: block; grid-column: 2; grid-row: 1; border-left: 1px solid var(--line); }
  #view-map.on ~ #view-feed { display: block; grid-column: 2; grid-row: 1; border-left: 1px solid var(--line); }
  .view.nv.on { grid-column: 1 / -1; border-left: 0; }
  body:not([data-mode="safety"]) #view-map { display: none !important; }
  .nv > *, .masthead { max-width: 820px; margin-left: auto; margin-right: auto; }
  .searchbox, .tip { max-width: 788px; margin-left: auto; margin-right: auto; }
  .secgrid { grid-template-columns: repeat(4, 1fr); }
  .sheet-card { left: auto; right: 24px; bottom: 24px; top: 24px; width: 480px; max-height: none; border-radius: 20px; animation: fadeIn .2s; }
  .sheet-img { border-radius: 20px 20px 0 0 !important; }
  .grab { display: none; }
  .minibar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.view.nv.grouped { background: var(--bg); }
.view.nv.grouped .masthead { padding-bottom: 4px; }

/* ---------- Audio: live radio ---------- */
.stations { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 24px; }
.station-sk { aspect-ratio: 1 / 1; border-radius: 18px; }
.rtile { position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 18px; padding: 14px; text-align: left; cursor: pointer; color: #fff; overflow: hidden;
  background: linear-gradient(150deg, var(--a), var(--b)); display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow); transition: transform .12s; }
.rtile:active { transform: scale(.97); }
.rtile .freq { position: absolute; top: 10px; left: 14px; font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: -2px; line-height: 1; opacity: .95; }
.rtile .freq small { font-size: 14px; letter-spacing: 0; margin-left: 3px; opacity: .8; font-weight: 700; }
.rtile b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.3px; line-height: 1.15; }
.rtile span.kind { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.rtile .playicon { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; }
.rtile .playicon svg { width: 16px; height: 16px; fill: #fff; }
.rtile.off { filter: grayscale(.9); opacity: .55; cursor: default; }
.rtile.on { outline: 3px solid var(--ink); outline-offset: 2px; }
.eq { display: none; gap: 3px; align-items: flex-end; height: 16px; }
.rtile.on .eq, .pl-art .eq { display: inline-flex; }
.rtile.on .playicon svg { display: none; }
.eq i { width: 3px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; } .eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.paused .eq i, .rtile.on.paused .eq i { animation-play-state: paused; }

.player { position: fixed; left: 10px; right: 10px; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 8px); z-index: 1490; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 8px; border-radius: 16px; background: color-mix(in srgb, var(--elevated) 88%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid var(--line); box-shadow: var(--shadow); animation: sheetUp .25s ease-out; }
.player[hidden] { display: none; }
.pl-art { width: 42px; height: 42px; flex: none; border-radius: 10px; background: linear-gradient(150deg, var(--a, #c0262d), var(--b, #5a0f14)); display: grid; place-items: center; }
.pl-txt { flex: 1; min-width: 0; display: grid; }
.pl-txt b { font-family: var(--display); font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-txt span { font-size: 12.5px; color: var(--muted); }
.pl-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 22px; }
.pl-btn svg { fill: currentColor; }
.pl-btn.x { color: var(--muted); }
body.playing { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 66px); }
body.playing .toast { bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 80px); }
@media (min-width: 900px) {
  .stations { grid-template-columns: repeat(4, 1fr); max-width: 820px; margin: 0 auto; }
  .player { left: auto; right: 24px; width: 360px; }
}
.rtile b, .rtile .kind { padding-right: 36px; }

/* ---------- Weather ---------- */
.wx-clear { --w1: #2f8cff; --w2: #7cc4ff; } .wx-partly { --w1: #3f86d6; --w2: #9cc3e6; } .wx-cloudy { --w1: #5f7189; --w2: #9aa9bc; }
.wx-rain { --w1: #34507a; --w2: #6a8bb0; } .wx-storm { --w1: #2b2d42; --w2: #5c4d7d; } .wx-night { --w1: #0b1d3a; --w2: #2c4677; }
.wxcard { display: block; width: calc(100% - 32px); margin: 2px 16px 12px; padding: 14px 16px; border: 0; border-radius: 18px; text-align: left; cursor: pointer; color: #fff;
  background: linear-gradient(160deg, var(--w1), var(--w2)); box-shadow: var(--shadow); transition: transform .12s; }
.wxcard:active { transform: scale(.985); }
.wxc-now { display: flex; align-items: center; gap: 10px; }
.wxc-ico .wi { width: 40px; height: 40px; }
.wxc-now > b { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.wxc-now span:last-child { display: grid; font-size: 13.5px; opacity: .92; }
.wxc-now em { font-style: normal; font-weight: 700; font-size: 15px; }
.wxc-hours { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .25); }
.wxc-hours span { display: grid; justify-items: center; gap: 4px; }
.wxc-hours .wi { width: 22px; height: 22px; }
.wxc-hours small { font-size: 11.5px; opacity: .85; }
.wxc-hours b { font-size: 14px; }

.wxtowns { padding: 0 16px 10px; }
.chip.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.wxtowns .chip { min-height: 36px; }
.wxhero { margin: 0 16px 12px; padding: 20px; border-radius: 22px; color: #fff; background: linear-gradient(160deg, var(--w1), var(--w2)); box-shadow: var(--shadow); }
.wxh-top { display: flex; align-items: center; gap: 12px; }
.wxh-ico .wi { width: 68px; height: 68px; stroke-width: 1.6; }
.wxh-temp { font-family: var(--display); font-size: 84px; font-weight: 600; letter-spacing: -4px; line-height: .9; }
.wxh-desc { margin: 10px 0 2px; font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.wxh-sub { margin: 0; opacity: .9; font-size: 15px; }
.wxbox { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; margin: 0 16px 12px; padding: 12px 14px; }
.wxbox h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.wxhours { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; padding: 0 6px; }
.wxhours::-webkit-scrollbar { display: none; }
.wxhours div { flex: none; width: 52px; display: grid; justify-items: center; gap: 3px; }
.wxhours small { font-size: 12px; color: var(--muted); font-weight: 600; }
.wxhours span .wi { width: 26px; height: 26px; }
.wxhours em { font-style: normal; font-size: 11px; color: var(--blue); font-weight: 700; min-height: 13px; }
.wxhours b { font-size: 15px; }
.wxday { display: grid; grid-template-columns: 52px 28px 38px 34px 1fr 34px; font-variant-numeric: tabular-nums; align-items: center; gap: 6px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.wxday:first-of-type { border-top: 0; }
.wxd-ico { display: grid; place-items: center; }
.wxd-ico .wi { width: 24px; height: 24px; }
.wxday em { font-style: normal; font-size: 12px; color: var(--blue); font-weight: 700; }
.wxd-min { color: var(--muted); text-align: right; }
.wxd-max { font-weight: 700; }
.wxbar { position: relative; height: 5px; border-radius: 3px; background: var(--chip); }
.wxbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #5ac8fa, #ffcc00, #ff9500); }
.wxgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 16px 12px; }
.wxgrid .wxbox { margin: 0; }
.wxgrid b { display: block; font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.8px; }
.wxgrid b small { font-size: 14px; letter-spacing: 0; color: var(--muted); font-weight: 600; }
.wxgrid span { font-size: 13px; color: var(--muted); }
.wxwarn { margin: 4px 16px 8px !important; background: var(--panel) !important; color: var(--accent) !important; border: 1px solid var(--line); }
@media (min-width: 900px) { .wxcard, .wxhero, .wxbox, .wxgrid, .wxtowns, .wxwarn { max-width: 788px; margin-left: auto !important; margin-right: auto !important; } .wxgrid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Weather icons (SVG, coloured by part) ---------- */
.wi { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wi .s { stroke: var(--sun); } .wi .s circle { fill: color-mix(in srgb, var(--sun) 30%, transparent); }
.wi .m { stroke: #a9b8ff; fill: color-mix(in srgb, #a9b8ff 25%, transparent); }
.wi .r { stroke: var(--rain); } .wi .b { stroke: var(--sun); fill: color-mix(in srgb, var(--sun) 35%, transparent); }
.wxbox .wi > path:not([class]), .wxday .wi > path:not([class]) { stroke: var(--muted); }
.wxcard .wi, .wxhero .wi { color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .15)); }
.wxcard .wi .s, .wxhero .wi .s, .wxcard .wi .b, .wxhero .wi .b { stroke: #ffd84d; }
.wxcard .wi .r, .wxhero .wi .r { stroke: #cfe6ff; }
.wxcard .wi .m, .wxhero .wi .m { stroke: #fff6c7; }
.wxc-now > b, .wxh-temp, .wxhours b, .wxc-hours b { font-variant-numeric: tabular-nums; }

/* ---------- Motion: tiles rise in when a view opens (not the radio grid, which redraws on every player change) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.view.on .secgrid > *, .view.on .wxgrid > * { animation: rise var(--t-slow) var(--ease) both; }
.view.on :is(.secgrid, .wxgrid) > :nth-child(2) { animation-delay: 30ms; }
.view.on :is(.secgrid, .wxgrid) > :nth-child(3) { animation-delay: 60ms; }
.view.on :is(.secgrid, .wxgrid) > :nth-child(4) { animation-delay: 90ms; }
.view.on :is(.secgrid, .wxgrid) > :nth-child(5) { animation-delay: 120ms; }
.view.on :is(.secgrid, .wxgrid) > :nth-child(6) { animation-delay: 150ms; }
.view.on :is(.secgrid, .wxgrid) > :nth-child(n+7) { animation-delay: 180ms; }

/* ---------- Pointer devices: hover states ---------- */
@media (hover: hover) and (pointer: fine) {
  .story:hover h2, .story:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
  .card:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); box-shadow: var(--shadow); }
  .chip:hover:not(.on), .ghost:hover, .row button:hover, .iconbtn:hover { background: color-mix(in srgb, var(--ink) 9%, var(--chip)); }
  .primary:hover:not(:disabled) { background: color-mix(in srgb, #000 10%, var(--accent-fill)); }
  .sectile:hover img, .rtile:hover { filter: brightness(1.06); }
  .dock button:hover:not(.on) { color: var(--ink); }
  .tabs button:hover:not(.on), .segctl button:hover:not([aria-pressed="true"]) { color: var(--ink); }
  .links a:hover { color: var(--accent); }
}

/* ---------- Anonymous tips (Crime Stoppers) ---------- */
.tipbox { display: flex; gap: 12px; margin: 14px 0; padding: 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--blue) 9%, var(--elevated)); border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent); }
.tipbox > svg { color: var(--blue); margin-top: 1px; }
.tipbox b { display: block; font-size: 16px; }
.sheet-card .tipbox p { margin: 3px 0 10px; font-size: 14px; color: var(--muted); }
.tipbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.tipbtns a { min-height: 40px; padding: 9px 14px; font-size: 14.5px; text-decoration: none; }
.tipbtns .ghost { color: var(--ink); }

/* ---------- v2: districts, curfew banner, Talk ---------- */
.links button { all: unset; display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15.5px; font-weight: 500; cursor: pointer; }
.links button::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border: solid var(--faint); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.links button:focus-visible { outline: 3px solid var(--ring); }

.dchip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; max-width: 46vw; padding: 4px 10px 4px 12px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--chip); font-size: 13px; font-weight: 700; cursor: pointer; transition: transform var(--t-fast); }
.dchip:active { transform: scale(.96); }
.dchip .dname, .dchip #talkDistrict { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dchip.inline { min-height: 28px; padding: 2px 8px 2px 10px; font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.dchip.big { min-height: 44px; font-size: 15px; padding: 8px 14px; max-width: none; }
.top .status { padding: 5px 8px; }
.top .status #statusText { max-width: 64px; }
@media (max-width: 380px) { .top .status #statusText { display: none; } }

.dlist { display: grid; gap: 6px; }
.drow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 54px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); cursor: pointer; transition: transform var(--t-fast), border-color var(--t); }
.drow:active { transform: scale(.985); }
.drow > span:first-child { flex: 1; min-width: 0; display: grid; }
.drow small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.drow .cnt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.badge { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 6px; }
.badge.warn { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }

.advslot:empty { display: none; }
#advSafety { background: var(--panel); padding: 8px 16px 0; }
#advTalk, #advToday { padding: 0 16px 8px; }
.advisories { display: grid; gap: 6px; }
.adv { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 48px; padding: 9px 12px; border-radius: var(--r-md); cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 12%, var(--panel)); color: var(--ink); transition: transform var(--t-fast); }
.adv:active { transform: scale(.985); }
.adv > svg:first-child { color: var(--amber); }
.adv span { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.adv b { font-size: 14.5px; }
.adv small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-soe { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.adv-soe > svg:first-child { color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 15px; }
.facts dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.facts dd { margin: 0; font-weight: 600; }

.secnav { padding: 0 16px 10px; }
.secnav .chip { min-height: 32px; padding: 5px 12px; font-size: 13px; }

/* Talk */
.newpost { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 8px 14px 8px 10px; border: 0; border-radius: var(--r-full); background: var(--accent-fill); color: #fff; font-weight: 700; cursor: pointer; transition: transform var(--t-fast); }
.newpost:active { transform: scale(.95); }
.tsort { margin: 2px 16px 8px; }
.tlist { list-style: none; margin: 0; padding: 4px 16px 24px; display: grid; gap: 10px; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px 15px; cursor: pointer; transition: transform var(--t-fast), border-color var(--t); }
.tcard:active { transform: scale(.985); }
.tcard.pinned { border-color: var(--blue); }
.tcard h3 { margin: 4px 0; font-family: var(--display); font-size: 17px; line-height: 1.24; font-weight: 650; letter-spacing: -.2px; }
.tcard p { margin: 0 0 6px; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .tlink { font-size: 13px; color: var(--ink); opacity: .75; }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--ink); }
.k-headsup { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }
.k-question { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.k-info { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.held { color: var(--amber); font-weight: 700; }
.tfoot { display: flex; gap: 14px; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.tfoot span { display: inline-flex; align-items: center; gap: 4px; }
.tfoot .on { color: var(--accent); }
.tfoot .who { margin-left: auto; font-weight: 500; font-size: 12.5px; }
.tintro { margin: 4px 16px 10px; padding: 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--blue) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent); }
.tintro b { font-size: 16px; }
.tintro p { margin: 4px 0 10px; color: var(--muted); font-size: 14px; }
.byhandle { font-size: 13px; }
.tbody { font-size: 16px; line-height: 1.5; margin: 8px 0 4px; overflow-wrap: anywhere; }
.tbody a, .reply p a { color: var(--blue); }
.tlinkcard { display: grid; gap: 2px; width: 100%; text-align: left; margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); font-weight: 600; cursor: pointer; }
.tlinkcard small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tbtn { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 6px 10px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; border-radius: var(--r-sm); cursor: pointer; }
.tbtn.on { color: var(--accent); }
.tbtn:disabled { opacity: .45; cursor: default; }
.tbtn.big { border: 1px solid var(--line); background: var(--chip); color: var(--ink); min-height: 44px; padding: 8px 14px; }
.tbtn.big.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.talkbtn { flex: none; }
.replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.reply { padding: 10px 0 2px; border-top: 1px solid var(--line); }
.reply.child { margin-left: 18px; padding-left: 12px; border-top: 0; border-left: 2px solid var(--line); }
.reply p { margin: 3px 0 0 !important; color: var(--ink) !important; font-size: 15px; overflow-wrap: anywhere; }
.rmeta { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.rmeta b { color: var(--ink); font-size: 13.5px; }
.op { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--blue); }
.ractions { display: flex; gap: 2px; margin-left: -10px; }
.composer { display: grid; gap: 10px; margin: 16px 0 4px; }
.composer textarea, .field input, .field select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--well); font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
.composer textarea:focus-visible, .field input:focus-visible, .field select:focus-visible { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.composer .check { margin-top: 0; }
.composer.big .primary.block { margin: 4px 0 0; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field small { font-weight: 500; }
.segctl.kinds { grid-template-columns: repeat(4, 1fr); }
.segctl.kinds button { font-size: 13px; padding: 8px 2px; }
.segctl button[aria-checked="true"] { background: var(--thumb); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.replying { font-size: 13px; color: var(--muted); }
.replying button { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
.rules summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--blue); }
.ruleslist { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.ruleslist li { display: grid; gap: 1px; }
.ruleslist span { color: var(--muted); font-size: 14px; }
.reasons { display: grid; gap: 6px; }
.ghost.block { display: flex; width: 100%; justify-content: flex-start; text-align: left; }
.ghost.danger { color: var(--accent); }
@media (min-width: 900px) { .tlist { max-width: 760px; margin: 0 auto; } }
.sortrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 16px 0; }
.sortrow .sortbar { margin: 0; }
.sortrow .fbtn { box-shadow: none; min-height: 36px; }
.fbtn.on { background: var(--ink); color: var(--panel); }

.elsewhere{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 4px;color:var(--muted);font-size:14px}
.elsewhere .ghost{flex:none}

/* moderator page */
.modpage { background: var(--bg); color: var(--ink); }
.modwrap { max-width: 720px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.modwrap .panel { margin: 0; display: grid; gap: 10px; }
.modhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.modhead h1 { font-size: 22px; margin: 0; }
.modbar, .modbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.modlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.modcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 8px; }
.modcard h3 { margin: 0; font-size: 16px; }
.modcard p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.modpage .muted { color: var(--muted); }
.modpage [hidden] { display: none !important; }
.dnote { margin: 0 0 10px; }

/* ---------- v3: labels, rumour checks, week card, district page, nudges, identity ---------- */
.st { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.st-confirmed { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.st-source, .st-corrected { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.st-false { background: var(--ink); color: var(--page); }
.st-noevidence { background: color-mix(in srgb, var(--ink) 14%, transparent); color: var(--ink); }
.stline { display: grid; gap: 2px; margin: 8px 0 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--well); border-left: 3px solid var(--faint); font-size: 14px; }
.stline b { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.stline span { color: var(--muted); }
.stline a { color: var(--blue); font-weight: 600; }
.stline.st-confirmed { border-left-color: var(--green); color: var(--ink); } .stline.st-confirmed b { color: var(--green); }
.stline.st-false { border-left-color: var(--ink); background: var(--well); color: var(--ink); }
.stline.st-source, .stline.st-corrected { border-left-color: var(--blue); color: var(--ink); } .stline.st-source b, .stline.st-corrected b { color: var(--blue); }
.stline.st-noevidence, .stline.st-unverified { color: var(--ink); background: var(--well); }
.hfacts { font-size: 13.5px; margin: 0 0 6px !important; }
.hfacts b { color: var(--ink); }
.blurred { filter: blur(7px); user-select: none; -webkit-user-select: none; pointer-events: none; }
.claim { display: grid; gap: 8px; margin: 8px 0; }
.claim .ghost { justify-self: start; }
.tclaim { font-style: italic; }
.tbanner { margin: 4px 0 8px !important; padding: 10px 12px; border-radius: var(--r-md); font-size: 13.5px; color: var(--ink) !important;
  background: color-mix(in srgb, var(--amber) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.note.closed { margin: 12px 0 4px; padding: 12px 14px; border-radius: var(--r-md); background: var(--well); color: var(--ink); font-weight: 600; }
.rvote { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.rvote span { flex-basis: 100%; }
.nudge { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--blue) 9%, var(--elevated)); border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent); font-size: 14.5px; }
.linkbtn { display: inline; border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.note .linkbtn { display: block; min-height: 32px; margin-top: 4px; text-align: left; }
.timg { margin: 10px 0 0; aspect-ratio: auto; max-height: 420px; }
.timg img { object-fit: contain; }
.actions { flex-wrap: wrap; }
.actions .tbtn.big { flex: 1 1 auto; justify-content: center; }
.segctl.kinds { grid-template-columns: repeat(6, 1fr); }
.segctl.kinds button { grid-column: span 2; }
.segctl.kinds button:nth-child(n+4) { grid-column: span 3; }
.field > .segctl { margin-top: 2px; }
.field > .segctl button { font-size: 13px; }
.field input[type="file"] { padding: 8px; font-size: 14px; }
.check a { color: var(--blue); }

.weekcard { margin: 10px 16px 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); }
.weekcard h2 { margin: 0 0 4px; font-family: var(--display); font-size: 17px; letter-spacing: -.2px; }
.wk-n { margin: 0; font-size: 16px; } .wk-n b { font-family: var(--display); font-size: 19px; }
.wk-u { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.wk-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wk-btns .ghost { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.tlist.flat { padding: 0; }
.tlist.flat .tcard h3 { font-size: 15.5px; }
.stlist { display: grid; gap: 10px; }
div.bar { cursor: default; }

.advchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 40px; padding: 6px 12px; border-radius: var(--r-full); cursor: pointer; font-size: 13.5px; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 12%, var(--panel)); color: var(--ink); }
.advchip > svg { color: var(--amber); }
.advchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advchip small { color: var(--muted); font-weight: 700; }
.adv-lifted, .advchip.adv-lifted { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 10%, var(--panel)); }
.adv-lifted > svg:first-child, .advchip.adv-lifted > svg { color: var(--green); }
.advchip.adv-soe { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.advchip.adv-soe > svg { color: var(--accent); }

.idname { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 17px; }
.notices { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.notices li { padding: 10px 12px; border-radius: var(--r-md); background: var(--well); font-size: 14px; }
.notices time { display: block; font-size: 12px; color: var(--muted); }
#identity .ghost.block { margin-top: 8px; }
.dock button.has-note::after { content: ""; position: absolute; top: 8px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent-fill); border: 2px solid var(--panel); }
.morealerts { margin-top: 12px; }
.morealerts summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--blue); min-height: 32px; }

/* moderator tools */
.modtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; position: sticky; top: 0; z-index: 5; background: var(--bg); }
.modtabs::-webkit-scrollbar { display: none; }
.modtabs button { flex: none; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--chip); font-weight: 700; font-size: 14px; cursor: pointer; }
.modtabs button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
#modBody { display: grid; gap: 14px; }
#modBody h2 { font-size: 16px; margin: 6px 0 0; }
.modwrap, .modwrap #modMain { align-content: start; }
.modwrap #modMain { display: grid; gap: 12px; }
.msrc { display: grid; gap: 4px; font-size: 14px; }
.msrc a { color: var(--blue); }
.mdigest { margin: 0; font-size: 14px; color: var(--muted); }
.modcard .meta { margin: 0; }
.modcard .field { font-size: 12.5px; }
.mstate { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--chip); }
.s-held { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }
.s-removed { background: var(--ink); color: var(--page); }
.mwhy { font-size: 13.5px; font-weight: 600; color: var(--amber); }
.mlegal { padding: 10px 12px; border-radius: var(--r-md); background: var(--well); font-size: 14px; display: grid; gap: 6px; }
.mremove { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.mremove .chip { min-height: 38px; }
.mmore summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); min-height: 30px; }
.mmore .modbtns { margin-top: 6px; }
.modimg { max-width: 100%; max-height: 260px; border-radius: var(--r-md); }
.excerpt { font-size: 13px; max-height: 260px; overflow: auto; background: var(--well); padding: 10px; border-radius: var(--r-md); }
.modundo { position: sticky; top: 48px; z-index: 6; padding: 10px 14px; border-radius: var(--r-md); background: var(--ink); color: var(--page); font-weight: 600; }
.modundo .linkbtn { color: inherit; margin-left: 8px; }
.mlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.mlog time { display: inline-block; min-width: 78px; color: var(--muted); }
.mswitch { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.mswitch p { margin: 2px 0 0; font-size: 13px; }
.mswitch button { flex: none; min-height: 40px; }
.modpage .primary:disabled, .modpage .ghost:disabled { opacity: .5; cursor: default; }
.modpage .modbtns .primary { padding: 9px 14px; min-height: 40px; }
.modpage textarea, .modpage .field input, .modpage .field select { width: 100%; }

/* accounts */
.sheet.locked .sheet-x, .sheet.locked .grab { display: none; }
#account .primary { margin-top: 2px; }

/* sponsors (text only) and the moderator extras */
.sponsor { display: flex; align-items: baseline; gap: 8px; margin: 10px 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); text-decoration: none; font-size: 14px; }
.sponsor small { flex: none; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.sponsor span { min-width: 0; color: var(--muted); } .sponsor b { color: var(--ink); }
.sheet-card .sponsor, .nsec + .sponsor { margin-left: 0; margin-right: 0; }
.nsec + .sponsor { margin: 0 16px 14px; }
.links a[hidden] { display: none; }
#modBody > *, .modwrap .panel > * { min-width: 0; }
.modwrap .panel { grid-template-columns: minmax(0, 1fr); }
.mkey { grid-template-columns: minmax(0, 1fr); padding: 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--amber) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); font-size: 14px; display: grid; gap: 8px; }
.mkey code { display: block; font: 600 14px/1.4 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; word-break: break-all; user-select: all; -webkit-user-select: all; }
