:root {
  --teal: #1D9E75;
  --teal-deep: #0F6E56;
  --teal-50: #E1F5EE;
  --bg: #F6FBFA;
  --surface: #FFFFFF;
  --line: #E5ECEA;
  --line-strong: #D3DEDA;
  --text: #18302B;
  --muted: #5C6B66;
  --hint: #8A9893;
  --short-bg: #EAF3DE; --short-fg: #3B6D11;
  --mod-bg: #FAEEDA;   --mod-fg: #854F0B;
  --long-bg: #FAECE7;  --long-fg: #993C1D;
  --flat-bg: #EFEDE7;  --flat-fg: #5F5E5A;
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --teal: #2FB68A; --teal-deep: #74D3B1; --teal-50: #15302A;
    --bg: #0E1614; --surface: #16211E; --line: #243330; --line-strong: #33443F;
    --text: #E7F0EC; --muted: #9CB0AA; --hint: #6F827C;
    --short-bg: #1B331A; --short-fg: #A8DC74;
    --mod-bg: #382E12; --mod-fg: #F0C275;
    --long-bg: #3A2018; --long-fg: #F1A283;
    --flat-bg: #222824; --flat-fg: #A7B3AE;
  }
  .emerg-strip { background: #2A1813; border-bottom-color: #45261C; color: #F0B49C; }
  .emerg-strip a, .foot-911 a { color: #F1A283; }
  .foot-911 { background: #2A1813; border-color: #45261C; color: #E7B6A3; }
  .foot-911 b { color: #F0C3B2; }
  .best-time, .map-hint { border-color: #2C4A40; }
}

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }
.skip { position: absolute; left: -999px; top: 6px; background: var(--surface); border: 1px solid var(--line-strong); padding: 8px 14px; border-radius: 8px; z-index: 2000; }
.skip:focus { left: 12px; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px 48px; }

.emerg-strip { background: #FBEEE9; color: #7c2f18; border-bottom: 1px solid #F0C9BB; font-size: 13.5px; text-align: center; padding: 8px 16px; }
.emerg-strip a { color: #993C1D; font-weight: 600; }
.emerg-strip strong { font-weight: 600; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--teal);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.logo svg { width: 22px; height: 22px; }
.wordmark { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.tagline { font-size: 12.5px; color: var(--teal-deep); }
.meta { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px;
}
.updated { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.dot.live { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ER vs urgent-care selector — a prominent, global facility-type switch. */
.kind-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 6px; margin: 4px 0 14px;
}
.kind-toggle button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: none; border: 1.5px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; color: var(--muted); padding: 12px 14px; text-align: left;
  transition: background .12s, color .12s, border-color .12s;
}
.kind-toggle button svg { width: 26px; height: 26px; flex: none; }
.kind-toggle .kc-txt { display: flex; flex-direction: column; line-height: 1.2; }
.kind-toggle .kc-txt b { font-size: 15.5px; font-weight: 600; }
.kind-toggle .kc-txt small { font-size: 11.5px; color: var(--hint); font-weight: 400; }
.kind-toggle button:hover { color: var(--text); }
.kind-toggle button[data-kind="er"].active {
  background: var(--teal-50); color: var(--teal-deep); border-color: var(--teal);
}
.kind-toggle button[data-kind="urgent"].active {
  background: #E7F0FA; color: #1A5C97; border-color: #2C7BC0;
}
.kind-toggle button.active .kc-txt small { color: inherit; opacity: .8; }
@media (prefers-color-scheme: dark) {
  .kind-toggle button[data-kind="urgent"].active { background: #122636; color: #8FC4EE; border-color: #2C7BC0; }
}
.kind-note {
  display: flex; align-items: flex-start; gap: 10px;
  background: #E7F0FA; color: #1A5C97; border: 1px solid #BCD8F0;
  border-radius: var(--radius-sm); padding: 10px 13px; margin: -6px 0 16px; font-size: 13px;
}
.kind-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.kind-note a { color: inherit; font-weight: 600; text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  .kind-note { background: #122636; color: #9FCBEF; border-color: #244B6B; }
}
.popup-badge.uc {
  display: inline-block; font-size: 11px; font-weight: 600; color: #1A5C97;
  background: #E7F0FA; border-radius: 5px; padding: 1px 7px; margin: 3px 0;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  background: none; border: none; cursor: pointer; font: inherit;
  padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; border-radius: 0;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--teal-deep); border-bottom-color: var(--teal); font-weight: 500; }

.tab { display: none; }
.tab.active { display: block; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 23px; font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.stat .value.short { color: var(--short-fg); }
.stat .value.mod { color: var(--mod-fg); }
.stat .value.long { color: var(--long-fg); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .title { font-size: 16px; font-weight: 600; }
.toolbar .title span { color: var(--muted); font-weight: 400; }
.controls { display: flex; gap: 8px; }
select {
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}

.er-filter { width: 100%; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 13px; margin-bottom: 12px; }
.er-filter:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.er-link { text-decoration: none; color: inherit; }
.er-link:hover { border-color: var(--line-strong); }
.er-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 8px; }
.er {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
}
.er .info { flex: 1; min-width: 0; }
.er .name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er .sub { font-size: 13px; color: var(--muted); }
.er .spark { flex: none; }
.pill {
  flex: none; font-size: 13px; font-weight: 500; padding: 4px 11px;
  border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill.short { background: var(--short-bg); color: var(--short-fg); }
.pill.moderate { background: var(--mod-bg); color: var(--mod-fg); }
.pill.long { background: var(--long-bg); color: var(--long-fg); }
.pill.unknown, .pill.closed { background: var(--flat-bg); color: var(--flat-fg); }
.no-wait { font-size: 12px; color: var(--hint); }

.trends-head { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.trends-head select { flex: 1; min-width: 220px; max-width: 460px; }
.best-time {
  background: var(--teal-50); border: 1px solid #BFE6D7; border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: var(--teal-deep);
}
.best-time.empty { background: var(--surface); border-color: var(--line); color: var(--muted); }
.best-time b { font-weight: 600; }
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; height: 340px; position: relative; }
[hidden] { display: none !important; }
.trends-views { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.trends-views button { background: none; border: none; cursor: pointer; font: inherit; font-size: 13.5px; padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; }
.trends-views button:hover { color: var(--text); }
.trends-views button.active { color: var(--teal-deep); border-bottom-color: var(--teal); font-weight: 500; }
.trends-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.trends-controls select { flex: 1; min-width: 200px; max-width: 460px; }
.trend-note { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.trend-note b { color: var(--text); font-weight: 600; }
.compare-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; background: var(--teal-50); color: var(--teal-deep); border: 1px solid #BFE6D7; border-radius: 999px; padding: 3px 6px 3px 11px; }
.cmp-chip button { background: none; border: none; cursor: pointer; color: inherit; font-size: 15px; line-height: 1; }
.heatmap { margin-bottom: 14px; }
.hm-row { display: flex; align-items: center; gap: 2px; margin-bottom: 2px; }
.hm-head { margin-bottom: 4px; }
.hm-day { width: 34px; font-size: 11px; color: var(--muted); flex: none; }
.hm-hl { flex: 1; font-size: 9px; color: var(--hint); }
.hm-c { flex: 1; height: 17px; border-radius: 2px; background: var(--flat-bg); }
.hm-c.short { background: #2FB67A; } .hm-c.moderate { background: #E8A23D; } .hm-c.long { background: #D9603C; }
.tl { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hint); margin-top: 5px; flex: none; }
.tl-dot.on { background: var(--long-fg); }
.tl-body { flex: 1; min-width: 0; }
.tl-name { font-size: 14px; font-weight: 500; }
.tl-meta { font-size: 12.5px; color: var(--muted); }

.find-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.find-row { display: flex; gap: 8px; }
#addr { flex: 1; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 13px; }
#addr:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--teal-deep); padding: 10px 2px 4px; }
.linkbtn svg { width: 15px; height: 15px; }
.find-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.find-note em { font-style: normal; color: var(--teal-deep); }
.rec-head { font-size: 12.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 18px 0 9px; }
.rec { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; margin-bottom: 8px; }
.rec.best { border-color: var(--teal); border-width: 1.5px; background: var(--teal-50); }
.rec.muted { background: var(--bg); }
.rec-rank { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--flat-bg); color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.rec.best .rec-rank { background: var(--teal); color: #fff; }
.rec-body { flex: 1; min-width: 0; }
.rec-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.wsev { font-weight: 500; padding: 1px 7px; border-radius: 999px; }
.wsev.short { background: var(--short-bg); color: var(--short-fg); }
.wsev.moderate { background: var(--mod-bg); color: var(--mod-fg); }
.wsev.long { background: var(--long-bg); color: var(--long-fg); }
.wsev.unknown { background: var(--flat-bg); color: var(--flat-fg); }
.wx { color: var(--teal-deep); }
.rec-total { flex: none; text-align: right; }
.rt-num { font-size: 19px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rec.best .rt-num { color: var(--teal-deep); }
.rt-lab { font-size: 11px; color: var(--muted); }
.rt-dash { flex: none; font-size: 18px; color: var(--hint); }

.cls-summary { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 8px; }
.cls-big { font-size: 38px; font-weight: 600; color: var(--hint); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cls-big.on { color: var(--long-fg); }
.cls-big-lab { font-size: 15px; font-weight: 500; color: var(--text); }
.cls-outage { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cls-allopen { background: var(--short-bg); color: var(--short-fg); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; font-weight: 500; margin-top: 10px; }
.cls { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; margin-bottom: 8px; }
.cls.active { border-left: 3px solid var(--long-fg); border-radius: var(--radius); }
.cls-body { flex: 1; min-width: 0; }
.cls-name { font-size: 15px; font-weight: 500; }
.cls-prov { font-size: 12px; color: var(--muted); font-weight: 400; }
.kpill { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.kpill.clo { background: var(--long-bg); color: var(--long-fg); }
.kpill.div { background: var(--mod-bg); color: var(--mod-fg); }
.cls-reason { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls-dur { flex: none; text-align: right; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.cls-since { font-size: 11px; font-weight: 400; color: var(--hint); }

.map-search { display: flex; gap: 8px; margin-bottom: 14px; }
.addr-wrap { position: relative; flex: 1; }
.map-search #map-addr { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 14px; }
.map-search #map-addr:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.map-search .linkbtn { white-space: nowrap; padding: 10px 6px; }
/* address autocomplete dropdown */
.addr-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1200;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; max-height: 320px; overflow-y: auto; }
.addr-opt { padding: 9px 13px; font-size: 13.5px; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--line); line-height: 1.35; }
.addr-opt:last-child { border-bottom: none; }
.addr-opt:hover, .addr-opt.active { background: var(--teal-50); color: var(--teal-deep); }
.map-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
#leaflet { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.map-panel { max-height: 560px; overflow-y: auto; }
.map-legend { display: flex; flex-wrap: wrap; gap: 9px 14px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.map-legend i.sev { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.sev.short { background: #2FB67A; } .sev.moderate { background: #E8A23D; } .sev.long { background: #D9603C; } .sev.closed { background: #B23A2A; } .sev.unknown { background: #B7C1BD; }
.sev.uc-ring { background: #fff; border: 2px solid #2C7BC0; }
.map-hint { font-size: 13px; color: var(--teal-deep); background: var(--teal-50); border: 1px solid #BFE6D7; border-radius: var(--radius-sm); padding: 11px 13px; }
.maprec { cursor: pointer; flex-direction: column; align-items: stretch; padding: 0; gap: 0; }
.maprec .rec-row { display: flex; align-items: center; gap: 13px; padding: 12px 15px; }
.maprec.selected { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-50); }
.rec-detail { display: none; border-top: 1px solid var(--line); padding: 12px 15px; }
.maprec.open .rec-detail { display: block; }
.calc { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.calc-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; color: var(--text); font-variant-numeric: tabular-nums; }
.calc-row span:first-child { color: var(--muted); }
.calc-row.total { font-weight: 600; border-top: 1px solid var(--line-strong); margin-top: 4px; padding-top: 7px; }
/* secondary toggle at the top of search results: posted-wait vs all-by-drive */
.scope-toggle { display: flex; gap: 3px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 12px; }
.scope-toggle button { flex: 1; background: none; border: none; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--muted); padding: 7px 6px; border-radius: 6px; white-space: nowrap; }
.scope-toggle button:hover { color: var(--text); }
.scope-toggle button.active { background: var(--surface); color: var(--teal-deep); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.maprec.nowait .rt-num { color: var(--muted); font-weight: 500; }
.maprec.nowait .rt-lab { color: var(--hint); }
/* call-ahead + open-now */
.rec-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 5px; font-size: 12.5px; }
.rec-phone, .popup-contact a { color: var(--teal-deep); font-weight: 600; text-decoration: none; white-space: nowrap; }
.rec-phone:hover { text-decoration: underline; }
.open-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--flat-bg); color: var(--flat-fg); white-space: nowrap; }
.open-badge.open { background: var(--short-bg); color: var(--short-fg); }
.open-badge.closed { background: var(--long-bg); color: var(--long-fg); }
.popup-contact { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; }
.rg-cities { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.7; }
.rg-cities a { color: var(--teal-deep); text-decoration: none; }
.rg-cities a:hover { text-decoration: underline; }
.hp-cihi { font-size: 15px; color: var(--text); margin: 0 0 6px; line-height: 1.5; }
.hp-contact { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 8px 0 4px; font-size: 14px; }
.hp-contact a { color: var(--teal-deep); font-weight: 600; text-decoration: none; }
.hp-contact a:hover { text-decoration: underline; }
.calc-row.pred { color: #1A5C97; }
.calc-row.pred span:last-child { font-weight: 600; }
@media (prefers-color-scheme: dark) { .calc-row.pred { color: #8FC4EE; } }
/* 'now -> on arrival' hint on a recommendation card */
.arr { color: var(--hint); font-size: 12px; margin-left: 6px; white-space: nowrap; }
.prdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2C7BC0; margin-right: 6px; vertical-align: middle; }
.pred-note { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px; margin-top: 10px; line-height: 1.45; }
.pred-note.ready { border-style: solid; border-color: #BCD8F0; background: #F3F8FD; }
@media (prefers-color-scheme: dark) { .pred-note.ready { background: #122636; border-color: #244B6B; } }
/* "Closer ER but no posted wait" callout — amber attention, reusing the moderate-wait palette. */
.pred-note.attn { border-style: solid; border-color: #EAD3A0; background: var(--mod-bg); color: #6E4410; }
.pred-note.attn .prdot { background: var(--mod-fg); }
@media (prefers-color-scheme: dark) { .pred-note.attn { background: rgba(133,79,11,0.18); border-color: rgba(133,79,11,0.45); color: #E9CB8E; } }
.rec-head.attn { color: var(--mod-fg); }
.calc-row.total span:first-child { color: var(--text); }
.calc-notes { margin-top: 10px; font-size: 13px; color: var(--muted); }
.dq { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-bottom: 7px; }
.dq i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dq-high { color: var(--short-fg); } .dq-high i { background: var(--short-fg); }
.dq-medium { color: var(--mod-fg); } .dq-medium i { background: var(--mod-fg); }
.dq-low { color: var(--long-fg); } .dq-low i { background: var(--long-fg); }
.cn { margin-bottom: 4px; }
.cn .wxdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 5px; }
.calc-links { margin-top: 9px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.calc-links a { color: var(--teal-deep); font-size: 13px; font-weight: 500; }
.watch-btn { font: inherit; font-size: 12.5px; font-weight: 500; background: var(--teal-50); color: var(--teal-deep); border: 1px solid #BFE6D7; border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.watch-btn[disabled] { opacity: 0.65; cursor: default; }
.watch { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 6px; }
.watch-info { flex: 1; min-width: 0; }
.watch-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-cond { font-size: 12px; color: var(--muted); }
.watch-x { background: none; border: none; cursor: pointer; color: var(--hint); font-size: 16px; line-height: 1; }
.watch-toast { background: var(--short-bg); color: var(--short-fg); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; margin-bottom: 6px; }
.popup-name { font-weight: 600; font-size: 13.5px; }
.popup-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 5px; }
@media (max-width: 760px) {
  .map-layout { grid-template-columns: 1fr; }
  #leaflet { height: 360px; }
  .map-panel { max-height: none; }
  .er-list { grid-template-columns: 1fr; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  background: var(--teal); color: #fff; border: none; border-radius: var(--radius-sm); padding: 9px 16px;
}
.btn.ghost { background: var(--surface); color: var(--teal-deep); border: 1px solid var(--line-strong); }
.btn svg { width: 16px; height: 16px; }

table.src { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.src th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.src td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.src td.num { text-align: right; font-variant-numeric: tabular-nums; }
code { background: var(--teal-50); color: var(--teal-deep); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.api-list { list-style: none; padding: 0; margin: 0; }
.api-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.api-list li:last-child { border: none; }
.api-list .desc { color: var(--muted); }
.loading { color: var(--hint); padding: 24px 0; text-align: center; font-size: 14px; }

.site-footer { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.6; }
.site-footer p { margin: 0 0 10px; }
.site-footer b { color: var(--text); font-weight: 600; }
.site-footer a { color: var(--teal-deep); }
.foot-911 { display: flex; gap: 12px; background: #FBEEE9; border: 1px solid #F0C9BB; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; color: #7c2f18; }
.foot-911 svg { width: 22px; height: 22px; flex: none; color: #C2603C; margin-top: 1px; }
.foot-911 b { color: #7c2f18; }
.foot-911 ul { margin: 8px 0 0; padding-left: 18px; }
.foot-911 li { margin-bottom: 4px; }
.foot-911 a { color: #993C1D; font-weight: 600; }
.foot-meta { color: var(--hint); }

.hp-back { display: inline-block; font-size: 13px; color: var(--teal-deep); margin: 8px 0 14px; }
.hp-name { font-size: 26px; font-weight: 600; margin: 0 0 2px; letter-spacing: -0.02em; }
.hp-loc { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.hp-loc a { color: var(--teal-deep); }
.hp-hero { display: flex; align-items: center; gap: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; }
.hp-num { font-size: 42px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; flex: none; }
.hp-num.short { color: var(--short-fg); } .hp-num.moderate { color: var(--mod-fg); } .hp-num.long { color: var(--long-fg); }
.hp-num.closed { color: var(--long-fg); font-size: 30px; } .hp-num.unknown { color: var(--hint); }
.hp-lab { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.hp-asof { font-size: 12.5px; color: var(--hint); margin-top: 6px; }
.hp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.hp-fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.hp-fact-lab { font-size: 12px; color: var(--muted); }
.hp-fact-val { font-size: 20px; font-weight: 600; margin-top: 2px; }
.hp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.hp-card h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.hp-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.hp-list li { margin-bottom: 4px; }
.hp-dim { color: var(--hint); }
.hp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 8px; }

.rg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 8px; }
.rg-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 15px; }
.rg-row:hover { border-color: var(--line-strong); }
.rg-info { flex: 1; min-width: 0; }
.rg-name { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-city { font-size: 12.5px; color: var(--muted); }

.resp-banner { display: none; align-items: center; gap: 10px; background: var(--mod-bg); border: 1px solid #E9C97E; color: var(--mod-fg); border-radius: var(--radius-sm); padding: 9px 14px; margin-bottom: 14px; font-size: 13.5px; }
.resp-banner.show { display: flex; }
.resp-banner svg { width: 17px; height: 17px; flex: none; }
.resp-banner .x { margin-left: auto; cursor: pointer; opacity: 0.6; font-size: 16px; background: none; border: none; color: inherit; }
