/* ==========================================================================
   Poppins, self-hosted.
   Served from this origin rather than fonts.googleapis.com so that loading a
   page makes no third-party request. Under FERPA, "metadata about students'
   interaction with an app" counts as PII, and a school's privacy review will
   ask where page views go. The answer should be "nowhere".
   Latin and Latin-Extended only; Devanagari is not needed for this content.
   Poppins is licensed under the SIL Open Font License 1.1 - see
   /fonts/OFL.txt.
   ========================================================================== */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/poppins-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/poppins-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/poppins-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/poppins-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =============================================
   RotaryXC — Global Stylesheet

   BRAND COLORS ARE TOKENS. Do not hardcode a palette hex below —
   use the var() form so a tenant rebrand reaches it. The :root block
   that follows is the default (RotaryXC) palette; a tenant build
   replaces it wholesale from config/tenants/<slug>.json.

   Every colour is a token now, including the neutral greys. They are not
   brand, but they do have to change between light and dark, so they live in
   the generated block below rather than inline.

   See config/README.md for the token reference.
============================================= */

/* THEME:START - generated by scripts/build-tenant.py. Do not edit by hand. */
/* Default theme for this tenant: light. */
:root {
    color-scheme: light;
    --theme-name: "light";

    /* --- Surfaces --- */
    --bg:         #f3f6fa;
    --surface:    #ffffff;
    --surface-2:  #e7eef7;
    --sunken:     #dfe8f3;
    --chrome:     #ffffff;

    /* --- Text --- */
    --text:               #001f3f;
    --text-muted:         #16324f;
    --text-soft:          #2f4763;
    --text-dim:           #4a6076;
    --on-accent:          #ffffff;
    --on-accent-inverse:  #001f3f;
    --on-media:           #ffffff;
    --on-media-accent:    #ff6600;

    /* --- Lines --- */
    --border:       #d6dee8;
    --border-soft:  #e6ecf4;

    /* --- Accent --- */
    --accent:        #0047ab;
    --accent-hover:  #003687;
    --accent-tint:   #e6eefb;
    --gold:          #a84300;
    --gold-tint:     #fdeee3;

    /* --- Semantic --- */
    --danger:        #b00020;
    --danger-tint:   #fdecec;
    --info:          #036672;
    --info-tint:     #e4f2f4;
    --warn:          #7d6100;
    --success:       #117a38;
    --success-tint:  #e6f4ea;
    --mark-correct:  #2b914e;
    --mark-wrong:    #b00020;

    /* --- Highlight marks --- */
    --mark-green:    #117a38;
    --mark-yellow:   #846500;
    --mark-red:      #b00020;
    --mark-blue:     #1059b3;
    --mark-magenta:  #8a2bb8;
    --mark-amber:    #9e5700;

    /* --- Derived rgb triplets, for rgba() use --- */
    --chrome-rgb:    255, 255, 255;
    --accent-rgb:    0, 71, 171;
    --gold-rgb:      168, 67, 0;
}

/* An explicit choice from the toggle wins in both directions. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --theme-name: "dark";

    /* --- Surfaces --- */
    --bg:         #001f3f;
    --surface:    #0b2f55;
    --surface-2:  #143d68;
    --sunken:     #00162e;
    --chrome:     #001327;

    /* --- Text --- */
    --text:               #e9f0f8;
    --text-muted:         #cddcec;
    --text-soft:          #b3c7dd;
    --text-dim:           #a3b8d0;
    --on-accent:          #001f3f;
    --on-accent-inverse:  #ffffff;
    --on-media:           #ffffff;
    --on-media-accent:    #ff6600;

    /* --- Lines --- */
    --border:       #24466e;
    --border-soft:  #16375c;

    /* --- Accent --- */
    --accent:        #6cb4ff;
    --accent-hover:  #9acbff;
    --accent-tint:   #0a2c4d;
    --gold:          #ff8c3d;
    --gold-tint:     #33200f;

    /* --- Semantic --- */
    --danger:        #ff6b6b;
    --danger-tint:   #3d1620;
    --info:          #4fd1c5;
    --info-tint:     #06333a;
    --warn:          #ffd84d;
    --success:       #35d07f;
    --success-tint:  #0d3a26;
    --mark-correct:  #60fbad;
    --mark-wrong:    #ff6b6b;

    /* --- Highlight marks --- */
    --mark-green:    #1db954;
    --mark-yellow:   #ffd84d;
    --mark-red:      #ff5252;
    --mark-blue:     #4a9eff;
    --mark-magenta:  #d878ff;
    --mark-amber:    #ffb04d;

    /* --- Derived rgb triplets, for rgba() use --- */
    --chrome-rgb:    0, 19, 39;
    --accent-rgb:    108, 180, 255;
    --gold-rgb:      255, 140, 61;
}

:root[data-theme="light"] {
    color-scheme: light;
    --theme-name: "light";

    /* --- Surfaces --- */
    --bg:         #f3f6fa;
    --surface:    #ffffff;
    --surface-2:  #e7eef7;
    --sunken:     #dfe8f3;
    --chrome:     #ffffff;

    /* --- Text --- */
    --text:               #001f3f;
    --text-muted:         #16324f;
    --text-soft:          #2f4763;
    --text-dim:           #4a6076;
    --on-accent:          #ffffff;
    --on-accent-inverse:  #001f3f;
    --on-media:           #ffffff;
    --on-media-accent:    #ff6600;

    /* --- Lines --- */
    --border:       #d6dee8;
    --border-soft:  #e6ecf4;

    /* --- Accent --- */
    --accent:        #0047ab;
    --accent-hover:  #003687;
    --accent-tint:   #e6eefb;
    --gold:          #a84300;
    --gold-tint:     #fdeee3;

    /* --- Semantic --- */
    --danger:        #b00020;
    --danger-tint:   #fdecec;
    --info:          #036672;
    --info-tint:     #e4f2f4;
    --warn:          #7d6100;
    --success:       #117a38;
    --success-tint:  #e6f4ea;
    --mark-correct:  #2b914e;
    --mark-wrong:    #b00020;

    /* --- Highlight marks --- */
    --mark-green:    #117a38;
    --mark-yellow:   #846500;
    --mark-red:      #b00020;
    --mark-blue:     #1059b3;
    --mark-magenta:  #8a2bb8;
    --mark-amber:    #9e5700;

    /* --- Derived rgb triplets, for rgba() use --- */
    --chrome-rgb:    255, 255, 255;
    --accent-rgb:    0, 71, 171;
    --gold-rgb:      168, 67, 0;
}

/* Header logo artwork follows the theme. */
.topbar .logo .logo-img--dark { display: none; }
:root[data-theme="dark"] .topbar .logo .logo-img--light,
:root[data-theme="light"] .topbar .logo .logo-img--dark { display: none; }
:root[data-theme="dark"] .topbar .logo .logo-img--dark,
:root[data-theme="light"] .topbar .logo .logo-img--light { display: block; }

/* Print: the tenant's light brand colours on real white paper. */
@media print {
    :root, :root[data-theme="dark"], :root[data-theme="light"] {
        --theme-name: "print";

        /* --- Surfaces --- */
        --bg:         #ffffff;
        --surface:    #ffffff;
        --surface-2:  #f2f2f0;
        --sunken:     #f7f7f5;
        --chrome:     #ffffff;

        /* --- Text --- */
        --text:               #000000;
        --text-muted:         #222222;
        --text-soft:          #333333;
        --text-dim:           #555555;
        --on-accent:          #ffffff;
        --on-accent-inverse:  #000000;
        --on-media:           #ffffff;
        --on-media-accent:    #ff6600;

        /* --- Lines --- */
        --border:       #999999;
        --border-soft:  #cccccc;

        /* --- Accent --- */
        --accent:        #0047ab;
        --accent-hover:  #003687;
        --accent-tint:   #e6eefb;
        --gold:          #a84300;
        --gold-tint:     #fdeee3;

        /* --- Semantic --- */
        --danger:        #b00020;
        --danger-tint:   #fdecec;
        --info:          #036672;
        --info-tint:     #e4f2f4;
        --warn:          #7d6100;
        --success:       #117a38;
        --success-tint:  #e6f4ea;
        --mark-correct:  #2b914e;
        --mark-wrong:    #b00020;

        /* --- Highlight marks --- */
        --mark-green:    #117a38;
        --mark-yellow:   #846500;
        --mark-red:      #b00020;
        --mark-blue:     #1059b3;
        --mark-magenta:  #8a2bb8;
        --mark-amber:    #9e5700;

        /* --- Derived rgb triplets, for rgba() use --- */
        --chrome-rgb:    255, 255, 255;
        --accent-rgb:    0, 71, 171;
        --gold-rgb:      168, 67, 0;
    }
}
/* THEME:END */

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

/* === TYPOGRAPHY === */
h1 { color: var(--accent); margin-top: 0; }
h2 { color: var(--gold); }
h3 { color: var(--gold); }

a {
    color: var(--accent);
    text-decoration: none;
}

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

p, ul li {
    color: var(--text-muted);
    line-height: 1.6;
}

/* === TOPBAR === */
.topbar {
    /* STICKY, not fixed. iOS Safari/Chrome do not reposition `position: fixed`
       elements during momentum scroll or while the URL bar collapses, which
       made the header stack visibly lag and land mid-viewport. Sticky is
       handled by the compositor and tracks the scroll correctly. It also stays
       in normal flow, so it reserves its own space and `main` needs no
       margin-top compensation that could drift out of sync with it. */
    position: sticky;
    top: 0;
    height: 56px;
    background-color: var(--bg);
    border-bottom: 2px solid var(--gold);
    /* Must be > .topnav-overlay (100) so the mobile drawer (.topnav, nested
       inside .topbar) can paint above the overlay and capture its own taps.
       Without this, the overlay's <label for="nav-toggle"> intercepts taps
       on drawer items and closes the menu. */
    z-index: 200;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
}
.topbar .logo {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15em;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.topbar .logo:hover { color: var(--accent-hover); }

/* Light/dark toggle. Injected into .topbar by js/theme-toggle.js. Sized to
   match the hamburger so the two sit level on mobile. */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font: inherit;
    line-height: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* The topbar is flex with a gap, and .topbar-search already owns the one
   auto margin that pushes the right-hand group over. A second auto margin
   here would split the free space and drag the search box out of place, so
   the toggle just takes its position in the flow as the last child. */
.topbar .theme-toggle { order: 99; }

/* Account indicator. Injected into .topbar by js/account-widget.js, and only
   present when a grading service answers. Sits just before the theme toggle. */
.account-widget { position: relative; order: 98; flex-shrink: 0; }
.account-signin {
    order: 98;
    flex-shrink: 0;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.88em;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
}
.account-signin:hover { color: var(--accent); border-color: var(--accent); }

.account-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px 3px 3px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    max-width: 190px;
}
.account-chip:hover { border-color: var(--accent); }
.account-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--on-accent);
    font-size: 0.72em; font-weight: 700; flex-shrink: 0;
}
/* Staff get a different avatar colour. Acting as an instructor and acting as
   a student are different powers, and the difference should be visible without
   opening anything. */
.account-chip.role-instructor .acct-avatar,
.account-chip.role-admin .acct-avatar { background: var(--gold); }
.acct-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.acct-name {
    font-size: 0.8em; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-role { font-size: 0.68em; color: var(--text-dim); text-transform: capitalize; }

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    z-index: 250;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.acct-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 6px;
    display: flex; flex-direction: column; gap: 2px;
}
.acct-head span { color: var(--text-dim); font-size: 0.78em; word-break: break-all; }
/* Which school you are signed into. The same email can hold an account at two
   schools, so this is not decoration. */
.acct-head .acct-school { color: var(--gold); font-weight: 600; word-break: normal; }
.account-menu a,
.account-menu .acct-signout {
    display: block; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 5px;
    color: var(--text); text-decoration: none;
    background: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: 0.88em;
}
.account-menu a:hover,
.account-menu .acct-signout:hover { background: var(--surface-2); color: var(--accent); }
.account-menu .acct-signout { color: var(--danger); }

@media (max-width: 900px) {
    /* Keep the avatar and role, drop the name: the topbar is tight once the
       hamburger appears. */
    .acct-name { display: none; }
    .account-chip { max-width: none; padding: 3px 8px 3px 3px; }
}

/* Tenant logo image. build-tenant.py swaps the topbar text link for an <img>
   when a tenant supplies brand.logoImage. Constrained to the 56px topbar so a
   full-resolution mark cannot blow out the header height. */
.topbar .logo-img {
    display: block;
    height: 34px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}
.topbar-search {
    flex: 0 1 320px;
    margin-left: auto;
}
.topbar-search input {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.92em;
    padding: 8px 14px;
    box-sizing: border-box;
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--accent);
}
.topbar-search input::placeholder { color: var(--text-dim); }

/* Support button in topbar */
.topbar-support {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold) 100%);
    color: var(--bg) !important;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    white-space: nowrap;
}
.topbar-support:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    color: var(--bg) !important;
}

/* Glossary cues toggle — sits between topnav/search and the support button.
   Slider switch indicates state: track green + knob right when on, track grey + knob left when off.
   Body class `glossary-cues-off` flips both the switch and the link styling. */
.topbar-cues {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px;
    background: transparent;
    border: 1px solid var(--surface-2);
    color: var(--text-soft);
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s ease, color 0.15s ease;
    user-select: none;
    font-family: inherit;
    line-height: 1;
}
.topbar-cues:hover {
    border-color: var(--accent);
    color: var(--text);
}
.topbar-cues-switch {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 14px;
    background: var(--accent);
    border-radius: 999px;
    flex-shrink: 0;
    transition: background-color 0.18s ease;
}
.topbar-cues-switch::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-radius: 50%;
    transform: translateX(14px);  /* knob on the right when on (default) */
    transition: transform 0.18s ease, background-color 0.18s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
body.glossary-cues-off .topbar-cues-switch {
    background: var(--surface-2);
}
body.glossary-cues-off .topbar-cues-switch::after {
    transform: translateX(0);  /* knob slides to the left when off */
    background: var(--text-soft);
}
/* Strip the dotted underline + tooltip when cues are off, keep link clickable. */
body.glossary-cues-off .glossary-auto-link,
body.glossary-cues-off .glossary-auto-link:hover {
    color: inherit;
    border-bottom: none;
    cursor: inherit;
}
body.glossary-cues-off .glossary-tip {
    display: none !important;
}
@media (max-width: 900px) {
    .topbar-cues { padding: 4px 9px; font-size: 0.72em; gap: 6px; }
    .topbar-cues-switch { width: 24px; height: 12px; }
    .topbar-cues-switch::after { width: 10px; height: 10px; transform: translateX(12px); }
    body.glossary-cues-off .topbar-cues-switch::after { transform: translateX(0); }
}

/* === TOPNAV (horizontal) ===
   Lives inside .topbar, between the logo (left) and search/coffee (right).
   Center grouping: the four section dropdowns (Learn / Practice / Tools / About).
   Dropdowns open on hover, focus-within, or .is-open (toggled by site.js for click).
*/
.topnav {
    flex: 0 1 auto;
}
.topnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    align-items: stretch;
}
.topnav-item {
    position: relative;
    display: flex;
}
.topnav-trigger {
    background: transparent;
    border: 0;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.92em;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.topnav-trigger::after {
    content: "▾";
    font-size: 0.72em;
    color: var(--text-dim);
    transition: color 0.15s ease, transform 0.15s ease;
}
.topnav-trigger:hover,
.topnav-item:focus-within .topnav-trigger,
.topnav-item.is-open .topnav-trigger {
    color: var(--accent);
    background-color: var(--accent-tint);
}
.topnav-trigger:hover::after,
.topnav-item:focus-within .topnav-trigger::after,
.topnav-item.is-open .topnav-trigger::after {
    color: var(--accent);
    transform: translateY(1px);
}
.topnav-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background-color: var(--chrome);
    border: 1px solid var(--surface);
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 95;
}
.topnav-item:hover > .topnav-menu,
.topnav-item:focus-within > .topnav-menu,
.topnav-item.is-open > .topnav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.topnav-menu a {
    display: block;
    color: var(--text);
    text-decoration: none;
    padding: 7px 16px;
    font-size: 0.9em;
    border-left: 2px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.topnav-menu a:hover,
.topnav-menu a.active {
    background-color: var(--accent-tint);
    color: var(--accent);
    border-left-color: var(--accent);
}

/* Highlight the Logbook entry as the most-used tool */
.topnav-menu .nav-emphasis {
    color: var(--gold) !important;
    font-weight: 700;
}
.topnav-menu .nav-emphasis::before {
    content: "✱ ";
    color: var(--gold);
}
.topnav-menu .nav-emphasis:hover { color: var(--accent) !important; }

/* === NESTED SUBMENU (inline) ===
   .topnav-submenu wraps a top-level menu entry that has children. The
   children render INLINE below the parent (indented, with an arrow prefix)
   so the whole structure reads as one vertical list — no sideways flyout.
   The parent link is still clickable; the children are always visible while
   the parent menu is open.

   The .topnav-submenu--collapsible variant adds a click-to-toggle chevron
   for entries with many children (e.g. Courses → PPL/IFR/CPL/CFI/sUAS),
   so the children stay hidden until the user explicitly opens them. That
   prevents items below from being pushed down when the dropdown opens. */
.topnav-submenu > a.topnav-submenu-trigger {
    display: block;
}

.topnav-flyout {
    /* Inline list — always visible while the parent .topnav-menu is open
       (overridden for .topnav-submenu--collapsible). */
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* Collapsible variant (Courses): one full-width toggle button — clicks
   anywhere on the row open the inline flyout. The chevron is pinned to
   the right as a visual affordance and rotates 90° when open. */
.topnav-submenu--collapsible { display: block; }
.topnav-submenu-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    border-left: 2px solid transparent;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    line-height: 1.3;
    padding: 7px 16px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.topnav-submenu-toggle .topnav-submenu-label {
    flex: 1;
}
.topnav-submenu-toggle .chevron {
    color: var(--text-dim);
    font-size: 0.85em;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.18s ease, color 0.15s ease;
}
.topnav-submenu-toggle:hover,
.topnav-submenu--collapsible.is-open > .topnav-submenu-toggle {
    background-color: var(--accent-tint);
    color: var(--accent);
    border-left-color: var(--accent);
}
.topnav-submenu-toggle:hover .chevron,
.topnav-submenu--collapsible.is-open > .topnav-submenu-toggle .chevron {
    color: var(--accent);
}
.topnav-submenu--collapsible.is-open > .topnav-submenu-toggle .chevron {
    transform: rotate(90deg);
}
.topnav-submenu--collapsible > .topnav-flyout { display: none; }
.topnav-submenu--collapsible.is-open > .topnav-flyout { display: block; }
.topnav-flyout a {
    display: block;
    color: var(--text-soft);
    text-decoration: none;
    padding: 6px 16px 6px 36px;
    font-size: 0.88em;
    border-left: 2px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.topnav-flyout a::before {
    content: "→ ";
    color: var(--text-dim);
    margin-right: 4px;
    transition: color 0.15s ease;
}
.topnav-flyout a:hover,
.topnav-flyout a.active {
    background-color: var(--accent-tint);
    color: var(--accent);
    border-left-color: var(--accent);
}
.topnav-flyout a:hover::before,
.topnav-flyout a.active::before { color: var(--accent); }

/* Mobile drawer overlay (only used at narrow widths; hidden on desktop) */
.topnav-overlay { display: none; }

/* === CONTEXTUAL SUB-NAV (horizontal strip) ===
   Populated by site.js on course/topic/wiki sub-pages. Sits below the topbar
   as a thin scrollable row of peer pages so users can move within a course
   without leaving the page.
*/
.subnav {
    display: none;
}
.subnav.has-context {
    /* Outer chrome — fixed strip below the topbar. Overflow is HIDDEN here so
       the fade-gradient overlays (::before / ::after) stay pinned to the
       viewport edges instead of scrolling with the content. The actual
       horizontal scroll happens on the inner .subnav-scroll element. */
    display: block;
    position: sticky;
    top: 56px;
    height: 40px;
    background-color: var(--chrome);
    border-bottom: 1px solid var(--surface);
    z-index: 85;
    overflow: hidden;
}

/* Inner horizontal-scroll track */
.subnav-scroll {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
    padding: 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    /* Hide the visible scrollbar — the fade overlays + chevron handle
       discoverability instead. Wheel/drag/touch scrolling still works. */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* legacy Edge / IE */
    scroll-behavior: smooth;
}
.subnav-scroll::-webkit-scrollbar { display: none; }  /* Chromium / Safari */

/* Fade-gradient affordances — appear only when there's actually overflow on
   that side. JS toggles .has-overflow / .is-scrolled / .is-end on .subnav. */
.subnav.has-context::before,
.subnav.has-context::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 56px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2;
}
.subnav.has-context::before {
    left: 0;
    background: linear-gradient(to right, var(--chrome) 0%, rgba(var(--chrome-rgb),0) 100%);
}
.subnav.has-context::after {
    right: 0;
    background: linear-gradient(to left, var(--chrome) 0%, rgba(var(--chrome-rgb),0) 100%);
}
/* Right fade visible when overflow exists and we haven't scrolled to the end */
.subnav.has-context.has-overflow:not(.is-end)::after { opacity: 1; }
/* Left fade visible only after the user has scrolled away from the start */
.subnav.has-context.is-scrolled::before { opacity: 1; }

/* Right-edge chevron — explicit "scroll for more" hint that rides on top of
   the fade. Only visible when there's overflow on the right. */
.subnav.has-context.has-overflow:not(.is-end) .subnav-scroll::after {
    content: '›';
    position: sticky;
    right: 10px;
    margin-left: auto;
    color: var(--gold);
    font-size: 1.9em;
    line-height: 1;
    font-weight: 700;
    padding: 0 8px;
    z-index: 3;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
    animation: subnav-nudge 1.6s ease-in-out infinite;
}
@keyframes subnav-nudge {
    0%, 100% { transform: translateX(0); opacity: 0.85; }
    50%      { transform: translateX(3px); opacity: 1; }
}
.subnav .nav-context-track {
    color: var(--accent);
    font-size: 0.88em;
    font-weight: 700;
    margin: 0 0 0 auto;     /* auto-margin pair with topics centers the group */
    padding: 0;
    flex-shrink: 0;
}
.subnav .nav-context-track a {
    color: var(--accent);
    text-decoration: none;
}
.subnav .nav-context-track a:hover { text-decoration: underline; }

.subnav .nav-context-topics {
    list-style: none;
    /* Pair with .nav-context-track's left auto-margin: when there's extra room
       in the row, the two auto-margins split it evenly and the group centers.
       When content overflows, both auto-margins collapse to 0 and the row
       scrolls normally with the chevron taking over on the right. */
    margin: 0 auto 0 0;
    padding: 0;
    display: flex;
    gap: 0;
    align-items: center;
    flex-shrink: 0;
}
.subnav .nav-context-topics > li {
    margin: 0;
    position: relative;
}
/* Vertical divider between every topic — full-height, lighter gray so it's
   visible against the dark subnav. */
.subnav .nav-context-topics > li + li {
    margin-left: 12px;
    padding-left: 14px;
}
.subnav .nav-context-topics > li + li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 22px;
    background-color: var(--surface-2);
}
.subnav .nav-context-topics > li > a {
    color: var(--text);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    display: inline-block;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.subnav .nav-context-topics > li > a:hover {
    background-color: var(--accent-tint);
    color: var(--accent);
}
.subnav .nav-context-topics > li > a.active {
    color: var(--accent);
    background-color: var(--accent-tint);
    font-weight: 700;
}

/* === ROW 3 — SUB-PAGES OF THE ACTIVE TOPIC ===
   A third fixed strip below the main subnav, only injected by site.js when
   the active topic has children. Slightly darker background and tighter
   chips so it reads as nested context, not a peer of the topics row. */
.subnav-l3 {
    display: none;
}
.subnav-l3.has-context {
    display: block;
    position: sticky;
    top: 96px;            /* topbar 56 + subnav 40 */
    height: 32px;
    background-color: var(--sunken);
    border-bottom: 1px solid var(--surface);
    z-index: 84;
    overflow: hidden;
}
.subnav-l3 .nav-context-subpages {
    list-style: none;
    /* margin: 0 auto centers the row when content fits; collapses to 0 and
       lets the row scroll naturally when content overflows. */
    margin: 0 auto;
    padding: 0;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

/* Subtle hover-preview cue — the third bar gets a faint gold top accent when
   it's showing siblings of a non-active topic. Helps distinguish "I'm
   previewing" from "I'm looking at the active topic's children". */
.subnav-l3.has-context.is-preview {
    border-top: 1px solid rgba(var(--gold-rgb), 0.35);
}
.subnav-l3 .nav-context-subpages li { margin: 0; }
.subnav-l3 .nav-context-subpages li a {
    color: var(--text-soft);
    text-decoration: none;
    padding: 4px 10px;
    font-size: 0.82em;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.subnav-l3 .nav-context-subpages li a:hover {
    background-color: var(--accent-tint);
    color: var(--accent);
}
.subnav-l3 .nav-context-subpages li a.active {
    color: var(--accent);
    background-color: var(--accent-tint);
    font-weight: 700;
}

/* Fade overlays + chevron on the third bar (mirror the main subnav rules) */
.subnav-l3.has-context::before,
.subnav-l3.has-context::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 56px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2;
}
.subnav-l3.has-context::before {
    left: 0;
    background: linear-gradient(to right, var(--sunken) 0%, rgba(14,14,14,0) 100%);
}
.subnav-l3.has-context::after {
    right: 0;
    background: linear-gradient(to left, var(--sunken) 0%, rgba(14,14,14,0) 100%);
}
.subnav-l3.has-context.has-overflow:not(.is-end)::after { opacity: 1; }
.subnav-l3.has-context.is-scrolled::before { opacity: 1; }
.subnav-l3.has-context.has-overflow:not(.is-end) .subnav-scroll::after {
    content: '›';
    position: sticky;
    right: 10px;
    margin-left: auto;
    color: var(--gold);
    font-size: 1.6em;
    line-height: 1;
    font-weight: 700;
    padding: 0 8px;
    z-index: 3;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
    animation: subnav-nudge 1.6s ease-in-out infinite;
}

/* === LAYOUT === */
main {
    padding: 24px 32px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

footer {
    background-color: var(--chrome);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--surface);
}

footer p {
    color: var(--text);
    margin: 0 0 8px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 15px;
}

footer a:hover {
    color: var(--accent-hover);
}

/* Safety notice above the copyright line. Muted, but deliberately still on a
   real contrast token — this is the one line in the footer that has to survive
   being skimmed, so it must not fade into the chrome. Class-qualified so it
   beats `footer p`'s margin regardless of source order. */
footer .footer-disclaimer {
    color: var(--text-muted);
    font-size: 0.85em;
    line-height: 1.5;
    max-width: 62ch;
    margin: 16px auto 0;
}

/* Platform attribution on licensed tenant builds. Emitted by
   scripts/build-tenant.py when license.showPoweredBy is true; absent from
   the default build, so this rule is normally inert. */
.powered-by {
    display: inline-block;
    margin-left: 6px;
    color: var(--text-dim);
    font-size: 0.9em;
}

.powered-by a {
    color: var(--text-dim);
    margin: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.powered-by a:hover {
    color: var(--text);
}

/* === HERO === */
/* Anything sitting on a photograph uses the --on-media tokens, which are the
   same value in both themes. A photo is a dark ground whether the page around
   it is light or dark, so text over it must not follow the page theme — doing
   so put near-black type on a dark helicopter photo in light mode. The scrim
   below guarantees contrast regardless of which image a tenant supplies. */
.hero {
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--on-media);
    position: relative;
    overflow: hidden;
}
/* Scrim. Text-shadow alone was carrying legibility, which fails on a bright
   image; this makes it independent of the photo. It also fades the hero into
   the page so the section below emerges instead of hard-cutting off the
   photograph.

   There were two `.hero::before` rules here. The second one won on order and
   quietly replaced the first, so the 0.70 band below -- which was measured
   against the actual hero, not guessed -- had not been in effect since it was
   written, and the heading was riding on its text-shadow alone. The second
   rule also faded to a hardcoded rgba(26,26,26), the old dark background,
   which put a near-black band above a white page once the site went light.

   Stops: at 0.55 the heading fell to 2.07:1 over the brightest part of the
   sky. 0.70 across the band where the text sits clears large-text AA even
   against pure white pixels, while the lighter top still shows the photo. The
   final stop is var(--bg), so the fade lands on whatever the theme is.

   That last stop holds until 88%, not 74%. Fading a night photograph into a
   white page over a quarter of the hero's height washed the lower third to
   milk -- the skids and the pad went foggy well before the edge. The blend
   still happens, it just happens at the seam instead of across the subject. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0,0,0,0.34) 0%, rgba(0,0,0,0.70) 38%,
        rgba(0,0,0,0.70) 88%, var(--bg) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Lift the hero content above the overlay. */
.hero > * {
    position: relative;
    z-index: 1;
}

/* Use on index landing page for full-viewport hero */
.hero--full {
    height: 100vh;
    height: 100dvh;
    /* The topbar is in flow (sticky), so pull the hero up under it — this
       full-bleed hero is meant to start at the very top of the viewport. */
    margin-top: -56px;
}

.hero h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--on-media-accent);
    text-shadow: 0 2px 14px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.7);
}

.hero p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto;
    color: var(--on-media);
    text-shadow: 0 2px 10px rgba(0,0,0,0.85), 0 0 3px rgba(0,0,0,0.6);
}

/* === BUTTONS === */
.cta-btn {
    display: inline-block;
    background-color: var(--accent);
    color: var(--on-accent-inverse);
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cta-btn:hover {
    background-color: var(--accent-hover);
    color: var(--on-accent-inverse);
}

.pilot-button {
    display: inline-block;
    background-color: var(--border);
    color: var(--text);
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.pilot-button:hover {
    background-color: var(--gold);
    color: var(--bg);
}

/* === CARDS === */
.course-card {
    background-color: var(--surface);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.course-card p,
.course-card ul li {
    color: var(--text-soft);
}

/* === HOME — SERVICES === */
.services {
    padding: 50px 20px;
    text-align: center;
    background-color: var(--chrome);
}

.services h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--accent);
}

.service-item {
    display: inline-block;
    width: 30%;
    margin: 0 2%;
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
    vertical-align: top;
}

.service-item h3 {
    color: var(--gold);
    margin-bottom: 15px;
}

.service-item p {
    color: var(--text-muted);
}

/* === HOME — TESTIMONIALS === */
.testimonials {
    padding: 50px 20px;
    background-color: var(--sunken);
    text-align: center;
}

.testimonials h2 {
    color: var(--accent);
    margin-bottom: 40px;
    font-size: 2.5em;
}

.testimonial {
    display: inline-block;
    width: 30%;
    margin: 0 2%;
    padding: 20px;
    background-color: var(--surface);
    border-radius: 8px;
    vertical-align: top;
}

.testimonial p {
    color: var(--text-muted);
    font-style: italic;
}

.testimonial h3 {
    margin-top: 10px;
    color: var(--gold);
}

/* === BLOG === */
.featured {
    padding: 50px 20px;
    text-align: center;
    background-color: var(--chrome);
}

.featured h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--accent);
}

.featured-posts {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.post-card {
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    text-align: left;
}

.post-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.post-card h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.post-card p {
    color: var(--text-muted);
}

.read-more {
    color: var(--accent);
}

.read-more:hover {
    color: var(--accent-hover);
}

.blog-grid {
    padding: 50px 20px;
    background-color: var(--sunken);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.grid-item {
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
}

.grid-item img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.grid-item h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.grid-item p {
    color: var(--text-muted);
}

.search-bar {
    text-align: center;
    margin-bottom: 30px;
}

.search-bar input {
    padding: 10px;
    width: 80%;
    max-width: 400px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    background-color: var(--surface);
    color: var(--text);
}

/* === GALLERY === */
.upload-section {
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-section h2 {
    color: var(--accent);
}

.upload-input {
    margin-top: 10px;
    background-color: var(--surface-2);
    color: var(--on-accent-inverse);
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    border: none;
    font-size: 16px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    background-color: var(--surface-2);
    padding: 15px;
    border-radius: 8px;
}

.gallery-item img,
.gallery-item iframe {
    width: 100%;
    border-radius: 8px;
}

.video-section {
    margin-bottom: 40px;
}

.video-section h2 {
    color: var(--accent);
}

.video-container {
    margin-bottom: 20px;
}

.video-container iframe {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

.category {
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.category h2 {
    color: var(--gold);
}

.category p {
    color: var(--text-muted);
}

/* === CONTACT === */
.contact-info,
.socials,
.bio-section {
    margin-bottom: 40px;
}

.contact-info p,
.socials p {
    color: var(--text-muted);
    font-size: 1.2em;
}

.bio-section img {
    display: block;
    margin: 0 auto 20px;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    object-fit: cover;
}

.bio-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

.bio-section p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1em;
}

/* === DASHBOARD === */
.progress-bar {
    width: 100%;
    background-color: var(--info-tint);
    border-radius: 8px;
    height: 20px;
    margin-bottom: 10px;
}

.progress {
    background-color: var(--gold);
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}

.progress-item {
    margin-bottom: 30px;
}

.meter {
    background-color: var(--info-tint);
    border-radius: 0.5rem;
    height: 1.25rem;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.meter span {
    display: block;
    height: 100%;
    background-color: var(--gold);
    transition: width 0.5s ease-in-out;
}

.meter span.progress {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    font-size: 0.875rem;
}

/* === PILOT CARD === */
.pilot-card {
    background-color: var(--info-tint);
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 400px;
}

.pilot-card-header h2 {
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.pilot-card-body {
    display: flex;
    justify-content: center;
}

/* === SMART FEEDBACK (dashboard) === */
.smart-feedback {
    display: grid;
    gap: 14px;
    margin: 16px 0 30px;
}
.feedback-block {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 18px 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border-left: 3px solid var(--accent);
}
.feedback-block.weak { border-left-color: var(--gold); }
.feedback-block.strong { border-left-color: var(--accent); }
.feedback-block .feedback-icon {
    font-size: 1.6em;
    flex-shrink: 0;
    line-height: 1;
}
.feedback-block .feedback-content { flex: 1; }
.feedback-block h4 {
    color: var(--gold);
    margin: 0 0 6px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.feedback-block.strong h4 { color: var(--accent); }
.feedback-block p {
    color: var(--text);
    margin: 4px 0;
    font-size: 0.92em;
    line-height: 1.5;
}
.feedback-list { list-style: none; padding: 0; margin: 8px 0 0; }
.feedback-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--bg);
}
.feedback-list li:last-child { border-bottom: none; }
.feedback-stat {
    color: var(--text-dim);
    font-size: 0.85em;
    margin-left: 8px;
}
.feedback-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.feedback-cta {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.feedback-cta:hover { border-color: var(--accent); background-color: var(--accent-tint); }

/* === FURTHER READING (reusable component on course pages) === */
.further-reading {
    background: linear-gradient(135deg, var(--accent-tint) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px;
    margin: 32px 0;
}
.further-reading h2,
.further-reading h3 {
    color: var(--gold);
    margin: 0 0 8px;
    font-size: 0.92em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: none;
    padding-bottom: 0;
}
.further-reading .fr-intro {
    color: var(--text-soft);
    font-size: 0.92em;
    margin: 4px 0 14px;
    line-height: 1.5;
}
.further-reading ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}
.further-reading li {
    padding: 8px 0;
    color: var(--text);
    font-size: 0.92em;
    border-bottom: 1px solid var(--bg);
}
.further-reading li:last-child { border-bottom: none; }
.further-reading li a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}
.further-reading li a:hover { text-decoration: underline; }
.further-reading li .fr-tag {
    display: inline-block;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.7em;
    padding: 1px 6px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.further-reading li .fr-tag.faa { color: var(--mark-amber); border-color: var(--gold-tint); }
.further-reading li .fr-tag.ac { color: var(--gold); border-color: var(--gold-tint); }
.further-reading li .fr-tag.reg { color: var(--info); border-color: var(--info-tint); }
.further-reading li .fr-tag.local { color: var(--accent); border-color: var(--accent-tint); }
.further-reading li .fr-desc {
    color: var(--text-dim);
    font-size: 0.85em;
    margin-top: 2px;
    margin-left: 0;
}

/* === STUDY TOOL CALLOUT (on course pages) === */
.study-tools-callout {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin: 24px 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.study-tools-callout .stc-label {
    color: var(--text-dim);
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.study-tools-callout .stc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.study-tools-callout a {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 700;
}
.study-tools-callout a:hover { border-color: var(--accent); background-color: var(--accent-tint); }

/* === MOBILE NAV — HAMBURGER + TOPNAV DRAWER === */
.nav-toggle-checkbox { display: none; }
.hamburger {
    display: none;
    background-color: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.2em;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.hamburger:active { background-color: var(--border); }

/* === COURSE LANDING PAGES === */
/* A course index is a signpost, not an article. Centring the header block and
   the section headings makes that read at a glance the moment the page opens.
   Card interiors stay left-aligned on purpose: those are multi-line
   descriptions, and centred body copy is slower to read and leaves every card
   with a ragged left edge. */
.course-landing > a {              /* the "\2190 Back to ..." link */
    display: block;
    text-align: center;
}
.course-landing > h1,
.course-landing > h2,              /* "Course Syllabus" / "Course Modules"  */
.course-landing > div > h2,        /* "FAA Hour Requirements"               */
.course-landing > section > h2 {   /* "Reference Material"                  */
    text-align: center;
}
/* Deliberately one level deep. A bare `.course-landing h2` also catches the
   track cards on /courses/, whose titles are h2 -- centring those left the
   card grids inconsistent with the syllabus cards, which use h3 and stay
   left. Section headings centre; anything inside a card does not. */
.course-landing > h1 { text-wrap: balance; }
.course-landing > p {              /* the lede: a standfirst, not body copy */
    text-align: center;
    max-width: 90ch;
    margin: 14px auto 32px;
    font-size: 1.0625rem;
    line-height: 1.7;
    /* `balance` evens the lines by SHORTENING them, which stacked this into a
       narrow three-line block inside an 1100px column. `pretty` only pulls
       back a trailing orphan, so the measure stays wide. */
    text-wrap: pretty;
}

/* === ADHERE-TO WARNING === */
/* A safety notice, not a card. It carries no box: a bubble makes it look like
   one more block of page furniture, and this is the line a reader has to take
   with them. Plain red text, first thing in <main>, above the breadcrumb --
   there is nothing on the page more important than "follow your POH". */
.warning-box {
    margin: 0 0 20px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
}
.warning-box p {
    color: var(--danger);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    /* No measure cap. A reading paragraph wants ~70 characters, but this is a
       notice, not prose: held to 78ch it wrapped into a three-line block that
       read as another paragraph to skim. Across the full column it runs as a
       banner line above everything. */
}
.warning-box strong { color: var(--danger); }

/* === ON-THIS-PAGE RAIL === */
/* A table of contents in the left margin: where you are in the page, and a
   way to jump. Content is a fixed 1100px column, so the rail is positioned
   against the viewport centre rather than floated -- and it only appears once
   the margin is genuinely wide enough to hold it without crowding the text. */
.page-toc {
    --toc-w: 190px;
    --toc-gap: 24px;
    /* Half the rail's footprint. The content column centres itself, so without
       shifting both by this the rail hangs off the left edge and every pixel of
       slack lands on the right -- measured 71px left of the rail against 293px
       right of the content. Centre the rail and the column as one composition
       instead. */
    --toc-shift: calc((var(--toc-w) + var(--toc-gap)) / 2);
    display: none;
    position: fixed;
    top: 150px;
    left: calc(50% - 550px - var(--toc-w) - var(--toc-gap) + var(--toc-shift));
    width: var(--toc-w);
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    overflow-x: hidden;                /* never a sideways scrollbar in a rail */
    font-size: 0.82rem;
    z-index: 5;
}
@media (min-width: 1540px) {
    .page-toc { display: block; }
    /* Only where a rail was actually built -- a page without one stays centred.
       TRANSFORM, not margin. `has-page-toc` is added by JS after first paint,
       so shifting `main` with margin-left relaid out the whole column and
       scored a 0.295 Cumulative Layout Shift in the field -- the worst element
       on the site. A transform paints the same offset without touching layout,
       and CLS explicitly does not count transform movement. `main` keeps its
       auto margins, so this is "centre it, then push right by half the rail",
       which is what the old calc() worked out to. */
    body.has-page-toc main {
        transform: translateX(calc((190px + 24px) / 2));
    }
}
.page-toc-title {
    margin: 0 0 10px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.page-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border);
}
.page-toc li { margin: 0; }
.page-toc a {
    display: block;
    padding: 7px 0 7px 14px;
    margin-left: -2px;                 /* sit the marker on top of the rail */
    border-left: 2px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.35;
    /* ACS task titles carry unbroken runs like
       "Runway/Taxiway/Heliport/Helipad" that will not wrap on their own, and
       overflow-y:auto forces overflow-x to compute to auto as well -- so the
       rail grew a horizontal scrollbar. Break them instead. */
    overflow-wrap: anywhere;
}

/* Per-section jump list, on the few pages dense enough to want one. Sits with
   the section it belongs to; the rail carries only the sections themselves. */
.section-jump {
    margin: 6px 0 18px;
    border-left: 2px solid var(--border);
    padding-left: 14px;
}
.section-jump > summary {
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.82em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    list-style: none;
    padding: 4px 0;
}
.section-jump > summary::-webkit-details-marker { display: none; }
.section-jump > summary::before {
    content: "\25B8 ";                 /* ▸ */
    color: var(--accent);
    display: inline-block;
    transition: transform .15s ease;
}
.section-jump[open] > summary::before { transform: rotate(90deg); }
.section-jump > summary:hover { color: var(--text); }
.section-jump ul {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    columns: 2;
    column-gap: 24px;
}
.section-jump li { break-inside: avoid; margin: 0 0 4px; }
.section-jump a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
}
.section-jump a:hover { color: var(--accent); }
@media (max-width: 760px) { .section-jump ul { columns: 1; } }
.page-toc a.sub {                      /* h3: a card or sub-section under an h2 */
    padding-left: 26px;
    font-size: 0.95em;
}
/* Leaves the page rather than scrolling within it. Marked, because a rail that
   silently mixes the two makes the reader guess which kind of click they are
   about to make. */
.page-toc a.goes::after {
    content: " \2192";
    /* The site's accent, not a muted grey: this arrow is the affordance that
       says the entry leaves the page, so it should read as clickable. */
    color: var(--accent);
}
.page-toc a.goes:hover { color: var(--accent); }
.page-toc a:hover { color: var(--text); }
.page-toc a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.page-toc a[aria-current="true"] {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Jump targets have to clear the fixed topbar and its subnav row. */
main h2, main h3 { scroll-margin-top: var(--jump-offset, 140px); }

/* scroll-behavior is smooth site-wide; honour a request for less motion. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* === STUDY TOOLS AS A RIGHT-HAND RAIL === */
/* Only with the left rail present, so the page is symmetric: rail, content,
   tools. 1620px is where 190 + 24 + 1100 + 24 + 190 fits with margins to
   spare; below it the bar stays where it was, in the flow. */
@media (min-width: 1620px) {
    body.has-study-rail .study-tools-callout.is-rail {
        position: fixed;
        top: 150px;
        left: calc(50% + 550px + 24px);
        width: 190px;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        z-index: 5;
    }
    body.has-study-rail .study-tools-callout.is-rail .stc-actions {
        flex-direction: column;
        width: 100%;
    }
    body.has-study-rail .study-tools-callout.is-rail a {
        text-align: center;
    }
    /* With a rail on each side the composition centres on its own, so the
       single-rail half-shift has to come back off or everything leans right. */
    body.has-page-toc.has-study-rail main {
        margin-left: auto;
        margin-right: auto;
    }
    body.has-page-toc.has-study-rail .page-toc {
        left: calc(50% - 550px - 214px);
    }
    /* Tools but no rail -- an index page. Mirror of the single-rail shift:
       lean the column left by half the panel so the two centre together. The
       panel has to travel with it, or the gap grows by exactly the shift. */
    body.has-study-rail:not(.has-page-toc) main {
        margin-left: calc(50% - 550px - (190px + 24px) / 2);
        margin-right: auto;
    }
    body.has-study-rail:not(.has-page-toc) .study-tools-callout.is-rail {
        left: calc(50% + 550px + 24px - (190px + 24px) / 2);
    }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar-search { display: none; }
    .topbar-support { padding: 6px 10px; font-size: 0.78em; }

    /* Hamburger replaces the inline topnav at narrow widths */
    .hamburger { display: flex; }

    /* Topnav becomes a slide-down drawer beneath the topbar.
       The closed-state translate must subtract the element's own height
       PLUS the top offset — `translateY(-110%)` is relative to the
       drawer's height, so a short drawer (~200px) only moves ~220px up
       from top:56px, leaving its bottom edge ~36px below the viewport
       top (the last item "About" peeks through). calc(-100% - 60px)
       guarantees the bottom edge clears y=0 regardless of content size. */
    .topnav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 56px);
        max-height: calc(100dvh - 56px);
        background-color: var(--chrome);
        border-bottom: 1px solid var(--surface);
        z-index: 150;
        overflow-y: auto;
        transform: translateY(calc(-100% - 60px));
        transition: transform 0.25s ease;
        padding: 8px 0;
        visibility: hidden;
        pointer-events: none;
    }
    .topnav-list {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    .topnav-item { display: block; }
    .topnav-trigger {
        width: 100%;
        justify-content: space-between;
        height: 44px;
        border-radius: 0;
        padding: 0 20px;
    }
    .topnav-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        background-color: var(--sunken);
        padding: 4px 0 8px;
        display: none;
        min-width: 0;
    }
    .topnav-item.is-open > .topnav-menu,
    .topnav-item:focus-within > .topnav-menu { display: block; }
    .topnav-menu a { padding: 8px 28px; font-size: 0.92em; }

    /* Nested submenu is already inline-indented globally; just give the
       children a touch more breathing room on the mobile drawer. */
    .topnav-flyout a { padding: 10px 24px 10px 44px; font-size: 0.9em; }

    /* Mobile-only overlay behind the drawer */
    .topnav-overlay {
        display: block;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 56px);
        height: calc(100dvh - 56px);
        background: rgba(0,0,0,0.6);
        z-index: 100;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }

    /* Open state — checkbox driven */
    .nav-toggle-checkbox:checked ~ .topbar .topnav,
    .nav-toggle-checkbox:checked ~ .topnav {
        transform: translateY(0);
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        visibility: visible;
        pointer-events: auto;
    }
    .nav-toggle-checkbox:checked ~ .topnav-overlay {
        opacity: 1;
        visibility: visible;
    }

    main, footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Sub-nav scrolls horizontally on mobile too — already does, just tighten */
    .subnav.has-context { padding: 0 12px; gap: 12px; }

    .service-item,
    .testimonial {
        display: block;
        width: 90%;
        margin: 10px auto;
    }

    .hero { height: 40vh; }
    .hero--full { height: 60vh; height: 60dvh; }
    .hero h1 { font-size: 2.2em; }
    .meter { height: 1rem; }

    /* Tighten cards/grids on mobile */
    .course-card, .feature-card, .topic-card, .track-card, .syllabus-card,
    .area-section, .question-card, .cert-block {
        padding: 18px;
    }
    .course-card h2, .area-section h2 { font-size: 1.2em; }

    /* Topic page mnemonic cards — wider on mobile */
    .mnemonic-grid, .pill-grid, .topic-grid, .feature-grid,
    .course-track, .track-row, .syllabus-grid, .post-list {
        grid-template-columns: 1fr !important;
    }

    /* Quiz / search adjustments.
       Deliberately NOT flex-direction: column. 900px is the hamburger
       breakpoint, and a wrapped row still fits comfortably at that width —
       stacking everything put Reset, Export and Import on three separate
       lines. flex-wrap already handles it; the score just has to give up its
       auto margin so it stops forcing an awkward break. */
    .quiz-controls .score { margin-left: 0; }
    .search-box { flex-wrap: wrap; }
    /* On narrow screens the 22-letter jump nav takes 3-4 rows when sticky,
       which dominates the viewport. Hide the letters and keep just the search
       bar — typing a term is faster than alphabet-hunting on a phone anyway. */
    .alpha-nav a { display: none; }
    .alpha-nav .search-box { margin-left: 0; width: 100%; }
    .alpha-nav input { width: 100%; min-width: 0; }

    /* Logbook two-column → one */
    .logbook-grid { grid-template-columns: 1fr !important; }

    /* ACS reference: stop sticky TOC from eating content */
    .area-toc { position: relative; }

    /* Smaller heading */
    h1 { font-size: 1.7em; }
    h2 { font-size: 1.3em; }
}

@media (max-width: 560px) {
    /* Below this the labelled selects genuinely are too wide to share a row. */
    .quiz-controls > div:not(.quiz-actions) { width: 100%; }
    .quiz-controls select { width: 100%; }
    .search-box { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8em; }
    .hero p { font-size: 1em; }
    .meter { height: 0.875rem; }
    .stat-grid, .summary-grid { grid-template-columns: 1fr 1fr !important; }

    /* Tighten table on small screens */
    table { font-size: 0.85em; }
    table th, table td { padding: 4px !important; }
}

/* ===== Auto-glossary linker ===== */
.glossary-auto-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--gold);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.glossary-auto-link:hover {
    color: var(--gold);
    border-bottom-color: var(--accent);
}
.glossary-tip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: max-content;
    max-width: 340px;
    background-color: var(--sunken);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 11px 16px 13px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.7);
    pointer-events: none;
    cursor: default;
    opacity: 0;
    transform: translateY(4px);
    /* display:none while closed, not merely opacity:0.
       Every tip is absolutely positioned 340px wide from its own underlined
       word, and an invisible-but-laid-out box parks past the right edge of a
       phone screen: 365px of viewport against 611px of document, so every
       page with a glossary term scrolled sideways on every phone.

       Capping max-width cannot fix that -- the problem is where the box
       starts, not how wide it is -- and clipping at the root does not either:
       measured in Chrome, `overflow-x: clip` and `hidden` on <html> both left
       the content moving 200px, because clip is not propagated to the
       viewport from the root. Removing the box from layout is what works.

       The fade survives via allow-discrete + @starting-style; where those are
       unsupported the tip appears instantly, which is a fair trade for not
       shipping a sideways scroll on every phone. Nothing measures the tip
       while it is closed -- positionTip() runs on mouseover and after the
       open class is added, by which point it is displayed. */
    display: none;
    transition: opacity 0.18s ease 0.18s, transform 0.18s ease 0.18s,
                display 0.18s allow-discrete 0.18s;
    z-index: 1000;
    text-align: left;
    color: var(--text);
    font-weight: 400;
    font-style: normal;
}
/* Invisible bridge over the 10px gap between the word and the tooltip — keeps
   :hover continuous so the mouse can travel up to click "Open in glossary →"
   without the tooltip vanishing mid-flight. Only "active" while the tip is
   shown, otherwise it would catch hovers above any underlined word. */
.glossary-tip::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -14px;
    height: 14px;
    pointer-events: none;
}
.glossary-auto-link:hover .glossary-tip,
.glossary-auto-link.glossary-tip-open .glossary-tip {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}
@starting-style {
    .glossary-auto-link:hover .glossary-tip,
    .glossary-auto-link.glossary-tip-open .glossary-tip {
        opacity: 0;
        transform: translateY(4px);
    }
}
.glossary-auto-link:hover .glossary-tip::before,
.glossary-auto-link.glossary-tip-open .glossary-tip::before {
    pointer-events: auto;
}
.glossary-tip-image {
    display: block;
    margin: -11px -16px 11px;          /* span to tooltip edges, gap below */
    border-radius: 5px 5px 0 0;        /* match tooltip top corners */
    border-bottom: 1px solid var(--border-soft);
    background: var(--sunken);
    overflow: hidden;
    line-height: 0;                    /* kill inline-img descender gap */
}
.glossary-tip-image img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
}
.glossary-tip-title {
    display: block;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.74em;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    line-height: 1.4;
    padding-bottom: 8px;
    margin-bottom: 9px;
    border-bottom: 1px solid rgba(var(--accent-rgb),0.35);
}
.glossary-tip-body {
    display: block;
    font-size: 0.87em;
    line-height: 1.6;
    color: var(--text);
}
/* Footer reads as a button: gold divider line above (matches the dotted-cue
   accent), button block below spans tooltip edges with a subtle gold tint
   that deepens on hover. Green text keeps the call-to-action prominent. */
.glossary-tip-link {
    display: block;
    margin: 12px -16px -13px;
    padding: 10px 16px 11px;
    border-top: 1px solid var(--gold);
    background-color: rgba(var(--gold-rgb),0.07);
    color: var(--accent);
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.glossary-tip-link:hover {
    background-color: rgba(var(--gold-rgb),0.18);
    color: var(--accent-hover);
}
/* On narrow screens, keep the tooltip inside the viewport */
@media (max-width: 600px) {
    .glossary-tip { max-width: min(340px, calc(100vw - 40px)); }
}


/* ===== Wiki sub-page layout ===== */
.breadcrumb {
    color: var(--text-dim);
    font-size: 0.85em;
    margin: 0 0 6px;
}
.breadcrumb a {
    color: var(--gold);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-dim); margin: 0 6px; }

.concept-hero {
    background-color: var(--surface);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 22px 26px;
    margin: 14px 0 28px;
}
.concept-hero h1 {
    color: var(--accent);
    margin: 0 0 10px;
    font-size: 1.7em;
}
.concept-hero .summary {
    color: var(--text);
    font-size: 1.02em;
    line-height: 1.6;
    margin: 0;
}
.concept-hero .also-known {
    color: var(--text-dim);
    font-size: 0.85em;
    margin-top: 10px;
    font-style: italic;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin: 18px 0 30px;
}
.concept-tile {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid var(--gold);
    transition: transform 0.15s ease, border-left-color 0.15s ease;
    display: block;
}
.concept-tile:hover {
    transform: translateY(-2px);
    border-left-color: var(--accent);
}
/* h3, not h4: the tile sits under an h2, so h4 skipped a level in the
   document outline -- which is how a screen-reader user navigates a page.
   Every property here is set explicitly, so the change is invisible. */
.concept-tile h3 {
    color: var(--accent);
    margin: 0 0 6px;
    font-size: 1em;
}
.concept-tile p {
    color: var(--text-soft);
    font-size: 0.88em;
    margin: 0;
    line-height: 1.5;
}
.concept-section-label {
    color: var(--gold);
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 24px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--surface);
}

.concept-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 32px 0 20px;
    padding-top: 22px;
    border-top: 1px solid var(--surface);
}
.concept-nav a {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.92em;
    display: block;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}
.concept-nav a:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.concept-nav .label {
    display: block;
    color: var(--text-dim);
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}
.concept-nav .center { background-color: var(--accent-tint); border-color: var(--accent); }
.concept-nav .center .label { color: var(--accent); }
.concept-nav .disabled {
    opacity: 0.4;
    pointer-events: none;
}
@media (max-width: 600px) {
    .concept-nav { grid-template-columns: 1fr; }
}

.related-concepts {
    background-color: var(--surface);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    padding: 16px 22px;
    margin: 24px 0;
}
.related-concepts h3 {
    color: var(--gold);
    margin: 0 0 10px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.related-concepts ul { margin: 0; padding-left: 18px; }
.related-concepts li { color: var(--text); font-size: 0.92em; margin-bottom: 6px; line-height: 1.5; }
.related-concepts a { color: var(--accent); text-decoration: none; }
.related-concepts a:hover { text-decoration: underline; }
.related-concepts .blurb { color: var(--text-dim); }

/* ==========================================================================
   Figures — diagrams and photos integrated into content pages.
   Use <figure class="diagram"> for FAA-style line drawings, scans, and
   technical illustrations (white-bg padding helps transparent PNGs read on
   the dark theme). Use <figure class="photo"> for full-bleed photography.
   Captions get italic muted text; .src spans render attribution muted further.
   ========================================================================== */
figure.diagram,
figure.photo {
    margin: 22px auto;
    max-width: 900px;
    text-align: center;
}
figure.diagram img,
figure.photo img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}
figure.diagram img {
    background: var(--surface);
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
figure.diagram figcaption,
figure.photo figcaption {
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 0.88em;
    font-style: italic;
    line-height: 1.5;
}
figure.diagram .src,
figure.photo .src {
    display: block;
    margin-top: 4px;
    color: var(--text-dim);
    font-size: 0.85em;
    font-style: normal;
}
@media (max-width: 600px) {
    figure.diagram img { padding: 8px; }
    figure.diagram, figure.photo { margin: 16px auto; }
}

/* ==========================================================================
   Color-coded marking text.
   When prose names a real-world color-coded thing (instrument arc, fuel
   placard, beacon, airspace shading, position light) we render the color
   word in that color so the eye can match prose to the diagram or photo.
   The rule: color the word only when you can point at the thing and it IS
   that color. Idioms like "red flag" or "green light" stay plain.
   Distinct from .links/headings (which use brand green var(--accent)) — these
   tokens are brighter and bold so they read as color labels.
   ========================================================================== */
/* --mark-green, not --accent-hover. The two happened to share a hex in the
   original palette, so the sweep collapsed them -- and on a red-branded
   instance "green arc" then rendered in red. An instrument marking names a
   real colour on a real gauge; it is never the brand's. */
.mark-green   { color: var(--mark-green); font-weight: 600; }
.mark-yellow  { color: var(--mark-yellow); font-weight: 600; }
.mark-red     { color: var(--mark-red); font-weight: 600; }
.mark-blue    { color: var(--mark-blue); font-weight: 600; }
.mark-magenta { color: var(--mark-magenta); font-weight: 600; }
.mark-amber   { color: var(--mark-amber); font-weight: 600; }
/* Print: keep colors readable on white paper. */
/* The generated print block repoints --mark-* at print-safe values, so the
   literal overrides that used to live here are gone. */

/* ==========================================================================
   Print stylesheet — turn any content page into a clean study packet.
   Hides site chrome (topbar, sidebar, notes widget, footer, study-tools
   callouts, prev/next nav). Resets dark theme to ink-on-paper. Adds page-
   break hints so course-cards and concept-heros don't split mid-block.
   ========================================================================== */

@media print {
    @page { margin: 0.6in 0.7in; }


    html, body {
        background: #fff !important;
        color: #000 !important;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 11pt;
        line-height: 1.45;
    }

    /* Hide every element that's only useful on screen. */
    .topbar, .topnav, .subnav, .nav-toggle-checkbox, .hamburger,
    .topnav-overlay, footer, .breadcrumb,
    .study-tools-callout, .concept-nav, .nav-context,
    .topbar-search, .topbar-support,
    #notes-widget, #notes-fab, #notes-panel,
    #feedback-fab, #feedback-overlay { display: none !important; }

    /* Full-width main; no chrome offsets. */
    main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Headings: serif body, sans headings, avoid orphan headings. */
    h1, h2, h3, h4, h5 {
        font-family: "Helvetica Neue", Arial, sans-serif;
        color: #000 !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    h1 { font-size: 22pt; margin: 0 0 12pt; }
    h2 { font-size: 15pt; margin: 16pt 0 6pt; }
    h3 { font-size: 12pt; margin: 12pt 0 4pt; }

    p, li { orphans: 3; widows: 3; }

    /* Links: black underlined. External URLs printed in parens; internal
       links keep just the underline so the page doesn't fill with /courses/... */
    a, a:visited { color: #000 !important; text-decoration: underline; }
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8.5pt;
        color: #555;
        word-break: break-all;
    }

    /* Content blocks: light borders, no fills. */
    .course-card {
        background: transparent !important;
        border: 0.5pt solid #888 !important;
        border-radius: 0 !important;
        padding: 8pt 12pt !important;
        margin: 0 0 10pt !important;
        page-break-inside: avoid;
    }
    .concept-hero {
        background: transparent !important;
        border: none !important;
        border-left: 3pt solid #000 !important;
        padding: 0 0 0 12pt !important;
        margin: 0 0 14pt !important;
        page-break-inside: avoid;
    }
    .concept-hero h1 { color: #000 !important; }
    .concept-hero .summary { color: #000 !important; font-size: 11pt; }
    .related-concepts {
        background: transparent !important;
        border: none !important;
        border-top: 1pt solid #000 !important;
        padding: 8pt 0 0 !important;
        margin-top: 14pt;
        page-break-inside: avoid;
    }
    .related-concepts h3 { color: #000 !important; }
    .related-concepts a { color: #000 !important; }
    .related-concepts .blurb { color: #444 !important; }

    /* Warning boxes: keep distinct as a "callout" but greyscale. */
    .warning-box {
        background: #f3f3f3 !important;
        border-left: 3pt solid #000 !important;
        color: #000 !important;
        padding: 6pt 10pt !important;
        page-break-inside: avoid;
    }
    .warning-box p { color: #000 !important; }

    /* Concept tile grids print as a vertical list. */
    .concept-grid { display: block !important; gap: 0 !important; }
    .concept-tile {
        background: transparent !important;
        border: 0.5pt solid #aaa !important;
        padding: 5pt 10pt !important;
        margin: 3pt 0 !important;
        display: block !important;
        page-break-inside: avoid;
    }
    .concept-tile h4 { color: #000 !important; margin: 0 0 2pt !important; font-size: 11pt; }
    .concept-tile p { color: #000 !important; margin: 0 !important; font-size: 10pt; }
    .concept-section-label { color: #000 !important; font-size: 12pt; margin-top: 14pt; }

    /* Code + pre: greyscale-friendly. */
    code, pre {
        background: #f3f3f3 !important;
        color: #000 !important;
        font-family: "Courier New", monospace;
        font-size: 9pt;
    }
    pre {
        border: 0.5pt solid #aaa !important;
        padding: 6pt 8pt !important;
        page-break-inside: avoid;
        white-space: pre-wrap;
    }

    /* Tables — keep gridlines, force visible borders. */
    table { border-collapse: collapse; page-break-inside: avoid; }
    th, td { border: 0.5pt solid #888 !important; padding: 4pt 6pt; color: #000 !important; }

    /* Images — never overflow the page; never split. */
    img { max-width: 100% !important; height: auto !important; page-break-inside: avoid; }

    /* Glossary auto-links: drop the dotted underline + tooltip pseudo-content. */
    .glossary-auto-link {
        color: #000 !important;
        text-decoration: none !important;
        border-bottom: none !important;
    }
    .glossary-tip { display: none !important; }

    /* Further-reading aside: keep, simplified. */
    .further-reading {
        background: transparent !important;
        border: none !important;
        border-top: 1pt solid #000 !important;
        padding: 8pt 0 0 !important;
        page-break-inside: avoid;
    }
    .further-reading h3 { color: #000 !important; }
    .fr-tag { background: #eee !important; color: #000 !important; border: 0.5pt solid #888 !important; }

    /* Figures — keep visible; drop dark-theme padding/shadow. */
    figure.diagram, figure.photo {
        margin: 12pt auto !important;
        page-break-inside: avoid;
    }
    figure.diagram img {
        background: transparent !important;
        padding: 0 !important;
        border: 0.5pt solid #888 !important;
        box-shadow: none !important;
    }
    figure.diagram figcaption,
    figure.photo figcaption {
        color: #000 !important;
        font-size: 9.5pt !important;
        font-style: italic;
    }
    figure.diagram .src,
    figure.photo .src { color: #444 !important; }
}

/* === VIDEO ASIDE (per-page video sidebar) === */
/* Fixed-right panel pinned to the viewport on wide screens. Below 1700px
   it falls back to an inline block appended to <main>. The JS module
   handles mounting in the right place based on a matchMedia query. */
.video-aside {
    background-color: #1f1f1f;
    border: 1px solid #2e2e2e;
    border-radius: 12px;
    padding: 18px;
    box-sizing: border-box;
}
.video-aside.is-fixed {
    position: fixed;
    top: 80px;
    /* Anchor just outside main's right edge. Main is centered (max-width 1100),
       so the aside hugs the reading column on wide screens instead of floating
       in dead space at the viewport edge. */
    left: calc(50% + 550px + 24px);
    width: 320px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    z-index: 50;
}
.video-aside.is-inline {
    margin: 36px 0 8px;
}
.video-aside h3 {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.95em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.video-aside .va-subtitle {
    margin: 0 0 14px;
    color: #888;
    font-size: 0.78em;
}
.video-aside .va-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.video-aside .va-card {
    background-color: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, transform 0.15s ease;
    text-align: left;
    display: block;
    width: 100%;
    padding: 0;
    color: inherit;
    font: inherit;
}
.video-aside .va-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.video-aside .va-card[data-locked="true"]:hover { border-color: var(--gold); }
.video-aside .va-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #111;
    background-size: cover;
    background-position: center;
}
.video-aside .va-thumb.is-placeholder {
    background-image:
        linear-gradient(135deg, #2a2a2a 0%, var(--bg) 100%);
    background-size: auto;
}
.video-aside .va-thumb.is-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.02) 0,
        rgba(255,255,255,0.02) 8px,
        transparent 8px,
        transparent 16px
    );
}
.video-aside .va-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.55) 100%);
}
.video-aside .va-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.video-aside .va-play::before {
    content: '';
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}
.video-aside .va-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0,0,0,0.7);
    color: var(--gold);
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 12px;
    z-index: 1;
    letter-spacing: 0.04em;
}
.video-aside .va-badge.free { color: var(--accent); }
.video-aside .va-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.75);
    color: #ddd;
    font-size: 0.75em;
    padding: 1px 6px;
    border-radius: 4px;
    z-index: 1;
}
.video-aside .va-meta {
    padding: 10px 12px 12px;
}
.video-aside .va-title {
    margin: 0;
    color: #e8e8e8;
    font-size: 0.92em;
    line-height: 1.35;
}
.video-aside .va-type {
    margin: 4px 0 0;
    color: #888;
    font-size: 0.75em;
}

/* Hide on narrow viewports — videos still accessible inline below content. */
@media (max-width: 700px) {
    .video-aside.is-inline { padding: 14px; }
}

/* Modal player (used for both video and GIF lightbox). */
.va-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.va-modal-inner {
    position: relative;
    width: min(960px, 100%);
    max-height: 90vh;
}
.va-modal-inner iframe,
.va-modal-inner video,
.va-modal-inner img {
    width: 100%;
    max-height: 90vh;
    background-color: #000;
    border-radius: 8px;
    border: 0;
    display: block;
}
.va-modal-inner iframe,
.va-modal-inner video {
    aspect-ratio: 16 / 9;
    height: auto;
}
.va-modal-close {
    position: absolute;
    top: -36px;
    right: 0;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.6em;
    cursor: pointer;
    padding: 4px 12px;
}
.va-modal-locked {
    background-color: #1f1f1f;
    border-radius: 12px;
    padding: 32px;
    color: #ddd;
    text-align: center;
    max-width: 480px;
}
.va-modal-locked h3 {
    color: var(--gold);
    margin: 0 0 12px;
}
.va-modal-locked p { margin: 0 0 18px; line-height: 1.5; }

/* Status flag on a citation whose source document the FAA has withdrawn.
   The link still goes to the real AC -- that is still where the text came
   from -- but a student reading it needs to know it is no longer current
   guidance, so the flag sits next to the citation rather than replacing it.
   Muted and in parentheses: it qualifies the citation, it is not a warning. */
.cite-status {
    color: var(--text-muted);
    font-size: 0.9em;
    font-style: italic;
    white-space: normal;
}

/* ==========================================================================
   ACS CODE ANATOMY
   ==========================================================================
   The decomposition of a code like PH.I.C.K2, built from type and rules
   rather than shipped as an image. Being real markup it is selectable and
   copyable, findable with the browser's own find-in-page, sharp at any zoom,
   and it takes whatever palette the tenant build stamps in -- none of which
   a JPEG does. (It does NOT become searchable from the site's search box:
   search-index.js is a hand-maintained list of pages, not a full-text
   index, and the ACS pages already have their entries.)

   Every colour comes from a token, and each segment carries its own colour
   in --ca-c. The swatch on a definition row below is the same --ca-c as its
   segment in the code above: that repetition is the whole diagram, and it
   is what survives when the parts wrap onto separate lines on a phone.
   Emphasis increases left to right, because so does specificity -- the
   element number is what a student actually looks up.

   Selectors are qualified with the element name and scoped to
   .code-anatomy on purpose: the ACS pages carry their own
   ".acs-decoder p, .acs-decoder ul" rules in a page <style> block, which
   ties on specificity and sits later in the cascade. Unqualified class
   selectors lost, and the code line rendered at 0.9em body size. */
.code-anatomy { margin: 16px 0 4px; }

.code-anatomy p.ca-code {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    /* Fluid, because the code must not wrap mid-segment on a narrow phone. */
    font-size: clamp(1.45rem, 6vw, 2.3rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 20px;
}
.code-anatomy .ca-seg {
    color: var(--ca-c);
    border-bottom: 3px solid var(--ca-c);
    padding: 0 0.10em 7px;
}
.code-anatomy .ca-dot {
    color: var(--text-dim);
    padding: 0 0.02em 7px;
}

.code-anatomy ol.ca-parts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 11px;
}
.code-anatomy .ca-part {
    display: grid;
    grid-template-columns: minmax(3.4em, auto) 1fr;
    gap: 14px;
    align-items: baseline;
}
.code-anatomy .ca-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--ca-c);
    border-left: 3px solid var(--ca-c);
    padding-left: 9px;
}
.code-anatomy .ca-def {
    color: var(--text-soft);
    font-size: 0.92em;
    line-height: 1.5;
}
.code-anatomy .ca-def strong { color: var(--text); font-weight: 600; }

.code-anatomy ul.ca-legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
}
.code-anatomy .ca-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 0.86em;
    color: var(--text-soft);
}
.code-anatomy .ca-chip b {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    color: var(--ca-c);
}

.code-anatomy p.ca-sub {
    margin: 16px 0 0;
    font-size: 0.9em;
    color: var(--text-soft);
    line-height: 1.55;
}
.code-anatomy .ca-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-weight: 700;
    color: var(--text);
}
/* The trailing lowercase letter is the point of the example, so it is the
   only part of it that is coloured. */
.code-anatomy .ca-mono em {
    color: var(--accent);
    font-style: normal;
}

@media print {
    .code-anatomy .ca-seg, .code-anatomy .ca-key,
    .code-anatomy .ca-chip b, .code-anatomy .ca-mono em { color: #000 !important; }
    .code-anatomy .ca-seg { border-bottom-color: #000 !important; }
    .code-anatomy .ca-key { border-left-color: #000 !important; }
    .code-anatomy { page-break-inside: avoid; }
}

/* ==========================================================================
   MNEMONIC CHECKLIST
   ==========================================================================
   IMSAFE, PAVE, and the rest: an initialism where the letters are the point.
   A bulleted list buries the mnemonic inside the prose. Here the letters sit
   in their own column so the word reads straight down the left edge, which
   is how a pilot recalls it in the cockpit -- the layout is doing the
   teaching, not decoration around a list.

   Kept as an <ol>: the order is load-bearing, because the order IS the word. */
.mnemonic {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
}
.mnemonic .mn-row {
    display: grid;
    grid-template-columns: 2.6rem 1fr;
    gap: 16px;
    align-items: start;
    padding: 11px 0;
    border-top: 1px solid var(--border-soft);
}
.mnemonic .mn-row:first-child {
    border-top: 0;
    padding-top: 2px;
}
.mnemonic .mn-letter {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent);
    text-align: center;
}
/* No provision for a lead-in like PAVE's "en" in enVironment. Setting it
   small beside the V pushed the V out of the column and the letters stopped
   lining up, which is the one thing this component exists to do. The term
   text carries the capitalisation instead. */
/* Spans, not <p>: the pages carry their own "section p { ... }" rules and a
   real paragraph here would inherit them. Blocked explicitly instead. */
.mnemonic .mn-body { display: block; }
.mnemonic .mn-term {
    display: block;
    margin: 0 0 3px;
    font-weight: 600;
    color: var(--text);
}
.mnemonic .mn-ask {
    display: block;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.92em;
    line-height: 1.55;
}

/* Visible to a screen reader, not to the eye. The sheet had no such utility;
   the differential table needs one for the empty corner cell of its header
   row, which must still be announced. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   DIFFERENTIAL COMPARISON
   ==========================================================================
   Two conditions that present alike. The shared band comes first on purpose:
   the reason this comparison exists is that most of the symptom list is
   common to both, and a reader who sees only the differences will overrate
   how easy they are to tell apart in the air. */
.differential { margin: 16px 0 0; }

.differential .diff-shared {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 0 16px;
    color: var(--text-soft);
    font-size: 0.92em;
    line-height: 1.55;
}
.differential .diff-shared .ds-label {
    display: block;
    font-size: 0.78em;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 5px;
}

/* Three columns do not fit a phone, so the table scrolls inside its own box
   rather than making the page scroll sideways. */
.differential .diff-scroll { overflow-x: auto; }
.differential table.diff {
    width: 100%;
    min-width: 30em;
    border-collapse: collapse;
}
.differential .diff th,
.differential .diff td {
    text-align: left;
    vertical-align: top;
    padding: 10px 14px 10px 0;
    border-top: 1px solid var(--border-soft);
    font-size: 0.92em;
    line-height: 1.5;
}
.differential .diff thead th {
    border-top: 0;
    padding-bottom: 8px;
    font-size: 0.86em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.differential .diff thead th:nth-child(2) { color: var(--info); }
.differential .diff thead th:nth-child(3) { color: var(--gold); }
.differential .diff tbody th {
    color: var(--text-dim);
    font-weight: 600;
    width: 9em;
    padding-right: 18px;
}
.differential .diff td { color: var(--text-soft); }
/* The row a pilot acts on. */
.differential .diff tr.diff-act th,
.differential .diff tr.diff-act td { color: var(--text); font-weight: 600; }
.differential .diff tr.diff-act { border-top: 1px solid var(--border); }

@media print {
    .mnemonic .mn-letter { color: #000 !important; }
    .differential .diff thead th { color: #000 !important; }
    .differential .diff-shared { border-color: #666 !important; }
    .mnemonic .mn-row, .differential { page-break-inside: avoid; }
}

/* Variant: an illusion mnemonic, where each letter carries two halves that
   contradict each other -- what the aircraft is doing, and what the pilot
   feels. Splitting them into two cells is the whole teaching point, because
   the gap between the columns is the illusion. The "feels like" side takes a
   coloured rule so the eye can run down it and read only the lies. */
.mnemonic .mn-vs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin-top: 6px;
}
.mnemonic .mn-vs-item {
    display: block;
    color: var(--text-soft);
    font-size: 0.9em;
    line-height: 1.5;
    padding-left: 11px;
    border-left: 2px solid var(--border);
}
.mnemonic .mn-vs-felt { border-left-color: var(--gold); }
.mnemonic .mn-vs-label {
    display: block;
    font-size: 0.78em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 2px;
}
.mnemonic .mn-vs-felt .mn-vs-label { color: var(--gold); }
/* One column below the width where two would force three-word lines. */
@media (max-width: 640px) {
    .mnemonic .mn-vs { grid-template-columns: 1fr; gap: 8px; }
}
@media print {
    .mnemonic .mn-vs-felt { border-left-color: #000 !important; }
    .mnemonic .mn-vs-felt .mn-vs-label { color: #000 !important; }
}

/* ==========================================================================
   PIPELINE
   ==========================================================================
   A left-to-right flow of stages with a labelled transition between each, and
   what is lost at every stage hanging off the bottom. Built for the three
   stages of memory, where the shape carries the argument a bulleted list
   cannot: the stages are narrow and sequential, so anything that does not get
   through a transition is gone.

   Below 760px the row becomes a column and the arrow glyph rotates, so the
   flow still reads as a flow instead of collapsing into a stack of boxes. */
.pipeline {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    margin: 16px 0 0;
}
.pipeline .pl-stage {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 15px 12px;
}
.pipeline .pl-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.pipeline .pl-meta {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.82em;
    color: var(--accent);
    margin-bottom: 7px;
}
.pipeline .pl-desc {
    display: block;
    color: var(--text-soft);
    font-size: 0.9em;
    line-height: 1.5;
}
/* Pushed to the bottom so the loss lines align across stages of unequal text. */
.pipeline .pl-loss {
    display: block;
    margin-top: auto;
    padding-top: 10px;
    color: var(--text-dim);
    font-size: 0.85em;
    line-height: 1.45;
}
.pipeline .pl-arrow {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 12px;
    text-align: center;
}
.pipeline .pl-glyph {
    font-size: 1.35em;
    line-height: 1;
    color: var(--accent);
}
.pipeline .pl-arrow-label {
    font-size: 0.78em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    max-width: 7em;
}

@media (max-width: 760px) {
    .pipeline { flex-direction: column; }
    .pipeline .pl-arrow {
        flex-direction: row;
        gap: 9px;
        padding: 9px 0;
        justify-content: flex-start;
    }
    .pipeline .pl-glyph { transform: rotate(90deg); }
    .pipeline .pl-arrow-label { max-width: none; }
}

@media print {
    .pipeline { page-break-inside: avoid; }
    .pipeline .pl-meta, .pipeline .pl-glyph { color: #000 !important; }
}

/* ==========================================================================
   CURRENCY BAR
   ==========================================================================
   A validity window with an end on it: 90 days for a solo endorsement,
   24 calendar months for a flight review. The whole point is that the bar is
   proportional -- the "act before this" marker sits where it actually falls
   in the window, so the size of the buffer is visible rather than asserted.

   Percentages come in from the markup as --cb-act, so one component serves
   any window length. */
.currency-bar { margin: 16px 0 0; }

.currency-bar .cb-track {
    position: relative;
    height: 34px;
    border-radius: 6px;
    background: linear-gradient(
        to right,
        var(--success-tint) 0%,
        var(--success-tint) var(--cb-end, 100%),
        var(--danger-tint) var(--cb-end, 100%),
        var(--danger-tint) 100%);
    border: 1px solid var(--border);
    overflow: hidden;
}
/* The expired zone is hatched, not just tinted. The two tints are strong
   enough to read apart in the dark theme but both go very pale in the light
   one, and "valid" versus "expired" is the entire point of the graphic --
   it cannot rest on a wash that a projector or a photocopier will flatten. */
.currency-bar .cb-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--cb-end, 100%);
    right: 0;
    /* Thin solid lines rather than a translucent wash: there is no --danger-rgb
       token in the sheet, and hard-coding one theme's rgb triplet into an
       rgba() would have shown the wrong red in the other theme and ignored the
       tenant palette entirely. 1px of the real token every 7px reads as a
       hatch without needing alpha. */
    background: repeating-linear-gradient(
        135deg,
        transparent 0 6px,
        var(--danger) 6px 7px);
    opacity: 0.55;
}
/* The expiry edge, drawn as a hard line rather than left to the gradient. */
.currency-bar .cb-track::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--cb-end, 100%);
    width: 2px;
    background: var(--danger);
}
/* The marker for "act by here", positioned by --cb-act. */
.currency-bar .cb-act {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--cb-act, 80%);
    width: 2px;
    background: var(--accent);
}

/* The "act by" label lives on its own row above the track. Below the track it
   collided with the expiry label whenever the buffer was small -- and a small
   buffer is exactly the case worth drawing. */
.currency-bar .cb-flags {
    position: relative;
    height: 1.5em;
    margin-bottom: 4px;
    font-size: 0.82em;
}
.currency-bar .cb-flag {
    position: absolute;
    left: var(--cb-at, 80%);
    white-space: nowrap;
    color: var(--accent);
    transform: translateX(-50%);
}
/* Keep the flag off the left and right edges of the track. */
.currency-bar .cb-flag--clampL { transform: none; }
.currency-bar .cb-flag--clampR { transform: translateX(-100%); }

.currency-bar .cb-scale {
    position: relative;
    height: 1.4em;
    margin-top: 6px;
    font-size: 0.82em;
    color: var(--text-dim);
}
.currency-bar .cb-tick {
    position: absolute;
    left: var(--cb-at, 0%);
    white-space: nowrap;
    transform: translateX(-50%);
}
.currency-bar .cb-tick--start { transform: none; left: 0; }
.currency-bar .cb-tick--end { transform: none; left: auto; right: 0; }

.currency-bar .cb-key {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 14px 0 0;
    padding: 0;
    font-size: 0.9em;
    color: var(--text-soft);
    line-height: 1.5;
}
.currency-bar .cb-key li { display: flex; gap: 9px; align-items: baseline; }
.currency-bar .cb-key li::before {
    content: '';
    flex: 0 0 auto;
    width: 3px;
    align-self: stretch;
    background: var(--cb-c, var(--border));
    border-radius: 2px;
}

/* Below 640px an absolutely-positioned tick at 80% with translateX(-50%)
   hangs past the right edge and widens the document. Measured on
   instructor-responsibilities: 380px viewport, 388px document. The scale
   becomes a plain flex row here -- start, expiry, end -- which reads the
   same and cannot overflow. */
@media (max-width: 640px) {
    .currency-bar .cb-scale {
        height: auto;
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }
    .currency-bar .cb-tick,
    .currency-bar .cb-tick--start,
    .currency-bar .cb-tick--end {
        position: static;
        left: auto;
        right: auto;
        transform: none;
        white-space: normal;
    }
    .currency-bar .cb-flag { white-space: normal; }
}

/* ==========================================================================
   SPLIT LIST
   ==========================================================================
   Two columns whose items do NOT correspond row for row -- which is why this
   is not the .differential table. Used where the division itself is the
   lesson: what expires against what does not. */
.split-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 16px 0 0;
}
.split-list .sl-col {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px 15px;
}
.split-list .sl-head {
    display: block;
    font-weight: 600;
    color: var(--sl-c, var(--text));
    margin-bottom: 3px;
}
.split-list .sl-sub {
    display: block;
    font-size: 0.84em;
    color: var(--text-dim);
    margin-bottom: 11px;
}
.split-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}
.split-list li {
    color: var(--text-soft);
    font-size: 0.9em;
    line-height: 1.5;
}
.split-list .sl-far {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.86em;
    color: var(--sl-c, var(--text-dim));
}
@media (max-width: 700px) {
    .split-list { grid-template-columns: 1fr; gap: 14px; }
}

@media print {
    .currency-bar .cb-track { background: #fff !important; }
    .currency-bar .cb-act, .currency-bar .cb-track::after { background: #000 !important; }
    .split-list .sl-head, .split-list .sl-far { color: #000 !important; }
    .currency-bar, .split-list .sl-col { page-break-inside: avoid; }
}

/* ==========================================================================
   ENDORSEMENT SAMPLE
   ==========================================================================
   A real endorsement with every required element marked, and a numbered key
   underneath. Marking the elements inside the sentence -- rather than listing
   them beside it -- is the point: a CFI writing one needs to see that the
   requirements are not a separate checklist, they are the sentence. */
.endorsement-sample {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px 18px 16px;
    margin: 16px 0 0;
}
.endorsement-sample .es-label {
    display: block;
    font-size: 0.78em;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 9px;
}
.endorsement-sample .es-body {
    margin: 0;
    color: var(--text);
    font-size: 1.02em;
    line-height: 1.95;   /* room for the underlines and superscripts */
}
.endorsement-sample .es-el {
    background: var(--accent-tint);
    border-bottom: 2px solid var(--accent);
    padding: 1px 3px 0;
    border-radius: 3px 3px 0 0;
}
.endorsement-sample .es-el sup {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.68em;
    margin-left: 2px;
}
.endorsement-sample .es-sig {
    display: block;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    color: var(--text-soft);
    font-size: 0.95em;
    line-height: 2;
}
.endorsement-sample ol.es-key {
    list-style: none;
    counter-reset: esk;
    margin: 15px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 7px 22px;
}
/* The number is positioned, not a grid column. As a grid container the <li>
   turned every inline child into a grid item -- an <em> mid-sentence jumped
   into the next cell and tore the line in half. */
.endorsement-sample ol.es-key li {
    counter-increment: esk;
    position: relative;
    padding-left: 1.5em;
    color: var(--text-soft);
    font-size: 0.88em;
    line-height: 1.5;
}
.endorsement-sample ol.es-key li::before {
    content: counter(esk);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.86em;
}
@media print {
    .endorsement-sample .es-el {
        background: transparent !important;
        border-bottom-color: #000 !important;
    }
    .endorsement-sample .es-el sup,
    .endorsement-sample ol.es-key li::before { color: #000 !important; }
    .endorsement-sample { page-break-inside: avoid; }
}


/* A bare URL, a long email, or any other unbreakable token is one word as
   far as line-breaking is concerned, and on a phone it pushes the whole
   document wider than the viewport -- contact.html measured 380px of
   viewport against 653px of document, and two pages overflowed from tokens
   in plain text rather than in links. break-word only acts when the word
   alone cannot fit on a line, so ordinary prose is untouched. */
main, .post-body { overflow-wrap: break-word; }

/* Preformatted blocks cannot wrap, so a wide one widens the whole document
   on a phone -- magnetic-compass measured 380px of viewport against 514px of
   document from a single <pre>. It scrolls inside its own box instead, the
   same treatment wide tables and diagrams already get. */
pre { max-width: 100%; overflow-x: auto; }

/* Regulatory scope and correction callouts.
   Two jobs, deliberately styled apart. `.reg-scope` sits ABOVE a requirement
   list and says which paragraph the numbers come from; `.reg-note` sits below
   and explains a number people expect to see but should not, because the
   near-identical airplane paragraph is the usual source of the error. Both
   lean on --info rather than --accent so they do not read as a link or as a
   warning. */
.reg-scope,
.reg-note {
    border-left: 3px solid var(--info);
    background: var(--info-tint);
    padding: 10px 14px;
    margin: 14px 0;
    font-size: 0.92em;
    color: var(--text-muted);
    border-radius: 0 6px 6px 0;
}
.reg-scope { margin-bottom: 16px; }
.reg-note a { color: var(--accent); }

/* An advisory calculator row: tracked, but not a regulatory threshold. Muted
   bar so it never reads as a red "you are short" against a number the CFR
   does not contain. */
.lb-req-advisory .lb-bar-fill { background: var(--text-dim); opacity: 0.55; }
.lb-req-advisory .lb-req-name { color: var(--text-soft); }

/* ACS summary. The headline is a sentence, not a number, because the number
   people wanted to read there ("readiness") cannot be computed honestly from
   a partial self-assessment. */
.sum-sentence {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px;
    line-height: 1.4;
}
.sum-qual {
    display: block;
    font-size: 0.82em;
    font-weight: 400;
    color: var(--text-dim);
    margin-top: 2px;
}
.acs-empty { margin: 8px 0 14px; font-size: 0.94rem; }
.acs-caveat {
    margin-top: 14px;
    padding: 10px 14px;
    border-left: 3px solid var(--gold);
    background: var(--gold-tint);
    font-size: 0.88rem;
    color: var(--text-muted);
    border-radius: 0 6px 6px 0;
}
/* Radar legend now reports "ready / total" rather than a percentage of
   whatever happened to be assessed. */
.rl-of { color: var(--text-dim); font-weight: 400; }

.mr-of { color: var(--text-dim); font-weight: 400; }

/* The "works today" panel sits beside the "not built yet" one and must not
   look like the same warning. Accent edge instead of the roadmap's muted one. */
.roadmap--shipping { border-left: 3px solid var(--accent); }

/* "Start studying" — the two guided routes, given their own block above the
   feature grid. Both surfaces already existed and were reachable only from a
   topnav dropdown, so this is a signposting change, not a new feature. */
.start-lede {
    color: var(--text-muted);
    max-width: 68ch;
    margin: 0 0 20px;
}
.start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.start-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 20px 22px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.start-card:hover,
.start-card:focus-visible {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.start-card h3 { margin: 0 0 8px; color: var(--accent); }
.start-card p { margin: 0 0 12px; color: var(--text-muted); }
.start-tag {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold);
}
@media (prefers-reduced-motion: reduce) {
    .start-card { transition: none; }
    .start-card:hover, .start-card:focus-visible { transform: none; }
}

/* === Mobile topbar fit ===
   The topbar is a single non-wrapping flex row: logo, hamburger, Cues, Coffee,
   theme toggle. At 375px those came to roughly 460px, so the last items were
   pushed outside the viewport and every page scrolled sideways by ~35px --
   with a strip of empty background on the right where the overflow was.
   Nothing was broken inside the row; there was simply more of it than there
   was screen, so this shrinks the row rather than repositioning anything. */
@media (max-width: 480px) {
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar-support { padding: 5px 10px; font-size: 0.75em; gap: 4px; }
    .topbar .logo-img { max-width: 130px; }
}
@media (max-width: 400px) {
    /* First thing to go: the word "Cues". The switch still reads as a toggle,
       and the button carries an aria-label so its name survives. */
    .topbar-cues-label { display: none; }
    .topbar-cues { padding: 4px 7px; }
}
@media (max-width: 360px) {
    /* Then the word "Coffee", leaving the cup. Measured at 320px, where the
       row still ran 55px past the edge with only the Cues label hidden. The
       link keeps its href and its emoji, so the affordance is still there --
       and `clip` below would otherwise have hidden it off-screen entirely,
       which is worse than shrinking it. */
    .topbar-support-label { display: none; }
    .topbar-support { padding: 5px 8px; }
    .topbar { padding: 0 10px; gap: 8px; }
    .topbar .logo-img { max-width: 104px; }
}

/* Backstop. The notes drawer is a fixed, translated-off-canvas panel and any
   future affordance parked off-screen would do the same thing. `clip` rather
   than `hidden`: hidden turns the body into a scroll container, which breaks
   `position: sticky` on the header stack -- the exact thing that was fixed by
   moving the topbar off `position: fixed`. `clip` does not scroll and does not
   create a containing block. */
body { overflow-x: clip; }
