/* Shelter Sign theme: the black and signal yellow of the fallout shelter sign.
   Yellow is for emphasis and controls; red is reserved for fallout that reaches you. */
@font-face {
  font-family: "Oswald";
  src: url("../assets/fonts/oswald-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
:root {
  --bg: #efece2;
  --surface: #ffffff;
  --ink: #141413;
  --ink-2: #55524a;
  --ink-3: #85837c;
  --line: #d6d2c4;
  --edge: #141413;
  --yellow: #f5c800;
  --on-yellow: #141413;
  --hazard: #c8102e;
  --hazard-soft: rgba(200, 16, 46, 0.2);
  --rain: #2f6fd0;
  --focus: #141413;
  --sign: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0d;
    --surface: #1a1a19;
    --ink: #f1eee4;
    --ink-2: #b5b1a4;
    --ink-3: #8a877c;
    --line: #36352f;
    --edge: #5a584e;
    --hazard: #ff4d5e;
    --hazard-soft: rgba(255, 77, 94, 0.26);
    --rain: #5b93e6;
    --focus: #f5c800;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
h1, h2 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; }
p { margin: 0; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.95rem; }
.brand-tag { color: var(--ink-2); font-size: 0.8rem; }
.place { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.place input { flex: 1 1 160px; max-width: 260px; min-width: 0; }
input, button {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); padding: 8px 12px; min-height: 40px;
}
button { cursor: pointer; background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }

/* Cards */
main { padding-top: 16px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
#report { display: flex; flex-direction: column; gap: 16px; }
#report[hidden], .welcome[hidden] { display: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.status { color: var(--ink-2); min-height: 1.5em; }
.status:empty { display: none; }
.status.error { color: var(--ink); border-left: 3px solid var(--hazard); padding-left: 10px; }
.welcome p { margin-top: 10px; color: var(--ink-2); max-width: 62ch; }
.hint { color: var(--ink-2); font-size: 0.9rem; margin-top: 4px; }

/* Headline */
.eyebrow { color: var(--ink-2); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.lede { margin-top: 10px; color: var(--ink-2); max-width: 62ch; }
.callout { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--hazard); background: var(--bg); border-radius: 0 6px 6px 0; font-size: 0.95rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; margin: 18px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stats > div { background: var(--surface); padding: 12px 14px; }
.stats dt { color: var(--ink-2); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.stats dd { margin: 2px 0 0; }
.stats .val { display: block; font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stats .sub { display: block; color: var(--ink-2); font-size: 0.85rem; }
.dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--rain); margin-right: 0.35em; vertical-align: 0.08em; }

/* Segmented control */
.controls { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 2px; margin: 0; gap: 2px; }
.seg legend { float: left; padding: 0 8px 0 8px; color: var(--ink-2); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; min-height: 0; cursor: pointer; }
.seg span { display: block; padding: 5px 12px; border-radius: 4px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.seg input:checked + span { background: var(--ink); color: var(--surface); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Map */
.map { height: min(60vh, 460px); min-height: 300px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); z-index: 0; }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
  .leaflet-control-attribution, .leaflet-bar a { background: var(--surface) !important; color: var(--ink-2) !important; }
}
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 10px 0 0; color: var(--ink-2); font-size: 0.85rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 12px; flex: none; }
.sw-hit { background: var(--hazard-soft); border: 2px solid var(--hazard); border-radius: 2px; }
.sw-miss { border: 1.5px solid var(--ink-3); border-radius: 2px; }
.sw-you { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--ink); }
.map-label {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; box-shadow: none;
  padding: 0 5px; font: 500 11.5px/1.5 system-ui, sans-serif; white-space: nowrap;
}
.map-label::before { display: none; }
.map-label.hit { font-weight: 700; border-color: var(--hazard); }
.map-label.you { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 700; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-2); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
.targets td, .targets th { white-space: nowrap; padding-right: 16px; }
.targets td:first-child { white-space: normal; min-width: 130px; }
.targets .kind { display: block; color: var(--ink-2); font-size: 0.8rem; }
.targets td:last-child, .targets th:last-child { text-align: right; padding-right: 0; }
.targets tr.path td { font-weight: 600; }
.targets tr.path .kind { font-weight: 400; }
.targets tr.clear td { color: var(--ink-2); }
.mark { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; margin-right: 0.45em; border: 1.5px solid var(--ink-3); }
.path .mark, .blast .mark { background: var(--hazard); border-color: var(--hazard); }
.targets tr.air td { color: var(--ink-2); }
.air .mark { border-style: dotted; }
.edge .mark { border-color: var(--hazard); background: linear-gradient(90deg, var(--hazard) 50%, transparent 50%); }

/* Timeline */
.timeline { display: flex; gap: 4px; overflow-x: auto; margin-top: 12px; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.tick {
  flex: 0 0 auto; width: 68px; min-height: 0; padding: 6px 2px; background: transparent; color: var(--ink);
  border: 1px solid transparent; border-radius: 8px; font-weight: 400; display: flex; flex-direction: column; align-items: center; gap: 1px;
  scroll-snap-align: start; font-variant-numeric: tabular-nums;
}
.tick:hover { border-color: var(--line); }
.tick[aria-pressed="true"] { border-color: var(--ink); background: var(--bg); }
.tick .day { font-size: 0.7rem; color: var(--ink-2); height: 1.2em; text-transform: uppercase; letter-spacing: 0.04em; }
.tick .hr { font-size: 0.8rem; font-weight: 600; }
.tick .spd { font-size: 0.75rem; color: var(--ink-2); }
.tick .count { font-size: 1.5rem; font-weight: 650; line-height: 1.3; }
.tick .count.zero { color: var(--ink-3); font-weight: 500; }
.tick .wet { height: 8px; }

/* Profile */
.profile { margin-top: 12px; }
.card > .callout { margin-top: 12px; }
.profile td { padding-top: 6px; padding-bottom: 6px; font-size: 0.92rem; }
.profile .alt { white-space: nowrap; width: 1%; padding-right: 16px; }
.profile .role { width: 1%; white-space: nowrap; padding-right: 16px; color: var(--ink-2); font-size: 0.8rem; }
.profile .from { white-space: nowrap; width: 1%; padding-right: 16px; }
.profile .mph { white-space: nowrap; width: 1%; text-align: right; padding-right: 10px; }
.profile .barcell { padding-right: 0; }
.profile tr.above td { color: var(--ink-3); }
.profile tr.cloud .role { color: var(--ink); font-weight: 600; }
.arrow { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; fill: currentColor; }
.bar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--hazard); min-width: 2px; }
tr.above .bar { background: var(--line); }

/* Guidance + footer */
.guidance ol { margin: 12px 0 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; max-width: 68ch; }
.guidance .hint { margin-top: 12px; }
.foot { color: var(--ink-2); font-size: 0.85rem; display: flex; flex-direction: column; gap: 8px; max-width: 76ch; padding: 4px; }

@media (max-width: 520px) {
  .card { padding: 16px; }
  .place { justify-content: stretch; }
  .place input { max-width: none; flex-basis: 100%; }
  .place button { flex: 1; }
  .profile .role { display: none; }
}

/* ---- Shelter Sign theme ---- */
h1, .h1 { font-family: var(--sign); font-weight: 600; letter-spacing: 0; line-height: 1.15; font-size: clamp(1.7rem, 5vw, 2.4rem); text-transform: none; }
h1 em, .h1 em { font-style: normal; background: var(--yellow); color: var(--on-yellow); padding: 0 0.22em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
h2 { font-family: var(--sign); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase; }
.eyebrow, .stats dt, th, .seg legend, .tick .day { font-family: var(--sign); font-weight: 500; letter-spacing: 0.08em; }

.top { background: #141413; color: #f1eee4; border-bottom: 4px solid var(--yellow); }
.brand-name { font-family: var(--sign); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.1em; color: var(--yellow); line-height: 1.15; }
.brand-tag { color: #c9c5b8; }
.top :focus-visible { outline-color: var(--yellow); }
.top input { background: #ffffff; color: #141413; border-color: #ffffff; border-radius: 2px; }
.top button { font-family: var(--sign); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 2px; background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.top button.ghost { background: transparent; color: #f1eee4; border-color: #6b695e; font-weight: 500; }

.card { border: 2px solid var(--edge); border-radius: 3px; }
.stats { border-radius: 2px; border-color: var(--edge); background: var(--edge); }
.callout { border-left: 6px solid var(--yellow); border-radius: 0; }
.status.error { border-left: 6px solid var(--hazard); }
.map { border-radius: 2px; border-color: var(--edge); }

.seg { border-radius: 2px; border-color: var(--edge); }
.seg span { border-radius: 1px; }
.seg input:checked + span { background: var(--yellow); color: var(--on-yellow); }

.tick { border-radius: 2px; }
.tick[aria-pressed="true"] { background: var(--yellow); border-color: var(--edge); color: var(--on-yellow); }
.tick[aria-pressed="true"] .day, .tick[aria-pressed="true"] .spd, .tick[aria-pressed="true"] .count.zero { color: var(--on-yellow); }
.tick .count { font-family: var(--sign); }

.bar { background: var(--ink); border-radius: 0 2px 2px 0; }
.map-label { border-radius: 2px; }
.sw-hit, .sw-miss { border-radius: 0; }

/* ---- Site navigation, notice strip and content pages ---- */
a.brand { text-decoration: none; color: inherit; }
.nav { border-top: 1px solid #36352f; }
.nav-row { display: flex; gap: 4px 22px; overflow-x: auto; padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.nav a { font-family: var(--sign); font-weight: 500; font-size: 0.92rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: #c9c5b8; padding: 9px 0 7px; border-bottom: 3px solid transparent; }
.nav a:hover { color: #ffffff; }
.nav a[aria-current="page"] { color: var(--yellow); border-bottom-color: var(--yellow); }
.notice { background: var(--yellow); color: var(--on-yellow); font-size: 0.85rem; padding: 5px 0; }
.notice .wrap { display: block; }

.prose { padding: 28px; }
.prose > * { max-width: 68ch; }
.prose h2 { margin-top: 1.9em; }
.prose p, .prose ul, .prose ol, .prose table, .prose details { margin-top: 0.8em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose .lede { font-size: 1.1rem; margin-top: 12px; }
.prose table { width: auto; min-width: min(100%, 360px); }
.prose td, .prose th { padding-right: 24px; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.cta { margin-top: 2em !important; }
a.button { display: inline-block; background: var(--yellow); color: var(--on-yellow); font-family: var(--sign); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 10px 18px; border: 2px solid var(--edge); border-radius: 2px; }
.city-list { list-style: none; padding: 0 !important; columns: 3 180px; max-width: none !important; }
.city-list li { margin: 0 0 0.45em !important; break-inside: avoid; }
.city-intro { padding: 20px; }
.welcome p + p { margin-top: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 520px) { .prose { padding: 18px; } }

/* Scope box under the map */
.scope { margin-top: 14px; padding: 10px 12px; border-left: 6px solid var(--yellow); background: var(--bg); font-size: 0.92rem; }
.scope summary { cursor: pointer; }
.scope p, .scope ul { margin-top: 0.7em; }
.scope ul { padding-left: 1.3em; }
.scope li + li { margin-top: 0.3em; }
