:root {
  --gutter: 40px;
  color-scheme: light dark;
  --maxw: 1200px;
  --radius: 10px;
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1b1c1f;
  --text-muted: #5e6168;
  --line: #dcd9d1;
  --line-strong: #c9c5bb;
  --field-border: #8a8d93;
  --grid: #e9e6df;
  --hover: rgba(27, 28, 31, 0.06);
  --accent: #1b1c1f;
  --on-accent: #faf9f6;
  --pin: #d7261e;
  --pin-dot: #fff;
  --shade: #000;
  --shade-line: #1b1c1f;
  --band-edge: var(--pin);
  --seg-on: #b3dbff;
  --on-seg-on: #0b2a4a;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --band-civil: #eef0f4;
  --band-nautical: #e4e7ee;
  --band-astro: #dadfe9;
  --band-night: #c5ccda;
  --moon-lit: #f7f2dd;
  --moon-dark: #4b505b;
  --shadow: 0 1px 2px rgba(27, 28, 31, 0.08);

  --c-sun: #b07a00;
  --c-moon: #6b7b8c;
  --c-mercury: #8e6cbf;
  --c-venus: #d9468c;
  --c-mars: #d2482b;
  --c-jupiter: #6e4b2a;
  --c-saturn: #9a8a2e;
  --c-uranus: #1a9e9a;
  --c-neptune: #2f5fd0;
  --c-pluto: #7a6a5a;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #15171b;
    --surface: #1b1e23;
    --surface-2: #20242a;
    --text: #e9e7e2;
    --text-muted: #a5a9b0;
    --line: #2f333a;
    --line-strong: #3d424a;
    --field-border: #737985;
    --grid: #24272d;
    --hover: rgba(233, 231, 226, 0.08);
    --accent: #e9e7e2;
    --on-accent: #15171b;
    --pin: #e5483e;
    --pin-dot: #fff;
    --seg-on: #8cc8ff;
    --on-seg-on: #0b1b2b;
    --danger: #ff8a80;
    --danger-bg: #3a1714;
    --band-civil: #121418;
    --band-nautical: #0f1114;
    --band-astro: #0c0d10;
    --band-night: #030405;
    --moon-lit: #e9e4cf;
    --moon-dark: #3a3f48;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);

    --c-sun: #ffc233;
    --c-moon: #a9b6c4;
    --c-mercury: #b79ae6;
    --c-venus: #f27ab0;
    --c-mars: #ff7a59;
    --c-jupiter: #f2d9b5;
    --c-saturn: #cdbb5c;
    --c-uranus: #4ccfcb;
    --c-neptune: #6f95ff;
    --c-pluto: #b5a08c;
  }
}

.body-sun { --body: var(--c-sun); }
.body-moon { --body: var(--c-moon); }
.body-mercury { --body: var(--c-mercury); }
.body-venus { --body: var(--c-venus); }
.body-mars { --body: var(--c-mars); }
.body-jupiter { --body: var(--c-jupiter); }
.body-saturn { --body: var(--c-saturn); }
.body-uranus { --body: var(--c-uranus); }
.body-neptune { --body: var(--c-neptune); }
.body-pluto { --body: var(--c-pluto); }

.body-uranus { --dash: 6 4; }
.body-neptune { --dash: 10 3 2 3 2 3; }
.body-pluto { --dash: 2 4; }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}

h1, h2, p, figure { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.skip {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 20;
  padding: 6px 10px;
  background: var(--accent);
  color: var(--on-accent);
}

.skip:focus { top: 8px; }

.kicker {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.q { color: var(--text-muted); font-size: 0.87em; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.button:hover { background: var(--hover); }

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.icon-button:hover { background: var(--hover); }

button:disabled, button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

input[type="text"], input[type="date"] {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

input[aria-invalid="true"] { border-color: var(--danger); }

.field-msg {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.field-msg:empty { margin: 0; }

.status-msg {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.status-msg.error { color: var(--danger); }

.hint, .note {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.note.warn { color: var(--danger); }

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topbar {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  min-height: 60px;
  margin: 0 auto;
  padding: 10px var(--gutter);
}

.brand {
  margin-right: auto;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.loc {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.loc .icon { color: var(--pin-dot); fill: var(--pin); }
.loc-name { font-weight: 650; }
.loc-grid { letter-spacing: 0.04em; }
.loc-coord { color: var(--text-muted); font-size: 14px; white-space: nowrap; }

.loc-change {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loc:hover .loc-change { color: var(--text); }

.datebar {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ib, .tb, .date-btn {
  border: 0;
  background: none;
  cursor: pointer;
}

.ib {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-muted);
}

.tb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
}

.date-wrap { position: relative; display: inline-block; }

.date-btn {
  padding: 6px 8px;
  border-radius: 4px;
  font-weight: 650;
  white-space: nowrap;
}

.date-btn:hover, .ib:hover, .tb:hover { background: var(--grid); }

#date-today {
  margin-left: 6px;
  color: var(--text-muted);
}

#date-today[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 3px;
}

.date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.date-native.is-shown {
  position: static;
  width: auto;
  min-height: 34px;
  opacity: 1;
  pointer-events: auto;
}

.date-wrap:has(.date-native.is-shown) .date-btn { display: none; }

.datebar .field-msg {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 11;
  max-width: 22em;
  border-radius: 6px;
  background: var(--surface);
}

.datebar .field-msg:not(:empty) {
  padding: 4px 8px;
  box-shadow: var(--shadow);
}

.seg {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.seg-opt { position: relative; }

.seg-opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg-opt span, .seg > button {
  display: block;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13.5px;
}

.seg-opt:hover input:not(:checked) + span, .seg > button[aria-pressed="false"]:hover { background: var(--hover); }

.seg-opt input:checked + span, .seg > button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

#tz-switch .seg-opt input:checked + span { background: var(--seg-on); color: var(--on-seg-on); }

.seg-opt input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#tz-switch { position: relative; }

.seg-opt .tz-caret { display: inline; margin-left: 0.3em; padding: 0; color: inherit; font-size: 0.75em; }

#tz-switch .seg-opt, .tz-menu {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.tz-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: -1px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  width: max-content;
  min-width: 15rem;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: var(--tz-menu-max, 70vh);
  padding: 10px 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
  color: var(--text);
  white-space: normal;
}

.tz-menu .kicker { padding: 0 16px 6px; }

.tz-list {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tz-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 34px;
  padding: 4px 16px 4px 38px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
}

.tz-item:focus { background: var(--hover); }
.tz-item:focus { outline: none; }

.tz-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

.tz-item[aria-checked="true"] { font-weight: 650; }

.tz-item[aria-checked="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 17px;
  width: 6px;
  height: 11px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-65%) rotate(45deg);
}

.tz-sub { color: var(--text-muted); font-size: 12.5px; font-weight: 400; }

.tz-sep {
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}

@media (pointer: coarse) {
  .tz-item { min-height: 44px; font-size: 15px; }
}

@media (min-width: 768px) and (min-height: 560px) {
  .topbar {
    position: sticky;
    top: 0;
  }

  html { scroll-padding-top: 72px; }
}

.banner {
  max-width: 1280px;
  margin: 12px auto 0;
  padding: 0 var(--gutter);
}

.banner-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
}

.banner-item p {
  flex: 1;
  margin: 6px 0;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.bodies {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.chips .kicker { margin-right: 3px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px 0 7px;
  border: 1px dashed var(--text-muted);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.chip[aria-pressed="true"] {
  border: 1px solid var(--text);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.chip[aria-pressed="true"]:hover { background: var(--grid); }
.chip[aria-pressed="false"]:hover { border-style: solid; color: var(--text); }

.sw {
  width: 20px;
  height: 8px;
  overflow: visible;
  flex: none;
}

.chip .sw { width: 16px; }

.sw line {
  stroke: var(--body);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: var(--dash, none);
}

.sw .strike { display: none; }
.chip[aria-pressed="false"] .sw line:first-child { opacity: 0.4; }

.chip[aria-pressed="false"] .sw .strike {
  display: inline;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.presets > button { font-size: 13px; }

.charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0 40px;
  padding-top: 18px;
}

.fig { min-width: 0; }

.fig figcaption {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 26px;
  margin-bottom: 8px;
}

.cap-note { color: var(--text-muted); font-size: 13px; }

.slider {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0 40px;
  align-items: center;
  padding: 2px 0 30px;
  border-bottom: 1px solid var(--line);
}

.slider-track { padding: 0 var(--pr, 0) 0 var(--pl, 0); }

.track-inner {
  position: relative;
  height: 36px;
}

.track-bands {
  position: absolute;
  top: 13px;
  right: 0;
  left: 0;
  height: 10px;
  border-radius: 5px;
  background: var(--track, none);
  box-shadow: inset 0 0 0 1px var(--line);
}

.slider input[type="range"] {
  position: absolute;
  top: 0;
  left: -11px;
  width: calc(100% + 22px);
  height: 36px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.slider input[type="range"]::-webkit-slider-runnable-track { height: 36px; background: transparent; }

.slider input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: 7px;
  -webkit-appearance: none;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.slider input[type="range"]::-moz-range-track { height: 36px; background: transparent; }

.slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.r-time { font-size: 28px; font-weight: 500; line-height: 1.1; }

.r-zone {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.r-alt { flex-basis: 100%; color: var(--text-muted); font-size: 13px; }

.events { padding: 34px 0 10px; }

#events[aria-busy="true"] .table-wrap {
  opacity: 0.55;
  transition: opacity 0.2s ease 0.25s;
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 14px;
}

.sec-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.005em; }
.sec-note { color: var(--text-muted); font-size: 14px; }

.events-table {
  width: 100%;
  border-collapse: collapse;
}

.events-table th, .events-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.events-table thead th {
  padding-top: 6px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--text);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.h-unit {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.events-table th:first-child, .events-table td:first-child { padding-left: 0; }
.events-table th:last-child, .events-table td:last-child { padding-right: 0; }

.events-table tbody tr { cursor: pointer; }
.events-table tbody th { font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.events-table tbody th .sw { margin-right: 10px; vertical-align: middle; }

.row-hl {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.events-table tbody td { white-space: nowrap; }
.events-table .t { font-size: 16.5px; font-weight: 500; }
.events-table .q { margin-left: 4px; font-size: 13px; white-space: nowrap; }
.events-table .t.below, .events-table .q.below { color: var(--text-muted); font-weight: 400; }
.events-table .ev + .ev { margin-top: 2px; }
.status { color: var(--text-muted); font-size: 14.5px; font-style: italic; }

.c-body { width: 13%; }
.c-rise, .c-set { width: 12.5%; }
.c-transit { width: 11%; }
.c-up { width: 24%; }
.c-at { width: 12%; }
.c-mag, .c-lit { width: 5.5%; text-align: right !important; }
.c-con { width: 8%; }

.flagtext {
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
  letter-spacing: 0.04em;
}

.scale {
  position: relative;
  display: block;
  height: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.scale span { position: absolute; top: 0; left: var(--x, 0); transform: translateX(-50%); }
.scale .at-start { transform: none; }
.scale .at-end { transform: translateX(-100%); }

@property --cur {
  syntax: '<percentage>';
  inherits: false;
  initial-value: -10%;
}

.events-table tbody td.c-up {
  min-width: 135px;
  padding-top: 0;
  padding-bottom: 0;
  background:
    linear-gradient(to right, transparent calc(var(--cur, -10%) - 0.75px), var(--accent) calc(var(--cur, -10%) - 0.75px),
      var(--accent) calc(var(--cur, -10%) + 0.75px), transparent calc(var(--cur, -10%) + 0.75px)),
    var(--bands, none);
  background-clip: content-box;
  background-origin: content-box;
}

.upbar { display: block; width: 100%; height: 10px; }
.upbar .thin, .upbar .thick { fill: var(--text); }

.events-table[data-highlight] tbody tr:not(.is-highlight) { color: var(--text-muted); }
.events-table[data-highlight] tbody tr:not(.is-highlight) :is(.sw, .upbar) { opacity: 0.35; }

.table-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.key { display: inline-flex; align-items: center; gap: 8px; }

.k-thick, .k-thin {
  display: inline-block;
  width: 22px;
  border-radius: 2px;
  background: var(--text);
}

.k-thick { height: 8px; }
.k-thin { height: 2px; }

.glance { display: grid; grid-template-columns: 1fr 1.05fr 1.5fr 1.1fr; border-bottom: 1px solid var(--line); }
.g { min-width: 0; padding: 26px 28px 24px; border-left: 1px solid var(--line); }
.g:first-child { padding-left: 0; border-left: 0; }
.g:last-child { padding-right: 0; }
.g .kicker { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.kick-note { font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; }

.kick-moon { display: inline-block; }
.big { font-size: 30px; font-weight: 450; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; }

.big.wrap { white-space: normal; }
.big.wrap > span { white-space: nowrap; }
.big .dash { padding: 0 2px; color: var(--text-muted); }
.big .unit { color: var(--text-muted); font-size: 16px; letter-spacing: 0; }
.mid { font-size: 20px; font-weight: 500; line-height: 1.2; }
.sub { margin-top: 8px; color: var(--text-muted); font-size: 13.5px; }
.sub strong { color: var(--text); font-weight: 600; }
.g-next .linkish { text-align: left; text-decoration: none; }
.g-next .linkish:hover { text-decoration: underline; }

.g-next .sub + .mid { margin-top: 12px; }

.g-next .mid { font-size: 15.5px; }
.moonline { display: flex; align-items: center; gap: 12px; }
.moon-dark { fill: var(--moon-dark); }
.moon-lit { fill: var(--moon-lit); }
.moon-rim { fill: none; stroke: var(--text-muted); stroke-width: 1; }
.tonight { margin: 0; padding: 0; list-style: none; }
.tonight li { display: grid; grid-template-columns: 22px 72px 108px 1fr; column-gap: 4px; align-items: baseline; font-size: 14.5px; line-height: 1.75; }

.tonight .sw { align-self: start; margin-top: 0.6em; }
.tn-name { font-weight: 600; }
.tn-best { color: var(--text-muted); font-size: 13px; }

.is-stale { opacity: 0.5; }
.details { display: grid; grid-template-columns: 1fr 1fr; margin-top: 26px; padding: 40px 0 8px; border-top: 1px solid var(--line); }
.panel { min-width: 0; }
.panel:first-child { padding-right: 48px; }
.panel + .panel { padding-left: 48px; border-left: 1px solid var(--line); }
.panel h2 { margin-bottom: 14px; font-size: 20px; font-weight: 600; }
.tw { width: 100%; margin-bottom: 18px; border-collapse: collapse; }
.tw th, .tw td { padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; text-align: left; }
.tw thead th { border-bottom: 1.5px solid var(--text); color: var(--text-muted); font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-align: right; text-transform: uppercase; }
.tw tbody th { font-size: 14.5px; }

.tw th + th { width: 26%; }
.tw td { font-size: 16.5px; font-weight: 500; text-align: right; white-space: nowrap; }
.tw .sunrow th, .tw .sunrow td { font-weight: 650; }
.tw .q, .tw .status { font-weight: 400; }

.tw .hours td { white-space: normal; }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 130px 1fr; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--text-muted); font-size: 14px; }
.facts dd { margin: 0; font-size: 15.5px; font-weight: 500; }
.facts .q { margin-left: 6px; font-weight: 400; }
.moonpanel { display: flex; align-items: center; gap: 22px; margin-bottom: 4px; padding: 2px 0 18px; border-bottom: 1px solid var(--line); }
.phase { font-size: 24px; font-weight: 450; line-height: 1.2; }
.moonpanel .q { margin-top: 4px; font-size: 14px; }

@media (max-width: 1199.98px) {
  .g { padding-right: 20px; padding-left: 20px; }
  .big { font-size: 26px; }
  .tonight li { grid-template-columns: 22px 72px 1fr; }
  .tn-best { grid-column: 2 / -1; margin-bottom: 4px; line-height: 1.3; }
  .tw .sunrow .q { display: block; }
}

@media (max-width: 991.98px) {
  .glance { grid-template-columns: 1fr 1fr; }
  .g:nth-child(2) { padding-right: 0; }
  .g:nth-child(3) { padding-left: 0; border-left: 0; }
  .g:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media screen and (max-width: 767.98px) {
  .glance { grid-template-columns: 1fr; }

  .g:nth-child(n) { display: grid; grid-template-columns: 82px 1fr; padding: 13px 0; border-left: 0; }
  .g + .g { border-top: 1px solid var(--line); }
  .g .kicker { flex-direction: column; gap: 2px; grid-row: 1 / span 3; margin: 4px 0 0; }
  .g > :not(.kicker) { grid-column: 2; }
  .kick-note { font-size: 11.5px; }
  .big { font-size: 22px; }
  .big .unit { font-size: 14px; }
  .mid { font-size: 17px; }
  .g-next .mid { font-size: 14.5px; }
  .sub { margin-top: 3px; font-size: 13px; }
  .moonline { gap: 10px; }
  .moonline .moonpic { width: 30px; height: 30px; }
  .tonight li { grid-template-columns: 22px 70px 1fr; font-size: 14px; line-height: 1.6; }
  .tonight .sw { margin-top: 0.5em; }
  .tn-best { margin-bottom: 2px; }
  .details { grid-template-columns: 1fr; margin-top: 20px; padding-top: 28px; }
  .panel:first-child { padding-right: 0; }
  .panel + .panel { margin-top: 30px; padding: 26px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .tw td { font-size: 15.5px; }
  .tw tbody th { font-size: 13.5px; }
  .facts > div { grid-template-columns: 104px 1fr; }
}

.footer { margin-top: 20px; border-top: 1px solid var(--line); }

.footer-in {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.footer .kicker { margin-bottom: 8px; }
.footer p + p { margin-top: 6px; }
.footer b { color: var(--text); font-weight: 600; }
.footer a { text-decoration: underline; }
.footer-credit { text-align: right; }
.footer-name { color: var(--text); font-size: 15px; font-weight: 650; }

@media (max-width: 991.98px) {
  .footer-in { grid-template-columns: 1fr 1fr; }
  .footer-credit { grid-column: 1 / -1; text-align: left; }
}

@media screen and (max-width: 767.98px) {
  .footer-in { grid-template-columns: 1fr; gap: 20px; }
}

.noscript {
  max-width: 1280px;
  margin: 16px auto;
  padding: 12px 16px;
  border: 1px solid var(--danger);
  border-radius: 8px;
}

.alt {
  position: relative;
  min-width: 0;
}

.alt-box {
  display: block;
  border-radius: 2px;
}

.alt-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.alt-svg.alt-hot { cursor: pointer; }
.alt .alt-off { display: none; }

.alt-band-civil { fill: var(--band-civil); }
.alt-band-nautical { fill: var(--band-nautical); }
.alt-band-astro { fill: var(--band-astro); }
.alt-band-night { fill: var(--band-night); }

.alt-grid { stroke: var(--grid); stroke-width: 1; }
.alt-axis text { fill: var(--text-muted); }
.alt-tick { stroke: var(--text-muted); stroke-width: 1; }
.alt-horizon { stroke: var(--text); stroke-width: 1; }

.alt-horizon-label {
  fill: var(--text);
  font-style: italic;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.alt-now line {
  stroke: var(--text-muted);
  stroke-width: 1.2;
  stroke-dasharray: 1 3;
  stroke-linecap: round;
}

.alt-now text {
  fill: var(--text-muted);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.alt-halo, .alt-curve {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.alt-halo {
  stroke: var(--bg);
  stroke-width: 6;
}

.alt-curve {
  stroke: var(--body);
  stroke-width: var(--w, 2px);
  stroke-dasharray: var(--dash, none);
}

.alt .body-sun { --w: 2.6px; }

.alt-ecl {
  fill: none;
  stroke: var(--body);
  stroke-width: 12;
  stroke-opacity: 0.4;
  stroke-linejoin: round;
  stroke-linecap: butt;
}

.alt-mark {
  fill: var(--body);
  stroke: var(--bg);
  stroke-width: 2;
  paint-order: stroke;
}

.alt-dot, .alt-cdot {
  fill: var(--body);
  stroke: var(--bg);
  stroke-width: 2;
}

.alt-cdot.alt-below {
  fill: var(--bg);
  stroke: var(--body);
  stroke-width: 1.8;
}

.alt-leader {
  stroke: var(--text-muted);
  stroke-width: 1;
}

.alt-label {
  fill: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

.alt-cursor-halo {
  stroke: var(--bg);
  stroke-width: 4;
}

.alt-cursor-line {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.alt-flag { fill: var(--accent); }

.alt-flag-text {
  fill: var(--on-accent);
  font-weight: 650;
}

.alt-tip { font-size: 11.5px; }

.alt-tip-box {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1;
}

.alt-tip-h {
  fill: var(--text);
  font-weight: 650;
}

.alt-tip-note {
  fill: var(--text-muted);
  font-weight: 400;
}

.alt-tip-rule {
  stroke: var(--line);
  stroke-width: 1;
}

.alt-tip-name {
  fill: var(--text);
  font-weight: 600;
}

.alt-tip-alt { fill: var(--text); }
.alt-tip-az { fill: var(--text-muted); }

.alt-tip-sw {
  stroke: var(--body);
  stroke-width: var(--w, 2.4px);
  stroke-linecap: round;
  stroke-dasharray: var(--dash, none);
}

.alt[data-highlight] .alt-b { opacity: 0.35; }
.alt[data-highlight] .alt-label { opacity: 1; }

.alt[data-highlight="sun"] .body-sun,
.alt[data-highlight="moon"] .body-moon,
.alt[data-highlight="mercury"] .body-mercury,
.alt[data-highlight="venus"] .body-venus,
.alt[data-highlight="mars"] .body-mars,
.alt[data-highlight="jupiter"] .body-jupiter,
.alt[data-highlight="saturn"] .body-saturn,
.alt[data-highlight="uranus"] .body-uranus,
.alt[data-highlight="neptune"] .body-neptune,
.alt[data-highlight="pluto"] .body-pluto { opacity: 1; }

.alt-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 6px 0 0;
  padding-left: 40px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.alt-key.alt-key-narrow {
  padding-left: 0;
  font-size: 12px;
}

.alt-key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.alt-key-sw {
  width: 14px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.alt-key-civil { background: var(--band-civil); }
.alt-key-nautical { background: var(--band-nautical); }
.alt-key-astro { background: var(--band-astro); }
.alt-key-night { background: var(--band-night); }

.alt-key-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.alt-key-tri {
  color: var(--text);
  font-size: 9px;
}

.alt-key-ecl {
  width: 18px;
  height: 10px;
  background: linear-gradient(var(--body), var(--body)) center / 100% 2px no-repeat,
    color-mix(in srgb, var(--body) 40%, transparent);
}

.dome { --dome-paper: var(--bg); min-width: 0; }

.dome-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-height: 26px;
  margin-bottom: 8px;
}

.dome-title {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dome-note { color: var(--text-muted); font-size: 13px; }

.dome-mirror {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.dome-mirror input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.dome-svg {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  font-family: var(--font);
}

.dome-grid { fill: none; stroke: var(--grid); stroke-width: 1; }
.dome-horizon { fill: none; stroke: var(--text); stroke-width: 1; }

.dome-axis { fill: var(--text-muted); font-size: 11px; text-anchor: middle; }
.dome-axis .dome-ring { text-anchor: start; }
.dome-axis .dome-cardinal { fill: var(--text); font-weight: 650; }

.dome-halos {
  fill: none;
  stroke: var(--dome-paper);
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.dome-paths > g {
  fill: none;
  stroke: var(--body);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: var(--dash, none);
}

.dome-paths > .body-sun { stroke-width: 2.6; }

.dome-hours circle { fill: var(--body); stroke: var(--dome-paper); stroke-width: 1; }

.dome-hour-labels {
  fill: var(--text);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--dome-paper);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.dome-rim line { stroke: var(--body); stroke-width: 2.5; stroke-linecap: round; }

.dome-now circle { fill: var(--body); stroke: var(--dome-paper); stroke-width: 2; }

.dome-now text {
  fill: var(--text);
  font-size: 12px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--dome-paper);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

.dome-svg [data-body] { cursor: pointer; }

.dome-svg .is-dim:not(tspan, .dome-now > g, .dome-hour-labels > g),
.dome-svg .dome-now > .is-dim circle { opacity: 0.35; }
.dome-svg .is-off { display: none; }

.year { margin-top: 32px; padding: 44px 0 28px; border-top: 1px solid var(--line); }
.yearnav { display: inline-flex; margin-left: -6px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }

.fchip {
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
}

.fchip:hover { background: var(--hover); }
.fchip[aria-pressed="true"] { border-color: var(--text); color: var(--text); font-weight: 600; }
.evlist { margin: 0; padding: 0; border-top: 1.5px solid var(--text); list-style: none; }
.year[aria-busy="true"] .evlist { opacity: 0.55; }

.evlist .ev {
  display: grid;
  grid-template-columns: 76px 64px minmax(0, 290px) minmax(0, 1fr) auto;
  gap: 0 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  cursor: pointer;
}

.ev-date { font-weight: 600; }
.ev-time { color: var(--text-muted); }
.ev-title { font-weight: 500; }
.ev-go { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.ev:hover .ev-go { text-decoration: underline; text-underline-offset: 3px; }
.ev-detail { grid-area: 1 / 4; color: var(--text-muted); font-size: 13.5px; }

.badge {
  display: inline-flex;
  grid-area: 1 / 5;
  align-items: center;
  gap: 6px;
  padding: 1px 9px 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

button.badge { cursor: pointer; }
button.badge:hover, .badge[aria-expanded="true"] { background: var(--hover); }

.badge .caret { margin-left: -2px; font-size: 0.8em; line-height: 1; }
.vis { width: 12px; height: 12px; }
.vis circle { fill: none; stroke: currentColor; stroke-width: 1.4; }
.vis .full { fill: currentColor; }
.badge-faint circle { stroke-dasharray: 2 1.6; }
.ev.past .ev-date, .ev.past .ev-title, .ev.past .badge, .ev.past .ev-path { color: var(--text-muted); }
.ev.past .ev-title { font-weight: 400; }
.evlist .ev.next { margin-left: -14px; padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
.ev.next .ev-title { font-weight: 650; }

.in {
  margin-left: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.today-rule { padding: 5px 0 6px; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.ev-more { grid-column: 4 / -1; margin-top: 8px; color: var(--text-muted); font-size: 13.5px; cursor: auto; }
.contacts { border-collapse: collapse; }
.contacts th, .contacts td { padding: 1px 14px 1px 0; font-weight: 400; text-align: left; vertical-align: baseline; }
.contacts td { color: var(--text); white-space: nowrap; }
.contacts .below { color: var(--text-muted); }
.contacts thead th { font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.ev-more p { margin-top: 4px; }

.ev-path { grid-column: 4 / -1; justify-self: start; margin-top: 3px; font-size: 13.5px; text-align: left; }

.mon-h { margin: 0; font-size: inherit; font-weight: inherit; }

.mon-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font-size: 15.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.mon-btn .icon { width: 16px; height: 16px; margin: 0 2px 0 -2px; vertical-align: -2px; }
.mon-btn[aria-expanded="true"] .icon { transform: rotate(90deg); }
.mon-btn:hover .mon-name { text-decoration: underline; text-underline-offset: 3px; }
.mon-n { margin-left: 4px; color: var(--text-muted); font-size: 13.5px; font-weight: 400; }
.mon.past .mon-btn { color: var(--text-muted); font-weight: 500; }
.mon-list { margin: 0; padding: 0; list-style: none; }

@media (max-width: 1199.98px) {
  .evlist .ev { grid-template-columns: 70px 52px minmax(0, 248px) minmax(0, 1fr) auto; gap: 0 14px; }
}

@media screen and (max-width: 991.98px) {
  .evlist .ev { grid-template-columns: 70px minmax(0, 1fr); gap: 1px 14px; padding: 11px 0; }
  .ev-time { grid-area: 2 / 1; font-size: 13.5px; }
  .ev-title { grid-area: 1 / 2; }
  .badge { grid-area: 2 / 2; justify-self: start; margin: 3px 0 2px; }
  .ev-detail { grid-area: 3 / 2; }
  .ev-more, .ev-path { grid-column: 2; }
}

@media screen and (max-width: 767.98px) {
  .year { margin-top: 24px; padding-top: 30px; }
  .filters { flex-basis: 100%; margin-left: 0; }
  .evlist .ev { grid-template-columns: 62px minmax(0, 1fr); gap: 1px 12px; }
  .evlist .ev.next { margin-left: -12px; padding-left: 12px; }
  .in { margin-left: 6px; }
}

@media print {
  .yearnav, .filters, .badge .caret, .mon-h, .ev-path { display: none !important; }
  .mon-list[hidden] { display: block !important; }

  .facts .linkish { text-decoration: none; }
  .evlist .mon { break-inside: auto; }
}

.sheet {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(420px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
}

.sheet::backdrop { background: rgba(10, 14, 20, 0.22); }

.sheet form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 { font-size: 18px; }
.sheet-head h2:focus { outline: none; }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px 16px;
}

.sheet-body > .hint { margin: 0 0 10px; }

.path-note { margin: 0 0 10px; font-size: 14px; }
.ecl-area { fill: var(--shade); fill-opacity: 0.08; }
.ecl-moon { fill-opacity: 0.15; }
.ecl-outer { stroke: var(--shade-line); stroke-opacity: 0.75; }
.ecl-band { fill: var(--pin); fill-opacity: 0.18; }
.ecl-edge { stroke: var(--band-edge); }
.ecl-line { stroke: var(--pin); }
.ecl-casing { stroke: var(--pin-dot); }
.ecl-dot { fill: var(--pin); stroke: var(--pin-dot); }

.sheet-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.map {
  display: grid;
  place-items: center;
  height: clamp(300px, 100vh - 470px, 430px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-top: 16px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.field input { width: 100%; }
.field .hint { font-size: 12.5px; }
.optional { color: var(--text-muted); font-weight: 400; }
.geo { margin-top: 16px; }

@media (max-width: 1199.98px) {
  :root { --gutter: 28px; }
  .topbar-inner { gap: 14px; }
  .loc-coord { display: none; }
  .events-table th, .events-table td { padding-right: 8px; padding-left: 8px; }
  .events-table .q { display: block; margin-left: 0; }
  .events-table tbody td.c-up { min-width: 170px; }
}

@media screen and (max-width: 991.98px) {
  html { scroll-padding-top: 100px; }
  .topbar-inner { flex-wrap: wrap; row-gap: 0; }
  .brand { flex: 1; }
  .loc { order: 2; }
  .datebar { order: 3; }
  .topbar .seg { order: 4; margin-left: auto; }
  .charts { grid-template-columns: 1fr; gap: 22px; }
  .slider { grid-template-columns: 1fr; padding-top: 14px; }
  .slider-track { order: 2; }
  .readout { order: 1; }
  .r-alt { flex-basis: auto; margin-left: auto; }
  .events { padding-top: 26px; }
  .sec-head h2 { font-size: 20px; }
  .sec-note { flex-basis: 100%; order: 3; font-size: 13px; }

  .events-table, .events-table tbody, .events-table tr, .events-table th, .events-table td { display: block; }

  .events-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .events-table tbody { border-top: 1.5px solid var(--text); }

  .events-table tbody tr {
    display: grid;
    grid-template-areas: "body at at" "rise transit set" "up up up" "mag lit con";
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 10px;
    padding: 14px 0 12px;
    border-bottom: 1px solid var(--line);
  }

  .events-table tbody th, .events-table tbody td { width: auto; padding: 0; border: 0; }
  .events-table tbody th { grid-area: body; align-self: center; font-size: 16px; }
  .events-table tbody .c-rise { grid-area: rise; }
  .events-table tbody .c-transit { grid-area: transit; }
  .events-table tbody .c-set { grid-area: set; }
  .events-table tbody .c-up { grid-area: up; min-height: 14px; padding-top: 2px; }
  .events-table tbody .c-at { grid-area: at; text-align: right; white-space: normal; }
  .events-table tbody .c-mag { grid-area: mag; text-align: left !important; }
  .events-table tbody .c-lit { grid-area: lit; text-align: left !important; }
  .events-table tbody .c-con { grid-area: con; }
  .events-table tbody .c-mag, .events-table tbody .c-lit, .events-table tbody .c-con { font-size: 14px; }

  .events-table tbody td[data-label]::before {
    content: attr(data-label) " ";
    display: block;
    margin-bottom: 1px;
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .events-table tbody .c-up::before { display: none !important; }

  .events-table tbody .c-at::before {
    display: inline-block !important;
    margin-right: 8px;
    padding: 0 6px;
    border-radius: 3px;
    background: var(--accent);
    color: var(--on-accent) !important;
    vertical-align: 2px;
  }

  .events-table tbody .c-mag::before, .events-table tbody .c-lit::before, .events-table tbody .c-con::before {
    display: inline !important;
    margin-right: 6px;
  }

  .events-table .t { font-size: 16px; }
  .events-table .q { display: block; margin-left: 0; font-size: 12.5px; }
  .events-table .c-at .q { display: inline; margin-left: 4px; }
  .status { font-size: 14px; white-space: normal; }
  .table-note { gap: 6px 16px; }
}

@media screen and (max-width: 767.98px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 90px; scroll-padding-bottom: 90px; }
  .topbar-inner { gap: 4px 8px; padding-top: 8px; padding-bottom: 8px; }
  .brand { font-size: 14px; }
  .loc { flex-basis: 100%; flex-wrap: wrap; gap: 4px 8px; padding: 2px 0 4px; }
  .loc-coord { display: inline; font-size: 13.5px; }
  .loc-change { margin-left: auto; }

  .datebar { margin-left: -8px; }
  .date-btn { padding: 6px 2px; }
  .ib { width: 36px; height: 40px; }
  .datebar .ib { width: 28px; }
  .tb { padding: 6px 4px; }
  #date-today { margin-left: 0; padding: 6px 2px; }

  .topbar .seg-opt > span { padding: 4px 7px; }
  .bodies { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 14px; }
  .chip { height: 36px; padding: 0 10px 0 8px; font-size: 13.5px; }
  .presets { align-self: flex-start; }
  .presets > button { padding: 6px 12px; }
  .timeblock { position: relative; }

  .slider {
    position: sticky;
    top: 0;
    bottom: 0;
    z-index: 8;
    gap: 0;
    margin: 14px calc(-1 * var(--gutter)) 0;
    padding: 8px var(--gutter) 6px;
    border-top: 1px solid var(--line);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .r-time { font-size: 20px; }
  .r-alt { font-size: 12.5px; }
  .sheet { width: 100%; border-left: 0; }
  .map { height: 42vh; }
  .fields { grid-template-columns: 1fr; }
}

@media screen and (max-width: 389.98px) {
  .datebar { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.tools { position: relative; display: inline-flex; gap: 2px; }
.tools .tb { padding-right: 8px; padding-left: 8px; }
.tools .icon, .csv .icon { width: 18px; height: 18px; }
.csv { margin-left: auto; color: var(--text-muted); }

.tools-msg {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  width: max-content;
  max-width: 300px;
  font-size: 13px;
}

.tools-msg:not(:empty) {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.loc, .loc-name { min-width: 0; }
.loc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tools .tb { justify-content: center; width: 36px; height: 36px; padding: 0; }
.tools .tb span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media screen and (max-width: 991.98px) {
  .tools { order: 1; }
}

@media screen and (max-width: 767.98px) {
  .tools .tb { width: 40px; height: 40px; }
}

:root[data-theme="light"] { color-scheme: light; }

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #15171b;
    --surface: #1b1e23;
    --surface-2: #20242a;
    --text: #e9e7e2;
    --text-muted: #a5a9b0;
    --line: #2f333a;
    --line-strong: #3d424a;
    --field-border: #737985;
    --grid: #24272d;
    --hover: rgba(233, 231, 226, 0.08);
    --accent: #e9e7e2;
    --on-accent: #15171b;
    --pin: #e5483e;
    --pin-dot: #fff;
    --seg-on: #8cc8ff;
    --on-seg-on: #0b1b2b;
    --danger: #ff8a80;
    --danger-bg: #3a1714;
    --band-civil: #121418;
    --band-nautical: #0f1114;
    --band-astro: #0c0d10;
    --band-night: #030405;
    --moon-lit: #e9e4cf;
    --moon-dark: #3a3f48;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --c-sun: #ffc233;
    --c-moon: #a9b6c4;
    --c-mercury: #b79ae6;
    --c-venus: #f27ab0;
    --c-mars: #ff7a59;
    --c-jupiter: #f2d9b5;
    --c-saturn: #cdbb5c;
    --c-uranus: #4ccfcb;
    --c-neptune: #6f95ff;
    --c-pluto: #b5a08c;
  }

  :root[data-theme="night"] {
    color-scheme: dark;
    scrollbar-color: var(--line-strong) var(--bg);
    --bg: #0c0000;
    --surface: #140100;
    --surface-2: #1a0200;
    --text: #ff5c4d;
    --text-muted: #f2412f;
    --line: #4d0d07;
    --line-strong: #6e140b;
    --field-border: #c2392a;
    --grid: #2c0603;
    --hover: rgba(255, 92, 77, 0.1);
    --accent: #ff5c4d;
    --on-accent: #0c0000;
    --pin: #f2412f;
    --pin-dot: #0c0000;
    --shade: #000;
    --shade-line: #f2412f;
    --band-edge: #0c0000;
    --seg-on: var(--accent);
    --on-seg-on: var(--on-accent);
    --danger: #ff5c4d;
    --danger-bg: #2a0300;
    --band-civil: #090000;
    --band-nautical: #060000;
    --band-astro: #030000;
    --band-night: #000000;
    --moon-lit: #ff5c4d;
    --moon-dark: #3d0904;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    --c-sun: #ff6b4f;
    --c-moon: #ff5c4d;
    --c-mercury: #e8402e;
    --c-venus: #ff6b4f;
    --c-mars: #e8402e;
    --c-jupiter: #ff5c4d;
    --c-saturn: #e8402e;
    --c-uranus: #c93324;
    --c-neptune: #c93324;
    --c-pluto: #c93324;
  }

  :root[data-theme="night"] .body-sun { --w: 3.2px; }
  :root[data-theme="night"] .body-mercury { --dash: 1 4; }
  :root[data-theme="night"] .body-venus { --dash: 9 4; }
  :root[data-theme="night"] .body-mars { --dash: 9 3 2 3; }
  :root[data-theme="night"] .body-jupiter { --dash: 4 3; }
  :root[data-theme="night"] .body-saturn { --dash: 14 4; }
  :root[data-theme="night"] ::selection { background: var(--accent); color: var(--on-accent); }

  :root[data-theme="night"] input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    background: var(--bg);
  }

  :root[data-theme="night"] input[type="checkbox"]:checked { background: var(--accent); box-shadow: inset 0 0 0 2px var(--bg); }

  :root[data-theme="night"] :is(.leaflet-tile-pane, .leaflet-attribution-flag) {
    filter: grayscale(1) brightness(0.5) sepia(1) hue-rotate(-50deg) saturate(4);
  }

  :root[data-theme="night"] .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
  :root[data-theme="night"] .leaflet-bar a.leaflet-disabled { color: var(--line-strong); }
  :root[data-theme="night"] .leaflet-control-attribution { background: var(--surface); color: var(--text-muted); }
  :root[data-theme="night"] .leaflet-control-attribution a { color: var(--text); }

  :root[data-theme="night"] .leaflet-container { background: var(--surface-2); }
}

@media print {
  @page { size: A4 portrait; margin: 12mm 10mm; }

  :root { --gutter: 0px; --bg: #fff; color-scheme: light; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .skip, .tools, .datebar .ib, #date-today, #tz-switch, .loc .icon, .loc-change, .banner, .bodies, .slider,
  .csv, .dome-mirror, .yearnav, .filters, .fchip { display: none !important; }

  #year li.ev[data-id*="conjunction-"] { display: none; }

  .topbar { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .loc-coord { display: inline; }
  .charts { grid-template-columns: 1fr; gap: 16px; }

  .events-table th, .events-table td { padding: 7px 5px; font-size: 13px; }
  .events-table thead th { white-space: normal; }
  .events-table thead .flagtext { white-space: nowrap; }
  .events-table thead .flagtext .now { white-space: normal; }
  .events-table tbody th { font-size: 13.5px; }
  .events-table .t { font-size: 14px; }
  .events-table tbody td.c-up { min-width: 110px; }
  h2 { break-after: avoid; }
  figure, tr, li, .g, .panel { break-inside: avoid; }

  .evlist .ev { grid-template-columns: 54px 40px minmax(0, 220px) minmax(0, 1fr) auto; gap: 0 12px; padding: 6px 0; font-size: 13px; }

  .footer { margin-top: 0; }
  .footer-in { grid-template-columns: 1fr; gap: 8px; padding: 16px 0 0; }
}
