:root {
  --bg0: #070b14;
  --bg1: #0c1222;
  --text: rgba(255, 255, 255, 0.94);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-mute: rgba(255, 255, 255, 0.38);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --accent: #7ec8ff;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --warn: #60a5fa;
  --bad: #f87171;
  --worse: #e879f9;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  /* Layout — mobile-first; desktop caps keep brief UI readable */
  --app-max: 100%;
  --content-gap: 12px;
  --panel-pad: 16px 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Ambient background */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(88, 120, 255, 0.22), transparent 55%),
    radial-gradient(900px 600px at 95% 5%, rgba(140, 90, 255, 0.16), transparent 50%),
    radial-gradient(800px 500px at 50% 100%, rgba(40, 180, 220, 0.1), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 50%, #060910);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-a {
  width: 320px;
  height: 320px;
  left: -80px;
  top: 10%;
  background: rgba(90, 140, 255, 0.35);
}

.orb-b {
  width: 280px;
  height: 280px;
  right: -60px;
  top: 30%;
  background: rgba(160, 100, 255, 0.28);
  animation-delay: -6s;
}

.orb-c {
  width: 360px;
  height: 360px;
  left: 30%;
  bottom: -120px;
  background: rgba(60, 200, 220, 0.18);
  animation-delay: -12s;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(20px, -24px, 0) scale(1.08); }
}

.app {
  position: relative;
  z-index: 1;
  width: min(var(--app-max), 100%);
  max-width: 100%;
  margin: 0 auto;
  padding:
    calc(14px + var(--safe-top)) 14px
    calc(28px + var(--safe-bot));
}

/* Glass surface */
.glass {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(255, 255, 255, 0.025) 100%
  );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 4px 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.near-banner {
  appearance: none;
  width: 100%;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(126, 200, 255, 0.22);
  background: rgba(126, 200, 255, 0.08);
  color: var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.near-banner:active {
  background: rgba(126, 200, 255, 0.14);
}

.near-banner.locating {
  opacity: 0.75;
}

.near-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(126, 200, 255, 0.7);
  flex: 0 0 auto;
}

.near-banner.locating .near-dot {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, #5b9dff, #8b5cf6 55%, #22d3ee);
  box-shadow:
    0 8px 24px rgba(80, 120, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
}

.mark-logo {
  display: block;
  object-fit: cover;
  background: #070b14;
  box-shadow:
    0 8px 24px rgba(34, 211, 238, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  inset: auto;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tag {
  margin: 1px 0 0;
  font-size: 0.72rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.glass-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.glass-btn:active {
  transform: scale(0.96);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

.icon-btn.spin svg {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Search — compact control strip (not full “dashboard” width) */
.search-shell {
  padding: 12px;
  margin-bottom: 10px;
}

.search-shell .search-row {
  max-width: 100%;
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 6px 6px 12px;
}

.search-ico {
  color: var(--text-mute);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

#icao-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 4px;
}

#icao-input::placeholder {
  color: var(--text-mute);
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 450;
}

.primary-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #061018;
  background: linear-gradient(180deg, #c9e7ff 0%, #7ec8ff 100%);
  box-shadow: 0 6px 18px rgba(126, 200, 255, 0.28);
  cursor: pointer;
  flex: 0 0 auto;
}

.primary-btn:active {
  transform: scale(0.97);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  min-height: 0;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chip:hover,
.chip:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  outline: none;
}

.chip.active {
  background: rgba(126, 200, 255, 0.16);
  border-color: rgba(126, 200, 255, 0.35);
  color: var(--accent);
}

.status {
  min-height: 1.2rem;
  margin: 4px 2px 10px;
  font-size: 0.82rem;
  color: var(--text-mute);
}

.status.error {
  color: #fca5a5;
}

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
}

.tabs.tabs-2 {
  grid-template-columns: 1fr 1fr;
}

.tabs.tabs-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ---------- Map tab (Phase A) ---------- */
.map-panel {
  padding: 10px;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.map-title {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.map-status {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.35;
}

.map-toolbar-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-tool-btn {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 36px;
}

/* FAA chart base selector (Street / VFR / IFR Low / IFR High / TAC) */
.chart-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.chart-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-right: 4px;
}

.chart-btn {
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 650;
  min-height: 34px;
  border-radius: 999px;
}

.chart-btn.active {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(37, 99, 235, 0.28);
  color: #dbeafe;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

/* Dep → Dest plan strip on map */
.flight-plan {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.flight-plan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.plan-icao {
  width: 4.6rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 10px 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
  color: var(--text);
  text-align: center;
}

.plan-icao:focus {
  border-color: rgba(96, 165, 250, 0.55);
}

.plan-arrow {
  color: var(--text-mute);
  font-weight: 700;
  opacity: 0.75;
  user-select: none;
}

.flight-plan-meta {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-mute);
  line-height: 1.4;
}

#btn-plan-nav.active {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(16, 185, 129, 0.22);
  color: #d1fae5;
}

/* FAA chart tiles under overlays */
.sb-faa-chart {
  image-rendering: auto;
}

.sky-map {
  width: 100%;
  height: min(58dvh, 520px);
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8eef5;
  z-index: 1;
}

/* When FAA charts are active, map chrome stays readable */
.sky-map .leaflet-control-attribution {
  font-size: 9px;
  max-width: 70%;
  background: rgba(255, 255, 255, 0.82);
  color: #1e293b;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  padding: 0 2px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 550;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.leg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.leg-dot.VFR { background: #34d399; }
.leg-dot.MVFR { background: #60a5fa; }
.leg-dot.IFR { background: #f87171; }
.leg-dot.LIFR { background: #e879f9; }
.leg-dot.UNK { background: #94a3b8; }
.leg-dot.own {
  background: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
}
.leg-dot.tail {
  background: #6d28d9;
  box-shadow: 0 0 0 1px rgba(109, 40, 217, 0.45);
}
.leg-radar {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 40%, #ef4444 70%, #a855f7 100%);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.leg-chart {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
  background:
    linear-gradient(135deg, #fef3c7 0%, #fde68a 40%, #86efac 70%, #93c5fd 100%);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.leg-sfc {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
  background:
    linear-gradient(90deg, #2563eb 0%, #ef4444 45%, #1e293b 55%, #f8fafc 100%);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

/* NWS surface analysis image overlay (fronts / H+L) */
.sb-sfc-analysis {
  pointer-events: none !important;
  image-rendering: auto;
}

#btn-map-sfc.active {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.leg-dot.traffic {
  background: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.45);
}

/* FR24-style aircraft icons */
.sb-div-icon.sb-plane-icon {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}

.sb-plane-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.sb-plane-rot {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transform-origin: 50% 50%;
  will-change: transform;
}

.sb-plane-svg {
  display: block;
  overflow: visible;
}

.sb-plane-label {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 1px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.14);
  color: #1e1b4b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.25;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.flight-history {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.history-item {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 11px;
  cursor: pointer;
  font: inherit;
}

.history-item:active {
  transform: scale(0.99);
}

.history-item.active {
  border-color: rgba(109, 40, 217, 0.55);
  background: rgba(109, 40, 217, 0.16);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 650;
}

.history-item-meta {
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--text-mute);
  line-height: 1.35;
}

.history-live {
  color: #86efac;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-note {
  margin: 8px 0 0;
  font-size: 0.7rem;
  color: var(--text-mute);
  line-height: 1.4;
}

.tail-track {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.tail-track-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tail-track-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#tail-input {
  flex: 1 1 7rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 10px 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
}

#tail-input:focus {
  border-color: rgba(167, 139, 250, 0.55);
}

.tail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}

.tail-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tail-chip.active {
  border-color: rgba(167, 139, 250, 0.65);
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
}

.tail-chip .tail-x {
  opacity: 0.55;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0 0 2px;
}

.tail-chip .tail-x:hover {
  opacity: 1;
}

/* Radar tiles sit above basemap, below markers */
.sb-radar-tiles {
  mix-blend-mode: normal;
}

/* Area traffic icons — altitude prominent */
.sb-traffic {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  line-height: 1.05;
}

.sb-traffic-rot {
  display: grid;
  place-items: center;
  transform-origin: 50% 50%;
}

.sb-traffic-alt {
  margin-top: 1px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.9);
  color: #ecfdf5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(45, 212, 191, 0.55);
  min-width: 2.2rem;
  text-align: center;
}

.sb-traffic-alt-miss {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.55);
  background: rgba(30, 20, 0, 0.88);
}

/* Last-known altitude (feed dropped alt for a few samples) */
.sb-traffic-alt-held {
  opacity: 0.92;
  border-style: dashed;
}

.sb-traffic-id {
  margin-top: 1px;
  font-size: 8px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  padding: 0 3px;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-tool-btn.active#btn-map-radar {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 116, 144, 0.28);
}

.map-tool-btn.active#btn-map-wx {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 95, 70, 0.28);
}

.map-tool-btn.active#btn-map-traffic {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(15, 118, 110, 0.28);
  color: #99f6e4;
}

.map-tool-btn.active#btn-map-follow {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(109, 40, 217, 0.22);
  color: #ddd6fe;
}

.glass-inner {
  /* marker class for nested glass-ish blocks */
}

.map-tool-btn.active {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
}

.map-disclaimer {
  margin: 10px 2px 0;
  font-size: 0.72rem;
  color: var(--text-mute);
  line-height: 1.4;
}

/* Leaflet — light map canvas, dark chrome popups still fine */
.leaflet-container {
  font: inherit;
  background: #e8eef5;
}

.sb-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #061018;
  line-height: 1;
}

.sb-marker.role-dep { border-color: #c9e7ff; }
.sb-marker.role-dest { border-color: #fde68a; }
.sb-marker.role-alt { border-color: #ddd6fe; }
.sb-marker.role-near {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
  font-size: 0;
  opacity: 0.9;
}

.sb-marker.VFR { background: #34d399; }
.sb-marker.MVFR { background: #60a5fa; color: #061018; }
.sb-marker.IFR { background: #f87171; color: #1a0606; }
.sb-marker.LIFR { background: #e879f9; color: #1a0618; }
.sb-marker.UNK { background: #94a3b8; }

.leaflet-popup-content-wrapper {
  background: rgba(12, 18, 34, 0.96);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-tip {
  background: rgba(12, 18, 34, 0.96);
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.leaflet-popup-content strong {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.leaflet-control-zoom a {
  background: rgba(12, 18, 34, 0.92) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

.leaflet-bar {
  border: 1px solid var(--line) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
}



.profile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.profile-select-field {
  flex: 1 1 12rem;
  min-width: 0;
}

.profile-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  padding-bottom: 1px;
}

.profile-btn {
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
  min-height: 44px;
}

.profile-btn.danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.profile-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Offline banner */
.offline-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 600;
}

.offline-banner[hidden] {
  display: none !important;
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
  flex: 0 0 auto;
}

/* Trip bar */
.trip-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.trip-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.trip-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 4.5rem;
  min-width: 4.2rem;
}

.trip-field span {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}

.trip-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 12px;
  padding: 11px 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 44px;
  outline: none;
}

.trip-field input:focus {
  border-color: rgba(126, 200, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(126, 200, 255, 0.12);
}

.trip-arrow {
  color: var(--text-mute);
  padding-bottom: 12px;
  font-size: 1rem;
}

.trip-btn {
  width: 100%;
}

.near-banner.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text-dim);
}

.near-banner.secondary .near-dot,
.near-banner.secondary::before {
  display: none;
}

/* Trip strip + summary */
.trip-summary {
  margin: 0 0 10px;
  padding: 12px 14px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.trip-summary strong {
  color: var(--text);
  font-weight: 650;
}

.trip-summary .cat-inline {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.trip-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.trip-strip::-webkit-scrollbar {
  display: none;
}

.trip-card {
  appearance: none;
  flex: 0 0 auto;
  width: 9.5rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 12px;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.trip-card:active {
  transform: scale(0.98);
}

.trip-card.active {
  border-color: rgba(126, 200, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(126, 200, 255, 0.2), var(--shadow);
}

.trip-role {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
  margin-bottom: 4px;
}

.trip-icao {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.trip-card-meta {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-mute);
  line-height: 1.35;
}

.trip-card .cat-pill {
  margin-top: 8px;
  display: inline-block;
  min-width: auto;
  padding: 4px 8px;
  font-size: 0.65rem;
}

/* Status polish */
.status {
  min-height: 1.35rem;
  margin: 4px 2px 10px;
  font-size: 0.82rem;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(126, 200, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}

.status.ok {
  color: rgba(167, 243, 208, 0.85);
}

.status.error {
  color: #fca5a5;
}

/* Section loading shimmer */
.is-loading .panel-sub,
.is-loading .winds-lead {
  opacity: 0.5;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Data age chip */
.age-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mute);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.age-chip.stale {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.age-chip.fresh {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

/* Panel polish */
.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero .meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Download button feedback */
.icon-btn.success {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.launch-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.launch-badge {
  flex: 0 0 auto;
  min-width: 5.5rem;
  text-align: center;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}

.launch-badge.go {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.4);
}

.launch-badge.marginal {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
}

.launch-badge.nogo {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
}

.launch-badge.unknown {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.launch-status-text {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.winds-lead {
  margin: -4px 0 12px;
  font-size: 0.8rem;
  color: var(--text-mute);
  line-height: 1.4;
}

.winds-more {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
  padding: 0 10px;
}

.winds-more summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.winds-more summary::-webkit-details-marker {
  display: none;
}

.winds-more[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  color: var(--text);
}

.winds-more .winds-table {
  padding-bottom: 10px;
}

.wind-row.ga-band {
  border-color: rgba(126, 200, 255, 0.12);
}

.winds-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 2rem;
}

.wind-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 4rem;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.wind-row.wind-head {
  background: transparent;
  border: 0;
  padding: 4px 12px 6px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.wind-row.ga-band {
  border-color: rgba(126, 200, 255, 0.22);
  background: rgba(126, 200, 255, 0.08);
}

.wind-alt {
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 600;
}

.wind-dir {
  font-weight: 650;
  color: #fff;
  letter-spacing: 0.02em;
}

.wind-temp {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.raw-inline {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  word-break: break-all;
  white-space: pre-wrap;
}

.sigmet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sigmet-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.28);
}

.sigmet-card .sig-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fecaca;
  margin-bottom: 6px;
}

.sigmet-card code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: pre-wrap;
  word-break: break-word;
}

.launch-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.launch-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 200, 255, 0.25);
  background: rgba(126, 200, 255, 0.08);
}

.launch-links a:active {
  opacity: 0.8;
}

.density-bar-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.density-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-mute);
  margin-bottom: 8px;
}

.density-bar-label strong {
  color: var(--accent);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.density-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.density-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #34d399 55%, #fbbf24);
  transition: width 0.35s ease;
}

.density-bar-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 100%;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.55);
  display: none; /* mark at 100% is right edge when scale is 0–110; we position via JS */
}

.race-notes {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.5;
}

.race-notes li {
  margin-bottom: 8px;
}

.race-notes li:last-child {
  margin-bottom: 0;
}

.race-notes strong {
  color: var(--text);
  font-weight: 600;
}

.race-source {
  margin: 12px 0 0;
  font-size: 0.75rem;
}

.race-key .metric {
  min-height: 80px;
}

.race-key .metric .value {
  font-size: 1.2rem;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab-panel[hidden] {
  display: none !important;
}

.perf-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perf-lead {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.text-btn:active {
  opacity: 0.75;
}

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

.form-grid.tight {
  margin-top: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field span {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.field input,
.field select {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 550;
  outline: none;
  min-height: 44px;
}

.field input:focus,
.field select:focus {
  border-color: rgba(126, 200, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(126, 200, 255, 0.12);
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.45) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.45) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.field select option {
  background: #121826;
  color: #fff;
}

#perf-computed {
  margin-top: 0;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-row {
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.check-row.ok {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

.check-row.warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.check-row.bad {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.check-title {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 4px;
}

.check-result {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.check-note {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-mute);
  line-height: 1.35;
}

.main {
  display: flex;
  flex-direction: column;
  gap: var(--content-gap);
  width: 100%;
}

/* Weather panels — always full content width (no orphan half-columns) */
.main > .hero,
.main > .panel,
.main > .disclaimer {
  width: 100%;
  min-width: 0;
}

/* Hero */
.hero {
  padding: var(--panel-pad);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.icao {
  font-size: clamp(2rem, 7vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.airport-name {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: min(28rem, 100%);
  line-height: 1.3;
}

.meta-line {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-mute);
}

.cat-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.cat-pill {
  min-width: 4.5rem;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
}

.cat-pill.VFR {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.15);
}

.cat-pill.MVFR {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 0 24px rgba(96, 165, 250, 0.15);
}

.cat-pill.IFR {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.15);
}

.cat-pill.LIFR {
  color: #f5d0fe;
  background: rgba(217, 70, 239, 0.18);
  border-color: rgba(232, 121, 249, 0.4);
  box-shadow: 0 0 24px rgba(232, 121, 249, 0.15);
}

.fav-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-mute);
  cursor: pointer;
}

.fav-toggle[aria-pressed="true"] {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}

.fav-toggle[aria-pressed="true"] svg {
  fill: currentColor;
}

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

@media (min-width: 560px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.metric {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 12px 11px;
  min-height: 72px;
}

.metric .label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}

.metric .value {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.metric .sub {
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--text-mute);
}

.raw-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.raw-block.quiet {
  margin-top: 12px;
}

.raw-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}

.raw-block code {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  word-break: break-word;
  white-space: pre-wrap;
}

/* Panels */
.panel {
  padding: var(--panel-pad);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-sub {
  font-size: 0.72rem;
  color: var(--text-mute);
  text-align: right;
  flex: 0 1 auto;
  min-width: 0;
}

.taf-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.taf-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.taf-when {
  font-size: 0.72rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  min-width: 4.6rem;
  line-height: 1.35;
}

.taf-detail {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.taf-detail strong {
  color: var(--text);
  font-weight: 600;
}

.taf-cat {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  align-self: center;
}

.taf-cat.VFR { color: #bbf7d0; background: rgba(16, 185, 129, 0.15); }
.taf-cat.MVFR { color: #bfdbfe; background: rgba(59, 130, 246, 0.16); }
.taf-cat.IFR { color: #fecaca; background: rgba(239, 68, 68, 0.15); }
.taf-cat.LIFR { color: #f5d0fe; background: rgba(217, 70, 239, 0.15); }

.muted {
  color: var(--text-mute);
  font-size: 0.88rem;
}

.airport-body {
  display: grid;
  gap: 8px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span:first-child {
  color: var(--text-mute);
}

.kv span:last-child {
  text-align: right;
  color: var(--text-dim);
  max-width: 65%;
}

.nearby-grid {
  display: grid;
  gap: 8px;
}

.nearby-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  padding: 12px 12px;
  cursor: pointer;
  color: inherit;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nearby-card:active {
  background: rgba(255, 255, 255, 0.06);
}

.nearby-id {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

.nearby-meta {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.35;
}

.nearby-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.nearby-dist {
  font-size: 0.72rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.disclaimer {
  margin: 4px 4px 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
}

/* Empty state */
.empty {
  padding: 36px 24px;
  text-align: center;
  margin-top: 8px;
}

.empty-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background:
    #070b14
    url("/icons/icon-192.png") center / cover no-repeat;
  box-shadow:
    0 12px 32px rgba(34, 211, 238, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.empty h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.empty p {
  margin: 0 auto 18px;
  max-width: 28rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.45;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ---------- Responsive layout (production) ---------- */

/* Large phones */
@media (min-width: 480px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-row {
    flex-direction: row;
    align-items: stretch;
  }

  .action-row .near-banner {
    flex: 1;
    margin-top: 0;
  }
}

/* Tablet portrait — still single column cards, equal width */
@media (min-width: 640px) {
  :root {
    --app-max: 640px;
    --content-gap: 14px;
    --panel-pad: 18px 20px;
  }

  .app {
    padding-left: 20px;
    padding-right: 20px;
  }

  .search-shell {
    padding: 14px 16px;
  }

  /* Brief strip: keep ICAO control from looking “banner-wide” */
  .search-shell form {
    max-width: 28rem;
  }

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

  .trip-strip {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .trip-card {
    flex: 1 1 9.5rem;
    max-width: 12rem;
  }
}

/* Desktop / iPad landscape */
@media (min-width: 900px) {
  :root {
    --app-max: 720px;
    --content-gap: 14px;
  }

  .app {
    padding-left: 24px;
    padding-right: 24px;
    padding-top: calc(20px + var(--safe-top));
  }

  .top {
    margin-bottom: 18px;
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  /* Search + chips: centered compact block (not full page width feel) */
  .search-shell {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
  }

  .tabs {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
  }

  .status {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
  }

  /* Single column: every weather card same full content width */
  .main {
    display: flex;
    flex-direction: column;
    gap: var(--content-gap);
  }

  #taf-panel,
  #airport-panel,
  #winds-panel,
  #nearby-panel,
  .hero {
    width: 100%;
    min-width: 0;
  }

  .sky-map {
    height: min(68dvh, 640px);
    min-height: 360px;
  }

  .map-panel {
    padding: 14px;
  }

  .map-toolbar {
    align-items: center;
  }

  .chart-bar {
    justify-content: flex-start;
  }

  .flight-plan-row {
    flex-wrap: nowrap;
  }

  .plan-icao {
    width: 5rem;
  }

  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .empty {
    padding: 48px 32px;
  }

  .empty p {
    max-width: 32rem;
  }
}

/* Wide desktop — slightly more room for map/weather without ballooning search */
@media (min-width: 1100px) {
  :root {
    --app-max: 860px;
  }

  .search-shell,
  .tabs,
  .status {
    max-width: 34rem;
  }

  .sky-map {
    height: min(70dvh, 700px);
  }

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

/* Ultra-wide: keep content centered, don’t stretch to edge */
@media (min-width: 1400px) {
  :root {
    --app-max: 920px;
  }
}

/* Mobile safety — prevent horizontal overflow on small phones */
@media (max-width: 379px) {
  .app {
    padding-left: 10px;
    padding-right: 10px;
  }

  .map-toolbar-actions {
    gap: 4px;
  }

  .map-tool-btn,
  .chart-btn {
    padding: 6px 8px;
    font-size: 0.72rem;
    min-height: 32px;
  }

  .primary-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .orb,
  .icon-btn.spin svg {
    animation: none;
  }
}
