:root {
  --paper: #F3EFE6;
  --band: #EAE3D5;
  --surface: #FBF9F4;
  --ink: #1D1B18;
  --ink-2: #4A453E;
  --muted: #7A7368;
  --rule: #D8CFBE;
  --grid: #E6DFD0;
  --land: #E2DACA;
  --land-edge: #CFC5B1;
  --quake: #D4461A;
  --accent: #D4461A;
  --accent-dark: #A8360F;
  --accent-light: #EBA587;
  --accent-soft: #F2C9B6;
  --old: #9A9182;
  --plate: #8B6F47;
  --d1: #E8784A;
  --d2: #B23A10;
  --d3: #5E1C07;
  --green: #4C9A5B;
  --yellow: #E2B42A;
  --orange: #E07B22;
  --red: #C62828;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --top: 58px;
  --sub: 40px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--mast) + 12px); }
body {
  --mast: calc(var(--top) + var(--sub));
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; margin: 0; }
small { font: 400 12px var(--sans); color: var(--muted); margin-left: 4px; }
.mono { font-family: var(--mono); }

/* Section accents: each hazard swaps the same named tokens */
[data-section="tsunami"] {
  --accent: #0A7EA4; --accent-dark: #075F7D; --accent-light: #8CC9E0; --accent-soft: #C6E3EE;
  --d1: #4FAFD6; --d2: #0A7EA4; --d3: #064866;
}
[data-section="volcano"] {
  --accent: #B07410; --accent-dark: #85560A; --accent-light: #E5BE78; --accent-soft: #F1DDB4;
  --d1: #E0A63C; --d2: #B07410; --d3: #6B3F05;
}
[data-section="near"] { --sub: 0px; }

/* Masthead: hazard tabs, then the pages of the current hazard */
.masthead {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar { height: var(--top); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 500 22px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 24px; height: 24px; fill: none; stroke: var(--quake); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sections { display: flex; gap: 2px; }
.sections a { padding: 6px 12px; text-decoration: none; color: var(--ink-2); font-size: 15px; position: relative; display: flex; align-items: center; gap: 8px; }
.sections a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); opacity: .35; transition: opacity .2s; }
.sections a[data-sec="quake"] { --dot: var(--quake); }
.sections a[data-sec="tsunami"] { --dot: #0A7EA4; }
.sections a[data-sec="volcano"] { --dot: #B07410; }
.sections a[data-sec="near"] { --dot: var(--ink); }
.sections a:hover { color: var(--ink); }
.sections a:hover::before, .sections a[aria-current]::before { opacity: 1; }
.sections a[aria-current] { color: var(--ink); font-weight: 500; }
.subnav { height: var(--sub); display: flex; align-items: stretch; gap: 4px; padding: 0 var(--gutter); border-top: 1px solid var(--grid); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; font-size: 14px; color: var(--ink-2); position: relative; white-space: nowrap; }
.subnav a:first-child { padding-left: 0; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); }
.subnav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); }
.subnav a:first-child[aria-current="page"]::after { left: 0; }
.live { display: flex; align-items: center; gap: 10px; font: 400 13px var(--mono); color: var(--ink-2); text-decoration: none; max-width: 420px; min-width: 0; }
.live-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-text b { color: var(--quake); font-weight: 500; }
.live-text span { color: var(--muted); }
.live-dot { --accent: var(--quake); }
.live-dot, .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; flex: none; display: inline-block; }
.live-dot::after, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 2s var(--ease) infinite; }
.live.error .live-dot, .live.error .live-dot::after { background: var(--muted); animation: none; }
@keyframes ping { to { transform: scale(3.2); opacity: 0; } }

/* Shared controls */
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; font-size: 14px; cursor: pointer; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--surface); }
.seg button:not([aria-checked="true"]):hover { background: var(--band); color: var(--ink); }
.text-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; font-size: 15px; }
.text-btn:hover { color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 34px; height: 18px; border-radius: 999px; background: var(--rule); position: relative; transition: background .25s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .25s var(--ease); }
.switch input:checked + .switch-track { background: var(--plate); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.fig-label { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .02em; margin: 0 0 10px; }
.alert-chip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.alert-chip.green { background: var(--green); } .alert-chip.yellow { background: var(--yellow); }
.alert-chip.orange { background: var(--orange); } .alert-chip.red { background: var(--red); }

/* Tooltip */
.tip {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--surface); padding: 9px 12px; border-radius: 3px;
  font-size: 13px; line-height: 1.4; max-width: 260px; box-shadow: 0 8px 24px rgba(29,27,24,.18);
}
.tip strong { display: block; font: 500 18px var(--serif); }
.tip-meta { display: block; font: 400 11px var(--mono); color: #CFC8BB; margin-top: 2px; }
.tip-hint { display: block; font-size: 11px; color: var(--accent-soft); margin-top: 3px; }

/* Now: hero */
.now-hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(24px, 5vw, 56px) var(--gutter) clamp(32px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  min-height: min(820px, calc(100svh - var(--mast)));
}
.latest-label { display: flex; align-items: center; gap: 10px; margin: 0 0 clamp(14px, 2vw, 26px); font-size: 16px; color: var(--ink-2); }
.latest-mag { font: 300 clamp(96px, 15vw, 220px)/.86 var(--serif); letter-spacing: -.045em; color: var(--accent); margin: 0 0 0 -.04em; font-variant-numeric: lining-nums; }
.latest-place { font-size: clamp(32px, 4.2vw, 58px); line-height: 1.02; margin: 14px 0 8px; max-width: 14ch; }
.latest-full { margin: 0 0 28px; color: var(--muted); font-size: 15px; }
.latest-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin: 0 0 22px; border-top: 1px solid var(--ink); }
.latest-facts div { padding: 10px 28px 0 0; }
.latest-facts div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.latest-facts dt { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.latest-facts dd { margin: 2px 0 0; font: 400 21px/1.2 var(--serif); }
.latest.arrive .latest-mag, .latest.arrive .latest-place { animation: arrive .9s var(--ease) both; }
.latest.arrive .latest-place { animation-delay: .08s; }
@keyframes arrive { from { opacity: 0; transform: translateY(24px); } }
.latest-mag, .latest-place, .latest-full, .latest-facts, .latest-label, #latest-more { animation: arrive 1s var(--ease) both; }
.latest-mag { animation-delay: .05s; } .latest-place { animation-delay: .12s; } .latest-full { animation-delay: .18s; }
.latest-facts { animation-delay: .24s; } #latest-more { animation-delay: .3s; }

.globe-wrap { margin: 0; justify-self: center; width: min(100%, 640px); animation: fadein 1.4s var(--ease) both .1s; }
@keyframes fadein { from { opacity: 0; transform: scale(.96); } }
#globe { display: block; width: 100%; aspect-ratio: 1; cursor: grab; touch-action: pan-y; }
#globe:active { cursor: grabbing; }
.globe-wrap figcaption { text-align: center; font: 400 12px var(--mono); color: var(--muted); margin-top: 8px; }

/* Now: day band */
.day {
  background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  padding: clamp(32px, 5vw, 56px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
}
.big-count { font: 300 clamp(88px, 11vw, 168px)/.85 var(--serif); letter-spacing: -.045em; margin: 0; font-variant-numeric: tabular-nums; }
.day-count h2 { font-size: 24px; line-height: 1.15; margin: 10px 0 22px; }
.mix { display: flex; gap: 2px; height: 10px; margin-bottom: 12px; }
.mix span { flex-basis: 0; min-width: 3px; transition: flex-grow 1s var(--ease); }
.b1 { background: var(--accent-soft); } .b2 { background: var(--d1); } .b3 { background: var(--d2); }
.mix-legend { margin: 0; display: grid; gap: 4px; }
.mix-legend div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--rule); padding: 4px 0; font-size: 14px; }
.mix-legend dt { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.mix-legend dt i { width: 10px; height: 10px; display: inline-block; }
.mix-legend dd { margin: 0; font: 500 14px var(--mono); }
.strip-wrap { margin: 0; min-width: 0; align-self: end; }
.strip { height: 240px; cursor: crosshair; }
.strip svg { display: block; overflow: visible; }
.strip .grid { stroke: var(--rule); stroke-width: 1; }
.strip .axis { font: 400 10px var(--mono); fill: var(--muted); }
.strip .stem line { stroke: #B5AA97; stroke-width: 1; }
.strip .stem circle { fill: var(--d1); stroke: var(--band); stroke-width: 1.5; }
.strip .stem.big circle { fill: var(--d2); }
.strip .stem.big line { stroke: var(--d2); }
.strip .stem.sel circle { stroke: var(--ink); stroke-width: 2.5; }
.strip .stem { transform-box: fill-box; transform-origin: 50% 100%; animation: rise .7s var(--ease) both; }
.strip .now-line { stroke: var(--accent); stroke-width: 1.5; }
@keyframes rise { from { transform: scaleY(0); } }
.strip.static .stem { animation: none; }

/* Now: ledger and detail */
.explore {
  max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 88px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: clamp(28px, 5vw, 64px); align-items: start;
}
.ledger-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 16px; }
.ledger-head h2 { font-size: clamp(30px, 3.4vw, 42px); }
.toggles { display: flex; gap: 10px; flex-wrap: wrap; }
.ledger { width: 100%; border-collapse: collapse; font-size: 15px; }
.ledger th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 8px; border-bottom: 1px solid var(--ink); }
.ledger td { padding: 11px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ledger tr { cursor: pointer; transition: background .15s; }
.ledger tbody tr:hover { background: var(--band); }
.ledger tr.sel { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.ledger .num { text-align: right; font: 400 13px var(--mono); color: var(--ink-2); white-space: nowrap; }
.ledger .mag { font: 500 15px var(--mono); white-space: nowrap; width: 92px; }
.mag-bar { display: inline-block; width: 30px; height: 6px; background: var(--grid); margin-right: 8px; position: relative; vertical-align: 1px; }
.mag-bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--m) * 100%); background: var(--accent); }
#ledger-more { margin-top: 16px; }

.detail { position: sticky; top: calc(var(--mast) + 20px); background: var(--surface); border-top: 3px solid var(--ink); padding: 22px 24px 24px; min-height: 300px; }
.d-heading { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 12px; }
.d-title { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin-bottom: 18px; }
.d-mag { font: 300 60px/.85 var(--serif); color: var(--accent); letter-spacing: -.04em; }
.d-title h3 { font-size: 22px; line-height: 1.15; }
.d-when { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 0; padding: 14px 0 18px; border-top: 1px solid var(--rule); }
.d-grid dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.d-grid dd { margin: 2px 0 0; font: 400 19px/1.25 var(--serif); }
.d-mech { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; border-top: 1px solid var(--rule); padding: 18px 0; min-height: 60px; }
.d-mech > p { grid-column: 1 / -1; }
.d-mech canvas { width: 132px; height: 132px; animation: spinin .8s var(--ease) both; }
@keyframes spinin { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }
.d-label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; }
.d-kind { font: 400 26px/1.1 var(--serif); margin: 2px 0 6px; }
.d-muted { color: var(--ink-2); font-size: 14px; margin: 0; }
.d-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; }

/* Now: significant */
.significant { border-top: 1px solid var(--rule); padding: clamp(48px, 6vw, 80px) 0; }
.sig-head { max-width: var(--max); margin: 0 auto 24px; padding: 0 var(--gutter); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
.sig-head h2 { font-size: clamp(30px, 3.4vw, 42px); }
.sig-head p { margin: 0; color: var(--muted); font-size: 15px; }
.sig-list {
  list-style: none; margin: 0; padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
}
.sig-list li { flex: none; scroll-snap-align: start; }
.sig-list button {
  width: 230px; min-height: 100%; text-align: left; background: none; border: 0; border-left: 1px solid var(--ink);
  padding: 2px 20px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: background .2s;
}
.sig-list li:last-child button { border-right: 1px solid var(--ink); }
.sig-list button:hover, .sig-list button.sel { background: var(--surface); }
.sig-mag { font: 300 58px/1 var(--serif); color: var(--accent); letter-spacing: -.03em; }
.sig-place { font: 400 19px/1.2 var(--serif); }
.sig-meta { font: 400 12px var(--mono); color: var(--muted); }
.sig-alert { font-size: 13px; color: var(--ink-2); margin-top: auto; padding-top: 6px; }
.empty { color: var(--muted); padding: 0 var(--gutter); }

/* Now: page index */
.index { border-top: 1px solid var(--ink); }
.index-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30ch) 48px; align-items: center; gap: 24px;
  padding: 14px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  border-bottom: 1px solid var(--rule); text-decoration: none; transition: background .3s var(--ease);
}
.index-row:hover { background: var(--band); color: inherit; }
.index-name { font: 400 clamp(44px, 7vw, 100px)/1 var(--serif); letter-spacing: -.035em; transition: transform .4s var(--ease), color .3s; }
.index-row:hover .index-name { transform: translateX(14px); color: var(--accent); font-style: italic; }
.index-fact { color: var(--ink-2); font-size: 16px; }
.arrow { font-size: 30px; text-align: right; transition: transform .4s var(--ease); }
.index-row:hover .arrow { transform: translateX(6px); }

/* Footer */
.foot { padding: 36px var(--gutter) 44px; max-width: var(--max); margin: 0 auto; font-size: 13px; color: var(--muted); }
.foot p { margin: 0 0 6px; max-width: 90ch; }
.foot p:first-child { color: var(--ink-2); font-size: 14px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1080px) {
  .topbar { gap: 16px; }
  .sections a { padding: 6px 8px; }
  .live { max-width: 260px; }
  .explore { grid-template-columns: 1fr; }
  .detail { position: static; }
}
@media (max-width: 860px) {
  .now-hero { grid-template-columns: 1fr; min-height: 0; }
  .globe-wrap { width: min(100%, 420px); }
  .day { grid-template-columns: 1fr; }
  .index-row { grid-template-columns: 1fr 32px; gap: 4px 12px; }
  .index-fact { grid-column: 1; grid-row: 2; }
  .arrow { grid-row: 1 / 3; grid-column: 2; }
}
@media (max-width: 760px) {
  :root { --top: 52px; }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .masthead { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .topbar { grid-template-columns: auto 1fr; }
  .live { justify-self: end; max-width: 100%; font-size: 12px; }
  .sections {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--surface); border-top: 1px solid var(--rule);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sections a { flex-direction: column; gap: 5px; text-align: center; padding: 10px 2px 12px; font-size: 12.5px; }
  .sections a::before { width: 8px; height: 8px; }
  .sections a[aria-current] { color: var(--ink); }
  .latest-facts { grid-template-columns: 1fr 1fr; }
  .latest-facts div:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 10px; }
  .ledger th:nth-child(3), .ledger td:nth-child(3) { display: none; }
  .ledger .where { font-size: 14px; }
  .d-grid { grid-template-columns: 1fr; }
  .d-mech { grid-template-columns: 96px 1fr; }
  .d-mech canvas { width: 96px; height: 96px; }
  .strip { height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Map page */
.page-map .map-app {
  display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100svh - var(--mast));
}
.map-panel { grid-column: 1; grid-row: 1 / 3; border-right: 1px solid var(--rule); padding: 28px 24px 20px; overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.map-panel h1 { font-size: 40px; line-height: 1; }
.panel-count { margin: 0; color: var(--ink-2); }
.panel-count b { display: block; font: 300 76px/.9 var(--serif); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.panel-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .new { background: var(--accent); } .legend .old { background: var(--old); }
.legend .shallow { background: var(--d1); } .legend .intermediate { background: var(--d2); } .legend .deep { background: var(--d3); }
.legend .plate { width: 18px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--plate); }
.panel-note { margin: 0; font-size: 13px; color: var(--muted); }
.panel-note:empty { display: none; }
.panel-src { margin: auto 0 0; font-size: 12px; color: var(--muted); }

.map-stage { grid-column: 2; grid-row: 1; position: relative; overflow: hidden; background: var(--paper); }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
#map .sphere { fill: var(--surface); }
#map .graticule { fill: none; stroke: var(--grid); stroke-width: .6; vector-effect: non-scaling-stroke; }
#map .land { fill: var(--land); stroke: var(--land-edge); stroke-width: .6; vector-effect: non-scaling-stroke; }
#map .plates { fill: none; stroke: var(--plate); stroke-width: 1.1; stroke-dasharray: 3 3; opacity: .75; vector-effect: non-scaling-stroke; transition: opacity .4s; }
#map .plates.off { opacity: 0; }
#map .dot { opacity: 0; stroke: var(--surface); stroke-width: .8; vector-effect: non-scaling-stroke; fill-opacity: .8; transform-box: fill-box; transform-origin: center; }
#map .dot.on { opacity: 1; }
#map .dot.pop { animation: dotpop .5s var(--ease); }
#map .dot.new { fill: var(--accent); }
#map .dot.old { fill: var(--old); fill-opacity: .55; }
#map .dot.shallow { fill: var(--d1); } #map .dot.intermediate { fill: var(--d2); } #map .dot.deep { fill: var(--d3); }
#map .ripple { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: ripple 1.8s ease-out forwards; pointer-events: none; }
#map .mark { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
@keyframes dotpop { from { transform: scale(2.4); } }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(7); opacity: 0; } }
.zoom { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--surface); }
.zoom button { width: 36px; height: 36px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.zoom button + button { border-top: 1px solid var(--rule); }
.zoom button:hover { background: var(--band); }
.map-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; font: 400 13px var(--mono); color: var(--muted); background: var(--surface); padding: 8px 14px; border: 1px solid var(--rule); }

.timeline { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 48px minmax(0, 1fr) 150px; align-items: center; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--rule); background: var(--surface); }
.play { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.play:hover { background: var(--band); }
.play span { width: 0; height: 0; border-left: 13px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.play.playing span { width: 12px; height: 14px; border: 0; margin: 0; border-left: 4px solid var(--ink); border-right: 4px solid var(--ink); }
.scrub { height: 66px; position: relative; cursor: ew-resize; touch-action: none; }
.scrub canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-label { margin: 0; font: 500 13px var(--mono); text-align: right; color: var(--ink-2); }

.drawer {
  position: fixed; top: var(--mast); right: 0; bottom: 0; width: min(400px, 100%); z-index: 35;
  background: var(--surface); border-left: 1px solid var(--ink); overflow: auto;
  transform: translateX(100%); transition: transform .45s var(--ease); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer .detail { position: static; border-top: 0; min-height: 0; padding-top: 26px; }
.drawer-close { position: absolute; right: 10px; top: 8px; width: 36px; height: 36px; border: 0; background: none; font-size: 26px; cursor: pointer; z-index: 1; }
.drawer-close:hover { color: var(--accent); }

@media (max-width: 760px) {
  .page-map .map-app { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .map-stage { grid-column: 1; grid-row: 1; height: 56svh; }
  .timeline { grid-column: 1; grid-row: 2; grid-template-columns: 44px minmax(0, 1fr); gap: 10px 12px; padding: 10px 16px; }
  .t-label { grid-column: 1 / -1; text-align: left; order: -1; }
  .map-panel { grid-column: 1; grid-row: 3; border-right: 0; }
  .map-panel h1 { font-size: 32px; }
  .drawer { top: auto; left: 0; bottom: calc(60px + env(safe-area-inset-bottom)); width: 100%; max-height: 72svh; border-left: 0; border-top: 2px solid var(--ink); transform: translateY(110%); }
}

/* Inner pages: heading */
.page-head {
  max-width: var(--max); margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: auto minmax(0, 36ch); justify-content: space-between; align-items: end; gap: 16px 48px;
}
.page-head h1 { font: 300 clamp(64px, 11vw, 168px)/.85 var(--serif); letter-spacing: -.05em; animation: arrive 1s var(--ease) both; }
.page-head p { margin: 0; font-size: 18px; color: var(--ink-2); animation: arrive 1s var(--ease) both .12s; }

/* Patterns: energy */
.energy {
  background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(36px, 5vw, 64px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
}
.energy-pct { margin: 0; font: 300 clamp(120px, 20vw, 280px)/.8 var(--serif); letter-spacing: -.06em; color: var(--accent); font-variant-numeric: tabular-nums; }
.energy-pct .pct { font-size: .45em; letter-spacing: 0; margin-left: .04em; }
.energy-text h2 { font-size: clamp(28px, 3.6vw, 48px); line-height: 1.05; max-width: 16ch; }
.energy-text p { margin: 12px 0 0; color: var(--ink-2); }
.energy-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 30px; margin-top: 28px; overflow: hidden; }
.energy-bar span { width: 0; min-width: 2px; transition: width 1.4s var(--ease); }
.energy-bar.grow span { width: var(--w); }
.energy-bar .s1 { background: var(--d2); } .energy-bar .s2 { background: var(--d1); } .energy-bar .s3 { background: var(--accent-soft); }
.energy-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 32px; margin: 4px 0 0; font-size: 14px; }
.energy-legend div { display: flex; gap: 8px; align-items: center; }
.energy-legend dt { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.energy-legend i { width: 10px; height: 10px; display: inline-block; }
.energy-legend i.s1 { background: var(--d2); } .energy-legend i.s2 { background: var(--d1); } .energy-legend i.s3 { background: var(--accent-soft); }
.energy-legend dd { margin: 0; font: 500 14px var(--mono); }

/* Patterns: figure sections */
.plate-fig {
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 72px); align-items: start;
  border-bottom: 1px solid var(--rule);
}
.plate-fig.depth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.plate-fig.depth .fig { grid-column: 1 / -1; }
.plate-fig.depth .fig-text { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(24px, 5vw, 72px); align-items: end; }
.fig-text h2 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.04; margin-bottom: 14px; }
.plate-fig.depth .fig-text h2 { margin: 0; }
.fig-text p { margin: 0 0 10px; color: var(--ink-2); font-size: 17px; }
.fig-text p b { font: 500 17px var(--mono); color: var(--accent); }
.fig-text .aside { font-size: 14px; color: var(--muted); }
.fig { margin: 0; min-width: 0; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { font: 400 10.5px var(--mono); fill: var(--muted); }
.chart .note { font: 400 11px var(--mono); fill: var(--muted); }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .ref-label { fill: var(--ink-2); }
.chart .undetected { fill: var(--band); }
.chart .cross { stroke: var(--ink); stroke-width: .75; pointer-events: none; }
#gr .pt { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
#gr .val { font: 500 11px var(--mono); fill: var(--ink-2); }
#depth .band-shallow { fill: rgba(212, 70, 26, .05); }
#depth .band-line { stroke: var(--d2); stroke-width: 1; opacity: .5; }
#depth .pt { stroke: var(--paper); stroke-width: .8; fill-opacity: .78; }
#depth .pt.shallow { fill: var(--d1); } #depth .pt.intermediate { fill: var(--d2); } #depth .pt.deep { fill: var(--d3); }
#depth .drop .pt { transform: translateY(-16px); opacity: 0; transition: transform 1.2s var(--ease), opacity 1.2s var(--ease); }
#depth .drop.in .pt { transform: none; opacity: 1; }

/* Patterns: ranking */
.rank { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.rank li { display: grid; grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 1fr) 48px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.rank-n { font: 400 13px var(--mono); color: var(--muted); }
.rank-name { font: 400 clamp(20px, 2.2vw, 28px)/1.1 var(--serif); }
.rank-bar { height: 10px; background: var(--grid); }
.rank-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1.1s var(--ease) .15s; }
.rank li.in .rank-bar span { width: var(--w); }
.rank-count { font: 500 15px var(--mono); text-align: right; }

/* Patterns: magnitude explorer */
.scale {
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center;
}
.scale-text h2 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.04; }
.scale-text > p { color: var(--ink-2); font-size: 17px; margin: 10px 0 0; }
.scale-text .mag-number { font: 300 clamp(110px, 14vw, 200px)/.85 var(--serif); letter-spacing: -.05em; margin: 28px 0 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.scale-text .mag-class { font: italic 400 30px/1.2 var(--serif); color: var(--accent); margin: 6px 0 4px; }
.scale-text .mag-effect { margin: 0 0 24px; min-height: 3.1em; max-width: 34ch; }
.slider-label { font: 500 12px var(--mono); color: var(--muted); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 6px 0 0; cursor: pointer; --pct: 53%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--accent) var(--pct), var(--rule) var(--pct)); }
input[type=range]::-moz-range-track { height: 4px; background: var(--rule); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); margin-top: -9px; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.presets button { border: 1px solid var(--rule); background: var(--surface); border-radius: 3px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: border-color .2s; }
.presets button span { font-family: var(--mono); color: var(--accent); margin-left: 4px; }
.presets button:hover, .presets button.active { border-color: var(--ink); }
.scale-visual { min-width: 0; }
#rings { display: block; width: 100%; aspect-ratio: 1; max-height: 520px; background: var(--surface); border: 1px solid var(--rule); }
.mag-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-left: 1px solid var(--rule); }
.mag-stats div { padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.mag-stats dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mag-stats dd { margin: 4px 0 0; font: 400 19px/1.2 var(--serif); }

@media (max-width: 860px) {
  .page-head { grid-template-columns: 1fr; }
  .energy { grid-template-columns: 1fr; }
  .plate-fig, .plate-fig.depth, .scale { grid-template-columns: 1fr; }
  .plate-fig.depth .fig-text { grid-template-columns: 1fr; }
  .rank li { grid-template-columns: 28px minmax(0, 1fr) 40px; }
  .rank-bar { grid-column: 2 / -1; grid-row: 2; }
  .mag-stats { grid-template-columns: 1fr; }
}

/* History */
.giants, .rhythm, .impact { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter); border-top: 1px solid var(--rule); }
.giants-head, .rhythm-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(24px, 5vw, 72px); align-items: end; margin-bottom: 28px; }
.giants h2, .rhythm h2 { font-size: clamp(34px, 4.4vw, 60px); line-height: 1.02; }
.giants-head p, .rhythm-head p { margin: 0; color: var(--ink-2); font-size: 17px; }
.rhythm-head p { margin-top: 14px; max-width: 46ch; }
.giants-head b { font: 500 17px var(--mono); color: var(--accent); }
#giants-chart .g-stem { stroke: var(--rule); stroke-width: 1; }
#giants-chart .g-dot { fill: var(--d1); fill-opacity: .85; stroke: var(--paper); stroke-width: 2; cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .8s var(--ease); }
#giants-chart .g-dot.nine { fill: var(--d2); }
#giants-chart .g-dot:hover { stroke: var(--ink); }
#giants-chart .g-label { font: 400 15px var(--serif); fill: var(--ink); transition: opacity .6s .6s; }
#giants-chart .grow .g-dot { transform: scale(0); }
#giants-chart .grow .g-label, #giants-chart .grow .g-stem { opacity: 0; }
#giants-chart .grow.in .g-dot { transform: none; }
#giants-chart .grow.in .g-label, #giants-chart .grow.in .g-stem { opacity: 1; }
#giants-chart .g-stem { transition: opacity .6s .3s; }

.giants-list { list-style: none; margin: 36px 0 0; padding: 0; columns: 2; column-gap: clamp(24px, 5vw, 72px); border-top: 1px solid var(--ink); }
.giants-list li { break-inside: avoid; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.g-mag { font: 400 26px/1 var(--serif); color: var(--accent); }
.g-name { font: 400 18px/1.2 var(--serif); }
.g-date { font: 400 12px var(--mono); color: var(--muted); white-space: nowrap; }
.g-link { font: 500 11px var(--mono); color: var(--ink-2); }

.rhythm-stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.rhythm-stats div { padding: 12px 16px 0 0; }
.rhythm-stats div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.rhythm-stats dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rhythm-stats dd { margin: 4px 0 0; font: 300 clamp(40px, 5vw, 64px)/1 var(--serif); letter-spacing: -.03em; }
.rhythm-stats dd small { font-size: 13px; letter-spacing: 0; }
#years-chart .bar { fill: var(--d1); transform-box: fill-box; transform-origin: 50% 100%; transition: transform .7s var(--ease); }
#years-chart .bar.partial { fill: var(--accent-soft); }
#years-chart .bar.hover { fill: var(--d2); }
#years-chart .grow .bar { transform: scaleY(0); }
#years-chart .grow.in .bar { transform: none; }
#years-chart .hit { fill: transparent; }
#years-chart .avg-line { stroke: var(--ink); stroke-width: 1.5; }
#years-chart .avg-label { font: 500 12px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }

@media (max-width: 860px) {
  .giants-head, .rhythm-head { grid-template-columns: 1fr; }
  .giants-list { columns: 1; }
  .rhythm-stats dd { font-size: 40px; }
}

/* Near you */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.finder {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 16px; align-items: center;
}
.search { position: relative; }
#q {
  width: 100%; font: 400 clamp(26px, 3.4vw, 40px)/1.2 var(--serif); color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid var(--ink); padding: 10px 0; outline: none; border-radius: 0;
}
#q::placeholder { color: var(--muted); }
#q:focus { border-bottom-color: var(--accent); }
#suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--ink); border-top: 0; box-shadow: 0 12px 30px rgba(29,27,24,.12); }
#suggest li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; cursor: pointer; font: 400 19px var(--serif); }
#suggest li small { font-size: 13px; }
#suggest li[aria-selected="true"], #suggest li:hover { background: var(--band); }
#suggest li.none { color: var(--muted); cursor: default; font: 400 14px var(--sans); }
.locate { border: 1.5px solid var(--ink); background: var(--ink); color: var(--surface); padding: 12px 18px; font-size: 15px; cursor: pointer; border-radius: 3px; transition: background .2s, color .2s; }
.locate:hover { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.picks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.picks button { border: 1px solid var(--rule); background: var(--surface); padding: 6px 12px; font-size: 14px; cursor: pointer; border-radius: 3px; }
.picks button:hover { border-color: var(--ink); }
.finder-msg { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--ink-2); min-height: 1.4em; }

.result { border-top: 1px solid var(--ink); background: var(--band); padding: clamp(32px, 5vw, 64px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); transition: opacity .3s; }
.result.loading { opacity: .45; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-bottom: 24px; }
.result-head h2 { font-size: clamp(36px, 5vw, 68px); line-height: 1; letter-spacing: -.03em; }
.radius-note { margin: 0; font: 400 13px var(--mono); color: var(--muted); }
.near-stats { margin: 0 0 36px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.near-stats div { padding: 14px 18px 0 0; min-width: 0; }
.near-stats div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.near-stats dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.near-stats dd { margin: 4px 0 4px; font: 300 clamp(40px, 5vw, 64px)/1 var(--serif); letter-spacing: -.03em; color: var(--accent); }
.near-stats div:nth-child(3) dd { font-size: clamp(28px, 3vw, 40px); padding-top: 10px; color: var(--ink); }
.near-stats p { margin: 0; font-size: 14px; color: var(--ink-2); }
.near-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.near-map { margin: 0; }
.near-map svg { display: block; width: 100%; max-width: 640px; height: auto; }
.near-map svg .sea { fill: var(--surface); stroke: var(--ink); stroke-width: 1; }
.near-map svg .land { fill: var(--land); stroke: var(--land-edge); stroke-width: .8; }
.near-map svg .plates { fill: none; stroke: var(--plate); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .8; }
.near-map svg .ring { fill: none; stroke: var(--ink-2); stroke-width: .8; stroke-dasharray: 2 4; opacity: .6; }
.near-map svg .ring-label { font: 400 11px var(--mono); fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.near-map svg .q { stroke: var(--surface); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: pop .6s var(--ease) both; }
.near-map svg .q.new { fill: var(--accent); fill-opacity: .85; }
.near-map svg .q.old { fill: var(--old); fill-opacity: .55; }
.near-map svg .hist { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.near-map svg .hist-label { font: 500 12px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.near-map svg .here { stroke: var(--ink); stroke-width: 2; }
@keyframes pop { from { transform: scale(0); } }
.near-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.near-legend span { display: flex; align-items: center; gap: 6px; }
.near-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.near-legend .new { background: var(--accent); } .near-legend .old { background: var(--old); }
.near-legend .hist { border: 1.8px solid var(--ink); }
.near-legend .plate { width: 18px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--plate); }
.near-lists h3 { font-size: 24px; margin: 0 0 8px; }
.near-lists h3 + ol { margin-bottom: 28px; }
.near-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.near-list li { border-bottom: 1px solid var(--rule); }
.near-list a { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: baseline; padding: 10px 0; text-decoration: none; }
.near-list a:hover { background: var(--paper); }
.near-list .none { padding: 10px 0; color: var(--muted); font-size: 14px; }
.n-mag { font: 400 26px/1 var(--serif); color: var(--accent); }
.n-place { font: 400 18px/1.25 var(--serif); }
.n-place small { display: block; margin: 2px 0 0; font: 400 12px var(--mono); }
.small-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.act { margin: 0; padding: 14px 0 0; border-top: 1px solid var(--rule); font-size: 15px; color: var(--ink-2); }

@media (max-width: 860px) {
  .near-stats { grid-template-columns: 1fr 1fr; }
  .near-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .near-stats div:nth-child(n+3) { border-top: 1px solid var(--rule); margin-top: 14px; }
  .near-body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .finder { grid-template-columns: 1fr; }
  .locate { justify-self: start; }
}

/* Shared: world map component */
.wmap { display: block; width: 100%; height: auto; }
.wmap .sphere { fill: var(--surface); }
.wmap .graticule { fill: none; stroke: var(--grid); stroke-width: .6; }
.wmap .land { fill: var(--land); stroke: var(--land-edge); stroke-width: .5; }
.wmap .plates { fill: none; stroke: var(--plate); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; transition: opacity .4s; }
.wmap .plates.off { opacity: 0; }
.wmap circle, .wmap path.pt { transform-box: fill-box; transform-origin: center; }
.wmap g circle, .wmap g path { animation: pop .6s var(--ease) both; }
.wmap .mark { fill: none; stroke: var(--ink); stroke-width: 2; animation: none; }
@keyframes pop { from { transform: scale(0); } }

/* Shared: legends, table views, horizontal and vertical bars */
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--ink-2); }
.legend-row span { display: inline-flex; align-items: center; gap: 7px; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.table-view { margin-top: 14px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--muted); width: max-content; }
.table-view summary:hover { color: var(--ink); }
.table-view table { border-collapse: collapse; margin-top: 8px; font: 400 13px var(--mono); }
.table-view th, .table-view td { text-align: left; padding: 4px 24px 4px 0; border-bottom: 1px solid var(--grid); }
.table-view th { color: var(--muted); font-weight: 500; }

.hbars { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.hbars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 80px; gap: 16px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.hb-label { font: 400 clamp(17px, 1.8vw, 21px)/1.2 var(--serif); }
.hb-label small { display: block; margin: 2px 0 0; font: 400 12px var(--mono); }
.hb-bar { height: 10px; background: var(--grid); }
.hb-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1.1s var(--ease); }
.hbars.in .hb-bar span { width: var(--w); }
.hb-value { font: 500 15px var(--mono); text-align: right; white-space: nowrap; }
.hbars .hb-note { display: block; border: 0; font-size: 13px; color: var(--muted); padding-top: 10px; }
.chart .bar { fill: var(--d1); transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .7s var(--ease); }
.chart .bars.in .bar { transform: none; }
.chart .bar.dark { fill: var(--d2); }
.chart .bar.soft { fill: var(--accent-soft); }
.chart .bar.hover { fill: var(--d3); }
.chart .hit { fill: transparent; }
.chart .ref-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .ref-text { font: 500 12px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }

/* Shared: generic content blocks for hazard pages */
.block { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter); border-top: 1px solid var(--rule); }
.block-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px clamp(24px, 5vw, 72px); align-items: end; margin-bottom: 28px; }
.block-head h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.02; }
.block-head p { margin: 0; color: var(--ink-2); font-size: 17px; max-width: 46ch; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.split h3 { font-size: 26px; margin-bottom: 14px; }
.small-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.seg-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

/* Tsunamis: status */
.ts-status {
  max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px clamp(24px, 5vw, 72px); align-items: end;
}
.ts-label { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--ink-2); }
.ts-headline h1 { font: 300 clamp(40px, 5.4vw, 78px)/.98 var(--serif); letter-spacing: -.035em; max-width: 13ch; animation: arrive 1s var(--ease) both; }
.ts-alert .ts-headline h1 { color: var(--red); }
.ts-sub { margin: 18px 0 0; font-size: 17px; color: var(--ink-2); max-width: 48ch; }
.bulletins { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.bulletin { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; animation: arrive .9s var(--ease) both .15s; }
.b-centre { margin: 0; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); grid-column: 1 / -1; }
.b-centre small { text-transform: none; letter-spacing: 0; }
.b-cat { margin: 4px 0 0; font: 400 26px/1.1 var(--serif); }
.b-cat.hot { color: var(--red); }
.b-region { margin: 4px 0 0; grid-column: 1; font-size: 15px; }
.b-meta { margin: 4px 0 0; grid-column: 2; grid-row: 2; font: 400 12px var(--mono); color: var(--muted); text-align: right; }
.b-note { margin: 6px 0 0; grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }
.b-link { grid-column: 1 / -1; font-size: 14px; margin-top: 6px; width: max-content; }
.b-none { margin: 6px 0 0; grid-column: 1 / -1; color: var(--ink-2); }
.ts-act { grid-column: 1 / -1; margin: 8px 0 0; padding: 14px 18px; background: var(--accent-soft); color: var(--ink); font-size: 16px; border-left: 3px solid var(--accent); }

.ts-map-wrap { border-top: 1px solid var(--rule); background: var(--band); padding: clamp(28px, 4vw, 48px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
.ts-map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; margin-bottom: 16px; }
.ts-map-head h2 { font-size: clamp(28px, 3.4vw, 42px); }
.legend-row .past { background: var(--accent); opacity: .8; }
.legend-row .flag { background: none; border: 1.5px solid var(--ink); }
.legend-row .bul { background: var(--red); border-radius: 1px; transform: rotate(45deg); width: 9px; height: 9px; }
.ts-map .wmap .past { fill: var(--accent); fill-opacity: .7; stroke: var(--surface); stroke-width: 1; }
.ts-map .wmap .flag { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.ts-map .wmap .bul { fill: var(--red); stroke: var(--surface); stroke-width: 1.5; }

.ts-numbers { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter); display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.ts-numbers div { padding: 0 20px; border-left: 1px solid var(--rule); }
.ts-numbers div:first-child { padding-left: 0; border-left: 0; }
.tn-big { margin: 0; font: 300 clamp(48px, 6vw, 88px)/1 var(--serif); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.ts-numbers p:not(.tn-big) { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }

.ts-recent { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter); border-top: 1px solid var(--rule); }
.ts-recent h2 { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 18px; }
.ts-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ts-list li { display: grid; grid-template-columns: 130px minmax(0, 1fr) 140px; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.tl-date { font: 400 13px var(--mono); color: var(--muted); }
.tl-place { font: 400 20px/1.2 var(--serif); }
.tl-place small, .tl-height small { display: block; margin: 2px 0 0; font: 400 12px var(--mono); }
.tl-height { text-align: right; }
.tl-height b { font: 400 24px var(--serif); color: var(--accent); }

.signs { background: var(--ink); color: var(--surface); padding: clamp(40px, 6vw, 80px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
.signs h2 { font-size: clamp(32px, 4vw, 54px); margin-bottom: 24px; }
.signs ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.signs li { padding: 6px 24px 10px 0; font-size: 18px; color: #D9D2C4; }
.signs li + li { padding-left: 24px; border-left: 1px solid #4A453E; }
.signs b { display: block; font: 400 clamp(24px, 2.6vw, 34px)/1.1 var(--serif); color: var(--surface); margin-bottom: 6px; }
.sign-n { display: block; font: 500 12px var(--mono); color: var(--accent-light); margin-bottom: 10px; }
.signs-go { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid #4A453E; font-size: 18px; color: var(--surface); }

@media (max-width: 860px) {
  .ts-status, .block-head, .split { grid-template-columns: 1fr; }
  .ts-numbers { grid-template-columns: 1fr 1fr; gap: 24px 0; }
  .ts-numbers div:nth-child(3) { padding-left: 0; border-left: 0; }
  .signs ol { grid-template-columns: 1fr; gap: 18px; }
  .signs li + li { padding-left: 0; border-left: 0; border-top: 1px solid #4A453E; padding-top: 18px; }
  .ts-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .tl-date { grid-column: 1 / -1; }
  .hbars li { grid-template-columns: minmax(0, 1fr) 70px; }
  .hb-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* Tsunami history: cause colours on the map */
.ts-map .wmap circle[class^="t-"] { stroke: var(--surface); stroke-width: .8; fill-opacity: .72; }
.ts-map .wmap .t-quake { fill: var(--d2); }
.ts-map .wmap .t-volcano { fill: #B07410; }
.ts-map .wmap .t-landslide { fill: var(--d3); }
.ts-map .wmap .t-weather { fill: var(--d1); }
.ts-map .wmap .t-other { fill: var(--old); }
.ts-map-head .seg { flex-wrap: wrap; }

/* Tsunami science: shoaling cross-section */
.shore { background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(36px, 5vw, 64px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
.shore-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 48px; align-items: end; margin-bottom: 20px; }
.shore-head h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.02; }
.shore-head p { margin: 0; color: var(--ink-2); font-size: 17px; }
.shore-fig { margin: 0; position: relative; }
#shore { display: block; width: 100%; height: clamp(240px, 32vw, 380px); background: var(--surface); border: 1px solid var(--rule); }
.readout { position: absolute; top: 14px; right: 14px; margin: 0; display: grid; grid-template-columns: repeat(3, auto); background: var(--surface); border: 1px solid var(--ink); }
.readout div { padding: 8px 14px; min-width: 104px; }
.readout div + div { border-left: 1px solid var(--rule); }
.readout dt { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.readout dd { margin: 2px 0 0; font: 400 22px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.shore-controls { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; margin-top: 12px; }

/* Tsunami science: speed */
.speed-big { margin: 0; font: 300 clamp(96px, 13vw, 180px)/.85 var(--serif); letter-spacing: -.05em; color: var(--accent); font-variant-numeric: tabular-nums; }
.speed-big small { font-size: .22em; letter-spacing: 0; margin-left: 10px; color: var(--ink-2); }
.speed-mph { margin: 14px 0 26px; font-size: 18px; color: var(--ink-2); }
#speed-chart .pt { fill: var(--accent); stroke: var(--paper); stroke-width: 2.5; }

/* Tsunami science: ocean crossing */
.cross-clock { margin: 0 0 0 auto; font: 500 15px var(--mono); color: var(--accent); }
.cross-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: center; }
.ts-map .wmap .arc { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 4; opacity: .6; }
.ts-map .wmap .front { fill: var(--accent); fill-opacity: .1; stroke: var(--accent); stroke-width: 2; }
.ts-map .wmap .src { fill: var(--red); stroke: var(--surface); stroke-width: 2; }
.ts-map .wmap .dest { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; transition: fill .3s; }
.ts-map .wmap .dest.hit { fill: var(--accent); }
.arrivals { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.arrivals li { display: grid; grid-template-columns: 72px 1fr; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); transition: background .3s; }
.ar-time { font: 400 24px/1 var(--serif); color: var(--muted); grid-row: 1 / 3; transition: color .3s; }
.ar-name { font-size: 15px; }
.arrivals small { margin: 0; font: 400 11px var(--mono); }
.arrivals li.hit .ar-time { color: var(--accent); }

@media (max-width: 860px) {
  .shore-head, .cross-body { grid-template-columns: 1fr; }
  .readout { position: static; margin-top: 10px; grid-template-columns: repeat(3, 1fr); }
  .readout div { min-width: 0; padding: 8px 10px; }
  .readout dd { font-size: 18px; }
  .cross-clock { margin-left: 0; width: 100%; }
}

.cause-legend { margin-top: 12px; }
.cause-legend .t-quake { background: var(--d2); } .cause-legend .t-volcano { background: #B07410; }
.cause-legend .t-landslide { background: var(--d3); } .cause-legend .t-weather { background: var(--d1); } .cause-legend .t-other { background: var(--old); }

/* Volcanoes: shared chips for USGS alert colours */
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.chip.green { background: var(--green); } .chip.yellow { background: var(--yellow); }
.chip.orange { background: var(--orange); } .chip.red { background: var(--red); }

/* Volcanoes now */
.vo-hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px clamp(24px, 5vw, 72px); align-items: end;
}
.vo-count .big-count { color: var(--accent); animation: arrive 1s var(--ease) both; }
.vo-count h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; margin: 12px 0 10px; max-width: 18ch; }
.vo-sub { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 46ch; }
.vo-alerts h2 { font-size: 24px; margin-bottom: 10px; }
.alerts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.alerts li { border-bottom: 1px solid var(--rule); }
.alerts a { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 0; text-decoration: none; }
.alerts a:hover { background: var(--band); }
.al-name { font: 400 21px/1.15 var(--serif); }
.al-name small, .al-level small { display: block; margin: 2px 0 0; font: 400 12px var(--mono); }
.al-level { text-align: right; font: 500 14px var(--mono); }
.al-level b { font-weight: 500; text-transform: capitalize; }
.alerts .empty, .v-list .empty { padding: 12px 0; color: var(--muted); }

.vo-map-wrap .legend-row .v-all { width: 0; height: 0; border-radius: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #B9AE9B; }
.vo-map-wrap .legend-row .v-active { width: 0; height: 0; border-radius: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--accent); }
.vo-map-wrap .legend-row .v-alert { background: none; border: 2px solid var(--orange); width: 12px; height: 12px; }
.ts-map .wmap .v-all { fill: #B9AE9B; }
.ts-map .wmap .v-active { fill: var(--accent); stroke: var(--surface); stroke-width: 1; }
.ts-map .wmap .v-alert { fill: none; stroke-width: 2.2; }
.ts-map .wmap .v-alert.green { stroke: var(--green); } .ts-map .wmap .v-alert.yellow { stroke: var(--yellow); }
.ts-map .wmap .v-alert.orange { stroke: var(--orange); } .ts-map .wmap .v-alert.red { stroke: var(--red); }

.v-list { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--ink); }
.v-list li { border-bottom: 1px solid var(--rule); }
.v-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; text-decoration: none; }
.v-list a:hover { background: var(--band); }
.vl-name { font: 400 20px/1.2 var(--serif); }
.vl-name small { display: block; margin: 2px 0 0; font: 400 12px var(--mono); }
.vl-since { font: 400 12px var(--mono); color: var(--muted); }

.level-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.level-row li { padding: 16px 18px 6px 0; }
.level-row li + li { padding-left: 18px; border-left: 1px solid var(--rule); }
.level-row .chip { width: 16px; height: 16px; }
.level-row b { display: block; font: 400 28px/1.1 var(--serif); text-transform: capitalize; margin: 10px 0 2px; }
.lv-colour { font: 400 12px var(--mono); color: var(--muted); }
.level-row p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }

/* Volcano history */
#timeline .pt { fill: var(--old); fill-opacity: .5; stroke: var(--paper); stroke-width: 1; transform-box: fill-box; transform-origin: center; transition: transform .8s var(--ease); cursor: pointer; }
#timeline .pt.deadly { fill: var(--accent); fill-opacity: .55; }
#timeline .pt:hover { stroke: var(--ink); stroke-width: 1.5; }
#timeline .dots .pt { transform: scale(0); }
#timeline .dots.in .pt { transform: none; }
#timeline .pt-label { font: 400 14px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }

/* Eruption size */
.vei {
  max-width: var(--max); margin: 0 auto; padding: clamp(32px, 5vw, 64px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center;
  border-top: 1px solid var(--rule);
}
.vei-number { margin: 0; font: 300 clamp(110px, 15vw, 210px)/.8 var(--serif); letter-spacing: -.05em; color: var(--accent); display: flex; align-items: flex-start; gap: 12px; }
.vei-tag { font: 500 15px var(--mono); letter-spacing: .05em; color: var(--muted); margin-top: 18px; }
.vei-style { font: italic 400 30px/1.2 var(--serif); margin: 12px 0 18px; }
.vei-facts { margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.vei-facts div { padding: 10px 16px 0 0; }
.vei-facts div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.vei-facts dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.vei-facts dd { margin: 4px 0 0; font: 400 21px/1.2 var(--serif); }
.vei-ex { margin: 0 0 26px; font-size: 16px; color: var(--ink-2); min-height: 3em; }
.vei-ex span { display: block; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.vei-ex b { font-weight: 500; color: var(--ink); }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 0 6px; }
.vei-visual { margin: 0; }
#plume { display: block; width: 100%; max-width: 480px; margin: 0 auto; height: auto; }
#plume .tropo { fill: var(--band); }
#plume .layer-label, #plume .axis { font: 400 11px var(--mono); fill: var(--muted); }
#plume .grid { stroke: var(--rule); stroke-width: 1; }
#plume .ref { stroke: var(--ink-2); stroke-dasharray: 4 4; stroke-width: 1; }
#plume .ref-text { font: 500 11px var(--mono); fill: var(--ink-2); }
#plume .everest { fill: var(--land); stroke: var(--land-edge); }
#plume .column { fill: #8F8576; fill-opacity: .55; }
#plume .umbrella { fill: #8F8576; fill-opacity: .4; }
#plume .cone { fill: var(--d3); }
#plume .col-label { font: 500 13px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
#plume .baseline { stroke: var(--ink); stroke-width: 1.5; }
.cube-fig { margin: 0; }
#cube { display: block; width: 100%; max-width: 760px; height: auto; }
#cube .baseline { stroke: var(--ink); stroke-width: 1.5; }
#cube .lm { fill: var(--land); stroke: var(--land-edge); stroke-width: 1.5; }
#cube .cube-front { fill: var(--d2); }
#cube .cube-top { fill: var(--d1); }
#cube .cube-side { fill: var(--d3); }
#cube .cube-label { font: 400 15px var(--serif); fill: var(--ink); }
#cube .cube-g { transform-box: fill-box; transform-origin: 50% 100%; animation: pop .7s var(--ease) both; }

@media (max-width: 860px) {
  .vo-hero, .vei { grid-template-columns: 1fr; }
  .level-row { grid-template-columns: 1fr 1fr; }
  .level-row li:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* Single quake page */
.q-hero { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(32px, 5vw, 56px); }
.q-when { margin: 0 0 clamp(18px, 2.4vw, 30px); color: var(--ink-2); }
.q-title { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px clamp(20px, 3vw, 40px); align-items: end; }
.q-mag { margin: 0; font: 300 clamp(96px, 14vw, 200px)/.82 var(--serif); letter-spacing: -.05em; color: var(--accent); animation: arrive 1s var(--ease) both; }
.q-title h1 { font-size: clamp(30px, 4vw, 56px); line-height: 1.02; max-width: 18ch; animation: arrive 1s var(--ease) both .1s; }
.q-stats { margin: 32px 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--ink); }
.q-stats div { padding: 12px 18px 12px 0; border-bottom: 1px solid var(--rule); }
.q-stats dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.q-stats dd { margin: 4px 0 0; font: 400 22px/1.2 var(--serif); }
.q-hero .d-links { border-top: 0; padding-top: 0; font-size: 15px; }
.q-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.q-images figure { margin: 0; }
.q-images img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: var(--surface); }
.q-images figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.q-h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.02; }
.q-kind { font: italic 400 34px/1.1 var(--serif); color: var(--accent); margin: 14px 0 8px; }
.q-copy { color: var(--ink-2); font-size: 17px; max-width: 42ch; margin: 0; }
#q-ball { width: 220px; height: 220px; justify-self: center; animation: spinin 1s var(--ease) both; }
.q-after-stats { margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.q-after-stats div { padding: 10px 14px 0 0; }
.q-after-stats div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.q-after-stats dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.q-after-stats dd { margin: 4px 0 0; font: 300 clamp(30px, 3.4vw, 44px)/1.05 var(--serif); }
.q-local #after-map .main, .near-legend .main { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.near-legend .main { background: var(--surface); border: 2.5px solid var(--accent); }
@media (max-width: 860px) { .q-title { grid-template-columns: 1fr; } }

#impact-chart .pt { fill: var(--accent); fill-opacity: .45; stroke: var(--paper); stroke-width: 1; cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .8s var(--ease); }
#impact-chart .pt:hover { stroke: var(--ink); stroke-width: 1.5; fill-opacity: .8; }
#impact-chart .dots .pt { transform: scale(0); }
#impact-chart .dots.in .pt { transform: none; }
#impact-chart .pt-label { font: 400 14px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.impact-lists { margin-top: 40px; }

/* Home: other hazards strip */
.status-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); max-width: 100%; }
.st { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; padding: 16px max(var(--gutter), 20px); text-decoration: none; border-left: 1px solid var(--rule); transition: background .25s; }
.st:first-child { border-left: 0; padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
.st:hover { background: var(--band); color: inherit; }
.st-k { display: flex; align-items: center; gap: 8px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.st-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.st[data-sec="tsunami"] { --dot: #0A7EA4; } .st[data-sec="volcano"] { --dot: #B07410; } .st[data-sec="near"] { --dot: var(--ink); }
.st-v { font: 400 18px/1.2 var(--serif); }
.st .arrow { font-size: 20px; }
.st.hot { background: #FBE3DE; }
.st.hot .st-v { color: var(--red); }
@media (max-width: 860px) {
  .status-strip { grid-template-columns: 1fr; }
  .st, .st:first-child { border-left: 0; border-top: 1px solid var(--rule); padding-left: var(--gutter); }
  .st:first-child { border-top: 0; }
}

/* Near you: other hazards */
.near-more { margin-top: -20px; }
.near-more dd { color: var(--ink); }
.near-more div:nth-child(2) dd { font-size: clamp(26px, 2.6vw, 36px); padding-top: 8px; }
.near-map svg .volc { fill: #B07410; stroke: var(--surface); stroke-width: 1.2; }
.near-map svg .volc.active { fill: var(--red); }
.near-legend .volc { width: 0; height: 0; border-radius: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #B07410; }

/* Hazard Now pages: status bar at the top (tsunami bulletins, US volcano alerts) */
.ts-bar {
  background: var(--band); border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px 40px; align-items: center;
  padding: 18px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
}
.ts-bar .ts-label { margin: 0 0 6px; font-size: 14px; }
.ts-bar h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; }
.ts-alert .ts-bar { background: #FBE3DE; }
.ts-alert .ts-bar h2 { color: var(--red); }
.ts-bar .bulletins { grid-template-columns: 1fr 1fr; gap: 0 24px; border-top: 0; }
.ts-bar .bulletin { border-bottom: 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: baseline; animation: none; }
.ts-bar .b-centre { grid-column: 1 / -1; }
.ts-bar .b-cat { font-size: 20px; margin: 2px 0 0; }
.ts-bar .b-meta { grid-column: 2; grid-row: 2; text-align: left; margin: 0; }
.ts-bar .b-region { grid-column: 1 / -1; margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.ts-bar .b-link { margin-left: 6px; font-size: 13px; }
.ts-bar .ts-act { grid-column: 1 / -1; margin: 0; padding: 10px 14px; font-size: 15px; }
.vo-bar .alerts { border-top: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.vo-bar .alerts li { border-bottom: 0; }
.vo-bar .alerts a { padding: 4px 0; grid-template-columns: 12px auto auto; gap: 10px; }
.vo-bar .al-name { font-size: 19px; }
.vo-bar .al-level { text-align: left; }

/* Volcano hero uses the name as the headline figure */
.latest-name { font: 300 clamp(56px, 8.4vw, 124px)/.92 var(--serif); letter-spacing: -.04em; color: var(--accent); margin: 0 0 12px; max-width: 11ch; animation: arrive 1s var(--ease) both .05s; }

/* Ledger extras */
.ledger .where small { display: block; font: 400 12px var(--mono); color: var(--muted); margin: 2px 0 0; }
.ledger .mag small { font: 400 11px var(--mono); margin-left: 2px; }
.ledger .chip { width: 9px; height: 9px; vertical-align: 1px; }

/* Cards in horizontal strips can be links as well as buttons */
.sig-list .sig-card {
  width: 230px; min-height: 100%; text-align: left; border-left: 1px solid var(--ink);
  padding: 2px 20px 12px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; transition: background .2s;
}
.sig-list li:last-child .sig-card { border-right: 1px solid var(--ink); }
.sig-list .sig-card:hover { background: var(--surface); color: inherit; }

/* Stem strips: colour by cause or alert */
.strip .stem.c-quake circle { fill: var(--d2); } .strip .stem.c-quake line { stroke: var(--d2); }
.strip .stem.c-landslide circle { fill: var(--d3); }
.strip .stem.c-volcano circle { fill: #B07410; }
.strip .stem.alerting circle { fill: var(--orange); }

/* Detail panel extras */
.d-volc { font-size: 44px; line-height: 1; padding-top: 6px; }
.d-grid .cap { text-transform: none; }
.d-grid .cap::first-letter { text-transform: uppercase; }
.d-grid .chip { width: 10px; height: 10px; margin-right: 6px; }

/* Atlas maps: tsunami and volcano dots and background triangles */
.page-atlas #map .dot { opacity: 0; stroke: var(--surface); stroke-width: .8; vector-effect: non-scaling-stroke; fill-opacity: .78; transform-box: fill-box; transform-origin: center; }
.page-atlas #map .dot.on { opacity: 1; }
.page-atlas #map .dot.pop { animation: dotpop .5s var(--ease); }
#map .c-quake, .legend .c-quake { fill: var(--d2); background: var(--d2); }
#map .c-volcano, .legend .c-volcano { fill: #B07410; background: #B07410; }
#map .c-landslide, .legend .c-landslide { fill: var(--d3); background: var(--d3); }
#map .c-weather, .legend .c-weather { fill: var(--d1); background: var(--d1); }
#map .c-other, .legend .c-other { fill: var(--old); background: var(--old); }
#map .h-3, .legend .h-3 { fill: var(--d3); background: var(--d3); }
#map .h-2, .legend .h-2 { fill: var(--d2); background: var(--d2); }
#map .h-1, .legend .h-1 { fill: var(--d1); background: var(--d1); }
#map .h-0, .legend .h-0 { fill: var(--old); background: var(--old); }
#map .k-3, .legend .k-3 { fill: var(--red); background: var(--red); }
#map .k-2, .legend .k-2 { fill: var(--d1); background: var(--d1); }
#map .k-1, .legend .k-1 { fill: var(--old); background: var(--old); }
#map .v-3, .legend .v-3 { fill: var(--d3); background: var(--d3); }
#map .v-2, .legend .v-2 { fill: var(--d2); background: var(--d2); }
#map .v-1, .legend .v-1 { fill: var(--d1); background: var(--d1); }
#map .v-n, .legend .v-n { fill: var(--old); background: var(--old); }
.page-atlas #map .dot.k-1, .page-atlas #map .dot.c-other, .page-atlas #map .dot.h-0, .page-atlas #map .dot.v-n { fill-opacity: .5; }
#map .bk { fill: #C4B9A5; stroke: none; }
#map .bk.active { fill: var(--accent); stroke: var(--surface); stroke-width: 1; vector-effect: non-scaling-stroke; }
#map .bk.alerting { stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
#map .bk.alerting.green { fill: var(--green); } #map .bk.alerting.yellow { fill: var(--yellow); }
#map .bk.alerting.orange { fill: var(--orange); } #map .bk.alerting.red { fill: var(--red); }
.legend .tri { width: 0; height: 0; border-radius: 0; background: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #C4B9A5; }
.legend .tri.active { border-bottom-color: var(--accent); }

/* Generic scatter dots in charts */
.chart .dots .pt { fill: var(--accent); fill-opacity: .5; stroke: var(--paper); stroke-width: 1; cursor: pointer; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .8s var(--ease); }
.chart .dots.in .pt { transform: none; }
.chart .dots .pt.deadly { fill: var(--d3); fill-opacity: .55; }
.chart .dots .pt:hover { stroke: var(--ink); stroke-width: 1.5; }
.chart .pt-label { font: 400 14px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.v-list .b-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; }

@media (max-width: 860px) {
  .ts-bar { grid-template-columns: 1fr; }
  .ts-bar .bulletins { grid-template-columns: 1fr; gap: 10px; }
}

/* Labels with a pulse dot flow as text, so long labels wrap naturally */
.latest-label, .ts-label { display: block; }
.latest-label .pulse, .ts-label .pulse { margin-right: 10px; vertical-align: 1px; }
