:root {
  --companion-logo-size: min(48vw, 176px);
  --companion-logo-center-y: calc(50% - 26.5px);
  --statusbar-height: calc(48px + env(safe-area-inset-top));
  --inbox-views-height: 0px;
  --workspace-top: calc(var(--statusbar-height) + var(--inbox-views-height));
  --flight-map-handle-height: 48px;
  --flight-map-tab-visible-height: 16px;
  /* Keep the authored FlightWire palette; do not let force-dark browsers recolor it. */
  color-scheme: only dark;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #05080b;
  color: #d7e0e6;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: #05080b;
}

body {
  padding: calc(var(--statusbar-height) + 10px) 18px
    max(100px, calc(env(safe-area-inset-bottom) + 88px));
}
body.flight-map-available {
  padding-top: calc(var(--statusbar-height) + var(--flight-map-handle-height) + 10px);
}
body.inbox-workspace { --inbox-views-height: 52px; --workspace-top: calc(var(--statusbar-height) + 52px); padding-top: calc(var(--workspace-top) + 10px); }
body.inbox-workspace.flight-map-available { padding-top: calc(var(--workspace-top) + var(--flight-map-handle-height) + 10px); }
.inbox-views { position: fixed; z-index: 30; top: var(--statusbar-height); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; width: min(760px, 100%); height: 52px; padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)); background: #080f15; border-bottom: 1px solid #23333e; }
.inbox-views[hidden] { display: none; }
.inbox-views button { flex: 1 1 0; min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #8da6b4; font: 600 11px/1.2 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.inbox-views button[aria-pressed="true"] { background: #17303c; border-color: #3b6374; color: #def3fb; }
.inbox-views button:disabled { opacity: .4; cursor: default; }
.inbox-views svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.inbox-views [aria-expanded="true"]:not([data-inbox-view="search"]) svg { transform: rotate(180deg); }

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: url("/flightwire-round.png");
  background-position: center var(--companion-logo-center-y);
  background-size: var(--companion-logo-size) auto;
  background-repeat: no-repeat;
  opacity: .055;
  filter: saturate(.55) brightness(.58);
  pointer-events: none;
}

.splash {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 28px;
  background: #05080b;
  opacity: 1;
  transition: opacity 280ms ease-out;
}
.splash[hidden] { display: none; }
.splash.closing { opacity: 0; pointer-events: none; }
.splash img {
  width: var(--companion-logo-size);
  height: auto;
  filter: drop-shadow(0 10px 28px rgb(0 0 0 / 38%));
}
.splash-title {
  display: grid;
  justify-items: center;
  gap: 5px;
  line-height: 1;
  text-align: center;
}
.splash-title strong {
  color: #d7e0e6;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .09em;
  transform: translateX(.045em);
}
.splash-title span {
  color: #b8c6ce;
  font-size: 12px;
  letter-spacing: .20em;
  transform: translateX(.10em);
}
.splash-version {
  position: absolute;
  right: 0;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  left: 0;
  color: #74838d;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; }
}

.statusbar {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--statusbar-height);
  height: var(--statusbar-height);
  padding: env(safe-area-inset-top)
    max(8px, env(safe-area-inset-right)) 0
    max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: inset 0 -1px #26323b;
  background: #070c10;
  color: #8998a2;
  font-size: 11px;
  letter-spacing: .05em;
}
#activity-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statusbar time {
  margin-left: auto;
  flex-shrink: 0;
  color: #7a8992;
  white-space: nowrap;
}
.statusbar button {
  position: relative;
  isolation: isolate;
  flex-shrink: 0;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #aeb9c0;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  cursor: pointer;
  touch-action: manipulation;
}
/* A 32px face sits 8px from the bar edges; the full 44px target stays tappable. */
.statusbar button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px 0;
  border: 1px solid #33434e;
  border-radius: 6px;
  background: #111920;
  pointer-events: none;
}
.statusbar button:active::before { background: #1b303e; border-color: #5b7a8c; }
.statusbar button:focus-visible { outline: none; }
.statusbar button:focus-visible::before { outline: 2px solid #83c8dd; outline-offset: 2px; }
.statusbar button[hidden] { display: none; }

.flight-map-drawer {
  position: fixed;
  z-index: 25;
  top: var(--workspace-top);
  right: 0;
  left: 0;
  width: min(760px, calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)));
  height: min(66vh, 560px, calc(100vh - 150px - env(safe-area-inset-top)));
  height: min(66dvh, 560px, calc(100dvh - var(--workspace-top) - 100px - env(safe-area-inset-bottom)));
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--flight-map-tab-visible-height);
  overflow: visible;
  pointer-events: auto;
  transform: translateY(calc(-100% + var(--flight-map-tab-visible-height)));
  transition: transform 320ms cubic-bezier(.22, .72, .18, 1);
  will-change: transform;
  overscroll-behavior: contain;
}
.flight-map-drawer[hidden] { display: none; }
.flight-map-drawer.dragging { transition: none; }
.flight-map-drawer:not(.open) { pointer-events: none; }
.flight-map-drawer:not(.open) .flight-map-handle { pointer-events: auto; }
.flight-map-panel {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #29404d;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: radial-gradient(circle at 50% 46%, #0b1921 0, #061017 58%, #03080c 100%);
  box-shadow: 0 18px 34px rgb(0 0 0 / 58%);
}
.flight-map-heading {
  min-height: 54px;
  padding: 8px 12px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #1c3441;
  background: #071119;
}
.flight-map-heading > div:first-child { min-width: 0; display: grid; gap: 2px; }
.flight-map-heading strong {
  color: #dce7ec;
  font-size: 12px;
  letter-spacing: .12em;
}
.flight-map-heading span {
  color: #7294a5;
  font-size: 9px;
  letter-spacing: .09em;
  white-space: nowrap;
}
.flight-map-heading-tools {
  min-width: max-content;
  display: grid;
  justify-items: end;
  gap: 3px;
}
.flight-map-zoom-controls {
  display: grid;
  grid-template-columns: 44px 48px 44px 52px;
  overflow: hidden;
  border: 1px solid #29404d;
  border-radius: 5px;
  background: #09151d;
}
.flight-map-zoom-controls button {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-left: 1px solid #213743;
  background: transparent;
  color: #90a9b5;
  font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.flight-map-zoom-controls button:first-child { border-left: 0; }
.flight-map-zoom-controls button:active { background: #16303d; color: #d8edf5; }
.flight-map-zoom-controls button.active {
  background: #10271d;
  color: #70df98;
  box-shadow: inset 0 0 0 1px rgb(112 223 152 / 35%);
}
.flight-map-zoom-controls button:disabled { opacity: .38; }
.flight-map-zoom-controls button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 1px solid #7cc9e6;
  outline-offset: -2px;
}
#flight-map-status {
  max-width: 64vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#flight-map-status[data-state="stale"] { color: #e2a34f; }
.flight-map-host { position: relative; min-height: 0; overflow: hidden; background: #101820; }
.flight-map-base { position: absolute; inset: 0; }
.flight-map {
  position: absolute;
  inset: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  background: transparent;
  touch-action: none;
  overscroll-behavior: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.flight-map.dragging { cursor: grabbing; }
.flight-map:focus-visible { outline: 1px solid #395b6c; outline-offset: -1px; }
.flight-map [hidden] { display: none; }
.flight-map-atc-labels text {
  fill: #66dca0;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
  paint-order: stroke;
  stroke: #041016;
  stroke-width: 4px;
  text-anchor: middle;
}
.flight-map-range-rings path {
  fill: none;
  stroke: #355461;
  stroke-width: 1;
  stroke-dasharray: 3 6;
  opacity: .55;
  vector-effect: non-scaling-stroke;
}
.flight-map-route-past,
.flight-map-route-ahead,
.flight-map-route-active,
.flight-map-track {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.flight-map-route-past {
  stroke: #344b57;
  stroke-width: 1.6;
  stroke-dasharray: 4 8;
  opacity: .66;
}
.flight-map-route-ahead {
  stroke: #74bfdc;
  stroke-width: 2.2;
  stroke-dasharray: 8 6;
  opacity: .82;
}
.flight-map-route-active {
  stroke: #70df98;
  stroke-width: 3.4;
  filter: drop-shadow(0 0 4px rgb(112 223 152 / 44%));
}
.flight-map-track { stroke: #3f8860; stroke-width: 2; opacity: .82; }
.flight-map-track-vector {
  fill: none;
  stroke: #a7d9ea;
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
  opacity: .75;
  vector-effect: non-scaling-stroke;
}
.flight-map-waypoints circle {
  fill: #07131a;
  stroke: #90b4c4;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.flight-map-waypoints g.active circle { fill: #143c27; stroke: #70df98; stroke-width: 3; }
.flight-map-waypoints g.destination circle { stroke: #7cc9e6; stroke-width: 2.2; }
.flight-map-waypoints text {
  fill: #a9c1cc;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
  paint-order: stroke;
  stroke: #041016;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.flight-map-waypoints g.active text { fill: #8cf0aa; }
.flight-map-waypoints g.destination text { fill: #cae4ee; }
.flight-map-aircraft path {
  fill: #e6f0f4;
  stroke: #071016;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgb(124 201 230 / 80%));
}
.flight-map-empty {
  fill: #78909d;
  font: 500 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .10em;
  text-anchor: middle;
  dominant-baseline: middle;
}
.flight-map-north {
  fill: #6f8c9a;
  font: 700 18px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-anchor: middle;
}
.flight-map-attribution {
  position: absolute;
  z-index: 2;
  bottom: 50px;
  left: 4px;
  min-height: 24px;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  color: #78909d;
  font-size: 8px;
  letter-spacing: .07em;
  text-decoration: none;
}
.flight-map-attribution:focus-visible { outline: 1px solid #7cc9e6; }
.flight-map-summary {
  min-height: 49px;
  padding: 6px 10px 7px;
  display: grid;
  grid-template-columns: 1.1fr .82fr .72fr .92fr 1fr;
  gap: 5px;
  border-top: 1px solid #1c3441;
  background: #061018;
}
.flight-map-summary div {
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 2px;
  border-left: 1px solid #162b36;
}
.flight-map-summary div:first-child { border-left: 0; }
.flight-map-summary span { color: #7896a4; font-size: 9px; letter-spacing: .10em; }
.flight-map-summary strong {
  max-width: 100%;
  overflow: hidden;
  color: #d6e2e8;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flight-map-handle {
  position: relative;
  width: 200px;
  max-width: calc(100% - 32px);
  height: var(--flight-map-handle-height);
  min-height: var(--flight-map-handle-height);
  padding: 0;
  justify-self: center;
  align-self: start;
  border: 0;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: ns-resize;
}
.flight-map-handle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 72px;
  height: var(--flight-map-tab-visible-height);
  border: 1px solid #29404d;
  border-top: 0;
  border-radius: 0 0 11px 11px;
  background: #070c10;
  box-shadow: 0 5px 10px rgb(0 0 0 / 30%);
  transform: translateX(-50%);
}
.flight-map-handle:focus-visible {
  outline: none;
}
.flight-map-handle:focus-visible::before {
  border-color: #7cc9e6;
  box-shadow: 0 0 0 2px rgb(124 201 230 / 35%), 0 5px 10px rgb(0 0 0 / 30%);
}
.flight-map-grabber {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 50%;
  width: 36px;
  height: 3px;
  border-radius: 999px;
  background: #526873;
  transform: translateX(-50%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .flight-map-drawer { transition: none; }
}

.link-warning{position:fixed;z-index:45;top:calc(var(--statusbar-height) + var(--flight-map-handle-height) + 5px);left:50%;transform:translateX(-50%);width:min(calc(100% - 28px),420px);min-height:44px;border:1px solid #d19a3e;border-radius:4px;background:#33250d;color:#ffd875;font:700 11px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em}
.link-warning[hidden]{display:none}
.test-controls {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto 8px;
  padding: 10px;
  border: 1px solid #375364;
  border-radius: 6px;
  background: rgb(8 20 27 / 94%);
  box-shadow: 0 8px 24px rgb(0 0 0 / 24%);
}
.test-controls[hidden] { display: none; }
.test-controls header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.test-controls header strong {
  color: #7cc9e6;
  font-size: 11px;
  letter-spacing: .08em;
}
.test-controls header span {
  color: #6e8490;
  font-size: 8px;
  letter-spacing: .05em;
  text-align: right;
}
.test-controls > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.test-controls button {
  min-width: 0;
  min-height: 44px;
  padding: 4px;
  border: 1px solid #344853;
  border-radius: 3px;
  background: #0d171d;
  color: #91a5af;
  font: 700 9px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
}
.test-controls button[aria-pressed="true"] {
  border-color: #5eafcf;
  background: #123040;
  color: #dff6ff;
}
@media (max-width: 390px) {
  .test-controls > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .test-controls button:last-child { grid-column: 1 / -1; }
}
.pairing-success{position:fixed;z-index:46;top:calc(var(--statusbar-height) + var(--flight-map-handle-height) + 5px);left:50%;transform:translate(-50%,-8px);width:min(calc(100% - 48px),360px);padding:11px 14px;border:1px solid #4ebf79;border-radius:5px;background:#123a28;color:#d9ffe7;box-shadow:0 9px 24px rgb(0 0 0 / 35%);font:700 12px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.04em;text-align:center;opacity:0;transition:opacity 180ms ease,transform 180ms ease}.pairing-success.visible{transform:translate(-50%,0);opacity:1}.pairing-success[hidden]{display:none}
.activity-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #697780;
}
.activity-dot.ready { background: #69d88c; box-shadow: 0 0 7px rgba(105,216,140,.55); }
.activity-dot.active { background: #8cf0aa; box-shadow: 0 0 11px rgba(105,216,140,.9); }
.activity-dot.offline { background: #b15e5e; }
.activity-dot.standby { background: #d1783f; box-shadow: 0 0 7px rgba(209,120,63,.42); }
.activity-dot.pairing { background: #c18c42; }
.activity-dot.checking { animation: activity-pulse 1.4s ease-in-out infinite; }
@keyframes activity-pulse { 50% { opacity: .28; } }

.telemetry {
  position: fixed;
  z-index: 20;
  right: max(6px, env(safe-area-inset-right));
  bottom: 4px;
  left: max(6px, env(safe-area-inset-left));
  width: auto;
  max-width: none;
  min-height: 72px;
  margin: 0;
  padding: 8px 12px max(7px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.9fr) minmax(0, .95fr) minmax(0, .9fr);
  gap: 7px 6px;
  background: linear-gradient(180deg, #08131a, #050b10);
  border: 1px solid #28404d;
  border-radius: 13px 13px
    max(28px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-bottom));
  box-shadow: inset 0 0 0 1px #020609;
  overflow: hidden;
}
.telemetry > div {
  min-width: 0;
  padding-left: 6px;
  display: grid;
  grid-template-rows: 12px 27px;
  row-gap: 3px;
  align-content: start;
  border-left: 1px solid #1d303b;
}
.telemetry > div:first-child { padding-left: 0; border-left: 0; }
.telemetry span {
  display: block;
  margin: 0;
  color: #7294a5;
  font-size: 9px;
  letter-spacing: .12em;
  text-align: center;
}
.telemetry strong {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 27px;
  padding: 1px 2px;
  border: 1px solid transparent;
  color: #edf3f6;
  font-size: clamp(12px, 3.8vw, 16px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}
.telemetry .pfd-fma{padding-left:5px}
.fma-modes{display:grid;grid-template-columns:.72fr 1fr 1fr;width:100%;height:27px;padding:1px;border:1px solid #667078;background:#2b3034}
.telemetry .fma-modes strong{height:auto;padding:1px 3px;border:0;border-left:1px solid #e8edf0;color:#62dc88;font-size:clamp(7px,2.25vw,11px);letter-spacing:0;overflow:hidden}
.telemetry .fma-modes strong:first-child{border-left:0}
.telemetry .fma-modes strong[data-state="off"]{color:#f1b85a}
.telemetry .fma-modes strong[data-state="unknown"]{color:#f2ca54}
.telemetry .fma-modes strong.mode-new{outline:1px solid #f4f7f8;outline-offset:-2px}
.telemetry small {
  grid-column: 1 / -1;
  padding-top: 6px;
  border-top: 1px solid #182b35;
  color: #7a8992;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .08em;
}

@media (max-width: 390px) {
  .telemetry {
    gap: 5px 4px;
    padding-right: 10px;
    padding-left: 10px;
    border-radius: 12px 12px
      max(28px, env(safe-area-inset-bottom))
      max(28px, env(safe-area-inset-bottom));
  }
  .telemetry strong { font-size: clamp(11px, 3.55vw, 14px); }
  .telemetry .pfd-fma strong { font-size: clamp(8px, 2.65vw, 11px); }
  .telemetry small { padding-top: 5px; }
}
.telemetry.live small { color: #58b97a; }
.telemetry.standby small{color:#f2aa4c;font-weight:700}
.telemetry.loss small{color:#f2ca54}
.telemetry.loss strong{color:#f2ca54}
.telemetry.loss > div:not(.pfd-fma) strong,.telemetry.loss .fma-modes strong{border:1px solid #f2ca54;background:#191b1c}

#feed { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

/* Unified inbox controls, with a segmented filter and a quieter search row. */
.inbox-tools {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto 6px;
  padding: 4px 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 1fr);
  align-items: stretch;
  gap: 12px;
  border-bottom: 1px solid #22313a;
}
.inbox-tools[hidden] { display: none; }
.message-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  padding: 4px;
  gap: 3px;
  border: 1px solid #263a45;
  border-radius: 12px;
  background: #0a1319;
  box-shadow: inset 0 1px 2px #0004;
}
.inbox-tools button {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94aab7;
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.inbox-tools button:hover:not(:disabled) { background: #15252f; color: #e2edf2; }
.inbox-tools button[aria-pressed="true"] {
  border-color: #497688;
  background: linear-gradient(180deg, #203b49, #182f3b);
  color: #e3f5fc;
  box-shadow: 0 2px 5px #0005, inset 0 1px 0 #a8d9e51a;
}
.inbox-tools button[aria-pressed="true"]:hover { background: #244654; }
.inbox-tools button:focus-visible { outline: 2px solid #8ecbde; outline-offset: 2px; }
.inbox-tools button:disabled { opacity: .4; cursor: default; }
.inbox-tools svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.inbox-search {
  grid-column: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 0 14px;
  gap: 11px;
  border: 1px solid #2a3e49;
  border-radius: 10px;
  background: #0a141b;
  color: #7e9caa;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.inbox-search:focus-within {
  border-color: #76b5c8;
  box-shadow: 0 0 0 3px #76b5c815;
  color: #9ed7e7;
}
.inbox-tools input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #e0ebf1;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.inbox-tools input::placeholder { color: #7f98a6; opacity: 1; }
@media (max-width: 600px) {
  .inbox-tools { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .message-filters button { padding: 0 5px; font-size: 11px; }
  .inbox-search { grid-column: 1; min-height: 46px; padding: 0 11px; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-tools button, .inbox-search { transition: none; }
}
.entry.unread { border-left: 2px solid #70df98; padding-left: 8px; }

.entry {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 17px 0 18px;
  border-bottom: 1px solid #26323b;
}

.time {
  color: #74838d;
  font-size: 13px;
  line-height: 1.55;
}

.message {
  margin: 0;
  color: #e2e8ec;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sentinel-entry {
  align-items: start;
  padding-top: 12px;
  padding-bottom: 14px;
}
.sentinel-entry-collapsed {
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
}
.sentinel-entry-collapsed .time { line-height: 1; }
.entry { position: relative; display: block; padding: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.entry-content { position: relative; z-index: 1; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 17px 0 18px; background: #05080b; transition: transform 180ms ease-out; }
.sentinel-entry .entry-content { align-items: start; padding-top: 12px; padding-bottom: 14px; }
.sentinel-entry-collapsed .entry-content { align-items: center; padding-top: 8px; padding-bottom: 8px; }
.message-delete { position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 88px; min-height: 44px; border: 0; border-radius: 0; padding: 6px 5px; background: #ff453a; color: #fff; font: 600 13px/1.3 system-ui, sans-serif; cursor: pointer; }
.message-delete svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.message-delete:focus-visible { outline: 2px solid white; outline-offset: -4px; }
.message-delete:disabled { cursor: progress; }
.entry.swiping .entry-content { transition: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { .entry-content { transition: none; } }
.sentinel-collapsed-bar {
  min-width: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid #365143;
  border-left: 4px solid #6fa788;
  border-radius: 4px;
  background: #0d1813;
  white-space: nowrap;
}
.sentinel-collapsed-bar strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #dfe8e3;
  font-size: 11px;
  letter-spacing: .04em;
  text-overflow: ellipsis;
}
.sentinel-collapsed-bar span {
  flex: 0 0 auto;
  color: #79b995;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
}
.sentinel-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #a36b32;
  border-left-width: 4px;
  border-radius: 6px;
  background: linear-gradient(135deg, #151b20, #0b1115);
  box-shadow: 0 8px 24px rgb(0 0 0 / 24%);
}
.sentinel-critical .sentinel-card {
  border-color: #d64e4e;
  background: linear-gradient(135deg, #241416, #0e1114);
}
.sentinel-advisory .sentinel-card { border-color: #4d839f; }
.sentinel-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sentinel-card header strong {
  color: #f0f4f6;
  font-size: 13px;
  letter-spacing: .05em;
}
.sentinel-card header span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #e5a453;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
}
.sentinel-critical .sentinel-card header span { color: #f06a6a; }
.sentinel-advisory .sentinel-card header span { color: #74b6d8; }
.sentinel-card p {
  margin: 9px 0 10px;
  color: #d8e0e5;
  font-size: 13px;
  line-height: 1.4;
}
.sentinel-card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0 0 11px;
  padding-top: 8px;
  border-top: 1px solid #2a363e;
  font-size: 10px;
}
.sentinel-card dt { color: #72838d; }
.sentinel-card dd {
  min-width: 0;
  margin: 0;
  color: #e0e7eb;
  text-align: right;
  overflow-wrap: anywhere;
}
.sentinel-card button {
  width: 100%;
  min-height: 44px;
  border: 1px solid #526b79;
  border-radius: 4px;
  background: #14222a;
  color: #dfe8ed;
  font: inherit;
  font-size: 11px;
  letter-spacing: .06em;
}
.sentinel-card button:disabled {
  border-color: #365143;
  background: #102019;
  color: #6fa788;
}

.setup {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 14px;
  padding: calc(72px + env(safe-area-inset-top)) 28px 28px;
  background: #05080b;
  text-align: center;
}

.setup[hidden], #pairing[hidden], .empty[hidden] { display: none; }
.setup h1 { margin: 0; font-size: 18px; letter-spacing: .08em; }
.setup p { max-width: 420px; margin: 0 auto; color: #8b9aa4; line-height: 1.5; }
.setup button {
  width: min(100%, 360px);
  min-height: 44px;
  margin: 0 auto;
  border: 1px solid #394954;
  border-radius: 4px;
  background: #111920;
  color: #d7e0e6;
  font: inherit;
}
.setup .danger-button {
  border-color: #704343;
  background: #211416;
  color: #e0a3a3;
}
.qr-scanner {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 18px
    max(22px, env(safe-area-inset-bottom));
  background: rgb(2 5 7 / 94%);
}
.qr-scanner[hidden] { display: none; }
.qr-scanner-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  text-align: center;
}
.qr-scanner h2 {
  margin: 0;
  color: #d7e0e6;
  font-size: 16px;
  letter-spacing: .08em;
}
.qr-scanner video {
  width: 100%;
  max-height: 52vh;
  aspect-ratio: 1;
  border: 1px solid #5b7584;
  border-radius: 8px;
  background: #010203;
  object-fit: cover;
}
.qr-scanner p {
  min-height: 32px;
  margin: 0;
  color: #91a3ae;
  font-size: 11px;
  line-height: 1.45;
}
.qr-scanner button {
  min-height: 44px;
  border: 1px solid #394954;
  border-radius: 4px;
  background: #111920;
  color: #d7e0e6;
  font: inherit;
}
.setting-row {
  width: min(100%, 360px);
  min-height: 38px;
  margin: 0 auto;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #26323b;
  color: #73828c;
  font-size: 12px;
}
.setting-row strong { color: #d7e0e6; font-weight: 500; }
#pairing { display: grid; gap: 12px; }
#pairing span { color: #73828c; font-size: 12px; }
#code { font-size: 22px; letter-spacing: .10em; overflow-wrap: anywhere; }
.error { color: #d88282 !important; }
.empty {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  color: #74838d;
  font-size: 13px;
  letter-spacing: .08em;
  pointer-events: none;
}

@media (max-width: 480px) {
}

@media (orientation: landscape) and (max-height: 460px) {
  .flight-map-drawer {
    height: min(560px, calc(100dvh - var(--workspace-top) - 116px));
  }
}

.flight-map-notice { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.flight-map-notice span:not([hidden]) { padding: 6px 8px; border-radius: 4px; background: #101820ed; color: #e3c690; font-size: 10px; line-height: 1.4; }
.flight-map-notice button { pointer-events: auto; min-height: 36px; padding: 6px 10px; background: #172a35; border: 1px solid #587b90; color: #e5f2fa; border-radius: 4px; font-size: 10px; }
.flight-map-host .maplibregl-ctrl-attrib { font: 10px/20px system-ui, sans-serif; color: #c5d1d8; background: #101820e8; }
.flight-map-host .maplibregl-ctrl-attrib a { color: #c5d1d8; }
.flight-map-host .maplibregl-ctrl-attrib-button { filter: invert(1); }
.flight-map-host .maplibregl-ctrl-scale { margin-bottom: 26px; background: #101820d9; color: #a8bfcb; border-color: #728a97; font-size: 9px; }
.flight-map-host .maplibregl-canvas:focus-visible { outline: 2px solid #7cc9e6; outline-offset: -2px; }

/* Flight workspace: a quiet overview, with detail available when needed. */
.flight-overview {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 18px;
  border: 1px solid #233944;
  border-radius: 12px;
  background: linear-gradient(125deg, #101e27, #0a1219 80%);
  overflow: hidden;
}
.flight-overview[hidden], .new-messages[hidden],
.map-layers[hidden], #test-scenarios[hidden], .route-progress[hidden] { display: none; }
.flight-overview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 24px 0;
}
.eyebrow { font-size: 9px; letter-spacing: .16em; color: #86a8b9; }
.flight-overview h1 { margin: 8px 0 0; font-size: clamp(22px, 4vw, 30px); font-weight: 600; letter-spacing: -.04em; color: #f1f7fa; }
.flight-overview button, .map-toolbar button {
  min-height: 44px;
  border: 1px solid #365363;
  border-radius: 6px;
  background: #102733;
  color: #bfdfeb;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.flight-overview button { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.open-map-arrow { flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.overview-context { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 15px 24px 20px; font-size: 10px; color: #96adb9; }
#overview-phase { color: #d7e0e6; }
#overview-freshness { margin-left: auto; color: #78cfaa; }
.flight-overview[data-state="stale"] #overview-freshness { color: #e7b566; }
.route-progress { height: 3px; background: #253843; margin: 0 24px; border-radius: 3px; overflow: hidden; }
.route-progress > span { display: block; height: 100%; width: 0; background: #70c6b2; transition: width 500ms ease; }
.overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 20px 24px 23px; gap: 20px; }
.overview-metrics div + div { border-left: 1px solid #263a45; padding-left: 20px; }
.overview-metrics dt { font-size: 9px; letter-spacing: .08em; color: #7f9aa9; }
.overview-metrics dd { margin: 9px 0 7px; font-size: 22px; color: #e3eef3; font-weight: 600; }
.overview-metrics small { display: block; font-size: 9px; line-height: 1.5; color: #8a9faa; }
.snapshot-note { display: block; color: #97a5ae; font-size: 10px; line-height: 1.5; margin-bottom: 13px; }
.entry { scroll-margin-top: calc(var(--workspace-top) + 24px); overflow-anchor: none; }
.entry:focus-visible { outline: 1px solid #75b8d0; outline-offset: 3px; }
.entry.unread { border-left: 0; padding-left: 0; }
.entry.unread .time::after { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: #70df98; margin-top: 8px; }
.new-messages { position: fixed; z-index: 22; bottom: calc(100px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); min-height: 44px; padding: 10px 18px; white-space: nowrap; border: 1px solid #5a9eae; border-radius: 24px; background: #163744; color: #e1f7ff; font-family: inherit; font-size: 11px; cursor: pointer; box-shadow: 0 6px 24px #0008; }
.test-controls { margin-bottom: 18px; padding: 5px 10px; background: #0a151c; border-color: #273c48; border-radius: 8px; }
.test-controls header { align-items: center; margin: 0; min-height: 44px; }
.test-controls header button { padding: 7px 10px; }
.test-controls > div { padding: 8px 0; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.test-controls button:last-child { grid-column: auto; }
.flight-map-panel { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.map-toolbar { display: flex; align-items: center; gap: 6px; padding: 0 10px; background: #0a151d; border-bottom: 1px solid #233b49; }
.map-toolbar button { min-height: 38px; margin: 4px 0; padding: 5px 10px; background: #0c1d28; border-color: #2a4555; }
.map-toolbar > span { margin-right: auto; color: #7894a4; font-size: 9px; }
.map-layers { position: absolute; z-index: 5; top: 8px; left: 8px; margin: 0; padding: 8px 12px; min-width: 186px; border: 1px solid #456376; border-radius: 8px; background: #0d1c27f5; box-shadow: 0 8px 28px #0008; }
.map-layers legend { font-size: 9px; letter-spacing: .1em; color: #afd0e0; background: #0d1c27; padding: 0 4px; }
.map-layers label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 11px; color: #c7dae5; cursor: pointer; }
.map-layers input { width: 16px; height: 16px; accent-color: #67baad; }
body.map-expanded { overflow: hidden; }
.flight-map-drawer.expanded { top: var(--statusbar-height); width: 100%; height: calc(100vh - var(--statusbar-height) - env(safe-area-inset-bottom)); height: calc(100dvh - var(--statusbar-height) - env(safe-area-inset-bottom)); z-index: 49; }
.flight-map-drawer.expanded .flight-map-panel { border-radius: 0; }
.flight-map-drawer.expanded { grid-template-rows: minmax(0, 1fr) var(--flight-map-handle-height); }
button:focus-visible, .map-layers input:focus-visible { outline: 2px solid #83c8dd; outline-offset: 3px; }
@media (max-width: 520px) {
  body { padding-left: 12px; padding-right: 12px; }
  .flight-overview header { padding-left: 16px; padding-right: 16px; }
  .overview-context { margin-left: 16px; margin-right: 16px; gap: 7px 10px; }
  #overview-freshness { flex-basis: 100%; margin-left: 0; }
  .route-progress { margin-left: 16px; margin-right: 16px; }
  .overview-metrics { padding: 17px 16px 20px; gap: 10px; }
  .overview-metrics div + div { padding-left: 10px; }
  .overview-metrics dt { font-size: 8px; letter-spacing: 0; }
  .overview-metrics dd { font-size: 19px; }
  .flight-map-heading { padding-left: 10px; padding-right: 10px; gap: 5px; }
  .flight-map-heading span { letter-spacing: 0; font-size: 8px; }
  .flight-map-heading strong { font-size: 10px; letter-spacing: .06em; }
  .flight-map-zoom-controls { grid-template-columns: 38px 40px 38px 44px; }
  .map-toolbar > span { font-size: 8px; }
  .map-toolbar button { padding-left: 7px; padding-right: 7px; font-size: 9px; }
  .test-controls header span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .route-progress > span { transition: none; } }
