/* Inter is vendored by `npm run build` (see package.json) so the tuned
   letter-spacing and 750 weight resolve for every visitor, not just locally. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/vendor/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/vendor/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  font-family: "Inter Variable", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);

  /* Ink and surfaces */
  --ink: #242629;
  --label: #494c50;
  --muted: #666a70;
  --surface: #ffffff;
  --surface-muted: #f5f5f5;
  --surface-sunken: #eeeeef;
  --panel: rgba(255, 255, 255, 0.96);
  --overlay: rgba(28, 29, 31, 0.94);
  --border: rgba(30, 32, 35, 0.13);
  --border-strong: #d5d6d8;
  --border-interactive: #cbd8ef;
  --grid-line: #dfe5ed;
  --axis-line: #9aa8b9;

  /* Interactive */
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-tint: #eaf0ff;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.16);

  /* Flight stages. Validated as a categorical set on this surface: distinct
     in all pairs under normal vision and the three CVD simulations, and each
     distinct from the interactive blue above. */
  --ascent-a: #f59e6b;
  --ascent-b: #eb6834;
  --descent-a: #8b7ce0;
  --descent-b: #4a3aa7;
  --cruise-a: #3fc0b0;
  --cruise-b: #0e9384;

  /* Point markers */
  --launch: #ef4444;
  --launch-ring: #b91c1c;
  --burst: #ffd60a;
  --burst-ring: #b45309;
  --landing: #22c55e;
  --landing-ring: #15803d;
  --trajectory-shadow: rgba(7, 20, 38, 0.78);

  /* Feedback */
  --error-ink: #8a2525;
  --error-surface: #fff0f0;

  /* Type scale */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 25px;

  /* Radii and elevation */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 16px 48px rgba(10, 26, 48, 0.18);
  --shadow-sm: 0 6px 20px rgba(10, 26, 48, 0.12);

  /* Single source of truth for the altitude panel height: the map controls,
     the legend, the control panel and the chart itself all key off it. */
  --chart-height: 34vh;
}

:root.dark-mode {
  color-scheme: dark;
  --ink: #eeeeef;
  --label: #d1d2d4;
  --muted: #aaaeb3;
  --surface: #252629;
  --surface-muted: #2d2e32;
  --surface-sunken: #1d1e21;
  --panel: rgba(34, 35, 38, 0.98);
  --border: rgba(230, 230, 232, 0.15);
  --border-strong: #45474c;
  --border-interactive: #555a63;
  --grid-line: #3c3e43;
  --axis-line: #92959b;
  --blue-tint: #303a4b;
  --trajectory-shadow: rgba(0, 0, 0, 0.8);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #dcdcdc;
}

.settings {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.settings summary {
  color: var(--label);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 700;
}

.settings-content {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 12px;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.maplibregl-ctrl-bottom-right {
  bottom: 10px;
}

body.chart-visible .maplibregl-ctrl-bottom-right {
  bottom: calc(var(--chart-height) + 10px);
}

/* Control panel */

.control-panel {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 380px;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: clip;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(18px);
}

body.chart-visible .control-panel {
  max-height: 100dvh;
}

.panel-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
  padding: 22px 20px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 6px;
}

.panel-links a {
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: 750;
  text-decoration: none;
}

.panel-links a:hover {
  text-decoration: underline;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#panel-content {
  padding: 22px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

/* Sections, so the panel is not one flat scroll of thirteen controls */

.panel-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.panel-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: var(--text-xs);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Fields */

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field[hidden] {
  display: none;
}

.field > span,
.field > label {
  color: var(--label);
  font-size: var(--text-sm);
  font-weight: 700;
}

.field small,
.checkbox-field small {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 14px;
  cursor: pointer;
}

.checkbox-field:last-child {
  margin-bottom: 0;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.checkbox-field > span {
  display: grid;
  gap: 3px;
}

.checkbox-field strong {
  color: var(--label);
  font-size: var(--text-sm);
}

select,
input[type="number"] {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

select:focus-visible,
input:focus-visible {
  border-color: #7da5f8;
  box-shadow: var(--focus-ring);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

/* A range paired with a number input, so every value is also keyboard- and
   paste-enterable rather than drag-only. */

.value-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.value-control input[type="range"] {
  flex: 1;
  min-width: 0;
}

.value-control input[type="number"] {
  width: 96px;
  min-height: 32px;
  flex: 0 0 96px;
  padding: 6px 8px;
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: right;
}

.value-control .unit {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.coordinate-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.coordinate-grid input {
  min-height: 36px;
  padding: 7px 9px;
  font-size: var(--text-sm);
}

/* Dataset block */

.dataset-summary-row {
  display: flex;
  min-height: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.dataset-source-link {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: var(--blue);
  border-radius: var(--radius-sm);
}

.dataset-source-link:hover {
  background: var(--blue-tint);
}

.dataset-source-link[aria-disabled="true"] {
  color: var(--muted);
  pointer-events: none;
}

.external-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* Collapsed by default: this is pipeline detail, not a per-run control. */

.dataset-processing {
  padding: 9px 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}

.dataset-processing[hidden] {
  display: none;
}

.dataset-processing summary {
  color: var(--label);
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.04em;
  list-style: none;
  text-transform: uppercase;
}

.dataset-processing summary::-webkit-details-marker {
  display: none;
}

.dataset-processing summary::after {
  margin-left: 4px;
  color: var(--muted);
  content: "▸";
}

.dataset-processing[open] summary::after {
  content: "▾";
}

.dataset-processing dl {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
}

.dataset-processing dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dataset-processing dt {
  color: var(--muted);
}

.dataset-processing dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

/* Timezone switch. Promoted to the panel heading because it rewrites every
   timestamp in the UI, not just the dataset block it used to sit in. */

.timezone-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 700;
}

.timezone-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
  background: #a8aaaf;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.toggle-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10, 26, 48, 0.25);
  transition: transform 0.15s ease;
}

.timezone-toggle input:checked + .toggle-track {
  background: var(--blue);
}

.timezone-toggle input:checked + .toggle-track i {
  transform: translateX(12px);
}

.timezone-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Launch site */

.text-button,
.icon-button {
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.text-button {
  font-size: var(--text-sm);
  font-weight: 750;
}

.text-button:hover {
  text-decoration: underline;
}

.location-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

.location-row .copy {
  min-width: 0;
  flex: 1;
}

.location-row strong,
.location-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-row strong {
  font-size: var(--text-base);
}

.location-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.dot,
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
}

.dot.launch,
.legend i.launch {
  background: var(--launch);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--launch-ring);
}

.map-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

/* Actions. The prediction re-runs by itself on every change, so none of these
   is the primary path and they share one secondary style at one height. */

.actions {
  display: grid;
  gap: 8px;
}

.secondary-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--border-interactive);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.secondary-button:hover:not(:disabled) {
  background: #f5f8ff;
  border-color: #9bb5e5;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary-button[hidden] {
  display: none;
}

/* Top-center overlay: the single place progress and failures are reported, so
   a scrolled or collapsed panel can never hide an error. */

.overlay {
  position: fixed;
  z-index: 40;
  top: 18px;
  left: 50%;
  display: flex;
  max-width: min(520px, calc(100vw - 36px));
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  color: var(--surface);
  background: var(--overlay);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.35;
}

.overlay[hidden] {
  display: none;
}

.overlay.error {
  color: var(--error-ink);
  background: var(--error-surface);
  border-radius: var(--radius-md);
}

.spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--surface);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner[hidden] {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Altitude chart */

.altitude-chart {
  position: fixed;
  z-index: 14;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  height: var(--chart-height);
  min-height: 0;
  flex-direction: column;
  padding: 14px 16px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.altitude-chart[hidden] {
  display: none;
}

.altitude-chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.altitude-chart-heading > div:first-child {
  flex: 0 0 auto;
}

.altitude-chart-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.altitude-chart-readout {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2vw, 36px);
  color: var(--muted);
  font-size: var(--text-base);
  text-align: right;
}

.altitude-chart-readout span {
  display: grid;
  gap: 1px;
}

.altitude-chart-readout small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.altitude-chart-readout strong {
  color: var(--ink);
  font-size: var(--text-base);
  white-space: nowrap;
}

.chart-close {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: var(--surface-sunken);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
}

.chart-close:hover {
  color: var(--ink);
  background: #e8edf4;
}

/* The viewBox is set from this element's pixel size in app.js, so one SVG unit
   is one CSS pixel and the font sizes below render at the size written. */
.altitude-chart-plot {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  touch-action: none;
}

.chart-empty-label {
  fill: var(--muted);
  font-size: var(--text-base);
}

.chart-grid-line {
  stroke: var(--grid-line);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--axis-line);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: var(--text-xs);
}

.chart-axis-title {
  fill: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Line weight separates the primary trajectory from the dispersion samples,
   so it lives here rather than in an attribute the cascade would override. */
.chart-series {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  opacity: 0.28;
}

.chart-series.primary {
  stroke-width: 3;
  opacity: 0.95;
}

.chart-series.ascent {
  stroke: var(--ascent-b);
}

.chart-series.descent {
  stroke: var(--descent-b);
}

.chart-series.cruise {
  stroke: var(--cruise-b);
}

.chart-series.other {
  stroke: var(--blue);
}

.chart-hover-line {
  stroke: var(--label);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.chart-hover-marker {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
  pointer-events: none;
}

/* Logo, now beside the heading instead of in a fixed bar of its own */

.vaaltech-logo {
  display: block;
  flex: 0 0 auto;
}

.vaaltech-logo img {
  display: block;
  width: 96px;
  height: auto;
}

/* Legend */

.legend {
  position: fixed;
  z-index: 11;
  top: 18px;
  right: 18px;
  display: flex;
  max-width: calc(100vw - 36px);
  min-height: 38px;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  color: #435268;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-xs);
  font-weight: 700;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend span[hidden] {
  display: none;
}

.legend i.ascent,
.legend i.descent,
.legend i.cruise {
  width: 20px;
  height: 3px;
  flex-basis: 20px;
  border-radius: 2px;
}

.legend i.ascent {
  background: linear-gradient(90deg, var(--ascent-a) 0 50%, var(--ascent-b) 50%);
}

.legend i.descent {
  background: linear-gradient(90deg, var(--descent-a) 0 50%, var(--descent-b) 50%);
}

.legend i.cruise {
  background: linear-gradient(90deg, var(--cruise-a) 0 50%, var(--cruise-b) 50%);
}

.legend i.burst,
.legend i.landing {
  border: 2px solid var(--surface);
}

.legend i.burst {
  background: var(--burst);
  box-shadow: 0 0 0 1px var(--burst-ring);
}

.legend i.landing {
  background: var(--landing);
  box-shadow: 0 0 0 1px var(--landing-ring);
}

/* Map tooltip */

.maplibregl-popup-content {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(10, 26, 48, 0.2);
}

.trajectory-tooltip {
  min-width: 210px;
  color: var(--ink);
  font-size: var(--text-xs);
}

.trajectory-tooltip > strong {
  display: block;
  margin-bottom: 8px;
  font-size: var(--text-base);
}

.trajectory-tooltip dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 14px;
  margin: 0;
}

.trajectory-tooltip dt {
  color: var(--muted);
}

.trajectory-tooltip dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.mobile-only {
  display: none;
}

@media (max-width: 760px) {
  .control-panel {
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 100dvh;
    padding: 0;
    border-radius: 0;
  }

  body.chart-visible .control-panel {
    max-height: 100dvh;
  }

  .altitude-chart {
    padding: 11px 12px 7px;
  }

  .altitude-chart-heading {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .altitude-chart-readout {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    text-align: left;
  }

  .mobile-only {
    display: block;
  }

  #panel-content.collapsed {
    display: none;
  }

  .panel-heading h1 {
    font-size: var(--text-lg);
  }

  #panel-toggle {
    display: grid;
    width: 32px;
    gap: 4px;
  }

  #panel-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }

  .coordinate-grid {
    grid-template-columns: 1fr;
  }

  /* Kept on screen rather than hidden: without it the trajectory colors go
     unexplained. Moved clear of the panel, above the chart and map controls. */
  .legend {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
    overflow-x: auto;
    gap: 12px;
  }

  body.chart-visible .legend {
    bottom: calc(var(--chart-height) + 10px);
  }

  .maplibregl-ctrl-bottom-right {
    bottom: 58px;
  }

  body.chart-visible .maplibregl-ctrl-bottom-right {
    bottom: calc(var(--chart-height) + 58px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .spinner {
    border-top-color: rgba(255, 255, 255, 0.55);
  }
}

/* Mission workspace: a fixed identity above independently scrolling controls. */
#map {
  position: absolute;
  left: 380px;
  width: calc(100% - 380px);
}
.altitude-chart { left: 380px; border-radius: 0; }
.section-caption { color: var(--muted); font-size: var(--text-xs); }
.balloon-settings {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  margin: 12px 0 18px;
}
.balloon-settings summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: var(--text-sm);
  font-weight: 650;
}
.balloon-settings summary small {
  display: block;
  padding-left: 16px;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 400;
}
.balloon-settings-content { padding: 0 14px 14px; }
.preset-actions { display: flex; align-items: center; gap: 10px; margin: 12px 0 16px; }
.preset-actions > span { flex: 1; font-size: var(--text-xs); color: var(--muted); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
input[readonly] { color: var(--muted); background: var(--surface-sunken); }
.display-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; font-size: var(--text-sm); }
.display-row + .display-row { border-top: 1px solid var(--border); }
.show-map { margin-top: 24px; width: 100%; padding: 14px; border: 0; border-radius: 8px; background: var(--blue); color: white; font-weight: 650; }
@media (max-width: 760px) {
  #map { left: 0; top: 84px; width: 100%; height: calc(100% - 84px); }
  .panel-heading { min-height: 84px; padding: 15px 16px; align-items: center; }
  .panel-links { gap: 12px; margin-top: 5px; }
  .vaaltech-logo img { width: 86px; }
  body.menu-open .control-panel { height: 100dvh; background: var(--surface); }
  body.menu-open #panel-content { flex: 1; }
  #panel-content { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .altitude-chart { left: 0; }
  #panel-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  #panel-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  #panel-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

.display-row .timezone-toggle { display: grid; grid-template-columns: 40px 36px 40px; gap: 8px; text-align: center; }

.display-row .toggle-track { justify-self: center; }

/* Secondary controls live in the hamburger menu on every screen size. */
.panel-heading { gap: 10px; padding-left: 16px; padding-right: 16px; align-items: center; }
.panel-heading h1 { font-size: 21px; }
#panel-toggle { display: grid; width: 32px; gap: 4px; }
#panel-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
#panel-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#panel-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
#panel-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
#mission-menu[hidden] { display: none; }
.show-map, .mobile-menu-return { display: none; }
body.menu-open .show-map { display: block; }
#mission-menu button,
.show-map {
  background: #526477;
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-weight: 650;
}
#mission-menu button:not(:disabled):hover,
.show-map:hover { background: #455669; }
#mission-menu button:disabled { opacity: 0.4; cursor: not-allowed; }
@media (min-width: 761px) {
  body.menu-open #mission-controls { display: none; }
}
@media (max-width: 760px) {
  .desktop-menu-return { display: none; }
  .mobile-menu-return { display: inline; }
  body.menu-open #mission-controls { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
}
