/* ============================================================
   Theoryworks — Instrument design system
   Loads after Bootstrap. Student-facing pages only.
   ============================================================ */

:root {
    --tw-ink: #16181D;
    --tw-ink-soft: #4B5160;
    --tw-ink-faint: #6A7080;
    --tw-bg: #F7F8FA;
    --tw-surface: #FFFFFF;
    --tw-line: #E3E6EB;
    --tw-line-soft: #E9EBEF;
    --tw-accent: #2B55C4;
    --tw-accent-dark: #1E3E96;
    --tw-accent-tint: #EEF2FC;
    --tw-good: #256B37;
    --tw-good-tint: #EAF6EC;
    --tw-bad: #A33333;
    --tw-bad-tint: #FBEDED;
    --tw-radius: 10px;
}

/* Keep room for the page scroll bar so the layout doesn't shift
   when a long Details panel makes the page scroll (classic scroll bars) */
html { scrollbar-gutter: stable; }

body.tw-student {
    background: var(--tw-bg);
    color: var(--tw-ink);
    font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */

.tw-header {
    height: 60px;
    background: var(--tw-surface);
    border-bottom: 1px solid var(--tw-line);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    flex-shrink: 0;
}

.tw-brand {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--tw-ink);
    text-decoration: none;
}

.tw-brand:hover { color: var(--tw-accent-dark); }

.tw-header-divider {
    width: 1px;
    height: 22px;
    background: var(--tw-line);
}

.tw-header-context {
    font-size: 14px;
    color: var(--tw-ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tw-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.tw-nav a {
    font-size: 14px;
    color: var(--tw-ink-faint);
    text-decoration: none;
    padding: 4px 0;
}

.tw-nav a:hover { color: var(--tw-ink); }

.tw-nav a.active {
    color: var(--tw-ink);
    font-weight: 600;
    border-bottom: 2px solid var(--tw-accent);
}

.tw-nav a.tw-nav-cta,
.tw-nav a.tw-nav-cta:hover {
    color: #fff;
    padding: 7px 14px;
}

.tw-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tw-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Page shell ---------- */

.tw-main {
    flex-grow: 1;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 28px 48px;
}

.tw-main.tw-main-wide {
    max-width: none;
    padding: 24px 28px 32px;
}

.tw-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.tw-page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.tw-footer {
    padding: 18px 28px;
    font-size: 12px;
    color: var(--tw-ink-faint);
    text-align: center;
}

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

.tw-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.tw-btn-primary { background: var(--tw-accent); color: #fff; }
.tw-btn-primary:hover { background: var(--tw-accent-dark); color: #fff; }

.tw-btn-dark { background: var(--tw-ink); color: #fff; }
.tw-btn-dark:hover { background: #2A2E38; color: #fff; }

.tw-btn-ghost {
    background: var(--tw-surface);
    color: var(--tw-ink);
    border-color: #D6DAE1;
}
.tw-btn-ghost:hover { border-color: var(--tw-ink-faint); color: var(--tw-ink); }

.tw-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Course / drill library ---------- */

.tw-resume {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 22px 26px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    margin-bottom: 24px;
}

.tw-resume-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tw-accent);
    margin-bottom: 6px;
}

.tw-resume-title { font-size: 18px; font-weight: 600; }

.tw-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1000px) {
    .tw-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .tw-card-grid { grid-template-columns: 1fr; }
}

.tw-course-card {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tw-course-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: var(--tw-ink);
}

.tw-course-desc {
    font-size: 13px;
    line-height: 1.55;
    color: var(--tw-ink-faint);
    margin: 0;
}

.tw-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--tw-accent-tint);
    color: var(--tw-accent-dark);
}

.tw-badge-good { background: var(--tw-good-tint); color: var(--tw-good); }

.tw-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.tw-card-meta { font-size: 12px; color: var(--tw-ink-faint); }

.tw-versions {
    font-size: 12px;
    color: var(--tw-ink-faint);
    border: 1px solid #D6DAE1;
    border-radius: 7px;
    padding: 5px 8px;
    background: var(--tw-surface);
}

/* ---------- Player chrome ---------- */

.tw-player-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    margin-bottom: 16px;
}

.tw-player-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tw-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.tw-player-bar .progress {
    width: 170px;
    height: 6px;
    border-radius: 3px;
    background: var(--tw-line-soft);
}

.tw-player-bar .progress-bar {
    background: var(--tw-accent) !important;
    border-radius: 3px;
}

.tw-timer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--tw-accent-tint);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--tw-accent-dark);
}

.tw-player-card {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    padding: 8px 10px 14px;
}

/* ---------- Player content (ported from the old course.css,
     class names unchanged so the player scripts keep working) ---------- */

.courseContainer,
.drillContainer {
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.courseContainerLeft,
.drillContainerLeft {
    flex: 0 0 60%;
    padding: 18px 22px 10px 14px;
    position: relative;
    transition: none;
}

#courseContent, #courseQuestions,
#drillContent, #drillQuestions {
    position: relative;
}

.courseContainerRight,
.drillContainerRight {
    flex: 0 0 40%;
    padding: 18px 14px 10px 22px;
    position: relative;
    border-left: 1px solid var(--tw-line-soft);
}

.courseContainer:has(.courseContainerRight:empty) .courseContainerLeft,
.drillContainer:has(.drillContainerRight:empty) .drillContainerLeft {
    flex: 0 0 100%;
}

/* Reading text: serif, like the exam. Lesson content pages (no question)
   are left out: they get real headings and paragraphs (see the end of this file). */
body:not(.tw-content-page) #courseContent, body:not(.tw-content-page) #courseContent *,
#drillContent, #drillContent * {
    font-size: 17px !important;
    line-height: 1.75 !important;
    letter-spacing: 0.1px;
    display: inline;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--tw-ink);
}

#courseContent popover, #courseContent greenpopover,
#courseContent p, #courseContent span,
#drillContent popover, #drillContent greenpopover,
#drillContent p, #drillContent span,
.note-editable p {
    font-size: inherit;
}

#courseContent img, #drillContent img {
    width: 100% !important;
    height: auto;
}

#mainQuestion {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.55 !important;
    letter-spacing: 0.1px;
    display: inline;
    font-family: 'Public Sans', system-ui, sans-serif;
    color: var(--tw-ink);
}

.courseContainerRight hr, .drillContainerRight hr {
    border-color: var(--tw-line);
    opacity: 1;
    margin: 12px 0;
}

.courseContainerRight small { font-size: 12px; color: var(--tw-ink-faint); }

/* ---------- Answer blocks ---------- */

.block {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: inherit;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    line-height: 1.55 !important;
    letter-spacing: 0.1px;
    font-family: Georgia, 'Times New Roman', serif;
}

.block p {
    font-size: 15px !important;
    display: inline;
    color: inherit !important;
}

.block > span {
    color: var(--tw-accent) !important;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-weight: 700;
    cursor: pointer;
    min-width: 18px;
    text-align: center;
}

.block p span,
.block div span { color: inherit !important; }

.block div { width: 100%; font-size: 15px !important; }

.block popover,
.block greenpopover,
.block redpopover {
    cursor: pointer;
}

/* Eliminate button inside a block */
.block .eliminate {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--tw-ink-faint);
    padding: 4px 8px;
    flex-shrink: 0;
}

.block .eliminate:hover {
    border-color: var(--tw-line);
    color: var(--tw-ink);
    background: var(--tw-bg);
}

/* Eliminated answer */
.selectedItem {
    background: #F3F4F7;
    border-color: var(--tw-line-soft);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    color: #878D99;
}

.selectedItem > span { color: #9AA0AC !important; }

.block.correctAnswer {
    background-color: var(--tw-good-tint);
    border: 2px solid #3F8E53;
}

.block.wrongAnswer {
    background-color: var(--tw-bad-tint);
    border: 2px solid #C05252;
}

.block.successAnswer { background-color: var(--tw-good-tint); }

/* ---------- Details panel ---------- */

#courseDetails {
    scrollbar-gutter: stable;
    background: var(--tw-bg);
    border-left: 1px solid var(--tw-line);
    padding: 14px;
    overflow-y: auto;
    max-height: 650px;
    transition: all 0.3s ease;
    font-size: 15px;
    border-radius: 0 10px 10px 0;
}

#courseDetails h4 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tw-ink-soft);
}

#popoverContent { font-size: 14px; }

.explain-item {
    border: 1px solid var(--tw-line) !important;
    border-radius: 10px !important;
    background: var(--tw-surface) !important;
}

.explainActive { cursor: pointer; }
.explain-item:hover { background-color: #FDFDFE !important; }

.explain-item.active { outline: 2px dashed #444; }

/* ---------- Segments review panel (post-submit / Explain) ---------- */

.tw-seg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 18px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--tw-line);
}

.tw-seg-head:first-child { margin-top: 2px; padding-top: 0; border-top: none; }

.tw-seg-head-label {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6A7080;
}

.tw-seg-correct {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #3f9415;
    border-radius: 4px;
    padding: 2px 8px;
}

.tw-seg {
    border-left: 3px solid #949415;
    padding: 2px 0 2px 12px;
    margin-bottom: 14px;
    cursor: default;
}

.tw-seg-label {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.tw-seg-phrase {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--tw-ink);
    margin-bottom: 3px;
}

.tw-seg-note {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: #4B5160;
    margin: 0;
}

#popoverContent.tw-collapsed .tw-seg-note { display: none; }

.tw-collapse-btn {
    border: none;
    background: none;
    color: var(--tw-accent);
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.tw-collapse-btn:hover { color: #1E3E96; text-decoration: underline; }

.tw-seg.active,
.tw-seg.tw-seg-flash { background: #EEF2FC; border-radius: 0 8px 8px 0; }

/* ---------- Player toolbar buttons & pagination ----------
   The player scripts toggle btn-info / btn-outline-info,
   so those classes are re-skinned here for player pages. */

.tw-player .btn-outline-info {
    color: var(--tw-ink);
    border-color: #D6DAE1;
    background: var(--tw-surface);
    font-weight: 500;
}

.tw-player .btn-outline-info:hover {
    background: var(--tw-bg);
    color: var(--tw-ink);
    border-color: var(--tw-ink-faint);
}

.tw-player .btn-info,
.tw-player .btn-info:hover {
    background: var(--tw-accent);
    border-color: var(--tw-accent);
    color: #fff;
    font-weight: 600;
}

.tw-player #nextButton {
    background: var(--tw-accent);
    border-color: var(--tw-accent);
    color: #fff;
    font-weight: 600;
}

.tw-player #nextButton:hover {
    background: var(--tw-accent-dark);
    border-color: var(--tw-accent-dark);
}

.tw-player #submitButton:not(:disabled) {
    background: var(--tw-good);
    border-color: var(--tw-good);
    color: #fff;
    font-weight: 600;
}

.paginationContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.paginationContainer .paginationButton {
    min-width: 38px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
}

/* ---------- Verification banner ---------- */

.tw-banner {
    background: #FFF7E6;
    border-bottom: 1px solid #F0DFB6;
    color: #6B5518;
    font-size: 14px;
    padding: 10px 28px;
}

.tw-banner form { display: inline; }

.tw-banner button {
    background: none;
    border: none;
    padding: 0;
    color: #6B5518;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
}

/* ============================================================
   Tagged elements in the course player (Sept 24, 2026)
   Before Submit/Explain: no underline, no colour.
   Hover: blue-grey tint + thin accent underline.
   After Submit/Explain: the same neutral dotted marker on every element.
   Label colour only on the element the student clicked (.tw-picked)
   or the one whose Details card they're pointing at (.active).
   ============================================================ */

.courseContainer :is(popover, greenpopover, redpopover) {
    cursor: pointer;
    border-radius: 3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-color .12s ease, box-shadow .12s ease;
}

.courseContainer :is(popover, greenpopover, redpopover):hover {
    background-color: #E4EAF5;
    box-shadow: inset 0 -2px 0 var(--tw-accent);
}

.tw-revealed .courseContainer :is(popover, greenpopover, redpopover) {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: #A3AAB6;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 5px;
}

.tw-revealed .courseContainer :is(popover, greenpopover, redpopover):hover,
.tw-revealed .courseContainer :is(popover, greenpopover, redpopover):is(.tw-picked, .active) {
    text-decoration-color: transparent;
}

.courseContainer redpopover:is(.tw-picked, .active) {
    background-color: #FBE4E1;
    box-shadow: inset 0 -2px 0 #c0392b;
}

.courseContainer greenpopover:is(.tw-picked, .active) {
    background-color: #E4F2DC;
    box-shadow: inset 0 -2px 0 #3f9415;
}

.courseContainer popover:is(.tw-picked, .active) {
    background-color: #F3F1CF;
    box-shadow: inset 0 -2px 0 #949415;
}

.tw-seg.tw-seg-single {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-left-width: 3px;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 6px;
}

/* ============================================================
   Side bar (signed-in pages and question pages)
   ============================================================ */

.tw-shell {
    display: flex;
    flex: 1 0 auto;
    min-height: 100vh;
}

.tw-rail {
    width: 68px;
    flex-shrink: 0;
    background: #15171C;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.tw-rail-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--tw-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    margin-bottom: 14px;
}

.tw-rail-logo:hover { color: #fff; background: var(--tw-accent-dark); }

.tw-rail-link {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #8E95A3;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, color .12s;
}

.tw-rail-link svg { width: 20px; height: 20px; }
.tw-rail-link:hover { background: rgba(255, 255, 255, .07); color: #E4E7EC; }
.tw-rail-link.active,
.tw-rail-link.active:hover { background: var(--tw-accent); color: #fff; }

.tw-rail-form { margin: 0; }
.tw-rail-grow { flex: 1; }

.tw-rail-tip {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #15171C;
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s, transform .12s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.tw-rail-link:hover .tw-rail-tip,
.tw-rail-link:focus-visible .tw-rail-tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.tw-shell-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Question toolbar sits at the very top on question pages */
.tw-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--tw-surface);
    border-bottom: 1px solid var(--tw-line);
}

.tw-topbar .tw-player-bar {
    border: 0;
    border-radius: 0;
    margin: 0;
    min-height: 64px;
    padding: 10px 28px;
    background: transparent;
}

.tw-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 15px;
}

.tw-crumbs a {
    color: var(--tw-ink-faint);
    text-decoration: none;
    white-space: nowrap;
}

.tw-crumbs a:hover { color: var(--tw-accent); }
.tw-crumbs-sep { color: #B3B8C2; }

@media (max-width: 760px) {
    .tw-shell { display: block; }
    .tw-shell-main { min-height: 100vh; padding-bottom: 60px; }
    .tw-rail {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0 8px;
    }
    .tw-rail-logo, .tw-rail-grow, .tw-rail-tip { display: none; }
    .tw-topbar .tw-player-bar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
    .tw-topbar .tw-progress-wrap { margin-left: 0; flex-wrap: wrap; }
    .tw-topbar .progress { display: none; }
    .tw-topbar .btn { white-space: nowrap; padding: 6px 10px; }
}

/* ============================================================
   Free tier + Advanced Curriculum (Sept 2026)
   ============================================================ */

/* ---------- Flash messages (student pages) ---------- */

.tw-flash {
    max-width: 1240px;
    margin: 16px auto 0;
    padding: 0 28px;
    width: 100%;
}

.tw-flash div {
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid transparent;
}

.tw-flash-ok { background: var(--tw-good-tint); border-color: #CBE7D1 !important; color: var(--tw-good); }
.tw-flash-bad { background: var(--tw-bad-tint); border-color: #F0CFCF !important; color: var(--tw-bad); }

/* ---------- Locked items in the course / drill lists ---------- */

.tw-badge-muted { background: #F3F4F7; color: #4B5160; }
.tw-badge-free { background: var(--tw-good-tint); color: var(--tw-good); }

.tw-badge-lock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F3F4F7;
    color: #4B5160;
}

.tw-badge-lock svg,
.tw-lock-icon { width: 12px; height: 12px; flex-shrink: 0; }

.tw-course-card.tw-locked .tw-course-title { color: var(--tw-ink-soft); }

.tw-upsell {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 24px;
    background: var(--tw-accent-tint);
    border: 1px solid #D7E0F6;
    border-radius: 14px;
    margin-bottom: 24px;
}

.tw-upsell-text { flex-grow: 1; font-size: 14px; color: var(--tw-ink-soft); }
.tw-upsell-text strong { display: block; font-size: 16px; color: var(--tw-ink); margin-bottom: 2px; }

/* ---------- Locked page numbers in the player ---------- */

.paginationContainer .tw-page-locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 38px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
    color: #9AA0AC;
    border: 1px dashed #D6DAE1;
    background: var(--tw-surface);
}

.paginationContainer .tw-page-locked:hover { color: var(--tw-ink-soft); border-color: var(--tw-ink-faint); background: var(--tw-surface); }
.paginationContainer .tw-page-locked svg { width: 11px; height: 11px; }

/* ---------- The wall (end of what this person can see) ---------- */

.tw-wall-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(22, 24, 29, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.tw-wall-backdrop.open { display: flex; }

.tw-wall {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--tw-surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(22, 24, 29, 0.25);
    padding: 30px 30px 26px;
}

.tw-wall-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tw-accent);
    margin-bottom: 8px;
}

.tw-wall h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--tw-ink);
}

.tw-wall p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--tw-ink-soft);
    margin: 0 0 20px;
}

.tw-wall-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tw-wall-actions .tw-btn { padding: 11px 20px; }

.tw-wall-alt { font-size: 14px; color: var(--tw-ink-faint); margin-top: 16px; }
.tw-wall-alt a { color: var(--tw-accent); font-weight: 600; text-decoration: none; }
.tw-wall-alt a:hover { text-decoration: underline; }

.tw-wall-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tw-ink-faint);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tw-wall-close:hover { background: var(--tw-bg); color: var(--tw-ink); }

/* ---------- Sign-in / sign-up / password pages ---------- */

.tw-auth {
    max-width: 420px;
    margin: 24px auto 0;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 16px;
    padding: 32px 32px 28px;
}

.tw-auth h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.tw-auth-lead { font-size: 14px; line-height: 1.55; color: var(--tw-ink-faint); margin: 0 0 22px; }

.tw-field { margin-bottom: 16px; }

.tw-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tw-ink-soft);
    margin-bottom: 6px;
}

.tw-field input[type=text],
.tw-field input[type=email],
.tw-field input[type=password] {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--tw-ink);
    background: var(--tw-surface);
    border: 1px solid #D6DAE1;
    border-radius: 8px;
    outline: none;
}

.tw-field input:focus { border-color: var(--tw-accent); box-shadow: 0 0 0 3px var(--tw-accent-tint); }
.tw-field input.is-invalid { border-color: var(--tw-bad); }
.tw-field-error { font-size: 13px; color: var(--tw-bad); margin-top: 5px; }
.tw-field-hint { font-size: 12px; color: var(--tw-ink-faint); margin-top: 5px; }

.tw-field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; font-size: 14px; }
.tw-field-row label { display: inline-flex; align-items: center; gap: 7px; color: var(--tw-ink-soft); margin: 0; }
.tw-field-row a,
.tw-auth-foot a { color: var(--tw-accent); font-weight: 600; text-decoration: none; }
.tw-field-row a:hover,
.tw-auth-foot a:hover { text-decoration: underline; }

.tw-auth .tw-btn-block { width: 100%; justify-content: center; padding: 11px 18px; font-size: 15px; }

.tw-auth-foot { text-align: center; font-size: 14px; color: var(--tw-ink-faint); margin-top: 18px; }

.tw-auth-status {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    background: var(--tw-good-tint);
    color: var(--tw-good);
    margin-bottom: 18px;
}

/* ---------- Advanced Curriculum page ---------- */

.tw-unlock {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .tw-unlock { grid-template-columns: 1fr; }
}

.tw-unlock-intro h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.tw-unlock-intro .tw-unlock-sub { font-size: 16px; color: var(--tw-ink-soft); margin: 0 0 24px; line-height: 1.55; }

.tw-unit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    overflow: hidden;
}

.tw-unit-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--tw-line-soft);
    font-size: 15px;
}

.tw-unit-list li:first-child { border-top: 0; }
.tw-unit-list .tw-unit-name { flex-grow: 1; font-weight: 500; }

.tw-buy {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    padding: 26px;
    position: sticky;
    top: 24px;
}

.tw-buy-price { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 2px; }
.tw-buy-note { font-size: 13px; color: var(--tw-ink-faint); margin-bottom: 20px; }
.tw-buy ul { padding-left: 18px; margin: 0 0 22px; font-size: 14px; color: var(--tw-ink-soft); line-height: 1.7; }
.tw-buy form { margin: 0; }
.tw-buy .tw-btn { width: 100%; justify-content: center; padding: 12px 18px; font-size: 15px; }
.tw-buy-alt { text-align: center; font-size: 14px; color: var(--tw-ink-faint); margin-top: 14px; }
.tw-buy-alt a { color: var(--tw-accent); font-weight: 600; text-decoration: none; }

@media (max-width: 760px) {
    .tw-upsell { flex-direction: column; align-items: flex-start; gap: 14px; }
    .tw-auth { padding: 24px 20px; }
    .tw-wall { padding: 26px 22px 22px; }
}

/* ============================================================
   Free unit: guest card (results so far + sign-up), results page,
   dashboard score card. Added 2026-10-12.
   ============================================================ */

/* ---------- Guest card ---------- */

.tw-wall-backdrop.tw-gw { align-items: flex-start; overflow-y: auto; padding: 32px 16px; }
.tw-gw .tw-wall { max-width: 520px; margin: auto; display: grid; gap: 18px; outline: none; }
.tw-gw .tw-wall p { margin: 0; }
.tw-gw-head { display: grid; gap: 6px; }
.tw-gw-head .tw-wall-eyebrow { margin: 0; }
.tw-gw .tw-wall h2 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; margin: 0; font-variant-numeric: tabular-nums; }

.tw-gw-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); gap: 5px; }
.tw-gw-cell {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 6px 0 5px;
    border-radius: 7px;
    background: var(--tw-bg);
    color: var(--tw-ink-faint);
    font-variant-numeric: tabular-nums;
}
.tw-gw-n { font-size: 11px; font-weight: 600; }
.tw-gw-icon { display: block; width: 14px; height: 14px; }
.tw-gw-icon svg { width: 14px; height: 14px; display: block; }
.tw-gw-cell.ok { background: var(--tw-good-tint); color: var(--tw-good); }
.tw-gw-cell.no { background: var(--tw-bad-tint); color: var(--tw-bad); }
.tw-gw-cell.locked { background: #F3F4F7; color: var(--tw-ink-faint); }
.tw-gw-key { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12px; color: var(--tw-ink-faint); margin-top: -10px; }

.tw-gw-miss { background: var(--tw-bad-tint); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; font-size: 14px; }
.tw-gw-miss[hidden] { display: none; }
.tw-gw-miss-top { font-size: 13px; color: var(--tw-ink-soft); }
.tw-gw-miss-top strong { color: var(--tw-ink); }
.tw-gw-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tw-bad); margin-right: 8px; }
.tw-gw-phrase { font-weight: 600; color: var(--tw-ink); }
.tw-gw .tw-wall p.tw-gw-note { color: var(--tw-ink-soft); font-size: 14px; line-height: 1.5; margin-top: 2px; }
.tw-gw .tw-wall p.tw-gw-clean { font-size: 14px; color: var(--tw-good); background: var(--tw-good-tint); border-radius: 10px; padding: 10px 14px; }
.tw-gw .tw-wall p.tw-gw-ask { font-size: 15px; }
.tw-gw-ask strong { color: var(--tw-ink); }

.tw-gw-form { display: grid; gap: 10px; }
.tw-gw-form .tw-field { margin-bottom: 0; min-width: 0; }
.tw-gw-form .tw-field input { box-sizing: border-box; width: 100%; }
.tw-gw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tw-gw-submit { width: 100%; justify-content: center; padding: 12px 20px; font-size: 15px; margin-top: 4px; }
.tw-gw .tw-wall p.tw-gw-fine { font-size: 12px; color: var(--tw-ink-faint); text-align: center; }
.tw-gw .tw-gw-alt { margin-top: 0; text-align: center; }

@media (max-width: 560px) {
    .tw-wall-backdrop.tw-gw { padding: 16px 12px 40px; }
    .tw-gw .tw-wall { padding: 24px 18px 20px; gap: 16px; }
    .tw-gw .tw-wall h2 { font-size: 24px; }
    .tw-gw-two { grid-template-columns: minmax(0, 1fr); }
    .tw-gw-strip { grid-template-columns: repeat(auto-fit, minmax(24px, 1fr)); gap: 3px; }
}

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

.tw-res { max-width: 1120px; display: grid; gap: 28px; }
.tw-res-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "score offer" "types offer";
    gap: 28px 24px;
    align-items: start;
}
.tw-res-top.tw-res-top-solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "score" "types"; }
.tw-res-score { grid-area: score; display: grid; gap: 16px; }
.tw-res-offer { grid-area: offer; }
.tw-res-types-sec { grid-area: types; display: grid; gap: 14px; }

.tw-res-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tw-accent); }
.tw-res-title { font-size: 40px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin: 0; font-variant-numeric: tabular-nums; }
.tw-res-sub { margin: 0; color: var(--tw-ink-soft); max-width: 60ch; font-size: 15px; }

.tw-res-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); gap: 6px; max-width: 560px; }
.tw-res-cell {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.tw-res-cell svg { width: 16px; height: 16px; }
.tw-res-n { font-size: 12px; font-weight: 600; }
.tw-res-cell.ok { background: var(--tw-good-tint); color: var(--tw-good); }
.tw-res-cell.no { background: var(--tw-bad-tint); color: var(--tw-bad); }
.tw-res-cell.skip { background: #F3F4F7; color: var(--tw-ink-faint); }
.tw-res-cell:hover { border-color: currentColor; }
.tw-res-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--tw-ink-faint); }
.tw-res-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tw-res-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tw-res-dot.ok { background: var(--tw-good); }
.tw-res-dot.no { background: var(--tw-bad); }
.tw-res-dot.skip { background: #C9CED8; }

.tw-res-offer {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    padding: 24px;
    display: grid;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 8px 24px rgba(22, 24, 29, 0.06);
}
.tw-res-offer h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.tw-res-offer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tw-res-offer li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 14px; color: var(--tw-ink-soft); }
.tw-res-offer li svg { width: 18px; height: 18px; color: var(--tw-good); margin-top: 1px; }
.tw-res-offer li strong { color: var(--tw-ink); font-weight: 600; }
.tw-res-price { display: flex; align-items: baseline; gap: 8px; }
.tw-res-amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tw-res-terms { font-size: 13px; color: var(--tw-ink-faint); }
.tw-res-offer form { margin: 0; }
.tw-res-buy { width: 100%; justify-content: center; padding: 12px 20px; font-size: 15px; }
.tw-res-offer-alt { font-size: 13px; text-align: center; margin: 0; }
.tw-res-offer-alt a { color: var(--tw-accent); font-weight: 600; text-decoration: none; }
.tw-res-offer-alt a:hover { text-decoration: underline; }

.tw-res-section { display: grid; gap: 14px; }
.tw-res-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.tw-res-head h3 { font-size: 17px; font-weight: 700; margin: 0; }
.tw-res-note { font-size: 13px; color: var(--tw-ink-faint); }

.tw-res-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tw-res-type { background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 16px 18px; display: grid; gap: 10px; }
.tw-res-type-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tw-res-type-name { font-weight: 600; }
.tw-res-type-score { font-weight: 600; color: var(--tw-ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tw-res-pips { display: flex; gap: 4px; }
.tw-res-pips i { height: 8px; flex: 1; border-radius: 3px; background: var(--tw-line-soft); }
.tw-res-pips i.ok { background: var(--tw-good); }
.tw-res-pips i.no { background: var(--tw-bad); opacity: 0.85; }
.tw-res-type-more { font-size: 13px; color: var(--tw-ink-faint); }
.tw-res-type-more strong { color: var(--tw-accent-dark); font-weight: 600; font-variant-numeric: tabular-nums; }
.tw-res-type-more.clean { color: var(--tw-good); }

.tw-res-qlist { background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); overflow: hidden; }
.tw-res-qhead, .tw-res-q {
    display: grid;
    grid-template-columns: 44px minmax(0, 1.6fr) 90px 90px 110px 80px;
    align-items: center;
    gap: 12px;
    padding-left: 18px;
    padding-right: 18px;
}
.tw-res-qhead { padding-top: 10px; padding-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tw-ink-faint); background: var(--tw-bg); border-bottom: 1px solid var(--tw-line); }
.tw-res-q { padding-top: 13px; padding-bottom: 13px; border-bottom: 1px solid var(--tw-line-soft); scroll-margin-top: 80px; }
.tw-res-q:last-child { border-bottom: 0; }
.tw-res-q-num { font-weight: 700; color: var(--tw-ink-soft); font-variant-numeric: tabular-nums; }
.tw-res-q-type { font-weight: 500; min-width: 0; }
.tw-res-q-ans { display: contents; }
.tw-res-q-label { display: none; }
.tw-res-letter {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--tw-line);
    font-size: 13px;
    font-weight: 700;
    color: var(--tw-ink-soft);
}
.tw-res-letter.ok { border-color: var(--tw-good); color: var(--tw-good); background: var(--tw-good-tint); }
.tw-res-letter.no { border-color: var(--tw-bad); color: var(--tw-bad); background: var(--tw-bad-tint); }
.tw-res-pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; justify-self: start; white-space: nowrap; }
.tw-res-pill.ok { background: var(--tw-good-tint); color: var(--tw-good); }
.tw-res-pill.no { background: var(--tw-bad-tint); color: var(--tw-bad); }
.tw-res-pill.skip { background: #F3F4F7; color: var(--tw-ink-soft); }
.tw-res-review { justify-self: end; font-size: 14px; font-weight: 600; color: var(--tw-accent); text-decoration: none; }
.tw-res-review:hover { text-decoration: underline; }

.tw-res-detail {
    grid-column: 2 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: baseline;
    padding: 10px 12px;
    background: var(--tw-bad-tint);
    border-radius: 8px;
    font-size: 14px;
}
.tw-res-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tw-bad); }
.tw-res-phrase { font-weight: 600; color: var(--tw-ink); }
.tw-res-detail p { grid-column: 2; margin: 0; color: var(--tw-ink-soft); max-width: 70ch; }

.tw-res-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; background: var(--tw-accent-tint); border-radius: 14px; }
.tw-res-cta p { margin: 0; font-weight: 600; color: var(--tw-accent-dark); }
.tw-res-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tw-res-cta-actions form { margin: 0; }
.tw-res-cta-plain { background: var(--tw-surface); border: 1px solid var(--tw-line); }

@media (max-width: 920px) {
    .tw-res-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "score" "offer" "types"; }
    .tw-res-offer { max-width: 560px; }
}
@media (max-width: 720px) {
    .tw-res-title { font-size: 32px; }
    .tw-res-types { grid-template-columns: minmax(0, 1fr); }
    .tw-res-strip { grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)); gap: 4px; }
    .tw-res-qhead { display: none; }
    .tw-res-q {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        grid-template-areas: "num type review" "num ans ans";
        row-gap: 8px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .tw-res-q-num { grid-area: num; align-self: start; }
    .tw-res-q-type { grid-area: type; }
    .tw-res-review { grid-area: review; }
    .tw-res-q-ans { grid-area: ans; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
    .tw-res-q-label { display: inline; font-size: 12px; color: var(--tw-ink-faint); margin-right: 4px; }
    .tw-res-detail { grid-column: 2 / -1; grid-template-columns: minmax(0, 1fr); }
    .tw-res-detail p { grid-column: 1; }
}

/* ---------- Dashboard: free unit card ---------- */

.tw-fu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 24px;
    padding: 20px 24px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    margin-bottom: 24px;
}
.tw-fu-text { flex: 1 1 280px; display: grid; gap: 6px; min-width: 0; }
.tw-fu-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tw-accent); }
.tw-fu-score { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tw-fu-strip { display: flex; gap: 4px; max-width: 320px; }
.tw-fu-strip i { height: 8px; flex: 1; border-radius: 3px; background: var(--tw-line-soft); }
.tw-fu-strip i.ok { background: var(--tw-good); }
.tw-fu-strip i.no { background: var(--tw-bad); opacity: 0.85; }
.tw-fu-actions { display: flex; flex-wrap: wrap; gap: 10px; }


/* ============================================================
   Lesson content pages (pages with no question). Added 2026-10-12.
   The player puts .tw-content-page on <body> while one is on screen.
   Plain headings, paragraphs and lists from the admin editor are
   styled here; these classes are for the editor's code view:
     <p class="tw-eyebrow">          small blue label above the title
     <h1>                            the page title
     <h2>                            small grey section label
     <ol>                            numbered steps (any ordered list)
     <div class="tw-note">           secondary line inside a step
     <div class="tw-note tw-outcome"> a colour chip and what it means
     <span class="tw-hl tw-hl-green|tw-hl-red|tw-hl-yellow">
                                     a phrase as the player highlights it
     <div class="tw-key">            colour key: rows of tw-key-row, each a
                                     tw-key-sample and a tw-key-text with a
                                     tw-label tw-label-green|red|yellow
     <div class="tw-demo-choice">    sample answer choice (add tw-out for
                                     an eliminated one): tw-demo-letter +
                                     tw-demo-text
   ============================================================ */

body.tw-content-page .tw-timer { display: none; }

.tw-page-count {
    font-size: 13px;
    color: var(--tw-ink-faint);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.tw-content-page #courseContent {
    max-width: 784px;
    padding: 40px 48px 24px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: 0.1px;
    color: #2A2E38;
}

body.tw-content-page #courseContent p { margin: 0 0 18px; }
body.tw-content-page #courseContent p:last-child { margin-bottom: 0; }

body.tw-content-page #courseContent h1 {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tw-ink);
    margin: 0 0 16px;
}

body.tw-content-page #courseContent h2 {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tw-ink-soft);
    margin: 36px 0 12px;
}

body.tw-content-page #courseContent .tw-eyebrow {
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tw-accent);
    margin: 0 0 10px;
}

/* Numbered steps */
body.tw-content-page #courseContent ol {
    list-style: none;
    counter-reset: tw-step;
    margin: 28px 0 0;
    padding: 0;
    border-bottom: 1px solid var(--tw-line-soft);
}

body.tw-content-page #courseContent ol > li {
    counter-increment: tw-step;
    position: relative;
    padding: 22px 0 22px 56px;
    border-top: 1px solid var(--tw-line-soft);
    font-size: 18px;
    line-height: 1.55;
    color: var(--tw-ink);
}

body.tw-content-page #courseContent ol > li::before {
    content: counter(tw-step);
    position: absolute;
    left: 0;
    top: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tw-accent-tint);
    color: var(--tw-accent-dark);
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.tw-content-page #courseContent ul { margin: 0 0 18px; padding-left: 1.3em; }
body.tw-content-page #courseContent ul > li { margin-bottom: 6px; }

body.tw-content-page #courseContent .tw-note {
    margin-top: 8px;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--tw-ink-soft);
}

/* A colour and what it means, inside a step: <div class="tw-note tw-outcome"> */
body.tw-content-page #courseContent .tw-outcome {
    display: flex;
    align-items: baseline;
    gap: 14px;
}
body.tw-content-page #courseContent .tw-outcome .tw-hl {
    flex-shrink: 0;
    min-width: 58px;
    text-align: center;
}

/* A phrase shown the way the player highlights a clicked one */
.tw-hl {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--tw-ink);
    border-radius: 3px;
    padding: 1px 5px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.tw-hl-green { background: #E4F2DC; box-shadow: inset 0 -2px 0 #3f9415; }
.tw-hl-red { background: #FBE4E1; box-shadow: inset 0 -2px 0 #c0392b; }
.tw-hl-yellow { background: #F3F1CF; box-shadow: inset 0 -2px 0 #949415; }

/* Colour key */
body.tw-content-page #courseContent .tw-key {
    border: 1px solid var(--tw-line-soft);
    border-radius: 10px;
    margin: 28px 0;
}

body.tw-content-page #courseContent .tw-key-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 24px;
    padding: 16px 20px;
    border-top: 1px solid var(--tw-line-soft);
}
body.tw-content-page #courseContent .tw-key-row:first-child { border-top: 0; }

body.tw-content-page #courseContent .tw-key-sample { flex: 0 0 210px; }

body.tw-content-page #courseContent .tw-key-text {
    flex: 1 1 260px;
    min-width: 0;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--tw-ink-soft);
}

body.tw-content-page #courseContent .tw-label {
    display: block;
    margin-bottom: 4px;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.tw-label-green { color: var(--tw-good); }
.tw-label-red { color: var(--tw-bad); }
.tw-label-yellow { color: #66660F; }

/* Sample answer choices (look like the real ones, not clickable) */
body.tw-content-page #courseContent .tw-demo-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 8px;
    padding: 12px 16px 12px 14px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: var(--tw-surface);
    font-size: 15px;
    line-height: 1.55;
    color: var(--tw-ink);
}

body.tw-content-page #courseContent .tw-demo-choice::after {
    content: "";
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background-color: var(--tw-ink-faint);
    -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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 18px 18px 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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
}

body.tw-content-page #courseContent .tw-demo-letter {
    flex-shrink: 0;
    min-width: 18px;
    text-align: center;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-weight: 700;
    color: var(--tw-accent);
}

body.tw-content-page #courseContent .tw-demo-text { flex: 1; min-width: 0; }

body.tw-content-page #courseContent .tw-demo-choice.tw-out {
    background: #F3F4F7;
    border-color: var(--tw-line-soft);
    color: #878D99;
}
body.tw-content-page #courseContent .tw-demo-choice.tw-out .tw-demo-text {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
body.tw-content-page #courseContent .tw-demo-choice.tw-out .tw-demo-letter { color: #9AA0AC; }
body.tw-content-page #courseContent .tw-demo-choice.tw-out::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E");
}

@media (max-width: 760px) {
    body.tw-content-page #courseContent { padding: 24px 16px 16px; }
    body.tw-content-page #courseContent h1 { font-size: 24px; }
    body.tw-content-page #courseContent ol > li { padding-left: 48px; font-size: 17px; }
    body.tw-content-page #courseContent .tw-key-sample { flex-basis: 100%; }
}
