:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #101827;
  --muted: #64748b;
  --line: #d9e2ef;
  --blue: #071f49;
  --blue2: #0f4c9c;
  --red: #bf1e2e;
  --amber: #f59e0b;
  --green: #16803c;
  --soft-blue: #e8f1ff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15,76,156,.18) 0, transparent 32%),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 100%);
  min-height: 100vh;
}

a { text-decoration: none; }

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.portal-app { display: grid; gap: 18px; }

.portal-hero,
.hero {
  background: linear-gradient(135deg, #071f49, #0f4c9c);
  color: white;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.portal-hero { padding: 30px; }

.portal-hero p,
.hero p {
  margin: 0;
  color: #d8e8ff;
  line-height: 1.5;
}

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

.portal-card {
  min-height: 170px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 26px;
  padding: 22px;
  text-align: left;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  align-items: start;
  box-shadow: var(--shadow);
  transition: .16s ease;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 76, 156, .35);
}

.portal-card strong {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--blue);
}

.portal-card span {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 600;
}

.portal-icon {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: var(--soft-blue);
  font-size: 29px;
}

.disabled-card {
  opacity: .62;
  cursor: not-allowed;
  pointer-events: none;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin-bottom: 14px;
  padding: 0 16px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--blue);
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px rgba(15,23,42,.08);
  font-weight: 900;
}

.hero {
  padding: 28px;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 20px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  right: -110px;
  top: -130px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #b9d5ff;
  font-weight: 800;
  margin-bottom: 8px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.status-card {
  background: rgba(255,255,255,0.11);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 2;
}

.status-card .label { color: #bfd7ff; font-size: 13px; }
.status-card .big { font-size: 34px; font-weight: 900; margin-top: 4px; }
.status-card .big.board-hint {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: normal;
}
.status-card .sub { font-size: 13px; color: #dceaff; margin-top: 6px; }
.threshold-sub { margin-top: 10px; font-weight: 800; color: #ffffff !important; }

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.panel {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-panel-header {
  padding-left: 0;
  padding-right: 0;
  border-bottom: 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-body { padding: 20px; }

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 7px;
  letter-spacing: .02em;
}

label.fuel-kg-label {
  margin-top: 10px;
}

.altn-scenario .airport-name-hint {
  min-height: 1.2em;
  margin-top: 4px;
  margin-bottom: 0;
}

.icao-input {
  font-weight: 700;
  letter-spacing: 0.06em;
}

.airport-ref-line {
  margin: -6px 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.35;
}

.status-card .scenario-ref-line {
  color: #e8f1ff;
  font-weight: 700;
  opacity: 0.95;
}

.status-card .scenario-ref-line:empty {
  display: none;
}

input {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1px solid #ccd7e6;
  background: #fff;
  padding: 0 13px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: .16s ease;
}

input:focus {
  border-color: var(--blue2);
  box-shadow: 0 0 0 4px rgba(15, 95, 184, .12);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

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

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

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

.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--blue2);
}

.result-card.minimum::before { background: var(--amber); }
.result-card.emergency::before { background: var(--red); }

/* EFOD below decision fuel — alternate scenario not achievable */
.result-card--scenario-unreachable::before {
  background: var(--red);
}

.result-card--scenario-unreachable .result-title h3,
.result-card--scenario-unreachable .airport-ref-line,
.result-card--scenario-unreachable .calc-line {
  color: var(--red);
}

.result-card--scenario-unreachable .pill {
  background: rgba(191, 30, 46, 0.12);
  color: var(--red);
}

.result-card--scenario-unreachable .metric .k {
  color: rgba(191, 30, 46, 0.88);
}

.result-card--scenario-unreachable .metric .v,
.result-card--scenario-unreachable .metric .u {
  color: var(--red);
}

.result-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.result-title h3 {
  margin: 0;
  font-size: 16px;
}

.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.pill.ops-normal {
  background: rgba(22, 128, 60, 0.12);
  color: var(--green);
}

.pill.ops-caution {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.pill.ops-critical {
  background: rgba(191, 30, 46, 0.12);
  color: var(--red);
}

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

.metric {
  background: #f8fafc;
  border: 1px solid #e5edf7;
  border-radius: 16px;
  padding: 12px;
}

.metric .k {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.metric .v {
  font-size: 20px;
  font-weight: 950;
  margin-top: 5px;
}

.metric .u {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.calc-line {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 15px;
  background: #f8fafc;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.fuel-min-caption {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.metrics--min-three {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .metrics--min-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metrics--min-bind {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

@media (max-width: 1100px) {
  .metrics--min-bind {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fuel-efod-summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 95, 184, 0.06), rgba(15, 95, 184, 0.02));
  border: 1px solid rgba(15, 95, 184, 0.12);
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
  font-weight: 650;
}

.fuel-min-intro {
  margin: -4px 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
}

.fuel-min-case {
  margin-bottom: 16px;
}

.fuel-min-case-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.02em;
}

/* CUA Fuel Policy — EFOD runway visualization */
.fuel-viz-stage {
  margin-top: 20px;
  border-radius: var(--radius, 18px);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.fuel-viz-stage--good {
  border-color: rgba(16, 185, 129, 0.35);
}

.fuel-viz-stage--caution {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.12);
}

.fuel-viz-stage--danger {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.14);
}

.fuel-viz-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #071f49 0%, #0f4c9c 55%, #1d6bcb 100%);
  color: #fff;
}

.fuel-viz-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.fuel-viz-burn {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.95;
  max-width: 100%;
}

.fuel-viz-caption {
  margin: 0;
  padding: 10px 18px 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 650;
}

.fuel-viz-mount {
  padding: 4px 8px 16px;
}

.fuel-viz-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
}

.fuel-viz-legend {
  list-style: none;
  margin: 0;
  padding: 0 18px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.fuel-viz-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fuel-viz-swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.fuel-viz-swatch--emg {
  background: rgba(220, 38, 38, 0.35);
}

.fuel-viz-swatch--min {
  background: rgba(245, 158, 11, 0.35);
}

.fuel-viz-swatch--dec {
  background: rgba(59, 130, 246, 0.35);
}

.fuel-viz-swatch--ok {
  background: rgba(16, 185, 129, 0.35);
}

.fuel-viz-swatch--efod {
  background: linear-gradient(90deg, #38bdf8, #0f4c9c);
}

.fuel-viz-swatch--div {
  background: linear-gradient(90deg, #a78bfa, #5b21b6);
}

.metrics--policy {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

@media (max-width: 1100px) {
  .metrics--policy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics--emergency {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.status-good { color: var(--green); }
.status-caution { color: var(--amber); }
.status-danger { color: var(--red); }

.wide { grid-column: 1 / -1; }

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

.time-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  text-align: center;
}

.time-chip strong {
  display: block;
  font-size: 18px;
  color: var(--blue);
}

.time-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

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

button {
  border: 0;
  height: 42px;
  border-radius: 14px;
  padding: 0 16px;
  background: var(--blue);
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition: .16s ease;
}

button.secondary {
  background: #eef4fb;
  color: var(--blue);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Weather / NOTAM board */
.weather-panel {
  margin-top: 22px;
}

.weather-cards {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.weather-airport-card.weather-ops-normal::before {
  background: var(--green);
}

.weather-airport-card.weather-ops-caution::before {
  background: var(--amber);
}

.weather-airport-card.weather-ops-critical::before {
  background: var(--red);
}

.weather-airport-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0;
}

.weather-airport-summary::-webkit-details-marker {
  display: none;
}

.weather-airport-summary .result-title {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.weather-airport-summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.55em;
  height: 0.55em;
  margin-left: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

details.weather-airport-card[open] > .weather-airport-summary::after {
  transform: rotate(45deg);
}

.weather-airport-body {
  padding-top: 14px;
}

.section-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 6px;
}

.section-label:first-child {
  margin-top: 0;
}

.raw-block {
  padding: 12px 14px;
  border-radius: 15px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.raw-block.muted-empty {
  color: var(--muted);
  font-style: italic;
}

.notam-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notam-item {
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
}

.notam-item--urgent {
  border-color: rgba(191, 30, 46, 0.45);
  box-shadow: 0 0 0 1px rgba(191, 30, 46, 0.06);
}

.notam-item--safety {
  border-color: rgba(245, 158, 11, 0.45);
}

.notam-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.notam-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}

.notam-badge--urgent {
  background: rgba(191, 30, 46, 0.12);
  color: var(--red);
}

.notam-badge--safety {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.notam-badge--info {
  background: var(--soft-blue);
  color: var(--blue);
}

.notam-item-index {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.notam-item-body {
  margin: 0;
  border-radius: 0;
  border: 0;
}

.notam-footer {
  margin-top: 4px;
}

.notam-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  background: #eef4fb;
  padding: 2px 6px;
  border-radius: 6px;
}

.error-line {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff1f2;
  border: 1px solid rgba(191, 30, 46, 0.25);
  color: #9f1239;
  font-size: 13px;
  font-weight: 700;
}

/* Flight movements (ADS-B) */
.movements-panel .movements-inputs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.movements-actions {
  flex-wrap: wrap;
}

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

.movements-col {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 120px;
}

.movements-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.movements-col-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.movements-col-head--in h3 {
  color: var(--green);
}

.movements-col-head--out h3 {
  color: var(--blue);
}

.movements-col-head--near h3 {
  color: var(--muted);
}

.movements-count {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.movements-list {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.movement-row {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.movement-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.movement-callsign {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}

.movement-meta {
  font-size: 12px;
  color: var(--muted);
}

.movement-row-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.movement-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 8px 4px;
}

a.movement-row-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
}

a.movement-row-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

a.movement-row-link:hover .movement-row {
  border-color: rgba(15, 76, 156, 0.35);
}

/* Flight detail page */
.flight-detail-page .flight-detail-hero {
  margin-bottom: 8px;
}

.flight-detail-sub {
  margin: 10px 0 0;
  color: #d8e8ff;
  font-size: 15px;
}

.flight-detail-mount {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.flight-detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.flight-detail-loading,
.flight-detail-error {
  margin: 0;
  padding: 22px;
  text-align: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.flight-detail-error {
  color: #9f1239;
  border-color: rgba(191, 30, 46, 0.25);
}

.flight-detail-note {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.detail-dl {
  margin: 0;
  display: grid;
  gap: 14px;
}

.detail-kv {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 12px 18px;
  align-items: baseline;
}

.detail-kv dt {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-kv dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.flight-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.flight-photo-card {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.flight-photo-card a {
  display: block;
}

.flight-photo-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.flight-photo-card figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}

.flight-detail-panel--muted .flight-detail-note {
  margin: 0;
}

.flight-live-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.flight-live-panel-head h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.flight-live-clock {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.flight-live-badge {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

.flight-detail-note--compact {
  margin-bottom: 12px;
}

/* Flight Notes */
.flight-notes-page .flight-notes-clock {
  font-variant-numeric: tabular-nums;
}

.flight-time-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flight-time-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flight-time-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.flight-time-controls input[type='datetime-local'] {
  flex: 1;
  min-width: 160px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid #ccd7e6;
  background: #fff;
  padding: 0 13px;
  font-size: 15px;
  color: var(--ink);
}

.now-btn {
  flex: 1 1 128px;
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--blue2), #164a93);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  transition: 0.16s ease;
}

.now-btn:hover {
  filter: brightness(1.06);
}

.now-btn:focus-visible {
  outline: 3px solid rgba(15, 95, 184, 0.45);
  outline-offset: 2px;
}

.flight-notes-actions {
  margin-top: 6px;
}

.flight-notes-section {
  margin-bottom: 22px;
}

.flight-notes-section:last-child {
  margin-bottom: 0;
}

.flight-notes-h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 900;
  color: var(--blue);
}

.flight-notes-h4 {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.flight-notes-empty {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.flight-notes-noscript {
  margin: 16px 0 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #78350f;
  font-size: 14px;
  line-height: 1.45;
}

.flight-notes-lede {
  margin: 0 0 16px;
  font-size: 14px;
  color: #475569;
  line-height: 1.45;
}

/* Vertical timeline: one fixed spine; dotted lines in copy are layout only (not time scaling) */
.flight-vtl-caption {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.flight-vtl {
  padding: 2px 0 4px;
}

.flight-vtl-stack {
  position: relative;
  display: flex;
  flex-direction: column;
}

.flight-vtl-stack::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: #c5d4e8;
  z-index: 0;
  pointer-events: none;
}

.flight-vtl-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
}

.flight-vtl-row.flight-vtl-copy {
  margin: 0;
  border: 0;
}

.flight-vtl-rail-slot {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.flight-vtl-rail-slot--dot {
  align-items: center;
  justify-content: center;
}

.flight-vtl-slot-aside {
  min-width: 0;
}

.flight-vtl-slot-aside--event {
  padding: 5px 0;
}

.flight-vtl-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.flight-vtl-dot--open[data-phase='dep'] {
  background: #fff;
  border: 2px solid var(--blue2);
  box-shadow: 0 0 0 2px #fff;
}

.flight-vtl-dot--filled[data-phase='dep'] {
  background: var(--blue2);
  border: 2px solid var(--blue2);
  box-shadow: 0 0 0 2px #fff;
}

.flight-vtl-dot--open[data-phase='arr'] {
  background: #fff;
  border: 2px solid #0f766e;
  box-shadow: 0 0 0 2px #fff;
}

.flight-vtl-dot--filled[data-phase='arr'] {
  background: #0f766e;
  border: 2px solid #0f766e;
  box-shadow: 0 0 0 2px #fff;
}

.flight-vtl-line {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px 8px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.flight-vtl-step {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.flight-vtl-phase {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.flight-vtl-copy[data-phase='arr'] .flight-vtl-phase {
  color: #0f766e;
}

.flight-vtl-title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flight-vtl-sep {
  flex: 1 1 8px;
  min-width: 6px;
  align-self: center;
  margin: 0 2px;
  border-bottom: 1px dotted #c9d7ea;
}

.flight-vtl-time {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.flight-vtl-copy[data-phase='arr'] .flight-vtl-time:not(.flight-vtl-time--empty) {
  color: #0f766e;
}

.flight-vtl-time--empty {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 640px) {
  .flight-vtl-stack::before {
    left: 10px;
  }

  .flight-vtl-row {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 2px 8px;
  }

  .flight-vtl-line {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .flight-vtl-title {
    flex: 1 1 140px;
  }

  .flight-vtl-sep {
    flex: 1 1 60px;
    min-width: 24px;
  }
}

.flight-tl {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
}

.flight-tl-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
}

.flight-tl-row:last-child {
  border-bottom: none;
}

.flight-tl-idx {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flight-tl-label {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}

.flight-tl-time {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.flight-dur-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flight-dur-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.flight-dur-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.flight-dur-value {
  font-size: 22px;
  font-weight: 950;
  color: var(--blue);
  margin-top: 6px;
}

.flight-dur-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.flight-insight-block {
  margin-bottom: 12px;
}

.flight-insight-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.flight-insight-list li {
  margin-bottom: 6px;
}

.flight-insight-warn {
  border-left: 4px solid #f59e0b;
  padding-left: 14px;
  list-style-position: outside;
}

.flight-insight-ok {
  margin: 0;
  font-size: 14px;
  color: #15803d;
  font-weight: 650;
}

.flight-insight-muted {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .flight-dur-grid {
    grid-template-columns: 1fr;
  }
}

.sata-offline-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  padding: 12px 16px;
  background: linear-gradient(135deg, #071f49, #0f4c9c);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.18);
}

.sata-offline-banner strong {
  font-weight: 900;
}

@media (max-width: 960px) {
  .hero,
  .grid { grid-template-columns: 1fr; }

  .cards { grid-template-columns: 1fr; }

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

  .movements-board {
    grid-template-columns: 1fr;
  }

  .flight-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body { background: #f6f8fc; }

  .app {
    width: 100%;
    margin: 0;
    padding: 12px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .portal-hero {
    border-radius: 24px;
    padding: 24px 18px;
  }

  .portal-card {
    min-height: 132px;
    border-radius: 22px;
    padding: 18px;
    grid-template-columns: 52px 1fr;
  }

  .portal-card strong { font-size: 19px; }

  .portal-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    font-size: 26px;
  }

  .hero {
    border-radius: 24px;
    padding: 22px 18px;
    gap: 16px;
  }

  h1 {
    font-size: 30px;
    letter-spacing: -0.03em;
  }

  .hero p { font-size: 14px; }

  .status-card .big { font-size: 31px; }

  .status-card .big.board-hint { font-size: 15px; }

  .grid {
    margin-top: 14px;
    gap: 14px;
  }

  .panel {
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  }

  .panel-header { padding: 16px; }

  .panel-body { padding: 16px; }

  .input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }

  input,
  button {
    height: 54px;
    border-radius: 16px;
    font-size: 17px;
  }

  .cards { gap: 14px; }

  .result-card {
    border-radius: 19px;
    padding: 16px;
  }

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

  .metric { padding: 11px; }

  .metric .v { font-size: 22px; }

  .calc-line {
    font-size: 12px;
    overflow-x: auto;
  }

  .detail-kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .comparison { grid-template-columns: 1fr; }

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

  .actions > :only-child {
    grid-column: 1 / -1;
  }

  button { width: 100%; }

  .flight-time-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }

  .flight-time-row {
    gap: 6px;
  }

  .flight-time-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .flight-time-controls input[type='datetime-local'] {
    min-width: 0;
    width: 100%;
  }
}
