:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1b1f2a;
  --muted: #5d6475;
  --border: #e1e4ec;
  --accent: #4f46e5;
  --accent-soft: #eceafe;
  --on-accent: #ffffff;
  --ok: #157a3a;
  --ok-bg: #e7f5ec;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --warn: #b45309;
  --code-bg: #f3f4f8;
  --hl-keyword: #a626a4;
  --hl-string: #2f7d32;
  --hl-number: #b45309;
  --hl-builtin: #0b6fa4;
  --hl-title: #4f46e5;
  --hl-comment: #8a8f9c;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1117;
    --surface: #181b24;
    --text: #e6e8ee;
    --muted: #9aa1b2;
    --border: #2b303d;
    --accent: #8f88ff;
    --accent-soft: #25234a;
    --on-accent: #0f1117;
    --ok: #5ad48a;
    --ok-bg: #13301f;
    --bad: #ff8a80;
    --bad-bg: #3a1a18;
    --warn: #f0b35a;
    --code-bg: #12151c;
    --hl-keyword: #d68cf0;
    --hl-string: #9fd88a;
    --hl-number: #f0b35a;
    --hl-builtin: #6fc3f0;
    --hl-title: #a9a4ff;
    --hl-comment: #6f7686;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #181b24;
  --text: #e6e8ee;
  --muted: #9aa1b2;
  --border: #2b303d;
  --accent: #8f88ff;
  --accent-soft: #25234a;
  --on-accent: #0f1117;
  --ok: #5ad48a;
  --ok-bg: #13301f;
  --bad: #ff8a80;
  --bad-bg: #3a1a18;
  --warn: #f0b35a;
  --code-bg: #12151c;
  --hl-keyword: #d68cf0;
  --hl-string: #9fd88a;
  --hl-number: #f0b35a;
  --hl-builtin: #6fc3f0;
  --hl-title: #a9a4ff;
  --hl-comment: #6f7686;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
}
body.wide header.site, body.wide main { max-width: 1100px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-family: Georgia, serif;
}
header.site nav { display: flex; align-items: center; gap: 16px; }
header.site { gap: 16px; }
.theme-switch button { font-size: 0.95rem; padding: 2px 9px; }
header.site nav a { text-decoration: none; font-weight: 500; }
/* Dashboard: logo și cont (nume, Ieși, temă) pe primul rând, meniul pe al doilea. Elementele nu se rup în
   mijloc; dacă nu încap, trec întregi pe rândul următor. */
body.prof header.site { flex-wrap: wrap; row-gap: 10px; }
body.prof header.site nav { order: 3; flex: 1 0 100%; flex-wrap: wrap; gap: 6px 18px; }
.prof-account { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.prof-account a { text-decoration: none; font-weight: 500; }
.prof-account a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.brand, header.site nav > a, .nav-menu summary, .prof-account a { white-space: nowrap; }
.theme-switch { flex-shrink: 0; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  border: 0; border-radius: 0; padding: 4px 10px; font-size: 0.8rem; font-weight: 700;
  color: var(--muted); background: transparent;
}
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.fs-btn { padding: 6px 12px; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

.notice { background: var(--accent-soft); color: var(--text); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }

main { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

h1 { font-size: 1.5rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 4px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.error { color: var(--bad); min-height: 0; margin: 8px 0; }
.error:empty, .hint:empty { display: none; }
.hint { color: var(--warn); margin: 8px 0 0; }

/* ---------- formulare și butoane */

.field { display: grid; gap: 6px; margin: 14px 0; }
label { font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
textarea { resize: vertical; }
.mono { font-family: var(--mono); font-size: 0.92rem; }
textarea.mono { tab-size: 4; line-height: 1.5; }
textarea[readonly] { background: var(--code-bg); }

button, .button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.6; cursor: progress; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.ghost { background: transparent; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
button.mode { display: grid; gap: 2px; text-align: left; padding: 12px 14px; }
.mode-title { font-size: 1rem; }
.mode-note { font-size: 0.8rem; font-weight: 400; opacity: 0.85; }
.pill.home { background: var(--ok-bg); color: var(--ok); }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } }
.slot { margin: 0 0 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.wrap select { width: auto; flex: 1 1 220px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions.center { justify-content: center; }

/* ---------- quiz */

.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.lab-title { font-weight: 700; }
.score { font-size: 1.25rem; white-space: nowrap; }

.dots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.dot {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
}
.dot.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.dot.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.dot.current { outline: 2px solid var(--accent); outline-offset: 2px; color: var(--text); }

.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; }
.pill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-weight: 600; }

.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.question > .md { font-size: 1.05rem; margin-bottom: 12px; }
.md code, code { font-family: var(--mono); font-size: 0.9em; }
.md :not(pre) > code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
pre code { font-family: var(--mono); }
pre.plain { font-family: var(--mono); white-space: pre-wrap; }

.options { display: grid; gap: 8px; margin: 12px 0; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  font-weight: 400; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.opt:hover { border-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { width: auto; margin-top: 4px; accent-color: var(--accent); }
.opt .md { flex: 1; min-width: 0; }
.opt pre { margin: 0; }
/* După răspuns: .options în față ca să bată regula :has(input:checked). */
.options .opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.options .opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.options .opt.missed { border-style: dashed; }
.opt:has(input:disabled) { cursor: default; }

.code-answer { display: grid; gap: 8px; margin: 12px 0; }
.run-output:empty { display: none; }
.run-output { border-radius: 8px; padding: 10px 12px; background: var(--code-bg); border: 1px solid var(--border); }
.run-output.ok { background: var(--ok-bg); border-color: var(--ok); }
.run-output.bad { background: var(--bad-bg); border-color: var(--bad); }
.run-output pre { margin: 6px 0 0; }
details.tests summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }

.feedback { border-radius: 10px; padding: 14px 16px; margin-top: 16px; border: 1px solid; }
.feedback.ok { background: var(--ok-bg); border-color: var(--ok); }
.feedback.bad { background: var(--bad-bg); border-color: var(--bad); }
.feedback.ok h3 { color: var(--ok); }
.feedback.bad h3 { color: var(--bad); }
.feedback .label { font-weight: 600; margin: 8px 0 0; font-size: 0.9rem; }
.feedback pre { background: var(--surface); }

.finish { text-align: center; }
.big-score { font-size: 3rem; font-weight: 800; margin: 8px 0; }
.big-score .muted { font-size: 1.5rem; font-weight: 600; }

/* ---------- clasament */

.controls h1 { display: flex; align-items: center; gap: 10px; }
.live { font-size: 0.8rem; color: var(--bad); font-weight: 700; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .live { animation: none; } }

.board-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.board-layout > .card { margin-bottom: 0; overflow-x: auto; }
.join { display: none; }

table.leaderboard { width: 100%; border-collapse: collapse; }
.leaderboard th, .leaderboard td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.leaderboard th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.leaderboard .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.leaderboard .rank { width: 3em; text-align: center; font-variant-numeric: tabular-nums; }
.leaderboard tr.me td { background: var(--accent-soft); }
.leaderboard .name { overflow-wrap: anywhere; }

.stats { display: grid; gap: 6px; margin-top: 12px; }
.stat summary { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.stat-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 999px; background: var(--code-bg); border: 1px solid var(--border); overflow: hidden; }
.fill { display: block; height: 100%; background: var(--ok); }
.fill.low { background: var(--bad); }
.stat[open] { padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* Mod proiector: text mare, codul QR pentru intrare lângă clasament. */
body.projector { font-size: 22px; }
body.projector header.site, body.projector main { max-width: none; }
body.projector .board-layout { grid-template-columns: 1fr 300px; align-items: start; }
body.projector .join { display: block; text-align: center; background: #fff; color: #111; border-radius: var(--radius); padding: 16px; }
body.projector .join .qr svg { width: 100%; height: auto; display: block; }
body.projector .join p { margin: 8px 0 0; font-size: 1rem; }

@media (max-width: 560px) {
  .card { padding: 16px; }
  .hide-sm { display: none; }
  .quiz-head { align-items: flex-start; }
  .big-score { font-size: 2.4rem; }
  pre { font-size: 0.8rem; padding: 10px 12px; }
}

/* ---------- highlight.js */
.hljs-keyword, .hljs-meta .hljs-keyword { color: var(--hl-keyword); }
.hljs-string { color: var(--hl-string); }
.hljs-number, .hljs-literal { color: var(--hl-number); }
.hljs-built_in { color: var(--hl-builtin); }
.hljs-title, .hljs-title.function_ { color: var(--hl-title); }
.hljs-comment { color: var(--hl-comment); font-style: italic; }
.hljs-params { color: inherit; }

/* ---------- dashboard profesori */

body.prof header.site nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.small-btn { padding: 4px 10px; font-size: 0.85rem; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: var(--bad-bg); }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.card .field { display: grid; gap: 4px; margin: 12px 0; }
.card .field > span { font-weight: 600; font-size: 0.9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; align-items: end; }
.form-grid .field > span { min-height: 1.4em; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 8px 0; }
label.check input { width: auto; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.list th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.list.compact td { padding: 4px 8px; font-size: 0.9rem; }
table.list .pill { margin-left: 8px; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
details.archived { margin-top: 12px; }
details.archived summary { cursor: pointer; color: var(--muted); }

.invites { display: grid; gap: 8px; }
.invite { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.invite.inactive { opacity: 0.6; }
.invite-result .row input { flex: 1; }
.invite-result:not(:empty) { margin: 12px 0; padding: 12px; border-radius: 8px; background: var(--accent-soft); }

dialog.modal {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--text);
}
dialog.modal::backdrop { background: rgb(0 0 0 / 0.45); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); color: #fff; }

/* catalog */
.gb-head h1 { margin-bottom: 2px; }
.gb-card { padding: 12px; }
.gb-scroll { overflow-x: auto; }
table.gradebook { border-collapse: separate; border-spacing: 0; font-size: 0.9rem; min-width: 100%; }
.gradebook th, .gradebook td { border-bottom: 1px solid var(--border); padding: 0; height: 34px; white-space: nowrap; }
.gradebook th { font-size: 0.75rem; color: var(--muted); padding: 0 6px; position: sticky; top: 0; background: var(--surface); }
.gradebook .num { text-align: right; padding: 0 8px; font-variant-numeric: tabular-nums; }
.gradebook .idx { color: var(--muted); width: 2.5em; }
/* numele rămâne vizibil când tabelul se derulează pe orizontală */
.gradebook .name { position: sticky; left: 0; background: var(--surface); z-index: 1; padding: 0 10px 0 6px; min-width: 190px; text-align: left; border-right: 1px solid var(--border); }
.gradebook .name .note { display: block; font-size: 0.75rem; line-height: 1.1; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; text-align: left; }
.linklike:hover { color: var(--accent); text-decoration: underline; }
.gradebook th.week, .gradebook td.week { width: 30px; text-align: center; padding: 0; }
.gradebook .current { background: var(--accent-soft); }
.gradebook th.current { color: var(--accent); }
button.att {
  width: 28px; height: 28px; padding: 0; margin: 3px 1px; border-radius: 6px; font-weight: 700; font-size: 0.85rem;
  border: 1px solid var(--border); background: transparent; color: var(--ok);
}
button.att[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok); }
.gradebook .total { font-weight: 700; border-left: 1px solid var(--border); }
.gradebook .grade-cell { padding: 0 2px; }
input.grade { width: 52px; padding: 4px 6px; text-align: right; font-variant-numeric: tabular-nums; border-radius: 6px; }
input.grade.saved { border-color: var(--ok); background: var(--ok-bg); transition: background 0.3s; }
.gradebook .computed { color: var(--muted); }
.gradebook .final { color: var(--text); font-weight: 700; }
.gradebook tfoot td { font-size: 0.8rem; color: var(--muted); text-align: center; border-bottom: 0; }
.gradebook tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.gradebook tbody tr:hover td.name { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.import-preview { margin-top: 8px; max-height: 320px; overflow: auto; }

/* ---------- modul de recapitulare: recursivitate (src/web/visual/recursion.ts) */

.rv { --pu: #7F77DD; --bl: #378ADD; --te: #1D9E75; --am: #EF9F27; --re: #E24B4A; font-size: 0.95rem; }
.rv-top, .rv-settings, .rv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rv-top { justify-content: space-between; margin-bottom: 12px; }
.rv-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-levels button { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 0.9rem; }
.rv-levels button[aria-pressed="true"] { border-color: var(--pu); background: rgba(127, 119, 221, 0.18); }
.rv-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 0.75rem; background: var(--pu); color: #fff; }
.rv-levels button.done .rv-num { background: var(--te); }
.rv-levels button.done .rv-num::after { content: "✓"; }
.rv-levels button.done .rv-num { font-size: 0; }
.rv-levels button.done .rv-num::after { font-size: 0.75rem; }
.rv-score { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--am); background: rgba(239, 159, 39, 0.16); font-weight: 600; }
.rv-settings { gap: 18px; margin-bottom: 14px; font-size: 0.85rem; color: var(--muted); }
.rv-settings label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.85rem; }
.rv-settings input[type="checkbox"], .rv-settings input[type="range"] { width: auto; accent-color: var(--pu); }
.rv-settings select { width: auto; padding: 4px 8px; }
.rv-settings b { color: var(--text); min-width: 1ch; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.rv-left { min-width: 0; }
.rv-label { font-size: 0.8rem; color: var(--muted); margin: 12px 0 4px; }
.rv-split { display: flex; justify-content: space-between; margin-top: 0; }
.rv-split span:last-child { font-family: var(--mono); color: var(--text); }

.rv-code { margin: 0; padding: 10px 0; font-size: 0.85rem; --hl: transparent; --hc: transparent; }
.rv-code.k-active { --hl: rgba(127, 119, 221, 0.2); --hc: var(--pu); }
.rv-code.k-waiting { --hl: rgba(55, 138, 221, 0.16); --hc: var(--bl); }
.rv-code.k-base { --hl: rgba(29, 158, 117, 0.2); --hc: var(--te); }
.rv-code.k-returning { --hl: rgba(239, 159, 39, 0.22); --hc: var(--am); }
.rv-code.k-overflow { --hl: rgba(226, 75, 74, 0.2); --hc: var(--re); }
.rv-ln { display: block; padding: 2px 14px; white-space: pre; border-left: 4px solid transparent; transition: background 0.3s, border-color 0.3s; }
.rv-ln.on { background: var(--hl); border-left-color: var(--hc); }

.rv-expr { min-height: 34px; }
.rv-chip { display: inline-block; font-family: var(--mono); font-size: 0.9rem; padding: 2px 8px; margin: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--code-bg); }
.rv-chip.call { border-color: var(--pu); background: rgba(127, 119, 221, 0.16); }
.rv-chip.q { border-color: var(--am); background: rgba(239, 159, 39, 0.22); }
.rv-chip.res { border-color: var(--te); background: rgba(29, 158, 117, 0.2); font-weight: 700; }

.rv-msg { position: relative; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--code-bg); line-height: 1.6; min-height: 90px; }
.rv-msg.quiz { background: rgba(239, 159, 39, 0.12); border: 1.5px solid var(--am); }
.rv-msg.boom { border: 1.5px solid var(--re); }
.rv-q { display: flex; gap: 10px; align-items: flex-start; }
.rv-qi { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--am); color: #fff; font-weight: 700; }
.rv-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rv-opts button { font-family: var(--mono); font-size: 0.95rem; min-width: 64px; }
.rv-opts button.ok { border-color: var(--te); background: rgba(29, 158, 117, 0.22); opacity: 1; }
.rv-opts button.bad { border-color: var(--re); background: rgba(226, 75, 74, 0.18); opacity: 1; }
.rv-err { color: var(--bad); font-size: 0.85rem; min-height: 1.2em; margin-top: 6px; }
.rv-ok { color: var(--ok); font-weight: 700; margin-bottom: 4px; }
.rv-bad { color: var(--bad); font-weight: 700; margin-bottom: 4px; }
.rv-next { margin-top: 10px; }
.rv-term { margin: 10px 0; padding: 10px 12px; font-family: var(--mono); font-size: 0.75rem; line-height: 1.5; background: #16181f; color: #d6d9e0; border: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-never { color: var(--bad); font-weight: 600; font-size: 0.85rem; }
.rv-term .err { color: #ff8a80; font-weight: 700; }

.rv-stack { position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-start; min-height: 300px; padding: 10px; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--border); transition: border-color 0.3s, background 0.3s; }
.rv-stack.boom { border-color: var(--re); background: rgba(226, 75, 74, 0.08); }
.rv-fr { --c: var(--pu); --f: rgba(127, 119, 221, 0.16); display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 7px 10px; border-radius: 10px; border: 1.5px solid var(--c); background: var(--f); transition: background 0.3s, border-color 0.3s; }
.rv-fr.k-waiting { --c: var(--bl); --f: rgba(55, 138, 221, 0.1); }
.rv-fr.k-base { --c: var(--te); --f: rgba(29, 158, 117, 0.16); }
.rv-fr.k-returning { --c: var(--am); --f: rgba(239, 159, 39, 0.16); }
.rv-fr.k-overflow { --c: var(--re); --f: rgba(226, 75, 74, 0.14); }
.rv-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; font-size: 0.85rem; }
.rv-fr b { font-family: var(--mono); font-weight: 600; }
.rv-fr small { display: block; font-size: 0.78rem; color: var(--muted); }
.rv-val { margin-left: auto; font-family: var(--mono); font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--c); color: #fff; }
.rv-ghost { margin-top: 6px; padding: 6px 10px; border-radius: 10px; border: 1.5px dashed var(--am); font-size: 0.85rem; color: var(--muted); }
.rv-gap { margin-top: 6px; text-align: center; font-size: 0.85rem; color: var(--re); font-weight: 600; }
.rv-empty { margin: auto; color: var(--muted); font-size: 0.85rem; }
.rv-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 0.75rem; color: var(--muted); }
.rv-legend span { display: flex; align-items: center; gap: 5px; }
.rv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--c); background: var(--f); }
.rv-legend .k-active { --c: var(--pu); --f: rgba(127, 119, 221, 0.16); }
.rv-legend .k-waiting { --c: var(--bl); --f: rgba(55, 138, 221, 0.1); }
.rv-legend .k-base { --c: var(--te); --f: rgba(29, 158, 117, 0.16); }
.rv-legend .k-returning { --c: var(--am); --f: rgba(239, 159, 39, 0.16); }
.rv-legend .k-overflow { --c: var(--re); --f: rgba(226, 75, 74, 0.14); }

.rv-controls { margin-top: 16px; }
.rv-controls [data-r="play"] { min-width: 110px; }
.rv-bar { flex: 1; min-width: 80px; height: 6px; border-radius: 999px; background: var(--code-bg); overflow: hidden; }
.rv-bar span { display: block; height: 100%; background: var(--pu); transition: width 0.35s; }
.rv-count { font-size: 0.8rem; color: var(--muted); }
.rv-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; }

@media (prefers-reduced-motion: no-preference) {
  .rv-fr.new { animation: rv-drop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .rv-fr.hit { animation: rv-hit 0.5s ease-out; }
  .rv-fr.pop .rv-ic { animation: rv-spin 0.6s ease-out; }
  .rv-ghost { animation: rv-fly 1s ease-out forwards; }
  .rv-stack.boom { animation: rv-shake 0.5s ease-in-out 2; }
  .rv-chip.last { animation: rv-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .rv .wob { animation: rv-shake 0.35s ease-in-out; }
  .rv-dot { animation: rv-burst 0.8s ease-out forwards; }
  .rv-term .err { animation: rv-pop 0.5s 0.3s both; }
}
@keyframes rv-drop { from { transform: translateY(-46px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rv-hit { 40% { transform: scale(1.05); } 100% { transform: none; } }
@keyframes rv-spin { from { transform: rotate(-180deg) scale(0.4); } to { transform: none; } }
@keyframes rv-fly { from { transform: none; opacity: 1; } to { transform: translateY(-22px); opacity: 0.25; } }
@keyframes rv-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes rv-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rv-burst { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; } }
.rv-term span { display: inline; }
.warmup-head h1 { margin-bottom: 4px; }
.warmup-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.rv-term .err { display: inline-block; }

/* ---------- modul de recapitulare: liste (src/web/visual/lists.ts); refolosește clasele rv-* */

.lv { --cw: 46px; --gap: 7px; }
.lv-scene { min-width: 0; }
.lv-grid { margin-top: 14px; align-items: start; }
.lv .rv-msg { margin-top: 0; }
.lv-strip { display: flex; gap: var(--gap); padding: 4px 2px 0; overflow-x: auto; }
.lv-cell { flex: none; width: var(--cw); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lv-far { position: relative; margin-left: 4px; }
.lv-far::before { content: "…"; position: absolute; left: -10px; top: 26px; color: var(--muted); }
.lv-idx { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.lv-idx.neg { color: var(--re); }
.lv-tag { min-height: 1.1em; font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.lv-tag.bad { color: var(--re); }
.lv-box { --c: var(--border); --f: var(--surface); display: inline-grid; place-items: center; min-width: var(--cw); height: 42px; padding: 0 6px; border-radius: 10px; border: 2px solid var(--c); background: var(--f); font-family: var(--mono); font-weight: 700; font-size: 1.05rem; transition: transform 0.3s, background 0.3s, border-color 0.3s, opacity 0.3s; }
.lv-box.sm { min-width: 36px; height: 32px; font-size: 0.9rem; border-radius: 8px; border-width: 1.5px; }
.lv-box.big { min-width: 72px; height: 52px; font-size: 1.4rem; }
.lv-box.pick { --c: var(--am); --f: rgba(239, 159, 39, 0.22); transform: translateY(-5px); }
.lv-box.head { --c: var(--pu); --f: rgba(127, 119, 221, 0.24); }
.lv-box.tail { --c: var(--te); --f: rgba(29, 158, 117, 0.16); }
.lv-box.new { --c: var(--bl); --f: rgba(55, 138, 221, 0.16); }
.lv-box.keep { --c: var(--te); --f: rgba(29, 158, 117, 0.2); }
.lv-box.excl { border-style: dashed; opacity: 0.55; }
.lv-box.used { opacity: 0.35; }
.lv-box.drop { --c: var(--re); --f: rgba(226, 75, 74, 0.08); opacity: 0.45; text-decoration: line-through; }
.lv-box.ghost { --c: var(--re); --f: rgba(226, 75, 74, 0.12); border-style: dashed; color: var(--re); }
.lv-box.q { --c: var(--am); border-style: dashed; color: var(--am); }
.lv-bracket { margin: 4px 0 0 calc(2px + var(--from) * (var(--cw) + var(--gap))); width: calc(var(--span) * (var(--cw) + var(--gap)) - var(--gap)); min-width: max-content; border: 2px solid var(--te); border-top: 0; border-radius: 0 0 10px 10px; height: 10px; position: relative; }
.lv-bracket span { position: absolute; top: 12px; left: 0; white-space: nowrap; font-family: var(--mono); font-size: 0.8rem; color: var(--te); font-weight: 600; }
.lv-bracket.empty { border-style: dashed; border-color: var(--am); width: var(--cw); }
.lv-bracket.empty span { color: var(--am); }
.lv-bracket + .rv-label { margin-top: 28px; }
.lv-res { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rv-chip.err { border-color: var(--re); background: rgba(226, 75, 74, 0.18); color: var(--re); font-weight: 700; }

.lv-rows { display: flex; flex-direction: column; }
.lv-row { margin-top: 6px; }
.lv-row.lv-done { opacity: 0.55; }
.lv .rv-ghost { animation: none; color: var(--text); }
.lv-rowbody { min-width: 0; }
.lv-call { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 2px; }
.lv-call b { font-family: var(--mono); }
.lv-row { padding-top: 6px; padding-bottom: 6px; }
.lv-boxes { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.lv-emptybox { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding: 3px 8px; border: 1.5px dashed var(--border); border-radius: 8px; }
.lv-out { margin: 0; padding: 10px 12px; min-height: 44px; font-family: var(--mono); font-size: 0.9rem; line-height: 1.5; background: #16181f; color: #d6d9e0; border: 0; white-space: pre-wrap; }
.lv-none { color: #7c8190; font-style: italic; }
.lv-newout { color: #ffd38a; font-weight: 700; }

.lv-flow { display: flex; flex-direction: column; }
.lv-lane { padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--code-bg); }
.lv-lane code { font-size: 0.8rem; color: var(--muted); }
.lv-arrow { text-align: center; color: var(--muted); font-size: 1.1rem; line-height: 1.4; }
.lv-acc { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--am); background: rgba(239, 159, 39, 0.1); }
.lv-acclabel { font-family: var(--mono); font-weight: 700; }
.lv-acc small { color: var(--muted); font-family: var(--mono); }
.lv-flow + .lv-acc + .rv-label, .lv-acc + .rv-label { margin-top: 12px; }

@media (max-width: 420px) { .lv { --cw: 40px; --gap: 5px; } }
@media (prefers-reduced-motion: no-preference) {
  .lv-in { animation: lv-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d, 0ms); }
  .lv-box.pick, .lv-box.ghost { animation: lv-pick 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .lv-box.drop { animation: lv-drop 0.6s ease-out; }
  .lv-newout { animation: rv-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); display: inline-block; }
  .lv-bracket { animation: rv-pop 0.4s ease-out; transform-origin: left top; }
  .rv-chip-last { animation: rv-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .lv-acc .lv-box { animation: lv-pick 0.45s ease-out; }
}
/* Recapitularea pentru mulțimi (sv-*), peste clasele rv-* și lv-* */
.sv-stream { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.sv-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.sv-tag { font-size: 0.7rem; font-weight: 700; color: var(--re); }
.sv-bags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sv-bag { position: relative; flex: 1 1 160px; min-height: 92px; padding: 22px 14px 14px; border-radius: 46px; border: 2px solid var(--pu); background: rgba(127, 119, 221, 0.1); }
.sv-bag.dict { border-color: var(--re); border-style: dashed; background: rgba(226, 75, 74, 0.06); }
.sv-name { position: absolute; top: 4px; left: 24px; font-size: 0.95rem; font-weight: 700; color: var(--pu); background: none; padding: 0; }
.sv-bag.dict .sv-name { color: var(--re); }
.sv-items { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; min-height: 48px; }
.sv-void { font-family: var(--mono); color: var(--muted); font-size: 1rem; }
.sv-bag.dict .sv-void { color: var(--re); font-weight: 700; }
.sv-chip {
  --c: var(--pu); --f: var(--surface);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: 999px; border: 2px solid var(--c); background: var(--f); font-family: var(--mono); font-weight: 700; font-size: 1rem;
  transition: transform 0.3s, background 0.3s, border-color 0.3s, opacity 0.3s;
}
.sv-chip.in { --c: var(--te); --f: rgba(29, 158, 117, 0.14); }
.sv-chip.new { --c: var(--bl); --f: rgba(55, 138, 221, 0.18); }
.sv-chip.dup { --c: var(--re); --f: rgba(226, 75, 74, 0.08); opacity: 0.55; text-decoration: line-through; }
.sv-chip.bad { --c: var(--re); --f: rgba(226, 75, 74, 0.14); border-radius: 8px; }
.sv-chip.pick { --c: var(--am); --f: rgba(239, 159, 39, 0.24); transform: translateY(-5px) scale(1.08); }
.sv-chip.used { opacity: 0.35; }
.sv-chip.q { --c: var(--am); border-style: dashed; color: var(--am); }
.sv-venn { display: block; width: 100%; max-width: 400px; margin: 0 auto; overflow: visible; }
.sv-zone { fill: transparent; transition: fill 0.4s; }
.sv-zone.on { fill: rgba(239, 159, 39, 0.38); }
.sv-ring { fill: none; stroke-width: 2.5; }
.sv-ring.a { stroke: var(--pu); }
.sv-ring.b { stroke: var(--te); }
.sv-setname { font-family: var(--mono); font-weight: 700; font-size: 20px; fill: var(--text); }
.sv-el circle { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; transition: fill 0.3s, stroke 0.3s, opacity 0.3s; }
.sv-el text { font-family: var(--mono); font-weight: 700; font-size: 14px; text-anchor: middle; fill: var(--text); }
.sv-el.on circle { fill: var(--am); stroke: var(--am); }
.sv-el.on text { fill: #fff; }
.sv-el.off { opacity: 0.35; }
.sv-pick { width: auto; }
@media (prefers-reduced-motion: no-preference) {
  .sv-chip.dup { animation: sv-reject 0.7s ease-out both; animation-delay: var(--d, 0ms); }
  .sv-chip.bad { animation: sv-shake 0.5s ease-in-out 2; }
  .sv-el.sv-pop { animation: sv-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d, 0ms); transform-box: fill-box; transform-origin: center; }
  .sv-el.on circle { animation: sv-glow 0.5s ease-out; }
}
@keyframes sv-reject { 0% { transform: translateY(-20px); opacity: 0; } 40% { transform: translateY(6px); opacity: 1; } 70% { transform: translateX(-6px) rotate(-8deg); } 100% { transform: none; opacity: 0.55; } }
@keyframes sv-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes sv-pop { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sv-glow { from { stroke-width: 6; } to { stroke-width: 1.5; } }
@keyframes lv-in { from { transform: translateY(-30px) scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lv-pick { from { transform: scale(0.7); } 60% { transform: translateY(-8px) scale(1.12); } to { transform: translateY(-5px); } }
@keyframes lv-drop { from { opacity: 1; transform: none; } to { opacity: 0.45; transform: translateY(6px); } }

/* ---------- dashboard live (src/web/prof-live.ts) */

.live-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.live-title h1 { margin: 0; }
.live-hint:empty { display: none; }
.live-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.live-card { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.live-card strong { font-size: 1.8rem; line-height: 1.1; }
.table-scroll { overflow-x: auto; }
.live-table td, .live-table th { white-space: nowrap; }
.live-table tr.dim td { opacity: 0.55; }
.live-table .name { font-weight: 500; }
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid transparent; }
.st-not_started { color: var(--muted); border-color: var(--border); }
.st-warmup { color: #378ADD; border-color: #378ADD; background: rgba(55, 138, 221, 0.12); }
.st-answering { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.st-finished { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.st.idle { color: var(--warn); border-color: var(--warn); background: transparent; }
.idle-note { display: block; color: var(--warn); font-size: 0.75rem; }
.qcells { display: inline-flex; gap: 3px; vertical-align: middle; }
.qcells span { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); background: transparent; flex: none; }
.qcells.head span { border: 0; font-size: 0.65rem; text-align: center; line-height: 16px; color: var(--muted); }
.qcells span.ok { background: var(--ok); border-color: var(--ok); }
.qcells span.bad { background: var(--bad); border-color: var(--bad); }
.qcells span.cur { border: 2px solid var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: no-preference) {
  .qcells span.cur { animation: live-pulse 1.4s ease-in-out infinite; }
}
@keyframes live-pulse { 50% { transform: scale(1.25); } }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.live-qtable .qcell { white-space: normal; min-width: 260px; }
.live-qtable details summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.live-qtable .qnum { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; background: var(--code-bg); font-size: 0.8rem; font-weight: 700; }
.live-qtable .qprompt { flex: 1; }
.live-qtable details[open] { padding-bottom: 8px; }
.live-qtable .pct { min-width: 160px; }
.pctbar { position: relative; height: 22px; border-radius: 6px; background: var(--code-bg); overflow: hidden; }
.pctbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--ok-bg); border-right: 2px solid var(--ok); }
.pctbar .fill.low { background: var(--bad-bg); border-right-color: var(--bad); }
.pctbar b { position: relative; padding-left: 8px; line-height: 22px; font-size: 0.85rem; }
.here { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-align: center; }
.live-link { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Nota pentru asistenții AI (în chenarul întrebării, ca să apară în pozele făcute cu telefonul) */
.ai-note {
  margin: 12px 0 4px; padding: 8px 12px; border-radius: 8px; font-size: 0.75rem; line-height: 1.45;
  color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
}
.ai-note strong { font-weight: 700; }
.qcells span.flag { position: relative; }
.qcells span.flag::after { content: ""; position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); border: 1.5px solid var(--surface); }
.live-table .flags { white-space: normal; min-width: 180px; }
.flag-badge { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; color: var(--warn); border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); cursor: help; }
.st-abandoned { color: var(--muted); border-color: var(--border); text-decoration: line-through; }

/* Mesajul temporar la paste în câmpul de cod */
.paste-warning {
  margin: 0; padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad);
}
@media (prefers-reduced-motion: no-preference) {
  .paste-warning.show { animation: paste-in 0.35s ease-out, rv-shake 0.4s 0.35s ease-in-out; }
}
@keyframes paste-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.run-output.neutral { background: var(--code-bg); border-color: var(--border); }
.code-answer .cm-editor { max-height: 420px; }
.code-answer .cm-scroller { overflow: auto; }
.editor-loading { min-height: 9em; margin: 0; opacity: 0.7; }

/* Fără ligaturi în cod: un începător ar putea crede că trebuie să scrie „≤” în loc de „<=”. */
code, pre, .mono, .cm-editor .cm-content { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.question > .ai-note { margin: 0 0 12px; }
.ask-hint { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); }
.cm-protected-header { padding: 4px 6px 2px 2px; font-family: var(--mono); color: var(--hl-comment); font-style: italic; user-select: none; cursor: default; }

/* ---------- mobil */
/* Coloana zonei de cod nu se lățește după cel mai lung rând: editorul derulează orizontal în interior. */
.code-answer { grid-template-columns: minmax(0, 1fr); }
.code-answer > * { min-width: 0; }
.cm-protected-header { white-space: pre-wrap; }
@media (max-width: 560px) {
  .question > .ai-note { font-size: 0.7rem; line-height: 1.35; padding: 6px 10px; }
  .code-answer .cm-editor { font-size: 0.85rem; }
}
@media (max-width: 560px) {
  .code-answer .row button { padding: 8px 12px; font-size: 0.9rem; }
}
/* Modulul de recapitulare pe ecrane mici (telefon în portret sau în landscape): butoanele rămân
   lipite de marginea de jos, ca studentul să poată avansa fără să deruleze după ele. */
@media (max-width: 640px), (max-height: 500px) {
  .rv-stack { min-height: 170px; }
  .rv-controls {
    position: sticky; bottom: 0; z-index: 2; margin: 12px -4px 0; padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .rv-settings { gap: 10px 16px; }
}
@media (max-height: 500px) {
  .rv-code { font-size: 0.8rem; }
  .rv-msg { min-height: 0; }
  .rv-fr { padding: 5px 8px; margin-top: 4px; }
  .rv-ic { width: 24px; height: 24px; }
}
@media (max-height: 500px) {
  .question > .ai-note { font-size: 0.7rem; line-height: 1.35; padding: 6px 10px; }
  .dots { gap: 4px; margin-bottom: 10px; }
  .dot { width: 30px; height: 30px; }
}
/* Meniul „Laboratoare” din bara profesorilor */
.nav-menu { position: relative; }
.nav-menu summary { cursor: pointer; font-weight: 500; color: var(--accent); list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: " ▾"; font-size: 0.8em; }
body.prof .nav-menu summary[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.nav-menu-list {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: max-content; max-width: min(420px, calc(100vw - 32px));
  display: grid; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.nav-menu-list a { padding: 8px 10px; border-radius: 6px; }
.nav-menu-list a:hover, .nav-menu-list a[aria-current="page"] { background: var(--accent-soft); text-decoration: none !important; }

.nav-menu-list a .pill { margin-left: 6px; font-size: 0.75rem; padding: 1px 8px; }
.nav-menu-empty { padding: 8px 10px; }

/* Prezența unei grupe (orice profesor) */
.att-weeks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.att-weeks button { min-width: 38px; padding: 6px 0; font-weight: 700; }
.att-weeks button.current { border-color: var(--accent); }
.att-weeks button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.att-count { margin: 0 0 12px; font-size: 1.05rem; }
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.att-student {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left;
  font-weight: 500; border-radius: 10px;
}
.att-student .att-name { flex: 1; min-width: 0; }
.att-mark {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px;
  border: 1.5px solid var(--border); font-weight: 700; font-size: 0.85rem;
}
.att-student[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok); }
.att-student[aria-pressed="true"] .att-mark { background: var(--ok); border-color: var(--ok); color: var(--surface); }

/* Pagina unui laborator, cu răspunsuri */
.lab-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.lab-tools a { overflow-wrap: anywhere; }
.lab-tools .lang-switch { margin-left: auto; }
.lab-tools .lang-switch a { padding: 4px 10px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.lab-tools .lang-switch a + a { border-left: 1px solid var(--border); }
.lab-tools .lang-switch a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.lab-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lab-toc a, .lab-q .qnum {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 7px;
  background: var(--code-bg); font-size: 0.85rem; font-weight: 700; text-decoration: none; color: var(--text);
}
.lab-toc a:hover { background: var(--accent-soft); color: var(--accent); }
.lab-q { scroll-margin-top: 12px; }
.lab-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.lab-q-head .qnum { background: var(--accent); color: var(--on-accent); }
.lab-q-head .pill { font-size: 0.8rem; }
.lab-q-head .qid { margin-left: auto; background: none; }
.lab-opts { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.lab-opts li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); }
.lab-opts li .md { flex: 1; min-width: 0; }
.lab-opts li .md > :first-child { margin-top: 0; }
.lab-opts li .md > :last-child { margin-bottom: 0; }
.lab-opts li pre { margin: 0; }
.lab-opts .mark { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 0.8rem; }
.lab-opts .letter { flex: none; font-weight: 700; color: var(--muted); min-width: 1.2em; }
.lab-opts li.correct { border-color: var(--ok); background: var(--ok-bg); }
.lab-opts li.correct .mark { background: var(--ok); color: var(--surface); }
.lab-opts li.wrong .mark { color: var(--bad); border: 1.5px solid var(--bad); }
.lab-answer { margin: 12px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ok); background: var(--ok-bg); }
.lab-answer pre { margin: 6px 0 0; background: var(--surface); }
.lab-more { margin: 8px 0; }
.lab-more summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.lab-stats-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.lab-stats-bar select { width: auto; }
.lab-toc a.good { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.lab-toc a.mid { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.lab-toc a.low { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.lab-legend .good { color: var(--ok); font-weight: 700; }
.lab-legend .mid { color: var(--warn); font-weight: 700; }
.lab-legend .low { color: var(--bad); font-weight: 700; }
.lab-qstats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 10px; }
.lab-qstats:empty { display: none; }
.lab-qstats .pctbar { flex: 0 1 240px; min-width: 180px; }
.lab-opts .picks { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--muted); min-width: 92px; justify-content: flex-end; }
.lab-opts .picks:empty { display: none; }
.picks-bar { display: inline-block; width: 50px; height: 6px; border-radius: 3px; background: var(--code-bg); overflow: hidden; }
.picks-bar span { display: block; height: 100%; background: var(--muted); }
.lab-opts li.correct .picks-bar span { background: var(--ok); }
.lab-opts li.wrong .picks-bar span { background: var(--bad); }
.lab-wrong { margin: 8px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--bad); background: var(--bad-bg); }
.lab-wrong:empty { display: none; }
.lab-wrong-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.lab-wrong-row pre { flex: 1; min-width: 0; margin: 0; background: var(--surface); }
.lab-explain { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--code-bg); }
.lab-explain .md > :first-child { margin-top: 4px; }
.lab-explain .md > :last-child { margin-bottom: 0; }

/* O listă derulantă cu o opțiune lungă (titlul laboratorului) nu are voie să lățească pagina. */
select { max-width: 100%; text-overflow: ellipsis; }
.row.wrap > * { min-width: 0; }
/* Dashboard-ul profesorilor pe telefon: meniul trece sub logo și se rupe pe rânduri,
   iar tabelele late derulează în interiorul cardului, nu toată pagina. */
@media (max-width: 640px) {
  body.prof header.site { flex-wrap: wrap; gap: 8px; }
  body.prof header.site nav { width: 100%; flex-wrap: wrap; gap: 6px 14px; }
  /* Meniul „Laboratoare” ocupă lățimea antetului, nu iese din ecran. */
  body.prof header.site { position: relative; }
  body.prof .nav-menu { position: static; }
  body.prof .nav-menu-list { left: 16px; right: 16px; top: calc(100% - 4px); width: auto; max-width: none; }
  /* Pe telefon, cât au ales din fiecare variantă trece sub textul ei. */
  .lab-opts li { flex-wrap: wrap; }
  .lab-opts .picks { flex: 1 0 100%; box-sizing: border-box; padding-left: 56px; justify-content: flex-start; }
  .card > table.list { display: block; overflow-x: auto; }
  .card > table.list td, .card > table.list th { white-space: nowrap; }
}
@media (max-width: 640px) {
  .gradebook .name { min-width: 120px; max-width: 150px; white-space: normal; }
  .gradebook .name .note { max-width: 130px; }
  .gradebook .idx { display: none; }
}

/* Erori pe câmpurile din ecranul de start */
.field.invalid select, .field.invalid input { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent); }
.field-error { margin: 2px 0 0; color: var(--bad); font-size: 0.85rem; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .field.invalid { animation: rv-shake 0.35s ease-in-out; }
}

/* iPhone: Safari mărește automat pagina când se focusează un câmp cu text sub 16px.
   Pe ecrane tactile, toate câmpurile (inclusiv editorul de cod) au cel puțin 16px. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  .code-answer .cm-editor, .code-answer .cm-editor .cm-content, .code-answer .cm-editor .cm-gutters { font-size: 16px !important; }
  input.grade { font-size: 16px; width: 60px; }
}
@media (pointer: coarse) {
  textarea.mono, input.mono { font-size: 16px; }
}

/* Înscrierea profesorilor: formularul și descrierea funcționalităților */
.onboarding { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.onboarding .card.narrow { max-width: none; margin: 0; }
@media (max-width: 760px) { .onboarding { grid-template-columns: minmax(0, 1fr); } }
.features h3 { margin: 16px 0 6px; font-size: 1rem; }
.features ul { margin: 0; padding-left: 1.2em; }
.features li { margin: 4px 0; }

/* ---------- testul pentru studenți (src/web/test.ts) */

.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 10px; }
.check-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; background: var(--code-bg); border: 1px solid var(--border); flex: none; }
.check-ok .check-icon { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.check-fail .check-icon { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.rows-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.row-option { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; }
.row-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rules { margin: 16px 0 0; padding-left: 1.2em; color: var(--muted); }
.rules li { margin: 4px 0; }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.exam-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; margin-bottom: 8px; background: var(--bg); }
.exam-clock { display: grid; justify-items: end; gap: 0; }
.timer { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer-low { color: var(--bad); }
.save-status { min-height: 1.2em; }
.exam-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.exam-tabs .tab { border-radius: 999px; }
.exam-tabs .tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.problem { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.problem h2 { margin: 0; font-size: 1.15rem; }
.report h3 { margin: 16px 0 6px; font-size: 1rem; }
.study-item { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.study-item p { margin: 6px 0; }

/* ---------- testele în dashboard (src/web/prof-exams.ts) */

.spread { justify-content: space-between; }
.exam-preview { margin-top: 10px; }
.exam-row h3 { margin: 16px 0 6px; }
.exam-problem { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.exam-problem summary { cursor: pointer; font-weight: 600; }
.pill.run-open { background: var(--accent-soft); color: var(--accent); }
.pill.run-running { background: var(--ok-bg); color: var(--ok); }
.pill.run-closed { background: var(--code-bg); color: var(--muted); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.st-requested { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pill.st-waiting { background: var(--code-bg); color: var(--muted); }
.pill.st-ready { background: var(--accent-soft); color: var(--accent); }
.pill.st-running { background: var(--ok-bg); color: var(--ok); }
.pill.st-submitted { background: var(--code-bg); color: var(--text); }
.pill.st-rejected { background: var(--bad-bg); color: var(--bad); }
.live-table .events { white-space: normal; }
.ev { display: inline-block; margin: 1px 6px 1px 0; font-variant-numeric: tabular-nums; }
.ev-pagehide, .ev-offline { color: var(--bad); }
.ev-hidden, .ev-paste { color: var(--warn); }
.warn-row td { background: color-mix(in srgb, var(--bad) 6%, transparent); }
td.warn, .num.warn { color: var(--warn); font-weight: 600; }
.requests { border-color: var(--warn); }
.results-table td, .results-table th { white-space: nowrap; }
.results-table tr.dim td { opacity: 0.55; }
.detail-row > td { background: var(--bg); white-space: normal; }
.result-detail { display: grid; gap: 12px; padding: 8px 0; }
.card.inset { margin: 0; box-shadow: none; }
.problem-result h3 { margin: 0; }
.problem-result pre { max-height: 360px; overflow: auto; }
.criteria td { white-space: normal; }
.problem-result input[type="number"] { width: 90px; }
.problem-result input[type="text"] { flex: 1; min-width: 160px; }
.inline-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.inline-check input, .row-option input { width: auto; flex: none; accent-color: var(--accent); }
.present-confirm { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.present-confirm p { margin: 0 0 10px; }
.row-badge { color: var(--accent); }
.grading-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); flex: none; }
.grading-bar { height: 10px; border-radius: 999px; background: var(--code-bg); border: 1px solid var(--border); overflow: hidden; }
.grading-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--ok))); transition: width 1s linear; }
.grading-steps { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; gap: 8px; }
.grading-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.grading-steps li.current { color: var(--text); font-weight: 600; }
.grading-steps li.done { color: var(--text); }
.grading-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: inline-grid; place-items: center; font-size: 0.7rem; }
.grading-steps li.done .grading-dot { background: var(--ok); border-color: var(--ok); }
.grading-steps li.done .grading-dot::after { content: "✓"; color: var(--on-accent); font-weight: 700; }
.grading-steps li.current .grading-dot { border-color: var(--accent); border-top-color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .spinner, .grading-steps li.current .grading-dot { animation: spin 0.9s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }
.exam-results h2 { margin-top: 0; }
.result-problem { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.result-problem:first-of-type { border-top: 0; }
.result-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.result-points { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-lines { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-size: 0.92rem; }
.result-lines li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; }
.pts { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.pts.minus { color: var(--bad); }
.pts.plus { color: var(--ok); }
.full-marks { color: var(--ok); font-weight: 600; }

/* Caseta de cod din test: bară de unelte, editor și terminal, într-un singur chenar */
.code-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.code-box .editor-box { margin: 0; }
.code-box .cm-editor { border: 0 !important; border-radius: 0 !important; }
.code-box .cm-editor.cm-focused { outline: none; }
.code-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.code-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; background: var(--code-bg); border-bottom: 1px solid var(--border); }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 0.85rem; border-radius: 8px; background: transparent; border: 1px solid transparent; }
.tool:hover { border-color: var(--border); background: var(--surface); }
.tool.run { margin-left: auto; background: var(--ok); border-color: var(--ok); color: var(--on-accent); font-weight: 700; }
.tool.run:hover { filter: brightness(1.08); background: var(--ok); }
.tool.run:disabled { opacity: 0.6; }
.tool-hint { font-size: 0.8rem; color: var(--muted); padding: 0 6px; }
@media (max-width: 560px) { .tool:not(.run) .tool-label { display: none; } }
.terminal { background: #0d1117; color: #d6deeb; border-top: 1px solid #1f2633; font-family: var(--mono); font-size: 0.85rem; }
.terminal-bar { display: flex; gap: 10px; align-items: center; padding: 4px 10px; background: #161b22; color: #8b949e; font-size: 0.75rem; }
.term-dots { letter-spacing: 2px; color: #ff5f56; }
.terminal-body { padding: 8px 12px 10px; min-height: 3.2em; max-height: 260px; overflow: auto; line-height: 1.5; }
.term-cmd { color: #7ee787; }
.term-out { margin: 2px 0; white-space: pre-wrap; color: #e6edf3; background: none; border: 0; padding: 0; font: inherit; }
.term-ok { color: #8b949e; }
.term-err { color: #ff7b72; white-space: pre-wrap; }
.term-muted { color: #8b949e; }
.exam-head-right { display: flex; align-items: center; gap: 14px; }
.finish-btn { font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
@media (max-width: 560px) { .exam-head { flex-wrap: wrap; } .exam-head-right { width: 100%; justify-content: space-between; } }
.fs-ask { max-width: 440px; }
.bonus-line { color: var(--ok); font-weight: 600; }
.grade-formula { font-size: 1.15rem; font-weight: 600; margin: 0 0 6px; }
.objection { margin: 6px 0 4px; }
.objection-btn { margin-top: 4px; }
.objection-item { border-left: 3px solid var(--warn); padding: 4px 10px; margin: 6px 0; background: color-mix(in srgb, var(--warn) 6%, transparent); border-radius: 0 6px 6px 0; }
.objection-reply { color: var(--ok); }
.objection-form { display: grid; gap: 6px; margin-top: 6px; }
.objection-form textarea { width: 100%; }
.email-card input[type="email"] { flex: 1 1 220px; }
.ok-text { color: var(--ok); }
.objection-prof { border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 8px; padding: 8px 12px; margin: 8px 0; display: grid; gap: 6px; }
.objection-prof.open { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.objection-prof textarea { width: 100%; }

/* Statisticile unui test. Notele: roșu (status) sub 5, apoi rampă albastră validată (ordinal, light/dark). */
:root { --grade-0: #d03b3b; --grade-1: #86b6ef; --grade-2: #5598e7; --grade-3: #2a78d6; --grade-4: #1c5cab; --grade-5: #104281; --meter: #2a78d6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grade-1: #184f95; --grade-2: #256abf; --grade-3: #3987e5; --grade-4: #6da7ec; --grade-5: #9ec5f4; --meter: #3987e5; }
}
:root[data-theme="dark"] { --grade-1: #184f95; --grade-2: #256abf; --grade-3: #3987e5; --grade-4: #6da7ec; --grade-5: #9ec5f4; --meter: #3987e5; }
.stats-filter { gap: 10px; margin: 0 0 14px; align-items: center; }
.stats-filter .chip { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; background: var(--surface); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 0.82rem; }
.stats-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 2fr); gap: 16px; align-items: start; }
.stats-grid > .card { margin: 0; min-width: 0; }
@media (max-width: 860px) { .stats-grid { grid-template-columns: 1fr; } }
.pie-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pie { width: 190px; max-width: 100%; }
.pie svg { display: block; width: 100%; height: auto; }
.pie-slice { fill: none; transition: opacity 0.15s; cursor: default; }
.pie-slice.dim { opacity: 0.3; }
.pie-gap { stroke: var(--surface); stroke-width: 2; }
.pie-value { font-size: 28px; font-weight: 800; fill: var(--text); }
.pie-sub { font-size: 12px; fill: var(--muted); }
.pie-slice.grade-0 { stroke: var(--grade-0); } .pie-slice.grade-1 { stroke: var(--grade-1); } .pie-slice.grade-2 { stroke: var(--grade-2); }
.pie-slice.grade-3 { stroke: var(--grade-3); } .pie-slice.grade-4 { stroke: var(--grade-4); } .pie-slice.grade-5 { stroke: var(--grade-5); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.swatch.grade-0 { background: var(--grade-0); } .swatch.grade-1 { background: var(--grade-1); } .swatch.grade-2 { background: var(--grade-2); }
.swatch.grade-3 { background: var(--grade-3); } .swatch.grade-4 { background: var(--grade-4); } .swatch.grade-5 { background: var(--grade-5); }
.pie-legend { border-collapse: collapse; font-size: 0.92rem; }
.pie-legend td { padding: 3px 8px; }
.pie-legend tr.active td { background: var(--accent-soft); }
.pie-legend tr.empty { color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: var(--code-bg); overflow: hidden; min-width: 120px; margin: 4px 0 2px; }
.meter span { display: block; height: 100%; background: var(--meter); border-radius: 4px; }
.problem-stats td:first-child { min-width: 200px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.card .actions:first-child, .row > .actions { margin-top: 0; }
/* Catalogul studentului: notele și prezențele, doar pentru citire */
header.site nav a[aria-current="page"] { color: var(--text); }
.catalog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.catalog-head h1 { margin: 0 0 2px; overflow-wrap: anywhere; }
.catalog-head p { margin: 0; }
.grade-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.grade-tile {
  display: grid; gap: 2px; justify-items: center; padding: 10px 6px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg);
}
.grade-label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.grade-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.grade-tile.average { background: var(--accent-soft); border-color: var(--accent); }
.grade-tile.final { background: var(--accent); border-color: var(--accent); }
.grade-tile.final .grade-label, .grade-tile.final .grade-value { color: var(--on-accent); }
.attendance-count { font-weight: 600; margin: 4px 0 12px; }
.weeks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.weeks .week {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0;
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
}
.weeks .week-num { font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.weeks .week-mark { font-weight: 800; min-height: 1.2em; }
.weeks .week.present { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.weeks .week.absent { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.weeks .week.future { border-style: dashed; opacity: 0.7; }
.weeks .week.current { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 560px) {
  header.site { flex-wrap: wrap; row-gap: 8px; }
  header.site nav { gap: 12px; }
  .grade-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Evenimente (pagina studenților și dashboard-ul) */
.page-title { margin: 8px 0 16px; }
.events { display: grid; gap: 12px; margin-bottom: 28px; }
.events > h2 { margin: 4px 0 0; }
.event-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: start; margin: 0; }
.event-date {
  display: grid; justify-items: center; align-content: center; gap: 0; min-height: 64px; padding: 6px 4px;
  border-radius: 12px; background: var(--accent); color: var(--on-accent); text-align: center;
}
.event-date.undated { background: var(--code-bg); color: var(--muted); border: 1px dashed var(--border); }
.event-day { font-size: 1.25rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-month { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.event-day.range { font-size: 1.05rem; letter-spacing: -0.02em; }
.event-icon { margin-right: 6px; }
.event-body { min-width: 0; }
.event-body h3 { font-size: 1.1rem; margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }
.event-desc { white-space: pre-line; margin: 8px 0; overflow-wrap: anywhere; }
.event-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 0; }
.event-link .button { text-decoration: none; }
.event-card.past .event-date { background: var(--code-bg); color: var(--muted); }
.event-card.past { opacity: 0.8; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.event-form textarea { min-height: 120px; }
@media (max-width: 560px) {
  header.site nav { flex-wrap: wrap; row-gap: 8px; }
  .event-card { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .event-day.range { font-size: 0.9rem; }
  .event-date { min-height: 52px; }
  .event-day { font-size: 1rem; }
}
