/* =============================================================
   Reykjavik Training Academy

   Colours are taken from the academy logo — glacier green, mint,
   and the deep navy of the wordmark. VATSIM Scandinavia's blue is
   kept as a supporting colour so the site still reads as part of
   the division.

   Flat design throughout: square corners, no gradients.
   ============================================================= */

:root {
    /* --- Academy identity, sampled from the logo --- */
    --glacier:     #1d9e75;   /* the mountain green */
    --glacier-lit: #5dcaa5;   /* mid mint */
    --glacier-pale:#9fe1cb;   /* pale ice */
    --navy:        #1a2340;   /* wordmark navy */
    --night:       #0f1623;   /* the logo's own backdrop */

    /* --- VATSIM Scandinavia, supporting --- */
    --breeze:   #43c6e7;
    --midnight: #1a475f;

    /* --- Semantic --- */
    --success: #1d9e75;
    --danger:  #b63f3f;
    --warning: #ff9800;

    color-scheme: dark;

    /* --- Applied roles: dark is the default --- */
    --page:       var(--night);
    --raised:     #161f2f;
    --sunk:       #0a111c;
    --rule:       #26314a;
    --ink:        #e8edf5;
    --muted:      #8b97ad;

    --accent:      var(--glacier);      /* fills, bars, borders */
    --accent-text: var(--glacier-lit);  /* links and text */
    --accent-ink:  #04211a;             /* text sitting on an accent fill */

    --good:       var(--glacier-lit);
    --good-solid: var(--glacier);
    --bad:        #e0837d;
    --bad-solid:  var(--danger);

    --devbar-bg:   #40201e;
    --devbar-line: #7a3a34;
    --devbar-ink:  #f3b6b0;

    --selected: #12352b;   /* chosen answer option */
    --hover:    #1b2739;

    /* --- Legacy aliases, so older rules keep working --- */
    --basalt:        var(--page);
    --basalt-raised: var(--raised);
    --basalt-sunk:   var(--sunk);
    --fissure:       var(--rule);
    --drift:         var(--muted);
    --ocean:         var(--midnight);
    --beacon:        var(--accent);
    --beacon-dim:    var(--rule);
    --aurora:        var(--good);
    --warn:          var(--bad);
    --snow:          var(--ink);
    --deep:          var(--page);

    --display: "Roboto", system-ui, sans-serif;
    --body:    "Roboto", system-ui, sans-serif;
    --mono:    "Roboto Mono", ui-monospace, monospace;

    --gutter: clamp(1.25rem, 4vw, 3rem);
    --measure: 68ch;
    --radius: 0;
}

/* -------------------------------------------------------------
   Light mode. Same identity, inverted surfaces: the navy from the
   wordmark becomes the text colour, and the green darkens so it
   still carries contrast on white.
   ------------------------------------------------------------- */
:root[data-theme="light"] {
    color-scheme: light;

    --page:   #ffffff;
    --raised: #f4f7fa;
    --sunk:   #eaeff5;
    --rule:   #d4dde8;
    --ink:    var(--navy);
    --muted:  #5b6880;

    --accent:      var(--glacier);
    --accent-text: #14775a;
    --accent-ink:  #ffffff;

    --good:       #14775a;
    --good-solid: var(--glacier);
    --bad:        #a13733;
    --bad-solid:  var(--danger);

    --devbar-bg:   #fdeceb;
    --devbar-line: #e5b4b0;
    --devbar-ink:  #8c3430;

    --selected: #e4f5ee;
    --hover:    #eef3f8;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--basalt);
    color: var(--glacier);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.65;
    font-synthesis-weight: none;
}

a { color: var(--beacon); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--glacier); }

:focus-visible {
    outline: 2px solid var(--beacon);
    outline-offset: 3px;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin: 0 0 0.6em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

.shell {
    width: min(1180px, 100%);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--drift);
    margin: 0 0 1rem;
}

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: var(--gutter);
    top: 0.5rem;
    z-index: 20;
    background: var(--beacon);
    color: var(--basalt);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
}

/* ---------- Masthead ---------- */

.masthead {
    border-bottom: 1px solid var(--fissure);
    background: var(--basalt-sunk);
    position: sticky;
    top: 0;
    z-index: 10;
}

.masthead__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 68px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--glacier);
    margin-right: auto;
}
.brand__mark {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--accent-ink);
    background: var(--accent);
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius);
    align-self: center;
}
.brand__name {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    font-size: 0.9rem;
}
.nav a {
    color: var(--drift);
    text-decoration: none;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--glacier); }
.nav a[aria-current="page"] {
    color: var(--glacier);
    border-bottom-color: var(--beacon);
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--body);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1;
    padding: 0.7rem 1.15rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}
.button:hover { background: var(--glacier-lit); border-color: var(--glacier-lit); color: var(--accent-ink); }

/* Midnight fill with white text — the brand's preferred button treatment. */
.button--solid {
    background: var(--navy);
    border-color: var(--navy);
    color: #ffffff;
}
.button--solid:hover { background: #24304f; border-color: #24304f; color: #ffffff; }

.button--quiet {
    background: transparent;
    color: var(--glacier);
    border-color: var(--fissure);
}
.button--quiet:hover { background: var(--raised); color: var(--ink); border-color: var(--accent); }

.button--link {
    background: none;
    border: none;
    padding: 0;
    color: var(--drift);
    font-weight: 400;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.button--link:hover { color: var(--glacier); background: none; }

/* ---------- Hero ---------- */

.hero {
    padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4.5rem);
    border-bottom: 1px solid var(--fissure);
}
.hero__lede {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    color: var(--drift);
    max-width: 54ch;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

/* ---------- Rating ladder (signature) ----------
   Reads left to right like an approach lighting bar: each tier is a
   step, and the tier a member currently holds is lit.
   ------------------------------------------------------------- */

.ladder {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    margin: clamp(2.5rem, 6vw, 4rem) 0 0;
    border: 1px solid var(--fissure);
    background: var(--fissure);
    border-radius: var(--radius);
    overflow: hidden;
}

.ladder__step {
    background: var(--basalt-raised);
    padding: 1.1rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-height: 132px;
}

.ladder__step::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--beacon-dim);
}

.ladder__step[data-state="lit"]::before { background: var(--beacon); }
.ladder__step[data-state="passed"]::before { background: var(--aurora); }

.ladder__code {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--glacier);
}
.ladder__step[data-state="lit"] .ladder__code { color: var(--beacon); }
.ladder__step[data-state="passed"] .ladder__code { color: var(--aurora); }

.ladder__name {
    font-size: 0.9rem;
    color: var(--glacier);
    font-weight: 600;
}
.ladder__note {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--drift);
    margin-top: auto;
}

a.ladder__step:hover { background: var(--hover); }

@media (max-width: 720px) {
    .ladder { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .ladder { grid-template-columns: 1fr; }
}

/* ---------- Generic sections ---------- */

.section {
    padding-block: clamp(3rem, 7vw, 5rem);
    border-bottom: 1px solid var(--fissure);
}
.section:last-of-type { border-bottom: none; }

.grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 2rem;
}

.card {
    background: var(--basalt-raised);
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    padding: 1.4rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--drift); font-size: 0.94rem; margin-bottom: 0; }

.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    color: var(--drift);
}
.tag--lit     { border-color: var(--beacon); color: var(--beacon); }
.tag--passed  { border-color: var(--aurora); color: var(--aurora); }
.tag--waiting { border-color: var(--ocean);  color: #7fc0dc; }

/* ---------- Tables ---------- */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.93rem;
}
.table th, .table td {
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--fissure);
}
.table th {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--drift);
    font-weight: 400;
}
.table td.mono { font-family: var(--mono); }

/* ---------- Flash messages ---------- */

.flash {
    border: 1px solid var(--fissure);
    border-left-width: 3px;
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    margin: 1.5rem 0;
    font-size: 0.93rem;
    background: var(--basalt-raised);
}
.flash--error   { border-left-color: var(--warn); }
.flash--success { border-left-color: var(--aurora); }
.flash--info    { border-left-color: var(--ocean); }

/* ---------- Empty states ---------- */

.empty {
    border: 1px dashed var(--fissure);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--drift);
    margin-top: 1.5rem;
}
.empty p { margin-inline: auto; }

/* ---------- Footer ---------- */

.colophon {
    border-top: 1px solid var(--fissure);
    background: var(--basalt-sunk);
    padding-block: 2.5rem;
    font-size: 0.86rem;
    color: var(--drift);
    margin-top: 4rem;
}
.colophon a { color: var(--drift); }
.colophon a:hover { color: var(--glacier); }
.colophon__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: baseline;
}
.colophon p { margin: 0; max-width: 46ch; }

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

/* ---------- Management screens ---------- */

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.searchbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.searchbar input[type="search"] {
    background: var(--basalt-raised);
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    color: var(--glacier);
    font: inherit;
    font-size: 0.92rem;
    padding: 0.62rem 0.85rem;
    min-width: 240px;
}
.searchbar input[type="search"]::placeholder { color: var(--drift); }

.matrix-scroll { overflow-x: auto; margin-top: 1.5rem; }

.matrix { min-width: 640px; }
.matrix th, .matrix td { vertical-align: middle; }

.matrix__role {
    text-align: center;
    white-space: nowrap;
    padding-inline: 1rem;
}
.matrix__count {
    display: block;
    font-size: 0.68rem;
    color: var(--drift);
    letter-spacing: 0.06em;
}

.matrix__label {
    font-family: var(--body);
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: var(--glacier);
    min-width: 260px;
}
.matrix__desc { display: block; }
.matrix__label code {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--drift);
}

.matrix__cell { text-align: center; }

.matrix__box input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
.matrix__box input[type="checkbox"]:disabled {
    accent-color: var(--drift);
    cursor: not-allowed;
    opacity: 0.55;
}

.role-option { cursor: pointer; display: block; }
.role-option:hover { border-color: var(--drift); }
.role-option--locked { cursor: not-allowed; opacity: 0.6; }
.role-option--locked:hover { border-color: var(--fissure); }

.role-option__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}
.role-option__head input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--accent);
}
.role-option__desc {
    display: block;
    color: var(--drift);
    font-size: 0.9rem;
}

/* ---------- Exams ---------- */

.shell--narrow { width: min(760px, 100%); }

.factbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0 2.5rem;
    margin: 2rem 0 0;
    padding: 1.1rem 0;
    border-block: 1px solid var(--fissure);
}
.factbar div { margin: 0; }
.factbar dt {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--drift);
}
.factbar dd {
    margin: 0.2rem 0 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.exambar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--fissure);
}

.clock {
    font-family: var(--mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--glacier);
    font-variant-numeric: tabular-nums;
}
.clock--low { color: var(--warn); }

.qnav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 1.2rem 0 2.5rem;
}
.qnav__pip {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: var(--fissure);
}
.qnav__pip--done { background: var(--ocean); }
.qnav__pip--here { background: var(--beacon); }

.qprompt {
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    margin-bottom: 1.5rem;
}

.qoptions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1.5rem 0;
}
.qoption {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: var(--basalt-raised);
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    line-height: 1.5;
}
.qoption:hover { border-color: var(--drift); }
.qoption:has(input:checked) { border-color: var(--accent); background: var(--selected); }
.qoption input {
    margin-top: 0.25rem;
    width: 17px; height: 17px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.qtext {
    width: 100%;
    background: var(--basalt-raised);
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    color: var(--glacier);
    font: inherit;
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    resize: vertical;
}
.qtext:focus { border-color: var(--beacon); }

.qactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fissure);
}

/* ---------- Results ---------- */

.scorecard {
    border: 1px solid var(--fissure);
    border-left-width: 4px;
    border-radius: var(--radius);
    background: var(--basalt-raised);
    padding: 1.6rem 1.8rem;
    margin: 2rem 0;
}
.scorecard--pass    { border-left-color: var(--aurora); }
.scorecard--fail    { border-left-color: var(--warn); }
.scorecard--waiting { border-left-color: var(--ocean); }

.scorecard__score {
    display: block;
    font-family: var(--display);
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}
.scorecard--pass .scorecard__score { color: var(--aurora); }
.scorecard--fail .scorecard__score { color: var(--warn); }

.scorecard__label {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--drift);
}
.scorecard p { margin: 0.6rem 0 0; color: var(--drift); font-size: 0.94rem; }

.review { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: q; }

.review__item {
    counter-increment: q;
    border: 1px solid var(--fissure);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: var(--basalt-raised);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}
.review__item--right   { border-left-color: var(--aurora); }
.review__item--wrong   { border-left-color: var(--warn); }
.review__item--pending { border-left-color: var(--ocean); }

.review__prompt { font-weight: 600; margin: 0 0 0.8rem; }
.review__prompt::before {
    content: counter(q) ". ";
    font-family: var(--mono);
    color: var(--drift);
}

.review__options { list-style: none; padding: 0; margin: 0 0 0.8rem; }
.review__options li {
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius);
    font-size: 0.94rem;
    margin-bottom: 0.3rem;
    background: var(--basalt-sunk);
}
.review__options li.correct { box-shadow: inset 2px 0 0 var(--aurora); }
.review__options li.picked  { box-shadow: inset 2px 0 0 var(--beacon); }
.review__options li.picked.correct { box-shadow: inset 2px 0 0 var(--aurora); }

.review__mark {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--drift);
    margin-left: 0.6rem;
}

.review__written {
    background: var(--basalt-sunk);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    font-size: 0.94rem;
    margin: 0 0 0.8rem;
    white-space: pre-wrap;
}

.review__verdict {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--drift);
    margin: 0;
}

.review__why {
    margin: 0.8rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid var(--fissure);
    color: var(--drift);
    font-size: 0.92rem;
}

/* ---------- Lesson reading ---------- */

.video {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 2rem 0;
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--basalt-sunk);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.prose { margin-top: 2rem; }
.prose h2, .prose h3, .prose h4 { margin-top: 2rem; }
.prose h3 { font-size: 1.3rem; }
.prose h4 { font-size: 1.08rem; }
.prose p, .prose li { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--basalt-sunk);
    padding: 0.1em 0.35em;
    border-radius: 2px;
}
.prose blockquote {
    margin: 1.5em 0;
    padding: 0.9rem 1.2rem;
    border-left: 3px solid var(--ocean);
    background: var(--basalt-raised);
    font-family: var(--mono);
    font-size: 0.92rem;
    color: var(--glacier);
}
.prose hr { border: 0; border-top: 1px solid var(--fissure); margin: 2.5rem 0; }

.lessonfoot {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fissure);
}

.lessonnav {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: 0.92rem;
}

/* ---------- Progress ---------- */

.progressbar {
    height: 6px;
    background: var(--fissure);
    border-radius: 3px;
    overflow: hidden;
}
.progressbar__fill {
    height: 100%;
    background: var(--beacon);
    transition: width 240ms ease;
}
.progressbar__label {
    margin-top: 0.6rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--drift);
}

.locked {
    border: 1px dashed var(--fissure);
    border-radius: var(--radius);
    padding: 1.4rem;
    color: var(--drift);
}
.locked p { margin: 0; }

/* ---------- Lesson / question lists ---------- */

.lessonlist { list-style: none; padding: 0; margin: 1.2rem 0 1.5rem; }

.lessonlist__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--fissure);
}
.lessonlist__item--done .lessonlist__no { color: var(--aurora); }
.lessonlist__item--broken { box-shadow: inset 3px 0 0 var(--warn); padding-left: 0.8rem; }

.lessonlist__no {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--drift);
    flex-shrink: 0;
    padding-top: 0.15rem;
}
.lessonlist__body { flex: 1; min-width: 0; }
.lessonlist__summary {
    display: block;
    color: var(--drift);
    font-size: 0.88rem;
    margin-top: 0.15rem;
}
.lessonlist__meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--drift);
}
.lessonlist__meta form { margin: 0; }
.lessonlist__meta button[disabled] { opacity: 0.3; cursor: not-allowed; }

/* ---------- Authoring forms ---------- */

.field { display: block; margin-bottom: 1.5rem; }
.field__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.field__hint {
    display: block;
    color: var(--drift);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
.field__hint code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--basalt-sunk);
    padding: 0.05em 0.3em;
    border-radius: 2px;
}

.fieldrow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 1.5rem;
}

select.qtext { appearance: none; cursor: pointer; }
.qtext--mono { font-family: var(--mono); font-size: 0.88rem; line-height: 1.7; }

.checks { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.5rem; }
.check { display: flex; align-items: center; gap: 0.7rem; font-size: 0.92rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.optrow { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.optrow__correct { width: 19px; height: 19px; accent-color: var(--good-solid); flex-shrink: 0; }

.statusrow {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 0;
    border-block: 1px solid var(--fissure);
    margin: 2rem 0;
}
.statusrow form { margin: 0; }

/* ---------- Modules ---------- */

.module {
    border: 1px solid var(--fissure);
    border-radius: var(--radius);
    background: var(--basalt-raised);
    margin-bottom: 1.2rem;
    overflow: hidden;
}
.module--passed { border-left: 3px solid var(--aurora); }

.module__head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--fissure);
}

.module__no {
    font-family: var(--mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--drift);
    flex-shrink: 0;
}
.module--passed .module__no { color: var(--aurora); }

.module__title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 1.05rem;
}
.module__summary {
    display: block;
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--drift);
    margin-top: 0.15rem;
}

.module__state {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--drift);
}
.module__state form { margin: 0; }
.module__state button[disabled] { opacity: 0.3; cursor: not-allowed; }

.module__empty {
    margin: 0;
    padding: 1.1rem 1.4rem;
    color: var(--drift);
    font-size: 0.9rem;
}

.lessonlist--module { margin: 0; padding: 0 1.4rem; }
.lessonlist--module .lessonlist__item:last-child { border-bottom: none; }

.module__exam {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.4rem;
    border-top: 1px solid var(--fissure);
    background: var(--basalt-sunk);
}
.module__locked { color: var(--drift); font-size: 0.9rem; }

.module--edit .module__head { background: var(--basalt-sunk); }

/* =============================================================
   Iceland — Reykjavik FIR character, within the VATSCA palette
   ============================================================= */

/* The hero carries a faint sixty-fourth-degree latitude grid, the way a
   sector chart does. Structure, not decoration: it only appears where the
   page is introducing the FIR. */
.hero {
    position: relative;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0 79px,
            rgba(29, 158, 117, 0.07) 79px 80px
        ),
        repeating-linear-gradient(
            to right,
            transparent 0 119px,
            rgba(29, 158, 117, 0.055) 119px 120px
        );
}

.hero > .shell { position: relative; }

/* Rating ladder reads as an approach lighting bar in brand blues. */
.ladder__step::before { background: var(--midnight); }
.ladder__step[data-state="lit"]::before { background: var(--accent); }
.ladder__step[data-state="passed"]::before { background: var(--good-solid); }
.ladder__step[data-state="lit"] .ladder__code { color: var(--accent); }
.ladder__step[data-state="passed"] .ladder__code { color: var(--good); }

/* Tags */
.tag--lit     { border-color: var(--accent);      color: var(--accent); }
.tag--passed  { border-color: var(--good-solid);  color: var(--good); }
.tag--waiting { border-color: var(--breeze);      color: var(--breeze); }

/* Flash messages use the brand's semantic colours. */
.flash--error   { border-left-color: var(--bad-solid); }
.flash--success { border-left-color: var(--good-solid); }
.flash--info    { border-left-color: var(--accent); }

/* Scorecards */
.scorecard--pass    { border-left-color: var(--good-solid); }
.scorecard--fail    { border-left-color: var(--bad-solid); }
.scorecard--waiting { border-left-color: var(--accent); }
.scorecard--pass .scorecard__score { color: var(--good); }
.scorecard--fail .scorecard__score { color: var(--bad); }

/* Review items */
.review__item--right   { border-left-color: var(--good-solid); }
.review__item--wrong   { border-left-color: var(--bad-solid); }
.review__item--pending { border-left-color: var(--accent); }
.review__options li.correct,
.review__options li.picked.correct { box-shadow: inset 2px 0 0 var(--good-solid); }
.review__options li.picked { box-shadow: inset 2px 0 0 var(--accent); }

/* Modules */
.module--passed { border-left-color: var(--good-solid); }
.module--passed .module__no { color: var(--good); }

/* Progress */
.progressbar__fill { background: var(--accent); }
.qnav__pip--done { background: var(--accent-text); }
.qnav__pip--here { background: var(--accent); }

/* Exam clock */
.clock--low { color: var(--bad); }

/* Quoted radio calls sit in midnight, like a strip. */
.prose blockquote { border-left-color: var(--accent); }

/* Focus ring stays on-brand and clearly visible. */
:focus-visible { outline-color: var(--accent); }

/* Flat design: strip the last few soft corners. */
.qnav__pip,
.progressbar,
.progressbar__fill,
.brand__mark { border-radius: 0; }

/* ---------- Course cards on the dashboard ---------- */

.cardgrid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    margin-top: 1.5rem;
}

.coursecard {
    background: var(--raised);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    padding: 1.3rem 1.4rem;
}
.coursecard--done { border-left-color: var(--good-solid); }

.coursecard__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.coursecard__title {
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.7rem;
}
.coursecard__title a { color: var(--ink); text-decoration: none; }
.coursecard__title a:hover { color: var(--accent); }

.coursecard__summary {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.coursecard__note {
    margin: 1rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.88rem;
}

/* ---------- Navigation: dropdown + mobile menu ---------- */

.devbar {
    background: var(--devbar-bg);
    border-bottom: 1px solid var(--devbar-line);
    padding: 0.55rem 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--devbar-ink);
}

.nav__form { margin: 0; display: inline; }

/* On desktop the toggle is hidden and the nav simply sits in the bar. */
.menutoggle { display: none; }

.dropdown { position: relative; }

.dropdown > summary {
    list-style: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after {
    content: "";
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.7;
}
.dropdown > summary:hover { color: var(--ink); }
.dropdown > summary.is-here { color: var(--ink); border-bottom-color: var(--accent); }
.dropdown[open] > summary { color: var(--ink); }

.dropdown__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    min-width: 210px;
    background: var(--raised);
    border: 1px solid var(--rule);
    padding: 0.4rem 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
}
.dropdown__panel a {
    padding: 0.55rem 1rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: none;
    font-size: 0.9rem;
}
.dropdown__panel a:hover { background: var(--hover); color: var(--ink); }
.dropdown__panel a[aria-current="page"] {
    color: var(--accent);
    box-shadow: inset 2px 0 0 var(--accent);
}

@media (max-width: 900px) {
    .masthead { position: relative; }
    .masthead__inner { min-height: 58px; }

    .menutoggle {
        display: block;
        margin-left: auto;
    }
    .menutoggle > summary {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        cursor: pointer;
        list-style: none;
        border: 1px solid var(--rule);
    }
    .menutoggle > summary::-webkit-details-marker { display: none; }
    .menutoggle[open] > summary { border-color: var(--accent); }

    .menutoggle__bars,
    .menutoggle__bars::before,
    .menutoggle__bars::after {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--ink);
        content: "";
    }
    .menutoggle__bars { position: relative; }
    .menutoggle__bars::before { position: absolute; top: -6px; }
    .menutoggle__bars::after  { position: absolute; top: 6px; }

    /* The nav is hidden until the sibling toggle is opened. */
    .nav { display: none; }

    .menutoggle[open] ~ .nav {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--sunk);
        border-top: 1px solid var(--rule);
        border-bottom: 1px solid var(--rule);
        padding: 0.5rem 0;
        z-index: 30;
    }
    .menutoggle[open] ~ .nav > a,
    .menutoggle[open] ~ .nav > .nav__form {
        padding: 0.75rem var(--gutter);
        border-bottom: none;
    }
    .menutoggle[open] ~ .nav > a[aria-current="page"] {
        box-shadow: inset 3px 0 0 var(--accent);
    }

    /* Staff group becomes an inline list rather than a popover. */
    .dropdown { position: static; }
    .dropdown > summary { padding: 0.75rem var(--gutter); }
    .dropdown__panel {
        position: static;
        border: none;
        background: var(--raised);
        padding: 0;
        min-width: 0;
    }
    .dropdown__panel a { padding: 0.7rem calc(var(--gutter) + 1rem); }

    .brand__name { font-size: 0.95rem; }
}

@media (max-width: 420px) {
    .brand__name { display: none; }
}

/* ---------- Mentoring queue ---------- */

.queuerow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 1rem 1.2rem;
    background: var(--raised);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    margin-bottom: 0.8rem;
}

.queuerow__who {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.queuerow__wait {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.queuerow__wait--long { color: var(--warning); }

.queuerow__form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.queuerow__form .qtext { min-width: 240px; padding: 0.55rem 0.7rem; }

.inlineform { display: flex; align-items: center; gap: 0.5rem; }
.qtext--slim { padding: 0.35rem 0.5rem; font-size: 0.85rem; }

/* ---------- Session reports ---------- */

.report {
    background: var(--raised);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--good-solid);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}
.report--private { border-left-color: var(--warning); }

.report__head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding-bottom: 0.8rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--rule);
}

.report__label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0.9rem 0 0.3rem;
}
.report__label:first-of-type { margin-top: 0; }

.report__body { margin: 0; font-size: 0.94rem; }

.report__by {
    margin: 1rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid var(--rule);
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Logo and theme toggle ---------- */

.brand { gap: 0; }

.brand__logo {
    display: block;
    height: 38px;
    width: auto;
    max-width: 260px;
}

/* Each logo variant shows only on the background it was drawn for. */
.brand__logo--light { display: none; }
:root[data-theme="light"] .brand__logo--dark  { display: none; }
:root[data-theme="light"] .brand__logo--light { display: block; }

.themetoggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.themetoggle:hover { color: var(--ink); border-color: var(--accent); }

.themetoggle__icon--sun  { display: none; }
.themetoggle__icon--moon { display: block; }
:root[data-theme="light"] .themetoggle__icon--sun  { display: block; }
:root[data-theme="light"] .themetoggle__icon--moon { display: none; }

@media (max-width: 900px) {
    .brand__logo { height: 32px; max-width: 210px; }
    .menutoggle[open] ~ .nav > .themetoggle { margin: 0.5rem var(--gutter); }
}

/* ---------- Light mode corrections ---------- */

:root[data-theme="light"] .masthead { background: var(--page); }
:root[data-theme="light"] .colophon { background: var(--raised); }

/* The hero grid needs to be fainter on white. */
:root[data-theme="light"] .hero {
    background:
        repeating-linear-gradient(to bottom, transparent 0 79px, rgba(26, 35, 64, 0.05) 79px 80px),
        repeating-linear-gradient(to right,  transparent 0 119px, rgba(26, 35, 64, 0.04) 119px 120px);
}

:root[data-theme="light"] .qoption:has(input:checked) { background: var(--selected); }
:root[data-theme="light"] a.ladder__step:hover { background: var(--hover); }
:root[data-theme="light"] .prose code,
:root[data-theme="light"] .field__hint code { background: var(--sunk); }

/* Buttons keep white text on green in light mode, which reads cleanly
   against the page rather than against a dark surface. */
:root[data-theme="light"] .button:hover {
    background: #17835f;
    border-color: #17835f;
    color: #ffffff;
}

/* ---------- Course builder ---------- */

.buildbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 0;
    border-block: 1px solid var(--rule);
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.checklist {
    border: 1px solid var(--rule);
    border-left-width: 3px;
    background: var(--raised);
    padding: 1.1rem 1.3rem;
    margin: 1.5rem 0;
}
.checklist--warn { border-left-color: var(--warning); }
.checklist--ok   { border-left-color: var(--good-solid); }

.checklist__head {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}
.checklist ul {
    margin: 0.8rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.checklist li { margin-bottom: 0.3rem; }

.module--build .module__head { background: var(--sunk); }

.addbox { border-top: 1px solid var(--rule); }

.addbox > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-text);
    background: var(--sunk);
}
.addbox > summary::-webkit-details-marker { display: none; }
.addbox > summary:hover { background: var(--hover); color: var(--ink); }
.addbox[open] > summary { border-bottom: 1px solid var(--rule); }

.addbox__form { padding: 1.3rem 1.4rem; }
.addbox__form .field:last-of-type { margin-bottom: 1rem; }

.addbox--module {
    border: 1px solid var(--rule);
    background: var(--raised);
    margin-bottom: 1.2rem;
}

/* ---------- Import preview ---------- */

.preview {
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    background: var(--raised);
    padding: 1.1rem 1.3rem;
    margin-bottom: 0.8rem;
}

.preview__prompt { font-weight: 600; margin: 0 0 0.8rem; }

.preview__options { list-style: none; padding: 0; margin: 0 0 0.7rem; }
.preview__options li {
    padding: 0.4rem 0.7rem;
    background: var(--sunk);
    margin-bottom: 0.25rem;
    font-size: 0.93rem;
}
.preview__options li.is-correct {
    background: var(--selected);
    box-shadow: inset 2px 0 0 var(--good-solid);
}
.preview__options .mono { color: var(--muted); margin-right: 0.5rem; }

.preview__mark {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--good);
    margin-left: 0.6rem;
}

.preview__meta {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.codeblock {
    background: var(--sunk);
    border: 1px solid var(--rule);
    padding: 1.1rem 1.3rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
    margin: 1rem 0;
}
.codeblock--scroll { max-height: 340px; overflow-y: auto; }
