/* My classes (class.html), in the student app's exercise-book language (notebook.css, the
   dashboard's paper cards; UI batch SC, 2026-10-23): a ruled desk, paper sheets with a gold page
   showing behind them, folder tabs over each part, gold sticky labels and masking tape, a red
   margin with punched holes down the task and results paper, and stamped paper buttons (navy
   outline, a 3px navy slab, pressed flat on click; gold for the main action). A secondary action
   is the app's own text button instead (.cl-link: underlined in gold, with the arrow; P30). Every state is said in words (N9). The task view scales its text with --cl-text-scale. */

.cl-page {
    --cl-sheet: var(--gm-paper-fill);
    --cl-write: var(--gm-surface);
    --cl-ink: var(--gm-paper-ink);
    --cl-rule: rgba(19, 35, 63, 0.24);
    --cl-hair: var(--book-rule);
    --cl-gold: var(--gm-gold);
    --cl-secondary: #586274;
    --cl-wash: var(--gm-gold-soft);
    --cl-good: #256b45;
    --cl-bad: var(--gm-danger);
    /* The sheet's red margin and its punched holes (notebook.css .lc-control::before). */
    --cl-margin-w: 30px;
    --cl-holes: radial-gradient(circle at 12px 48px, var(--gm-bg) 0 4px, var(--gm-paper-ink) 4.5px 5.5px, transparent 6px) 0 0 / 30px 192px repeat-y;
    --cl-mini-sheet: 4px 4px 0 var(--gm-gold-soft), 4px 4px 0 1.5px var(--gm-paper-ink);
}

.cl-shell,
.cl-shell.is-collapsed { grid-template-columns: 1fr; }
.cl-display { min-width: 0; }
/* The desk is ruled paper, as behind the dashboard's cards. The page itself scrolls (one scrollbar, as on the
   dashboard): the display is no scroll box, so the rules simply move with the page and nothing repaints while
   scrolling (owner, 2026-10-23: an inner scroll box with a locally attached ruled background flickered). */
.cl-page .cl-shell { height: auto; }
.cl-page .cl-display {
    overflow: visible;
    background-color: var(--gm-bg);
    background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(19, 35, 63, 0.06) 31px 32px);
}
/* N8: the work uses the width of the screen, not a narrow column. */
.cl-display > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

[data-cl-view][hidden], .cl-gate[hidden], .cl-notice[hidden], .cl-banner[hidden], .cl-block[hidden],
.cl-empty[hidden], .cl-callout[hidden], .cl-palette[hidden], .cl-poll[hidden], .cl-session-state[hidden],
.cl-submitted[hidden], .cl-code-keep[hidden], .cl-small[hidden], .cl-instructions[hidden],
.cl-actions[hidden], .cl-submit[hidden], .cl-poll form[hidden], .cl-alert-line[hidden], .cl-lesson[hidden],
.cl-lesson-objective[hidden], .cl-lesson-topics[hidden], .cl-recovery[hidden], .cl-paused[hidden],
.cl-results-meta[hidden], .cl-questions[hidden], .cl-notes[hidden], .cl-lesson-row[hidden],
.cl-task-foot[hidden], .cl-ask-jump[hidden], .cl-task-state[hidden] { display: none; }

/* ---------- type ---------- */
.cl-head { margin-bottom: 22px; }
.cl-title {
    margin: 0 0 8px;
    font-family: var(--gm-display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--cl-ink);
    overflow-wrap: anywhere;
}
.cl-subtitle { margin: 18px 0 8px; font-family: var(--gm-display); font-size: 1.15rem; color: var(--cl-ink); }
/* A part of the page opens on a folder tab (the dashboard's section tabs): a gold-cream tab with a
   navy outline. Over a folder sheet it sits on the sheet's top edge (see .cl-folder below). */
.cl-section-title {
    position: relative; display: block; width: fit-content; max-width: 100%;
    margin: 48px 0 0; padding: 10px 22px 9px 18px;
    border: 1.5px solid var(--cl-ink); border-bottom: 0; border-radius: 14px 14px 0 0;
    background: var(--gm-gold-soft);
    font-family: var(--gm-display); font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 600; line-height: 1.3;
    letter-spacing: 0; text-transform: none; color: var(--cl-ink); overflow-wrap: anywhere;
}
/* A small kicker over a fact, as the dashboard's card labels (.gm-stat-label), in gold ink. */
.cl-spec-label {
    display: inline-block; margin: 0;
    font-family: var(--gm-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    line-height: 1.3; color: var(--gm-gold-ink);
}
.cl-lede { margin: 0 0 12px; max-width: 68ch; color: var(--cl-secondary); line-height: 1.55; }
.cl-small { margin: 8px 0 0; font-size: 0.9rem; color: var(--cl-secondary); }
/* Nothing here yet: a dashed space on the page (the dashboard's empty notes slot). */
.cl-empty {
    margin: 10px 0 0; padding: 14px 18px;
    border: 1.5px dashed #a9a08a; border-radius: 12px;
    color: var(--gm-ink-2); line-height: 1.5;
}
.cl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.cl-notice {
    margin: 0 8px 18px 0; padding: 14px 18px;
    border: 1.5px solid var(--cl-ink); border-radius: 12px; background: var(--cl-sheet); box-shadow: var(--cl-mini-sheet);
    font-weight: 600; color: var(--cl-ink);
}
.cl-notice--error { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border-color: var(--gm-danger); color: var(--gm-danger); }
.cl-notice--error p { margin: 0; flex: 1 1 220px; }
/* A note in the margin: gold-cream with a gold rule on its left (the timetable's Brain lines). */
.cl-banner, .cl-callout, .cl-consent-line, .cl-pack-partial, .cl-replaced-note, .cl-stuck-sent, .cl-ask-reply, .cl-recovery-text {
    border-left: 3px solid var(--cl-gold); border-radius: 0 10px 10px 0; background: var(--gm-gold-soft); color: var(--cl-ink);
}
.cl-banner { margin: 0 0 18px; padding: 12px 16px; font-weight: 600; }

/* A paper sheet on the desk with the next page showing behind it (notebook.css). */
.cl-sheet {
    position: relative;
    margin-right: 8px;
    padding: 28px clamp(18px, 3vw, 36px);
    background: var(--cl-sheet);
    border: 1.5px solid var(--cl-ink);
    border-radius: 12px;
    box-shadow: var(--book-sheet);
}
/* Masking tape holds the page that waits for the student: sign in, join, the waiting room. */
:is(.cl-gate, .cl-consent, .cl-lobby)::before {
    content: ""; position: absolute; top: -12px; left: calc(50% - 34px); width: 68px; height: 24px;
    background: var(--book-selected); border: 1px solid var(--cl-ink); transform: rotate(-4deg); pointer-events: none;
}
.cl-code-keep { margin: 0 0 12px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }

/* A folder: the part's sheet, with its title as the folder's tab on the top edge. The tab is
   lifted by its own height, so the room it leaves becomes the sheet's top margin. */
.cl-todo, .cl-class-section, .cl-block:has(> [data-cl-kept]), .cl-ask {
    --cl-fold-pad: clamp(18px, 3vw, 32px);
    position: relative;
    margin: 84px 8px 0 0; padding: 0 var(--cl-fold-pad) 24px;
    background: var(--cl-sheet);
    border: 1.5px solid var(--cl-ink); border-radius: 0 14px 14px 14px;
    box-shadow: var(--book-sheet);
}
:is(.cl-todo, .cl-class-section, .cl-block:has(> [data-cl-kept])) > .cl-section-title,
.cl-ask > #cl-ask-title {
    margin: -1.5px 0 -22px calc(-1 * var(--cl-fold-pad) - 1.5px);
    transform: translateY(calc(-100% + 1.5px));
    scroll-margin-top: 76px;   /* the tab is drawn above its box: keep it in view when focused */
}
/* A part that holds cards rather than one sheet: the tab stands on a rule that runs past it. */
.cl-block:has(> [data-cl-classes]) > .cl-section-title { margin-top: 64px; }
.cl-block:has(> [data-cl-classes]) > .cl-section-title::after {
    content: ""; position: absolute; left: -1.5px; bottom: -1.5px; height: 1.5px; width: calc(100% + 96px); max-width: calc(100vw - 48px);
    background: var(--cl-ink);
}

/* ---------- stamped paper buttons (the student app's .gm-ghost-button / .lc-primary) ---------- */
/* The main action is gold; a second action is paper; both keep the house arrow. */
.cl-page :is(.gm-run-button, .cl-text-button) {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; padding: 0 16px;
    border: 1.5px solid var(--cl-ink); border-radius: 10px;
    background: var(--book-selected); color: var(--cl-ink);
    font: inherit; font-family: var(--gm-display); font-size: 0.95rem; font-weight: 600; line-height: 1.25;
    text-align: center; text-decoration: none; white-space: normal;
    box-shadow: var(--book-tab); cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.cl-page :is(.gm-run-button.cl-run-quiet, .cl-text-button) { background: var(--cl-sheet); font-weight: 600; }
.cl-page :is(.gm-run-button, .cl-text-button):not(:disabled):not([aria-disabled="true"]):hover {
    transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--cl-ink); color: var(--cl-ink); background: #e6c36e;
}
.cl-page :is(.gm-run-button.cl-run-quiet, .cl-text-button):not(:disabled):not([aria-disabled="true"]):hover { background: var(--cl-write); }
.cl-page :is(.gm-run-button, .cl-text-button):not(:disabled):not([aria-disabled="true"]):active {
    transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--cl-ink);
}
.cl-page :is(.gm-run-button, .cl-text-button):is(:disabled, [aria-disabled="true"]) {
    background: #e8ddc6; color: #606574; border-color: #939185; box-shadow: none; cursor: not-allowed;
}
.cl-page :is(.gm-run-button, .cl-text-button):focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 4px; }
/* Leaving is never the loud choice: paper, with red ink when it means it. */
.cl-page .gm-run-button.cl-danger { background: var(--cl-sheet); color: var(--gm-danger); border-color: var(--gm-danger); box-shadow: 3px 3px 0 var(--gm-danger); }
.cl-page .gm-run-button.cl-danger:not(:disabled):hover { background: #f8e4df; color: var(--gm-danger); box-shadow: 4px 4px 0 var(--gm-danger); }
.cl-danger { color: var(--gm-danger); }
.cl-page .cl-leave { min-height: 40px; padding: 0 14px; font-size: 0.88rem; font-weight: 500; color: var(--cl-secondary); }
.cl-page .cl-leave:not(:disabled):hover { color: var(--gm-danger); }
/* Back: the top bar's Dashboard button, arrow first, with room before the title under it. */
.cl-page .cl-back { justify-self: start; min-height: 40px; padding: 0 14px; font-size: 0.9rem; margin-bottom: 20px; }
.cl-back::before { content: "\2190"; transition: transform 0.15s ease; }
.cl-back:hover::before { transform: translateX(-3px); }
/* P21/P30: a secondary action is the student app's own text button (guidemate.css .gm-run-button
   and .gm-page .gm-run-button): ink words, the gold pen-stroke underline and the house arrow, no
   box. The main action of a screen keeps the stamped paper button. */
.cl-page :is(.gm-run-button, .cl-text-button).cl-link {
    display: inline-block; min-height: 44px; padding: 10px 2px; line-height: 24px;
    border: 0; border-radius: 0; background: none; box-shadow: none;
    color: var(--cl-ink); font-weight: 600; text-align: left;
    text-decoration: underline; text-decoration-color: var(--gm-gold); text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.cl-page :is(.gm-run-button, .cl-text-button).cl-link:not(:disabled):not([aria-disabled="true"]):hover {
    transform: none; box-shadow: none; background: none; color: var(--gm-gold-ink);
}
.cl-page :is(.gm-run-button, .cl-text-button).cl-link:not(:disabled):not([aria-disabled="true"]):active { transform: none; box-shadow: none; }
.cl-page :is(.gm-run-button, .cl-text-button).cl-link:is(:disabled, [aria-disabled="true"]) { background: none; color: var(--cl-secondary); text-decoration-color: var(--cl-hair); }
/* The arrow stands beside the underlined words, not on the line (an inline block takes no underline). */
.cl-page .cl-link::after, .cl-page .cl-link.cl-back::before { display: inline-block; text-decoration: none; color: var(--gm-gold-ink); }
.cl-page .cl-link::after { margin-left: 8px; }
.cl-page .cl-link.cl-back::before { margin-right: 8px; }
.cl-title:focus { outline: none; }
.cl-title:focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 4px; }

/* ---------- home: title, join, to do now ---------- */
/* The page head ends on the dashboard's margin line: gold, with a faint rule above it. */
.cl-home-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 48px;
    margin-bottom: 0; padding-bottom: 26px; background: var(--gm-margin-rule);
}
.cl-home-intro { flex: 1 1 360px; min-width: 0; }
.cl-home-intro .cl-lede { margin-bottom: 0; }
.cl-join { display: grid; gap: 8px; flex: 0 1 auto; }
.cl-join-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.cl-field { font-weight: 600; font-size: 0.95rem; color: var(--cl-ink); }
/* A writing space: navy outline, cream surface, a gold line along its foot (notebook fields). */
.cl-input, .cl-code-input {
    min-height: 48px; padding: 8px 12px;
    border: 1.5px solid var(--cl-ink); border-radius: 8px;
    background: var(--cl-write); color: var(--cl-ink); font: inherit;
    box-shadow: inset 0 -3px 0 var(--gm-gold-soft);
}
.cl-input:focus-visible, .cl-code-input:focus-visible { outline: 2px solid var(--cl-gold); outline-offset: 2px; background: #fffdf8; }
.cl-input::placeholder { color: #687080; opacity: 1; }
.cl-code-input { width: min(100%, 13ch); font-family: var(--gm-display); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.cl-code-input::placeholder { font-size: 0.95rem; letter-spacing: 0.02em; text-transform: none; color: #687080; }
.cl-error { margin: 0; min-height: 1.2em; font-weight: 600; color: var(--gm-danger); }
.cl-error:empty { display: none; }

/* ---------- rows: work, classes ---------- */
.cl-rows { margin: 0; padding: 0; list-style: none; }
.cl-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 22px;
    padding: 14px 0;
}
.cl-row-main { flex: 1 1 260px; min-width: 0; }
.cl-row-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--gm-display); font-size: 1.05rem; font-weight: 600; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-row-meta { margin: 3px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.9rem; color: var(--cl-secondary); }
.cl-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.cl-row .gm-run-button { min-height: 44px; }
/* The class list on its way: a line of text and two quiet placeholder rows. */
.cl-row--loading { padding-bottom: 4px; }
.cl-skeleton { display: grid; gap: 8px; justify-content: stretch; }
.cl-skeleton span { display: block; height: 12px; border-radius: 4px; background: var(--gm-gold-soft); }
.cl-skeleton span:first-child { width: min(260px, 60%); height: 16px; }
.cl-skeleton span:last-child { width: min(180px, 40%); }

/* A work row (N8, N9): title and facts | the state in words | its actions. Rows sit on the
   sheet's ruled lines. */
.cl-work-list .cl-task-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 13rem 16rem;
    align-items: center; gap: 6px 28px; padding: 16px 0;
}
.cl-work-list .cl-task-row + .cl-task-row { border-top: 1px solid var(--cl-hair); }
/* One action, or two stacked at the right edge: the title keeps its width. */
.cl-work-list .cl-task-row .cl-row-actions { flex-direction: column; align-items: flex-end; gap: 10px; }
.cl-work-list .cl-task-row .cl-row-actions > * { min-width: 9.5rem; }
.cl-task-row--quiet .cl-row-title { color: var(--cl-secondary); }

/* The state, in words, with a mark of its kind (N9). */
.cl-state {
    margin: 0; display: inline-flex; align-items: baseline; gap: 8px;
    font-family: var(--gm-display); font-size: 0.92rem; font-weight: 600; line-height: 1.35; color: var(--cl-ink);
}
.cl-state::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; transform: translateY(-1px); }
.cl-state--todo { color: var(--gm-gold-ink); }
.cl-state--todo::before { background: var(--cl-gold); }
.cl-state--waiting::before { box-shadow: inset 0 0 0 2px var(--cl-ink); }
.cl-state--shared, .cl-state--done { color: var(--cl-good); }
.cl-state--shared::before, .cl-state--done::before { content: "\2713"; width: auto; height: auto; border-radius: 0; transform: none; font-weight: 700; }
.cl-state--quiet { color: var(--cl-secondary); font-weight: 500; }
.cl-state--quiet::before { width: 9px; height: 2px; border-radius: 0; background: var(--cl-secondary); transform: translateY(-4px); }
.cl-state--live { color: var(--cl-good); }
.cl-state--live::before { background: var(--gm-success); box-shadow: 0 0 0 3px rgba(47, 125, 82, 0.18); }

/* Tags on a row: the notebook's chips (navy outline, small square corners). */
.cl-chip {
    display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px;
    border: 1px solid var(--cl-ink); border-radius: 6px;
    font-family: var(--gm-display); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em; color: var(--cl-ink); background: var(--cl-write); white-space: nowrap;
}
.cl-chip--new, .cl-chip--todo { background: var(--book-selected); }
.cl-chip--practice { background: var(--gm-gold-soft); border-color: var(--gm-gold-ink); color: var(--gm-gold-ink); }
.cl-chip--late { border-color: var(--gm-danger); color: var(--gm-danger); background: var(--cl-write); }
.cl-chip--quiet { border-color: var(--cl-rule); color: var(--cl-secondary); background: transparent; }

/* Seals: the session's state in form (a dot) and word. */
.cl-chip--live, .cl-seal {
    display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px 0 7px;
    border: 1px solid var(--cl-ink); border-radius: 999px; background: var(--book-selected);
    font-family: var(--gm-display); font-size: 0.78rem; font-weight: 600; color: var(--cl-ink); white-space: nowrap;
}
.cl-chip--live::before, .cl-seal::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gm-success); box-shadow: 0 0 0 2px var(--cl-sheet); }
.cl-seal--paused { background: var(--cl-sheet); }
.cl-seal--paused::before { background: transparent; box-shadow: inset 0 0 0 2px var(--gm-gold-ink); }
.cl-seal--ended { background: var(--cl-sheet); color: var(--cl-secondary); border-color: var(--cl-secondary); }
.cl-seal--ended::before { background: var(--cl-secondary); }

/* The status line at the top of the live and task views. */
.cl-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 2px 0 6px; font-size: 0.85rem; font-weight: 500; color: var(--cl-secondary); font-variant-numeric: tabular-nums; }
.cl-status-line[hidden] { display: none; }
.cl-status-line .cl-seal { margin-right: 12px; }
.cl-status-part + .cl-status-part::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 10px 2px; border-radius: 50%; background: var(--gm-gold); vertical-align: middle; }

/* ---------- each class: a paper card on its navy slab (the dashboard's cards) ---------- */
/* Its label is a gold tab on the card's top edge (the Curiosity Center card); who and what on
   the left, its work on the right, on ruled lines. */
[data-cl-classes] { display: grid; gap: 44px; margin-top: 36px; padding: 0 10px 10px 0; }
.cl-class {
    position: relative;
    display: grid; grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr); gap: 4px 44px;
    padding: 34px clamp(18px, 2.6vw, 30px) 24px;
    background: var(--cl-sheet);
    border: 1.5px solid var(--cl-ink); border-radius: 16px;
    box-shadow: var(--gm-paper-slab);
}
.cl-class-head { display: grid; align-content: start; gap: 14px; padding: 0; }
.cl-class-head .cl-row-main { flex: none; }
.cl-class-tag {
    position: absolute; top: -16px; left: 24px; max-width: calc(100% - 48px);
    margin: 0; padding: 6px 14px;
    background: var(--book-selected); border: 1.5px solid var(--cl-ink); border-radius: 5px 5px 0 0;
    font-family: var(--gm-display); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; color: var(--cl-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-class-head .cl-row-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.cl-class-head .cl-row-meta { margin-top: 4px; }
.cl-class-actions { flex-direction: column; align-items: flex-start; gap: 12px; }
.cl-class-actions .gm-run-button, .cl-class-actions .cl-text-button { min-height: 40px; }
.cl-class-body { min-width: 0; }
.cl-class-work .cl-task-row:first-child { padding-top: 2px; }
.cl-class-none { margin: 0; }
.cl-class-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--cl-hair); }
.cl-class--archived { background: #f4ecd8; }
.cl-class--archived .cl-class-head .cl-row-title { color: var(--cl-secondary); }
.cl-class--live { box-shadow: 8px 8px 0 0 var(--gm-gold), 8px 8px 0 1.5px var(--cl-ink); }

/* ---------- consent ---------- */
.cl-consent { display: grid; gap: 6px; max-width: 760px; margin: 24px auto 0; }
.cl-keeps { margin: 0 0 6px; padding-left: 1.2em; display: grid; gap: 4px; color: var(--cl-ink); line-height: 1.5; }
.cl-consent-line { margin: 0 0 6px; padding: 10px 12px; line-height: 1.5; }
.cl-consent .cl-field { margin-top: 10px; }
.cl-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px 16px; margin-top: 12px; }
.cl-actions--start { justify-content: flex-start; }

/* ---------- lobby and live ---------- */
.cl-lobby { display: grid; justify-items: start; gap: 6px; max-width: 760px; margin: 24px auto 0; }
.cl-lobby .cl-title { margin-bottom: 2px; }
.cl-lobby-who { margin: 0; color: var(--cl-ink); line-height: 1.5; }
.cl-lobby-who strong { font-family: var(--gm-display); font-weight: 600; }
.cl-lobby .cl-text-button { margin-top: 8px; }
/* Waiting, drawn: a thin ink stroke travels along a gold rule (still under reduced motion). */
.cl-wait { position: relative; width: min(220px, 60%); height: 2px; margin: 14px 0 10px; overflow: hidden; background: #ddd2b9; }
.cl-wait span { position: absolute; inset: 0 auto 0 0; width: 34%; background: var(--cl-ink); animation: cl-wait 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
@keyframes cl-wait { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.cl-session-state { margin: 0; font-weight: 650; color: var(--gm-gold-ink); }
.cl-poll { margin: 8px 8px 22px 0; }
.cl-poll-prompt { margin-bottom: 10px; padding: 0; font-weight: 650; color: var(--cl-ink); }
.cl-choices { margin: 0 0 8px; padding: 0; border: 0; }

/* B12, N3: what today's lesson is about, as label-and-text rows (topics by name). */
.cl-lesson { display: grid; gap: 10px; margin: 14px 0 0; padding: 18px 0 0; border-top: 1px solid var(--cl-hair); }
.cl-lesson-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 4px 24px; align-items: baseline; margin: 0; }
.cl-lesson-row dd { margin: 0; min-width: 0; }
.cl-lesson-objective { max-width: 75ch; color: var(--cl-ink); line-height: 1.55; overflow-wrap: anywhere; }
.cl-lesson-topics { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; color: var(--cl-ink); }
.cl-lesson-topic { overflow-wrap: anywhere; }
.cl-lesson-topic + .cl-lesson-topic::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 12px 3px; border-radius: 50%; background: var(--gm-gold); vertical-align: middle; }

/* ---------- the focused task: a page of the exercise book ---------- */
.cl-task { --cl-text-scale: 1; }
.cl-task-head { display: grid; gap: 6px; margin-bottom: 20px; }
.cl-task-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--cl-secondary); }
/* The status line with the text size controls at its right end: small quiet keys (a hairline, no
   slab, P30), 44px targets. */
.cl-task-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; margin: 2px 0 2px; }
.cl-task-status .cl-status-line { margin: 0; }
.cl-text-size { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 0 4px 4px 0; }
.cl-size-button {
    min-width: 44px; min-height: 44px; padding: 0 6px;
    border: 1px solid var(--cl-rule); border-radius: 8px; background: transparent;
    font: inherit; font-family: var(--gm-display); font-size: 0.85rem; font-weight: 600; color: var(--cl-ink); cursor: pointer;
}
.cl-size-button--big { font-size: 1.05rem; }
.cl-size-button:hover { background: var(--cl-write); border-color: var(--cl-ink); }
.cl-size-button:active { background: var(--gm-gold-soft); }

/* N9: where the work stands, at the top, in words, on its own card (the dashboard's due card):
   label | the state and what happens next | a way to ask the teacher. */
.cl-task-state {
    display: grid; grid-template-columns: 8rem minmax(0, 1fr) auto; align-items: baseline; gap: 6px 24px;
    margin: 0 8px 26px 0; padding: 18px 22px;
    background: var(--cl-sheet); border: 1.5px solid var(--cl-ink); border-radius: 14px;
    box-shadow: 5px 5px 0 var(--gm-gold-soft), 5px 5px 0 1.5px var(--cl-ink);
}
.cl-task-state > .cl-spec-label, .cl-join > .cl-spec-label { justify-self: start; }
.cl-task-state-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.cl-task-state-word {
    margin: 0; display: inline-flex; align-items: baseline; gap: 10px;
    font-family: var(--gm-display); font-size: 1.25rem; font-weight: 700; line-height: 1.3; color: var(--cl-ink);
}
.cl-task-state-word::before { content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%; transform: translateY(-2px); }
.cl-task-state[data-tone="todo"] .cl-task-state-word { color: var(--gm-gold-ink); }
.cl-task-state[data-tone="todo"] .cl-task-state-word::before { background: var(--cl-gold); }
.cl-task-state[data-tone="waiting"] .cl-task-state-word::before { box-shadow: inset 0 0 0 2.5px var(--cl-ink); }
.cl-task-state:is([data-tone="shared"], [data-tone="done"]) .cl-task-state-word { color: var(--cl-good); }
.cl-task-state:is([data-tone="shared"], [data-tone="done"]) .cl-task-state-word::before { content: "\2713"; width: auto; height: auto; border-radius: 0; transform: none; }
.cl-task-state[data-tone="quiet"] .cl-task-state-word { color: var(--cl-secondary); }
.cl-task-state[data-tone="quiet"] .cl-task-state-word::before { width: 11px; height: 2px; border-radius: 0; background: var(--cl-secondary); transform: translateY(-6px); }
.cl-task-state-why { margin: 0; max-width: 70ch; color: var(--cl-secondary); line-height: 1.5; }
.cl-task-state-why:empty { display: none; }
/* A submitted task learns, while open, that the teacher shared its results. */
.cl-shared-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 6px 0 0; font-weight: 600; color: var(--cl-ink); }
.cl-shared-note[hidden] { display: none; }
.cl-ask-jump { justify-self: end; align-self: center; }

.cl-save { font-size: 0.9rem; color: var(--cl-secondary); }
.cl-callout { margin: 0 0 16px; padding: 12px 16px; font-weight: 600; }
.cl-callout p { margin: 0; }

.cl-task-body, .cl-palette, .cl-task-foot { font-size: calc(1rem * var(--cl-text-scale)); }
.cl-rich { line-height: 1.65; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-rich p { margin: 0 0 10px; }
.cl-rich ul, .cl-rich ol { margin: 0 0 10px; padding-left: 1.3em; }
.cl-rich code { font-size: 0.95em; padding: 0 4px; border-radius: 4px; background: var(--cl-wash); }
.cl-rich h1, .cl-rich h2, .cl-rich h3, .cl-rich h4, .cl-rich h5, .cl-rich h6 { margin: 12px 0 8px; font-size: 1.05em; line-height: 1.35; }
.cl-rich blockquote { margin: 0 0 10px; padding-left: 14px; border-left: 2px solid var(--gm-gold); color: var(--cl-secondary); }
.cl-rich pre { margin: 0 0 10px; padding: 10px 12px; overflow-x: auto; border-radius: 8px; background: var(--cl-wash); }
.cl-rich pre code { padding: 0; background: none; }
/* Tables and display maths scroll inside their own box, so a wide one never widens the page. */
.cl-rich .gm-table-wrap { max-width: 100%; margin: 0 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cl-rich .gm-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 0.94em; line-height: 1.45; }
.cl-rich .gm-table th, .cl-rich .gm-table td { padding: 6px 10px; border: 1px solid var(--cl-ink); text-align: left; vertical-align: top; overflow-wrap: normal; background: var(--cl-write); }
.cl-rich .gm-table thead th { background: var(--gm-gold-soft); font-weight: 650; }
.cl-rich .katex-display { max-width: 100%; margin: 0.6em 0; overflow-x: auto; overflow-y: hidden; padding-block: 4px; }
.cl-rich .katex, .cl-option-text .katex, .cl-poll-prompt .katex { overflow-wrap: normal; }
.cl-rich > :last-child { margin-bottom: 0; }
.cl-instructions { margin: 0; padding: 18px 0 4px; color: var(--cl-secondary); }
.cl-instructions > :last-child { margin-bottom: 0; }
/* The text students read first says so (batch 3, A11). */
.cl-instructions-label { margin: 0 0 8px; font-family: var(--gm-display); font-size: 0.8em; font-weight: 700; color: var(--cl-ink); }
/* T10: the teacher's resources for reference, under the text read first. */
.cl-resources { margin: 0; padding: 14px 0 4px; border-top: 1px solid var(--cl-rule); color: var(--cl-secondary); }
.cl-resources-title { margin: 0 0 4px; font-family: var(--gm-display); font-size: 0.8em; font-weight: 700; color: var(--cl-ink); }
.cl-resources-note { margin: 0 0 8px; font-size: 0.9em; }
.cl-resources-list { display: grid; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.cl-resource { overflow-wrap: anywhere; }
.cl-resource a { color: var(--cl-ink); font-weight: 600; text-underline-offset: 3px; }
.cl-resource summary { cursor: pointer; color: var(--cl-ink); font-weight: 600; }
.cl-resources-kind { font-size: 0.9em; }
.cl-resources-text { margin-top: 8px; max-width: 75ch; }
/* B24: line breaks the teacher typed (a pasted source's title, lines of data) stay. */
.cl-rich p, .cl-rich li { white-space: pre-line; }
/* J1: a text cited by line number, printed line by line with the numbers students count. */
.cl-lines { margin: 0 0 12px; max-width: 75ch; }
.cl-line { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); align-items: baseline; line-height: 1.6; }
.cl-line-n { padding-right: 0.8em; text-align: right; font-size: 0.78em; font-variant-numeric: tabular-nums; color: var(--cl-secondary); user-select: none; }
.cl-line-text { overflow-wrap: anywhere; }
.cl-lines-gap { height: 0.7em; }
/* B4: a long source or question is shown whole, in its own scrolling panel. */
.cl-rich--long {
    max-height: min(60vh, 640px); overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 16px; margin-bottom: 10px; border: 1px solid var(--cl-rule); border-radius: 8px; background: var(--cl-write);
}
.cl-rich--long:focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 2px; }

/* The paper: one exercise-book page with the next showing behind it, a red margin line and
   punched holes down its left edge; each question opens on a navy-ruled head. */
.cl-task-body, .cl-review {
    position: relative;
    margin-right: 8px;
    background: var(--cl-sheet);
    border: 1.5px solid var(--cl-ink); border-radius: 12px;
    box-shadow: var(--book-sheet);
}
:is(.cl-task-body, .cl-review)::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: var(--cl-margin-w);
    border-right: 1px solid var(--book-margin); background: var(--cl-holes); pointer-events: none;
}
.cl-task-body { padding: 6px clamp(18px, 3.2vw, 44px) 30px calc(var(--cl-margin-w) + clamp(16px, 2.6vw, 36px)); }
.cl-questions { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.cl-question-item { min-width: 0; }
.cl-question { margin: 0; padding: 30px 0 6px; min-width: 0; border: 0; }
.cl-q-legend {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; float: left; width: 100%;
    margin: 0 0 4px; padding: 0 0 12px; border-bottom: 1.5px solid var(--cl-ink); color: var(--cl-ink);
}
.cl-q-legend + * { clear: both; }
.cl-q-number { font-family: var(--gm-display); font-size: 1.2em; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.cl-q-of { font-weight: 500; color: var(--cl-secondary); font-size: 0.8em; }
/* Topic and command term: small gold chips (the notebook's tags). */
.cl-q-topic, .cl-q-command {
    display: inline-block; padding: 2px 8px; border: 1px solid var(--gm-gold-ink); border-radius: 6px; background: var(--gm-gold-soft);
    font-family: var(--gm-display); font-size: 0.68em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gm-gold-ink);
    overflow-wrap: anywhere;
}
.cl-q-marks { margin-left: auto; font-family: var(--gm-display); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--cl-ink); white-space: nowrap; }
/* Question on the left, answer space on the right; a part per row; stacked on a phone. */
.cl-qa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: start; padding: 22px 0; }
.cl-qa + .cl-qa { border-top: 1px solid var(--cl-hair); }
/* P21: a question with a picture gives the picture the card's full width; the answer goes under it.
   Its words keep a readable line length; only the picture spans the card. */
.cl-qa:has(> .cl-qa-q .cl-figure) { grid-template-columns: minmax(0, 1fr); }
.cl-qa:has(> .cl-qa-q .cl-figure) .cl-q-stem { max-width: 80ch; }
.cl-qa--stem { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; }
.cl-qa--stem .cl-qa-q > :not(.cl-figure) { max-width: 80ch; }
.cl-qa-q, .cl-qa-a { min-width: 0; }
.cl-q-stem, .cl-part-prompt { font-size: 1.02em; }
/* P21: a picture fills its column, in a frame of its own. Its limits come from its own width
   (class.js sizeFigure): never narrower than 560px or its own width, so a wide diagram's words
   stay readable; on a narrow screen the frame scrolls sideways instead (the page never does).
   Never stretched past twice its own width. The picture opens larger on a tap or a click. */
.cl-figure { margin: 10px 0 12px; min-width: 0; }
.cl-figure-frame { max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; border-radius: 6px; }
.cl-figure-frame:focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 3px; }
.cl-figure-frame img {
    display: block; box-sizing: border-box; width: 100%; height: auto;
    min-width: var(--cl-fig-min, 0px); max-width: var(--cl-fig-max, none);
    border: 1.5px solid var(--cl-ink); border-radius: 6px; background: #fff; cursor: zoom-in;
}
.cl-figure-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin-top: 2px; }
.cl-figure-scroll { font-size: 0.86em; color: var(--cl-secondary); }
.cl-figure-scroll::before { content: "\2194"; margin-right: 6px; color: var(--gm-gold-ink); }
.cl-figure-scroll[hidden] { display: none; }
.cl-figure-elsewhere { margin: 8px 0 12px; color: var(--cl-secondary); }
/* The larger view (R7.0 F): wide on a desktop, the picture filling it; on a phone at its own size, panned with a finger. */
.cl-dialog.cl-figure-view { width: min(96vw, 1200px); max-width: 96vw; max-height: 96dvh; padding: 0; }
.cl-figure-view-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--gm-line, #d9d3c3); }
.cl-figure-view-title { margin: 0; font-weight: 600; }
.cl-figure-view-body { max-height: calc(96dvh - 64px); overflow: auto; padding: 12px; }
.cl-figure-view-body img { display: block; width: 100%; max-width: none; height: auto; }
@media (max-width: 560px) { .cl-figure-view-body img { width: auto; min-width: 100%; } }
.cl-part-label { display: flex; align-items: baseline; gap: 12px; margin: 0 0 6px; font-family: var(--gm-display); color: var(--cl-ink); }
.cl-part-letter { font-weight: 700; }
.cl-part-marks { font-size: 0.88em; font-weight: 500; color: var(--cl-secondary); white-space: nowrap; }
.cl-answer, .cl-part { display: grid; gap: 8px; }
.cl-answer > *, .cl-part > * { min-width: 0; }
/* "YOUR ANSWER": a gold card kicker over the answer space. */
.cl-answer > .cl-field, .cl-numeric-row > .cl-field, .cl-answer-label {
    justify-self: start; margin: 0;
    font-family: var(--gm-display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gm-gold-ink);
}
.cl-answer-label { display: inline-block; margin-bottom: 8px; }
/* Ruled answer space: the rules are painted on the box and move with its text, so writing sits
   on the lines; it grows with the answer (two lines a mark to start, as on the paper). */
.cl-textarea {
    --cl-line: 1.8em;
    display: block; width: 100%; min-height: calc(var(--cl-rows, 4) * var(--cl-line) + 1px);
    field-sizing: content; resize: vertical;
    padding: 0 6px; border: 1.5px solid var(--cl-ink); border-radius: 8px;
    font-size: inherit; line-height: var(--cl-line); color: var(--cl-ink);
    background-color: var(--cl-write);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--cl-line) - 1px), var(--cl-rule) calc(var(--cl-line) - 1px), var(--cl-rule) var(--cl-line));
    background-attachment: local;
}
.cl-textarea:focus-visible { outline: 2px solid var(--cl-gold); outline-offset: 3px; }
/* Handed in: the answer as written, no empty lines below it. */
.cl-textarea:disabled { min-height: calc(var(--cl-line) + 1px); resize: none; opacity: 1; color: var(--cl-ink); -webkit-text-fill-color: var(--cl-ink); cursor: default; background-color: transparent; }
/* Choices: each a paper slot with a navy outline; the chosen one is highlighted gold (.lc-option). */
.cl-options { display: grid; gap: 8px; margin: 0 0 8px; }
/* A choice: its radio, then its text (polls); a task question's choice shows a lettered box instead. */
.cl-option {
    position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 9px 12px;
    border: 1.5px solid var(--cl-ink); border-radius: 8px; background: var(--cl-write); cursor: pointer;
}
.cl-option input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.cl-option:hover { background: var(--gm-gold-soft); }
.cl-option--key { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: baseline; }
.cl-option--key input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cl-option-key { width: 24px; height: 24px; display: grid; place-items: center; border: 1.5px solid var(--cl-ink); border-radius: 6px; background: var(--cl-sheet); font-family: var(--gm-display); font-size: 0.85em; font-weight: 600; line-height: 1; transform: translateY(5px); }
.cl-option--key:has(input:checked) .cl-option-key { background: var(--cl-ink); color: var(--cl-sheet); }
.cl-option:has(input:checked) { background: var(--book-selected); box-shadow: 2px 2px 0 var(--cl-ink); }
.cl-option-text { min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.cl-numeric-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.cl-numeric-row .cl-field { flex-basis: auto; margin-right: 100%; }
.cl-numeric { width: min(100%, 18ch); font-size: inherit; font-variant-numeric: tabular-nums; }
.cl-units { font-weight: 650; color: var(--cl-ink); }
.cl-input:disabled, .cl-option:has(input:disabled) { cursor: default; }
.cl-option:has(input:disabled):not(:has(input:checked)) { opacity: 0.7; }
.cl-stuck-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 4px 0 10px; clear: both; }
/* "I'm stuck" is a text link (.cl-link), a little smaller than the work. */
.cl-page .gm-run-button.cl-stuck { font-size: 0.9em; }
.cl-stuck-sent { flex: 1 1 240px; margin: 8px 0; padding: 8px 12px; font-size: 0.92em; font-weight: 600; line-height: 1.45; }
.cl-stuck-sent::before { content: "\2713"; margin-right: 8px; color: var(--gm-gold-ink); }
.cl-stuck-line .cl-text-button { min-height: 44px; }

/* Symbols tray: in the page flow at every width, straight under the focused answer; one row
   that scrolls sideways when it is too narrow. It never floats over content. */
.cl-palette {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
    margin: 8px 0 4px; padding: 6px 4px 8px 0; overflow-x: auto;
    border-top: 1px solid var(--cl-hair); border-bottom: 1px solid var(--cl-hair); background: transparent;
}
.cl-palette-label, .cl-symbol { flex: none; }
/* B7: in a subject that does not write with symbols, the tray is one small link until opened. */
.cl-palette.is-link { border: 0; padding: 0; margin: 6px 0 2px; }
.cl-palette-open {
    flex: none; padding: 4px 0; border: 0; border-bottom: 2px solid var(--gm-gold); background: none; cursor: pointer;
    font-family: var(--gm-display); font-size: 0.8em; font-weight: 600; color: var(--cl-ink);
}
.cl-palette-open::after { content: " \2192"; color: var(--gm-gold-ink); }
.cl-palette-label { margin-right: 6px; font-family: var(--gm-display); font-size: 0.7em; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gm-gold-ink); }
.cl-symbol {
    min-width: 40px; min-height: 40px; padding: 0 6px;
    border: 1.5px solid var(--cl-ink); border-radius: 8px; background: var(--cl-sheet); box-shadow: 2px 2px 0 var(--cl-ink);
    font: inherit; font-size: 1.05em; color: var(--cl-ink); cursor: pointer;
}
.cl-symbol:hover { background: var(--cl-write); }
.cl-symbol:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--cl-ink); }

/* The submit bar: progress and Submit stay in reach at the foot of the screen, on a strip of
   paper with the gold edge of the top bar. The page scrolls at every width, so the bar sticks to the screen. */
.cl-task-foot {
    position: sticky; bottom: 0; z-index: 6;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 22px;
    margin: 22px 8px 0 0; padding: 12px 16px 14px;
    border: 1.5px solid var(--cl-ink); border-radius: 12px 12px 0 0; background: var(--cl-sheet);
    box-shadow: 0 -4px 0 var(--gm-gold-soft);
}
.cl-task-foot .cl-save { margin-right: auto; font-size: 0.85rem; color: var(--cl-secondary); }
.cl-answered { margin: 0; font-family: var(--gm-display); font-size: 0.95rem; font-weight: 600; color: var(--cl-ink); font-variant-numeric: tabular-nums; }
.cl-submit { min-height: 48px; font-size: 1.1em; }
.cl-page .gm-run-button.cl-submit { min-height: 48px; padding: 0 22px; font-size: 1.05em; }

/* ---------- results: a marked page of the exercise book, never a box or dialog ---------- */
.cl-results-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--cl-secondary); font-size: 0.92rem; }
.cl-results-class { font-weight: 650; color: var(--cl-ink); }
.cl-review { padding: 8px clamp(18px, 3.4vw, 52px) 36px calc(var(--cl-margin-w) + clamp(16px, 3vw, 44px)); color: var(--cl-ink); }
.cl-review > .cl-empty, .cl-review > .cl-notice { margin: 20px 0; border: 0; padding: 0; box-shadow: none; background: none; }
/* A labelled row: a gold kicker on the left rail, content on the right. */
.cl-spec-row { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 10px 40px; align-items: start; padding: 26px 0; border-bottom: 1px solid var(--cl-hair); }
.cl-spec-row > .cl-spec-label { justify-self: start; }
.cl-spec-body { min-width: 0; }
/* SUX-r2#1: a wide table or equation scrolls inside its own box; no grid track grows to fit it. */
:is(.cl-rail-body, .cl-spec-body, .cl-notes-body, .cl-pack-topic, .cl-qa-q, .cl-qa-a, .cl-result-question, .cl-result-part) > * { min-width: 0; max-width: 100%; }
.cl-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; margin: 0; color: var(--cl-ink); }
.cl-score-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cl-score-value { font-family: var(--gm-display); font-size: 1.15rem; font-weight: 500; color: var(--cl-secondary); font-variant-numeric: tabular-nums; }
.cl-score-value strong { margin-right: 6px; font-size: clamp(2.8rem, 4.6vw, 4rem); font-weight: 700; line-height: 0.9; color: var(--cl-ink); }
/* The percentage is ringed like a mark in the margin. */
.cl-score-pct {
    display: inline-block; padding: 2px 14px; border: 1.5px solid var(--cl-ink); border-radius: 999px; background: var(--book-selected);
    font-family: var(--gm-display); font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; color: var(--cl-ink); font-variant-numeric: tabular-nums;
}
.cl-score-none { margin: 0; font-size: 1.05rem; line-height: 1.55; color: var(--cl-ink); }
.cl-teacher-note .cl-rich { font-size: 1.12rem; line-height: 1.6; max-width: 70ch; }
/* "What to work on next": what went well, then the numbered next steps, each under its own label
   (owner 2026-10-23). */
.cl-next-part + .cl-next-part { margin-top: 20px; }
.cl-next-kicker {
    margin: 0 0 8px; font-family: var(--gm-display); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--cl-ink);
}
.cl-next-part--well .cl-next-kicker { color: var(--cl-good); }
.cl-next-strengths { margin: 0; color: var(--cl-ink); line-height: 1.55; overflow-wrap: anywhere; max-width: 72ch; }
.cl-next-strengths::before { content: "\2713"; margin-right: 8px; color: var(--cl-good); font-weight: 700; }
.cl-next-items { margin: 0; padding: 0 0 0 1.4em; display: grid; gap: 14px; max-width: 72ch; }
.cl-next-item { padding-left: 4px; line-height: 1.5; }
.cl-next-item::marker { font-family: var(--gm-display); font-weight: 700; color: var(--gm-gold-ink); }
.cl-next-label { margin: 0; font-family: var(--gm-display); font-weight: 600; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-next-action { margin: 2px 0 0; color: var(--cl-ink); overflow-wrap: anywhere; }

/* Each question: a head (number, topic | marks) over a navy rule, then labelled rows. */
.cl-script { margin: 0; padding: 0; list-style: none; }
.cl-result-row { padding: 34px 0 4px; }
.cl-result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; padding-bottom: 12px; border-bottom: 1.5px solid var(--cl-ink); }
.cl-result-q { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; font-family: var(--gm-display); font-size: 1.2rem; font-weight: 700; color: var(--cl-ink); }
.cl-result-q .cl-q-topic { font-size: 0.62rem; }
.cl-result-mark { margin: 0; font-family: var(--gm-display); font-size: 1.6rem; font-weight: 600; color: var(--cl-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-result-mark-unit { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cl-secondary); }
.cl-result-mark--quiet { font-size: 1rem; font-weight: 500; color: var(--cl-secondary); }
.cl-result-main { min-width: 0; }
.cl-rail-row { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 8px 40px; align-items: start; padding: 20px 0; }
.cl-rail-row + .cl-rail-row, .cl-result-part + .cl-result-part, .cl-result-question + .cl-rail-row, .cl-result-part + .cl-rail-row { border-top: 1px solid var(--cl-hair); }
.cl-rail-label {
    justify-self: start; margin: 0;
    font-family: var(--gm-display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gm-gold-ink);
}
.cl-rail-body { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* A part keeps its own letter case: "Part (a)". */
.cl-result-part .cl-rail-label { text-transform: none; letter-spacing: 0.04em; font-size: 0.82rem; }
.cl-rail-body .cl-rich { max-width: 75ch; }
/* The rail already says "Your answer"; the inner label stays for screen readers only. */
.cl-result-question > .cl-rail-row :is(.cl-result-answer, .cl-result-model) > .cl-result-answer-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cl-result-answer { position: relative; }
.cl-result-answer-label { display: block; margin-bottom: 4px; font-family: var(--gm-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gm-gold-ink); }
.cl-result-answer-text { margin: 0; max-width: 75ch; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--cl-ink); font-size: 1.05rem; line-height: 1.7; }
.cl-result-answer-text--none { color: var(--cl-secondary); font-style: italic; }
.cl-result-feedback { min-width: 0; color: var(--cl-ink); }
.cl-result-model { padding: 12px 16px; border-left: 3px solid var(--cl-good); border-radius: 0 10px 10px 0; background: var(--cl-write); }
.cl-result-key { margin: 6px 0 0; font-weight: 600; color: var(--cl-good); }
/* B19: every choice of a returned multiple-choice question, the student's marked. */
.cl-result-options { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cl-result-option { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 7px 12px; border: 1px solid var(--cl-hair); border-radius: 8px; color: var(--cl-ink); }
.cl-result-option.is-chosen { background: var(--gm-gold-soft); border-color: var(--cl-ink); }
.cl-result-option.is-correct { box-shadow: inset 3px 0 0 var(--cl-good); }
.cl-result-option-mark { order: 2; font-family: var(--gm-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gm-gold-ink); }
.cl-result-option-mark--correct { color: var(--cl-good); }
/* B11/B17: several shared tries, each its own titled part of the page. */
.cl-attempt + .cl-attempt { margin-top: 30px; padding-top: 4px; background: var(--gm-margin-rule); background-position: top; background-size: 100% 7px; background-repeat: no-repeat; }
.cl-attempt-title { margin: 24px 0 4px; font-family: var(--gm-display); font-size: 1.3rem; color: var(--cl-ink); }

/* B26: a replaced question that stays on a handed-in copy. */
.cl-replaced-note { margin: 12px 0 10px; padding: 8px 12px; font-weight: 600; line-height: 1.45; }
.cl-replaced-reason { font-weight: 500; }

:is(.cl-size-button, .cl-symbol):focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 3px; }
.cl-option:has(input:focus-visible) { outline: 2px solid var(--cl-ink); outline-offset: 3px; }

/* ---------- short messages (replaces the shared toast on this page) ---------- */
.cl-display:focus { outline: none; }
/* Empty: kept in the page (a live region must exist before it speaks) but out of sight. */
.cl-status:not([data-open]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cl-status[data-open] {
    position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
    display: flex; align-items: center; gap: 0 16px;
    width: max-content; max-width: min(560px, calc(100% - 32px)); padding: 6px 8px 6px 18px;
    border: 1.5px solid var(--cl-ink); border-radius: 12px; background: var(--gm-ink); color: var(--gm-on-ink); box-shadow: 4px 4px 0 var(--gm-gold);
}
.cl-status[data-tone="error"] { background: var(--gm-danger); color: #fff; }
.cl-status-text { flex: 1 1 auto; min-width: 0; margin: 0; padding: 8px 0; font-size: 0.9rem; font-weight: 600; line-height: 1.4; }
.cl-page .cl-status .cl-text-button { min-height: 40px; color: var(--cl-ink); }
.cl-status-dismiss[hidden] { display: none; }
/* On a phone the message takes its own place at the top of the page instead of covering work. */
@media (max-width: 560px) {
    .cl-status[data-open] { position: static; transform: none; width: auto; max-width: none; margin: 0 6px 16px 0; flex-wrap: wrap; }
}

/* ---------- dialogs (confirmations only): the notebook's note modal ---------- */
.cl-dialog {
    position: fixed; inset: 0; margin: auto; height: fit-content;
    width: min(520px, calc(100% - 32px)); max-height: min(88vh, 760px);
    padding: 0; border: 1.5px solid var(--cl-ink); border-radius: 12px;
    background: var(--cl-sheet); color: var(--cl-ink); box-shadow: var(--book-sheet), 0 18px 44px rgba(13, 29, 54, 0.22);
}
.cl-dialog::backdrop { background: rgba(13, 29, 54, 0.45); }
.cl-dialog form { display: grid; gap: 10px; padding: 24px 26px 26px; }
.cl-dialog-title { margin: 0 0 4px; padding-bottom: 14px; font-family: var(--gm-display); font-size: 1.35rem; background: var(--gm-margin-rule); }
.cl-dialog-lede { margin: 0; color: var(--cl-secondary); line-height: 1.5; }

/* ---------- R5.0 bug fixes (P0) ---------- */
/* B9/B20: what reached the student while they were elsewhere: a gold slip each, with a way there. */
.cl-alerts { display: grid; gap: 12px; }
.cl-alerts:has(> :not([hidden])) { margin-bottom: 20px; }
.cl-alert-line {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 8px 0 0; padding: 10px 14px 12px;
    border: 1.5px solid var(--cl-ink); border-radius: 12px; background: var(--book-selected); box-shadow: var(--cl-mini-sheet);
    color: var(--cl-ink); font-weight: 600;
}
.cl-alert-line > span { flex: 1 1 220px; padding: 4px 0; overflow-wrap: anywhere; }
/* Its ways there are text links (.cl-link), as on the task page (P30). */

/* B1: answers kept aside, with a copy action. */
.cl-recovery {
    margin: 0 8px 18px 0; padding: 16px 20px; border: 1.5px solid var(--gm-danger); border-radius: 12px;
    background: var(--cl-sheet); color: var(--cl-ink); box-shadow: 4px 4px 0 var(--gm-gold-soft), 4px 4px 0 1.5px var(--gm-danger);
}
.cl-recovery-title { margin: 0 0 8px; font-family: var(--gm-display); font-size: 1.05rem; font-weight: 600; color: var(--gm-danger); }
.cl-recovery-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.cl-recovery-label { margin: 0; font-weight: 650; font-size: 0.92rem; }
.cl-recovery-text {
    margin: 2px 0 0; padding: 8px 12px;
    white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; max-height: 40vh; overflow-y: auto;
}

/* B5: the pause screen sits over the task; the work under it waits, untouched. */
.cl-task-body[data-paused] > :not(.cl-paused) { opacity: 0.35; filter: blur(1.5px); pointer-events: none; user-select: none; }
.cl-paused {
    position: sticky; top: 12px; z-index: 5; margin: 18px 0 14px; padding: 16px 18px;
    border: 1.5px solid var(--cl-ink); border-radius: 12px; background: var(--book-selected); box-shadow: var(--book-tab);
}
.cl-paused-title { margin: 0 0 4px; font-family: var(--gm-display); font-size: 1.15rem; font-weight: 600; color: var(--cl-ink); }
.cl-paused-text { margin: 0; color: var(--cl-ink); line-height: 1.5; }

/* ---------- R5.1 item 6: the class inbox ---------- */
.cl-bell[hidden], .cl-bell-count[hidden], .cl-inbox[hidden], [data-cl-inbox-alerts][hidden], [data-cl-inbox-alerts-state][hidden], [data-cl-inbox-more][hidden] { display: none; }
/* The same stamped paper button as its neighbours in the top bar. */
.cl-bell {
    position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border: 1.5px solid var(--gm-paper-ink); border-radius: 10px; background: var(--gm-paper-fill); box-shadow: 3px 3px 0 var(--gm-paper-ink);
    font: inherit; font-family: var(--gm-display); font-size: 0.85rem; font-weight: 600; color: var(--gm-paper-ink); cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cl-bell:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--gm-paper-ink); background: var(--gm-surface); }
.cl-bell:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--gm-paper-ink); }
.cl-bell svg { width: 18px; height: 18px; flex: none; }
.cl-bell:focus-visible { outline: 2px solid var(--gm-paper-ink); outline-offset: 3px; }
.cl-bell-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gm-danger); color: #fff;
    font-size: 0.75rem; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
/* The inbox is a page laid over the desk: paper, a page behind it, the margin line under its head. */
.cl-inbox {
    position: fixed; top: 76px; right: max(16px, calc((100vw - 1440px) / 2 + 16px)); z-index: 200;
    width: min(440px, calc(100vw - 32px)); max-height: min(72vh, 640px); overflow-y: auto; overscroll-behavior: contain;
    padding: 0 18px 16px; border: 1.5px solid var(--cl-ink); border-radius: 12px; background: var(--cl-sheet);
    box-shadow: var(--book-sheet), 0 18px 44px rgba(13, 29, 54, 0.18);
}
/* The heading and Close stay in view while the list scrolls (SUX-r1#3). */
.cl-inbox-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; background: var(--cl-sheet); }
.cl-inbox-title { margin: 0; font-family: var(--gm-display); font-size: 1.25rem; color: var(--cl-ink); }
.cl-inbox-title:focus { outline: none; }
.cl-inbox-head .gm-run-button, .cl-inbox-tools .gm-run-button { min-height: 40px; padding: 0 12px; font-size: 0.86rem; }
.cl-inbox-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 4px 4px 18px 0; background: var(--gm-margin-rule); }
.cl-inbox-tools .cl-small { margin: 0; flex-basis: 100%; }
.cl-inbox-list { margin: 6px 0 0; padding: 0; list-style: none; }
.cl-inbox-item + .cl-inbox-item { border-top: 1px solid var(--cl-hair); }
.cl-inbox-open {
    display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 10px 6px 10px 20px; position: relative;
    border: 0; border-radius: 8px; background: transparent; text-align: left; font: inherit; color: var(--cl-ink); cursor: pointer;
}
.cl-inbox-open:hover { background: var(--gm-gold-soft); }
.cl-inbox-open:focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 2px; }
.cl-inbox-item.is-unread .cl-inbox-open::before { content: ""; position: absolute; left: 6px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--gm-danger); }
.cl-inbox-text { font-family: var(--gm-display); font-weight: 600; overflow-wrap: anywhere; }
.cl-inbox-item:not(.is-unread) .cl-inbox-text { font-weight: 500; color: var(--cl-secondary); }
.cl-inbox-body { font-size: 0.9rem; color: var(--cl-secondary); overflow-wrap: anywhere; }
.cl-inbox-task { font-size: 0.92rem; font-weight: 600; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-inbox-when { font-size: 0.8rem; color: var(--cl-secondary); font-variant-numeric: tabular-nums; }
.cl-inbox-arrow { color: var(--gm-gold-ink); }
.cl-inbox > .gm-run-button { margin-top: 10px; }
@media (max-width: 560px) {
    .cl-bell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .cl-bell { min-width: 44px; min-height: 44px; padding: 0 10px; justify-content: center; }
    .cl-bell-count { position: absolute; top: -6px; right: -6px; }
    .cl-inbox { top: 8px; left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 16px); }
}

/* ---------- R5.3 and R6.0 C: revision notes, reading tasks, revision packs, flashcards ---------- */
.cl-notes { margin: 0; }
/* Notes to read come first, in a reading measure on the same page. */
.cl-notes--first { padding: 26px 0 8px; }
.cl-notes-kicker { display: inline-block; margin: 0; font-family: var(--gm-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gm-gold-ink); }
.cl-notes .cl-subtitle { margin: 10px 0 6px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.cl-notes-lede { margin: 0 0 22px; max-width: 70ch; color: var(--cl-secondary); line-height: 1.55; }
.cl-notes-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 72ch; }
.cl-note-section { min-width: 0; }
/* Full chapter notes (correction 9): a section's kind, and a self-check's answer folded until asked for. */
.cl-note-type { margin: 0 0 6px; font-family: var(--gm-display); font-size: 0.8em; font-weight: 700; color: var(--cl-secondary); }
.cl-note-answer { margin-top: 10px; }
.cl-note-answer > summary { cursor: pointer; font-family: var(--gm-display); font-weight: 700; color: var(--cl-ink); }
.cl-note-answer-body { margin-top: 8px; }
.cl-note-heading { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1.5px solid var(--cl-ink); font-family: var(--gm-display); font-size: 1.15em; font-weight: 700; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-note-body { font-size: 1.04em; line-height: 1.75; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-note-body > :first-child { margin-top: 0; }
.cl-note-body > :last-child { margin-bottom: 0; }
.cl-note-source { margin: 10px 0 0; font-size: 0.85em; color: var(--cl-secondary); overflow-wrap: anywhere; }
.cl-note-source--teacher { color: var(--gm-gold-ink); font-weight: 600; }
.cl-notes-actions { margin-top: 28px; padding-top: 18px; background: var(--gm-margin-rule); background-position: top; background-size: 100% 7px; background-repeat: no-repeat; }
.cl-page .gm-run-button.cl-notes-done { font-size: 1.05em; min-height: 48px; padding: 0 20px; }
.cl-notes-fold { padding: 14px 0 4px; border-bottom: 1px solid var(--cl-hair); }
.cl-notes-fold--results { margin-top: 10px; border-bottom: 0; }
.cl-notes-fold--reading { border-bottom: 0; }
.cl-notes-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 44px; cursor: pointer; font-family: var(--gm-display); font-weight: 600; color: var(--cl-ink); }
.cl-notes-fold[open] > .cl-notes-summary { margin-bottom: 14px; }
.cl-notes-read { font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--cl-good); }
.cl-notes-read::before { content: "\2713"; margin-right: 6px; }

.cl-pack-name { margin: 6px 0 8px; font-family: var(--gm-display); font-size: 1.15rem; font-weight: 600; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-pack-partial { margin: 0 0 14px; padding: 10px 14px; line-height: 1.5; max-width: 68ch; }
.cl-pack-topic { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0 0 20px; max-width: 72ch; }
.cl-pack-topic-title { margin: 10px 0 0; font-family: var(--gm-display); font-size: 1.1rem; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-pack-hint { margin: 4px 0 12px; font-size: 0.9rem; color: var(--cl-secondary); }
/* Flashcards are index cards (owner 2026-10-23: one size, proper rows and columns, clear labels):
   every card in the grid is as tall as the tallest, and each card is laid out the same way: "Card 1
   of 8" with its side (Question or Answer) over a red rule, the text, then "Tap to flip". Both sides
   share one place, the hidden one invisible, so turning a card never changes its size. The answer
   side is gold-cream. */
.cl-cards {
    list-style: none; margin: 0; padding: 0 6px 6px 0; display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); grid-auto-rows: 1fr;
}
.cl-card-item { min-width: 0; display: grid; }
.cl-card {
    display: grid; grid-template-rows: auto 1fr auto; gap: 14px; width: 100%; height: 100%; min-height: 168px; padding: 0 18px 14px;
    border: 1.5px solid var(--cl-ink); border-radius: 8px;
    background-color: var(--cl-write);
    box-shadow: 3px 3px 0 var(--cl-ink);
    color: var(--cl-ink); font: inherit; text-align: left; cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cl-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--cl-ink); }
.cl-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--cl-ink); }
.cl-card:focus-visible { outline: 3px solid var(--gm-gold); outline-offset: 3px; }
.cl-card.is-back { background-color: var(--gm-gold-soft); }
.cl-card-top {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -18px; padding: 12px 18px 10px;
    border-bottom: 1px solid var(--book-margin);
}
.cl-card-count { font-family: var(--gm-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gm-gold-ink); }
.cl-card-side {
    padding: 1px 8px; border: 1px solid var(--cl-ink); border-radius: 6px; background: var(--cl-sheet);
    font-family: var(--gm-display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--cl-ink);
}
.cl-card.is-back .cl-card-side { background: var(--book-selected); }
.cl-card-faces { display: grid; align-items: start; min-width: 0; }
.cl-card-face { grid-area: 1 / 1; min-width: 0; }
.cl-card-face[hidden] { display: block; visibility: hidden; }
.cl-card-text { line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }   /* a card's own line breaks stay */
.cl-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.cl-card-hint { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--cl-secondary); }
.cl-card-hint::after { content: " \21BB"; }
.cl-card-credit { font-size: 0.8rem; font-weight: 600; color: var(--gm-gold-ink); }
@media (max-width: 560px) {
    .cl-cards { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .cl-card { min-height: 0; }
}
/* "Created with GuideMate Brain", said once at the end of the report (owner 2026-10-23). */
.cl-report-credit { margin: 24px 0 0; }
/* P7 (owner, 2026-10-25): the GuideMate Brain line icon from the dashboard, at text size, then quiet text.
   No banner, fill or tile. */
.cl-brain-credit { display: flex; align-items: center; gap: 7px; }
span.cl-brain-credit { display: inline-flex; }
.cl-brain-credit .cl-brain-ic { width: 1.25em; height: 1.25em; color: var(--gm-gold-ink); stroke: currentColor; }

/* ---------- "In this report" (owner 2026-10-23): the report's index at the top right ---------- */
/* A stamped paper tab that stays in reach while the page scrolls; it opens an index card listing the
   parts of this report, each one press away. */
.cl-report-nav[hidden], .cl-report-index[hidden] { display: none; }
.cl-report-nav {
    position: sticky; top: 14px; z-index: 40; height: 0; display: flex; justify-content: flex-end;
    padding-right: clamp(0px, 1vw, 12px);
}
.cl-report-nav > * { pointer-events: auto; }
.cl-page .cl-report-toggle {
    position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
    border: 1.5px solid var(--cl-ink); border-radius: 10px; background: var(--cl-sheet); color: var(--cl-ink);
    font: inherit; font-family: var(--gm-display); font-size: 0.9rem; font-weight: 600; cursor: pointer;
    box-shadow: var(--book-tab); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cl-report-toggle::before {
    content: ""; width: 14px; height: 12px; flex: none;
    background: linear-gradient(var(--cl-ink), var(--cl-ink)) 0 0 / 100% 2px no-repeat, linear-gradient(var(--cl-ink), var(--cl-ink)) 0 5px / 100% 2px no-repeat, linear-gradient(var(--cl-ink), var(--cl-ink)) 0 10px / 70% 2px no-repeat;
}
.cl-page .cl-report-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--cl-ink); background: var(--cl-write); }
.cl-page .cl-report-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--cl-ink); }
.cl-page .cl-report-toggle[aria-expanded="true"] { background: var(--book-selected); }
.cl-report-toggle:focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 4px; }
.cl-report-index {
    position: absolute; top: 50px; right: clamp(0px, 1vw, 12px); width: min(300px, calc(100vw - 32px));
    margin: 0; padding: 8px 8px 10px; list-style: none;
    border: 1.5px solid var(--cl-ink); border-radius: 12px; background: var(--cl-sheet);
    box-shadow: var(--book-sheet), 0 18px 44px rgba(13, 29, 54, 0.16);
}
.cl-report-group {
    margin: 8px 8px 2px; font-family: var(--gm-display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--gm-gold-ink);
}
.cl-report-item + .cl-report-item { border-top: 1px solid var(--cl-hair); }
.cl-report-go {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent; color: var(--cl-ink); cursor: pointer;
    font: inherit; font-family: var(--gm-display); font-size: 0.98rem; font-weight: 600; text-align: left;
}
.cl-report-go:hover { background: var(--gm-gold-soft); }
.cl-report-go:focus-visible { outline: 2px solid var(--cl-ink); outline-offset: 1px; }
.cl-report-arrow { color: var(--gm-gold-ink); }
/* The head keeps room for the tab beside Back. */
[data-cl-view="results"] .cl-head { padding-right: 190px; }
[data-cl-view="results"] .cl-report-nav[hidden] + .cl-head { padding-right: 0; }
/* A part reached from the index lands below the page's top edge, and says where focus went. */
[data-report-part] { scroll-margin-top: 72px; }
[data-report-part]:focus { outline: none; }
[data-report-part]:focus-visible { outline: 2px solid var(--gm-gold); outline-offset: 6px; border-radius: 4px; }
@media (max-width: 560px) {
    .cl-report-nav { top: 8px; padding-right: 0; }
    /* Compact on a phone: the list icon alone (its name stays for screen readers), a 44px target. */
    .cl-page .cl-report-toggle { width: 44px; height: 44px; padding: 0; justify-content: center; }
    .cl-report-toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .cl-report-index { top: 48px; right: 0; }
    [data-cl-view="results"] .cl-head { padding-right: 0; }
}

/* ---------- R5.4: a class's own page (folders), "Ask your teacher" ---------- */
.cl-ask[hidden], .cl-ask-list[hidden], .cl-feed[hidden] { display: none; }
.cl-classpage .cl-head { padding-bottom: 22px; background: var(--gm-margin-rule); }
/* Each part of the class page is its own folder: its tab, then its content on the sheet. */
.cl-class-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
.cl-class-section > .cl-section-title { justify-self: start; }
.cl-class-section > :not(.cl-section-title) { min-width: 0; }
.cl-class-section .cl-section-title:focus { outline: none; }
.cl-class-section > .cl-small:first-of-type { margin-top: 0; }
/* Rows inside the class page are plain blocks, each opening on its gold kicker. */
.cl-class-section .cl-spec-row { display: block; padding: 18px 0 0; border-bottom: 0; }
.cl-class-section .cl-spec-row > .cl-spec-label { margin-bottom: 12px; }
.cl-class-section .cl-subtitle { margin: 22px 0 4px; font-size: 1.05rem; }
.cl-class-section > .gm-run-button { justify-self: start; margin-top: 8px; }
/* What the teacher wrote: a note in the margin (gold-cream, gold rule). */
.cl-feed { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 14px; }
.cl-feed-item { padding: 14px 18px; border-left: 3px solid var(--gm-gold); border-radius: 0 12px 12px 0; background: var(--gm-gold-soft); max-width: 80ch; }
.cl-feed-when { margin: 0 0 6px; font-size: 0.85rem; color: var(--cl-secondary); }
.cl-feed-body { margin: 0; white-space: pre-wrap; line-height: 1.65; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-progress-refs { list-style: none; margin: 10px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 4px 32px; }
.cl-progress-ref { padding: 12px 0; min-width: 0; border-bottom: 1px solid var(--cl-hair); }
.cl-progress-label { margin: 0; font-family: var(--gm-display); font-weight: 600; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-progress-band { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.cl-progress-why { margin: 4px 0 0; font-size: 0.88rem; color: var(--cl-secondary); overflow-wrap: anywhere; }
.cl-band { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--cl-secondary); font-size: 0.85rem; font-weight: 600; color: var(--cl-ink); background: var(--cl-write); margin-right: 6px; }
.cl-band--secure { border-color: var(--cl-ink); background: var(--book-selected); }
.cl-band--developing { border-color: var(--cl-ink); background: var(--gm-gold-soft); }
.cl-band--weak { border-color: var(--gm-danger); color: var(--gm-danger); }
.cl-band--not_enough { border-style: dashed; color: var(--cl-secondary); }
.cl-trend { font-size: 0.88rem; color: var(--cl-secondary); }
.cl-trend--up::before { content: "\2191"; margin-right: 4px; }
.cl-trend--down::before { content: "\2193"; margin-right: 4px; }
.cl-catchup { padding: 4px 0 14px; margin-bottom: 12px; max-width: 80ch; }
.cl-catchup + .cl-catchup { border-top: 1px solid var(--cl-hair); }
.cl-catchup-title { margin: 10px 0 6px; font-family: var(--gm-display); font-size: 1.1rem; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-catchup-line { margin: 0 0 6px; line-height: 1.5; color: var(--cl-ink); overflow-wrap: anywhere; white-space: pre-line; }
/* Ask your teacher: its own folder below the paper, reachable from the task's status card (N9). */
.cl-ask { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 90px; scroll-margin-top: 72px; }
.cl-ask > :not(#cl-ask-title) { min-width: 0; max-width: 76ch; }
.cl-ask > #cl-ask-title {
    position: relative; display: block; width: fit-content; max-width: 100%; padding: 10px 22px 9px 18px;
    border: 1.5px solid var(--cl-ink); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--gm-gold-soft);
    font-family: var(--gm-display); font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--cl-ink);
}
.cl-ask > .cl-small { margin-top: 0; }
.cl-ask-list { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 12px; }
.cl-ask-item { padding: 12px 16px; border: 1px solid var(--cl-hair); border-radius: 10px; background: var(--cl-write); min-width: 0; }
.cl-ask-meta { margin: 0 0 4px; font-size: 0.85rem; color: var(--cl-secondary); }
.cl-ask-text { margin: 0; white-space: pre-wrap; line-height: 1.55; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-ask-reply { margin-top: 10px; padding: 8px 12px; }
.cl-ask-state { margin: 6px 0 0; font-size: 0.85rem; color: var(--cl-secondary); }
.cl-ask-form { display: grid; gap: 8px; }
.cl-ask-form .gm-run-button { justify-self: start; }
.cl-ask-about { width: min(100%, 22rem); }
.cl-ask-input { width: 100%; min-height: 84px; resize: vertical; font: inherit; line-height: 1.5; }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
    .cl-work-list .cl-task-row { grid-template-columns: minmax(0, 1fr) minmax(9rem, 13rem); }
    .cl-work-list .cl-task-row .cl-row-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 10px 12px; }
}
@media (max-width: 900px) {
    /* The page itself scrolls here: the display is no scroll box, so the submit bar sticks to the screen. */
    .cl-page .cl-display { overflow: visible; }
    .cl-task-foot { bottom: 0; }
    .cl-qa { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .cl-class { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .cl-class-actions { flex-direction: row; flex-wrap: wrap; gap: 10px 12px; }
    .cl-spec-row, .cl-rail-row, .cl-class-section, .cl-ask { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .cl-task-state { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .cl-ask-jump { justify-self: start; }
}
@media (max-width: 560px) {
    .cl-page { --cl-margin-w: 20px; --cl-holes: radial-gradient(circle at 9px 48px, var(--gm-bg) 0 3.5px, var(--gm-paper-ink) 4px 5px, transparent 5.5px) 0 0 / 20px 192px repeat-y; }
    .cl-sheet { padding: 24px 16px; }
    .cl-task-body { padding: 0 14px 18px calc(var(--cl-margin-w) + 14px); }
    .cl-review { padding: 0 14px 24px calc(var(--cl-margin-w) + 14px); }
    .cl-todo, .cl-class-section, .cl-block:has(> [data-cl-kept]), .cl-ask { --cl-fold-pad: 16px; margin-top: 76px; }
    [data-cl-classes] { gap: 40px; }
    .cl-class { padding: 30px 16px 18px; }
    .cl-class-tag { left: 14px; max-width: calc(100% - 28px); }
    .cl-dialog { max-height: calc(100dvh - 24px); overflow: auto; }
    .cl-dialog form { padding: 22px 18px; }
    .cl-home-head { padding-bottom: 22px; }
    .cl-join { width: 100%; }
    .cl-task-state { padding: 16px; }
    /* A work row stacks: title and facts, the state, then the actions. */
    .cl-work-list .cl-task-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 0; }
    .cl-work-list .cl-task-row .cl-row-actions > * { min-width: 0; }
    .cl-lesson-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .cl-question { padding-top: 24px; }
    .cl-qa { padding: 16px 0; }
    .cl-result-row { padding-top: 26px; }
    .cl-result-mark { font-size: 1.3rem; }
    .cl-score-value strong { font-size: 2.6rem; }
    .cl-task-foot { gap: 6px 16px; padding: 10px 12px 12px; }
    .cl-task-foot .cl-save { flex-basis: 100%; margin-right: 0; }
}
/* In a live class, and on a task or results screen (data-cl-focus), a phone shows the work near
   the top: the shared header becomes one short row that scrolls away (icons keep their accessible
   names) and the workspace tabs fold away until the student is back on the lists. Other pages are
   untouched (scoped to .cl-page). */
@media (max-width: 560px) {
    .cl-page:is([data-cl-live], [data-cl-focus]) .book-index { display: none; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-topbar { position: static; flex-wrap: nowrap; height: auto; min-height: 0; padding-block: 6px; gap: 6px; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-brand-lockup { display: none; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-brand-mark { width: 32px; height: 32px; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-topbar-right { flex-wrap: nowrap; gap: 6px; margin-left: auto; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .ibn-trigger > span:not(.ibn-badge),
    .cl-page:is([data-cl-live], [data-cl-focus]) .sr-trigger-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .cl-bell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .cl-page:is([data-cl-live], [data-cl-focus]) :is(.ibn-trigger, .sr-trigger, .lc-back, .cl-bell) { min-width: 44px; min-height: 44px; padding: 0 10px; justify-content: center; }
    .cl-page:is([data-cl-live], [data-cl-focus]) :is(.lc-topbar-right > *, .sr-control, .sr-trigger, .cl-bell) { flex: none; width: auto; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-back { font-size: 0; gap: 0; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-back .gm-ic { width: 18px; height: 18px; }
    .cl-page:is([data-cl-live], [data-cl-focus]) .lc-display { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .cl-page .gm-run-button::after, .cl-back::before { transition: none; }
    .cl-page :is(.gm-run-button, .cl-text-button, .cl-card, .cl-bell, .cl-size-button, .cl-symbol) { transition: none; }
    .cl-page :is(.gm-run-button, .cl-text-button, .cl-card, .cl-bell):not(:disabled):hover { transform: none; }
    .cl-wait span { animation: none; transform: translateX(100%); }
}

/* Scheduled classes (plan scheduled-class section 8): the in-app notice under a class and at the
   top of its page, and the class's own page before it opens. */
.cl-upcoming { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.cl-upcoming-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.cl-upcoming-row .cl-row-meta { margin: 0; }
.cl-upcoming-line strong { font-family: var(--gm-display); font-weight: 600; color: var(--cl-ink); }
.cl-sched .cl-text-button { margin-top: 6px; }
.cl-upcoming[hidden], .cl-wait[hidden], .cl-sched [hidden] { display: none; }
