:root {
  color-scheme: dark;
  --bg: #11161b;
  --panel: #1b232b;
  --panel-2: #202a33;
  --line: #34424e;
  --line-soft: #2a3540;
  --text: #e7edf2;
  --muted: #9daab5;
  --faint: #6f7b86;
  --accent: #ffd84a;
  --accent-2: #70d6ff;
  --green: #83e17f;
  --red: #ff6f6f;
  --orange: #ffb35f;
  --violet: #a88cff;
  --map-bg: #0d1318;
  --topbar-height: 74px;
  --topbar-pad-x: 22px;
  --sidebar-width: 330px;
  --map-height: 58%;
  --map-min-height: 300px;
  --timeline-width: 48%;
  --panel-header-min-height: 62px;
  --panel-header-pad-y: 14px;
  --panel-header-pad-x: 16px;
  --splitter-size: 7px;
  --instrument-scale: 1;
  --instrument-user-scale: 1;
  --instrument-edge: 16px;
  --instrument-gap: 10px;
  --overlay-top: 78px;
  --overlay-edge: 16px;
  --surrogate-panel-width: 460px;
  --surrogate-panel-max-height: min(36%, 300px);
  --voice-settings-top: 84px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--topbar-pad-x);
  border-bottom: 1px solid var(--line-soft);
  background: #151b21;
  overflow: hidden;
}

.eyebrow,
.meta,
.status {
  color: var(--muted);
  font-size: 12px;
}

h1,
h2 {
  margin: 0;
  font-weight: 650;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.status {
  min-width: 0;
  max-width: min(36vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #10161c;
}

.mode-switch button {
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.mode-switch button.active {
  color: #071018;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.voice-settings-panel {
  position: fixed;
  top: var(--voice-settings-top);
  right: 18px;
  z-index: 40;
  width: min(420px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid rgba(112, 214, 255, 0.34);
  border-radius: 10px;
  background: rgba(15, 21, 26, 0.98);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.48);
}

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

.voice-settings-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.voice-settings-field select,
.voice-settings-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070b0f;
  color: var(--text);
  padding: 8px 9px;
}

.voice-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.voice-settings-status {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.voice-settings-status.ok {
  color: var(--green);
}

.voice-settings-status.error {
  color: var(--red);
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #25313b;
  padding: 8px 12px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent-2);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, var(--sidebar-width)) var(--splitter-size) minmax(0, 1fr);
  height: calc(100dvh - var(--topbar-height));
  min-height: 0;
}

.layout.sidebar-collapsed {
  grid-template-columns: 0 30px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line-soft);
  background: #151b21;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.layout.sidebar-collapsed .sidebar {
  border-right: 0;
  visibility: hidden;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 12px 0;
}

.sidebar-tabs button {
  padding: 7px 9px;
  font-size: 12px;
  color: var(--muted);
  background: #10161c;
}

.sidebar-tabs button.active {
  color: #141414;
  background: var(--accent);
  border-color: var(--accent);
}

.sidebar-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.search {
  padding: 16px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.search input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f151a;
  color: var(--text);
  padding: 10px;
}

.lesson-list {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 10px 14px;
}

.taxonomy-list {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 10px 14px;
}

.taxonomy-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 12px 12px;
}

.taxonomy-actions button,
.taxonomy-add-row {
  padding: 7px 9px;
  font-size: 12px;
}

.sidebar-empty {
  color: var(--muted);
  padding: 12px;
  font-size: 13px;
}

.lesson-group {
  margin-bottom: 8px;
}

.lesson-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border-radius: 7px;
  color: var(--text);
  user-select: none;
}

.lesson-group summary::-webkit-details-marker {
  display: none;
}

.lesson-group summary::before {
  content: "›";
  color: var(--muted);
  margin-right: 6px;
  transition: transform 120ms ease;
}

.lesson-group[open] > summary::before {
  transform: rotate(90deg);
}

.lesson-group summary::before {
  content: ">";
}

.lesson-group.category > summary {
  padding: 9px 10px;
  background: #202a33;
  color: var(--accent);
  font-size: 13px;
}

.lesson-group.topic {
  margin: 7px 0 7px 10px;
}

.lesson-group.topic > summary {
  padding: 7px 9px;
  background: #182129;
  color: var(--text);
  font-size: 12px;
}

.lesson-group.difficulty {
  margin: 6px 0 6px 12px;
}

.lesson-group.difficulty > summary {
  padding: 6px 8px;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--line-soft);
  font-size: 12px;
}

.taxonomy-group {
  margin-bottom: 8px;
}

.taxonomy-group summary {
  list-style: none;
  cursor: pointer;
}

.taxonomy-group summary::-webkit-details-marker {
  display: none;
}

.taxonomy-group > summary:not(.taxonomy-row) {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  background: #202a33;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 13px;
}

.taxonomy-group.nested {
  margin: 7px 0 7px 10px;
}

.taxonomy-row {
  width: calc(100% - 12px);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 7px 0 7px 12px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #161d23;
  color: var(--text);
}

.taxonomy-row.taxonomy-summary {
  margin-left: 0;
  width: 100%;
}

.taxonomy-row.active {
  border-color: var(--accent);
  background: #24251a;
}

.taxonomy-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taxonomy-row small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.taxonomy-add-row {
  width: calc(100% - 12px);
  margin: 6px 0 10px 12px;
  color: var(--accent-2);
  background: transparent;
  border-style: dashed;
}

.lesson-row {
  position: relative;
  width: calc(100% - 12px);
  text-align: left;
  border-radius: 8px;
  padding: 0;
  margin: 7px 0 7px 12px;
  background: var(--panel);
  border: 1px solid transparent;
  overflow: hidden;
}

.lesson-row.active {
  border-color: var(--accent);
  background: #2a2b1f;
}

.lesson-row.pending-start {
  border-color: rgba(131, 225, 127, 0.72);
  box-shadow: 0 0 0 1px rgba(131, 225, 127, 0.18);
}

.lesson-row.free-fly {
  margin-top: 0;
  border-color: rgba(91, 213, 255, 0.45);
  background: linear-gradient(135deg, rgba(91, 213, 255, 0.12), rgba(255, 225, 75, 0.08));
}

.lesson-row.free-fly .title {
  color: var(--accent);
}

.lesson-row-main {
  width: 100%;
  display: block;
  padding: 11px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.lesson-row .title {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.lesson-row .sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.lesson-runtime {
  margin-top: 7px;
  color: var(--green);
  font-size: 11px;
  line-height: 1.35;
}

.lesson-row-actions {
  display: flex;
  gap: 8px;
  padding: 0 11px 11px;
}

.lesson-row-actions button {
  padding: 5px 8px;
  font-size: 11px;
  border-color: rgba(255, 216, 74, 0.35);
  background: #111820;
}

.lesson-start-confirm {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(27, 35, 43, 0.04), rgba(10, 14, 12, 0.88));
}

.lesson-start-confirm button {
  pointer-events: auto;
  min-width: 76px;
  padding: 8px 12px;
  border-color: rgba(131, 225, 127, 0.9);
  background: linear-gradient(#55d75a, #238a2b);
  color: #041007;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(29, 160, 58, 0.32);
}

.workspace {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(180px, var(--map-height)) var(--splitter-size) minmax(170px, 1fr);
}

.map-panel,
.timeline-panel,
.editor-panel {
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}

.map-panel {
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
}

.panel-header {
  min-height: var(--panel-header-min-height);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: var(--panel-header-pad-y) var(--panel-header-pad-x);
  border-bottom: 1px solid var(--line-soft);
}

.panel-header.tight {
  min-height: calc(var(--panel-header-min-height) - 12px);
  padding: calc(var(--panel-header-pad-y) - 2px) calc(var(--panel-header-pad-x) - 2px);
}

.map-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.map-tools button {
  padding: 5px 9px;
  font-size: 12px;
}

.map {
  width: 100%;
  height: 100%;
  min-height: var(--map-min-height);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--map-bg);
  background-size: 36px 36px;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.map.panning {
  cursor: grabbing;
}

.surrogate-instruments {
  position: absolute;
  left: var(--instrument-edge);
  bottom: var(--instrument-edge);
  z-index: 13;
  width: var(--instrument-layout-width, calc(100% - (var(--instrument-edge) * 2)));
  display: flex;
  flex-wrap: wrap;
  gap: var(--instrument-gap);
  align-items: flex-end;
  pointer-events: none;
  transform: scale(var(--instrument-scale)) scale(var(--instrument-user-scale));
  transform-origin: left bottom;
}

.instrument-settings-button {
  position: absolute;
  right: var(--overlay-edge);
  top: var(--overlay-top);
  z-index: 15;
  min-width: 106px;
  height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  border-color: rgba(112, 214, 255, 0.34);
  background: rgba(10, 15, 19, 0.92);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
}

.instrument-settings-panel {
  position: absolute;
  right: var(--overlay-edge);
  top: calc(var(--overlay-top) + 42px);
  z-index: 35;
  width: 260px;
  padding: 12px;
  border: 1px solid rgba(112, 214, 255, 0.34);
  border-radius: 10px;
  background: rgba(10, 15, 19, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.44);
}

.instrument-settings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.instrument-settings-top button {
  padding: 5px 7px;
  font-size: 11px;
}

.instrument-scale-control {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.instrument-scale-control label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 12px;
}

.instrument-scale-control output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.instrument-scale-control input {
  width: 100%;
  accent-color: var(--accent-2);
}

.instrument-settings-list {
  display: grid;
  gap: 7px;
}

.instrument-settings-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}

.instrument-card {
  width: 132px;
  padding: 8px 8px 9px;
  border: 1px solid rgba(112, 214, 255, 0.28);
  border-radius: 8px;
  background: rgba(10, 15, 19, 0.86);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  position: relative;
  user-select: none;
  will-change: transform;
  cursor: grab;
}

.instrument-card.dragging {
  z-index: 30;
  border-color: rgba(255, 216, 74, 0.72);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46);
  cursor: grabbing;
}

.airspeed-tape-card {
  order: 1;
}

.throttle-card {
  order: 2;
}

.altitude-tape-card {
  order: 3;
}

.garmin-g5-card {
  order: 4;
}

.heading-indicator-card {
  order: 5;
}

.combo-hsi-card {
  order: 6;
}

.vsi-card {
  order: 7;
}

.vor-card {
  order: 8;
}

.gps-fms-card {
  order: 9;
}

.radio-stack-card {
  order: 10;
}

.stopwatch-card {
  order: 11;
}

.autopilot-card {
  order: 12;
}

.landing-card {
  order: 13;
}

.instrument-card.instrument-hidden {
  display: none;
}

.instrument-title {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 4px;
}

.instrument-card.dragging .instrument-title {
  color: var(--accent);
}

.instrument-card :is(button, input, select, textarea, label, a, .instrument-knob, .gps-fms-list, .gps-waypoint-options, .throttle-slot) {
  cursor: auto;
}

.instrument-dial {
  width: 116px;
  height: 116px;
  display: block;
  cursor: grab;
  touch-action: none;
}

.instrument-dial:active {
  cursor: grabbing;
}

.instrument-bezel {
  fill: #090e12;
  stroke: #51616f;
  stroke-width: 2;
}

.instrument-dial .instrument-face {
  fill: #141c23;
  stroke: #25313b;
  stroke-width: 1;
}

.heading-card text,
.vsi-dial text,
.vor-dial text {
  fill: #dce8f1;
  font-size: 11px;
  font-weight: 700;
}

.heading-indicator-card,
.vor-card {
  width: 196px;
}

.garmin-g5-card {
  width: 500px;
}

.g-fife-hdg-knob,
.golf-fife-vs-knob,
.golf-fife-baro-knob,
.golf-fife-alt-knob {
  position: absolute;
  bottom: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid rgba(232, 238, 243, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.2), transparent 24%),
    radial-gradient(circle at 50% 55%, #26313b 0 38%, #111920 62%, #050708 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.05),
    inset 0 -8px 12px rgba(0, 0, 0, 0.46),
    0 4px 10px rgba(0, 0, 0, 0.55);
  color: var(--accent);
  cursor: ew-resize;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.g-fife-hdg-knob {
  left: 26px;
}

.golf-fife-alt-knob {
  left: 162px;
  right: auto;
}

.golf-fife-vs-knob {
  left: auto;
  right: 162px;
}

.golf-fife-baro-knob {
  right: 26px;
}

.g-fife-hdg-knob::before,
.golf-fife-vs-knob::before,
.golf-fife-baro-knob::before,
.golf-fife-alt-knob::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 4deg,
    rgba(255, 255, 255, 0.18) 0deg 4deg,
    transparent 4deg 13deg
  );
  opacity: 0.5;
}

.g-fife-hdg-knob span,
.golf-fife-vs-knob span,
.golf-fife-baro-knob span,
.golf-fife-alt-knob span {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.g-fife-hdg-knob:active,
.golf-fife-vs-knob:active,
.golf-fife-baro-knob:active,
.golf-fife-alt-knob:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.05),
    inset 0 6px 12px rgba(0, 0, 0, 0.55),
    0 2px 7px rgba(0, 0, 0, 0.5);
}

.garmin-g5-display {
  width: 472px;
  margin: 0 auto;
  border: 10px solid #050607;
  border-top-width: 12px;
  border-bottom-width: 46px;
  border-radius: 12px;
  background: #020304;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(0, 0, 0, 0.38);
}

.garmin-g5-svg {
  display: block;
  width: 100%;
  aspect-ratio: 46 / 40;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.g5-screen {
  fill: #05080d;
}

.g5-attitude-bezel {
  fill: #10161c;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}

.g5-sky {
  fill: #3476ff;
}

.g5-ground {
  fill: #8b4f08;
}

.g5-horizon-line {
  stroke: #f8f0a8;
  stroke-width: 3;
}

.g5-horizon-line.subtle {
  opacity: 0.72;
}

.g5-pitch-line,
.g5-tape-tick {
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 2;
  stroke-linecap: round;
}

.g5-tape-tick.minor,
.g5-vs-tick.minor {
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 1.4;
}

.g5-pitch-label,
.g5-heading-label,
.g5-tape-label {
  fill: #f4f7fb;
  font-size: 16px;
  font-weight: 850;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.42);
  stroke-width: 2px;
}

.g5-heading-window {
  fill: rgba(11, 18, 25, 0.8);
  stroke: rgba(255, 255, 255, 0.18);
}

.g5-heading-label {
  font-size: 13px;
  stroke-width: 1.5px;
}

.g5-heading-tick {
  stroke: #f4f7fb;
  stroke-width: 2;
}

.g5-heading-tick.minor {
  stroke: rgba(244, 247, 251, 0.68);
  stroke-width: 1.4;
}

.g5-scoreboard rect {
  fill: #050607;
}

.g5-scoreboard-text {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.58);
  stroke-width: 2px;
}

.g5-scoreboard-text.source,
.g5-scoreboard-text.armed {
  fill: #f6f8fb;
}

.g5-scoreboard-text.active {
  fill: #49e35f;
}

.g5-scoreboard-separator {
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 1;
}

.g5-heading-current-box,
.g5-value-box {
  fill: #040506;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1;
}

.g5-value-text {
  fill: #f8f8f8;
  font-size: 24px;
  font-weight: 900;
}

.g5-heading-current {
  fill: #f8f8f8;
  font-size: 21px;
  font-weight: 900;
}

.g5-heading-pointer {
  fill: #f8f8f8;
  stroke: rgba(0, 0, 0, 0.65);
  stroke-width: 1;
}

.g5-heading-bug {
  fill: #55e68a;
  stroke: #071018;
  stroke-width: 1;
  filter: drop-shadow(0 0 4px rgba(85, 230, 138, 0.48));
}

.g5-speed-tape,
.g5-altitude-tape {
  fill: rgba(22, 63, 198, 0.62);
  stroke: rgba(255, 255, 255, 0.16);
}

.g5-speed-band {
  fill: #40d180;
}

.g5-value-pointer {
  fill: #040506;
  stroke: rgba(255, 255, 255, 0.68);
  stroke-width: 1;
}

.g5-mini-label,
.g5-baro-text,
.g5-nav-label,
.g5-gs-label {
  fill: #66f4ff;
  font-size: 15px;
  font-weight: 900;
}

.g5-baro-box {
  fill: #040506;
  stroke: #5ff5ff;
  stroke-width: 1;
}

.g5-vs-reference-box rect {
  fill: #040506;
  stroke: #5ff5ff;
  stroke-width: 1;
}

.g5-vs-reference-box text {
  fill: #66f4ff;
  font-size: 18px;
  font-weight: 950;
}

.g5-vs-reference-box path {
  fill: #66f4ff;
  stroke: #071018;
  stroke-width: 1;
}

.g5-altitude-bug-window rect {
  fill: #050708;
  stroke: #66f4ff;
  stroke-width: 1;
}

.g5-altitude-bug-window text {
  fill: #66f4ff;
  font-size: 18px;
  font-weight: 950;
}

.g5-altitude-bug-window path,
.g5-altitude-bug-marker path {
  fill: #66f4ff;
  stroke: #071018;
  stroke-width: 1;
}

.g5-vs-rail {
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1.5;
}

.g5-vs-tick {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 2;
  stroke-linecap: round;
}

.g5-vs-label {
  fill: #f4f7fb;
  font-size: 16px;
  font-weight: 850;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.62);
  stroke-width: 3px;
}

.g5-vs-bug {
  fill: #66f4ff;
  stroke: #071018;
  stroke-width: 1;
  filter: drop-shadow(0 0 4px rgba(102, 244, 255, 0.46));
}

.g5-vs-current {
  fill: #f8f8f8;
  stroke: #071018;
  stroke-width: 1.2;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.55));
}

.g5-aircraft path {
  fill: #d8e33f;
  stroke: #071018;
  stroke-width: 2;
  stroke-linejoin: round;
}

.g5-aircraft rect {
  fill: #f8f8f8;
  stroke: #071018;
  stroke-width: 1;
}

.g5-deviation-backplate {
  fill: rgba(8, 13, 18, 0.48);
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 1;
}

.g5-cdi-dot,
.g5-gs-dot {
  fill: rgba(255, 255, 255, 0.72);
}

.g5-cdi-center,
.g5-gs-center {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2;
  stroke-linecap: round;
}

.g5-cdi-diamond,
.g5-gs-diamond {
  fill: #d946ef;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 1;
  filter: drop-shadow(0 0 4px rgba(217, 70, 239, 0.45));
}

.g5-localizer.source-nav .g5-cdi-diamond,
.g5-glideslope.source-nav .g5-gs-diamond {
  fill: #40e36f;
  filter: drop-shadow(0 0 4px rgba(64, 227, 111, 0.46));
}

.g5-heading-popup rect {
  fill: rgba(2, 5, 7, 0.96);
  stroke: rgba(160, 190, 205, 0.82);
  stroke-width: 2;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}

.g5-heading-popup-title {
  fill: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 850;
}

.g5-heading-popup-value {
  fill: #66f4ff;
  font-size: 30px;
  font-weight: 950;
}

.combo-hsi-card {
  width: 240px;
}

.combo-heading-readout {
  width: 92px;
  margin: 3px auto 5px;
  border: 1px solid rgba(220, 232, 241, 0.7);
  border-radius: 4px;
  background: #030609;
  color: #f2f2f2;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 18px;
  font-weight: 850;
  line-height: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.heading-indicator-dial,
.vor-dial {
  width: 180px;
  height: 180px;
}

.combo-hsi-dial {
  width: 220px;
  height: 220px;
}

.compass-rose text {
  fill: #f2f2f2;
  font-weight: 750;
  dominant-baseline: middle;
}

.rose-cardinal {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.rose-degree {
  font-size: 11px;
  font-weight: 650;
}

.rose-hashmarks line {
  stroke: rgba(220, 232, 241, 0.76);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.rose-hashmarks line.major {
  stroke: rgba(220, 232, 241, 0.88);
  stroke-width: 1.7;
}

.rose-hashmarks line.cardinal {
  stroke: #f2f2f2;
  stroke-width: 2.3;
}

.instrument-ticks line {
  stroke: #9fb0be;
  stroke-width: 2;
  stroke-linecap: round;
}

.cdi-reference-dots circle {
  fill: rgba(220, 232, 241, 0.78);
  stroke: rgba(3, 6, 9, 0.45);
  stroke-width: 0.5;
}

.vor-cdi-needle line {
  stroke: #d946ef;
  stroke-width: 3;
  stroke-linecap: round;
}

.vor-cdi-needle {
  filter: drop-shadow(0 0 4px rgba(217, 70, 239, 0.4));
}

.combo-course line,
.combo-cdi line {
  stroke: #d946ef;
  stroke-width: 3;
  stroke-linecap: round;
}

.combo-course path {
  fill: #d946ef;
}

.combo-vor-pointer line {
  stroke: #63d471;
  stroke-width: 4;
  stroke-linecap: round;
}

.combo-vor-pointer path,
.combo-vor-pointer circle {
  fill: #63d471;
  stroke: rgba(3, 6, 9, 0.75);
  stroke-width: 1;
}

.combo-hsi-card.cdi-vor .combo-course line,
.combo-hsi-card.cdi-vor .combo-cdi line {
  stroke: #63d471;
}

.combo-hsi-card.cdi-vor .combo-course path {
  fill: #63d471;
}

.combo-source-annunciation {
  fill: #d946ef;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(217, 70, 239, 0.45);
}

.combo-source-annunciation.nav-source {
  fill: #63d471;
  text-shadow: 0 0 4px rgba(99, 212, 113, 0.45);
}

.combo-aircraft {
  transform-origin: center;
}

.heading-bug path {
  fill: var(--accent);
  stroke: #1d1700;
  stroke-width: 1.2;
  filter: drop-shadow(0 0 4px rgba(255, 216, 74, 0.35));
}

.lubber-line {
  fill: #f4f4f4;
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 1;
}

.vor-course-index {
  fill: var(--accent);
  stroke: #1d1700;
  stroke-width: 1;
}

.instrument-knob {
  fill: #202a33;
  stroke: #f2f2f2;
  stroke-width: 2;
  cursor: ew-resize;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.45));
}

.knob-label {
  fill: var(--accent);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.aircraft-symbol {
  fill: rgba(112, 214, 255, 0.24);
  stroke: var(--accent-2);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.heading-aircraft {
  fill: #f4f4f4;
  stroke: rgba(0, 0, 0, 0.65);
  stroke-width: 1.8;
}

.vor-center {
  fill: #05090d;
  stroke: #f2f2f2;
  stroke-width: 2;
}

.vor-tofrom {
  fill: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.vor-tofrom.is-off {
  fill: var(--red);
  filter: drop-shadow(0 0 5px rgba(255, 77, 77, 0.45));
}

.nav-readout,
.nav-ident-readout {
  margin-top: 5px;
  border-radius: 6px;
  background: #05090d;
  color: var(--muted);
  font-size: 11px;
  line-height: 22px;
  text-align: center;
}

.radio-stack-card {
  width: 310px;
}

.radio-row {
  display: grid;
  grid-template-columns: 42px 1fr 1fr 44px;
  gap: 5px;
  align-items: center;
  margin-top: 5px;
}

.radio-header {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.radio-row b {
  color: var(--accent-2);
  font-size: 11px;
}

.radio-row input,
.radio-actions input {
  min-width: 0;
  border: 1px solid rgba(112, 214, 255, 0.22);
  border-radius: 6px;
  background: #05090d;
  color: var(--text);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 12px;
  padding: 5px 6px;
}

.radio-row input.active-frequency {
  border-color: rgba(255, 216, 74, 0.26);
  background: #030609;
  color: var(--accent);
  cursor: default;
}

.radio-row input.active-frequency:focus {
  outline: none;
  box-shadow: none;
}

.radio-row button,
.radio-actions button,
.ap-buttons button {
  padding: 5px 7px;
  font-size: 11px;
}

.radio-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  align-items: center;
  margin-top: 8px;
}

.autopilot-card {
  width: 214px;
}

.landing-card {
  width: 238px;
}

.ap-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.landing-environment-status {
  border: 1px solid rgba(149, 163, 177, 0.26);
  border-radius: 6px;
  background: rgba(5, 9, 13, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  min-height: 42px;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
}

.landing-environment-status.approach-lights {
  border-color: rgba(255, 193, 7, 0.45);
  color: #ffd84a;
  background: rgba(255, 193, 7, 0.08);
}

.landing-environment-status.runway-visible,
.landing-environment-status.landed {
  border-color: rgba(80, 227, 194, 0.45);
  color: var(--green);
  background: rgba(80, 227, 194, 0.08);
}

.landing-minimums-readout {
  margin-top: 8px;
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.landing-minimums-readout.hidden {
  display: none;
}

.landing-actions {
  display: grid;
  grid-template-columns: 1.45fr 0.7fr;
  gap: 7px;
  margin-top: 8px;
}

.landing-actions button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.15;
}

.ap-buttons button.active,
.radio-actions button.active {
  color: #071018;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35);
  transform: translateY(1px);
}

.landing-actions button.active {
  color: #06130c;
  background: var(--green);
  border-color: rgba(131, 225, 127, 0.9);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
  transform: translateY(1px);
}

.obs-field {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.obs-field input {
  min-width: 0;
  border: 1px solid rgba(112, 214, 255, 0.22);
  border-radius: 6px;
  background: #05090d;
  color: var(--text);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 12px;
  padding: 5px 6px;
}

.vsi-arc {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.82;
}

.vsi-arc.climb {
  stroke: var(--green);
}

.vsi-arc.descend {
  stroke: var(--orange);
}

.vsi-label {
  stroke: #141c23;
  stroke-width: 3px;
  paint-order: stroke fill;
  stroke-linejoin: round;
}

.vsi-needle line {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}

.vsi-needle circle {
  fill: var(--accent);
  stroke: #1d1700;
  stroke-width: 1;
}

.instrument-readout {
  margin-top: 4px;
  border-radius: 6px;
  background: #05090d;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
}

.combo-hsi-actions {
  display: grid;
  grid-template-columns: 1fr 68px 1fr;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.combo-hsi-actions button {
  padding: 5px 6px;
  font-size: 11px;
  color: #071018;
  background: #d946ef;
  border-color: #d946ef;
}

.combo-hsi-card.cdi-vor .combo-hsi-actions button {
  background: #63d471;
  border-color: #63d471;
}

.combo-hsi-readout,
.combo-course-field {
  border-radius: 6px;
  background: #05090d;
  color: var(--accent);
  font-size: 11px;
  line-height: 24px;
  text-align: center;
}

.combo-course-field {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  padding-left: 6px;
  color: var(--muted);
}

.combo-course-field input {
  min-width: 0;
  width: 100%;
  height: 24px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--accent);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  padding: 0 6px 0 0;
}

.combo-distance-readout {
  margin-top: 6px;
  border-radius: 6px;
  background: #05090d;
  color: var(--accent-2);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 800;
  line-height: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.gps-fms-card {
  width: 320px;
  height: 320px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.gps-fms-resize-handle {
  position: absolute;
  top: -7px;
  left: 36px;
  right: 36px;
  height: 14px;
  cursor: ns-resize;
  touch-action: none;
}

.gps-fms-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 68px;
  height: 3px;
  border-radius: 999px;
  background: rgba(112, 214, 255, 0.42);
  box-shadow: 0 0 10px rgba(112, 214, 255, 0.16);
  transform: translateX(-50%);
}

.gps-fms-resize-handle:hover::before {
  background: var(--accent);
}

.gps-fms-status {
  padding: 7px 8px;
  border-radius: 7px;
  background: #05090d;
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1.3;
}

.gps-fms-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin: 8px 0 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.gps-fms-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  width: 100%;
  min-height: 60px;
  padding: 7px 8px 7px 22px;
  border: 1px solid rgba(220, 232, 241, 0.16);
  border-radius: 5px;
  background: linear-gradient(#5f5a55, #3c3835);
  color: #ecebe7;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.gps-fms-row:hover,
.gps-fms-row.selected {
  border-color: rgba(93, 213, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(93, 213, 255, 0.36);
}

.gps-fms-gap {
  display: block;
  width: 100%;
  height: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gps-fms-gap span {
  display: none;
}

.gps-fms-gap.selected span {
  display: block;
  width: 100%;
  content: "";
  height: 2px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(93, 213, 255, 0.55);
}

.gps-fms-row.active {
  border-color: rgba(217, 70, 239, 0.95);
  background: linear-gradient(#b62aa5, #8f217e);
  box-shadow: inset 0 0 0 1px rgba(255, 216, 255, 0.22);
}

.gps-fms-row.selected,
.gps-fms-row.active.selected {
  border-color: rgba(93, 213, 255, 0.95);
  background: linear-gradient(#31596a, #1b3540);
  box-shadow:
    inset 0 0 0 2px rgba(93, 213, 255, 0.6),
    0 0 0 1px rgba(93, 213, 255, 0.28);
}

.gps-fms-row.active.selected {
  background: linear-gradient(#b62aa5, #8f217e);
}

.gps-fms-row.selected::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(93, 213, 255, 0.72);
}

.gps-fms-leg {
  color: #8ee6c4;
  font-weight: 850;
}

.gps-fms-ident {
  grid-column: 1;
  color: #f4f4f4;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.gps-fms-meta {
  color: #d8d7d2;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.gps-fms-edit {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 54px 50px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.gps-fms-edit input,
.gps-procedure-select {
  min-width: 0;
  border: 1px solid rgba(220, 232, 241, 0.18);
  border-radius: 6px;
  background: #05090d;
  color: #e5edf4;
  padding: 6px 7px;
  font-size: 12px;
}

.gps-fms-edit button {
  padding: 6px 6px;
  font-size: 11px;
}

.gps-waypoint-options {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 40;
  width: min(290px, 100%);
  max-height: 240px;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgba(112, 214, 255, 0.34);
  border-radius: 7px;
  background: #11151a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.gps-waypoint-option {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.gps-waypoint-option:hover,
.gps-waypoint-option:focus {
  background: rgba(112, 214, 255, 0.16);
}

.gps-waypoint-option strong {
  color: var(--text);
  font-size: 13px;
}

.gps-waypoint-option span {
  color: var(--muted);
  font-size: 11px;
}

.gps-waypoint-option.muted {
  color: var(--muted);
}

.gps-fms-knob {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0 !important;
  border-radius: 50%;
  border: 2px solid #f2f2f2;
  background: radial-gradient(circle at 35% 30%, #273340, #071017 68%);
  color: var(--accent);
  cursor: ew-resize;
  font-size: 9px !important;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.gps-fms-message {
  min-height: 17px;
  margin-top: 5px;
  color: rgba(201, 222, 235, 0.76);
  font-size: 11px;
  font-weight: 750;
}

.gps-fms-message.error {
  color: #ff9b9b;
}

.gps-fms-message.ok {
  color: #9effae;
}

.gps-fms-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.gps-fms-actions button {
  padding: 6px 7px;
  font-size: 12px;
}

.gps-procedure-select {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 48px;
  z-index: 45;
  width: auto;
  margin-top: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.stopwatch-card {
  width: 132px;
  padding: 7px 8px 8px;
}

.stopwatch-readout {
  margin-top: 4px;
  border: 1px solid rgba(255, 216, 74, 0.28);
  border-radius: 6px;
  background: #05090d;
  color: var(--accent);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  line-height: 31px;
  text-align: center;
}

.stopwatch-scale {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.stopwatch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}

.stopwatch-actions button {
  padding: 5px 6px;
  font-size: 11px;
}

.airspeed-tape-card {
  width: 166px;
}

.airspeed-tape-svg {
  width: 130px;
  height: 260px;
  display: block;
  margin: 0 auto;
}

.airspeed-tape-frame {
  fill: #143b9d;
  stroke: #dce8f1;
  stroke-width: 1.2;
}

.airspeed-speed-band {
  fill: rgba(58, 210, 87, 0.72);
}

.airspeed-tick {
  stroke: rgba(242, 242, 242, 0.74);
  stroke-width: 1.2;
}

.airspeed-tick.major {
  stroke-width: 1.8;
}

.airspeed-tick-label {
  fill: rgba(242, 242, 242, 0.78);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 17px;
  font-weight: 750;
}

.airspeed-current-box {
  fill: #030609;
  stroke: rgba(220, 232, 241, 0.9);
  stroke-width: 1;
}

.airspeed-current-text {
  fill: #f2f2f2;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 24px;
  font-weight: 850;
  dominant-baseline: middle;
}

.throttle-card {
  width: 138px;
}

.throttle-slot {
  position: relative;
  width: 88px;
  height: 210px;
  margin: 10px auto 8px;
}

.throttle-slot input {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 88px;
  height: 210px;
  opacity: 0;
  cursor: ns-resize;
  writing-mode: vertical-lr;
  direction: rtl;
}

.throttle-rail {
  position: absolute;
  left: 39px;
  top: 12px;
  width: 10px;
  height: 186px;
  border-radius: 8px;
  background: linear-gradient(#24313b, #06090c);
  border: 1px solid rgba(220, 232, 241, 0.22);
}

.throttle-knob-visual {
  position: absolute;
  left: 13px;
  top: 132px;
  width: 62px;
  height: 44px;
  border-radius: 16px 16px 11px 11px;
  background: linear-gradient(#f4f5f4, #8f989f);
  border: 2px solid rgba(3, 6, 9, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 8px 12px rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.throttle-knob-visual::after {
  content: "THR";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #071018;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.altitude-tape-card {
  width: 166px;
}

.altitude-tape-shell {
  position: relative;
  width: 150px;
  margin: 0 auto;
}

.altitude-tape-svg {
  width: 150px;
  height: 300px;
  display: block;
  margin: 0 auto;
}

.altitude-bug-window {
  position: absolute;
  top: 4px;
  left: 28px;
  z-index: 2;
  display: grid;
  grid-template-columns: 13px 1fr;
  align-items: center;
  width: 88px;
  height: 28px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 216, 74, 0.75);
  background: #030609;
}

.altitude-bug-chevron {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid var(--accent);
}

.altitude-bug-window input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--accent);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 0 6px 0 0;
}

.altitude-tape-frame {
  fill: #203b82;
  stroke: #dce8f1;
  stroke-width: 1.2;
}

.altitude-tick {
  stroke: rgba(220, 232, 241, 0.72);
  stroke-width: 1.2;
}

.altitude-tick.major {
  stroke-width: 1.8;
}

.altitude-tick-label {
  fill: rgba(242, 242, 242, 0.72);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
}

.altitude-current-box,
.altimeter-window {
  fill: #030609;
  stroke: rgba(220, 232, 241, 0.9);
  stroke-width: 1;
}

.altitude-current-text {
  fill: #f2f2f2;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 20px;
  font-weight: 800;
  dominant-baseline: middle;
}

.altitude-bug-marker path {
  fill: var(--accent);
  stroke: #1d1700;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.glidepath-indicator.hidden {
  display: none;
}

.glidepath-rail {
  fill: rgba(3, 6, 9, 0.82);
  stroke: rgba(112, 214, 255, 0.3);
  stroke-width: 1;
}

.glidepath-label-box {
  fill: rgba(3, 6, 9, 0.9);
  stroke: rgba(99, 212, 113, 0.72);
  stroke-width: 1;
}

.glidepath-label {
  fill: #63d471;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 900;
  dominant-baseline: middle;
}

.glidepath-center {
  stroke: rgba(220, 232, 241, 0.88);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.glidepath-dot {
  fill: rgba(220, 232, 241, 0.85);
}

.glidepath-marker path {
  fill: #63d471;
  stroke: rgba(3, 6, 9, 0.8);
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(99, 212, 113, 0.5));
}

.altimeter-setting {
  fill: #39f5ff;
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 800;
  dominant-baseline: middle;
}

.voice-expectation-overlay {
  position: absolute;
  top: var(--overlay-top);
  right: var(--overlay-edge);
  z-index: 16;
  width: min(460px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid rgba(255, 216, 74, 0.58);
  border-radius: 8px;
  background: rgba(12, 15, 18, 0.96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
}

.voice-overlay-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--accent);
}

.voice-overlay-top span {
  color: var(--muted);
  font-size: 12px;
}

.voice-overlay-expected {
  margin-top: 8px;
  padding: 9px;
  border-radius: 7px;
  background: rgba(255, 216, 74, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.voice-overlay-input {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.voice-overlay-input input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070b0f;
  color: var(--text);
  padding: 8px 9px;
}

.voice-overlay-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
  flex-wrap: wrap;
}

.voice-overlay-actions button {
  padding: 7px 9px;
  font-size: 12px;
}

.voice-overlay-actions button:nth-child(2) {
  color: #061016;
  background: var(--blue);
  border-color: var(--blue);
}

.voice-overlay-actions button.recording {
  color: #1b0707;
  background: var(--red);
  border-color: var(--red);
}

.voice-overlay-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.voice-overlay-actions button:last-child {
  color: #161400;
  background: var(--accent);
  border-color: var(--accent);
}

.student-preview-mode #voiceOverlayBypassButton {
  display: none;
}

.voice-overlay-mic-status {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.voice-overlay-mic-status.ok {
  color: var(--green);
}

.voice-overlay-mic-status.error {
  color: var(--red);
}

.push-to-talk-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 9px 10px;
  border: 1px solid rgba(112, 214, 255, 0.42);
  border-radius: 8px;
  background: rgba(7, 11, 15, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.push-to-talk-panel.hidden {
  display: none;
}

.push-to-talk-panel .push-to-talk-button {
  box-sizing: border-box;
  flex: 0 0 174px;
  width: 174px;
  min-width: 174px;
  color: #031016;
  background: #70d6ff;
  border-color: #9de5ff;
  font-weight: 800;
  text-align: center;
  text-shadow: none;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset, 0 8px 18px rgba(112, 214, 255, 0.18);
}

.push-to-talk-panel .push-to-talk-button:hover:not(:disabled) {
  color: #031016;
  background: #9de5ff;
  border-color: #c8f1ff;
}

.push-to-talk-panel .push-to-talk-button.recording {
  color: #031016;
  background: #3fb8e6;
  border-color: #70d6ff;
  transform: translateY(2px);
  box-shadow: 0 0 0 2px rgba(3, 16, 22, 0.34) inset, 0 2px 7px rgba(112, 214, 255, 0.12);
}

.push-to-talk-panel .push-to-talk-button:disabled {
  color: #d9f5ff;
  background: #172936;
  border-color: rgba(112, 214, 255, 0.62);
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

.student-preview-panel {
  position: absolute;
  left: 18px;
  top: calc(var(--overlay-top) + 2px);
  z-index: 14;
  width: min(560px, calc(100% - 36px));
  max-height: min(46vh, 420px);
  overflow: hidden;
  border: 1px solid rgba(112, 214, 255, 0.35);
  border-radius: 10px;
  background: rgba(9, 13, 17, 0.92);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.34);
  padding: 14px;
  transition:
    width 180ms ease,
    max-height 180ms ease,
    padding 180ms ease,
    background-color 180ms ease;
}

.student-preview-panel.collapsed {
  width: min(540px, calc(100% - 36px));
  max-height: 48px;
  padding: 8px 10px;
  background: rgba(9, 13, 17, 0.88);
}

.student-preview-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.student-preview-top > div:first-child {
  min-width: 0;
}

.student-preview-top h3 {
  margin: 2px 0 0;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-preview-meta,
.student-preview-progress {
  color: var(--muted);
  font-size: 12px;
}

.student-preview-progress {
  color: var(--accent);
}

.student-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.student-preview-toggle {
  padding: 4px 7px;
  font-size: 11px;
}

.student-preview-instruction,
.student-preview-atc,
.student-preview-voice,
.student-preview-result {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  line-height: 1.38;
}

.student-preview-instruction {
  background: rgba(255, 255, 255, 0.06);
}

.student-preview-atc {
  border: 1px solid rgba(112, 214, 255, 0.28);
  background: rgba(112, 214, 255, 0.1);
}

.student-preview-voice {
  border: 1px solid rgba(255, 216, 74, 0.28);
  background: rgba(255, 216, 74, 0.1);
}

.student-preview-result.succeeded {
  color: var(--green);
  background: rgba(131, 225, 127, 0.1);
}

.student-preview-result.failed {
  color: var(--red);
  background: rgba(255, 111, 111, 0.1);
}

.student-preview-panel.collapsed .student-preview-top {
  align-items: center;
}

.student-preview-panel.collapsed .student-preview-top > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.student-preview-panel.collapsed .student-preview-top h3 {
  margin: 0;
  font-size: 13px;
}

.student-preview-panel.collapsed .student-preview-meta {
  flex: 0 0 auto;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-preview-panel.collapsed .student-preview-instruction,
.student-preview-panel.collapsed .student-preview-atc,
.student-preview-panel.collapsed .student-preview-voice,
.student-preview-panel.collapsed .student-preview-result {
  display: none;
}

.student-preview-mode #saveButton,
.student-preview-mode #saveTaxonomyButton,
.student-preview-mode #curriculumTab,
.student-preview-mode .lower,
.student-preview-mode .simulation-overlay,
.student-preview-mode .caption-overlay {
  display: none;
}

.student-preview-mode .workspace {
  grid-template-rows: minmax(0, 1fr);
}

.student-preview-mode .voice-overlay-expected {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.lesson-result-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lesson-result-modal.hidden {
  display: none;
}

.lesson-result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
}

.lesson-result-card {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100vw - 48px));
  border: 1px solid rgba(112, 214, 255, 0.34);
  border-radius: 12px;
  background: #10171d;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  padding: 34px;
  text-align: center;
}

.lesson-result-card.succeeded {
  border-color: rgba(80, 227, 194, 0.65);
  background: linear-gradient(180deg, rgba(22, 48, 42, 0.98), rgba(12, 22, 24, 0.98));
}

.lesson-result-card.failed {
  border-color: rgba(255, 111, 111, 0.7);
  background: linear-gradient(180deg, rgba(54, 22, 27, 0.98), rgba(18, 18, 22, 0.98));
}

.lesson-result-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lesson-result-card.succeeded .lesson-result-kicker {
  color: var(--green);
}

.lesson-result-card.failed .lesson-result-kicker {
  color: #ff9a9a;
}

.lesson-result-card h2 {
  margin: 12px 0 10px;
  color: var(--text);
  font-size: 46px;
  line-height: 1;
}

.lesson-result-card p {
  margin: 0 auto 24px;
  max-width: 44ch;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

.lesson-result-card button {
  min-width: 140px;
  border-color: transparent;
  background: var(--accent);
  color: #071018;
  font-weight: 800;
}

.lesson-result-card.failed button {
  background: #ff9a9a;
}

.lesson-result-confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.lesson-result-confetti span {
  position: absolute;
  left: var(--x);
  top: -24px;
  width: 9px;
  height: 16px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
  transform: translateX(0) rotate(var(--rotate));
  animation: result-confetti-fall var(--duration) var(--delay) ease-in forwards;
}

@keyframes result-confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -30px, 0) rotate(var(--rotate));
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0.95;
    transform: translate3d(var(--drift), calc(100vh + 60px), 0) rotate(calc(var(--rotate) + 540deg));
  }
}

.surrogate-panel {
  position: absolute;
  right: var(--overlay-edge);
  bottom: var(--overlay-edge);
  width: min(var(--surrogate-panel-width), calc(100% - (var(--overlay-edge) * 2)));
  max-height: var(--surrogate-panel-max-height);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 21, 26, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
  padding: 12px;
  z-index: 12;
}

.surrogate-header,
.surrogate-actions,
.surrogate-checks {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.surrogate-header {
  justify-content: space-between;
  margin-bottom: 10px;
}

.surrogate-header span,
.surrogate-lesson-status {
  color: var(--muted);
  font-size: 12px;
}

.surrogate-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(180px, 1.4fr);
  gap: 8px;
  align-items: end;
}

.surrogate-grid label,
.surrogate-checks label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.surrogate-checks label {
  grid-auto-flow: column;
  align-items: center;
}

.surrogate-grid input,
.surrogate-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f151a;
  color: var(--text);
  padding: 7px 8px;
}

.surrogate-position-summary {
  align-self: stretch;
  display: flex;
  align-items: center;
  min-height: 33px;
  padding: 7px 8px;
  border: 1px solid rgba(112, 214, 255, 0.18);
  border-radius: 7px;
  background: rgba(5, 9, 13, 0.86);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.surrogate-hidden-controls {
  display: none;
}

.surrogate-checks,
.surrogate-actions {
  margin-top: 10px;
}

.surrogate-lesson-status {
  margin-top: 8px;
  line-height: 1.4;
}

.lower {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, var(--timeline-width)) var(--splitter-size) minmax(260px, 1fr);
}

.resize-handle {
  position: relative;
  z-index: 5;
  background: #151b21;
  transition: background 120ms ease;
}

.sidebar-collapse-button {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 2;
  width: 22px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  transform: translateX(-50%);
  color: var(--accent);
  background: #10171d;
  border-color: rgba(112, 214, 255, 0.34);
  font-size: 20px;
  line-height: 1;
}

.resize-handle.sidebar-collapsed {
  cursor: default;
  background: #111820;
}

.resize-handle.sidebar-collapsed::after {
  display: none;
}

.resize-handle.sidebar-collapsed .sidebar-collapse-button {
  top: 12px;
}

.resize-handle::after {
  content: "";
  position: absolute;
  background: var(--line-soft);
}

.resize-handle-vertical {
  cursor: col-resize;
}

.resize-handle-vertical::after {
  top: 0;
  bottom: 0;
  left: calc((var(--splitter-size) - 1px) / 2);
  width: 1px;
}

.resize-handle-horizontal {
  cursor: row-resize;
}

.resize-handle-horizontal::after {
  left: 0;
  right: 0;
  top: calc((var(--splitter-size) - 1px) / 2);
  height: 1px;
}

.resize-handle:hover,
.resize-handle.resizing {
  background: rgba(112, 214, 255, 0.16);
}

body.resizing-pane {
  user-select: none;
  cursor: col-resize;
}

body.resizing-pane.resizing-row {
  cursor: row-resize;
}

.timeline-panel {
  border-right: 1px solid var(--line-soft);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-actions button {
  padding: 5px 9px;
  font-size: 12px;
}

.sim-speed {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.sim-speed select {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #10161c;
  padding: 4px 7px;
  font-size: 12px;
}

.timeline {
  overflow: auto;
  padding: 12px;
}

.step {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: #161d23;
  cursor: pointer;
}

.step[draggable="true"] {
  cursor: grab;
}

.step.dragging {
  opacity: 0.45;
}

.step.drop-target {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent-2);
}

.step.locked {
  opacity: 0.75;
}

.step.active {
  border-color: var(--accent);
  background: #24251a;
}

.step.sim-active-step {
  border-color: var(--accent-2);
  background: #172833;
  box-shadow: inset 4px 0 0 var(--accent-2);
}

.step.sim-active-step .top span {
  color: var(--accent-2);
}

.step.local-active-step {
  border-color: var(--green);
  background: #172719;
  box-shadow: inset 4px 0 0 var(--green);
}

.step.local-active-step .top span {
  color: var(--green);
}

.step.background {
  border-left: 4px solid var(--violet);
}

.step .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
}

.step .trigger {
  color: var(--accent-2);
  font-size: 12px;
  margin-top: 6px;
}

.step .speech {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.35;
}

.editor-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.inspector {
  overflow: auto;
  padding: 14px;
}

.inspector.empty {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.editor-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.danger-button {
  border-color: rgba(255, 111, 111, 0.55);
  color: #ffd1d1;
}

.taxonomy-note {
  grid-column: 1 / -1;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  background: #141b21;
  font-size: 12px;
  line-height: 1.4;
}

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #10161c;
  color: var(--text);
  padding: 9px;
  min-width: 0;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.json-box {
  min-height: 420px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.dirty {
  color: #141414;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}

.hidden {
  display: none;
}

.pin-start {
  fill: var(--green);
  stroke: #07110a;
  stroke-width: 2;
  cursor: grab;
}

.pin-trigger {
  fill: var(--accent);
  stroke: #231f00;
  stroke-width: 2;
  cursor: grab;
}

.pin-fix {
  fill: var(--map-bg);
  stroke: rgba(112, 214, 255, 0.95);
  stroke-width: 2.5;
  cursor: grab;
}

.pin-protected {
  fill: var(--orange);
  stroke: #1d1000;
  stroke-width: 2;
  cursor: grab;
}

.pin-selected {
  stroke: white;
  stroke-width: 3;
}

.pin-sim-active {
  stroke: var(--accent-2);
  stroke-width: 4;
}

.sim-pulse {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2;
  stroke-dasharray: 4 4;
  opacity: 0.9;
}

.sim-aircraft-halo {
  fill: rgba(112, 214, 255, 0.15);
  stroke: rgba(112, 214, 255, 0.45);
  stroke-width: 1.5;
}

.sim-aircraft-body {
  fill: var(--accent-2);
  stroke: #071820;
  stroke-width: 2;
}

.ring {
  fill: none;
  stroke: rgba(255, 216, 74, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.runway {
  stroke: rgba(232, 237, 242, 0.9);
  stroke-width: 12;
  stroke-linecap: round;
}

.runway-centerline {
  stroke: rgba(13, 19, 24, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 8 7;
}

.runway-end {
  fill: var(--map-bg);
  stroke: rgba(232, 237, 242, 0.9);
  stroke-width: 1.5;
}

.radial {
  stroke: rgba(112, 214, 255, 0.75);
  stroke-width: 2;
  stroke-linecap: round;
}

.radial-buffer {
  stroke: rgba(112, 214, 255, 0.32);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 8 6;
}

.heading {
  stroke: rgba(131, 225, 127, 0.75);
  stroke-width: 2;
  stroke-linecap: round;
}

.sim-active-geometry {
  stroke: var(--accent-2);
  stroke-width: 3;
  opacity: 1;
}

.sim-path-shadow {
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 8;
  stroke-linecap: round;
}

.sim-path {
  stroke: var(--accent-2);
  stroke-width: 3;
  stroke-linecap: round;
}

.sim-odp-path {
  stroke-dasharray: 14 8;
}

.sim-heading-path {
  stroke: rgba(131, 225, 127, 0.95);
}

.sim-wait-path {
  stroke: rgba(255, 216, 74, 0.95);
  stroke-dasharray: 9 7;
}

.sim-turn-path {
  stroke: rgba(255, 216, 74, 0.95);
  stroke-dasharray: 9 7;
}

.sim-intercept-path {
  stroke: rgba(112, 214, 255, 0.95);
  stroke-dasharray: 16 5 4 5;
}

.sim-radial-path {
  stroke: rgba(255, 122, 122, 0.95);
  stroke-dasharray: 10 5;
}

.sim-path-target {
  fill: var(--accent-2);
  stroke: var(--map-bg);
  stroke-width: 3;
}

.sim-heading-target {
  fill: rgba(131, 225, 127, 0.95);
}

.sim-wait-target {
  fill: rgba(255, 216, 74, 0.95);
}

.sim-turn-target {
  fill: rgba(255, 216, 74, 0.95);
}

.sim-intercept-target {
  fill: rgba(112, 214, 255, 0.95);
}

.sim-radial-target {
  fill: rgba(255, 122, 122, 0.95);
}

.sim-path-label {
  fill: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--map-bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.sim-heading-label {
  fill: rgba(131, 225, 127, 0.95);
}

.sim-wait-label {
  fill: rgba(255, 216, 74, 0.95);
}

.sim-turn-label {
  fill: rgba(255, 216, 74, 0.95);
}

.sim-intercept-label {
  fill: rgba(112, 214, 255, 0.95);
}

.sim-radial-label {
  fill: rgba(255, 122, 122, 0.95);
}

.sim-path-group.past {
  opacity: 0.58;
}

.map-label {
  fill: var(--text);
  font-size: 12px;
  paint-order: stroke;
  stroke: var(--map-bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.gps-leg {
  stroke: rgba(217, 70, 239, 0.52);
  stroke-width: 2.4;
  stroke-dasharray: 8 6;
  fill: none;
}

.gps-leg.active {
  stroke: #d946ef;
  stroke-width: 3.4;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 6px rgba(217, 70, 239, 0.5));
}

.gps-waypoint {
  fill: #d946ef;
  stroke: #090e12;
  stroke-width: 2;
}

.gps-label {
  fill: #f0c8ff;
}

.scale-label {
  fill: var(--text);
  font-size: 12px;
  paint-order: stroke;
  stroke: var(--map-bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.scale-line {
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: square;
}

.scale-tick {
  stroke: var(--text);
  stroke-width: 2;
}

.simulation-overlay {
  position: absolute;
  right: 14px;
  top: var(--overlay-top);
  width: min(380px, calc(100% - 28px));
  pointer-events: none;
}

.sim-card {
  border: 1px solid rgba(112, 214, 255, 0.5);
  border-radius: 8px;
  background: rgba(13, 19, 24, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 12px;
  color: var(--text);
  pointer-events: auto;
}

.sim-card.voice {
  border-color: rgba(255, 216, 74, 0.65);
}

.sim-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.sim-card-top strong {
  color: var(--accent-2);
  text-transform: none;
}

.sim-card.voice .sim-card-top strong {
  color: var(--accent);
}

.sim-step-id {
  margin-top: 5px;
  font-weight: 650;
  font-size: 14px;
}

.sim-instruments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.sim-instrument {
  border: 1px solid rgba(157, 170, 181, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px;
  min-width: 0;
}

.sim-instrument .instrument-face {
  position: relative;
  width: 66px;
  height: 66px;
  margin: 0 auto 7px;
  border: 2px solid rgba(232, 237, 242, 0.82);
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(112, 214, 255, 0.18), transparent 45%),
    rgba(13, 19, 24, 0.86);
}

.sim-instrument .instrument-face span {
  position: absolute;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.sim-instrument .instrument-face span:nth-child(2) {
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.sim-instrument .instrument-face span:nth-child(3) {
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}

.sim-instrument .instrument-face span:nth-child(4) {
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.sim-instrument .instrument-face span:nth-child(5) {
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
}

.sim-instrument .heading-bug {
  position: absolute;
  inset: 7px;
  transform-origin: center;
}

.sim-instrument .heading-bug::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 15px solid var(--accent-2);
}

.altitude-tape {
  display: grid;
  place-items: center;
  height: 66px;
  margin-bottom: 7px;
  border: 2px solid rgba(232, 237, 242, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 46%, rgba(112, 214, 255, 0.2) 46%, rgba(112, 214, 255, 0.2) 54%, transparent 54%),
    repeating-linear-gradient(180deg, rgba(232, 237, 242, 0.18) 0 1px, transparent 1px 11px),
    rgba(13, 19, 24, 0.86);
}

.altitude-tape strong {
  font-size: 18px;
  color: var(--text);
}

.altitude-tape span {
  margin-top: -8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.instrument-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.instrument-readout b {
  color: var(--muted);
  font-size: 10px;
}

.instrument-readout strong {
  color: var(--accent-2);
  font-size: 13px;
  white-space: nowrap;
}

.sim-line {
  margin-top: 8px;
  display: grid;
  gap: 3px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.sim-line b {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.sim-pilot-example {
  border: 1px solid rgba(255, 216, 74, 0.32);
  border-radius: 7px;
  background: rgba(255, 216, 74, 0.08);
  padding: 9px;
}

.sim-pilot-example.waiting {
  border-color: rgba(157, 170, 181, 0.32);
  background: rgba(157, 170, 181, 0.08);
  color: var(--muted);
}

.sim-page-actions {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.sim-page-actions button {
  padding: 4px 8px;
  font-size: 11px;
}

.sim-value-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.sim-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 12px;
}

.sim-progress span {
  display: block;
  height: 100%;
  background: var(--accent-2);
}

.caption-overlay {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 36px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.caption-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.caption-line span {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #10161c;
}

.caption-line.atc span {
  background: var(--accent-2);
}

.caption-line.pilot span {
  background: var(--accent);
}

.caption-line p {
  margin: 0;
  color: white;
  font-size: 16px;
  line-height: 1.35;
  text-shadow: 0 1px 2px black;
}

@media (max-height: 900px), (max-width: 1440px) {
  :root {
    --topbar-height: 62px;
    --topbar-pad-x: 16px;
    --sidebar-width: 300px;
    --map-height: 72%;
    --map-min-height: 230px;
    --timeline-width: 45%;
    --panel-header-min-height: 52px;
    --panel-header-pad-y: 10px;
    --panel-header-pad-x: 12px;
    --splitter-size: 6px;
    --instrument-scale: 0.68;
    --instrument-edge: 12px;
    --instrument-gap: 8px;
    --overlay-top: 62px;
    --overlay-edge: 12px;
    --surrogate-panel-width: 420px;
    --surrogate-panel-max-height: min(40%, 280px);
    --voice-settings-top: 68px;
  }

  h1 {
    font-size: 19px;
  }

  h2 {
    font-size: 15px;
  }

  button {
    padding: 7px 10px;
  }

  .topbar .actions {
    gap: 8px;
  }

  .status {
    max-width: min(28vw, 320px);
  }

  #saveTaxonomyButton:disabled,
  #saveButton:disabled {
    display: none;
  }

  .mode-switch button {
    padding: 5px 8px;
  }

  .sidebar-tabs {
    gap: 6px;
    padding: 10px 10px 0;
  }

  .search,
  .taxonomy-actions {
    padding: 12px;
  }

  .lesson-list,
  .taxonomy-list {
    padding: 0 8px 12px;
  }

  .lesson-row {
    margin: 6px 0 6px 10px;
    width: calc(100% - 10px);
  }

  .lesson-row-main {
    padding: 9px 10px;
  }

  .lesson-row .title {
    font-size: 12px;
  }

  .panel-header,
  .map-tools,
  .timeline-actions {
    gap: 8px;
  }

  .instrument-settings-button {
    min-width: 94px;
    height: 31px;
    padding: 5px 9px;
  }

  .voice-expectation-overlay,
  .student-preview-panel,
  .surrogate-panel,
  .sim-card {
    padding: 10px;
  }

  .student-preview-panel {
    width: min(500px, calc(100% - 24px));
  }

  .student-preview-top h3 {
    font-size: 16px;
  }

  .caption-overlay {
    bottom: 12px;
    gap: 6px;
  }

  .caption-line {
    padding: 8px 10px;
  }

  .caption-line p {
    font-size: 14px;
  }

  .push-to-talk-panel {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }
}

@media (max-height: 760px), (max-width: 1280px) {
  :root {
    --topbar-height: 54px;
    --topbar-pad-x: 12px;
    --sidebar-width: 276px;
    --map-height: 73%;
    --map-min-height: 190px;
    --timeline-width: 42%;
    --panel-header-min-height: 44px;
    --panel-header-pad-y: 8px;
    --panel-header-pad-x: 10px;
    --splitter-size: 5px;
    --instrument-scale: 0.6;
    --instrument-edge: 10px;
    --instrument-gap: 7px;
    --overlay-top: 54px;
    --overlay-edge: 10px;
    --surrogate-panel-width: 390px;
    --surrogate-panel-max-height: min(44%, 250px);
    --voice-settings-top: 58px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar {
    gap: 10px;
  }

  .status {
    max-width: min(24vw, 230px);
  }

  #studentPreviewModeButton,
  #voiceSettingsButton,
  #saveTaxonomyButton {
    font-size: 0;
  }

  #studentPreviewModeButton::after,
  #voiceSettingsButton::after,
  #saveTaxonomyButton::after {
    font-size: 11px;
  }

  #studentPreviewModeButton::after {
    content: "Student";
  }

  #voiceSettingsButton::after {
    content: "Voice";
  }

  #saveTaxonomyButton::after {
    content: "Curriculum";
  }

  .workspace {
    grid-template-rows: minmax(170px, var(--map-height)) var(--splitter-size) minmax(145px, 1fr);
  }

  h1 {
    font-size: 17px;
  }

  h2 {
    font-size: 14px;
  }

  button {
    padding: 6px 8px;
  }

  .eyebrow,
  .meta,
  .status {
    font-size: 11px;
  }

  .mode-switch {
    gap: 2px;
    padding: 2px;
  }

  .mode-switch button,
  .sidebar-tabs button,
  .taxonomy-actions button,
  .taxonomy-add-row,
  .timeline-actions button,
  .map-tools button {
    padding: 5px 7px;
    font-size: 11px;
  }

  .search {
    padding: 10px;
  }

  .search input,
  .voice-overlay-input input,
  .voice-settings-field select {
    padding: 7px 8px;
  }

  .lesson-group.category > summary,
  .taxonomy-group > summary:not(.taxonomy-row) {
    padding: 7px 8px;
    font-size: 12px;
  }

  .student-preview-instruction,
  .student-preview-atc,
  .student-preview-voice,
  .student-preview-result {
    margin-top: 8px;
    padding: 8px 9px;
  }

  .voice-overlay-expected {
    padding: 8px;
    font-size: 12px;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: minmax(220px, var(--sidebar-width)) var(--splitter-size) minmax(0, 1fr);
  }

  .layout.sidebar-collapsed {
    grid-template-columns: 0 30px minmax(0, 1fr);
  }

  .lower {
    grid-template-columns: minmax(220px, var(--timeline-width)) var(--splitter-size) minmax(240px, 1fr);
  }

  .timeline-panel {
    border-right: 0;
  }
}
