/* Mission-control dark, after SpaceX's own site: true black, white, thin rules,
 * small letter-spaced capitals for labels, outlined buttons that fill on hover,
 * and one cool accent used only where it carries meaning.
 *
 * The design logic underneath is kept from the previous GOV.UK pass, because
 * it is what makes the page usable rather than what makes it look like
 * anything: labels above controls, hint text under them, longer guidance set
 * apart as a note, a focus state you cannot miss, semantic tags that explain
 * themselves on hover, and no decoration that does not communicate.
 *
 * Typeface: SpaceX sets in D-DIN, a font the page will not download because it
 * makes no third-party requests. Helvetica and Arial sit close enough that the
 * letter-spaced capitals carry the look.
 *
 * Tokens come in two layers. Rules only ever use a role, never a palette entry,
 * because a custom property is substituted where it is declared and not where
 * it is used: a role written in terms of the palette freezes the palette value
 * at :root, and night mode further down could not then change it.
 */

:root {
  /* ---- Palette ---- */
  --black: #000000;
  --white: #ffffff;
  --grey-900: #0d0d0d;
  --grey-800: #161616;
  --grey-700: #222222;
  --grey-500: #4a4a4a;
  --grey-300: #8c8c8c;
  --ice: #6fb1ff;
  --ice-deep: #0f2a45;
  --amber: #f5b942;
  --signal-red: #e5484d;
  --signal-green: #3ecf8e;

  /* ---- Roles ---- */
  --page-bg: #000000;
  --surface: #000000;
  --surface-raised: #0d0d0d;
  --row-hover: #161616;

  --text: #ffffff;
  --text-secondary: #8c8c8c;
  --text-inverse: #000000;

  --rule: #222222;
  --border: #4a4a4a;
  --border-strong: #ffffff;

  --link: #6fb1ff;
  --accent: #6fb1ff;
  --focus: #ffffff;
  --focus-text: #000000;

  --selected-bg: #0f2a45;
  --selected-edge: #6fb1ff;
  --progress-fill: #6fb1ff;

  --action-bg: #ffffff;
  --action-bg-hover: #d9d9d9;
  --action-text: #000000;

  --danger-bg: #e5484d;
  --danger-text: #000000;
  --success: #3ecf8e;
  --notice: #f5b942;
  --warn-text: #f5b942;

  --chart-bg: #000000;
  --chart-line: #222222;
  --chart-text: #8c8c8c;
  --chart-limit: #6fb1ff;
  --chart-marker: #ffffff;

  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color-scheme: dark;
}

/* Night mode is not a second theme, it is dark adaptation: red only, so the
   observer's eyes stay adjusted at the eyepiece. Every role is restated. */
body.night {
  --page-bg: #000000;
  --surface: #000000;
  --surface-raised: #120000;
  --row-hover: #1c0000;

  --text: #ff4a4a;
  --text-secondary: #a83a3a;
  --text-inverse: #000000;

  --rule: #2a0000;
  --border: #5a0000;
  --border-strong: #ff4a4a;

  --link: #ff8f8f;
  --accent: #ff8f8f;
  --focus: #ff8f8f;
  --focus-text: #000000;

  --selected-bg: #2e0000;
  --selected-edge: #ff8f8f;
  --progress-fill: #8f0000;

  --action-bg: #ff4a4a;
  --action-bg-hover: #ff8f8f;
  --action-text: #000000;

  --danger-bg: #8f0000;
  --danger-text: #ff8f8f;
  --success: #ff8f8f;
  --notice: #ff8f8f;
  --warn-text: #ff8f8f;

  --chart-bg: #000000;
  --chart-line: #2a0000;
  --chart-text: #a83a3a;
  --chart-limit: #ff8f8f;
  --chart-marker: #ff4a4a;
}
/* The data ramps are generated in JavaScript, so they are filtered to red
   rather than restated. The legend swatch is a CSS gradient and the tracks
   are SVG, so both need saying. */
body.night svg.chart .colored,
body.night .legend .bar {
  filter: saturate(0) sepia(1) hue-rotate(-50deg) saturate(6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------
 * Typography. Headings and labels are small capitals with wide tracking;
 * numbers and body text stay in normal case where they have to be read.
 * ------------------------------------------------------------------ */
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.25; }
b, strong { font-weight: 600; }

.caps,
h2,
label,
th,
.field-group__label,
.accordion__title,
.accordion__toggle,
.accordion__show-all,
.details__summary,
.legend,
.status,
button {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

a, a:link {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
a:hover { color: var(--text); }
a:active { color: var(--text-secondary); }

/* ------------------------------------------------------------------
 * Focus. A white ring, offset so it reads on any background, on every
 * control that can take the keyboard. Never removed, never subtle.
 * ------------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
a:focus-visible { background: var(--focus); color: var(--focus-text); border-color: transparent; }

/* ------------------------------------------------------------------
 * Buttons: an outlined rectangle that fills on hover. The one primary
 * action is filled from the start.
 * ------------------------------------------------------------------ */
button {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
  margin: 0;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  -webkit-appearance: none;
}
button:hover { background: var(--text); color: var(--text-inverse); }
button:active { background: var(--action-bg-hover); color: var(--text-inverse); }
button:disabled { opacity: 0.4; cursor: default; }
button:disabled:hover { background: transparent; color: var(--text); }

button.primary {
  background: var(--action-bg);
  border-color: var(--action-bg);
  color: var(--action-text);
  font-weight: 600;
  padding: 11px 22px;
}
button.primary:hover { background: var(--action-bg-hover); border-color: var(--action-bg-hover); }
button.primary:disabled { background: var(--action-bg); }

button.small { padding: 6px 10px; font-size: 11px; }

/* ------------------------------------------------------------------
 * Form controls
 * ------------------------------------------------------------------ */
input, select {
  font: inherit;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 10px;
  height: 38px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 120ms ease;
}
input:hover, select:hover { border-color: var(--text-secondary); }
input:focus, select:focus { border-color: var(--border-strong); outline: none; }
select {
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px top 50%, right 9px top 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input[type=number] { width: 7em; }
input[type=text] { width: 100%; max-width: 18em; }

input[type=checkbox] {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  position: relative;
}
input[type=checkbox]:checked { background: var(--text); }
input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 9px;
  height: 4px;
  border: solid var(--text-inverse);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
input[type=checkbox]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

input[type=range] {
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--border); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--text);
  border: 0;
}
input[type=range]::-moz-range-track { height: 2px; background: var(--border); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }

/* A label sits above its control as a small caption; a checkbox keeps
   its label beside it. */
label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}
label:has(input[type=checkbox]) { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 14px; }
label:has(input[type=number]),
label:has(input[type=text]),
label:has(input[type=datetime-local]),
label:has(select) {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.field-group { margin-bottom: 15px; }
.field-group__label { display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.field-group .row { margin-bottom: 0; }

::placeholder { color: var(--grey-500); opacity: 1; }

/* ------------------------------------------------------------------
 * Header and the status strip beneath it
 * ------------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 28px;
  background: var(--page-bg);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-header h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.site-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-raised);
}
/* The catalog picker decides what the whole page is about, so it is never
   folded away with the rest of the controls. */
.site-banner__catalog { flex-direction: row; align-items: center; gap: 12px; }
.site-banner__catalog select { height: 34px; font-size: 14px; min-width: 16em; }
.site-banner .status { flex: 1; min-width: 12em; font-size: 11px; color: var(--text-secondary); }

/* ------------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  padding: 28px;
}
@media (max-width: 1040px) { .layout { grid-template-columns: 1fr; } }

.sidebar { display: block; }
.main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }

.panel { padding: 0; }
.panel h2 {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.panel h2 + .hint + h2, .panel h2 ~ h2 { margin-top: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 0 0 15px; }
.row:last-child { margin-bottom: 0; }
.presets { gap: 8px; }

.hint { color: var(--text-secondary); font-size: 13px; }
.hint + .row, .hint + .field-group { margin-top: 15px; }
.note {
  border-left: 2px solid var(--border);
  padding: 8px 0 8px 14px;
  margin: 0 0 15px;
}
.note:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------
 * Tag: a word in small capitals that says what a value is, and explains
 * itself on hover.
 * ------------------------------------------------------------------ */
.tag, .offline-badge, .err, #msg:not(:empty) {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: help;
}
.tag--warn { border-color: var(--notice); color: var(--notice); }
.offline-badge { border-color: var(--notice); color: var(--notice); cursor: default; }
.err { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger-text); cursor: default; }
#msg:not(:empty) { border-color: var(--success); color: var(--success); cursor: default; }
#msg.err { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger-text); }

/* ------------------------------------------------------------------
 * Accordion: each control group folds away behind a thin rule.
 * ------------------------------------------------------------------ */
.accordion { border-bottom: 1px solid var(--rule); }
.accordion__controls { display: flex; justify-content: flex-end; padding: 0 0 8px; }

.accordion__show-all,
.accordion__button {
  display: flex;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  transition: color 120ms ease;
}
.accordion__show-all { gap: 8px; }
.accordion__show-all:hover,
.accordion__button:hover { background: none; color: var(--text); }
.accordion__show-all:active,
.accordion__button:active { background: none; color: var(--text); }

.accordion__section { border-top: 1px solid var(--rule); }
.accordion__heading { margin: 0; }
.accordion__button { width: 100%; padding: 16px 0; gap: 15px; }
.accordion__title { color: var(--text); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; }
.accordion__toggle { display: flex; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; }
/* How many filters are narrowing the results. On the header, so a folded
   section cannot hide it. */
.accordion__badge {
  margin-left: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--notice);
  border: 1px solid var(--notice);
  white-space: nowrap;
}

/* An empty table that says why it is empty. */
.empty {
  border: 1px solid var(--notice);
  border-left-width: 3px;
  padding: 15px;
  margin-bottom: 15px;
  font-size: 14px;
}
.empty p { margin: 0 0 12px; }
.empty p:last-child { margin-bottom: 0; }

.accordion__chevron {
  box-sizing: border-box;
  display: inline-block;
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
}
.accordion__chevron::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: -2px;
  left: 0;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg); /* closed points down: press to open */
  transition: transform 120ms ease;
}
.accordion__section.open .accordion__chevron::after,
.accordion__show-all.open .accordion__chevron::after {
  top: 2px;
  transform: rotate(225deg); /* open points up: press to fold away */
}

.accordion__content { display: none; padding: 0 0 22px; }
.accordion__section.open .accordion__content { display: block; }

/* ------------------------------------------------------------------
 * Details, used for the column chooser
 * ------------------------------------------------------------------ */
.details { margin: 0; }
.details__summary {
  display: inline-block;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  padding-left: 16px;
  position: relative;
  transition: color 120ms ease;
}
.details__summary:hover { color: var(--text); }
.details__summary::-webkit-details-marker { display: none; }
.details__summary::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}
.details[open] > .details__summary::before { transform: rotate(45deg); top: 2px; }
.details__content { padding: 15px 0 0; }
.col-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px 16px;
  margin-top: 15px;
}
.col-choices label { font-size: 13px; }

/* ------------------------------------------------------------------
 * Sky chart
 * ------------------------------------------------------------------ */
.chart-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}
.chart-wrap > * { min-width: 0; }
/* Two columns for as long as both fit, so the chart is not left alone with
   a whole tablet width to fill. */
@media (max-width: 900px) { .chart-wrap { grid-template-columns: minmax(0, 1fr); } }

/* The chart never gets taller than most of the screen. svh is the height with
   the browser's own bars showing, so the chart does not resize as they hide. */
.chart-col {
  max-width: min(560px, 80vh);
  max-width: min(560px, 80svh);
}

svg.chart {
  width: 100%;
  height: auto;
  display: block;
  background: var(--chart-bg);
  border: 1px solid var(--rule);
}
svg.chart .grid { stroke: var(--chart-line); fill: none; stroke-width: 1; }
svg.chart .limit { stroke: var(--chart-limit); stroke-dasharray: 3 5; fill: none; opacity: 0.8; }
svg.chart .lbl { fill: var(--chart-text); font-size: 11px; letter-spacing: 0.1em; text-anchor: middle; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
svg.chart .track { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; cursor: pointer; }
svg.chart .track.dim { opacity: 0.2; }
svg.chart .track.dot { fill: none; stroke-width: 1.8; }
svg.chart .track.dot.sel, svg.chart .track.dot:hover { stroke-width: 3; }
svg.chart .track.sel { stroke-width: 4; opacity: 1; }
svg.chart .track:hover { stroke-width: 3.5; opacity: 1; }
/* The Sun and the Moon. Drawn as symbols, not to scale: half a degree is a
   pixel and a half on this chart. */
svg.chart .body { pointer-events: none; }
/* A dark patch under each body, so it reads against a chart full of tracks. */
svg.chart .body__halo { fill: var(--chart-bg); fill-opacity: 0.8; stroke-width: 1; }
svg.chart .body__disk { stroke-width: 1; }
svg.chart .body__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Outline first, then the letters, so the label survives a busy chart. */
  stroke: var(--chart-bg);
  stroke-width: 3;
  paint-order: stroke fill;
}
svg.chart .body--sun .body__halo { stroke: var(--notice); }
svg.chart .body--sun .body__disk { fill: var(--notice); stroke: var(--notice); }
svg.chart .body--sun .body__label { fill: var(--notice); }
svg.chart .body--moon .body__halo { stroke: var(--chart-marker); }
svg.chart .body--moon .body__disk { fill: var(--chart-marker); stroke: var(--chart-marker); }
svg.chart .body--moon .body__label { fill: var(--chart-marker); }

svg.chart .marker { stroke: var(--chart-marker); stroke-width: 1; pointer-events: none; }
svg.chart .marker.sel { stroke-width: 2.5; }

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 12px;
  flex-wrap: wrap;
}
.legend__by { flex-direction: row; align-items: center; gap: 10px; }
.legend__by select { height: 32px; font-size: 13px; }
.legend .bar { height: 6px; width: 160px; }

.timebar { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-bottom: 10px; }
.timebar input[type=range] { flex: 1 1 120px; min-width: 0; }
.timebar .t { font-variant-numeric: tabular-nums; min-width: 9em; font-size: 15px; }
#tInfo { margin-bottom: 4px; }

#tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 13px;
  z-index: 10;
  display: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------------
 * Table
 * ------------------------------------------------------------------ */
.table-panel { border-top: 1px solid var(--rule); padding-top: 15px; }
.table-panel > .details { padding: 0 0 15px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 9px 12px 9px 0;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
th:first-child, td:first-child { padding-left: 12px; }
th:last-child, td:last-child { padding-right: 12px; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease;
}
th:hover { color: var(--text); }
th.sorted { color: var(--text); }
th.sorted::after { content: " \25BE"; }
th.sorted.asc::after { content: " \25B4"; }
td.num, th.num { text-align: right; }
tr:hover td { background: var(--row-hover); }
tr.sel td { background: var(--selected-bg); }
tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--selected-edge); }

/* Element age: a warning, then a refusal to be trusted. */
td.warn { color: var(--warn-text); }
td.bad { color: var(--danger-bg); font-weight: 600; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 0 0 15px;
}
.toolbar .spacer { flex: 1; }
/* The name search sits with the table it searches, not with the filters. It
   stays on one line beside the buttons, so it needs to outrank the rule that
   stacks a text field under its label. */
.toolbar label.toolbar__search { flex-direction: row; align-items: center; gap: 10px; }
.toolbar__search input { height: 32px; font-size: 14px; width: 13em; }
/* Per-object links out to the catalogs that keep the official record. */
.links { font-size: 11px; white-space: nowrap; letter-spacing: 0.06em; text-transform: uppercase; }
.links a { border-bottom-color: var(--rule); }
.links a:hover { border-bottom-color: currentColor; }
.loading { opacity: 0.6; }

progress {
  width: 100%;
  height: 2px;
  border: 0;
  background: var(--rule);
  -webkit-appearance: none;
  appearance: none;
}
progress::-webkit-progress-bar { background: var(--rule); }
progress::-webkit-progress-value { background: var(--progress-fill); }
progress::-moz-progress-bar { background: var(--progress-fill); }

/* ------------------------------------------------------------------
 * Transits. One line each: a crossing is an event, not a pass, so it does
 * not belong in the table of passes.
 * ------------------------------------------------------------------ */
.transit {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  cursor: pointer;
}
.transit:hover { background: var(--row-hover); }
.transit__time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.transit__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transit__detail { color: var(--text-secondary); white-space: nowrap; font-size: 11px; }
.transit__disk {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.transit__disk--sun { border-color: var(--notice); color: var(--notice); }
.transit__disk--moon { border-color: var(--link); color: var(--link); }
/* How central the crossing is: full width means straight over the middle. */
.transit__bar { width: 44px; height: 4px; background: var(--rule); flex: none; }
.transit__bar span { display: block; height: 100%; background: var(--text-secondary); }
#transits { margin-top: 8px; }

/* ------------------------------------------------------------------
 * Rows that only apply to one kind of catalog. The body carries the class,
 * so switching catalog switches the whole interface in one place.
 * ------------------------------------------------------------------ */
.sb-only { display: none; }
body.smallbody .sb-only { display: inline-block; }
body.smallbody .sat-only { display: none; }
body.smallbody div.sb-only { display: block; }
th.sb-only-cell, td.sb-only-cell { display: none; }
body.smallbody th.sb-only-cell, body.smallbody td.sb-only-cell { display: table-cell; }
body.smallbody th.sat-only-cell, body.smallbody td.sat-only-cell { display: none; }
body.smallbody #satPresets, body.smallbody #sunlitRow { display: none; }

/* The combined catalog holds both kinds, so it shows both sets of columns
   and both sets of notes rather than choosing between them. */
body.mixed .sb-only { display: inline-block; }
body.mixed div.sb-only { display: block; }
body.mixed th.sb-only-cell, body.mixed td.sb-only-cell { display: table-cell; }

/* A short screen, such as a phone held sideways, has vertical space to spare
   least of all. The header stops holding on to a third of it. */
@media (max-height: 600px) {
  .site-header { position: static; }
}

/* ------------------------------------------------------------------
 * Small screens. The page is dense by design; on a phone it has to give
 * back space rather than shrink everything until nothing is legible.
 * ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .layout { padding: 16px; gap: 16px; }
  .site-header { padding: 14px 16px; gap: 10px; flex-wrap: wrap; position: static; }
  .site-header h1 { font-size: 13px; }
  .site-header__actions { gap: 14px; }
  .site-banner { padding: 12px 16px; }
  .site-banner__catalog { flex: 1 1 100%; }
  .site-banner__catalog select { width: 100%; min-width: 0; }
  .chart-wrap { gap: 16px; }
  /* Tighter cells, so the essential columns get closer to fitting the width. */
  th, td { padding: 8px 8px 8px 0; }
  th:first-child, td:first-child { padding-left: 8px; }
  th:last-child, td:last-child { padding-right: 8px; }
  /* Controls stack, so each one gets the full width rather than a sliver. */
  .row { gap: 14px; }
  .row > label:has(input[type=number]) { flex: 1 1 45%; }
  .row > label:has(input[type=number]) input { width: 100%; }
  .row > label:has(select) { flex: 1 1 100%; }
  .row > label:has(select) select { width: 100%; }
  .col-choices { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
