:root {
  --bg: #0b0d0f;
  --panel: #101214;
  --panel-2: #15181b;
  --line: #2a2e31;
  --line-soft: rgba(214, 220, 223, 0.12);
  --text: #e6e9eb;
  --muted: #8f969c;
  --accent: #2997ff;
  --accent-2: #e0a35c;
  --blue: #2997ff;
  --danger: #ff6b6b;
  --sky: #2f7fb5;
  --ground: #6e4d2f;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  color-scheme: dark;
}

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

::-webkit-scrollbar-track {
  background: #0b0d0f;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #0b0d0f;
  border-radius: 99px;
  background: #2c3237;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b444b;
}

body {
  background:
    radial-gradient(circle at 18% -10%, rgba(41, 151, 255, 0.07) 0%, transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(143, 199, 209, 0.05) 0%, transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.55;
  padding: 18px;
}

.topbar,
.layout,
.foot {
  max-width: 1440px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.008));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #1b7f74);
  color: #04110f;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(53, 214, 194, 0.25);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.aircraft-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aircraft-picker select {
  min-width: 176px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.aircraft-picker select:focus {
  outline: 1px solid var(--accent);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(127, 145, 166, 0.12);
}

.dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(55, 214, 189, 0.16);
  animation: pulse 1.6s ease-in-out infinite;
}

.dot.paused {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.16);
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(55, 214, 189, 0.04);
  }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 36%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.instruments {
  display: grid;
  gap: 16px;
}

.instruments .panel,
.panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.horizon-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #0c1219;
}

.globe-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  height: clamp(580px, 76vh, 1000px);
  background: #04070b;
  border-color: rgba(72, 128, 158, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.globe-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(2, 7, 12, 0.62);
  background: radial-gradient(
    ellipse 92% 82% at 50% 40%,
    transparent 56%,
    rgba(0, 2, 5, 0.38) 100%
  );
  border-radius: inherit;
}

.globe-card.cockpit::after {
  box-shadow: inset 0 0 150px rgba(1, 4, 8, 0.7);
  background:
    linear-gradient(180deg, rgba(2, 5, 9, 0.55) 0%, transparent 16%),
    radial-gradient(ellipse 105% 95% at 50% 45%, transparent 52%, rgba(0, 2, 5, 0.5) 100%);
}

.cockpit-glow {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 300px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    ellipse 58% 100% at 50% 50%,
    rgba(104, 152, 190, 0.22) 0%,
    rgba(52, 92, 128, 0.11) 38%,
    rgba(20, 42, 62, 0.04) 58%,
    transparent 74%
  );
  filter: blur(6px);
}

.globe-card.cockpit .cockpit-glow {
  opacity: 0;
}

.globe-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.globe-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  will-change: left, top;
}

.globe-label.plane {
  padding-top: 0;
  color: #eef7ff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(1, 5, 10, 0.95), 0 0 2px rgba(1, 5, 10, 0.9);
}

.globe-label.wp {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(120, 170, 195, 0.2);
  border-radius: 5px;
  background: rgba(6, 11, 16, 0.72);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.cockpit-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.globe-card.cockpit .cockpit-hud {
  opacity: 1;
}

#globe {
  width: 100%;
  height: 100%;
}

.globe-card .cesium-viewer,
.globe-card .cesium-viewer-cesiumWidgetContainer,
.globe-card .cesium-widget,
.globe-card .cesium-widget canvas {
  width: 100%;
  height: 100%;
}

.globe-card .cesium-viewer-bottom {
  display: none;
}

.globe-card .cesium-widget-credits {
  font-size: 10px;
  opacity: 0.75;
}

.globe-chip,
.globe-distance {
  position: absolute;
  z-index: 3;
  top: 14px;
  padding: 6px 11px;
  border: 1px solid rgba(120, 170, 195, 0.24);
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.58);
  backdrop-filter: blur(8px);
  color: #d4e6f2;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.globe-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(53, 214, 194, 0.8);
  vertical-align: 1px;
}

.globe-chip {
  left: 14px;
}

.globe-distance {
  right: 14px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.globe-distance span {
  color: var(--muted);
}

.globe-distance strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.globe-camera {
  position: absolute;
  z-index: 4;
  top: 48px;
  right: 14px;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(120, 170, 195, 0.24);
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.62);
  backdrop-filter: blur(8px);
}

.globe-camera button {
  height: 25px;
  padding: 0 11px;
  color: #8fa6b4;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.globe-camera button.active {
  color: #0b1218;
  background: #d4e6f2;
}

.horizon-card.compact #horizon {
  max-height: 190px;
  object-fit: cover;
  border-radius: 14px;
}

.globe-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

.globe-fallback span {
  color: var(--danger);
  font-size: 11px;
}

#horizon {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 15px;
}

.horizon-labels {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.hud {
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(110, 180, 200, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 18, 26, 0.48), rgba(5, 11, 17, 0.78));
  backdrop-filter: blur(8px);
}

.hud-attitude {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hud-attitude canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 720 / 560;
}

.hud-attitude .horizon-labels {
  display: none;
}

.hud-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.hud-gauges {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.hud-gauge {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.hud-gauge canvas {
  display: block;
  width: 100%;
  max-width: 64px;
  aspect-ratio: 1;
}

.hud-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hud-label strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hud-label em {
  font-style: normal;
  font-size: 8px;
  color: var(--muted);
}

.hud-strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding-top: 3px;
  border-top: 1px solid rgba(110, 180, 200, 0.18);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hud-strip strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.control-card {
  padding: 13px 18px 15px;
}

.control-card .card-head {
  margin-bottom: 10px;
}

.control-bars {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.bar-row strong {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bar {
  position: relative;
  height: 5px;
  border-radius: 99px;
  background: #172430;
  overflow: hidden;
}

.bar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: #3a4b5f;
}

.bar i {
  position: absolute;
  top: 0;
  height: 100%;
  width: 0;
  left: 50%;
  background: linear-gradient(90deg, rgba(53, 214, 194, 0.55), var(--accent));
  border-radius: 99px;
  box-shadow: 0 0 10px rgba(53, 214, 194, 0.35);
  transition: width 0.08s linear, left 0.08s linear;
}

.side {
  display: grid;
  gap: 16px;
}

.card {
  padding: 16px 18px;
}

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

.card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93a8bd;
}

.card h2::before {
  content: "";
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(53, 214, 194, 0.25));
}

.card-head span {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

#map {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #0a1016;
  border: 1px solid var(--line);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 4px 0 14px;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  flex: 1;
  min-height: 36px;
  border: 1px solid #2b3c4e;
  background: #141f2b;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, color 0.15s;
}

button:hover {
  background: #1b2a39;
  border-color: #3c536a;
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: transparent;
  color: #a9bacb;
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.04);
}

button.primary {
  border-color: rgba(53, 214, 194, 0.42);
  background: linear-gradient(180deg, rgba(53, 214, 194, 0.2), rgba(53, 214, 194, 0.08));
  color: #c9fff7;
}

button.primary:hover {
  border-color: rgba(53, 214, 194, 0.68);
  background: linear-gradient(180deg, rgba(53, 214, 194, 0.28), rgba(53, 214, 194, 0.12));
}

button.stop {
  border-color: rgba(255, 200, 97, 0.45);
  background: linear-gradient(180deg, rgba(255, 200, 97, 0.18), rgba(255, 200, 97, 0.06));
  color: #ffe4b0;
}

.pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 44px 44px;
  gap: 8px;
  margin-top: 14px;
}

.pad-btn {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 15px;
}

.pad-btn.up {
  grid-column: 2;
  grid-row: 1;
}

.pad-btn.left {
  grid-column: 1;
  grid-row: 2;
}

.pad-btn.right {
  grid-column: 3;
  grid-row: 2;
}

.pad-btn.down {
  grid-column: 2;
  grid-row: 2;
}

.pad-btn.rudder {
  grid-row: 2;
  font-size: 11px;
}

.pad-btn.rudder:nth-of-type(5) {
  grid-column: 4;
}

.pad-btn.rudder:nth-of-type(6) {
  grid-column: 5;
}

.help p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.help p:last-child {
  margin-bottom: 0;
}

.globe-coords {
  position: absolute;
  z-index: 3;
  left: 14px;
  bottom: 130px;
  display: flex;
  gap: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(120, 150, 180, 0.24);
  border-radius: 7px;
  background: rgba(6, 11, 16, 0.6);
  backdrop-filter: blur(6px);
  color: #9fd8d0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.sixdof-card {
  padding: 13px 18px 15px;
}

.dof-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.dof-grid div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.dof-grid .wide {
  grid-column: 1 / -1;
  justify-content: center;
  background: rgba(53, 214, 194, 0.045);
  border-color: rgba(53, 214, 194, 0.16);
}

.dof-grid span {
  color: var(--muted);
  font-size: 10px;
}

.dof-grid strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dof-grid em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.dof-sub {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dof-sub span {
  color: var(--muted);
  font-size: 10px;
}

.dof-sub strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wp-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.wp-summary span:last-child {
  color: var(--accent);
}

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

.wp-form input,
.wp-form button {
  min-width: 0;
}

.wp-form input {
  height: 33px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b141d;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.wp-form input:focus {
  outline: none;
  border-color: rgba(53, 214, 194, 0.45);
}

.wp-form button {
  grid-column: span 2;
  min-height: 33px;
  padding: 6px 8px;
}

.wp-form #wp-current,
.wp-form #wp-update {
  grid-column: span 1;
}

.wp-form button:disabled {
  opacity: 0.45;
  cursor: default;
}

.wp-loop {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.wp-loop input {
  accent-color: var(--accent);
}

.wp-hint {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.wp-list {
  display: grid;
  gap: 6px;
  max-height: 150px;
  margin: 0 0 12px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.wp-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.wp-list li.active {
  border-color: var(--accent);
  background: rgba(55, 214, 189, 0.08);
}

.wp-list li.selected {
  border-color: #6aa9ff;
  background: rgba(106, 169, 255, 0.1);
}

.wp-list li span {
  cursor: pointer;
}

.wp-list button {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 9px;
  background: transparent;
  color: var(--muted);
}

.nav-readout {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(53, 214, 194, 0.035);
}

.nav-readout div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

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

.nav-readout strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#mode-badge {
  color: var(--accent);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 2px 0 12px;
}

.segmented button {
  padding: 8px;
  font-size: 12px;
}

.segmented button.active {
  border-color: rgba(53, 214, 194, 0.65);
  background: linear-gradient(180deg, rgba(53, 214, 194, 0.9), rgba(37, 184, 168, 0.9));
  color: #04110f;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(53, 214, 194, 0.22);
}

.target-grid {
  display: grid;
  gap: 8px;
}

.target-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.target-grid label > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.target-grid input {
  width: 92px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b141d;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.target-grid input:focus {
  outline: none;
  border-color: rgba(53, 214, 194, 0.45);
}

.pid-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pid-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.pid-table {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.pid-head,
.pid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 58px 58px;
  gap: 6px;
  align-items: center;
}

.pid-head span {
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.pid-row span {
  color: var(--text);
  font-size: 10px;
}

.pid-row input {
  width: 100%;
  height: 27px;
  padding: 0 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b141d;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.pid-row input:focus {
  outline: none;
  border-color: rgba(53, 214, 194, 0.45);
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 5px;
  margin-right: 3px;
  border: 1px solid #33475c;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #0b141d;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: center;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 14px 4px 8px;
  border-top: 1px solid var(--line-soft);
  color: #5d6f82;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(6, 9, 13, 0.86);
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  text-align: center;
  padding: 28px 36px;
}

.overlay-card h1 {
  margin: 18px 0 6px;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.overlay-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(55, 214, 189, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

.error {
  color: var(--danger) !important;
  margin-top: 10px !important;
  max-width: 460px;
}

@media (max-width: 1200px) {
  .hud {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .hud-gauge canvas {
    max-width: 56px;
  }

  .globe-coords {
    bottom: 118px;
  }

  .globe-card .cesium-viewer-bottom {
    bottom: 110px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hud {
    grid-template-columns: 1fr;
  }

  .hud-attitude {
    display: none;
  }

  .hud-gauges {
    flex-wrap: wrap;
  }

  .hud-gauge {
    flex: 0 0 30%;
    max-width: none;
  }

  .globe-coords {
    display: none;
  }

  .globe-card .cesium-viewer-bottom {
    bottom: 12px;
    left: auto;
    right: 10px;
  }
}

@media (max-width: 620px) {
  body {
    padding: 12px;
  }

  .dof-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dof-sub {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pad {
    grid-template-columns: repeat(3, 1fr) repeat(2, 1fr);
  }

  .foot {
    flex-direction: column;
  }
}

/* ---------- site integration ---------- */

.topbar {
  padding: 0 2px 12px;
  margin-bottom: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  align-items: baseline;
  gap: 8px;
}

.brand-mark {
  display: none;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.top-actions {
  flex: 1;
  justify-content: space-between;
  gap: 14px;
}

.status {
  padding: 4px 10px;
  border-color: var(--line);
  background: transparent;
  border-radius: 980px;
  font-size: 10px;
}

.dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.12);
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(41, 151, 255, 0.04);
  }
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #101214;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.globe-card {
  height: 870px;
  border-color: var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.card h2 {
  color: #d6dcdf;
}

.card h2::before {
  background: linear-gradient(180deg, var(--accent), rgba(41, 151, 255, 0.2));
}

.card-head span,
.wp-hint,
.help p,
.help h2 {
  color: var(--muted);
}

button {
  border-color: #33383d;
  background: #1a1d20;
  border-radius: 8px;
}

button:hover {
  background: #23272b;
  border-color: #4a5056;
}

button.primary {
  border-color: #0071e3;
  background: #0071e3;
  color: #fff;
}

button.primary:hover {
  border-color: #2997ff;
  background: #2997ff;
}

.segmented button.active {
  border-color: #0071e3;
  background: #0071e3;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.22);
}

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

.aircraft-picker select,
.target-grid input,
.pid-row input,
.wp-form input,
kbd {
  border-color: var(--line);
  background: #15181b;
  color: var(--text);
}

.aircraft-picker select:focus,
.target-grid input:focus,
.pid-row input:focus,
.wp-form input:focus {
  outline: none;
  border-color: rgba(41, 151, 255, 0.6);
}

.wp-list li.active {
  border-color: rgba(41, 151, 255, 0.55);
  background: rgba(41, 151, 255, 0.07);
}

.nav-readout {
  border-color: var(--line);
  background: rgba(41, 151, 255, 0.03);
}

.hud {
  border-color: rgba(214, 220, 223, 0.18);
  background: linear-gradient(180deg, rgba(10, 12, 14, 0.5), rgba(8, 10, 12, 0.82));
}

.globe-chip,
.globe-distance,
.globe-coords {
  border-color: rgba(214, 220, 223, 0.18);
  background: rgba(10, 12, 14, 0.62);
  color: #d6dcdf;
}

.globe-chip::before {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(41, 151, 255, 0.7);
}

.globe-distance strong,
.nav-readout strong {
  color: var(--accent);
}

.overlay {
  background: rgba(11, 13, 15, 0.94);
}

.spinner {
  border-color: rgba(41, 151, 255, 0.18);
  border-top-color: var(--accent);
}

.foot {
  margin-top: 18px;
  padding: 12px 2px 2px;
  color: #6f767c;
  border-top-color: var(--line);
}

.hotkeys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  padding: 10px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.hotkeys span {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    width: 100%;
  }

  .brand-sub {
    display: none;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .aircraft-picker {
    flex: 1;
    min-width: 0;
  }

  .aircraft-picker > span {
    flex: none;
    white-space: nowrap;
  }

  .aircraft-picker select {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .status {
    flex: none;
  }

  .globe-card {
    height: auto;
  }

  .hotkeys {
    display: none;
  }

  #globe {
    height: 460px;
  }

  .hud {
    position: static;
    margin: 10px;
    width: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .globe-card .cesium-viewer-bottom {
    bottom: 212px;
  }

  .globe-coords {
    display: none;
  }
}
