:root {
  --chrome: #0c121c;
  --panel: #121a26;
  --panel-2: #182231;
  --line: #233044;
  --text: #e7edf5;
  --muted: #8c9ab0;
  --accent: #f5b400;
  --accent-ink: #0c121c;
  --danger: #ff5d5d;
  --danger-bg: rgba(255, 93, 93, .12);
  --radius: 10px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --top-h: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Elements given display rules elsewhere must still hide when [hidden] is set. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--chrome);
  color: var(--text);
  font: 14px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
svg { display: block; }

/* ---------- top bar ---------- */
.top {
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1100;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .01em; }

.search { position: relative; flex: 1; min-width: 0; max-width: 420px; }
.search-icon { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: #1ea7ff; box-shadow: 0 0 0 3px rgba(30,167,255,.18); }
.results {
  position: absolute; top: 44px; left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 340px; overflow: auto;
}
.results li { padding: 9px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.results li:hover { background: var(--panel-2); }
.results li.empty { cursor: default; color: var(--muted); }
.results li.empty:hover { background: none; }
.results .r-main { font-weight: 600; }
.results .r-sub { color: var(--muted); }

.top-nav { display: flex; gap: 2px; margin-left: auto; }
.top-nav a { padding: 7px 11px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; }
.top-nav a:hover { color: var(--text); background: var(--panel); }
.top-right { margin-left: 8px; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.pill {
  padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums;
}
.pill strong { color: var(--text); font-weight: 600; }
.pill.warn { color: var(--danger); border-color: rgba(255, 93, 93, .4); }
.clock { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 14px/1 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock small { font: 700 10.5px/1 Inter, system-ui, sans-serif; letter-spacing: .06em; color: #1ea7ff; }

/* ---------- map ---------- */
.stage { position: relative; height: calc(100% - var(--top-h)); }
#map { position: absolute; inset: 0; background: #1b2433; }
html[data-map="light"] #map { background: #d9e4ea; }
/* OpenStreetMap tiles, toned down so aircraft stand out. */
html[data-map="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) saturate(.35) brightness(calc(.78 * var(--map-b, 1))) contrast(1.1); }
html[data-map="light"] .leaflet-tile-pane { filter: saturate(.3) brightness(calc(1.04 * var(--map-b, 1))) contrast(.92); }
html[data-map="grey"] #map { background: #c9cdd2; }
html[data-map="grey"] .leaflet-tile-pane { filter: grayscale(1) brightness(calc(1 * var(--map-b, 1))) contrast(.95); }
.ac-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 450; }
.leaflet-container.over-ac { cursor: pointer; }
.leaflet-control-attribution {
  background: rgba(12, 18, 28, .75) !important; color: var(--muted) !important;
  font-size: 11px; border-radius: 6px 0 0 0;
}
.leaflet-control-attribution a { color: #c9d4e3 !important; }

.hover-tip {
  position: absolute; z-index: 600; pointer-events: none;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap;
}
.hover-tip b { font-weight: 700; margin-right: 6px; }
.hover-tip span { color: var(--muted); }

/* ---------- map controls ---------- */
.map-controls {
  position: absolute; right: 14px; top: 14px; z-index: 700;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.ctl { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--panel); cursor: pointer; color: var(--text); }
.ctl:hover { background: var(--panel-2); }
.ctl svg { width: 18px; height: 18px; }

/* ---------- bottom dock ---------- */
.dock {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 720;
  display: flex; gap: 4px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.dock-item { position: relative; }
.dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 70px; padding: 7px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--muted); font-size: 12px;
}
.dock-btn svg { width: 20px; height: 20px; }
.dock-btn:hover, .dock-btn[aria-expanded="true"] { background: var(--panel-2); color: var(--text); }
.pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  width: 250px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.pop h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop h3 ~ h3 { margin-top: 14px; }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--chrome); border-radius: 8px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 6px 8px; border: 0; border-radius: 6px; background: none; cursor: pointer; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.switch { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:focus-visible { outline: 2px solid #1ea7ff; outline-offset: 2px; }
.ramp-wrap { margin: -4px 0 10px; }
.ramp {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #8a8a8a 0 7%, hsl(20 82% 48%) 7%, hsl(20 82% 48%) 12%, hsl(80 82% 38%) 23%, hsl(140 82% 38%) 34%, hsl(193 82% 48%) 67%, hsl(300 82% 48%) 100%);
}
.ramp-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }

/* ---------- flight panel ---------- */
.flight {
  position: absolute; top: 14px; left: 14px; bottom: 14px; width: 370px; z-index: 800;
  overflow: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.fl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 16px 16px 12px; }
.fl-callsign { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fl-callsign h1 { margin: 0; font-size: 24px; letter-spacing: .02em; color: var(--accent); }
.badge { padding: 2px 7px; border-radius: 5px; font-weight: 700; font-size: 12px; line-height: 1.5; }
.badge-iata { background: #3a4452; color: #e7edf5; }
.badge-type { background: #2f6fd6; color: #fff; }
.fl-airline { margin: 3px 0 0; color: var(--text); font-weight: 500; }
.icon-btn { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--panel-2); cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.fl-photo { position: relative; margin: 0; aspect-ratio: 16 / 9; background: var(--chrome); overflow: hidden; }
.fl-photo img { width: 100%; height: 100%; object-fit: cover; }
.fl-photo-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.fl-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #dde5ef; font-size: 11px;
}
.fl-photo figcaption a { color: #fff; }
.fl-photo { touch-action: pan-y; user-select: none; }
.fl-photo img { transition: opacity .2s; }
.fl-photo img.swapping { opacity: .35; }
.ph-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: rgba(8, 12, 19, .62); color: #fff; cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.ph-nav svg { width: 18px; height: 18px; }
.ph-prev { left: 8px; }
.ph-next { right: 8px; }
.fl-photo:hover .ph-nav, .ph-nav:focus-visible { opacity: 1; }
.ph-nav:hover { background: rgba(8, 12, 19, .85); }
.ph-nav:focus-visible { outline: 2px solid #1ea7ff; outline-offset: 2px; }
@media (hover: none) { .ph-nav { opacity: 1; } }
.ph-count {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 2px 8px; border-radius: 999px; background: rgba(8, 12, 19, .62); color: #fff;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.ph-dots { position: absolute; left: 0; right: 0; bottom: 26px; z-index: 2; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.ph-dots i.on { background: #fff; }

.alert { margin: 12px 16px 0; padding: 9px 11px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-weight: 600; }

.fl-route {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
  margin: 12px 16px 0; padding: 14px; background: var(--panel-2); border-radius: var(--radius);
}
.ap { display: flex; flex-direction: column; min-width: 0; }
.ap-end { text-align: right; }
.ap-code { font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.ap-city { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { grid-column: 1 / -1; position: relative; height: 4px; margin: 12px 0 4px; border-radius: 2px; background: var(--line); }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--accent); }
.progress-plane { position: absolute; top: 50%; width: 20px; height: 20px; margin-left: -10px; transform: translateY(-50%); color: var(--accent); }
.progress-text { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.fl-section { padding: 14px 16px 0; }
.fl-section h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.facts > div { background: var(--panel-2); padding: 9px 11px; min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { color: var(--muted); font-size: 11px; }
.facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.fl-actions { display: flex; gap: 8px; padding: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text);
  text-decoration: none; cursor: pointer; font-size: 13px;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--muted); }
.btn[aria-pressed="true"] { background: #0b84e0; border-color: #0b84e0; color: #fff; font-weight: 600; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .top { gap: 10px; padding: 0 12px; }
  .brand-name, .top-nav { display: none; }
  .top-right .pill { display: none; }
  .clock { font-size: 13px; padding: 4px 9px; }
  .top-right { margin-left: auto; }
  .pill { font-size: 12px; padding: 4px 9px; }
  .flight {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%;
    border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  .flight:not([hidden]) ~ .dock, .flight:not([hidden]) ~ .map-controls { display: none; }
  .dock { bottom: 16px; }
  .map-controls { top: 10px; right: 10px; }
}
@media (max-width: 420px) {
  .pill { display: none; }
}

@media (max-width: 1080px) { .top-nav { display: none; } .top-right { margin-left: auto; } }

/* ---------- panel tabs ---------- */
.fl-tabs { display: flex; gap: 4px; margin: 14px 16px 0; border-bottom: 1px solid var(--line); }
.fl-tabs button {
  padding: 9px 12px; border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.fl-tabs button:hover { color: var(--text); }
.fl-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.fl-pane { padding-bottom: 2px; }
#pane-cockpit, #pane-profile { padding: 14px 16px 0; }
.pane-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.facts-3 { grid-template-columns: 1fr 1fr 1fr; margin-top: 12px; }

/* ---------- cockpit display ---------- */
.pfd { background: #07090c; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.pfd svg { width: 100%; height: auto; }
.pfd text { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }

/* ---------- altitude profile ---------- */
.profile { background: var(--panel-2); border-radius: var(--radius); padding: 10px 8px 6px; min-height: 120px; }
.profile svg { width: 100%; height: auto; }
.profile text { font-family: Inter, system-ui, sans-serif; }
.profile-empty { display: grid; place-items: center; min-height: 140px; color: var(--muted); font-size: 13px; }

.flag { display: inline-block; width: 22px; height: 16px; margin-right: 8px; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); object-fit: cover; }

/* ---------- grouped flight details ---------- */
.grp { margin: 14px 16px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.grp-head {
  display: flex; align-items: center; gap: 9px; margin: 0; padding: 9px 12px;
  background: linear-gradient(180deg, #1d2a3d, #172233); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .01em;
}
.grp-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: rgba(245, 180, 0, .12); color: var(--accent); flex: none; }
.grp-icon svg { width: 16px; height: 16px; }
.grp-head-val { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(61, 220, 132, .12); color: #5ee39a; font-size: 12px; font-weight: 600; }
.grp-body { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.grp-body > div { padding: 9px 12px; min-width: 0; border-top: 1px solid rgba(35, 48, 68, .7); }
.grp-body > div:nth-child(-n+2), .grp-body > div.wide:first-child { border-top: 0; }
.grp-body > div:nth-child(odd):not(.wide) { border-right: 1px solid rgba(35, 48, 68, .7); }
.grp-body .wide { grid-column: 1 / -1; }
.grp-body dt { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.grp-body dd { margin: 3px 0 0; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.grp-body dd .u { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 2px; }
.grp-body dd .na { color: #56627a; font-weight: 500; }
.dt-code { margin-left: 4px; padding: 0 5px; border-radius: 4px; background: #2f6fd6; color: #fff; letter-spacing: .02em; }
.dt-code:empty { display: none; }
.modes { display: flex; flex-wrap: wrap; gap: 4px; }
.mode { padding: 1px 6px; border-radius: 4px; background: rgba(63, 208, 255, .12); color: #6fdcff; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.eta { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; }
.eta span { color: var(--muted); }

/* ---------- cockpit readouts ---------- */
.cstats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0 0;
  background: #07090c; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cstats > div { padding: 10px 12px; border-left: 1px solid #161c26; border-top: 1px solid #161c26; }
.cstats > div:nth-child(3n+1) { border-left: 0; }
.cstats > div:nth-child(-n+3) { border-top: 0; }
.cstats dt { color: #7d8aa0; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cstats dd { margin: 3px 0 0; font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 16px; font-weight: 600; color: #f2f5f9; white-space: nowrap; }
.cstats dd .u { color: #7d8aa0; font-size: 11px; font-weight: 500; margin-left: 3px; }
.pfd { padding: 0; border: 1px solid #1b2230; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04); overflow: hidden; }

/* Flag and country name on one line. */
#f-country { display: flex; align-items: center; min-width: 0; }
#f-country .flag { flex: none; margin-right: 8px; }
#f-country .country-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Never show the "no photo" text over a photo, whatever order the sources answer in. */
.fl-photo img:not([hidden]) ~ .fl-photo-empty { display: none !important; }

/* ---------- aircraft card ---------- */
.ac-hero { padding: 12px 12px 11px; }
.ac-model { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ac-model .dt-code { margin-left: 0; font-size: 11px; padding: 1px 6px; }
.ac-operator { margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.ac-strip { display: grid; grid-template-columns: 1.05fr 1fr .9fr; margin: 0; border-top: 1px solid rgba(35, 48, 68, .7); }
.ac-strip > div { padding: 10px 12px; min-width: 0; }
.ac-strip > div + div { border-left: 1px solid rgba(35, 48, 68, .7); }
.ac-strip dt { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ac-strip dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ac-strip dd .sub { display: block; margin-top: 1px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.ac-strip dd .na { color: #56627a; font-weight: 500; font-size: 13px; }
.ac-strip #f-country .flag { width: 20px; height: 15px; margin-right: 6px; }

/* ---------- satellite map ---------- */
html[data-map="satellite"] #map { background: #0b0f14; }
html[data-map="satellite"] .leaflet-tile-pane { filter: brightness(calc(.82 * var(--map-b, 1))) saturate(.95); }
.seg { flex-wrap: nowrap; }

/* ---------- filters in the Display menu ---------- */
.pop { width: 280px; }
.frow { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.frow label { margin-right: 2px; }
.frow select, .finput, .flist-tools select, .flist-tools input {
  height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--chrome); color: var(--text); font: inherit; font-size: 13px;
}
.frow select { flex: 1; min-width: 0; }
.finput { width: 100%; margin-bottom: 8px; }
.finput::placeholder, .flist-tools input::placeholder { color: #5f6d82; }
.frow select:focus, .finput:focus, .flist-tools select:focus, .flist-tools input:focus { outline: none; border-color: #1ea7ff; }
.fclear { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; }
.fclear:hover { background: var(--panel-2); }
.dock-btn { position: relative; }
.dock-badge {
  position: absolute; top: 3px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.dock-btn[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

/* ---------- flights in view ---------- */
.flist {
  position: absolute; top: 14px; right: 66px; bottom: 14px; width: 300px; z-index: 790;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.flist-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 16px; }
.flist-head h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.flist-count { padding: 1px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.flist-tools { display: flex; gap: 6px; padding: 0 12px 10px; }
.flist-tools input { flex: 1; min-width: 0; }
.flist-cols, .flist-rows li { display: grid; grid-template-columns: 1.3fr .8fr .9fr .8fr; gap: 6px; align-items: center; }
.flist-cols { padding: 6px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.flist-cols span:nth-child(n+3), .flist-rows li span:nth-child(n+3) { text-align: right; }
.flist-rows { list-style: none; margin: 0; padding: 4px 6px; overflow: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.flist-rows li { padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; }
.flist-rows li:hover { background: var(--panel-2); }
.flist-rows li.on { background: rgba(255, 90, 54, .14); }
.fl-cs { font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-ty { color: var(--text-2, #c3cddb); font-size: 12px; }
.fl-al { color: var(--text); }
.fl-sp { color: var(--muted); font-size: 12px; }
.flist-more { margin: 0; padding: 8px 16px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .flist { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 55%; border-radius: 16px 16px 0 0; border-bottom: 0; z-index: 810; }
  .flight:not([hidden]) ~ .flist { display: none; }
  .pop { width: min(280px, calc(100vw - 32px)); }
}

/* ---------- airline chips ---------- */
.pop { max-height: calc(100vh - 170px); overflow: auto; scrollbar-width: thin; }
.achips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.achip {
  position: relative; display: grid; place-items: center; height: 34px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
  font-size: 11px; font-weight: 700; color: #0c121c;
}
.achip img { max-width: 100%; max-height: 20px; object-fit: contain; }
.achip[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.achip-n {
  position: absolute; top: -6px; right: -5px; min-width: 18px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 10px; line-height: 14px; text-align: center;
}
.achips-empty { margin: -2px 0 12px; color: var(--muted); font-size: 12px; }

/* ---------- airport hover card ---------- */
.ap-tip {
  position: absolute; z-index: 610; pointer-events: none; transform: translate(-50%, -100%);
  max-width: 240px; padding: 7px 10px; border-radius: 8px; background: #fff; color: #0c121c;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); font-size: 13px; line-height: 1.3;
}
.ap-tip b { display: block; font-weight: 700; }
.ap-tip span { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-weight: 600; color: #3a4658; }
.ap-tip .flag { width: 18px; height: 13px; margin: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.ap-tip::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); }

/* ---------- airport panel ---------- */
.ap-name { margin: 0; font-size: 21px; line-height: 1.2; color: var(--accent); }
.ap-codes { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; font-weight: 700; font-size: 14px; color: var(--text); }
.ap-codes .flag { width: 20px; height: 15px; margin: 0; }
.ap-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.ap-photo { position: relative; margin: 0; aspect-ratio: 16 / 9; background: var(--chrome); }
#ap-map { position: absolute; inset: 0; background: #0b0f14; }
.ap-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 500; padding: 14px 10px 6px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #dde5ef; font-size: 11px; pointer-events: none; }
.ap-wx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 16px 0; }
.wx-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); text-align: center; min-height: 104px; position: relative; }
.wx-l { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.wx-icon, .wx-arrow { width: 30px; height: 30px; color: var(--text); }
.wx-icon svg, .wx-arrow svg { width: 100%; height: 100%; }
.wx-arrow { transition: transform .3s; }
.wx-v { font-size: 13px; font-weight: 600; color: var(--text); }
.wx-big { margin-top: 8px; font-size: 26px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.wx-cat { margin-top: 1px; padding: 0 5px; border-radius: 4px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; }
.cat-vfr { background: rgba(61,220,132,.16); color: #5ee39a; }
.cat-mvfr { background: rgba(80,150,255,.18); color: #7fb0ff; }
.cat-ifr { background: rgba(255,90,90,.18); color: #ff8080; }
.cat-lifr { background: rgba(255,79,216,.18); color: #ff8be6; }
.ap-metar { margin: 10px 16px 0; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.ap-metar summary { padding: 10px 0; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.ap-metar code { display: block; padding-bottom: 6px; font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.ap-metar p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.ap-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.apt-n { padding: 0 6px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 11px; }
.ap-traffic { list-style: none; margin: 6px 16px 0; padding: 0; }
.ap-traffic li { display: grid; grid-template-columns: 1.2fr .7fr 1fr .6fr; gap: 6px; align-items: center; padding: 8px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ap-traffic li:hover { background: var(--panel-2); }
.ap-traffic li b { color: var(--accent); }
.ap-traffic .apt-type { color: var(--muted); font-size: 12px; }
.ap-traffic .apt-dist { text-align: right; color: var(--muted); font-size: 12px; }
.ap-traffic li.empty, .ap-runways li.empty { display: block; cursor: default; color: var(--muted); }
.ap-traffic li.empty:hover { background: none; }
.ap-note { margin: 6px 16px 0; }
.ap-runways { list-style: none; margin: 0; padding: 0; }
.ap-runways li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-top: 1px solid rgba(35,48,68,.7); font-size: 13px; }
.ap-runways li:first-child { border-top: 0; }
.ap-runways li b { color: var(--text); }
.ap-runways li span { color: var(--muted); text-align: right; }

/* ---------- position card when there's no route ---------- */
.route-alt { display: block; }
.ra-head { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--text); }
.ra-head svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.ra-line { margin: 8px 0 0; padding-left: 29px; color: var(--text); font-size: 13px; }
.ra-note { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.ap-tabs { gap: 0; }
.ap-tabs button { white-space: nowrap; padding: 9px 8px; font-size: 13px; }

/* on-ground groups in the airport panel */
#ap-traffic li.apt-h { display: block; padding: 10px 2px 4px; border: 0; background: none; cursor: default; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#ap-traffic li.apt-h:first-child { padding-top: 2px; }

/* "Feed TailNav" call to action in the top bar */
.top-nav a.nav-cta { background: #0b84e0; color: #fff; font-weight: 600; margin-left: 4px; }
.top-nav a.nav-cta:hover { background: #1ea7ff; color: #fff; }

/* ---------- flight replay ---------- */
.replay-plane { background: none; border: 0; }
.replay-plane svg { transition: transform .2s; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.replay-bar { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 1200; width: min(640px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(16,23,34,.96); border: 1px solid var(--line, #253247); box-shadow: 0 20px 50px rgba(0,0,0,.5); color: #e8edf4; font-size: 13px; }
.replay-bar button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #f5b400; color: #0c121c; font-size: 14px; cursor: pointer; flex: none; }
.replay-bar .rp-close { background: transparent; color: #9aa7b8; font-size: 22px; }
.replay-bar .rp-main { flex: 1; min-width: 0; }
.replay-bar .rp-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replay-bar input[type=range] { width: 100%; accent-color: #f5b400; margin: 6px 0 2px; }
.replay-bar .rp-meta { color: #9aa7b8; font-variant-numeric: tabular-nums; }
.replay-bar select { background: #1c2738; color: #e8edf4; border: 1px solid #253247; border-radius: 8px; padding: 6px; }
.results li.r-hist { padding: 0; }
.results li.r-hist a { display: block; padding: 10px 14px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; border-top: 1px solid var(--line); }
.results li.r-hist a:hover { background: var(--panel-2, rgba(255,255,255,.05)); }

/* TailNav logo */
.brand-mark { width: 32px !important; height: 32px !important; }
.brand-name { font: 800 19px/1 Montserrat, Inter, system-ui, sans-serif; letter-spacing: -0.02em; color: #fff; }
.brand-name span { color: #1ea7ff; }

/* ---------- search suggestions ---------- */
.results { max-height: min(70vh, 560px); overflow-y: auto; padding: 0 0 6px; }
.results li.sg-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px 6px; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: default; border-radius: 0; background: rgba(255,255,255,.03); }
.results li.sg-head:hover { background: rgba(255,255,255,.03); }
.results li.sg-head:first-child { margin-top: 0; }
.results li.sg-head span { font-weight: 500; letter-spacing: 0; text-transform: none; }
.results li.sg-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 6px 0; border-radius: 8px; justify-content: flex-start; }
.results li.sg-item:hover, .results li.sg-item.active { background: var(--panel-2); }
.sg-icon { width: 34px; height: 34px; flex: none; border-radius: 8px; background: rgba(255,255,255,.05); display: grid; place-items: center; color: var(--muted); }
.sg-icon svg { width: 20px; height: 20px; }
.sg-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-main { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-main b { color: #fff; font-weight: 700; }
.sg-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.08); color: var(--muted); vertical-align: 1px; }
.sg-tag.sg-type { background: rgba(30,167,255,.16); color: #6cc4ff; }
.sg-tag.sg-live { background: rgba(79,209,139,.16); color: #4fd18b; }
.sg-tag.sg-live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #4fd18b; margin-right: 4px; vertical-align: 1px; }

/* ---------- aircraft category on the card ---------- */
.ac-cat { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(30,167,255,.14); color: #7cc8ff; }
.ac-cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ac-cat[data-cat="military"] { background: rgba(120,200,120,.14); color: #8fd48f; }
.ac-cat[data-cat="cargo"] { background: rgba(245,180,0,.14); color: #f5c84a; }
.ac-cat[data-cat="bizjet"] { background: rgba(190,140,255,.15); color: #c9a6ff; }
.ac-cat[data-cat="ga"], .ac-cat[data-cat="glider"] { background: rgba(255,255,255,.08); color: #c8d1dd; }
.ac-cat[data-cat="heli"] { background: rgba(255,120,90,.14); color: #ff9b80; }

/* ---------- filters panel ---------- */
.fpanel { position: absolute; top: 14px; right: 66px; bottom: 96px; width: 330px; z-index: 795; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.fp-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; padding: 8px 8px 6px; border-bottom: 1px solid var(--line); }
.fp-head h2 { margin: 0; text-align: center; font-size: 15px; grid-column: 2; }
.fp-icon { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.fp-icon:hover { background: var(--panel-2); color: var(--text); }
#fp-back { grid-column: 1; grid-row: 1; }
#fp-close { grid-column: 3; grid-row: 1; }
.fp-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.fp-tabs button { border: 0; background: none; color: var(--muted); font: 600 13.5px Inter, system-ui, sans-serif; padding: 11px; cursor: pointer; }
.fp-tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 #1ea7ff; }
.fp-count:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #1ea7ff; color: #04101f; font-size: 11px; }
.fp-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.fp-h { margin: 10px 2px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fp-h:first-child { margin-top: 0; }
.fp-cats { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.fp-cat { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); font: 500 13.5px Inter, system-ui, sans-serif; text-align: left; cursor: pointer; }
.fp-cat[aria-pressed="true"] { background: rgba(30,167,255,.1); border-color: rgba(30,167,255,.45); color: var(--text); }
.fp-cat-all { font-weight: 700; }
.fp-check { width: 18px; height: 18px; flex: none; border-radius: 5px; border: 2px solid #4a5a70; }
.fp-cat[aria-pressed="true"] .fp-check { border-color: #1ea7ff; background: #1ea7ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.3l2.5 2.5L12 5' fill='none' stroke='%2304101f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.fp-cat-name { flex: 1; }
.fp-cat-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-note, .fp-sub { margin: 8px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.fp-lead { margin: 2px 2px 8px; color: var(--text); font-weight: 600; }
.fp-empty { display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; font-size: 13px; color: var(--muted); }
.fp-empty b { color: var(--text); font-size: 14px; }
.fp-rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); }
.fp-rule-kind { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6cc4ff; }
.fp-rule-val { display: block; font-size: 14px; color: var(--text); }
.fp-rule-x { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 4px; }
.fp-rule-x:hover { color: #ff7a6b; }
.fp-add { margin-top: 8px; padding: 11px; border-radius: 9px; border: 0; background: #0b84e0; color: #fff; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.fp-add:hover { background: #1ea7ff; }
.fp-add:disabled { opacity: .45; cursor: default; }
.fp-add-line { background: none; border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.fp-add-line:hover { background: var(--panel-2); }
.fp-kind { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer; }
.fp-kind:hover { border-color: rgba(30,167,255,.5); }
.fp-kind b { display: block; font-size: 14px; }
.fp-kind span span { display: block; font-size: 12px; color: var(--muted); }
.fp-chev { font-size: 22px; color: var(--muted); }
.fp-input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: 14px Inter, system-ui, sans-serif; }
.fp-input:focus { outline: none; border-color: #1ea7ff; }
.fp-inline { display: flex; gap: 6px; align-items: center; }
.fp-to { color: var(--muted); font-size: 12px; }
.fp-btn { height: 38px; padding: 0 14px; border-radius: 8px; border: 0; background: #0b84e0; color: #fff; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; flex: none; }
.fp-results { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.fp-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); text-align: left; cursor: pointer; }
.fp-result:hover { background: var(--panel-2); border-color: var(--line); }
.fp-logo { width: 58px; height: 22px; flex: none; border-radius: 4px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.fp-logo img { max-width: 54px; max-height: 18px; }
.fp-res-text { flex: 1; min-width: 0; }
.fp-res-text b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-res-text span { display: block; font-size: 12px; color: var(--muted); }
.fp-res-n { font-size: 11.5px; color: #6cc4ff; white-space: nowrap; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-chip { padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; }
.fp-chip span { color: var(--muted); font-weight: 500; margin-left: 3px; }
.fp-chip:hover { border-color: #1ea7ff; }
.fp-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.fp-seg button { border: 0; background: none; color: var(--muted); font: 600 12.5px Inter, system-ui, sans-serif; padding: 8px 4px; cursor: pointer; }
.fp-seg button[aria-pressed="true"] { background: #1ea7ff; color: #04101f; }
.fp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.fp-foot button { border: 0; background: none; color: #ff8a7a; font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; }
@media (max-width: 700px) {
  .fpanel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 70%; border-radius: 16px 16px 0 0; z-index: 820; }
}

/* ---------- settings panel ---------- */
.spanel .fp-head { grid-template-columns: 36px 1fr 36px; }
.spanel .fp-head h2 { grid-column: 2; }
.sp-tabs { grid-template-columns: repeat(3, 1fr); }
.sp-h { margin: 14px 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sp-group:first-child .sp-h, .fp-body > .sp-h:first-child { margin-top: 2px; }
.sp-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.sp-style { position: relative; height: 74px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: var(--panel-2); cursor: pointer; }
.sp-style img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-style span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; font: 600 11.5px Inter, system-ui, sans-serif; color: #fff; background: rgba(6,13,31,.72); }
.sp-style[aria-pressed="true"] { border-color: #1ea7ff; }
.sp-style[aria-pressed="true"] span { background: #1ea7ff; color: #04101f; }
.sp-style-dark img { filter: invert(1) hue-rotate(195deg) saturate(.35) brightness(.78) contrast(1.1); }
.sp-style-light img { filter: saturate(.3) brightness(1.04) contrast(.92); }
.sp-style-grey img { filter: grayscale(1); }
.sp-style-satellite img { filter: brightness(.85); }
.sp-style-hybrid::after { content: "Places"; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font: 700 10px Inter, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
.sp-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.sp-seg button { border: 0; border-right: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: 600 12.5px Inter, system-ui, sans-serif; padding: 9px 4px; cursor: pointer; }
.sp-seg button:last-child { border-right: 0; }
.sp-seg button[aria-pressed="true"] { background: #1ea7ff; color: #04101f; }
.sp-seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.sp-seg-wrap button { border-bottom: 1px solid var(--line); }
.sp-seg-wrap button:nth-child(3n) { border-right: 0; }
.sp-slider { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.sp-slider input { flex: 1; accent-color: #1ea7ff; }
.sp-slider span.big { font-size: 20px; color: var(--text); }
.sp-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.sp-toggle b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.sp-toggle small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.sp-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sp-toggle i { width: 38px; height: 22px; flex: none; border-radius: 11px; background: #3a475b; position: relative; transition: background .15s; }
.sp-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sp-toggle input:checked + i { background: #1ea7ff; }
.sp-toggle input:checked + i::after { transform: translateX(16px); }
.sp-toggle input:focus-visible + i { outline: 2px solid #1ea7ff; outline-offset: 2px; }
.sp-note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.spanel .ramp-wrap { margin-top: 8px; }

/* ---------- side widgets ---------- */
.widgets { position: absolute; top: 14px; left: 14px; bottom: 96px; width: 330px; z-index: 780; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; pointer-events: none; scrollbar-width: none; }
.widgets::-webkit-scrollbar { display: none; }
.wcard { pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; flex: none; }
.wcard-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px 11px 15px; }
.wcard-head h2 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.w-badge { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: rgba(79,209,139,.15); color: #4fd18b; }
.wcard-toggle { width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; cursor: pointer; position: relative; }
.wcard-toggle::after { content: ""; position: absolute; left: 10px; top: 11px; width: 7px; height: 7px; border-left: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.wcard.collapsed .wcard-toggle::after { transform: rotate(225deg); top: 8px; }
.wcard-toggle:hover { background: var(--panel-2); }
.wcard-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.wcard.collapsed .wcard-body { display: none; }
.w-row { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
.w-row:hover { border-color: rgba(30,167,255,.5); }
.w-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.w-line b { font-weight: 700; }
.w-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.w-tag { font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.08); color: var(--muted); }
.w-tag.w-type { background: rgba(30,167,255,.16); color: #6cc4ff; }
.w-code { font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.w-viewers { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: #ffc93d; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.w-viewers svg { width: 16px; height: 16px; }
.w-live { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: rgba(79,209,139,.15); color: #4fd18b; }
.w-empty { margin: 2px 4px 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.w-ap { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.w-wx { font-size: 13px; }
.w-arrow { display: inline-block; font-weight: 700; color: var(--text); }
.w-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.w-cat { font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
.w-cat.cat-vfr { background: rgba(79,209,139,.15); color: #4fd18b; }
.w-cat.cat-mvfr { background: rgba(30,167,255,.16); color: #6cc4ff; }
.w-cat.cat-ifr { background: rgba(255,90,70,.16); color: #ff8a7a; }
.w-cat.cat-lifr { background: rgba(220,90,255,.16); color: #e09bff; }
.w-cat.cat-none { background: rgba(255,255,255,.08); color: var(--muted); }
.w-traffic { font-size: 11px; color: var(--muted); }
.w-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); margin: 0 -10px 6px; }
.w-tabs button { border: 0; background: none; color: var(--muted); font: 600 12px Inter, system-ui, sans-serif; padding: 9px 2px; cursor: pointer; }
.w-tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 #1ea7ff; }
.w-bm { display: flex; align-items: center; gap: 6px; padding: 0; cursor: default; }
.w-bm-main { flex: 1; min-width: 0; text-align: left; padding: 9px 11px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.w-x { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 0 10px; cursor: pointer; }
.w-x:hover { color: #ff8a7a; }
.w-add { margin-top: 4px; padding: 9px; border-radius: 9px; border: 1px dashed var(--line); background: none; color: #6cc4ff; font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; }
.w-add:hover { border-color: #1ea7ff; }
#w-loc-name { margin-top: 4px; }
#p-bm[aria-pressed="true"] { background: rgba(255,201,61,.15); border-color: rgba(255,201,61,.5); color: #ffc93d; }
.bm-star[aria-pressed="true"] { color: #ffc93d; }
.bm-star[aria-pressed="true"] path { fill: #ffc93d; }
@media (max-width: 760px) { .widgets { display: none; } }

/* ---------- search result card ---------- */
.results li.sg-card { display: block; margin: 4px 6px 6px; padding: 0; border-radius: 12px; border: 1px solid rgba(30,167,255,.35); background: rgba(30,167,255,.06); overflow: hidden; cursor: default; }
.results li.sg-card:hover { background: rgba(30,167,255,.06); }
.sgc-head { display: flex; align-items: center; gap: 11px; padding: 12px 12px 10px; }
.sgc-logo { width: 62px; height: 26px; flex: none; border-radius: 5px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.sgc-logo img { max-width: 58px; max-height: 22px; }
.sgc-titles { min-width: 0; }
.sgc-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sgc-line1 b { font-size: 16px; color: #fff; }
.sgc-route { margin-top: 3px; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sgc-code { font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.sgc-arrow { color: #1ea7ff; font-weight: 700; }
.sgc-photo { position: relative; height: 170px; background: var(--panel-2); }
.sgc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sgc-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff !important; font-size: 11px; text-decoration: none; }
.sgc-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line); }
.sgc-grid div { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.sgc-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.sgc-grid dt { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sgc-grid dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.sgc-model { margin: 0; padding: 9px 12px 2px; font-size: 12.5px; color: var(--muted); }
.sgc-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; }
.sgc-act { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: 600 12px Inter, system-ui, sans-serif; cursor: pointer; }
.sgc-act:hover { border-color: #1ea7ff; }
.sgc-act.primary { background: #0b84e0; border-color: #0b84e0; color: #fff; }
.sgc-act.primary:hover { background: #1ea7ff; }

/* aircraft card: second row of facts (category, MSN, Mode S) */
.ac-strip > div:nth-child(3n+1) { border-left: 0; }
.ac-strip > div:nth-child(n+4) { border-top: 1px solid rgba(35, 48, 68, .7); }
.ac-strip dd.na { color: #56627a; font-weight: 500; font-size: 13px; }
.results:has(.sg-card) { min-width: 440px; }

/* speed and altitude graph */
.profile { position: relative; }
.grp-graph { padding: 6px 10px 10px; }
.profile-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.prof-readout { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: rgba(6,13,31,.92); border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--text); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.grp-body > div.wide { grid-column: 1 / -1; }
.sgc-head { cursor: pointer; }
.sgc-titles { flex: 1; }
.sgc-toggle { width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px; background: none; cursor: pointer; position: relative; }
.sgc-toggle::after { content: ""; position: absolute; left: 10px; top: 9px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.sg-card.open .sgc-toggle::after { transform: rotate(-135deg); top: 13px; }
.sgc-toggle:hover { background: var(--panel-2); }
.sgc-actions { flex-direction: column; gap: 0; padding: 4px 0 6px; }
.sgc-act, .sgc-act.primary { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--text); padding: 10px 14px; font-size: 13px; }
.sgc-act:hover, .sgc-act.primary:hover { background: var(--panel-2); border-color: var(--line); }
.sgc-act.primary { color: #6cc4ff; }

/* panel actions: one tidy row */
.fl-actions { flex-wrap: nowrap; gap: 6px; }
.fl-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding-left: 6px; padding-right: 6px; font-size: 12.5px; white-space: nowrap; gap: 5px; }
.fl-actions .btn svg { width: 15px; height: 15px; flex: none; }

/* panel actions: four equal buttons, icon above label */
.fl-actions .btn { flex-direction: column; height: auto; padding: 9px 4px 8px; gap: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.1; }
.fl-actions .btn svg { width: 18px; height: 18px; }

/* ---------- account button and menu (top bar) ---------- */
.acct { position: relative; margin-left: 10px; flex: none; }
.acct-signin { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #2c3a52; color: #e8edf4; font: 600 13.5px Inter, system-ui, sans-serif; text-decoration: none; white-space: nowrap; }
.acct-signin:hover { border-color: #1ea7ff; color: #fff; }
.acct-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #1ea7ff; color: #04101f; font: 800 13px Montserrat, Inter, system-ui, sans-serif; cursor: pointer; letter-spacing: .02em; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(30,167,255,.3); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 2000; width: 240px; padding: 6px; border-radius: 12px; background: #0d1730; border: 1px solid #22304d; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.acct-who { padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid #22304d; }
.acct-who b { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #8d9bb0; }
.acct-who span { display: block; margin-top: 2px; font-size: 13.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who .acct-pts { color: #6cc4ff; font-size: 12.5px; }
.acct-menu a, .acct-menu .acct-out { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: #dbe3ee; font: 500 14px Inter, system-ui, sans-serif; text-align: left; text-decoration: none; cursor: pointer; }
.acct-menu a:hover, .acct-menu .acct-out:hover { background: #16223d; color: #fff; }
.acct-menu .acct-out { color: #ff9b8f; margin-top: 4px; border-top: 1px solid #22304d; border-radius: 0 0 8px 8px; }

/* ---------- search results: plain, dense list ---------- */
.results li.sg-head { background: none; padding: 10px 14px 4px; font-size: 10.5px; }
.results li.sg-item { position: relative; margin: 0; padding: 8px 64px 8px 14px; border-radius: 0; gap: 0; border-top: 1px solid rgba(255,255,255,.04); }
.results li.sg-item:hover, .results li.sg-item.active { background: rgba(30,167,255,.08); }
.sg-icon { display: none; }
.sg-main { font-size: 14px; }
.sg-main b { font-weight: 700; }
.sg-tag, .sg-tag.sg-type { background: none; padding: 0; margin-left: 6px; border-radius: 0; font-size: 12px; font-weight: 600; color: #8fa3bb; vertical-align: 0; }
.sg-tag.sg-live { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); margin: 0; color: #4fd18b; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sg-tag.sg-live::before { width: 6px; height: 6px; margin-right: 5px; }
.sg-sub { font-size: 12px; margin-top: 1px; }
.results .sg-tag.sg-live { background: none; padding: 0; }

/* ---------- cookie notice ---------- */
.cookie-bar { position: fixed; left: 16px; bottom: 16px; z-index: 3000; max-width: 460px; display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: #182230; color: #e8edf4; border: 1px solid #2a3647; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.28); font: 14px/1.5 Inter, system-ui, sans-serif; }
.cookie-bar p { margin: 0; }
.cookie-bar a { color: #6cc4ff; font-weight: 600; white-space: nowrap; }
.cookie-bar button { flex: none; height: 34px; padding: 0 18px; border: 0; border-radius: 8px; background: #0b84e0; color: #fff; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.cookie-bar button:hover { background: #0a76c9; }
@media (max-width: 520px) { .cookie-bar { left: 10px; right: 10px; bottom: 10px; max-width: none; } }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { position: fixed; inset: 40% 16px auto; z-index: 5000; max-width: 420px; margin: 0 auto; padding: 16px; background: #182230; color: #e8edf4; border-radius: 12px; text-align: center; }
.noscript a { color: #6cc4ff; }
.acct-menu .acct-sep { height: 1px; margin: 6px 0; background: rgba(255,255,255,.1); }
.fl-route.is-partial #r-to { color: var(--muted); }
.fl-route.is-partial .eta { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.fl-route.is-partial .progress-fill { width: 0 !important; }
/* phones: give the search box room; the clock hides */
@media (max-width: 520px) { .top-right .clock { display: none; } .top-right { gap: 8px; } }
.acct-menu .acct-install { color: #6cc4ff; border-top: 0; margin-top: 0; border-radius: 8px; }
.acct-menu .acct-install[hidden] { display: none; }
