html { color-scheme: light; }
body { margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }

:root {
    --stop-not-started: #f1f3f6;
    --stop-enroute: #80c7da;
    --stop-arrived: #ffeccd;
    --stop-completed: #c5e1a5;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-alt: #f9fafb;
    --text: #1c273c;
    --fg2: #4e5879;
    --muted: #6b7280;
    --border: #e5e7eb;
    --border-soft: #eef0f3;
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --primary-soft: #e5eefc;
    --primary-tint: #f2f7ff;
    --on-primary: #ffffff;
    --success: #10b759;
    --success-soft: #e4f7ec;
    --success-fg: #14803f;
    --warning: #f5a623;
    --warning-soft: #fdf3e2;
    --warning-fg: #8a5a00;
    --danger: #dc3545;
    --danger-soft: #fdecee;
    --danger-fg: #b42334;
    --info: #0ea5c4;
    --info-soft: #e6f6fb;
    --info-fg: #0a6b80;
    --violet-soft: #ede9fe;
    --violet-fg: #6d28d9;
    --grey-stop: #c2c8d3;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --stop-not-started: #273049;
        --stop-enroute: #314b52;
        --stop-arrived: #655841;
        --stop-completed: #2b4817;
        --bg: #171f2b;
        --surface: #1f2937;
        --surface-alt: #1b2431;
        --text: #e5e7eb;
        --fg2: #c2c8d3;
        --muted: #9ca3af;
        --border: #374151;
        --border-soft: #2b3444;
        --primary: #5b8def;
        --primary-dark: #7ba6f5;
        --primary-soft: #1e2a45;
        --primary-tint: #182238;
        --on-primary: #0f1726;
        --success: #22c55e;
        --success-soft: #153025;
        --success-fg: #5fd98c;
        --warning-soft: #382a15;
        --warning-fg: #f0be6b;
        --danger: #ef5b6a;
        --danger-soft: #3a1e22;
        --danger-fg: #f2929b;
        --info: #38bedc;
        --info-soft: #152c33;
        --info-fg: #7fd4e6;
        --violet-soft: #2b2544;
        --violet-fg: #c4b5fd;
        --grey-stop: #596882;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --stop-not-started: #273049;
    --stop-enroute: #314b52;
    --stop-arrived: #655841;
    --stop-completed: #2b4817;
    --bg: #171f2b;
    --surface: #1f2937;
    --surface-alt: #1b2431;
    --text: #e5e7eb;
    --fg2: #c2c8d3;
    --muted: #9ca3af;
    --border: #374151;
    --border-soft: #2b3444;
    --primary: #5b8def;
    --primary-dark: #7ba6f5;
    --primary-soft: #1e2a45;
    --primary-tint: #182238;
    --on-primary: #0f1726;
    --success: #22c55e;
    --success-soft: #153025;
    --success-fg: #5fd98c;
    --warning-soft: #382a15;
    --warning-fg: #f0be6b;
    --danger: #ef5b6a;
    --danger-soft: #3a1e22;
    --danger-fg: #f2929b;
    --info: #38bedc;
    --info-soft: #152c33;
    --info-fg: #7fd4e6;
    --violet-soft: #2b2544;
    --violet-fg: #c4b5fd;
    --grey-stop: #596882;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { text-wrap: balance; margin: 0; line-height: 1.25; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary); }
button { font: inherit; color: inherit; }
kbd {
    font-family: var(--mono); font-size: 12px;
    padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 4px; background: var(--surface);
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.topbar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1120px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 16px; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 6px; background: var(--primary); color: var(--on-primary);
    display: grid; place-items: center;
}
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topnav a {
    text-decoration: none; color: var(--fg2); font-size: 14px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px;
}
.topnav a:hover { background: var(--surface-alt); color: var(--text); }
.topnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 64px; }
/* Pages with screenshots use the extra width on large screens; running text keeps its own line length. */
.is-wide .wrap, .is-wide .topbar-inner { max-width: 1480px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } .topbar-inner { padding-inline: 16px; } h1 { font-size: 25px; } }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--primary); }
.lead { font-size: 17px; color: var(--fg2); max-width: 62ch; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { display: flex; flex-direction: column; gap: 16px; margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 8px 14px; border-radius: 6px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; text-decoration: none; line-height: 1.3;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-ghost { background: transparent; color: var(--primary); padding-inline: 6px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.badge {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 1.5;
}
.b-grey { background: var(--surface-alt); color: var(--fg2); border: 1px solid var(--border); }
.b-blue { background: var(--primary-soft); color: var(--primary); }
.b-green { background: var(--success-soft); color: var(--success-fg); }
.b-amber { background: var(--warning-soft); color: var(--warning-fg); }
.b-red { background: var(--danger-soft); color: var(--danger-fg); }
.b-violet { background: var(--violet-soft); color: var(--violet-fg); }
.b-info { background: var(--info-soft); color: var(--info-fg); }
/* «Ny»: warm but quiet, so a new lesson stands out from the grey meta without competing with the status badge. */
.b-new { background: var(--warning-soft); color: var(--warning-fg); text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; padding: 1px 7px; }

/* Home */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: 36px; }
@media (max-width: 520px) { .hero h1 { font-size: 28px; } }
.start-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; border-color: var(--primary); background: var(--primary-tint); }
.start-card .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.role-card {
    text-align: left; cursor: pointer; padding: 18px; display: flex; flex-direction: column; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
    text-decoration: none; color: var(--text);
}
.role-card:hover { border-color: var(--primary); }
.role-card .top { display: flex; align-items: center; gap: 10px; }
.role-icon { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.role-card p { color: var(--muted); font-size: 14px; }
.role-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.meter { height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--success); border-radius: 999px; }

.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
@media (max-width: 860px) { .levels { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .levels { grid-template-columns: 1fr; } }
.level { padding: 18px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border-soft); }
.level:last-child { border-right: 0; }
@media (max-width: 860px) { .level { border-right: 0; border-bottom: 1px solid var(--border-soft); } }
.level-num {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 13px; background: var(--primary-soft); color: var(--primary);
}
.level p { font-size: 14px; color: var(--muted); }

.anatomy { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 860px) { .anatomy { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .anatomy { grid-template-columns: 1fr; } }
.anatomy .panel { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.anatomy .panel p { font-size: 13.5px; color: var(--muted); }

/* Role page */
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }
.role-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.role-head .role-icon { width: 52px; height: 52px; }
.level-block { padding: 0; overflow: hidden; }
.level-block-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.level-block-head p { color: var(--muted); font-size: 14px; }
.lesson-row {
    display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center;
    padding: 12px 18px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--text);
}
.lesson-row:last-child { border-bottom: 0; }
a.lesson-row:hover { background: var(--surface-alt); }
.lesson-row .t { font-weight: 600; }
.lesson-row .m { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.lesson-row.planned .t { font-weight: 500; color: var(--fg2); }
.state-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); color: transparent; }
.state-dot.done { background: var(--success); border-color: var(--success); color: #fff; }
.state-dot.started { border-color: var(--primary); }
.state-dot.planned { border-style: dashed; }

/* Lesson */
.lesson-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); display: flex; flex-direction: column; gap: 2px; }
/* After the base rule, so the narrow layout really drops the side menu instead of letting it float over the content. */
@media (max-width: 860px) { .lesson-layout { grid-template-columns: 1fr; } .toc { display: none; } }
.toc a { text-decoration: none; color: var(--fg2); font-size: 14px; padding: 6px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: center; }
.toc a:hover { background: var(--surface); color: var(--text); }
.toc .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 14px; }
.lesson-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lesson-title { display: flex; flex-direction: column; gap: 10px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.part { padding: 22px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 80px; }
.part-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.part-head h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.015em; color: var(--text); }
/* Sections without a number get an accent bar, so every section heading reads the same way. */
.part-head:not(:has(.part-num)) h2 { display: flex; align-items: center; gap: 12px; }
.part-head:not(:has(.part-num)) h2::before { content: ''; width: 5px; height: 24px; border-radius: 3px; background: var(--primary); flex: none; }
.part-num {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
    display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none; box-shadow: 0 0 0 4px var(--primary-soft);
}
.part-head .sub {
    margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--fg2); white-space: nowrap;
    padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border-soft);
}
.prose { display: flex; flex-direction: column; gap: 10px; max-width: 68ch; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
/* «Dette lærer du» at the top of a lesson: the goals in plain words, before the why */
.prose .goals { padding: 14px 16px; border-radius: 8px; background: var(--primary-tint, var(--primary-soft)); border: 1px solid var(--primary-soft); display: flex; flex-direction: column; gap: 8px; }
.prose .goals-title { font-weight: 700; color: var(--text); margin: 0; }
.prose .goals ul { gap: 6px; }
.prose .goals li::marker { color: var(--primary); }
.callout {
    padding: 12px 14px; border-radius: 6px; background: var(--primary-tint); border: 1px solid var(--primary-soft);
    font-size: 14px; color: var(--fg2); display: flex; gap: 10px; align-items: flex-start;
}
.callout.amber { background: var(--warning-soft); border-color: transparent; color: var(--warning-fg); }
.callout.violet { background: var(--violet-soft); border-color: transparent; color: var(--violet-fg); }
.callout svg { flex: none; margin-top: 2px; }

.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.term { padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 3px; }
.term b { font-weight: 600; }
.term span { font-size: 14px; color: var(--muted); }

.internal { display: none; }


.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Flow map */
.flow { display: flex; flex-direction: column; gap: 14px; }
.flow-lane { display: flex; flex-direction: column; gap: 8px; }
.flow-lane-label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.flow-row { display: flex; gap: 0; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.flow-node {
    flex: 1 1 0; min-width: 118px; cursor: pointer; text-align: left;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 4px; position: relative;
}
.flow-node:hover { border-color: var(--primary); }
.flow-node[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 1px var(--primary); }
.flow-node .who { font-size: 11.5px; font-weight: 600; }
.flow-node .name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.flow-arrow { flex: none; width: 22px; display: grid; place-items: center; color: var(--muted); }
.flow-branch { display: flex; gap: 10px; flex-wrap: wrap; padding-left: 0; }
.flow-branch .flow-node { flex: 0 1 220px; }
.flow-detail { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; background: var(--surface-alt); }
.flow-detail .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
    .flow-row { flex-direction: column; overflow: visible; }
    .flow-arrow { width: auto; height: 16px; transform: rotate(90deg); }
    .flow-node { min-width: 0; }
}

/* TMS mocks */
.mock { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow-x: auto; }
.mock-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.drivers { display: flex; gap: 10px; flex-wrap: wrap; }
.driverbox {
    width: 172px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
    display: flex; flex-direction: column; text-align: left; padding: 0; cursor: default;
}
button.driverbox { cursor: pointer; }
button.driverbox:hover { box-shadow: var(--shadow-lg); }
.driverbox .bar { height: 5px; }
.driverbox .body { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.driverbox .dn { font-weight: 600; font-size: 14px; }
.driverbox .dr { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.driverbox .ds { font-size: 12.5px; color: var(--fg2); display: flex; justify-content: space-between; margin-top: 4px; font-variant-numeric: tabular-nums; }
.driverbox.free .bar { background: var(--success); }
.driverbox.busy .bar { background: var(--warning); }
.driverbox.off .bar { background: var(--danger); }
.driverbox.drop-hover { outline: 2px dashed var(--primary); outline-offset: 2px; }
.driverbox.picked-right { outline: 2px solid var(--success); }
.driverbox.picked-wrong { outline: 2px solid var(--danger); }
.driverbox .assigned { border-top: 1px solid var(--border-soft); padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }

.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.order-card .oc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.ono { font-family: var(--mono); font-weight: 700; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.ono.pending { background: var(--warning-soft); color: var(--warning-fg); }
.ono.accepted { background: var(--success-soft); color: var(--success-fg); }
.ono.none { background: var(--surface-alt); color: var(--fg2); border: 1px solid var(--border); }
.clock { display: inline-flex; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; }
.clock.after { color: var(--success-fg); }
.clock.before { color: var(--warning-fg); }
.timeline { display: flex; flex-direction: column; gap: 0; }
/* As in the TMS: the circle shows the stop type and never changes; the background of the whole stop shows its status. */
.stop {
    display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; margin: 3px 0;
    position: relative; font-size: 13.5px; border-radius: 6px; background: var(--stop-not-started); transition: background 0.25s;
}
.stop + .stop::before { content: ''; position: absolute; left: 20px; top: -9px; height: 12px; border-left: 2px solid var(--border); }
.stop .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.stop.k-pickup .dot { background: #10b759; }
.stop.k-drop .dot { background: #f5a623; }
.stop.s-onway { background: var(--stop-enroute); }
.stop.s-arrived { background: var(--stop-arrived); }
.stop.s-done { background: var(--stop-completed); }
.stop .st { font-size: 12px; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--fg2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.olist { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.olist th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 10px; background: var(--surface-alt); border-bottom: 1px solid var(--border); white-space: nowrap; }
.olist td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.olist tr:last-child td { border-bottom: 0; }
.olist tr.draggable { cursor: grab; }
.olist tr.draggable:hover td { background: var(--primary-tint); }
.olist tr.selected td { background: var(--primary-soft); }
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.tabbar span { padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabbar span.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.tabbar .count { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; font-weight: 700; }

.stepper { display: flex; flex-direction: column; gap: 8px; }
.fstep { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.fstep > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; border: 0; cursor: pointer; text-align: left; }
.fstep .fn { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.fstep.open .fn { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fstep .ft { font-weight: 600; }
.fstep .fh { font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }
.fstep .fbody { padding: 0 12px 12px 44px; display: none; flex-direction: column; gap: 10px; font-size: 14px; color: var(--fg2); }
.fstep.open .fbody { display: flex; }
@media (max-width: 520px) { .fstep .fh { display: none; } .fstep .fbody { padding-left: 12px; } }
.fields { display: flex; gap: 8px; flex-wrap: wrap; }
.field { border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px 6px; background: var(--surface); min-width: 140px; flex: 1 1 140px; }
.field small { display: block; font-size: 11px; color: var(--muted); }
.field div { font-size: 13.5px; color: var(--text); display: flex; gap: 6px; align-items: center; }

.plan-states { display: flex; flex-direction: column; gap: 8px; }
.plan-card { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
@media (max-width: 520px) { .plan-card { grid-template-columns: 1fr; } }
.plan-card.p-none { border-left: 4px solid var(--grey-stop); }
.plan-card.p-wait { border-left: 4px solid var(--warning); }
.plan-card.p-ok { border-left: 4px solid var(--success); }
.plan-card.p-no { border-left: 4px solid var(--danger); }

/* Exercises */
.exercise { display: flex; flex-direction: column; gap: 12px; }
.scenario { padding: 12px 14px; border-radius: 6px; background: var(--surface-alt); border: 1px dashed var(--border); font-size: 14.5px; }
.feedback { font-size: 14px; padding: 10px 12px; border-radius: 6px; display: none; }
.feedback.show { display: block; }
.feedback.ok { background: var(--success-soft); color: var(--success-fg); }
.feedback.warn { background: var(--warning-soft); color: var(--warning-fg); }
.feedback.bad { background: var(--danger-soft); color: var(--danger-fg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { cursor: pointer; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--primary); }
.chip.placed { background: var(--success-soft); color: var(--success-fg); border-color: transparent; cursor: default; }
.chip.shake { animation: shake 0.3s; border-color: var(--danger); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .chip.shake { animation: none; } .stop { transition: none; } }
.sequence { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 38px; padding: 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-alt); }
.sequence .slot { font-size: 13px; color: var(--muted); padding: 4px 8px; }
.sequence .seq-item { font-size: 13.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); display: inline-flex; gap: 6px; align-items: center; }
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14.5px; }
.checklist input { margin-top: 3px; accent-color: var(--success); width: 16px; height: 16px; flex: none; }
.checklist label.done span { color: var(--muted); text-decoration: line-through; }
.event-log { font-size: 13.5px; color: var(--fg2); min-height: 1.5em; }

/* Quiz */
.q { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; margin: 0; min-width: 0; border: 0; border-top: 1px solid var(--border-soft); }
.q:first-of-type { border-top: 0; padding-top: 0; }
.q .qt { font-weight: 600; }
.q label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: var(--surface); font-size: 14.5px; }
.q label:hover { border-color: var(--primary); }
.q input { margin-top: 4px; accent-color: var(--primary); flex: none; }
.q label.right { border-color: var(--success); background: var(--success-soft); }
.q label.wrong { border-color: var(--danger); background: var(--danger-soft); }
.q .explain { font-size: 14px; color: var(--fg2); display: none; }
.q.checked .explain { display: block; }
.quiz-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Badge page */
.badge-card {
    padding: 36px 32px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    background-image: linear-gradient(var(--surface), var(--surface)), repeating-linear-gradient(45deg, var(--primary-soft) 0 2px, transparent 2px 10px);
    background-clip: padding-box, border-box; border: 8px solid transparent; box-shadow: 0 0 0 1px var(--border), var(--shadow);
}
.badge-card h1 { font-size: 26px; }
.badge-card .who-name { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; min-height: 1.3em; }
.badge-card .what { font-size: 17px; color: var(--fg2); }
.badge-card .facts { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge-card .facts b { display: block; color: var(--text); font-size: 14px; }
.input { font: inherit; font-size: 15px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%; max-width: 340px; }
.req-list { display: flex; flex-direction: column; gap: 6px; }
.req-list a { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }

.footer { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.switch { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; color: var(--fg2); }
.switch input { accent-color: var(--primary); }
.confirm-inline { display: inline-flex; gap: 8px; align-items: center; }

.internal { display: none; }
.embedded .topbar-inner { padding-block: 8px; }
.embedded .wrap { padding-block: 20px 40px; }
/* Theme switch: shows the moon in light mode (click for dark) and the sun in dark mode */
.theme-switch {
    display: inline-grid; place-items: center; width: 32px; height: 30px; margin-left: 4px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--fg2);
}
.theme-switch:hover { color: var(--text); background: var(--surface); }
.theme-switch .icon-sun { display: none; }
:root[data-theme="dark"] .theme-switch .icon-sun { display: block; }
:root[data-theme="dark"] .theme-switch .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-switch .icon-sun { display: block; }
    :root:not([data-theme="light"]) .theme-switch .icon-moon { display: none; }
}
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-left: 4px; }
.lang-switch a { padding: 4px 8px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--muted); }
.lang-switch a:hover { color: var(--text); background: var(--surface-alt); }
.lang-switch a[aria-current] { background: var(--primary-soft); color: var(--primary); }
.learner-chip {
    font-size: 13px; color: var(--fg2); display: inline-flex; gap: 8px; align-items: center; text-decoration: none;
    padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
}
.learner-chip:hover { border-color: var(--primary); color: var(--text); }
.learner-badges { display: inline-flex; gap: 3px; align-items: center; font-weight: 700; color: #b7791f; }
:root[data-theme="dark"] .learner-badges { color: #f5b83d; }

/* «Din fremgang»: who is tracked, the level they are on and one medal per level */
.progress-panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; border-left: 4px solid var(--primary); }
.progress-head { display: flex; gap: 14px; align-items: center; }
.progress-head h2 { font-size: 21px; }
.progress-avatar {
    width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--primary); color: #fff; font-weight: 700; font-size: 19px;
}
.progress-avatar.is-guest { background: var(--surface-alt); color: var(--muted); border: 1px dashed var(--border); }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-row.is-compact { gap: 6px; }
.badge-link { text-decoration: none; color: inherit; border-radius: 12px; }
.badge-link:hover .level-badge { border-color: var(--metal-lo); }
.level-badge {
    --metal-hi: #d9dde5; --metal: #a9b0bd; --metal-lo: #7d8594; --metal-ink: #3a404b; --metal-soft: #f1f3f6;
    display: inline-flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface);
}
.level-badge.tier-0 { --metal-hi: #b8f0d8; --metal: #34c08a; --metal-lo: #13875c; --metal-ink: #064b32; --metal-soft: #e9f9f1; }
.level-badge.tier-1 { --metal-hi: #f6cfa6; --metal: #cd8a4b; --metal-lo: #8f5324; --metal-ink: #4a2a0f; --metal-soft: #fbf0e5; }
.level-badge.tier-2 { --metal-hi: #f4f6fa; --metal: #b9c1cd; --metal-lo: #7c8696; --metal-ink: #2f3642; --metal-soft: #f2f4f8; }
.level-badge.tier-3 { --metal-hi: #fff0a8; --metal: #f2b93b; --metal-lo: #b7800f; --metal-ink: #4f3500; --metal-soft: #fff8e3; }
.level-badge.is-compact { padding: 0; border: 0; background: none; }
/* Not earned: a ring that fills with the share of lessons done at the level. */
.level-badge-medal {
    position: relative; isolation: isolate; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: conic-gradient(var(--metal) calc(var(--pct, 0) * 1%), var(--border) 0);
}
.level-badge-face {
    width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); color: var(--muted); font-weight: 800; font-size: 14px;
}
.level-badge.is-compact .level-badge-medal { width: 30px; height: 30px; }
.level-badge.is-compact .level-badge-face { width: calc(100% - 6px); height: calc(100% - 6px); font-size: 12px; }
/* Earned: a shining medal in the level's metal, with a ribbon. */
.level-badge.is-earned { border-color: var(--metal); background: var(--metal-soft); }
.level-badge.is-earned.is-compact { background: none; }
.level-badge.is-earned .level-badge-medal {
    background: radial-gradient(circle at 32% 28%, var(--metal-hi), var(--metal) 55%, var(--metal-lo));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.level-badge.is-earned .level-badge-medal::before, .level-badge.is-earned .level-badge-medal::after {
    content: ""; position: absolute; bottom: -7px; width: 9px; height: 13px; background: var(--metal-lo); z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}
.level-badge.is-earned .level-badge-medal::before { left: 22%; transform: rotate(18deg); }
.level-badge.is-earned .level-badge-medal::after { right: 22%; transform: rotate(-18deg); }
.level-badge.is-earned .level-badge-face { background: none; color: var(--metal-ink); }
.level-badge.is-earned .level-badge-face { font-weight: 800; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); }
.level-badge.is-earned .level-badge-text b { color: var(--text); }
:root[data-theme="dark"] .level-badge.is-earned { background: color-mix(in srgb, var(--metal) 16%, var(--surface)); }
.level-badge-text { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.level-badge-text span { color: var(--muted); font-size: 12.5px; }
.role-levels { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.role-level-name { font-size: 13px; font-weight: 600; color: var(--text); }
.progress-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.progress-role {
    display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 8px; text-decoration: none; color: var(--text);
    border: 1px solid var(--border-soft); background: var(--surface-alt);
}
.progress-role:hover { border-color: var(--primary); }
.progress-role .muted { font-size: 13px; }
.badge-earned {
    display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px 18px 12px 12px; width: fit-content;
    text-decoration: none; color: var(--text); animation: badge-pop 0.6s cubic-bezier(.2, 1.4, .4, 1);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--metal) 35%, transparent);
}
.badge-earned.level-badge .level-badge-medal { width: 52px; height: 52px; }
.badge-earned .level-badge-face { font-size: 24px; }
.badge-earned-text { display: flex; flex-direction: column; gap: 2px; }
.badge-earned-text small { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-earned-text b { font-size: 16px; }
@keyframes badge-pop { from { transform: scale(0.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .badge-earned { animation: none; } }
.notice { max-width: 560px; margin: 60px auto; padding: 28px; display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.prose h3 { margin-top: 6px; }
.prose p + p { margin-top: 0; }

/* Real screenshots from the test tenant, with numbered markers measured on the live elements */
.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot-frame { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; line-height: 0; }
.shot-frame a { display: block; }
.shot-media { display: block; width: 100%; height: auto; max-width: 100%; }
video.shot-media { border: 1px solid var(--border); border-radius: 8px; background: #000; }
.shot-pin {
    position: absolute; transform: translate(-50%, -50%);
    min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
    background: rgba(13, 110, 253, 0.5); color: #fff; font: 700 12px/22px var(--font); text-align: center;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    pointer-events: none; transition: opacity 0.2s, background-color 0.2s;
}
/* The markers step aside while the reader looks at the screenshot, and light up from the legend. */
.shot-frame:hover .shot-pin { opacity: 0.15; }
.shot-frame .shot-pin.is-lit { opacity: 1; background: var(--primary); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(16, 24, 40, 0.35); }
.shot-legend li { cursor: default; border-radius: 6px; }
.shot-legend li:hover { background: var(--surface-alt); }
.shot-pin.static { position: static; transform: none; display: inline-block; box-shadow: none; flex: none; background: var(--primary); text-shadow: none; }
.shot figcaption { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--fg2); }
.shot-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shot-legend li { display: flex; gap: 10px; align-items: flex-start; }
@media (max-width: 520px) { .shot-pin { min-width: 18px; height: 18px; font-size: 10px; line-height: 18px; } }

/* A real driver card screenshot used as a clickable/droppable card in exercises */
.shot-card {
    display: flex; flex-direction: column; gap: 0; padding: 4px; cursor: pointer;
    background: #171f2b; border: 1px solid var(--border); border-radius: 8px; line-height: 0;
}
.shot-card img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.shot-card:hover { box-shadow: var(--shadow-lg); }
.shot-card.picked-right { outline: 2px solid var(--success); outline-offset: 2px; }
.shot-card.picked-wrong { outline: 2px solid var(--danger); outline-offset: 2px; }
.shot-card.drop-hover { outline: 2px dashed var(--primary); outline-offset: 2px; }
.shot-card .assigned { line-height: 1.5; border-top: 1px solid var(--border); margin-top: 4px; padding: 6px 4px 2px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #e5e7eb; }

/* Clickable screen tour: a real screenshot with one region per part of the screen */
.tour { container-type: inline-size; }
.tour-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
/* A small or tall screenshot (a card, a side panel) keeps its natural width and the explanation sits right beside it. */
.tour.is-narrow .tour-grid { grid-template-columns: auto minmax(240px, 1fr); }

.tour-frame { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; line-height: 0; background: #171f2b; }
.tour-region {
    position: absolute; padding: 0; margin: 0; cursor: pointer; background: transparent;
    border: 2px solid transparent; border-radius: 6px; transition: box-shadow 0.25s, border-color 0.2s;
}
.tour-region:hover { border-color: rgba(91, 141, 239, 0.7); }
.tour-region:focus-visible { outline: none; border-color: #fff; }
.tour-region.is-active { border-color: #5b8def; box-shadow: 0 0 0 9999px rgba(8, 12, 20, 0.62); z-index: 2; }
.tour-num {
    position: absolute; left: 3px; top: 3px; z-index: 1; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px;
    background: rgba(13, 110, 253, 0.45); color: #fff; font: 700 11px/20px var(--font); text-align: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s, background-color 0.2s;
}
.tour-region:not(.is-active) .tour-num { opacity: 0.7; }
.tour-region:hover .tour-num, .tour-region.is-active .tour-num { opacity: 1; background: #0d6efd; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
/* The number sits just outside the area so it never covers the content it points at. */
.tour-region.num-above .tour-num { top: auto; bottom: calc(100% + 3px); left: -2px; }
.tour-region.num-below .tour-num { top: calc(100% + 3px); left: -2px; }
.tour-num.static { position: static; display: inline-block; flex: none; box-shadow: none; background: #0d6efd; text-shadow: none; }
.tour-panel { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); }
.tour-progress { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); font-variant-numeric: tabular-nums; }
.tour-step { display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.tour-step h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.tour-step p { color: var(--fg2); font-size: 14.5px; }
.tour-nav { display: flex; gap: 8px; }
.tour-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border-soft); padding-top: 10px; }
.tour-index button { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--fg2); }
.tour-index button:hover { background: var(--surface-alt); }
.tour-index button.is-active { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.tour-hint { font-size: 12.5px; color: var(--muted); }
/* A tour step that clicks something: the area the click changed gets the spotlight, the clicked control keeps its ring */
.tour.has-focus .tour-region.is-active { box-shadow: none; z-index: 3; border-style: dashed; }
.tour.shows-step-image .tour-region:not(.is-active) { visibility: hidden; }
.tour-focus {
    position: absolute; z-index: 2; pointer-events: none; border: 2px solid #f5b83d; border-radius: 6px;
    box-shadow: 0 0 0 9999px rgba(8, 12, 20, 0.62), inset 0 0 0 9999px rgba(245, 184, 61, 0.06);
    animation: tour-focus-in 0.5s ease-out;
}
@keyframes tour-focus-in { from { border-color: transparent; transform: scale(0.98); } to { border-color: #f5b83d; transform: none; } }

/* Content that changed after a click (see ChangeFocus in akademi.js) */
.is-changed { animation: change-focus 2.4s ease-out; border-radius: 8px; }
@keyframes change-focus {
    0%, 55% { box-shadow: 0 0 0 3px var(--primary), 0 0 0 8px var(--primary-soft); }
    100% { box-shadow: 0 0 0 3px transparent, 0 0 0 8px transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .tour-region, .tour-num, .shot-pin { transition: none; }
    .tour-focus { animation: none; }
    .is-changed { animation: none; box-shadow: 0 0 0 3px var(--primary); }
}

/* «Større visning»: the tour moved into a large window */
.tour-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.tour-expand {
    display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
    padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg2);
}
.tour-expand:hover { border-color: var(--primary); color: var(--primary); }
.tour.in-modal .tour-tools { display: none; }
.tour-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; }
.tour-modal[hidden] { display: none; }
.tour-modal-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 20, 0.72); }
.tour-modal-dialog {
    position: relative; width: min(1900px, 98vw); height: 96vh; display: flex; flex-direction: column;
    background: var(--surface); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); overflow: hidden;
}
.tour-modal-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
.tour-modal-title { flex: 1; font-weight: 700; font-size: 16px; }
.tour-modal-body { flex: 1; overflow: auto; padding: 18px 20px; }
body.tour-modal-open { overflow: hidden; }
.tour.in-modal .tour-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
.tour.in-modal.is-narrow .tour-grid { grid-template-columns: auto minmax(300px, 1fr); }
/* The image fills the window height; the frame shrinks to it so the clickable areas stay on their spots. */
.tour.in-modal .tour-stage { min-width: 0; }
.tour.in-modal .tour-frame { max-width: 100% !important; width: fit-content; margin-inline: auto; }
.tour.in-modal .tour-frame .shot-media { width: auto; max-width: min(100%, var(--native-width, 100%)); max-height: calc(96vh - 100px); }
.tour.in-modal .tour-panel { position: static; }
.tour.in-modal .tour-step h3 { font-size: 21px; }
.tour.in-modal .tour-step p { font-size: 15.5px; }

/* Flow across several screens: a rail of stages, one clickable screenshot per stage */
.flow { display: flex; flex-direction: column; gap: 16px; }
.flow-rail { list-style: none; margin: 0; padding: 4px 2px 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.flow-rail li { flex: 1 0 128px; display: flex; }
.flow-stage {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer;
    padding: 10px 12px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--fg2); font: inherit;
}
.flow-rail li + li .flow-stage::before {
    content: ''; position: absolute; left: -7px; top: 50%; width: 7px; height: 2px; background: var(--border);
}
.flow-stage:hover { border-color: var(--primary); }
.flow-stage.is-done { border-color: var(--success); }
.flow-stage.is-done .flow-num { background: var(--success); color: #fff; }
.flow-stage.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); box-shadow: 0 0 0 2px var(--primary); }
.flow-stage.is-active .flow-num { background: var(--primary); color: #fff; }
.flow-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-alt); color: var(--fg2); }
.flow-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.flow-note { font-size: 11.5px; line-height: 1.3; color: var(--warning-fg); }
.flow-stage.is-branch { border-style: dashed; }
.flow-panel { display: flex; flex-direction: column; gap: 10px; border-radius: 8px; }
.flow-panel-head { display: flex; flex-direction: column; gap: 4px; }
.flow-panel-head h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.flow-progress { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.flow-nav { display: flex; justify-content: space-between; gap: 8px; }

/* Several flows: a segmented switch picks one; the intro under it says what differs */
.flow-sets { display: flex; flex-direction: column; gap: 14px; }
.flow-switch { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-alt); border: 1px solid var(--border); width: fit-content; max-width: 100%; }
.flow-switch-tab {
    flex: 0 0 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 16px; border: 0; border-radius: 7px;
    background: transparent; color: var(--fg2); font: inherit; text-align: left; cursor: pointer;
}
.flow-switch-tab:hover { color: var(--text); }
.flow-switch-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.flow-switch-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--primary), 0 1px 3px rgba(0, 0, 0, .08); }
.flow-switch-name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.flow-switch-tab[aria-selected="true"] .flow-switch-name { color: var(--primary); }
.flow-switch-count { font-size: 12px; color: var(--muted); }
.flow-set { display: flex; flex-direction: column; gap: 14px; }
.flow-intro { margin: 0; padding: 10px 14px; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; background: var(--primary-soft); color: var(--text); font-size: 14.5px; line-height: 1.5; }
@media (max-width: 560px) {
    .flow-switch { width: 100%; }
    .flow-switch-tab { flex: 1 1 0; padding: 8px 10px; }
}

/* Steptour tours: branded cards in «Vis meg» that open the Steptour player in a modal over the lesson */
:root { --steptour: #2f62f1; --steptour-soft: #eef3fe; --steptour-ink: #16295e; }
:root[data-theme="dark"] { --steptour: #5c8bf7; --steptour-soft: #172446; --steptour-ink: #dbe6ff; }
.st-logo { display: inline-flex; align-items: center; flex: none; }
.st-logo img { height: 26px; width: auto; display: block; }
.st-logo .st-logo-on-dark { display: none; }
:root[data-theme="dark"] .st-logo .st-logo-on-light { display: none; }
:root[data-theme="dark"] .st-logo .st-logo-on-dark { display: block; }
.steptours {
    display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; border-radius: 10px;
    background: var(--steptour-soft); border: 1px solid color-mix(in srgb, var(--steptour) 30%, transparent); border-left: 4px solid var(--steptour);
}
.steptours-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.steptours-head > div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; }
.steptours-head h3 { color: var(--steptour-ink); }
.steptours-head .muted { font-size: 13.5px; }
.steptour-list { display: flex; flex-wrap: wrap; gap: 10px; }
.steptour-card {
    display: flex; gap: 12px; align-items: center; text-align: left; cursor: pointer; flex: 1 1 280px; max-width: 460px; min-width: 0; flex-wrap: wrap;
    padding: 12px 14px 12px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.steptour-card:hover, .steptour-card:focus-visible { border-color: var(--steptour); box-shadow: 0 0 0 3px color-mix(in srgb, var(--steptour) 20%, transparent); outline: none; }
.steptour-play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--steptour); color: #fff; flex: none; }
.steptour-text { display: flex; flex-direction: column; gap: 1px; flex: 1 1 150px; min-width: 0; }
.steptour-text span { font-size: 12.5px; color: var(--muted); }
.steptour-open { flex: none; font-size: 13px; font-weight: 700; color: var(--steptour); white-space: nowrap; }
.steptour-bar { display: block; height: 5px; border-radius: 999px; background: var(--border-soft); overflow: hidden; margin-top: 4px; }
.steptour-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--steptour); transition: width 0.4s; }
.steptour-bar > span.is-done { background: var(--success); }
.st-modal-bar .st-logo img { height: 22px; }
@media (prefers-reduced-motion: reduce) { .steptour-bar > span { transition: none; } }
.st-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px); }
.st-modal-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 20, 0.72); }
.st-modal-dialog {
    position: relative; width: min(1400px, 100%); height: min(88vh, 900px);
    display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
    background: var(--surface); box-shadow: var(--shadow-lg);
}
.st-modal-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); }
.st-modal-title { font-weight: 600; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-modal-frame { flex: 1; width: 100%; border: 0; background: #0f1726; }
body.st-modal-open { overflow: hidden; }

/* Explanation beside the image; only on phone widths does it move below. */
@container (max-width: 640px) {
    .tour-grid, .tour.is-narrow .tour-grid { grid-template-columns: 1fr; }
    .tour-panel { position: static; }
    .tour-index { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .tour-index button { width: auto; }
    .tour-step { min-height: 0; }
}

/* «Slik tar du nivåmerkene» on the front page */
.reward-tally { display: inline-flex; gap: 14px; align-items: center; font-size: 14px; color: var(--fg2); }
.reward-tally span { display: inline-flex; gap: 6px; align-items: center; }
.reward-tally svg { width: 16px; height: 16px; color: #d19418; }
.reward-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.reward-step { position: relative; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.reward-step h3 { font-size: 17px; }
.reward-step p { color: var(--fg2); font-size: 14.5px; margin: 0; }
.reward-step h3 { display: flex; gap: 10px; align-items: center; }
.reward-num {
    flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: var(--zone, var(--primary)); color: #fff; font-weight: 700; font-size: 13px;
}
.reward-visual { height: 124px; border-radius: 10px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; }
.reward-quiz { flex-direction: column; align-items: stretch; }
.rq-row { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 6px; font-size: 13.5px; border: 1px solid; }
.rq-row svg { width: 14px; height: 14px; }
.rq-row.is-right { border-color: var(--success); background: var(--success-soft); color: var(--text); }
.rq-row.is-wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--text); }
.reward-medals { gap: 16px; }
.reward-medal { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--fg2); }
.reward-medals .level-badge.is-compact .level-badge-medal { width: 50px; height: 50px; }
.mini-badge {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 22px; border-radius: 8px; background: var(--surface);
    box-shadow: 0 0 0 1px var(--border), var(--shadow); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.mini-badge .level-badge { margin-bottom: 6px; }
.mini-badge .level-badge.is-compact .level-badge-medal { width: 34px; height: 34px; }
.mini-badge b { font-size: 14px; color: var(--text); }

/* Above the quiz: what completing it takes, and which medal it counts towards */
.quiz-reward { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--surface-alt); border: 1px solid var(--border-soft); }
.quiz-reward > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.quiz-reward span { color: var(--fg2); }
.quiz-reward .level-badge.is-compact .level-badge-medal { width: 40px; height: 40px; }
.progress-help { font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--primary); width: fit-content; }

/* Content zones: each kind of content has its own colour, icon tile and type label, used the same way on every page.
   Roles blue, badges gold, levels teal, lesson structure violet. Lesson parts reuse the same colours:
   why blue, terms violet, show teal, try amber, quiz green. */
[data-zone="roles"], [data-kind="why"] { --zone: var(--primary); --zone-soft: var(--primary-soft); --zone-fg: var(--primary); }
[data-zone="rewards"] { --zone: #e0a21b; --zone-soft: var(--warning-soft); --zone-fg: var(--warning-fg); }
[data-zone="levels"], [data-kind="show"] { --zone: var(--info); --zone-soft: var(--info-soft); --zone-fg: var(--info-fg); }
[data-zone="anatomy"], [data-kind="terms"] { --zone: #7c3aed; --zone-soft: var(--violet-soft); --zone-fg: var(--violet-fg); }
[data-kind="try"] { --zone: var(--warning); --zone-soft: var(--warning-soft); --zone-fg: var(--warning-fg); }
[data-kind="quiz"] { --zone: var(--success); --zone-soft: var(--success-soft); --zone-fg: var(--success-fg); }
:root[data-theme="dark"] [data-zone="anatomy"], :root[data-theme="dark"] [data-kind="terms"] { --zone: #a78bfa; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) [data-zone="anatomy"], :root:not([data-theme="light"]) [data-kind="terms"] { --zone: #a78bfa; }
}

.zone {
    margin-top: 28px; padding: 22px; border-radius: 14px; position: relative;
    background: color-mix(in srgb, var(--zone) 5%, var(--bg));
    border: 1px solid color-mix(in srgb, var(--zone) 18%, transparent);
    border-top: 4px solid var(--zone);
}
.zone-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.zone-icon {
    width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none;
    background: var(--zone); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--zone) 30%, transparent);
}
.zone-title { display: flex; flex-direction: column; gap: 1px; }
.zone-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--zone-fg); }
.zone-title h2 { font-size: 22px; font-weight: 700; }
.zone-aside { margin-left: auto; font-size: 14px; }
.zone .panel { box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07); }
.zone .role-card:hover { border-color: var(--zone); box-shadow: 0 6px 18px color-mix(in srgb, var(--zone) 18%, transparent); }

/* Levels read as a ladder in the medal colours, so a level and its badge look like the same thing. */
.level { border-top: 4px solid var(--metal, var(--border)); }
.level.tier-0 { --metal: #34c08a; } .level.tier-1 { --metal: #cd8a4b; } .level.tier-2 { --metal: #9aa3b1; } .level.tier-3 { --metal: #f2b93b; }

@media (min-width: 861px) {
    .level:nth-child(2) { padding-top: 26px; } .level:nth-child(3) { padding-top: 34px; } .level:nth-child(4) { padding-top: 42px; }
}

/* The five lesson parts on the front page and in the lesson itself share their colours. */
.anatomy .panel[data-kind] { border-top: 4px solid var(--zone); }
[data-kind] > .part-num, [data-kind] .part-head .part-num { background: var(--zone); box-shadow: 0 0 0 4px var(--zone-soft); }
.part[data-kind] { border-left: 5px solid var(--zone); }
.part[data-kind] .part-head {
    margin: -22px -22px 0; padding: 16px 22px; border-radius: 8px 8px 0 0; border-bottom: 1px solid color-mix(in srgb, var(--zone) 20%, transparent);
    background: color-mix(in srgb, var(--zone) 7%, var(--surface));
}
.part[data-kind] .part-head:not(:has(.part-num)) h2::before { background: var(--zone); }
.part[data-kind] .part-head .sub { background: var(--surface); border-color: color-mix(in srgb, var(--zone) 25%, transparent); color: var(--zone-fg); }
.toc a[data-kind] .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--zone-soft); color: var(--zone-fg); font-weight: 700; font-size: 11px; }

/* The quiz: each question is its own card, so it reads as a test and not as more text. */
.part[data-kind="quiz"] .q { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); margin-top: 10px; }
.part[data-kind="quiz"] .q:first-of-type { padding-top: 14px; border-top: 1px solid var(--border); }
.part[data-kind="quiz"] .q label:hover { border-color: var(--zone); }
.part[data-kind="quiz"] .q input { accent-color: var(--zone); }
.part[data-kind="quiz"] .quiz-foot .btn-primary { background: var(--success); }
.part[data-kind="quiz"] .quiz-foot .btn-primary:hover { background: color-mix(in srgb, var(--success) 85%, #000); }
/* The level blocks on a role page use the same ladder colours as the medals. */
.level-block.tier-0 { --metal: #34c08a; } .level-block.tier-1 { --metal: #cd8a4b; } .level-block.tier-2 { --metal: #9aa3b1; } .level-block.tier-3 { --metal: #f2b93b; }
.level-block[class*="tier-"] { border-top: 4px solid var(--metal); }
.level-label {
    display: inline-block; width: fit-content; margin-bottom: 4px; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    background: color-mix(in srgb, var(--metal, var(--primary)) 16%, var(--surface)); color: color-mix(in srgb, var(--metal, var(--primary)) 55%, var(--text));
}
.level-block-head h3 { font-size: 18px; }
.level-block-badge { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--fg2); }
/* A medal with the level number is the icon for a level everywhere a level is named. */
.level-icon.level-badge.is-compact .level-badge-medal { width: 40px; height: 40px; }
.level-badge.is-large.is-compact .level-badge-medal { width: 96px; height: 96px; }
.level-badge.is-large.is-compact .level-badge-face { width: calc(100% - 12px); height: calc(100% - 12px); font-size: 40px; }
.level-badge.is-large.is-earned .level-badge-medal::before, .level-badge.is-large.is-earned .level-badge-medal::after { bottom: -16px; width: 22px; height: 30px; }
.badge-card .level-badge.is-large { margin-bottom: 14px; }
.level-block-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.level-icon.level-badge.is-compact .level-badge-face { font-size: 16px; }
.level-icon.is-small.level-badge.is-compact .level-badge-medal { width: 24px; height: 24px; }
.level-icon.is-small.level-badge.is-compact .level-badge-face { font-size: 11px; }
.level-icon.is-small .level-badge-medal::before, .level-icon.is-small .level-badge-medal::after { bottom: -4px; width: 6px; height: 8px; }
.level .level-icon { margin-bottom: 6px; align-self: center; }
.level .level-label { align-self: center; }
.lesson-level { display: inline-flex; align-items: center; gap: 10px; }
.level-block-badge .meter { width: 90px; }

/* «Din fremgang»: the levels as a track. Done steps show the badge, the current step is the goal, later steps wait. */
.level-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.track-step {
    --metal: #9aa3b1; position: relative; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
}
.track-step.tier-0 { --metal: #34c08a; } .track-step.tier-1 { --metal: #cd8a4b; } .track-step.tier-2 { --metal: #9aa3b1; } .track-step.tier-3 { --metal: #f2b93b; }
.track-step .level-badge.is-compact .level-badge-medal { width: 44px; height: 44px; }
.track-step .level-badge.is-compact .level-badge-face { font-size: 17px; }
.track-text { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; min-width: 0; font-size: 13px; color: var(--muted); }
.track-text b { font-size: 14px; color: var(--text); }
.track-text a { color: var(--primary); font-weight: 600; text-decoration: none; }
.track-text .meter > span { background: var(--metal); }
.track-step.is-current {
    border: 2px solid var(--metal); background: color-mix(in srgb, var(--metal) 9%, var(--surface));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--metal) 22%, transparent);
}
.track-step.is-current .level-badge.is-compact .level-badge-medal { width: 56px; height: 56px; }
.track-step.is-current .level-badge.is-compact .level-badge-face { font-size: 21px; color: var(--text); }
.track-step.is-current .track-text b { font-size: 15.5px; }
.track-step.is-done { border-color: color-mix(in srgb, var(--metal) 45%, var(--border)); }
.track-step.is-later { opacity: 0.6; }
.track-here {
    position: absolute; top: -10px; left: 14px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase; background: var(--metal); color: #fff;
}
.track-next { flex-basis: 100%; justify-content: center; }
.track-new { color: var(--warning-fg); font-weight: 600; }
/* «Slik kommer du dit» in level 1 lessons: the clicks that lead to the screen, right after the goals */
.prose .way-in { padding: 14px 16px; border-radius: 8px; background: var(--surface-alt); border: 1px dashed var(--border); display: flex; flex-direction: column; gap: 8px; }
.prose .way-in-title { font-weight: 700; color: var(--text); margin: 0; display: flex; gap: 8px; align-items: center; }
.prose .way-in-title::before { content: ""; width: 18px; height: 18px; flex: none; background: var(--primary); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.prose .way-in ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.prose .way-in li::marker { color: var(--primary); font-weight: 700; }

/*
 * FleetX app illustrations beside a flow stage. The phone is drawn at the app's own sizes (360 × 740 logical px,
 * Inter, the colours of lib/resource/color_pallet.dart) and scaled with zoom. The screen keeps the app's light
 * theme in Akademi's dark mode too, so its colours are fixed here on purpose.
 */
.app-flow { container-type: inline-size; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.app-flow-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-flow-head h4 { margin: 0; font-size: 16px; font-weight: 700; }
.app-flow-list { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; }
.app-figure { margin: 0; display: grid; grid-template-columns: auto minmax(180px, 300px); gap: 16px; align-items: start; }
.app-flow-list.is-multi .app-figure { grid-template-columns: 304px; }
.app-flow-list.is-multi .app-figure figcaption { padding-top: 0; }
.app-figure figcaption { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; color: var(--fg2); padding-top: 8px; }
.app-figure-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--primary); color: #fff; }
@container (max-width: 560px) {
    .app-figure { grid-template-columns: 1fr; justify-items: center; }
    .app-figure figcaption { max-width: 360px; }
}

.app-phone {
    --a-primary: #e94925; --a-black: #1b1d21; --a-text: #111827; --a-grey: #4b5563; --a-grey-light: #6b7280; --a-grey-dark: #374151;
    --a-line: #e5e7eb; --a-fill: #e8e9eb; --a-surface: #f9fafb; --a-dark-chip: #1f2937;
    --a-enroute: #3b82f6; --a-arrived: #fbbf24; --a-finished: #10b981;
    zoom: 0.8; flex: none; width: 380px; padding: 10px; border-radius: 48px; background: #1b1d21;
    box-shadow: 0 0 0 1px #3a3d44 inset, 0 0 0 1px rgba(255, 255, 255, 0.1), 0 18px 40px rgba(16, 24, 40, 0.22);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--a-black); text-align: left;
    -webkit-font-smoothing: antialiased; line-height: 1.25;
}
@container (max-width: 400px) { .app-phone { zoom: 0.76; } }
.app-phone b { font-weight: 600; }
.app-screen { position: relative; width: 360px; height: 740px; border-radius: 38px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.app-statusbar { flex: none; height: 44px; padding: 0 26px 0 32px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; color: #000; position: relative; z-index: 2; }
.app-statusbar.is-light { color: #fff; }
.app-statusbar-icons { display: flex; gap: 5px; align-items: center; }
.app-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.app-home-indicator { position: absolute; left: 50%; bottom: 7px; width: 124px; height: 5px; margin-left: -62px; border-radius: 3px; background: #111; z-index: 5; }
.app-ic { flex: none; display: block; }
.app-scroll { flex: 1; min-height: 0; overflow: hidden; }

/* Header (customHeader) */
.app-header { flex: none; height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--a-line); }
.app-header-back { width: 36px; height: 36px; display: grid; place-items: center; color: var(--a-black); }
.app-header-title { flex: 1; font-size: 18px; font-weight: 600; color: var(--a-black); white-space: pre; overflow: hidden; }
.app-header-back + .app-header-title { flex: 1; }
.app-header-more { color: var(--a-black); }

/* Bottom navigation */
.app-tabbar { flex: none; display: flex; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.1); padding-bottom: 26px; position: relative; z-index: 3; }
.app-tab { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--a-text); }
.app-tab-mark { width: 56px; height: 4px; border-radius: 0 0 4px 4px; }
.app-tab.is-active .app-tab-mark { background: var(--a-primary); }
.app-tab.is-active .app-tab-label { font-weight: 600; }
.app-tab-icon { position: relative; margin: 10px 0 4px; color: var(--a-black); }
.app-tab.is-active .app-tab-icon { color: var(--a-primary); }
.app-tab-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 2px; border-radius: 8px; background: var(--a-primary); border: 0.7px solid #fff; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.app-avatar-mini { width: 24px; height: 24px; border-radius: 12px; background: #fdede9; color: var(--a-primary); font-size: 12px; font-weight: 500; display: grid; place-items: center; }

/* Buttons */
.app-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 8px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.app-btn.is-primary { background: var(--a-primary); color: #fff; }
.app-btn.is-outline { background: #fff; color: var(--a-grey-dark); border: 1px solid var(--a-line); }
.app-btn.is-small { height: auto; padding: 12px; font-size: 14px; font-weight: 600; }
.app-btn.is-block { height: 48px; }
.app-btn.is-ghost { height: 48px; border-radius: 6px; border: 1px solid var(--a-grey); color: var(--a-grey); background: #fff; }
.app-btn.is-arrived { background: #f59e0b; color: #fff; border-radius: 6px; }
.app-btn.is-tall { height: 60px; }
.app-bottom-bar { flex: none; display: flex; gap: 20px; padding: 14px 20px 34px; border-top: 1px solid var(--a-line); background: #fff; }
.app-bottom-bar > * { flex: 1; }
.app-bottom-bar.is-single { padding: 12px 24px 34px; }
.app-actions { flex: none; display: flex; flex-direction: column; gap: 24px; padding: 12px 20px 34px; border-top: 1px solid var(--a-line); }

/* Home */
.app-body:has(.app-home-top) { margin-top: -44px; }
.app-home-top { flex: none; height: 140px; padding: 44px 16px 0; display: flex; align-items: center; justify-content: space-between; color: #fff;
    background: radial-gradient(circle at 92% -40%, transparent 44%, rgba(255, 255, 255, 0.22) 44.4%, transparent 45%), radial-gradient(circle at 92% -40%, transparent 62%, rgba(255, 255, 255, 0.18) 62.4%, transparent 63%), linear-gradient(100deg, #f4b13a 0%, #ef8a2c 45%, #e94925 100%); }
.app-home-hi { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.app-mirror { display: inline-flex; transform: scaleX(-1); }
.app-home-actions { display: flex; align-items: center; gap: 16px; }
.app-bell { position: relative; }
.app-bell-badge { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--a-primary); font-size: 10px; font-weight: 500; display: grid; place-items: center; }
.app-home-body { flex: 1; background: var(--a-surface); padding: 24px 16px; }
.app-tiles { display: flex; gap: 12px; }
.app-tile { flex: 1; height: 150px; padding: 12px; border-radius: 12px; border: 1px solid var(--a-fill); background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); display: flex; flex-direction: column; }
.app-tile-head { display: flex; justify-content: space-between; align-items: flex-start; color: var(--a-grey-light); margin-bottom: auto; }
.app-tile-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; }
.app-tile-icon.is-primary { background: rgba(233, 73, 37, 0.1); color: var(--a-primary); }
.app-tile-icon.is-orange { background: rgba(255, 152, 0, 0.1); }
.app-tile b { font-size: 36px; font-weight: 700; color: var(--a-dark-chip); line-height: 1.1; }
.app-tile > span:last-child { margin-top: 4px; font-size: 13px; color: var(--a-grey); }
.app-barrier { position: absolute; inset: -44px 0 -96px; background: rgba(0, 0, 0, 0.54); display: flex; align-items: center; padding: 0 40px; z-index: 4; }
.app-dialog { width: 100%; padding: 20px; border-radius: 16px; background: #fff; display: flex; flex-direction: column; }
.app-dialog-head { display: flex; justify-content: space-between; gap: 8px; color: var(--a-grey); }
.app-dialog-head b { font-size: 18px; font-weight: 700; color: var(--a-text); }
.app-dialog p { margin: 16px 0 20px; font-size: 14px; line-height: 1.4; color: var(--a-grey); }

/* Order detail (OrderTopDetailView) */
.app-order-top { padding: 16px 20px 16px; }
.app-customer { display: flex; align-items: center; gap: 8px; color: var(--a-grey-dark); padding-bottom: 25px; }
.app-customer b { font-size: 16px; color: var(--a-black); }
.app-divider { height: 1px; background: var(--a-line); margin: 0 0 20px; }
.app-rule { height: 1px; background: var(--a-line); }
.app-rule.is-spaced { margin: 8px 0; }
.app-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--a-grey); padding-bottom: 12px; }
.app-meta > span { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.app-meta .app-ic { color: var(--a-primary); }
.app-initials { flex: none; width: 16px; height: 16px; border-radius: 8px; background: #fdede9; color: var(--a-primary); font-size: 7px; font-weight: 500; display: grid; place-items: center; }
.app-initials.is-large { width: 24px; height: 24px; border-radius: 12px; font-size: 11px; }
.app-goods { display: flex; align-items: center; padding: 10px 0 16px; }
.app-goods.is-padded { padding: 16px 20px; }
.app-goods > span { flex: 1; display: flex; gap: 6px; align-items: flex-start; font-size: 12px; font-weight: 500; color: var(--a-black); }
.app-goods > span > .app-ic { color: var(--a-primary); }
.app-goods small { display: block; font-size: 11px; font-weight: 400; color: var(--a-grey); margin-bottom: 2px; }
.app-goods > .app-goods-more { flex: none; padding-left: 8px; color: var(--a-grey-light); }
.app-goods-description { margin: 0 0 12px; padding: 12px; border-radius: 6px; background: var(--a-surface); display: flex; flex-direction: column; gap: 8px; }
.app-goods-description b { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--a-grey-dark); }
.app-goods-description span { font-size: 12px; color: #4e4e4e; }
.app-timing { padding-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--a-grey); }
.app-timing small { font-size: 12px; font-weight: 400; }
.app-timing span, .app-order-info-times span, .app-completed-times span { display: flex; align-items: center; gap: 4px; }
.app-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.app-dot.is-green { background: radial-gradient(circle, #22c55e 0 4.5px, #dcfce7 5px); }
.app-dot.is-orange { background: radial-gradient(circle, #f59e0b 0 4.5px, #fef3c7 5px); }
.app-dot.is-large { width: 20px; height: 20px; background: radial-gradient(circle, #f59e0b 0 6px, #fef3c7 6.5px); }
.app-gap { height: 12px; background: var(--a-fill); }
.app-stops-head { padding: 24px 20px 0; font-size: 16px; font-weight: 500; color: var(--a-grey-light); margin-bottom: 16px; }

/* Stops (AddressCardWidget); status colours from utility/order_status_helper.dart, tint = 15 % of the colour on white */
.app-address { display: flex; align-items: center; padding: 16px 0; border-left: 4px solid transparent; border-bottom: 1px solid var(--a-line); background: #fff; }
.app-address-icon { flex: none; width: calc(var(--inset, 20px) + 40px); display: grid; place-items: center; }
.app-address[style*="--inset: 0px"] { border-bottom: 0; padding: 0; }
.app-address-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--a-grey-dark); }
.app-address-text b { font-size: 13px; color: var(--a-black); margin-bottom: 1px; }
.app-address-text.is-muted span { color: var(--a-grey); }
.app-address-chevron { flex: none; padding: 0 8px; color: var(--a-grey-light); }
.app-address.is-enroute { border-left-color: var(--a-enroute); background: #e2ecfe; }
.app-address.is-arrived { border-left-color: var(--a-arrived); background: #fef5da; }
.app-address.is-finished { border-left-color: var(--a-finished); background: #dbf5ec; }
.app-address.is-finished .app-address-text { color: rgba(55, 65, 81, 0.7); }
.app-address.is-finished .app-address-text b { color: rgba(55, 65, 81, 0.7); }
.app-stop-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.app-stop-icon.is-pickup { background: #dcfce7; color: #16a34a; }
.app-stop-icon.is-drop { background: #fef3c7; color: #f59e0b; }
.app-stop-info { margin: 12px 20px 16px; padding: 12px 12px 12px 20px; border-radius: 8px; border-left: 4px solid transparent; display: flex; gap: 12px; align-items: flex-start; }
.app-stop-info.is-enroute { border-left-color: var(--a-enroute); background: #e2ecfe; }
.app-info-box { margin: 0 20px 12px; padding: 12px; border-radius: 6px; background: var(--a-surface); display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #4e4e4e; }
.app-info-box b { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--a-grey-dark); }
.app-log { display: flex; justify-content: space-between; padding-right: 34px; }

/* My orders */
.app-pills { flex: none; display: flex; gap: 12px; padding: 16px 16px 0; overflow: hidden; }
.app-pills.is-scrolled { justify-content: flex-end; }
.app-pill { flex: none; padding: 4px 16px; border-radius: 100px; border: 1px solid var(--a-grey); color: var(--a-grey); font-size: 16px; line-height: 22px; }
.app-pill.is-selected { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.app-list { padding: 32px 16px 16px; }
.app-order-card { border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); overflow: hidden; }
.app-order-card .app-address:last-child { border-bottom: 0; }
.app-order-info { position: relative; padding: 11px 20px 8px; border-bottom: 1px solid var(--a-line); }
.app-order-no { position: absolute; left: -5px; top: -5px; width: 60px; height: 60px; border-radius: 50%; background: #fff; border: 2px solid var(--a-fill); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--a-dark-chip); }
.app-order-card { overflow: visible; }
.app-order-info-name { padding-left: 50px; display: flex; align-items: center; justify-content: space-between; color: var(--a-grey-light); }
.app-order-info-name b { font-size: 14px; color: var(--a-black); }
.app-order-info-company { padding-left: 50px; margin: 2px 0 3px; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--a-grey); }
.app-order-info .app-meta { padding: 7px 0 12px; }
.app-order-info-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--a-grey); }
.app-toast { position: absolute; left: 50%; bottom: 136px; transform: translateX(-50%); padding: 10px 18px; border-radius: 22px; background: #10b981; color: #fff; font-size: 14px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); z-index: 4; }
.app-list-tools { flex: none; height: 48px; display: flex; align-items: center; border-top: 1px solid var(--a-line); font-size: 16px; font-weight: 500; color: var(--a-grey); }
.app-list-tools span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }
.app-list-tools i { font-style: normal; }

/* Completed orders */
.app-completed { background: var(--a-fill); padding-top: 20px; }
.app-completed-search { background: #fff; padding: 16px; display: flex; align-items: center; gap: 8px; color: var(--a-grey); margin-bottom: 12px; }
.app-completed-search .app-ic:first-child { color: var(--a-primary); }
.app-completed-search b { flex: 1; font-size: 16px; color: var(--a-black); }
.app-completed-card { background: #fff; padding: 16px 20px; }
.app-completed-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 25px; }
.app-completed-title b { font-size: 16px; }
.app-completed-title span { padding: 3px 6px; border-radius: 4px; background: var(--a-dark-chip); color: #fff; font-size: 10px; font-weight: 500; }
.app-completed-meta { display: flex; align-items: center; margin: 8px 0 12px; font-size: 12px; color: #4e4e4e; }
.app-completed-meta > span { flex: 1; display: flex; align-items: center; gap: 8px; }
.app-completed-meta > i { width: 1px; height: 14px; background: var(--a-grey-light); }
.app-completed-meta .is-goods { justify-content: center; gap: 6px; color: var(--a-primary); font-weight: 500; }
.app-completed-times { display: flex; gap: 32px; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--a-grey); margin-bottom: 12px; }

/* Signature (POD) */
.app-pod-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 16px 20px 0; }
.app-pod-head .app-ic { margin-right: 8px; }
.app-pod-head b { font-size: 18px; color: #000; }
.app-pod { padding: 16px 20px 0; display: flex; flex-direction: column; gap: 16px; }
.app-pod-goods { padding: 12px 16px; border-radius: 8px; border: 1px solid var(--a-line); background: var(--a-surface); display: flex; gap: 15px; align-items: center; font-size: 14px; color: var(--a-grey-dark); }
.app-pod-goods .app-ic { color: var(--a-grey); margin-left: 3px; }
.app-signature { position: relative; height: 330px; border-radius: 8px; border: 1px solid var(--a-line); display: grid; place-items: center; }
.app-signature svg { width: 88%; }
.app-signature-clear { position: absolute; top: 12px; right: 12px; font-size: 14px; font-weight: 500; color: var(--a-text); }
.app-field { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.app-field-label { font-size: 14px; font-weight: 500; color: var(--a-text); }
.app-field-label i { font-style: normal; color: var(--a-primary); }
.app-field-input { padding: 12px 10px; border-radius: 8px; border: 1px solid var(--a-line); font-size: 14px; color: var(--a-text); }
/* The first view of a tour is the plain screenshot: no shading, no numbers. */
.tour.is-overview .tour-region, .tour.is-overview .tour-focus { display: none; }
.tour-num.is-overview { background: var(--surface-alt); color: var(--muted); }
.quiz-targets { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.quiz-targets li { display: flex; align-items: center; gap: 8px; }
.quiz-targets li > span { display: flex; flex-direction: column; font-size: 13px; color: var(--fg2); }
.quiz-targets b { color: var(--text); }
/* The badge chip in the top bar opens the learner's badges per role */
.badge-menu { position: relative; }
.badge-menu > summary { list-style: none; cursor: pointer; }
.badge-menu > summary::-webkit-details-marker { display: none; }
.badge-menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(320px, 90vw); padding: 14px;
    display: flex; flex-direction: column; gap: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg);
}
.badge-menu-title { font-size: 14px; }
.badge-menu-role { display: flex; flex-direction: column; gap: 6px; }
.badge-menu-role-name { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.badge-menu-medals { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-menu-medals .level-badge.is-compact .level-badge-medal { width: 36px; height: 36px; }
.badge-menu-panel .muted { font-size: 13.5px; margin: 0; }
.badge-menu-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning-fg); margin-left: -4px; }
.badge-menu-new {
    display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
    text-decoration: none; color: var(--text); background: var(--warning-soft);
}
.badge-menu-new:hover { color: var(--primary); }
.badge-menu-more { font-size: 13.5px; font-weight: 600; color: var(--primary); text-decoration: none; }
/* A legend sits on a fieldset's border by default; floating it keeps the question inside its card. */
.q > legend { float: left; width: 100%; }
.q > legend + * { clear: both; }
/* Level 0 on the front page: the shared start for every role, in the level 0 colour */
[data-zone="start"] { --zone: #34c08a; --zone-soft: #e9f9f1; --zone-fg: #13875c; }
:root[data-theme="dark"] [data-zone="start"] { --zone-soft: #15302a; --zone-fg: #5fd9a8; }
.hero { grid-template-columns: 1fr; }
.start-intro { color: var(--fg2); max-width: 75ch; margin: 0; }
.start-progress { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--fg2); }
.start-lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.zone .start-card { flex-direction: row; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text); border-color: var(--border); background: var(--surface); }
.zone .start-card:hover { border-color: var(--zone); box-shadow: 0 6px 18px color-mix(in srgb, var(--zone) 18%, transparent); }
.start-step { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--zone); color: #fff; font-weight: 700; }
.zone-level.level-badge.is-compact .level-badge-medal { width: 42px; height: 42px; }
/* Levels on a role page as tabs */
.level-tab-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.level-tab {
    --metal: #9aa3b1; display: flex; gap: 10px; align-items: center; text-align: left; cursor: pointer; font: inherit; color: var(--text);
    padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); border-bottom: 4px solid transparent; background: var(--surface);
}
.level-tab.tier-0 { --metal: #34c08a; } .level-tab.tier-1 { --metal: #cd8a4b; } .level-tab.tier-2 { --metal: #9aa3b1; } .level-tab.tier-3 { --metal: #f2b93b; }
.level-tab:hover { border-color: var(--metal); }
.level-tab[aria-selected="true"] { border-color: var(--metal); border-bottom-color: var(--metal); background: color-mix(in srgb, var(--metal) 10%, var(--surface)); }
.level-tab .level-icon.is-small.level-badge.is-compact .level-badge-medal { width: 30px; height: 30px; }
.level-tab-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.level-tab-text b { font-size: 13.5px; }
.level-tab-text span { font-size: 12.5px; color: var(--muted); }
.level-tab.has-new { position: relative; }
.level-tab.has-new .level-tab-text span { color: var(--warning-fg); font-weight: 600; }
.level-tab-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warning-fg); }

/* Locked levels: muted with a small lock, a waiting state rather than a warning. */
.level-badge.is-locked .level-badge-medal { background: var(--border); }
.level-badge.is-locked .level-badge-face { color: var(--muted); opacity: 0.7; }
.level-badge-lock {
    position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1px var(--border);
}
.level-badge-lock svg { width: 10px; height: 10px; }
.level-badge.is-large .level-badge-lock, .track-step.is-current .level-badge-lock { width: 22px; height: 22px; }
.level-badge.is-large .level-badge-lock svg, .track-step.is-current .level-badge-lock svg { width: 13px; height: 13px; }
.level-tab.is-locked .level-tab-text b { color: var(--fg2); }
.level-tab.is-locked:not([aria-selected="true"]) { background: var(--surface-alt); }
.level-lock-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.level-guest-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 18px; font-size: 13px; color: var(--muted); background: var(--surface-alt); border-bottom: 1px solid var(--border-soft); }
.lesson-row.is-locked { cursor: default; }
.lesson-row.is-locked .t { font-weight: 500; color: var(--fg2); }
.lesson-row.is-locked .badge { display: inline-flex; align-items: center; gap: 4px; }
.state-dot.locked { color: var(--muted); border-style: dashed; }
.state-dot.locked svg { width: 12px; height: 12px; }
.track-step.is-locked { opacity: 0.7; background: var(--surface-alt); }
.track-step.is-current.is-locked { opacity: 1; }
.track-lock { display: inline-flex; align-items: center; gap: 5px; }
.role-level-lock { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.lesson-nav-lock { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; }
.lesson-nav-lock small { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.locked-panel { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; }
.lesson-level .level-badge-lock { display: none; }
.locked-panel h2 { font-size: 18px; }
.locked-icon {
    flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border);
}
.locked-icon svg { width: 20px; height: 20px; }
.locked-callout { align-items: center; }
.locked-callout a { color: var(--primary); font-weight: 600; text-decoration: none; margin-left: 4px; }
@media (max-width: 560px) {
    .lesson-nav-lock { align-items: stretch; width: 100%; }
    .locked-panel { flex-direction: column; }
}
