/* EDDF wind & runway viewer – light, projector-friendly theme. */
:root {
  color-scheme: light;
  --page: #f2f2ef;
  --surface: #fcfcfb;
  --raised: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --wash: #f0efec;

  /* Encodings (validated: blue / amber / critical red pass the all-pairs CVD check) */
  --c-ost: #2a78d6;
  --c-west: #eda100;
  --c-closed: #d03b3b;
  --c-r18: #52514e;
  --c-unknown: #dcdbd3;
  --c-unknown-line: #a9a8a0;
  --c-warn: #fab219;
  --c-good-text: #006300;
  --c-warn-text: #7a4f00;

  /* Airport model */
  --c-ground: #e9e8e1;
  --c-apron: #dad9d1;
  --c-terminal: #bfbeb5;
  --c-taxi: #cac9c0;

  --radius: 12px;
  font-size: clamp(13px, 0.38vw + 9.2px, 17px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
b { font-weight: 700; }
code { font-size: 0.92em; background: var(--wash); padding: 0 4px; border-radius: 4px; }
kbd { font: inherit; font-size: 0.9em; border: 1px solid var(--axis); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--raised); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.app {
  min-height: 100vh;
  max-width: 2200px;
  margin: 0 auto;
  padding: 12px 16px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
/* Top bar, map + details, timeline: fills the window (minus the .app padding); the middle row grows with the
   details instead of scrolling inside them, and the map grows along. */
.screen {
  min-height: calc(100vh - 22px);
  display: grid;
  grid-template-rows: auto minmax(380px, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(11, 11, 11, 0.04);
}

/* ---------------------------------------------------------------- top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { flex: none; width: 42px; height: 42px; border-radius: 11px; background: var(--ink); display: grid; place-items: center; }
h1 { margin: 0; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.015em; }
/* Airport choice in the title: looks like the subtitle, with a caret */
.airport-select {
  font: inherit; font-weight: 500; color: var(--ink-2); letter-spacing: inherit; cursor: pointer;
  padding: 0 26px 0 6px; margin-left: 2px; border: 1px solid transparent; border-radius: 8px; background-color: transparent;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%2352514e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 12px;
}
.airport-select:hover, .airport-select:focus-visible { border-color: var(--axis); background-color: var(--raised); color: var(--ink); }
.meta { margin: 3px 0 0; font-size: 0.8rem; color: var(--ink-2); }
.meta b { color: var(--ink); }
.meta:empty { display: none; }
.models { display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: flex-end; }
.model { display: grid; gap: 3px; min-width: 0; max-width: 370px; }
.model-kind { font-size: 0.68rem; line-height: 1.25; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.model select {
  font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink);
  width: 100%; min-width: 220px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--axis); background: var(--raised); cursor: pointer; text-overflow: ellipsis;
}
.model select:hover { border-color: var(--muted); }
/* Last data update: a dot for the state of the background updates, details in the tooltip. */
.update-info { cursor: help; }
.update-value { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; font-size: 0.88rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.update-dot { width: 9px; height: 9px; border-radius: 50%; background: #1f9d55; flex: none; }
.update-info[data-state="busy"] .update-dot { background: #0a84ff; animation: pulse 1.1s ease-in-out infinite; }
.update-info[data-state="stale"] .update-dot { background: var(--c-warn); }
.update-info[data-state="error"] .update-dot { background: var(--c-closed); }
.update-info[data-state="off"] .update-dot { background: var(--axis); }
@keyframes pulse { 50% { opacity: 0.25; } }
.btn-od {
  font: inherit; font-size: 0.88rem; font-weight: 650; color: var(--ink); white-space: nowrap;
  height: var(--ctl-h); padding: 0 12px; border-radius: 8px; border: 1px solid var(--axis); background: var(--raised); cursor: pointer;
}
.btn-od:hover { background: var(--wash); border-color: var(--muted); }
/* Language flag and settings: pinned to the top right; the top bar keeps their space free so they never wrap. */
.topbar { position: relative; padding-right: 124px; --ctl-h: 34px; }
/* Level with the buttons under the .model-kind labels: one label line (0.68rem × 1.25) plus the 3px gap lower. */
.corner { position: absolute; top: calc(0.68rem * 1.25 + 3px); right: 0; display: flex; align-items: stretch; gap: 6px; height: var(--ctl-h); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h); padding: 0 9px;
  font: inherit; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2);
  border-radius: 8px; border: 1px solid var(--axis); background: var(--raised); cursor: pointer;
}
.lang-btn:hover { background: var(--wash); color: var(--ink); }
.lang-btn svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(11, 11, 11, 0.18); }
.icon-btn {
  display: grid; place-items: center; height: var(--ctl-h); min-width: var(--ctl-h); padding: 0 8px; border-radius: 8px; border: 1px solid var(--axis);
  background: var(--raised); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--wash); color: var(--ink); }
/* Settings: a panel under the gear with the model selection. */
.settings {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: min(440px, calc(100vw - 32px));
  display: grid; gap: 12px; padding: 14px 16px 16px; border-radius: 14px; background: var(--raised);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--border);
}
.settings[hidden] { display: none; }
.settings h2 { margin: 0; font-size: 1rem; letter-spacing: -0.01em; }
.settings .model { max-width: none; }
.ops { border: 0; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.ops-on { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.ops-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--ink-2); }
.ops-hours select { font: inherit; padding: 3px 6px; border-radius: 7px; border: 1px solid var(--axis); background: var(--raised); color: var(--ink); }
.ops-hours select:disabled { opacity: 0.5; }
.off-note { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--wash); font-size: 0.78rem; color: var(--ink-2); }
.run-off { background: var(--c-unknown); }
.tl-cell.is-off .tl-arrow { opacity: 0.45; }
.hs-cell.is-off .hs-fc, .hs-cell.is-off .hs-flown { opacity: 0.25; }

/* ------------------------------------------------------------------- main */
.main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(480px, 1fr); gap: 10px; min-height: 0; }
.map-card { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; padding: 9px 14px 2px; }
.card-head h2 { margin: 0; font-size: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: 3px 12px; list-style: none; margin: 0; padding: 0; font-size: 0.74rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 3px; border: 1px solid rgba(11, 11, 11, 0.45); }
.sw-ost { background: var(--c-ost); }
.sw-west { background: var(--c-west); }
.sw-r18 { background: var(--c-r18); }
.sw-closed { background: var(--c-closed); }
.sw-partial { background: repeating-linear-gradient(-45deg, var(--c-closed) 0 3px, var(--c-r18) 3px 7px); }
.sw-mixed { background: repeating-linear-gradient(45deg, var(--c-ost) 0 4px, var(--c-west) 4px 8px); }
.sw-unknown, .run-unknown, .od-unknown {
  background: repeating-linear-gradient(135deg, var(--c-unknown-line) 0 1.5px, var(--c-unknown) 1.5px 5px);
}

.map-wrap { position: relative; min-height: 340px; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; font-family: inherit; }

/* Floating cards on the map (design of runway.aicp.agency): white, blurred, rounded, no outline. */
.float {
  position: absolute; z-index: 5; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}
.map-tl { position: absolute; left: 14px; top: 14px; z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: calc(100% - 28px); pointer-events: none; }
.map-card.is-gl .map-tl { max-width: min(430px, calc(100% - 200px)); }
.map-tl .float { position: static; }
/* One badge row stays reserved, so the airport is framed below it whether or not a badge is shown. */
.map-badges { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.map-card.is-gl .map-badges { min-height: 30px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 6px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 650; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}
.badge-night .badge-icon { background: var(--ink); color: #fff; }
.badge-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; flex: none; }
.badge-change .badge-icon { background: linear-gradient(135deg, var(--c-ost) 50%, var(--c-west) 50%); color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
.badge-closed { border-color: rgba(208, 59, 59, 0.45); }
.badge-closed .badge-icon { background: var(--c-closed); color: #fff; }
.badge-warn { border-color: rgba(250, 178, 25, 0.8); }
.badge-warn .badge-icon { background: var(--c-warn); color: var(--ink); }

/* Map engine (runway_map.js): the card is the map, the schematic legend is not needed. */
.map-card.is-gl { border: 0; border-radius: 20px; background: #e9eaec; }
.map-card.is-gl .card-head { display: none; }
.map-card.is-gl .map-wrap { grid-row: 1 / -1; }
.rm-map { position: absolute; inset: 0; }
.rm-map .maplibregl-ctrl-attrib { background: rgba(255, 255, 255, 0.9); border-top-left-radius: 8px; font-size: 0.68rem; }
.rm-windfx { position: absolute; top: 0; left: 0; pointer-events: none; }
.rm-toggles { top: 14px; right: 14px; display: flex; gap: 8px; background: transparent; box-shadow: none; backdrop-filter: none; }
.tg { display: flex; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); border-radius: 12px; padding: 3px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1); }
.tg button {
  font: inherit; font-size: 0.8rem; font-weight: 550; color: var(--ink); padding: 6px 12px; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer;
}
.tg button:hover { background: var(--wash); }
.tg button.on { background: #1d1d1f; color: #fff; }
.rm-key {
  left: 14px; bottom: 30px; padding: 8px 13px; font-size: 0.74rem; display: flex; gap: 5px 14px; align-items: center; flex-wrap: wrap;
  max-width: calc(100% - 230px);
}
.rm-key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rm-ramp {
  position: relative; display: inline-block; width: 96px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #7fd3f7 0%, #32ade6 16.7%, #0a84ff 33.3%, #3f51f5 50%, #5e3bd6 66.7%, #7a1fa8 100%);
}
.rm-cur { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: #1d1d1f; box-shadow: 0 0 0 2px #fff; transform: translateX(-50%); }
.rm-sw { display: inline-block; width: 20px; height: 10px; border-radius: 3px; }
.rm-wind { right: 14px; bottom: 30px; padding: 9px 14px; display: flex; align-items: center; gap: 10px; font-size: 0.8rem; line-height: 1.35; }
.rm-rose-ring { fill: #f5f5f7; stroke: #e3e3e8; }
.rm-rose-n { font-size: 7px; font-weight: 700; fill: #6e6e73; text-anchor: middle; }
.rl {
  font-size: 0.74rem; font-weight: 600; color: #1d1d1f; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.rl b { font-weight: 800; }
.rl .r-near { color: #b25e00; }
.rl .r-over { color: #c4271d; }
.rm-plane, .rm-shadow { pointer-events: none; }
.rm-shadow svg { filter: blur(1.2px); }

/* SVG airport model */
.m-ground { fill: var(--c-ground); stroke: var(--c-ground); stroke-linejoin: round; }
.m-ground-strip { fill: none; stroke: var(--c-ground); stroke-linecap: round; stroke-linejoin: round; }
.m-apron { fill: var(--c-apron); }
.m-taxi { fill: none; stroke: var(--c-taxi); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.m-terminal { fill: var(--c-terminal); stroke: #a19f96; stroke-width: 1; stroke-linejoin: round; }
.m-cargo { fill: #cfcec6; stroke: #b3b1a8; stroke-width: 1; }
.m-tlabel {
  font-size: 13px; font-weight: 800; fill: var(--ink-2); text-anchor: middle; dominant-baseline: middle;
  paint-order: stroke; stroke: var(--c-apron); stroke-width: 4px; stroke-linejoin: round;
}
.m-tlabel-cargo { font-size: 10.5px; font-weight: 600; }
.rw { stroke: rgba(11, 11, 11, 0.65); stroke-width: 1; stroke-linejoin: round; }
.rw-overlay { stroke: none; }
.chev { fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.chev-light { stroke: #fff; }
.chev-dark { stroke: var(--ink); }
.chev-halo { stroke: #fff; filter: drop-shadow(0 0 1.2px rgba(0, 0, 0, 0.95)); }
.rw-end {
  font-size: 12px; font-weight: 600; fill: var(--muted);
  paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round;
}
.rw-end.is-active { fill: var(--ink); font-weight: 800; }
.rw-name {
  font-size: 11px; font-weight: 500; fill: var(--ink-2); text-anchor: middle;
  paint-order: stroke; stroke: var(--c-ground); stroke-width: 3px; stroke-linejoin: round;
}
.rw-name.is-closed { fill: var(--c-closed); font-weight: 700; }
.rw-status { font-weight: 800; }
.rw-status-unknown { fill: var(--ink-2); font-weight: 600; font-style: italic; }
.wind-arrow { stroke: var(--ink); stroke-opacity: 0.8; stroke-width: 1.8; stroke-linejoin: round; paint-order: stroke; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)); }
.wg-tail { stop-color: var(--ink); stop-opacity: 0.03; }
.wg-head { stop-color: var(--ink); stop-opacity: 0.3; }
.wind-rot { transition: transform 650ms cubic-bezier(0.3, 0.7, 0.2, 1); }
.m-wind { transition: opacity 250ms; }
.m-wind.is-hidden { opacity: 0 !important; }
.m-north-ring { fill: rgba(252, 252, 251, 0.9); stroke: var(--axis); }
.m-north-arrow { fill: var(--ink); }
.m-north-text { font-size: 11px; font-weight: 800; text-anchor: middle; fill: var(--ink); }
.m-scale path { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.m-scale text { font-size: 11px; fill: var(--ink-2); text-anchor: middle; }
.pf-ost { fill: var(--c-ost); }
.pf-west { fill: var(--c-west); }
.pf-closed { fill: var(--c-closed); }
.pf-unknown { fill: var(--c-unknown); }
.pf-unknown-line { fill: var(--c-unknown-line); }

/* ----------------------------------------------------------- detail panel */
.detail-card { min-width: 0; padding: 12px 16px 12px; }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eyebrow { margin: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.d-head h2 { margin: 1px 0 0; font-size: 1.3rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tz { font-size: 0.7em; font-weight: 600; color: var(--ink-2); }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--wash); border: 1px solid var(--border); white-space: nowrap; letter-spacing: 0; text-transform: none; }
.tag-fc { background: #eef1f6; }
.tag-mixed { background: linear-gradient(90deg, var(--wash) 50%, #eef1f6 50%); white-space: normal; text-align: center; max-width: 13rem; }
.tag-now { background: var(--ink); color: #fff; border-color: var(--ink); padding: 1px 7px; }
.tag-demo { background: #fff5dc; border-color: rgba(250, 178, 25, 0.9); color: var(--c-warn-text); margin-right: 2px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.kpi { border: 1px solid var(--border); border-radius: 10px; padding: 6px 9px 7px; background: var(--raised); min-width: 0; }
.kpi-btn { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kpi-btn > span { display: block; }
.kpi-btn > .kpi-value { display: flex; }
.kpi-btn:hover { border-color: var(--muted); background: var(--wash); }
.kpi.is-closed { border-color: rgba(208, 59, 59, 0.55); box-shadow: inset 4px 0 0 var(--c-closed); }
.kpi-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.kpi-value { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 1.12rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: 2px; font-size: 0.75rem; color: var(--ink-2); }
.kpi-sub b { color: var(--ink); }
.meter { height: 5px; margin-top: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink-2); border-radius: 3px; }
.od-chip {
  display: inline-grid; place-items: center; min-width: 2.15em; padding: 1px 5px; border-radius: 5px;
  font-size: 0.82em; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3;
  border: 1px solid rgba(11, 11, 11, 0.25);
}
.od-07 { background: var(--c-ost); color: #fff; }
.od-25 { background: var(--c-west); color: var(--ink); }
.od-unknown { color: var(--ink-2); }
.d-h3 { margin: 10px 0 5px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.d-h3 .hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 6px; }
.d-fold > summary { cursor: pointer; list-style: none; }
.d-fold > summary::-webkit-details-marker { display: none; }
.d-fold > summary::before { content: '▸'; display: inline-block; width: 1em; transition: transform 0.15s; }
.d-fold[open] > summary::before { transform: rotate(90deg); }
.d-fold > summary:hover { color: var(--ink); }
.steps-wrap { overflow-x: auto; }
.steps { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.steps th[scope="row"] { text-align: left; font-size: 0.74rem; font-weight: 650; color: var(--ink-2); padding: 2px 8px 2px 0; white-space: nowrap; }
.steps td, .steps thead th { text-align: center; padding: 2px 2px; }
.steps td { border-top: 1px solid var(--grid); }
.steps .is-obs { background: rgba(11, 11, 11, 0.035); }
.steps .is-sel { background: rgba(11, 11, 11, 0.1); }
.steps thead button {
  font: inherit; font-weight: 700; color: var(--ink); background: none; border: 1px solid transparent;
  border-radius: 6px; padding: 2px 5px; cursor: pointer;
}
.steps thead button:hover { border-color: var(--axis); background: var(--raised); }
.steps thead button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.steps svg { width: 18px; height: 18px; display: block; overflow: visible; flex: none; }
.cellflex { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1px 3px; }
.steps .dir { font-size: 0.7rem; color: var(--ink-2); }
.steps .is-peak { font-weight: 800; }
.peak { color: var(--ink); font-size: 0.65rem; margin-left: 1px; vertical-align: 1px; }
.p07 { font-size: 0.7rem; color: var(--ink-2); }
.sep { color: var(--muted); margin: 0 2px; }
.steps thead sup, .steps-note sup { font-size: 0.6rem; font-weight: 800; color: var(--ink-2); margin-left: 1px; }
.steps-note { margin: 4px 0 0; font-size: 0.7rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
/* Near (from 80 %) and over a limit, in the colours of the map key */
.lv-near, .lv-over { border-radius: 4px; padding: 0 3px; font-weight: 750; }
.lv-near { background: #fff0db; color: #b25e00; }
.lv-over { background: #ffe5e3; color: #c4271d; }
.obs-swatch { display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: rgba(11, 11, 11, 0.07); border: 1px solid var(--grid); }
.mini { display: inline-block; padding: 0 4px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; line-height: 1.45; }
.mini-closed { background: var(--c-closed); color: #fff; }
.mini-warn { background: var(--c-warn); color: var(--ink); }
.ok-dot { color: var(--c-good-text); font-weight: 700; }
.comp { width: 100%; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.comp th { font-size: 0.7rem; font-weight: 650; color: var(--ink-2); text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--axis); }
.comp td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.comp th:first-child, .comp td:first-child { text-align: left; }
.comp th:last-child, .comp td:last-child { text-align: left; white-space: normal; }
.comp tr.is-active td { background: rgba(11, 11, 11, 0.035); }
.comp tr.is-active td:first-child { box-shadow: inset 3px 0 0 var(--ink); font-weight: 700; }
.comp sup { color: var(--c-warn-text); font-weight: 800; }
.st-ok { color: var(--c-good-text); font-weight: 650; }
.st-closed { color: var(--c-closed); font-weight: 750; }
.st-warn { color: var(--c-warn-text); font-weight: 750; }
.st-muted, .st-unknown { color: var(--muted); }
.rules-note { margin: 8px 0 0; font-size: 0.72rem; color: var(--muted); line-height: 1.4; }

/* --------------------------------------------------------------- timeline */
.timeline-card { padding: 9px 14px 7px; }
.btn {
  font: inherit; font-size: 0.85rem; font-weight: 650; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 8px; border: 1px solid var(--axis); background: var(--raised); cursor: pointer;
}
.btn:hover { background: var(--wash); }
.btn svg { fill: currentColor; }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.tl { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); column-gap: 10px; }
.tl-rowlabels {
  display: grid; grid-template-rows: 18px 26px 40px 10px; align-items: center;
  font-size: 0.7rem; font-weight: 650; color: var(--ink-2); text-align: right; line-height: 1.1;
}
.tl-main { position: relative; min-width: 0; }
.tl-zones { position: relative; height: 18px; font-size: 0.72rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.tl-zones .z-obs { position: absolute; right: calc(100% - var(--now, 33%) + 50px); top: 1px; }
.tl-zones .z-obs::before { content: "◀ "; }
.tl-zones .z-fc { position: absolute; left: calc(var(--now, 33%) + 50px); top: 1px; }
.tl-zones .z-fc::after { content: " ▶"; }
.tl-track {
  position: relative; border-radius: 6px;
  background: linear-gradient(90deg, rgba(11, 11, 11, 0.045) 0 var(--now, 0%), transparent var(--now, 0%));
}
.tl-cells { display: grid; grid-template-columns: repeat(var(--n, 72), minmax(0, 1fr)); outline: none; }
.tl-cell { position: relative; display: grid; grid-template-rows: 26px 40px 10px; cursor: pointer; border-radius: 4px; outline: none; }
.tl-cell:hover { background: rgba(11, 11, 11, 0.05); }
.tl-cell[aria-selected="true"] { background: rgba(11, 11, 11, 0.1); }
.tl-cell[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; top: 24px; bottom: 8px;
  border: 2px solid var(--ink); border-radius: 4px; pointer-events: none;
}
.tl-cell:focus-visible::after { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: 0 0 0 2px var(--ink); }
.tl-cell.day-start { box-shadow: inset 1px 0 0 var(--axis); }
.tl-arrow { display: grid; place-items: center; overflow: visible; }
.tl-arrow svg { width: min(24px, calc(var(--cell-w, 20px) + 2px)); height: 24px; overflow: visible; }
.tl-shaft { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.tl-head { fill: var(--ink); }
.tl-calm { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
.tl-bar { display: flex; align-items: flex-end; height: 40px; padding: 0 1px; }
.run { display: block; flex: none; }
.run:first-child { border-top-left-radius: 3px; }
.run:last-child { border-top-right-radius: 3px; }
.run-07 { background: var(--c-ost); }
.run-25 { background: var(--c-west); }
.run-none { background: none; }
.tl-clos { position: relative; margin: 3px 1px 0; }
.clos { position: absolute; top: 0; bottom: 0; min-width: 4px; background: var(--c-closed); border-radius: 2px; }
.tl-now { position: absolute; top: 0; bottom: 8px; width: 0; border-left: 2px solid var(--ink); pointer-events: none; z-index: 2; }
.tl-now span {
  position: absolute; top: -18px; left: 0; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.tl-labels { position: relative; height: 15px; font-size: 0.7rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl-tick { position: absolute; top: 1px; transform: translateX(-50%); }
.tl-tick.is-midnight { font-weight: 800; color: var(--ink); }
.tl-days { position: relative; height: 16px; font-size: 0.74rem; font-weight: 700; }
.tl-day { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tl-slider { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; }
.tl-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--grid); }
.tl-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
  width: var(--cell-w, 14px); height: 18px; margin-top: -6px; border-radius: 5px;
  background: var(--ink); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink);
}
.tl-slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--grid); }
.tl-slider::-moz-range-thumb { box-sizing: border-box; width: var(--cell-w, 14px); height: 18px; border-radius: 5px; background: var(--ink); border: 2px solid var(--surface); }
.tl-note { margin: 4px 0 0; font-size: 0.72rem; color: var(--muted); }

.caption { font-size: 0.74rem; color: var(--ink-2); line-height: 1.45; padding: 0 4px; }
.warn-text { color: var(--c-warn-text); font-weight: 650; }
.tooltip {
  position: absolute; z-index: 20; max-width: 360px; padding: 6px 9px; border-radius: 7px;
  background: var(--ink); color: #fff; font-size: 0.78rem; line-height: 1.35; pointer-events: none;
  box-shadow: 0 4px 14px rgba(11, 11, 11, 0.2);
}
.fatal { max-width: 640px; margin: 12vh auto; padding: 24px 28px; }
.fatal h1 { font-size: 1.3rem; margin-bottom: 8px; }

/* ------------------------------------------------- forecast vs. flown (history.js) */
.hist-card { padding: 10px 14px 9px; min-width: 0; }
.hs-head { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.hs-head h2 { margin: 0; font-size: 1rem; }
.hs-head .hint { font-size: 0.74rem; color: var(--muted); }
.hist-card .kpis { grid-template-columns: repeat(3, minmax(0, 300px)); }
.hs-strip { margin-top: 6px; }
.hs-rowlabels { grid-template-rows: 34px 14px 8px; }
.hs-cells { display: grid; grid-template-columns: repeat(var(--n, 168), minmax(0, 1fr)); }
.hs-cell { display: grid; grid-template-rows: 34px 14px 8px; row-gap: 0; }
.hs-cell:hover { background: rgba(11, 11, 11, 0.06); }
.hs-cell.day-start { box-shadow: inset 1px 0 0 var(--axis); }
.hs-fc { display: flex; align-items: flex-end; padding: 0 0.5px; }
.hs-fc .run { width: 100%; border-radius: 2px 2px 0 0; }
.hs-fc .run.is-rec { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0 1.5px, transparent 1.5px 4px); }
.hs-flown { margin: 2px 0.5px 0; border-radius: 0 0 2px 2px; }
.hs-miss { position: relative; }
.hs-miss i { position: absolute; left: 0.5px; right: 0.5px; top: 2px; height: 5px; background: var(--c-closed); border-radius: 2px; }
.hs-lead { min-height: 150px; }
.hs-lead svg { display: block; max-width: 100%; }
.hs-grid { stroke: var(--grid); stroke-width: 1; }
.hs-axis { font-size: 10.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.hs-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.hs-base { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 5 4; }
.hs-sel { stroke: var(--axis); stroke-width: 1.5; }
.hs-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.hs-hit { fill: transparent; cursor: pointer; }

/* ------------------------------------------------------------- login page (login.html) */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(400px, 100%); display: grid; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; --ctl-h: 34px; }
.login-brand > div:nth-child(2) { flex: 1; min-width: 0; }
.login-brand h1 { margin: 0; font-size: 1.15rem; letter-spacing: -0.01em; }
.login-kicker { margin: 0; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.login-card { display: grid; gap: 12px; padding: 18px 20px 20px; }
.login-card h2 { margin: 0; font-size: 1rem; }
.login-field { display: grid; gap: 4px; }
.login-field input {
  font: inherit; font-size: 0.95rem; color: var(--ink); padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--axis); background: var(--raised);
}
.login-field input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.login-pw { position: relative; display: grid; }
.login-pw input { padding-right: 42px; }
.login-eye {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center;
  width: 32px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.login-eye:hover { background: var(--wash); color: var(--ink); }
.login-eye .eye-shut, .login-eye[aria-pressed="true"] .eye-open { display: none; }
.login-eye[aria-pressed="true"] .eye-shut { display: block; }
.login-submit {
  font: inherit; font-size: 0.92rem; font-weight: 700; margin-top: 4px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer;
}
.login-submit:hover { background: #2b2b2b; }
.login-error { margin: 0; padding: 7px 10px; border-radius: 8px; background: #fbeceb; border: 1px solid rgba(208, 59, 59, 0.4); font-size: 0.84rem; color: #8a1f1f; }
.login-note { margin: 0; font-size: 0.72rem; color: var(--muted); text-align: center; }
.settings .logout { justify-self: start; font: inherit; font-size: 0.84rem; font-weight: 650; padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--axis); background: var(--raised); color: var(--ink); cursor: pointer; }
.settings .logout:hover { background: var(--wash); }
.logout-form { display: flex; align-items: center; gap: 10px; }
.logout-form[hidden] { display: none; }
.logout-user { font-size: 0.8rem; color: var(--ink-2); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .main { grid-template-columns: minmax(0, 1fr) minmax(420px, 1.1fr); }
}
@media (max-width: 1300px) {
  .model { max-width: 330px; }
}
@media (max-width: 980px) {
  .map-wrap { min-height: 480px; }
}
@media (max-width: 980px) {
  .main { grid-template-columns: 1fr; }
  .models { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .wind-rot, .m-wind { transition: none; }
  .update-info[data-state="busy"] .update-dot { animation: none; }
}
@media (forced-colors: active) {
  .run, .clos, .sw, .od-chip { forced-color-adjust: none; }
}

/* -------------------------------------------- operating direction changes */
.od-dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 18px;
  background: var(--raised); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}
.od-dialog::backdrop { background: rgba(11, 11, 11, 0.35); }
.od-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 22px 10px; background: var(--raised); }
.od-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.od-close { font: inherit; font-size: 1.4rem; line-height: 1; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--wash); cursor: pointer; }
.od-close:hover { background: var(--grid); }
#od-body { padding: 0 22px 20px; font-size: 0.88rem; }
.od-lead { margin: 0 0 10px; color: var(--ink-2); line-height: 1.45; }
.od-now { margin: 0 0 14px; padding: 9px 12px; border-radius: 10px; background: var(--wash); line-height: 1.6; }
.od-h3 { margin: 16px 0 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.od-form { padding: 2px 14px 10px; border-radius: 12px; border: 1px solid var(--border); }
.od-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.od-field { display: grid; gap: 4px; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.od-grow { flex: 1 1 180px; }
.od-field input {
  font: inherit; font-size: 0.88rem; color: var(--ink); padding: 6px 9px; border-radius: 8px; border: 1px solid var(--axis); background: var(--raised);
}
.seg { display: inline-flex; background: var(--wash); border-radius: 10px; padding: 3px; }
.seg button { font: inherit; font-size: 0.84rem; font-weight: 650; padding: 5px 11px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink); }
.seg button.on { background: #1d1d1f; color: #fff; }
.btn-primary {
  font: inherit; font-size: 0.86rem; font-weight: 700; padding: 7px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: #1d1d1f; color: #fff;
}
.btn-primary:hover { background: #3a3a3c; }
.link-btn { font: inherit; padding: 0; border: 0; background: none; color: #1f6f6b; font-weight: 650; text-decoration: underline; cursor: pointer; }
.od-help { margin: 8px 0 0; font-size: 0.78rem; color: var(--ink-2); line-height: 1.45; }
.od-msg { margin: 6px 0 0; min-height: 1em; font-size: 0.8rem; font-weight: 650; }
.od-msg.is-ok { color: var(--c-good-text); }
.od-msg.is-err { color: var(--c-closed); }
.od-note { color: var(--ink-2); }
.od-table-wrap { max-height: 280px; overflow: auto; border-radius: 10px; border: 1px solid var(--border); }
.od-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.od-table th { position: sticky; top: 0; background: var(--wash); text-align: left; font-size: 0.72rem; font-weight: 700; color: var(--ink-2); padding: 6px 10px; }
.od-table td { padding: 6px 10px; border-top: 1px solid var(--border); vertical-align: top; }
.od-t { white-space: nowrap; font-variant-numeric: tabular-nums; }
.od-w { white-space: nowrap; }
.od-src { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--wash); }
.od-src-manual { background: #e3f0ef; color: #1f6f6b; }
.od-extra { font-size: 0.74rem; color: var(--ink-2); margin-top: 2px; }
.od-del { font: inherit; font-size: 1rem; line-height: 1; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.od-del:hover { background: #fbeceb; color: var(--c-closed); }
.od-train { margin-top: 6px; }
.od-train-state { margin: 6px 0 0; font-size: 0.8rem; font-weight: 650; color: var(--ink-2); }
.od-train-state:empty { display: none; }
