/* Metro Fire Desk — shared by every /fires/<metro>/ page.
   Palette and type are the event map's (event-map/index.html), so the desk
   reads as the same product: deep navy ground, warm-white type, orange for
   agency fire records, amber for unconfirmed radio dispatch. */
:root {
  color-scheme: dark;
  --bg: #060b14;
  --surface: #0c1322;
  --surface-2: #101a2d;
  --line: rgba(244,239,228,0.12);
  --line-strong: rgba(244,239,228,0.24);
  --ink: #F4EFE4;
  --ink-2: rgba(244,239,228,0.72);
  --ink-3: rgba(244,239,228,0.52);
  --link: #7FA8F5;
  --fire: #E08A3C;
  --radio: #F0B44C;
  --live: #6FCF97;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 60% at 50% -10%, rgba(29,52,82,0.55), transparent 60%);
  background-repeat: no-repeat;
  color: var(--ink);
  line-height: 1.5;
  padding: 0 16px 72px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
.wrap { max-width: 1240px; margin: 0 auto; }

.preview-banner {
  margin: 0 -16px; padding: 10px 16px; text-align: center;
  background: rgba(240,180,76,0.12); border-bottom: 1px solid rgba(240,180,76,0.4);
  color: var(--radio); font-size: 0.84rem;
}
.preview-banner strong { font-weight: 700; letter-spacing: 0.02em; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0.01em; }
.brand img { width: 26px; height: 26px; }
.metro-switch { display: flex; gap: 6px; font-size: 0.8rem; }
.metro-switch a {
  color: var(--ink-2); text-decoration: none; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
}
.metro-switch a[aria-current="page"] { color: var(--ink); background: rgba(244,239,228,0.12); border-color: rgba(244,239,228,0.45); }
.metro-switch a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

header.hero { padding: 34px 0 18px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem;
  color: var(--ink-3); margin: 0 0 10px; display: flex; align-items: center; gap: 10px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 0 rgba(111,207,151,0.6); animation: pulse 2.4s infinite;
}
.live-dot.idle { background: var(--ink-3); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111,207,151,0.55); }
  70% { box-shadow: 0 0 0 9px rgba(111,207,151,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,207,151,0); }
}
h1 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.lede { margin: 0; color: var(--ink-2); max-width: 64ch; font-size: 1.02rem; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 20px; }
.metric { background: rgba(12,19,34,0.75); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.metric-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-label { font-size: 0.78rem; color: var(--ink-3); margin-top: 4px; }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.areas { display: flex; flex-wrap: wrap; gap: 8px; }
.area-chip {
  appearance: none; font: inherit; font-size: 0.84rem; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.area-chip:hover { border-color: rgba(244,239,228,0.42); color: var(--ink); }
.area-chip[aria-pressed="true"] { background: rgba(244,239,228,0.13); border-color: rgba(244,239,228,0.55); color: var(--ink); }
.area-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.area-count { font-size: 0.72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.area-chip[aria-pressed="true"] .area-count { color: var(--ink-2); }
.window-select {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 0.84rem;
}

.desk { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: stretch; }
.map-shell {
  position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  height: 640px; background: #0b1220;
}
#map { width: 100%; height: 100%; background: #0b1220; }
.feed {
  border: 1px solid var(--line); border-radius: 14px; background: rgba(12,19,34,0.78);
  height: 640px; display: flex; flex-direction: column; overflow: hidden;
}
.feed-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.feed-title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.feed-meta { font-size: 0.76rem; color: var(--ink-3); }
.feed-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.incident {
  appearance: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; align-items: start;
  background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 12px 10px;
  transition: background 0.12s, border-color 0.12s;
}
.incident:hover, .incident.is-hot { background: rgba(244,239,228,0.05); border-color: var(--line); }
.incident[aria-current="true"] { background: rgba(240,180,76,0.08); border-color: rgba(240,180,76,0.45); }
.incident:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.incident-when { font-size: 0.8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.incident-when b { display: block; font-size: 0.95rem; color: var(--ink); font-weight: 600; }
.incident-title { font-weight: 600; font-size: 0.96rem; margin: 0 0 2px; }
.incident-where { font-size: 0.84rem; color: var(--ink-2); margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2);
}
.chip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chip.radio { border-color: rgba(240,180,76,0.55); color: var(--radio); }
.chip.radio i { background: transparent; border: 1.5px solid var(--radio); }
.chip.official { border-color: rgba(224,138,60,0.55); color: #F2A866; }
.chip.official i { background: var(--fire); }
.chip.muted { color: var(--ink-3); }

.feed-more { display: none; }
.empty { padding: 28px 18px; color: var(--ink-2); font-size: 0.92rem; }
.empty h3 { margin: 0 0 8px; font-size: 1rem; color: var(--ink); font-weight: 600; }
.empty p { margin: 0 0 10px; }

.notice {
  border-left: 2px solid rgba(127,168,245,0.5); padding: 8px 12px; margin: 0 0 14px;
  background: rgba(76,130,240,0.07); font-size: 0.86rem; color: var(--ink-2);
}

/* Markers: agency records are solid orange; radio dispatch is an amber
   ring — hollow because it is unconfirmed. Newest reports breathe. */
.fd-dot { width: 14px; height: 14px; border-radius: 50%; position: relative; transition: transform 0.12s; }
.fd-dot.official { background: var(--fire); border: 1.5px solid #FFE6CC; box-shadow: 0 0 0 4px rgba(224,138,60,0.22); }
.fd-dot.radio { background: rgba(240,180,76,0.18); border: 2px solid var(--radio); box-shadow: 0 0 0 4px rgba(240,180,76,0.14); }
.fd-dot.recent::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid var(--radio); opacity: 0; animation: ripple 2.2s infinite;
}
.fd-dot.is-hot, .fd-dot.is-active { transform: scale(1.45); }
.fd-dot.is-active { box-shadow: 0 0 0 4px rgba(240,180,76,0.14), 0 0 0 7px rgba(244,239,228,0.85); }
@keyframes ripple { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .fd-dot.recent::after { animation: none; }
}

.lower { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: rgba(12,19,34,0.6); padding: 18px; }
.card h2 { font-size: 0.98rem; margin: 0 0 10px; font-weight: 600; }
.card p { margin: 0 0 10px; font-size: 0.86rem; color: var(--ink-2); }
.card ul { margin: 0; padding: 0; list-style: none; font-size: 0.86rem; color: var(--ink-2); }
.card li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.card li:first-child { border-top: none; }
.card li span:last-child { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.legend-row .chip { flex: none; margin-top: 1px; }
.legend-row p { margin: 0; }

.alert-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.alert-form input, .alert-form select {
  flex: 1 1 120px; min-width: 0; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 0.86rem;
}
.alert-form button {
  flex: none; appearance: none; font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  background: var(--ink); color: #0b1220; border: none; border-radius: 8px; padding: 9px 16px;
}
.alert-form button:focus-visible, .alert-form input:focus-visible, .alert-form select:focus-visible { outline: 2px solid var(--radio); outline-offset: 2px; }
.alert-status { margin-top: 10px; font-size: 0.8rem; color: var(--radio); min-height: 1.2em; }

/* Detail drawer: right side on desktop, bottom sheet on mobile — the event
   map's own pattern, so a visitor who has used one has used both. */
.backdrop { position: fixed; inset: 0; background: rgba(3,6,12,0.6); z-index: 999; opacity: 0; transition: opacity 0.16s ease; }
.backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 1000;
  background: var(--surface); border-left: 1px solid var(--line-strong); overflow-y: auto;
  padding: 24px 22px 32px; transform: translateX(100%); transition: transform 0.2s ease;
}
.drawer.open { transform: translateX(0); }
.drawer:focus { outline: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(244,239,228,0.06); color: var(--ink); font-size: 1.15rem; cursor: pointer;
}
.drawer-close:focus-visible, .drawer-action:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.drawer h2 { margin: 12px 0 4px; font-size: 1.3rem; font-weight: 600; padding-right: 40px; line-height: 1.25; }
.drawer .when-line { color: var(--ink-2); font-size: 0.9rem; margin: 0 0 16px; }
.facts { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0 0 16px; }
.facts th { text-align: left; font-weight: 500; color: var(--ink-3); width: 34%; padding: 8px 10px 8px 0; vertical-align: top; border-top: 1px solid var(--line); }
.facts td { padding: 8px 0; border-top: 1px solid var(--line); }
.callout { border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; margin: 0 0 16px; }
.callout.radio { background: rgba(240,180,76,0.08); border: 1px solid rgba(240,180,76,0.35); color: rgba(244,239,228,0.85); }
.callout.official { background: rgba(224,138,60,0.07); border: 1px solid rgba(224,138,60,0.3); color: rgba(244,239,228,0.85); }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.drawer-action {
  appearance: none; font: inherit; font-size: 0.8rem; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2);
}
.drawer-action:hover { border-color: rgba(244,239,228,0.45); color: var(--ink); }
.drawer-action[data-copied="true"] { border-color: var(--live); color: var(--live); }
.provenance { border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.8rem; color: var(--ink-3); }
.provenance summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.provenance dl { display: grid; grid-template-columns: 38% 1fr; gap: 6px 10px; margin: 10px 0 0; }
.provenance dt { color: var(--ink-3); }
.provenance dd { margin: 0; color: var(--ink-2); word-break: break-all; }

footer.page-foot { margin-top: 28px; font-size: 0.78rem; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 16px; }

@media (max-width: 960px) {
  .desk { grid-template-columns: 1fr; }
  .map-shell { height: 52vh; min-height: 340px; }
  .feed { height: auto; max-height: none; }
  .feed-list { overflow: visible; }
  .feed:not(.expanded) .feed-list li.overflow { display: none; }
  .feed-more:not([hidden]) {
    display: block; appearance: none; font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer;
    margin: 0 12px 12px; padding: 11px; border-radius: 10px; color: var(--ink);
    background: rgba(244,239,228,0.07); border: 1px solid var(--line-strong);
  }
  .feed-more:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .lower { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .metrics { gap: 8px; }
  .metric { padding: 10px 12px; }
  .metric-value { font-size: 1.35rem; }
  .metric-label { font-size: 0.7rem; }
  /* Block, not flex: a flex column sizes to its children's min-content,
     which let the unwrapped chip row widen the whole page to ~650px and
     made phones render it zoomed out. As a block, the row is exactly the
     screen width and scrolls sideways inside it. */
  .controls { display: block; }
  .areas { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 10px; padding: 2px 16px 4px; scrollbar-width: none; }
  .areas::-webkit-scrollbar { display: none; }
  .area-chip { flex: none; }
  .metro-switch a { padding: 5px 10px; }
  .drawer {
    top: auto; left: 0; right: 0; width: 100%; max-height: 86vh; border-left: none;
    border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0; transform: translateY(100%);
  }
  .drawer.open { transform: translateY(0); }
}
