:root { color-scheme: light dark; --paper: #f0efdf; --surface: #faf9ed; --ink: #1d2420; --muted: #465347; --line: #a8af9d; --accent: #c4ed89;
  --cool: #2f7d95; --haz: #c2410c; --aurora: #2f8f5b; --amber: #9a6a00; --mono: ui-monospace, monospace; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 system-ui, sans-serif; }
header, main, footer { width: min(100% - 2rem, 72rem); margin-inline: auto; }
header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
a { color: inherit; text-underline-offset: .2em; }
main { padding-block: 3rem; }
h1 { font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.12; letter-spacing: -.04em; margin: .5rem 0 1rem; overflow-wrap: anywhere; }
h2 { margin-top: 0; font-size: 1.25rem; }
h2 .n { font: 600 .85rem var(--mono); color: var(--muted); margin-right: .7rem; }
h3 { margin: .8rem 0 .2rem; font-size: 1.2rem; line-height: 1.3; }
.eyebrow { font-family: var(--mono); color: var(--muted); }
.intro { max-width: 48rem; font-size: 1.12rem; }
section { padding: clamp(1rem, 3vw, 2rem); margin-block: 2rem; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin-block: 2rem; }
.pair section { margin: 0; }
.lede { max-width: 60rem; }
.small, .hint, .meta { font-size: .875rem; color: var(--muted); }
.meta { font-family: var(--mono); }
.unavailable { color: var(--muted); font-style: italic; }
code { font-family: var(--mono); font-size: .9em; }

.capture-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .8rem 1rem; border: 1px solid var(--line); background: var(--surface); }
.capture-bar label { font-weight: 650; }
.capture-bar p { margin: 0; color: var(--muted); font-size: .9rem; }
select, input { min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .25rem; background: var(--paper); color: var(--ink); font: inherit; }
button { padding: .65rem 1rem; min-height: 44px; border: 1px solid var(--line); border-radius: .25rem; background: var(--accent); color: #17201c; font: 650 .9rem/1.5 system-ui, sans-serif; cursor: pointer; }
button.quiet { background: transparent; color: var(--ink); min-height: 32px; padding: .2rem .6rem; font-weight: 500; }

figure { margin: 0; }
figure img, figure iframe { display: block; width: 100%; border: 0; background: #000; border-radius: .25rem; }
#earth figure img { aspect-ratio: 1; object-fit: contain; }
#apod figure img, #apod iframe { aspect-ratio: 4 / 3; object-fit: cover; }
.expl { max-height: 8.2em; overflow: hidden; }
.expl.open { max-height: none; }
.stats { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; margin: .8rem 0; }
.stats div { font-size: .82rem; color: var(--muted); }
.stats b { display: block; font: 600 1.6rem/1.2 var(--mono); color: var(--ink); }

.chart svg, .kp svg { display: block; width: 100%; height: auto; }
.chart text, .kp text { fill: var(--muted); font: 11px var(--mono); }
.chart .grid { stroke: var(--line); stroke-width: .6; }
.chart .moon { stroke: var(--cool); stroke-dasharray: 4 4; }
.chart .neo { fill: var(--cool); fill-opacity: .6; stroke: var(--cool); cursor: pointer; }
.chart .neo.haz { fill: var(--haz); stroke: var(--haz); }
.chart .neo:hover, .chart .neo:focus, .chart .neo.sel { fill-opacity: .95; stroke: var(--ink); stroke-width: 2; outline: none; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .82rem; color: var(--muted); }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .35rem; }
.dot.safe { background: var(--cool); } .dot.haz { background: var(--haz); }
.detail { font-family: var(--mono); font-size: .875rem; min-height: 1.6em; }
summary { cursor: pointer; font-weight: 650; }
.table-wrap { overflow-x: auto; margin-top: .8rem; }
table { border-collapse: collapse; width: 100%; font: .85rem var(--mono); }
th, td { padding: .4rem .6rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td.haz a { color: var(--haz); }

.places { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .8rem; }
.places li { border: 1px solid var(--line); padding: .8rem 1rem; background: var(--paper); position: relative; }
.places .name { font-weight: 650; font-size: 1.1rem; padding-right: 4.5rem; overflow-wrap: anywhere; }
.places .quiet { position: absolute; top: .5rem; right: .5rem; }
.verdict { font: 650 .8rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.verdict.yes { color: var(--aurora); } .verdict.maybe { color: var(--amber); } .verdict.no, .verdict.unknown { color: var(--muted); }
.add-place label { display: block; font-weight: 650; margin-bottom: .3rem; }
.add-place .row { display: flex; gap: .5rem; max-width: 30rem; }
.add-place input { flex: 1; min-width: 0; }
.error { color: var(--haz); min-height: 1.2em; margin: .3rem 0 0; font-size: .875rem; }
.kp .bar { fill: var(--line); } .kp .bar.predicted { fill: var(--accent); stroke: var(--aurora); stroke-width: .5; } .kp .bar.hot { fill: var(--aurora); }
.kp .thr { stroke: var(--amber); stroke-dasharray: 4 3; }

.flares { list-style: none; padding: 0; margin: 0; }
.flares li { display: flex; flex-wrap: wrap; gap: .2rem 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.cls { font: 650 .95rem var(--mono); min-width: 3.4em; }
.cls.X { color: var(--haz); } .cls.M { color: var(--amber); }

.map-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
#map { height: 26rem; border: 1px solid var(--line); background: var(--paper); }
#ev-list { list-style: none; margin: 0; padding: 0; max-height: 26rem; overflow-y: auto; }
#ev-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); font-weight: 500; min-height: 0; padding: .5rem .2rem; }
#ev-list button:hover { background: var(--paper); }
#ev-list .cat { display: block; font: .75rem var(--mono); color: var(--muted); text-transform: uppercase; }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(9.5rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .4rem; }
.strip a { text-decoration: none; font-size: .875rem; }
.strip img, .strip .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; border-radius: .25rem; margin-bottom: .3rem; }
.strip .d { display: block; font: .75rem var(--mono); color: var(--muted); }

aside { border-left: 3px solid var(--line); padding-left: 1rem; }
footer { border-top: 1px solid var(--line); padding-block: 1.5rem; }
:focus-visible { outline: 3px solid #ca6c1b; outline-offset: 4px; }
.skip { position: absolute; top: -10rem; left: 1rem; padding: .5rem; background: var(--surface); }
.skip:focus { top: .5rem; }
[hidden] { display: none !important; }
@media (max-width: 48rem) { .pair, .map-row { grid-template-columns: 1fr; } #map { height: 20rem; } main { padding-block: 1.5rem; } }
@media (prefers-color-scheme: dark) {
  :root { --paper: #17201c; --surface: #222d26; --ink: #f0efdf; --muted: #c3cfbc; --line: #64755d; --cool: #7cc6dc; --haz: #ff8a65; --aurora: #6be3a0; --amber: #f2c14e; }
  .kp .bar.predicted { fill: #4c6b3c; }
  .leaflet-tile { filter: brightness(.75) contrast(1.1) saturate(.6); }
}
