/* Training Camp – building blocks (SPEC 10.2).
   Generated from docs/klick-dummy.html, then maintained here. Every page uses only these classes;
   a missing block is added once here and shown on the "Bausteine" page. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1d2330;
  --muted: #5d6677;
  --border: #d9dde4;
  --primary: #1f5fbf;
  --primary-hover: #194e9e;
  --on-primary: #ffffff;
  --ok-bg: #e6f4ea; --ok: #1e5e2f;
  --bad-bg: #fdecea; --bad: #8a1c12;
  --info-bg: #e8f0fb; --info: #1b4380;
  --warn-bg: #fff4e0; --warn: #7a4b00;
  --focus: #f0a500;
  /* Code always on Atom One Dark, in both themes */
  --code-bg: #282c34; --code-fg: #abb2bf; --code-line: #3b4048; --code-gutter: #21252b;
  --hl-kw: #c678dd; --hl-str: #98c379; --hl-num: #d19a66; --hl-fn: #61afef; --hl-com: #7f848e; --hl-built: #e6c07b; --hl-lit: #56b6c2; --hl-var: #e06c75;
  --mono-py: #dbe7fb; --mono-ap1: #e3f1e4; --mono-wiso: #f6e9d9;
  --ch-bg: #fff3c4; --ch-fg: #7a5c00; --ch-border: #f0d77a;
  --mono-py-fg: #1f5fbf; --mono-ap1-fg: #23784a; --mono-wiso-fg: #a2591a;
  --shadow: 0 1px 2px rgb(20 30 50 / 0.05), 0 6px 20px -8px rgb(20 30 50 / 0.12);
  --shadow-hover: 0 2px 4px rgb(20 30 50 / 0.06), 0 14px 32px -10px rgb(31 95 191 / 0.28);
  --radius: 12px;
  --radius-lg: 18px;
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --surface: #1b2029; --surface-2: #232a35; --text: #e6e9ef; --muted: #a1aab9; --border: #313847;
    --primary: #5b9bf5; --primary-hover: #7eb0f7; --on-primary: #0b1220;
    --ok-bg: #173322; --ok: #9be0b0; --bad-bg: #3a1916; --bad: #f6b0a8; --info-bg: #172a45; --info: #a9c8f5; --warn-bg: #3a2c10; --warn: #f5d08a;
    --mono-py: #1f3253; --mono-ap1: #1e3524; --mono-wiso: #3b2d1c;
    --ch-bg: #3a3214; --ch-fg: #f3d36b; --ch-border: #5c4d1c;
    --mono-py-fg: #8dbbff; --mono-ap1-fg: #8fdcae; --mono-wiso-fg: #f2b878;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -10px rgb(0 0 0 / 0.5);
    --shadow-hover: 0 2px 4px rgb(0 0 0 / 0.4), 0 16px 36px -12px rgb(91 155 245 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151b; --surface: #1b2029; --surface-2: #232a35; --text: #e6e9ef; --muted: #a1aab9; --border: #313847;
  --primary: #5b9bf5; --primary-hover: #7eb0f7; --on-primary: #0b1220;
  --ok-bg: #173322; --ok: #9be0b0; --bad-bg: #3a1916; --bad: #f6b0a8; --info-bg: #172a45; --info: #a9c8f5; --warn-bg: #3a2c10; --warn: #f5d08a;
  --mono-py: #1f3253; --mono-ap1: #1e3524; --mono-wiso: #3b2d1c;
  --ch-bg: #3a3214; --ch-fg: #f3d36b; --ch-border: #5c4d1c;
  --mono-py-fg: #8dbbff; --mono-ap1-fg: #8fdcae; --mono-wiso-fg: #f2b878;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -10px rgb(0 0 0 / 0.5);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / 0.4), 0 16px 36px -12px rgb(91 155 245 / 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: 0.92em; padding: 0.08em 0.35em; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
pre { margin: 0; overflow-x: auto; border-radius: var(--radius); background: var(--code-bg); border: 1px solid var(--code-line); }
pre code { display: block; padding: 0.95rem 1.1rem; border: 0; background: transparent; color: var(--code-fg); font-size: 0.9rem; line-height: 1.6; white-space: pre; }
/* Atom One Dark token colors (as in VS Code) */
.hljs-comment, .hljs-quote { color: var(--hl-com); font-style: italic; }
.hljs-keyword, .hljs-doctag, .hljs-formula { color: var(--hl-kw); }
.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { color: var(--hl-var); }
.hljs-literal { color: var(--hl-lit); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { color: var(--hl-str); }
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-number, .hljs-selector-class { color: var(--hl-num); }
.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title, .hljs-title.function_, .hljs-built_in { color: var(--hl-fn); }
.hljs-title.class_, .hljs-class .hljs-title { color: var(--hl-built); }
.hljs-params { color: var(--code-fg); }
.hljs-operator { color: var(--hl-lit); }
pre.has-copy { position: relative; }
.copy-btn { position: absolute; top: 0.45rem; right: 0.45rem; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 32px; padding: 0 0.6rem; border: 1px solid var(--code-line); border-radius: 8px; background: var(--code-gutter); color: var(--code-fg); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; opacity: 0.85; }
.copy-btn:hover, .copy-btn:focus-visible { opacity: 1; border-color: var(--hl-fn); color: #ffffff; }
.copy-btn.done { border-color: var(--hl-str); color: var(--hl-str); opacity: 1; }
.copy-btn .i { width: 0.95rem; height: 0.95rem; }
pre.has-copy code { padding-right: 6.5rem; }
@media (max-width: 30rem) { .copy-btn span { display: none; } pre.has-copy code { padding-right: 3rem; } }
/* VS Code bracket pair colorization (default dark colors) */
.br1 { color: #ffd700; }
.br2 { color: #da70d6; }
.br3 { color: #179fff; }
/* line numbers like the editor gutter; the numbers sit in their own column so the code can scroll sideways on phones */
pre.has-ln { display: grid; grid-template-columns: auto minmax(0, 1fr); overflow: hidden; }
pre.has-ln code { overflow-x: auto; padding-left: 0.9rem; }
.ln { padding: 0.95rem 0 0.95rem 0.9rem; min-width: 2.2rem; text-align: right; color: #495162; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.6; white-space: pre; user-select: none; }

/* one page width for header, menu and content, in every area */
:root { --page-max: 72rem; }
.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.spread { justify-content: space-between; }

/* App header */
.app-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.app-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding-block: 0.35rem; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.nav > a, .nav > span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 0.75rem; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.nav .who { color: var(--muted); font-size: 0.9rem; }

main { padding-block: 1.5rem 3rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: var(--tap); padding: 0 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-small { min-height: 38px; padding: 0 0.8rem; font-size: 0.9rem; }
.btn-icon { min-width: var(--tap); padding: 0; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; min-height: var(--tap); color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1rem; }
@media (min-width: 40rem) { .card { padding: 1.4rem 1.5rem; } }

progress { width: 100%; height: 0.6rem; accent-color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip-due { background: var(--warn-bg); color: var(--warn); }
.chip-new { background: var(--info-bg); color: var(--info); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }

/* Start page */
.hello { display: grid; gap: 0.35rem; margin-bottom: 1.25rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.tile { display: grid; gap: 0.85rem; align-content: start; padding: 1.2rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.tile:hover { border-color: var(--primary); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .tile, .tile:hover { transition: none; transform: none; } }
.tile-head { display: flex; gap: 0.85rem; align-items: center; }
.mono { flex: none; display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 12px; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em; color: var(--text); }
.mono-pcap { background: var(--mono-py); }
.mono-ap1 { background: var(--mono-ap1); }
.mono-wiso { background: var(--mono-wiso); }
.tile-title { font-weight: 700; line-height: 1.3; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--border); font-weight: 600; color: var(--primary); }
.empty { text-align: center; padding: 2.5rem 1rem; }

/* Course page */
.back { display: inline-flex; align-items: center; min-height: var(--tap); margin-bottom: 0.25rem; }
.course-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.course-head .mono { width: 3.6rem; height: 3.6rem; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.75rem; }
.stat { background: var(--surface-2); border-radius: var(--radius); padding: 0.75rem 0.9rem; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0.75rem; }
.mode { display: grid; gap: 0.5rem; align-content: start; text-align: left; padding: 1rem 1.1rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.mode:hover { border-color: var(--primary); }
.mode.is-main { border-color: var(--primary); }
.mode-title { font-weight: 700; font-size: 1.02rem; }
.mode-go { color: var(--primary); font-weight: 600; }
.section-list { display: grid; gap: 0.85rem; }
.section-row { display: grid; gap: 0.3rem; }
.section-row .row { font-size: 0.92rem; }
.section-row .num { font-variant-numeric: tabular-nums; color: var(--muted); }

/* Training */
.run-top { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.run-progress { font-size: 0.9rem; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 0.55rem; min-height: var(--tap); cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.toggle input { appearance: none; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background 0.15s; flex: none; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--surface); transition: left 0.15s; }
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { left: 1.3rem; }
.qcard { display: grid; gap: 1.1rem; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.qmeta .q-translate { margin-left: auto; }
.qtext { font-size: 1.08rem; font-weight: 500; display: grid; gap: 0.8rem; overflow-wrap: anywhere; min-width: 0; padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--surface-2); }
.qtext .translation { font-weight: 400; }
.translation { border-left: 3px solid var(--primary); padding: 0.15rem 0 0.15rem 0.8rem; color: var(--muted); font-size: 0.97rem; }
.translation .lang { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); margin-bottom: 0.1rem; }
.hint { font-weight: 600; color: var(--info); }

.choices { display: grid; gap: 0.55rem; border: 0; padding: 0; margin: 0; }
.choice { display: flex; align-items: flex-start; gap: 0.75rem; min-height: calc(var(--tap) + 6px); padding: 0.7rem 0.9rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--primary); }
.choice-body { display: grid; gap: 0.15rem; min-width: 0; overflow-wrap: anywhere; }
.choice-de { color: var(--muted); font-size: 0.9rem; }
.choice:has(input:checked) { border-color: var(--primary); }
.mark { font-weight: 700; font-size: 0.85rem; margin-left: auto; white-space: nowrap; padding-left: 0.5rem; }
.is-correct { border-color: var(--ok) !important; background: var(--ok-bg); }
.is-correct .mark { color: var(--ok); }
.is-wrong { border-color: var(--bad) !important; background: var(--bad-bg); }
.is-wrong .mark { color: var(--bad); }

.match-row { display: grid; gap: 0.5rem; padding: 0.8rem 0.9rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); }
@media (min-width: 40rem) { .match-row { grid-template-columns: 1fr 1.5fr; align-items: center; } .match-row .mark { grid-column: 1 / -1; margin-left: 0; } }
select, input[type="text"], textarea { width: 100%; min-height: var(--tap); padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; }
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }

.order { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .order { grid-template-columns: 1fr 1fr; } }
.order h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.4rem; }
.lines { display: grid; gap: 0.4rem; min-height: 4rem; padding: 0.5rem; border: 2px dashed var(--border); border-radius: var(--radius); list-style: none; margin: 0; }
.line { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.25rem 0.25rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; }
.line code { flex: 1 1 12rem; min-width: 0; border: 0; background: transparent; padding: 0 0 0 1.5em; text-indent: -1.5em; white-space: pre-wrap; overflow-wrap: break-word; }
.line-actions { display: flex; gap: 0.4rem; margin-left: auto; flex: none; }
.line .btn { min-height: 36px; min-width: 36px; padding: 0 0.5rem; }

.numeric { display: flex; align-items: center; gap: 0.6rem; max-width: 22rem; }
.numeric input { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.numeric .unit { font-weight: 600; color: var(--muted); }

.criteria { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.criteria li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.75rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.criteria .pts { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-label { display: inline-flex; gap: 0.35rem; align-items: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
.model-answer { white-space: pre-line; }

.feedback { border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: 0.6rem; }
.feedback.good { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback.neutral { background: var(--info-bg); color: var(--info); }
.feedback-title { font-size: 1.12rem; font-weight: 700; }
.feedback .explain { color: var(--text); display: grid; gap: 0.6rem; }
.boxline { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.92rem; }
.boxes { display: inline-flex; gap: 3px; }
.boxes i { width: 1.35rem; height: 1.35rem; border-radius: 4px; background: var(--surface); border: 1px solid currentColor; opacity: 0.45; font-style: normal; font-size: 0.7rem; display: grid; place-items: center; font-weight: 700; }
.boxes i.on { opacity: 1; background: currentColor; color: inherit; }
.boxes i.on span { color: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; }
.star[aria-pressed="true"] { border-color: var(--focus); color: var(--warn); }

/* Simulation */
.sim-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 1rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.02em; }
.grid-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 0.35rem; }
.grid-nav button { min-height: 2.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; position: relative; }
.grid-nav button.answered { background: var(--info-bg); border-color: var(--info); color: var(--info); font-weight: 700; }
.grid-nav button.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--focus); }
.grid-nav button[aria-current="true"] { outline: 2px solid var(--primary); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.85rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; border: 1px solid var(--border); background: var(--surface); }
.legend .l-ans::before { background: var(--info-bg); border-color: var(--info); }
.legend .l-flag::before { background: var(--focus); border-color: var(--focus); border-radius: 50%; }
.sim-layout { display: grid; gap: 1rem; }
@media (min-width: 56rem) { .sim-layout { grid-template-columns: minmax(0, 1fr) 17rem; align-items: start; } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict { display: grid; gap: 0.4rem; text-align: center; padding: 1.5rem 1rem; border-radius: 14px; }
.verdict.pass { background: var(--ok-bg); color: var(--ok); }
.verdict.fail { background: var(--bad-bg); color: var(--bad); }
.verdict .big { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.weak { background: var(--warn-bg); }
.bar-cell { min-width: 7rem; }

/* Admin */
.admin-layout { display: grid; gap: 1rem; }
@media (min-width: 56rem) { .admin-layout { grid-template-columns: 16rem minmax(0, 1fr); align-items: start; } }
.user-list { display: grid; gap: 0.35rem; list-style: none; padding: 0; margin: 0; }
.user-list button { width: 100%; text-align: left; display: grid; gap: 0.1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.user-list button[aria-current="true"] { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.user-list button:disabled { cursor: default; opacity: 0.7; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
legend { font-weight: 700; margin-bottom: 0.4rem; padding: 0; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; align-items: start; padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; accent-color: var(--primary); grid-row: span 2; }
.check .desc { font-size: 0.88rem; color: var(--muted); }
.form-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.quota { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.88rem; padding: 0.55rem 0.8rem; border-radius: var(--radius); background: var(--info-bg); color: var(--text); }
.quota.is-empty { background: var(--bad-bg); }
.quota-field input { max-width: 8rem; }
.card.alert { border-color: var(--bad); }
.locked { border-color: var(--bad); max-width: 40rem; }
.events { width: 100%; border-collapse: collapse; font-size: 0.85rem; display: block; overflow-x: auto; }
.events th, .events td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.note { padding: 0.7rem 0.9rem; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: 0.9rem; }

/* ---------------------------------------------------------------- refresh: icons, depth, softer shapes */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i.fill { fill: currentColor; }
.i-lg { width: 1.5rem; height: 1.5rem; }

.card { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.btn { border-radius: var(--radius); transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.btn-primary { box-shadow: 0 6px 16px -8px var(--primary); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.back { gap: 0.35rem; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.back:hover { color: var(--primary); }
.linkbtn { display: inline-flex; align-items: center; gap: 0.3rem; }

progress { appearance: none; -webkit-appearance: none; height: 0.5rem; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

/* header */
.brand { gap: 0.55rem; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: var(--primary); color: var(--on-primary); }
.nav a { gap: 0.4rem; }
.nav a[aria-current="page"] { background: var(--info-bg); }
.avatar { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 0.8rem; margin-left: 0.25rem; }
.nav .who { gap: 0.4rem; }
.nav .logout { color: var(--muted); gap: 0.4rem; font-size: 0.9rem; }
.nav .logout:hover { color: var(--primary); }

/* start */
.hello h1 { font-size: 1.8rem; }
.due-pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 0.92rem; width: fit-content; }
.tile { border-radius: var(--radius-lg); box-shadow: var(--shadow); gap: 1rem; padding: 1.3rem; }
/* Equal tiles: each tile spans 4 rows of the shared grid, so head, progress, chips and footer line up across a row */
@supports (grid-template-rows: subgrid) {
  .tiles { grid-auto-rows: auto; }
  .tile { grid-row: span 4; grid-template-rows: subgrid; align-content: stretch; }
}
.tile-head { align-items: start; }
.tile-foot { align-self: end; }
.tile:hover { box-shadow: var(--shadow); border-color: var(--primary); background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); transform: none; }
.mono { width: 3.2rem; height: 3.2rem; border-radius: 14px; }
.mono .i { width: 1.6rem; height: 1.6rem; }
.mono-pcap { color: var(--mono-py-fg); }
.mono-ap1 { color: var(--mono-ap1-fg); }
.mono-wiso { color: var(--mono-wiso-fg); }
.tile-kicker { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tile-foot { border-top: 0; padding-top: 0; }
.tile-foot .go { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--info-bg); color: var(--primary); transition: transform 0.15s, background 0.15s; }
.tile:hover .go { background: var(--primary); color: var(--on-primary); }
.tile-foot { gap: 0.75rem; }
.last { display: flex; align-items: center; gap: 0.6rem; min-width: 0; font-weight: 400; }
.last .face { width: 1.9rem; height: 1.9rem; stroke-width: 1.8; }
.last-text { display: grid; line-height: 1.3; min-width: 0; }
.last-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.last-value { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last.ok { color: var(--ok); }
.last.fail { color: var(--bad); }
.last.none { color: var(--muted); }
.last.none .last-value { font-weight: 600; }

/* stats */
.stat { display: grid; grid-template-columns: auto 1fr; gap: 0 0.7rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.8rem 0.9rem; }
.stat .ico { grid-row: span 2; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--info-bg); color: var(--primary); }
.stat .ico.warn { background: var(--warn-bg); color: var(--warn); }
.stat .ico.ok { background: var(--ok-bg); color: var(--ok); }
.stat b { font-size: 1.25rem; line-height: 1.2; }

/* modes */
.mode { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.1rem 1.15rem; gap: 0.6rem; transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s; }
.mode:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.mode.is-main { border: 2px solid var(--primary); }
.mode-head { display: flex; align-items: center; gap: 0.7rem; }
.mode-ico { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--info-bg); color: var(--primary); flex: none; }
.mode-ico.exam { background: var(--warn-bg); color: var(--warn); }
.mode-go { display: inline-flex; align-items: center; gap: 0.3rem; }
/* simple training type buttons + legend */
.modes-simple { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.6rem; }
.mode-btn { display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem; padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mode-btn:hover { border-color: var(--primary); background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); }
.mode-btn .mode-title { flex: 1; font-size: 0.98rem; }
.mode-btn .mode-ico { width: 2.3rem; height: 2.3rem; border-radius: 10px; }
.mode-chev { color: var(--muted); }
.mode-btn:hover .mode-chev { color: var(--primary); }
.mode-ico.sm { width: 1.8rem; height: 1.8rem; border-radius: 8px; }
.mode-ico.sm .i { width: 1rem; height: 1rem; }
.legend-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.legend-box summary { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0 0.9rem; cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--muted); list-style: none; }
.legend-box summary::-webkit-details-marker { display: none; }
.legend-box summary::after { content: ""; margin-left: auto; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; }
.legend-box[open] summary::after { transform: rotate(-135deg); }
.legend-box summary:hover { color: var(--primary); }
.legend-box dl { display: grid; gap: 0; margin: 0; padding: 0 0.9rem 0.4rem; }
.legend-row { display: grid; gap: 0.25rem 1rem; padding: 0.7rem 0; border-top: 1px solid var(--border); }
@media (min-width: 40rem) { .legend-row { grid-template-columns: 15rem 1fr; } }
.legend-row dt { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.legend-row dd { margin: 0; display: grid; gap: 0.15rem; font-size: 0.92rem; }
/* topic picker */
.topic-list { display: grid; gap: 0.6rem; }
.topic-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main chev' 'bar chev' 'meta chev'; gap: 0.45rem 0.8rem; align-items: center; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.topic-btn:hover { border-color: var(--primary); background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); }
.topic-btn.is-weak { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.topic-main { grid-area: main; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.topic-title { font-weight: 700; }
.topic-bar { grid-area: bar; display: flex; align-items: center; gap: 0.6rem; }
.topic-bar .num { min-width: 2.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.topic-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.topic-btn .mode-chev { grid-area: chev; }
.topic-btn:hover .mode-chev { color: var(--primary); }
.topic-btn { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'check main' 'check bar' 'check meta'; }
.topic-check { grid-area: check; align-self: start; width: 1.3rem; height: 1.3rem; margin: 0.1rem 0 0; accent-color: var(--primary); }
.topic-btn.is-on { border: 2px solid var(--primary); padding: calc(0.9rem - 1px) calc(1rem - 1px); background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); }
.topic-go { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); min-height: 32px; padding: 0 0.55rem; }
.btn-ghost:hover { background: var(--info-bg); border-color: transparent; }
.badge-main { margin-left: auto; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .mode, .mode:hover, .tile .go { transition: none; transform: none; } }

/* question meta */
.chip .i { width: 0.95rem; height: 0.95rem; }
.diff { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.8rem; }
.diff i { width: 3px; border-radius: 1px; background: currentColor; opacity: 0.3; }
.diff i:nth-child(1) { height: 40%; } .diff i:nth-child(2) { height: 70%; } .diff i:nth-child(3) { height: 100%; }
.diff.d1 i:nth-child(1), .diff.d2 i:nth-child(-n+2), .diff.d3 i { opacity: 1; }
.star .i { width: 1.05rem; height: 1.05rem; }
.star[aria-pressed="true"] { background: var(--warn-bg); }
.translation { display: grid; gap: 0.45rem; padding-block: 0.35rem; }
.translation .lang { display: flex; align-items: center; gap: 0.35rem; margin: 0; line-height: 1; }
.translation .lang .i { width: 0.95rem; height: 0.95rem; vertical-align: 0; }
.translation p { margin: 0; }
.toggle .i { color: var(--muted); }
.mark { display: inline-flex; align-items: center; gap: 0.3rem; }
.line .btn { display: inline-grid; place-items: center; }
/* code_order lines are code too: dark like every code block */
.line { background: var(--code-bg); border-color: var(--code-line); }
.line code { color: var(--code-fg); font-size: 0.9rem; }
.line .btn { background: var(--code-gutter); border-color: var(--code-line); color: var(--code-fg); }
.line .btn:hover:not(:disabled) { border-color: var(--hl-fn); color: #ffffff; }
.line.is-correct { background: var(--code-bg); border: 2px solid #98c379 !important; }
.line.is-wrong { background: var(--code-bg); border: 2px solid #e06c75 !important; }

/* feedback */
.feedback { border-radius: var(--radius-lg); padding: 1.1rem 1.2rem; }
.feedback-head { display: flex; align-items: center; gap: 0.6rem; }
.feedback-head .i { width: 1.6rem; height: 1.6rem; }
.boxline { padding: 0.5rem 0.7rem; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--text); }
.boxline .i { color: var(--muted); }
.boxes i { border-radius: 6px; width: 1.55rem; height: 1.55rem; border-color: var(--border); color: var(--muted); opacity: 1; }
.boxes i.on { background: var(--primary); border-color: var(--primary); }
.boxes i.on span { color: var(--on-primary); }
.boxes i.was { border: 2px dashed var(--muted); }
.box-move { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
.ai-label .i { width: 1rem; height: 1rem; }
.quota .ai-label { gap: 0.3rem; }

/* simulation */
.timer { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.75rem; border-radius: 999px; background: var(--surface-2); }
.timer .i { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.sim-bar { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.grid-nav button { border-radius: 10px; }
.verdict { border-radius: var(--radius-lg); }
.verdict-ico { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin: 0 auto 0.3rem; border-radius: 50%; background: var(--surface); }
.verdict-ico .i { width: 1.7rem; height: 1.7rem; }

/* admin */
.card-title { display: flex; align-items: center; gap: 0.5rem; }
.card-title .i { color: var(--primary); }
.alert .card-title .i { color: var(--bad); }
.user-list button { border-radius: var(--radius); grid-template-columns: auto 1fr; column-gap: 0.65rem; align-items: center; }
.user-list .avatar { grid-row: span 2; margin: 0; }
.status-warn { color: var(--bad); display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.locked-ico { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--bad-bg); color: var(--bad); }
.locked-ico .i { width: 1.5rem; height: 1.5rem; }

/* breadcrumb: one navigation line above every page heading */
.crumbs { margin-bottom: 1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 0.15rem; min-width: 0; }
.crumbs .sep { width: 1rem; height: 1rem; color: var(--muted); opacity: 0.6; }
.crumb { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; padding: 0 0.6rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; }
.crumb .i { width: 1rem; height: 1rem; vertical-align: 0; }
a.crumb:hover { background: var(--surface-2); color: var(--primary); }
.crumb.is-current { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.crumb-lock { margin-left: auto; gap: 0.35rem; color: var(--warn); font-size: 0.82rem; font-weight: 600; }
.crumb-lock .i { width: 0.95rem; height: 0.95rem; }
@media (max-width: 30rem) { .crumb { padding: 0 0.45rem; } .crumb-lock span { display: none; } }
/* confidence before checking an answer */
.confidence { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.confidence .label { font-weight: 600; font-size: 0.92rem; }
.confidence .seg-opt span { min-height: var(--tap); }
.conf-note { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.55rem 0.75rem; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 0.92rem; }
.conf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 0.6rem; }
.trend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.trend .sep { width: 1rem; height: 1rem; color: var(--muted); }
.trend .chip.now { background: var(--primary); color: var(--on-primary); }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); }
.status-line code { font-size: 0.82rem; }
/* admin: exam profiles */
.w-input { width: 5.5rem; min-height: 38px; padding: 0.3rem 0.5rem; text-align: right; }
.sum-row td { font-weight: 700; border-bottom: 0; }
.pf-hint { display: flex; gap: 0.5rem; align-items: flex-start; }
/* light/dark switch in the header */
.nav .theme-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.nav .theme-btn:hover { color: var(--primary); background: var(--surface-2); }
.nav .theme-btn .i { width: 1.25rem; height: 1.25rem; }
/* admin: questions */
.q-id { font-family: var(--font-mono); font-size: 0.82rem; white-space: nowrap; color: var(--muted); }
.q-text { display: block; max-width: 38rem; overflow-wrap: anywhere; }
.dropzone { display: grid; justify-items: center; gap: 0.6rem; padding: 1.6rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius-lg); text-align: center; color: var(--muted); }
.dropzone .i { width: 2rem; height: 2rem; color: var(--primary); }
.msg-list { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.msg-list li { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.7rem; border-radius: var(--radius); }
.msg-list .err { background: var(--bad-bg); color: var(--bad); }
.msg-list .hint-row { background: var(--warn-bg); color: var(--warn); }
.dist td:first-child { max-width: 22rem; overflow-wrap: anywhere; }
.preview { display: grid; gap: 1rem; padding: 1rem; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.quote { margin: 0; padding-left: 0.7rem; border-left: 3px solid var(--border); color: var(--text); }
.report-form { display: grid; gap: 0.75rem; padding: 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.report-form textarea { min-height: 5rem; }
.report-done { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; }
/* group progress (trainer view) */
.ls-bar { display: flex; align-items: center; gap: 0.5rem; min-width: 7rem; }
.ls-bar progress { flex: 1; margin: 0; }
.ls-bar .num { min-width: 2.6rem; text-align: right; }
.ls-sec { display: grid; gap: 0.3rem; }
.ls-sec + .ls-sec { margin-top: 0.6rem; }
/* challenges */
.ch-list { display: grid; gap: 0.6rem; }
.ch-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 0.9rem; align-items: start; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
@media (min-width: 40rem) { .ch-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; } }
.ch-ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--ch-bg); color: var(--ch-fg); border: 1px solid var(--ch-border); }
.ch-body { display: grid; gap: 0.15rem; min-width: 0; }
.ch-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ch-title { font-size: 1rem; }
.ch-action { grid-column: 2; }
@media (min-width: 40rem) { .ch-action { grid-column: auto; } }
.ok-text { color: var(--ok); display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.warn-text { color: var(--ch-fg); display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.ch-teaser { margin-top: 1.75rem; }
/* .nav span gives every span 44px min-height and side padding; reset that for the counter */
.nav-badge { display: inline-grid; place-items: center; flex: none; align-self: center; box-sizing: border-box; min-width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0 0.28rem; margin-left: 0.1rem; border-radius: 999px; white-space: nowrap; background: var(--surface); color: var(--text); border: 1px solid var(--border); font-size: 0.7rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.board .place { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); }
.board .medal .i { width: 1.1rem; height: 1.1rem; }
.board .m1 { background: #f6e7a6; color: #7a5a00; }
.board .m2 { background: #e3e7ee; color: #4a5568; }
.board .m3 { background: #f2d6bd; color: #7a3e12; }
.board tr.me td { background: var(--info-bg); font-weight: 700; }
.verdict.neutral-v { background: var(--info-bg); color: var(--info); }
.rules { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: 0.5rem; align-items: flex-start; }
.rules .i { color: var(--ok); margin-top: 0.2rem; }
.nick-field { flex: 1 1 14rem; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 0.5rem; }
.pick { display: flex; align-items: center; gap: 0.6rem; min-height: var(--tap); padding: 0.4rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.pick input { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }
.pick:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); }
.pick .avatar { margin: 0; width: 1.9rem; height: 1.9rem; font-size: 0.72rem; }
.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 0.9rem; }
.seg-opt input:checked + span { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.user-list .avatar .i { width: 1rem; height: 1rem; }
.user-list .new-group { grid-template-columns: auto 1fr; color: var(--primary); border-style: dashed; }
.warn-note { background: var(--warn-bg); color: var(--warn); display: flex; gap: 0.5rem; align-items: flex-start; }
.ch-admin-row { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.ch-admin-row:first-child { border-top: 0; }
/* admin: table, toolbar, tabs, groups */
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem 1rem; }
.search { position: relative; flex: 1 1 16rem; display: flex; align-items: center; }
.search .i { position: absolute; left: 0.75rem; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: var(--tap); padding: 0.5rem 0.75rem 0.5rem 2.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.field-inline { display: grid; gap: 0.2rem; }
.field-inline label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field-inline select, select.auto-w { width: auto; min-width: 10rem; }
.card.flat { padding: 0; overflow: hidden; }
.users { font-size: 0.92rem; }
.users th { background: var(--surface-2); }
.users td, .users th { padding: 0.55rem 0.7rem; }
.users .cb { width: 2.6rem; }
.users .cb input { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }
.u-row { cursor: pointer; }
.u-row:hover td { background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); }
.u-name { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.u-name .avatar { margin: 0; width: 2rem; height: 2rem; flex: none; font-size: 0.72rem; }
.users .go-col { width: 2rem; color: var(--muted); }
.num-l { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-row { text-align: center; padding: 2rem 1rem !important; color: var(--muted); }
@media (max-width: 56rem) { .hide-m { display: none; } }
@media (max-width: 40rem) { .hide-s { display: none; } }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.75rem; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.6rem 0.9rem; margin-bottom: 0.75rem; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--info-bg); }
.bulk-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.bulk-group select { width: auto; min-height: 38px; padding: 0.3rem 0.6rem; }
.person-head { display: flex; align-items: center; gap: 1rem; }
.avatar.xl { width: 3.6rem; height: 3.6rem; font-size: 1.1rem; margin: 0; flex: none; background: var(--info-bg); color: var(--primary); }
.avatar.xl .i { width: 1.6rem; height: 1.6rem; }
.person-meta { display: grid; gap: 0.3rem; min-width: 0; }
/* Tabs wrap into a second line instead of scrolling: no scrollbars, every tab visible (wish of the user 2026-11-15). */
.tabs { display: flex; flex-wrap: wrap; gap: 0 0.25rem; border-bottom: 1px solid var(--border); }
.tab { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; min-height: var(--tap); padding: 0 0.9rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--bad); }
.tab-panel { display: grid; gap: 1rem; }
.save-bar { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.6rem; }
.split { display: grid; gap: 1rem; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }
.member-list { display: grid; }
.member-list.scroll { max-height: 26rem; overflow-y: auto; padding-right: 0.4rem; }
.member { display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.member:first-child { border-top: 0; }
.member .avatar { margin: 0; width: 2rem; height: 2rem; font-size: 0.72rem; flex: none; }
.member-name { display: grid; flex: 1; min-width: 0; }
.card.danger { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.toast { display: inline-flex; align-items: center; gap: 0.45rem; }
.toast .toast-undo { background: none; border: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: var(--tap); padding: 0 0.4rem; margin: -0.6rem -0.4rem -0.6rem 0.2rem; }
.toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 0.6rem 1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600; z-index: 20; max-width: calc(100% - 2rem); }

/* ---------------------------------------------------------------- navigation: grouped, built from one list */
.menu-btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: var(--tap); padding: 0 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.menu-btn b { font-weight: 600; }
.menu-btn:hover { border-color: var(--primary); }
.menu-panel { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.menu-panel .wrap { padding-block: 0.4rem 0.8rem; }
.nav-group { display: grid; gap: 2px; padding-block: 0.35rem; }
.nav-group + .nav-group { border-top: 1px solid var(--border); margin-top: 0.3rem; padding-top: 0.65rem; }
.nav-group-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0 0.75rem 0.25rem; }
.side-link { display: flex; align-items: center; gap: 0.65rem; min-height: var(--tap); padding: 0 0.75rem; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500; }
.side-link:hover { background: var(--surface-2); }
.side-link[aria-current="page"] { background: var(--info-bg); color: var(--primary); font-weight: 600; }
.side-link .nav-label { flex: 1; min-width: 0; }
.side-nav { display: none; }
@media (min-width: 56rem) {
  .menu-btn, .menu-panel { display: none !important; }
  .admin-shell { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: 1.75rem; align-items: start; }
  .side-nav { display: block; position: sticky; top: calc(3.6rem + env(safe-area-inset-top, 0px)); padding: 0.4rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
}
@media (max-width: 55.99rem) { .hide-mobile { display: none !important; } .user-menu .who-name { display: none; } }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0 0.45rem; border-radius: 999px; cursor: pointer; color: var(--text); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); }
.user-menu summary .i { width: 1rem; height: 1rem; color: var(--muted); }
.user-menu .avatar { margin: 0; font-style: normal; }
.user-menu .who-name { font-weight: 600; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 30; min-width: 15rem; display: grid; gap: 2px; padding: 0.35rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-hover); }
.menu-pop a { display: flex; align-items: center; gap: 0.6rem; min-height: var(--tap); padding: 0 0.75rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu-pop a:hover { background: var(--surface-2); }
.menu-pop .logout { color: var(--muted); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 0.2rem; }

/* ---------------------------------------------------------------- one look for every form control */
input[type="text"], input[type="number"], input[type="search"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius);
  background-color: var(--surface); color: var(--text); font: inherit; line-height: 1.4; transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:hover:not(:disabled), input[type="number"]:hover:not(:disabled), input[type="search"]:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
input[type="text"]:focus-visible, input[type="number"]:focus-visible, input[type="search"]:focus-visible, input[type="email"]:focus-visible, input[type="password"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1rem;
}
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.search input { padding-left: 2.4rem; background-color: var(--surface); }
.field-inline select, select.auto-w, .bulk-group select { width: auto; min-width: 10rem; min-height: var(--tap); padding-top: 0.55rem; padding-bottom: 0.55rem; }
.w-input { width: 6rem; min-height: var(--tap); text-align: right; }
.quota-field input { max-width: 10rem; }
:where(input[type="checkbox"], input[type="radio"]) { width: 1.2rem; height: 1.2rem; accent-color: var(--primary); }
.field label, .field-inline label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.field-inline { gap: 0; }
.seg-opt span { min-height: var(--tap); }
@media (pointer: coarse) { .btn-small, .btn-ghost { min-height: var(--tap); } }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

/* ---------------------------------------------------------------- app additions (not in the dummy) */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.skip-link { position: absolute; left: 0.5rem; top: -3rem; z-index: 50; padding: 0.6rem 1rem; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); font-weight: 600; }
.skip-link:focus { top: 0.5rem; }
.app-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.nav form { margin: 0; }
.menu-pop form { margin: 0; }
.menu-pop button { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: var(--tap); padding: 0 0.75rem; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 0.2rem; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.menu-pop button:hover { background: var(--surface-2); color: var(--primary); }
.narrow { width: 100%; max-width: 28rem; margin-inline: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; }
.note.ok-note { background: var(--ok-bg); color: var(--ok); display: flex; gap: 0.5rem; align-items: flex-start; }
.note.bad-note { background: var(--bad-bg); color: var(--bad); display: flex; gap: 0.5rem; align-items: flex-start; }
.note ul { margin: 0; padding-left: 1.1rem; }
.flashes { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.field .help { margin-top: 0.3rem; }
.temp-password { font-size: 1.1rem; padding: 0.3rem 0.6rem; user-select: all; }
.app-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: 0.875rem; color: var(--muted); }
.app-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; padding-block: 0.9rem; }
.app-footer nav { display: flex; gap: 1rem; }
.app-footer a { color: var(--muted); }
.impact { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.impact li { display: flex; gap: 0.5rem; align-items: flex-start; }
.impact .i { color: var(--bad); margin-top: 0.2rem; }
.gap-sm { gap: 0.35rem; }
.gap-0 { gap: 0; }
.mt-1 { margin-top: 1rem; }
.btn-block { width: 100%; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.debug summary { cursor: pointer; font-weight: 600; }
.debug pre { margin-top: 0.75rem; }
/* light/dark switch: shows the moon in light design and the sun in dark design */
.theme-btn .when-dark { display: none; }
:root[data-theme="dark"] .theme-btn .when-dark { display: inline; }
:root[data-theme="dark"] .theme-btn .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .when-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-btn .when-light { display: none; }
}
.locked-ico { margin-bottom: 0.25rem; }
.tab { text-decoration: none; }
.tab[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.admin-main { min-width: 0; }
.bulk-bar[hidden] { display: none; }
.filter-submit { align-self: end; }
.js .filter-submit { display: none; }
.prose { max-width: 48rem; }
.prose h2 { margin-top: 0.5rem; }
.prose ul { margin: 0; padding-left: 1.2rem; }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: default; pointer-events: none; }
/* password rules below the field: ticked off while typing */
.pw-rules { display: grid; gap: 0.2rem; margin: 0.4rem 0 0; padding: 0; list-style: none; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 0.4rem; }
.pw-rules .i { width: 0.95rem; height: 0.95rem; opacity: 0.35; }
.pw-rules li.is-met { color: var(--ok); }
.pw-rules li.is-met .i { opacity: 1; }
.pw-rules ul { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
/* course colours by position (courses come from the import, so no colour per course id) */
:root { --c0: var(--mono-py); --c1: var(--mono-ap1); --c2: var(--mono-wiso); --c3: #ece3f7; --c4: #dff1f2; --c5: #f7e1e6;
        --c0-fg: var(--mono-py-fg); --c1-fg: var(--mono-ap1-fg); --c2-fg: var(--mono-wiso-fg); --c3-fg: #6a3fa0; --c4-fg: #17717a; --c5-fg: #a3324c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c3: #2f2440; --c4: #1b3436; --c5: #3d1f27; --c3-fg: #c9a8f2; --c4-fg: #8fd8de; --c5-fg: #f2a5b6; } }
:root[data-theme="dark"] { --c3: #2f2440; --c4: #1b3436; --c5: #3d1f27; --c3-fg: #c9a8f2; --c4-fg: #8fd8de; --c5-fg: #f2a5b6; }
.mono-c0 { background: var(--c0); color: var(--c0-fg); } .mono-c1 { background: var(--c1); color: var(--c1-fg); }
.mono-c2 { background: var(--c2); color: var(--c2-fg); } .mono-c3 { background: var(--c3); color: var(--c3-fg); }
.mono-c4 { background: var(--c4); color: var(--c4-fg); } .mono-c5 { background: var(--c5); color: var(--c5-fg); }
.mono { font-size: 0.82rem; }
.course-head { margin-bottom: 0; }
/* question admin */
.q-text + .small { display: block; }
.block { display: block; }
.break-all { overflow-wrap: anywhere; }
.preview-card:has(#q-de:not(:checked)) .translation,
.preview-card:has(#q-de:not(:checked)) .translation-inline { display: none; }
.translation-inline { display: block; }
.order-steps { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.35rem; }
label.dropzone { cursor: pointer; }
.dropzone.is-over { border-color: var(--primary); background: var(--info-bg); }
.msg-list li span { overflow-wrap: anywhere; }
.verdict strong { font-size: 1.05rem; }
/* tab "Kurse" on the person page */
.grant-row { display: grid; gap: 0.4rem 1rem; align-items: center; }
@media (min-width: 40rem) { .grant-row { grid-template-columns: minmax(0, 1fr) 12rem; } }
.grant-row .field-inline input { min-height: var(--tap); }
/* training */
a.mode-btn { text-decoration: none; }
.feedback:focus { outline: none; }
.line-de { display: block; flex-basis: 100%; color: var(--code-fg); opacity: 0.75; padding: 0 0.4rem 0.2rem 0; }
.line { flex-wrap: wrap; }
.lines .empty-line { list-style: none; padding: 0.4rem; }
.sortable-ghost { opacity: 0.4; }
.sortable-chosen { box-shadow: var(--shadow-hover); }
.line { cursor: grab; }
.criterion { display: grid; gap: 0.4rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.criterion .pts { font-weight: 700; white-space: nowrap; }
.summary-score { font-size: 1.6rem; font-weight: 800; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.model-answer > :first-child { margin-top: 0; }
.qtext p + p, .explain p + p { margin-top: 0.5rem; }

/* Phase 4: groups */
.member form { flex: none; margin: 0; }

/* Phase 5: exam simulation */
[hidden] { display: none !important; }
/* One-column grids never grow wider than the page: long code lines scroll inside their <pre>. */
.stack, .qcard, .review-item, .sim-layout, .tab-panel { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) { .sim-layout { grid-template-columns: minmax(0, 1fr) 17rem; } }
/* Matching: long options and the hint "richtig wäre: …" wrap instead of widening the page. */
.match-row { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .match-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); } }
.match-row select { width: 100%; min-width: 0; max-width: 100%; }
.match-row .mark { white-space: normal; }
.course-admin-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.course-admin-links .small .i { vertical-align: -0.15em; }
.sim-note { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.sim-aside-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0; }
.review-item { display: grid; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.review-item:first-of-type { border-top: 0; padding-top: 0; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.review-head .mark { margin-left: auto; }
.bar-cell progress { flex: 1; min-width: 4rem; }
.bar-pct { min-width: 3.2rem; text-align: right; }

/* Mix courses */
.show-s { display: none; }
@media (max-width: 40rem) { .show-s { display: inline; } }
.mix-form summary { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap); cursor: pointer; list-style: none; color: var(--primary); }
.mix-form summary::-webkit-details-marker { display: none; }
.mix-form[open] summary { margin-bottom: 0.5rem; }
.mix-sources { display: grid; gap: 0; margin: 0.3rem 0 0; padding: 0; list-style: none; font-size: 0.92rem; }
.mix-sources li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid var(--border); }
.mix-sources li:first-child { border-top: 0; }
.mix-sources .num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* row whose items sit on the bottom line: a field with label next to its button */
.row-end { align-items: flex-end; }

/* AI setting of groups and people (SPEC 8): only show the fields the chosen mode needs */
.ai-choice:has(input[value="off"]:checked) .ai-quota,
.ai-choice:has(input[value="unlimited"]:checked) > .ai-quota,
.ai-choice:not(:has(input[value="unlimited"]:checked)) .ai-until { display: none; }
.card:has(#src-group:checked) .ai-own { display: none; }

/* Building block "Liste bearbeiten" (question editor: options, pairs, criteria, variants) */
.edit-list { display: grid; gap: 0.6rem; }
.edit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; align-items: start; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.edit-fields { display: grid; gap: 0.6rem; min-width: 0; }
.edit-tools { display: flex; flex-direction: column; gap: 0.25rem; }
.edit-flags { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.mini-check { display: inline-flex; align-items: center; gap: 0.45rem; min-height: var(--tap); font-size: 0.92rem; cursor: pointer; }
.mini-check input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--primary); }
textarea.code-input { font-family: var(--font-mono); font-size: 0.9rem; white-space: pre; overflow-x: auto; tab-size: 4; }
/* Question picture ("Fragebild"): below the question text, white behind transparent diagrams, tap to enlarge */
.q-figure { margin: 0; display: grid; gap: 0.3rem; min-width: 0; }
.q-zoom { display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: var(--radius); cursor: default; }
.q-figure.can-zoom .q-zoom { cursor: zoom-in; }
.q-figure.is-zoomed .q-zoom { cursor: zoom-out; }
.q-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.q-figure figcaption { display: none; }
.q-figure.can-zoom:not(.is-zoomed) img { width: auto; max-width: 100%; max-height: 70vh; max-height: 70dvh; margin-inline: auto; }
.q-figure.can-zoom figcaption, .q-figure.is-zoomed figcaption { display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--muted); }
/* Picture field in the question editor */
.image-current { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 0.9rem; align-items: start; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.image-current img { width: 100%; max-height: 9rem; object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.image-meta { display: grid; gap: 0.4rem; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 48rem) {
  .edit-fields.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .edit-fields.two .span-2 { grid-column: 1 / -1; }
  .edit-fields.crit { grid-template-columns: minmax(0, 1fr) 7rem; }
}
/* Question editor: translation fields only while the switch is on */
.question-editor:not(:has(#ed-de:checked)) .de-field { display: none; }

/* Installable app (PWA): offline page and install guide */
.offline-card { max-width: 32rem; margin: 1.5rem auto 0; }
.offline-card .locked-ico { background: var(--surface-2); color: var(--muted); }
.install-steps { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.35rem; }
.install-steps .i { margin-right: 0.2rem; }

.report-row { margin-top: 0.5rem; }

/* Medals: three coins (25/50/75 % sicher gelernt) and the gold medal (100 %), SPEC 6.7 */
.medal-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 0.8rem; }
.medal-trail { display: inline-flex; align-items: center; gap: 0.3rem; }
.medal-trail svg { width: 1.2rem; height: 1.2rem; flex: none; }
.medal-trail svg.medal { width: 1.8rem; height: 1.8rem; margin-left: 0.15rem; }
.medal-trail.lg { gap: 0.5rem; }
.medal-trail.lg svg { width: 2.1rem; height: 2.1rem; }
.medal-trail.lg svg.medal { width: 3.4rem; height: 3.4rem; margin-left: 0.3rem; }
.medal-trail.xl svg.medal { width: 5rem; height: 5rem; }
.coin-1 { --metal: #c27c3e; }
.coin-2 { --metal: #a9b3bf; }
.coin-3, .medal { --metal: #e3a90b; }
.coin .face, .medal .face { fill: var(--metal); stroke: color-mix(in srgb, var(--metal) 62%, #000); stroke-width: 1.4; }
.coin .rim, .medal .rim { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 1.1; }
.coin .mark, .medal .mark { fill: rgba(255, 255, 255, 0.9); }
.medal .band-l { fill: #1f5fbf; }
.medal .band-r { fill: #4f86df; }
.medal-trail .is-off .face { fill: none; stroke: var(--border); stroke-width: 1.6; stroke-dasharray: 3 2.4; }
.medal-trail .is-off .rim, .medal-trail .is-off .mark { display: none; }
.medal-trail .is-off .band-l, .medal-trail .is-off .band-r { fill: var(--border); }
.medal-card { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.medal-card .medal-text { flex: 1 1 14rem; display: grid; gap: 0.3rem; }
.celebrate { display: grid; justify-items: center; text-align: center; gap: 0.6rem; background: linear-gradient(180deg, color-mix(in srgb, #e3a90b 14%, var(--surface)), var(--surface) 70%); }
.celebrate h2 { font-size: 1.5rem; margin: 0; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* Role mark in the header (admin, super admin): shield on the avatar always, chip beside the name from tablet width */
.avatar.role-admin, .avatar.role-super { position: relative; box-shadow: 0 0 0 2px var(--role-ring); }
.avatar.role-admin { --role-ring: var(--info); --role-bg: var(--info-bg); }
.avatar.role-super { --role-ring: var(--ch-fg); --role-bg: var(--ch-bg); }
.role-dot { position: absolute; right: -0.3rem; bottom: -0.3rem; display: grid; place-items: center; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--role-bg); color: var(--role-ring); box-shadow: 0 0 0 2px var(--surface); }
.user-menu summary .role-dot .i, .role-dot .i { width: 0.7rem; height: 0.7rem; color: inherit; }
.role-chip.role-admin { background: var(--info-bg); color: var(--info); }
.role-chip.role-super { background: var(--ch-bg); color: var(--ch-fg); }
@media (max-width: 55.99rem) { .user-menu .role-chip { display: none; } }
/* formatting help in the question editor: what to type (dashed box) and how it looks */
pre.md-source { padding: 0.55rem 0.75rem; background: var(--surface); border: 1px dashed var(--border); color: var(--text); font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.md-result { font-size: 0.98rem; padding: 0.7rem 0.85rem; gap: 0.5rem; }
.legend-box dd .md-source + .small, .legend-box dd .md-result + .small { margin-top: 0.25rem; }
.md-help .legend-row dt { align-items: flex-start; }
/* formatting toolbar above editor fields (md-toolbar.js); inline fields show it only while focused */
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.md-toolbar + textarea, .md-toolbar + input { border-top-left-radius: 0; border-top-right-radius: 0; }
.md-toolbar .btn { min-height: 2.25rem; }
.md-toolbar .md-select { width: auto; min-height: 2.25rem; padding-block: 0.2rem; font-size: 0.9rem; }
.field:not(:focus-within) > .md-toolbar.md-inline { display: none; }
.field:not(:focus-within) > .md-toolbar.md-inline + input { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.md-live { display: grid; gap: 0.3rem; }
@media (pointer: coarse) { .md-toolbar .btn, .md-toolbar .md-select { min-height: var(--tap); } }
