/* The Questions panel as a full-screen grid of picture cards (Describe Image;
   js/questions-cards.js). The panel covers the window; inside it a header and
   a footer stay put, white against the cream the cards sit on, and only the
   cards between them scroll. Colours are the --picker-* tokens (main.css). */

practice-page-frame .questions-panel.questions-panel-cards {
    position: fixed;
    z-index: 50;
    inset: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--picker-cream);
    box-shadow: none;
    color: var(--picker-ink);
}

/* The panel hangs from the Task bar (45), whose column sits under the
   paused timer's row (50) and beside the Practice trigger (45). Full screen,
   the cards cover all of them, so both are lifted while the cards are open:
   the column on wide screens, and the bar itself where the column is
   `display: contents` and makes no stacking context. */
practice-page-frame .task-bar-column:has(.questions-panel-cards:not([hidden])),
practice-page-frame .task-bar:has(> .questions-panel-cards:not([hidden])) {
    z-index: 55;
}

practice-page-frame .questions-panel.questions-panel-cards:not([hidden]) {
    display: flex;
    flex-direction: column;
}

practice-page-frame .questions-panel-cards .questions-panel-cards-host {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

practice-page-frame .questions-panel-cards .questions-view-end {
    order: 2;
    margin-inline-start: 0;
}

practice-page-frame .questions-cards {
    position: relative;
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

practice-page-frame .questions-cards [hidden] {
    display: none;
}

/* -- The header ------------------------------------------------------- */

practice-page-frame .questions-cards-head {
    position: relative;
    z-index: 2;
    flex: none;
    padding: 6px 12px;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--picker-line), 0 6px 14px rgba(60, 40, 100, 0.06);
    container-type: inline-size;
}

/* Two parts. The top row is fixed: the heading, the search and the panel's
   close, pinned at the right (its place in the DOM stays last, after the zoom,
   so the Tab order is the search, chips, selects, zoom, close). Below it the
   chips, selects and zoom wrap onto as many rows as they need, so the header
   is never wider than the window (#1272). */
practice-page-frame .questions-cards-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 5px;
}

practice-page-frame .questions-cards-bar::after {
    order: 3;
    width: 100%;
    height: 0;
    content: "";
}

/* The heading never clips the Task's name: the name keeps its width (the
   heading's own least width), and the count after it is what gives way, to an
   ellipsis (#1272). */
practice-page-frame .questions-cards-bar > .questions-cards-heading {
    display: flex;
    flex: 1 1 0;
    order: 0;
    margin: 0;
    color: var(--chrome-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

practice-page-frame .questions-cards-heading-name {
    flex: none;
}

practice-page-frame .questions-cards-heading-count {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre;
}

practice-page-frame .questions-cards-bar > .questions-cards-search { order: 1; }
practice-page-frame .questions-cards-bar > :not(.questions-cards-heading, .questions-cards-search, .chrome-overlay-close, .questions-view-end) { order: 4; }

practice-page-frame .questions-cards-bar > *,
practice-page-frame .questions-cards-states,
practice-page-frame .questions-cards-selects,
practice-page-frame .questions-cards-zoom-group {
    flex: none;
}

practice-page-frame .questions-cards-spacer {
    flex: 1 1 0;
}

practice-page-frame .questions-cards-search {
    position: relative;
    display: flex;
    width: 196px;
    align-items: center;
    margin-right: 6px;
}

practice-page-frame .questions-cards-search-label {
    position: absolute;
    left: 10px;
    display: grid;
    color: var(--picker-muted);
    pointer-events: none;
}

practice-page-frame .questions-cards-search-icon {
    width: 14px;
    height: 14px;
}

practice-page-frame .questions-cards-search-input {
    width: 100%;
    height: 32px;
    box-sizing: border-box;
    padding: 0 28px 0 30px;
    border: 1px solid var(--picker-line);
    border-radius: var(--pill);
    margin: 0;
    background: var(--surface);
    color: var(--picker-ink);
    font-size: 13px;
    outline: none;
}

practice-page-frame .questions-cards-search-input::-webkit-search-cancel-button {
    appearance: none;
}

practice-page-frame .questions-cards-search-input:focus-visible,
practice-page-frame .questions-cards-search[data-active="true"] .questions-cards-search-input {
    border-color: var(--picker-purple);
}

practice-page-frame .questions-cards-search-clear {
    position: absolute;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--picker-muted);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

practice-page-frame .questions-cards-chip,
practice-page-frame .questions-cards-select {
    height: 32px;
    box-sizing: border-box;
    padding: 0 9px;
    border: 1px solid var(--picker-line);
    border-radius: var(--pill);
    margin: 0;
    background: var(--surface);
    color: var(--picker-ink);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

/* The header's and the sheet's controls wear the chrome's one focus ring
   (STYLE_GUIDE: 2px of --chrome-accent at a 3px offset). The panel-wide rule
   reaches the buttons; it does not reach a select, so this names them all. */
practice-page-frame :is(.questions-cards-chip, .questions-cards-select, .questions-cards-search-clear,
    .questions-cards-clear-filters, .questions-cards-filters, .questions-cards-sheet-close,
    .questions-cards-zoom-chip):focus-visible {
    outline: 2px solid var(--chrome-accent);
    outline-offset: 3px;
}

/* The state chips wear the colour of the cards they let through: done green,
   doing purple, All and Not done a neutral. */
practice-page-frame .questions-cards-states {
    display: inline-flex;
    gap: 2px;
}

practice-page-frame .questions-cards-state {
    --chip-line: var(--picker-neutral-line);
    --chip-wash: var(--picker-neutral-wash);
    --chip-text: var(--picker-neutral-text);
    border-color: color-mix(in srgb, var(--chip-line) 55%, var(--surface));
}

practice-page-frame .questions-cards-state[data-status="done"] {
    --chip-line: var(--picker-green);
    --chip-wash: var(--picker-done-wash);
    --chip-text: var(--picker-done-text);
}

practice-page-frame .questions-cards-state[data-status="doing"] {
    --chip-line: var(--picker-purple);
    --chip-wash: var(--picker-doing-wash);
    --chip-text: var(--picker-doing-text);
}

practice-page-frame .questions-cards-state:hover {
    border-color: var(--chip-line);
    background: var(--chip-wash);
}

practice-page-frame .questions-cards-state[aria-pressed="true"] {
    border-color: var(--chip-line);
    background: var(--chip-wash);
    box-shadow: 0 0 0 1px var(--chip-line);
    color: var(--chip-text);
    font-weight: 600;
}

practice-page-frame .questions-cards-vsep {
    width: 1px;
    height: 24px;
    margin: 0 1px;
    background: var(--picker-vsep);
}

practice-page-frame .questions-cards-selects {
    display: inline-flex;
    gap: 3px;
}

/* A chevron drawn from two gradients, so no image carries a colour. */
practice-page-frame .questions-cards-select {
    width: 84px;
    overflow: hidden;
    padding: 0 20px 0 9px;
    border-radius: 8px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--picker-muted) 50%),
        linear-gradient(135deg, var(--picker-muted) 50%, transparent 50%);
    background-position: right 11px center, right 7px center;
    background-repeat: no-repeat;
    background-size: 4px 4px, 4px 4px;
    font-size: 12.5px;
    text-overflow: ellipsis;
}

practice-page-frame .questions-cards-select[data-key="module"] {
    width: 92px;
}

practice-page-frame .questions-cards-select[data-key="difficulty"] {
    width: 94px;
}

/* The phone's Filters button: hidden until the phone block below. */
practice-page-frame .questions-cards-filters {
    display: none;
}

/* A Task's own selects (#1258) take the width of their names, at every tier. */
practice-page-frame .questions-cards-selects.is-own .questions-cards-select {
    width: auto;
    max-width: 160px;
}

practice-page-frame .questions-cards-select.is-active {
    border-color: var(--picker-purple);
    background-color: var(--picker-tint);
    color: var(--picker-purple);
}

practice-page-frame .questions-cards-zoom {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

practice-page-frame .questions-cards-zoom-label {
    color: var(--chrome-ink-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

practice-page-frame .questions-cards-zoom-group {
    display: inline-flex;
}

practice-page-frame .questions-cards-zoom-chip {
    display: inline-flex;
    min-width: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 0;
    line-height: 1;
}

practice-page-frame .questions-cards-zoom-chip + .questions-cards-zoom-chip {
    margin-left: -1px;
}

practice-page-frame .questions-cards-zoom-chip:first-child {
    border-radius: var(--pill) 0 0 var(--pill);
}

practice-page-frame .questions-cards-zoom-chip:last-child {
    border-radius: 0 var(--pill) var(--pill) 0;
}

practice-page-frame .questions-cards-zoom-chip[data-zoom="S"] { font-size: 11px; font-weight: 500; }
practice-page-frame .questions-cards-zoom-chip[data-zoom="M"] { font-size: 13px; font-weight: 600; }
practice-page-frame .questions-cards-zoom-chip[data-zoom="L"] { font-size: 16px; font-weight: 800; }

practice-page-frame .questions-cards-zoom-chip[aria-pressed="true"] {
    position: relative;
    z-index: 1;
    border-color: var(--picker-purple);
    background: var(--picker-purple);
    color: var(--surface);
}

practice-page-frame .questions-panel-cards .questions-cards-bar .chrome-overlay-close {
    width: 36px;
    min-width: 36px;
    height: 32px;
    min-height: 32px;
    flex: none;
    margin-left: 0;
    border-color: var(--chrome-line-control);
    background: var(--surface);
    color: var(--chrome-ink);
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

practice-page-frame .questions-panel-cards .questions-cards-bar .chrome-overlay-close:is(:hover, :focus-visible) {
    border-color: var(--chrome-ink);
    background: var(--chrome-line-soft);
    color: var(--chrome-ink);
}

/* The header gives way as it narrows: the search first, then the zoom's word
   and padding and the selects' width, and the rows below the top one wrap.
   Each select keeps its name in full (#1258). The 1040 / 940 / 820px tiers and the
   widths in them are the approved proto's (protos/di-picker-calendar r10). */
@container (max-width: 1040px) {
    practice-page-frame .questions-cards-search {
        width: 150px;
        margin-right: 2px;
    }
}

@container (max-width: 940px) {
    practice-page-frame .questions-cards-zoom-label {
        display: none;
    }

    practice-page-frame .questions-cards-zoom-chip {
        min-width: 24px;
        padding: 0 5px;
    }

    practice-page-frame .questions-cards-search {
        width: 120px;
    }

    practice-page-frame .questions-cards-select { width: 78px; }
    practice-page-frame .questions-cards-select[data-key="module"] { width: 84px; }
    practice-page-frame .questions-cards-select[data-key="difficulty"] { width: 88px; }
}

@container (max-width: 820px) {
    practice-page-frame .questions-cards-select { width: 92px; }
    practice-page-frame .questions-cards-select[data-key="module"] { width: 100px; }
    practice-page-frame .questions-cards-select[data-key="difficulty"] { width: 94px; }
}

/* -- The cards -------------------------------------------------------- */

practice-page-frame .questions-cards-body {
    position: relative;
    min-height: 0;
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
}

practice-page-frame .questions-cards-grid {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    gap: var(--gap-y);
    overflow-x: clip;
}

/* A band of a few rows (questions-cards.js, BAND_ROWS), laid out and painted
   only near the screen: drawing all 1,300+ pictures on every filter was most
   of the panel's cost. A skipped band clips to its padding box, so the side
   padding holds the links out of the first and last cards, and 12px above and
   below (taken back by the margins) holds the hover and NEXT glows. */
practice-page-frame .questions-cards-band {
    display: grid;
    padding: 12px 14px;
    margin: -12px 0;
    gap: var(--gap-y) var(--gap-x);
    /* --cols is the script's count (questions-cards.js columns), so the
       rows the links are drawn for are the rows laid out. */
    grid-template-columns: repeat(var(--cols, 1), minmax(var(--card-width), 1fr));
    content-visibility: auto;
}

practice-page-frame .questions-cards-empty {
    padding: 40px;
    margin: 0;
    color: var(--chrome-ink-muted);
}

practice-page-frame .questions-cards-empty-text {
    margin-right: 12px;
}

/* The note over a question a number found outside the filters. */
practice-page-frame .questions-cards-outside {
    padding: 10px 14px 0;
    margin: 0;
    color: var(--chrome-ink-muted);
    font-size: 13px;
}

/* Clear filters, in the header and the empty state: a quiet pill that reads as
   a link, so it never competes with the chips. */
practice-page-frame .questions-cards-clear-filters {
    height: 32px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--picker-line);
    border-radius: var(--pill);
    margin: 0;
    background: var(--surface);
    color: var(--chrome-ink);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

practice-page-frame .questions-cards-clear-filters:is(:hover, :focus-visible) {
    border-color: var(--picker-purple);
}

practice-page-frame .questions-card {
    position: relative;
    min-width: 0;
}

/* A card's button, before its card makes it a tile: what the retired
   Questions Table's rows wore, and every card still starts from (ADR-0174). */
practice-page-frame .questions-row {
    min-width: 40px;
    min-height: 32px;
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--chrome-ink);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-align: left;
}

practice-page-frame .questions-card .questions-row {
    position: relative;
    display: block;
    width: 100%;
    height: var(--thumb);
    box-sizing: border-box;
    padding: 0;
    border: 1px solid var(--picker-line);
    border-radius: 10px;
    margin: 0;
    background: var(--picker-thumb);
    color: var(--picker-ink);
    cursor: pointer;
    font: inherit;
    outline: none;
    text-align: left;
}

practice-page-frame .questions-card-img {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    inset: 0;
    object-fit: contain;
}

/* The number's own strip above a picture, so the badge never covers the chart's
   title or any of the image (#1277). It stays inside the card's height. */
practice-page-frame .questions-cards-grid[data-cell="image"] .questions-card-img {
    height: calc(100% - 20px);
    inset: 20px 0 0;
}

/* A captioned picture (Retell Lecture's lecture name) starts under the
   caption's line too, so the caption covers none of it. */
practice-page-frame .questions-cards-grid[data-cell="image"] .questions-row:has(.questions-card-caption) .questions-card-img {
    height: calc(100% - 37px);
    inset: 37px 0 0;
}

/* The state's wash over the picture. */
practice-page-frame .questions-card .questions-row::after {
    position: absolute;
    border-radius: 10px;
    content: "";
    inset: 0;
    pointer-events: none;
}

practice-page-frame .questions-card.st-done .questions-row {
    box-shadow: 0 0 0 2px var(--picker-green), 0 0 9px 1px rgba(47, 179, 106, 0.28);
}

practice-page-frame .questions-card.st-done .questions-row::after {
    background: rgba(47, 179, 106, 0.1);
}

/* Done, but under the Progress Store's strong line (70%): the weak score
   pill's tokens for the frame and the wash. */
practice-page-frame .questions-card.st-done-weak .questions-row {
    box-shadow: 0 0 0 2px var(--score-pill-weak-line), 0 0 9px 1px color-mix(in srgb, var(--score-pill-weak-line) 40%, transparent);
}

practice-page-frame .questions-card.st-done-weak .questions-row::after {
    background: color-mix(in srgb, var(--score-pill-weak-bg) 60%, transparent);
}

practice-page-frame .questions-card.st-doing .questions-row::after {
    background: rgba(124, 92, 191, 0.085);
}

practice-page-frame .questions-card.is-now .questions-row {
    box-shadow: 0 0 0 2.5px var(--picker-purple);
}

/* NEXT: a still ring, and a glow whose opacity pulses (the compositor's
   work, not a repaint). */
practice-page-frame .questions-card.is-next .questions-row {
    box-shadow: 0 0 0 2px rgba(244, 185, 66, 0.5);
}

practice-page-frame .questions-card.is-next .questions-row::before {
    position: absolute;
    border-radius: inherit;
    animation: questions-cards-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 1px rgba(244, 185, 66, 0.25), 0 0 12px 1px rgba(244, 185, 66, 0.45);
    content: "";
    inset: -1px;
    pointer-events: none;
    will-change: opacity;
}

@keyframes questions-cards-pulse {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    practice-page-frame .questions-card.is-next .questions-row::before {
        animation: none;
    }
}

practice-page-frame .questions-card .questions-row:hover,
practice-page-frame .questions-card .questions-row:focus-visible {
    z-index: 3;
    box-shadow: 0 0 0 2px var(--picker-hover), 0 4px 14px rgba(80, 50, 140, 0.25);
}

practice-page-frame .questions-card .questions-row:focus-visible {
    box-shadow: 0 0 0 2.5px var(--picker-purple), 0 4px 14px rgba(80, 50, 140, 0.25);
}

practice-page-frame .questions-card-id {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 5px;
    color: var(--picker-ink);
    font-size: 16.5px;
    font-weight: 800;
    line-height: 20px;
    text-shadow: 0 0 2px var(--surface), 0 0 3px var(--surface), 0 0 5px var(--surface), 0 0 7px var(--surface);
}

practice-page-frame .questions-card-id i {
    font-style: normal;
    font-weight: 400;
}

/* A picture's caption, its cell's head (Retell Lecture's lecture name, #1265):
   one line under the number, in its own strip above the picture, clear of NOW
   above and NEXT and the score below. */
practice-page-frame .questions-card-caption {
    position: absolute;
    z-index: 1;
    top: 21px;
    right: 5px;
    left: 5px;
    overflow: hidden;
    color: var(--picker-ink);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 2px var(--surface), 0 0 3px var(--surface), 0 0 5px var(--surface), 0 0 7px var(--surface);
}

practice-page-frame .questions-card-now {
    position: absolute;
    z-index: 1;
    top: 3px;
    right: 3px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--picker-purple);
    color: var(--surface);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 16px;
}

/* DOING: NOW's spot and shape, in the doing wash and ink (6.4:1). */
practice-page-frame .questions-card-doing {
    position: absolute;
    z-index: 1;
    top: 3px;
    right: 3px;
    padding: 0 6px;
    border: 1px solid var(--picker-doing-ring);
    border-radius: 8px;
    background: var(--picker-doing-wash);
    color: var(--picker-doing-text);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 14px;
}

practice-page-frame .questions-card-next {
    position: absolute;
    z-index: 1;
    bottom: 3px;
    left: 3px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--picker-next-wash);
    color: var(--picker-next-text);
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
}

practice-page-frame .questions-card-score {
    position: absolute;
    z-index: 1;
    right: 3px;
    bottom: 3px;
    display: flex;
    width: 23px;
    height: 23px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--surface);
    border-radius: 50%;
    color: var(--surface);
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* The links between consecutive done cards: across the gap to the right, and
   in from the left edge on the first card of the next row. One neutral colour
   whether the cards are done-strong or done-weak: the link says "done in a
   row", the frame says how it went (#1275). */
practice-page-frame .questions-card.cr::after,
practice-page-frame .questions-card.cl::before {
    position: absolute;
    z-index: 2;
    top: calc(50% - 3px);
    height: 6px;
    border-radius: 3px;
    background: var(--picker-link);
    content: "";
    opacity: 0.85;
    pointer-events: none;
}

practice-page-frame .questions-card.cr::after {
    left: 100%;
    width: var(--gap-x);
}

practice-page-frame .questions-card.cl::before {
    right: 100%;
    width: 10px;
}

/* A link into the item on screen, not done yet: broken. */
practice-page-frame .questions-card.cr.brk::after {
    background: linear-gradient(90deg, var(--picker-link) 0 30%, transparent 30% 70%, var(--picker-link) 70% 100%);
    opacity: 0.9;
}

practice-page-frame .questions-card.cl.brk::before {
    background: repeating-linear-gradient(90deg, var(--picker-link) 0 3px, transparent 3px 6px);
    opacity: 0.6;
}

/* -- The footer ------------------------------------------------------- */

practice-page-frame .questions-cards-foot {
    position: relative;
    z-index: 2;
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 14px;
    background: var(--surface);
    box-shadow: 0 -1px 0 var(--picker-line), 0 -6px 14px rgba(60, 40, 100, 0.06);
    font-size: 12.5px;
    gap: 4px 14px;
    line-height: 22px;
}

practice-page-frame .questions-cards-foot p {
    margin: 0;
}

practice-page-frame .questions-cards-status b,
practice-page-frame .questions-cards-meter b {
    font-weight: 600;
}

practice-page-frame .questions-cards-meter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

practice-page-frame .questions-cards-bar-track {
    display: block;
    width: 90px;
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--picker-pip);
}

practice-page-frame .questions-cards-bar-track i {
    display: block;
    height: 100%;
    background: var(--picker-green);
}

practice-page-frame .questions-cards-average {
    margin-left: auto !important;
    font-weight: 700;
    white-space: nowrap;
}

practice-page-frame .questions-cards-average-number {
    margin-left: 2px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

/* -- A phone ---------------------------------------------------------- */

/* 560px is the approved proto's phone breakpoint (protos/di-picker-calendar
   r10), held by PHONE_MAX in questions-cards.js. */

@media (max-width: 560px) {
    /* The close sits over the top row only, so the search ends that row
       short of it and the chips' row keeps the full width (#1278). */
    practice-page-frame .questions-cards-head {
        padding: 6px 10px;
    }

    /* The heading, the search and the close share the top row, and the chips
       and Filters the one below it: two rows over the cards (#1278). The close
       is pinned over the head's right padding, so the row is as tall as the
       close. The name wraps rather than clip, the count under it; where the
       name needs the row's height the count is what is hidden (#1272). */
    practice-page-frame .questions-cards-bar > .questions-cards-heading {
        min-width: 0;
        height: 44px;
        flex-direction: column;
        justify-content: safe center;
        overflow: hidden;
        white-space: normal;
    }

    practice-page-frame .questions-cards-heading-name {
        font-size: 13px;
        line-height: 14px;
    }

    practice-page-frame .questions-cards-heading-count {
        flex: none;
        color: var(--chrome-ink-muted);
        font-size: 11px;
        font-weight: 600;
        line-height: 13px;
        white-space: nowrap;
    }

    /* The count starts its own line, so it shows no " · " (kept for the
       panel's accessible name, which the heading gives). */
    practice-page-frame .questions-cards-heading-dot {
        font-size: 0;
    }

    practice-page-frame .questions-cards-search {
        width: auto;
        min-width: 108px;
        flex: 0 1 132px;
        margin: 0 50px 0 0;
    }

    practice-page-frame .questions-cards-search-input,
    practice-page-frame .questions-cards-chip,
    practice-page-frame .questions-cards-select {
        height: 44px;
    }

    practice-page-frame .questions-cards-state {
        flex: 1;
    }

    /* The status chips share their row with the Filters button (#1278). */
    practice-page-frame .questions-cards-states {
        min-width: 0;
        flex: 1 1 0;
    }

    practice-page-frame .questions-cards-filters:not([hidden]) {
        display: block;
        height: 44px;
        box-sizing: border-box;
        flex: none;
        padding: 0 14px;
        border: 1px solid var(--picker-line);
        border-radius: var(--radius);
        background: var(--surface);
        color: var(--chrome-ink);
        font: inherit;
        font-size: 12.5px;
        font-weight: 600;
    }

    /* The sheet holds the Clear filters; the header does not carry a second. */
    practice-page-frame .questions-cards-bar > .questions-cards-clear-filters {
        display: none;
    }

    practice-page-frame .questions-cards-vsep,
    practice-page-frame .questions-cards-spacer,
    practice-page-frame .questions-cards-zoom {
        display: none;
    }

    practice-page-frame .questions-panel-cards .questions-cards-bar .chrome-overlay-close {
        position: absolute;
        top: 6px;
        right: 10px;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        margin: 0;
    }

    practice-page-frame .questions-cards-search-clear {
        width: 36px;
        height: 36px;
    }

    practice-page-frame .questions-cards-foot {
        padding: 6px 12px;
        gap: 4px 8px;
    }

    practice-page-frame .questions-cards-bar-track {
        width: 50px;
    }
}

/* -- The phone's Filters sheet (#1278) ------------------------------------------
   A bottom sheet over the cards: the selects, one to a row, and Clear filters.
   Its layer takes no box, so only the backdrop and the sheet catch a tap. */

practice-page-frame .questions-cards-sheet-layer {
    display: contents;
}

practice-page-frame .questions-cards-sheet-backdrop {
    position: absolute;
    z-index: 20;
    inset: 0;
    background: var(--chrome-scrim);
}

practice-page-frame .questions-cards-sheet {
    position: absolute;
    z-index: 21;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    max-height: 80%;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    background: var(--surface);
    box-shadow: 0 -8px 24px rgba(60, 40, 100, 0.18);
}

practice-page-frame .questions-cards-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

practice-page-frame .questions-cards-sheet-title {
    margin: 0;
    color: var(--chrome-ink);
    font-size: 15px;
    font-weight: 700;
}

practice-page-frame .questions-cards-sheet-close {
    width: 44px;
    height: 44px;
    border: 0;
    margin: -6px -8px -6px 0;
    background: none;
    color: var(--chrome-ink);
    cursor: pointer;
    font: inherit;
    font-size: 18px;
}

practice-page-frame .questions-cards-sheet .questions-cards-selects {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 8px;
}

practice-page-frame .questions-cards-sheet .questions-cards-select,
practice-page-frame .questions-cards-sheet .questions-cards-selects.is-own .questions-cards-select {
    width: 100%;
    max-width: none;
    height: 44px;
}

practice-page-frame .questions-cards-sheet .questions-cards-clear-filters {
    height: 44px;
}

/* -- A Task's own cell (#1258) ---------------------------------------------------
   A Task with no picture draws what its declaration's cell says over a plain
   card: a text tile (a head, tags and meta) or a mini tile (a big value). The
   look is the owner's item-picker proto's. */
practice-page-frame .questions-cards-grid:not([data-cell="image"]) .questions-card .questions-row {
    overflow: hidden;
    background: var(--surface);
}

practice-page-frame .questions-card-cell {
    position: relative;
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    padding: 5px 7px;
    color: var(--picker-ink);
    pointer-events: none;
}

/* A mini tile keeps its fixed height and lays its cell over it. */
practice-page-frame .questions-card-cell.is-mini {
    position: absolute;
    inset: 0;
}

/* A text tile sizes to its content (#1277): no fixed height, and the cards of a
   row stretch to the tallest, so a row stays even. */
practice-page-frame .questions-cards-grid[data-cell="text"] .questions-card {
    display: flex;
}

practice-page-frame .questions-cards-grid[data-cell="text"] .questions-card .questions-row {
    display: flex;
    height: auto;
}

practice-page-frame .questions-cards-grid[data-cell="text"] .questions-card-cell {
    width: 100%;
    gap: 4px;
}

practice-page-frame .questions-card-top {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 6px;
}

practice-page-frame .questions-card-num {
    flex: none;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.05;
}

practice-page-frame .questions-card-num i {
    margin-right: 1px;
    font-size: 0.8em;
    font-style: normal;
    font-weight: 600;
    opacity: 0.55;
}

practice-page-frame .questions-card-kicker {
    min-width: 0;
    overflow: hidden;
    color: var(--chrome-ink-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

practice-page-frame .questions-card.is-now .questions-card-top {
    padding-right: 38px;
}

practice-page-frame .questions-card-head {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

/* Write Essay's prompt: up to three lines, ending in an ellipsis. */
practice-page-frame .questions-card-prompt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--chrome-ink-muted);
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

practice-page-frame .questions-card-tags {
    display: flex;
    min-height: 15px;
    flex-wrap: nowrap;
    gap: 3px;
    overflow: hidden;
}

practice-page-frame .questions-card-tag {
    max-width: 100%;
    flex: none;
    overflow: hidden;
    padding: 0 5px;
    border-radius: var(--radius-sm);
    background: var(--picker-tint);
    color: var(--chrome-ink-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The doing ink, not the brand purple: 10px text on the tint needs 4.5:1 (5.7). */
practice-page-frame .questions-card-tag.is-primary {
    color: var(--picker-doing-ink);
}

/* Small text takes the chrome's muted ink, as the table's does: --picker-muted
   is 4.3:1 on white, short of AA (#1258 gate). */
practice-page-frame .questions-card-meta {
    margin-top: auto;
    overflow: hidden;
    color: var(--chrome-ink-muted);
    font-size: 10.5px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

practice-page-frame .questions-card:has(.questions-card-score) .questions-card-meta {
    padding-right: 26px;
}

practice-page-frame .questions-card.is-next .questions-card-meta {
    padding-left: 44px;
}

practice-page-frame .questions-cards-grid[data-zoom="S"] .questions-card-cell { gap: 2px; padding: 4px 6px; }
practice-page-frame .questions-cards-grid[data-zoom="S"] .questions-card-num { font-size: 14px; }
practice-page-frame .questions-cards-grid[data-zoom="S"] .questions-card-head { font-size: 11px; }
practice-page-frame .questions-cards-grid[data-zoom="S"] .questions-card-tags { display: none; }
practice-page-frame .questions-cards-grid[data-zoom="S"] .questions-card-meta { font-size: 10px; }
practice-page-frame .questions-cards-grid[data-zoom="M"] .questions-card-head { font-size: 11.5px; }
practice-page-frame .questions-cards-grid[data-zoom="L"] .questions-card-head { -webkit-line-clamp: 3; font-size: 12.5px; }
practice-page-frame .questions-cards-grid[data-zoom="phone"] .questions-card-head { font-size: 11.5px; }

/* A mini tile: the id, decoration ticks, and its big value in the middle. */
practice-page-frame .questions-card-cell.is-mini .questions-card-big {
    margin: auto 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 750;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* No padding of its own: the score's and NEXT's clearance above still applies. */
practice-page-frame .questions-card-cell.is-mini .questions-card-meta {
    margin-top: 0;
    text-align: center;
}

practice-page-frame .questions-cards-grid[data-zoom="S"] .questions-card-cell.is-mini .questions-card-big { font-size: 14px; }

/* A mini tile's one tag, centred under its big value (js MINI_TAG_ROW is its row). */
practice-page-frame .questions-card-cell.is-mini .questions-card-tags {
    flex: none;
    justify-content: center;
}

practice-page-frame .questions-card-ticks {
    display: flex;
    height: 12px;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    margin-top: auto;
}

practice-page-frame .questions-card-ticks i {
    width: 3px;
    height: 100%;
    border-radius: 1px;
    background: var(--picker-line);
}

practice-page-frame .questions-card-ticks + .questions-card-big {
    margin-top: 4px;
    margin-bottom: auto;
}

/* On a phone a text tile's kicker and tags wrap instead of being cut (#1277). */
practice-page-frame .questions-cards-grid[data-zoom="phone"][data-cell="text"] .questions-card-top {
    flex-wrap: wrap;
    row-gap: 0;
}

practice-page-frame .questions-cards-grid[data-zoom="phone"][data-cell="text"] .questions-card-kicker {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

practice-page-frame .questions-cards-grid[data-zoom="phone"][data-cell="text"] .questions-card-tags {
    flex-wrap: wrap;
}

practice-page-frame .questions-cards-grid[data-zoom="phone"][data-cell="text"] .questions-card-tag {
    flex: 0 1 auto;
    white-space: normal;
}
