/* OutageWatch web. Direction: "V2, data on the diagram". A calm forecast-led
   answer, a restoration timeline, and an honest one-line schematic built from
   the real outages. Light, one panel, the timeline is the signature. */
:root {
  --ground: #eceef0;
  --ink: #20242a;
  --out: #c0562a;
  --restored: #2f7d5b;
  --restored-text: #276b4e;
  --muted: #5c6069;
  --surface: #ffffff;
  --surface-2: #f5f6f7;
  --line: #d8dbe0;
  --line-soft: #e3e5e9;
  --focus: #20242a;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, dl, dd, figure, figcaption { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px;
}

/* ---------- header ---------- */
header.site { border-bottom: 1px solid var(--line-soft); background: var(--ground); }
.site-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-block; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 7px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.98rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- hero + finder ---------- */
.hero { padding-top: 44px; padding-bottom: 2px; }
.hero-title { font-size: clamp(2rem, 5.4vw, 2.85rem); font-weight: 700; letter-spacing: -0.022em; line-height: 1.04; text-wrap: balance; }
.hero-sub { color: var(--muted); margin-top: 13px; max-width: 46ch; font-size: 1.06rem; }
.finder { margin-top: 26px; max-width: 580px; }

.modes { display: inline-flex; gap: 3px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 11px; padding: 4px; }
.modes .tab { background: none; border: 0; border-radius: 8px; padding: 8px 18px; font: inherit; font-size: 0.96rem; color: var(--muted); cursor: pointer; min-height: 40px; transition: color .12s, background .12s; }
.modes .tab:hover { color: var(--ink); }
.modes .tab[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(32,36,42,0.12); }

.finder-row {
  display: flex; align-items: stretch; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(32,36,42,0.04), 0 12px 28px rgba(32,36,42,0.06);
  transition: border-color .12s, box-shadow .12s;
}
.finder-row:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(32,36,42,0.13), 0 12px 28px rgba(32,36,42,0.08); }
.finder-row input {
  flex: 1 1 auto; min-width: 0; width: 100%; font: inherit; font-size: 1.08rem; color: var(--ink);
  background: transparent; border: 0; padding: 17px 20px; min-height: 60px;
}
/* the address input sits inside the .ac autocomplete wrapper, so it is not a
   direct flex child of the bar; make it fill the wrapper or its placeholder
   clips at the default input width instead of at the bar edge. */
.finder-row .ac { display: flex; }
.finder-row input:focus { outline: none; }
.finder-row input::placeholder { color: #8b8f97; }
.finder-go {
  flex: 0 0 auto; margin: 7px; padding: 0 24px; border: 0; border-radius: 9px;
  background: var(--ink); color: #fff; font: inherit; font-weight: 600; font-size: 1.02rem;
  cursor: pointer; transition: background .12s;
}
.finder-go:hover { background: #2c313a; }
.locate-btn { display: inline-block; margin-top: 15px; background: none; border: 0; color: var(--restored-text); font: inherit; font-size: 0.99rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; min-height: 40px; }
.locate-btn:hover { color: var(--ink); }

/* autocomplete */
.ac { position: relative; flex: 1 1 auto; min-width: 0; }
.ac-list { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(32,36,42,.12); }
.ac-item { padding: 11px 14px; cursor: pointer; }
.ac-item + .ac-item { border-top: 1px solid var(--line-soft); }
.ac-item:hover, .ac-item.sel { background: var(--surface-2); }
.ac-item .t { font-weight: 600; }
.ac-item .s { font-size: 0.85rem; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #2c313a; }
.btn-ink:disabled { opacity: .6; cursor: default; }
.btn-soon { background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: default; }

/* ---------- primary panel ---------- */
main { padding-bottom: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; box-shadow: 0 1px 2px rgba(32,36,42,0.05), 0 8px 24px rgba(32,36,42,0.05); margin-top: 26px; padding: 30px 30px 34px; }
.asof { font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; min-height: 1em; }
.cond-word { color: var(--ink); font-weight: 700; letter-spacing: -0.02em; line-height: 1.04; font-size: clamp(2.2rem, 7vw, 3.6rem); }
.cond-word .em-out { color: var(--out); }
.cond-word .em-on { color: var(--restored-text); }
.place { font-size: clamp(1.15rem, 3.2vw, 1.5rem); font-weight: 600; margin-top: 6px; }
.detail { color: var(--muted); margin-top: 12px; max-width: 52ch; font-size: 1.03rem; }

/* framed live map, sits right under the status */
.panel-map { margin-top: 24px; }
#map { height: 320px; border-radius: 12px; border: 1px solid var(--line-soft); overflow: hidden; background: var(--surface-2); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---------- restoration timeline (signature) ---------- */
.forecast { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.fc-cap { margin-bottom: 30px; }
.fc-cap h2 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }
.fc-cap p { color: var(--muted); margin-top: 4px; font-size: 1rem; }
.fc-strip { position: relative; padding-top: 46px; padding-bottom: 30px; }
.fc-bar { position: relative; display: flex; height: 18px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fc-seg { height: 100%; }
.fc-out { background: var(--out); }
.fc-back { background: var(--restored); }
.fc-tick { position: absolute; top: 3px; height: 12px; width: 1px; background: rgba(255,255,255,0.55); transform: translateX(-50%); }
.fc-stop { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--restored); transform: translate(-50%, -50%); box-shadow: 0 1px 2px rgba(32,36,42,0.18); }
.fc-callout { position: absolute; top: 0; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.fc-callout::after { content: ""; display: block; width: 1px; height: 12px; margin: 6px auto 0; background: var(--restored); }
.fc-callout-time { display: block; color: var(--restored-text); font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.fc-callout-note { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 1px; }
.fc-hours { position: absolute; left: 0; right: 0; bottom: 0; height: 24px; }
.fc-hours span { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; padding-top: 8px; }
.fc-hours .h-now { transform: translateX(0); left: 0; }
.fc-hours .h-end { transform: translateX(-100%); }
.fc-hours .h-back { color: var(--restored-text); font-weight: 700; }
.fc-legend { display: flex; gap: 20px; margin-top: 4px; font-size: 0.88rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 3px; }
.lg-out::before { background: var(--out); }
.lg-back::before { background: var(--restored); }

/* ---------- why it is out (annotated schematic) ---------- */
.why { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.why h2 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }
.why-lead { color: var(--muted); margin-top: 4px; font-size: 1rem; max-width: 62ch; }
.sch-scroll { margin-top: 18px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 16px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sch-scroll svg { display: block; width: 100%; min-width: 560px; height: auto; }
.sch-hint { color: var(--muted); font-size: 0.82rem; margin-top: 10px; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 0.85rem; color: var(--muted); }
.sc { display: inline-flex; align-items: center; gap: 8px; }
.sc-line::before { content: ""; width: 18px; height: 4px; border-radius: 2px; flex: 0 0 auto; }
.sc-live::before { background: var(--restored); }
.sc-out::before { background: var(--out); }
.sc-icon svg { display: block; width: 20px; height: 14px; flex: 0 0 auto; }
.why-note { color: var(--muted); margin-top: 16px; max-width: 62ch; font-size: 0.96rem; }

/* ---------- service facts ---------- */
.facts { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.facts h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.facts-grid { display: grid; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 620px) { .facts-grid { grid-template-columns: 1fr 1fr; column-gap: 44px; } }
.facts-grid > div { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.facts-grid dt { color: var(--muted); font-size: 0.92rem; }
.facts-grid dd { font-family: var(--mono); font-size: 0.9rem; text-align: right; font-variant-numeric: tabular-nums; }
.facts-grid dd.v-out { color: var(--out); }
.facts-grid dd.v-back { color: var(--restored-text); font-weight: 600; }

/* ---------- nearby outages ---------- */
.nearby { margin-top: 44px; }
.sec-head h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.sec-head p { color: var(--muted); margin-top: 3px; font-size: 0.98rem; }
.nb-list { margin-top: 16px; border-top: 1px solid var(--line-soft); }
.nb-row { display: flex; align-items: flex-start; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line-soft); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; color: inherit; cursor: pointer; }
.nb-row:hover .nb-place { text-decoration: underline; text-underline-offset: 3px; }
.nb-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; }
.dot-out { background: var(--out); }
.dot-plan { background: transparent; border: 2px solid var(--out); }
.nb-main { flex: 1 1 auto; min-width: 0; }
.nb-place { font-weight: 600; font-size: 1.04rem; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.nb-tag { font-size: 0.74rem; font-weight: 600; color: var(--out); background: rgba(192,86,42,0.10); border-radius: 5px; padding: 2px 7px; }
.nb-cause { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.nb-meta { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.nb-back { flex: 0 0 auto; text-align: right; line-height: 1.2; }
.nb-back-time { display: block; font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-back-lbl { display: block; color: var(--muted); font-size: 0.82rem; }

/* notices, loading, freshness */
.notice { color: var(--ink); background: rgba(192,86,42,0.08); border-left: 3px solid var(--out); border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 16px 0; font-size: 0.95rem; }
.freshness { color: var(--muted); font-size: 0.82rem; margin-top: 12px; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: sp 0.7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- alerts ---------- */
.alerts { margin-top: 40px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 26px 26px 28px; }
.alerts h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.alerts p { color: var(--muted); margin-top: 4px; font-size: 0.98rem; max-width: 54ch; }
.alerts .btn { margin-top: 16px; }
.push-status { margin-top: 12px; min-height: 1em; color: var(--muted); font-size: 0.95rem; }

/* ---------- how it works ---------- */
.how { margin-top: 52px; }
.how-list { margin-top: 20px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.how-item { padding: 18px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 1fr; gap: 5px; }
@media (min-width: 720px) { .how-item { grid-template-columns: 220px 1fr; gap: 24px; align-items: baseline; } }
.how-item h3 { font-size: 1.04rem; font-weight: 700; }
.how-item p { color: var(--muted); font-size: 1rem; }

/* ---------- get the app ---------- */
.getapp { margin-top: 52px; }
.app-row { margin-top: 20px; display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .app-row { grid-template-columns: repeat(3, 1fr); } }
.app-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.app-card h3 { font-size: 1.06rem; font-weight: 700; }
.app-card p { color: var(--muted); font-size: 0.96rem; }
.app-card .btn { margin-top: 10px; align-self: flex-start; }
.app-note { font-size: 0.86rem; margin-top: 10px; }
.app-soon { background: var(--surface-2); }

/* ---------- footer ---------- */
footer { margin-top: 56px; border-top: 1px solid var(--line-soft); padding: 30px 0 48px; }
.disc { color: var(--muted); font-size: 0.92rem; max-width: 70ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.foot-links a { color: var(--ink); text-decoration: none; font-size: 0.95rem; min-height: 44px; display: inline-flex; align-items: center; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-brand { margin-top: 18px; font-weight: 700; color: var(--ink); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,24,28,.5); display: none; z-index: 50; align-items: flex-end; justify-content: center; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 22px 22px 30px; border: 1px solid var(--line-soft); }
@media (min-width: 620px) { .modal-back { align-items: center; } .modal { border-radius: 18px; } }
.modal .x { float: right; background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.modal h2 { margin: 2px 0; font-size: 1.25rem; }
.modal .eta { color: var(--out); font-family: var(--mono); margin: 0 0 16px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--mono); }
.explain-h { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.74rem; color: var(--muted); margin: 20px 0 8px; font-weight: 700; }
.explain { white-space: pre-wrap; }
.explain.loading { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .spin { border-top-color: var(--line); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding-top: 32px; }
  .panel { padding: 22px 18px 26px; border-radius: 14px; }
  .alerts { padding: 20px 18px 22px; }
  .finder-row input { padding: 15px 16px; min-height: 56px; font-size: 1.04rem; }
  .finder-go { padding: 0 18px; margin: 6px; }
}
