:root {
  --accent: #ffb800;
  --accent-dim: rgba(255, 184, 0, 0.68);
  --accent-muted: rgba(255, 184, 0, 0.42);
  --bg: #050505;
  --bg-soft: #0b0b0b;
  --panel: rgba(13, 13, 13, 0.96);
  --panel-2: rgba(18, 18, 18, 0.98);
  --line: rgba(255, 184, 0, 0.14);
  --line-strong: rgba(255, 184, 0, 0.35);
  --text: #ffb800;
  --text-dim: rgba(255, 184, 0, 0.68);
  --text-muted: rgba(255, 184, 0, 0.42);
  --axis: rgba(169, 193, 255, 0.72);
  --violet: #8b5cf6;
  --blue: #60a5fa;
  --critical: #ef4444;
  --warning: #f97316;
  --caution: #fbbf24;
  --danger: #f43f5e;
  --success: #22c55e;
}

:root[data-theme="light"] {
  --bg: #f7f7f5;
  --bg-soft: #f0f0eb;
  --panel: rgba(255, 255, 255, 0.98);
  --panel-2: rgba(250, 250, 246, 0.99);
  --line: rgba(17, 17, 17, 0.1);
  --line-strong: rgba(17, 17, 17, 0.28);
  --text: #111111;
  --text-dim: rgba(17, 17, 17, 0.72);
  --text-muted: rgba(17, 17, 17, 0.5);
  --axis: rgba(63, 89, 138, 0.82);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 184, 0, 0.05), transparent 20%),
    radial-gradient(circle at 80% 65%, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(180deg, #060606 0%, #0a0a0a 100%);
  color: var(--text);
  font-family: Consolas, "Lucida Console", "Courier New", monospace;
}

:root[data-theme="light"] html,
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 184, 0, 0.08), transparent 22%),
    radial-gradient(circle at 84% 74%, rgba(0, 0, 0, 0.035), transparent 24%),
    linear-gradient(180deg, #fdfdfb 0%, #f2f1ec 100%);
  color: var(--text);
}

body { letter-spacing: 0.04em; }
button, input { font: inherit; }

.app-shell {
  visibility: visible;
}

.app-shell.is-auth-hidden {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  overflow: hidden;
  background: #040404;
  --text: #ffb800;
  --text-dim: rgba(255, 184, 0, 0.68);
  --text-muted: rgba(255, 184, 0, 0.42);
  --accent: #ffb800;
  --accent-dim: rgba(255, 184, 0, 0.68);
  --accent-muted: rgba(255, 184, 0, 0.42);
}

.welcome-gate.is-visible {
  display: block;
}

.welcome-atlas-host,
.welcome-overlay {
  position: absolute;
  inset: 0;
}

.welcome-atlas-host {
  z-index: 1;
}

.welcome-atlas-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.welcome-overlay {
  z-index: 2;
  background:
    radial-gradient(circle at 18% 28%, rgba(0, 0, 0, 0.2), transparent 28%),
    radial-gradient(circle at 68% 46%, rgba(0, 0, 0, 0.12), transparent 26%),
    linear-gradient(90deg, rgba(2, 2, 2, 0.96) 0%, rgba(2, 2, 2, 0.72) 42%, rgba(2, 2, 2, 0.56) 62%, rgba(2, 2, 2, 0.84) 100%);
}

.welcome-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  width: min(1520px, calc(100vw - 56px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 440px);
  gap: 56px;
  align-items: center;
  padding: 48px 0;
}

.welcome-brand-lockup {
  max-width: 620px;
  display: grid;
  justify-items: center;
  text-align: center;
}

.welcome-brand-logo {
  width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.38));
}

.welcome-kicker {
  margin-top: 24px;
  color: var(--accent-dim);
  letter-spacing: 0.2em;
  font-size: 1.55rem;
  font-weight: 700;
}

.welcome-copy {
  max-width: 520px;
  margin: 26px 0 0;
  color: rgba(255, 184, 0, 0.78);
  line-height: 1.7;
  font-size: 1rem;
}

.welcome-card {
  padding: 26px;
  background: rgba(10, 10, 10, 0.84);
  border: 1px solid rgba(255, 184, 0, 0.2);
  backdrop-filter: blur(12px);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.welcome-card-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-tab {
  width: 100%;
}

.auth-message {
  min-height: 20px;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.auth-message.is-error {
  color: #f87171;
}

.auth-message.is-success {
  color: #4ade80;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.is-active {
  display: grid;
}

.auth-inline-action {
  justify-self: start;
  padding: 0;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.auth-inline-action:hover,
.auth-inline-action:focus-visible {
  color: var(--text);
  box-shadow: none;
  outline: none;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.06), transparent 20%),
    radial-gradient(circle at 50% 78%, rgba(255, 184, 0, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.995), rgba(9, 9, 9, 0.995));
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.app-loader.is-visible {
  opacity: 1;
  visibility: visible;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.app-loader-inner {
  width: min(520px, calc(100vw - 48px));
  display: grid;
  justify-items: center;
  gap: 24px;
}

.app-loader-logo {
  width: min(300px, 58vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.45));
}

.app-loader-bar {
  width: 100%;
  height: 10px;
  border: 1px solid rgba(255, 184, 0, 0.22);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.app-loader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 184, 0, 0.65), #ffb800 65%, rgba(255, 238, 186, 0.95));
  box-shadow: 0 0 20px rgba(255, 184, 0, 0.32);
  transition: width 160ms ease;
}

.app-loader-text {
  color: var(--accent-dim);
  font-size: 0.92rem;
  letter-spacing: 0.1em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 7, 7, 0.97);
  backdrop-filter: blur(8px);
}

.topbar-left, .nav, .button-row, .panel-head, .page-head-actions, .section-head {
  display: flex;
  align-items: center;
}

.topbar-left { gap: 18px; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-pill {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 8px 12px;
  border: 1px solid rgba(255, 184, 0, 0.14);
  background: rgba(255, 184, 0, 0.04);
}

.topbar-logout {
  padding: 10px 14px;
}

.brand,
.nav-link,
.menu-item,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-word {
  color: var(--accent);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.nav { gap: 8px; flex-wrap: wrap; }

.nav-link, .menu-item {
  padding: 10px 12px;
  font-size: 0.95rem;
}

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

.nav-menu { position: relative; }

.menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  min-width: 170px;
  flex-direction: column;
  background: rgba(12, 12, 12, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu.is-open .menu-popover { display: flex; }

.clock {
  color: var(--accent);
  font-size: 1rem;
}

.shell {
  width: min(1520px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.page { display: none; }
.page.is-active { display: block; }
.page-narrow { width: min(980px, 100%); margin: 0 auto; }

h1 {
  margin: 0;
  font-size: clamp(3rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.page-head,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.page-head { margin-bottom: 26px; }

.page-head p,
.muted,
.panel-copy,
.stat-note {
  margin: 10px 0 0;
  color: var(--text-dim);
}

.dashboard-grid,
.stats-grid,
.split-grid,
.map-grid {
  display: grid;
  gap: 22px;
}

.dashboard-grid,
.split-grid { grid-template-columns: 1fr 1fr; }
.dashboard-span-2 { grid-column: 1 / -1; }
.stats-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.stats-grid-single { grid-template-columns: 1fr; }
.stats-grid-recency-ops { grid-template-columns: 1fr; margin-top: 24px; }
.recency-summary {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 28px;
  align-items: start;
}
.dashboard-recency-summary {
  grid-template-columns: minmax(220px, 280px) minmax(220px, 1fr) minmax(320px, 1.15fr);
  margin-top: 16px;
}

.recency-type-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.recency-type-item {
  display: grid;
  gap: 4px;
}

.recency-type-name {
  color: var(--text);
  display: inline-block;
  width: fit-content;
  align-self: start;
  padding: 2px 6px;
  border: 1px solid rgba(255, 184, 0, 0.25);
  line-height: 1.2;
  background: transparent;
  white-space: nowrap;
  font-size: 0.88rem;
}

.recency-type-count {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.recency-ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.recency-op-item {
  display: grid;
  gap: 8px;
}

.recency-op-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.recency-op-value {
  color: var(--text);
  font-size: 2.5rem;
  line-height: 1;
}

.stat-number.recency-good,
.recency-op-value.recency-good {
  color: var(--success);
}

.stat-number.recency-bad,
.recency-op-value.recency-bad {
  color: var(--critical);
}

.hero-subnumber.limit-good {
  color: var(--success);
}

.hero-subnumber.limit-warn {
  color: var(--warning);
}

.hero-subnumber.limit-bad {
  color: var(--critical);
}

.dashboard-recency-ops {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-recency-ops .recency-op-value {
  font-size: 2rem;
}

.settings-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.settings-input-grid-single {
  grid-template-columns: minmax(0, 320px);
}

.settings-field {
  display: grid;
  gap: 8px;
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 184, 0, 0.16);
  background:
    linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(11, 11, 11, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.settings-field span {
  color: var(--text-dim);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.settings-field .input {
  appearance: textfield;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 184, 0, 0.26);
  background: rgba(7, 7, 7, 0.98);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: 0.04em;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 184, 0, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.settings-field .input:focus {
  border-color: rgba(255, 184, 0, 0.72);
  background: rgba(12, 12, 12, 0.98);
  box-shadow:
    0 0 0 1px rgba(255, 184, 0, 0.18),
    0 0 18px rgba(255, 184, 0, 0.08);
}

.settings-field .input::-webkit-outer-spin-button,
.settings-field .input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.map-grid { grid-template-columns: 240px 1fr; }

.panel {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.015), transparent 42%),
    linear-gradient(180deg, rgba(15, 15, 15, 0.98), rgba(10, 10, 10, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
}

.hero-panel {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-submetrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.hero-submetric {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.hero-number,
.stat-number,
.map-number {
  color: var(--text);
}

.hero-number {
  font-size: clamp(3.3rem, 6vw, 5.4rem);
  line-height: 1;
}

.hero-number span { font-size: 0.56em; opacity: 0.8; }
.hero-subnumber {
  color: var(--text);
  font-size: clamp(2rem, 3vw, 2.85rem);
  line-height: 1;
}
.hero-subnumber span { font-size: 0.56em; opacity: 0.8; }
.stat-number { font-size: 3rem; margin-top: 10px; }
.map-number { font-size: 3.2rem; }

.map-stats { padding-top: 18px; }
.map-stat { margin-top: 52px; }
.map-label {
  color: var(--accent-dim);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.button {
  border: 1px solid rgba(255, 184, 0, 0.3);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: #0c0c0c;
  padding: 14px 18px;
}

.button-ghost,
.button-chip,
.button-danger {
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
}

.button-danger {
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.55);
}

.button-chip.is-active {
  background: var(--accent);
  color: #0c0c0c;
}

.button-chip span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.button-chip.is-active span {
  color: rgba(0, 0, 0, 0.68);
}

.settings-subrow {
  margin-top: 12px;
}

.button-wide { width: 100%; }

.timeline-controls {
  margin-left: auto;
  justify-content: flex-end;
  gap: 10px;
}

.timeline-year-select {
  min-width: 126px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 184, 0, 0.3);
  background: rgba(12, 12, 12, 0.98);
  color: var(--text);
  letter-spacing: 0.08em;
  outline: none;
  cursor: pointer;
}

.timeline-year-select.is-active,
.timeline-year-select:focus {
  border-color: rgba(255, 184, 0, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 184, 0, 0.18) inset;
}

.timeline-year-select:disabled {
  opacity: 0.45;
  cursor: default;
}

.legend {
  display: flex;
  gap: 16px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.legend-line {
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

.legend-line.gold { background: var(--accent); }
.legend-line.violet {
  background: repeating-linear-gradient(90deg, var(--violet) 0 4px, transparent 4px 7px);
}

.chart-wrap {
  position: relative;
}

.chart {
  width: 100%;
  height: 280px;
  display: block;
  overflow: visible;
}
.chart-large { height: 360px; }
.chart-bars { height: 560px; }

.chart-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  min-width: 110px;
  padding: 8px 10px;
  background: rgba(7, 10, 16, 0.96);
  border: 1px solid rgba(255, 184, 0, 0.24);
  color: #f7d891;
  font-size: 0.78rem;
  line-height: 1.38;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  transition: opacity 120ms ease, transform 120ms ease;
  opacity: 0;
}

.chart-tooltip.is-visible {
  display: block;
  opacity: 1;
  transform: translate(-50%, calc(-100% - 16px));
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
}

.chart-tooltip-line {
  margin-top: 2px;
}

.stack-list, .card-list, .route-list { display: grid; gap: 10px; }

.list-row,
.table-row,
.currency-card {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0;
}

.route-strong { color: var(--accent); font-size: 1.2rem; }
.subtle { color: var(--text-dim); font-size: 0.88rem; margin-top: 6px; }
.flight-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 184, 0, 0.25);
  font-size: 0.88rem;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot-expired { background: #6b7280; }
.dot-critical { background: var(--critical); }
.dot-warning { background: var(--warning); }
.dot-caution { background: var(--caution); }
.dot-ok { background: var(--blue); }

.currency-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 18, 30, 0.72);
}

.currency-card.critical {
  background: rgba(68, 12, 12, 0.58);
  border-color: rgba(239, 68, 68, 0.58);
}

.currency-card.warning {
  background: rgba(65, 30, 8, 0.52);
}

.currency-title { font-size: 1.4rem; }

.badge {
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid currentColor;
  font-size: 0.72rem;
}

.badge-ok { color: #93c5fd; }
.badge-critical { color: #fda4af; }
.badge-warning { color: #fdba74; }
.badge-caution { color: #fde68a; }
.badge-expired { color: #9ca3af; }

.search-panel { padding: 0; margin-bottom: 14px; }
.search-panel-small { max-width: 460px; }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.table-panel { overflow: hidden; }
.table-load-more {
  display: flex;
  justify-content: center;
  padding: 18px 18px 22px;
}

.table-head,
.table-row {
  padding: 14px 18px;
}

.table-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 0.84rem;
}

.logbook-grid,
.recency-grid,
.airport-grid,
.aircraft-grid,
.table-row.logbook-grid-row,
.table-row.recency-grid-row,
.table-row.airport-grid-row,
.table-row.aircraft-grid-row {
  display: grid;
  align-items: center;
  gap: 12px;
}

.logbook-grid,
.table-row.logbook-grid-row { grid-template-columns: 120px 100px 90px 140px 1.15fr 120px 130px 110px 90px 80px 80px 100px 76px; }
.recency-grid,
.table-row.recency-grid-row { grid-template-columns: 140px 120px 1.4fr 140px; }
.airport-grid,
.table-row.airport-grid-row { grid-template-columns: 72px 60px 1.2fr 1.1fr 110px 110px 76px; }
.aircraft-grid,
.table-row.aircraft-grid-row { grid-template-columns: 200px 1fr 240px 76px; }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.currency-status-row {
  align-items: center;
}

.currency-days {
  font-size: 0.95rem;
}

.currency-days-ok { color: #93c5fd; }
.currency-days-critical { color: #fda4af; }
.currency-days-warning { color: #fdba74; }
.currency-days-caution { color: #fde68a; }
.currency-days-expired { color: #9ca3af; }

.dashboard-currency-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border: 1px solid rgba(84, 122, 214, 0.2);
  background: rgba(11, 15, 30, 0.82);
}

.dashboard-currency-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-currency-row .route-strong {
  font-size: 1.15rem;
}

.dashboard-currency-row .badge {
  min-width: 66px;
  text-align: center;
}

.icon-button { color: var(--text-dim); }
.icon-button:hover { color: var(--text); }

.route-item {
  display: grid;
  grid-template-columns: 26px 1fr minmax(180px, 1.5fr) auto auto;
  gap: 12px;
  align-items: center;
}

.bar-track {
  position: relative;
  height: 10px;
  background: rgba(255, 184, 0, 0.12);
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--text), rgba(255, 184, 0, 0.45));
}

.map-panel {
  position: relative;
  min-height: 760px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035), transparent 44%),
    rgba(10, 10, 10, 0.72);
}

.map-panel canvas {
  width: min(900px, 100%);
  max-height: 760px;
  display: block;
  cursor: grab;
  touch-action: none;
}

.map-panel canvas.is-dragging {
  cursor: grabbing;
}

.map-logo {
  position: absolute;
  top: 54px;
  right: 40px;
  width: 130px;
  opacity: 0.58;
}

.map-panel-stage {
  min-height: 840px;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 62% 42%, rgba(255, 255, 255, 0.055), transparent 18%),
    linear-gradient(180deg, rgba(6, 6, 6, 0.995), rgba(3, 3, 3, 0.995));
}

.atlas-stage {
  position: relative;
  min-height: 860px;
  box-shadow: inset 0 0 0 1px rgba(255, 184, 0, 0.04);
}

.atlas-globe-host {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.atlas-globe-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  touch-action: none;
}

.atlas-globe-host canvas.is-dragging {
  cursor: grabbing;
}

.map-panel-stage canvas {
  width: 100%;
  height: auto;
  max-height: none;
  cursor: grab;
  touch-action: none;
}

.map-panel-stage canvas.is-dragging {
  cursor: grabbing;
}

.map-kicker {
  position: absolute;
  top: 20px;
  left: 28px;
  z-index: 3;
}

.map-stats-hud {
  position: absolute;
  left: 42px;
  top: 190px;
  z-index: 3;
  width: 270px;
  padding-top: 0;
}

.map-stats-hud .map-stat {
  margin-top: 56px;
}

.map-stats-hud .map-stat:first-child {
  margin-top: 0;
}

.map-stats-hud .map-number {
  margin-top: 10px;
  font-size: clamp(2.3rem, 3vw, 3.55rem);
  line-height: 0.94;
}

.atlas-stage .map-logo {
  top: 58px;
  right: 42px;
  width: 154px;
  opacity: 0.78;
  transform: none;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.08));
}

.settings-stack { display: grid; gap: 18px; }
.danger-text { color: var(--danger); }
.panel-danger { border-color: rgba(244, 63, 94, 0.35); }

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 90;
}

.drawer.is-open { display: block; }

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(660px, 100%);
  height: 100%;
  overflow: auto;
  background: rgba(18, 18, 18, 0.98);
  border-left: 1px solid rgba(255, 184, 0, 0.5);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-body { padding: 22px; }
.drawer-head h2 { margin: 0; font-size: 1.3rem; }

.import-review {
  display: grid;
  gap: 18px;
}

.import-review-summary {
  display: grid;
  gap: 14px;
}

.import-review-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.import-review-card {
  padding: 16px 18px;
  border: 1px solid rgba(255, 184, 0, 0.18);
  background: rgba(15, 15, 15, 0.88);
}

.import-review-card-danger {
  border-color: rgba(244, 63, 94, 0.3);
}

.import-review-number {
  color: var(--text);
  font-size: 2.6rem;
  line-height: 1;
}

.import-review-card-danger .import-review-number {
  color: #f87171;
}

.import-review-label,
.import-review-note {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.import-review-errors-panel {
  padding: 16px;
}

.import-error-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 52vh;
  overflow: auto;
}

.import-error-row {
  padding: 12px 14px;
  border: 1px solid rgba(244, 63, 94, 0.28);
  background: rgba(60, 10, 20, 0.28);
}

.import-error-head {
  color: #fca5a5;
  font-size: 0.92rem;
}

.import-error-route {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.95rem;
}

.import-error-reason {
  margin-top: 6px;
  color: #f87171;
  font-size: 0.9rem;
}

.import-review-actions {
  justify-content: flex-end;
}

.form-grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.form-grid label,
.form-section {
  display: grid;
  gap: 8px;
}

.airport-field {
  position: relative;
}

.form-grid span {
  color: var(--accent-dim);
  font-size: 0.9rem;
}

.form-grid input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 16, 16, 0.95);
  color: var(--text);
  outline: none;
}

.form-grid input:focus { border-color: var(--line-strong); }

.previous-experience-totals {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 184, 0, 0.03);
}

.previous-total-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.42);
}

.previous-total-card strong {
  font-size: 1.9rem;
  line-height: 1;
}

.flight-number-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
}

.flight-number-prefix {
  min-width: 56px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 0;
  background: rgba(22, 22, 22, 0.98);
  color: var(--accent);
  display: none;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
}

.flight-number-prefix.is-visible {
  display: flex;
}

.flight-number-input-wrap input {
  min-width: 0;
}

.flight-number-prefix.is-visible + input {
  border-left: 0;
}

.form-grid input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.9;
  filter: invert(0.88);
}

.form-grid input[type="date"]::-webkit-datetime-edit,
.form-grid input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.form-grid input[type="date"]::-webkit-datetime-edit-text,
.form-grid input[type="date"]::-webkit-datetime-edit-month-field,
.form-grid input[type="date"]::-webkit-datetime-edit-day-field,
.form-grid input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--text);
}
.crew-name-input {
  color: var(--violet);
}

.crew-name-input::placeholder {
  color: rgba(139, 92, 246, 0.52);
}

.form-actions { margin-top: 8px; }

.manage-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.manage-account-actions .button {
  min-width: 220px;
}

.flight-time-mode-indicator {
  color: var(--violet);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  align-self: end;
}

.airport-suggest {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 8;
  display: none;
  max-height: 258px;
  overflow: auto;
  border: 1px solid rgba(255, 184, 0, 0.42);
  background: rgba(18, 18, 18, 0.985);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.46);
}

.airport-suggest.is-open {
  display: block;
}

.airport-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.airport-option:hover,
.airport-option.is-active {
  background: rgba(255, 184, 0, 0.16);
}

.airport-option-top,
.airport-option-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.airport-option-code {
  color: var(--text);
}

.airport-option-iata,
.airport-option-meta {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.airport-option-name {
  display: block;
  margin-top: 3px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

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

.check-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 184, 0, 0.22);
  min-height: 62px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.check-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-pill:hover {
  border-color: rgba(255, 184, 0, 0.52);
}

.check-pill:has(input:checked) {
  background: rgba(255, 184, 0, 0.18);
  border-color: rgba(255, 184, 0, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 0, 0.28);
}

.empty {
  padding: 22px 18px;
  color: var(--text-dim);
}

svg text {
  fill: var(--axis);
  font-family: Consolas, "Lucida Console", "Courier New", monospace;
  font-size: 11px;
}

svg .grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-dasharray: 2 6;
}

svg .chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .chart-line-animated {
  animation: drawLine 1400ms ease forwards;
}

svg .chart-area {
  animation: fadeArea 1200ms ease forwards;
}

svg .chart-point {
  animation: popPoint 650ms ease both;
}

svg .chart-hit {
  fill: transparent;
  cursor: crosshair;
}

svg .chart-hover-band {
  display: none;
  fill: rgba(220, 220, 220, 0.08);
  stroke: rgba(220, 220, 220, 0.16);
  stroke-width: 1;
  pointer-events: none;
}

svg .chart-hover-band.is-visible {
  display: block;
}

svg .chart-hover-line {
  display: none;
  stroke: rgba(255, 184, 0, 0.32);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  pointer-events: none;
}

svg .chart-hover-line.is-visible {
  display: block;
}

svg .chart-hover-point {
  display: none;
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 2;
  r: 4.2;
  pointer-events: none;
}

svg .chart-hover-point.is-visible {
  display: block;
}

svg .bar-grow {
  animation: growBar 950ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center bottom;
}

svg .globe-route {
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .globe-route-glow {
  opacity: 0.34;
}

svg .globe-graticule {
  stroke: rgba(255, 255, 255, 0.08);
  fill: none;
}

svg .globe-airport-glow {
  animation: pulseAirport 2200ms ease-in-out infinite;
}

@keyframes drawLine {
  from { stroke-dashoffset: var(--path-length); }
  to { stroke-dashoffset: 0; }
}

@keyframes fadeArea {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popPoint {
  from { opacity: 0; transform: scale(0.35); transform-origin: center; }
  to { opacity: 1; transform: scale(1); transform-origin: center; }
}

@keyframes growBar {
  from { transform: scaleY(0.04); opacity: 0.25; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes pulseAirport {
  0%, 100% { opacity: 0.18; transform: scale(0.9); transform-origin: center; }
  50% { opacity: 0.46; transform: scale(1.24); transform-origin: center; }
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(17, 17, 17, 0.1);
}

:root[data-theme="light"] .app-loader-text,
:root[data-theme="light"] .map-label,
:root[data-theme="light"] .form-grid span {
  color: var(--text-dim);
}

:root[data-theme="light"] .app-loader {
  background:
    radial-gradient(circle at 50% 28%, rgba(0, 0, 0, 0.05), transparent 20%),
    radial-gradient(circle at 50% 78%, rgba(255, 184, 0, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(250, 250, 247, 0.996), rgba(242, 241, 236, 0.996));
}

:root[data-theme="light"] .panel {
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0.025), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 248, 244, 0.98));
  border-color: rgba(17, 17, 17, 0.08);
}

:root[data-theme="light"] .drawer-panel,
:root[data-theme="light"] .timeline-year-select,
:root[data-theme="light"] .settings-field .input,
:root[data-theme="light"] .currency-card,
:root[data-theme="light"] .dashboard-currency-row {
  background-color: rgba(255, 255, 255, 0.98);
}

:root[data-theme="light"] .drawer-panel {
  border-left-color: rgba(17, 17, 17, 0.18);
}

:root[data-theme="light"] .drawer-head {
  border-bottom-color: rgba(17, 17, 17, 0.08);
}

:root[data-theme="light"] .search-wrap,
:root[data-theme="light"] .airport-suggest {
  background: rgba(255, 255, 255, 0.98);
}

:root[data-theme="light"] .search-wrap input,
:root[data-theme="light"] .form-grid input,
:root[data-theme="light"] .timeline-year-select,
:root[data-theme="light"] .airport-option,
:root[data-theme="light"] .settings-field .input,
:root[data-theme="light"] .button-ghost,
:root[data-theme="light"] .button-chip,
:root[data-theme="light"] .brand,
:root[data-theme="light"] .nav-link,
:root[data-theme="light"] .menu-item,
:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .session-pill {
  color: var(--text);
}

:root[data-theme="light"] .search-wrap input::placeholder,
:root[data-theme="light"] .form-grid input::placeholder {
  color: rgba(17, 17, 17, 0.42);
}

:root[data-theme="light"] .form-grid input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.12);
}

:root[data-theme="light"] .form-grid input {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 17, 17, 0.14);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}

:root[data-theme="light"] .previous-experience-totals,
:root[data-theme="light"] .previous-total-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(17, 17, 17, 0.1);
}

:root[data-theme="light"] .flight-number-prefix {
  background: rgba(248, 248, 244, 0.98);
  border-color: rgba(17, 17, 17, 0.14);
}

:root[data-theme="light"] .form-grid input:focus {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 184, 0, 0.48);
  box-shadow:
    0 0 0 1px rgba(255, 184, 0, 0.12),
    0 0 14px rgba(255, 184, 0, 0.06);
}

:root[data-theme="light"] .crew-name-input {
  color: var(--violet);
}

:root[data-theme="light"] .crew-name-input::placeholder {
  color: rgba(139, 92, 246, 0.48);
}

:root[data-theme="light"] .flight-time-mode-indicator {
  color: var(--violet);
}

:root[data-theme="light"] .menu-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .menu-popover .menu-item {
  color: var(--text);
}

:root[data-theme="light"] .menu-popover .menu-item:hover {
  color: var(--accent);
  background: rgba(255, 184, 0, 0.08);
}

:root[data-theme="light"] .settings-field {
  background:
    linear-gradient(180deg, rgba(250, 250, 247, 0.98), rgba(242, 241, 236, 0.98));
  border-color: rgba(17, 17, 17, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

:root[data-theme="light"] .settings-field span {
  color: var(--text-dim);
}

:root[data-theme="light"] .airport-option:hover,
:root[data-theme="light"] .airport-option.is-active {
  background: rgba(255, 184, 0, 0.12);
}

:root[data-theme="light"] .check-pill {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 184, 0, 0.28);
  color: var(--text);
}

:root[data-theme="light"] .check-pill:hover {
  border-color: rgba(255, 184, 0, 0.56);
  background: rgba(255, 248, 230, 0.82);
}

:root[data-theme="light"] .check-pill:has(input:checked) {
  background: rgba(255, 184, 0, 0.18);
  border-color: rgba(255, 184, 0, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 0, 0.2);
}

:root[data-theme="light"] .session-pill {
  border-color: rgba(17, 17, 17, 0.14);
  background: rgba(17, 17, 17, 0.04);
}

:root[data-theme="light"] .currency-card {
  background: rgba(246, 248, 255, 0.9);
  border-color: rgba(17, 17, 17, 0.08);
}

:root[data-theme="light"] .currency-card.critical {
  background: rgba(255, 235, 238, 0.94);
  border-color: rgba(239, 68, 68, 0.36);
}

:root[data-theme="light"] .currency-card.warning {
  background: rgba(255, 243, 230, 0.94);
}

:root[data-theme="light"] .dashboard-currency-row {
  background: rgba(241, 245, 255, 0.92);
  border-color: rgba(84, 122, 214, 0.16);
}

:root[data-theme="light"] .table-head,
:root[data-theme="light"] .table-row,
:root[data-theme="light"] .list-row,
:root[data-theme="light"] .currency-card {
  border-bottom-color: rgba(17, 17, 17, 0.06);
}

:root[data-theme="light"] .map-panel-stage,
:root[data-theme="light"] .atlas-stage,
:root[data-theme="light"] .welcome-atlas-host {
  background:
    radial-gradient(circle at 62% 42%, rgba(0, 0, 0, 0.03), transparent 18%),
    linear-gradient(180deg, rgba(252, 252, 249, 0.995), rgba(244, 243, 238, 0.995));
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .stats-grid,
  .split-grid,
  .map-grid {
    grid-template-columns: 1fr;
  }

  .map-stats-hud {
      left: 26px;
      width: 220px;
  }

  .atlas-stage .map-logo {
    right: 24px;
    width: 128px;
  }
}

@media (max-width: 860px) {
  .welcome-shell {
    width: calc(100vw - 28px);
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 24px 0 36px;
    align-items: end;
  }

  .welcome-brand-logo {
    width: 156px;
  }

  .topbar,
  .topbar-left,
  .topbar-right,
  .page-head,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .shell { width: calc(100vw - 26px); }

  .grid-2,
  .grid-3,
  .grid-4,
  .role-grid,
  .table-head,
  .logbook-grid,
  .recency-grid,
  .airport-grid,
  .aircraft-grid,
  .table-row.logbook-grid-row,
  .table-row.recency-grid-row,
  .table-row.airport-grid-row,
  .table-row.aircraft-grid-row {
    grid-template-columns: 1fr;
  }

  .table-head { display: none; }

  .recency-summary {
    grid-template-columns: 1fr;
  }

  .recency-ops-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-recency-ops {
    grid-template-columns: 1fr 1fr;
  }

  .hero-submetrics,
  .settings-input-grid {
    grid-template-columns: 1fr;
  }

  .map-panel-stage {
    min-height: 720px;
    padding-top: 108px;
  }

  .map-stats-hud {
      position: static;
      width: auto;
      padding: 18px 18px 0;
      transform: none;
  }

  .map-stats-hud {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .map-stats-hud .map-stat {
    margin-top: 30px;
  }

  .map-stats-hud .map-stat:first-child {
    margin-top: 30px;
  }

  .map-kicker {
    left: 18px;
  }

  .atlas-stage .map-logo {
    top: 68px;
    right: 18px;
    width: 108px;
    transform: none;
  }

  .map-panel-stage canvas {
    width: min(100%, 760px);
    max-height: 560px;
  }

  .atlas-globe-host {
    position: relative;
    inset: auto;
    width: 100%;
    height: 560px;
  }
}
.panel-head {
  justify-content: space-between;
}
