/* Přijímačky – jednotný vzhled aplikace */
:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #f8fafb;
    --ink: #172026;
    --ink-2: #3b4650;
    --muted: #6b7680;
    --line: #e2e7ec;
    --line-strong: #cfd6dd;
    --primary: #13715d;
    --primary-hover: #0f5f4e;
    --primary-soft: #e6f3ef;
    --primary-ink: #0d5a4a;
    --warn: #9a5b00;
    --warn-soft: #fff4dc;
    --warn-line: #f2d59b;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --ok: #157347;
    --ok-soft: #e5f5ec;
    --info-soft: #eaf2fb;
    --info: #1d5a96;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 8px 24px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.hidden, [hidden] { display: none !important; }

/* ---------- horní lišta ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand-mark .icon { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; height: 100%; overflow-x: auto; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- stránka ---------- */
.page { padding: 28px 0 80px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin-top: 6px; display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; }
.page-head .sub span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- karty ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + form, form + .card { margin-top: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .hint { font-size: 13px; color: var(--muted); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-gap { margin-top: 18px; }

/* ---------- tlačítka ---------- */
.btn, button {
    font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
    background: var(--primary); color: #fff; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover, button:hover { background: var(--primary-hover); text-decoration: none; }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(19, 113, 93, .25); outline-offset: 1px; }
.btn.secondary, button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); border-color: #b9c2cb; }
.btn.ghost, button.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover, button.ghost:hover { background: #eef1f4; }
.btn.danger, button.danger { background: var(--surface); color: var(--danger); border-color: #f1c0bb; }
.btn.danger:hover, button.danger:hover { background: var(--danger-soft); }
.btn.sm, button.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg, button.lg { height: 46px; padding: 0 22px; font-size: 16px; }
button:disabled { opacity: .55; cursor: default; }

/* ---------- formuláře ---------- */
label.lbl, .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=number], input[type=password], select, textarea {
    font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); height: 38px; padding: 0 12px; min-width: 0;
}
textarea { height: auto; padding: 10px 12px; width: 100%; min-height: 170px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.field { display: flex; flex-direction: column; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- štítky ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f4; color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge .icon { width: 13px; height: 13px; vertical-align: 0; }

/* ---------- upozornění ---------- */
.alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 14px; font-size: 14px; }
.alert .icon { margin-top: 2px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert.ok { background: var(--ok-soft); border-color: #b6e0c8; color: #0f5132; }
.alert.error { background: var(--danger-soft); border-color: #f4c7c2; color: #8a1c13; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #6b4000; }
.alert.info { background: var(--info-soft); border-color: #c6dbf2; color: #17487a; }

/* ---------- tabulky ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.center, td.center { text-align: center; }
.name-cell a { font-weight: 600; color: var(--ink); }
.name-cell .mono { color: var(--muted); }
.pts { width: 46px; height: 32px; padding: 0 4px; text-align: center; font-variant-numeric: tabular-nums; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pts:placeholder-shown { background: var(--warn-soft); border-color: var(--warn-line); }
.score { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.score b { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }
.bar { height: 6px; border-radius: 3px; background: #e7ebef; overflow: hidden; width: 90px; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }

/* ---------- přehled zadání ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .title { font-weight: 650; font-size: 15px; color: var(--ink); }
.list-item .meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.list-item .right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.progress { height: 6px; background: #e7ebef; border-radius: 3px; overflow: hidden; width: 120px; }
.progress > div { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.progress.wide { width: 100%; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: #a3adb7; margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- kroky / pracovní postup ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #eef1f4; color: var(--ink-2); flex: none; }
.step.done .step-num { background: var(--ok-soft); color: var(--ok); }
.step.active { border-color: #9fd2c3; box-shadow: 0 0 0 3px var(--primary-soft); }
.step.active .step-num { background: var(--primary); color: #fff; }
.step p { color: var(--muted); font-size: 13.5px; margin: 0; }
.step .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.split > .card + .card, .split > form + .card, .split > .card + form { margin-top: 0; }
@media (max-width: 900px) { .split, .split.wide-left { grid-template-columns: 1fr; } }
/* Kompaktní lišta kroků na stránce zadání */
.stepbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.stepbar .step { padding: 12px 14px; gap: 10px; }
.stepbar .step-head { flex-wrap: wrap; gap: 4px 10px; }
.stepbar .step-head h3 { font-size: 15px; }
.stepbar .step-num { width: 24px; height: 24px; font-size: 12px; }
.stepbar .step-num .icon { width: 14px; height: 14px; }
.step-state { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.step-state b { color: var(--ink); }
.stepbar .actions { margin-top: 0; gap: 6px; }
.stepbar .actions form { display: contents; }
.upload-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 16px; }
.upload-row .dropzone { flex-direction: row; justify-content: flex-start; text-align: left; padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .upload-row { grid-template-columns: 1fr; } }
.stat { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat small { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ---------- nahrávání ---------- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
    border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 18px 14px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; transition: border-color .12s, background .12s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .icon { width: 24px; height: 24px; color: var(--primary); }
.dropzone b { color: var(--ink); }
.dropzone .files { color: var(--primary-ink); font-weight: 600; word-break: break-word; }

details.howto { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
details.howto summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); list-style: none; display: flex; gap: 8px; align-items: center; }
details.howto summary::-webkit-details-marker { display: none; }
details.howto[open] summary { border-bottom: 1px solid var(--line); }
.card > details.howto { border: 0; background: transparent; }
@media (max-width: 1000px) { .hide-narrow { display: none; } }
/* Seznam testů: odkaz na test + přepínač „vidí učitelé“ */
.exam-row { padding: 0; }
.exam-row .exam-link { display: block; padding: 16px 20px; color: inherit; }
.exam-row .exam-link:hover { text-decoration: none; }
.exam-row .right { padding-right: 20px; }
.vis-toggle { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: 15px;
    background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; font-weight: 600; box-shadow: none; }
.vis-toggle .vis-knob { width: 30px; height: 18px; border-radius: 9px; background: #cfd6dd; position: relative; transition: background .15s; }
.vis-toggle .vis-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.vis-toggle.on { color: var(--primary-ink); background: var(--primary-soft); border-color: #b8ddd2; }
.vis-toggle.on .vis-knob { background: var(--primary); }
.vis-toggle.on .vis-knob::after { left: 14px; }
/* Volba formy zadání jako dvě karty */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choice-card { display: grid; gap: 4px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer;
    background: var(--surface); position: relative; }
.choice-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-card.disabled { opacity: .5; cursor: not-allowed; }
.cc-title { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.cc-text { color: var(--ink-2); font-size: 14px; }
.cc-extra { font-size: 14px; display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.cc-extra input { width: 80px; height: 34px; }
.cc-extra[hidden] { display: none; }
/* Postup zadání: hotové kroky odškrtnuté, aktuální zvýrazněný s nápovědou, budoucí ztlumené */
.flow { list-style: none; margin: 0 0 16px; padding: 6px 0; }
.flow-step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 12px 18px; position: relative; }
.flow-step + .flow-step { border-top: 1px solid var(--line); }
.flow-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
    background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); }
.flow-num svg { width: 16px; height: 16px; }
.flow-step.done .flow-num { background: var(--ok-soft); border-color: #b6e0c8; color: var(--ok); }
.flow-step.current { background: var(--primary-soft); }
.flow-step.current .flow-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.flow-step.todo .flow-title { color: var(--muted); }
.flow-title { font-weight: 650; line-height: 30px; }
.flow-state { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }
.flow-help { color: var(--ink-2); font-size: 14px; margin: 0 0 8px; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flow-actions:empty { display: none; }
.flow-step.done .flow-actions, .flow-step.todo .flow-actions { opacity: .85; }
details.more { position: relative; }
details.more summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 8px; border-radius: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " ▾"; }
.more-menu { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 280px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.more-menu a { padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.more-menu a:hover { background: var(--surface-2); text-decoration: none; }
details.more.right-menu .more-menu { left: auto; right: 0; }
details.more.right-menu summary::after { content: none; }
.more-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 2px; }
.print-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.print-form .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
details.more-card > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink-2); list-style: none; }
details.more-card > summary::-webkit-details-marker { display: none; }
/* Navádění „co teď“ – kroky s jednou hlavní akcí */
.guide { display: grid; gap: 10px; margin-bottom: 16px; }
.guide-step { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.live-actions { margin-bottom: 12px; gap: 8px; }
/* Přehled zadání: právě běžící digitální test */
.running-test { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; margin-bottom: 14px;
    padding: 16px 20px; border-radius: var(--radius); background: var(--primary-soft); border: 1px solid #b8ddd2; color: var(--ink);
    box-shadow: var(--shadow); }
.running-test:hover { text-decoration: none; border-color: var(--primary); }
.rt-dot { width: 12px; height: 12px; border-radius: 50%; background: #d92d20; box-shadow: 0 0 0 0 rgba(217, 45, 32, .5);
    animation: rt-pulse 1.6s infinite; }
@keyframes rt-pulse { 70% { box-shadow: 0 0 0 10px rgba(217, 45, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0); } }
.rt-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary-ink); }
.rt-title { font-weight: 700; font-size: 17px; }
.rt-meta { color: var(--ink-2); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rt-time { text-align: right; display: grid; }
.rt-time b { font: 800 26px/1 ui-monospace, "SF Mono", Consolas, monospace; }
@media (max-width: 640px) { .running-test { grid-template-columns: auto 1fr; } .rt-time, .running-test .btn { grid-column: 2; text-align: left; } }
/* Živý přehled digitálního testu */
.live-clock { text-align: right; }
.live-clock .big { font: 800 40px/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: -.02em; }
.live-table tr.row-locked td { background: var(--danger-soft); }
.live-table td { vertical-align: middle; }
/* Výsledky pro žáka */
.result-hero { padding: 20px 22px; }
.rh-main { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.rh-main h1 { font-size: 24px; }
.rh-score { min-width: 220px; text-align: right; }
.rh-score .big { font-size: 40px; font-weight: 800; line-height: 1; }
.rh-score .big small { font-size: 16px; font-weight: 600; color: var(--muted); }
.rh-bar { height: 8px; background: #e7ebef; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.rh-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.rh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.rh-note { margin-top: 12px; font-size: 14px; color: var(--info); display: flex; gap: 8px; align-items: center; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0; }
.qcard { padding: 10px 16px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); scroll-margin-top: 20px; }
.qcard-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.qline { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.qline .qid { min-width: 34px; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.qline img { height: 34px; width: auto; border-radius: 4px; }
.qans { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.qans svg { width: 15px; height: 15px; }
.qline.ok .qans svg { color: var(--ok); }
.qline.bad .qans svg { color: var(--danger); }
.open-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 600px) { .rh-score { text-align: left; } .qgrid { grid-template-columns: 1fr; } }
/* Napsané odpovědi z digitálního testu */
.typed-answers { display: grid; gap: 8px; }
.typed { display: flex; gap: 10px; align-items: baseline; }
.typed-label { font-weight: 700; color: var(--ink-2); min-width: 42px; font-size: 13px; }
.typed-text { font-size: 19px; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; flex: 1; }
.typed-text.empty { color: var(--muted, #888); font-style: italic; font-size: 15px; }
.scan-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; padding: 14px; }
.scan-pages figure { margin: 0; text-align: center; }
.scan-pages img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.checklist { margin: 0; padding: 10px 14px 12px 14px; list-style: none; font-size: 13.5px; display: flex; flex-direction: column; gap: 7px; }
.checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.checklist li .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--ok); }
.checklist li.no .icon { color: var(--danger); }
.checklist b { color: var(--ink); }

/* ---------- výběr žáků ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; user-select: none; }
.pick:hover { border-color: var(--line-strong); }
.pick input { width: 17px; height: 17px; accent-color: var(--primary); }
.pick:has(input:not(:checked)) { color: var(--muted); background: var(--surface-2); text-decoration: line-through; }

/* ---------- test: náhledy a klíč ---------- */
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.previews a { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.previews a:hover { border-color: var(--primary); }
.previews img { width: 100%; display: block; }
.previews .cap { font-size: 12.5px; color: var(--muted); padding: 6px 10px; border-top: 1px solid var(--line); }
.q-edit { display: inline-flex; gap: 4px; margin: 2px 8px 2px 0; align-items: center; }
.q-edit input { width: 58px; height: 32px; }
.q-edit select { height: 32px; padding: 0 6px; }

/* ---------- úprava jména na místě ---------- */
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input[type=text] { flex: 1; border-color: transparent; background: transparent; font-weight: 500; }
.inline-edit input[type=text]:hover { border-color: var(--line); background: var(--surface); }
.inline-edit input[type=text]:focus { border-color: var(--primary); background: var(--surface); }
.inline-edit button { visibility: hidden; }
.inline-edit.dirty button { visibility: visible; }

/* ---------- arch žáka ---------- */
.qlist { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1100px) {
    .qlist { grid-template-columns: 1fr 1fr; }
    .qlist .qrow:nth-child(odd) { border-right: 1px solid var(--line); }
}
.qrow { display: grid; grid-template-columns: 48px minmax(150px, 220px) 1fr; gap: 14px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.qrow.review { background: var(--warn-soft); }
.qrow .qid { font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.qrow img { max-width: 100%; max-height: 70px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.qrow .seg { align-self: flex-start; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg label { display: inline-flex; align-items: center; padding: 0 10px; height: 32px; font-size: 13.5px; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line); color: var(--ink-2); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--primary); color: #fff; }
.seg label.correct:not(:has(input:checked)) { color: var(--ok); }
.open-row { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: start; }
.open-row:last-child { border-bottom: 0; }
.open-row img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; display: block; }
.scorebox { text-align: right; }
.scorebox .big { font-size: 34px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.scorebox .big small { font-size: 16px; color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.chip b { font-weight: 700; }

.chip.ok { background: var(--ok-soft); border-color: #b6e0c8; color: var(--ok); }
.chip.err { background: var(--danger-soft); border-color: #f4c7c2; color: var(--danger); }
.chip.part { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
a.chip:hover { text-decoration: none; filter: brightness(.97); }
.answers { display: flex; flex-direction: column; }
.answers-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 20px 6px; border-top: 1px solid var(--line); background: var(--surface-2); }
.answers-group:first-child { border-top: 0; }
.answer-row { display: grid; grid-template-columns: 52px minmax(140px, 240px) 1fr auto; gap: 14px; align-items: center; padding: 8px 20px; border-top: 1px solid var(--line); }
.answer-row .qid { font-weight: 700; }
.answer-row img { max-width: 100%; max-height: 60px; border: 1px solid var(--line); border-radius: 6px; display: block; }
:target { scroll-margin-top: 80px; }
.answer-row:target, .answers-group:target, .card:target { box-shadow: 0 0 0 3px var(--primary-soft); }
@media (max-width: 640px) { .answer-row { grid-template-columns: 44px 1fr; } .answer-row .num { grid-column: 2; } }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; margin-top: 18px; padding: 12px 16px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- průvodce opravováním ---------- */
.wizard { display: flex; flex-direction: column; gap: 10px; }
.wiz-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wiz-top .phase { font-weight: 700; }
.wiz-top .progress { flex: 1; min-width: 160px; height: 8px; }
.wiz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.wiz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wiz-head .task { font-size: 19px; font-weight: 750; }
.wiz-head .student { display: flex; gap: 10px; align-items: baseline; }
.wiz-head .student b { font-size: 17px; }
.wiz-section { padding: 10px 18px 12px; }
.wiz-section + .wiz-section { border-top: 1px solid var(--line); }
.wiz-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.wiz-key img { display: block; max-width: 100%; max-height: 210px; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; }
.wiz-key img.zoom { max-height: none; cursor: zoom-out; }
.wiz-key pre { white-space: pre-wrap; margin: 0; font: inherit; background: var(--ok-soft); color: #0f5132; padding: 10px 12px; border-radius: 6px; }
.wiz-answer { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.wiz-answer img { display: block; max-width: 100%; height: auto; border: 2px solid var(--primary); border-radius: 8px; background: #fff; }
.wiz-answer .tiles { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; width: 100%; }
.wiz-answer figure { margin: 0; max-width: 100%; }
.wiz-answer figcaption { font-weight: 700; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.wiz-meta { font-size: 13.5px; color: var(--muted); }
.wiz-bar { position: sticky; bottom: 0; z-index: 10; background: rgba(255, 255, 255, .97); backdrop-filter: blur(6px); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wiz-choices { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: center; }
button.choice { height: 46px; min-width: 64px; padding: 0 18px; font-size: 18px; font-weight: 700; background: var(--surface); color: var(--ink); border: 2px solid var(--line-strong); border-radius: 10px; }
button.choice:hover { border-color: var(--primary); background: var(--primary-soft); }
button.choice.correct { border-color: #8fcfb0; }
button.choice.active { background: var(--primary); border-color: var(--primary); color: #fff; }
button.choice.confirm { background: var(--primary); border-color: var(--primary); color: #fff; font-size: 15px; }
button.choice.confirm:hover { background: var(--primary-hover); }
button.choice kbd { font: 600 11px/1 system-ui, sans-serif; margin-left: 8px; padding: 3px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .55; }
.wiz-hint { font-size: 12px; color: var(--muted); text-align: center; width: 100%; margin-top: -4px; }
.wiz-answer img { max-height: 34vh; }

@media (max-width: 760px) {
    .topbar-inner { gap: 12px; }
    .brand span:last-child { display: none; }
    .qrow { grid-template-columns: 1fr; }
    .open-row { grid-template-columns: 1fr; }
    .list-item { grid-template-columns: 1fr; }
    .list-item .right { justify-content: flex-start; }
    h1 { font-size: 22px; }
}
