:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --ink: #0F172A;
  --muted: #475569;
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --border: #CBD5E1;
  --pass-bg: #DCFCE7;
  --pass-ink: #15803D;
  --tight-bg: #FEF3C7;
  --tight-ink: #B45309;
  --fail-bg: #FEE2E2;
  --fail-ink: #B91C1C;
  --fare-bg: #EDE9FE;
  --fare-ink: #6D28D9;
  --info-bg: #E0F2FE;
  --info-ink: #0369A1;
  --radius: 12px;
  --maxw: 1080px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  overflow-x: clip;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #FFF;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header & Nav */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: #FFF;
  font-size: 0.8rem;
  font-weight: 800;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.25rem 0;
}
.nav-links a[aria-current="page"], .nav-links a:hover {
  color: var(--accent);
}

main { padding: 1.5rem 0 3rem; }

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.25;
}
h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.08rem;
}
.lead {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0;
  max-width: 72ch;
}

/* Tool Panel */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}
.preset-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.25rem;
}
.btn-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-chip:hover { border-color: var(--accent); color: var(--accent); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.field input, .field select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding: 0.85rem;
  background: var(--surface-alt);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.toggle-group button {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.toggle-group button[aria-pressed="true"] {
  background: var(--accent);
  color: #FFF;
}

.error-banner {
  background: var(--fail-bg);
  color: var(--fail-ink);
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Summary Bar */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}
.stat-num { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-top: 0.2rem; }

/* Airline Verdict Cards */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.85rem;
}
.airline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.airline-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.airline-name { font-weight: 800; font-size: 1.02rem; margin: 0; }
.airline-region { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-pass { background: var(--pass-bg); color: var(--pass-ink); }
.badge-tight { background: var(--tight-bg); color: var(--tight-ink); }
.badge-fail { background: var(--fail-bg); color: var(--fail-ink); }
.badge-fare_blocked { background: var(--fare-bg); color: var(--fare-ink); }
.badge-unverified_numeric { background: var(--info-bg); color: var(--info-ink); }

.spec-line {
  font-size: 0.86rem;
  color: var(--ink);
  background: var(--surface-alt);
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
}
.verdict-text { font-size: 0.88rem; color: var(--muted); margin: 0; }
.card-meta {
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid var(--surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  gap: 0.5rem;
}

/* Content Sections & Diagrams */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1.5rem;
}
.diagram-card { margin: 1rem 0 0; }
.diagram-svg { width: 100%; height: auto; display: block; }
.diagram-caption {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface-alt);
  padding: 0.9rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
}
.callout-warn { border-left-color: var(--tight-ink); background: #FFFBEB; }

.table-wrap { overflow-x: auto; max-width: 100%; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--surface-alt); font-weight: 700; }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  font-size: 0.86rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  .hero, .tool-card, .content-section { padding: 1rem; }
  .results-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
