/* backend\public\static\public\css\quiz.css
   The quiz pages follow the deck pages (My decks is the benchmark): same
   serif font, black text, 640px centred column, 60px below the header,
   22px titles, compact dark button, deck-style rows. Accents: muted
   #6b7280 / #94a3b8, border #e5e7eb, dark button #111827, blue #185fa5. */

/* ---------------------------------------------------------------------
   Font and page frame, matching the deck pages. Those don't load site.css,
   so they render in the browser's default serif with its default 8px body
   margin; quiz pages do load site.css (header, breadcrumbs...), so the
   same look is set explicitly here, on body.quiz-section (every quiz
   template's <body>). "Times New Roman", Times is what that default is on
   desktop; generic serif covers the rest, as it does on the deck pages.
   --------------------------------------------------------------------- */
body.quiz-section {
    font-family: "Times New Roman", Times, serif;
    color: #000000;
    background: #ffffff;
    margin: 8px;
}

/* 640px of content, like .deck-page (max-width 640 + 24px padding each
   side, content-box) -- here the box is border-box, so 640 + 48. */
.page {
    max-width: 688px;
    margin: 60px auto 0;
    padding: 0 24px 64px;
    box-sizing: border-box;
}

.page h1 {
    font-size: 22px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 4px;
}

@media (max-width: 640px) {
    .page {
        margin-top: 32px;
        padding: 0 12px 48px;
    }
}

.btn-primary {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #1f2937;
    text-decoration: none;
}

/* =========================================================
   MY QUIZZES — page head, type tabs, list rows (the deck list's layout;
   its stat cells, HSK pills and share rows reuse deck.css's classes)
   ========================================================= */

.quiz-page-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.quiz-page-head h1 {
    margin: 0;
}

.type-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 4px;
}

.type-tab {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    padding: 10px 2px;
    cursor: pointer;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.type-tab.is-active {
    color: #111827;
    border-bottom-color: #111827;
}

.type-tab:disabled {
    cursor: default;
}

.type-tab-count {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 1px 7px;
}

.type-tab-soon {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

.quiz-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* My Quizzes rows: the deck list's row -- gutter | name | numbers | actions on one
   grid line (fixed number and action widths, so the header labels line up with
   every row's numbers), then the skill pills and the share rows. The whole row is
   one grid, so the phone layout can put the actions under the pills. */
.quiz-list-header-row,
.quiz-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 236px 180px;
    grid-template-areas: "gutter name stats actions";
    align-items: center;
    column-gap: 14px;
    padding: 10px 8px;
    text-align: left;
}

.quiz-list-header-row {
    font-size: 12px;
    color: #94a3b8;
}

.quiz-list-header-row[hidden] {
    display: none;
}

.quiz-list-header-row .deck-stat {
    display: block;
    text-align: right;
    white-space: nowrap;
}

.quiz-row {
    grid-template-areas:
        "gutter name  stats actions"
        ".      pills pills pills"
        ".      share share share"
        ".      link  link  link";
    padding-bottom: 0;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

/* Every skill passed. */
.quiz-row.is-passed {
    background: #f6fbf8;
}

.quiz-cell-gutter {
    grid-area: gutter;
    align-self: start;
    padding-top: 2px;
}

.quiz-cell-name {
    grid-area: name;
    min-width: 0;
}

.quiz-cell-stats {
    grid-area: stats;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.quiz-stat-questions { min-width: 60px; }
.quiz-stat-known { min-width: 64px; }
.quiz-stat-last { min-width: 84px; }

.quiz-row .deck-stat-value {
    white-space: nowrap;
}

/* Last practised more than a week ago, and not every skill passed yet. */
.quiz-row .quiz-stat-stale {
    color: #b54708;
}

.quiz-row .quiz-stat-never {
    color: #9ca3af;
}

.quiz-cell-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
}

.quiz-row > .deck-lane-breakdown {
    grid-area: pills;
    padding: 8px 0 6px;
}

.quiz-row > .deck-share-checkbox-row {
    grid-area: share;
    padding: 0 0 4px;
}

.quiz-row > .deck-share-link-row {
    grid-area: link;
    padding: 0 0 10px;
}

.quiz-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 2px;
    min-width: 0;
    font-weight: 500;
}

/* The deck list's title is a plain, unstyled link: default link colour,
   underlined. site.css restyles <a>, so restore the default here. */
.quiz-row-title {
    font-size: 14px;
    color: #0000ee;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.quiz-row-title:visited {
    color: #551a8b;
}

/* Under the name: characters, tones (readings), HSK levels. */
.quiz-row-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
    unicode-bidi: plaintext;
}

/* Under the meta line: saved items no longer in the dictionary (not in Known X/N). */
.quiz-row-unavailable {
    margin-top: 2px;
    font-size: 12px;
    color: #92400e;
}

.quiz-chip {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #eef2f7;
}

.quiz-chip-passed {
    color: #15803d;
    background: #dcfce7;
}

/* Gutter: every skill passed (green ✓), some (ring "N/M"), none (grey ring). */
.quiz-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.quiz-mark-some {
    border-color: #16a34a;
    color: #15803d;
}

.quiz-mark-all {
    border-color: #16a34a;
    background: #16a34a;
    color: #ffffff;
    font-size: 13px;
}

/* Skill pills: the deck list's lane pills, single-select. */
.quiz-skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 4px 12px;
    font-size: 12px;
    color: #374151;
    background: #ffffff;
    border-color: #d1d5db;
}

.quiz-skill-pill:hover {
    background: #f8fafc;
    color: #111827;
}

.quiz-skill-pill.is-selected {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.quiz-skill-pill:disabled {
    cursor: default;
    transform: none;
    color: #9ca3af;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.quiz-skill-check {
    color: #16a34a;
    font-weight: 700;
}

/* After the pills: Start over, while the selected skill has a run in progress. */
.quiz-start-over-link {
    align-self: center;
    margin-left: 4px;
    font-size: 12px;
    color: #2563eb;
    text-decoration: underline;
    white-space: nowrap;
}

.quiz-start-over-link[hidden] {
    display: none;
}

@media (max-width: 640px) {
    /* The tab strip scrolls within itself rather than widening the page. */
    .type-tabs {
        gap: 16px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .type-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .quiz-list-header-row {
        display: none;
    }

    /* One column: name and chip, the numbers on one line, the pills, then the actions. */
    .quiz-row {
        grid-template-columns: 24px minmax(0, 1fr);
        grid-template-areas:
            "gutter name"
            "gutter stats"
            ".      pills"
            ".      actions"
            ".      share"
            ".      link";
        column-gap: 10px;
        row-gap: 6px;
        padding: 12px 6px 0;
    }

    .quiz-cell-stats {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .quiz-cell-stats .deck-stat {
        min-width: 0;
    }

    .quiz-cell-actions {
        justify-content: flex-start;
    }

    .quiz-start-link .quiz-start-count {
        display: inline;
    }

    .quiz-row > .deck-lane-breakdown {
        padding: 2px 0;
    }
}

/* Action cluster: one pill container, filled Play button + icon-only
   Edit/Delete riding next to it — same pattern as the deck list's
   .deck-action-cluster. */
.quiz-action-cluster {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f8fafc;
    border-radius: 999px;
    padding: 3px;
    flex-shrink: 0;
}

.quiz-start-link {
    color: #ffffff;
    background: #185fa5;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    line-height: 1.4;
    text-decoration: none;
}

/* Practice on a phone: the card's Hint / Next row, while the on-screen keyboard (with its
   own Hint and Next keys) is up -- quiz_pinyin_practice.js sets the class. */
.review-pinyin-actions.quiz-actions--keyboard {
    display: none;
}

/* Continue's "(X/N)": on phones only -- on desktop Known shows it beside the button. */
.quiz-start-count {
    display: none;
}

.quiz-start-link:hover {
    background: #124d87;
    color: #ffffff;
    text-decoration: none;
}

.quiz-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.quiz-icon-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.quiz-icon-btn-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.quiz-icon-btn-armed {
    background: #dc2626;
    color: #ffffff;
}

.quiz-icon-btn-armed:hover {
    background: #b91c1c;
    color: #ffffff;
}

.empty-state {
    padding: 28px 0;
    color: #6b7280;
    font-size: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.signed-out-copy {
    color: #6b7280;
    font-size: 15px;
    max-width: 48ch;
    margin: 10px 0 20px;
}

/* =========================================================
   QUIZ LANDING (type picker at /quiz/new/)
   ========================================================= */

.quiz-landing-hero {
    text-align: center;
    margin: 32px 0;
}

.quiz-landing-hero p {
    color: #6b7280;
}

.quiz-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.quiz-type-card {
    color: inherit;
}

.quiz-type-card h2 {
    font-size: 16px;
    margin: 0 0 6px;
    color: #111827;
}

.quiz-type-card p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

a.quiz-type-card:hover {
    border-color: #94a3b8;
    text-decoration: none;
}

.quiz-type-card--soon {
    opacity: 0.6;
}

/* =========================================================
   PINYIN BUILDER
   ========================================================= */

.quiz-search {
    display: flex;
    gap: 8px;
    margin: 20px 0 6px;
    max-width: 420px;
}

.quiz-search input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
}

.quiz-search button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* My Quizzes' inline "New quiz" form -- the builder's search box, opened in
   place like the deck page's .deck-new-form. */
.quiz-new-form {
    margin: 0 0 20px;
}

/* display:flex above would otherwise beat the [hidden] attribute. */
.quiz-new-form[hidden] {
    display: none;
}

.quiz-search-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.quiz-empty,
.quiz-warning {
    padding: 14px 16px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #6b7280;
    font-size: 14px;
}

.quiz-level-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 16px 0;
}

.quiz-level-chip {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Batch example controls: untick "All" or one HSK level to pull every example at
   that level out of the quiz at once, across every character -- finetuning the
   final example set in batches rather than one checkbox at a time. Visually a
   step down from the main HSK level chips above it (smaller, muted background)
   since it's a secondary, narrower-scope control acting only on examples. */
.quiz-example-batch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 20px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.quiz-example-batch-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.quiz-example-batch-chip {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quiz-level-chip:has(input:disabled),
.quiz-example-batch-chip:has(input:disabled) {
    color: #cbd5e1;
}

.quiz-example-batch-all-chip {
    font-weight: 600;
    padding-right: 14px;
    border-right: 1px solid #e5e7eb;
}

.quiz-select-hint {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 20px;
}

.quiz-pivot-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.quiz-pivot {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 640px;
    /* Fixed layout: column widths come from the header row, not from the cell
       text -- otherwise every "9/12" -> "10/12" while ticking re-sizes the
       columns and the whole table shifts sideways. */
    table-layout: fixed;
}

.quiz-pivot th,
.quiz-pivot td {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.quiz-pivot thead .quiz-pivot-corner {
    width: 100px;
}

.quiz-pivot thead .quiz-pivot-total-col {
    width: 84px;
}

/* Cells read "selected/total" once JS runs (data-total holds the server-rendered total
   for the no-JS fallback) -- tabular-nums keeps the "/" aligned as the selected count
   changes digit width while the user ticks boxes. */
.js-pivot-characters,
.js-pivot-words,
.js-pivot-questions,
.js-pivot-questions-total {
    font-variant-numeric: tabular-nums;
}

/* The running question count -- what the Start button will ask -- set apart
   from the two "selected/total" rows above it. */
.quiz-pivot-questions td {
    font-weight: 700;
    color: #111827;
    background: #f8fafc;
    border-top: 2px solid #e5e7eb;
}

.quiz-pivot thead th {
    color: #94a3b8;
    font-weight: 500;
}

.quiz-pivot td:first-child,
.quiz-pivot .quiz-pivot-corner {
    padding-left: 10px;
    text-align: left;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.quiz-pivot-total-col {
    font-weight: 700;
    color: #111827;
    border-left: 1px solid #e5e7eb;
}

/* Explains why the Words row's "selected/total" can show something like 31/30 -- not an
   error, just that a shared word (counted once in Total) renders as one checkbox per
   character it appears under (so Selected can tick past it). */
.quiz-pivot-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.quiz-level-group {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

/* Native <details>/<summary> accordion -- no extra JS needed to expand/collapse
   an HSK level group. The marker is drawn via ::before below so it can rotate
   on [open] instead of relying on the browser's default triangle glyph. */
.quiz-level-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    background: #f8fafc;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.quiz-level-summary::-webkit-details-marker {
    display: none;
}

.quiz-level-summary::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(-45deg);
    transition: transform 0.15s;
    flex-shrink: 0;
}

.quiz-level-group[open] > .quiz-level-summary::before {
    transform: rotate(45deg);
}

.quiz-level-title {
    flex: 1;
}

.quiz-level-count {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.quiz-tone-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px;
}

.quiz-tone-col {
    min-width: 160px;
}

/* Tones are grouped for structure (reading order), not colour-coded any more --
   one tone no longer "means" one colour; nothing about a tone's correctness or
   difficulty was meant to be conveyed by it, so a single neutral style for all
   five removes a visual signal that wasn't actually signalling anything. */
.quiz-tone-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #6b7280;
    margin: 0 0 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e5e7eb;
}

.quiz-word-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 14px;
}

.quiz-char-row {
    display: block;
    padding: 10px 0;
    border-bottom: 0.5px solid #f1f5f9;
    font-size: 14px;
}

.quiz-char-row:last-child {
    border-bottom: none;
}

/* A character the user has unticked still shows its data (nothing to quiz on it
   right now, but nothing hides), just dimmed, matching its now-disabled example
   checkboxes below it. */
.quiz-char-row-off {
    opacity: 0.5;
}

.quiz-char-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    cursor: pointer;
}

.quiz-char-zh {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.quiz-char-py {
    color: #6b7280;
}

/* Flags a character that's ALSO read a completely different way on another syllable
   (系 as jì here, but xì elsewhere) -- its level badge below only reflects THIS reading,
   so without this a learner could reasonably expect the character's "famous" reading's
   level instead. Hover/title carries the other syllable(s); kept terse inline since most
   rows won't have it at all. */
.quiz-multi-reading-badge {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 1px 5px;
    cursor: help;
}

/* All of the character's own senses, read-only -- e.g. all 17 for 是, not just one */
.quiz-char-senses {
    display: block;
    font-size: 13px;
    color: #374151;
    margin: 4px 0 0 24px;
}

.quiz-example-sep {
    margin: 0 4px;
    color: #cbd5e1;
}

/* Example words -- each with ALL of its own senses, not just one. Individually
   checkable (picking which examples feed the quiz is a later "cart" step), so
   each is its own label/checkbox row rather than plain text. */
.quiz-char-examples {
    list-style: none;
    margin: 6px 0 0 24px;
    padding: 0;
    font-size: 12px;
    color: #94a3b8;
}

.quiz-char-examples li {
    padding: 2px 0;
}

.quiz-example-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    cursor: pointer;
}

.quiz-example-row input[disabled] {
    cursor: default;
}

.quiz-example {
    font-weight: 600;
    color: #6b7280;
    margin-right: 6px;
}

.quiz-example-py {
    color: #94a3b8;
    margin-right: 6px;
}

.quiz-example-level {
    color: #cbd5e1;
    font-size: 11px;
    margin-right: 6px;
}

.quiz-example-en {
    color: #94a3b8;
}

.quiz-builder-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.quiz-title-input {
    flex: 1 1 220px;
    min-width: 160px;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

#quiz-start-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

#quiz-start-btn:disabled {
    background: #cbd5e1;
    cursor: default;
}

.quiz-save-btn {
    padding: 10px 18px;
    border: 1px solid #111827;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
}

.quiz-save-btn:disabled {
    border-color: #cbd5e1;
    color: #cbd5e1;
    cursor: default;
}

.quiz-save-status {
    font-size: 13px;
    color: #374151;
    margin-top: 10px;
}

.quiz-save-status-error {
    color: #dc2626;
}

.quiz-share-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 20px;
}

.quiz-share-hint input {
    display: block;
    margin-top: 6px;
    width: 100%;
    max-width: 420px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
}

/* =========================================================
   PINYIN PLAYER
   ========================================================= */

.quiz-play {
    text-align: center;
    /* The player loads review.css, which makes <body> a flex column. There,
       .page's "margin: 0 auto" stops the item stretching to the screen and
       sizes it to its content instead -- and the results list's one-line
       (ellipsised) meanings are several hundred px wide unwrapped, so on a
       phone the page grew to 512px and scrolled sideways. An explicit full
       width (still capped by .page's max-width, still centred) fits it to
       the screen and lets the ellipsis do its job. */
    width: 100%;
    box-sizing: border-box;
}

.quiz-play-root {
    max-width: 480px;
    margin: 20px auto 0;
}

.quiz-progress {
    font-size: 13px;
    color: #94a3b8;
}

/* Long meaning/translation on the question card: 4 lines, then a Show more
   toggle (see makeClampable in quiz_pinyin_play.js). */
.quiz-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.quiz-clamp-1 {
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.quiz-clamp.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.quiz-clamp-toggle {
    margin: 2px 0 0;
    padding: 0;
    border: none;
    background: none;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
}

.quiz-clamp-toggle[hidden] {
    display: none;
}

/* Per-question verdict -- the same pill as the end screen's result badge. */
.quiz-word-verdict {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    margin: 0 0 12px;
}

.quiz-kind-tag {
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    align-self: flex-start;
    flex-shrink: 0;
    color: #475569;
    background: #f1f5f9;
}

.quiz-next-btn,
.quiz-replay-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.quiz-score {
    font-size: 22px;
    color: #111827;
}

.quiz-end-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

/* End screen: every question of the run with its result. Kept neutral --
   "Correct" is a green pill and "Incorrect" a red one; "Incorrect (hint
   used)" is a quiet outlined pill, and glyphs, pinyin and the struck-through
   attempt stay neutral. */
.quiz-results {
    margin: 24px 0;
    text-align: start;   /* left, or right on an RTL page */
}

/* Mixed directions on an RTL page (Arabic): the page and its translations
   run right to left, Chinese and pinyin left to right -- in the same row.

   Rows that lay a word out ONE ELEMENT PER CHARACTER (the results glyphs,
   the question's context word) must be LTR themselves, or the RTL row puts
   the characters in reverse: 漂亮 would read 亮 漂. On RTL the glyph row
   still sits at the start (right) side of its row. */
.quiz-result-glyphs,
.quiz-play .review-context-word {
    direction: ltr;
}

[dir="rtl"] .quiz-result-glyphs {
    justify-content: flex-end;
}

/* Text blocks take their direction from their own first strong letter
   (plaintext), not from the page: an Arabic translation runs RTL with any
   Chinese or pinyin inside it kept LTR in place; a meaning that fell back
   to English, typed pinyin in the input, run LTR. The input's Arabic
   placeholder stays RTL that way too. */
.quiz-play .review-pinyin-input,
.quiz-play .review-char-meaning,
.quiz-play .review-sub,
.quiz-play .review-summary-context-meaning,
.quiz-result-meaning,
.quiz-char-senses,
.quiz-example-en {
    unicode-bidi: plaintext;
}

.quiz-results-heading {
    font-size: 15px;
    color: #111827;
    margin: 0 0 8px;
}

.quiz-results-tally {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
}

.quiz-results-tally-item strong {
    color: #111827;
}

.quiz-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e5e7eb;
}

.quiz-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.quiz-result-main {
    flex: 1;
    min-width: 0;
}

.quiz-result-glyphs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quiz-result-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.quiz-result-glyph {
    font-size: 22px;
}

.quiz-result-glyph { color: #111827; }

.quiz-result-pinyin {
    font-size: 12px;
    color: #374151;
}

/* The dictionary reading under a spoken (sandhi) form: "dictionary: bu4". */
.quiz-result-reading {
    font-size: 11px;
    color: #6b7280;
}

.quiz-result-typed {
    font-size: 11px;
    color: #6b7280;
    text-decoration: line-through;
}

.quiz-result-info {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* One line (ellipsised by .quiz-clamp-1), Show more underneath when cut. */
.quiz-result-meaning-wrap {
    flex: 1;
    min-width: 0;
}

.quiz-result-meaning-wrap .quiz-clamp-toggle:not([hidden]) {
    display: block;
    font-size: 12px;
}

.quiz-result-badge {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.quiz-result-row.is-correct .quiz-result-badge,
.quiz-word-verdict.is-correct { color: #15803d; background: #dcfce7; }
.quiz-result-row.is-incorrect .quiz-result-badge,
.quiz-word-verdict.is-incorrect { color: #b91c1c; background: #fee2e2; }
.quiz-result-row.is-hint .quiz-result-badge,
.quiz-word-verdict.is-hint { color: #374151; background: #ffffff; border-color: #d1d5db; }

/* End screen "Create deck": quick-select row above the list, a checkbox
   per word row, name + button below. Neutral like the rest of the list. */
.quiz-select-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin: 0 0 8px;
    font-size: 13px;
    color: #6b7280;
}

.quiz-select-btns {
    display: flex;
    gap: 6px;
}

.quiz-select-btn {
    padding: 3px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
}

.quiz-select-btn:hover {
    border-color: #94a3b8;
}

.quiz-result-check,
.quiz-result-check-slot {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
}

.quiz-deck-create {
    max-width: none;
    margin: 16px 0 0;
}

.quiz-deck-create button:disabled {
    background: #cbd5e1;
    cursor: default;
}

.quiz-edit-link {
    color: #2563eb;
    align-self: center;
}

.quiz-powered-by {
    margin-top: 24px;
    font-size: 12px;
    color: #94a3b8;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {
    .quiz-type-grid {
        grid-template-columns: 1fr;
    }

}
/* My Quizzes' toast ("No longer shared", link copied, ...) -- same look as
   the deck page's .deck-toast, kept here since this page doesn't load
   deck.css. Fixed at the bottom centre, fading/sliding in. */
.quiz-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.quiz-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.quiz-toast[hidden] {
    display: none;
}

/* A shared public quiz's page (quiz_shared.html): title, counts, one action. */
.quiz-shared-meta {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px;
}

/* Practice on a phone: the site header scrolls away with the page. Pinned, its ~97 px came
   out of the room between it and the on-screen keyboard, and the card's top -- the word's
   meaning -- ended up under it (makeFit, quiz_pinyin_practice.js). 768 px: isMobileViewport. */
@media (max-width: 768px) {
    .quiz-practice-page .site-header {
        position: static;
    }
}

/* Practice mode (quiz_pinyin_practice.html): a bar above the card with the
   known count and a Stop button, a Known badge in the verdict, the recap. */
.quiz-practice-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
}

/* The bar's left side: Known X of N, then the skill practised -- a plain label, no switch. */
.quiz-practice-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
}

.quiz-practice-skill {
    padding: 1px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    white-space: nowrap;
}

/* Continue / Start over: Start over is a link-style button beside Continue. */
.quiz-run-start-over {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.quiz-practice-stop {
    padding: 5px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.quiz-practice-stop[hidden] {
    display: none;
}

.quiz-practice-stop:hover {
    border-color: #94a3b8;
}

.quiz-practice-known {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #185fa5;
    background: #e6f1fb;
}

.quiz-practice-known[hidden] {
    display: none;
}

.quiz-practice-answer {
    justify-content: center;
    margin: 4px 0 16px;
}

.quiz-practice-recap-list {
    list-style: none;
    margin: 12px 0 20px;
    padding: 0;
    color: #374151;
    line-height: 1.8;
}

/* Practice recap: timing per item and per character inside it. */
.quiz-practice-stats {
    margin: 8px 0 24px;
    text-align: start;
}

.quiz-practice-stats[hidden] {
    display: none;
}

.quiz-practice-stats-summary {
    margin: 0 0 4px;
    font-size: 13px;
    color: #6b7280;
}

.quiz-practice-item-word {
    font-size: 20px;
    direction: ltr;
    margin-inline-end: 8px;
}

.quiz-practice-item-reps {
    font-size: 12px;
    color: #94a3b8;
    margin-inline-start: 8px;
}

.quiz-practice-timing {
    margin-top: 12px;
}

.quiz-practice-timing-group {
    text-align: center !important;
    border-bottom: none !important;
}

/* Item heading row: word, tags, count -- set off from the previous item. */
.quiz-practice-timing-head td {
    text-align: start !important;
    padding-top: 14px !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-top: 1px solid #e5e7eb;
}

.quiz-practice-timing-head .quiz-kind-tag,
.quiz-practice-timing-head .quiz-practice-known {
    vertical-align: middle;
}

.quiz-practice-timing {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.quiz-practice-timing th,
.quiz-practice-timing td {
    padding: 4px 6px;
    text-align: end;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.quiz-practice-timing th {
    font-weight: 600;
    color: #374151;
}

.quiz-practice-timing-sub th {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
}

.quiz-practice-timing-char {
    text-align: start;
    direction: ltr;
}

.quiz-practice-timing-char .quiz-result-glyph {
    font-size: 18px;
    margin-inline-end: 6px;
}

.quiz-practice-timing-avg {
    color: #6b7280;
}

.quiz-practice-all-known {
    display: inline-block;
    margin: 4px 0 0;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
}

.quiz-practice-all-known[hidden] {
    display: none;
}

/* Practice: speed check panel under the card. */
.quiz-speed-check {
    margin: 28px 0 0;
    text-align: start;
}

.quiz-speed-table[hidden],
.quiz-speed-check [hidden] {
    display: none;
}

.quiz-speed-fast {
    color: #15803d;
    font-weight: 600;
}

.quiz-speed-slow {
    color: #b45309;
    font-weight: 600;
}

/* Speed check: every answer, with the correct pinyin next to what was typed.
   Nine columns -- scrolls sideways on a narrow screen instead of squeezing. */
.quiz-speed-scroll {
    overflow-x: auto;
}

.quiz-speed-scroll[hidden] {
    display: none;
}

.quiz-speed-table td,
.quiz-speed-table th {
    white-space: nowrap;
}

.quiz-speed-pinyin {
    unicode-bidi: plaintext;
}

.quiz-speed-right {
    color: #15803d;
}

.quiz-speed-wrong {
    color: #b91c1c;
    font-weight: 600;
}

.quiz-speed-hint {
    font-weight: 400;
    color: #6b7280;
}

/* Practice: away pause -- blurs the whole page (the on-screen keyboard
   included) until Continue. */
.quiz-pause {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.quiz-pause[hidden] {
    display: none;
}

.quiz-pause-box {
    max-width: 360px;
    padding: 24px 28px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.quiz-pause-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 600;
}

.quiz-pause-note {
    margin: 0 0 18px;
    font-size: 14px;
    color: #6b7280;
}

/* Character quiz builder (quiz_character.html): a pivot of the readings, then
   one block per reading of the character with its words by level. */
.quiz-reading-block {
    margin: 0 0 24px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.quiz-reading-block.is-empty {
    background: #f8fafc;
    color: #94a3b8;
}

.quiz-reading-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 18px;
}

.quiz-reading-char {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
}

.quiz-reading-py {
    font-size: 20px;
    color: #2563eb;
}

.quiz-reading-block.is-empty .quiz-reading-char,
.quiz-reading-block.is-empty .quiz-reading-py {
    color: #94a3b8;
}

.quiz-reading-meaning {
    margin: 0;
    font-size: 14px;
    color: #374151;
}

/* The pivot on top: readings x HSK levels, "selected / total" per cell. On a
   phone it scrolls sideways inside its own box, never the page. */
.quiz-char-pivot-wrap {
    overflow-x: auto;
    margin: 0 0 24px;
    max-width: 100%;
}

.quiz-char-pivot {
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.quiz-char-pivot th,
.quiz-char-pivot td {
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
    white-space: nowrap;
}

.quiz-char-pivot thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.quiz-char-pivot tbody th,
.quiz-char-pivot tfoot th {
    text-align: start;
    font-weight: 600;
}

.quiz-char-pivot-corner {
    font-size: 18px;
}

.quiz-char-pivot-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Level columns: checkbox above "HSK n", so the whole table fits a desktop page. */
.quiz-char-pivot thead .quiz-char-pivot-check {
    flex-direction: column;
    gap: 2px;
}

.quiz-char-pivot .quiz-reading-py {
    font-size: 13px;
}

.quiz-char-pivot-total,
.quiz-char-pivot tfoot td {
    font-weight: 600;
}

.quiz-char-pivot tfoot th,
.quiz-char-pivot tfoot td {
    background: #f8fafc;
}

.quiz-char-pivot .is-empty {
    color: #cbd5e1;
}

.quiz-char-pivot tr.is-empty th,
.quiz-char-pivot tr.is-empty .quiz-reading-py {
    color: #94a3b8;
}

.quiz-reading-word-label {
    display: inline;
    cursor: pointer;
}

.quiz-reading-word-label input {
    margin: 0 6px 0 0;
    vertical-align: middle;
}

.quiz-reading-empty {
    margin: 8px 0 0;
    font-size: 14px;
    font-style: italic;
}

.quiz-reading-level {
    margin: 12px 0 0;
}

.quiz-reading-level-title {
    margin: 0 0 6px;
    font-size: 14px;
    color: #374151;
}

.quiz-reading-words {
    list-style: none;
    margin: 0;
    padding: 0;
}

.quiz-reading-word {
    padding: 3px 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

/* The spoken form where it differs from the reading: 不要 "(said bú)". */
.quiz-reading-said {
    color: #b45309;
    font-size: 12px;
    margin-right: 6px;
}

/* My Quizzes: a character quiz's anchor character next to its title. */
.quiz-row-anchor {
    margin: 0 6px;
    font-size: 18px;
    color: #374151;
}

/* The Char column (the character itself at each reading) set apart from the levels. */
.quiz-char-pivot .quiz-char-pivot-charcol {
    background: #eff6ff;
    border-right: 2px solid #bfdbfe;
}

/* Edit mode: saved items the dictionary no longer has. */
.quiz-unavailable {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    font-size: 14px;
    color: #92400e;
}

.quiz-unavailable p,
.quiz-unavailable ul {
    margin: 0;
}

.quiz-unavailable ul {
    padding-left: 18px;
}

/* My Quizzes: the skill pills (the SRS deck list's lane pills, as buttons). */
.quiz-skill-pills {
    padding: 0 0 10px;
}

.quiz-skill-pills .deck-lane-pill {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

/* Recap: a character quiz's reading next to a character item (行 xíng / 行 háng). */
.quiz-practice-item-reading {
    margin-left: 6px;
    color: #2563eb;
}

/* Recall: masked boxes (X) until answered, then a check or a cross beside the colour. */
.review-pinyin-context-char.is-masked .review-pinyin-context-char-glyph {
    color: #94a3b8;
}

.quiz-recall-mark {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.review-pinyin-context-char.correct .quiz-recall-mark { color: #15803d; }
.review-pinyin-context-char.incorrect .quiz-recall-mark { color: #b91c1c; }

/* Practice: saved items the page can't serve. */
.quiz-unavailable {
    margin: 0 0 12px;
    font-size: 14px;
    color: #92400e;
}

/* Practice: the attempt's verdict under the result badge -- counted or not, and why.
   A mark and a colour together. On a phone it is a button opening the speed check. */
.quiz-attempt-verdict {
    margin: -4px 0 12px;
    font-size: 14px;
    line-height: 1.4;
}
.quiz-attempt-verdict.is-counted { color: #15803d; }
.quiz-attempt-verdict.is-not-counted { color: #b91c1c; }
.quiz-attempt-verdict-mark {
    font-weight: 700;
    margin-right: 4px;
}
.quiz-attempt-verdict-toggle {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-align: inherit;
}
.quiz-attempt-verdict-more {
    margin-left: 6px;
    color: #2563eb;
    text-decoration: underline;
    white-space: nowrap;
}
.quiz-attempt-verdict-toggle[aria-expanded="true"] .quiz-attempt-verdict-more::after { content: " \25B4"; }
.quiz-attempt-verdict-toggle[aria-expanded="false"] .quiz-attempt-verdict-more::after { content: " \25BE"; }

/* Writing's final screen: a character's full dictionary entry, collapsed under the
   lane's "is a component in" toggle style (quiz_writing_decomp.js entryHTML). The reading
   used in the word comes first, marked with the accent bar. */
.quiz-writing-entry-body { margin-top: 8px; text-align: left; }
.quiz-writing-entry-reading { padding: 6px 0 6px 10px; border-left: 3px solid transparent; }
.quiz-writing-entry-reading + .quiz-writing-entry-reading { border-top: 1px solid #f1f5f9; }
.quiz-writing-entry-reading.is-current { border-left-color: #6366f1; background: #f8fafc; }
.quiz-writing-entry-head { display: flex; align-items: baseline; gap: 6px; margin: 0 0 4px; }
.quiz-writing-entry-glyph { font-size: 18px; }
.quiz-writing-entry-pinyin { font-size: 15px; color: #374151; }
.quiz-writing-entry-reading.is-current .quiz-writing-entry-pinyin { font-weight: 700; color: #4338ca; }
.quiz-writing-entry-senses { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #4b5563; }
.quiz-writing-entry-senses li { margin: 2px 0; }
.quiz-writing-entry-number { color: #9ca3af; }

/* The Writing card (quiz_writing_card.js, on the Practice page): the SRS
   Writing lane's card and result screen (srs/css/review.css), plus per-character Again /
   Good with the verdict line, and room under both screens for the lane's fixed bar (Hint,
   Done / Next). */
.quiz-writing-card { margin: 0 auto; text-align: center; }
/* The word's slots while drawing: written glyphs grey, hinted ones red with the Hint label
   under them. The label sits in room kept below the row and the slots are spaced for it,
   so it never wraps or moves the card. */
.quiz-writing-slots { padding-bottom: 14px; }
.quiz-writing-slots .review-context-char {
    position: relative; display: inline-block; box-sizing: content-box; min-width: 1em; padding: 0 6px;
    text-align: center;
}
.quiz-writing-slot-done { color: #94a3b8; }
.quiz-writing-slot-done.quiz-writing-slot-hint { color: #dc2626; }
.quiz-writing-slot-hint-label {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    font-size: 10px; font-weight: 400; line-height: 1; white-space: nowrap; color: #dc2626;
}
.quiz-writing-root { padding-bottom: 120px; }
/* The final screen's drawings start where the canvas did (.review-writer-target's top margin). */
.quiz-writing-card .review-writing-summary { margin-top: 20px; }
.quiz-writing-char-block { padding: 4px 0 16px; border-bottom: 1px solid #f1f5f9; }
.quiz-writing-char-block:last-child { border-bottom: 0; }
.quiz-writing-char-rate { display: flex; gap: 8px; margin-top: 12px; }
.quiz-writing-char-rate .review-rate-btn { padding: 10px 0; border-radius: 8px; }
.quiz-writing-char-rate.is-rated .review-rate-btn:not(.is-picked) { opacity: 0.35; }
.quiz-writing-char-rate .is-picked { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); }
.quiz-writing-char-block .quiz-attempt-verdict { margin: 8px 0 0; text-align: left; }
.quiz-writing-word-verdict { margin: 16px 0 0; text-align: left; font-weight: 600; }
/* The Writing recap: a write that didn't count, as its word's verdict line. */
.quiz-writing-recap .quiz-writing-recap-reason td { text-align: start; white-space: normal; }
.quiz-writing-card .review-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Pinyin, Recall and Writing: each meaning in its own slot of fixed height
   (quiz_meaning_area.js), top to bottom: the WORD's meaning, the word's row (slots / X),
   the ACTIVE CHARACTER's meaning (smaller, muted), then the input or canvas -- so nothing
   moves from character to character, item to item or question to answer, short meaning or
   long. Each text is clamped to two lines, with room kept for its Show more; Show
   more lets that slot grow. A one-character item's meaning is the word's: its character
   slot is kept, empty. */
.quiz-meaning-area {
    --qm-lines: 2;
    --qm-line: 1.625rem;                /* the word's meaning: 20 px text, 26 px lines */
    --qm-height: calc(var(--qm-lines) * var(--qm-line) + 1.1875rem);   /* + Show more's 19 px */
    width: 100%;
    height: var(--qm-height);
    overflow: hidden;
}
.quiz-meaning-area--word { margin: 0 0 8px; }
.quiz-meaning-area--char { --qm-line: 1.3125rem; margin: 0 0 12px; }   /* 16.5 px text, 21 px lines */
/* The character's meaning right under the word: the word row's own margin is the gap. */
.quiz-practice-card .review-word-row { margin-bottom: 4px; }
.quiz-meaning-area.is-open { height: auto; min-height: var(--qm-height); }
/* The word's meaning, the main clue: larger, darker and heavier than the character's. */
.quiz-meaning-area .review-sub { margin: 0; font-size: 1.25rem; line-height: var(--qm-line); font-weight: 500; color: #111827; }
.quiz-meaning-area .review-char-meaning { margin: 0; font-size: 1.03125rem; line-height: var(--qm-line); font-weight: 400; color: #6b7280; }
.quiz-meaning-area .quiz-clamp { -webkit-line-clamp: var(--qm-lines); line-clamp: var(--qm-lines); }
.quiz-meaning-area .quiz-clamp.is-expanded { -webkit-line-clamp: unset; line-clamp: unset; }
.quiz-meaning-area .quiz-clamp-toggle:not([hidden]) { display: block; margin: 0.125rem auto 0; line-height: 1.0625rem; }

/* Phones: the Practice page's spacing tightened, so the meanings,
   the slots and the whole canvas (Writing) are on the first screen at 360 px. */
@media (max-width: 480px), (max-height: 700px) {
    .quiz-meaning-area--word { margin-bottom: 4px; }
    .quiz-meaning-area--char { margin-bottom: 8px; }
    .quiz-practice.page { margin-top: 12px; }
    .quiz-practice .breadcrumbs { margin: 0; padding: 4px 0; }
    .quiz-practice .quiz-play-root { margin-top: 8px; }
    .quiz-practice .quiz-practice-bar { margin-bottom: 8px; }
    .quiz-practice .review-card { padding-top: 12px; }
    .quiz-writing-card .review-word-row { margin-bottom: 4px; }
    .quiz-writing-card .review-context-word { margin-bottom: 0; }
    .quiz-writing-card .review-writer-target { margin: 8px auto; }
    .quiz-writing-card .review-writing-summary { margin-top: 8px; }
}

/* Component quiz builder (quiz_component.html): component -> HSK level -> character ->
   its readings and words. The level groups and summary reuse the pinyin builder's look. */
.quiz-comp-contains {
    margin: 8px 0 16px;
    font-size: 20px;
}

.quiz-comp-section > .quiz-level-summary input,
.quiz-comp-level-summary input,
.quiz-comp-entry-head input {
    margin: 0;
    flex-shrink: 0;
}

.quiz-comp-char {
    font-size: 26px;
    font-weight: 600;
    margin-inline-end: 8px;
}

.quiz-comp-meaning {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
}

.quiz-comp-body {
    padding: 8px 16px 16px;
}

.quiz-comp-level {
    margin: 8px 0 0;
}

.quiz-comp-level-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid #e5e7eb;
}

.quiz-comp-level-summary::-webkit-details-marker {
    display: none;
}

.quiz-comp-entry {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.quiz-comp-entry.is-anchor {
    border-color: #2563eb;
    background: #eff6ff;
}

.quiz-comp-entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
}

.quiz-comp-entry-head .quiz-reading-char {
    font-size: 26px;
}

.quiz-comp-entry-head .quiz-reading-py {
    font-size: 16px;
}

.quiz-comp-entry-head .js-scope-count {
    margin-inline-start: auto;
}

.quiz-comp-anchor-badge {
    padding: 1px 8px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
}

.quiz-comp-reading {
    margin: 8px 0 0;
}

.quiz-comp-char-item {
    font-size: 15px;
}

/* Its summary table: one block (Characters / Words / Questions) per component, then Total.
   Same look as .quiz-pivot; wide tables scroll inside .quiz-pivot-wrap, never the page. */
.quiz-comp-pivot {
    min-width: 600px;
}

.quiz-comp-pivot-col-label { width: 52px; }
.quiz-comp-pivot-col-row { width: 84px; }
.quiz-comp-pivot-col-total { width: 76px; }

.quiz-comp-pivot .quiz-comp-pivot-label {
    padding: 4px 6px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 2px solid #e5e7eb;
    color: #111827;
    font-weight: 600;
    line-height: 1.2;
}

.quiz-comp-pivot-glyph {
    display: block;
    font-size: 22px;
}

.quiz-comp-pivot-py {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #2563eb;
}

.quiz-comp-pivot .quiz-comp-pivot-rowlabel {
    padding-left: 8px;
    text-align: start;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.quiz-comp-pivot td.js-sum {
    font-variant-numeric: tabular-nums;
}

.quiz-comp-pivot .quiz-pivot-questions td {
    border-bottom: 2px solid #e5e7eb;
}

.quiz-comp-pivot .quiz-pivot-questions td.quiz-comp-pivot-rowlabel {
    color: #111827;
}

/* The Total block: what Save stores, set apart from the component blocks above it. */
.quiz-comp-pivot-block.is-total .quiz-comp-pivot-label,
.quiz-comp-pivot-block.is-total td {
    background: #f1f5f9;
}

.quiz-comp-pivot .is-empty {
    color: #cbd5e1;
}

/* Several blocks: tighter rows than the single-block pivot, so 4-5 components stay compact. */
.quiz-comp-pivot th,
.quiz-comp-pivot td {
    padding-top: 5px;
    padding-bottom: 5px;
}

/* The component's checkbox in its summary block: the whole cell is the hit area. */
.quiz-comp-pivot .quiz-comp-pivot-label:has(.quiz-comp-pivot-check) {
    padding: 0;
}

.quiz-comp-pivot-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 6px 4px;
    cursor: pointer;
}

.quiz-comp-pivot-check input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.quiz-comp-pivot-col-label { width: 56px; }

/* A component that is itself a character (兑 in 兑's section): first in its level, marked. */
.quiz-comp-self-badge {
    padding: 0 8px;
    border: 1px solid #2563eb;
    border-radius: 999px;
    color: #2563eb;
    font-size: 12px;
}

.quiz-comp-entry.is-component:not(.is-anchor) {
    border-color: #93c5fd;
}

/* The character you train, above the components: shown once, every reading. */
.quiz-comp-anchor { margin: 16px 0 8px; }
.quiz-comp-anchor > .quiz-comp-entry { margin: 0; }
/* A component's own entry heads its section. */
.quiz-comp-body > .quiz-comp-entry.is-component { margin-top: 4px; }
.quiz-comp-radical-badge {
    padding: 0 8px;
    border: 1px dashed #6b7280;
    border-radius: 999px;
    color: #374151;
    font-size: 12px;
}
/* A reading's meaning (the searched character and the components). */
.quiz-comp-reading-meaning {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;              /* the full sense list is the title */
    overflow: hidden;
    margin: 2px 0 4px 26px;
    color: #4b5563;
    font-size: 13px;
}
/* The kind chips: label and selected/total. */
.quiz-comp-kind-chips { margin-bottom: 6px; }
.quiz-comp-kind-count { color: #6b7280; font-variant-numeric: tabular-nums; }

/* The Practice card, one layout for a question and its answer (.is-answered): nothing on it
   moves or resizes between the two (public.tests_browser.PracticeLayout*BrowserTests).
   Pinyin / Recall (quiz_pinyin_practice.html, quiz-tpl-word): the character row, the
   meanings and the input stay; the answer fills room kept for its tallest case under the
   input -- the badge, a two-line verdict, the answer's glyphs with the reading note and the
   typed pinyin; the bottom bar keeps Hint / I don't know (disabled) and the primary slot.
   Writing (quiz_writing_templates.html): Hint and Done / Next in the same bar. */
/* Desktop: the SRS lane's 80 px over the card would push the answer's room under the bar at
   800 px; phones already take it down to 12 px (the media query above, of which this is the rest). */
@media (min-width: 481px) and (min-height: 701px) {
    .quiz-practice .review-card { padding-top: 16px; }
}
.quiz-primary-slot { display: inline-grid; }
.quiz-primary-slot > * { grid-area: 1 / 1; }          /* stacked: the slot is as wide as the wider */
.quiz-primary-slot > .quiz-primary-a,
.is-answered .quiz-primary-slot > .quiz-primary-q { visibility: hidden; }
.is-answered .quiz-primary-slot > .quiz-primary-a { visibility: visible; }
.is-answered .review-pinyin-hint-btn:disabled,
.is-answered .review-hint-btn:disabled { opacity: 0.4; cursor: default; }

.quiz-practice-card .review-pinyin-context-char-pinyin { height: 16px; line-height: 16px; }
.quiz-practice-card .quiz-recall-mark { height: 14px; }
.quiz-practice-card .review-pinyin-input:disabled { background: #f8fafc; color: #374151; opacity: 1; }
.quiz-practice-summary { width: 100%; margin-top: 12px; }
.quiz-practice-card:not(.is-answered) .quiz-practice-summary { visibility: hidden; }
.quiz-practice-verdict-row {
    display: flex; justify-content: center; align-items: center; gap: 6px;
    height: 26px; margin: 0 0 8px;
}
.quiz-practice-verdict-row .quiz-word-verdict,
.quiz-practice-verdict-row .quiz-practice-known { margin: 0; }
.quiz-practice-summary .quiz-attempt-verdict { min-height: 40px; margin: 0 0 4px; }
/* On a narrow phone a verdict can take three lines (Russian at 360 px): room for three, so the
   card doesn't grow -- and scroll -- once it is answered. */
@media (max-width: 400px) {
    .quiz-practice-summary .quiz-attempt-verdict { min-height: 60px; }
}
.quiz-practice-summary .quiz-attempt-verdict[hidden] { display: block; visibility: hidden; }
.quiz-practice-summary .quiz-practice-answer { min-height: 68px; margin: 0; align-items: flex-start; }

/* Phone: the on-screen keyboard stays up on an answered card, every key but Next dimmed and
   inert -- the keys keep their places and widths (pinyin_keyboard.css). */
.zm-kb.quiz-kb-answered .zm-key:not(.zm-key--done) { opacity: 0.35; pointer-events: none; }

/* Pinyin in the component builder (table, headers, item lines, words, chips): the site's sans
   stack, not the quiz pages' Times New Roman, in which a tone mark over "i" at 11-15 px (xíng,
   chì) melts into the dot and reads as "xing", "chi" -- ī (yī, dīng) stayed visible. */
.quiz-component-builder .quiz-comp-py {
    font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", Arial, sans-serif;
}
.quiz-comp-pivot-py { font-size: 12px; }

/* Readings chips: glyph and reading, then selected/total. */
.quiz-comp-reading-chips { margin-bottom: 6px; }
.quiz-comp-reading-chip [lang="zh"] { font-size: 17px; }
.quiz-comp-reading-chip .quiz-comp-py { color: #2563eb; }

/* A reading of a character at several readings: its own sub-block, its words collapsed. */
.quiz-comp-rd {
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
}
.quiz-comp-rd-head {
    display: flex;
    align-items: baseline;
    gap: 4px 10px;
}
.quiz-comp-rd-head input { margin: 0; flex-shrink: 0; align-self: center; }
.quiz-comp-rd-head .quiz-reading-char { font-size: 24px; }
.quiz-comp-rd-head .quiz-reading-py { font-size: 17px; font-weight: 600; }
.quiz-comp-rd-meaning {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;            /* the full sense list is the title */
    color: #4b5563;
    font-size: 13px;
}
.quiz-comp-rd-head .js-scope-count { flex-shrink: 0; }
.quiz-comp-rd > .quiz-comp-char-item { display: inline-block; margin: 4px 0 0 2px; }
.quiz-comp-rd-words,
.quiz-comp-rd-level { margin: 2px 0 0; }
.quiz-comp-rd-level { margin-inline-start: 22px; }
.quiz-comp-rd-words > summary,
.quiz-comp-rd-level > summary { padding: 4px 0; font-size: 14px; }
.quiz-comp-rd-words > summary::after,
.quiz-comp-rd-level > summary::after {
    content: "▸";
    color: #6b7280;
    font-weight: 400;
}
.quiz-comp-rd-words[open] > summary::after,
.quiz-comp-rd-level[open] > summary::after { content: "▾"; }
.quiz-comp-rd-level .quiz-reading-words { margin-inline-start: 22px; }

/* =========================================================
   COMPONENT QUIZ BUILDER -- TILES (chunk 4)
   The dictionary's component display (word_page.css: decomp-part, decomp-hsk-row,
   decomp-tile ...) made tickable: a tile is a button standing for its character item(s)
   and all their words; the "i" button opens its details panel under the row.
   ========================================================= */

.quiz-component-builder { --cb-accent: #1d5fa6; --cb-accent-bg: #eef4fb; }
.quiz-cb-py { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.quiz-cb-intro { margin: 4px 0 12px; font-size: 14px; line-height: 1.5; color: #4b5563; }

/* the summary bar: sticky under the site header (the script sets top to its height) */
.quiz-cb-bar {
    position: sticky;
    top: 64px;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin: 0 0 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d5dae3;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06);
}
.quiz-cb-sum { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.quiz-cb-stat { display: flex; flex-direction: column; line-height: 1.15; }
.quiz-cb-stat-n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: #111827; }
.quiz-cb-stat-label { font-size: 12px; color: #5b6472; }
.quiz-cb-save {
    min-height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.quiz-cb-save:disabled { background: #cbd5e1; cursor: default; }
.quiz-cb-title { display: block; width: 100%; box-sizing: border-box; margin: 0 0 4px; }

/* blocks: the searched character, then each component (decomp-part) */
.quiz-cb-block { margin: 18px 0; }
.quiz-cb-top { padding: 14px 14px 4px; border: 1px solid #e1e5ed; border-radius: 16px; }
.quiz-cb-head { flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.quiz-cb-head .decomp-number { align-self: center; }
.quiz-cb-head-glyph { line-height: 1.1; }
.quiz-cb-top .quiz-cb-head-glyph { font-size: 30px; }
.decomp-sub-glyph.quiz-cb-head-glyph { font-size: 26px; }
.quiz-cb-head-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; flex: 1 1 160px; min-width: 0; }
.quiz-cb-head-text .decomp-top-pinyin,
.quiz-cb-head-text .decomp-sub-pinyin { font-size: 15px; font-weight: 600; color: #1d4ed8; }
.quiz-cb-head-note { font-size: 12px; color: #94a3b8; }
.quiz-cb-head-count { font-size: 13px; color: #4b5563; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quiz-cb-btn {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #c9cfda;
    border-radius: 10px;
    background: #fff;
    color: #1b2330;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.quiz-cb-btn:disabled { color: #cbd5e1; cursor: default; }

/* rows: the dictionary's HSK row with a row button, tiles in a grid */
.decomp-hsk-row.quiz-cb-row { align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.quiz-cb-row-side { display: flex; flex-direction: column; gap: 6px; width: 56px; flex-shrink: 0; }
.quiz-cb-row-side .decomp-hsk-label { min-width: 0; }
.quiz-cb-btn.quiz-cb-row-btn { min-height: 32px; padding: 0 6px; font-size: 12px; }
.quiz-cb-row-body { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; }
.quiz-cb-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.quiz-cb-cell { position: relative; min-width: 0; }
.quiz-cb-cell[hidden] { display: none; }

.decomp-tile.quiz-cb-tile {
    position: relative;
    width: 100%;
    min-height: 132px;
    gap: 2px;
    padding: 30px 6px 10px;
    border: 1.5px solid #d5dae3;
    border-radius: 12px;
    background: #fafbfc;
    color: #6b7280;
    font: inherit;
    cursor: pointer;
}
.decomp-tile.quiz-cb-tile.is-on,
.decomp-tile.quiz-cb-tile.is-mixed { border-color: var(--cb-accent); background: var(--cb-accent-bg); color: #1b2330; }
.decomp-tile.quiz-cb-tile.is-mixed { border-style: dashed; }
.decomp-tile.quiz-cb-tile:hover { border-color: var(--cb-accent); }
.decomp-tile.quiz-cb-tile.is-off:hover { background: #fafbfc; }
.quiz-cb-tile .decomp-tile-glyph { font-size: 26px; }
.quiz-cb-tile.is-off .decomp-tile-glyph { color: #9ca3af; }
.quiz-cb-tile .decomp-tile-pinyin { margin-top: 2px; font-size: 13px; font-weight: 600; color: #1d4ed8; }
.quiz-cb-tile.is-off .decomp-tile-pinyin { color: #6b7280; }
.quiz-cb-tile .decomp-tile-meaning {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    font-size: 11.5px;
    color: inherit;
}
.quiz-cb-tile-words { margin-top: auto; padding-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--cb-accent); }
.quiz-cb-tile.is-off .quiz-cb-tile-words { color: #6b7280; }

/* the tick box (tiles, words, readings, the Show more tick) */
.quiz-cb-box {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border: 1.5px solid #9aa3b2;
    border-radius: 5px;
    background: #fff;
}
.is-on > .quiz-cb-box,
.is-mixed > .quiz-cb-box { border-color: var(--cb-accent); background: var(--cb-accent); }
.is-on > .quiz-cb-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.is-mixed > .quiz-cb-box::after { content: ""; position: absolute; left: 3px; right: 3px; top: 6.5px; height: 2px; background: #fff; }
.quiz-cb-tile > .quiz-cb-box { position: absolute; top: 8px; right: 8px; }

/* the "i" button: its own 44 px target over the tile's top corner, not inside the tile button */
.quiz-cb-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    padding: 5px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.quiz-cb-info-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    border: 1.5px solid #9aa3b2;
    border-radius: 50%;
    background: #fff;
    color: #1b2330;
    font: italic 600 14px/1 Georgia, serif;
}
.quiz-cb-info.is-open .quiz-cb-info-dot { border-color: var(--cb-accent); background: var(--cb-accent); color: #fff; }
.quiz-cb-tile:focus-visible,
.quiz-cb-info:focus-visible .quiz-cb-info-dot,
.quiz-cb-word:focus-visible,
.quiz-cb-reading:focus-visible,
.quiz-cb-more-tick:focus-visible,
.quiz-cb-more-open:focus-visible { outline: 2px solid var(--cb-accent); outline-offset: 2px; }

/* the details panel, under the row */
.quiz-cb-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1.5px solid var(--cb-accent);
    border-radius: 14px;
    background: #f7f9fc;
}
.quiz-cb-panel-head { display: flex; align-items: flex-start; gap: 12px; }
.quiz-cb-panel-glyph { font-size: 40px; font-weight: 700; line-height: 1; color: #111827; }
.quiz-cb-panel-text { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.quiz-cb-panel-py { font-size: 16px; font-weight: 700; color: #1d4ed8; }
.quiz-cb-panel-full { margin: 0; padding-inline-start: 20px; font-size: 14px; line-height: 1.5; color: #374151; }
.quiz-cb-close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-inline-start: auto;
    border: 1px solid #c9cfda;
    border-radius: 10px;
    background: #fff;
    color: #1b2330;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.quiz-cb-panel-reading { display: flex; flex-direction: column; gap: 6px; }
.quiz-cb-panel-words-head { margin: 4px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #5b6472; }
.quiz-cb-panel-note { margin: 0; font-size: 13px; color: #4b5563; }
.quiz-cb-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.quiz-cb-word,
.quiz-cb-reading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1.5px solid #d5dae3;
    border-radius: 10px;
    background: #fafbfc;
    color: #6b7280;
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.quiz-cb-word.is-on,
.quiz-cb-reading.is-on { border-color: var(--cb-accent); background: #fff; color: #1b2330; }
.quiz-cb-word.is-dimmed { opacity: 0.6; }
.quiz-cb-reading { align-self: flex-start; }
.quiz-cb-word-zh { flex-shrink: 0; font-size: 17px; font-weight: 700; }
.quiz-cb-word-text { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.3; }
.quiz-cb-word-mean { overflow-wrap: anywhere; }

/* the "Show more" bar: its tick covers the hidden tiles, its button shows them */
.quiz-cb-more { display: flex; align-items: stretch; gap: 6px; }
.quiz-cb-more-tick,
.quiz-cb-more-open {
    min-height: 44px;
    border: 1px dashed #b4bccb;
    border-radius: 10px;
    background: #f7f9fc;
    cursor: pointer;
}
.quiz-cb-more-tick { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; padding: 0; }
.quiz-cb-more-open {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 0 12px;
    color: #1b2330;
    font: inherit;
    font-size: 13px;
    text-align: start;
}
.quiz-cb-more-words { font-size: 12px; font-weight: 600; color: var(--cb-accent); white-space: nowrap; }

@media (max-width: 600px) {
    .quiz-cb-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .decomp-hsk-row.quiz-cb-row { flex-direction: column; gap: 6px; }
    .quiz-cb-row-side { flex-direction: row; align-items: center; width: auto; }
    .quiz-cb-row-side .decomp-hsk-label { padding-top: 0; }
    .quiz-cb-row-body { width: 100%; }
    .quiz-cb-words { grid-template-columns: 1fr; }
    .quiz-cb-sum { gap: 2px 14px; }
    .quiz-cb-stat-n { font-size: 18px; }
    .quiz-cb-save { padding: 0 16px; }
    .quiz-cb-top { padding: 12px 10px 2px; }
    .decomp-part.quiz-cb-block { padding-left: 8px; }
    .decomp-tile.quiz-cb-tile { min-height: 124px; }
}

[dir="rtl"] .quiz-cb-tile > .quiz-cb-box { right: auto; left: 8px; }
[dir="rtl"] .quiz-cb-info { left: auto; right: 0; }

/* The builder links word_page.css for the dictionary's component display; on phones that file
   sets overflow-x: hidden on html AND body, which makes body a scroll container and breaks
   every position: sticky on the page (the site header, the summary bar). The viewport still
   clips sideways through html's own rule. */
@media (max-width: 700px) {
    body.quiz-section { overflow-x: visible; }
}

/* the words' HSK chips, and the details panel's words by HSK level */
.quiz-cb-word-levels { margin-top: 0; }
.quiz-cb-word-levels label[hidden] { display: none; }
.quiz-cb-wlevel { display: flex; flex-direction: column; gap: 6px; }
.quiz-cb-wlevel + .quiz-cb-wlevel { margin-top: 4px; }
.quiz-cb-wlevel-head { display: flex; align-items: center; gap: 10px; }
.quiz-cb-wlevel-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: #5b6472; }
.quiz-cb-wlevel-count { flex: 1 1 auto; font-size: 12px; color: #4b5563; }
.quiz-cb-wlevel-head .quiz-cb-btn { min-height: 36px; }
