/* ---------- the palette ----------------------------------------------------
   Every colour that carries *structure* — the page, the ink, a card, a hairline,
   a status tint — is a token here and is never written as a hex anywhere below.
   That is what makes the night theme a second palette rather than a second
   stylesheet: the rules do not know which one they are drawing in.

   Three states, on purpose (`docs/deployment.md` has the reasoning in one line):

   * bare `:root` is the **complete light set**, so the default „follow the
     system" state always resolves even where nothing is stamped;
   * `@media (prefers-color-scheme: dark)` guarded by `:not([data-theme=light])`
     is the system preference — the guard is what lets a student who explicitly
     chose light keep it on a machine set to dark;
   * `:root[data-theme="dark"]` is the explicit choice and wins in both
     directions.

   The top bar is **not** in here and does not change: it is already dark navy,
   and the one piece of the page that reads the same in both themes is the one
   piece that is always in view.

   Near-duplicate shades were folded together when the tokens went in (two greys
   for hairlines, two pale blues for chips, two greens for „solved"): the light
   theme shifted by a shade nobody can see, and every rule that used them now
   has a dark counterpart for free. */
:root {
    color-scheme: light;

    --page:        #F5F6FA;
    --card:        #FFF;
    --card-soft:   #FBFCFE;
    --ink:         #2D3140;
    --ink-soft:    #46506A;
    --ink-muted:   #6A7188;
    --ink-faint:   #9AA3B5;
    --line:        #E3E6EF;
    --line-strong: #CCD3E4;
    --row-quiet:   #F4F5F9;

    --link:        #2456B0;
    --link-strong: #1D478F;
    --tint:        #EEF2FA;
    --tint-hover:  #E2E9F7;
    --accent-ink:  #35507F;

    --good:        #1E7A37;
    --good-tint:   #EAF5EC;
    --bad:         #C0392B;
    --bad-ink:     #A33030;
    --bad-tint:    #FBECEB;
    --warn-ink:    #8A5A22;
    --warn-strong: #A06A12;
    --warn-tint:   #FDF0D8;
    --clay:        #9A4F21;
    --neutral-tint:#ECECF2;

    /* The one-offs. Each belongs to one small thing — a chip on the timetable,
       the code card, the empty half of a star row — and each is here for the
       same reason as the block above: so the night theme is a list of values and
       not a second copy of the rules. */
    --tint-info:     #E8F0FB;
    --tint-offline:  #F5ECE2;
    --tint-today:    #F4F7FF;
    --tint-taught:   #EDF1F8;
    --tint-live:     #FDF8EE;
    --tint-unplanned:#FDF4F3;
    --tint-duty:     #F7F4EC;
    --slot-bg:       #FAFBFE;
    --free-a:        #F6F7FB;
    --free-b:        #EEF0F7;
    --code-bg:       #F4F6FB;
    --quote-bg:      #EEF1F7;
    --quote-ink:     #55607A;
    --panel-line:    #C8D2E6;
    --extra-bg:      #FDF6F0;
    --extra-line:    #E3CBB6;
    --extra-edge:    #C58B58;
    --extra-chip:    #F7ECE3;
    --answer-line:   #DDE3EE;
    --bar-track:     #B9C6E4;
    --seg-offline:   #DDD3C4;
    --seg-pause:     #B9C0D0;
    --picked:        #D3E0F7;
    --none-ink:      #B6BCCB;
    --clock-ink:     #8A91A6;
    --axis-line:     #E8EAF1;
    --untracked-line:#DFE2EA;
    --worklist-bg:   #F6F7FA;
    --worklist-line: #E2E5EE;
    --stars-empty:   #D3D6E0;
    --focus:         #2B4A8B;
    --quiet-ink:     #4A5168;
    --calm-ink:      #52607A;
    --tok-k:         #8250A0;
    --tok-b:         #1A6B8C;
    --tok-c:         #5D6478;
    --planned-bg:    #FBFBFD;
}

* { box-sizing: border-box; }
body {
    margin: 0; background: var(--page); color: var(--ink);
    /* The three CJK faces are not decoration: without a Japanese font named
       here, a page with Japanese content falls back to whatever the system
       picks, which has a different line height and pushes every row of a
       table out of line. Segoe UI carries no kana at all. */
    font-family: system-ui, -apple-system, "Segoe UI", "Yu Gothic UI", Meiryo,
                 "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex; align-items: center; gap: 1rem;
    background: #1f2a44; color: #fff; padding: 0.6rem 1.2rem;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.topbar .active-class {
    background: #35507e; border-radius: 4px; padding: 0.15rem 0.6rem; font-size: 0.9rem;
    color: #fff;
}
.topbar .active-class:hover { background: #43629a; text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .nav-link { color: #cdd6ea; font-size: 0.95rem; }
.topbar .user-email { color: #9fb0d0; font-size: 0.9rem; }
.logout-form { margin: 0; }
.translation-panel { margin: 0.4rem 0; border-left: 3px solid var(--panel-line); padding-left: 0.7rem; }
.translation-panel > summary { cursor: pointer; font-weight: 600; color: #35507e; }
.translation-box { margin: 0.6rem 0; }
.translation-box textarea { width: 100%; }
.translation-original {
    background: var(--quote-bg); border-radius: 4px; padding: 0.4rem 0.6rem; margin: 0.2rem 0;
    white-space: pre-wrap; font-size: 0.85rem; color: var(--quote-ink); max-height: 9rem;
    overflow: auto;
}
.deck-languages { margin: 0.4rem 0; }
.live-notifications:empty { display: none; }
.live-notifications {
    background: var(--bad); border-radius: 4px; padding: 0.15rem 0.6rem; font-size: 0.9rem;
    animation: flash 1s linear infinite alternate;
}
@keyframes flash { from { opacity: 1; } to { opacity: 0.5; } }

.container { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }

.messages { margin-bottom: 1rem; }
.message { border-radius: 6px; padding: 0.6rem 1rem; margin-bottom: 0.4rem; }
.message-success { background: var(--good-tint); color: var(--good); }
.message-info    { background: var(--tint-info); color: var(--link-strong); }
.message-error   { background: var(--bad-tint); color: var(--bad-ink); }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { border: 1px solid var(--line); padding: 0.45rem 0.7rem; text-align: left; font-size: 0.95rem; }
th { background: var(--tint); }

.btn {
    display: inline-block; border: none; border-radius: 6px; cursor: pointer;
    background: var(--link); color: #fff; padding: 0.45rem 1rem; font-size: 0.95rem;
}
.btn:hover { background: var(--link-strong); }
.btn-small { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #992d22; }
/* A tile that is deliberately not a link yet — same shape, no promise. Never a
   disabled <a>: it is a <span>, so there is nothing to click or focus. */
.btn-disabled, .btn-disabled:hover { background: var(--ink-faint); cursor: not-allowed; }
.btn-microsoft {
    background: #2f2f2f; font-size: 1.05rem; padding: 0.7rem 1.5rem;
}
.btn-microsoft:hover { background: #1a1a1a; text-decoration: none; }

form.inline { display: inline; }
input[type=text], input[type=number], input[type=email], select, textarea {
    border: 1px solid var(--line-strong); border-radius: 6px; padding: 0.4rem 0.6rem;
    font-size: 0.95rem; font-family: inherit;
}
textarea { width: 100%; }
.form-row { margin-bottom: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.balances { display: flex; gap: 1rem; margin: 1rem 0; }
.balance {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 0.8rem 1.4rem; text-align: center;
}
.balance .value { font-size: 1.8rem; font-weight: 700; }
.balance .label { color: var(--ink-muted); font-size: 0.9rem; }

.login-box { max-width: 420px; margin: 4rem auto; text-align: center; }
.muted { color: var(--ink-muted); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-muted); }

/* --- live quick questions (phase 2) --- */
.live-notifications.flashing {
    background: var(--bad); color: #fff; padding: 0.2rem 0.6rem; border-radius: 4px;
    animation: live-flash 1s steps(1, end) infinite;
}
@keyframes live-flash { 50% { opacity: 0.35; } }

.live-modal-overlay {
    position: fixed; inset: 0; background: rgba(16, 22, 38, 0.82);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
    padding: 1rem;
}
.live-modal {
    background: var(--card); border-radius: 10px; padding: 1.5rem; max-width: 560px;
    width: 100%; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.live-modal h2 { margin-top: 0; font-size: 1.35rem; }
.live-countdown { font-size: 2rem; font-weight: 700; color: var(--link-strong); margin: 0.5rem 0; }
/* A brainstorm has no clock. The words go where the number was, so they must
   not shout like one — nothing is running out. */
.live-countdown.live-countdown-open { font-size: 1rem; font-weight: 600; color: var(--calm-ink); }
.live-error { color: var(--bad-ink); min-height: 1.2em; margin: 0.2rem 0; }
.live-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.live-input { flex: 1; min-width: 12rem; }
.live-options { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
.live-option { text-align: left; }
/* Multichoice: rows of checkboxes rather than one-click buttons, so the student
   picks several and then submits. */
.live-checkbox {
    background: var(--tint); color: var(--ink); border-radius: 6px;
    padding: 0.45rem 0.8rem; display: flex; align-items: center; gap: 0.5rem;
    cursor: pointer;
}
.live-checkbox:hover { background: var(--tint-hover); }
.live-my-answers { margin: 0.8rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); }

/* The option's number, on every screen that lists options: the student presses
   it, the teacher says it out loud, the projector shows the same one. Fixed
   width so the option texts line up under each other. */
.option-number {
    display: inline-block; min-width: 1.6rem; margin-right: 0.5rem;
    font-weight: 700; color: var(--link-strong); font-variant-numeric: tabular-nums;
}
.live-checkbox.is-picked, .quiz-checkbox.is-picked { background: var(--picked); }

/* Counted options on the teacher's overview — the same picture the projector
   draws, in the page's own colours. */
.quiz-bars { display: flex; flex-direction: column; gap: 0.35rem; }
.quiz-bars .quiz-bar-row { display: flex; align-items: center; gap: 0.6rem; }
.quiz-bars .quiz-bar-label { min-width: 14rem; }
.quiz-bars .quiz-bar {
    height: 1.1rem; border-radius: 4px; background: var(--bar-track); min-width: 2px;
}
.quiz-bars .quiz-bar-row.is-correct .quiz-bar { background: var(--good); }
.quiz-bars .quiz-bar-row.is-correct .quiz-bar-label { font-weight: 700; color: var(--good); }
.quiz-bars .quiz-bar-count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Pás s celým papírem nad jednou aktivní otázkou (quizbank test).

   ZÁMĚRNĚ BEZ NOVÝCH TOKENŮ. Stavy se dají říct tím, co už v paletě je:
   zodpovězeno `--good-*`, nezodpovězeno `--card` + `--line-strong`, aktuální
   `--accent-ink`. Tři nové tokeny by se musely dát do obou nočních bloků a
   hlásily by totéž co ty tři existující (docs/theme.md).

   ZALAMUJE SE, NESCROLLUJE. Dvacet políček pod sebou je na mobilu lepší než
   dvacet políček, ze kterých je vidět šest — a scrollovací pás schová právě to,
   co student hledá: díru na konci papíru. */
.paper-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.9rem 0 1.1rem;
}
.paper-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 2.6rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}
.paper-nav-item:hover { background: var(--tint-hover); text-decoration: none; }
.paper-nav-item.is-answered {
    background: var(--good-tint);
    border-color: var(--good);
    color: var(--good);
}
/* Aktuální otázka: obtažení, ne jiná výplň — stav "zodpovězeno" se tím
   nepřebije a dá se vidět obojí naráz. */
.paper-nav-item.is-current {
    outline: 2px solid var(--accent-ink);
    outline-offset: 1px;
    font-weight: 700;
    color: var(--accent-ink);
}
.paper-nav-number { line-height: 1; }
.paper-nav-kind { flex: none; opacity: 0.75; }

/* Stavba receptu testu. `quiz-short` sedí na tokenech `--bad-*`, které už
   existují — nová barva by se musela dát do oba nočních bloků, a tahle hlásí
   totéž co každé jiné "tohle neprojde". */
.quiz-recipe td, .quiz-recipe th { vertical-align: top; }
.quiz-recipe .js-available { font-variant-numeric: tabular-nums; }
.quiz-recipe .js-available.quiz-short {
    color: var(--bad-ink);
    background: var(--bad-tint);
    font-weight: 700;
}
.quiz-test-form .quiz-recipe select[multiple] { min-width: 22rem; }

.answer-cards { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.answer-card {
    border: 1px solid var(--answer-line); border-radius: 8px; padding: 0.8rem 1rem; min-width: 12rem;
}
.answer-card .answer-text { font-size: 1.1rem; }
.answer-card .answer-count { color: var(--ink-muted); font-size: 0.9rem; }
.answer-card .answer-actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.question-text { font-size: 1.8rem; }

/* compose form for quick questions */
.field-group { margin-bottom: 0.9rem; }
.field-group[hidden] { display: none !important; }
.field-group > label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.field-group .form-row > label { font-weight: 600; display: flex; gap: 0.4rem; align-items: center; }
.field-group textarea, .field-group > input[type="text"], .field-group > select { width: 100%; }
.kind-hint { margin: 0.3rem 0 0; font-size: 0.9rem; }

/* A negative balance is a debt from a withdrawn award — never hide it. */
.balance .value-debt { color: var(--bad); }

/* --- presentations (phase 3): top-bar link to a running presentation --- */
.live-presentation {
    background: var(--good); color: #fff; border-radius: 4px;
    padding: 0.15rem 0.6rem; font-size: 0.9rem;
}
.live-presentation:hover { background: #17612c; text-decoration: none; }
.live-presentation[hidden] { display: none; }

.presentation-settings { border-top: 1px solid var(--line); margin-top: 0.8rem; padding-top: 0.8rem; }

/* --- question bank + live quizzes (phase 3b) --- */
.checkbox-list { display: flex; flex-direction: column; gap: 0.25rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; }
.checkbox-list[hidden] { display: none !important; }

.live-quiz-link {
    background: #7a3ea8; color: #fff; border-radius: 4px;
    padding: 0.15rem 0.6rem; font-size: 0.9rem;
}
.live-quiz-link:hover { background: #642f8c; text-decoration: none; }
.live-quiz-link[hidden] { display: none; }
.live-quiz-link.flashing { animation: live-flash 1s steps(1, end) infinite; }

.quiz-header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.quiz-header h1 { margin: 0; }
.quiz-header .spacer { flex: 1; }
/* Zbývající čas a pod ním zbývající body: jedno rozhodnutí o dvou ubývajících
   věcech (nápověda stojí body a čas běží dál). */
.quiz-clock {
    display: inline-flex; flex-direction: column;
    align-items: flex-end; gap: 0.2rem; text-align: right;
}
.quiz-progress { color: var(--ink-muted); font-size: 1rem; }
.quiz-countdown {
    font-size: 2rem; font-weight: 800; color: var(--link-strong);
    font-variant-numeric: tabular-nums;
}
.quiz-countdown.is-urgent { color: var(--bad); }
.quiz-question { font-size: 1.5rem; margin-top: 0; }
.quiz-form { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-option { text-align: left; }
.quiz-checkbox {
    background: var(--tint); color: var(--ink); border-radius: 6px;
    padding: 0.5rem 0.8rem; display: flex; align-items: center; gap: 0.5rem;
    cursor: pointer;
}
.quiz-checkbox:hover { background: var(--tint-hover); }
.quiz-input { width: 100%; }
.quiz-waiting { color: var(--ink-muted); font-size: 1.1rem; }
.quiz-verdict { font-size: 1.2rem; font-weight: 600; }
.quiz-verdict.is-good { color: var(--good); }
.quiz-verdict.is-bad { color: var(--bad-ink); }
.quiz-correct { font-size: 1.1rem; }
.quiz-explanation {
    background: var(--tint); border-left: 4px solid var(--link);
    padding: 0.5rem 0.8rem; border-radius: 4px;
}

/* --- account pages (login, registration, password) ---
   allauth renders these; the markup comes from templates/account/. */
.auth-box { max-width: 460px; margin: 3rem auto; }
.auth-box h1 { font-size: 1.5rem; margin-top: 0; }
.auth-box .card { text-align: center; }
.auth-box form { text-align: left; }
.auth-box .field-group > label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.auth-box input[type=text], .auth-box input[type=email], .auth-box input[type=password] {
    width: 100%;
}
.field-check { display: flex; align-items: center; gap: 0.4rem; }
.field-check > label { font-weight: 400; margin: 0; }
.field-error { color: var(--bad-ink); font-size: 0.9rem; margin: 0.15rem 0 0.6rem; }
.field-help { font-size: 0.85rem; margin: 0.15rem 0 0.6rem; }
.field-help ul { margin: 0.2rem 0; padding-left: 1.1rem; }
.auth-alt { font-size: 0.9rem; }

/* Inline name editing on the roster (teachers fix what Microsoft got wrong). */
.name-form { display: flex; gap: 0.3rem; align-items: center; }
.name-form input[type=text] { width: 7.5rem; padding: 0.2rem 0.4rem; font-size: 0.9rem; }

/* --- authored question content (Markdown rendered by the server) ---
   Everything a teacher can produce with apps/questionbank/richtext.py, styled
   once and used wherever a question, an explanation or a bank image is shown.
   The container is a div rather than a heading everywhere, because a list or a
   code block inside an <h1> is not markup a browser is obliged to keep. */
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p { margin: 0.4em 0; }
.rich-text ul, .rich-text ol { margin: 0.4em 0; padding-left: 1.4em; }
/* Code is set in a monospace face because the alignment *is* the meaning: a
   study text about indentation, or about where a `return` sits relative to a
   loop, says nothing at all in a proportional font. This was missing until
   2026-09-16 — `pre` inherited the body face and every listing in the handout
   rendered as prose. */
.rich-text code, .rich-text pre {
    font-family: "Cascadia Mono", Consolas, "DejaVu Sans Mono", "Liberation Mono",
                 ui-monospace, monospace;
    font-variant-ligatures: none;   /* `!=` and `->` must look like what was typed */
}
.rich-text code {
    background: var(--tint); border-radius: 3px; padding: 0.1em 0.3em;
    font-size: 0.9em;
}
.rich-text pre {
    background: var(--tint); border-radius: 6px; padding: 0.6rem 0.8rem;
    /* Code samples are the reason wide content must scroll in its own box
       rather than stretching the card off the screen. */
    overflow-x: auto; font-size: 0.95rem; line-height: 1.45; font-weight: 400;
    tab-size: 4;
}
.rich-text pre code { background: none; padding: 0; font-size: inherit; }

/* Syntax highlighting. The spans are emitted at *render* time by
   `questionbank.richtext` (never by a script at read time), so these five
   classes are the whole vocabulary:
       k  keyword     b  builtin     s  string     n  number     c  comment
   Kept deliberately quiet — four hues on a light card, none of them saturated.
   A listing a student reads for five minutes should not be the loudest thing on
   the page, and the comment colour in particular has to stay legible rather
   than decorative. */
.rich-text .tok-k { color: var(--tok-k); font-weight: 600; }
.rich-text .tok-b { color: var(--tok-b); }
.rich-text .tok-s { color: var(--good); }
.rich-text .tok-n { color: var(--clay); }
/* Not the site's `--muted` grey (var(--ink-muted)): on the code card's lighter ground
   that lands at 4.3:1, just under AA, and a comment is often the sentence that
   explains the listing. Darkened until it passes. */
.rich-text .tok-c { color: var(--tok-c); font-style: italic; }
.rich-text table { border-collapse: collapse; margin: 0.4em 0; }
.rich-text th, .rich-text td { border: 1px solid var(--line-strong); padding: 0.25rem 0.5rem; }
.rich-text blockquote {
    margin: 0.4em 0; padding-left: 0.8rem; border-left: 3px solid var(--line-strong);
    color: var(--quiet-ink);
}
/* A question's image is bounded by the space it is shown in, not by its own
   pixel size: the same graph appears in a modal, on a review page and on a
   projector. */
.rich-image { max-width: 100%; height: auto; border-radius: 6px; }
.rich-text .rich-image { display: block; margin: 0.5em 0; }

/* The question itself, wherever a script builds it (live.js, livequiz.js). Both
   replaced a heading element, so the weight has to be stated here. */
.live-modal .live-question { margin-top: 0; font-size: 1.35rem; font-weight: 600; }
.live-modal .live-question .rich-image { max-height: 40vh; width: auto; }
.quiz-question { font-weight: 600; }
.quiz-question .rich-image { max-height: 45vh; width: auto; }
.question-text { font-weight: 600; }
.quiz-review-index { font-size: 1.1rem; color: var(--ink-muted); margin-bottom: 0.3rem; }

/* --- the images panel on the bank's authoring form --- */
.asset-strip {
    display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem;
}
.asset-card {
    margin: 0; padding: 0.4rem; border: 1px solid var(--line-strong); border-radius: 6px;
    background: var(--card-soft); width: 9rem;
}
.asset-card img {
    display: block; width: 100%; height: 5rem; object-fit: contain;
    background: var(--tint); border-radius: 4px;
}
.asset-card figcaption {
    display: flex; gap: 0.3rem; align-items: center; justify-content: space-between;
    margin-top: 0.35rem;
}

/* --- progeval: the code editor, verdicts and the grading grid --- */
.code-editor {
    width: 100%; font-family: Consolas, "DejaVu Sans Mono", monospace;
    font-size: 0.9rem; line-height: 1.4; tab-size: 4;
}
.code-view {
    background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px;
    padding: 0.6rem; overflow-x: auto; font-size: 0.85rem; white-space: pre-wrap;
}
/* What the student's own code printed. Dark on purpose: it is a terminal, not a
   part of the page, and the difference matters when you are looking for a
   trailing space. `pre-wrap` keeps that space visible instead of collapsing it. */
.run-output {
    background: #1e2430; color: #e8ecf4; border-radius: 6px;
    padding: 0.6rem 0.8rem; overflow-x: auto; font-size: 0.85rem;
    font-family: Consolas, "DejaVu Sans Mono", monospace;
    white-space: pre-wrap; margin: 0;
}
.task-statement { margin-bottom: 0.6rem; }
.task-solved { color: var(--good); font-weight: 600; }
.task-partial { color: var(--warn-strong); font-weight: 600; }
/* A wrong answer is not the same state as a partial one, and reading them in the
   same amber said so less clearly than the words did. */
.task-wrong { color: var(--bad); font-weight: 600; }
.task-failed { color: var(--bad-ink); font-weight: 600; }
/* Task rows a class never practises: the hidden half of a pool sorts last and
   reads as a different kind of row without needing a legend. */
.task-row-hidden td { background: var(--row-quiet); }
/* The folded task list under a pool: no border of its own, so the nested table
   does not read as a second grid inside the release grid. */
.pool-tasks > td { border-top: 0; padding-top: 0; }
.pool-tasks summary { cursor: pointer; color: var(--accent-ink); font-size: 0.9rem; }
.pool-tasks details[open] summary { margin-bottom: 0.5rem; }
/* The student's task list, folded by pool: a finished pool starts closed, so the
   summary line has to carry enough to make opening it a choice, not a guess. */
.pool-details > summary { cursor: pointer; padding: 0.15rem 0; }
.pool-details[open] > summary { margin-bottom: 0.6rem; }
.grade-row { border-top: 1px solid var(--line); padding-top: 0.6rem; margin-top: 0.6rem; }
.grade-row:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* --- lesson plans: the readable plan, the editor and the runner ---
   All three show the same timeline, so the clock column, the block and the chip
   are defined once here and reused. The clock is tabular-nums throughout: it is
   read down a column, and proportional digits make that column wobble. */
.plan-read { max-width: 46rem; }
.plan-masthead { border-bottom: 2px solid #1f2a44; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.plan-eyebrow {
    font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent-ink); margin: 0 0 0.3rem;
}
.plan-masthead h1 { margin: 0 0 0.5rem; }
.plan-standfirst { color: var(--ink-soft); font-size: 1.05rem; }
.plan-facts {
    display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none;
    padding: 0; margin: 0.8rem 0 0;
}
.plan-facts li {
    background: var(--tint); border-radius: 999px; padding: 0.15rem 0.7rem;
    font-size: 0.85rem; color: var(--accent-ink);
}
.plan-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.plan-timeline { display: flex; flex-direction: column; gap: 1rem; }
.plan-block { display: flex; gap: 1rem; align-items: flex-start; }
.plan-clock {
    flex: 0 0 5.5rem; display: flex; flex-direction: column;
    font-variant-numeric: tabular-nums; padding-top: 0.15rem;
}
.plan-clock .from { font-weight: 700; }
.plan-clock .dur { color: var(--ink-muted); font-size: 0.85rem; }
.plan-body { flex: 1; border-left: 2px solid var(--line); padding-left: 1rem; }
.plan-head { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.plan-head h3 { margin: 0 0 0.3rem; }
.plan-chip {
    font-size: 0.75rem; border-radius: 999px; padding: 0.1rem 0.6rem;
    background: var(--tint); color: var(--accent-ink); white-space: nowrap;
}
.plan-chip-offline { background: var(--tint-offline); color: var(--warn-ink); }
.plan-chip-pause { background: var(--neutral-tint); color: var(--ink-muted); }
.plan-pause {
    text-align: center; color: var(--ink-muted); font-size: 0.9rem;
    letter-spacing: 0.1em; text-transform: uppercase;
    border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong);
    padding: 0.4rem 0;
}
.plan-launch { font-size: 0.9rem; color: var(--accent-ink); margin: 0.4rem 0 0; }
.plan-slides { font-size: 0.9rem; color: var(--accent-ink); margin: 0.3rem 0 0; }
/* The range inputs read as one field ("slidy [od] – [do]"), so they sit on one
   baseline rather than wrapping like two unrelated numbers. */
.slide-range { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.plan-broken { color: var(--bad-ink); }
.plan-cut { font-size: 0.9rem; color: var(--warn-ink); margin: 0.3rem 0 0; }
.plan-cuts li { margin-bottom: 0.3rem; }
.plan-archived td { background: var(--row-quiet); color: var(--ink-muted); }
/* Sequence problems: amber, not red. The plan still runs — it just has a step
   standing on a presentation that will not be up by then. */
.plan-warnings { border-left: 4px solid var(--warn-strong); }
.plan-warnings h2 { color: var(--warn-ink); }

/* The editor. A step is a <details>, so a long plan stays scannable and only the
   block being rewritten is open. */
.step-editor {
    border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.7rem;
    margin-bottom: 0.5rem; background: var(--card-soft);
}
.step-editor > summary {
    cursor: pointer; display: flex; gap: 0.6rem; align-items: baseline;
    flex-wrap: wrap;
}
.step-editor[open] > summary { margin-bottom: 0.8rem; }
.step-clock { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 4.5rem; }
.step-name { font-weight: 600; }
.step-meta { font-size: 0.85rem; }
.step-pause > summary .step-name { color: var(--ink-muted); font-weight: 400; }
.step-form textarea { width: 100%; }
.past-notes { border-top: 1px solid var(--line); margin-top: 0.8rem; padding-top: 0.6rem; }
.past-notes h4 { margin: 0 0 0.4rem; font-size: 0.9rem; }
/* The averaged cost of the block: the one number a re-plan is actually made of. */
.past-average { font-weight: 400; color: var(--warn-ink); }
.past-note { margin: 0 0 0.4rem; font-size: 0.9rem; }

/* The runner. Type is a size up from the rest of the app: this page is read from
   a laptop propped on a desk, standing, mid-sentence. */
.run-header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.run-header h1 { margin: 0; }
.run-header .spacer { flex: 1; }
.run-total, .run-step-timer {
    font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--link-strong);
}
.run-total.is-over, .run-step-timer.is-over { color: var(--bad); }
.run-current { border-left: 4px solid var(--link-strong); }
.run-current-head { display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.run-current-head h2 { margin: 0; font-size: 1.4rem; }
.run-current-head .spacer { flex: 1; }
.run-step-clock { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.run-buttons {
    display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
    margin: 0.8rem 0;
}
.run-buttons .spacer { flex: 1; }
/* Planned slides versus the live ones. The live half is the louder of the two:
   the plan is a claim, the session is the fact. */
.run-slides { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0.4rem 0; }
.run-slides-plan { color: var(--ink-muted); }
.run-slides-live { color: var(--good); font-weight: 600; }
.run-slides-off { color: var(--warn-strong); }
/* The schedule verdict beside the clock. Green for early is deliberate: running
   ahead is not a problem to flag, it is room to spend. */
.run-expected { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
/* The bell. The scheduled window is context and stays quiet; the countdown to
   the next ring is the line a teacher looks up mid-sentence, so it is not. */
.run-scheduled { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.run-bell {
    font-variant-numeric: tabular-nums; border-radius: 999px;
    padding: 0.1rem 0.6rem; white-space: nowrap; background: var(--tint); color: var(--accent-ink);
}
.run-bell-break { background: var(--tint-offline); color: var(--warn-ink); }
.run-bell-after { background: var(--bad-tint); color: var(--bad-ink); }
.run-period-form select { max-width: 14rem; }
.run-drift {
    font-weight: 700; font-variant-numeric: tabular-nums;
    border-radius: 999px; padding: 0.1rem 0.6rem; white-space: nowrap;
}
.run-drift-on { background: var(--good-tint); color: var(--good); }
.run-drift-ahead { background: var(--tint-info); color: var(--link-strong); }
.run-drift-behind { background: var(--bad-tint); color: var(--bad-ink); }

/* The time budget: one segment per step, as wide as the minutes it was given. */
.run-plan-bar {
    position: relative; display: flex; gap: 2px; margin: 0.6rem 0 0.9rem;
    height: 1.4rem; border-radius: 4px; overflow: hidden; background: var(--line);
}
.run-plan-seg {
    /* flex-basis 0 so the segments divide the width purely by their minutes;
       min-width keeps a zero-minute step visible as a hairline. */
    flex-basis: 0; min-width: 3px; background: var(--line-strong);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.run-plan-seg-offline { background: var(--seg-offline); }
.run-plan-seg-pause { background: var(--seg-pause); }
.run-plan-seg.is-done { box-shadow: inset 0 -3px 0 var(--ink-muted); }
.run-plan-seg.is-current { background: var(--link-strong); }
.run-plan-seg.is-current .run-plan-min { color: #fff; }
.run-plan-min {
    font-size: 0.7rem; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
/* A narrow segment cannot show its minutes without spilling; hide the number
   rather than clip it, the tooltip still carries it. */
.run-plan-seg { white-space: nowrap; }
.run-plan-now {
    position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad);
    /* Centred on the position rather than starting at it, so the line marks the
       moment instead of the two pixels after it. */
    margin-left: -1px; pointer-events: none;
}

.run-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
/* The deck moved the run while a note was being typed. Amber rather than red:
   nothing is wrong, the teacher just has two things open at once. */
.run-moved { border-left: 4px solid var(--warn-strong); }
.run-moved[hidden] { display: none; }
/* "Co se bude ptát" — the question as the class will get it, on the teacher's
   page only. Set apart from the step's own prose, because one is what you do
   and the other is what the students read. */
.asked {
    border: 1px solid var(--line-strong); border-left: 4px solid var(--accent-ink); border-radius: 6px;
    padding: 0.5rem 0.8rem; margin: 0.7rem 0; background: var(--card-soft);
}
.asked > summary { cursor: pointer; font-weight: 600; }
.asked[open] > summary { margin-bottom: 0.5rem; }
.asked-text { font-size: 1.05rem; }
.asked-options { margin: 0.5rem 0 0; padding-left: 1.4rem; }
.asked-options li.is-correct { font-weight: 700; color: var(--good); }
.asked-correct { margin: 0.5rem 0 0; }
.asked-why { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink-soft); }
.run-note { border-top: 1px solid var(--line); padding-top: 0.7rem; }
.run-note label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.run-note textarea { width: 100%; }
.run-behind { border-left: 4px solid var(--bad); }
.run-behind h2 { color: var(--bad); }
.run-table td { vertical-align: top; }
.run-cell-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-row-current > td { background: var(--tint); }
.run-row-pause > td { color: var(--ink-muted); }
/* The jump row belongs to the step above it, so it loses the border that would
   otherwise read as a row of its own. */
.run-row-goto > td { border-top: 0; padding-top: 0; }
.run-link { display: inline-block; margin-right: 0.5rem; font-size: 0.85rem; }
.run-note-inline textarea { width: 100%; min-width: 12rem; }
.run-over { color: var(--bad); font-variant-numeric: tabular-nums; }
.run-under { color: var(--good); font-variant-numeric: tabular-nums; }

/* ---------- worklists ---------- */

/* Only the current row is marked. The rule is "do the first thing you have not
   finished", so anything else competing for the eye would be inviting exactly
   the choice a single ordered list exists to remove. */
.worklist-row.is-current { border-left: 4px solid #2f6feb; }
.worklist-row.is-done h2 { color: var(--ink-muted); }
.worklist-number {
    font-family: Consolas, "DejaVu Sans Mono", monospace;
    color: var(--ink-muted); margin-right: 0.3rem;
}

/* Skupina u seznamu. Výběr spolužáků je zalomený do mřížky, ne pod sebe:
   ve třídě je jich dvacet a dvacet řádků by odstrčilo první položku pod
   okraj obrazovky. */
.worklist-team-picks {
    display: flex; flex-wrap: wrap; gap: 0.15rem 1.1rem;
}
.worklist-team-pick { white-space: nowrap; }
.worklist-teams td { padding: 0.15rem 0.8rem 0.15rem 0; vertical-align: middle; }

/* The matrix. One glyph per cell on purpose: eight students against seventeen
   items has to fit on a laptop without scrolling sideways, and mid-lesson the
   teacher reads it by shape rather than by value. */
.worklist-matrix { font-variant-numeric: tabular-nums; }
.worklist-matrix th, .worklist-matrix td { padding: 0.2rem 0.35rem; }
.worklist-matrix td.wm-done,
.worklist-matrix td.wm-part,
.worklist-matrix td.wm-none { text-align: center; font-size: 1.1rem; }
.worklist-matrix td.wm-done { color: var(--good); }
.worklist-matrix td.wm-part { color: var(--clay); }
.worklist-matrix td.wm-none { color: var(--none-ink); }

/* The answers page. `pre` keeps a student's line breaks — the six (vstup,
   výstup) pairs of item 11 are a list and read as one — but it must wrap: this
   is text a student typed, nobody wrapped it for us, and one long line in a
   bare `pre` pushes the whole page sideways. */
.worklist-response {
    font-family: Consolas, "DejaVu Sans Mono", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--worklist-bg);
    border: 1px solid var(--worklist-line);
    border-radius: 3px;
    padding: 0.5rem 0.6rem;
    margin: 0 0 0.6rem;
}
/* Unreviewed is the state worth finding on a page of thirty answers, so it is
   the one that is marked. */
.worklist-answer.is-unreviewed { border-left: 4px solid var(--clay); }
.worklist-block { margin: 1.4rem 0 0.4rem; }
.worklist-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* --- study materials: how far past the lesson a section goes ---
   Only ever drawn for a section that is *not* základní, so it reads as "this
   one is different" rather than as a label on everything. Clay rather than a
   warning red: going beyond the lesson is an offer, not a problem.

   The tint is the load-bearing half. A student scrolling a handout has to be
   able to see what they may be examined on without reading a word, and the
   answer has to be visible *while the section is open* — hiding or collapsing
   it would defeat the point, which is that anyone who wants the mechanism can
   have it. Kept light enough that body text on it still reads at AA. */
.card.section-extra {
    background: var(--extra-bg);
    border-color: var(--extra-line);
    border-left: 4px solid var(--extra-edge);
}
.section-level {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--clay);
    background: var(--extra-chip);
    border: 1px solid var(--extra-line);
    border-radius: 3px;
    padding: 0.05rem 0.4rem;
}
h2 + .section-level { margin: 0 0 0.6rem; }

/* The answered question, held on screen with the verdict before the stream
   rolls on. The tick says what the student picked, the colour what was right —
   two different facts, so they are not carried by the same mark. */
.opts-review { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.opts-review li {
    padding: 0.25rem 0.5rem;
    border-left: 4px solid transparent;
    border-radius: 2px;
}
.opts-review .opt-mark {
    display: inline-block;
    width: 1.2rem;
    font-weight: 700;
    color: var(--link-strong);
}
.opts-review .opt-correct { background: var(--good-tint); border-left-color: var(--good); }
.opts-review .opt-wrong { background: var(--bad-tint); border-left-color: var(--bad); }

/* --- the timetable (docs/timetable.md) ---
   Status is carried by a labelled chip, never by colour alone: the word is what
   the page is answering with, and the tint only makes it findable. */
.tt-status {
    display: inline-block; font-size: 0.8rem; border-radius: 3px;
    padding: 0.05rem 0.45rem; white-space: nowrap;
}
.tt-ready     { background: var(--good-tint); color: var(--good); }
.tt-taught    { background: var(--tint-taught); color: var(--ink-soft); }
.tt-live      { background: var(--warn-tint); color: var(--warn-ink); }
.tt-unplanned { background: var(--bad-tint); color: var(--bad-ink); }
.tt-missed    { background: var(--bad-tint); color: var(--bad-ink); }
.tt-nodiary   { background: var(--warn-tint); color: var(--warn-ink); }
.tt-cancelled { background: var(--neutral-tint); color: var(--ink-muted); }
.tt-untracked { background: var(--neutral-tint); color: var(--ink-muted); }

.tt-today { background: var(--tint-today); }
.tt-row-cancelled td { color: var(--ink-faint); }
.attention-list { margin: 0.2rem 0 0.8rem; padding-left: 1.2rem; }
.attention-list li { margin-bottom: 0.25rem; }

.tt-plan-form { display: flex; gap: 0.3rem; align-items: center; }
.tt-plan-form select { max-width: 15rem; }
.tt-cancel-form { display: flex; gap: 0.3rem; margin-top: 0.3rem; }
.tt-cancel-form input[type=text] { width: 8rem; }
td > details > summary { cursor: pointer; font-size: 0.85rem; color: var(--ink-muted); }

/* A week on one time axis: a narrow column of period marks, then five days.
   Every block is positioned by its start and sized by its length, on a scale
   shared by all of them — so 45 minutes is 45 minutes on Friday too, and a
   double lesson is visibly two periods plus the break between them.

   **Two grids on the same columns**, headers above and timelines below, so the
   five timelines start at one y whatever the headers do. Inside a single grid
   they did not: a busy day's summary wraps to two lines, which pushed that
   whole column down and left the axis matching nobody. */
.tt-head-row, .tt-week {
    display: grid; grid-template-columns: 2.4rem repeat(5, 1fr); gap: 0.4rem;
}
.tt-head-row { align-items: end; margin-bottom: 0.3rem; }
@media (max-width: 760px) {
    .tt-head-row, .tt-week { grid-template-columns: 1.9rem 1fr; }
}
.tt-day {
    border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem;
}
.tt-day-head { padding: 0 0.4rem; }
.tt-day-head h3 { margin: 0 0 0.1rem; font-size: 0.9rem; }
.tt-day-head-today h3 { color: var(--link); }
.tt-day-sum { font-size: 0.72rem; margin: 0; line-height: 1.25; }
.tt-day-today { border-color: var(--link); background: var(--tint-today); }
.tt-warn { color: var(--bad-ink); }

/* The column is the day; blocks are placed inside it in pixels computed from
   the timetable (`agenda.place`). Absolute rather than flex, because only a
   fixed axis makes the heights comparable *between* columns — flex-grow
   stretched each day's contents to fill its own column, so one lesson on a
   quiet Friday looked like a double. */
.tt-line { position: relative; }
.tt-slot {
    position: absolute; left: 0; right: 0; overflow: hidden;
    border-left: 4px solid var(--line-strong); border-radius: 3px;
    padding: 0.15rem 0.3rem; font-size: 0.78rem; line-height: 1.25;
    background: var(--slot-bg);
}
.tt-slot-head {
    display: flex; gap: 0.25rem; align-items: baseline; white-space: nowrap;
}
.tt-slot-head > a {
    font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis;
}
.tt-slot-head > a:hover { color: var(--link); }
.tt-num { color: var(--ink-soft); font-weight: 700; }
.tt-clock {
    font-variant-numeric: tabular-nums; color: var(--clock-ink); font-size: 0.7rem;
    margin-left: auto;
}
/* Today's block offers the one thing today's block is for. It takes the
   clock's place rather than sitting beside it: on a 45-minute block there is
   one line and the start time is the thing you already know. */
.tt-go {
    margin-left: auto; font-size: 0.68rem; background: var(--link); color: #fff;
    border-radius: 3px; padding: 0 0.3rem;
}
.tt-go:hover { background: var(--link-strong); text-decoration: none; }
.tt-slot-plan a { color: inherit; }
.tt-slot-plan a:hover { color: var(--link); }
.tt-slot-plan { overflow-wrap: anywhere; font-size: 0.75rem; }
.tt-slot-room { font-size: 0.68rem; }

/* A label that has to survive a block too short to contain it. Centred on the
   true height and allowed to overhang: the alternative was flooring the height,
   which made a ten-minute duty taller than ten minutes and put the next block
   inside it. The strip stays truthful; only the text leaves it. */
.tt-tag {
    font-size: 0.7rem; white-space: nowrap; line-height: 1.15;
}
.tt-slot-thin {
    overflow: visible; padding: 0; display: flex; align-items: center;
    z-index: 3;
}
.tt-slot-thin .tt-tag {
    font-size: 0.64rem; padding: 0 0.25rem; border-radius: 2px;
    background: inherit;
}

/* The axis: period number and its bell, on the same grid as the blocks beside
   it. The transparent border and matching padding are what keep that alignment
   — the day columns have a border and padding of their own, and without the
   same box here every mark sits a pixel off the block it labels. */
.tt-axis-col {
    padding: 0.4rem 0.2rem 0.4rem 0;
    border: 1px solid transparent;
}
.tt-axis-mark {
    position: absolute; left: 0; right: 0;
    font-size: 0.66rem; color: var(--clock-ink); text-align: right;
    border-top: 1px solid var(--axis-line);
    line-height: 1.1; padding-top: 1px;
}
.tt-axis-mark b { color: var(--ink-muted); font-size: 0.72rem; margin-right: 0.2rem; }
.tt-axis-mark span { font-variant-numeric: tabular-nums; }

.tt-slot.tt-ready { border-left-color: var(--good); }
.tt-slot.tt-unplanned { border-left-color: var(--bad); background: var(--tint-unplanned); }
.tt-slot.tt-taught { border-left-color: var(--ink-soft); }
.tt-slot.tt-live { border-left-color: #e0a63c; background: var(--tint-live); }
.tt-slot.tt-missed { border-left-color: var(--bad); }
.tt-slot.tt-cancelled { border-left-color: var(--line-strong); color: var(--ink-faint); }
.tt-slot.tt-untracked { border-left-color: var(--untracked-line); color: var(--ink-faint); }
/* Duties and free time are deliberately quieter than any lesson: they are the
   shape of the day, not the thing being prepared for. */
.tt-slot-duty { border-left-color: #b9a06a; background: var(--tint-duty); color: var(--ink-muted); }
.tt-slot-pause { border-left-style: dotted; }
.tt-slot-free {
    border-left-color: transparent; background: repeating-linear-gradient(
        135deg, var(--free-a), var(--free-a) 6px, var(--free-b) 6px, var(--free-b) 12px);
}
.diary-entry p { margin: 0.2rem 0; }

/* --- the perk catalogue (docs/perks.md) --- */
.perk-notice { border-left: 4px solid #e0a63c; }
.perk-summary { font-size: 1.02rem; margin: 0 0 0.3rem; }
.perk-ladder { max-width: 26rem; margin: 0.6rem 0; }
.perk-ladder td, .perk-ladder th { padding: 0.25rem 0.6rem; }
/* Affordable rows are tinted *and* say so in words: the tint alone would be a
   colour carrying the only copy of a fact (CLAUDE.md's test rules aside, it is
   the same reason). */
.perk-ok { background: var(--good-tint); }
.perk-rules { font-size: 0.85rem; margin-bottom: 0; }
.perk-needs { font-size: 0.9rem; }
/* An idea, not a promise: it still gets a price, but it must not look like the
   rows that are decided. */
.perk-planned { border-style: dashed; background: var(--planned-bg); }
.perk-planned h2 { color: var(--ink-muted); }
.perk-heading { margin: 1.4rem 0 0.6rem; font-size: 1.05rem; }
.perk-intro { max-width: 48rem; margin-top: -0.3rem; }
/* Ten rows of an exponential price need to stay scannable: the numbers line up
   under each other and the row height drops. */
.perk-ladder td { padding: 0.15rem 0.6rem; font-variant-numeric: tabular-nums; }
/* Earning is the other direction, and the green says so before the words do. */
.reward { border-left: 4px solid var(--good); }
.reward-pay { margin-bottom: 0; }
.reward-pay b { color: var(--good); }
.asked-list li { margin-bottom: 0.6rem; }
.asked-text { font-weight: 600; }
/* The options of a question somebody else wrote, with **nothing** marking the
   right one — that strip is the whole point of the unlocked list. */
.asked-options { margin: 0.2rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); }
.question-proposal { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.3rem; }
.question-author { font-size: 0.8rem; margin: 0.2rem 0 0; }
.student-question { margin-top: 0.6rem; max-width: 34rem; }
.tt-pending { background: var(--warn-tint); color: var(--warn-ink); }
.tt-accepted { background: var(--good-tint); color: var(--good); }
.tt-rejected { background: var(--neutral-tint); color: var(--ink-muted); }

/* --- Poslední minuta: hvězdičky ------------------------------------------
   Stars rather than a row of numbers, because in a Czech school a 1 reads as
   the *best* mark — backwards from a rating scale, and no caption fixes that
   reliably. Five stars carry no second meaning.

   They are real radio buttons with the label as the star, so the keyboard and
   a scriptless browser both work; only the filling is CSS. The inputs sit in
   the DOM as 5→1 so `:checked ~ label` can reach the lower values, and the row
   is drawn reversed so that 1 ends up on the left. */
.stars { border: 0; padding: 0; margin: 0 0 1.1rem; }
.stars legend { font-weight: 600; padding: 0; margin-bottom: 0.2rem; }
.star-row { display: inline-flex; flex-direction: row-reverse; gap: 0.1rem; }
.star-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-row label {
    font-size: 2.1rem;
    line-height: 1;
    color: var(--stars-empty);
    cursor: pointer;
    padding: 0 0.05rem;
    transition: color .08s;
}
/* The chosen star and every lower one. `+` is its own label, `~` the rest —
   which are the smaller values, because the DOM runs downwards. */
.star-row input:checked + label,
.star-row input:checked ~ label { color: #e8a317; }
/* Hover preview, same shape. Guarded so a touch device does not stick. */
@media (hover: hover) {
    .star-row:hover label { color: var(--stars-empty); }
    .star-row label:hover,
    .star-row label:hover ~ label { color: #f0b93a; }
}
/* Keyboard focus has to stay visible — the input itself is off-screen, so the
   ring goes on the label it controls. */
.star-row input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.stars-hint { font-size: 0.85rem; color: var(--ink-muted); margin: 0 0 1.1rem; }
/* The answer read back, and the course-wide table: plain text, not inputs. */
.stars-shown { color: #e8a317; letter-spacing: 0.06em; }

/* ---------- noční režim ----------------------------------------------------
   Nothing below is a rule about *layout*: it is the same stylesheet with the
   other palette in it. Two selectors carry it —

     * the system preference, guarded by `:not([data-theme="light"])`, so that a
       student who picked the light theme keeps it on a machine set to dark;
     * the explicit choice, which wins in both directions.

   **The list is written twice on purpose.** CSS has no way to share one
   declaration block between a media query and an attribute selector, and the
   alternative — letting the script resolve "system" and stamp `data-theme`
   always — would make the system preference depend on JavaScript. Keep the two
   lists identical; if a token is added above, it belongs in both.

   What is *not* here is as deliberate: the top bar, the buttons' white labels,
   the terminal that shows what a student's program printed, and the stars. They
   were already dark or already saturated, and a page where the one fixed
   landmark moves too is a page nobody recognises.

   Backgrounds are lifted rather than lightened: `--card` sits *above* `--page`,
   the way a card does in daylight, so the shadowless flat design still reads as
   layers. Status tints go the other way — dark, low-chroma grounds under bright
   ink, because a pale mint chip on a dark page glows and a dark one does not. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --page:        #14161c;
        --card:        #1b1f27;
        --card-soft:   #20242e;
        --ink:         #e6e9f0;
        --ink-soft:    #c2c8d6;
        --ink-muted:   #98a0b3;
        --ink-faint:   #6e7688;
        --line:        #2c313d;
        --line-strong: #3a4150;
        --row-quiet:   #20242e;

        --link:        #7fa8ee;
        --link-strong: #a9c6f7;
        --tint:        #222a38;
        --tint-hover:  #2a3546;
        --accent-ink:  #9db6dd;

        --good:        #62c98a;
        --good-tint:   #17301f;
        --bad:         #f07a6b;
        --bad-ink:     #f19a90;
        --bad-tint:    #3a1d1a;
        --warn-ink:    #e0b775;
        --warn-strong: #d9a94f;
        --warn-tint:   #33280f;
        --clay:        #e0a07a;
        --neutral-tint:#262a34;

        --tint-info:     #1c2738;
        --tint-offline:  #2e2519;
        --tint-today:    #1b2436;
        --tint-taught:   #222834;
        --tint-live:     #2d2718;
        --tint-unplanned:#2f1d1b;
        --tint-duty:     #272318;
        --slot-bg:       #1e222b;
        --free-a:        #191d25;
        --free-b:        #21252e;
        --code-bg:       #1e2330;
        --quote-bg:      #20242e;
        --quote-ink:     #a8afc0;
        --panel-line:    #3a4150;
        --extra-bg:      #2a2119;
        --extra-line:    #4a3b2c;
        --extra-edge:    #b5794a;
        --extra-chip:    #33281e;
        --answer-line:   #333a48;
        --bar-track:     #3d4a63;
        --seg-offline:   #4a4234;
        --seg-pause:     #383e4c;
        --picked:        #2c3d5c;
        --none-ink:      #5a6172;
        --clock-ink:     #8b93a6;
        --axis-line:     #2c313d;
        --untracked-line:#333845;
        --worklist-bg:   #1e222b;
        --worklist-line: #2c313d;
        --stars-empty:   #3a4150;
        --focus:         #7fa8ee;
        --quiet-ink:     #b3bacb;
        --calm-ink:      #a0a8ba;
        --tok-k:         #c99ae0;
        --tok-b:         #6fc2dd;
        --tok-c:         #9aa2b5;
        --planned-bg:    #1d212a;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --page:        #14161c;
    --card:        #1b1f27;
    --card-soft:   #20242e;
    --ink:         #e6e9f0;
    --ink-soft:    #c2c8d6;
    --ink-muted:   #98a0b3;
    --ink-faint:   #6e7688;
    --line:        #2c313d;
    --line-strong: #3a4150;
    --row-quiet:   #20242e;

    --link:        #7fa8ee;
    --link-strong: #a9c6f7;
    --tint:        #222a38;
    --tint-hover:  #2a3546;
    --accent-ink:  #9db6dd;

    --good:        #62c98a;
    --good-tint:   #17301f;
    --bad:         #f07a6b;
    --bad-ink:     #f19a90;
    --bad-tint:    #3a1d1a;
    --warn-ink:    #e0b775;
    --warn-strong: #d9a94f;
    --warn-tint:   #33280f;
    --clay:        #e0a07a;
    --neutral-tint:#262a34;

    --tint-info:     #1c2738;
    --tint-offline:  #2e2519;
    --tint-today:    #1b2436;
    --tint-taught:   #222834;
    --tint-live:     #2d2718;
    --tint-unplanned:#2f1d1b;
    --tint-duty:     #272318;
    --slot-bg:       #1e222b;
    --free-a:        #191d25;
    --free-b:        #21252e;
    --code-bg:       #1e2330;
    --quote-bg:      #20242e;
    --quote-ink:     #a8afc0;
    --panel-line:    #3a4150;
    --extra-bg:      #2a2119;
    --extra-line:    #4a3b2c;
    --extra-edge:    #b5794a;
    --extra-chip:    #33281e;
    --answer-line:   #333a48;
    --bar-track:     #3d4a63;
    --seg-offline:   #4a4234;
    --seg-pause:     #383e4c;
    --picked:        #2c3d5c;
    --none-ink:      #5a6172;
    --clock-ink:     #8b93a6;
    --axis-line:     #2c313d;
    --untracked-line:#333845;
    --worklist-bg:   #1e222b;
    --worklist-line: #2c313d;
    --stars-empty:   #3a4150;
    --focus:         #7fa8ee;
    --quiet-ink:     #b3bacb;
    --calm-ink:      #a0a8ba;
    --tok-k:         #c99ae0;
    --tok-b:         #6fc2dd;
    --tok-c:         #9aa2b5;
    --planned-bg:    #1d212a;
}

/* The two places a hardcoded colour cannot be left alone: both are navy on a
   light ground, which on the dark ground is navy on near-navy. Written as rules
   rather than as tokens because in daylight they are the same colour as the top
   bar and that is the point of them. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .plan-masthead { border-bottom-color: var(--line-strong); }
    :root:not([data-theme="light"]) .translation-panel > summary { color: var(--accent-ink); }
}
:root[data-theme="dark"] .plan-masthead { border-bottom-color: var(--line-strong); }
:root[data-theme="dark"] .translation-panel > summary { color: var(--accent-ink); }

/* The switch itself, in the top bar. One button, not a pair of controls: the two
   states are each other's label, so the button says where pressing it goes. */
.theme-toggle {
    background: transparent; border: 1px solid #43629a; color: #cdd6ea;
    border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.85rem;
    font-family: inherit; cursor: pointer; line-height: 1.4;
}
.theme-toggle:hover { background: #35507e; color: #fff; }
/* Only one of the two labels is ever shown, and which one is a property of the
   theme rather than of the script — so a page that loads already dark says the
   right thing before any JavaScript runs. */
.theme-toggle .theme-to-dark { display: inline; }
.theme-toggle .theme-to-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .theme-to-dark { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .theme-to-light { display: inline; }
}
:root[data-theme="dark"] .theme-toggle .theme-to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-to-light { display: inline; }
:root[data-theme="light"] .theme-toggle .theme-to-dark { display: inline; }
:root[data-theme="light"] .theme-toggle .theme-to-light { display: none; }

/* Hlasování o čase. Nine number fields and a running total; everything here is
   about reading a column of digits, which is what `tabular-nums` is for. No new
   tokens — `--bad-ink` already has a value in both themes. */
.time-vote-cell { width: 4.5rem; font-family: inherit; font-size: 1rem; }
.time-vote-num, #time-vote-total { font-variant-numeric: tabular-nums; }
/* The total while it does not match the budget. Colour only — see
   `static/js/time_vote.js` for why the button is not disabled with it. */
#time-vote-total.over { color: var(--bad-ink); }

/* „Čeká na vás" na učitelské úvodní stránce. Jedna fronta přes všechny
   aplikace, a jediné místo, kde se ta čísla sčítají (audit 12. 11.: 693
   odevzdaných odpovědí ze seznamů leželo nezaplacených, protože je nikde
   nebylo vidět). Žádné nové tokeny — `--warn-strong`, `--warn-tint`
   a `--ink-muted` mají hodnotu v obou tématech.

   Pruh vlevo nese význam, ne ozdobu: tahle karta je jediná na stránce, která
   říká „něco po tobě chce stisk", a musí se od dlaždic „Moje výuka" poznat
   bez čtení. */
.pending-queue { border-left: 3px solid var(--warn-strong); }
/* Bez rámečků — globální `th, td` je kreslí, a mřížka z devíti čar je na
   čtyřech řádcích odkazů šum. Zůstává jen hairline mezi řádky. */
.pending-table, .pending-table td {
    background: transparent; border: none;
}
.pending-table td {
    border-bottom: 1px solid var(--line); padding: 0.35rem 0.5rem 0.35rem 0;
    vertical-align: baseline;
}
.pending-table tr:last-child td { border-bottom: none; }
.pending-table .muted { margin-left: 0.5rem; font-size: 0.88rem; }
/* Číslo je to, podle čeho se karta prohlíží, takže dostane svůj sloupec,
   zarovnání na pravý okraj a `tabular-nums` — 7 a 607 pod sebou musí mít
   jedničky ve stejném sloupci. */
.pending-count {
    width: 3.2rem; text-align: right; padding-right: 0.7rem;
    font-variant-numeric: tabular-nums; font-weight: 600;
    color: var(--warn-ink); white-space: nowrap;
}

/* „Uložit celý sloupec" pod hodnotící tabulkou. Hairline nad ním odděluje
   jeden stisk na celou třídu od sedmnácti stisků nad ním — jsou to dvě různá
   rozhodnutí a nemají splývat. */
.worklist-grade-all {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
    margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}
.worklist-grade-all .muted { flex: 1 1 18rem; font-size: 0.88rem; }
