:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --surface-2: #f8f5ee;
  --ink: #1b1a17;
  --ink-2: #52514e;
  --ink-3: #807e77;
  --line: #e2ddd1;
  --line-strong: #cbc4b4;
  --accent: #1f3a5f;
  --accent-ink: #ffffff;
  --accent-soft: #e5ecf5;
  --good: #1f7a3d;  --good-soft: #e3f3e8;
  --warn: #9a5b00;  --warn-soft: #fbefd9;
  --bad: #b3261e;   --bad-soft: #fbe5e3;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 14px rgb(0 0 0 / .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141413; --paper: #1d1d1b; --surface-2: #242422;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8d86;
    --line: #333230; --line-strong: #4a4845;
    --accent: #8fb3e3; --accent-ink: #0f1a2a; --accent-soft: #1f2a3a;
    --good: #6cc78b; --good-soft: #17301f;
    --warn: #e0a84a; --warn-soft: #33270f;
    --bad: #f08a84; --bad-soft: #3a1b19;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413; --paper: #1d1d1b; --surface-2: #242422;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8d86;
  --line: #333230; --line-strong: #4a4845;
  --accent: #8fb3e3; --accent-ink: #0f1a2a; --accent-soft: #1f2a3a;
  --good: #6cc78b; --good-soft: #17301f;
  --warn: #e0a84a; --warn-soft: #33270f;
  --bad: #f08a84; --bad-soft: #3a1b19;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --shadow: 0 1px 2px rgb(0 0 0 / .3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
/* long tokens (cipher suite names, URLs, DNS records) must wrap instead of widening the page */
.q-text, .statement, .r-answer, .r-feedback, details.solution .sol, .r-missing, .opt-res, .scard .stmt, .verdict, .flash .face, .peer-answer, .topic-card, .row .meta { overflow-wrap: anywhere; }
main { overflow-x: clip; }
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-2); } .small { font-size: .875rem; } .tiny { font-size: .78rem; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 10px 24px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { background: var(--accent); color: var(--accent-ink); font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 3px 6px; border-radius: 5px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.topbar nav a.active { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.topbar nav a { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.topbar nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { background: #b3261e; color: #fff; font-size: .68rem; font-weight: 700; border-radius: 99px; padding: 0 6px; line-height: 16px; min-width: 16px; text-align: center; }
.who { font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
main { max-width: 980px; margin: 0 auto; padding: 32px 24px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

/* ---------- elements ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--paper);
  border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.grade { font-family: var(--serif); font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 10vh auto 0; }
.login h1 { font-size: 1.6rem; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.field input { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 8px; padding: 10px 12px; }
.users-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.users-pick button { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 8px; padding: 10px 6px; cursor: pointer; font-weight: 600; }
.users-pick button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.error { color: var(--bad); font-size: .9rem; min-height: 1.4em; }

/* ---------- dashboard ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.hero .eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.hero h2 { font-size: 1.7rem; margin-bottom: 6px; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.peers { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; }
.peer { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.next-up { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 10px; background: var(--surface-2); font-size: .92rem; color: var(--ink-2); }
.section-title { margin: 36px 0 12px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-family: var(--sans); }
.list { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .title { font-weight: 600; }
.row .meta { font-size: .85rem; color: var(--ink-2); }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }

/* ---------- exam ---------- */
.cover { max-width: 720px; margin: 0 auto; }
.cover h1 { text-align: center; margin-bottom: 4px; }
.cover .sub { text-align: center; color: var(--ink-2); margin-bottom: 24px; }
.cover dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 20px; }
.cover dt { color: var(--ink-2); } .cover dd { margin: 0; font-weight: 600; }
.cover ul { padding-left: 20px; margin: 0 0 20px; color: var(--ink-2); }
.cover ul li { margin-bottom: 4px; }
.exam-bar { position: sticky; top: 57px; z-index: 15; display: flex; align-items: center; gap: 16px; padding: 10px 16px; margin: -12px 0 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.timer { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }
.exam-bar .progress { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.exam-bar .progress a { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; font-size: .75rem; font-weight: 700; text-decoration: none;
  color: var(--ink-2); border: 1px solid var(--line-strong); }
.exam-bar .progress a.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.save-state { font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.q { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin-bottom: 16px; scroll-margin-top: 130px; }
.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.q-head h3 { margin: 0; }
.q-topic { font-size: .78rem; color: var(--ink-3); }
.q-text { white-space: pre-wrap; margin-bottom: 14px; }
.statement { border-left: 3px solid var(--accent); background: var(--surface-2); padding: 10px 14px; border-radius: 0 8px 8px 0; margin-bottom: 14px; font-style: italic; }
textarea.answer { width: 100%; min-height: 140px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px; background: var(--surface-2); line-height: 1.55; }
textarea.answer:focus { background: var(--paper); }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--surface-2); }
.option:hover { border-color: var(--line-strong); }
.option input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.tf-choice { display: flex; gap: 8px; margin-bottom: 10px; }
.tf-choice label { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; font-weight: 600; }
.tf-choice input { accent-color: var(--accent); }
.submit-zone { text-align: center; padding: 28px; }

/* ---------- results ---------- */
.result-head { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.big-grade { font-family: var(--serif); font-size: 3.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.scorebar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.scorebar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.r-block { margin-top: 14px; }
.r-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.r-answer { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 10px 14px; }
.r-feedback { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; }
.r-missing { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); font-size: .92rem; }
details.solution { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
details.solution summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.solution .sol { white-space: pre-wrap; margin-top: 8px; }
.opt-res { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.opt-res .mark { width: 20px; flex: none; text-align: center; font-weight: 700; }
.opt-res .expl { font-size: .85rem; color: var(--ink-2); }
.peer-answers { margin-top: 14px; }
.peer-answers summary { cursor: pointer; font-size: .9rem; color: var(--ink-2); }
.peer-answer { margin-top: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.peer-answer .who-line { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }

/* ---------- stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .name { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.kpi .val { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: .8rem; color: var(--ink-3); }
.kpi .sub { display: flex; gap: 16px; margin-top: 10px; font-size: .85rem; color: var(--ink-2); }
table.matrix { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.matrix th, table.matrix td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.matrix th { font-size: .78rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
table.matrix td.c { text-align: center; }
table.matrix tr:last-child td { border-bottom: 0; }
.best { font-weight: 700; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tooltip { position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font-size: .82rem;
  box-shadow: var(--shadow); min-width: 140px; z-index: 5; }
.tooltip .t-title { font-weight: 700; margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tooltip .t-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.topic-row { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.topic-row:first-of-type { border-top: 0; }
.topic-bars { display: grid; gap: 3px; }
.tbar { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; font-size: .78rem; }
.tbar .track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; position: relative; }
.tbar .fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.footnote { margin-top: 28px; font-size: .8rem; color: var(--ink-3); text-align: center; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 8px; font-size: .9rem; z-index: 50; box-shadow: var(--shadow); }

@media (max-width: 700px) {
  /* backdrop-filter would turn the topbar into the containing block of the fixed tab bar */
  .topbar { padding: 10px 16px; gap: 12px; backdrop-filter: none; background: var(--paper); }
  .hero-actions .pill { align-self: flex-start; }
  .topbar nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    background: var(--paper); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .topbar nav a { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 2px; border-radius: 8px; }
  .topbar nav svg { width: 22px; height: 22px; }
  .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); }
  .brand { flex: 1; }
  main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .hero { grid-template-columns: 1fr; }
  .hero-actions { align-items: stretch; }
  .row { grid-template-columns: 1fr auto; }
  .row > :last-child { grid-column: 1 / -1; }
  .kpis { grid-template-columns: 1fr; }
  /* compact one-line exam bar: chips scroll horizontally instead of wrapping into 3 rows */
  .exam-bar { top: 52px; gap: 10px; padding: 8px 10px; flex-wrap: nowrap; }
  .exam-bar .progress { flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .exam-bar .progress::-webkit-scrollbar { display: none; }
  .exam-bar .progress a { flex: none; width: 30px; height: 30px; }
  .timer { font-size: 1.05rem; }
  .save-state { font-size: .72rem; }
  .q { scroll-margin-top: 120px; }
  .topic-row { grid-template-columns: 1fr; gap: 6px; }
  .result-head { grid-template-columns: 1fr; gap: 12px; }
  .q { padding: 18px 16px; }
}

/* ---------- practice ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.topic-card { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow); }
.topic-card:hover { border-color: var(--line-strong); }
.topic-card .t { font-weight: 700; margin-bottom: 6px; }
.topic-card .m { font-size: .85rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.mini-bar { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--accent); }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.session-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: .9rem; color: var(--ink-2); flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- swipe ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 99px; padding: 6px 14px; font-size: .88rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.swipe-wrap { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100dvh - 190px); }
.swipe-top { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; color: var(--ink-2); margin-bottom: 8px; }
.swipe-progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.swipe-progress span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.stack { position: relative; flex: 1; min-height: 340px; touch-action: none; user-select: none; -webkit-user-select: none; }
.scard { position: absolute; inset: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgb(0 0 0 / .10);
  display: flex; flex-direction: column; justify-content: center; padding: 28px 24px; text-align: center; will-change: transform; cursor: grab; }
.scard.behind { transform: scale(.95) translateY(12px); opacity: .7; pointer-events: none; }
.scard .topic { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); position: absolute; top: 20px; left: 0; right: 0; }
.scard .stmt { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; text-wrap: balance; }
.scard .stamp { position: absolute; top: 56px; font-weight: 800; font-size: 1.2rem; letter-spacing: .06em; padding: 4px 12px; border: 3px solid; border-radius: 8px; opacity: 0; }
.scard .stamp.yes { right: 22px; color: var(--good); transform: rotate(12deg); }
.scard .stamp.no { left: 22px; color: var(--bad); transform: rotate(-12deg); }
.swipe-hint { text-align: center; font-size: .8rem; color: var(--ink-3); margin: 10px 0; }
.swipe-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swipe-buttons button { border: 2px solid; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 1.05rem; background: var(--paper); cursor: pointer; }
.swipe-buttons .no { color: var(--bad); border-color: var(--bad); }
.swipe-buttons .yes { color: var(--good); border-color: var(--good); }
.verdict { position: absolute; inset: 0; border-radius: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px; text-align: center; gap: 12px; z-index: 5; }
.verdict.ok { background: var(--good-soft); color: var(--good); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict .big { font-size: 2.2rem; font-weight: 800; }
.verdict .expl { color: var(--ink); font-size: 1rem; line-height: 1.45; }
.verdict .stmt-small { color: var(--ink-2); font-size: .9rem; font-style: italic; }
.board { width: 100%; border-collapse: collapse; font-size: .92rem; }
.board td, .board th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.board th { font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- flashcards ---------- */
.fc-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.fc-stats strong { color: var(--ink); font-size: 1.1rem; }
.flash { max-width: 640px; margin: 0 auto; }
.flash .face { white-space: pre-wrap; font-size: 1.05rem; }
.flash .front { font-family: var(--serif); font-size: 1.2rem; }
.flash hr { border: 0; border-top: 1px dashed var(--line-strong); margin: 18px 0; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.rate button { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 10px; padding: 10px 4px; cursor: pointer; font-weight: 700; display: grid; gap: 2px; }
.rate button small { font-weight: 500; color: var(--ink-3); font-size: .75rem; }
.rate .r1 { color: var(--bad); } .rate .r2 { color: var(--warn); } .rate .r3 { color: var(--good); } .rate .r4 { color: var(--accent); }
.export-box { font-size: .9rem; color: var(--ink-2); }
.export-box ol { padding-left: 20px; margin: 8px 0 0; }

/* ---------- slides ---------- */
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.slide-thumb { border: 1px solid var(--line); border-radius: 8px; padding: 0; background: var(--surface-2); cursor: zoom-in; overflow: hidden; text-align: left; }
.slide-thumb img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #fff; }
.slide-thumb span { display: block; font-size: .78rem; padding: 6px 8px; color: var(--ink-2); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgb(0 0 0 / .85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: 6px; background: #fff; }
.lightbox span { color: #ddd; font-size: .85rem; }
