/* Vaeroly — crew centre styles */

:root {
  --brand: #2563eb;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --ring: color-mix(in srgb, var(--brand) 35%, transparent);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, var(--surface));
  --brand-ink: color-mix(in srgb, var(--brand) 80%, #000);
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-button: #b91c1c;  /* white text on it stays readable */
  --bad-soft: #fee2e2;
  --info-soft: #e0e7ff;
  --shell: #0b1220;
  --shell-2: #111a2e;
  --shell-text: #cbd5e1;
  --shell-muted: #7c8aa5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px rgb(15 23 42 / .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a;
    --surface: #111827;
    --surface-2: #0f1624;
    --text: #e5e9f0;
    --text-2: #b4bfd0;
    --muted: #8391a7;
    --border: #1f2a3c;
    --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface));
    --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
    --ok: #4ade80;
    --ok-soft: #0f2e1c;
    --warn: #fbbf24;
    --warn-soft: #33260a;
    --bad: #f87171;
    --bad-button: #dc2626;
    --bad-soft: #3a1414;
    --info-soft: #1c2342;
    --shell: #070b14;
    --shell-2: #0d1422;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--text); font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-lg { width: 22px; height: 22px; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand); color: #fff; font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none !important; transition: filter .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-danger { background: var(--bad-button); }
.btn-ok { background: var(--ok); }
.btn-sm { padding: 5px 11px; font-size: .84rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.inline { display: inline; margin: 0; }

label { display: block; font-weight: 550; font-size: .88rem; color: var(--text-2); margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); display: inline-block; }
input[type="color"] { padding: 2px; height: 40px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--text); }
label.check input { margin-top: 3px; }
label.check span.muted { display: block; font-weight: 400; }
.help { font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: 4px; }
/* A field whose label line also holds buttons (Generate, Copy): the buttons sit outside the <label>, so clicking
   the label text focuses the field instead of pressing a button. */
.field { margin-bottom: 14px; }
.field .label-line { font-weight: 550; font-size: .88rem; color: var(--text-2); }
.field .label-line label { display: inline; margin: 0; font: inherit; color: inherit; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form label { margin: 0; flex: 1 1 140px; }
.inline-form .btn { margin-bottom: 1px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 14px; }
.checks label { margin: 0; display: inline-flex; gap: 6px; align-items: center; font-weight: 500; color: var(--text); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Cards, grids, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }
.grid > .card, .grid > .stat, .features > .card { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
@media (max-width: 760px) { .span-2 { grid-column: auto; } }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.stat-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 500; }

.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 999px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 500; }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .i { width: 34px; height: 34px; color: var(--border); margin-bottom: 8px; }
.empty p { margin: 4px 0 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.card > .table-wrap:first-child table th:first-child { border-top-left-radius: var(--radius); }
.card > .table-wrap:first-child table th:last-child { border-top-right-radius: var(--radius); }

/* ---------- Badges, tags, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.accepted, .badge.complete, .badge.active, .badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.pending, .badge.needs_reply { background: var(--warn-soft); color: var(--warn); }
.badge.rejected, .badge.invalidated, .badge.suspended, .badge.hidden-b { background: var(--bad-soft); color: var(--bad); }
.badge.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag { display: inline-block; padding: 1px 8px; margin: 1px 2px; border-radius: 6px; font-size: .78rem; font-weight: 600; font-family: var(--mono);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tag.locked { color: var(--muted); text-decoration: line-through; }
.tag.brand { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.tag.tag-soft { font-family: inherit; font-weight: 500; background: transparent; color: var(--muted); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem;
  background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: var(--muted); font-size: .78rem; }
.icao { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--brand); color: #fff;
  font-weight: 800; font-size: .82rem; letter-spacing: .04em; flex: none; box-shadow: inset 0 -2px 0 rgb(0 0 0 / .15); }
.icao.sm { width: 32px; height: 32px; border-radius: 8px; font-size: .68rem; }
.route-pair { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-family: var(--mono); }
.route-pair .i { color: var(--muted); width: 15px; height: 15px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: .92rem; background: var(--info-soft); color: var(--text); border: 1px solid transparent; }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.bad-text { color: var(--bad); }
.alert .i { margin-top: 2px; }

/* ---------- Site (platform) layout ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 22px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; display: block; flex: none; }
.logo-mark .i { width: 18px; height: 18px; }
.topnav { display: flex; gap: 4px; align-items: center; flex: 1; }
.topnav a { color: var(--text-2); font-weight: 550; font-size: .92rem; padding: 6px 10px; border-radius: 7px; }
.topnav a:hover, .topnav a.active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.site-main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; }
.site-footer div { max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgb(15 23 42 / .14); padding: 6px; z-index: 40; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--text);
  font-size: .9rem; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head small { display: block; color: var(--muted); }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; flex-basis: 100%; overflow-x: auto; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #e2e8f0; background: radial-gradient(1200px 500px at 80% -10%, #1d4ed8 0%, transparent 60%),
  radial-gradient(900px 500px at 0% 120%, #6d28d9 0%, transparent 55%), #070d1c; }
.hero-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 84px 20px 92px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; color: #fff; letter-spacing: -.03em; max-width: 720px; }
.hero p.lead { font-size: 1.15rem; color: #b6c2d9; max-width: 620px; margin: 18px 0 30px; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #93c5fd; background: rgb(59 130 246 / .12); border: 1px solid rgb(59 130 246 / .25); padding: 5px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero .btn-ghost { background: rgb(255 255 255 / .06); color: #fff; border-color: rgb(255 255 255 / .18); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.hero-stats { display: flex; gap: 40px; margin-top: 46px; flex-wrap: wrap; }
.hero-stats div { font-size: .85rem; color: #94a3b8; }
.hero-stats strong { display: block; font-size: 1.8rem; color: #fff; letter-spacing: -.02em; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 10px 0 44px; }
.feature { padding: 22px; }
.feature .stat-icon { margin-bottom: 14px; }
.feature p { color: var(--text-2); font-size: .9rem; margin: 6px 0 0; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.section-title p { margin: 4px 0 0; color: var(--muted); }

.airline-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); transition: transform .15s, box-shadow .15s; }
.airline-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(15 23 42 / .10); text-decoration: none; }
.airline-card .band { height: 6px; background: var(--brand); }
.airline-card .card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.airline-card .desc { color: var(--text-2); font-size: .9rem; flex: 1; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.airline-card .meta { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.airline-card .meta span { display: inline-flex; gap: 5px; align-items: center; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background: radial-gradient(800px 400px at 50% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .logo { justify-content: center; width: 100%; margin-bottom: 22px; }
.auth-box .card-body { padding: 28px; }
.auth-box h1 { font-size: 1.35rem; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-weight: 500; font-size: .84rem; }

/* ---------- Airline shell ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar { background: var(--shell); color: var(--shell-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; color: #fff; border-bottom: 1px solid rgb(255 255 255 / .06); }
.sb-brand:hover { text-decoration: none; }
.sb-brand strong { display: block; font-size: .98rem; line-height: 1.25; }
.sb-brand small { color: var(--shell-muted); font-size: .76rem; }
.sb-nav { padding: 14px 10px; flex: 1; }
.sb-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--shell-muted); font-weight: 700; padding: 14px 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--shell-text); font-size: .9rem; font-weight: 500; }
.sb-link:hover { background: rgb(255 255 255 / .05); color: #fff; text-decoration: none; }
.sb-link.active { background: color-mix(in srgb, var(--brand) 26%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.sb-link .i { opacity: .85; }
.sb-count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 7px; }
.sb-foot { padding: 12px 10px 16px; border-top: 1px solid rgb(255 255 255 / .06); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; }
.sb-user .avatar { background: rgb(255 255 255 / .1); color: #fff; }
.sb-user small { display: block; color: var(--shell-muted); font-size: .76rem; }
.sb-mobile { display: none; }
.content { min-width: 0; }
.content-inner { max-width: 1160px; margin: 0 auto; padding: 28px 30px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-head .actions .acars-version { flex-basis: 100%; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }  /* spare height goes to the page, not the header */
  .sidebar { position: static; height: auto; }
  .sb-nav, .sb-foot { display: none; }
  .sidebar[open] .sb-nav, .sidebar.open .sb-nav, .sidebar.open .sb-foot { display: block; }
  .sb-brand { border: 0; }
  .sb-mobile { display: inline-flex; margin-left: auto; background: rgb(255 255 255 / .08); color: #fff; border: 0; border-radius: 8px; padding: 8px; cursor: pointer; }
  .content-inner { padding: 20px 16px 50px; }
}

/* ---------- Airline pages ---------- */
.va-hero { border-radius: var(--radius); padding: 28px; color: #fff; position: relative; overflow: hidden; margin-bottom: 18px;
  background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0b1220)); }
.va-hero h1 { color: #fff; font-size: 1.8rem; }
.va-hero p { color: rgb(255 255 255 / .85); max-width: 640px; margin: 8px 0 0; }
.va-hero .hero-art { opacity: .25; }
.va-hero .icao { background: rgb(255 255 255 / .16); width: 56px; height: 56px; font-size: 1rem; }
.flight-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 6px 0 18px; }
.flight-card .ap { font-family: var(--mono); font-size: 1.7rem; font-weight: 800; letter-spacing: .02em; }
.flight-card .ap small { display: block; font-family: var(--font); font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.flight-card .ap:last-child { text-align: right; }
.flight-card .mid { text-align: center; color: var(--muted); font-size: .8rem; min-width: 110px; }
.flight-card .mid .line { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 11px); margin: 8px 0; }
.flight-card .mid .line .i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(45deg); background: var(--surface); color: var(--brand); padding: 0 4px; width: 26px; }
.score-row td:first-child { width: 70px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-row.plus td:first-child { color: var(--ok); }
.score-row.minus td:first-child, .score-row.flag td { color: var(--bad); }
.key-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.key-box code { flex: 1; word-break: break-all; font-size: .8rem; }
.cmd { background: #0b1220; color: #cbd5e1; border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--mono); font-size: .8rem; overflow-x: auto; white-space: pre; }
.hub-card { display: flex; flex-direction: column; gap: 10px; }
.hub-card .top { display: flex; align-items: center; gap: 12px; }
.hub-card .nums { display: flex; gap: 18px; font-size: .84rem; color: var(--muted); }
.hub-card .nums b { color: var(--text); font-size: 1rem; }
#map { height: 520px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.plane-icon div { font-size: 22px; line-height: 22px; color: var(--brand); text-shadow: 0 1px 2px rgb(0 0 0 / .35); }
.leaflet-popup-content { font: 13px/1.45 var(--font); }

/* ---------- Error page ---------- */
.error-page { text-align: center; padding: 70px 20px; }
.error-page .code { font-size: 4rem; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Fixes ---------- */
input::placeholder, textarea::placeholder { text-transform: none; color: var(--muted); opacity: .6; font-weight: 400; }
.icao { width: auto; min-width: 44px; padding: 0 7px; }
.icao.sm { min-width: 32px; padding: 0 5px; }
@media (max-width: 900px) {
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sb-brand { flex: 1; min-width: 0; }
  .sb-mobile { margin: 0 16px 0 0; }
  .sidebar.open .sb-nav, .sidebar.open .sb-foot { flex-basis: 100%; }
}

/* PIREP flight track: map plus altitude / ground-speed profiles */
.track { --series: var(--brand); }
@media (prefers-color-scheme: dark) { .track { --series: var(--brand-ink); } }
#track-map { height: 320px; border-radius: var(--radius-sm); }
.track-charts { display: grid; gap: 14px; margin-top: 16px; }
.track-chart h3 { margin: 0 0 4px; font-size: .85rem; color: var(--text-2); font-weight: 600; }
.track-chart svg { width: 100%; height: auto; display: block; touch-action: none; }
.track-chart .grid { stroke: var(--border); stroke-width: 1; }
.track-chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.track-chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.track-chart .area { fill: var(--series); opacity: .1; }
.track-chart .cross { stroke: var(--text-2); stroke-width: 1; }
.track-chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.track-tip { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; min-height: 1.6em; font-size: .9rem; }
#track-tip { display: inline-flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
#track-tip[hidden] { display: none; }
.track-tip strong { color: var(--text); font-variant-numeric: tabular-nums; }
.track-tip span { color: var(--muted); }
.grade { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-ink); margin-left: 6px; }
.grade.hard, .grade.crash { background: var(--bad-soft); color: var(--bad); }
.grade.firm { background: var(--warn-soft); color: var(--warn); }
.grade.butter, .grade.smooth { background: var(--ok-soft); color: var(--ok); }

/* Platform announcement banner and admin tabs */
.announce { padding: 9px 16px; text-align: center; font-size: .9rem; font-weight: 500; background: var(--info-soft); color: var(--text); }
.announce.warning { background: var(--warn-soft); color: var(--warn); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 0 0 20px; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs .count { background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.health { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.health li { display: flex; gap: 10px; align-items: flex-start; }
.health .i { flex: none; margin-top: 2px; }
.health .ok { color: var(--ok); }
.health .no { color: var(--warn); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); font-size: .84rem; }
.chips a.active { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; font-weight: 600; }
.flight-log .log-warning td:last-child { color: var(--bad); font-weight: 500; }
.flight-log .log-phase td:last-child, .flight-log .log-landing td:last-child { font-weight: 600; }
.flight-log .i { width: 14px; height: 14px; vertical-align: -2px; }
.award .award-emoji { font-size: 2.2rem; line-height: 1; filter: grayscale(1); opacity: .55; }
.award.earned .award-emoji { filter: none; opacity: 1; }
.award.earned { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badges .badge-item { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px 4px 6px; font-size: .88rem; }
.badges .badge-item span:first-child { font-size: 1.25rem; }
#profile-map { height: 300px; border-radius: var(--radius-sm); }
.prose { line-height: 1.6; }

/* Stats page charts */
.mini-chart, .hbars { --series: var(--brand); }
@media (prefers-color-scheme: dark) { .mini-chart, .hbars { --series: var(--brand-ink); } }
.mini-chart { margin: 0; }
.hbars { width: 100%; height: auto; display: block; }
.mini-chart figcaption { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.mini-chart svg { width: 100%; height: auto; display: block; }
.mini-chart .grid { stroke: var(--border); stroke-width: 1; }
.mini-chart .tick, .hbars .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hbars .tick.lbl { fill: var(--text-2); font-size: 12px; }
.hbars .tick.val { fill: var(--text); font-size: 12px; }
.mini-chart .bar, .hbars .bar { fill: var(--series); }
.mini-chart .hit-area { fill: transparent; }
.mini-chart .hit:hover .bar, .mini-chart .hit:focus .bar { opacity: .8; }
.mini-chart .hit:focus { outline: none; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px 10px; font-size: .85rem; pointer-events: none;
  display: flex; gap: 8px; align-items: baseline; z-index: 30; }
.chart-tip[hidden] { display: none; }
.chart-tip strong { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--muted); }

/* Settings pages: a described section per topic, choice cards, and a save bar */
.settings-section { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px; padding: 26px 0;
  border-top: 1px solid var(--border); }
.settings-section:first-of-type { border-top: 0; padding-top: 6px; }
.settings-section > header h2 { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; }
.settings-section > header p { color: var(--muted); font-size: .88rem; margin: 0; line-height: 1.5; }
@media (max-width: 800px) { .settings-section { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.field-title { font-size: .82rem; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.field-title:not(:first-child) { margin-top: 20px; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.choice { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 14px 16px 14px 44px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); font-weight: 600; font-size: .92rem; transition: border-color .15s, box-shadow .15s; }
.choice input { position: absolute; left: 16px; top: 16px; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.choice small { font-weight: 400; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.choice:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); background: var(--brand-soft); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.switch-row small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.switch { position: relative; flex: none; width: 40px; height: 22px; margin-top: 1px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.save-bar { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin: 8px -22px -20px; padding: 14px 22px; background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 16px rgb(15 23 42 / .06); }
.save-bar .muted { margin-right: auto; font-size: .88rem; }
.preview-box { border: 1px dashed var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 4px; }
.preview-box .announce { margin: 0; }
.preview-box .empty-preview { padding: 10px 14px; color: var(--muted); font-size: .85rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.tool-grid > .card { margin-top: 0; }
.sysinfo { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: .9rem; }
.sysinfo dt { color: var(--muted); }
.sysinfo dd { margin: 0; font-variant-numeric: tabular-nums; }
.money-neg { color: var(--bad); }
.mini-chart .ref-line { fill: none; stroke: var(--muted); stroke-width: 1; opacity: .7; }
.mini-chart .glide-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mini-chart .dev-area { fill: var(--series); opacity: .12; }

/* Live weather widget */
.wx-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .9rem; font-weight: 500; }
.wx-cat { font-weight: 700; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.wx-mvfr { background: var(--info-soft); color: var(--brand-ink); }
.wx-ifr { background: var(--bad-soft); color: var(--bad); }
.wx-lifr { background: #f5d0fe; color: #86198f; }
.wx-raw { font-family: var(--mono); font-size: .8rem; color: var(--text-2); margin-top: 8px; line-height: 1.5; word-break: break-word; }
.wx-best { margin-top: 6px; font-size: .88rem; font-weight: 600; }
.wx-table { width: 100%; margin-top: 10px; font-size: .88rem; }
.wx-table th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.wx-table td { padding: 5px 6px; border-top: 1px solid var(--border); }
.wx-best-row td { background: var(--brand-soft); font-weight: 600; }
.wx-mini { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; }
.wx-mini .wx-raw { font-size: .75rem; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; margin: 6px 0; font-size: .92rem; display: flex; flex-direction: column; gap: 2px; }
.msg-staff { background: var(--brand-soft); margin-left: auto; }
.msg-pilot { background: var(--surface-2); border: 1px solid var(--border); }

/* Dashboard digest (news, events, tours, awards) */
.digest-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.digest-item:last-child { border-bottom: 0; }
.digest-item small { display: block; }
.digest-item p { margin: 4px 0 0; }

/* "File on VATSIM / IVAO" buttons under the booking */
.prefile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.prefile .btn { color: #fff; border-color: transparent; }
.prefile .net-vatsim { background: #29845a; }
.prefile .net-ivao { background: #0d2c99; }
.prefile .net-pilotedge { background: #5b4a9e; }
.prefile .net-poscon { background: #403a60; }

/* Dashboard: recent PIREP tiles (colour = status, with the status word written on each tile) */
.pirep-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pirep-tile { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; color: #fff; text-decoration: none;
  background: #1f7a4d; box-shadow: 0 1px 2px rgb(0 0 0 / .12); transition: transform .12s; }
.pirep-tile:hover { transform: translateY(-2px); text-decoration: none; color: #fff; }
.pirep-tile.st-pending { background: #2f5fb3; }
.pirep-tile.st-rejected { background: #c2410c; }
.pt-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .86rem; }
.pt-row strong { font-size: 1.02rem; letter-spacing: .02em; }
.pt-route { font-weight: 600; font-size: .95rem; }
.pt-route svg { width: 14px; height: 14px; opacity: .85; }
.pt-nums { font-variant-numeric: tabular-nums; opacity: .92; font-size: .8rem; }

/* Your career */
.career { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.career div, .period-nums div { display: grid; }
.career span, .period-nums span { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.career small, .period-nums small { color: var(--muted); font-size: .78rem; }
@media (max-width: 520px) { .career { grid-template-columns: repeat(2, 1fr); } }

/* NOTAM priority chips */
.prio { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 600; border: 1px solid; vertical-align: middle; }
.prio-high { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.prio-medium { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.prio-low { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

/* Period tabs */
.period-tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.period-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 6px; color: var(--text-2);
  font: inherit; cursor: pointer; }
.period-tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--brand); }
.period-nums { display: flex; justify-content: space-between; gap: 10px; }
.period-nums .ok { color: var(--ok); } .period-nums .warn { color: var(--warn); } .period-nums .bad { color: var(--bad); }
@media (max-width: 600px) { .period-tabs { grid-template-columns: repeat(3, 1fr); } }
.period-panel[hidden] { display: none; }
.pt-nums span { white-space: nowrap; }
@media (max-width: 600px) { .notams th:nth-child(3), .notams td:nth-child(3) { display: none; } }

/* Flight Centre maps */
#map.flight-map { height: calc(100vh - 190px); min-height: 420px; }
.map-flights { margin-top: 8px; max-height: 220px; overflow-y: auto; }
.map-flight { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid #e5e7eb; }
.map-flight span { display: grid; }
.map-flight small { color: #6b7280; }
.map-flight .btn { color: #fff; }

/* Collapsible sidebar groups */
.sb-sect > summary { list-style: none; cursor: pointer; user-select: none; }
.sb-sect > summary::-webkit-details-marker { display: none; }
.sb-caret { margin-left: auto; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; opacity: .7; transition: transform .15s; }
.sb-sect[open] .sb-caret { transform: rotate(90deg); }
.sb-sub { padding-left: 14px; }
.sb-sub .sb-link { font-size: .86rem; padding: 7px 10px; }

/* Stacked cards in a grid column */
.stack { display: grid; gap: 18px; align-content: start; }
.stack > .card { margin: 0; }

/* Rank tracker: one bar per requirement */
.rt-next { font-size: 1.25rem; font-weight: 600; margin: 2px 0 14px; }
.rt-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; }
.rt-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-weight: 500; }
.rt-track { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.rt-track > div { height: 100%; border-radius: 999px; background: var(--brand); }
.rt-points .rt-track > div { background: #1f9d55; }
.rt-flights .rt-track > div { background: #8b5cf6; }
.rt-bar small { display: block; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Period tabs scale to however many periods there are */
.period-tabs { grid-template-columns: repeat(var(--tabs, 5), 1fr); }
.period-panel .g-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 700px) { .period-tabs { grid-template-columns: repeat(4, 1fr); } }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

/* Pilot profile (vAMSYS-style: stats on the left, pilot card and most-visited on the right) */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.profile-main, .profile-side { display: grid; gap: 18px; min-width: 0; }
.profile-main > .card, .profile-side > .card { margin: 0; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-actions .btn { justify-content: center; }
.pilot-card { text-align: center; padding: 22px 18px; }
.pilot-card .avatar { width: 64px; height: 64px; font-size: 1.3rem; margin: 0 auto 10px; }
.pilot-card h1 { font-size: 1.35rem; margin: 0; color: var(--brand); }
.pilot-code { font-size: 1.2rem; font-weight: 700; margin: 4px 0 0; color: var(--brand); letter-spacing: .04em; }
.pilot-rank { font-weight: 600; margin: 6px 0 14px; }
.pilot-card .kv { text-align: left; }
@media (max-width: 1000px) { .profile-layout { grid-template-columns: 1fr; } .profile-side { order: -1; } }
@media (max-width: 600px) { .profile-actions { grid-template-columns: 1fr; } }

/* Book flight map: panel over the map, like vAMSYS */
.map-wrap { position: relative; }
.map-wrap.map-dim .leaflet-tile-pane { filter: invert(.92) hue-rotate(180deg) brightness(.95) contrast(.85) saturate(.35); }
.map-wrap.map-dark #map { background: #0b1220; }
.map-panel { position: absolute; z-index: 500; top: 12px; left: 12px; width: 300px; max-height: calc(100% - 24px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgb(0 0 0 / .25); }
.map-panel[hidden] { display: none; }
.mp-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.mp-head strong { display: block; font-size: 1.05rem; }
.mp-head small { color: var(--muted); }
.mp-close { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.mp-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.mp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-ap { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); min-width: 0; }
.mp-ap strong { display: block; font-size: 1.05rem; }
.mp-ap small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-ap.chosen { border-color: var(--brand); }
.mp-tag { display: block; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }
.mp-tag.arr { color: var(--ok); }
.mp-flights:empty { display: none; }
.mp-flights { border: 1px solid var(--border); border-radius: 10px; padding: 2px 10px 8px; max-height: 240px; overflow-y: auto; }
.mp-btn { width: 100%; justify-content: center; }
.mp-toggle { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.mp-toggle span { display: inline-flex; gap: 8px; align-items: center; }
.mp-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mp-toggle i { width: 34px; height: 18px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.mp-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.mp-toggle input:checked + i { background: var(--brand); }
.mp-toggle input:checked + i::after { transform: translateX(16px); }
.mp-toggle input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.map-panel-open { position: absolute; z-index: 500; top: 12px; left: 12px; }
.map-panel-open[hidden] { display: none; }
.map-filter { display: inline-flex; align-items: center; gap: 8px; }
.map-filter select { width: auto; }
.ring-label { color: #94a3b8; font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; }
.map-flights .btn { color: #fff; }
@media (max-width: 700px) { .map-panel { position: static; width: auto; max-height: none; margin-top: 12px; } }
.profile-main, .profile-side { grid-template-columns: minmax(0, 1fr); }
.period-panel .g-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Flight checks on the PIREP page: mark + word, never colour alone */
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.check-item small { display: block; }
.check-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.check-item.is-ok .check-mark { background: var(--ok-soft); color: var(--ok); }
.check-item.is-failed { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); background: color-mix(in srgb, var(--bad-soft) 45%, transparent); }
.check-item.is-failed .check-mark { background: var(--bad); color: #fff; }
.check-item.is-na { opacity: .6; }
.check-item.is-na .check-mark { background: var(--surface-2); color: var(--muted); }
.checks-table input[type=number] { width: 100px; }

/* Passenger reviews */
.stars { color: #b45309; letter-spacing: .06em; }
.pax-score { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.pax-reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pax-review { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pax-review p { margin: 6px 0; font-style: italic; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stars { color: #fbbf24; } }

/* Book map: airport pins, faint network, highlighted route */
.ap-pin { display: grid !important; place-items: center; border-radius: 50%; background: #f8fafc; color: #0f172a;
  border: 1.5px solid #334155; font-size: 11px; line-height: 1; box-shadow: 0 1px 3px rgb(0 0 0 / .35); cursor: pointer; }
.ap-pin.hub { background: var(--brand); color: #fff; border-color: #fff; }
.ap-pin.here { background: #facc15; color: #111827; border: 2px solid #111827; font-size: 14px; }
.map-dark .ap-pin:not(.here):not(.hub) { background: #cbd5e1; border-color: #0f172a; }
.map-wrap.has-selection .route-line { opacity: .15; }
.mp-ap { position: relative; }
.mp-x { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; line-height: 1; font-size: .85rem; }
#mp-arrival:not(.chosen) .mp-x { display: none; }
.mp-route { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-route[hidden] { display: none; }
.mp-cell { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); min-width: 0; }
.mp-cell.wide { grid-column: 1 / -1; }
.mp-cell strong { display: block; margin-top: 2px; }
.mp-cell .mp-tag { color: var(--muted); }
.mp-cell .map-flight:first-of-type { border-top: 0; }
.mp-info { display: flex; gap: 8px; }
.mp-info .btn { flex: 1; justify-content: center; }
.mp-info .btn[hidden], .mp-jump[hidden] { display: none; }
.mp-jump { background: #6d28d9; border-color: #6d28d9; width: 100%; justify-content: center; }
.mp-jump:hover { background: #5b21b6; }
.kings-past { display: flex; flex-wrap: wrap; gap: 8px; }
tr.row-mine td { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* Flight of the day and streak */
.daily { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.daily > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.daily strong { display: block; font-size: 1.05rem; }
.daily small { color: var(--muted); }
.daily-fotd { background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface)) !important; }
.daily-tag { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.daily-streak { justify-content: flex-start !important; }
.flame { font-size: 1.8rem; }
@media (max-width: 800px) { .daily { grid-template-columns: 1fr; } }
.community-top { margin-bottom: 18px; }
.community-top .card-body { max-height: 190px; overflow-y: auto; }

/* Fuel efficiency bar: plan marker at 100% of a 130% scale */
.fuel-bar { position: relative; height: 12px; margin-top: 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.fuel-bar > div { height: 100%; border-radius: 999px; background: var(--brand); }
.fuel-plan { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }

/* Pilot passport */
.passport-cover { display: flex; gap: 22px; padding: 26px; border-radius: 16px; color: #f8fafc;
  background: radial-gradient(circle at 15% 20%, #1e3a8a, #0b1533 70%); box-shadow: 0 10px 30px rgb(2 6 23 / .35); }
.pc-emblem { flex: none; width: 84px; height: 84px; border-radius: 50%; border: 2px solid #fbbf24; color: #fbbf24;
  display: grid; place-items: center; font-size: 2.2rem; }
.pc-body { flex: 1; min-width: 0; }
.pc-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #fbbf24; }
.passport-cover h1 { margin: 4px 0 0; color: #fff; }
.pc-title { margin: 2px 0 14px; color: #cbd5e1; }
.pc-facts { display: flex; flex-wrap: wrap; gap: 26px; margin: 0 0 14px; }
.pc-facts dt { font-size: .74rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; }
.pc-facts dd { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-next { margin: 0 0 6px; color: #cbd5e1; font-size: .9rem; }
.passport-cover .progress { background: rgb(255 255 255 / .12); border-color: transparent; }
.passport-cover .progress > div { background: #fbbf24; }
.pc-airlines { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pc-airline { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); }
.pc-airline small { display: block; color: var(--muted); }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.stamp { display: grid; gap: 2px; text-align: center; padding: 14px 10px; border: 2.5px double var(--stamp, var(--brand));
  border-radius: 14px; color: var(--stamp, var(--brand)); transform: rotate(var(--tilt, 0deg));
  background: color-mix(in srgb, var(--stamp, var(--brand)) 6%, var(--surface)); }
.stamp-country { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .92rem; }
.stamp-date { font-family: ui-monospace, monospace; font-size: .8rem; }
.stamp-meta, .stamp-airline { font-size: .72rem; color: var(--text-2); }
.milestones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.milestone { padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }  /* not yet reached: muted but readable */
.milestone.got { color: var(--text); border-style: solid; border-color: #d97706; background: color-mix(in srgb, #fbbf24 10%, var(--surface)); }
.milestone small { display: block; color: var(--muted); }
@media (max-width: 600px) { .passport-cover { flex-direction: column; } }
.duel-line { margin: 0 0 10px; }
.duel-line small { display: block; }

/* Airline league */
.league .who { color: var(--text); gap: 10px; }
.league tr.podium-1 td { background: color-mix(in srgb, #fbbf24 10%, transparent); }
.league-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.league-row:last-child { border-bottom: 0; }
.league-place { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.league-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.rating-type { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: .04em; }
.rating-card.is-held { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }

/* Dispatch page */
.dispatch-head h1 { font-size: 1.35rem; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.dh-tags { display: inline-flex; gap: 10px; align-items: center; font-size: .85rem; font-weight: 500; color: var(--muted); }
.dh-times { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; color: var(--muted); }
.dh-times strong { color: var(--text); }
.dh-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: .8rem; color: var(--text-2); background: var(--surface-2); }
.chip .i { width: 13px; height: 13px; }
.dh-details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.dispatch { display: grid; gap: 14px; margin-top: 14px; }
.dispatch > .card { margin: 0; }
.picker-tools { display: inline-flex; gap: 6px; align-items: center; }
.picker-tools .on { color: var(--brand); font-weight: 700; }
#ac-search { width: 100%; margin-bottom: 8px; }
.ac-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.ac-group { margin: 0; padding: 8px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  position: sticky; top: 0; background: var(--surface); }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-top: 1px solid var(--border); margin: 0; }
.ac-item:hover { background: var(--surface-2); }
.ac-item:has(input:checked) { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.ac-item[hidden], .ac-group[hidden] { display: none; }
.ac-reg { font-weight: 700; font-family: ui-monospace, monospace; min-width: 80px; }
.ac-fav { margin-left: auto; background: none; border: 0; font-size: 1.1rem; color: var(--muted); cursor: pointer; }
.ac-fav.on { color: #d97706; }
.ready { border: 2px solid var(--brand); overflow: hidden; }
.ready-head { display: flex; justify-content: space-between; padding: 10px 16px; background: var(--brand); color: #fff; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; }
.ready-head span { display: inline-flex; gap: 8px; align-items: center; }
.ready-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; padding: 16px; }
.ready-grid span { display: block; font-size: .78rem; color: var(--muted); }
.ready-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ready-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 0 16px 16px; }
.ready-actions .btn { justify-content: center; }
.dsec > summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; }
.dsec > summary::-webkit-details-marker { display: none; }
.dsec > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.dsec[open] > summary::after { transform: rotate(180deg); }
.dsec > summary small { display: block; color: var(--muted); }
.dsec-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.dsec > .card-body { border-top: 1px solid var(--border); }
.dispatch-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 16px rgb(0 0 0 / .08); }
@media (max-width: 700px) { .ready-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ready-actions { grid-template-columns: 1fr; } }

/* Booking page */
.booking-map { height: 240px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 14px; background: var(--surface-2); }
.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.booking-main, .booking-side { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.booking-main > .card, .booking-side > .card { margin: 0; }
.bk-label { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bk-big { font-size: 1.15rem; }
.bk-row, .bk-times { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bk-route { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; margin-bottom: 14px; }
.bk-route small { display: block; color: var(--muted); }
.bk-line { position: relative; height: 1px; background: var(--border); }
.bk-line span { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); background: var(--surface); padding: 0 6px; color: var(--muted); }
.bk-times > div { min-width: 90px; }
.bk-times small { display: block; color: var(--muted); }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 18px; }
.bk-grid.two { grid-template-columns: 1fr 1fr; }
.bk-grid small { display: block; }
.bk-grid strong.bad { color: var(--bad); }
.ofp h3 { font-size: .85rem; margin: 18px 0 8px; color: var(--text-2); }
.ofp h3:first-child { margin-top: 0; }
.side-actions { display: grid; gap: 8px; }
.side-actions .btn { justify-content: center; }
.side-actions .net-vatsim, .side-actions .net-ivao { color: #fff; }
.side-actions .net-vatsim { background: #29845a; border-color: #29845a; }
.side-actions .net-ivao { background: #0d2c99; border-color: #0d2c99; }
@media (max-width: 1000px) {
  .booking-layout { grid-template-columns: 1fr; }
  /* On one column the checklist and the Plan / File / Fly buttons come first, the flight details after. */
  .booking-layout > .booking-side { display: contents; }
  .booking-side > .preflight { order: -2; }
  .booking-side > .bk-actions { order: -1; }
}

/* Dispatch sections */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; margin: 6px 0 0;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; }
.switch-row.small { padding: 8px 10px; font-size: .88rem; }
.switch-row input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.switch-row i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch-row input:checked + i { background: var(--brand); }
.switch-row input:checked + i::after { transform: translateX(16px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.sb-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cs-wrap { position: relative; display: block; }
.cs-wrap input { width: 100%; padding-right: 70px; }
.cs-status { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: .78rem; font-weight: 700; }
.cs-status.ok { color: var(--ok); }
.cs-status.bad { color: var(--bad); }
.label-tools { float: right; font-weight: 400; }
.stepper { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; }
.zfw { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.zfw .bad { color: var(--bad); font-weight: 700; }
.toast { position: fixed; top: 16px; right: 16px; z-index: 2000; max-width: 340px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgb(0 0 0 / .2); display: grid; gap: 2px; }
.toast[hidden] { display: none; }
.toast span { color: var(--muted); font-size: .88rem; }
.ac-item { display: flex !important; flex-direction: row !important; }
.ac-item input[type=radio] { width: auto !important; flex: none; margin: 0; }
.ac-item .muted { flex: 1; min-width: 0; }

/* --- Dashboard v3 ------------------------------------------------------------------ */
.dash-hero { position: relative; overflow: hidden; border-radius: 16px; padding: 22px 24px 18px; margin-bottom: 16px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 55%, #0b1220) 0%, #0b1220 70%); }
.dash-hero::after { content: "✈"; position: absolute; right: 18px; bottom: -34px; font-size: 150px; opacity: .06; transform: rotate(-12deg); pointer-events: none; }
.dh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dh-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dh-avatar { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-weight: 800; font-size: 1.1rem;
  background: color-mix(in srgb, var(--brand) 70%, #fff); color: #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / .12); }
.dash-hero h1 { margin: 0; font-size: 1.55rem; line-height: 1.2; color: #fff; }
.dh-kicker { margin: 0 0 2px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .65); }
.dh-sub { margin: 4px 0 0; color: rgb(255 255 255 / .75); font-size: .9rem; }
.dh-sub strong { color: #fff; }
.dh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-hero .dh-primary { background: #fff; color: #0b1220; border-color: #fff; }
.dash-hero .dh-primary:hover { background: #e2e8f0; color: #0b1220; }
.dash-hero .dh-ghost { background: rgb(255 255 255 / .08); color: #fff; border-color: rgb(255 255 255 / .22); }
.dash-hero .dh-ghost:hover { background: rgb(255 255 255 / .16); color: #fff; }
.dh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 2fr); gap: 10px; margin-top: 20px; }
.dh-stats > div { display: grid; align-content: center; padding: 10px 14px; border-radius: 12px; background: rgb(255 255 255 / .07);
  border: 1px solid rgb(255 255 255 / .08); min-width: 0; }
.dh-stats span { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dh-stats small { color: rgb(255 255 255 / .65); font-size: .75rem; }
.dh-rank-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.dh-rank-top strong { flex: 1; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-track { height: 8px; border-radius: 99px; background: rgb(255 255 255 / .14); overflow: hidden; }
.dh-track div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #60a5fa, #34d399); }
.dh-nudge { margin: 12px 0 0; font-size: .85rem; color: #fde68a; }
@media (max-width: 1000px) { .dh-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dh-rank { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .dash-hero { padding: 18px 16px 16px; border-radius: 14px; }
  .dash-hero h1 { font-size: 1.25rem; }
  .dh-actions { width: 100%; } .dh-actions .btn { flex: 1; justify-content: center; }
  .dh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.comm-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.comm-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; min-width: 0; }
.comm-tile:hover { border-color: var(--brand); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.comm-tile > div { display: grid; gap: 2px; min-width: 0; flex: 1; }
.comm-tile small:first-child { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.comm-tile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.comm-ico svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .comm-strip { grid-template-columns: 1fr; gap: 8px; } .comm-tile { padding: 12px 14px; } }

.dash-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dash-main { grid-template-columns: 1fr; } }
.next-flight { border-top: 3px solid var(--brand); }
.nf-head-actions { display: flex; gap: 8px; align-items: center; }
.fotd-card { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface)); }
.fotd-route { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; font-family: var(--mono); font-size: 1.4rem; }
.fotd-line { flex: 1; display: flex; justify-content: center; border-top: 2px dashed var(--border); height: 0; color: var(--brand); }
.fotd-line svg { width: 18px; height: 18px; margin-top: -10px; background: transparent; }
.crown-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.crown { font-size: 1.4rem; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.section-head h2 { margin: 0; font-size: 1.05rem; }
.pirep-strip { grid-template-columns: repeat(5, minmax(170px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.pirep-tile { scroll-snap-align: start; background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border);
  border-left: 4px solid var(--ok); box-shadow: var(--shadow); }
.pirep-tile:hover { color: var(--text) !important; border-color: var(--brand); }
.pirep-tile.st-pending { border-left-color: var(--warn); }
.pirep-tile.st-rejected { border-left-color: var(--bad); }
.pt-status { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.st-pending .pt-status { background: var(--warn-soft); color: var(--warn); }
.st-rejected .pt-status { background: var(--bad-soft); color: var(--bad); }
.pirep-tile .pt-route svg { color: var(--brand); }
.pirep-tile .pt-nums { color: var(--text-2); }
@media (max-width: 760px) { .pirep-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; } }

/* --- Booking page: pre-flight, grouped actions, OFP placeholder ------------------------ */
.preflight { overflow: hidden; }
.pf-steps { list-style: none; margin: 0; padding: 6px 16px 14px; display: grid; gap: 2px; }
.pf-steps li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.pf-steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -6px; width: 2px; background: var(--border); }
.pf-steps li.done:not(:last-child)::before { background: var(--ok); }
.pf-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); border: 2px solid var(--border); color: var(--muted); }
.pf-steps li.done .pf-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.pf-steps strong { display: block; font-size: .92rem; }
.pf-steps small { color: var(--muted); }
.act-groups { display: grid; gap: 16px; }
.act-group { display: grid; gap: 6px; }
.act-group form { margin: 0; }
.act { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 500; text-align: left; cursor: pointer;
  text-decoration: none; transition: border-color .15s, background .15s; }
.act:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--text); text-decoration: none; }
.act > span:not(.net-dot) { flex: 1; }
.act small { color: var(--muted); font-weight: 400; }
.act svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.act-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.act-primary svg { color: #fff; }
.act-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.act-danger { color: var(--bad); }
.act-danger svg { color: var(--bad); }
.act-danger:hover { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.net-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.net-vatsim .net-dot { background: #29845a; }
.net-ivao .net-dot { background: #0d2c99; box-shadow: 0 0 0 1px #6b8cff; }
.ofp-empty .card-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ofp-empty { border: 1px dashed var(--border); box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* --- Staff: manage one pilot -------------------------------------------------------------- */
.pe-head .card-body { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; border-radius: 16px; }
.pe-stats { display: flex; gap: 20px; }
.pe-stats div { display: grid; text-align: right; }
.pe-stats strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.pe-stats small { color: var(--muted); font-size: .75rem; }
.pe-form { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 600px) { .pe-stats { width: 100%; justify-content: space-between; } .pe-stats div { text-align: left; } }
.fpl-box summary { cursor: pointer; color: var(--muted); }
.fpl-box pre { margin: 6px 0 0; padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: .75rem; white-space: pre-wrap; word-break: break-all; user-select: all; }

/* --- Terms and Privacy ------------------------------------------------------------------------ */
.legal { max-width: 820px; margin: 0 auto; }
.legal .card-body { padding: 28px 32px; line-height: 1.65; }
.legal h1 { margin-top: 0; }
.legal h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.legal li { margin: 4px 0; }
@media (max-width: 600px) { .legal .card-body { padding: 20px 18px; } }
.sb-legal { margin: 10px 12px 0; font-size: .75rem; color: var(--shell-muted); }
.sb-legal a { color: var(--shell-muted); }
.site-footer a { color: inherit; text-decoration: underline; }

/* --- Airline subscription ------------------------------------------------------------------ */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .bill-grid { grid-template-columns: 1fr; } }
.bill-status h2 { margin: 4px 0 6px; font-size: 1.5rem; }
.bill-status { border-left: 4px solid var(--ok); }
.bill-status.st-trial { border-left-color: var(--brand); }
.bill-status.st-grace { border-left-color: var(--warn); }
.bill-status.st-expired { border-left-color: var(--bad); }
.act small { color: inherit; opacity: .85; }
.pay-paypal { background: #0070ba; border-color: #0070ba; }
.pay-paypal:hover { background: #005ea6; border-color: #005ea6; }
.billing-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* --- Edit a table row in place ------------------------------------------------------------ */
.row-actions { position: relative; }
.row-actions > * { vertical-align: middle; }
.row-edit { display: inline-block; }
.row-edit > summary { list-style: none; cursor: pointer; }
.row-edit > summary::-webkit-details-marker { display: none; }
.row-edit[open] > summary { background: var(--brand-soft); border-color: var(--brand); }
.row-edit > form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: min(620px, 92vw);
  padding: 16px; text-align: left; white-space: normal; box-shadow: 0 12px 32px rgb(15 23 42 / .18); }
.row-edit-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 12px; }
@media (max-width: 700px) { .row-edit > form { position: fixed; left: 8px; right: 8px; top: 72px; width: auto; max-height: 80vh; overflow: auto; } }

/* Home page: three ways in, airline search, pricing */
.home-hero .hero-inner { padding-bottom: 64px; }
.paths { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin-top: 8px; max-width: 1040px; }
.path { background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .12); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 10px; backdrop-filter: blur(6px); }
.path h2 { color: #fff; font-size: 1.15rem; margin: 0; }
.path p { color: #b6c2d9; font-size: .92rem; margin: 0; flex: 1; }
.path-main { background: linear-gradient(160deg, rgb(37 99 235 / .45), rgb(37 99 235 / .12)); border-color: rgb(96 165 250 / .45); }
.path-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgb(255 255 255 / .1); color: #fff; }
.path .btn-ghost { background: rgb(255 255 255 / .06); color: #fff; border-color: rgb(255 255 255 / .2); }
.path .btn-ghost:hover { background: rgb(255 255 255 / .14); }
.btn-block { width: 100%; justify-content: center; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgb(34 197 94 / .6); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0); } 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.home-section { margin: 8px 0 48px; }
.airline-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px 8px 6px 14px; margin-bottom: 18px; box-shadow: var(--shadow); }
.airline-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.airline-search .i { color: var(--muted); flex: none; }
.airline-search input { border: 0; background: transparent; box-shadow: none; flex: 1; min-width: 0; font-size: 1rem; padding: 8px 0; }
.airline-search input:focus { outline: none; box-shadow: none; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 20px 64px;
  position: relative; display: flex; flex-direction: column; gap: 4px; }
.steps li::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; display: grid; place-items: center; }
.steps span { color: var(--text-2); font-size: .92rem; }
.pricing { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; flex-wrap: wrap; }
.pricing h2 { font-size: 2rem; margin: 6px 0; }
.pricing h2 small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.pricing p { margin: 0; max-width: 560px; }
.pricing-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow-dark { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
@media (max-width: 860px) {
  .paths { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
}
.grid > [hidden] { display: none !important; }
.networks { padding: 28px; }
.networks h2 { margin: 6px 0 8px; }
.networks-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.networks-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.networks-list .i { color: var(--ok); flex: none; margin-top: 3px; }
/* Claim screenshots (staff) */
.claim-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.claim-shots img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.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; }
tr.row-highlight td { background: var(--brand-soft); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot, .slot button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); font: inherit; color: var(--text); width: 100%; font-variant-numeric: tabular-nums; }
.slot.free { padding: 0; border: 0; }
.slot.free button { cursor: pointer; border-style: dashed; }
.slot.free button:hover, .slot.free button:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.slot.taken { background: var(--bg); color: var(--muted); }
.slot.mine { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.slot small { font-size: .75rem; color: inherit; }
.insignia { width: 72px; height: 33px; flex: none; display: block; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px 18px; align-items: stretch; }
.rank-card { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; height: 100%; box-sizing: border-box; }
.rank-next-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rank-next-bar { height: 10px; margin-bottom: 16px; }
.rank-stats .card > .small { display: block; margin-top: 2px; }
.rank-card.current { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rank-card strong { display: block; }
.rank-card .small { color: var(--muted); display: block; }
.rank-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; align-items: stretch; }
.rank-stats > .card { margin: 0; }
.rank-stats b.rank-name { font-size: 1.1rem; line-height: 1.3; }
.rank-stats .card { padding: 14px 16px; }
.rank-stats b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.ok-text { color: var(--ok); }
fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
fieldset.plain legend { padding: 0; margin-bottom: 4px; }

/* "My flight" in the sidebar and the next-flight bar on the dashboard: the way back to a booked flight. */
.sb-myflight .sb-count { font-family: var(--mono, ui-monospace, monospace); letter-spacing: .02em; }
.sb-count.live { background: var(--ok); }
.sb-count .live-dot { width: 6px; height: 6px; margin-right: 4px; background: #fff; }
.nextflight-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--border);
  border-left: 4px solid var(--brand); border-radius: 12px; background: var(--card, var(--surface)); color: inherit; text-decoration: none; }
.nextflight-bar:hover { border-color: var(--brand); }
.nfb-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); flex: none; }
.nfb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nfb-text small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.nfb-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .nextflight-bar .btn { display: none; } }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.decision-notice { align-items: center; }
.decision-notice .muted { color: inherit; opacity: .85; }
.first-steps { margin-bottom: 16px; }
.first-steps .pf-steps { padding: 4px 0 0; }
.first-steps .pf-steps a { color: var(--brand); text-decoration: none; }
.first-steps .pf-steps a:hover { text-decoration: underline; }

.band-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.band-grid textarea { width: 100%; min-height: 120px; font-size: .85rem; }
/* Scoring & PIREP rules page */
.rule-table td { vertical-align: top; }
.rule-table .num { text-align: right; white-space: nowrap; }
.rule-pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.rule-pts.pos { color: var(--ok); }
.rule-pts.neg { color: var(--bad); }
.rule-h { display: flex; gap: 8px; align-items: center; font-size: 1rem; margin: 20px 0 8px; }
.rule-h:first-child { margin-top: 0; }
.rule-list { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.rule-groups { margin-top: 18px; }
.rule-group { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.rule-group > summary { padding: 12px 16px; cursor: pointer; }
.rule-group-body { padding: 4px 16px 16px; }
.td-counted td { background: var(--brand-soft); font-weight: 600; }

/* Getting started (new-airline setup) */
.setup-steps { display: grid; gap: 14px; }
.setup-step .card-head h2 { display: flex; align-items: center; gap: 8px; }
.setup-step.is-done { opacity: .85; }
.setup-step.is-done .card-body > p.muted { margin-bottom: 8px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist li.done { color: var(--muted, #64748b); text-decoration: line-through; }

/* Public pages: pricing, FAQ, contact, comparison */
.center-head { text-align: center; justify-content: center; }
.center-head p { margin-left: auto; margin-right: auto; }
.pricing-card { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.pricing-card .card-body { padding: 34px 32px; }
.price-big { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0; }
.price-big small { font-size: 1rem; font-weight: 600; color: var(--muted, #64748b); }
.included { list-style: none; padding: 0; margin: 26px 0 0; text-align: left; display: grid; gap: 10px; }
.included li { display: flex; gap: 10px; align-items: flex-start; }
.included .i { color: var(--ok, #16a34a); flex: none; margin-top: 3px; }
.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 20px; list-style-position: inside; }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted, #475569); line-height: 1.6; }
.contact-card { max-width: 720px; margin: 0 auto; }
.compare { width: 100%; border-collapse: collapse; }
.compare th, .compare td { padding: 12px 14px; border-bottom: 1px solid var(--border, #e2e8f0); text-align: left; vertical-align: top; }
.compare th:first-child { width: 34%; }
.compare .yes { color: var(--ok, #16a34a); font-weight: 600; }
.compare .no { color: var(--muted, #64748b); }
.compare th, .compare td { white-space: normal; }
.compare tbody th { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text, #0f172a); }
@media (max-width: 640px) { .compare { min-width: 620px; } .compare th:first-child { width: 150px; } }
