/* ===========================================================================
   Overhead — a live instrument for the radio sky.

   The palette is not decorative: these are the emission lines the upper
   atmosphere actually produces when it is excited. 557.7 nm oxygen green is the
   colour of an aurora you have seen photographed; 630.0 nm oxygen red only
   appears high up; 427.8 nm nitrogen blue fringes the base. Warm amber is the
   instrument's own dial lamp, and it is the only colour in the page that does
   not come from the sky.
   =========================================================================== */

:root {
  --void: #070a18;
  --deep: #0a0f26;
  --layer: #0e1430;
  --surface: rgba(14, 20, 48, 0.72);
  --surface-solid: #0d1330;

  --green: #62f5a0;
  --red: #ff6b7a;
  --blue: #6e9bff;
  --dial: #ffc46b;
  --ash: #8a93b8;
  --craft: #c9d2f0;

  --text: #e6eafa;
  --text-dim: #98a1c4;
  --text-faint: #666f96;

  --edge: rgba(138, 147, 184, 0.16);
  --edge-strong: rgba(138, 147, 184, 0.32);

  --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;

  --gap: 1.5rem;
  --radius: 3px;
  --bar-h: 3.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --------------------------------------------------------------- ambience */

#ionosphere {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

body::after {
  /* Vignette: seals the page like the edge of an aperture. */
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 35%, transparent 40%, rgba(4, 6, 16, 0.75) 100%);
}

main,
.masthead,
.instrument-bar,
.colophon {
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 0.85rem clamp(1rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--edge);
  background: rgba(7, 10, 24, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.brand-mark {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  position: relative;
  align-self: center;
  flex: none;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: var(--dial);
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.masthead-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chip {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: rgba(14, 20, 48, 0.6);
  color: inherit;
  font: inherit;
}

.chip-button {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.chip-button:hover,
.chip-button[aria-expanded='true'] {
  border-color: var(--edge-strong);
  background: rgba(20, 28, 62, 0.85);
}

.chip-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chip-value {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.clock-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--dial);
}

.clock-zone {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

/* --------------------------------------------------------- location panel */

.location-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: clamp(1rem, 4vw, 2.75rem);
  width: min(23rem, calc(100vw - 2rem));
  padding: 1.1rem;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: grid;
  gap: 0.85rem;
}

.location-panel[hidden] {
  display: none;
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}

.location-row {
  display: flex;
  gap: 0.5rem;
}

input[type='search'] {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: rgba(7, 10, 24, 0.8);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
}

input[type='search']::placeholder {
  color: var(--text-faint);
}

input[type='search']:focus-visible,
.btn:focus-visible,
.chip-button:focus-visible,
.sat-item:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius);
  background: rgba(98, 245, 160, 0.1);
  color: var(--green);
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
  background: rgba(98, 245, 160, 0.2);
  border-color: var(--green);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: rgba(138, 147, 184, 0.12);
  border-color: var(--edge-strong);
  color: var(--text);
}

.btn-wide {
  width: 100%;
}

.location-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  min-height: 1em;
}

.location-status[data-state='error'] {
  color: var(--red);
}

.location-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  max-height: 12rem;
  overflow-y: auto;
}

.location-results:empty {
  display: none;
}

.location-results button {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(138, 147, 184, 0.06);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.85rem;
  cursor: pointer;
}

.location-results button:hover {
  border-color: var(--edge-strong);
  background: rgba(138, 147, 184, 0.14);
}

.location-results .result-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  margin-left: 0.4rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.preset-row button {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  cursor: pointer;
}

.preset-row button:hover {
  border-color: var(--green);
  color: var(--green);
}

/* -------------------------------------------------------- instrument bar */

.instrument-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 clamp(1rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--edge);
  background: rgba(10, 15, 38, 0.7);
  overflow-x: auto;
  scrollbar-width: thin;
}

.reading {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-right: 1px solid var(--edge);
  white-space: nowrap;
  flex: none;
}

.reading:first-child {
  padding-left: 0;
}

.reading:last-child {
  border-right: 0;
}

.reading-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reading-value {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: color 0.4s;
}

.reading-value[data-level='high'] {
  color: var(--dial);
}

.reading-value[data-level='alert'] {
  color: var(--red);
}

.reading-value[data-level='good'] {
  color: var(--green);
}

.reading-unit {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-faint);
}

.reading-bar {
  display: inline-block;
  width: 3.25rem;
  height: 4px;
  border-radius: 2px;
  background: rgba(138, 147, 184, 0.2);
  overflow: hidden;
}

.reading-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 0.6s ease, background 0.6s ease;
}

/* ------------------------------------------------------------ observatory */

main {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.75rem) 4rem;
  max-width: 1560px;
  margin: 0 auto;
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 3rem);
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
}

.hero-copy {
  grid-area: copy;
  align-self: start;
}

.hero-copy h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 2.9vw, 2.85rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lede {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
}

/* The dome is the point of the page, so it sits level with the top of the
   copy rather than below it — the reader should meet the sky first. */
.observatory-grid {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr) minmax(0, 15.5rem);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    'copy dome bands'
    'sats dome bands';
  gap: clamp(1rem, 2.2vw, 2rem);
  align-items: start;
}

.rail-sats { grid-area: sats; }
.rail-bands { grid-area: bands; }

.rail {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(10px);
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--edge);
}

.rail-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.count {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}

.rail-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-faint);
}

/* satellite list ---------------------------------------------------------- */

.sat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 24rem;
  overflow-y: auto;
}

.sat-item {
  width: 100%;
  display: grid;
  grid-template-columns: 3px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sat-item:hover {
  background: rgba(138, 147, 184, 0.1);
}

.sat-item[aria-pressed='true'] {
  background: rgba(98, 245, 160, 0.1);
  border-color: rgba(98, 245, 160, 0.4);
}

.sat-flag {
  width: 3px;
  height: 1.6rem;
  border-radius: 2px;
  background: var(--green);
}

.sat-item[data-kind='station'] .sat-flag { background: var(--dial); }
.sat-item[data-kind='weather'] .sat-flag { background: var(--blue); }
.sat-item[data-kind='high'] .sat-flag { background: var(--red); }

.sat-body {
  min-width: 0;
}

.sat-name {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sat-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-faint);
}

.sat-el {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.sat-list .empty,
.timeline .empty,
.data-table .empty {
  padding: 0.8rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  text-align: left;
}

/* band conditions --------------------------------------------------------- */

.band-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.band-row {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.band-name {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.band-meter {
  height: 7px;
  border-radius: 2px;
  background: rgba(138, 147, 184, 0.14);
  overflow: hidden;
}

.band-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1), background 0.8s;
}

.band-state {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  min-width: 4.4rem;
  text-align: right;
}

/* --------------------------------------------------------------- the dome */

.dome-stage {
  grid-area: dome;
  position: relative;
  display: grid;
  place-items: center;
  align-content: start;
  min-height: 24rem;
}

#dome {
  width: 100%;
  max-width: 40rem;
  aspect-ratio: 1;
  display: block;
  cursor: crosshair;
}

.dome-key {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-faint);
}

.dome-key li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.key-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.key-dot[data-kind='station'] { background: var(--dial); }
.key-dot[data-kind='weather'] { background: var(--blue); }
.key-dot[data-kind='high'] { background: var(--red); }

/* Drawn larger and with a halo on the dome, so the swatch says so too — it
   shares the dial amber with a crewed station but never reads as one. */
.key-sun {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dial);
  box-shadow: 0 0 7px 2px rgba(255, 196, 107, 0.45);
}

.key-chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 8px solid var(--craft);
}

/* readout overlay --------------------------------------------------------- */

.dome-readout {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(19rem, 100%);
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius);
  background: rgba(8, 12, 30, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 0.5rem;
  animation: readout-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dome-readout[hidden] {
  display: none;
}

@keyframes readout-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.readout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--edge);
}

.readout-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.readout-kind {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 0.15rem;
}

.readout-close {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.readout-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.8rem;
}

.readout-cell dt {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.readout-cell dd {
  margin: 0.1rem 0 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.readout-doppler {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 196, 107, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 196, 107, 0.07);
}

.readout-doppler dt {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 196, 107, 0.75);
}

.readout-doppler dd {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dial);
}

.readout-shift {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* Same card, but the frequency is the published one rather than a live
   reading, so it should not glow like a number you can act on. */
.readout-waiting {
  border-color: var(--edge);
  background: rgba(138, 147, 184, 0.06);
}

.readout-waiting dt {
  color: var(--text-faint);
}

.readout-waiting dd {
  color: var(--text-dim);
}

.readout-note {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ panels */

.panel {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(10px);
  padding: clamp(0.9rem, 2vw, 1.35rem);
  display: grid;
  gap: 0.9rem;
  align-content: start;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--edge);
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.panel-head .eyebrow {
  margin-bottom: 0.3rem;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.toggle-group {
  display: flex;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow: hidden;
}

.toggle {
  padding: 0.32rem 0.7rem;
  border: 0;
  border-right: 1px solid var(--edge);
  background: transparent;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle:last-child {
  border-right: 0;
}

.toggle:hover {
  color: var(--text);
  background: rgba(138, 147, 184, 0.1);
}

.toggle[aria-pressed='true'] {
  background: rgba(98, 245, 160, 0.14);
  color: var(--green);
}

.toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

/* Marks a satellite whose downlink frequency is on file, and which therefore
   has a live Doppler figure to read. */
.pass-tunable {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--dial);
  vertical-align: middle;
  flex: none;
}

.panel-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem);
}

/* --------------------------------------------------------- doppler trace */

.doppler-body {
  display: grid;
  grid-template-columns: minmax(0, 27rem) minmax(0, 32rem);
  gap: clamp(1rem, 2.5vw, 2.5rem);
  align-items: start;
  /* Cap the columns rather than letting a sparse readout stretch across a
     1400px panel and leave the plot looking like a thumbnail. */
  justify-content: start;
}

/* The plot and its transport are one unit in the left column; without this
   wrapper the transport becomes a third grid child and displaces the readout
   onto a second row. */
.doppler-column {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
}

.doppler-plot {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

#waterfall {
  width: 100%;
  height: 21rem;
  display: block;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0a1029, #070b1c);
}

.doppler-plot figcaption {
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-faint);
}

/* Transport: drives the dome and the trace off the same simulated clock, so
   scrubbing a pass moves the satellite across the sky and the carrier down the
   waterfall together. */
.transport {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.transport-btn {
  padding: 0.38rem 0.6rem;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius);
  background: rgba(98, 245, 160, 0.1);
  color: var(--green);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.transport-btn:hover:not(:disabled) {
  background: rgba(98, 245, 160, 0.2);
  border-color: var(--green);
}

.transport-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.transport-btn[aria-pressed='true'] {
  background: rgba(255, 196, 107, 0.16);
  border-color: var(--dial);
  color: var(--dial);
}

.transport-live {
  background: transparent;
  color: var(--text-dim);
}

.transport-live:hover {
  background: rgba(138, 147, 184, 0.14);
  border-color: var(--edge-strong);
  color: var(--text);
}

.transport-btn:focus-visible,
.transport-scrub:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.transport-scrub {
  flex: 1;
  min-width: 3.5rem;
  height: 3px;
  appearance: none;
  background: rgba(138, 147, 184, 0.25);
  border-radius: 2px;
  cursor: pointer;
}

.transport-scrub:disabled {
  opacity: 0.35;
  cursor: default;
}

.transport-scrub::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--dial);
  border: 0;
  cursor: grab;
}

.transport-scrub::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--dial);
  border: 0;
  cursor: grab;
}

.transport-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  min-width: 4.2rem;
  text-align: right;
}

/* The clock in the masthead has to say so when it is not showing real time. */
.clock[data-mode='replay'] .clock-value {
  color: var(--dial);
}

.clock[data-mode='replay'] .clock-zone::after {
  content: ' · replay';
  color: var(--dial);
}

.doppler-readout {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.doppler-readout .empty {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}

.tune-now {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 196, 107, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 196, 107, 0.07);
}

.tune-now[data-live='false'] {
  border-color: var(--edge);
  background: rgba(138, 147, 184, 0.06);
}

.tune-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 196, 107, 0.8);
}

.tune-now[data-live='false'] .tune-label {
  color: var(--text-faint);
}

.tune-freq {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  color: var(--dial);
}

.tune-now[data-live='false'] .tune-freq {
  color: var(--text-dim);
}

.tune-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.doppler-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.55rem 1rem;
  margin: 0;
}

.doppler-facts dt {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.doppler-facts dd {
  margin: 0.12rem 0 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.doppler-note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- listening */

#spectrum {
  width: 100%;
  height: 15rem;
  display: block;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: #04060f;
}

.listen-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.listen-freq {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dial);
  min-width: 7.5rem;
}

/* Signal strength, as the receiver reports it rather than as a guess. */
.listen-meter {
  display: inline-block;
  width: 7rem;
  height: 5px;
  border-radius: 2px;
  background: rgba(138, 147, 184, 0.2);
  overflow: hidden;
}

.listen-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(110, 155, 255, 0.85), var(--green));
  transition: width 0.15s linear;
}

.listen-dbm {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  min-width: 4.5rem;
}

.listen-volume {
  flex: 0 1 8rem;
}

.listen-detail {
  display: grid;
  gap: 0.6rem;
}

.listen-detail .empty {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-faint);
}

.listen-detail strong {
  color: var(--text-dim);
  font-weight: 600;
}

.receiver-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.35rem;
}

.receiver-item {
  width: 100%;
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: rgba(138, 147, 184, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.receiver-item:hover {
  border-color: var(--edge-strong);
  background: rgba(138, 147, 184, 0.12);
}

.receiver-item[aria-pressed='true'] {
  border-color: rgba(98, 245, 160, 0.45);
  background: rgba(98, 245, 160, 0.1);
}

.receiver-item:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.receiver-name {
  font-size: 0.78rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receiver-meta {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-faint);
}

.listen-note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-faint);
}

.listen-error {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--red);
}

/* The button that starts a stream, in the shortwave table. */
.tune-btn {
  padding: 0.14rem 0.45rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tune-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(98, 245, 160, 0.1);
}

.tune-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.tune-btn[aria-pressed='true'] {
  border-color: var(--dial);
  color: var(--dial);
  background: rgba(255, 196, 107, 0.12);
}

/* ---------------------------------------------------------- pass timeline */

.timeline {
  display: grid;
  gap: 3px;
  position: relative;
}

.timeline-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 13rem 0.35rem 9.1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  border-bottom: 1px solid var(--edge);
  margin-bottom: 0.3rem;
}

.pass-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.16rem 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pass-row:hover {
  background: rgba(138, 147, 184, 0.08);
}

.pass-row[aria-pressed='true'] {
  background: rgba(98, 245, 160, 0.09);
  border-color: rgba(98, 245, 160, 0.35);
}

.pass-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 500;
  padding-left: 0.35rem;
}

.pass-track {
  position: relative;
  height: 1.15rem;
  border-radius: 2px;
  background: rgba(138, 147, 184, 0.07);
  overflow: hidden;
}

.pass-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 2px;
  min-width: 3px;
  background: var(--green);
  opacity: 0.85;
  transform-origin: left center;
  animation: bar-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bar-in {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 0.85; }
}

.pass-bar[data-quality='high'] {
  background: linear-gradient(90deg, rgba(98, 245, 160, 0.55), var(--green));
  box-shadow: 0 0 12px rgba(98, 245, 160, 0.45);
}

.pass-bar[data-quality='mid'] { background: rgba(110, 155, 255, 0.7); }
.pass-bar[data-quality='low'] { background: rgba(138, 147, 184, 0.45); }

.pass-peak {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.65);
}

/* Its own column rather than an overlay: a pass that runs to the right-hand
   edge of the track would otherwise print straight over its own numbers. */
.pass-meta {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  white-space: nowrap;
  text-align: right;
  padding-right: 0.35rem;
}

.now-line {
  position: absolute;
  top: 1.4rem;
  bottom: 0;
  width: 1px;
  background: var(--dial);
  opacity: 0.55;
  pointer-events: none;
}

/* ------------------------------------------------------------------ tables */

.table-scroll {
  overflow-x: auto;
  max-height: 24rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-solid);
  padding: 0.45rem 0.6rem;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
}

.data-table td {
  padding: 0.42rem 0.6rem;
  border-bottom: 1px solid rgba(138, 147, 184, 0.07);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: rgba(138, 147, 184, 0.07);
}

.data-table .num,
.data-table td.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.cell-strong {
  font-weight: 600;
}

.cell-dim {
  color: var(--text-faint);
}

.cell-mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.cell-alert {
  color: var(--red);
  font-weight: 600;
}

.signal-meter {
  display: inline-block;
  width: 3.4rem;
  height: 5px;
  border-radius: 2px;
  background: rgba(138, 147, 184, 0.18);
  overflow: hidden;
  vertical-align: middle;
}

.signal-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(110, 155, 255, 0.8), var(--green));
}

.filter-input {
  width: 100%;
}

.band-tag {
  display: inline-block;
  padding: 0.06rem 0.35rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-dim);
}

/* The band tag carries the live condition, so a row's chances are legible
   without cross-referencing the HF panel. */
.band-tag[data-condition='4'],
.band-tag[data-condition='3'] {
  border-color: rgba(98, 245, 160, 0.45);
  color: var(--green);
}

.band-tag[data-condition='2'] {
  border-color: rgba(255, 196, 107, 0.4);
  color: var(--dial);
}

.band-tag[data-condition='1'],
.band-tag[data-condition='0'] {
  border-color: rgba(138, 147, 184, 0.2);
  color: var(--text-faint);
}

/* -------------------------------------------------- shortwave band picker */

.sw-controls {
  display: grid;
  gap: 0.6rem;
}

.sw-bands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.sw-band-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.55rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sw-band-chip:hover {
  border-color: var(--edge-strong);
  color: var(--text);
}

.sw-band-chip[aria-pressed='true'] {
  border-color: rgba(98, 245, 160, 0.5);
  background: rgba(98, 245, 160, 0.1);
  color: var(--green);
}

.sw-band-chip:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.sw-band-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(138, 147, 184, 0.35);
  flex: none;
}

.sw-band-chip i[data-condition='4'],
.sw-band-chip i[data-condition='3'] { background: var(--green); }
.sw-band-chip i[data-condition='2'] { background: var(--dial); }
.sw-band-chip i[data-condition='1'] { background: var(--red); }

.sw-band-chip[data-special='true'] {
  border-style: dashed;
}

.sw-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sw-row .filter-input {
  flex: 1;
  min-width: 10rem;
  width: auto;
}

.sw-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}

.sw-toggle input {
  accent-color: var(--green);
  cursor: pointer;
}

.sw-hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-faint);
}

.kind-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.04rem 0.3rem;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  background: rgba(138, 147, 184, 0.12);
}

.kind-tag[data-kind='data'] {
  color: var(--red);
  background: rgba(255, 107, 122, 0.12);
}

.kind-tag[data-kind='time'],
.kind-tag[data-kind='music'] {
  color: var(--blue);
  background: rgba(110, 155, 255, 0.12);
}

/* --------------------------------------------------------------- colophon */

.colophon {
  border-top: 1px solid var(--edge);
  background: rgba(7, 10, 24, 0.75);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1rem, 4vw, 2.75rem);
}

.colophon-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.colophon h3 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

.colophon ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.colophon li,
.colophon p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.colophon a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--edge-strong);
}

.colophon a:hover {
  color: var(--green);
  border-color: var(--green);
}

.sign-name {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.sign-note {
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------- utility */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(138, 147, 184, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(138, 147, 184, 0.28);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 147, 184, 0.45);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .observatory-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      'copy copy'
      'dome dome'
      'sats bands';
  }
}

@media (max-width: 720px) {
  .masthead {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .masthead-controls {
    width: 100%;
    justify-content: space-between;
  }

  .location-panel {
    left: 1rem;
    right: 1rem;
    width: auto;
  }

  .observatory-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'copy'
      'dome'
      'sats'
      'bands';
  }

  .dome-stage {
    min-height: 0;
  }

  .doppler-body {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Too narrow for a separate numbers column, so the row wraps to two lines. */
  .pass-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.6rem;
    padding: 0.35rem 0;
  }

  .pass-track {
    grid-column: 1 / -1;
    order: 2;
  }

  .pass-meta {
    text-align: right;
    padding-right: 0;
  }

  .timeline-scale {
    padding: 0 0 0.35rem;
  }

  .sat-list {
    max-height: 17rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
