/* Raymond Musa: aviation theme. Tokens first, dark mode via media query or data-theme. */
:root {
    --bg: #f6f9fc;
    --surface: #ffffff;
    --text: #0e1b2c;
    --muted: #5a6b80;
    --border: #d9e2ec;
    --primary: #0b3d78;
    --primary-contrast: #ffffff;
    --accent: #1e90e6;
    --hero-from: #0b3d78;
    --hero-to: #1e90e6;
    --shadow: 0 1px 2px rgba(14, 27, 44, .06), 0 6px 20px rgba(14, 27, 44, .06);
    --radius: 14px;
    --aviation: #0b57a4; --aviation-contrast: #ffffff; --aviation-soft: #e4f0fb; --aviation-accent: #1e90e6;
    --software: #0f766e; --software-contrast: #ffffff; --software-soft: #e0f3f0; --software-accent: #0d9488;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a1220; --surface: #121c2e; --text: #e6edf6; --muted: #9bb0c9; --border: #243248;
        --primary: #5ab0f5; --primary-contrast: #06121f; --accent: #5ab0f5;
        --hero-from: #0e2a52; --hero-to: #1b6fb8; --shadow: 0 1px 2px rgba(0,0,0,.4); --aviation: #6db6f5; --aviation-contrast: #06121f; --aviation-soft: #10243d; --aviation-accent: #5ab0f5; --software: #4fd1c0; --software-contrast: #04161a; --software-soft: #0e2a2c; --software-accent: #4fd1c0;
    }
}

:root[data-theme="dark"] {
    --bg: #0a1220; --surface: #121c2e; --text: #e6edf6; --muted: #9bb0c9; --border: #243248;
    --primary: #5ab0f5; --primary-contrast: #06121f; --accent: #5ab0f5;
    --hero-from: #0e2a52; --hero-to: #1b6fb8; --shadow: 0 1px 2px rgba(0,0,0,.4); --aviation: #6db6f5; --aviation-contrast: #06121f; --aviation-soft: #10243d; --aviation-accent: #5ab0f5; --software: #4fd1c0; --software-contrast: #04161a; --software-soft: #0e2a2c; --software-accent: #4fd1c0;
}

html, body { background: var(--bg); color: var(--text); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6; margin: 0; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-row { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--primary); font-size: 1.1rem; }
.nav-links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav-links a:hover { background: var(--bg); }
.nav-links a.active { background: var(--primary); color: var(--primary-contrast); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions form.inline { display: inline; margin: 0; }
.lang { font-size: .8rem; font-weight: 600; padding: 4px 6px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.lang.active { color: var(--primary-contrast); background: var(--primary); }
.theme-toggle, .btn-ghost { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer; text-decoration: none; font: inherit; font-size: .9rem; }
.theme-toggle:hover, .btn-ghost:hover { border-color: var(--accent); }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 1020px) {
    .nav-burger { display: block; margin-left: auto; font-size: 1.6rem; cursor: pointer; }
    .nav-links { display: none; flex-basis: 100%; flex-direction: column; order: 5; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-actions { order: 4; }
}

/* Main + hero */
.site-main { min-height: 70vh; }
.hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 72px 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 12px; }
.hero p { max-width: 640px; font-size: 1.15rem; opacity: .95; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.btn { display: inline-block; padding: 10px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 2px solid transparent; }
.btn-primary-solid { background: #fff; color: #0b3d78; }
.btn-outline { border-color: rgba(255,255,255,.7); color: #fff; }

.section { padding: 48px 0; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); display: block; }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 8px; color: var(--primary); }
.card p { margin: 0; color: var(--muted); }
.page-title { padding: 40px 0 8px; }
.notice { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 24px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; }

#blazor-error-ui { background: lightyellow; color: #000; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Tools */
.hint { color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 16px 0; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); font: inherit; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.tool-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 40px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.field input, .field select { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.results { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 20px; }
.result { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.result span { color: var(--muted); font-size: .85rem; }
.result strong { font-size: 1.4rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.result.total { border-color: var(--accent); }

/* Quiz + forms + tables */
.btn-solid { background: var(--primary); color: var(--primary-contrast); }
.btn-ghost-solid { border-color: var(--border); color: var(--text); background: transparent; }
.q-text { margin-top: 0; font-size: 1.3rem; }
.options { display: grid; gap: 10px; margin: 16px 0; }
.option { text-align: left; font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); cursor: pointer; }
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; }
.option.correct { border-color: #1a9e57; background: color-mix(in srgb, #1a9e57 18%, var(--bg)); }
.option.wrong { border-color: #d6453d; background: color-mix(in srgb, #d6453d 18%, var(--bg)); }
.feedback.ok { color: #1a9e57; }
.feedback.bad { color: #d6453d; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td.actions { white-space: nowrap; text-align: right; }
.field textarea { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); margin-bottom: 8px; }
.answer-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.answer-row .grow { flex: 1; min-width: 160px; font: inherit; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.check { display: block; margin: 12px 0; }
details.tool-body { margin: 16px 0; }
details summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }

/* Materials */
.subject { margin-bottom: 20px; }
.subject h2 { margin-top: 0; color: var(--primary); }
.materials { list-style: none; padding: 0; margin: 0 0 12px; }
.materials li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.badge { font-size: .72rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

/* ICAO */
.hero.small { padding: 48px 0; }
.table tr.highlight td { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.dialogue { margin: 16px 0; padding: 4px 18px; border-left: 4px solid var(--accent); background: var(--bg); border-radius: 0 10px 10px 0; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.tips li { margin-bottom: 8px; }

/* Blog */
.post-card { margin-bottom: 16px; }
.prose { max-width: 760px; }
.prose img { max-width: 100%; height: auto; }
.prose pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.prose code { font-family: ui-monospace, Consolas, monospace; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; }
.preview { border-top: 1px dashed var(--border); padding-top: 12px; }

/* Contact + messages + footer */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .field { margin-bottom: 12px; }
.msg.handled { opacity: .65; }
.msg-body { white-space: pre-wrap; }
.badge.warn { background: #d6453d; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* Software */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; font-size: .9rem; }

/* Weight & balance */
.wb-chart { width: 100%; max-width: 520px; margin-top: 16px; }
.result.total.good { border-color: #1a9e57; }
.result.total.good strong { color: #1a9e57; }
.result.total.bad { border-color: #d6453d; }
.result.total.bad strong { color: #d6453d; }
.warn-note { margin-bottom: 14px; }

/* Exam, review, progress, certificate, glossary */
.exam-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; position: sticky; top: 60px; background: var(--bg); z-index: 5; }
.timer { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary); }
.timer.low { color: #d6453d; }
.navigator { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.nav-num { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-weight: 600; }
.nav-num.done { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.nav-num.current { outline: 2px solid var(--accent); }
.option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
.review-item h3 { margin-top: 0; }
.bars { display: grid; gap: 8px; margin: 12px 0 24px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 110px; gap: 10px; align-items: center; }
.bar { background: var(--border); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill.low { background: #d6453d; } .bar-fill.mid { background: #e0a31a; } .bar-fill.high { background: #1a9e57; }
.bar-value { color: var(--muted); font-size: .85rem; text-align: right; }
.glossary-search { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.glossary-search input, .glossary-search select { font: inherit; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.glossary-search input { flex: 1; min-width: 200px; }
.glossary dt { font-weight: 700; margin-top: 16px; color: var(--primary); }
.glossary dd { margin: 4px 0 0; }
.certificate { max-width: 760px; margin: 24px auto 48px; padding: 48px 32px; text-align: center; border: 6px double var(--primary); border-radius: 8px; background: var(--surface); }
.cert-brand { letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cert-name { font-size: 2rem; font-weight: 700; border-bottom: 1px solid var(--border); display: inline-block; min-width: 260px; padding: 0 16px; margin: 8px 0; }
.cert-score { font-size: 1.2rem; font-weight: 600; }
.cert-controls { margin: 16px 0; max-width: 420px; }
@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: #fff !important; }
    .certificate { border-color: #0b3d78; box-shadow: none; color: #000; background: #fff; }
}

/* Audio practice */
.btn.rec { background: #d6453d; color: #fff; }
.check.inline { display: inline-block; margin-left: 12px; }
audio { max-width: 100%; }

/* Booking, courses, groups, testimonials, how it works */
.btn-small { padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.nav-links a { font-size: .95rem; padding: 8px 9px; }
.slot-day { margin: 24px 0 8px; font-size: 1.1rem; color: var(--primary); }
.slots { display: flex; flex-wrap: wrap; gap: 10px; }
.slot { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; text-decoration: none; color: var(--text); min-width: 130px; }
.slot:hover { border-color: var(--accent); }
.weekdays { margin: 8px 0; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 4px 0; }
.results-grid th, .results-grid td { white-space: nowrap; }
.status-done td:not(:first-child), td.status-done { color: #1a9e57; }
.status-overdue td:not(:first-child), td.status-overdue { color: #d6453d; }
.signup-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
.quote blockquote { margin: 0 0 10px; font-style: italic; }
.quote figcaption { color: var(--muted); }
.steps li { margin-bottom: 8px; }

/* Dev tools + client area */
textarea.code, input.code { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.matches code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.badge.status-done { background: #1a9e57; } .badge.status-review { background: #e0a31a; } .badge.status-inprogress { background: var(--accent); } .badge.status-planned { background: var(--muted); }

/* Search, stats */
.icon-link { text-decoration: none; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); }
.icon-link:hover { border-color: var(--accent); }
.results-list { list-style: none; padding: 0; }
.results-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 12px 0 24px; border-bottom: 1px solid var(--border); }
.daybar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.daybar span { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; }
.small-text { font-size: .8rem; word-break: break-all; }

/* Admin overview, settings, audit, errors */
.admin-groups { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.admin-group { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: .9rem; }
.admin-group.active { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.card .big { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 4px 0; }
.alert-card { border-color: #d6453d; }
.setting { margin-bottom: 18px; }
.setting .default { margin-left: 8px; opacity: .8; }
.nowrap { white-space: nowrap; }
pre.code { overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: .8rem; white-space: pre-wrap; }
.error-item summary { cursor: pointer; }

/* Study, readiness, flashcards, print sheets, import */
.study-badge { margin: 8px 0; }
.goal-bar { height: 14px; margin: 8px 0 16px; }
.goal-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 24px; }
.goal-form .field { max-width: 220px; }
.badge.ready-ready { background: #1a9e57; } .badge.ready-almost { background: #e0a31a; } .badge.ready-notyet { background: #d6453d; } .badge.ready-notenoughdata { background: var(--muted); }
.flash { max-width: 640px; }
.flash:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-face { min-height: 160px; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 24px; margin: 16px 0; border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.face-label { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--muted); margin: 0 0 8px; }
.face-text { font-size: 1.4rem; font-weight: 600; white-space: pre-line; margin: 0; }
.error-list { color: #d6453d; }
.print-sheet { max-width: 800px; }
.print-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.print-questions > li { margin-bottom: 14px; break-inside: avoid; }
.print-options { list-style: none; padding-left: 12px; margin: 4px 0; }
.print-options li.right { font-weight: 700; }
.print-glossary dt { break-after: avoid; }
@media print { .print-sheet { max-width: none; } .print-glossary { columns: 2; column-gap: 24px; } .bar-fill, .badge { print-color-adjust: exact; } }

/* Assessments and pictures */
.picture { margin: 12px 0; }
.picture svg { width: 100%; max-width: 520px; height: auto; border: 1px solid var(--border); border-radius: 10px; display: block; }
.search-input { font: inherit; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); margin-left: 8px; min-width: 220px; }
.share-link { width: 100%; max-width: 640px; font: inherit; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.levelbar { display: inline-block; width: 100%; min-width: 90px; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.levelbar span { display: block; height: 100%; background: var(--accent); }
.levelbar-cell { width: 35%; }
.report-table tr.highlight td { background: color-mix(in srgb, #d6453d 10%, transparent); }
@media print { .levelbar span { print-color-adjust: exact; } .report { max-width: none; } }

/* Invoices */
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.line-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.line-row .grow, .line-row .num-in { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.line-row .grow { flex: 1; min-width: 200px; }
.line-row .num-in { width: 110px; }
.num { text-align: right; }
.invoice-wrap { max-width: 860px; }
.invoice { position: relative; background: #fff; color: #111; padding: 40px; border: 1px solid var(--border); border-radius: 6px; line-height: 1.45; }
.invoice h1 { margin: 0 0 8px; font-size: 1.8rem; }
.invoice h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #555; margin: 0 0 4px; }
.invoice-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.seller-name { font-size: 1.15rem; }
.invoice-meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 16px; margin: 0; }
.invoice-meta dt { color: #555; } .invoice-meta dd { margin: 0; font-weight: 600; text-align: right; }
.invoice-customer { margin-bottom: 24px; }
.invoice table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.invoice th, .invoice td { padding: 6px 8px; border-bottom: 1px solid #ddd; text-align: left; }
.invoice th.num, .invoice td.num { text-align: right; }
.invoice tfoot td { font-weight: 700; border-top: 2px solid #111; border-bottom: 0; }
.invoice-totals { max-width: 420px; margin-left: auto; }
.invoice-topay { font-size: 1.15rem; text-align: right; }
.invoice-small { font-size: .85rem; color: #444; }
.invoice-foot { margin-top: 28px; border-top: 1px solid #ddd; padding-top: 10px; font-size: .8rem; color: #555; }
.invoice-stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-20deg); font-size: 5rem; font-weight: 800; color: rgba(214, 69, 61, .16); letter-spacing: .1em; pointer-events: none; }
@media print { .invoice { border: 0; padding: 0; } .invoice-wrap { max-width: none; } .invoice-stamp { print-color-adjust: exact; } }

/* ---- Accessibility ---- */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 2000; background: var(--primary); color: var(--primary-contrast); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
.site-main:focus { outline: none; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#blazor-error-ui .dismiss { background: none; border: 0; font: inherit; color: inherit; }
/* The menu checkbox stays focusable: on small screens it sits on top of the burger icon, invisible but reachable by keyboard. */
@media (max-width: 1020px) {
    .nav-toggle { display: block; position: absolute; right: 16px; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
    .nav-row { position: relative; }
    .nav-burger { min-width: 44px; min-height: 44px; text-align: center; line-height: 44px; border-radius: 8px; }
    .nav-toggle:focus-visible + .nav-burger { outline: 3px solid var(--accent); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Comments */
.comment { border-left: 3px solid var(--border); padding: 4px 0 4px 14px; margin: 14px 0; }
.comment-head { margin: 0 0 2px; }
.comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip.active { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }

/* ================= Design v2: two worlds (aviation and software) ================= */
.zone-aviation { --primary: var(--aviation); --primary-contrast: var(--aviation-contrast); --accent: var(--aviation-accent); --zone-soft: var(--aviation-soft); --zone-bar: linear-gradient(90deg, #0b57a4, #1e90e6); }
.zone-software { --primary: var(--software); --primary-contrast: var(--software-contrast); --accent: var(--software-accent); --zone-soft: var(--software-soft); --zone-bar: linear-gradient(90deg, #0f766e, #2dd4bf); }
.zone-neutral { --zone-soft: transparent; --zone-bar: linear-gradient(90deg, #0b57a4 50%, #0f766e 50%); }

h1, h2, h3 { letter-spacing: -.01em; }
.zone-software h1, .zone-software h2 { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: -.02em; }
.zone-software .page-title h1::before { content: "> "; color: var(--accent); }
.zone-aviation .page-title h1::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 10px; border-radius: 4px; background: linear-gradient(90deg, #0b57a4, #1e90e6); }

/* Header */
.site-header { box-shadow: 0 1px 0 var(--border), 0 8px 24px -16px rgba(14, 27, 44, .25); }
.site-header::before { content: ""; display: block; height: 4px; background: var(--zone-bar); }
.brand { font-size: 1.15rem; letter-spacing: -.01em; }
.nav-links { align-items: center; }
.nav-group { position: relative; }
.nav-group-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.nav-group-title .dot { width: 10px; height: 10px; border-radius: 50%; }
.nav-aviation .dot { background: linear-gradient(135deg, #0b57a4, #1e90e6); }
.nav-software .dot { background: linear-gradient(135deg, #0f766e, #2dd4bf); border-radius: 3px; }
.nav-group.current .nav-group-title { background: var(--zone-soft); }
.nav-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(14, 27, 44, .35); padding: 8px; z-index: 30; }
.nav-sub a { display: block; }
.nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub { display: block; }
.nav-aviation .nav-sub a.active { background: var(--aviation); color: var(--aviation-contrast); }
.nav-software .nav-sub a.active { background: var(--software); color: var(--software-contrast); }
@media (max-width: 1020px) {
    .nav-group { width: 100%; }
    .nav-sub { display: block; position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 18px; min-width: 0; }
}

/* Page background tint per world */
.zone-aviation .site-main, .zone-software .site-main { background: linear-gradient(180deg, var(--zone-soft) 0, transparent 360px); }
.zone-aviation .page-title { border-left: 6px solid var(--accent); padding-left: 16px; margin-top: 24px; }
.zone-software .page-title { border-left: 6px solid var(--accent); padding-left: 16px; margin-top: 24px; }

/* Heroes */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #061a3a, #0b57a4); padding: 84px 0; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 44px 44px;
    -webkit-mask-image: linear-gradient(120deg, transparent 10%, #000 90%); mask-image: linear-gradient(120deg, transparent 10%, #000 90%); }
.hero > .wrap { position: relative; z-index: 1; }
.zone-software .hero { background: linear-gradient(135deg, #07161b, #0f766e); }
.zone-software .hero::after { background-image: radial-gradient(rgba(153, 246, 228, .35) 1.2px, transparent 1.4px); background-size: 22px 22px; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); letter-spacing: -.03em; }
.hero p { opacity: 1; color: #e8f1fb; }
.hero .kicker, .kicker { letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; font-weight: 700; color: #bfe0ff; margin: 0 0 12px; }
.hero-home { background: linear-gradient(115deg, #061a3a 0%, #0b57a4 52%, #0f766e 100%); padding: 110px 0 96px; }
.hero-home .lead { font-size: 1.25rem; max-width: 680px; }
.hero.small { padding: 56px 0; }

.btn { transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.45); }
.btn-aviation { background: #cfe8ff; color: #06264d; }
.btn-software { background: #99f6e4; color: #042f2e; }
.btn-solid:hover { filter: brightness(1.1); }

/* Two big world panels on the home page */
.split { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.panel { position: relative; overflow: hidden; border-radius: 22px; padding: 36px 32px; color: #fff; box-shadow: 0 24px 50px -24px rgba(14, 27, 44, .55); }
.panel h2 { margin: 12px 0 8px; font-size: 1.9rem; }
.panel p { color: #eaf3fb; }
.panel-aviation { background: linear-gradient(145deg, #061a3a, #0b57a4); }
.panel-aviation::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: linear-gradient(200deg, #000, transparent 70%); mask-image: linear-gradient(200deg, #000, transparent 70%); }
.panel-software { background: linear-gradient(145deg, #07161b, #0f766e); font-family: inherit; }
.panel-software h2 { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.panel-software::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6; background-image: radial-gradient(rgba(153,246,228,.4) 1.2px, transparent 1.4px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(200deg, #000, transparent 70%); mask-image: linear-gradient(200deg, #000, transparent 70%); }
.panel > * { position: relative; z-index: 1; }
.panel-icon { width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.14); display: grid; place-items: center; color: #fff; }
.panel-icon.mono { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 1.1rem; }
.panel-links { list-style: none; padding: 0; margin: 16px 0 24px; display: grid; gap: 6px; }
.panel-links a { color: #fff; text-decoration: none; font-weight: 600; }
.panel-links a::before { content: "→ "; opacity: .7; }
.panel-links a:hover { text-decoration: underline; }
.strip { padding-top: 8px; }

/* Cards */
.card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; border-top: 4px solid var(--accent); }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -18px rgba(14, 27, 44, .45); }
.zone-aviation-card { border-top-color: #1e90e6; }
.zone-software-card { border-top-color: #0d9488; }
.zone-software-card h3 { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; }
.card h3 { color: var(--primary); }
.card .icon { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.tool-body { border-radius: 18px; }
.tool-body, .result { transition: border-color .15s ease; }
.result strong { letter-spacing: -.01em; }
.result.bad { border-color: #d6453d; }
.result.bad strong { color: #d6453d; }

/* Tabs as soft pills */
.tabs { gap: 4px; }
.tab { border-radius: 10px 10px 0 0; }
.tab:hover { background: var(--zone-soft); }
.tab.active { background: var(--zone-soft); }

/* Section titles */
.section h2, .wrap > section > h2 { position: relative; padding-bottom: 8px; }
.section h2::after, .wrap > section > h2::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 8px; border-radius: 3px; background: var(--accent); }

/* Steps, facts, FAQ */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); counter-reset: step; list-style: none; padding: 0; margin: 20px 0; }
.steps li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 54px 20px 20px; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); position: absolute; left: 20px; top: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-contrast); font-weight: 700; }
.zone-software .steps li::before { border-radius: 8px; font-family: ui-monospace, Consolas, monospace; }
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px; margin-bottom: 10px; }
.faq summary { padding: 10px 0; margin: 0; }
.faq p { margin: 0 0 12px; color: var(--muted); }
.code-sample { background: #07161b; color: #d7fff6; border-radius: 14px; padding: 18px 20px; overflow-x: auto; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9rem; line-height: 1.55; box-shadow: var(--shadow); }
.code-sample .c { color: #6fb7ab; }
.code-sample .k { color: #99f6e4; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table thead th { background: var(--zone-soft); }
.data-table tfoot th, .data-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); }

/* Footer */
.site-footer { background: var(--surface); margin-top: 64px; padding: 40px 0 28px; }
.footer-grid { display: grid !important; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.footer-grid strong { color: var(--text); }
.footer-brand { font-size: 1.1rem; }
.footer-grid p { margin: 6px 0; }
/* Training tools, what-if bars, briefing sheet */
.card-button { text-align: left; font: inherit; cursor: pointer; width: 100%; }
.picture-frame { max-width: 460px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); margin: 8px 0 12px; }
.picture-frame svg, .picture { display: block; width: 100%; height: auto; }
.bars { display: grid; gap: 8px; margin: 12px 0 24px; }
.bar-row { display: grid; grid-template-columns: 56px 1fr 72px; gap: 10px; align-items: center; }
.bar-label, .bar-value { font-variant-numeric: tabular-nums; font-size: .9rem; }
.bar-value { text-align: right; }
.bar-track { position: relative; height: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.bar { height: 100%; background: var(--accent); border-radius: 9px; transition: width .2s ease; }
.bar.bad { background: #d6453d; }
.bar-limit { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--text); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.briefing { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-top: 16px; }
.briefing h2 { margin-top: 0; }
.briefing .raw { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.briefing .ok { color: #1a9e57; }
.briefing .bad { color: #d6453d; }
@media print {
    .site-header, .site-footer, .skip-link, .tabs, .no-print, .page-title, .hint:not(.briefing .hint), #blazor-error-ui { display: none !important; }
    body, .site-main, .zone { background: #fff !important; color: #000 !important; }
    .tool-body { border: 0; box-shadow: none; padding: 0; }
    .briefing { border: 0; padding: 0; }
    .briefing .ok, .briefing .bad { color: #000; }
    .table-wrap, .data-table { page-break-inside: avoid; }
}

/* Developer tools round 2, cheat sheets, quizzes */
.diff { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; overflow-x: auto; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; line-height: 1.5; white-space: pre; }
.diff span { display: block; padding: 0 6px; }
.diff-add { background: color-mix(in srgb, #1a9e57 22%, transparent); }
.diff-del { background: color-mix(in srgb, #d6453d 22%, transparent); }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 46px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.color-row input.code { flex: 1; }
.contrast-sample { margin: 14px 0; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--border); font-size: 1.15rem; }
.metar-raw { font-family: ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 12px 0; }
.hold-frame { max-width: 360px; color: var(--text); background: var(--surface); }
.snippet .code-sample { margin: 12px 0; white-space: pre; }
.cheat-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cheat-grid .wide { grid-column: 1 / -1; }
.cheat .tool-body { margin-bottom: 0; }
.cheat th[scope=row] { font-weight: 600; width: 38%; }
.alphabet { display: grid; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.alphabet strong { display: inline-block; width: 1.4em; color: var(--primary); }
@media print { .cheat-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .cheat .tool-body { break-inside: avoid; padding: 6px; } .cheat h2 { font-size: 1rem; margin: 0 0 4px; } .data-table th, .data-table td { padding: 2px 6px; font-size: .85rem; } }

/* Header fit at desktop widths: one line, long user names are cut short */
.nav-row { flex-wrap: nowrap; gap: 12px; }
.nav-links { flex-wrap: nowrap; min-width: 0; }
.nav-links a { white-space: nowrap; }
.nav-actions { flex-shrink: 0; gap: 6px; }
.nav-actions .btn-ghost { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .nav-actions .btn-ghost[href="Account/Manage"] { max-width: 110px; } }
@media (max-width: 1020px) { .nav-row { flex-wrap: wrap; } .nav-links { flex-wrap: wrap; } }
.site-header .wrap { max-width: 1280px; }
.nav-links a { padding: 8px 10px; }
.nav-group-title { gap: 6px; }
@media (max-width: 1020px) { .nav-links a { padding: 8px 12px; } }

/* Study guides, tool groups, radio tools */
.lead-text { font-size: 1.15rem; max-width: 760px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.guide-topic { margin-bottom: 18px; }
.guide-points { padding-left: 1.2em; margin: 0 0 12px; }
.guide-points li { margin-bottom: 8px; max-width: 80ch; }
.tab-group { margin-bottom: 4px; }
.tab-group-label { display: block; margin-top: 12px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tab-group .tabs { margin: 4px 0 0; border-bottom: 0; }
.tab-group .tab { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; border-bottom-width: 1px; background: var(--surface); }
.tab-group .tab.active { border-color: var(--accent); background: var(--zone-soft); color: var(--primary); }
.spelled { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.spelled-word { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 1.2rem; }
.spelled-word.wide { font-size: 1.3rem; }
.radio-line { font-family: ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-wrap: anywhere; }
.pitot-diagram { max-width: 420px; }
.nowrap { white-space: nowrap; }
.cheat td code { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-value { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; overflow-wrap: anywhere; }

/* Weather: flight category colours (always paired with the category text, so colour is never the only signal) */
.badge.cat-vfr { background: #1a7f4b; } .badge.cat-mvfr { background: #2563c9; } .badge.cat-ifr { background: #c0392b; } .badge.cat-lifr { background: #8e2a8e; }
.result.cat-vfr { border-left: 4px solid #1a7f4b; } .result.cat-mvfr { border-left: 4px solid #2563c9; } .result.cat-ifr { border-left: 4px solid #c0392b; } .result.cat-lifr { border-left: 4px solid #8e2a8e; }
button.result { font: inherit; color: inherit; text-align: left; cursor: pointer; background: var(--surface, transparent); }
button.result.active { outline: 2px solid var(--accent); }
.sparkline { width: 100%; height: 60px; color: var(--accent); display: block; }
.stale { color: #d6453d; }

/* ---- Teaching diagrams (aerofoil, forces, stability, drag, engine, systems, walk-around, instrument panel) ---- */
.diagram { display: block; width: 100%; max-width: 640px; height: auto; margin: 8px auto; color: var(--text); }
.diagram.walk { max-width: 460px; margin: 0; }
.diagram text, .gauge text { fill: currentColor; font-family: inherit; }
.d-text { font-size: 11px; fill: currentColor; }
.d-text.drag, .a-curve.drag { fill: #d6453d; }
.d-label { font-size: 10px; font-weight: 600; fill: var(--text); pointer-events: none; }
.d-arrowhead { fill: var(--muted); }

.a-axis { stroke: var(--muted); stroke-width: 1; fill: none; }
.a-horizon { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 4; fill: none; }
.a-foil { fill: var(--aviation-soft); stroke: var(--aviation); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.a-cp { fill: #d6453d; }
.a-wind { stroke: var(--accent); stroke-width: 2; fill: none; }
.a-wind.faint, .a-curve.faint { opacity: .35; }
.a-curve { fill: none; stroke: var(--aviation-accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.a-curve.drag { stroke: #d6453d; fill: none; }
.a-curve.parasite { stroke: #e0a31a; }
.a-curve.induced { stroke: #1a9e57; }
.a-curve.unstable { stroke: #d6453d; }
.a-marker { fill: var(--aviation-accent); stroke: var(--surface); stroke-width: 2; }
.a-marker.drag { fill: #d6453d; }
.a-stall { stroke: #d6453d; stroke-width: 1.5; fill: none; }
.a-stall.dashed { stroke-dasharray: 5 4; stroke: var(--muted); }

.f-plane { fill: var(--muted); stroke: none; }
.f-arrow { stroke-width: 3; fill: none; stroke-linecap: round; }
.f-arrow.lift, .f-key.lift { stroke: #1e90e6; color: #1e90e6; }
.f-arrow.weight, .f-key.weight { stroke: #8a5a2b; color: #8a5a2b; }
.f-arrow.drag, .f-key.drag { stroke: #d6453d; color: #d6453d; }
.f-arrow.thrust, .f-key.thrust { stroke: #1a9e57; color: #1a9e57; }
.f-arrow.center { stroke: #8e2a8e; }
.f-arrow { color: inherit; } .f-arrow.lift { color: #1e90e6; } .f-arrow.weight { color: #8a5a2b; } .f-arrow.drag { color: #d6453d; } .f-arrow.thrust { color: #1a9e57; } .f-arrow.center { color: #8e2a8e; }
.f-key { font-weight: 700; }

.d-cylinder { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.d-head { fill: var(--aviation-soft); stroke: var(--text); stroke-width: 2; }
.d-piston { fill: var(--muted); stroke: var(--text); stroke-width: 1.5; }
.d-rod { stroke: var(--text); stroke-width: 6; stroke-linecap: round; }
.d-valve { fill: var(--muted); stroke: var(--text); stroke-width: 1.5; }
.d-valve.open { fill: #1a9e57; }
.d-spark { fill: none; stroke: #e0a31a; stroke-width: 3; stroke-linejoin: round; }
.d-flow { stroke: var(--muted); stroke-width: 2; fill: none; }
.d-box { fill: var(--surface); stroke: var(--aviation); stroke-width: 1.5; }
.d-part { cursor: pointer; }
.d-part:hover .d-box, .d-part:focus .d-box { fill: var(--aviation-soft); }
.d-part.selected .d-box { fill: var(--aviation-soft); stroke-width: 3; }
.d-part:focus { outline: none; } .d-part:focus-visible .d-box { stroke: var(--accent); stroke-width: 3; }

.w-body, .w-wing { fill: var(--aviation-soft); stroke: var(--aviation); stroke-width: 2; stroke-linejoin: round; }
.w-point { cursor: pointer; }
.w-point circle { fill: var(--surface); stroke: var(--aviation); stroke-width: 2; }
.w-point text { font-size: 10px; font-weight: 700; text-anchor: middle; }
.w-point:hover circle, .w-point.selected circle { fill: var(--aviation-accent); }
.w-point.selected text { fill: #fff; }
.w-point.done circle { fill: #1a9e57; stroke: #1a9e57; } .w-point.done text { fill: #fff; }
.w-point:focus { outline: none; } .w-point:focus-visible circle { stroke: var(--text); stroke-width: 3; }
.walk-layout { display: grid; grid-template-columns: minmax(240px, 460px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .walk-layout { grid-template-columns: 1fr; } }
.part-info { margin-top: 12px; }

.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 14px 0; }
.gauge-box { margin: 0; text-align: center; }
.gauge-box figcaption { font-size: .85rem; color: var(--muted); }
.gauge { width: 100%; max-width: 190px; height: auto; color: #e9eef5; }
.g-bg { fill: #121a26; stroke: #4a5a70; stroke-width: 2; }
.g-ring { fill: none; stroke: #4a5a70; stroke-width: 3; }
.g-tick { stroke: #e9eef5; stroke-width: 1.5; }
.g-needle { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.g-needle.thick { stroke-width: 4.5; }
.g-hub { fill: #e9eef5; }
.gauge .g-label { font-size: 10px; fill: #c9d4e3; }
.gauge .g-num { font-size: 9px; fill: #e9eef5; text-anchor: middle; }
.g-sky { fill: #3b8fd9; } .g-ground { fill: #8a5a2b; }
.g-pitchline { stroke: #fff; stroke-width: 1.2; }
.g-plane { fill: none; stroke: #f5b301; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-plane.fill { fill: #f5b301; stroke: none; }
.g-tube { fill: none; stroke: #4a5a70; stroke-width: 10; stroke-linecap: round; }
.g-ball { fill: #f5f5f5; stroke: #333; stroke-width: 1; }
.panel-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 18px; }
.diagram .d-text { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }

/* ---- E6B simulator ---- */
.e6b-layout { display: grid; grid-template-columns: minmax(260px, 430px) 1fr; gap: 22px; align-items: start; margin-top: 12px; }
@media (max-width: 800px) { .e6b-layout { grid-template-columns: 1fr; } }
.e6b-svg { width: 100%; height: auto; display: block; max-width: 460px; margin: 0 auto; color: #1b2a3d; touch-action: none; }
.e6b-steps { padding-left: 1.3em; } .e6b-steps li { margin-bottom: 6px; }
.e-plate { fill: #e9eef5; stroke: #3a4a60; stroke-width: 2; }
.e-inner { fill: #fff7e0; stroke: #3a4a60; stroke-width: 2; }
.e-disc { transition: transform .7s cubic-bezier(.3,.7,.3,1); }
.e-tick { stroke: #1b2a3d; stroke-width: 1; } .e-tick.card { stroke: #1b2a3d; }
.e-num { font-size: 11px; font-weight: 700; fill: #1b2a3d; } .e-num.inner { fill: #5b3a00; } .e-num.card { font-size: 10px; }
.e-index { fill: #1a9e57; }
.e-set { fill: #d6453d; }
.e-cursor { stroke: #d6453d; stroke-width: 1.5; opacity: .85; }
.e-hub { fill: #1b2a3d; }
.e-rose { fill: rgba(255,255,255,.55); stroke: #1b2a3d; stroke-width: 1.5; }
.e-arc { fill: none; stroke: #7a8ba3; stroke-width: 1; }
.e-drift { stroke: #b3c0d1; stroke-width: 1; } .e-drift.zero { stroke: #7a8ba3; stroke-width: 1.5; }
.e-grid-num { font-size: 9px; fill: #3a4a60; }
.e-vec { stroke-width: 2.5; stroke-linecap: round; } .e-vec.gs { stroke: #1a9e57; } .e-vec.tas { stroke: #1e63c9; } .e-vec.wind { stroke: #d6453d; stroke-dasharray: 5 3; }
.e-dot { fill: #d6453d; stroke: #fff; stroke-width: 1.5; }
.e6b-svg { background: #f4f7fb; border: 1px solid var(--border); border-radius: 12px; }
.diagram .d-arrowhead { fill: currentColor; }

.handout-topic { break-inside: avoid-page; margin-bottom: 18px; } .handout-key { break-before: page; }
.home-weather .badge { vertical-align: middle; }
.option.chosen { outline: 2px solid var(--accent); }

.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 12px; }
.compare-col h2 { font-size: 1.15rem; } .compare-col h3 { font-size: 1rem; margin-top: 12px; }
.outlook { list-style: none; padding: 0; } .outlook li { margin-bottom: 4px; }
.best-row th, .best-row td { background: var(--aviation-soft); }
.load-dot { stroke: var(--surface); stroke-width: 2; } .load-dot.ok { fill: #1a9e57; } .load-dot.bad { fill: #d6453d; }
.check-list { list-style: none; padding: 0; } .check-list li { margin-bottom: 6px; } .check-list .met span:first-child { color: #1a9e57; font-weight: 700; } .check-list .unmet span:first-child { color: #d6453d; font-weight: 700; }
.model-call { font-family: ui-monospace, Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.exercise-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.exercise-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; color: var(--text); cursor: pointer; font: inherit; }
.exercise-item.active { border-color: var(--accent); outline: 2px solid var(--accent); } .exercise-item.done { border-color: #1a9e57; }
.good-text { color: #1a9e57; font-weight: 700; } .bad-text { color: #d6453d; font-weight: 700; }
.code-inline { font-family: ui-monospace, Consolas, monospace; background: var(--aviation-soft); padding: 1px 6px; border-radius: 6px; }
.api-history { list-style: none; padding: 0; } .api-history li { margin: 2px 0; } .api-history button { text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================================================
   Modern refresh: wider desktop layout, softer surfaces, clearer rhythm, tool pages with a side menu.
   Kept at the end so it can refine the earlier rules without touching them.
   ===================================================================================================== */
:root { --wrap-max: 1520px; --gutter: clamp(16px, 3.4vw, 64px); --radius: 16px; --ease: cubic-bezier(.2, .7, .2, 1); --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); --lift: 0 20px 44px -22px rgba(14, 27, 44, .38); }
html { scroll-behavior: smooth; }
body {
    font-size: 1.0625rem; line-height: 1.65; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(1100px 520px at 92% -120px, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%),
        radial-gradient(900px 460px at -8% 160px, color-mix(in srgb, var(--aviation-accent) 7%, transparent), transparent 70%),
        var(--bg);
}
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 2.6vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 1.9vw, 1.85rem); margin-top: 1.6em; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Use the width of a desktop screen: the page grows with the window up to a generous limit, text keeps a readable line length. */
.wrap { max-width: var(--wrap-max); padding-inline: var(--gutter); }
.wrap > p, .wrap > .hint, .wrap > ul, .wrap > ol, .lead-text { max-width: 82ch; }
.wrap > .grid, .wrap > .results, .wrap > .tool-body, .wrap > .table-wrap, .wrap > .tools-layout, .wrap > .actions-row, .wrap > .chips { max-width: none; }
.page-title { padding: 44px 0 10px; }
.section { padding: clamp(36px, 5vw, 72px) 0; }

/* Header: lighter, see-through, sticky */
.site-header { background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); }
.nav-row { min-height: 70px; gap: 20px; }
.nav-links a, .nav-sub a { border-radius: 10px; transition: background .15s var(--ease), color .15s var(--ease); }
.nav-sub { border-radius: 16px; }

/* Hero */
.hero-home { padding: clamp(80px, 11vw, 150px) 0 clamp(72px, 9vw, 120px); }
.hero-home h1 { font-size: clamp(2.6rem, 5.4vw, 5rem); line-height: 1.04; max-width: 16ch; letter-spacing: -.035em; }
.hero-home .lead { font-size: clamp(1.1rem, 1.5vw, 1.4rem); max-width: 56ch; }
.hero.small, .hero { padding-block: clamp(44px, 6vw, 84px); }

/* Cards and panels */
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: clamp(16px, 1.6vw, 26px); }
.card { border-radius: var(--radius); padding: 24px; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
a.card:hover, .card:hover { transform: translateY(-3px); box-shadow: var(--lift); }
.card h3 { font-size: 1.12rem; }
.split { gap: clamp(18px, 2vw, 32px); }
.panel { border-radius: 26px; padding: clamp(28px, 3vw, 48px); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.panel:hover { transform: translateY(-4px); box-shadow: 0 34px 60px -26px rgba(14, 27, 44, .6); }
.strip .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* Buttons */
.btn { padding: 11px 22px; border-radius: 12px; transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(14, 27, 44, .45); }
.btn:active { transform: none; box-shadow: none; }
.btn-ghost { border-radius: 10px; }
.chip { transition: background .15s var(--ease), border-color .15s var(--ease); }
.chip:hover { border-color: var(--accent); }

/* Forms */
.field input, .field select, .field textarea, .answer-row .grow {
    border-radius: 12px; padding: 10px 13px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, var(--surface));
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=range] { accent-color: var(--accent); }
.form-grid { gap: 16px 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* Tool surfaces and result tiles */
.tool-body { border-radius: 20px; padding: clamp(18px, 2.2vw, 32px); }
.results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.result { border-radius: 14px; padding: 15px 18px; background: color-mix(in srgb, var(--bg) 55%, var(--surface)); transition: border-color .15s var(--ease), transform .15s var(--ease); }
.result:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.result strong { letter-spacing: -.015em; }
.notice { border-radius: 16px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.tool-body .diagram { max-width: min(100%, 780px); }

/* Tables */
.table-wrap { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 12px 16px; }
.data-table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); position: sticky; top: 0; }
.data-table tbody tr { transition: background .12s var(--ease); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }

/* Tool pages on a desktop screen: the menu moves to a side column and the tool gets the full remaining width. */
.tools-layout > .tool-body { margin-bottom: 0; }
@media (min-width: 1100px) {
    .tools-layout { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: clamp(20px, 2.4vw, 40px); align-items: start; margin-bottom: 56px; }
    .tools-layout > [role=tablist] {
        position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow-y: auto; padding: 14px 12px; border: 1px solid var(--border);
        border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); scrollbar-width: thin;
    }
    .tools-layout .tab-group { margin: 0 0 14px; }
    .tools-layout .tab-group:last-child { margin-bottom: 0; }
    .tools-layout .tab-group-label { display: block; margin: 4px 10px 6px; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
    .tools-layout .tabs { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; border: 0; }
    .tools-layout .tab { text-align: left; border: 0; border-radius: 10px; padding: 7px 12px; font-weight: 500; font-size: .95rem; color: var(--text); background: transparent; width: 100%; }
    .tools-layout .tab:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
    .tools-layout .tab.active { background: var(--zone-soft, var(--aviation-soft)); color: var(--primary); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
}
@media (min-width: 1100px) and (max-height: 760px) { .tools-layout > [role=tablist] { top: 80px; max-height: calc(100vh - 96px); } }

/* Footer */
.site-footer { margin-top: clamp(48px, 6vw, 96px); }
.site-footer .wrap { gap: clamp(20px, 4vw, 64px); }

/* Study streak */
.study-streak { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px 24px; margin: 18px 0; box-shadow: var(--shadow); }
.streak-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.streak-head h2 { margin: 0; font-size: 1.15rem; }
.streak-head p { margin: 2px 0 0; }
.streak-number { display: grid; place-items: center; min-width: 76px; padding: 8px 14px; border-radius: 18px; background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--accent) 80%, var(--primary))); color: var(--primary-contrast); }
.streak-number strong { font-size: 1.9rem; line-height: 1; } .streak-number span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.week { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; max-width: 520px; }
.week li { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; justify-content: flex-end; font-size: .78rem; color: var(--muted); }
.week .bar { display: block; width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--accent) 35%, var(--border)); transition: height .4s var(--ease); }
.week li.today .bar { background: var(--accent); } .week .count { font-weight: 700; color: var(--text); }

/* Small components used by the newer tools */
.rec-columns { display: grid; gap: clamp(16px, 2.4vw, 36px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.rec-list, .rec-sequence { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; counter-reset: rec; }
.rec-sequence li { counter-increment: rec; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.rec-sequence li::before { content: counter(rec); display: grid; place-items: center; min-width: 26px; height: 26px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem; }
.rec-sequence li > span, .rec-sequence li > strong { flex: 1; }
.rec-sequence li.right { border-color: #1a9e57; background: color-mix(in srgb, #1a9e57 14%, var(--bg)); }
.rec-sequence li.wrong { border-color: #d6453d; background: color-mix(in srgb, #d6453d 14%, var(--bg)); }
.rec-sequence li.misplaced { border-color: #e0a31a; background: color-mix(in srgb, #e0a31a 14%, var(--bg)); }
.rec-action { width: 100%; text-align: left; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.rec-action:hover:not(:disabled) { border-color: var(--accent); transform: translateX(2px); }
.rec-action:disabled { opacity: .45; cursor: default; }
.key { font-size: .9rem; } .key.blue { color: var(--aviation-accent); } .key.red { color: #d6453d; } .key.green { color: #1a9e57; }
.voice-box { margin: 10px 0 16px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 16px; }
.voice-compare { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.live-metar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 16px; }
.live-metar .field { min-width: 150px; }
.stale { color: #d6453d; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.site-header .nav-row { max-width: var(--wrap-max); }
.study-streak.compact { padding: 10px 16px; margin: 10px 0 18px; border-radius: 16px; }
.study-streak.compact .streak-number { min-width: 58px; padding: 4px 10px; border-radius: 14px; } .study-streak.compact .streak-number strong { font-size: 1.3rem; }
.study-streak.compact .streak-head { gap: 14px; } .study-streak.compact h2 { font-size: 1rem; }
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }

/* ===== Round 10: systems failures, race, chart, cases, perf puzzles, palette, glossary, weather extras ===== */
.indicator-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.indicator { display: grid; grid-template-columns: 14px 1fr; grid-template-areas: "lamp name" "lamp state"; gap: 0 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: #121a26; color: #e9eef5; }
.indicator .lamp { grid-area: lamp; width: 12px; height: 12px; border-radius: 50%; background: #1fae63; box-shadow: 0 0 10px #1fae63aa; }
.indicator .name { grid-area: name; font-size: .85rem; font-weight: 600; } .indicator .state { grid-area: state; font-size: .75rem; opacity: .75; }
.indicator.caution { border-color: #e0a31a; } .indicator.caution .lamp { background: #f5b301; box-shadow: 0 0 12px #f5b301cc; }
.indicator.failed { border-color: #d6453d; } .indicator.failed .lamp { background: #ff4d44; box-shadow: 0 0 14px #ff4d44cc; animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.story { padding-left: 1.3em; } .story li { margin-bottom: 6px; }
.option.chosen { outline: 2px solid var(--accent); }
.race-bar { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--aviation-soft); font-weight: 600; }
.race-clock { font-variant-numeric: tabular-nums; font-size: 1.3rem; color: var(--primary); }
.race-review { list-style: none; padding: 0; } .race-review li { margin: 6px 0; } .race-review .met span:first-child { color: #1a9e57; font-weight: 700; } .race-review .unmet span:first-child { color: #d6453d; font-weight: 700; }
.chart-layout { display: grid; gap: clamp(16px, 2vw, 32px); grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 960px) { .chart-layout { grid-template-columns: 1fr; } }
.vfr-chart { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); background: #eef3e6; }
.c-land { fill: #eef3e6; } .c-water { fill: #cfe6f3; } .c-grid { stroke: #00000014; stroke-width: 1; }
.c-text { font-size: 15px; fill: #1b2a3d; } .c-text.bold { font-weight: 700; } .c-text.air { font-size: 14px; font-weight: 600; fill: #3c2a6b; }
.c-airspace { cursor: pointer; } .c-airspace polygon, .c-airspace circle { fill: transparent; stroke-width: 2.5; }
.c-airspace.ctr circle { stroke: #1d6fd1; fill: #1d6fd114; stroke-dasharray: 10 5; } .c-airspace.tma circle { stroke: #7a3fb3; fill: #7a3fb30c; }
.c-airspace.restricted polygon { stroke: #d6453d; fill: #d6453d22; } .c-airspace.danger polygon { stroke: #c9760f; fill: #e0a31a22; stroke-dasharray: 6 4; }
.c-obstacle polygon { fill: #1b2a3d; cursor: pointer; } .c-point polygon { fill: #fff; stroke: #7a3fb3; stroke-width: 3; cursor: pointer; }
.c-airfield circle { fill: #fff; stroke: #1d6fd1; stroke-width: 4; cursor: pointer; } .c-airfield line { stroke: #1d6fd1; stroke-width: 4; }
.c-airspace:hover polygon, .c-airspace:hover circle { stroke-width: 4; } .c-airfield:hover circle { fill: #cfe3fa; }
.c-airspace.chosen polygon, .c-airspace.chosen circle, .c-obstacle.chosen polygon, .c-point.chosen polygon, .c-airfield.chosen circle { stroke: #e0a31a; stroke-width: 5; fill-opacity: .5; }
.c-airspace.right polygon, .c-airspace.right circle, .c-airfield.right circle, .c-point.right polygon, .c-obstacle.right polygon { stroke: #1a9e57; stroke-width: 6; }
.c-airspace.wrong polygon, .c-airspace.wrong circle, .c-airfield.wrong circle, .c-point.wrong polygon, .c-obstacle.wrong polygon { stroke: #d6453d; stroke-width: 6; }
.c-north path { fill: #1b2a3d; } .c-scale { stroke: #1b2a3d; stroke-width: 4; }
.case-path { padding-left: 1.2em; } .case-path li { margin-bottom: 10px; }
.case-choice { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); } .case-choice.good { border-color: #1a9e57; background: color-mix(in srgb, #1a9e57 12%, transparent); } .case-choice.poor { border-color: #d6453d; background: color-mix(in srgb, #d6453d 12%, transparent); }
.perf-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin: 14px 0; }
.perf-option { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface); } .perf-option h3 { font-size: 1rem; margin-top: 0; }
.perf-option.chosen { border-color: var(--accent); } .perf-option.fastest { border-color: #1a9e57; box-shadow: 0 0 0 3px color-mix(in srgb, #1a9e57 25%, transparent); }
.perf-option .code-output { max-height: 160px; overflow: auto; font-size: .8rem; }
.perf-time { display: flex; gap: 10px; align-items: center; margin-top: 10px; } .perf-time .bar { flex: 1; height: 10px; border-radius: 6px; background: var(--border); overflow: hidden; } .perf-time .bar span { display: block; height: 100%; background: var(--accent); }
.gloss { border-bottom: 1px dotted var(--accent); cursor: help; position: relative; outline-offset: 2px; }
.gloss:hover::after, .gloss:focus::after { content: attr(data-def); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(320px, 80vw); padding: 10px 12px; border-radius: 12px; background: #0e1b2c; color: #f3f7fb; font-size: .85rem; line-height: 1.45; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); white-space: normal; }
.rose-layout { display: grid; gap: 24px; grid-template-columns: minmax(240px, 340px) 1fr; align-items: center; } @media (max-width: 760px) { .rose-layout { grid-template-columns: 1fr; } }
.wind-rose { width: 100%; max-width: 340px; } .rose-ring { fill: none; stroke: var(--border); } .rose-wedge { fill: var(--accent); fill-opacity: .75; stroke: var(--surface); } .rose-label { fill: var(--muted); font-size: 13px; font-weight: 700; }
.weather-card .card-station { break-inside: avoid; border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin: 12px 0; } .weather-card .raw { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; word-break: break-word; } .weather-card .url { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.install-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; } .palette-tip { margin: 8px 0 0; }
.palette-open { font: inherit; font-weight: 700; border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.palette { border: 0; padding: 0; border-radius: 20px; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); margin-top: 12vh; }
.palette::backdrop { background: rgba(6, 18, 32, .55); backdrop-filter: blur(3px); }
.palette-box { padding: 14px; } #palette-input { width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
#palette-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 50vh; overflow: auto; } #palette-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
#palette-list li.active { background: var(--zone-soft, var(--aviation-soft)); box-shadow: inset 3px 0 0 var(--accent); } .palette-group { color: var(--muted); font-size: .8rem; white-space: nowrap; } .palette-none { color: var(--muted); cursor: default !important; }
.palette-help { margin: 8px 4px 0; font-size: .8rem; }
@media print { .install-box, .palette-tip, .palette-open { display: none !important; } }

/* =====================================================================================================
   Colour and layout refresh: Ferrari red (Rosso Corsa) as the signature accent, with more colour around it.
   Red is for calls to action and highlights; the blue (aviation) and teal (software) of each zone stay for headings and menus.
   ===================================================================================================== */
:root {
    --red: #d40000; --red-bright: #ff2800; --red-deep: #9e0000; --red-soft: #fde8e6;
    --yellow: #ffc800; --yellow-soft: #fff6d1; --green: #16a34a; --violet: #7c3aed; --orange: #f97316; --sky: #0ea5e9; --teal: #0d9488; --rose: #e11d48;
}
:root[data-theme="dark"] { --red: #ff3b30; --red-soft: #3a1210; --yellow-soft: #3a3010; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --red: #ff3b30; --red-soft: #3a1210; --yellow-soft: #3a3010; } }

/* The header carries a stripe: red, yellow, then the colour of the zone you are in. */
.site-header::before { height: 5px; background: linear-gradient(90deg, var(--red) 0 22%, var(--yellow) 22% 34%, var(--zone-bar, linear-gradient(90deg, #0b57a4, #1e90e6)) 34% 100%); }
.site-header::before { background: linear-gradient(90deg, var(--red) 0%, var(--red) 24%, var(--yellow) 24%, var(--yellow) 32%, var(--accent) 32%, var(--accent) 100%); }
.brand, .nav-brand { letter-spacing: -.01em; }
.nav-links a.active, .nav-group.current .nav-group-title { box-shadow: inset 0 -3px 0 var(--red); }

/* Calls to action in Rosso Corsa */
.btn-solid, .btn-ferrari {
    background: linear-gradient(145deg, var(--red-bright), var(--red) 55%, var(--red-deep)); color: #fff; border-color: transparent;
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--red) 80%, transparent);
}
.btn-solid:hover, .btn-ferrari:hover { filter: brightness(1.08) saturate(1.05); box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--red) 85%, transparent); }
.btn-solid:disabled, .btn-ferrari:disabled { background: color-mix(in srgb, var(--red) 35%, var(--surface)); box-shadow: none; filter: none; color: #fff; opacity: .7; }
.btn-ghost-solid:hover { border-color: var(--red); color: var(--red); }
.btn-ghost:hover { color: var(--red); }
a { text-underline-offset: 3px; }
.page-title { border-left: 6px solid var(--red); padding-left: 18px; margin-top: 28px; }
.zone-software .page-title { border-left-color: var(--accent); }
.page-title h1::after { content: ""; display: block; width: 64px; height: 5px; margin-top: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--red), var(--yellow)); }
.chip.active, .chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.option.chosen { outline-color: var(--red); } .option:hover:not(:disabled) { border-color: var(--red); }
.result.total { border-color: var(--red); } .result.total strong { color: var(--red); }
.result.good strong { color: var(--green); } .result.bad strong { color: var(--red); }
input[type=range] { accent-color: var(--red); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 20%, transparent); }
:focus-visible { outline-color: var(--red); }
.streak-number { background: linear-gradient(145deg, var(--red-bright), var(--red-deep)); color: #fff; }
.week .bar { background: color-mix(in srgb, var(--red) 28%, var(--border)); } .week li.today .bar { background: var(--red); }
.race-bar { background: var(--red-soft); } .race-clock { color: var(--red); }
.badge { background: var(--red); } .badge.cat-vfr, .badge.cat-mvfr, .badge.cat-ifr, .badge.cat-lifr { color: #fff; }
.indicator-board .indicator { border-radius: 14px; }
.stale, .bar-fill.low { color: var(--red); }

/* Colour for the categories: every group of tools, every tile, every card cycle gets its own colour. */
.tile, .grid > .card:nth-child(6n+1), .grid > .card:nth-child(6n+2), .grid > .card:nth-child(6n+3), .grid > .card:nth-child(6n+4), .grid > .card:nth-child(6n+5), .grid > .card:nth-child(6n+6) { --tile: var(--accent); }
.grid > .card { border-top: 4px solid var(--tile, var(--accent)); }
.grid > .card:nth-child(6n+1) { --tile: var(--red); } .grid > .card:nth-child(6n+2) { --tile: var(--sky); } .grid > .card:nth-child(6n+3) { --tile: var(--yellow); }
.grid > .card:nth-child(6n+4) { --tile: var(--green); } .grid > .card:nth-child(6n+5) { --tile: var(--violet); } .grid > .card:nth-child(6n+6) { --tile: var(--orange); }
.grid > .card h3 { color: var(--text); } .card:hover { border-color: var(--tile, var(--accent)); }

.tools-layout .tab-group { --g: var(--sky); }
.tools-layout .tab-group:nth-of-type(7n+1) { --g: #1e90e6; } .tools-layout .tab-group:nth-of-type(7n+2) { --g: var(--orange); } .tools-layout .tab-group:nth-of-type(7n+3) { --g: var(--violet); }
.tools-layout .tab-group:nth-of-type(7n+4) { --g: var(--teal); } .tools-layout .tab-group:nth-of-type(7n+5) { --g: var(--green); } .tools-layout .tab-group:nth-of-type(7n+6) { --g: var(--red); } .tools-layout .tab-group:nth-of-type(7n+7) { --g: #64748b; }
.tools-layout .tab-group-label { color: var(--g); display: flex; align-items: center; gap: 8px; }
.tools-layout .tab-group-label::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--g); flex: none; }
@media (min-width: 1100px) {
    .tools-layout .tab.active { background: color-mix(in srgb, var(--g) 16%, var(--surface)); color: var(--text); box-shadow: inset 4px 0 0 var(--g); }
    .tools-layout .tab:hover { background: color-mix(in srgb, var(--g) 9%, transparent); }
}
.tools-layout > .tool-body { border-top: 5px solid var(--red); }

/* Home: a two-column hero with a live card, then big colourful start tiles */
.hero-home { background: radial-gradient(900px 420px at 8% 100%, color-mix(in srgb, var(--red) 38%, transparent), transparent 70%), linear-gradient(115deg, #050f22 0%, #0b3d78 48%, #0f766e 100%); }
.hero-grid { display: grid; gap: clamp(24px, 4vw, 64px); align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .8fr); } }
.hero-home h1 { max-width: 15ch; }
.hero-home h1::first-line { color: #fff; }
.hero-tip { margin-top: 22px; font-size: .9rem; opacity: .8; }
.btn-ferrari { font-weight: 700; padding: 12px 26px; }
.hero-side { display: grid; gap: 16px; }
.hero-side .home-weather { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); color: #fff; box-shadow: 0 24px 50px -24px rgba(0,0,0,.6); border-top: 4px solid var(--red); }
.hero-side .home-weather h3, .hero-side .home-weather p { color: #fff; } .hero-side .home-weather .hint { color: #cfe3f7; }
.hero-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-links a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; text-decoration: none; font-weight: 600; transition: background .15s ease, transform .15s ease; }
.hero-links a:hover { background: rgba(255,255,255,.2); transform: translateY(-2px); }
.section-title { margin: 0 0 18px; font-size: clamp(1.5rem, 2.2vw, 2.1rem); }
.section-title::before { content: ""; display: inline-block; width: 28px; height: 6px; margin-right: 12px; vertical-align: middle; border-radius: 4px; background: var(--red); }
.tiles { display: grid; gap: clamp(14px, 1.6vw, 24px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.tile { position: relative; display: block; padding: 24px 22px 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--tile, var(--red)); }
.tile::after { content: ""; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px; border-radius: 50%; background: var(--tile, var(--red)); opacity: .09; transition: transform .3s var(--ease); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--lift); border-color: var(--tile, var(--red)); } .tile:hover::after { transform: scale(1.5); }
.tile-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 16px; font-size: 1.6rem; background: color-mix(in srgb, var(--tile, var(--red)) 15%, var(--surface)); }
.tile-icon.mono { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 1.05rem; color: var(--tile); }
.tile h3 { margin: 0 0 6px; font-size: 1.15rem; } .tile p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Footer: darker, with the same stripe as the header */
.site-footer { background: color-mix(in srgb, var(--surface) 92%, #000); border-top: 0; position: relative; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--red) 0 24%, var(--yellow) 24% 32%, var(--accent) 32% 100%); }
.footer-grid { padding-top: 12px; } .site-footer a:hover { color: var(--red); }

/* The wide weather dashboard: category tiles and the insight cards sit side by side on a big screen */
@media (min-width: 1200px) { .weather-dash .results { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* The new trainers */
.land-layout { display: grid; gap: clamp(16px, 2.4vw, 36px); grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; margin-top: 12px; } @media (max-width: 860px) { .land-layout { grid-template-columns: 1fr; } }
.land-svg { width: 100%; max-width: 340px; border-radius: 18px; background: #f2f6fa; border: 1px solid var(--border); }
.l-ground { fill: #dfe9d4; } .l-runway { fill: #3b4552; } .l-centre { stroke: #fff; stroke-width: 3; stroke-dasharray: 14 10; }
.l-wind { stroke: var(--sky); stroke-width: 5; } .l-windhead { fill: var(--sky); } .l-text { font-size: 14px; font-weight: 700; fill: #1b2a3d; } .l-plane { fill: var(--red); stroke: #fff; stroke-width: 1.5; }
.wx-chart .wx-sea { fill: #eaf2f8; } .wx-isobar { fill: none; stroke: #5b6b80; stroke-width: 2; } .wx-hpa { font-size: 13px; fill: #44526a; font-weight: 600; } .wx-hpa.big { font-size: 20px; font-weight: 800; fill: #1b2a3d; }
.wx-box { fill: #ffffff55; stroke: #7a8aa0; stroke-dasharray: 6 5; } .wx-box-letter { font-size: 22px; font-weight: 800; fill: #5b6b80; }
.wx-front { cursor: pointer; } .front-hit { fill: none; stroke: transparent; stroke-width: 26; } .front-line { fill: none; stroke-width: 4; }
.wx-front.cold .front-line { stroke: #1d63d8; } .wx-front.cold .front-sym { fill: #1d63d8; } .wx-front.warm .front-line { stroke: #d40000; } .wx-front.warm .front-sym { fill: #d40000; }
.wx-front.chosen .front-line { stroke-width: 7; } .wx-front.right .front-line { stroke: #16a34a; stroke-width: 7; } .wx-front.wrong .front-line { stroke-width: 7; opacity: .6; }
.wx-centre { cursor: pointer; } .wx-centre circle { fill: #fff; stroke-width: 4; } .wx-centre.low circle { stroke: #d40000; } .wx-centre.high circle { stroke: #1d63d8; }
.wx-letter { font-size: 28px; font-weight: 800; fill: #1b2a3d; } .wx-centre.chosen circle { fill: var(--yellow-soft); } .wx-centre.right circle { stroke: #16a34a; stroke-width: 7; } .wx-centre.wrong circle { stroke-width: 7; }
.conv-turn { padding: 14px 18px; margin: 12px 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); } .conv-turn.done { opacity: .92; }
.conv .atc { padding: 10px 14px; border-radius: 12px; background: var(--yellow-soft); } .conv .me { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--sky) 10%, var(--surface)); }
.ice-svg, .wind-rose { width: 100%; max-width: 260px; } .ice-air { fill: color-mix(in srgb, var(--sky) 14%, var(--surface)); stroke: var(--border); } .ice-band { fill: color-mix(in srgb, var(--red) 55%, transparent); }
.ice-line { stroke: #1d63d8; stroke-width: 2; stroke-dasharray: 5 4; } .ice-cloud { stroke: var(--text); stroke-width: 3; } .ice-label { font-size: 11px; fill: var(--muted); } .ice-label.cloud { fill: var(--text); font-weight: 700; }
.gauge-box[role="button"] { cursor: pointer; border-radius: 16px; transition: transform .12s ease, outline-color .12s ease; } .gauge-box[role="button"]:hover { transform: scale(1.03); }
.gauge-box.right { outline: 4px solid var(--green); outline-offset: 4px; } .gauge-box.wrong { outline: 4px solid var(--red); outline-offset: 4px; } .gauge-box.chosen { outline: 4px solid var(--yellow); outline-offset: 4px; }
.listen-row { margin: 0 0 10px; } .listen-btn[aria-pressed="true"] { background: var(--red); color: #fff; border-color: var(--red); }

/* ==========================================================================
   Round 12: colour themes, systems tracer, fuel system, start flow, recovery gauge, charts, ICAO self-check
   ========================================================================== */
:root[data-accent="blue"] { --red: #0b57a4; --red-bright: #1e90e6; --red-deep: #083a73; --red-soft: #e3f0fc; }
:root[data-accent="green"] { --red: #0f7a43; --red-bright: #1fb868; --red-deep: #0a5530; --red-soft: #e2f5ea; }
:root[data-accent="violet"] { --red: #6d28d9; --red-bright: #8b5cf6; --red-deep: #4c1d95; --red-soft: #efe8fd; }
:root[data-theme="dark"][data-accent="blue"] { --red: #5ab0f5; --red-soft: #0f2a44; }
:root[data-theme="dark"][data-accent="green"] { --red: #4ade80; --red-soft: #0f3322; }
:root[data-theme="dark"][data-accent="violet"] { --red: #a78bfa; --red-soft: #241a45; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"])[data-accent="blue"] { --red: #5ab0f5; --red-soft: #0f2a44; }
    :root:not([data-theme="light"])[data-accent="green"] { --red: #4ade80; --red-soft: #0f3322; }
    :root:not([data-theme="light"])[data-accent="violet"] { --red: #a78bfa; --red-soft: #241a45; }
}
.accent-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: none; cursor: pointer; }
.accent-toggle:hover { border-color: var(--red); }
.accent-toggle .dot { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(145deg, var(--red-bright), var(--red-deep)); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--red); }

/* systems tracer */
.net-svg { width: 100%; max-width: 900px; height: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.net-edge { stroke: var(--muted); stroke-width: 2; }
.net-edge.live { stroke: var(--green); stroke-width: 3; } .net-edge.dead { stroke: var(--red); stroke-dasharray: 5 4; }
.net-node rect { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.net-node.source rect { fill: color-mix(in srgb, var(--green) 14%, var(--surface)); stroke: var(--green); }
.net-node.link rect { fill: color-mix(in srgb, var(--sky, #1e90e6) 14%, var(--surface)); stroke: var(--sky, #1e90e6); }
.net-node.load { cursor: pointer; } .net-node.load:hover rect { stroke: var(--red); }
.net-node.load:focus { outline: none; } .net-node.load:focus-visible rect { stroke: var(--red); stroke-width: 4; }
.net-node.failed rect { fill: color-mix(in srgb, var(--red) 18%, var(--surface)); stroke: var(--red); stroke-dasharray: 6 4; }
.net-node.marked rect { fill: color-mix(in srgb, var(--yellow) 30%, var(--surface)); stroke: var(--yellow); stroke-width: 3; }
.net-node.right rect { fill: color-mix(in srgb, var(--green) 25%, var(--surface)); stroke: var(--green); stroke-width: 3; }
.net-node.ok rect, .net-node.live rect { stroke: var(--green); }
.net-node.wrong rect, .net-node.missed rect { fill: color-mix(in srgb, var(--red) 22%, var(--surface)); stroke: var(--red); stroke-width: 3; }
.net-node.dead rect { stroke: var(--red); }
.net-text { fill: var(--text); font-size: 11.5px; font-weight: 600; pointer-events: none; }
.net-cross { stroke: var(--red); stroke-width: 4; stroke-linecap: round; pointer-events: none; }

/* fuel system */
.fuel-layout { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .fuel-layout { grid-template-columns: 1fr; } }
.fuel-panel { display: flex; gap: 14px; align-items: flex-start; justify-content: center; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.tank-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tank { position: relative; width: 70px; height: 170px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); overflow: hidden; display: flex; align-items: flex-end; }
.tank-fill { width: 100%; background: linear-gradient(180deg, var(--yellow), color-mix(in srgb, var(--yellow) 60%, var(--red))); transition: height .4s ease; }
.tank-fill.low { background: var(--red); }
.fuel-valve { align-self: center; max-width: 120px; text-align: center; }
.pill { font-size: .78rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.pill.ok { border-color: var(--green); color: var(--green); } .pill.bad { border-color: var(--red); color: var(--red); font-weight: 700; }
.fuel-log { font-size: .85rem; color: var(--muted); max-height: 160px; overflow: auto; }
.notice.warn { border-left-color: var(--red); background: var(--red-soft); }

/* engine start flow */
.start-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .start-cols { grid-template-columns: 1fr; } }
.start-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ol.start-list { list-style: decimal inside; }
ol.start-list li { padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
ol.start-list li.met { border-color: var(--green); } ol.start-list li.unmet { border-color: var(--red); }

/* stall and spin gauge */
.aoa-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 700px) { .aoa-layout { grid-template-columns: 1fr; } .aoa-svg { max-width: 240px; } }
.aoa-svg { width: 100%; }
.aoa-bar { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.aoa-ok { fill: color-mix(in srgb, var(--green) 35%, var(--surface)); }
.aoa-stalled { fill: color-mix(in srgb, var(--red) 40%, var(--surface)); }
.aoa-crit { stroke: var(--red); stroke-width: 3; stroke-dasharray: 5 3; }
.aoa-marker { fill: var(--text); }
.aoa-wing { fill: var(--primary); } .aoa-wind { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; }

/* charts */
.lfc-svg { width: 100%; max-width: 760px; height: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.lfc-plot { fill: var(--bg); stroke: var(--border); }
.lfc-grid { stroke: var(--border); stroke-width: 1; }
.lfc-tick { fill: var(--muted); font-size: 11px; } .lfc-tick.red { fill: var(--red); } .lfc-tick.blue { fill: var(--primary); }
.lfc-n { fill: none; stroke: var(--red); stroke-width: 3; } .lfc-v { fill: none; stroke: var(--primary); stroke-width: 3; }
.lfc-limit { stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 4; } .lfc-now { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
.lfc-dot.red { fill: var(--red); } .lfc-dot.blue { fill: var(--primary); }
.lfc-legend .sw { display: inline-block; width: 14px; height: 4px; vertical-align: middle; margin: 0 4px 0 12px; border-radius: 2px; }
.lfc-legend .sw.red { background: var(--red); } .lfc-legend .sw.blue { background: var(--primary); }

/* handoff and ICAO self-check */
.option.freq { font-variant-numeric: tabular-nums; font-size: 1.1rem; letter-spacing: .04em; }
.self-criterion .options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.self-criterion .option { text-align: left; }
.self-criterion .option.chosen { background: var(--red-soft); border-color: var(--red); }
:root[data-accent] .btn-solid, :root[data-accent] .btn-ferrari { background: linear-gradient(145deg, color-mix(in srgb, var(--red-bright) 55%, var(--red-deep)), var(--red-deep)); }
:root[data-theme="dark"][data-accent] .chip.active, :root[data-theme="dark"][data-accent] .chip[aria-pressed="true"], :root[data-theme="dark"][data-accent] .badge { color: #06121f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent] .chip.active, :root:not([data-theme="light"])[data-accent] .chip[aria-pressed="true"], :root:not([data-theme="light"])[data-accent] .badge { color: #06121f; } }

/* ---- Round 13: tools menu (search, pins, collapsible groups) and the new tools ---- */
.tools-search { width: 100%; box-sizing: border-box; font: inherit; padding: 9px 12px; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); }
.tools-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tools-nav .tab-group { margin: 0 0 4px; }
.tools-nav .tab-group-label { display: flex; align-items: center; gap: 8px; margin: 10px 4px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g, var(--muted)); }
.group-head { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; text-align: left; cursor: pointer; background: none; color: var(--text); border: 0; border-radius: 10px; padding: 8px 10px; }
.group-head:hover { background: color-mix(in srgb, var(--g) 10%, transparent); }
.group-head:focus-visible, .tools-nav .tab:focus-visible, .pin-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.group-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--g); flex: none; }
.group-name { flex: 1; font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--g); }
.group-count { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--g) 16%, var(--surface)); color: var(--text); }
.group-chevron { width: 1em; text-align: center; color: var(--muted); }
.tab-group.open > .group-head { background: color-mix(in srgb, var(--g) 8%, transparent); }
.tab-meta { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.tools-nav .tab-group .tabs { margin: 2px 0 6px 6px; padding-left: 8px; border-left: 2px solid color-mix(in srgb, var(--g) 35%, transparent); }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.tool-head h2 { margin: 0; font-size: 1.25rem; }
.pin-btn { font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 4px 10px; }
.pin-btn:hover, .pin-btn.pinned { color: var(--red); border-color: var(--red); }
@media (min-width: 1100px) {
    .tools-layout > .tools-nav { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow-y: auto; padding: 14px 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); scrollbar-width: thin; }
    .tools-nav .tab-group .tabs { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; border-bottom: 0; }
    .tools-nav .tab { text-align: left; border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 500; font-size: .93rem; color: var(--text); background: transparent; width: 100%; }
    .tools-nav .tab:hover { background: color-mix(in srgb, var(--g) 9%, transparent); }
    .tools-nav .tab.active { background: color-mix(in srgb, var(--g) 16%, var(--surface)); color: var(--text); font-weight: 700; box-shadow: inset 4px 0 0 var(--g); }
}
@media (min-width: 1100px) and (max-height: 760px) { .tools-layout > .tools-nav { top: 80px; max-height: calc(100vh - 96px); } }
@media (max-width: 1099px) {
    .tools-nav { margin-bottom: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
    .tools-nav .tab-group .tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 0; }
    .tools-nav .tab { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
    .tools-nav .tab.active { border-color: var(--g); background: color-mix(in srgb, var(--g) 14%, var(--surface)); }
}
.lfc-n.faint { opacity: .4; stroke-dasharray: 5 4; }
.compass-svg { width: min(100%, 260px); display: block; margin: 0 auto 8px; }
.compass-ring { fill: var(--bg); stroke: var(--border); stroke-width: 2; }
.compass-real { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 4; }
.compass-shown { stroke: var(--red); stroke-width: 4; stroke-linecap: round; }
.swatch { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; }
.swatch.real { background: var(--muted); } .swatch.shown { background: var(--red); }
.gauge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.gauge { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.gauge-name { font-size: .8rem; color: var(--muted); font-weight: 600; }
.gauge-value { font-size: 1.5rem; }
.gauge-value small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.gauge-bar { position: relative; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 25%, var(--bg)); }
.gauge-green { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, #1a9e57 55%, var(--bg)); border-radius: 999px; }
.gauge-needle { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.gauge-state { font-size: .78rem; font-weight: 600; }
.gauge-caution { border-color: #d98a00; } .gauge-caution .gauge-state { color: #d98a00; }
.gauge-danger { border-color: #d6453d; background: color-mix(in srgb, #d6453d 10%, var(--bg)); } .gauge-danger .gauge-state { color: #d6453d; }
.wake-svg { width: 100%; max-width: 760px; display: block; margin: 12px 0; }
.wake-ground { fill: color-mix(in srgb, var(--muted) 30%, var(--bg)); }
.wake-path { stroke: var(--muted); stroke-dasharray: 6 5; stroke-width: 1.5; }
.wake-vortex { fill: color-mix(in srgb, var(--red) 25%, transparent); stroke: var(--red); stroke-width: 3; }
.wake-follower { fill: var(--primary, var(--text)); }
.stress-word { font-size: 1.8rem; font-weight: 700; letter-spacing: .02em; margin: 6px 0; }
.stress-marked { font-weight: 700; letter-spacing: .04em; }
.syllables { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.syllable { font: inherit; font-size: 1.2rem; font-weight: 600; padding: 10px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); cursor: pointer; }
.syllable:hover:not(:disabled) { border-color: var(--accent); }
.syllable.correct { border-color: #1a9e57; background: color-mix(in srgb, #1a9e57 18%, var(--bg)); }
.syllable.wrong { border-color: #d6453d; background: color-mix(in srgb, #d6453d 18%, var(--bg)); }
