/* Hallmark · genre: editorial · macrostructure: Index-First (public) + Workbench (admin)
 * theme: Almanac · axes: light paper / roman-serif display / warm accent
 * nav: N6 Newspaper masthead · footer: Ft1 Mast-headed · enrichment: none (typography only)
 * design-system: design.md · designed-as-app
 * tone: a printed register — a repertory programme, not a dashboard
 * pre-emit critique: P5 H5 E5 S5 R5 V4
 * slop test: 58 / 58 · contrast: pass (40–41), verified in-browser
 * mobile: verified 320 / 375 / 414 / 768 — no horizontal scroll
 *
 * Tokens live in css/tokens.css. Every colour and font here is a var() —
 * no inline hex, no inline oklch, no bare font-family.
 */

/* ==================================================================
   Base
   ================================================================== */

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    margin: 0;
    background: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    font-variant-numeric: oldstyle-nums;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: normal;
    color: var(--color-ink-strong);
    letter-spacing: var(--tracking-display);
    line-height: 1.15;
    overflow-wrap: anywhere;
    min-width: 0;
    margin: 0;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p { margin: 0; }

a {
    color: var(--color-accent);
    text-decoration-thickness: var(--rule-hair);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration-thickness: var(--rule-firm);
}

:focus-visible {
    outline: var(--rule-firm) solid var(--color-focus);
    outline-offset: 3px;
    /* Never transitioned — the ring must be there the instant focus lands. */
}

::selection {
    background: var(--color-accent-soft);
    color: var(--color-ink-strong);
}

img {
    max-width: 100%;
    display: block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Shared label voice: uppercase, tracked, body face. The mono outlier is
   reserved for recorded figures alone — labels are not figures. */
.label,
th,
.field__label,
.site-notice__label,
.entry__label,
.modal__label,
.score-card__total-label,
.score-grid label > span,
.form label,
.colophon__meta,
.masthead__moderator,
.logout-link {
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-neutral);
}

/* The dateline IS a recorded figure — it stays mono. */
.masthead__dateline {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: 400;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-neutral);
}

/* ==================================================================
   One orchestrated entrance. Nothing reveals on scroll.
   ================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(6px);
    animation: reveal var(--dur-long) var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes reveal {
    to { opacity: 1; transform: none; }
}

/* ==================================================================
   Masthead — N6 newspaper masthead
   ================================================================== */

.masthead {
    position: relative;
    border-bottom: var(--rule-firm) solid var(--color-ink-strong);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    background: var(--color-paper);
}

.masthead::after {
    /* The second half of the double rule. */
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: calc(var(--rule-firm) * -1 - 3px);
    height: var(--rule-hair);
    background: var(--color-rule-firm);
}

.masthead__inner {
    max-width: var(--page-max);
    margin-inline: auto;
    text-align: center;
}

.masthead__dateline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-md);
}

.masthead__wordmark {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-display);
    line-height: 1.05;
    letter-spacing: var(--tracking-display);
    color: var(--color-ink-strong);
    text-decoration: none;
    overflow-wrap: anywhere;
    min-width: 0;
}

.masthead__wordmark:hover {
    color: var(--color-accent);
}

.masthead__standfirst {
    max-width: 52ch;
    margin: var(--space-md) auto 0;
    font-size: var(--text-md);
    color: var(--color-muted);
    text-wrap: pretty;
}

.masthead__note {
    margin-top: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--color-neutral);
}

/* In flow on narrow screens so it can't land on top of a wrapped dateline;
   pinned to the corner once there's room. */
.masthead__moderator {
    display: block;
    width: fit-content;
    margin-inline-start: auto;
    margin-bottom: var(--space-sm);
    color: var(--color-neutral);
    text-decoration: none;
    border-bottom: var(--rule-hair) solid var(--color-rule);
    padding-bottom: var(--space-3xs);
    white-space: nowrap;
    transition: color var(--dur-micro) var(--ease-out),
                border-color var(--dur-micro) var(--ease-out);
}

.masthead__moderator:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Condensed variant — admin and login wear the same identity, quieter. */
.masthead--condensed {
    padding-block: var(--space-md) var(--space-sm);
}

.masthead--condensed .masthead__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm) var(--space-lg);
    text-align: start;
}

.masthead--condensed .masthead__wordmark {
    font-size: var(--text-xl);
}

.masthead--condensed .masthead__dateline {
    margin: 0;
    justify-content: flex-start;
}

/* ==================================================================
   Site notice — the moderator's one message, above the register
   ================================================================== */

/* Aligned to the page, and clear of the masthead's double rule. main's own
   top padding carries the gap below it, so the register keeps its rhythm. */
.site-notice {
    max-width: var(--page-max);
    margin: var(--space-lg) auto 0;
    padding-inline: var(--space-md);
}

/* A slip pasted onto the paper, not a coloured alert: paper-2 and a hairline,
   with the accent doing what it does everywhere else here — marking, in a
   2px edge, and nothing more. */
.site-notice__inner {
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-inline-start: var(--rule-firm) solid var(--color-accent);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
}

.site-notice[hidden] {
    display: none;
}

/* The label and the close sit on one row, so no message length can ever run
   underneath the icon — the corner belongs to the button alone. */
.site-notice__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-2xs);
}

/* Tertiary voice: no box, no border. The negative margins pull the icon out
   into the padding so it reads as the corner, not as a row of its own. */
.site-notice__close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: calc(var(--space-2xs) * -1) calc(var(--space-xs) * -1)
            calc(var(--space-2xs) * -1) 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-neutral);
    cursor: pointer;
    outline: var(--rule-firm) solid transparent;
    outline-offset: 1px;
    transition: color var(--dur-micro) var(--ease-out);
}

.site-notice__close:hover {
    color: var(--color-accent);
}

/* Focus rings appear instantly — never transitioned. */
.site-notice__close:focus-visible {
    outline-color: var(--color-focus);
}

.site-notice__close svg {
    width: 0.75rem;
    height: 0.75rem;
}

.site-notice__message {
    max-width: var(--measure);
    color: var(--color-ink);
    /* The moderator's own line breaks survive; nothing else does. */
    white-space: pre-line;
    text-wrap: pretty;
}

/* ==================================================================
   Page shell
   ================================================================== */

/* The register runs wider than the default measure: the tables need the room,
   and masthead/colophon widen with them so the page stays aligned. */
.page-home {
    --page-max: 100rem;
}

main {
    display: block;
    max-width: var(--page-max);
    margin-inline: auto;
    padding-inline: var(--space-md);
    padding-block: var(--space-xl) var(--space-2xl);
}

/* Section heads stack vertically, single column, left-flush. */
.section-head {
    margin-bottom: var(--space-lg);
}

.section-head__title {
    font-size: var(--text-xl);
}

.section-head__note {
    max-width: var(--measure);
    margin-top: var(--space-xs);
    color: var(--color-muted);
    text-wrap: pretty;
}

/* Deliberately uneven rhythm: the register breathes above, closes tight;
   the suggestion panel does the reverse. */
.register {
    padding-block: var(--space-xs) var(--space-lg);
}

.suggest {
    padding-block: var(--space-2xl) var(--space-md);
    border-top: var(--rule-hair) solid var(--color-rule);
}

/* ==================================================================
   Register filter — one field over both ledgers
   ================================================================== */

.register-filter {
    margin-bottom: var(--space-lg);
}

.register-filter__field {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 34rem;
}

.register-filter__icon {
    position: absolute;
    inset-inline-start: var(--space-sm);
    width: 1rem;
    height: 1rem;
    color: var(--color-neutral);
    pointer-events: none;
}

/* Room at the start for the glass, at the end for the clear button. The two
   classes are deliberate: the shared input[type="search"] padding outweighs
   one class on its own. */
.register-filter__field .register-filter__input {
    padding-inline-start: var(--space-xl);
    padding-inline-end: var(--space-xl);
}

/* The UA's own clear affordance would sit beside ours. */
.register-filter__input::-webkit-search-cancel-button,
.register-filter__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.register-filter__clear {
    position: absolute;
    inset-inline-end: var(--space-2xs);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    min-height: 0;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-neutral);
    cursor: pointer;
    transition: color var(--dur-micro) var(--ease-out);
}

.register-filter__clear:hover {
    background: none;
    color: var(--color-ink-strong);
}

.register-filter__clear svg {
    width: 0.75rem;
    height: 0.75rem;
}

.register-filter__count {
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--color-neutral);
}

.register-filter__count:empty {
    display: none;
}

/* ==================================================================
   Tabs — the register's two ledgers
   ================================================================== */

.dashboard-tabs {
    position: relative;
}

.dashboard-tabs__header {
    position: relative;
    display: flex;
    gap: var(--space-lg);
    border-bottom: var(--rule-hair) solid var(--color-rule);
    margin-bottom: var(--space-lg);
}

.dashboard-tabs__tab {
    appearance: none;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 var(--space-sm);
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: var(--tracking-display);
    color: var(--color-neutral);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur-short) var(--ease-out);
}

.dashboard-tabs__tab:hover {
    color: var(--color-ink);
}

.dashboard-tabs__tab.is-active {
    color: var(--color-ink-strong);
}

.dashboard-tabs__indicator {
    position: absolute;
    bottom: calc(var(--rule-hair) * -1);
    inset-inline-start: 0;
    height: var(--rule-firm);
    width: 0;
    background: var(--color-accent);
    /* Transform only — animating `width` is a layout-property animation. */
    transition: transform var(--dur-short) var(--ease-out);
}

.dashboard-tabs__panels {
    position: relative;
}

/* Mobile base: panels stack in place and slide; JS drives the inline
   transform/opacity and the container height at (max-width: 768px). */
.dashboard-tabs__panel {
    display: block;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    transition: transform var(--dur-short) var(--ease-out),
                opacity var(--dur-short) var(--ease-out);
}

/* ==================================================================
   The register table
   ================================================================== */

.table-container {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-variant-numeric: tabular-nums;
}

thead th {
    position: sticky;
    top: 0;
    z-index: var(--z-base);
    background: var(--color-paper);
    text-align: start;
    padding: var(--space-xs) var(--space-sm);
    border-bottom: var(--rule-firm) solid var(--color-ink-strong);
    white-space: nowrap;
}

tbody td {
    padding: var(--space-sm);
    border-bottom: var(--rule-hair) solid var(--color-rule);
    vertical-align: top;
    color: var(--color-ink);
    font-size: var(--text-sm);
}

/* No zebra striping — hairlines carry the rhythm. */
tbody tr {
    transition: background-color var(--dur-micro) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    tbody tr:hover {
        background: var(--color-paper-2);
    }
}

.sortable-column {
    cursor: pointer;
    user-select: none;
    transition: color var(--dur-micro) var(--ease-out);
}

.sortable-column:hover {
    color: var(--color-ink-strong);
}

.sortable-column::after {
    content: '·';
    margin-inline-start: var(--space-2xs);
    color: var(--color-rule-firm);
}

.sortable-column.is-sort-active {
    color: var(--color-accent);
}

.sortable-column.is-sort-active::after {
    content: '↑';
    color: var(--color-accent);
}

.sortable-column.is-sort-active.is-sort-desc::after {
    content: '↓';
}

/* Title reads as the entry's name, not as another data cell. */
tbody td[data-label="Title"] {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--color-ink-strong);
    letter-spacing: var(--tracking-display);
    min-width: 14ch;
}

/* Recorded figures wear the mono outlier. */
tbody td[data-label="Rank"],
tbody td[data-label="Year"],
tbody td[data-label="Duration"],
tbody td[data-label="Watched On"],
tbody td[data-label="Suggested On"] {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-muted);
    white-space: nowrap;
}

tbody td[data-label="Rank"] {
    color: var(--color-neutral);
}

tbody td[data-label="Genre"],
tbody td[data-label="Brief Review"] {
    color: var(--color-muted);
}

tbody td[data-label="Genre"] {
    min-width: 13ch;
}

tbody td[data-label="Brief Review"] {
    min-width: 22ch;
    max-width: 34ch;
    text-wrap: pretty;
}

/* A review can embed a GIF; it sits under the copy and keeps to the column. */
.review-embed {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: var(--space-2xs);
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
}

tbody td[data-label="Suggested By"] {
    color: var(--color-ink);
    white-space: nowrap;
}

.loading-row td,
.message-row td {
    text-align: center;
    border-bottom: 0;
}

.message-row td {
    padding-block: var(--space-2xl);
    color: var(--color-neutral);
}

/* ==================================================================
   Posters — real content, framed like plates in a programme
   ================================================================== */

.poster-cell {
    width: 4.5rem;
}

.poster,
.poster-placeholder {
    width: 3.5rem;
    height: 5.25rem;
    object-fit: cover;
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
}

/* ==================================================================
   Score — numeral first, meter second, colour third
   ================================================================== */

.score-cell {
    width: 7rem;
}

/* Flat by design: a table cell is already a container. No card in a card. */
.score-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    background: none;
    border: 0;
    padding: 0;
    box-shadow: none;
    --score-accent: var(--color-band-good);
}

.score-card[data-score-band="great"] { --score-accent: var(--color-band-great); }
.score-card[data-score-band="good"]  { --score-accent: var(--color-band-good); }
.score-card[data-score-band="fair"]  { --score-accent: var(--color-band-fair); }
.score-card[data-score-band="weak"]  { --score-accent: var(--color-band-weak); }

.score-card__total {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    background: none;
    padding: 0;
}

.score-card__total-label {
    color: var(--color-neutral);
}

.score-card__total-score {
    display: flex;
    align-items: baseline;
    gap: 0.1em;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.score-card__total-value {
    font-size: var(--text-xl);
    font-weight: 500;
    line-height: 1;
    color: var(--score-accent);
}

.score-card__total-max {
    font-size: var(--text-xs);
    color: var(--color-neutral);
}

.score-card__meter {
    height: 3px;
    width: 100%;
    background: var(--color-rule);
    border-radius: 0;
    overflow: hidden;
}

.score-card__meter-fill {
    display: block;
    height: 100%;
    background: var(--score-accent);
}

/* ==================================================================
   Agreeability — the readers' verdict, read and given in one cell
   ================================================================== */

.agree-cell {
    width: 11.5rem;
}

/* Flat, like the score cell beside it: the table cell is the container. */
.agree {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    --score-accent: var(--color-neutral);
}

.agree__reading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-xs);
}

.agree[data-score-band="great"] { --score-accent: var(--color-band-great); }
.agree[data-score-band="good"]  { --score-accent: var(--color-band-good); }
.agree[data-score-band="fair"]  { --score-accent: var(--color-band-fair); }
.agree[data-score-band="weak"]  { --score-accent: var(--color-band-weak); }

.agree__value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-xl);
    font-weight: 500;
    line-height: 1;
    color: var(--score-accent);
    white-space: nowrap;
}

/* No votes is not zero per cent. It is an en dash and a plain count. */
.agree__value--empty {
    color: var(--color-rule-firm);
}

.agree__unit {
    margin-inline-start: 0.1em;
    font-size: var(--text-xs);
    color: var(--color-neutral);
}

.agree__count {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--color-neutral);
    white-space: nowrap;
}

.agree__meter {
    height: 3px;
    width: 100%;
    background: var(--color-rule);
    overflow: hidden;
}

.agree__meter-fill {
    display: block;
    height: 100%;
    background: var(--score-accent);
}

/* The scale itself. Five steps, evenly weighted, in the order they are worded:
   strongest agreement on the left, strongest disagreement on the right. */
.agree__options {
    display: flex;
    gap: var(--space-3xs);
    margin-top: var(--space-3xs);
}

.agree-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 1.75rem;
    max-width: 2.5rem;
    height: 1.75rem;
    padding: 0;
    border: var(--rule-hair) solid transparent;
    border-radius: var(--radius-input);
    background: none;
    color: var(--color-neutral);
    cursor: pointer;
    transition: color var(--dur-micro) var(--ease-out),
                border-color var(--dur-micro) var(--ease-out),
                background-color var(--dur-micro) var(--ease-out);
}

.agree-option svg {
    width: 1.125rem;
    height: 1.125rem;
}

@media (hover: hover) and (pointer: fine) {
    .agree-option:hover:not(:disabled) {
        color: var(--color-ink-strong);
        border-color: var(--color-rule-firm);
    }
}

/* The reader's own answer is the one thing in this cell worth the accent. */
.agree-option[aria-pressed="true"] {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.agree-option:disabled {
    cursor: progress;
    opacity: 0.55;
}

.agree-cell[aria-busy] .agree__meter-fill {
    opacity: 0.5;
}

/* ==================================================================
   Tooltips — 800 ms on hover, immediate on focus
   ================================================================== */

[data-tip] {
    position: relative;
}

[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + var(--space-3xs));
    inset-inline-end: 0;
    z-index: var(--z-tooltip);
    width: max-content;
    max-width: 13rem;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
    background: var(--color-ink-strong);
    color: var(--color-paper);
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    text-align: start;
    text-wrap: pretty;
    opacity: 0;
    transform: translateY(var(--space-3xs));
    pointer-events: none;
    transition: opacity var(--dur-micro) var(--ease-out),
                transform var(--dur-micro) var(--ease-out);
}

/* Keyboard first: a focused control explains itself at once. */
[data-tip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

@media (hover: hover) and (pointer: fine) {
    [data-tip]:hover::after {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 800ms;
    }
}

/* ==================================================================
   Buttons and form controls — one voice everywhere
   ================================================================== */

.button,
.login-button,
.search-section button,
.score-form button,
.modal-content button,
.spin-wheel__button,
.form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border: var(--rule-hair) solid var(--color-accent);
    border-radius: var(--radius-input);
    background: var(--color-paper);
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--dur-micro) var(--ease-out),
                color var(--dur-micro) var(--ease-out),
                transform var(--dur-micro) var(--ease-out);
}

.button:hover,
.login-button:hover,
.search-section button:hover,
.score-form button:hover,
.modal-content button:hover,
.spin-wheel__button:hover,
.form button:hover {
    background: var(--color-accent);
    color: var(--color-accent-ink);
}

.button:active,
.login-button:active,
.search-section button:active,
.score-form button:active,
.modal-content button:active,
.spin-wheel__button:active,
.form button:active {
    transform: translateY(1px);
}

.button:disabled,
.search-section button:disabled,
.score-form button:disabled,
.modal-content button:disabled,
.spin-wheel__button:disabled,
.form button:disabled {
    border-color: var(--color-rule-firm);
    background: var(--color-paper-2);
    color: var(--color-neutral);
    cursor: not-allowed;
    transform: none;
}

/* Secondary voice — typographic, no box. */
.button--secondary,
.form button[type="button"] {
    border-color: transparent;
    background: none;
    color: var(--color-muted);
    padding-inline: 0;
    text-decoration: underline;
    text-decoration-thickness: var(--rule-hair);
    text-underline-offset: 0.25em;
}

.button--secondary:hover,
.form button[type="button"]:hover {
    background: none;
    color: var(--color-accent);
    text-decoration-thickness: var(--rule-firm);
}

.button--danger,
.delete-form .button--danger {
    border-color: transparent;
    background: none;
    color: var(--color-band-weak);
    padding-inline: 0;
    text-decoration: underline;
    text-decoration-thickness: var(--rule-hair);
    text-underline-offset: 0.25em;
}

.button--danger:hover,
.delete-form .button--danger:hover {
    background: none;
    color: var(--color-band-weak);
    text-decoration-thickness: var(--rule-firm);
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: var(--space-sm);
    /* Border-width never changes between states — only its colour does. */
    border: var(--rule-hair) solid var(--color-field-border);
    border-radius: var(--radius-input);
    outline: var(--rule-firm) solid transparent;
    outline-offset: 1px;
    background: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.4;
    transition: border-color var(--dur-micro) var(--ease-out),
                background-color var(--dur-micro) var(--ease-out);
}

input:focus-visible,
textarea:focus-visible {
    outline-color: var(--color-focus);
    border-color: var(--color-ink);
}

input:disabled,
textarea:disabled {
    background: var(--color-paper-2);
    border-color: var(--color-rule);
    color: var(--color-neutral);
    opacity: 0.55;
    cursor: not-allowed;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--color-band-weak);
    background: var(--color-accent-soft);
}

input[type="number"],
input[type="date"] {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

input:hover,
textarea:hover {
    border-color: var(--color-muted);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-neutral);
}

textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.logout-link {
    color: var(--color-muted);
    text-decoration: none;
    border-bottom: var(--rule-hair) solid var(--color-rule);
    padding-bottom: var(--space-3xs);
    white-space: nowrap;
}

.logout-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ==================================================================
   Alerts and the toast
   ================================================================== */

.alert {
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-input);
    background: var(--color-paper-2);
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.alert--success {
    border-color: var(--color-band-great);
}

.alert--error {
    border-color: var(--color-band-weak);
    color: var(--color-ink-strong);
}

.notification {
    position: fixed;
    top: var(--space-md);
    left: 50%;
    transform: translate(-50%, -8px);
    z-index: var(--z-toast);
    max-width: min(30rem, calc(100% - var(--space-lg)));
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hair) solid var(--color-ink-strong);
    border-radius: var(--radius-input);
    background: var(--color-paper);
    color: var(--color-ink-strong);
    box-shadow: var(--shadow-raised);
    font-size: var(--text-sm);
    text-align: start;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity var(--dur-short) var(--ease-out),
                transform var(--dur-short) var(--ease-out);
}

.notification--visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.notification--success { border-color: var(--color-band-great); }
.notification--error   { border-color: var(--color-band-weak); }
.notification--info    { border-color: var(--color-rule-firm); }

/* ==================================================================
   Loader — functional motion, keeps running under reduced-motion
   ================================================================== */

.loader {
    width: 1.75rem;
    height: 1.75rem;
    margin: var(--space-lg) auto;
    border: var(--rule-firm) solid var(--color-rule);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.loader--inline {
    width: 1.125rem;
    height: 1.125rem;
    margin: var(--space-sm) auto;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.empty-state {
    padding: var(--space-lg) 0;
    color: var(--color-neutral);
    font-size: var(--text-sm);
}

/* ==================================================================
   Suggestion panel — search, results, modal
   ================================================================== */

.search-section {
    margin: 0;
    text-align: start;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: stretch;
    max-width: 34rem;
}

.search-section input {
    flex: 1 1 14rem;
    min-width: 0;
}

/* One height across the row — a 38px input beside a 44px button is the tell. */
.search-section button {
    min-height: 2.75rem;
}

.search-hint {
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--color-neutral);
}

.movie-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.movie-results:empty {
    margin-top: 0;
}

.search-note {
    grid-column: 1 / -1;
    padding-block: var(--space-md);
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.movie-card {
    position: relative;
    width: 100%;
    background: none;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    transition: transform var(--dur-short) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .movie-card:hover {
        transform: translateY(-2px);
    }
}

.movie-card .image-container {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-card .info {
    position: static;
    width: 100%;
    padding: var(--space-xs) 0 0;
    background: none;
}

.movie-card .info h3 {
    margin: 0;
    font-size: var(--text-base);
    color: var(--color-ink-strong);
    text-wrap: pretty;
}

.movie-card .info p {
    margin-top: var(--space-3xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--color-neutral);
}

/* Fade the plate, not the label — the label still has to be readable. */
.movie-card--disabled {
    cursor: not-allowed;
}

.movie-card--disabled .image-container {
    filter: grayscale(1);
    opacity: 0.5;
}

.movie-card--disabled .info h3,
.movie-card--disabled .info p {
    color: var(--color-neutral);
}

.movie-card--disabled:hover {
    transform: none;
}

.movie-card__overlay {
    position: absolute;
    inset: 0 0 auto;
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);
    background: var(--color-scrim);
    color: var(--color-accent-ink);
    border-radius: var(--radius-sm);
    text-shadow: 0 1px 2px var(--color-scrim);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    text-align: center;
}

/* ---- Modal ---- */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: var(--color-scrim);
}

.modal-content {
    width: 100%;
    max-width: 26rem;
    max-height: 88dvh;
    overflow-y: auto;
    padding: var(--space-lg);
    border: var(--rule-hair) solid var(--color-ink-strong);
    border-radius: var(--radius-md);
    background: var(--color-paper);
    text-align: start;
    box-shadow: var(--shadow-raised);
    animation: modal-in var(--dur-long) var(--ease-out);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.modal-content img {
    width: 5rem;
    height: 7.5rem;
    object-fit: cover;
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.modal-content h2 {
    font-size: var(--text-lg);
    color: var(--color-ink-strong);
    text-wrap: pretty;
}

.modal-content > p {
    margin-top: var(--space-2xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--color-neutral);
}

.modal__label {
    display: block;
    margin-top: var(--space-lg);
    color: var(--color-neutral);
}

.modal-content input {
    margin-top: var(--space-2xs);
}

.modal-content button {
    width: 100%;
    margin-top: var(--space-md);
}

.modal__notify {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    color: var(--color-ink);
    cursor: pointer;
}

.modal__notify input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0.2rem 0 0;
    flex: none;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.modal__notify label {
    cursor: pointer;
    line-height: 1.4;
}

.modal__field {
    margin-top: var(--space-xs);
}

/* The reason sits next to the field it asks about. */
.modal__privacy {
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--color-neutral);
}

/* ==================================================================
   Sealed films — newly scored, covered until the reader reveals them
   ================================================================== */

/* Sits above the search, closed off from the register by a hairline, so the
   register itself reads exactly as it does for someone with nothing new. */
.sealed {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: var(--rule-hair) solid var(--color-rule);
}

.sealed[hidden] {
    display: none;
}

.sealed__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2xs) var(--space-md);
}

.sealed__title {
    font-size: var(--text-lg);
}

.sealed__all {
    padding-block: 0;
}

.sealed__note {
    max-width: var(--measure);
    margin-top: var(--space-2xs);
    font-size: var(--text-sm);
    color: var(--color-muted);
    text-wrap: pretty;
}

.sealed__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: var(--space-sm);
    margin: var(--space-md) 0 0;
    padding: 0;
    list-style: none;
}

/* The same slip as the site notice: paper-2, a hairline, the accent as an edge. */
.sealed-film {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-inline-start: var(--rule-firm) solid var(--color-accent);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
    overflow: hidden;
}

/* A register row seen through frosted glass. Shapes only — the page holds
   nothing about the film until it is revealed. */
.sealed-film__cover {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    filter: blur(3px);
    user-select: none;
    pointer-events: none;
}

.sealed-film__poster {
    flex: none;
    width: 2.25rem;
    height: 3.25rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(160deg, var(--color-rule-firm), var(--color-muted));
}

.sealed-film__lines {
    flex: 1 1 auto;
    display: grid;
    gap: var(--space-xs);
}

.sealed-film__line {
    display: block;
    height: 0.5rem;
    border-radius: 1px;
    background: var(--color-rule-firm);
}

.sealed-film__line:first-child {
    height: 0.75rem;
    background: var(--color-muted);
}

.sealed-film__score {
    flex: none;
    width: 2.25rem;
    height: 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-band-fair);
}

.sealed-film__body {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-xs);
}

.sealed-film__label {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-neutral);
    white-space: nowrap;
}

.sealed-film__reveal {
    padding: var(--space-xs) var(--space-md);
}

/* The reveal dialog borrows the suggestion modal; these are its extra voices. */
.modal-content .modal__lead {
    margin-top: var(--space-xs);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-muted);
    text-wrap: pretty;
}

.modal-content .button--secondary {
    margin-top: var(--space-xs);
    border-color: transparent;
    background: none;
    color: var(--color-muted);
    text-decoration: underline;
    text-decoration-thickness: var(--rule-hair);
    text-underline-offset: 0.25em;
}

.modal-content .button--secondary:hover {
    background: none;
    color: var(--color-accent);
    text-decoration-thickness: var(--rule-firm);
}

.modal-content .reveal-result {
    display: flex;
    align-items: baseline;
    gap: var(--space-2xs);
    margin-top: var(--space-sm);
    padding-block: var(--space-sm);
    border-block: var(--rule-hair) solid var(--color-rule);
}

.reveal-result[data-score-band="great"] { --score-accent: var(--color-band-great); }
.reveal-result[data-score-band="good"]  { --score-accent: var(--color-band-good); }
.reveal-result[data-score-band="fair"]  { --score-accent: var(--color-band-fair); }
.reveal-result[data-score-band="weak"]  { --score-accent: var(--color-band-weak); }

.modal-content .reveal-result__value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    line-height: 1;
    color: var(--score-accent, var(--color-ink-strong));
}

.reveal-result__max {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-neutral);
}

.modal-content .reveal-verdict {
    margin-top: var(--space-sm);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-ink-strong);
}

.reveal-review {
    margin-top: var(--space-sm);
    padding-inline-start: var(--space-sm);
    border-inline-start: var(--rule-firm) solid var(--color-rule-firm);
    font-size: var(--text-sm);
    color: var(--color-ink);
}

.modal-content .reveal-review img {
    width: auto;
    height: auto;
    max-width: 100%;
    margin: var(--space-xs) 0 0;
}

.modal-content .reveal-number {
    margin: 0 0 var(--space-2xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-neutral);
}

/* The register's rating control, brought into the dialog. */
.reveal-agree {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: var(--rule-hair) solid var(--color-rule);
}

.modal-content .reveal-agree__prompt {
    margin: 0 0 var(--space-xs);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.reveal-agree__cell {
    width: 100%;
    padding: 0;
}

/* The dialog styles its own buttons: full width, padded, accent-bordered. The
   rating icons are not that kind of button, so they keep the shape they have
   in the register. */
.modal-content .agree-option {
    width: auto;
    height: 1.75rem;
    margin-top: 0;
    padding: 0;
    border-color: transparent;
    background: none;
    color: var(--color-neutral);
}

/* The shared line, shown as it will be pasted. */
.reveal-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs) var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: var(--rule-hair) solid var(--color-rule);
}

.reveal-share__preview {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: 0.04em;
    color: var(--color-ink);
}

/* After a refused copy it holds the whole result, line breaks and all. */
.reveal-share__preview--full {
    flex: 1 1 100%;
    font-size: var(--text-xs);
    white-space: pre-wrap;
    user-select: all;
    color: var(--color-muted);
}

.modal-content .reveal-share__copy {
    width: auto;
    margin-top: 0;
    padding-inline: 0;
}

/* A revealed film arrives in its place with the accent's soft wash, which
   then fades into the paper like every other row. */
tbody tr.is-just-revealed {
    animation: just-revealed 2400ms var(--ease-out);
}

@keyframes just-revealed {
    from {
        background-color: var(--color-accent-soft);
        box-shadow: inset var(--rule-firm) 0 0 var(--color-accent);
    }
    to {
        background-color: transparent;
        box-shadow: inset var(--rule-firm) 0 0 transparent;
    }
}

@media (max-width: 30rem) {
    .sealed-film__score {
        display: none;
    }
}

/* ==================================================================
   Colophon — Ft1 mast-headed footer
   ================================================================== */

.colophon {
    border-top: var(--rule-firm) solid var(--color-ink-strong);
    background: var(--color-paper-2);
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

.colophon__inner {
    max-width: var(--page-max);
    margin-inline: auto;
    display: grid;
    gap: var(--space-sm);
}

.colophon__wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-lg);
    letter-spacing: var(--tracking-display);
    color: var(--color-ink-strong);
}

.colophon__line,
.colophon__data {
    max-width: var(--measure);
    font-size: var(--text-sm);
    color: var(--color-muted);
    text-wrap: pretty;
}

.colophon__data {
    color: var(--color-neutral);
}

.colophon__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-lg);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: var(--rule-hair) solid var(--color-rule);
    color: var(--color-neutral);
}

.colophon__meta a {
    color: var(--color-neutral);
    text-decoration: none;
    border-bottom: var(--rule-hair) solid var(--color-rule);
    white-space: nowrap;
}

.colophon__meta a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ==================================================================
   Login page
   ================================================================== */

/* Short page — pin the colophon to the bottom of the viewport. */
.page-login {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.page-login main {
    flex: 1 0 auto;
}

.page-login .colophon {
    flex-shrink: 0;
}

.login-container {
    max-width: 26rem;
    margin-inline: auto;
    padding: var(--space-2xl) var(--space-md) var(--space-3xl);
}

.login-panel {
    display: grid;
    gap: var(--space-md);
}

.login-panel h1 {
    font-size: var(--text-xl);
}

.login-panel__note {
    font-size: var(--text-sm);
    color: var(--color-muted);
    text-wrap: pretty;
}

.form {
    display: grid;
    gap: var(--space-xs);
}

.form label {
    color: var(--color-neutral);
    margin-top: var(--space-sm);
}

.form button {
    margin-top: var(--space-md);
}

.form button[type="button"] {
    margin-top: var(--space-xs);
    justify-self: start;
}

/* ==================================================================
   Admin — Workbench
   ================================================================== */

.admin-header__alert {
    max-width: var(--page-max);
    margin: var(--space-md) auto 0;
}

.admin-shell {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: var(--space-xl) var(--space-md) var(--space-3xl);
}

/* The desk sits above the two working columns and spans them — one message
   for the whole site is not a per-column job. */
.notice-desk {
    max-width: var(--measure);
    margin-bottom: var(--space-2xl);
}

.notice-desk__status {
    margin-bottom: var(--space-md);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.notice-desk__form button {
    justify-self: start;
}

/* The reason sits next to the field it asks about. */
.notice-desk__note {
    margin-top: var(--space-2xs);
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--color-neutral);
}

.admin-grid {
    display: grid;
    gap: var(--space-2xl);
}

.admin-column {
    min-width: 0;
}

.admin-column__header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: var(--rule-firm) solid var(--color-ink-strong);
}

.admin-column__summary {
    max-width: var(--measure);
    margin-top: var(--space-2xs);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.admin-locked {
    display: grid;
    gap: var(--space-sm);
    justify-items: start;
    max-width: var(--measure-tight);
    padding-block: var(--space-2xl);
}

.suggestions-panel {
    margin-top: var(--space-xl);
}

.suggestions-panel h3 {
    padding-bottom: var(--space-xs);
    border-bottom: var(--rule-hair) solid var(--color-rule);
    margin-bottom: var(--space-md);
}

/* Entries, not cards — hairline rule above, no box, no shadow. */
.suggestion-card {
    padding-block: var(--space-lg);
    border-top: var(--rule-hair) solid var(--color-rule);
}

.suggestion-card:first-of-type {
    border-top: 0;
    padding-top: var(--space-xs);
}

.suggestion-card header h3 {
    font-size: var(--text-md);
    border: 0;
    padding: 0;
    margin: 0;
}

.suggestion-card header p {
    margin-top: var(--space-3xs);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--color-neutral);
}

.suggestion-meta {
    margin-top: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.suggestion-meta a {
    margin-inline-start: var(--space-2xs);
}

.score-form {
    margin-top: var(--space-md);
}

.score-grid {
    display: grid;
    gap: var(--space-sm);
    align-items: start;
}

.score-grid label {
    display: grid;
    gap: var(--space-2xs);
    min-width: 0;
}

.score-grid label > span {
    color: var(--color-neutral);
}

.score-grid__score span small {
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-neutral);
}

.score-form button {
    margin-top: var(--space-md);
}

.delete-form {
    margin-top: var(--space-sm);
}

/* ==================================================================
   Spin wheel — the one playful object. A real tool, inside the system.
   ================================================================== */

.spin-wheel {
    margin-block: var(--space-lg) var(--space-xl);
    padding: var(--space-lg);
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
}

.spin-wheel h2 {
    font-size: var(--text-lg);
}

.spin-wheel__subtitle {
    margin-top: var(--space-2xs);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.spin-wheel__layout {
    display: grid;
    gap: var(--space-lg);
    align-items: center;
    margin-top: var(--space-lg);
}

.spin-wheel__visual {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--space-md);
}

.spin-wheel__pointer {
    width: 0;
    height: 0;
    border-inline: 8px solid transparent;
    border-top: 12px solid var(--color-ink-strong);
}

.spin-wheel__disc {
    position: relative;
    width: min(15rem, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    border: var(--rule-firm) solid var(--color-ink-strong);
    background: var(--color-paper-3);
}

.spin-wheel__disc--spinning {
    transition: transform 4200ms var(--ease-out);
}

.spin-wheel__glow {
    display: none;
}

.spin-wheel__center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.25rem;
    height: 2.25rem;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: var(--rule-hair) solid var(--color-ink-strong);
    background: var(--color-paper);
}

.spin-wheel__result {
    padding-top: var(--space-md);
    border-top: var(--rule-hair) solid var(--color-rule);
}

.spin-wheel__result h3 {
    font-size: var(--text-md);
}

.spin-wheel__result p {
    margin-top: var(--space-2xs);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.spin-wheel__result-text--active {
    color: var(--color-ink);
}

/* ==================================================================
   Top-rated cards — kept on-system in case the section is restored
   ================================================================== */

.top-leaderboard {
    padding-block: var(--space-lg);
}

.top-leaderboard__header {
    margin-bottom: var(--space-lg);
}

.top-leaderboard__eyebrow {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-neutral);
}

.top-leaderboard__note {
    max-width: var(--measure);
    margin-top: var(--space-xs);
    color: var(--color-muted);
}

.top-leaderboard__grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.top-leaderboard__card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-md);
    align-items: start;
    padding-top: var(--space-md);
    border-top: var(--rule-firm) solid var(--color-ink-strong);
}

.top-leaderboard__card--loading {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}

.top-leaderboard__rank {
    position: absolute;
    top: calc(var(--space-md) * -1);
    inset-inline-end: 0;
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--color-neutral);
}

.top-leaderboard__poster {
    width: 3.5rem;
    height: 5.25rem;
    overflow: hidden;
    border: var(--rule-hair) solid var(--color-rule-firm);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
}

.top-leaderboard__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-leaderboard__content h3 {
    font-size: var(--text-md);
}

.top-leaderboard__meta {
    margin-top: var(--space-2xs);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.top-leaderboard__meta-name {
    color: var(--color-ink);
}

.top-leaderboard__score {
    margin-top: var(--space-xs);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-neutral);
    --score-accent: var(--color-band-good);
}

.top-leaderboard__score[data-score-band="great"] { --score-accent: var(--color-band-great); }
.top-leaderboard__score[data-score-band="good"]  { --score-accent: var(--color-band-good); }
.top-leaderboard__score[data-score-band="fair"]  { --score-accent: var(--color-band-fair); }
.top-leaderboard__score[data-score-band="weak"]  { --score-accent: var(--color-band-weak); }

.top-leaderboard__score strong {
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--score-accent);
}

.top-leaderboard__empty {
    grid-column: 1 / -1;
    padding: var(--space-lg) 0;
    color: var(--color-neutral);
    font-size: var(--text-sm);
}

/* ==================================================================
   Small viewports — the register becomes a stack of entries
   The (max-width) queries below mirror the JS matchMedia breakpoint
   at 768px; everything else grows upward with min-width.
   ================================================================== */

@media (max-width: 48rem) {
    .table-container {
        overflow-x: visible;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: var(--space-2xs) var(--space-md);
        padding-block: var(--space-lg);
        border-top: var(--rule-hair) solid var(--color-rule);
    }

    tbody tr:first-child {
        border-top: 0;
        padding-top: var(--space-xs);
    }

    tbody td {
        grid-column: 2;
        padding: 0;
        border: 0;
    }

    tbody td::before {
        content: attr(data-label);
        display: block;
        font-family: var(--font-body);
        font-weight: 500;
        font-size: var(--text-2xs);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-neutral);
    }

    /* The poster spans the rows to its left, like a plate in the margin. */
    tbody td[data-label="Poster"] {
        grid-column: 1;
        grid-row: 1 / span 4;
        width: auto;
    }

    tbody td[data-label="Poster"]::before,
    tbody td[data-label="Rank"]::before,
    tbody td[data-label="Title"]::before {
        display: none;
    }

    tbody td[data-label="Rank"] {
        font-size: var(--text-2xs);
    }

    tbody td[data-label="Title"] {
        font-size: var(--text-lg);
    }

    .score-cell,
    .poster-cell,
    .agree-cell {
        width: auto;
    }

    /* Stacked, the cell has room to breathe and the scale gets tap targets.
       The reading and its meter run the full width, as the score above it
       does; only the scale itself is held in, so the five steps stay close
       enough together to read as one control. */
    .agree {
        gap: var(--space-xs);
        margin-top: var(--space-2xs);
    }

    .agree__options {
        gap: var(--space-2xs);
        max-width: 19rem;
    }

    .agree-option {
        max-width: none;
        height: 2.5rem;
    }

    /* Nothing clips out here, so the tip can sit under the thumb rather than
       behind it. */
    [data-tip]::after {
        inset-inline-end: auto;
        inset-inline-start: 0;
    }

    tbody tr.loading-row,
    tbody tr.message-row {
        display: block;
        border: 0;
        padding-block: var(--space-lg);
    }

    tbody tr.loading-row td,
    tbody tr.message-row td {
        text-align: center;
    }

    tbody tr.loading-row td::before,
    tbody tr.message-row td::before {
        display: none;
    }

    /* JS drives the slide; panels overlay each other while it does. */
    .dashboard-tabs__panels {
        overflow: hidden;
    }

    .dashboard-tabs__panel[style*="position: absolute"] {
        position: absolute;
    }
}

@media (min-width: 48.0625rem) {
    .masthead__moderator {
        position: absolute;
        top: var(--space-md);
        inset-inline-end: var(--space-lg);
        margin: 0;
    }

    /* The column head already says SCORE — don't say it twice per row. */
    .score-card__total-label {
        display: none;
    }

    /* Desktop: only the active ledger is in the document. */
    .dashboard-tabs__panel {
        display: none;
        position: static;
    }

    .dashboard-tabs__panel.is-active {
        display: block;
    }

    .table-container table {
        min-width: 68rem;
    }

    main {
        padding-inline: var(--space-lg);
    }

    .masthead,
    .colophon {
        padding-inline: var(--space-lg);
    }

    .score-grid {
        grid-template-columns: 7rem minmax(0, 1fr);
        gap: var(--space-md);
    }

    .score-grid label:has(textarea) {
        grid-column: 1 / -1;
    }

    .spin-wheel__layout {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .spin-wheel__result {
        padding-top: 0;
        padding-inline-start: var(--space-lg);
        border-top: 0;
        border-inline-start: var(--rule-hair) solid var(--color-rule);
    }
}

@media (min-width: 60rem) {
    .admin-grid {
        /* Deliberately unequal — rating new suggestions is the wider job. */
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        gap: var(--space-3xl);
    }

    .colophon__inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
        column-gap: var(--space-3xl);
    }

    .colophon__wordmark {
        grid-row: 1 / span 2;
    }

    .colophon__meta {
        grid-column: 1 / -1;
    }
}

@media (pointer: coarse) {
    /* Icon-only, so it needs the full target in both directions. */
    .site-notice__close {
        width: 44px;
        height: 44px;
        margin-block: calc(var(--space-sm) * -1);
    }

    .dashboard-tabs__tab,
    .button,
    .login-button,
    .search-section button,
    .score-form button,
    .modal-content button,
    .spin-wheel__button,
    .form button {
        min-height: 44px;
    }

    .agree-option {
        height: 44px;
        min-width: 44px;
    }
}

/* ==================================================================
   Reduced motion — spatial motion collapses, loaders keep working
   ================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 150ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 150ms !important;
    }

    .reveal {
        animation: reveal-reduced 150ms linear forwards;
    }

    @keyframes reveal-reduced {
        to { opacity: 1; transform: none; }
    }

    .movie-card:hover,
    .button:active {
        transform: none;
    }

    .loader {
        animation: spin 900ms linear infinite !important;
    }

    /* A colour fading out, not movement — it keeps its pace. */
    tbody tr.is-just-revealed {
        animation-duration: 2400ms !important;
    }

    .spin-wheel__disc--spinning {
        transition-duration: 150ms !important;
    }
}
