/* =============================================================================
   vatds-restore.css
   -----------------------------------------------------------------------------
   RECONSTRUCTION FILE. A prior edit accidentally truncated the main
   `public/css/vatds.css` and a large chunk of VATDS-specific component styles
   was lost. This file restores those styles using ONLY design tokens from
   `public/css/variables.css`, and reuses the base component primitives from
   `public/css/main.css` (`.card`, `.btn`, `.badge`, `.table`, `.sidebar-item`,
   etc.) — see CLAUDE.md § "Frontend workflow" for the visual contract.

   These rules were written fresh from the EJS markup that uses them, so small
   cosmetic tweaks may be required after side-by-side comparison with CHub.
   Long-term plan: once every section here has been visually validated, merge
   the content back into `vatds.css` and delete this file. The <link> tag for
   it lives in `views/layout.ejs`, directly below the `vatds.css` <link>.

   Notes on the input list (`undefined-classes.txt`):
     - A handful of entries are NOT real class names — they are word fragments
       captured by the grep that produced the file (e.g. `body`, `row`, `num`,
       `center`, `code`, `dark`, `admin`, `facility`, `dashboard`, `rw`,
       `ize`, `lass`, `ount`, `tier`, `path`, `tr`, `ith`, `has`, `join`,
       `ins`, `ize`, `starts`, `position_type`, `metering`, `metering_enabled`,
       `is_on`, `writable`, `classes`, `class`, `num`). They are excluded.
     - `ids-atis-cell-`, `ids-atis-flow`, `ids-empty`, `rwy-card-`, `pos-type-`,
       `badge-`, `ids`, `pinned`, `airport`, `checklists`, `references`,
       `positions-grid`, `position-ids-items`, `has-visible-chart` — these
       are either already defined in `vatds.css` (ids-*) or added below.
     - Tokens referenced: --card, --border, --foreground, --muted-foreground,
       --brand, --brand-muted, --brand-subtle, --brand-ring, --sidebar,
       --sidebar-foreground, --sidebar-accent, --sidebar-border,
       --sidebar-muted-foreground, --secondary, --muted, --radius, --radius-sm,
       --radius-md, --radius-lg, --radius-full, --shadow-sm, --shadow-md,
       --shadow-lg, --transition-fast, --transition-normal, --z-dropdown,
       --z-modal, --success, --warning, --danger, --info.
   ============================================================================= */


/* =============================================================================
   === Solid badge variants ===
   `main.css` defines outlined badges only (.badge-outline, .badge-brand, ...).
   VATDS needs filled/solid counterparts and type-keyed position badges.
   ============================================================================= */

.badge-brand-solid {
  background-color: var(--brand);
  color: var(--brand-foreground);
  border-color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.badge-info-solid {
  background-color: var(--info);
  color: var(--info-foreground);
  border-color: var(--info);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.badge-success-solid {
  background-color: var(--success);
  color: var(--success-foreground);
  border-color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.badge-warning-solid {
  background-color: var(--warning);
  color: var(--warning-foreground);
  border-color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* Position-type keyed pill (used in the positions table). Tints mirror the
   IDS group badges in vatds.css. */
.badge-local {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-tracon {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-enroute {
  color: #c4b5fd;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-tmu {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* =============================================================================
   === Chips (pill tags + custom pill-style checkboxes) ===
   - `.chip` is a small inline tag used to display airports-of-responsibility.
   - `.chip-check` wraps a hidden `<input type="checkbox">` in a styled label
     that toggles brand fill when checked (used in the admin position editor).
   ============================================================================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--secondary);
  color: var(--foreground);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  line-height: 1.2;
  white-space: nowrap;
}

.chip-sm {
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  margin-right: 0.2rem;
  margin-bottom: 0.15rem;
}

.chip-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.chip-check:hover {
  border-color: var(--brand-ring);
  color: var(--foreground);
}

/* Hide the actual checkbox but keep it accessible. */
.chip-check input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.chip-check:has(input[type="checkbox"]:checked) {
  background: var(--brand-muted);
  color: var(--brand);
  border-color: var(--brand);
}

.chip-check:has(input[type="checkbox"]:focus-visible) {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}


/* =============================================================================
   === Tab bar (admin tabs) ===
   Horizontal pill-underline tab bar used in `views/admin/facility-config.ejs`
   and `views/admin/ids-config.ejs`.
   ============================================================================= */

.tab-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.tab-panel {
  min-height: 100px;
}


/* =============================================================================
   === Form grids ===
   `.form-grid` is responsive auto-fit for general use. `.form-grid-2` and
   `.form-grid-3` pin to fixed column counts and collapse gracefully.
   ============================================================================= */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

@media (max-width: 640px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =============================================================================
   === KPI tiles (facility + position dashboards) ===
   ============================================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  min-height: 84px;
  justify-content: center;
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  line-height: 1;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi-value-sm {
  font-size: 1.25rem;
}

.kpi-value.is-brand { color: var(--brand); }
.kpi-value.is-muted { color: var(--muted-foreground); }

/* Prefiled-plans stacked arrow/count (two stacked counts inside one tile). */
.kpi-prefile-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.kpi-prefile-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.kpi-prefile-arrow {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  line-height: 1;
}

/* Zulu clock — monospaced so the seconds don't jitter the layout. */
.zulu-clock {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}


/* =============================================================================
   === Facility dashboard grid (map + right column) ===
   ============================================================================= */

.facility-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  /* Default grid `align-items` is `stretch`, which is what we want here:
     the map card stretches to match the right column's natural height so
     the bottom of the map aligns with the bottom of the ATIS card. */
}

@media (max-width: 900px) {
  .facility-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Map card flex chain so the inner #facilityMap can fill 100% of the cell.
   `min-height` is the floor when the right column is shorter than 460px
   (e.g. on a tall viewport with no controllers online). */
.facility-map-card {
  display: flex;
  flex-direction: column;
  min-height: 460px;
}

.facility-map-card .card-content {
  padding: 0;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.facility-map-card #facilityMap,
.facility-map-card .vatds-map {
  width: 100%;
  flex: 1;
  min-height: 460px;
  background: var(--background);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.facility-right-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Map legend pinned inside the map card (bottom-left). */
.map-legend {
  position: absolute;
  bottom: 0.65rem;
  left: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  color: var(--foreground);
  z-index: 400;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Colored dots for arrivals/departures/overflights/VFR. */
.flight-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-foreground);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.flight-dot.arrival    { background: var(--success); }
.flight-dot.departure  { background: var(--brand); }
.flight-dot.overflight { background: var(--info); }
.flight-dot.vfr        { background: var(--warning); }


/* =============================================================================
   === Online Now list (facility dashboard) ===
   ============================================================================= */

.online-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
}

.online-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.online-row:first-child { border-top: 0; }

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  margin-top: 0.45rem;
  flex-shrink: 0;
  animation: vatds-pulse 2s ease-in-out infinite;
}

.online-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.online-top {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.online-callsign {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  letter-spacing: 0.01em;
}

.online-freq {
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.online-sub {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  min-width: 0;
}

.online-since {
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  white-space: nowrap;
}


/* =============================================================================
   === ATIS & Flow list (facility dashboard + enroute dashboard) ===
   ============================================================================= */

.atis-flow-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.atis-flow-row:first-child { border-top: 0; }

.atis-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-muted);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: var(--radius-md);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.atis-badge.offline {
  color: var(--muted-foreground);
  background: transparent;
  border-color: var(--border);
}

.atis-flow-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.atis-flow-icao {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--foreground);
  letter-spacing: 0.02em;
}

.atis-flow-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
  flex-shrink: 0;
  min-width: 0;
  max-width: 55%;
}

/* Stacked pill rows inside .atis-flow-pills (rendered by facility-dashboard.js). */
.runway-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-end;
}

.runway-stack-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}


/* =============================================================================
   === Approach / Runway pills ===
   Used in ATIS cells and the facility ATIS-flow list.
   ============================================================================= */

.approach-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--info);
  background: var(--info-muted);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.runway-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
}

.runway-pill.landing {
  color: var(--success);
  background: var(--success-muted);
  border-color: rgba(34, 197, 94, 0.4);
}

.runway-pill.departing {
  color: var(--brand);
  background: var(--brand-muted);
  border-color: rgba(249, 115, 22, 0.4);
}


/* =============================================================================
   === Section eyebrow ===
   Small uppercase heading used above ungrouped content (references, charts,
   training modal groups).
   ============================================================================= */

.section-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.5rem;
}


/* =============================================================================
   === References list (facility/references.ejs) ===
   ============================================================================= */

.references-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
}

.references-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Cards rendered as anchor tags (the whole card is a link). */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.card-link:hover {
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}

.card-link:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}


/* =============================================================================
   === TMU dashboard ===
   ============================================================================= */

.tmu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.tmu-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tmu-card-disabled {
  opacity: 0.65;
}

.tmu-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.tmu-metric-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.tmu-metric-value {
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--foreground);
}

.tmu-metric-sub {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-top: 0.1rem;
  font-variant-numeric: tabular-nums;
}

/* Full-width metric row inside the TMU grid (e.g. Flow, Ground delays). */
.tmu-row-sep {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

@media (max-width: 560px) {
  .tmu-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* =============================================================================
   === Positions admin — tree + two-column grid ===
   ============================================================================= */

.positions-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .positions-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pos-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pos-tree-root > .pos-tree-node,
.pos-tree-root > li {
  margin-top: 0;
}

.pos-tree-list .pos-tree-list {
  margin-left: 0.85rem;
  padding-left: 0.85rem;
  border-left: 1px dashed var(--border);
}

.pos-tree-node {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  min-width: 0;
}

.pos-tree-node strong {
  color: var(--foreground);
  font-weight: 600;
}

/* Type badge sits inline with the callsign in the tree node. */
.pos-tree-type {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted-foreground);
  line-height: 1;
  flex-shrink: 0;
}

.pos-tree-type.pos-type-local    { color: #fdba74; background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.45); }
.pos-tree-type.pos-type-tracon   { color: #93c5fd; background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.45); }
.pos-tree-type.pos-type-enroute  { color: #c4b5fd; background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.45); }
.pos-tree-type.pos-type-tmu      { color: #fde68a; background: rgba(234,179,8,0.12);  border-color: rgba(234,179,8,0.45); }


/* =============================================================================
   === Training Mode (sidebar slot + picker modal) ===
   ============================================================================= */

.sidebar-training {
  padding: 0.5rem 0.75rem 0.25rem;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-training .sidebar-item {
  /* Keep consistent with other sidebar items but slightly de-emphasized. */
  color: var(--sidebar-muted-foreground);
}

.training-chip {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.6rem;
  background: var(--brand-muted);
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: var(--radius-md);
  color: var(--foreground);
}

.training-chip-active {
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.25);
}

.training-chip-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.training-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
  animation: vatds-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

.training-chip-label {
  flex: 1;
}

.training-chip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.training-chip-body {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--foreground);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-chip-exit {
  flex-shrink: 0;
  height: 28px;
  padding: 0 0.55rem;
  font-size: 0.7rem;
}

/* Training Mode picker modal contents */
.training-group + .training-group {
  margin-top: 0.75rem;
}

.training-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 0.4rem;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.training-option:hover {
  background: var(--muted);
  border-color: var(--brand-ring);
}

.training-option input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.training-option:has(input[type="radio"]:checked) {
  background: var(--brand-muted);
  border-color: var(--brand);
}

.training-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.training-option-body strong {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--foreground);
  letter-spacing: 0.01em;
}


/* =============================================================================
   === Modal overlay ===
   Shared primitive used by training-mode modal and PIREP modal.
   ============================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: var(--z-modal);
  animation: fadeIn var(--transition-fast) ease-out;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slide-up var(--transition-normal) ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}


/* =============================================================================
   === Quick Action flyout (sidebar → slide-out panel) ===
   Triggered by `.quick-action-trigger` in the sidebar. Panel is fixed, slides
   out from the right edge of the sidebar.
   ============================================================================= */

.quick-action-trigger {
  /* Layer on top of .sidebar-item — just align chevron and expanded state. */
}

.quick-action-trigger > span:not(.sidebar-icon) {
  flex: 1;
  text-align: left;
}

.quick-action-trigger.is-flyout-open {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.quick-action-trigger.is-flyout-open .quick-action-chevron {
  transform: rotate(90deg);
  color: var(--brand);
}

.quick-action-chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.quick-action-flyout {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  bottom: 0;
  width: 360px;
  max-width: calc(100vw - var(--sidebar-width) - 1rem);
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  transform: translateX(-8px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--transition-normal),
    opacity var(--transition-normal);
}

.quick-action-flyout.is-open,
.quick-action-flyout[aria-hidden="false"] {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.quick-action-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.quick-action-flyout-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sidebar-foreground);
  letter-spacing: 0.01em;
}

.quick-action-flyout-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--sidebar-muted-foreground);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.quick-action-flyout-close:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-foreground);
}

.quick-action-flyout-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
}

/* Charts flyout search bar — sticky below the header so it stays visible
   while the airport/category drill-down scrolls under it. The '/' shortcut
   opens the flyout and focuses the input. */
.charts-search-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0.25rem 0.5rem;
  margin: 0 0 0.25rem;
  background: var(--popover, var(--card));
  border-bottom: 1px solid var(--border);
}
.charts-search-input {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.charts-search-hint {
  min-height: 1em;
  padding: 0 0.1rem;
  font-size: 0.72rem;
}
#quickActionFlyoutContent { flex: 1 1 auto; }

.quick-action-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  font-style: italic;
}

.quick-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.quick-action-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
}

.quick-action-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--sidebar-foreground);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.quick-action-item:hover {
  background: var(--sidebar-accent);
}

.quick-action-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.quick-action-item-body strong {
  font-weight: 600;
  color: var(--sidebar-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-action-item-body .text-sm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Drill-down: airports → categories → items. */
.qa-drill .qa-drill-item {
  /* Reuses .quick-action-item; nothing extra needed beyond inheriting size. */
}

.qa-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0.75rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--sidebar-muted-foreground);
}

.qa-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: var(--sidebar-foreground);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.qa-back:hover {
  background: var(--sidebar-accent);
  border-color: var(--brand-ring);
}

.qa-crumb-current {
  font-weight: 600;
  color: var(--sidebar-foreground);
  /* Category color passed through as `--chart-cat` inline style. */
  border-left: 3px solid var(--chart-cat, var(--brand));
  padding-left: 0.5rem;
}

.qa-chev {
  display: inline-flex;
  align-items: center;
  color: var(--sidebar-muted-foreground);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.qa-drill-item:hover .qa-chev { transform: translateX(2px); color: var(--brand); }

/* Category row: colored dot from `--chart-cat` inline style. */
.qa-cat-row {
  /* Inherit .quick-action-item base. */
}

.qa-cat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chart-cat, var(--brand));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

/* Chart row: slender vertical color bar on the left. */
.qa-chart-row {
  position: relative;
  padding-left: 0.85rem;
}

.qa-cat-bar {
  position: absolute;
  left: 0.25rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 3px;
  border-radius: var(--radius-full);
  background: var(--chart-cat, var(--brand));
  flex-shrink: 0;
}

/* Pin toggle button (the thumbtack on each flyout row). */
.pin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-top: 0.15rem;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--sidebar-muted-foreground);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.pin-toggle:hover {
  background: var(--sidebar-accent);
  color: var(--foreground);
}

.pin-toggle.is-pinned {
  color: var(--brand);
  background: var(--brand-muted);
  border-color: rgba(249, 115, 22, 0.35);
}

/* Mobile — flyout covers full width below the header. */
@media (max-width: 768px) {
  .quick-action-flyout {
    left: 0;
    width: 100vw;
    max-width: 100vw;
    top: var(--header-height);
  }
}


/* =============================================================================
   === Pin bar / chart dock ===
   Bottom-of-viewport pinned chart dock. The `.chart-card` uses an inline
   custom property `--pin-color` for its top accent border.
   ============================================================================= */

.pin-bar {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-sticky) - 2);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transition: transform var(--transition-normal);
}

.pin-bar > * {
  pointer-events: auto;
}

.pin-bar[hidden] {
  display: none;
}

/* Charts row: transparent backdrop that holds one .chart-card per visible pin.
   Hidden until at least one chart is pinned (JS toggles `has-visible-chart`). */
.dock-charts-row {
  display: none;
  flex-direction: row;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  max-height: 55vh;
  overflow-x: auto;
  overflow-y: hidden;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  align-items: flex-end;
}

.pin-bar.has-visible-chart .dock-charts-row {
  display: flex;
}

.chart-card {
  position: relative;
  display: flex;
  flex-direction: column;
  /* FAA terminal procedure paper is 5.375" × 8.25" (portrait, aspect ≈ 0.6515).
     Height drives layout; width derives from the chart aspect so the body
     displays the whole chart without letterboxing. */
  height: 540px;
  max-height: 62vh;
  width: calc(540px * 5.375 / 8.25);
  max-width: 48vw;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-top: 3px solid var(--pin-color, var(--brand));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-shrink: 0;
}

/* Rotation outer dimensions are applied as inline styles by panels.js
   wireCard() — it measures the title-bar height and swaps body_w ↔ body_h
   precisely, so the body aspect is the inverse of the pre-rotation aspect
   (matching the rotated chart). No CSS rule here on purpose. */

.chart-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  min-width: 0;
}

.chart-card-title-text {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--foreground);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.chart-card-rotate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.chart-card-rotate:hover {
  color: var(--foreground);
  background: var(--muted);
}

.chart-card-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--background);
  overflow: hidden;
}

.chart-card-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Rotation is applied to the iframe by panels.js applyRotation() (which also
   swaps iframe width/height so rotated content fits the body exactly). No CSS
   transforms here — a second rotation on top of the JS one double-rotates. */

/* Tabs row: always visible when the pin-bar is shown — one tab per pin. */
.dock-tabs-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  background: var(--sidebar);
  border-top: 1px solid var(--sidebar-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 38px;
}

.dock-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-top: 2px solid var(--pin-color, var(--brand));
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.dock-tab:hover {
  background: var(--secondary);
}

.dock-tab.is-active {
  background: var(--brand-muted);
  color: var(--foreground);
  border-color: var(--pin-color, var(--brand));
}

.dock-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.dock-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  color: var(--muted-foreground);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dock-tab-close:hover {
  background: var(--danger-muted);
  color: var(--danger);
}

.pin-bar-hint {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--muted-foreground);
  font-style: italic;
}

/* `display: inline-flex` above overrides the UA stylesheet's default
   `[hidden] { display: none }`. Restore it explicitly so the hint disappears
   when JS (or server-side EJS) sets the `hidden` attribute. */
.pin-bar-hint[hidden] {
  display: none;
}

/* Individual chart-card toggle state. The per-tab click handler toggles
   `.is-hidden` on the card only — other pinned cards stay visible. */
.chart-card.is-hidden {
  display: none;
}

/* Mobile — pin-bar spans full viewport and chart cards shrink while keeping
   the chart's portrait/landscape aspect ratio. */
@media (max-width: 768px) {
  .pin-bar {
    left: 0;
  }
  .chart-card {
    height: 400px;
    max-height: 55vh;
    width: calc(400px * 5.375 / 8.25);
    max-width: 85vw;
  }
}


/* =============================================================================
   === QRG switcher + popup ===
   ============================================================================= */

.qrg-switcher {
  /* Thin sticky sidebar on /position/qrgs. */
  min-width: 0;
}

.qrg-switcher .card-content ul {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
}

.qrg-switcher .sidebar-item {
  margin: 0.1rem 0;
}

/* QRG popup window shell — exists in both vatds.css (originally) and the
   inline <style> in views/position/qrg-popup.ejs. These rules remain as a
   fallback in case someone includes vatds-restore in a future popup route. */
.qrg-popup-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.qrg-popup-body {
  padding: 1rem 1.25rem 2rem;
  max-width: 860px;
  margin: 0 auto;
}

/* Chart popup toolbar (view-only chart window) */
.chart-popup-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}


/* =============================================================================
   === Markdown body ===
   Rendered reference / QRG content. Mirrors the `.prose` rules in main.css
   but scoped to a narrower selector so reference detail pages can opt in
   without pulling every other prose rule.
   ============================================================================= */

.markdown-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--foreground);
}

.markdown-body > *:first-child { margin-top: 0; }
.markdown-body > *:last-child  { margin-bottom: 0; }

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.5em 0 0.5em;
  color: var(--foreground);
}

.markdown-body h1 { font-size: 1.4rem; }
.markdown-body h2 { font-size: 1.2rem; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body h4 { font-size: 1rem; }

.markdown-body p {
  margin: 0 0 1em;
}

.markdown-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }

.markdown-body li {
  margin-bottom: 0.35em;
}

.markdown-body blockquote {
  margin: 1em 0;
  padding: 0.65em 1em;
  border-left: 3px solid var(--brand);
  background: var(--muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.35em;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.markdown-body pre {
  margin: 1em 0;
  padding: 1em;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.85rem;
}

.markdown-body pre code {
  padding: 0;
  background: none;
  border: 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.85rem;
}

.markdown-body table th,
.markdown-body table td {
  padding: 0.5em 0.75em;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-body table th {
  background: var(--muted);
  font-weight: 600;
}

.markdown-body hr {
  margin: 1.5em 0;
  border: 0;
  border-top: 1px solid var(--border);
}


/* =============================================================================
   === Table utility helpers ===
   Small cell alignment classes used in admin tables.
   ============================================================================= */

.table th.num,
.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table th.center,
.table td.center {
  text-align: center;
}


/* =============================================================================
   === Shared keyframes ===
   ============================================================================= */

@keyframes vatds-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.92); }
}

/* `fadeIn` and `slide-up` already exist in main.css — no redefinition needed. */


/* =============================================================================
   === Floating chart / QRG panels ===
   Built at runtime by public/js/panels.js. Each panel is an absolutely-
   positioned window with a draggable header, an iframe body, and a
   bottom-right resize handle. `--panel-accent` is set inline from the
   chart category color so the header stripe matches the flyout swatch.
   ============================================================================= */

.panel {
  position: fixed;
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 0.5rem);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  z-index: 100;
  min-width: 320px;
  min-height: 240px;
}

.panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.panel.is-focused {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
  border-color: var(--panel-accent, var(--border));
}

.panel.is-dragging {
  transition: none;
  cursor: grabbing;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem 0.5rem 0.85rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  flex: 0 0 auto;
  position: relative;
}

.panel-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--panel-accent, transparent);
}

.panel.is-dragging .panel-header {
  cursor: grabbing;
}

.panel-titles {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
  overflow: hidden;
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-subtitle {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 0.35rem);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.panel-btn:hover {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--border);
}

.panel-btn.panel-close {
  font-size: 1.25rem;
  font-weight: 500;
}

.panel-btn.panel-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

.panel-btn.panel-pin.is-pinned {
  color: var(--brand, #38bdf8);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

.panel-body {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: var(--background);
}

.panel-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--background);
}

.panel-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  background:
    linear-gradient(135deg,
      transparent 0,
      transparent 45%,
      var(--muted-foreground) 45%,
      var(--muted-foreground) 55%,
      transparent 55%,
      transparent 70%,
      var(--muted-foreground) 70%,
      var(--muted-foreground) 80%,
      transparent 80%);
  opacity: 0.6;
  z-index: 1;
}

.panel-resize:hover {
  opacity: 1;
}

#vatdsPanelRoot {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

#vatdsPanelRoot > .panel {
  pointer-events: auto;
}


/* =============================================================================
   === SimTraffic unified table (facility dashboard Arrivals & Departures) ===
   The table is rendered by renderSimTraffic() in public/js/facility-dashboard.js.
   Two header tiers need visual distinction from the data rows:
     1. The <thead> column-titles row (Callsign / Type / Origin / etc).
     2. The .st-airport-header rows (one per airport, spanning all columns).
   We give each its own subtle dark background using existing CSS tokens so the
   table groups read clearly without inventing new colors.
   ============================================================================= */

/* Column-title row — slightly raised from the data rows. */
.st-unified-table thead th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}

/* Per-airport header row — darker than thead so it visibly delimits each
   airport's group of flights. Uses --secondary which sits between --card
   and --muted in the dark palette. */
.st-unified-table .st-airport-header > th {
  background: var(--secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  height: auto;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  color: var(--foreground);
  font-weight: 600;
}

/* Reset the global .table tbody tr:hover for header / empty rows so the
   airport-grouping background stays put when the cursor is over them. */
.st-unified-table tbody tr.st-airport-header:hover > th,
.st-unified-table tbody tr.st-empty-row:hover > td {
  background: var(--secondary);
}
.st-unified-table tbody tr.st-empty-row > td {
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
}

/* Header row internal layout: airport identity on the LEFT, A/D counts and
   the SimTraffic status strip on the RIGHT. The right group is wrapped in
   .st-airport-header-right and pushed away from the airport name with
   margin-left:auto so there's clear visual separation between the two. */
.st-airport-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: wrap;
}

.st-airport-header-left {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
}

.st-airport-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.st-airport-icao {
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--foreground);
}

.st-airport-name {
  font-size: 0.78rem;
  font-weight: 400;
}

.st-airport-counts {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.st-airport-strip {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted-foreground);
}

.st-airport-strip.is-disabled {
  color: var(--muted-foreground);
  font-style: italic;
}

/* Data rows: subtle hover already comes from the global .table tbody tr:hover.
   The arrival/departure direction chip styling lives with the rest of the
   .dir-chip rules elsewhere in the CSS. */
.st-row td {
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
}

.time-label {
  color: var(--muted-foreground);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}

.time-label.time-edct {
  color: var(--brand);
}

.time-muted {
  color: var(--muted-foreground);
  font-style: italic;
}
