/* Nickel — Cobalt-style app theme.
   Tokens sampled from the reference shots in _scratch/cobalt-ui-ref/. */

:root {
  /* surfaces, darkest → lightest */
  --bg: #07090e;
  --sheet: #10131a;
  --card: #171b24;
  --card-2: #0c0f15;
  --line: #232936;

  --text: #f2f5f9;
  --muted: #8b93a3;

  /* semantic */
  --blue: #0a84ff;
  --blue-dim: #12294a;
  --green: #30d158;
  --green-dim: #10321d;
  --red: #ff453a;
  --red-dim: #3a1215;
  --amber: #ff9f0a;
  --amber-dim: #3a2a10;
  --orange: #ff9f0a;
  --violet: #8b7cf6;

  /* map bands */
  --ground: #64748b;
  --low: #22d3ee;
  --mid: #a3e635;
  --high: #fbbf24;
  --atc: #f472b6;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;

  --font: "Satoshi", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --sheet-w: 430px;
  --tabbar-h: 74px;
}

* { box-sizing: border-box; }
/* display:flex/grid classes below would beat the UA's [hidden] rule */
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #2b3240 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2b3240; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
b, strong { font-weight: 700; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); }

.boot-error {
  position: fixed; left: 50%; top: 60px; transform: translateX(-50%);
  z-index: 90; background: var(--red-dim); border: 1px solid #6b2323;
  color: #ffd3d3; border-radius: var(--radius-s); padding: 10px 14px;
  font: 12px/1.5 var(--mono); max-width: 80vw; white-space: pre-wrap;
}

/* ---------- map underlay ---------- */
#map {
  position: fixed; inset: 0;
  background: var(--bg);
}
#map canvas { cursor: grab; }

/* dark maplibre chrome */
.maplibregl-popup-content {
  background: var(--sheet) !important;
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius-s) !important;
  font: 13px/1.5 var(--font) !important;
  padding: 8px 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}
.maplibregl-popup-tip { border-top-color: var(--sheet) !important; }
.maplibregl-ctrl-scale {
  background: rgba(7,9,14,.6) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
  border-radius: 4px;
  font: 11px var(--mono) !important;
}
.maplibregl-ctrl-attrib {
  background: rgba(7,9,14,.55) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

/* ---------- floating map chrome ---------- */
.map-ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.map-ui > * { pointer-events: auto; }

.bridge-pill {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(16, 19, 26, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.pill-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(48, 209, 88, .8);
  flex: none;
}
.pill-dot.bad { background: var(--red); box-shadow: 0 0 8px rgba(255,69,58,.8); }
.pill-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pill-text b { font-size: 13px; font-weight: 700; }
.pill-text small { font-size: 11px; color: var(--muted); }

.map-buttons {
  position: absolute;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 10px;
}
.map-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(16, 19, 26, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  transition: background .15s;
}
.map-btn:hover { background: rgba(30, 35, 46, .92); }
.map-btn.on { background: var(--blue); border-color: var(--blue); }
.map-btn svg { width: 19px; height: 19px; fill: currentColor; }

.map-pop {
  position: absolute;
  right: 62px;
  top: calc(12px + env(safe-area-inset-top));
  width: 220px;
  background: rgba(16, 19, 26, .96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.check {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 14px; cursor: pointer;
}
.check input { accent-color: var(--blue); width: 16px; height: 16px; }
.legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ground { background: var(--ground); }
.dot.low { background: var(--low); }
.dot.mid { background: var(--mid); }
.dot.high { background: var(--high); }
.dot.atc { background: var(--atc); }

/* ---------- bottom sheet / docked panel ---------- */
.sheet {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: min(100vw, var(--sheet-w));
  height: min(58vh, 560px);
  z-index: 20;
  background: rgba(16, 19, 26, .97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0,0,0,.5);
  transition: height .25s ease;
}
.sheet.tall { height: min(86vh, 780px); }

.grabber {
  width: 40px; height: 5px; border-radius: 3px;
  background: #3a4152;
  margin: 8px auto 0;
  flex: none;
  cursor: pointer;
  border: none; padding: 0;
}

.sheet-head {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 10px 14px 6px;
  flex: none;
}
.sheet-head h1 {
  margin: 0; text-align: center;
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { background: var(--card-2); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  justify-self: end;
}

.settings-pop {
  position: absolute;
  top: 58px; right: 14px;
  width: 280px;
  background: #141821;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
  z-index: 5;
}
.settings-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.settings-pop input {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 8px 10px;
  color: var(--text); font-size: 14px;
}

.sheet-scroll {
  flex: 1; overflow-y: auto;
  padding: 4px 14px calc(var(--tabbar-h) + 20px);
  overscroll-behavior: contain;
}

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  z-index: 30;
}
.tabbar-pill {
  display: flex; align-items: center; gap: 2px;
  background: rgba(20, 24, 33, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid #2a3040;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 76px; padding: 9px 0 7px;
  border-radius: 999px;
  color: #9aa3b5;
  transition: background .15s, color .15s;
}
.tab svg { width: 22px; height: 22px; fill: currentColor; }
.tab span { font-size: 10.5px; font-weight: 500; letter-spacing: .01em; }
.tab.active { background: #262c3a; color: var(--blue); }
.tab:not(.active):hover { color: #c7cddb; }
.badge {
  position: absolute; top: 2px; right: 12px;
  min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--red); color: #fff;
  font: 700 10.5px/17px var(--font);
  text-align: center; padding: 0 4px;
}
.search-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(20, 24, 33, .92);
  backdrop-filter: blur(20px);
  border: 1px solid #2a3040;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.search-fab svg { width: 21px; height: 21px; fill: currentColor; }
.search-fab:active { background: #262c3a; }

/* ---------- search overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(7, 9, 14, .82);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 6px 8px 6px 14px;
}
.search-glyph { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 16px; padding: 10px 0; color: var(--text);
}
.search-results {
  width: min(560px, 100%);
  margin-top: 10px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow-y: auto;
  max-height: 60vh;
}
.search-results:empty { display: none; }

/* ---------- sheet content components ---------- */

/* status line */
.statusline {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  padding: 4px 2px 10px;
  flex-wrap: wrap;
}
.statusline b { color: var(--text); font-weight: 700; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.conn-dot.ok { background: var(--green); }
.conn-dot.warn { background: var(--amber); }
.conn-dot.bad { background: var(--red); }

/* segmented control */
.segmented {
  display: flex;
  background: var(--card);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 12px;
}
.segmented button {
  flex: 1;
  padding: 8px 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px; font-weight: 600;
}
.segmented button.active { background: #2b3240; color: var(--text); }

/* chip rows (sub-tabs, filters) */
.chiprow {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip svg { width: 14px; height: 14px; fill: currentColor; }

/* section headings */
h2.sect {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
  margin: 18px 2px 8px;
}
h2.sect .count { color: #5a6274; font-weight: 500; }

/* rows (controllers, traffic, follows, events) */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  background: var(--card);
  border-radius: var(--radius-m);
  margin-bottom: 7px;
  cursor: pointer;
  border: 1px solid transparent;
}
.row:active { background: #1d222d; }
.row.selected { border-color: var(--blue); }
.row .grow { flex: 1; min-width: 0; }
.row .cs { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .freq {
  text-align: right; font-family: var(--mono);
  font-size: 13px; color: var(--text); flex: none;
}
.online-dot, .offline-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none;
}
.online-dot { background: var(--green); }
.offline-dot { background: #3a4152; }
.dotwrap { flex: none; display: flex; }

/* small inline chips inside rows */
.chip-tag {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--card-2); color: var(--muted);
}
.chip-tag.live { background: var(--green-dim); color: var(--green); }
.chip-tag.warn { background: var(--amber-dim); color: var(--amber); }
.chip-tag.actual { background: var(--blue-dim); color: var(--blue); }

/* the signature flight card */
.flight-card {
  position: relative;
  background: linear-gradient(145deg, #1a2138 0%, #131828 55%, #101523 100%);
  border: 1px solid #2a3552;
  border-radius: var(--radius-m);
  padding: 14px 16px 0;
  margin-bottom: 14px;
  overflow: hidden;
}
.flight-card .fc-top {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 10px;
}
.flight-card .fc-airline {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--blue-dim);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.flight-card .fc-airline svg { width: 14px; height: 14px; fill: var(--blue); }
.flight-card .fc-cs { font-weight: 700; font-size: 15px; }
.flight-card .fc-live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  color: var(--green);
  background: var(--green-dim);
  padding: 3px 9px; border-radius: 999px;
}
.flight-card .fc-live i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.flight-card .fc-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.flight-card .fc-icao { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.flight-card .fc-icao.right { text-align: right; }
.flight-card .fc-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 110px; }
.flight-card .fc-block { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.flight-card .fc-track {
  width: 100%; height: 14px; position: relative;
}
.flight-card .fc-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; background: #2c3654; border-radius: 1px;
}
.flight-card .fc-track .fill {
  position: absolute; left: 0; top: 50%; height: 2px;
  background: var(--blue); border-radius: 1px;
  box-shadow: 0 0 8px rgba(10, 132, 255, .7);
}
.flight-card .fc-track svg {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 15px; height: 15px; fill: #fff;
  filter: drop-shadow(0 0 4px rgba(0,0,0,.8));
}
.flight-card .fc-times {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 8px;
}
.flight-card .fc-times .t { font-weight: 700; font-size: 15px; }
.flight-card .fc-times .s { font-size: 11.5px; }
.flight-card .fc-times .ok { color: var(--green); }
.flight-card .fc-times .late { color: var(--red); }
.flight-card .fc-times .arr { text-align: right; }
.flight-card .fc-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(7, 9, 14, .45);
  margin: 4px -16px 0;
  padding: 9px 16px;
  font-family: var(--mono); font-size: 13.5px;
  color: #cdd5e3;
}
.flight-card .fc-foot .sep { color: #3d4666; }

/* progress bar (follows, route) */
.progress {
  height: 3px; border-radius: 2px;
  background: #2a3140;
  margin-top: 7px; overflow: hidden;
}
.progress i { display: block; height: 100%; background: var(--blue); border-radius: 2px; }

/* stat tiles */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.statbox {
  background: var(--card);
  border-radius: var(--radius-s);
  padding: 10px 12px;
}
.statbox .label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 3px;
}
.statbox .value { font-family: var(--mono); font-size: 17px; font-weight: 600; }

/* AP tiles with steppers */
.ap-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 12px; }
.ap-tile {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 12px 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.ap-tile .t-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  color: var(--muted);
}
.ap-tile .t-dot { width: 6px; height: 6px; border-radius: 50%; background: #3a4152; }
.ap-tile .t-dot.on { background: var(--green); box-shadow: 0 0 6px rgba(48,209,88,.7); }
.ap-tile .t-value {
  font-family: var(--mono); font-size: 21px; font-weight: 600;
  background: none; border: none; outline: none;
  color: var(--text); width: 100%;
  padding: 0;
}
.ap-tile .t-steppers { display: flex; gap: 6px; }
.ap-tile .t-steppers button {
  flex: 1; height: 28px;
  border-radius: 7px;
  background: var(--card);
  color: var(--muted);
  font-size: 16px; font-weight: 700; line-height: 1;
}
.ap-tile .t-steppers button:active { background: #262c3a; color: var(--text); }

/* round toggles */
.round-row { display: flex; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.round-toggle {
  min-width: 58px; height: 44px; padding: 0 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13.5px; font-weight: 800;
  border: 1px solid var(--line);
}
.round-toggle.active { background: var(--green); border-color: var(--green); color: #06230f; }
.round-toggle.danger { background: var(--red); border-color: var(--red); color: #fff; }

/* engine gauges */
.gauge {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.gauge .g-label {
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  color: var(--muted);
}
.gauge .g-track {
  height: 7px; border-radius: 4px;
  background: var(--card-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.gauge .g-track i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--blue), #5eb0ff);
  border-radius: 3px;
  transition: width .3s;
}
.gauge .g-track.g-fuel i { background: var(--green); }
.gauge .g-val { font-size: 11.5px; color: var(--muted); }

/* cards (systems sections, radiators) */
.card {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 14px;
  margin-bottom: 12px;
}
.card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  font-size: 14.5px; font-weight: 700;
}
.card-head svg { width: 17px; height: 17px; fill: var(--muted); }
.card-head .spacer { flex: 1; }
.status-pill {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase;
  background: var(--card-2); color: var(--muted);
}
.status-pill.on { background: var(--green-dim); color: var(--green); }

/* radio pairs */
.radio-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 9px;
}
.radio-tile { border: none; }
.radio-tile.dim { opacity: .5; }
.radio-tile {
  border-radius: var(--radius-s);
  padding: 9px 12px;
  text-align: center;
}
.radio-tile .r-label {
  font-size: 9.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 2px;
}
.radio-tile .r-freq { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.radio-tile.active-tile { background: var(--green-dim); }
.radio-tile.active-tile .r-label { color: var(--green); }
.radio-tile.standby-tile { background: var(--card-2); border: 1px solid var(--line); }
.radio-tile.standby-tile .r-label { color: var(--muted); }
.radio-swap {
  align-self: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.radio-swap svg { width: 15px; height: 15px; fill: currentColor; }

/* quick tune */
.qt-label {
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
  margin: 12px 0 7px;
}
.qt-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.qt-chips .chip.active { background: var(--blue-dim); border-color: var(--blue-dim); color: var(--blue); }

/* PTT */
.ptt {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px;
  border-radius: var(--radius-m);
  background: var(--red);
  color: #fff; font-weight: 800; font-size: 14px;
  letter-spacing: .06em;
  margin-top: 12px;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.ptt.talking { background: #c73328; transform: scale(.985); }

/* debrief card */
.debrief .d-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px;
}
.debrief .d-fpm .num { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.debrief .d-fpm small {
  font-size: 12px; font-weight: 800; letter-spacing: .12em;
  color: var(--muted);
}
.debrief .d-word { font-size: 13px; font-weight: 700; color: var(--blue); margin-top: -4px; }
.debrief .d-grade {
  margin-left: auto;
  width: 64px; height: 64px;
  border-radius: var(--radius-s);
  background: var(--blue-dim);
  border: 1px solid var(--blue);
  color: var(--blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900;
  flex: none;
}
.debrief .d-grade small {
  font-size: 7.5px; font-weight: 800; letter-spacing: .18em;
  margin-top: 1px;
}
svg.spark { width: 100%; height: 64px; display: block; margin: 6px 0 2px; }

/* events / inbox */
.event {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  margin-bottom: 8px;
  border-left: 3px solid var(--blue);
}
.event.k-controller-online { border-left-color: var(--green); }
.event.k-test { border-left-color: var(--amber); }
.event .t { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-bottom: 3px; }
.event .title { font-weight: 700; font-size: 14px; }
.event .body { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* atlas */
.passport {
  background: linear-gradient(150deg, #1a2138 0%, #12172a 60%, #0e1220 100%);
  border: 1px solid #2a3552;
  border-radius: var(--radius-m);
  padding: 18px;
  margin-bottom: 12px;
}
.passport .p-brand {
  font-size: 10.5px; font-weight: 800; letter-spacing: .22em;
  color: var(--muted); text-transform: uppercase;
  display: flex; align-items: center; gap: 7px;
}
.passport .p-brand i {
  width: 18px; height: 18px; border-radius: 5px; background: var(--blue);
  display: inline-block;
}
.passport .p-name {
  font-size: 26px; font-weight: 900; letter-spacing: -0.01em;
  margin: 10px 0 4px;
}
.passport .p-meta { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.passport .p-stats {
  display: flex; gap: 0;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid #26304c;
}
.passport .p-stats > div { flex: 1; }
.passport .p-stats b { display: block; font-size: 16px; font-weight: 800; }
.passport .p-stats small { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.month-h {
  font-size: 13px; font-weight: 800;
  margin: 16px 2px 8px;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

/* tables (airport board, logbook fallback) */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 10px; }
th {
  text-align: left; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
  padding: 4px 6px 6px 0;
  border-bottom: 1px solid var(--line);
}
td { padding: 7px 6px 7px 0; border-bottom: 1px solid #1a1f2a; }
tr.clickable { cursor: pointer; }
tr.clickable:active td { background: #1d222d; }

/* detail views */
.detail-title { font-size: 24px; font-weight: 900; margin: 4px 0 2px; letter-spacing: -0.01em; }
.detail-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 13.5px; margin-bottom: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; }
pre.atis {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  font: 11.5px/1.6 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px;
  color: #c3cbd9;
}
.note { font-size: 12px; color: var(--muted); margin: 8px 2px; line-height: 1.5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

/* buttons + fields */
.btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px; font-weight: 700;
  color: var(--text);
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.danger { color: var(--red); }
.field { display: flex; gap: 8px; margin: 8px 0; }
.field input, .field select {
  flex: 1; min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--blue); }
.field select { flex: 0 0 auto; }

/* toasts */
.toasts {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(90vw, 420px);
}
.toast {
  background: rgba(20, 24, 33, .97);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  color: var(--text);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* search result rows reuse .row inside the overlay */
.search-results .row { background: transparent; border-radius: 0; margin: 0; border-bottom: 1px solid #1a1f2a; }
.search-results .row:last-child { border-bottom: none; }
.search-hint { padding: 12px 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- desktop: sheet docks left ---------- */
@media (min-width: 1000px) {
  .sheet {
    left: 0; top: 0; bottom: 0; transform: none;
    width: var(--sheet-w);
    height: auto;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 40px rgba(0,0,0,.4);
  }
  .grabber { display: none; }
  .sheet-scroll { padding-bottom: calc(var(--tabbar-h) + 14px); }
  .tabbar {
    left: calc(var(--sheet-w) / 2);
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .bridge-pill { left: calc(var(--sheet-w) + 12px); }
  .map-pop { right: auto; left: calc(var(--sheet-w) + 62px); }
  .toasts { left: calc(var(--sheet-w) / 2); }
}

/* small phones: trim the flight card */
@media (max-width: 360px) {
  .flight-card .fc-icao { font-size: 21px; }
  .tab { width: 66px; }
}
