:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #ecf4f3;
  background: #10171b;
  --panel: #151f24;
  --edge: #34474d;
  --muted: #a0b3b9;
  --faint: #899fa5;
  --mint: #87e1c6;
  --amber: #ffc681;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button, select, summary {
  font: 650 0.875rem "Inter", "Segoe UI", system-ui, sans-serif;
  color: #e2eeee;
  background: #1c292f;
  border: 1px solid #3b5259;
  border-radius: 6px;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
:is(button:not(:disabled), select, summary):hover { background: #2a3c43; border-color: #66838a; }
button:disabled { color: #87999e; opacity: 0.58; cursor: default; }
:is(button, select, summary, input):focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.console {
  --gutter: clamp(8px, 1vw, 16px);
  --window-top: calc(54px + var(--gutter));
  --window-bottom: calc(44px + var(--gutter));
  --pane-width: 290px;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0c1b23;
}
.console:fullscreen { width: 100%; height: 100%; }
.scope, #unity-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.approach-console > :not(.scope, .approach-start),
.approach-console .scope > :not(canvas) { display: none; }
.approach-console canvas:focus { outline: none; }
.approach-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0a151be8;
}
.approach-card {
  width: min(100%, 480px);
  padding: 26px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--panel);
}
.approach-card h1 { font-size: 1.6rem; white-space: normal; }
.approach-card progress { width: 100%; margin-top: 18px; }
.approach-card p { margin-top: 10px; color: var(--muted); font-size: 0.875rem; }
.approach-card p:empty { display: none; }
.approach-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.mode-link { color: var(--mint); font-size: 0.875rem; text-underline-offset: 3px; }
.mode-link:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.toolbar {
  position: absolute;
  z-index: 7;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  min-height: 54px;
  padding: 6px var(--gutter);
  background: #10191fef;
  border-bottom: 1px solid #3a5158;
  box-shadow: 0 3px 12px #06101438;
}
.station, .toolbar-controls, .view-tabs { display: flex; align-items: center; gap: 8px; }
.station { gap: 10px; }
.brand { color: var(--mint); font: 700 0.65rem var(--mono); letter-spacing: 0.14em; }
.brand-mark {
  display: block;
  flex: 0 0 23px;
  height: 23px;
  border: 1px solid #477a73;
  border-radius: 50%;
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--mint); border-radius: 50%; }
h1 { margin-top: 1px; font-size: 1.03rem; font-weight: 670; line-height: 1.25; letter-spacing: -0.018em; white-space: nowrap; }
.view-tabs { gap: 2px; padding: 2px; border-radius: 7px; background: #0d1a20; border: 1px solid #31474d; }
.view-tabs button { background: transparent; color: var(--muted); border-color: transparent; min-height: 30px; }
.view-tabs button[aria-pressed="true"] { background: #24413f; color: #c0f5e4; border-color: #41655e; }
.window-menu { position: relative; }
.window-menu summary { display: flex; align-items: center; gap: 7px; list-style: none; }
.window-menu summary::-webkit-details-marker { display: none; }
.window-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid #9eb9bd;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.window-menu-content {
  position: absolute;
  z-index: 1;
  right: 0;
  top: calc(100% + 8px);
  min-width: 172px;
  display: grid;
  gap: 2px;
  padding: 7px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: 0 8px 24px #06101494;
}
.window-menu-content label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 0.85rem;
  cursor: pointer;
}
.window-menu-content input { accent-color: var(--mint); }
.window-menu-content button { margin-top: 4px; }

.window-area {
  position: absolute;
  z-index: 4;
  inset: var(--window-top) var(--gutter) var(--window-bottom);
  pointer-events: none;
}
.dock {
  position: absolute;
  inset-block-start: 0;
  display: grid;
  gap: 8px;
  width: min(var(--pane-width), 100%);
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  pointer-events: auto;
}
.dock[data-dock="left"] { left: 0; }
.dock[data-dock="right"] { right: 0; }
.floating-windows { position: absolute; inset: 0; pointer-events: none; }
.floating-windows > .pane { position: absolute; width: min(var(--pane-width), 100%); max-height: 100%; overflow-y: auto; }
.floating-windows > .pane[data-active] { z-index: 1; }
.dock-target {
  --target-color: #608b87;
  position: absolute;
  z-index: 2;
  inset-block: 0;
  width: min(104px, 20%);
  display: none;
  align-items: end;
  justify-content: center;
  padding-bottom: 10px;
  border: 1px dashed var(--target-color);
  border-radius: 8px;
  color: #d4f5ea;
  font: 700 0.72rem var(--mono);
  pointer-events: none;
}
.dock-target[data-dock-target="left"] { left: 0; }
.dock-target[data-dock-target="right"] { right: 0; }
.window-area[data-dragging] .dock-target { display: flex; background: #203b3d53; }
.dock-target[data-ready] { --target-color: #87e1c6; background: #286152a6 !important; }
.dock-target span { padding: 6px 7px; border-radius: 5px; background: #122925; white-space: nowrap; }

.pane {
  min-width: 0;
  overflow: hidden;
  pointer-events: auto;
  background: #151f24f2;
  border: 1px solid var(--edge);
  border-radius: 9px;
  box-shadow: 0 4px 18px #06101458;
}
.pane-head {
  min-height: 40px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--edge);
  background: #19262cf2;
}
.window-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; cursor: grab; touch-action: none; user-select: none; }
.window-title::before {
  content: "";
  flex: 0 0 8px;
  height: 12px;
  background: radial-gradient(circle, #7f969e 1px, transparent 1.2px) 0 0 / 4px 4px;
}
.window-area[data-dragging] .window-title { cursor: grabbing; }
.pane-head h2 { font-size: 0.88rem; letter-spacing: -0.01em; line-height: 1.2; }
.window-actions { display: flex; align-items: center; gap: 5px; padding: 5px 6px 5px 0; }
.window-actions :is(button, select) { min-height: 28px; padding: 2px 5px; font-size: 0.73rem; }
.window-actions button { width: 28px; font-size: 1.07rem; line-height: 1; }
.shift-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px; }
.shift-metric span { display: block; color: var(--muted); font-size: 0.68rem; }
.shift-metric strong { display: block; margin-top: 3px; font: 650 1rem var(--mono); }
.shift-buttons { display: flex; gap: 5px; margin-left: auto; }
.shift-buttons button { min-height: 30px; padding-inline: 6px; font-size: 0.73rem; }
.briefing { padding: 10px; border-top: 1px solid var(--edge); }
.briefing h3 { font-size: 0.96rem; }
.briefing p { color: #bfced2; font-size: 0.82rem; line-height: 1.45; margin: 5px 0 10px; }
.primary { background: var(--mint); color: #132724; border-color: var(--mint); font-weight: 750; }
.primary:hover:not(:disabled) { background: #b7f2df; border-color: #b7f2df; }
.primary:disabled { color: #c0d2cf; background: #293e42; border-color: #51686b; }
progress { display: block; margin-top: 8px; width: 100%; height: 5px; accent-color: var(--mint); }

.flight-strips { padding: 8px; display: grid; gap: 6px; }
.strip { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 8px; text-align: left; border-left: 3px solid var(--mint); padding: 7px 8px; }
.arrival-strip { border-left-color: var(--amber); }
.strip[aria-pressed="true"] { background: #293a40; border-top-color: #607980; border-right-color: #607980; border-bottom-color: #607980; }
.strip-kind { color: var(--muted); grid-column: 1 / -1; font: 600 0.65rem var(--mono); letter-spacing: .075em; }
.strip strong { font: 700 0.94rem var(--mono); }
.strip-phase { color: #c1d1d4; font-size: 0.74rem; text-align: right; }
.clearance-panel { padding: 9px; }
.selected-label { display: flex; justify-content: space-between; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 0.76rem; }
.selected-label strong { font: 600 0.74rem var(--mono); color: var(--mint); }
.clearance-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.clearance-buttons button { padding-inline: 4px; font-size: 0.82rem; }
#guidance { min-height: 2.6em; margin-top: 7px; color: var(--muted); font-size: 0.77rem; line-height: 1.4; }
.radio-tools { display: flex; justify-content: flex-end; padding: 5px 8px; border-top: 1px solid var(--edge); }
.radio-tools button { min-height: 28px; padding: 2px 8px; font-size: 0.76rem; }
.radio-tools button[aria-pressed="true"] { color: var(--amber); }
.radio-log { margin: 0; padding: 0 9px; list-style: none; max-height: min(205px, 26dvh); overflow-y: auto; scrollbar-width: thin; }
.radio-log li { padding: 7px 2px; }
.radio-log li + li { border-top: 1px solid #2b3a41; }
.radio-log time { float: right; color: var(--faint); font: 0.68rem var(--mono); }
.radio-log strong { color: var(--mint); font: 700 0.72rem var(--mono); }
.radio-log li[data-source="TOWER"] strong { color: #b9cbef; }
.radio-log p, #radio-empty { color: #bdcdd0; font-size: 0.77rem; line-height: 1.43; }
#radio-empty { padding: 9px 10px; }

.marker {
  position: absolute;
  display: flex;
  gap: 7px;
  align-items: center;
  transform: translate(-7px, -50%);
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  padding: 4px 6px 4px 3px;
  color: var(--mint);
  background: #0c1820ea;
  font: 700 0.73rem var(--mono);
  white-space: nowrap;
}
.marker.reverse { flex-direction: row-reverse; transform: translate(calc(-100% + 7px), -50%); padding: 4px 3px 4px 6px; }
.marker[aria-pressed="true"] { outline: 1px solid currentColor; z-index: 1; }
.marker.arrival-marker { color: var(--amber); }
.blip { flex-shrink: 0; width: 8px; height: 8px; border: 1px solid currentColor; transform: rotate(45deg); }
.status-bar {
  position: absolute;
  z-index: 5;
  inset: auto var(--gutter) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  pointer-events: none;
  font: 650 0.72rem var(--mono);
  color: #d3e3e5;
}
.status-bar > * { background: #101b21eb; border: 1px solid #3a5158; border-radius: 6px; padding: 7px 9px; }
.runway, .status-view { display: flex; align-items: center; gap: 8px; }
.runway { color: var(--mint); }
.runway.occupied { color: var(--amber); }
.status-dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; flex-shrink: 0; }
.conflict {
  position: absolute;
  z-index: 6;
  bottom: var(--window-bottom);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  margin: 0;
  padding: 9px 12px;
  color: #ffe1b9;
  background: #432916;
  border: 1px solid #c48345;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 650;
  pointer-events: none;
}
@media (max-width: 670px) {
  .console { --pane-width: 272px; }
  .dock { width: min(var(--pane-width), 81%); }
  .brand-mark { display: none; }
}
@media (max-width: 590px) {
  .console { --window-top: calc(88px + var(--gutter)); }
  .toolbar { flex-wrap: wrap; gap: 4px; }
  .station { width: 100%; }
  .toolbar-controls { width: 100%; justify-content: space-between; gap: 4px; }
}
@media (max-width: 450px) {
  .toolbar-controls :is(button, summary) { font-size: 0.78rem; padding-inline: 7px; }
  .status-bar { font-size: 0.66rem; gap: 4px; }
  .status-bar > * { padding: 6px; }
  .status-view { display: none; }
}

.airport-choice {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.75rem;
}
.airport-choice select { width: 100%; min-height: 32px; padding: 3px 7px; }
.runway-labels { position: absolute; inset: 0; pointer-events: none; }
.runway-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 3px;
  border-radius: 3px;
  color: #a9c5ca;
  background: #0c1820e6;
  font: 650 clamp(0.56rem, 1.2vw, 0.7rem) var(--mono);
}
.runway-label.active { color: var(--mint); border: 1px solid #426f66; }
.scope[data-visual] .marker,
.scope[data-visual] .marker.reverse { transform: translate(-50%, calc(-100% - 9px)); flex-direction: row; }
.camera-tools {
  position: absolute;
  z-index: 5;
  bottom: var(--window-bottom);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 5px;
  border: 1px solid #3b5259;
  border-radius: 7px;
  background: #101b21ef;
}
.camera-tools :is(.camera-target, .camera-zoom) { display: flex; align-items: center; gap: 4px; }
.camera-tools button { min-height: 30px; padding: 3px 7px; font-size: 0.76rem; }
.camera-tools button[aria-pressed="true"] { background: #24413f; color: #c0f5e4; border-color: #41655e; }
.camera-zoom button { min-width: 29px; }
.camera-zoom output { min-width: 23px; text-align: center; font: 650 0.76rem var(--mono); }
.console:has(.camera-tools:not([hidden])) .conflict { bottom: calc(var(--window-bottom) + 52px); }
