:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #fafbfc;
  --border: #e3e7ed;
  --border-strong: #cfd6e0;
  --text: #1c2530;
  --text-mid: #5a6779;
  --text-dim: #8b97a8;
  --brand: #185fa5;
  --brand-dark: #0c447c;
  --brand-soft: #e6f1fb;
  --ok: #3b6d11;
  --ok-soft: #eaf3de;
  --warn: #854f0b;
  --warn-soft: #faeeda;
  --err: #a32d2d;
  --err-soft: #fcebeb;
  --info: #0f6e56;
  --info-soft: #e1f5ee;
  --track: #e24b4a;
  --airspace: #ef9f27;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ---------- license ---------- */
.license-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.license-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
/* the company mark above the login card's brand line */
.license-logo {
  width: 44px; height: 44px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}
.license-brand {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.brand-en { font-size: 11px; color: var(--text-mid); letter-spacing: .08em; margin-left: 6px; }
.license-title { font-size: 20px; font-weight: 500; margin: 0 0 4px; }
.license-hint { font-size: 13px; color: var(--text-mid); margin: 0 0 20px; }
.license-msg { margin-top: 12px; font-size: 13px; min-height: 20px; }

/* ---------- topbar ---------- */
.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  /* Phase 3.9g: brand sits LEFT, next to the sidebar toggle (it used to be
   * pushed into the middle by space-between). The meta cluster keeps to the
   * right via its own margin-left:auto. */
  justify-content: flex-start;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 500;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
/* Real brand mark (img/logo.png, from the company's logo.ico). The old
 * CSS-drawn square + white bar is gone; object-fit keeps the 46×48
 * artwork undistorted inside a square box at any size. */
.topbar-logo {
  width: 30px; height: 30px;
  object-fit: contain;
  flex: none;
  display: block;
}
.topbar-title { font-size: 17px; font-weight: 500; line-height: 1.2; }
.topbar-sub { font-size: 11px; color: var(--text-dim); line-height: 1.2; }
.topbar-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tag {
  font-size: 11px;
  color: var(--text-mid);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}

/* ---------- layout ---------- */
/* Phase 3.4 (Dongbo 20:55): the shell is a two-column flex app. The
 * LEFT column is the data-source / FDR-conversion workflow and spans
 * the full page height; the RIGHT workspace owns the title bar and the
 * content. Folding the left column therefore only hides that column —
 * the header and the map never move, the map just gets wider and is
 * re-measured (see app.js sidebar-toggle). */
.app {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- sidebar ---------- */
/* The sidebar clips a fixed-width inner panel, so folding it is a clean
 * slide-out: the inner content keeps its own width and never reflows
 * into a squeezed column while the width animates. */
.sidebar {
  width: 276px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .22s ease, border-color .22s ease;
}
.side-inner {
  width: 276px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 16px;
}
.app.sb-collapsed .sidebar { width: 0; border-right-color: transparent; }
.app.sb-collapsed .side-inner { opacity: 0; transition: opacity .12s ease; }
.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0 13px;
  border-bottom: 1px solid var(--border);
}
.side-head-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.side-head-sub { font-size: 11px; color: var(--text-dim); line-height: 1.3; }
.side-block { padding: 16px 0; border-bottom: 1px solid var(--border); }
.side-block:last-of-type { border-bottom: none; }
.side-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
.side-note {
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 10px;
}
.side-contact {
  padding: 12px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ---------- dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-alt);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone-icon {
  width: 26px; height: 26px;
  margin: 0 auto 8px;
  border: 2px solid var(--text-dim);
  border-radius: 6px;
  position: relative;
}
.dropzone-icon::after {
  content: "";
  position: absolute;
  left: 50%; top: 4px;
  width: 2px; height: 14px;
  background: var(--text-dim);
  transform: translateX(-50%);
}
.dropzone-text { font-size: 13px; color: var(--text); }
.dropzone-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.file-info {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
}

/* ---------- form ---------- */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 4px;
}
.field input, .field select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 10px;
  outline: none;
}
.field input:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}
.field-help {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-size: 13px;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-alt); border-color: var(--brand); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-mid); }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- content ---------- */
.content { flex: 1; min-width: 0; }

.card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 18px 20px 20px;
  margin-bottom: 0;
  box-shadow: none;
}
.card-head {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* One-line clarification under a card title (Phase 3.10). Pulled up
 * against .card-head's 14px bottom margin so it reads as part of the
 * heading rather than as the first row of content. */
.card-sub {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  margin: -8px 0 14px;
}

/* ---------- empty / loading ---------- */
.empty-state, .loading-state {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 64px 20px;
  text-align: center;
}
.empty-icon {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border: 2px solid var(--border-strong);
  border-radius: 10px;
  position: relative;
}
.empty-icon::after {
  content: "";
  position: absolute;
  left: 12px; top: 14px;
  width: 16px; height: 10px;
  border: 2px solid var(--border-strong);
  border-top: none;
}
.empty-title { font-size: 15px; color: var(--text); }
.empty-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.spinner {
  width: 26px; height: 26px;
  margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- scan / read progress (Phase 2.1) ---------- */
.scan-progress { max-width: 460px; margin: 14px auto 0; }
.scan-progress progress { width: 100%; height: 10px; display: block; }
.load-progress-text {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  min-height: 16px;
}
.scan-cancel-row { margin-top: 12px; }

/* ---------- info grid ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 20px;
}
.info-item { display: flex; gap: 6px; font-size: 13px; }
.info-key { color: var(--text-mid); flex: none; }
.info-val { color: var(--text); font-weight: 500; }

/* ---------- map & chart ---------- */
.map {
  height: 520px;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-alt);
  border: none;
}
.chart { min-height: 380px; }
/* Legend rides in the pane head above the map (Phase 3.9f). It used to sit
 * between the map and the chart, eating a whole row of vertical space and
 * reading as if it belonged to the chart below it. */
.map-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mid);
}
/* Pane-head right cluster (Phase 3.10): readout-source switch + legend.
 * Grouped so `justify-content: space-between` keeps the title on the left
 * instead of spreading three children across the row. */
.pane-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Readout-source switch (Phase 3.10): 读数跟随 鼠标 / 飞机. One state,
 * two mirrored controls (map head + chart head). */
.ro-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-mid);
  user-select: none;
}
.ro-switch .ro-cap {
  padding: 0 4px 0 5px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.ro-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.5;
  padding: 2px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ro-switch button:hover { color: var(--text); }
.ro-switch button.on {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
/* the three swatch chips must not break mid-word; the trailing hint
 * paragraph is meant to wrap */
.map-legend { flex-wrap: wrap; }
.legend-item:not(:last-child) { white-space: nowrap; }
.legend-line { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.legend-track { background: var(--track); }
.legend-airspace { background: var(--airspace); }

.leaflet-container { font: inherit; }

/* ---------- analyse ---------- */
.an-section { margin-bottom: 18px; }
.an-section:last-child { margin-bottom: 0; }
.an-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.an-line {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--surface-alt);
  color: var(--text-mid);
  word-break: break-all;
}
.an-line.is-ok { background: var(--ok-soft); color: var(--ok); }
.an-line.is-warn { background: var(--warn-soft); color: var(--warn); }
.an-line.is-err { background: var(--err-soft); color: var(--err); }
.an-line.is-head { background: transparent; color: var(--text-dim); font-size: 12px; padding-left: 0; }
.an-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ---------- raw table ---------- */
.raw-table {
  max-height: 420px;
  overflow: auto;
  border: none;
  border-radius: 0;
}
.raw-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.raw-table th, .raw-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.raw-table th {
  position: sticky;
  top: 0;
  background: var(--surface-alt);
  font-weight: 500;
  color: var(--text-mid);
  z-index: 1;
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .app { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .side-inner { width: auto; height: auto; overflow: visible; }
  .app.sb-collapsed .sidebar { width: auto; height: 0; border-bottom-color: transparent; }
}

/* Phase 1 additions */
.login-wrap, .license-wrap{min-height:100vh}
#map{height:520px}
#chart{height:100%}
.info-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:6px 18px}
.raw-table{margin-top:8px}
.dragover{outline:2px dashed var(--brand)}

/* ---- Phase 3: param panel / flight details ---- */
.chart-wrap{display:flex;gap:0;align-items:stretch;height:480px;position:relative}
.chart-wrap .chart{flex:1;min-width:0;min-height:0;height:100%;position:relative}
/* Phase 3.11: the chart head row is gone, so "还原" floats in the canvas
 * instead — parked just left of the ECharts toolbox so the two read as one
 * toolbar. Kept light-on-white: the plot itself is on the page background. */
.chart-act{position:absolute;top:4px;right:92px;z-index:8;font:inherit;font-size:11.5px;line-height:1.55;
  padding:1px 9px;border-radius:6px;border:1px solid var(--border);background:rgba(255,255,255,.86);
  color:var(--text-mid);cursor:pointer;transition:color .15s,border-color .15s,background .15s}
.chart-act:hover{color:var(--brand);border-color:var(--brand);background:#fff}
/* download link lives under the canvas (the head row is gone) */
.chart-foot{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:2px 0 2px}
.param-panel{width:205px;flex:none;max-height:100%;overflow-y:auto;overscroll-behavior:contain;border:none;border-right:1px solid var(--border);border-radius:0;padding:8px 10px 8px 0;background:transparent}
/* Phase 3.5: flat parameter list (no family groups) + 全开/全关 */
.pp-head{display:flex;justify-content:space-between;align-items:center;font-weight:600;margin-bottom:6px;gap:8px}
.pp-presets{display:flex;gap:6px}
.pp-item{display:flex;gap:6px;align-items:center;font-size:12.5px;padding:2px 0 2px 2px;cursor:pointer;min-width:0}
.pp-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pp-item:hover{color:var(--brand)}
.pp-dot{width:9px;height:9px;border-radius:50%;flex:none}

/* Phase 3.5: hover readout — one background-free label PER CURVE,
 * pinned at that curve's pixel height; value white, name in the
 * curve colour, soft shadow instead of a card. */
.qch-hover{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;z-index:6;overflow:hidden}
.qch-line{position:absolute;top:34px;bottom:64px;width:1px;background:rgba(60,80,100,.45)}
.qch-time{position:absolute;top:2px;transform:translateX(-50%);font-size:11px;line-height:16px;padding:0 6px;border-radius:3px;color:#eaf4ff;background:rgba(13,20,28,.72);font-variant-numeric:tabular-nums;white-space:nowrap}
.qch-rows{position:absolute;left:0;top:0;right:0;bottom:0}
/* Each row rides a translucent dark plate: the white value stays legible
 * over dense curves / gridlines, and the plate separates neighbouring
 * rows on their own heights. */
.qch-row{position:absolute;white-space:nowrap;font-size:12px;line-height:15px;font-variant-numeric:tabular-nums;
  padding:1px 6px;border-radius:4px;background:rgba(15,23,32,.66);
  border:1px solid rgba(126,156,186,.24);box-shadow:0 1px 4px rgba(8,14,20,.32)}
.qch-row b{color:#fff;font-weight:700;margin-right:5px;letter-spacing:.2px;
  text-shadow:0 1px 1px rgba(0,0,0,.7)}
/* the name keeps the curve's own colour; a slight lift compensates the
 * dark plate so the darker palette entries (#393b79, #5254a3) still read */
.qch-row i{font-style:normal;font-weight:600;filter:brightness(1.22) saturate(1.05)}
.qch-box{position:absolute;border:1px dashed var(--brand);background:rgba(24,95,165,.12);pointer-events:none;z-index:7}

/* Phase 3.5: drag the bottom edge to resize the chart alone */
.chart-resizer{height:14px;margin:2px 0 0;cursor:row-resize;display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none}
.chart-resizer-grip{width:64px;height:4px;border-radius:2px;background:var(--border-strong)}
.chart-resizer:hover .chart-resizer-grip,.chart-resizer:active .chart-resizer-grip{background:var(--brand)}
.legend-flown{background:#ff2020!important}
.legend-ahead{background:#2fd06e!important}
/* aeronautical reference layer: legend toggle + airport name labels */
.legend-btn{background:none;border:none;padding:0;font:inherit;color:inherit;cursor:pointer;opacity:.95}
.legend-btn:hover{color:var(--text)}
.legend-btn:not(.on){opacity:.35}
.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 auto}
.legend-aero-dot{background:#22d3ee;border:1px solid #04222b;box-shadow:0 0 0 1px rgba(34,211,238,.22)}
.aero-lbl span{font-size:10px;font-weight:600;color:#e8f1fb;white-space:nowrap;pointer-events:none;
  text-shadow:0 1px 2px #000,0 0 4px #000,0 0 7px rgba(0,0,0,.85)}
#flight-details h4{margin:14px 0 6px}
.fd-sub{font-weight:600;margin:10px 0 4px;color:var(--brand)}
.fd-cycle{border:none;border-top:1px solid var(--border);border-radius:0;padding:10px 0;margin:10px 0}
/* record-integrity banner: a truncated log must look explained, not broken
 * (left rule + soft fill, no shadow, so it reads as a note inside the card) */
.fd-alerts{display:flex;flex-direction:column;gap:6px;margin:2px 0 12px}
.fd-alert{font-size:12px;line-height:1.55;padding:7px 10px;border-radius:6px;
  border-left:3px solid var(--warn);background:var(--warn-soft);color:var(--warn)}
.fd-alert b{font-weight:600;margin-right:2px;font-variant-numeric:tabular-nums}
.fd-alert-note{border-left-color:var(--text-dim);background:var(--surface-alt);color:var(--text-mid)}
/* extreme values link to their sample: click jumps the chart cursor */
.fd-jump{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;
  border-bottom:1px dashed rgba(31,119,180,.5);line-height:1.2;border-radius:1px}
.fd-jump:hover{color:var(--brand);border-bottom-color:var(--brand);background:rgba(31,119,180,.07)}
.fd-jump:active{opacity:.6}
.fd-flags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.flag{border-radius:999px;padding:2px 10px;font-size:12px;border:1px solid}
.flag-ok{background:#e7f6ec;border-color:#9ed3ab;color:#17663a}
.flag-warn{background:#fdf1e2;border-color:#f0c48a;color:#8a5a12}
.flag-note{background:#eef1f6;border-color:#c4ccd8;color:#41506a}

/* ---- Phase 3.1: stacked analysis panes / splitter / hover label / zoom band ---- */
#analysis-section{padding:14px 20px 20px;border-bottom:1px solid var(--border)}
.pane-head{font-size:14px;font-weight:500;margin:6px 0 10px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.splitter{height:12px;cursor:row-resize;display:flex;align-items:center;justify-content:center;touch-action:none;margin:2px 0;user-select:none}
.splitter-grip{width:56px;height:4px;border-radius:2px;background:var(--border-strong)}
.splitter:hover .splitter-grip,.splitter:active .splitter-grip{background:var(--brand)}
/* overflow:hidden is the last line of defence: no absolutely positioned
 * overlay (readout label, provider markers) may escape the map frame. */
.map-wrap{position:relative;overflow:hidden}
.map-hover-label{position:absolute;z-index:800;pointer-events:none;background:transparent;border:none;box-shadow:none;color:#fff;font-size:12px;line-height:1.55;white-space:pre-line;font-variant-numeric:tabular-nums;text-shadow:0 1px 3px rgba(0,0,0,.95),0 0 8px rgba(0,0,0,.75);transform:translate(-50%,-118%);padding:0}

/* ---- Phase 3.2: map playback / progress control ---- */
/* Phase 3.8: aircraft-follow toggle, top-right of the map. Sits above the
 * provider's own panes but never over the playback bar (bottom). */
.map-center-btn{position:absolute;top:10px;right:10px;z-index:860;display:flex;align-items:center;gap:5px;
  padding:5px 9px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;font-weight:600;
  color:#cfdae6;background:rgba(12,18,26,.82);border:1px solid rgba(120,145,170,.38);letter-spacing:.3px}
.map-center-btn:hover{color:#fff;border-color:rgba(120,145,170,.7)}
.map-center-btn.on{color:#08131c;background:#22d3ee;border-color:#22d3ee}
.map-center-btn.on:hover{background:#5ce1f2;border-color:#5ce1f2}
.map-playback{position:absolute;left:0;right:0;bottom:0;z-index:850;display:flex;align-items:center;gap:10px;padding:6px 12px;background:rgba(18,24,32,.82);color:#fff}
.pb-btn{background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff;border-radius:6px;padding:2px 10px;cursor:pointer;font:inherit;font-size:13px;line-height:1.5;min-width:40px;flex:none}
.pb-btn:hover{border-color:#fff}
.pb-slider{flex:1;min-width:0;accent-color:#fff;cursor:pointer}
.pb-time{font-size:12px;font-variant-numeric:tabular-nums;min-width:64px;text-align:center;flex:none}
/* Phase 3.5: playback multiplier is a <select> right in the bar */
.pb-speed-wrap{display:flex;align-items:center;gap:6px;font-size:12px;flex:none;color:#cfdae7}
.pb-speed{font:inherit;font-size:12px;color:#fff;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.45);border-radius:6px;padding:2px 4px;cursor:pointer;outline:none}
.pb-speed option{color:#111;background:#fff}
.pb-speed:hover{border-color:#fff}

/* ---- Phase 3.4: map row + G1000-style instrument cluster ---- */
.map-row{display:flex;align-items:stretch}
.map-row .map-wrap{flex:1;min-width:0}
/* The cluster is two fixed-viewBox SVGs stacked in a fixed-width
 * cockpit-dark column, so it scales as one unit and never sizes the
 * map row: the column takes its height FROM the row (stretch) and the
 * panels share it 1.62:1.08 — a ratio chosen to match the 340x310 and
 * 340x190 viewBoxes, so neither panel is letterboxed much. */
.instruments{width:352px;flex:none;border-left:1px solid var(--border);background:#070b10;padding:7px;display:flex;flex-direction:column;gap:6px;min-height:0;overflow:hidden}
.inst-block{display:flex;flex-direction:column;justify-content:center;min-height:0}
.inst-block-pfd{flex:1.62 1 0}
.inst-block-hsi{flex:1 1 0}
.inst-svg{width:100%;height:100%;display:block}
.inst-off{opacity:.3;filter:grayscale(1)}
.inst-note{flex:none;font-size:11px;color:#8b97a8;padding:1px 2px}
#sidebar-toggle{flex:none;margin-right:10px}
@media (max-width: 900px){
  .map-row{flex-direction:column}
  .instruments{width:auto;border-left:none;border-top:1px solid var(--border);flex-direction:row;flex-wrap:wrap}
  .inst-block{flex:1 1 300px}
  .inst-svg{height:auto}
}

/* ---- misc: 检查分组标题 / 用户管理列表 ---- */
.check-group{margin:12px 0 4px;color:var(--text-mid)}
.check-group:first-child{margin-top:4px}
.admin-user{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:5px 0;border-bottom:1px solid var(--border);font-size:13px}
.admin-user>span{flex:1;min-width:200px}

/* ---------- cloud flight picker / modal (Phase 3.12) ---------- */
.foqa-open { margin-top: 10px; }

.modal-wrap {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 20, 30, .58); }
.modal-card {
  position: relative; width: min(820px, 100%); max-height: min(86vh, 760px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(16, 24, 40, .22);
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 20px 14px; border-bottom: 1px solid var(--border);
}
.modal-head-text { min-width: 0; }
.modal-title { font-size: 15px; font-weight: 500; }
.modal-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.modal-x {
  border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 7px; border-radius: 6px;
  color: var(--text-dim);
}
.modal-x:hover { background: var(--surface-alt); color: var(--text); }
.modal-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 20px 6px; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px;
  border-top: 1px solid var(--border); background: var(--surface-alt);
}

.foqa-filters {
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.2fr);
}
.foqa-filters .field { margin-bottom: 10px; }
.foqa-stat { font-size: 12px; color: var(--text-mid); min-height: 18px; margin-bottom: 8px; }
.foqa-list {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: auto; max-height: 42vh;
}
.foqa-empty { padding: 30px 16px; text-align: center; font-size: 13px; color: var(--text-dim); }
.foqa-empty.err { color: var(--err); }
.foqa-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.foqa-table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-alt); text-align: left;
  font-weight: 400; font-size: 12px; color: var(--text-mid);
  padding: 7px 10px; border-bottom: 1px solid var(--border);
}
.foqa-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.foqa-table tbody tr { cursor: pointer; }
.foqa-table tbody tr:hover { background: var(--brand-soft); }
.foqa-table tbody tr.sel { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.foqa-table tbody tr:last-child td { border-bottom: none; }
.foqa-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--text-mid);
}
.foqa-table .dim { font-size: 12px; color: var(--text-dim); }
.foqa-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-mid); }
.foqa-actions { display: flex; gap: 8px; }

/* ---------- approach debrief (js/approach.js) ---------- */
.ap-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.ap-summary > div {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.ap-summary b { display: block; font-size: 20px; line-height: 1.2; color: var(--brand); font-weight: 600; }
.ap-summary span { font-size: 11px; color: var(--text-dim); }
.ap-block { margin-top: 18px; }
.ap-block > h4, .ap-notes > summary { font-size: 13px; font-weight: 600; color: var(--text-mid); margin: 0 0 8px; }
.ap-phases { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-phase {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  background: var(--brand-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px; cursor: pointer;
  font: inherit; color: var(--text);
}
.ap-phase:hover:not(:disabled) { border-color: var(--brand); }
.ap-phase:disabled { opacity: .55; cursor: default; }
.ap-phase b { font-size: 12px; font-weight: 600; }
.ap-phase span, .ap-phase em { font-size: 10px; font-style: normal; color: var(--text-mid); }
.ap-hint, .ap-muted { font-size: 11px; color: var(--text-dim); }
.ap-hint { margin-top: 6px; }
.ap-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 14px 16px; margin-top: 12px;
}
.ap-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ap-num { font-size: 32px; font-weight: 700; line-height: 1; }
.ap-num small { font-size: 12px; font-weight: 400; color: var(--text-dim); margin-left: 2px; }
.ap-badge { color: #fff; border-radius: 20px; padding: 2px 10px; font-size: 12px; }
.ap-stable { font-size: 12px; padding: 2px 9px; border-radius: 20px; }
.ap-stable.yes { color: var(--ok); background: var(--ok-soft); }
.ap-stable.no { color: var(--warn); background: var(--warn-soft); }
.ap-meta { margin-left: auto; font-size: 11px; color: var(--text-mid); }
.ap-quality {
  margin-top: 10px; padding: 7px 10px; font-size: 12px;
  color: var(--warn); background: var(--warn-soft); border-radius: var(--radius);
}
.ap-dims { display: grid; gap: 5px; margin-top: 12px; }
.ap-dim {
  display: grid; grid-template-columns: 76px 150px 30px 1fr;
  gap: 10px; align-items: center; font-size: 12px;
}
.ap-dimname { color: var(--text-mid); }
.ap-dimbar { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.ap-dimbar i { display: block; height: 100%; border-radius: 4px; }
.ap-dimval { text-align: right; font-weight: 600; }
.ap-dimdetail { color: var(--text-dim); font-size: 11px; }
.ap-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
.ap-metrics > div { display: flex; flex-direction: column; }
.ap-metrics b { font-size: 14px; font-weight: 600; }
.ap-metrics span { font-size: 10px; color: var(--text-dim); }
.ap-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ap-chip { border: 1px solid; border-radius: 20px; padding: 1px 9px; font-size: 11px; }
.ap-jump { margin-top: 10px; }
.ap-table-wrap { overflow-x: auto; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ap-table th {
  text-align: left; font-weight: 400; font-size: 11px; color: var(--text-mid);
  background: var(--surface-alt); padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.ap-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ap-table tr.ap-susp { opacity: .5; }
.ap-prof-title { font-size: 11px; color: var(--text-mid); margin-top: 8px; }
.ap-prof { width: 100%; height: 150px; display: block; }
.ap-profleg { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; margin-top: 2px; }
/* 进近讲评默认折叠：评分表 / 剖面图较长，点标题才展开，避免撑长页面。 */
.ap-fold > summary { list-style: none; cursor: pointer; }
.ap-fold > summary::-webkit-details-marker { display: none; }
.ap-fold > summary.card-head { margin-bottom: 0; }
.ap-fold[open] > summary.card-head { margin-bottom: 14px; }
.ap-fold-hint { font-size: 11px; font-weight: 400; color: var(--text-dim); flex: none; }
.ap-fold-hint::after { content: '点击展开 ▾'; }
.ap-fold[open] .ap-fold-hint::after { content: '点击收起 ▴'; }
.ap-notes { margin-top: 18px; font-size: 12px; color: var(--text-mid); }
.ap-notes > summary { cursor: pointer; }
.ap-notes ul { margin: 6px 0 0; padding-left: 20px; }
.ap-notes li { margin-bottom: 4px; }
.ap-notes code { font-size: 11px; background: var(--surface-alt); padding: 1px 4px; border-radius: 3px; }

@media (max-width: 720px) {
  .foqa-filters { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column; align-items: stretch; }
  .foqa-actions { justify-content: flex-end; }
  .ap-summary, .ap-metrics { grid-template-columns: repeat(2, 1fr); }
  .ap-dim { grid-template-columns: 70px 1fr 26px; }
  .ap-dimdetail { grid-column: 1 / -1; }
  .ap-meta { margin-left: 0; width: 100%; }
}
