:root { --bg:#0b0f14; --panel:#121924; --line:#223042; --text:#f2f4f7; --muted:#8a94a6; --accent:#ffcc00; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
nav { display:flex; gap:20px; align-items:center; border-bottom:1px solid var(--line); padding:14px 16px; max-width:1100px; margin:0 auto; flex-wrap:wrap; }
nav .brand { display:inline-flex; align-items:center; gap:8px; font-weight:800; margin-right:auto; color:var(--text); text-decoration:none; }
nav .brand::before { content:""; width:28px; height:28px; flex:none; background:url(/logo.svg) center/contain no-repeat; }
nav a { color:var(--muted); text-decoration:none; font-weight:600; }
nav a[aria-current] { color:var(--text); }
h1 { font-size: 30px; margin: 8px 0 4px; letter-spacing: -.01em; }
h2 { font-size: 22px; margin: 40px 0 12px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.note { color: var(--muted); font-size: 14px; border:1px solid var(--line); border-radius:10px; padding:10px 14px; margin-bottom:24px; }
a.link, .prose a { color: var(--accent); }
/* Homepage "about" note: always shown on wide screens; on phones it sits behind an About toggle. */
.abouttoggle { display: none; background: none; border: 0; padding: 0; margin-left: 10px; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.abouttoggle::after { content: " ▾"; text-decoration: none; display: inline-block; margin-left: 2px; transition: transform .15s; }
.abouttoggle[aria-expanded="true"]::after { transform: rotate(180deg); }
@media (max-width: 600px) {
  .abouttoggle { display: inline; }
  .note.about { display: none; margin-top: -12px; }
  .note.about.open { display: block; }
}
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; overflow:hidden; color:inherit; text-decoration:none; display:block; }
.card img { width:100%; aspect-ratio:4/5; display:block; background:var(--bg); }
.card div { padding:10px 12px; font-size:14px; }
.card b { display:block; }
.card span { color:var(--muted); font-size:13px; }
.empty { color:var(--muted); }
.cols { display:grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding: 4px 20px 16px; }
.panel h2 { margin-top: 16px; }
.panel li { margin: 6px 0; }
.big { font-size: 56px; font-weight: 800; line-height: 1.1; }
table { width:100%; border-collapse: collapse; }
td { padding: 12px 0; border-bottom: 1px solid var(--line); }
td:last-child { text-align:right; font-weight:800; font-size:22px; color:#ff9f1a; }

/* Quake detail page */
.qhead { border-top: 4px solid var(--c); padding-top: 16px; margin-bottom: 20px; }
.qhead .kicker { color: var(--c); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.qhead h1 { font-size: 64px; line-height: 1; margin: 8px 0; font-weight: 800; }
.qhead h1 .m { color: var(--muted); font-size: .55em; margin-right: 2px; }
.qhead h1 .cls { color: var(--c); font-size: .4em; font-weight: 600; vertical-align: middle; margin-left: 8px; }
.qhead .place { font-size: 22px; font-weight: 600; margin: 0; }
.qhead h1.ftitle { font-size: 44px; line-height: 1.1; overflow-wrap: anywhere; }
.qmap { height: 440px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.maplegend { color: var(--muted); font-size: 13px; margin: 8px 0 24px; }
.shaking { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.shaking .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.shaking .seg button { background: transparent; color: var(--muted); border: 0; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.shaking .seg button + button { border-left: 1px solid var(--line); }
.shaking .seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); font-weight: 600; }
.mmiscale { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; }
.mmiscale span { min-width: 22px; padding: 2px 3px; text-align: center; color: #0b0f14; font-weight: 700; border-radius: 3px; }
.mmiscale small { color: var(--muted); margin-left: 6px; font-size: 12px; }
.shakenote { flex-basis: 100%; color: var(--muted); font-size: 13px; margin: 0; }
.shaking + .maplegend { margin-top: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.stat > span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat b { display: block; font-size: 22px; margin: 2px 0; }
.stat small { color: var(--muted); font-size: 13px; }
table.near td:last-child, table.list td:last-child { font-size: 15px; font-weight: 600; color: var(--text); }
table.near small { color: var(--muted); font-weight: 400; }
table.near tr.major td { border-top: 1px dashed var(--line); padding-top: 8px; }
.nearnote { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
table.list td { font-size: 15px; padding: 10px 8px 10px 0; }
table.list td:last-child { color: var(--muted); font-weight: 400; white-space: nowrap; }
table.list a { text-decoration: none; color: var(--text); }
.bars { display: grid; gap: 10px; max-width: 640px; }
.bar { display: grid; grid-template-columns: 64px 1fr 56px; align-items: center; gap: 12px; }
.bar .track { height: 22px; background: var(--panel); border-radius: 6px; overflow: hidden; }
.bar .track div { height: 100%; }
.bar span { text-align: right; font-weight: 800; }
/* "How fast the shaking spread": P tick, S tick and the warning gap between them. */
.waves { display: grid; gap: 10px; max-width: 760px; }
.wave { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 7.5rem; align-items: center; gap: 12px; }
.wave > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave small { color: var(--muted); }
.wave b { text-align: right; font-size: 14px; white-space: nowrap; }
.wave .track { position: relative; height: 22px; background: var(--panel); border-radius: 6px; }
.wave .track i, .wavekey i { position: absolute; top: 0; bottom: 0; }
.wave .track i.p, .wave .track i.s { width: 4px; margin-left: -2px; border-radius: 2px; }
.wave .track i.p, .wavekey i.p { background: var(--text); }
.wave .track i.s, .wavekey i.s { background: #ff9f1a; }
.wave .track i.gap, .wavekey i.gap { background: rgba(255, 159, 26, .28); }
.wavekey { color: var(--muted); font-size: 13px; margin: 12px 0; }
.wavekey i { position: static; display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.waveact { display: flex; flex-wrap: wrap; gap: 10px; }
.wavetimer { position: absolute; left: 12px; bottom: 12px; z-index: 1000; background: rgba(11, 15, 20, .85); color: #f2f4f7; padding: 6px 12px; border-radius: 8px; font: 14px/1.4 system-ui, sans-serif; pointer-events: none; }
@media (max-width: 600px) {
  .wave { grid-template-columns: 1fr auto; row-gap: 4px; }
  .wave .track { grid-column: 1 / -1; grid-row: 2; }
}
.share { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 24px; align-items: start; }
.share img { width: 100%; border-radius: 12px; border: 1px solid var(--line); aspect-ratio: 4/5; background: var(--panel); }
.btn { display: inline-block; background: var(--accent); color: #0b0f14; font-weight: 700; padding: 10px 16px; border-radius: 8px; text-decoration: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.source { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.leaflet-container { font: 13px/1.4 system-ui, sans-serif; }
/* leaflet.css loads after this file and sets a light #ddd background, which shows through the
   hairline gaps between tiles on scaled/high-DPI screens. Match the dark tiles instead. */
.qmap.leaflet-container { background: #222327; }
.leaflet-popup-content a { color: #0b66c3; }
@media (max-width: 600px) {
  .qhead h1 { font-size: 48px; }
  .qhead h1.ftitle { font-size: 32px; }
  .qmap { height: 320px; }
  .share { grid-template-columns: 1fr; }
  table.list td:last-child { white-space: normal; }
}

/* Homepage magnitude filter */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filters button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b0f14; }

/* Fault maps */
.fkey, .agetoggle { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; white-space: nowrap; }
.fkey i, .agetoggle i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.agetoggles { display: flex; flex-wrap: wrap; gap: 4px 0; }
.agetoggle { cursor: pointer; color: var(--text); }
.agetoggle input { accent-color: var(--accent); margin: 0; }
.mapbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mapbar .filters { margin-bottom: 0; }
.mapbar .btn { padding: 6px 14px; font-size: 14px; }
.bigmap { height: min(72vh, 720px); }
.homemap { height: 380px; margin-bottom: 8px; }
@media (max-width: 600px) {
  .bigmap { height: 64vh; }
  .homemap { height: 300px; }
}

/* Homepage: list first, map alongside (wide) or folded above the list (narrow) */
/* Latest-quake banner: the first thing on the page, styled like a phone emergency alert.
   .major = M5+ (red), .fresh = in the last day (orange), .calm = older. --m is the magnitude color. */
.latest { --band: var(--panel); --ink: var(--muted); --edge: var(--line); position: relative; display: block; margin: 0 0 24px; border: 2px solid var(--edge); border-radius: 14px; overflow: hidden; background: var(--panel); color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.latest[hidden] { display: none; }
.latest.major { --band: #ff3b30; --ink: #fff; --edge: #ff3b30; background: linear-gradient(180deg, rgba(255,59,48,.16), rgba(255,59,48,.04)), var(--panel); box-shadow: 0 0 0 1px rgba(255,59,48,.35), 0 8px 32px rgba(255,59,48,.22); }
.latest.fresh { --band: #ff9f1a; --ink: #0b0f14; --edge: #ff9f1a; background: linear-gradient(180deg, rgba(255,159,26,.13), rgba(255,159,26,.03)), var(--panel); box-shadow: 0 8px 28px rgba(255,159,26,.16); }
.latest:hover { transform: translateY(-1px); }
.latest.calm:hover { border-color: var(--muted); }
.latest:has(.go:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.latest .go:focus-visible { outline: none; }
.lhead { display: flex; align-items: center; gap: 10px; padding: 9px 18px; background: var(--band); color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.latest.calm .lhead { border-bottom: 1px solid var(--line); }
.lhead .warn { width: 20px; height: 20px; flex: none; margin: 0; color: var(--ink); --bg: var(--band); }
.lkick { min-width: 0; }
.lago { margin-left: auto; white-space: nowrap; font-weight: 700; letter-spacing: .06em; }
.live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--band); font-size: 11px; letter-spacing: .12em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: livepulse 1.2s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .2; } }
.latest.major .lhead .warn { animation: livepulse 1.6s ease-in-out infinite; }
.lbody { display: flex; align-items: center; gap: 20px; padding: 16px 18px 18px; }
.lmag { flex: none; font-size: 64px; line-height: .9; font-weight: 900; letter-spacing: -.03em; color: var(--m); font-variant-numeric: tabular-nums; }
.lmag small { font-size: .38em; font-weight: 700; color: var(--muted); margin-right: 2px; letter-spacing: 0; }
.ltext { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ltext b { font-size: 24px; line-height: 1.2; }
.ltext > span { color: var(--muted); font-size: 15px; }
.latest.major .ltext > span, .latest.fresh .ltext > span { color: #c8ced8; }
.lacts { margin-left: auto; flex: none; display: flex; align-items: center; gap: 10px; }
.latest .go { white-space: nowrap; font-weight: 800; padding: 10px 16px; border-radius: 10px; background: var(--edge); color: var(--ink); text-decoration: none; }
/* The whole banner opens the quake page; the Share button sits above that link. */
.latest .go::after { content: ''; position: absolute; inset: 0; }
.lshare { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 800; padding: 8px 14px; border-radius: 10px; border: 2px solid var(--edge); background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; }
.lshare svg { width: 18px; height: 18px; }
.lshare:hover { background: rgba(255,255,255,.06); }
.lshare:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.latest.calm .go { background: transparent; color: var(--accent); border: 1px solid var(--line); }
/* The newest quake, when the banner is holding an earlier M5+. Quiet on purpose, and above the
   banner-wide link so it opens its own quake. */
.lnext { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.18); color: var(--text); text-decoration: none; font-size: 14px; }
.lnext:hover { background: rgba(255,255,255,.05); }
.lnext:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.lnlabel { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lntext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c8ced8; }
.lntext b { color: var(--text); }
.lnext .warn { flex: none; margin: 0 -4px 0 0; color: #ff3b30; }
.lnext > span:last-child { margin-left: auto; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .live i, .latest.major .lhead .warn { animation: none; }
  .latest, .latest:hover { transition: none; transform: none; }
}
@media (max-width: 600px) {
  .lhead { padding: 8px 14px; font-size: 11px; gap: 8px; letter-spacing: .1em; }
  .lbody { flex-wrap: wrap; gap: 6px 14px; padding: 14px 14px 16px; }
  .lnext { padding: 9px 14px; font-size: 13px; }
  .lmag { font-size: 52px; }
  .ltext { flex: 1; }
  .ltext b { font-size: 19px; }
  .ltext > span { font-size: 14px; }
  .lacts { flex-basis: 100%; margin: 8px 0 0; }
  .lacts > * { flex: 1; text-align: center; }
}
.warn { width: 1.05em; height: 1.05em; color: var(--accent); vertical-align: -0.15em; margin-right: 0.3em; }
.home { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.listbar { margin-bottom: 16px; }
.listbar .filters { margin-bottom: 6px; }
.listcount { margin: 0 0 2px; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.home .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card[hidden], .btn[hidden] { display: none; }
.oldlist { color: var(--accent); font-size: 14px; margin: 8px 0 0; }
.newquakes { position: fixed; z-index: 1000; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 16px #000a; }
.listtools { position: relative; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 10px; }
.listtools input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 16px; color-scheme: dark; }
.listtools input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.placebox { position: relative; flex: 1; min-width: 0; }
.placebox input { display: block; width: 100%; height: 44px; margin: 0; -webkit-appearance: none; appearance: none; }
.places, .cal { position: absolute; z-index: 900; top: 50px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px #000a; }
.places { left: 0; right: 0; margin: 0; padding: 4px; list-style: none; }
.places[hidden], .cal[hidden] { display: none; }
.places li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.places li:hover, .places li[aria-selected="true"] { background: var(--line); }
.places small { color: var(--muted); flex: none; }
.datebtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.datebtn svg { width: 22px; height: 22px; }
.datebtn:hover { color: var(--text); }
.datebtn.on { color: var(--accent); border-color: var(--accent); }
/* On phones "Back to latest" takes the line below the filter. */
@media (max-width: 600px) { #today:not([hidden]) { flex-basis: 100%; } }
.cal { right: 0; width: min(340px, 100%); padding: 12px; color-scheme: dark; }
.cal button:not(.btn) { background: none; color: var(--text); border: 0; padding: 0; font: inherit; cursor: pointer; }
.cal button:disabled { opacity: .3; cursor: default; }
.cal button:focus-visible, .datebtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.calhead { display: flex; justify-content: space-between; align-items: center; }
.calhead button, .calnav button { width: 40px; height: 40px; }
.calends { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.cal .calends button:not(.btn) { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; text-align: left; line-height: 1.35; }
.cal .calends button[aria-pressed="true"]:not(.btn) { border-color: var(--accent); }
.calends small { display: block; color: var(--muted); font-size: 12px; }
.calnav { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal .calnav button:not(.btn) { font-size: 24px; line-height: 1; }
.calnav select { min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font: inherit; font-size: 16px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.calweek { color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; }
.cal .calgrid button:not(.btn) { height: 38px; border-radius: 8px; font-size: 15px; }
.cal .calgrid button:not(.btn):hover:enabled { background: var(--line); }
.cal .calgrid button[aria-current]:not(.btn) { box-shadow: inset 0 0 0 1px var(--muted); }
.cal .calgrid button.in:not(.btn):enabled { background: rgba(255,204,0,.16); border-radius: 0; }
.cal .calgrid button.end:not(.btn):enabled { background: var(--accent); color: #0b0f14; font-weight: 700; }
.calacts { display: flex; justify-content: space-between; margin-top: 10px; }
.more { display: flex; justify-content: center; margin: 20px 0 8px; }
.more .btn:disabled { opacity: .6; cursor: default; }
.card { transition: border-color .15s, transform .15s; }
.card:hover, .card.hot { border-color: var(--accent); }
.card.hot { transform: translateY(-2px); }
.card.pickable { cursor: pointer; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card .cardlink { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; }
.homeside { position: sticky; top: 16px; }
.homeside .homemap { height: min(calc(100vh - 170px), 620px); }
.maptitle { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.maptitle b { color: var(--text); font-weight: 600; }
.homeside summary { display: none; }
.homeside .maplegend { margin: 8px 0 0; line-height: 2; }
.dot.ring { background: transparent; border: 2px solid #fff; }
@media (max-width: 899px) {
  .home { grid-template-columns: 1fr; }
  .homeside { position: static; order: -1; }
  .homeside summary { display: block; cursor: pointer; color: var(--text); font-weight: 600; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
  .homeside .homemap { height: 320px; }
  .widehint { display: none; }
}
i.plain { font-style: normal; }
table.near td:last-child { white-space: nowrap; padding-left: 8px; }
.shaking .fitfelt { background: transparent; color: var(--accent); border: 0; padding: 0; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* Preparedness guides (/prepare, /prepare/before|during|after) */
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 20px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.ghead { border-top: 4px solid var(--c, var(--accent)); padding-top: 18px; margin-bottom: 24px; }
.eyebrow { color: var(--c, var(--accent)); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.ghead h1 { font-size: 40px; line-height: 1.15; margin: 8px 0 10px; }
.lede { font-size: 18px; color: #c8ced8; max-width: 720px; margin: 0 0 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 13px; }
.meta div { display: flex; gap: 6px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; }
.parts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 0 0 32px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.parts li + li { border-left: 1px solid var(--line); }
.parts a { display: block; height: 100%; padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.parts a small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.parts a:hover { color: var(--text); background: var(--panel); }
.parts a[aria-current] { color: var(--text); background: var(--panel); box-shadow: inset 0 3px 0 var(--c); }
.glayout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 16px; font-size: 14px; }
.toc b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.gbody { max-width: 760px; }
.gsec { padding-bottom: 8px; margin-bottom: 28px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.gsec:last-child { border-bottom: 0; }
.gsec h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; font-size: 24px; }
.gsec h2 .n { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #0b0f14; font-size: 15px; font-weight: 800; transform: translateY(-3px); }
.gsec h3 { font-size: 16px; margin: 18px 0 6px; }
.gsec p, .gsec li { color: #d5dae2; }
.gsec ul { padding-left: 20px; }
.gsec li { margin: 6px 0; }
.gsec li::marker { color: var(--c); }
.gsec b { color: var(--text); }
.gsec a, .callout a { color: var(--accent); }
sup.ref { font-size: 11px; line-height: 0; margin-left: 1px; }
sup.ref a { color: var(--muted); text-decoration: none; }
sup.ref a:hover { color: var(--accent); }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--cc, var(--c)); background: var(--panel); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.callout > b:first-child { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cc, var(--c)); margin-bottom: 2px; }
.callout p { margin: 4px 0; color: #d5dae2; }
.callout.caution { --cc: #ff9f1a; }
.callout.danger { --cc: #ff6b5e; }
.dch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.dch div { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: #d5dae2; }
.dch strong { display: block; font-size: 22px; font-weight: 800; color: var(--c); letter-spacing: .02em; }
table.sit { margin: 8px 0 16px; }
table.sit th, table.sit td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 400; color: #d5dae2; }
table.sit th { width: 30%; font-weight: 700; color: var(--text); }
table.sit td:last-child { text-align: left; font-size: 15px; font-weight: 400; color: #d5dae2; }
.sharehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin: 48px 0 16px; }
.sharehead h2 { margin: 0; }
.sharehead p { margin: 4px 0 0; }
[data-sizes] { display: flex; align-items: center; gap: 10px; }
.seglabel { color: var(--muted); font-size: 13px; }
[data-sizes] .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
[data-sizes] .seg button { background: transparent; color: var(--muted); border: 0; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
[data-sizes] .seg button + button { border-left: 1px solid var(--line); }
[data-sizes] .seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); font-weight: 600; }
.cardgroup { margin: 0 0 28px; }
.cardgroup h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.cardgroup > p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.sharegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.sharecard { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.sharecard .shot { display: block; background: var(--bg); }
.sharecard img { display: block; width: 100%; aspect-ratio: 4/5; }
.sharecard.story img { aspect-ratio: 9/16; }
.sharecard figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sharecard figcaption b { font-size: 15px; }
.sharecard figcaption span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.sharecard .acts { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.refs { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.refs h2 { margin-top: 0; font-size: 18px; }
.refs ol { padding-left: 22px; font-size: 14px; color: var(--muted); }
.refs li { margin: 8px 0; scroll-margin-top: 16px; }
.refs li:target { color: var(--text); }
.refs li a { color: var(--text); }
.refs li small { display: block; color: var(--muted); }
.disclaimer { color: var(--muted); font-size: 13px; margin-top: 16px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.pager a:hover { border-color: var(--muted); }
.pager a small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.pager a.next { text-align: right; margin-left: auto; }
.hubparts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.hubpart { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 12px; padding: 16px 18px; color: var(--text); text-decoration: none; }
.hubpart:hover { border-color: var(--c); }
.hubpart h2 { margin: 6px 0; font-size: 22px; }
.hubpart p { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.hubpart ul { margin: 0 0 12px; padding-left: 18px; font-size: 14px; color: #d5dae2; }
.hubpart ul li::marker { color: var(--c); }
.hubpart .go { margin-top: auto; color: var(--c); font-weight: 700; font-size: 14px; }
@media (max-width: 899px) {
  .glayout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; margin-bottom: 24px; }
  .hubparts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ghead h1 { font-size: 30px; }
  .lede { font-size: 16px; }
  .parts a { padding: 8px 10px; font-size: 13px; }
  .dch { grid-template-columns: 1fr; }
  table.sit th { width: 38%; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
}
@media print {
  :root { --bg: #fff; --panel: #fff; --line: #ccc; --text: #000; --muted: #444; }
  body { background: #fff; color: #000; font-size: 12pt; }
  body > nav, .parts, .toc, .sharehead, .cardgroup, .sharegrid, .pager { display: none !important; }
  .glayout { display: block; }
  .gsec p, .gsec li, table.sit th, table.sit td, .dch div, .callout p, .lede { color: #000; }
  .gsec h2 .n { color: #fff; background: #000; }
  .refs li a { color: #000; }
  .refs li a::after { content: " (" attr(href) ")"; font-size: 10pt; color: #444; }
  .gsec, .callout { break-inside: avoid; }
}

/* Share buttons on homepage cards and map popups */
.card .cardacts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.card .cardacts .cardlink { margin-top: 0; }
.card .cardacts .btn { padding: 4px 12px; }
.popacts { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.leaflet-popup-content .popacts .btn { color: #0b0f14; border-color: #c7ccd3; padding: 3px 10px; }
.qshare { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.qshare .btn { display: inline-flex; align-items: center; gap: 8px; }
.qshare .btn svg { width: 18px; height: 18px; }
#share { scroll-margin-top: 16px; }

/* Ads (ads.js). Each box holds its ad's height before it loads, and goes away if there's no ad for it.
   The top strip instead stays closed until its ad fills, so there's no gap under the nav. It keeps its width (no
   display: none) because AdSense won't fill a box without one. */
.ad-slot { margin: 32px 0; min-height: 280px; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-top { margin: 0 auto; min-height: 0; padding: 8px 16px; max-width: 1100px; }
.ad-top:not(:has(ins[data-ad-status="filled"])) { height: 0; padding-block: 0; overflow: hidden; }
.ad-top ins { width: min(100%, 320px); height: 100px; margin: 0 auto; }
.ad-banner { min-height: 0; }
.ad-banner ins { width: min(100%, 336px); height: 280px; margin: 0 auto; }
.ad-cell { margin: 0; min-height: 0; align-self: center; }
.ad-cell ins { width: min(100%, 300px); height: 250px; margin: 0 auto; }
.grid.searching .ad-cell { display: none; }
@media (min-width: 768px) { .ad-top ins, .ad-banner ins { width: min(100%, 728px); height: 90px; } }
@media (min-width: 1040px) { .ad-banner ins { width: min(100%, 970px); height: 250px; } }
@media print { .ad-slot { display: none !important; } }

/* Site footer on every page: what this is, plus the legal links. */
.sitefoot { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.sitefoot p { margin: 0 0 6px; }
.sitefoot a { color: var(--text); display: inline-block; padding: 4px 0; }
@media print { .sitefoot { display: none; } }
