/* IncidentTrack "Night Shift" front end. Dark only. Mobile-first: Tonight (feed),
   Map and More views with a tab bar; desktop shows feed and map side by side.
   Class names used by app.js, admin-edit.js and report.js are kept. */
:root {
  --bg: #000000; --card: #121214; --card2: #1a1a1d; --line: #232326; --line2: #2c2c30;
  --text: #f2f2ef; --soft: #c9c9c4; --muted: #8a8a86; --link: #9bb8ff;
  --accent: #5a5df0; --accent-deep: #2b2d8a; --red: #e5484d; --live: #43c393;
  --police: #6ea8fe; --fire: #ff6b6b; --ems: #43c393; --traffic: #e3aa4a; --other: #b39ddb;
  --police-t: #9bb8ff; --fire-t: #ff8a8a; --ems-t: #7fdcb5; --traffic-t: #f2c36b; --other-t: #c9b5e8;
  --chip: #121214; --chip-on: #f2f2ef; --chip-on-text: #000;
  --flash: #1d1d3a; --warn-bg: rgba(250, 204, 21, .12); --warn-fg: #fde047; --warn-line: rgba(250, 204, 21, .4);
  --tabs-h: 58px; --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 Outfit, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--link); }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------- header --- */
header {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px 6px; padding-top: calc(14px + env(safe-area-inset-top));
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand strong { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.brand .sub { color: var(--muted); font-size: 13px; }
.hdr-right { display: flex; align-items: center; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.live b {
  background: var(--red); color: #fff; font-weight: 700; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 6px; border-radius: 4px; line-height: 1;
}
.live.err b { background: #3a3a40; color: #c9c9c4; }
.hdr-links { display: none; gap: 18px; font-size: 14px; margin-right: auto; margin-left: 12px; }
.hdr-links a { color: var(--muted); text-decoration: none; }
.hdr-links a:hover { color: var(--text); }
.hdr-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; color: var(--soft); background: var(--card); border: 1px solid var(--line); }
.hdr-icon:hover { color: var(--text); border-color: var(--line2); }
.hdr-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- pulse --- */
.pulse { flex: 0 0 auto; padding: 2px 16px 0; }
.pulse .lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.pulse .lbl .hot { color: var(--fire-t); }
.pulse .lbl .cool { color: var(--police-t); }
.pulse .g { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.pulse .g i { flex: 1; min-height: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-radius: 2px 2px 0 0; opacity: .85; }
.pulse .g i.hot { background: linear-gradient(180deg, #ff6b6b, #8a2b2b); }
.pulse .g i.now { opacity: 1; }
.pulse.empty .g i { opacity: .25; }

/* --------------------------------------------------------------- views --- */
main { flex: 1 1 auto; min-height: 0; display: flex; }
.view { display: none; flex: 1 1 auto; min-width: 0; min-height: 0; flex-direction: column; }
.view.active { display: flex; }

/* ------------------------------------------------------------- filters --- */
.filters { flex: 0 0 auto; display: flex; gap: 6px; padding: 12px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; min-height: 34px;
  background: var(--chip); border: 1px solid var(--line); color: var(--soft); font-size: 13px; font-weight: 500;
}
.chip.active { background: var(--chip-on); color: var(--chip-on-text); border-color: var(--chip-on); }
.chip-closed { margin-left: auto; }
.chip-siren { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--fire-t); border-color: rgba(255, 107, 107, .45); }
.chip-siren svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-siren.active { background: var(--fire); color: #000; border-color: var(--fire); }

.searchbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; padding: 0 12px; min-height: 38px;
  background: var(--card); border-radius: 12px; border: 1px solid var(--line);
}
.searchbar:focus-within { border-color: var(--line2); }
.searchbar svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.searchbar input {
  flex: 1 1 auto; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none;
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.searchbar button { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; font-size: 19px; line-height: 1; color: var(--muted); }
.searchbar button:hover { background: var(--line); }
#search-note { flex: 0 0 auto; padding: 6px 16px 0; font-size: 12.5px; color: var(--muted); }
#search-note b { color: var(--text); }
#feed.searching #home-about { display: none; }

.disclaimer { flex: 0 0 auto; font-size: 11.5px; line-height: 1.35; color: var(--muted); padding: 0 16px 8px; }

#promo {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 0 12px 8px;
  padding: 9px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 13px; flex-wrap: wrap;
}
.promo-text { font-weight: 600; margin-right: auto; }
.promo-text svg { width: 15px; height: 15px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; }
.promo-btn { padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; }
.promo-btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.promo-x { font-size: 18px; color: var(--muted); padding: 2px 6px; }

/* ---------------------------------------------------------------- feed --- */
#feed { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 12px; }
.empty { color: var(--muted); padding: 48px 32px; text-align: center; }
#statusbar { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); padding: 5px 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#statusbar .warn { color: var(--fire-t); }
.feed-sep { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 4px 8px; }
.more-menu { padding: 8px 12px; overflow-y: auto; }
.more-menu a {
  display: block; padding: 14px 16px; margin-bottom: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.more-menu a b { display: block; font-size: 15px; font-weight: 600; }
.more-menu a span { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 8px; }
.card.flash { animation: flash 3s; }
@keyframes flash { 0% { background: var(--flash); } 100% { background: var(--card); } }
.card.closed { opacity: .55; }
.card.pinned { border-color: var(--accent); }
.card-head { cursor: pointer; }
.card-head:active { opacity: .75; }
.card-main { min-width: 0; }
.cat { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--other-t); }
.cat-l { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.police .cat { color: var(--police-t); } .card.fire .cat { color: var(--fire-t); }
.card.ems .cat { color: var(--ems-t); } .card.traffic .cat { color: var(--traffic-t); }
.ci { width: 13px; height: 13px; flex: 0 0 auto; }
.ci.f { fill: currentColor; }
.ci.s { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card-time { font-size: 12px; color: var(--muted); white-space: nowrap; letter-spacing: 0; text-transform: none; font-weight: 500; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; margin-top: 5px; }
.card-addr { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.last-upd { display: flex; gap: 7px; align-items: baseline; font-size: 13px; line-height: 1.35; color: #d8d8d4; margin-top: 7px; }
.last-upd .who { flex: 0 0 auto; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--soft); }
.card.fire .last-upd .who { color: var(--fire-t); } .card.police .last-upd .who { color: var(--police-t); }
.card.ems .last-upd .who { color: var(--ems-t); } .card.traffic .last-upd .who { color: var(--traffic-t); }
.last-upd > span:not(.who) { min-width: 0; }
.card:not(.open) .last-upd > span:not(.who) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.sp-row { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.sp-row img { height: 16px; width: auto; flex: 0 0 auto; }
.sp-row a { color: #d8d8d4; font-weight: 600; text-decoration: none; }
.sp-row a:hover { text-decoration: underline; }
.units-line { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.units-line .u { font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--card2); color: var(--soft); white-space: nowrap; }
.units-line .u.st-onscene { background: #2a1515; color: var(--fire-t); }
.card.police .units-line .u.st-onscene { background: #15203a; color: var(--police-t); }
.card.ems .units-line .u.st-onscene { background: #12291f; color: var(--ems-t); }
.card.traffic .units-line .u.st-onscene { background: #2e2310; color: var(--traffic-t); }
.units-line .u.st-cleared { opacity: .5; }
.card-meta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: 0 0 auto; }
.rx-sum { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rx-stack { display: inline-flex; }
.rx-stack i { font-style: normal; font-size: 12px; line-height: 1; }
.rx-stack i + i { margin-left: 1px; }
.card-meta .rx-sum-slot:not(:empty) + .meta-txt:not(:empty)::before { content: "· "; }
.card.is-new .card-title { color: #fff; }
.new-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; flex: 0 0 auto; }

.card-body { display: none; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
.card.open .card-body { display: block; }
.section-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.upd { display: flex; gap: 10px; font-size: 13.5px; padding: 5px 0; }
.upd time { color: var(--muted); font-size: 11px; flex: 0 0 auto; padding-top: 2px; font-family: var(--mono); }

.clip { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.clip:first-of-type { border-top: 0; }
.clip .play { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.clip.playing .play { background: var(--accent); color: #fff; }
.clip .play svg { width: 14px; height: 14px; fill: currentColor; }
.clip .body { flex: 1 1 auto; min-width: 0; }
.clip .ct { display: flex; gap: 8px; align-items: baseline; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.clip .ct .who { font-weight: 700; color: var(--soft); letter-spacing: .04em; }
.card.fire .clip .ct .who { color: var(--fire-t); } .card.police .clip .ct .who { color: var(--police-t); }
.card.ems .clip .ct .who { color: var(--ems-t); } .card.traffic .clip .ct .who { color: var(--traffic-t); }
.clip .ct .who.dispatch { color: var(--police-t); }
.clip .tr { font-size: 13.5px; margin-top: 2px; line-height: 1.38; color: #d8d8d4; }
.clip .bar { height: 3px; background: var(--line); margin-top: 6px; border-radius: 2px; overflow: hidden; display: none; }
.clip.playing .bar { display: block; }
.clip .bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.btn { display: inline-block; padding: 9px 16px; border-radius: 999px; min-height: 38px; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; }
.btn-ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }

/* reactions + actions */
.card-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: 8px -4px 0; padding-top: 6px; border-top: 1px solid var(--line); }
.rx-bar { display: flex; gap: 4px; min-width: 0; flex-wrap: wrap; }
.rx-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; min-width: 34px; padding: 0 8px; justify-content: center;
  border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.rx-btn .e { font-size: 14px; line-height: 1; transition: transform .12s; }
.rx-btn b { font-size: 11.5px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.rx-btn b:empty { display: none; }
.rx-btn:hover { border-color: var(--line2); }
.rx-btn:active .e { transform: scale(1.3); }
.rx-btn.on { border-color: var(--accent); background: #1d1d3a; }
.rx-btn.on b { color: #fff; }
.card-actions { display: flex; gap: 0; flex: 0 0 auto; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; text-decoration: none; }
.icon-btn:hover { background: var(--card2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.on { color: var(--link); }
.icon-btn.on svg { fill: currentColor; fill-opacity: .25; }
.icon-btn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 3000;
  transform: translate(-50%, 8px); background: var(--chip-on); color: var(--chip-on-text); padding: 9px 16px;
  border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------- listen along --- */
#listen { flex: 0 0 auto; margin: 6px 12px 8px; background: var(--accent); border-radius: 14px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; color: #fff; }
#listen.on { background: linear-gradient(90deg, #5a5df0, #4446c4); }
#listen .btn-play { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
#listen .btn-play svg { width: 11px; height: 11px; fill: var(--accent-deep); }
#listen .t { min-width: 0; flex: 1 1 auto; font-size: 12px; line-height: 1.25; }
#listen .t b { display: block; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#listen .t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
#listen .bars { display: flex; gap: 2px; align-items: flex-end; height: 18px; flex: 0 0 auto; }
#listen .bars i { width: 3px; background: #fff; border-radius: 2px; opacity: .9; height: 6px; }
#listen.on .bars i { animation: lbar 1s ease-in-out infinite; }
#listen.on .bars i:nth-child(2) { animation-delay: .15s; } #listen.on .bars i:nth-child(3) { animation-delay: .3s; }
#listen.on .bars i:nth-child(4) { animation-delay: .45s; } #listen.on .bars i:nth-child(5) { animation-delay: .6s; }
@keyframes lbar { 0%, 100% { height: 5px; } 50% { height: 17px; } }
@media (prefers-reduced-motion: reduce) { #listen.on .bars i { animation: none; height: 12px; } }

/* ----------------------------------------------------------------- map --- */
#view-map { position: relative; }
#map { flex: 1 1 auto; background: #050506; }
.leaflet-container { font: inherit; background: #050506; }
.dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(1.02) saturate(.5); }
.leaflet-control-layers, .leaflet-control-zoom a, .leaflet-control-attribution { background: rgba(0, 0, 0, .78) !important; color: var(--soft) !important; border-color: var(--line) !important; }
.leaflet-bar a { border-bottom-color: var(--line) !important; }
.leaflet-control-layers-toggle { filter: invert(.85); }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom a { width: 36px; height: 36px; line-height: 36px; font-size: 18px; }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; box-shadow: none !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--text); box-shadow: 0 12px 30px rgba(0, 0, 0, .6); }

.pin-wrap { background: none; border: 0; }
.pin { position: relative; width: 0; height: 0; }
.pin .halo { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px; border-radius: 50%; background: var(--c); opacity: .18; }
.pin .ring { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 2px solid var(--c); opacity: .5; }
.pin .dot { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 12px var(--c); border: 1.5px solid rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; color: #fff; }
.pin .dot svg { width: 14px; height: 14px; }
.pin .dot svg.f { fill: currentColor; }
.pin .dot svg.s { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pin.police { --c: #6ea8fe; } .pin.fire { --c: #ff6b6b; } .pin.ems { --c: #43c393; } .pin.traffic { --c: #e3aa4a; } .pin.other { --c: #b39ddb; }
.pin.dead .halo, .pin.dead .ring { display: none; }
.pin.dead .dot { opacity: .5; box-shadow: none; }
.pin:not(.hot) .ring { display: none; }
@media (prefers-reduced-motion: no-preference) { .pin.hot .halo { animation: pinpulse 2.2s ease-out infinite; } }
@keyframes pinpulse { 0% { transform: scale(.5); opacity: .5; } 100% { transform: scale(1.6); opacity: 0; } }
.pin-wrap.leaflet-marker-icon { margin: 0 !important; }

.ud-wrap { background: none; border: 0; }
.ud { position: relative; width: 0; height: 0; }
.ud i { position: absolute; left: 0; top: 0; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: #c9c9c4; border: 1.5px solid #000; box-sizing: border-box; }
.ud b { position: absolute; left: 8px; top: -15px; font: 700 9.5px/1 var(--mono); color: #c9c9c4; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; }
#legend { position: absolute; left: 12px; bottom: 12px; z-index: 900; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: rgba(0, 0, 0, .72); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; font-size: 11px; color: var(--soft); }
#legend span { display: inline-flex; align-items: center; gap: 5px; }
#legend .ci { width: 12px; height: 12px; }
#legend .cam-k { width: 9px; height: 7px; border-radius: 1.5px; background: #3a3a42; border: 1px solid #55555f; }

/* traffic cameras */
.cam-wrap { background: none; border: 0; }
.cam-pin { width: 20px; height: 20px; border-radius: 5px; background: #2a2a30; color: #c9c9c4; border: 1px solid #55555f; display: flex; align-items: center; justify-content: center; }
.cam-pin svg { width: 12px; height: 12px; fill: currentColor; }
.cam-pin.fav { background: #e3aa4a; color: #000; border-color: #e3aa4a; }
.cam-toggle { background: rgba(0, 0, 0, .78); color: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; font: 600 12px Outfit, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.cam-toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cam-popup .leaflet-popup-content { margin: 10px 12px 10px; width: 300px !important; }
.cam-popup .leaflet-popup-content-wrapper { border-radius: 14px; }
.cam-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.cam-title span { margin-right: auto; }
.cam-star { font-size: 20px; line-height: 1; color: var(--muted); padding: 0 2px; }
.cam-star.on { color: #e3aa4a; }
.cam-box video { width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: 8px; display: block; }
.cam-status { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cam-credit { font-size: 11px; color: var(--muted); margin-top: 6px; }

#sheet {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1000;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .7);
}
.sheet-cat { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--other-t); }
.sheet-cat.police { color: var(--police-t); } .sheet-cat.fire { color: var(--fire-t); } .sheet-cat.ems { color: var(--ems-t); } .sheet-cat.traffic { color: var(--traffic-t); }
.sheet-cat .inacc { margin: 0 0 0 8px; }
.sheet-title { font-size: 17px; font-weight: 700; margin-top: 4px; letter-spacing: -.015em; line-height: 1.15; }
.sheet-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.sheet-actions .btn { min-height: 34px; padding: 7px 14px; font-size: 13px; }
#map-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1100;
  background: var(--chip-on); color: var(--chip-on-text); padding: 9px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); white-space: nowrap; }
#map-hint button { margin-left: 10px; text-decoration: underline; font-weight: 500; color: inherit; }
#mycams { position: absolute; top: 10px; left: 62px; right: 62px; z-index: 900; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
#mycams::-webkit-scrollbar { display: none; }
.mycams-lbl { flex: 0 0 auto; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); background: rgba(0, 0, 0, .72); padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); }
.mycam { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .78); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px 5px 8px; font-size: 12.5px; white-space: nowrap; }
.mycam svg { width: 14px; height: 14px; fill: currentColor; }

/* ------------------------------------------------------------ banners --- */
#mode-banner, #since-pill { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 8px 14px; border-radius: 14px; font-size: 13px; border: 1px solid var(--line); background: var(--card); }
#mode-banner { border-color: rgba(255, 107, 107, .4); }
#mode-banner span { margin-right: auto; }
#mode-banner button { font-weight: 600; color: var(--link); padding: 4px 8px; }
#since-pill { border-color: rgba(90, 93, 240, .5); }
#since-pill span:not(.new-dot) { margin-right: auto; }
#since-pill button { font-size: 18px; color: var(--muted); padding: 0 6px; }

#wx-banner { flex: 0 0 auto; margin: 0 12px 8px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
#wx-banner .wx-main { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13.5px; text-align: left; }
#wx-banner .wx-main svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#wx-banner .wx-main > span:first-of-type { margin-right: auto; }
#wx-banner .wx-more, #wx-banner .wx-caret { font-size: 12px; font-weight: 600; opacity: .85; }
#wx-banner.warn { background: #b4231f; color: #fff; border-color: #b4231f; }
#wx-banner.watch { background: #3a2e12; color: var(--traffic-t); }
#wx-banner.adv { background: var(--card); }
.wx-details { background: var(--card); color: var(--text); padding: 4px 14px 12px; max-height: 45vh; overflow-y: auto; }
.wx-item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.wx-item p { margin-top: 6px; color: var(--muted); }
.wx-src { font-size: 11.5px; color: var(--muted); padding-top: 8px; }

/* ------------------------------------------------------------ settings --- */
#settings { border: 1px solid var(--line); padding: 0; width: min(520px, 100vw); max-width: 100vw; max-height: 92dvh;
  background: var(--card); color: var(--text); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); }
#settings::backdrop { background: rgba(0, 0, 0, .7); }
@media (max-width: 600px) { #settings { margin: auto 0 0; width: 100vw; border-radius: 18px 18px 0 0; max-height: 90dvh; } }
.set-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 16px; }
.set-x { font-size: 24px; line-height: 1; color: var(--muted); padding: 0 4px; }
.set-note { margin: 12px 18px 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: #1d1d3a; border: 1px solid rgba(90, 93, 240, .5); }
.set-sec { padding: 14px 18px 16px; border-bottom: 1px solid var(--line); }
.set-sec h3 { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.set-help { font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; }
.set-status { font-size: 14px; font-weight: 600; margin: 4px 0 10px; }
.set-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.set-row .btn { min-height: 34px; padding: 7px 12px; font-size: 13px; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; }
.set-check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 9px 0; cursor: pointer; }
.set-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.set-sub { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.set-types { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.set-types .set-check { margin: 6px 0; }
.set-indent { margin-left: 27px; }
#settings select { font: inherit; font-size: 14px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--text); }
#set-push-opts { margin-top: 10px; }
#set-push-opts.disabled { opacity: .45; pointer-events: none; }
.set-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
#set-saved { font-size: 13px; color: var(--live); }

/* ---------------------------------------------------------------- tabs --- */
#tabs { flex: 0 0 auto; display: flex; background: var(--bg); padding: 0 0 calc(8px + env(safe-area-inset-bottom)); }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 0; font-size: 12.5px; color: var(--muted); min-height: 46px; }
.tab.active { color: #fff; font-weight: 600; }

/* ------------------------------------------------------------- desktop --- */
@media (min-width: 900px) {
  #tabs { display: none; }
  #view-more { display: none !important; }
  .hdr-links { display: flex; }
  header { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .view { display: flex; }
  #view-feed { flex: 0 0 520px; border-right: 1px solid var(--line); }
  #view-map { flex: 1 1 auto; }
  #sheet { left: auto; right: 20px; bottom: 20px; width: 340px; }
  #legend { left: 20px; bottom: 20px; }
}

/* ------------------------------------------------------ human verified --- */
.hv { display: inline-flex; align-items: center; gap: 3px; color: var(--ems); font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: -2px; margin-left: 5px; letter-spacing: 0; text-transform: none; }
.hv svg { width: 14px; height: 14px; flex: 0 0 auto; }
.hv svg circle { fill: currentColor; stroke: none; }
.hv svg path { fill: none; stroke: var(--card); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.card-title .hv svg { width: 15px; height: 15px; }
.clip .ct .hv { margin-left: 6px; }
.card.voided .card-title span[data-part] { text-decoration: line-through; opacity: .7; }

/* ------------------------------------------------- possibly inaccurate --- */
.inacc { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 1px 9px 1px 7px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn-line); font-size: 11.5px; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.inacc svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* -------------------------------------------------- homepage about text --- */
#home-about { padding: 22px 4px 30px; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 720px; }
#home-about h1 { font-size: 17px; color: var(--text); margin: 0 0 8px; line-height: 1.3; font-weight: 600; }
#home-about p { margin: 0 0 10px; }
#home-about .home-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
#home-about a { color: var(--link); text-decoration: none; }
#home-about a:hover { text-decoration: underline; }

/* ------------------------------------------- glowing Patterns link --- */
a.nav-glow:hover, a.nav-glow:focus-visible {
  background-image: linear-gradient(90deg, #f47c7c, #f7b955, #43c393, #6ea8fe, #b39ddb, #f47c7c);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; animation: navflow 1.6s linear infinite;
  filter: drop-shadow(0 0 5px rgba(110, 168, 254, .9)) drop-shadow(0 0 13px rgba(244, 124, 124, .6)); }
@keyframes navflow { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { a.nav-glow:hover, a.nav-glow:focus-visible { animation: none; } }

/* ------------------------------------------------- iOS app pop-up (Safari on iPhone) --- */
.ios-dlg { border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--text); padding: 22px 20px 16px; width: min(92vw, 360px); text-align: center; }
.ios-dlg::backdrop { background: rgba(0, 0, 0, .62); }
.ios-dlg img { border-radius: 14px; display: block; margin: 0 auto 10px; }
.ios-dlg h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.ios-dlg p { margin: 0 0 16px; color: var(--soft); font-size: 14px; line-height: 1.4; }
.ios-dlg .btn-app { display: block; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; padding: 12px; border-radius: 999px; }
.ios-dlg .btn-later { display: block; width: 100%; margin-top: 6px; background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; padding: 8px; cursor: pointer; }
