:root {
  color-scheme: dark;
  --background: #07101d;
  --surface: #0c1727;
  --surface-strong: #12233a;
  --text: #f6f7f9;
  --muted: #aeb9c8;
  --line: #29405e;
  --accent: #ffd63d;
  --accent-text: #171300;
  --good: #60e6ae;
  --possible: #ffd978;
  --danger: #ff9b9b;
  --focus: #8fd1ff;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 80% -10%, rgba(68, 125, 190, 0.24), transparent 38rem), var(--background);
  color: var(--text);
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 29, 0.84);
  backdrop-filter: blur(14px);
}
.header-inner, main, footer {
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
}
.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 0 2rem;
}
.eyebrow, .aircraft-kind, .location-label {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}
.strapline {
  max-width: 35rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}
.live-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.live-dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(96, 230, 174, 0.55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 0.55rem rgba(96, 230, 174, 0); }
  100% { box-shadow: 0 0 0 0 rgba(96, 230, 174, 0); }
}
main { padding: 1.25rem 0 3rem; }
.search-panel, .explanation {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 23, 39, 0.88);
}
.search-panel h2, .explanation h2, .results h2 { margin-top: 0; }
label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 800;
}
.postcode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}
input[type="text"], input:not([type]) { width: 100%; }
#postcode {
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid #3c587b;
  border-radius: 0.75rem;
  background: #07101d;
  color: var(--text);
  font-size: 1.05rem;
  text-transform: uppercase;
}
button {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 900;
}
button:hover { filter: brightness(1.05); }
button:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button:disabled {
  cursor: wait;
  opacity: 0.62;
}
.range-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
}
.field-help {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
#range-output {
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}
#range {
  width: 100%;
  accent-color: var(--accent);
}
.status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  margin: 0.8rem 0 0;
  padding: 0.75rem 0.25rem;
  color: var(--muted);
}
.status.error { color: var(--danger); }
.secondary-button {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.55rem 0.8rem;
}
.results {
  scroll-margin-top: 1rem;
  padding: 1.2rem 0;
}
.results-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.results-heading-row h2 { margin-bottom: 0; }
.updated-at {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}
.aircraft-list {
  display: grid;
  gap: 0.85rem;
}
.aircraft-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(18, 35, 58, 0.96), rgba(10, 22, 38, 0.96));
}
.aircraft-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.aircraft-callsign {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
  letter-spacing: -0.03em;
}
.audibility-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  background: rgba(96, 230, 174, 0.13);
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}
.audibility-badge.possible {
  background: rgba(255, 217, 120, 0.12);
  color: var(--possible);
}
.aircraft-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.9rem 0 0;
}
.aircraft-facts div { min-width: 0; }
.aircraft-facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}
.aircraft-facts dd {
  margin: 0.18rem 0 0;
  font-weight: 800;
}
.empty-state {
  padding: 2.5rem 1.25rem;
  border: 1px dashed #3d5878;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}
.empty-state h3 {
  margin: 0.5rem 0 0.25rem;
  color: var(--text);
}
.empty-state p { margin: 0; }
.empty-icon {
  color: var(--accent);
  font-size: 2rem;
}
.explanation p {
  margin-bottom: 0;
  color: var(--muted);
}
footer {
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
footer p { margin: 0; }
@media (max-width: 680px) {
  .header-inner { padding-top: 1.7rem; }
  .live-mark { margin-top: 0.15rem; }
  .postcode-row { grid-template-columns: 1fr; }
  .postcode-row button { width: 100%; }
  .aircraft-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .updated-at { text-align: left; }
}
@media (max-width: 420px) {
  .header-inner { flex-direction: column; }
  .aircraft-topline { flex-direction: column; }
  .aircraft-facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
