:root {
  color-scheme: dark;
  --background: #031021;
  --surface: #06182f;
  --surface-raised: #0a1f3d;
  --border: rgba(148, 186, 224, 0.2);
  --text: #ffffff;
  --muted: #b9c7d7;
  --accent: #00d4ff;
  --accent-strong: #73e7ff;
  --success: #55d69e;
  --warning: #ffc857;
  --danger: #ff7b7b;
  --shadow: 0 16px 38px rgba(0, 9, 25, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
}

button,
select,
a {
  font: inherit;
}

a {
  color: var(--accent-strong);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 16, 33, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner,
main,
footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 58px;
  object-fit: contain;
}


.brand small {
  display: block;
}



.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.secondary-button,
.filter-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: 160ms ease;
}

.toolbar-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.7fr) minmax(0, 2.3fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.control-group {
  display: flex;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(0, 212, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 31, 61, 0.58);
  flex-direction: column;
  gap: 8px;
}

.control-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.select-control select {
  width: 100%;
  min-height: 42px;
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-raised);
}

.select-control select:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.45);
  outline-offset: 3px;
}

.secondary-button {
  padding: 10px 15px;
  border-radius: 8px;
}

.secondary-button:hover,
.filter-button:hover,
.filter-button.active {
  border-color: rgba(0, 212, 255, 0.55);
  background: rgba(0, 212, 255, 0.13);
}

.secondary-button:focus-visible,
.filter-button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.45);
  outline-offset: 3px;
}

main {
  padding-block: 58px 36px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.25rem);
  line-height: 0.97;
  letter-spacing: -0.058em;
}

.hero-copy {
  max-width: 670px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.9rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(255, 200, 87, 0.1);
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(85, 214, 158, 0.1);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 123, 123, 0.1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 44px;
}

.summary-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(145deg, #041124, #082a4d);
  box-shadow: var(--shadow);
}

.summary-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.summary-card strong {
  font-size: 2rem;
}

.toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar h2 {
  margin: 0 0 5px;
  font-size: 1.5rem;
}

.toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.filter-button {
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
}

.filter-button.active {
  color: var(--text);
}

.message-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(255, 123, 123, 0.3);
  border-radius: 8px;
  color: #ffd7d7;
  background: rgba(255, 123, 123, 0.08);
  line-height: 1.55;
}

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

.flight-card {
  min-height: 280px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(12, 35, 67, 0.96), rgba(6, 24, 47, 0.94));
  box-shadow: var(--shadow);
}

.flight-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.flight-card h3 {
  margin: 0;
  font-size: 1.5rem;
}

.callsign {
  margin: 6px 0 0;
  color: var(--muted);
}

.score {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgba(0, 212, 255, 0.09);
  font-size: 1.35rem;
  font-weight: 800;
}

.score small {
  display: block;
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 600;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.badge {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.76rem;
  font-weight: 700;
}

.flight-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0;
}

.flight-details div {
  min-width: 0;
}

.flight-details dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flight-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 54px 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.skeleton {
  position: relative;
  background: var(--surface);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.beta-note {
  margin-top: 28px;
  padding: 17px 19px;
  border-left: 3px solid var(--warning);
  color: var(--muted);
  background: rgba(255, 200, 87, 0.055);
  line-height: 1.55;
}

.beta-note strong {
  color: var(--text);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 30px 48px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

@media (max-width: 780px) {
  main {
    padding-top: 40px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .status-panel {
    align-self: flex-start;
  }

  .summary-grid,
  .flight-grid {
    grid-template-columns: 1fr;
  }

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

  .filter-control {
    grid-column: 1 / -1;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .header-inner {
    min-height: 60px;
  }

  .brand small {
    display: none;
  }

  .secondary-button {
    padding-inline: 11px;
    font-size: 0.82rem;
  }

  .toolbar-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-control {
    grid-column: auto;
  }

  .flight-details {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  font-size: clamp(1.85rem, 3.8vw, 3.25rem);
  line-height: 1.05;
  max-width: 900px;
  text-wrap: balance;
}

.score-help { color: var(--muted); font-size: 0.8rem; }
.summary-card { position: relative; }
.summary-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.summary-heading .summary-label { margin-bottom: 0; }
.summary-heading .score-help { margin-block: -10px; }
.score-help summary { display: grid; place-items: center; width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; color: var(--accent); cursor: pointer; list-style: none; font-weight: 800; }
.score-help summary::-webkit-details-marker { display: none; }
.score-help summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.score-help p { position: absolute; top: 100%; left: 0; z-index: 5; width: 100%; margin: 6px 0 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); box-shadow: var(--shadow); line-height: 1.55; font-size: inherit; }
.status-panel { max-width: 100%; }
.status-dot { flex-shrink: 0; }
@media (max-width: 520px) {
  .header-inner { gap: 10px; }
  .brand { gap: 8px; }
  .brand-logo { height: 52px; max-width: 155px; object-fit: contain; }
}

/* Exact foreground/background pairs from website/public/styles.css .track-* rules. */
.badge.category-special { color: #8428c7; background: #fbf7ff; }
.badge.category-cargo { color: #e76800; background: #fff9f2; }
.badge.category-heavy { color: #df334c; background: #fff7f8; }
.badge.category-rare { color: #006cc7; background: #f5faff; }
.badge.category-military { color: #16752a; background: #f6fbf6; }


/* Informational treatment reused from the public website's .notice. */
.enthusiast-note {
  margin-bottom: 28px;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: rgba(0, 123, 255, 0.08);
  line-height: 1.55;
}
.enthusiast-note h2 { margin: 0 0 6px; color: var(--text); font-size: 1rem; }
.enthusiast-note p { margin: 0; font-size: 0.9rem; }
