/* Sun & Moon: base styles, light theme. Mobile first. The dark theme is
   dark.css, which overrides this file; see the note at its top. */

:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1d1f24;
  --muted: #646a75;
  --line: #e4e1d8;
  /* The masthead: the header and the circumstances bar under it, one panel set off from the page. */
  --masthead: #e8ecf5;
  --masthead-line: #d5dbe9;
  --accent-sun: #e8891c;
  --accent-sun-soft: #fdf1e1;
  --accent-moon: #4a5a8c;
  --accent-moon-soft: #eceff8;
  --accent-twilight: #8a4f7d;
  --warn-text: #a35a00;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-wrap: break-word; }
h1, h2, h3, p { margin: 0; }

.site-header {
  /* The background runs edge to edge; the content lines up with the page's (1040px with 20px padding). */
  padding: 18px max(24px, calc((100% - 1000px) / 2));
  width: 100%;
  background: var(--masthead);
  border-bottom: 1px solid var(--masthead-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-tools { display: flex; align-items: center; gap: 18px; }
.site-nav { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
/* With the circumstances bar under it, the bar draws the line between them and the one at the bottom. */
.site-header:has(+ .circumstances) { border-bottom: 0; }
/* Phones: the brand, three links and Settings on one line. */
@media (max-width: 480px) {
  .site-header { gap: 10px; padding: 14px 16px; }
  .site-tools { gap: 12px; }
  .site-nav { gap: 12px; font-size: 0.9rem; }
  .brand { gap: 8px; white-space: nowrap; }
}
/* The smallest phones keep the mark; the name stays for screen readers. */
@media (max-width: 374px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
/* Fun Facts dropdown: a <details>, so it works without script. */
.site-menu { position: relative; }
.site-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary:hover, .site-menu[open] summary { color: var(--text); }
.site-menu summary.is-current { color: var(--text); font-weight: 600; }
.site-menu summary:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; border-radius: 4px; }
.site-menu-chev { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.site-menu[open] .site-menu-chev { transform: rotate(180deg); }
.site-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.16);
}
.site-menu-panel > div { display: grid; }
.site-nav .site-menu-panel a { padding: 9px 12px; border-radius: 9px; color: var(--text); }
.site-nav .site-menu-panel a:hover { background: var(--accent-moon-soft); }
.site-menu-label {
  margin: 6px 12px 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) { .site-menu-chev { transition: none; } }
@media (max-width: 480px) {
  .site-header { flex-wrap: wrap; row-gap: 4px; }
  .site-nav { gap: 14px; }
  .site-nav a, .brand { white-space: nowrap; }
  /* Brand, Account and Settings on the first line, the five sections spread across the second. */
  .site-tools { display: contents; }
  .account-button { order: 1; margin-left: auto; }
  .settings { order: 1; }
  .site-nav { order: 2; flex-basis: 100%; justify-content: space-between; gap: 2px 8px; flex-wrap: wrap; }
}
@media (max-width: 374px) {
  .site-nav { font-size: 0.86rem; }
}
/* Sections beyond the first four show only where the header has room for them;
   the More menu holds the ones that do not (each item hides while its section shows). */
.site-nav .nav-more, .nav-more .more-aurora, .nav-more .more-radio, .nav-more .more-dark { display: none; }
@media (max-width: 959px) {
  .site-nav .nav-more, .nav-more .more-dark { display: block; }
  .nav-more summary[data-current="dark"] { color: var(--text); font-weight: 600; }
}
@media (max-width: 939px) {
  .nav-more .more-aurora { display: block; }
  .nav-more summary[data-current="aurora"] { color: var(--text); font-weight: 600; }
}
@media (max-width: 859px) {
  .site-nav .nav-wide { display: none; }
  .nav-more .more-radio { display: block; }
  .nav-more summary[data-current="radio"] { color: var(--text); font-weight: 600; }
}
/* Phones give the sections their own rows, with room for Aurora itself. */
@media (max-width: 480px) {
  .site-nav .nav-wide.nav-aurora { display: block; }
  .nav-more .more-aurora { display: none; }
  .nav-more summary[data-current="aurora"] { color: var(--muted); font-weight: inherit; }
}
@media (max-width: 959px) {
  .site-nav .nav-widest { display: none; }
}
@media (max-width: 939px) {
  .site-nav .nav-wider { display: none; }
}
@media (max-width: 659px) {
  .site-nav .nav-wide { display: none; }
}
/* Between phone and tablet widths the sections may need a second line. */
@media (max-width: 799px) {
  .site-nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex: none;
  white-space: nowrap;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: 0.005em;
}
.brand-mark { width: 38px; height: 38px; display: block; }
@media (max-width: 480px) {
  .brand { font-size: 1.15rem; }
  .brand-mark { width: 32px; height: 32px; }
}

/* Settings: theme and units, in a menu from the header (the settings island). */
.settings { position: relative; }
.settings[hidden] { display: none; }
.settings-button, .account-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.settings-button::-webkit-details-marker { display: none; }
.settings-button:hover, .account-button:hover { color: var(--text); border-color: var(--muted); }
.settings-button:focus-visible, .account-button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.account-button { flex: none; text-decoration: none; }
.account-button[aria-current="page"] { color: var(--text); border-color: var(--accent-moon); }
.account-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.settings[open] > .settings-button { color: var(--text); border-color: var(--accent-moon); }
.settings-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: max-content;
  min-width: 15rem;
  max-width: calc(100vw - 40px);
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
}
.setting { margin: 0; padding: 0; border: 0; min-width: 0; }
.setting legend { padding: 0; margin-bottom: 6px; font-size: 0.85rem; color: var(--muted); }
.setting .segmented { display: flex; }
.setting .segmented label { flex: 1; justify-content: center; font-size: 0.92rem; white-space: nowrap; }

.page {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.place { margin: 8px 0 10px; }
/* Nothing left to show (the home page's heading is for screen readers only): no gap of its own. */
.place:not(:has(> :not(.visually-hidden))) { margin: 0; }
.place h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.15; letter-spacing: -0.01em; }
.place-meta { margin-top: 6px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.place-meta > * { min-width: 0; overflow-wrap: anywhere; }
/* While another day or place loads in place. */
.is-navigating main.page { opacity: 0.6; transition: opacity 0.15s 0.1s; }
.note { font-size: 0.9rem; }
.link-button {
  font: inherit;
  font-size: 0.9rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-moon);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.notice {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-moon-soft);
  font-size: 0.95rem;
}

.cards { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* Two columns: Sun | Moon, Twilight | Phase, then Solar risk across both. One column keeps the page order: all Sun, then all Moon.
   Side by side, the first four cards share one height (the tallest one's): two equal flexible rows. Each card's
   last block (details, notes, the next phases) sits at the bottom, so spare room falls between its parts. */
@media (min-width: 820px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; }
  .card-sun { grid-area: 1 / 1; }
  .card-moon { grid-area: 1 / 2; }
  .card-twilight { grid-area: 2 / 1; }
  .card-phase { grid-area: 2 / 2; }
  .card-risk { grid-area: 3 / 1 / 4 / 3; }
  :is(.card-sun, .card-moon, .card-twilight, .card-phase) { align-self: stretch; }
  :is(.card-sun, .card-moon, .card-twilight, .card-phase) > :last-child { margin-top: auto; }
}

/* Small cards, one topic each: a title, the key facts, then details. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
@media (max-width: 380px) { .card { padding: 16px 14px; } }

.card-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }
.card-caption { color: var(--muted); font-size: 0.85rem; margin-right: auto; }
.card-sun .card-header h2, .card-risk .card-header h2 { color: var(--accent-sun); }
.card-moon .card-header h2, .card-phase .card-header h2 { color: var(--accent-moon); }
.card-twilight .card-header h2 { color: var(--accent-twilight); }
.card-icon { width: 28px; height: 28px; flex: none; }
.sun-icon { fill: var(--accent-sun); stroke: var(--accent-sun); stroke-width: 1.6; stroke-linecap: round; }
.moon-glyph { fill: var(--accent-moon); }
.twilight-icon { fill: none; stroke: var(--accent-twilight); stroke-width: 1.8; stroke-linecap: round; }
.moon-icon .moon-dark { fill: var(--accent-moon-soft); stroke: var(--accent-moon); stroke-width: 1; }
.moon-icon .moon-lit { fill: var(--accent-moon); }
.card .notice { margin: 0; }
.notice[hidden] { display: none; }

/* Rise/set timeline: the previous event, "now", then the next two. */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline { container-type: inline-size; }
.event {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon name time"
    "icon day  relative";
  column-gap: 12px;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: 14px;
}
.event[hidden] { display: none; }
.event-icon {
  grid-area: icon;
  align-self: center;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-sun .event-icon { color: var(--accent-sun); }
.card-moon .event-icon { color: var(--accent-moon); }
.event-name { grid-area: name; font-weight: 600; }
.event-time {
  grid-area: time;
  text-align: right;
  font-size: clamp(1.35rem, 5vw, 1.6rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.event-day { grid-area: day; font-size: 0.85rem; color: var(--muted); }
.event-day .north-true, .event-day .north-magnetic { white-space: nowrap; }
.day-label { color: var(--text); font-weight: 600; }
.event-relative {
  grid-area: relative;
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.event.is-past { opacity: 0.6; }
/* Narrow cards (small phones, large text): stack time and countdown under the name. */
@container (max-width: 300px) {
  .event {
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas: "icon name" "icon time" "icon day" "icon relative";
  }
  .event-time, .event-relative { text-align: left; }
}
.event.is-past .event-time { font-size: 1.15rem; font-weight: 600; }
.card-sun .event.is-next { background: var(--accent-sun-soft); }
.card-moon .event.is-next { background: var(--accent-moon-soft); }

.now-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.now-marker::before, .now-marker::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.now-marker::before { flex: 0 0 14px; }
.now-marker time { font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; font-weight: 500; }

.details { margin: 0; display: grid; gap: 0; }
.details > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.details dt { color: var(--muted); }
.details dd { margin: 0 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; }
.dt-note, .dd-note { display: block; font-size: 0.8rem; color: var(--muted); }
.dt-note { opacity: 0.85; }
.muted { color: var(--muted); }
.footnote { font-size: 0.8rem; color: var(--muted); }
.footnote a { color: inherit; }

/* Twilight ribbon: the day from midnight to midnight, coloured by where the Sun is
   (the sky slider's palette), with the hours under it and the chosen time on it. */
.band-day { --band: #8ec5ef; }
.band-civil { --band: #c77d8a; }
.band-nautical { --band: #4b5a92; }
.band-astronomical { --band: #2a3260; }
.band-night { --band: #141a36; }
.twilight-chart { min-width: 0; }
.twilight-ribbon { display: block; overflow: visible; }
.twilight-ribbon rect[class^="band-"] { fill: var(--band); }
.twilight-frame { fill: none; stroke: rgb(0 0 0 / 0.08); stroke-width: 1; }
.twilight-names text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-anchor: middle;
  fill: rgb(255 255 255 / 0.88);
  pointer-events: none;
}
.twilight-names .band-day text { fill: #17365c; }
.twilight-hours line { stroke: var(--muted); stroke-opacity: 0.5; stroke-width: 1; }
.twilight-hours text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.twilight-marker line { stroke-linecap: round; }
.twilight-marker .marker-halo { stroke: #fff; stroke-width: 6; opacity: 0.9; }
.twilight-marker .marker-line { stroke: var(--accent-sun); stroke-width: 2.5; }
/* The times by depth: one row per band, dawn on the left, dusk on the right. The bands
   stack from daylight down to astronomical twilight and narrow as they go, like the
   Sun sinking. Fixed layout so large text wraps inside the cells. */
.twilight {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.twilight thead th { padding: 0 12px 6px; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.twilight thead th:first-child, .twilight td:first-child { text-align: right; }
.twilight thead th:last-child, .twilight td:last-child { text-align: left; }
.twilight thead th:nth-child(2) { width: 46%; }
.twilight td { padding: 0 12px; font-weight: 600; white-space: nowrap; }
.twilight th[scope="row"] {
  --top: 0%;
  --bottom: 0%;
  height: 46px;
  padding: 4px 10px;
  text-align: center;
  line-height: 1.2;
  background: var(--band);
  color: #fff;
  clip-path: polygon(var(--top) 0, calc(100% - var(--top)) 0, calc(100% - var(--bottom)) 100%, var(--bottom) 100%);
}
.twilight tr.band-day th { --top: 0%; --bottom: 3%; color: #17365c; }
.twilight tr.band-civil th { --top: 3%; --bottom: 6%; }
.twilight tr.band-nautical th { --top: 6%; --bottom: 9%; }
.twilight tr.band-astronomical th { --top: 9%; --bottom: 12%; }
.twilight tbody tr:first-child th { border-radius: 10px 10px 0 0; }
.twilight tbody tr:last-child th { border-radius: 0 0 10px 10px; }
.band-name { display: block; font-size: 0.9rem; font-weight: 600; }
.band-depth { display: block; font-size: 0.75rem; opacity: 0.85; }
@media (max-width: 380px) {
  .twilight td, .twilight thead th { padding-left: 6px; padding-right: 6px; }
  .twilight th[scope="row"] { padding: 4px 6px; }
}

.phase {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent-moon-soft);
}
.phase .moon-icon { width: 56px; height: 56px; }
.phase .bar, .phase .footnote { grid-column: 1 / -1; }
.phase-text { min-width: 0; }
.phase-name { font-size: 1.3rem; font-weight: 650; }
.phase-meta [hidden] { display: none; }
.phase-meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.phase-meta strong { color: var(--text); font-weight: 600; }
.bar { display: block; }
.bar-track { fill: var(--line); }
.bar-fill { fill: var(--accent-moon); }

.subheading { font-size: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.subheading .muted { font-weight: 400; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Solar radiation level, NOAA scale terms: the worse of R (flare X-rays) and S (particles) now. */
.activity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.activity strong {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--accent-sun-soft);
  color: var(--accent-sun);
}
.risk-level-0 strong { background: var(--accent-moon-soft); color: var(--accent-moon); }
.risk-level-3 strong { background: #c2410c; color: #fff; }
.risk-level-4 strong { background: #b91c1c; color: #fff; }
.risk-level-5 strong { background: #7f1d1d; color: #fff; }

/* Solar risk: UV and solar radiation, stacked on phones, side by side on wide screens. */
.risk-parts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.risk-radiation { border-top: 1px solid var(--line); padding-top: 18px; }
@media (min-width: 820px) {
  .risk-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .risk-radiation { border-top: 0; padding-top: 0; border-left: 1px solid var(--line); padding-left: 28px; }
}

/* UV index colors from WHO's Global Solar UV Index. */
.uv-low { --uv: #289500; --uv-ink: #fff; }
.uv-moderate { --uv: #f7e400; --uv-ink: #1d1f24; }
.uv-high { --uv: #f85900; --uv-ink: #fff; }
.uv-veryhigh { --uv: #d8001d; --uv-ink: #fff; }
.uv-extreme { --uv: #6b49c8; --uv-ink: #fff; }
/* The Sun is down: no rating, a moon in the badge. */
.uv-night { --uv: var(--accent-moon-soft); --uv-ink: var(--accent-moon); }
.uv-now { display: flex; align-items: center; gap: 14px; }
.uv-badge {
  flex: none;
  min-width: 54px;
  height: 54px;
  padding: 0 10px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--uv);
  color: var(--uv-ink);
}
.uv-moon { display: none; width: 28px; height: 28px; fill: currentColor; }
.uv-night .uv-value { display: none; }
.uv-night .uv-moon { display: block; }
.uv-now-text { display: flex; flex-direction: column; min-width: 0; }
.uv-now-text strong { font-size: 1.1rem; }
.uv-basis { font-size: 0.85rem; color: var(--muted); }
.uv-chart { display: block; width: 100%; height: auto; overflow: visible; }
.uv-axis { stroke: var(--line); stroke-width: 1; }
.uv-threshold { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.uv-area { fill: var(--accent-sun); fill-opacity: 0.3; stroke: var(--accent-sun); stroke-width: 1.5; stroke-linejoin: round; }
.uv-clear { fill: none; stroke: var(--accent-sun); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: 0.75; }
.uv-marker line { stroke: var(--text); stroke-width: 1; opacity: 0.3; }
.uv-marker circle { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.uv-tick text { fill: var(--muted); font-size: 10px; }
.uv-legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.78rem; color: var(--muted); margin-top: -4px; }
.uv-key::before { content: ""; display: inline-block; width: 14px; margin-right: 6px; vertical-align: middle; }
.uv-key-estimate::before { height: 9px; background: var(--accent-sun); opacity: 0.45; border-top: 2px solid var(--accent-sun); }
.uv-key-clear::before { border-top: 2px dashed var(--accent-sun); }
.uv-key-threshold::before { border-top: 1px dashed var(--muted); }
.uv-advice { font-size: 0.9rem; }
.risk-more { font-size: 0.9rem; }
.risk-more a { color: var(--accent-moon); }

/* A page's reference list: closed until asked for, but still in the HTML for
   search engines and readers without JavaScript. Links to it, or to a numbered
   source in it, open it (lib/reveal.ts), and so does printing. Pages style the
   heading and list; this is the shared row: heading, count, then the arrow. */
.refs { scroll-margin-top: 12px; }
.refs > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-block: 4px; cursor: pointer; list-style: none; }
.refs > summary::-webkit-details-marker { display: none; }
.refs > summary :is(h2, h3) { margin: 0; }
/* Beside the heading when there is room, on its own line under it when not. */
.refs-count { flex: 1 1 12em; color: var(--muted); font-size: 0.9rem; }
.refs > summary::after { content: "\25BE"; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.refs[open] > summary::after { content: "\25B4"; }
.refs > summary:hover :is(h2, h3) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.refs > summary:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 4px; border-radius: 6px; }
@media print { .refs > summary::after { content: none; } }

/* "How this is estimated": sources and method, out of the way until asked for. */
.info summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  color: var(--muted);
}
.info summary::-webkit-details-marker { display: none; }
.info summary:hover, .info[open] summary { color: var(--text); }
.info-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-grid;
  place-items: center;
  font: italic 600 11px/1 Georgia, "Times New Roman", serif;
}
.info-body {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.info-body a { color: inherit; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.phase-list { list-style: none; margin: 0; padding: 0; }
.phase-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.phase-list time { color: var(--muted); }

.site-footer a { color: inherit; }
.site-footer p + p { margin-top: 4px; }
.site-footer {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- Circumstances: where and when, under the header, kept at the top while scrolling ----
   On every page where the place or the time matters (_Circumstances.cshtml).
   Page elements that also stick (Apollo's tabs) sit under it: --sticky-top is
   its height, kept current by the circumstances island. */
.circumstances {
  position: sticky;
  top: 0;
  z-index: 20;
  /* The lower half of the masthead the header starts, edge to edge like it. */
  background: var(--masthead);
  border-top: 1px solid var(--masthead-line);
  border-bottom: 1px solid var(--masthead-line);
  box-shadow: 0 6px 16px -10px rgb(0 0 0 / 0.25);
}
.circumstances-bar {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.circumstances :is(input, button, summary, a):focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.has-circumstances { --sticky-top: 62px; }
html:has(.has-circumstances) { scroll-padding-top: calc(var(--sticky-top, 62px) + 8px); }
.has-circumstances .page { padding-top: 28px; }

/* Shared look: one height, one border, one radius. */
.where-chip, .day-step, .day-pick input, .day-button, .time-pick input, .share-button, .reset, .day-go, .time-go, .live-now {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
}
.circumstances svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* The place: a chip that opens the location panel. Its second line says how the place was found. */
.where { min-width: 0; }
.where-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 26rem;
  padding: 3px 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.where-chip::-webkit-details-marker { display: none; }
.where-chip:hover { border-color: var(--muted); }
.where-pin { color: var(--accent-sun); }
.where-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.where-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.where-how { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.76rem; }
.where-zone { font-variant-numeric: tabular-nums; }
/* The place may be wrong (unknown, or only the country): say so in the chip. */
.where-chip.is-doubtful { border-color: color-mix(in srgb, var(--accent-sun) 55%, var(--line)); }
.where-chip.is-doubtful .where-how { color: var(--warn-text, #a35a00); }
.where-caret { color: var(--muted); transition: transform 0.15s; }
.where[open] > .where-chip { border-color: var(--accent-moon); }
.where[open] .where-caret { transform: rotate(180deg); }
.where-panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 20px;
  width: min(calc(100% - 40px), 36rem);
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
}
.where-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.where-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--accent-moon);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.where-action svg { width: 16px; height: 16px; }
.where-action:hover { border-color: var(--accent-moon); background: var(--accent-moon-soft); }
.where-action:disabled { opacity: 0.6; cursor: progress; }
.where-action.back-home { background: var(--accent-moon-soft); border-color: transparent; }
.where-action[hidden] { display: none; }
.where-actions .hint { flex-basis: 100%; }
.where-explain:empty { display: none; }

/* Live pages: no date to pick, the current time at the place instead. */
.live-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #23a565; box-shadow: 0 0 0 0 rgb(35 165 101 / 0.5); animation: live-pulse 2.4s ease-out infinite; }
.live-clock { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgb(35 165 101 / 0.45); } 70%, 100% { box-shadow: 0 0 0 7px rgb(35 165 101 / 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.hint { color: var(--muted); font-size: 0.9rem; }

/* The date: ‹ picker › */
.day-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.day-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  text-decoration: none;
}
.day-step:hover { border-color: var(--muted); }
.day-step.is-disabled { visibility: hidden; }
.day-pick, .time-pick { display: flex; gap: 6px; align-items: center; min-width: 0; }
.day-pick input, .time-pick input {
  min-width: 0;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}
/* With JavaScript a click anywhere on the field opens the picker, so the small icon can go. */
.js .day-pick input, .js .time-pick input { cursor: pointer; }
.js .day-pick input::-webkit-calendar-picker-indicator,
.js .time-pick input::-webkit-calendar-picker-indicator { display: none; }
.day-pick input:hover, .time-pick input:hover { border-color: var(--muted); }
.day-go, .time-go { padding: 0 14px; border: 0; background: var(--accent-moon); color: var(--surface); cursor: pointer; }
.day-go[hidden], .time-go[hidden] { display: none; }

/* With JavaScript the date field is a button that opens the Moon calendar. */
.day-pick input[hidden], .day-button[hidden] { display: none; }
.day-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px 0 10px;
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.day-button > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.day-button svg { color: var(--accent-moon); }
.day-button:hover { border-color: var(--muted); }
.day-button[aria-expanded="true"] { border-color: var(--accent-moon); }

/* The Moon calendar: a month with each day's phase, then the month's principal phases. */
.day-nav { position: relative; }
.calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 22.5rem;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
}
.calendar-head { display: flex; align-items: center; gap: 6px; }
.calendar-title { flex: 1; display: flex; justify-content: center; gap: 6px; min-width: 0; }
.calendar select {
  min-width: 0;
  min-height: 36px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  color-scheme: light dark;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.calendar-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.calendar-step:hover:not(:disabled), .calendar select:hover { border-color: var(--muted); }
.calendar-step:disabled { opacity: 0.35; cursor: default; }
.calendar :is(a, button, select):focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.calendar-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar-grid th { padding: 2px 0 6px; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.calendar-grid td { padding: 1px; }
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
a.calendar-day:hover { background: var(--accent-moon-soft); }
.calendar-number { font-size: 0.85rem; line-height: 1; }
.calendar-moon, .calendar-moon-slot { display: block; width: 20px; height: 20px; flex: none; }
.calendar-day.is-today .calendar-number { color: var(--accent-sun); font-weight: 700; }
.calendar-day.is-shown { background: var(--accent-moon-soft); border-color: var(--accent-moon); }
.calendar-day.is-principal .calendar-number { font-weight: 700; }
.calendar-day.is-principal .calendar-moon { border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent-sun); }
.calendar-day.is-disabled { opacity: 0.35; }
.calendar-phases[hidden] { display: none; }
.calendar-phases { border-top: 1px solid var(--line); padding-top: 6px; }
.calendar-phases ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.calendar-phases a {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}
.calendar-phases a:hover { background: var(--accent-moon-soft); }
.calendar-phases .calendar-moon { width: 16px; height: 16px; }
.calendar-phases time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Share: a link to the place and moment shown, at the end of the bar. */
.share { position: relative; display: flex; margin-left: auto; }
.share[hidden] { display: none; }
.share-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent-moon);
  cursor: pointer;
}
.share-button:hover { border-color: var(--accent-moon); }
/* "Link copied", or the link to copy by hand. Present but empty when idle, so screen readers hear it change. */
.share-note {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0s 0.15s;
}
.share-note.is-shown { opacity: 1; visibility: visible; transform: none; transition: opacity 0.15s, transform 0.15s; }
.share-note.is-manual {
  width: min(26rem, calc(100vw - 40px));
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  white-space: normal;
}
.share-note label { display: flex; flex-direction: column; gap: 8px; }
.share-note input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: inherit;
  font: inherit;
  font-weight: 400;
}

/* The way back, right after the time. */
.resets { display: flex; gap: 8px; }
.reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: var(--accent-moon);
}
.reset:hover { border-color: var(--accent-moon); }
.reset-here { background: var(--accent-moon); border-color: var(--accent-moon); color: var(--surface); padding-left: 11px; }
.reset-here:hover { filter: brightness(1.08); }
.reset[hidden] { display: none; }

/* Tablets: one line still, so Share is its icon, and so is "Here & now" when "Now" shows too. */
@media (min-width: 761px) and (max-width: 919px) {
  .share-button { width: 44px; padding: 0; justify-content: center; }
  .share-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .circumstances-bar:has(.reset-now:not([hidden])) .reset-here { width: 44px; padding: 0; justify-content: center; }
  .circumstances-bar:has(.reset-now:not([hidden])) .reset-here span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Phones and small tablets: the place and the way back on one line, date and time (or "Live") on the next. */
@media (max-width: 760px) {
  .has-circumstances { --sticky-top: 108px; }
  .circumstances-bar { padding: 10px 16px 12px; row-gap: 8px; gap: 6px; }
  .circumstances-bar::before { content: ""; order: 2; flex-basis: 100%; }
  .live-now { order: 3; }
  .where { order: 1; flex: 1 1 0; }
  .where-chip { max-width: none; }
  .where-rest { display: none; }
  .resets { order: 1; }
  /* Share ends the first line, after the place and the way back, as an icon. */
  .share { order: 1; }
  .share-button { width: 44px; padding: 0; justify-content: center; }
  .share-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* Time moves to its own line only on the narrowest screens. */
  .day-nav { order: 3; flex: 1 1 0; min-width: 12.5rem; }
  .time-pick { order: 3; }
  .day-pick { flex: 1; }
  .day-pick input, .day-button { flex: 1; width: 0; }
  .day-nav { position: static; }
  .calendar { left: 16px; right: 16px; width: auto; max-width: none; }
  .day-step { width: 38px; }
  .where-panel { left: 16px; right: 16px; width: auto; }
  .reset { padding: 0 12px; }
  .reset-here svg { display: none; }
  /* With Share and both ways back on the first line, "Here & now" becomes its icon so the place keeps its name. */
  .circumstances-bar:has(.reset-now:not([hidden])) .reset-here { width: 44px; padding: 0; justify-content: center; }
  .circumstances-bar:has(.reset-now:not([hidden])) .reset-here svg { display: block; }
  .circumstances-bar:has(.reset-now:not([hidden])) .reset-here span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* The narrowest phones: the whole date rather than the calendar icon; the place's
   UTC offset gives way to how it was found (the time field is already local). */
@media (max-width: 400px) {
  .where-zone { display: none; }
  .day-button { padding: 0 10px; justify-content: center; }
  .day-button svg { display: none; }
}

/* ---- Sky panorama and time control ------------------------------------- */
.sky-panel {
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sky-time { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 10px; }
.sky-title { font-size: 1.05rem; display: flex; gap: 8px; align-items: baseline; }
.sky-title time { font-variant-numeric: tabular-nums; font-size: 1.35rem; }
.sky-slider[hidden] { display: none; }
/* The slider sits on a strip coloured by the Sun's altitude through the day. */
.sky-slider { position: relative; height: 28px; }
.day-strip { position: absolute; inset: 9px 0; width: 100%; height: 10px; border-radius: 5px; }
.sky-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.sky-slider input[type="range"]::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.sky-slider input[type="range"]::-moz-range-track { height: 28px; background: transparent; }
.sky-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-sun);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
}
.sky-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-sun);
}
.sky-slider input[type="range"]:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; border-radius: 6px; }

.day-strip .sky-day { fill: #8ec5ef; }
.day-strip .sky-golden { fill: #f2b86b; }
.day-strip .sky-civil { fill: #c77d8a; }
.day-strip .sky-nautical { fill: #4b5a92; }
.day-strip .sky-astro { fill: #2a3260; }
.day-strip .sky-night { fill: #141a36; }

svg.sky { display: block; width: 100%; height: auto; }
.sky .stop-top { stop-color: #0b1030; }
.sky .stop-horizon { stop-color: #1d2650; }
.sky-day .stop-top { stop-color: #3f8fd8; }
.sky-day .stop-horizon { stop-color: #a9d3f2; }
.sky-golden .stop-top { stop-color: #5d8fd0; }
.sky-golden .stop-horizon { stop-color: #f6c27a; }
.sky-civil .stop-top { stop-color: #33407a; }
.sky-civil .stop-horizon { stop-color: #e28c74; }
.sky-nautical .stop-top { stop-color: #1b2350; }
.sky-nautical .stop-horizon { stop-color: #4b4f88; }
.sky-astro .stop-top { stop-color: #0f1433; }
.sky-astro .stop-horizon { stop-color: #262c5c; }
.sky .stars circle { fill: #fff; opacity: 0; transition: opacity 0.4s; }
.sky-astro .stars circle { opacity: 0.35; }
.sky-night .stars circle { opacity: 0.8; }
.sky-grid line { stroke: rgb(255 255 255 / 0.18); stroke-dasharray: 2 6; }
.sky-grid text { fill: rgb(255 255 255 / 0.55); font-size: 13px; }
.sky-path { fill: none; stroke-width: 2.5; stroke-dasharray: 1 7; stroke-linecap: round; }
.sky-path-sun { stroke: #ffd27a; }
.sky-path-moon { stroke: #c9d4ff; }
.sky-ground { fill: #1c2a1f; fill-opacity: 0.82; }
.sky-day .sky-ground, .sky-golden .sky-ground { fill: #4c6b3f; }
.sky-horizon { stroke: rgb(255 255 255 / 0.55); stroke-width: 1.5; }
.sky-compass text { fill: rgb(255 255 255 / 0.85); font-size: 15px; font-weight: 600; text-anchor: middle; }
/* The panorama shrinks on phones; its labels must not. */
@media (max-width: 600px) {
  .sky-compass text { font-size: 26px; }
  .sky-grid text { font-size: 22px; }
  .sky-marker { transform: scale(1.8); }
}
.sky-sun .sun-glow { fill: #ffd27a; opacity: 0.3; }
.sky-sun .sun-disc { fill: #ffcf4d; stroke: #fff3c4; stroke-width: 2; }
.sky-moon .moon-dark { fill: #2b3150; stroke: #c9d4ff; stroke-width: 1.2; }
.sky-moon .moon-lit { fill: #f1efe4; }
.sky-sun.is-below, .sky-moon.is-below { opacity: 0.45; }

/* ---- Weather in the panorama --------------------------------------------
   _Sky.cshtml draws every layer; .sky-view's data-* attributes (set by the
   server and by the sky island as the time moves) pick what shows:
   data-forecast ok|past|beyond|pending|none, data-oktas 0-8 (cloud cover in
   eighths), data-precip none|drizzle|rain|snow|sleet|storm, data-intensity
   light|moderate|heavy, data-haze none|mist|fog|haze|smoke|dust. The
   visitor's switch sets html[data-weather="off"], which shows a clear sky.
   Colors follow the light: each sky class sets them for clouds, veil, rain
   and haze. */
.sky-view { position: relative; }
.sky { --cloud-top: #2e3554; --cloud-base: #1b2038; --veil-top: #14172a; --veil-horizon: #1e2238;
  --drop: #9fb0d8; --flake: #dfe6f6; --mist: #59607a; --fog: #6a7088; --haze: #5c5646; --smoke: #4b453d; --dust: #5f4f3a; }
.sky-astro { --cloud-top: #2b3159; --cloud-base: #1b2045; --veil-top: #181c35; --veil-horizon: #23284a; }
.sky-nautical { --cloud-top: #4a5384; --cloud-base: #2c3360; --veil-top: #2b3050; --veil-horizon: #3d4166;
  --mist: #6a7194; --fog: #7c839f; }
.sky-civil { --cloud-top: #f0b8a8; --cloud-base: #6d5b7d; --veil-top: #575872; --veil-horizon: #a98585;
  --drop: #d9dff0; --mist: #b49ca4; --fog: #c7b3b6; --haze: #b39a86; --smoke: #8d7b70; --dust: #b08a68; }
.sky-golden { --cloud-top: #fff1dc; --cloud-base: #d59e7c; --veil-top: #8f8f9a; --veil-horizon: #d6b59a;
  --drop: #eef3fa; --flake: #fff; --mist: #e6d9cf; --fog: #ece4dc; --haze: #e6cfa6; --smoke: #b8a48c; --dust: #d8b07c; }
.sky-day { --cloud-top: #fff; --cloud-base: #c3cdd9; --veil-top: #8d99a6; --veil-horizon: #c2c9d0;
  --drop: #eef3fa; --flake: #fff; --mist: #dfe5ea; --fog: #e7eaec; --haze: #e8dcc0; --smoke: #b9ab98; --dust: #d9b98a; }

.veil-top { stop-color: var(--veil-top); }
.veil-horizon { stop-color: var(--veil-horizon); }
.cloud-top { stop-color: var(--cloud-top); }
.cloud-base { stop-color: var(--cloud-base); }
.wx-cloud-shape { fill: url(#wx-cloud-fill); }
.wx-drop { stroke: var(--drop); stroke-width: 1.4; stroke-linecap: round; }
.wx-flake { fill: var(--flake); }
.haze-thin { stop-color: var(--haze-color, var(--mist)); stop-opacity: 0; }
.haze-thick { stop-color: var(--haze-color, var(--mist)); }
.wx-fog { fill: var(--fog); }
.wx-flash { fill: #fff; }
.wx-bolt { fill: #fffbe8; }

/* Everything starts hidden and fades in, so moving the slider blends one hour's weather into the next. */
.wx-veil, .wx-gloom, .wx-cloud, .wx-haze, .wx-fog, .wx-fall, .wx-flash, .wx-bolt { opacity: 0; transition: opacity 0.6s ease; }
.sky .stars, .sun-glow, .sun-disc, .sky-moon .sky-marker { transition: opacity 0.6s ease; }
/* Animations run only while their layer shows. */
.wx-drift { animation: wx-drift 70s ease-in-out infinite alternate; animation-play-state: paused; }
.wx-cloud:nth-child(3n + 1) .wx-drift { animation-duration: 95s; animation-delay: -30s; }
.wx-cloud:nth-child(3n + 2) .wx-drift { animation-duration: 120s; animation-delay: -70s; animation-direction: alternate-reverse; }
.wx-fall { animation: wx-rain 0.8s linear infinite; animation-play-state: paused; }
.wx-rain-b { animation-duration: 0.62s; }
.wx-snow-a { animation: wx-snow 11s linear infinite; animation-play-state: paused; }
.wx-snow-b { animation: wx-snow-b 15s linear infinite; animation-play-state: paused; }
.wx-sway { animation: wx-sway 3.2s ease-in-out infinite alternate; animation-play-state: paused; }
.wx-sway-b { animation-duration: 2.4s; animation-direction: alternate-reverse; }
@keyframes wx-drift { from { transform: translateX(-14px); } to { transform: translateX(18px); } }
@keyframes wx-rain { from { transform: translateY(0); } to { transform: translateY(120px); } }
@keyframes wx-snow { from { transform: translateY(0); } to { transform: translateY(180px); } }
@keyframes wx-snow-b { from { transform: translateY(0); } to { transform: translateY(360px); } }
@keyframes wx-sway { from { transform: translateX(-6px); } to { transform: translateX(6px); } }
@keyframes wx-flash { 0%, 90%, 92.5%, 95%, 100% { opacity: 0; } 91% { opacity: 0.32; } 93.5% { opacity: 0.2; } }
@keyframes wx-bolt { 0%, 90%, 92.5%, 100% { opacity: 0; } 91%, 91.8% { opacity: 0.9; } }

:root:not([data-weather="off"]) .sky-view[data-forecast="ok"] {
  /* Clouds by oktas: a few scattered ones at 1/8, the whole sky at 8/8. */
  &:not([data-oktas="0"]) .wx-c1,
  &:is([data-oktas="2"], [data-oktas="3"], [data-oktas="4"], [data-oktas="5"], [data-oktas="6"], [data-oktas="7"], [data-oktas="8"]) .wx-c2,
  &:is([data-oktas="3"], [data-oktas="4"], [data-oktas="5"], [data-oktas="6"], [data-oktas="7"], [data-oktas="8"]) .wx-c3,
  &:is([data-oktas="4"], [data-oktas="5"], [data-oktas="6"], [data-oktas="7"], [data-oktas="8"]) .wx-c4,
  &:is([data-oktas="5"], [data-oktas="6"], [data-oktas="7"], [data-oktas="8"]) .wx-c5,
  &:is([data-oktas="6"], [data-oktas="7"], [data-oktas="8"]) .wx-c6,
  &:is([data-oktas="7"], [data-oktas="8"]) .wx-c7,
  &[data-oktas="8"] .wx-c8 { opacity: 0.92; }
  &:not([data-oktas="0"]) .wx-drift { animation-play-state: running; }
  /* Soft edges. Only while clouds show: Chrome paints an empty filtered group as a dark corner. */
  &:not([data-oktas="0"]) .wx-clouds { filter: url(#wx-soft); }
  /* Beyond about half cover a grey veil closes over the blue (or the stars). */
  &[data-oktas="5"] .wx-veil { opacity: 0.15; }
  &[data-oktas="6"] .wx-veil { opacity: 0.35; }
  &[data-oktas="7"] .wx-veil { opacity: 0.62; }
  &[data-oktas="8"] .wx-veil { opacity: 0.88; }
  &[data-precip="storm"] { --veil-top: #3a3f4f; --veil-horizon: #5d6372; --cloud-top: #8a93a3; --cloud-base: #3e4452; }
  &[data-precip="storm"] .wx-veil { opacity: 0.92; }
  &[data-precip="drizzle"] .wx-gloom, &[data-precip="snow"] .wx-gloom { opacity: 0.22; }
  &:is([data-precip="rain"], [data-precip="sleet"])[data-intensity="light"] .wx-gloom { opacity: 0.32; }
  &:is([data-precip="rain"], [data-precip="sleet"])[data-intensity="moderate"] .wx-gloom { opacity: 0.42; }
  &:is([data-precip="rain"], [data-precip="sleet"])[data-intensity="heavy"] .wx-gloom,
  &[data-precip="storm"] .wx-gloom { opacity: 0.5; }
  /* Stars fade behind cloud, and the Sun's glow with them. */
  &:is([data-oktas="3"], [data-oktas="4"]) .stars { opacity: 0.6; }
  &:is([data-oktas="5"], [data-oktas="6"]) .stars { opacity: 0.3; }
  &:is([data-oktas="7"], [data-oktas="8"], [data-haze="fog"]) .stars { opacity: 0; }
  &:is([data-oktas="6"], [data-oktas="7"]) .sun-glow { opacity: 0.12; }
  &:is([data-oktas="8"], [data-haze="fog"]) .sun-glow { opacity: 0; }
  &:is([data-oktas="8"], [data-haze="fog"]) .sun-disc { opacity: 0.7; }
  &:is([data-oktas="8"], [data-haze="fog"]) .sky-moon .sky-marker { opacity: 0.7; }

  /* Rain: one layer when light, two when heavier; drizzle is fine and faint. */
  &:is([data-precip="rain"], [data-precip="storm"], [data-precip="drizzle"], [data-precip="sleet"]) .wx-rain-a { opacity: 0.55; animation-play-state: running; }
  &:is([data-precip="rain"], [data-precip="storm"])[data-intensity="moderate"] .wx-rain-a { opacity: 0.75; }
  &:is([data-precip="rain"], [data-precip="storm"])[data-intensity="heavy"] .wx-rain-a { opacity: 0.9; }
  &:is([data-precip="rain"], [data-precip="storm"]):not([data-intensity="light"]) .wx-rain-b { opacity: 0.55; animation-play-state: running; }
  &:is([data-precip="rain"], [data-precip="storm"])[data-intensity="heavy"] .wx-rain-b { opacity: 0.85; }
  &[data-precip="drizzle"] .wx-rain-a { opacity: 0.4; }
  &[data-precip="drizzle"] .wx-drop { stroke-width: 0.8; }
  &[data-precip="sleet"] .wx-rain-a { opacity: 0.4; }
  /* Snow drifts down slowly; sleet mixes a little of it with rain. */
  &:is([data-precip="snow"], [data-precip="sleet"]) :is(.wx-snow-a, .wx-sway) { animation-play-state: running; }
  &:is([data-precip="snow"], [data-precip="sleet"]) .wx-snow-a { opacity: 0.7; }
  &[data-precip="snow"]:not([data-intensity="light"]) .wx-snow-a { opacity: 0.95; }
  &[data-precip="snow"]:not([data-intensity="light"]) .wx-snow-b { opacity: 0.7; animation-play-state: running; }
  &[data-precip="snow"][data-intensity="heavy"] .wx-snow-b { opacity: 1; }
  /* Thunderstorms flash now and then. */
  &[data-precip="storm"] .wx-flash { animation: wx-flash 9s linear infinite; }
  &[data-precip="storm"] .wx-bolt { animation: wx-bolt 9s linear infinite; }

  /* Mist, haze, smoke and dust thicken toward the horizon; fog hides most of the sky. */
  &[data-haze="mist"] { --haze-color: var(--mist); }
  &[data-haze="haze"] { --haze-color: var(--haze); }
  &[data-haze="smoke"] { --haze-color: var(--smoke); }
  &[data-haze="dust"] { --haze-color: var(--dust); }
  &[data-haze="fog"] { --haze-color: var(--fog); }
  &:is([data-haze="mist"], [data-haze="haze"]) .wx-haze { opacity: 0.6; }
  &:is([data-haze="smoke"], [data-haze="dust"]) .wx-haze { opacity: 0.75; }
  &[data-haze="fog"] .wx-haze { opacity: 0.95; }
  &[data-haze="fog"] .wx-fog { opacity: 0.65; }
  /* Compass labels stay legible against pale fog and haze by day. */
  &:not([data-haze="none"]) :is(.sky-day, .sky-golden) .sky-compass text { fill: rgb(38 46 60 / 0.78); }
}
@media (prefers-reduced-motion: reduce) {
  .wx-drift, .wx-fall, .wx-sway { animation: none !important; }
  .wx-flash, .wx-bolt { animation: none !important; opacity: 0 !important; }
}

/* Over the panorama when it shows no weather: no forecast for that time, or switched off. */
.sky-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgb(10 14 30 / 0.62);
  border: 1px solid rgb(255 255 255 / 0.25);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.2;
  pointer-events: none;
}
.sky-badge svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sky-badge span { display: none; }
.sky-view:is([data-forecast="none"], [data-forecast="past"], [data-forecast="beyond"]) .sky-badge { display: inline-flex; }
.sky-view:is([data-forecast="none"], [data-forecast="past"], [data-forecast="beyond"]) .sky-badge-none { display: inline; }
:root[data-weather="off"] .sky-view .sky-badge { display: inline-flex; }
:root[data-weather="off"] .sky-view .sky-badge-none { display: none; }
:root[data-weather="off"] .sky-view .sky-badge-off { display: inline; }

/* The forecast in words, its source, and the switch. */
.weather-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px 0;
  font-size: 0.9rem;
}
.weather-status { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.weather-credit { color: var(--muted); font-size: 0.8rem; }
.weather-off-text { display: none; }
:root[data-weather="off"] .weather-text, :root[data-weather="off"] .weather-credit { display: none; }
:root[data-weather="off"] .weather-off-text { display: inline; }
.sky-view:not([data-forecast="ok"]) + .weather-bar .weather-credit { display: none; }
.sky-view:not([data-forecast="ok"]) + .weather-bar .weather-text { color: var(--muted); }
.weather-switch { display: flex; align-items: center; gap: 8px; }
.weather-switch[hidden] { display: none; }
.weather-switch-label { color: var(--muted); }

/* Under the slider: the forecast through the day, where there is one. */
.weather-strip { position: absolute; left: 0; right: 0; bottom: 3px; width: 100%; height: 4px; border-radius: 2px; }
.weather-strip rect { fill: #cfdbe8; }
.weather-strip .wx-cloudy { fill: #97a2b0; }
.weather-strip .wx-overcast { fill: #5f6874; }
.weather-strip .wx-wet { fill: #2f74d0; }
.weather-strip .wx-white { fill: #7fc4ec; }
.weather-strip .wx-storm { fill: #7a4fb0; }
.weather-strip .wx-murk { fill: #c2a874; }
:root[data-weather="off"] .weather-strip { display: none; }

/* Where each body is at the chosen time: two blocks under the panorama,
   side by side when there is room. */
.sky-bodies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 4px 28px;
  padding: 12px 16px 4px;
}
.sky-body { min-width: 0; }
.sky-body-name { font-size: 1rem; display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.sky-body .details dd { font-variant-numeric: tabular-nums; }
/* Altitude and bearing on one row; on a narrow card it wraps at the dot. */
.sky-position > span { white-space: nowrap; }
.sky-note { padding: 4px 16px 14px; }
.sky-note[hidden] { display: none; }
.sky-key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.sky-key-sun { background: #ffcf4d; }
.sky-key-moon { background: #c9d4ff; border: 1px solid #7c88b8; }

/* ---- Location panel: search and map ------------------------------------- */
.place-search { position: relative; }
.place-search-row { display: flex; gap: 8px; }
.place-search input[type="search"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
}
.place-search button {
  font: inherit;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-moon);
  color: var(--surface);
  cursor: pointer;
}
.place-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}
.place-results[hidden] { display: none; }
.place-results a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.place-results a:hover, .place-results a.is-active { background: var(--accent-moon-soft); }
.place-name { font-weight: 600; }
.place-where { color: var(--muted); }
.place-none { padding: 10px 12px; color: var(--muted); }

.world-map { min-width: 0; }
.map-frame {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #cfe3f3;
  cursor: crosshair;
  border: 1px solid var(--line);
}
.map-frame.is-loading { opacity: 0.6; cursor: progress; }
/* The map takes wheel, pinch and drag itself (zoom and pan). */
.map-frame { touch-action: none; user-select: none; -webkit-user-select: none; }
.map-frame.is-dragging { cursor: grabbing; }
.map-frame > svg, .map-frame > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-detail, .map-frame.is-detailed .map-coarse { display: none; }
.map-frame.is-detailed .map-detail { display: inline; }
.map-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.16);
  cursor: default;
}
.map-zoom[hidden] { display: none; }
.map-zoom button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.map-zoom button + button { border-left: 1px solid var(--line); }
.map-zoom button:hover:not(:disabled) { background: var(--accent-moon-soft); }
.map-zoom button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: -2px; }
.map-zoom button:disabled { color: var(--muted); opacity: 0.45; cursor: default; }
.map-zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (pointer: coarse) { .map-zoom button { width: 36px; height: 36px; } }
.map-land { fill: #e9e3cf; stroke: #b9b29a; stroke-width: 0.6; }
.map-borders { fill: none; stroke: #b9b29a; stroke-width: 0.5; }
.map-graticule { fill: none; stroke: rgb(255 255 255 / 0.55); stroke-width: 0.5; }
.map-sun { fill: #ffcf4d; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map-here { fill: var(--accent-sun); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 6px; vertical-align: -1px; }
.legend:first-child { margin-left: 0; }
.legend-day { background: #e9e3cf; border: 1px solid #b9b29a; }
.legend-twilight { background: #8a8fa8; }
.legend-night { background: #2a3048; }

/* ---- Places: breadcrumbs, more places, country and place lists ----------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--accent-moon); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.more-places { margin-top: 28px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.more-places h2, .country-group h2 { font-size: 1rem; margin-bottom: 8px; }
.place-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 2px 16px;
}
.place-links a, .country-links a { color: var(--accent-moon); text-decoration: none; display: inline-block; padding: 4px 0; }
.place-links a:hover, .country-links a:hover { text-decoration: underline; }
.more-link { display: inline-block; margin-top: 8px; color: var(--accent-moon); font-size: 0.9rem; }
.country-links {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 16rem;
  column-gap: 24px;
}
.country-links li { break-inside: avoid; }
.country-group + .country-group { margin-top: 20px; }

/* ---- Bearings: true north or compass ---------------------------------------
   The north island sets html[data-north]. Without it true bearings show and
   compass bearings (marked .north-optional) stay hidden. */
html[data-north="true"] .north-magnetic,
html[data-north="magnetic"] .north-true,
html:not([data-north="magnetic"]) .north-optional { display: none; }

.north-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 12px 16px 0;
  font-size: 0.9rem;
}
.north-switch[hidden], .north-hint[hidden] { display: none; }
.north-switch-label { color: var(--muted); }
.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
}
.segmented label {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented label:has(input:checked) { background: var(--accent-moon-soft); color: var(--text); font-weight: 600; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.segmented label:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.north-hint { flex-basis: 100%; font-size: 0.85rem; }

/* ---- Units: the visitor's choice from Settings ----------------------------
   Values come in both units (Units.cs); the boot script sets
   html[data-distance] and html[data-temperature] before the first paint.
   Without it the metric value shows. */
html:not([data-distance="mi"]) .unit-mi,
html[data-distance="mi"] .unit-km,
html:not([data-temperature="f"]) .unit-f,
html[data-temperature="f"] .unit-c { display: none; }

/* ---- Eclipses ------------------------------------------------------------ */
.eclipse-jump { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 0.92rem; }
.eclipse-jump a { color: var(--accent-moon); text-underline-offset: 3px; }

/* Next eclipse from the visitor's location: countdown, figures, the eclipse
   as they will see it (zenith up), its timeline, and what comes after. */
.eclipse-dash { display: grid; gap: 16px; margin: 22px 0 4px; scroll-margin-top: 12px; }
@media (min-width: 920px) { .eclipse-dash { grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); align-items: start; } }
.dash-main { gap: 16px; }
.dash-eyebrow { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.dash-main.is-solar .dash-eyebrow { color: var(--accent-sun); }
.dash-main.is-lunar .dash-eyebrow { color: var(--accent-moon); }
.dash-head h2 { margin-top: 4px; font-size: clamp(1.45rem, 4vw, 1.95rem); line-height: 1.15; letter-spacing: -0.015em; }
.dash-when { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; font-weight: 600; }
.dash-when span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.dash-note { margin-top: 6px; color: var(--muted); font-size: 0.9rem; }

.dash-body { display: grid; gap: 18px; }
@media (min-width: 640px) { .dash-body { grid-template-columns: minmax(0, 1fr) minmax(150px, 210px); align-items: center; } }
.dash-figures { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.countdown-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.countdown-units { display: flex; gap: 8px; margin-top: 6px; }
.countdown-units > span {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.countdown-units b { font-size: clamp(1.45rem, 5.5vw, 2.1rem); line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown-units small { font-size: 0.75rem; color: var(--muted); }
.dash-main.is-underway .countdown-units > span { background: var(--accent-sun-soft); border-color: transparent; }
.dash-main.is-lunar.is-underway .countdown-units > span { background: var(--accent-moon-soft); }
.dash-main.is-over .countdown-units { display: none; }

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 8px; margin: 0; }
.dash-stats > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.dash-stats dt { font-size: 0.8rem; color: var(--muted); }
.dash-stats dd { margin: 2px 0 0; display: flex; flex-direction: column; }
.dash-stats strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-stats dd span { font-size: 0.8rem; color: var(--muted); }

.dash-sky { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.dash-sky svg { display: block; width: 100%; max-width: 210px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #27304a, #121625 72%); }
.is-lunar .dash-sky svg { background: radial-gradient(circle at 50% 40%, #1c2133, #0b0d16 72%); }
.dash-sky figcaption { font-size: 0.8rem; color: var(--muted); max-width: 16rem; }
.sky-glow-in { stop-color: #ffd678; stop-opacity: 0.32; }
.sky-corona-in { stop-color: #e9f0ff; stop-opacity: 0.75; }
.sky-glow-out { stop-color: #ffd678; stop-opacity: 0; }
.sky-sun { fill: #ffcf5a; }
.sky-moon-dark { fill: #0d1019; }
.sky-full-moon { fill: #ebe4d2; }
.sky-penumbra { fill: rgb(18 16 24 / 0.26); }
.sky-umbra { fill: #7d2716; fill-opacity: 0.94; }
.sky-umbra-edge { fill: none; stroke: rgb(255 255 255 / 0.18); stroke-width: 0.004; stroke-dasharray: 0.02 0.015; }
.sky-ground { fill: #26331f; }

.dash-track { display: block; width: 100%; height: 24px; overflow: visible; }
.dash-track-all { fill: var(--line); }
.dash-track-seen { fill: var(--accent-sun); }
.is-lunar .dash-track-seen { fill: var(--accent-moon); }
.dash-track-tick { stroke: var(--text); stroke-opacity: 0.55; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.dash-track-tick.is-horizon { stroke-dasharray: 3 2; }
.dash-track-now { stroke: #c2410c; stroke-width: 2.5px; vector-effect: non-scaling-stroke; }

.dash-steps { list-style: none; margin: -6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); gap: 10px 14px; }
.dash-steps li { display: flex; flex-direction: column; font-size: 0.85rem; min-width: 0; }
.dash-steps time { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-steps small { font-size: 0.78rem; color: var(--muted); }
.dash-steps li.is-below { color: var(--muted); }
.dash-steps li.is-below time { font-weight: 400; }
.dash-steps li.is-horizon span { font-style: italic; }

.dash-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 0.88rem; color: var(--muted); }
.dash-foot a { color: var(--accent-moon); text-underline-offset: 3px; }
.safety-inline { color: #8a4a06; }

.dash-side { gap: 14px; }
.dash-side h3 { font-size: 1rem; }
.dash-later { list-style: none; margin: -4px 0 0; padding: 0; }
.dash-later li + li { border-top: 1px solid var(--line); }
.dash-later a { display: grid; gap: 4px; padding: 10px 0; color: inherit; text-decoration: none; }
.dash-later a:hover .dash-later-note { color: var(--text); }
.dash-later-date { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-later-date .muted { font-size: 0.85rem; font-weight: 400; }
.dash-later-note { font-size: 0.85rem; }
.dash-central { padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 0.9rem; }
.dash-unseen { font-size: 0.88rem; }
.dash-unseen ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.dash-unseen li { display: flex; flex-wrap: wrap; gap: 0 8px; }
.dash-unseen a { color: var(--accent-moon); text-underline-offset: 3px; }

.eclipse-feature { margin: 28px 0 40px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 12px; }
.eclipse-feature + .eclipse-feature { padding-top: 28px; border-top: 1px solid var(--line); }
.eclipse-head h2 { font-size: clamp(1.3rem, 3.2vw, 1.75rem); line-height: 1.2; letter-spacing: -0.01em; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.eclipse-summary { margin-top: 8px; max-width: 72ch; }

.kind {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--accent-sun-soft);
  color: var(--accent-sun);
}
.kind-total { background: #1d1f24; color: #f6efe2; }
.kind-annular, .kind-hybrid { background: #fbe1bf; color: #8a4a06; }
.kind-penumbral { background: var(--accent-moon-soft); color: var(--accent-moon); }
.eclipse-lunar .kind-partial, #lunar .kind-partial, .kind-moon.kind-partial { background: #f6dcd6; color: #8c2a17; }
.eclipse-lunar .kind-total, #lunar .kind-total, .kind-moon.kind-total { background: #8c2a17; color: #fff; }

/* World maps: Natural Earth land as a static background image (built by
   web/build/land-svg.ts), the eclipse as server-rendered SVG on top. */
.eclipse-map { margin: 0; min-width: 0; }
.eclipse-frame {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #cfe3f3 url("/dist/map/land-light.svg") center / 100% 100% no-repeat;
}
.eclipse-frame > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.eclipse-frame path, .eclipse-frame circle { vector-effect: non-scaling-stroke; }
.band { fill: #e8891c; fill-opacity: 0.15; }
.band-0 { stroke: #b85f06; stroke-opacity: 0.55; stroke-width: 1px; }
.central-path { fill: #3a1d00; fill-opacity: 0.6; stroke: #3a1d00; stroke-width: 1px; }
.central-total { fill: #050505; fill-opacity: 0.72; }
.central-line { fill: none; stroke: #fff; stroke-opacity: 0.85; stroke-width: 1px; }
.hour-mark circle { fill: #fff; stroke: #3a1d00; stroke-width: 1px; }
.hour-mark text, .contact-label text {
  font-size: 3.4px;
  font-weight: 650;
  text-anchor: middle;
  paint-order: stroke;
  stroke-width: 0.8px;
  stroke-linejoin: round;
}
.hour-mark text { fill: #3a1d00; stroke: rgb(255 255 255 / 0.85); }
.greatest-mark { fill: #fff; stroke: #c2410c; stroke-width: 2.5px; }
.eclipse-frame .map-here { fill: var(--accent-moon); stroke: #fff; stroke-width: 2px; }
.moon-down { fill: #0b1130; fill-opacity: 0.3; }
.contact-line { fill: none; stroke: #4a5a8c; stroke-width: 1.2px; stroke-dasharray: 5 4; }
.contact-u1, .contact-u2, .contact-u3, .contact-u4 { stroke: #8c2a17; }
.contact-label text { fill: #1d2a4f; stroke: rgb(255 255 255 / 0.8); }
.zenith-mark { fill: #f1efe4; stroke: #4a5a8c; stroke-width: 2.5px; }
/* Labels are sized in map degrees; on phones they would be unreadable. */
@media (max-width: 640px) { .hour-mark text, .contact-label { display: none; } }

.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.swatch-band { background: rgb(232 137 28 / 0.25); border: 1px solid rgb(184 95 6 / 0.6); }
.swatch-deep { background: rgb(232 137 28 / 0.6); }
.swatch-path { background: rgb(58 29 0 / 0.7); }
.swatch-total { background: #111; }
.swatch-greatest, .swatch-here, .swatch-zenith { width: 11px; height: 11px; border-radius: 50%; }
.swatch-greatest { background: #fff; border: 2px solid #c2410c; }
.swatch-here { background: var(--accent-moon); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch-zenith { background: #f1efe4; border: 2px solid #4a5a8c; }
.swatch-clear { background: transparent; border: 1px solid var(--muted); }
.swatch-partly { background: rgb(11 17 48 / 0.3); }
.swatch-none { background: rgb(11 17 48 / 0.52); }
.swatch-line { height: 0; border-top: 2px dashed #4a5a8c; border-radius: 0; }
.swatch-penumbra { background: rgb(74 90 140 / 0.25); }
.swatch-umbra { background: #8c2a17; }

.lunar-figures { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .lunar-figures { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); align-items: start; } }
.shadow-diagram { margin: 0; min-width: 0; }
.shadow-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.penumbra { fill: rgb(74 90 140 / 0.16); stroke: rgb(74 90 140 / 0.5); stroke-width: 0.008; }
.umbra { fill: rgb(140 42 23 / 0.55); stroke: #8c2a17; stroke-width: 0.008; }
.moon-track { stroke: var(--muted); stroke-width: 0.012; stroke-dasharray: 0.05 0.035; }
.diagram-arrow { fill: var(--muted); }
.moon-disk circle { fill: #f1efe4; fill-opacity: 0.8; stroke: #4a5a8c; stroke-width: 0.01; }
.moon-disk.is-greatest circle { fill: #d8c7b1; fill-opacity: 1; stroke-width: 0.016; }
.diagram-label { font-size: 0.11px; font-weight: 650; fill: var(--text); text-anchor: middle; }
.diagram-time { font-size: 0.09px; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.diagram-compass { font-size: 0.085px; fill: var(--muted); }

.eclipse-columns { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 820px) { .eclipse-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.eclipse-columns h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }
.eclipse-solar .eclipse-columns h3 { color: var(--accent-sun); }
.eclipse-lunar .eclipse-columns h3 { color: var(--accent-moon); }
.eclipse-facts .details > div:first-child { border-top: 0; }
.here-headline { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 1.1rem; }
.here-headline span { color: var(--muted); font-size: 1rem; }

.contacts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.contacts th, .contacts td { padding: 8px 0; border-top: 1px solid var(--line); text-align: right; }
.contacts th[scope="row"] { text-align: left; font-weight: 400; color: var(--muted); }
.contacts thead th { border-top: 0; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.contacts td + td, .contacts th + td { padding-left: 12px; }
.contacts tr.is-below td:not(.muted) { color: var(--muted); }

.eclipse-cities h3 { font-size: 1rem; margin-bottom: 8px; }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.eclipse-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.eclipse-table th, .eclipse-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); white-space: nowrap; }
.eclipse-table thead th { border-top: 0; font-size: 0.8rem; color: var(--muted); font-weight: 600; vertical-align: bottom; }
.eclipse-table th[scope="row"] { font-weight: 600; }
.eclipse-table th[scope="row"] .muted { font-weight: 400; }
.eclipse-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.eclipse-table thead th.num { text-align: right; }
.eclipse-table .where { white-space: normal; min-width: 14rem; }
.eclipse-table .here { white-space: normal; min-width: 10rem; }
.eclipse-table .where span, .eclipse-table .here span, .eclipse-table .muted { display: block; }
/* A city and its country stay on one line. */
.eclipse-table th.city .muted { display: inline; }
.eclipse-table th .muted { font-weight: 400; }
.eclipse-table thead th .muted { font-weight: 500; }
.eclipse-table .here.is-not { color: var(--muted); }
.eclipse-table tbody tr:target { background: var(--accent-sun-soft); }
.eclipse-table.compact th, .eclipse-table.compact td { padding: 8px 12px; }

.eclipse-list { margin-top: 40px; scroll-margin-top: 12px; }
.eclipse-list h2 { font-size: 1.3rem; margin-bottom: 12px; }
.eclipse-countries summary { cursor: pointer; color: var(--accent-moon); text-underline-offset: 3px; }
.country-magnitudes { list-style: none; padding: 0; margin: 12px 0; columns: 18rem; column-gap: 28px; font-size: 0.9rem; }
.country-magnitudes li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; break-inside: avoid; border-bottom: 1px dotted var(--line); white-space: nowrap; }
/* One line per country; the rare name too long for its column is cut (full name on hover). */
.country-magnitudes li > span:first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.country-magnitudes li > span + span { flex: none; }
.safety { padding: 10px 14px; border-radius: 12px; background: #fff4e5; border: 1px solid #f3c98b; color: #7a4100; font-size: 0.92rem; }

.eclipse-notes { margin-top: 44px; }
.eclipse-notes h2 { font-size: 1.2rem; margin-bottom: 12px; }
.eclipse-notes dl { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: 8px 20px; margin: 0 0 12px; }
.eclipse-notes dt { font-weight: 600; }
.eclipse-notes dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .eclipse-notes dl { grid-template-columns: minmax(0, 1fr); } .eclipse-notes dd { margin-bottom: 8px; } }

/* ---- Privacy choices (ADR 0022) ------------------------------------------- */
/* Shown by the consent island only where the visitor's region asks first, or
   from the footer. "Allow" and "No thanks" look the same on purpose. */
.consent {
  position: fixed;
  z-index: 60;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
}
.consent[hidden], [data-consent-open][hidden] { display: none; }
.consent h2 { font-size: 1rem; }
.consent p { font-size: 0.92rem; line-height: 1.5; }
.consent-status { color: var(--muted); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-button {
  flex: 1 1 10rem;
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--surface);
  cursor: pointer;
}
.consent-button:hover { filter: brightness(1.15); }
.consent-button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.consent-more { font-size: 0.85rem !important; }
.consent-more a { color: var(--accent-moon); }
.footer-button { font-size: inherit; color: inherit; }
