:root {
  --amber: #FFB000;
  --amber-dim: #9a7020;
  --amber-glow: rgba(255, 176, 0, 0.12);
  --amber-bright: #FFD060;
  --bg: #0c0d0e;
  --bg2: #111213;
  --bg3: #161718;
  --border: #1e1f20;
  --border-active: #272829;
  --text-dim: #404244;
  --green: #39FF14;
  --red: #FF3B3B;

  /* ── Split-flap card ── */
  --flap-bg:      #111213;
  --flap-section: #0e0f10;
  --flap-tile:    #1b1b1b;
  --flap-border:  #1a1a1a;
  --flap-divider: #181818;
  --flap-text:    #f2ede3;
  --flap-sub:     #aaa89e;
  --flap-label:   #3a3830;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--amber);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  cursor: crosshair;
}

/* CRT scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px);
  pointer-events: none;
  z-index: 9000;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 8999;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Views ── */
.view { min-height: 100vh; }

body.electron #view-about,
body.electron #view-prefs {
  min-height: unset;
  height: 100vh;
  overflow-y: auto;
}

body.electron .app-shell {
  padding-bottom: 32px;
}

/* ════════════════════════════════════════
   SHARED LAYOUT
════════════════════════════════════════ */
.app-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

/* ── App header ── */
.app-header {
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.logo {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.15em;
  text-shadow: 0 0 16px rgba(255,176,0,0.2);
  animation: flicker 9s infinite;
}

.logo-sub {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--flap-label);
  margin-top: 3px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--flap-sub);
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: 'Share Tech Mono', monospace;
}

.nav-link:hover,
.nav-link.active-nav {
  color: var(--flap-text);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 2s step-end infinite;
  flex-shrink: 0;
}

/* ── Section label ── */
.section-label {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--flap-label);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ════════════════════════════════════════
   SETTINGS PANEL
════════════════════════════════════════ */
.settings-panel {
  background: var(--flap-bg);
  border: 1px solid var(--flap-divider);
  padding: 16px 18px;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setting-label {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--flap-sub);
  text-transform: uppercase;
  flex-shrink: 0;
  width: 100px;
}

/* Segmented toggle — dark tiles, amber active */
.seg {
  display: flex;
  border: 1px solid #0c0c0c;
  flex: 1;
  overflow: hidden;
}

.seg input[type="radio"] { display: none; }

.seg label {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flap-text);
  background: var(--flap-tile);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  border-right: 1px solid #0c0c0c;
  line-height: 1;
  white-space: nowrap;
}

.seg label:last-of-type { border-right: none; }

.seg input[type="radio"]:checked + label {
  background: var(--amber);
  color: #080604;
}

.seg label:hover { color: var(--flap-text); }

.seg input[type="radio"]:checked + label:hover {
  color: #080604;
  background: var(--amber-bright);
}

.seg-multi input[type="checkbox"] { display: none; }
.seg-multi input[type="checkbox"]:checked + label { background: var(--amber); color: #080604; }
.seg-multi input[type="checkbox"]:checked + label:hover { color: #080604; background: var(--amber-bright); }

.divider {
  height: 1px;
  background: var(--flap-divider);
  margin: 0;
}

/* Advanced collapsible */
.advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 6px 10px;
  background: var(--flap-tile);
  border: 1px solid #0c0c0c;
  transition: background 0.12s;
}

.advanced-toggle::-webkit-details-marker { display: none; }
.advanced-toggle:hover { background: #222; }

.advanced-label {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--flap-sub);
  text-transform: uppercase;
}

.advanced-arrow {
  font-size: 10px;
  color: var(--flap-sub);
  letter-spacing: 0;
  transition: transform 0.15s;
}

details[open] .advanced-arrow { transform: rotate(90deg); }

.advanced-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--flap-divider);
  margin-top: 4px;
}

/* Range filter — dual slider */
.dual-range-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dual-range-slider {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.dual-range-track {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: var(--flap-tile);
  border: 1px solid #0c0c0c;
}

.dual-range-fill {
  position: absolute;
  height: 3px;
  background: var(--amber);
  pointer-events: none;
}

.dual-range-input {
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0;
  z-index: 3;
}

.dual-range-input.dual-range-max { z-index: 4; }
.dual-range-input:active          { z-index: 5 !important; }

.dual-range-input::-webkit-slider-runnable-track { background: transparent; }

.dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: all;
  width: 12px;
  height: 20px;
  background: var(--amber);
  border: 1px solid rgba(0,0,0,0.6);
  cursor: ew-resize;
  border-radius: 0;
}

.dual-range-input:focus-visible::-webkit-slider-thumb {
  outline: 1px solid var(--amber-bright);
  outline-offset: 1px;
}

.dual-range-input::-moz-range-track  { background: transparent; height: 3px; }
.dual-range-input::-moz-range-thumb  {
  appearance: none;
  pointer-events: all;
  width: 12px;
  height: 20px;
  background: var(--amber);
  border: 1px solid rgba(0,0,0,0.6);
  border-radius: 0;
  cursor: ew-resize;
}

.dual-range-values {
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--flap-sub);
  letter-spacing: 0.06em;
}

.range-val-any { color: var(--text-dim); }

/* Departure region select */
.region-select {
  flex: 1;
  background: var(--flap-tile);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23FFB000'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid #0c0c0c;
  color: var(--flap-text);
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 24px 8px 6px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.region-select:focus { border-color: var(--amber-dim); }

/* Generate button */
.btn-generate {
  background: var(--amber);
  color: #0c0d0e;
  border: none;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
  padding: 13px;
  width: 100%;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.12s;
}

.btn-generate:hover { background: var(--amber-bright); }

.btn-generate:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Status message (unsupported simulator/type warnings) ── */
.status-msg {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--amber-dim);
  text-transform: uppercase;
  padding: 10px 14px;
  border: 1px solid var(--flap-divider);
  background: var(--flap-section);
  margin-bottom: 2px;
}

/* ════════════════════════════════════════
   FLIGHT CARD — split-flap board style
════════════════════════════════════════ */
.flight-card {
  background: var(--flap-bg);
  border: 1px solid #1e1e1e;
  box-shadow: 0 0 40px rgba(0,0,0,0.6), 0 0 80px rgba(255,176,0,0.03);
  overflow: hidden;
}

/* ── Flap tile ── */
.flap-row {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.flap-row + .flap-row { margin-top: 4px; }

.flap-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--flap-tile);
  color: var(--flap-text);
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid #0c0c0c;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 28ms ease;
}

.flap-char.flap-amber {
  color: var(--amber);
  background: #1e1800;
  border-color: #0f0c00;
}

/* Size variants */
.flap-char.flap-xl { width: 38px; height: 54px; font-size: 30px; }
.flap-char.flap-lg { width: 23px; height: 34px; font-size: 18px; }
.flap-char.flap-md { width: 16px; height: 25px; font-size: 13px; }
.flap-char.flap-sm { width: 12px; height: 19px; font-size: 11px; color: var(--flap-sub); }
.flap-char.flap-sm.flap-amber { color: var(--amber); }

/* ── Field label ── */
.flap-label {
  font-family: 'Orbitron', monospace;
  font-size: 7px;
  letter-spacing: 0.28em;
  color: var(--flap-sub);
  text-transform: uppercase;
  margin-bottom: 7px;
}

/* ── Card sections ── */
.card-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--flap-divider);
}
.card-section:last-child { border-bottom: none; }
.card-section.card-section-dark { background: var(--flap-section); }
.card-section.route-section { overflow: hidden; }

/* ── Card header ── */
.card-header-row1 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-header-row2 { /* airline — full width, second line */ }

.std-time { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }

/* ── Route section ── */
.card-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: start;
}

.apt { display: flex; flex-direction: column; gap: 5px; }
.apt.right { align-items: flex-end; text-align: right; }
.apt.right .flap-row { justify-content: flex-end; }

.apt-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #6e6c64;
  height: 20px;
  line-height: 20px;
  max-width: 298px;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 200ms ease;
}

.route-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.r-stat { display: flex; flex-direction: column; align-items: center; gap: 5px; }

.r-metric { display: flex; align-items: center; gap: 6px; }

.metric-unit {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--flap-sub);
  text-transform: uppercase;
  flex-shrink: 0;
}

.r-line { width: 1px; height: 14px; background: #222; }

.r-plane {
  font-size: 15px;
  color: #2e2e2e;
  animation: float 3s ease-in-out infinite;
}

/* ── Stats strip (aircraft) ── */
.card-stats {
  display: grid;
  grid-template-columns: 1fr;
}

.stat-cell {
  padding: 13px 18px;
  min-height: 100px;
}

.aircraft-type {
  font-family: 'Share Tech Mono', monospace;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--flap-text);
  transition: opacity 200ms ease;
}

.stat-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #6e6c64;
  margin-top: 5px;
  white-space: nowrap;
  transition: opacity 200ms ease;
}

/* ── Card footer ── */
.card-footer {
  padding: 11px 18px;
  background: var(--flap-section);
  border-top: 1px solid var(--flap-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-note {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--flap-label);
  text-transform: uppercase;
}

.btn-dispatch {
  background: none;
  border: 1px solid var(--flap-sub);
  color: var(--flap-sub);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.2em;
  padding: 9px 16px;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-dispatch:hover {
  border-color: var(--flap-text);
  color: var(--flap-text);
}

.btn-dispatch.is-disabled {
  border-color: var(--flap-label);
  color: var(--flap-label);
  cursor: not-allowed;
  pointer-events: none;
}


/* ════════════════════════════════════════
   ABOUT PAGE
════════════════════════════════════════ */
.about-hero {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.about-title {
  font-family: 'Orbitron', monospace;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(255,176,0,0.3);
  margin-bottom: 10px;
}

.about-tagline {
  font-size: 14px;
  color: var(--amber-dim);
  letter-spacing: 0.15em;
  line-height: 1.6;
  margin-top: 14px;
}

.about-block {
  margin-bottom: 28px;
}

.about-block-title {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--amber-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.about-text {
  font-size: 14px;
  color: var(--amber-dim);
  line-height: 1.85;
  letter-spacing: 0.04em;
}

.about-text p + p { margin-top: 10px; }

/* Feature list */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--amber-dim);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.feature-list li::before {
  content: '→';
  color: var(--amber);
  flex-shrink: 0;
}

/* Aircraft table */
.aircraft-table {
  width: 100%;
  border-collapse: collapse;
}

.aircraft-table th {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.aircraft-table td {
  font-size: 13px;
  color: var(--amber-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  vertical-align: top;
}

.aircraft-table td:first-child {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: var(--amber);
  letter-spacing: 0.1em;
}

.aircraft-table tr:last-child td { border-bottom: none; }

/* Sim table */
.sim-table {
  width: 100%;
  border-collapse: collapse;
}

.sim-table tr {
  border-bottom: 1px solid var(--border);
}

.sim-table tr:last-child { border-bottom: none; }

.sim-table td {
  padding: 10px 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.sim-table td:first-child {
  color: var(--amber);
  width: 50%;
}

.sim-table td:last-child {
  color: var(--text-dim);
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.tag-live {
  color: var(--green);
  letter-spacing: 0.15em;
  font-size: 12px;
}

.tag-soon { color: var(--text-dim); }

/* Links */
.about-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.about-link {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--amber-dim);
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-active);
  padding-bottom: 2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.about-link:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}

/* ── Re-roll buttons ── */
.label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.label-row .flap-label {
  margin-bottom: 0;
}

.label-row-right {
  justify-content: flex-end;
}

.btn-reroll {
  background: none;
  border: none;
  color: var(--flap-label);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.12s;
  font-family: 'Share Tech Mono', monospace;
  visibility: hidden;
  pointer-events: none;
}

.btn-reroll.visible {
  visibility: visible;
  pointer-events: auto;
}

.btn-reroll:hover {
  color: var(--amber);
}

/* ════════════════════════════════════════
   SETTINGS PAGE
════════════════════════════════════════ */
.prefs-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prefs-section {
  background: var(--flap-bg);
  border: 1px solid var(--flap-divider);
}

.prefs-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--amber);
  text-transform: uppercase;
  padding: 12px 14px;
  background: var(--flap-section);
  border-bottom: 1px solid var(--flap-divider);
  border-left: 3px solid var(--amber);
}

.ac-group { border-bottom: 1px solid var(--flap-divider); }
.ac-group:last-child { border-bottom: none; }

.ac-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 14px;
}

.ac-group-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--flap-sub);
  text-transform: uppercase;
  padding: 10px 14px 6px;
}

.ac-group-actions {
  display: flex;
  gap: 1px;
}

.ac-action-btn {
  background: var(--flap-tile);
  border: 1px solid var(--border-active);
  color: var(--flap-sub);
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.ac-action-btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: #080604;
}

.ac-item { border-bottom: 1px solid #0a0a0a; }
.ac-item:last-child { border-bottom: none; }

.ac-item input[type="checkbox"] { display: none; }

.ac-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.ac-item label:hover { background: #0f1011; }

.ac-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.12s, box-shadow 0.12s;
}

.ac-item input:checked + label .ac-dot {
  background: var(--amber);
  box-shadow: 0 0 4px rgba(255,176,0,0.5);
}

.ac-name {
  flex: 1;
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  transition: color 0.12s;
}

.ac-item input:checked + label .ac-name { color: var(--flap-text); }

.ac-addon {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: color 0.12s;
}

.ac-item input:checked + label .ac-addon { color: var(--flap-label); }

/* ── Animations ── */
@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.7; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

