/* ============================================================
   Büntetőjog ZV — Design System v3
   Inspired by MongoDB Atlas + Linear precision + GitHub restraint.
   Single dark theme. Forest accents, leaf only on primary CTA.
   Hairline borders. Subtle motion. Generous whitespace.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Surfaces — calmer slate with tighter range */
  --bg-0:  #0d1418;   /* page bg / shell */
  --bg-1:  #131b21;   /* nav, hero */
  --bg-2:  #181f25;   /* card surface */
  --bg-3:  #1f2830;   /* elevated / hover */
  --bg-4:  #2a363d;   /* highest elevation */

  /* Borders */
  --border-1: #1f2830;  /* default hairline (matches bg-3) */
  --border-2: #2a363d;  /* visible separator */
  --border-3: #3a464d;  /* strong border (input focus) */

  /* Text */
  --fg-0: #ecf2f7;    /* primary — off-white */
  --fg-1: #a8b2bb;    /* secondary */
  --fg-2: #6f7a82;    /* tertiary / labels */
  --fg-3: #4a555c;    /* disabled / placeholder */

  /* Brand — MongoDB leaf, restrained usage */
  --leaf:        #00ed64;   /* brand mark, primary CTA */
  --leaf-hover:  #00d058;
  --leaf-dim:    #00a854;   /* slightly more muted */
  --forest:      #006c44;   /* accent borders, text-on-dark */
  --leaf-tint:        rgba(0, 237, 100, 0.10);
  --leaf-tint-soft:   rgba(0, 237, 100, 0.05);
  --leaf-tint-strong: rgba(0, 237, 100, 0.18);

  /* Status — desaturated for dark UI */
  --ok:     #3fb950;
  --warn:   #d29922;
  --err:    #f85149;
  --info:   #58a6ff;
  --ok-bg:    rgba(63, 185, 80, 0.12);
  --warn-bg:  rgba(210, 153, 34, 0.12);
  --err-bg:   rgba(248, 81, 73, 0.12);
  --info-bg:  rgba(88, 166, 255, 0.12);

  /* Categorical chart palette (declared order) */
  --c-1: #006c44;
  --c-2: #58a6ff;
  --c-3: #d29922;
  --c-4: #8b949e;
  --c-5: #00d2ff;
  --c-6: #f85149;
  --c-7: #8957e5;
  --c-8: #00ed64;

  /* Type */
  --font-sans: "Inter", -apple-system, "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Spacing scale (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* Geometry */
  --r-1: 4px;     /* chips, small */
  --r-2: 6px;     /* buttons, inputs */
  --r-3: 8px;     /* cards */
  --r-4: 12px;    /* hero, large surfaces */

  /* Layout */
  --nav-w: 232px;
  --max-w: 1400px;

  /* Motion */
  --ease-out:    cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-norm: 200ms;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { color-scheme: dark; }
body {
  background: var(--bg-0);
  color: var(--fg-0);
  font: 400 14px/1.55 var(--font-sans);
  font-feature-settings: "tnum", "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--leaf-tint-strong); color: var(--fg-0); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 5px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

/* Type */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg-0);
}
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 17px; line-height: 1.35; margin-top: var(--s-6); margin-bottom: var(--s-3); letter-spacing: -0.01em; }
h3 { font-size: 14px; line-height: 1.4; margin-top: var(--s-4); margin-bottom: var(--s-2); }
h4 { font-size: 12px; line-height: 1.4; margin-top: var(--s-3); margin-bottom: var(--s-2); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-2); font-weight: 600; }
p  { margin: 0 0 var(--s-3); color: var(--fg-0); }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  font-weight: 600;
  display: block;
}

a { color: var(--leaf-dim); text-decoration: none; }
a:hover { color: var(--leaf); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

strong, b { font-weight: 600; color: var(--fg-0); }
em, i { font-style: italic; }

code, .mono, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: var(--r-1);
  color: var(--fg-0);
  border: 1px solid var(--border-1);
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  color: var(--fg-1);
  line-height: 1.2;
}
pre {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  border: 1px solid var(--border-1);
  margin: var(--s-2) 0;
}
pre code { background: none; border: 0; padding: 0; }

hr { border: 0; border-top: 1px solid var(--border-1); margin: var(--s-5) 0; }

.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-1); font-size: 12px; }
.muted-strong { color: var(--fg-1); }

/* ============================================================
   Layout shell
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
  background: var(--bg-0);
}
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border-1); }
}

.app-nav {
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: var(--s-2);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-3);
  text-decoration: none;
  color: var(--fg-0);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--s-2);
}
.app-brand:hover { text-decoration: none; }
.app-brand-mark {
  width: 32px; height: 32px;
  background: var(--leaf);
  color: var(--bg-0);
  border-radius: var(--r-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.app-brand-text { display: flex; flex-direction: column; gap: 1px; }
.app-brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--fg-0);
  line-height: 1.2;
}
.app-brand-sub {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
}

.app-nav-section-title {
  padding: var(--s-4) var(--s-4) var(--s-1);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  font-weight: 600;
}

.app-nav-list { list-style: none; margin: 0; padding: 0; }
.app-nav a {
  display: flex;
  align-items: center;
  padding: 7px var(--s-4);
  color: var(--fg-1);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
  margin-left: -1px; /* align with nav border */
}
.app-nav a:hover {
  color: var(--fg-0);
  background: var(--bg-2);
  text-decoration: none;
}
.app-nav a.active {
  color: var(--leaf-dim);
  background: var(--bg-2);
  border-left-color: var(--leaf-dim);
}

.app-nav-footer {
  margin-top: auto;
  padding: var(--s-3) var(--s-4) var(--s-4);
  border-top: 1px solid var(--border-1);
}
.hud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
}
.hud-stat { display: flex; flex-direction: column; gap: 2px; }
.hud-stat .num {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg-0);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hud-stat .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-2);
  font-weight: 600;
}
.hud-level {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 12px; font-weight: 500;
  color: var(--fg-0);
}
.hud-level .level-dot {
  background: var(--leaf-dim);
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Main content */
.app-main {
  padding: var(--s-6) var(--s-6) var(--s-7);
  max-width: var(--max-w);
  width: 100%;
  min-width: 0;
}
.loading {
  padding: var(--s-7);
  text-align: center;
  color: var(--fg-1);
  font-size: 13px;
}

/* ============================================================
   Buttons / CTAs
   ============================================================ */
.cta, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-2);
  font: 500 13px/1.2 var(--font-sans);
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--fg-0);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  font-feature-settings: "tnum";
  -webkit-user-select: none; user-select: none;
}
.cta:hover, .btn:hover {
  background: var(--bg-3);
  border-color: var(--border-3);
  color: var(--fg-0);
  text-decoration: none;
}
.cta:active, .btn:active { background: var(--bg-2); }
.cta:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--leaf-dim);
  outline-offset: 1px;
}

.cta.primary, .btn.primary {
  background: var(--leaf);
  color: var(--bg-0);
  border-color: var(--leaf);
  font-weight: 600;
}
.cta.primary:hover, .btn.primary:hover {
  background: var(--leaf-hover);
  border-color: var(--leaf-hover);
  color: var(--bg-0);
}

.cta.danger, .btn.danger {
  background: var(--err);
  color: #fff;
  border-color: var(--err);
}
.cta.danger:hover { filter: brightness(1.08); }

.cta.ghost, .btn.ghost {
  background: transparent;
  border-color: var(--border-1);
  color: var(--fg-1);
}
.cta.ghost:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
  color: var(--fg-0);
}

.cta.big, .btn.big { padding: 10px 18px; font-size: 13.5px; }
.cta.small, .btn.small { padding: 5px 10px; font-size: 12px; }

.cta.active {
  background: var(--leaf-tint);
  border-color: var(--leaf-dim);
  color: var(--leaf);
}

button { font: inherit; }

/* ============================================================
   Inputs
   ============================================================ */
input[type=text], input[type=password], input[type=search], input[type=number],
input[type=email], input[type=url], textarea, select {
  font: 400 13px var(--font-sans);
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--fg-0);
  border-radius: var(--r-2);
  width: 100%;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:hover, textarea:hover, select:hover { border-color: var(--border-3); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--leaf-dim);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--leaf-tint-soft);
}

label {
  display: block;
  font-size: 12px;
  color: var(--fg-1);
  margin: var(--s-3) 0 var(--s-1);
  font-weight: 500;
}
label input, label select, label textarea { margin-top: var(--s-1); }

/* Toggle switch */
.toggle {
  display: inline-flex; align-items: center; gap: var(--s-3);
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--fg-0);
}
.toggle input { display: none; }
.toggle-track {
  width: 32px; height: 18px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  position: relative;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.toggle-thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 14px; height: 14px;
  background: var(--fg-1);
  border-radius: 50%;
  transition: transform var(--t-fast), background-color var(--t-fast);
}
.toggle input:checked + .toggle-track {
  background: var(--leaf);
  border-color: var(--leaf);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(14px);
  background: var(--bg-0);
}

/* ============================================================
   Card / surface primitives
   ============================================================ */
.card, .stat-card, .topic-card, .test-question,
.recommendation-card, .daily-goal-card, .achv-teaser-card,
.intro-section, .objectives-block, .terms-block, .related-block,
.question-block, .notes-area, .stub-banner, .vizsga-section,
.section-block, .exam-active, .exam-results, .exam-setup,
.test-active, .test-results, .test-config, .test-history,
.settings-block, .achv-card, .past-exams {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: var(--s-4) var(--s-5);
  transition: border-color var(--t-fast);
}

.card:hover, .topic-card:hover { border-color: var(--border-2); }

.intro-section { border-left: 2px solid var(--forest); padding-left: 22px; }
.recommendation-card {
  display: flex; gap: var(--s-4); align-items: center;
  border-left: 2px solid var(--leaf-dim);
}
.recommendation-card .icon { display: none; }
.recommendation-card h3 { margin: 0; }
.recommendation-card .why { color: var(--fg-1); font-size: 13px; margin: 2px 0 0; }

.daily-goal-card {
  display: flex; gap: var(--s-4); align-items: center;
  border-left: 2px solid var(--leaf-dim);
}
.daily-goal-card.done { border-left-color: var(--ok); background: var(--ok-bg); }
.daily-goal-card .dg-icon { display: none; }

.stub-banner {
  border-left: 2px solid var(--warn);
  background: var(--warn-bg);
}
.stub-banner h3 { color: var(--fg-0); margin-top: 0; }

.banner.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.banner.warn strong { color: #f6c84c; }

.warn-text { color: var(--err); font-size: 12px; }

/* ============================================================
   Stat tile
   ============================================================ */
.stat-num {
  font-size: 26px;
  font-weight: 600;
  color: var(--fg-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-2);
  margin-top: var(--s-1);
  font-weight: 600;
}
.stat-card { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-4); }
.stat-card .muted { margin-top: var(--s-1); font-size: 11px; color: var(--fg-2); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

/* ============================================================
   Progress bar
   ============================================================ */
.bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--s-2);
}
.bar-fill {
  height: 100%;
  background: var(--leaf-dim);
  transition: width var(--t-norm) var(--ease-out);
}
.bar.lg { height: 8px; }
.bar.small { height: 3px; }
.bar-fill.bad { background: var(--err); }
.bar-fill.good { background: var(--ok); }

/* ============================================================
   Tables
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--fg-2);
  padding: var(--s-2) var(--s-3);
  text-align: left;
  border-bottom: 1px solid var(--border-2);
}
td {
  padding: 0 var(--s-3);
  height: 36px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-1);
  color: var(--fg-0);
}
td.num { text-align: right; }

/* ============================================================
   Chips
   ============================================================ */
.chip, .meta-chip, .mini-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-1);
  background: var(--bg-3);
  color: var(--fg-1);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-1);
  font-family: var(--font-mono);
  line-height: 1.6;
}
.chip + .chip, .meta-chip + .meta-chip, .mini-chip + .mini-chip { margin-left: 0; }

.part-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  line-height: 1.6;
}
.part-A {
  background: var(--leaf-tint);
  color: var(--leaf-dim);
  border: 1px solid var(--forest);
}
.part-B {
  background: var(--info-bg);
  color: #79b8ff;
  border: 1px solid #2d5a8a;
}
.pri-high {
  background: var(--err-bg);
  color: #f1837a;
  border: 1px solid #6e2825;
}
.pri-medium {
  background: var(--warn-bg);
  color: #ddb05e;
  border: 1px solid #5d4318;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-4);
  padding: var(--s-6) var(--s-6);
  margin-bottom: var(--s-5);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--leaf) 0%, var(--forest) 100%);
}
.hero h1 {
  color: var(--fg-0);
  font-size: 28px;
  margin-bottom: var(--s-2);
  letter-spacing: -0.02em;
}
.hero .lead {
  color: var(--fg-1);
  font-size: 14.5px;
  margin-bottom: var(--s-5);
  max-width: 640px;
  line-height: 1.6;
}
.hero .cta-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ============================================================
   Segmented control
   ============================================================ */
.seg {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  background: transparent;
  border: 0;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: var(--r-1);
  font: 500 12px var(--font-sans);
  color: var(--fg-1);
  font-feature-settings: "tnum";
  transition: background-color var(--t-fast), color var(--t-fast);
}
.seg-btn:hover { color: var(--fg-0); }
.seg-btn.active {
  background: var(--bg-3);
  color: var(--fg-0);
  font-weight: 600;
}

/* ============================================================
   Topic list
   ============================================================ */
.topics-header { margin-bottom: var(--s-5); }
.topics-header h1 { margin-bottom: var(--s-1); }
.topics-header .muted { color: var(--fg-1); font-size: 13px; margin-bottom: var(--s-4); }
.filter-row {
  display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center;
}
.filter-row input[type=search] { flex: 1; min-width: 200px; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}
.topic-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: var(--s-4);
  cursor: pointer;
  text-decoration: none;
  color: var(--fg-0);
  display: block;
  position: relative;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.topic-card:hover {
  border-color: var(--border-3);
  background: var(--bg-3);
  text-decoration: none;
}
.topic-card .top-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--s-2);
}
.topic-card .id-num {
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.topic-card .title {
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg-0);
  font-size: 14px;
  letter-spacing: -0.005em;
}
.topic-card .progress-line {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-3);
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.topic-card .status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-3);
}
.topic-card.mastered .status-dot { background: var(--ok); }
.topic-card.in-progress .status-dot { background: var(--warn); }
.topic-card.stub::after {
  content: "STUB";
  position: absolute; top: 12px; right: 12px;
  background: var(--warn-bg); color: #ddb05e;
  font-size: 9px; padding: 1px 6px; border-radius: var(--r-1); font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid var(--warn);
  font-family: var(--font-mono);
}
.topic-meta-row {
  margin-top: var(--s-2);
  display: flex; gap: var(--s-1); flex-wrap: wrap;
}

/* ============================================================
   Topic thumbnail grid
   ============================================================ */
.topic-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: var(--s-1);
  margin-bottom: var(--s-5);
}
.topic-thumb {
  aspect-ratio: 1;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast);
}
.topic-thumb:hover {
  border-color: var(--border-3);
  color: var(--fg-0);
  background: var(--bg-3);
  text-decoration: none;
}
.topic-thumb.mastered {
  background: var(--ok-bg);
  border-color: var(--forest);
  color: var(--leaf-dim);
}
.topic-thumb.touched {
  border-color: var(--warn);
  color: #ddb05e;
}
.topic-thumb.stub { opacity: 0.5; }
.topic-thumb .num { font-size: 12px; line-height: 1; }

/* ============================================================
   Learn mode
   ============================================================ */
.learn-header { margin-bottom: var(--s-5); }
.back {
  color: var(--fg-2);
  font-size: 12px;
  display: inline-block;
  margin-bottom: var(--s-3);
}
.back:hover { color: var(--fg-0); }
.topic-meta {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin-bottom: var(--s-2);
  flex-wrap: wrap;
}
.tetel-num { color: var(--fg-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }
.topic-title {
  color: var(--fg-0);
  margin: var(--s-2) 0 var(--s-1);
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.learn-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--s-5);
  align-items: flex-start;
}
@media (max-width: 880px) {
  .learn-grid { grid-template-columns: 1fr; }
  .learn-toc { position: relative; top: auto; }
}

.learn-toc {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: var(--s-2) 0 var(--s-2);
  position: sticky;
  top: var(--s-4);
}
.learn-toc h3 {
  margin: var(--s-2) var(--s-3) var(--s-1);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  font-weight: 600;
  padding: 0;
}
.learn-tab-list {
  list-style: none;
  padding: 0; margin: 0;
}
.learn-tab-list li {
  display: flex;
  align-items: center;
  padding: 7px var(--s-3);
  cursor: pointer;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.learn-tab-list li:hover {
  background: var(--bg-3);
  color: var(--fg-0);
}
.learn-tab-list li.active {
  background: var(--bg-3);
  color: var(--leaf-dim);
  border-left-color: var(--leaf-dim);
  font-weight: 500;
}
.learn-tab-list .tab-group-title {
  padding: var(--s-3) var(--s-3) var(--s-1);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  font-weight: 600;
  cursor: default;
  border: 0;
}
.learn-tab-list .tab-group-title:hover { background: transparent; color: var(--fg-2); }
.learn-tab-list .tab-group-title:first-child { padding-top: 0; }

.learn-actions {
  display: flex; flex-direction: column; gap: 6px;
  margin: var(--s-3) var(--s-3) 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-1);
}

.learn-main {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: var(--s-5) var(--s-6);
  font-size: 14px;
  min-height: 400px;
  animation: tab-in 200ms var(--ease-out);
}
.learn-main p { margin-bottom: var(--s-3); }
@keyframes tab-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-block {
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-1);
}
.section-block:last-of-type { border-bottom: 0; }
.section-block h2 {
  display: flex; align-items: center;
  gap: var(--s-3);
  margin-top: 0;
  font-size: 18px;
}
.sec-num {
  background: var(--forest);
  color: var(--leaf);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  width: 22px; height: 22px;
  border-radius: var(--r-1);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.recall-prompt {
  background: var(--bg-3);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  border-left: 2px solid var(--forest);
}
.recall-prompt h4 {
  margin: 0 0 var(--s-2);
  color: var(--fg-1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.recall-prompt textarea { min-height: 56px; resize: vertical; }
.recall-prompt .recall-actions {
  display: flex; gap: var(--s-2); margin-top: var(--s-2);
}

.section-text {
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-0);
}
.section-text.hidden { display: none; }
.hidden { display: none !important; }

.vizsga-section {
  background: var(--bg-2);
  border-left: 2px solid var(--leaf-dim);
  padding-left: 22px;
}
.vizsga-section h2 { margin-top: 0; }

.checkpoint {
  margin-top: var(--s-3);
  display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center;
}
.checkpoint.hidden { display: none; }
.cp-label {
  font-size: 11px;
  color: var(--fg-2);
  margin-right: var(--s-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.cp-btn {
  padding: 4px 10px;
  border-radius: var(--r-1);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  cursor: pointer;
  font: 500 12px var(--font-sans);
  color: var(--fg-1);
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.cp-btn:hover { background: var(--bg-3); color: var(--fg-0); border-color: var(--border-3); }
.cp-btn.good { color: var(--leaf-dim); border-color: var(--forest); }
.cp-btn.good:hover { background: var(--leaf-tint); color: var(--leaf); }
.cp-btn.bad { color: var(--err); border-color: #6e2825; }
.cp-btn.bad:hover { background: var(--err-bg); }
.cp-btn:disabled { opacity: 0.5; cursor: default; }

/* Objectives */
.objectives-block { margin: var(--s-4) 0; }
.objectives { list-style: none; padding: 0; margin: 0; }
.objectives li { padding: 7px 0; border-bottom: 1px solid var(--border-1); }
.objectives li:last-child { border-bottom: 0; }
.objectives label {
  display: flex; align-items: center; gap: var(--s-3);
  cursor: pointer; color: var(--fg-0); font-size: 13.5px;
  margin: 0;
}
.objectives input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--leaf-dim); }

/* Key terms / glossary */
.terms-block { margin: var(--s-4) 0; }
.terms { margin: 0; padding: 0; }
.terms dt {
  font-weight: 600;
  color: var(--leaf-dim);
  margin-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -0.005em;
}
.terms dd {
  margin: 3px 0 var(--s-2) 0;
  color: var(--fg-1);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border-1);
  font-size: 13px;
  line-height: 1.55;
}
.terms dd:last-child { border-bottom: 0; }

/* Related topics */
.related-block { margin: var(--s-4) 0; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-1);
}
.related-chip {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  padding: var(--s-2) var(--s-3);
  display: flex; gap: var(--s-2); align-items: center;
  text-decoration: none;
  color: var(--fg-0);
  font-size: 12px;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.related-chip:hover {
  border-color: var(--border-3);
  background: var(--bg-2);
  text-decoration: none;
}
.related-chip .rel-num {
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
}
.related-chip .rel-title { line-height: 1.4; }

/* Key questions block (legacy, not visible since merged into cheat sheet) */
.question-block { margin-bottom: var(--s-3); }
.question-block h3 {
  margin-top: 0;
  color: var(--fg-0);
  font-size: 14px;
  font-weight: 500;
}
.question-block .your-answer textarea { min-height: 64px; }
.question-block .model-answer {
  background: var(--ok-bg);
  border-left: 2px solid var(--ok);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  margin-top: var(--s-2);
}
.question-block .src-tag {
  color: var(--ok);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: var(--s-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.question-block .section-text { font-family: var(--font-sans); white-space: pre-wrap; font-size: 13px; }

/* Notes editor (legacy) */
.notes-area { padding: var(--s-4) var(--s-5); }
.notes-area h3 { margin-top: 0; }
.notes-area textarea {
  width: 100%;
  min-height: 240px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}
.notes-status { color: var(--leaf-dim); font-size: 11px; margin-top: var(--s-1); min-height: 1em; font-weight: 500; }

/* ============================================================
   AI Tutor chat
   ============================================================ */
.tutor {
  display: flex; flex-direction: column;
  height: calc(100vh - 260px);
  min-height: 500px;
  max-height: 820px;
}
.tutor-header {
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--border-1);
}
.tutor-progress {
  display: flex; gap: var(--s-1); align-items: center; flex-wrap: wrap;
  margin-bottom: 6px;
}
.tutor-section-indicator {
  color: var(--fg-1);
  font-size: 12px;
}

.tutor-chat {
  flex: 1; overflow-y: auto;
  padding: var(--s-3);
  background: var(--bg-0);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  display: flex; flex-direction: column; gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.tutor-chat .chat-msg, .chat .chat-msg {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-2);
  max-width: 88%;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13.5px;
  animation: bubble-in 200ms var(--ease-out);
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tutor-chat .chat-msg.user, .chat .chat-msg.user {
  align-self: flex-end;
  background: var(--leaf-tint);
  color: var(--fg-0);
  border: 1px solid var(--forest);
  border-bottom-right-radius: 2px;
}
.tutor-chat .chat-msg.bot, .chat .chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-2);
  color: var(--fg-0);
  border: 1px solid var(--border-1);
  border-bottom-left-radius: 2px;
}
.tutor-chat .chat-msg.bot.streaming::after, .chat .chat-msg.bot.streaming::after {
  content: "▍";
  color: var(--leaf-dim);
  margin-left: 2px;
  animation: blink 1s infinite;
}
.tutor-chat .chat-msg.bot.error, .chat .chat-msg.bot.error {
  background: var(--err-bg);
  border-color: var(--err);
  color: #f1837a;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.chat-empty { text-align: center; color: var(--fg-2); padding: var(--s-7); font-style: italic; font-size: 13px; }

.tutor-input, .teacher-input { display: flex; flex-direction: column; gap: var(--s-2); }
.tutor-input textarea { min-height: 48px; resize: vertical; }
.tutor-input-actions { display: flex; gap: var(--s-1); flex-wrap: wrap; align-items: center; }
.tutor-input-actions .cta.primary { margin-left: auto; }

/* Markdown in chat bubbles */
.chat-msg.bot p { margin: 0 0 var(--s-2); }
.chat-msg.bot p:last-child { margin-bottom: 0; }
.chat-msg.bot strong { color: var(--leaf-dim); font-weight: 600; }
.chat-msg.bot em { font-style: italic; color: var(--fg-0); }
.chat-msg.bot code {
  background: var(--bg-3);
  padding: 1px 6px; border-radius: var(--r-1);
  font-family: var(--font-mono); font-size: 0.9em;
  border: 1px solid var(--border-1);
}
.chat-msg.bot pre.md-code {
  background: var(--bg-0);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-2);
  font-family: var(--font-mono); font-size: 12px;
  overflow-x: auto; white-space: pre;
  margin: var(--s-2) 0;
  border: 1px solid var(--border-1);
}
.chat-msg.bot ul.md-ul, .chat-msg.bot ol.md-ol { margin: var(--s-1) 0 var(--s-2); padding-left: 20px; }
.chat-msg.bot li { margin-bottom: 3px; line-height: 1.55; }
.chat-msg.bot h3.md-h, .chat-msg.bot h4.md-h { margin: var(--s-3) 0 var(--s-1); }
.chat-msg.bot h3.md-h { font-size: 15px; }
.chat-msg.bot h4.md-h {
  font-size: 13px;
  color: var(--leaf-dim);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

/* ============================================================
   Drill (flashcards interface)
   ============================================================ */
.drill-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-4); flex-wrap: wrap; gap: var(--s-3);
}
.drill-header h1 { margin: 0; font-size: 22px; }
.drill-meta {
  display: flex; gap: var(--s-3);
  font-weight: 500;
  color: var(--fg-1);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.drill-stage {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: var(--s-5) var(--s-6);
  min-height: 380px;
}
.flashcard .card-tag {
  color: var(--fg-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-family: var(--font-mono);
}
.flashcard .topic-context {
  color: var(--fg-2);
  font-size: 11px;
  margin-bottom: var(--s-3);
}
.flashcard .card-q {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  margin: var(--s-3) 0 var(--s-5);
  line-height: 1.4;
  color: var(--fg-0);
  letter-spacing: -0.005em;
}
.flashcard .your-answer { margin-bottom: var(--s-3); }
.flashcard .your-answer textarea { min-height: 76px; }
.flashcard .reveal-actions { display: flex; gap: var(--s-1); flex-wrap: wrap; margin-top: var(--s-2); }
.flashcard .card-a {
  background: var(--bg-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  margin-top: var(--s-3);
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  border: 1px solid var(--border-1);
}
.drill-empty { text-align: center; padding: var(--s-7) var(--s-4); }

/* MCQ / TF buttons */
.mcq-options { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-3); }
.mcq-opt {
  text-align: left;
  padding: var(--s-2) var(--s-3);
  background: var(--bg-2);
  color: var(--fg-0);
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  cursor: pointer;
  font: 500 13px var(--font-sans);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.mcq-opt:hover:not(:disabled) { border-color: var(--border-3); background: var(--bg-3); }
.mcq-opt.correct {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok);
  font-weight: 600;
}
.mcq-opt.wrong {
  background: var(--err-bg);
  border-color: var(--err);
  color: var(--err);
}
.mcq-opt:disabled { cursor: default; }

.mcq-opt-label, .tf-opt-label {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-2) var(--s-3);
  background: var(--bg-2);
  color: var(--fg-0);
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  cursor: pointer;
  font: 500 13px var(--font-sans);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.mcq-opt-label:hover, .tf-opt-label:hover { border-color: var(--border-3); background: var(--bg-3); }
.mcq-opt-label:has(input:checked), .tf-opt-label:has(input:checked) {
  background: var(--leaf-tint);
  border-color: var(--forest);
}
.mcq-opt-label input, .tf-opt-label input { margin-top: 3px; accent-color: var(--leaf-dim); }

.tf-row { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.tf-btn { flex: 1; }
.tf-btn.correct { background: var(--ok); border-color: var(--ok); color: #fff; }
.tf-btn.wrong { background: var(--err); border-color: var(--err); color: #fff; }

.explanation {
  margin-top: var(--s-3); padding: var(--s-3) var(--s-4);
  background: var(--bg-3);
  border-radius: var(--r-2);
  border-left: 2px solid var(--forest);
}
.explain-row { font-weight: 600; margin-bottom: var(--s-1); font-size: 13px; }
.explain-detail { color: var(--fg-1); font-size: 12px; margin-bottom: var(--s-2); }

/* ============================================================
   Quizlet flashcards
   ============================================================ */
.fc-deck { display: flex; flex-direction: column; gap: var(--s-3); }
.fc-controls {
  display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-2) var(--s-3);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
}
.fc-control-group { display: flex; gap: 6px; flex-wrap: wrap; }
.fc-stats {
  display: flex; gap: var(--s-4); align-items: center;
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.fc-counter { color: var(--leaf-dim); }
.fc-known { color: var(--ok); }
.fc-learning { color: var(--warn); }

.fc-stage {
  min-height: 360px;
  display: flex; align-items: center; justify-content: center;
  perspective: 1500px;
}
.fc-card {
  width: 100%; max-width: 600px; aspect-ratio: 16/10;
  cursor: pointer;
  perspective: 1500px;
  outline: none;
  position: relative;
}
.fc-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 500ms var(--ease-in-out);
}
.fc-card-front, .fc-card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-3);
  padding: var(--s-5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  text-align: center;
}
.fc-card-back {
  transform: rotateY(180deg);
  background: var(--bg-3);
  border-color: var(--forest);
}
.fc-card.starred .fc-card-front, .fc-card.starred .fc-card-back {
  border-color: var(--leaf-dim);
}
.fc-side-tag {
  position: absolute; top: var(--s-3); left: var(--s-4);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 10px; font-weight: 600; color: var(--fg-2);
  font-family: var(--font-mono);
}
.fc-star {
  position: absolute; top: var(--s-2); right: var(--s-3);
  font-size: 18px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  color: var(--fg-3);
  transition: color var(--t-fast);
}
.fc-star:hover { color: var(--leaf-dim); }
.fc-card.starred .fc-star { color: var(--leaf-dim); }
.fc-content {
  font-family: var(--font-sans);
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.4;
  color: var(--fg-0);
  max-width: 92%;
  margin: auto;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.fc-card-back .fc-content {
  font-size: clamp(13px, 1.8vw, 16px);
  font-weight: 400;
  color: var(--fg-0);
}
.fc-hint {
  position: absolute; bottom: var(--s-3); left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
}
.fc-nav {
  display: flex; gap: var(--s-2); justify-content: center; align-items: center; flex-wrap: wrap;
}
.fc-help {
  text-align: center;
  font-size: 11px;
  color: var(--fg-3);
  margin-top: var(--s-2);
}
.fc-empty { text-align: center; padding: var(--s-7) var(--s-4); }

/* Match game */
.match-game { display: flex; flex-direction: column; gap: var(--s-3); }
.match-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--s-3);
}
.match-meta {
  display: flex; gap: var(--s-3); align-items: center;
  font-weight: 500;
  color: var(--fg-1);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 720px) { .match-grid { grid-template-columns: repeat(2, 1fr); } }
.match-tile {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  padding: var(--s-3);
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-0);
}
.match-tile:hover { border-color: var(--border-3); background: var(--bg-3); }
.match-tile.match-term { background: var(--leaf-tint); font-weight: 600; border-color: var(--forest); }
.match-tile.match-def { color: var(--fg-1); }
.match-tile.selected {
  border-color: var(--leaf);
  background: var(--leaf);
  color: var(--bg-0);
  font-weight: 600;
}
.match-tile.matched {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok);
  pointer-events: none; opacity: 0.55;
}
.match-tile.wrong {
  background: var(--err-bg);
  border-color: var(--err);
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.match-win {
  margin-top: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--leaf-tint);
  border: 1px solid var(--forest);
  border-radius: var(--r-2);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--leaf-dim);
}

/* ============================================================
   Exam mode
   ============================================================ */
.exam-header { margin-bottom: var(--s-4); }
.exam-header h1 { margin-bottom: var(--s-1); }
.exam-header .lead { color: var(--fg-1); font-size: 14px; line-height: 1.55; max-width: 720px; }

.exam-setup { text-align: center; padding: var(--s-7) var(--s-5); }
.exam-setup .cta.big { margin: var(--s-3) 0; }
.exam-options { margin: var(--s-3) 0; }
.exam-options label { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 13px; }

.exam-active { padding: var(--s-5); }
.phase-chip {
  display: inline-flex; align-items: center;
  padding: 3px var(--s-3);
  background: var(--leaf-tint);
  color: var(--leaf-dim);
  border: 1px solid var(--forest);
  border-radius: var(--r-1);
  font: 600 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s-3);
}
.phase-chip.phase-answer { background: var(--warn-bg); color: #ddb05e; border-color: #5d4318; }
.phase-chip.phase-eval { background: var(--info-bg); color: #79b8ff; border-color: #2d5a8a; }

.exam-topics-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-4); }
@media (max-width: 720px) { .exam-topics-row { grid-template-columns: 1fr; } }
.exam-topic-card {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--leaf-dim);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.exam-topic-card.part-B { border-left-color: var(--info); }
.exam-topic-card h3 { margin: 4px 0 0; font-size: 15px; }

.exam-timer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--s-3) 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-3);
  border-radius: var(--r-2);
  border: 1px solid var(--border-1);
  gap: var(--s-3);
  flex-wrap: wrap;
}
.exam-timer {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--fg-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.exam-timer.warning { color: var(--err); }

.exam-answer-area { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 720px) { .exam-answer-area { grid-template-columns: 1fr; } }
.exam-answer-area .col h3 { margin-top: 0; }
.exam-answer-area textarea { min-height: 220px; resize: vertical; font-family: var(--font-sans); }

.exam-submit { margin-top: var(--s-4); text-align: right; }

.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: var(--s-2) var(--s-3); margin-bottom: 4px;
  background: var(--bg-3);
  border-radius: var(--r-2);
  display: flex; gap: var(--s-2); align-items: flex-start;
  border: 1px solid var(--border-1);
}
.checklist li input[type=checkbox] { margin-top: 3px; accent-color: var(--leaf-dim); }
.checklist li label { color: var(--fg-0); margin: 0; cursor: pointer; font-size: 13px; }

.self-rating {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-3);
  border-radius: var(--r-2);
  margin-top: var(--s-3);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--fg-1);
}
.rating-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-1);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  cursor: pointer;
  font: 600 12px var(--font-mono);
  color: var(--fg-1);
  transition: all var(--t-fast);
}
.rating-btn:hover { border-color: var(--border-3); color: var(--fg-0); }
.rating-btn.selected {
  background: var(--leaf);
  color: var(--bg-0);
  border-color: var(--leaf);
}
.rating-label { font-style: italic; color: var(--fg-1); font-size: 12px; }

.past-exams { margin-top: var(--s-5); text-align: left; padding: var(--s-4) var(--s-5); }
.past-exams h3 { margin-top: 0; }
.past-exam-row {
  display: flex; justify-content: space-between;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
  font-size: 12px;
}
.past-exam-row:last-child { border-bottom: 0; }
.past-exam-row strong { color: var(--fg-0); font-weight: 600; }
.past-exam-row .score {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.past-exam-row .score.good { color: var(--ok); }
.past-exam-row .score.bad { color: var(--err); }

.prep-recall summary { cursor: pointer; color: var(--fg-1); font-size: 12px; padding: 4px 0; }
.prep-recall summary:hover { color: var(--fg-0); }
.prep-recall pre {
  background: var(--bg-3);
  font-family: var(--font-sans);
  font-size: 12px;
  white-space: pre-wrap;
}

.model-show {
  background: var(--ok-bg);
  border-left: 2px solid var(--ok);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-size: 13px;
  margin-top: var(--s-2);
}

/* ============================================================
   AI Test
   ============================================================ */
.test-start, .test-active, .test-results, .test-loading { display: flex; flex-direction: column; gap: var(--s-3); }
.test-loading {
  align-items: center; text-align: center; padding: var(--s-7) var(--s-4);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
}
.test-loading h3 { margin-top: var(--s-3); }
.test-loading p { color: var(--fg-1); }
.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg-3);
  border-top-color: var(--leaf-dim);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.test-config { padding: var(--s-5) var(--s-5); }
.test-config ul { padding-left: 20px; margin: var(--s-2) 0; }
.test-config li { margin-bottom: 5px; font-size: 13.5px; }
.test-options { margin: var(--s-4) 0; }
.test-history { padding: var(--s-4) var(--s-5); }

.test-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--s-3);
  padding-bottom: var(--s-3); border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--s-3);
}
.test-meta {
  color: var(--fg-1); font-size: 12px;
  display: flex; gap: var(--s-3);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.test-questions { display: flex; flex-direction: column; gap: var(--s-3); }
.test-question { padding: var(--s-4) var(--s-5); }
.test-question h3 { margin: 0; font-size: 14px; font-weight: 600; }
.qtype {
  font-size: 10px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s-1);
  font-family: var(--font-mono);
  font-weight: 600;
}
.qprompt {
  font-size: 14px;
  margin: var(--s-2) 0 var(--s-3);
  color: var(--fg-0);
  line-height: 1.6;
}

.test-actions {
  display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap;
  padding-top: var(--s-4); border-top: 1px solid var(--border-1);
}

.test-summary { text-align: center; margin-bottom: var(--s-5); padding: var(--s-5) 0; }
.big-score {
  font-size: 56px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--fg-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}
.big-score.good { color: var(--ok); }
.big-score.bad { color: var(--err); }

.test-q-list { display: flex; flex-direction: column; gap: var(--s-2); }
.test-result-q {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--fg-3);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.test-result-q.ok { border-left-color: var(--ok); }
.test-result-q.partial { border-left-color: var(--warn); }
.test-result-q.wrong { border-left-color: var(--err); }
.qhead { display: flex; gap: var(--s-3); align-items: center; margin-bottom: var(--s-1); }
.qnum { font-family: var(--font-mono); font-weight: 600; color: var(--fg-2); font-size: 12px; }
.qscore {
  font-weight: 600; font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.test-result-q.ok .qscore { color: var(--ok); }
.test-result-q.partial .qscore { color: var(--warn); }
.test-result-q.wrong .qscore { color: var(--err); }
.qtype-sm {
  font-size: 10px; color: var(--fg-2);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-left: auto; font-family: var(--font-mono); font-weight: 600;
}
.ans-row { margin: var(--s-1) 0; font-size: 12px; }
.ans-row strong { color: var(--fg-0); }
.ans-block {
  background: var(--bg-3);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-1);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: var(--s-1);
}
.ai-feedback {
  background: var(--leaf-tint-soft);
  border-left: 2px solid var(--forest);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-1);
  margin: var(--s-2) 0;
  font-size: 12.5px;
  color: var(--fg-0);
  line-height: 1.55;
}
.ai-feedback strong { color: var(--leaf-dim); font-weight: 600; font-family: var(--font-mono); font-size: 11px; }
.explain {
  background: var(--bg-3);
  border-radius: var(--r-1);
  padding: var(--s-2) var(--s-3);
  margin-top: var(--s-1);
  font-size: 12.5px;
  border-left: 2px solid var(--border-3);
}
.explain strong { color: var(--leaf-dim); }

/* ============================================================
   Cheat Sheet v2 — comprehensive exam-eve reference
   ============================================================ */
.cheatsheet { font-size: 14px; }
.cs-header {
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--s-4);
}
.cs-title {
  margin: var(--s-1) 0;
  font-size: 32px;
  letter-spacing: -0.025em;
  font-weight: 700;
  line-height: 1.15;
}
.cs-header .cs-meta {
  display: flex; gap: var(--s-1); flex-wrap: wrap;
  color: var(--fg-1);
  font-size: 12px;
  margin-top: var(--s-3);
}
.cs-actions {
  display: flex; gap: var(--s-2); margin-bottom: var(--s-4);
  position: sticky; top: var(--s-3); z-index: 5;
  background: var(--bg-0);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
}

/* ---- A LÉNYEG · feature definition block ---- */
.cs-feature {
  background: linear-gradient(180deg, var(--leaf-tint-soft) 0%, var(--bg-2) 100%);
  border: 1px solid var(--forest);
  border-left: 3px solid var(--leaf-dim);
  border-radius: var(--r-3);
  padding: var(--s-5) var(--s-5);
  margin-bottom: var(--s-4);
}
.cs-feature-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--leaf-dim);
  font-weight: 700;
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
}
.cs-feature-text {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-0);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.cs-feature-text strong.cs-key {
  color: var(--leaf-dim);
  font-weight: 700;
}

.cs-section {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: var(--s-5) var(--s-5);
  margin-bottom: var(--s-3);
}
.cs-section > h3 {
  margin: 0 0 var(--s-4);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-2);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.cs-section > h3::before {
  content: "";
  display: inline-block;
  width: 16px; height: 2px;
  background: var(--leaf-dim);
}

/* ---- BTK SZAKASZOK ---- */
.cs-btk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.cs-btk-block {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--forest);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.cs-btk-head {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  margin-bottom: var(--s-2);
  flex-wrap: wrap;
}
.cs-btk-ref-big {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--leaf-dim);
  background: var(--leaf-tint);
  padding: 3px 10px;
  border-radius: var(--r-1);
  border: 1px solid var(--forest);
  letter-spacing: 0.02em;
}
.cs-btk-subtitle {
  font-size: 12px;
  color: var(--fg-2);
  font-style: italic;
}
.cs-btk-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-0);
  font-family: var(--font-sans);
}

/* ---- FELTÉTELEK / ELEMEK ---- */
.cs-element-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.cs-element {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.cs-element-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--forest);
  color: var(--leaf);
  border-radius: var(--r-1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.cs-element-body { flex: 1; min-width: 0; }
.cs-element-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--leaf-dim);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cs-element-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-0);
}

/* ---- KULCSFOGALMAK · glossary visible (not hover) ---- */
.cs-glossary { margin: 0; padding: 0; }
.cs-gloss-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: var(--s-4);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
  align-items: baseline;
}
.cs-gloss-row:last-child { border-bottom: 0; }
.cs-gloss-term {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--leaf-dim);
  margin: 0;
  letter-spacing: -0.005em;
}
.cs-gloss-def {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-1);
}

/* ---- ELHATÁROLÁSOK ---- */
.cs-stack { display: flex; flex-direction: column; gap: var(--s-2); }
.cs-distinct {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--warn);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.cs-distinct-title {
  font-size: 13px;
  font-weight: 600;
  color: #ddb05e;
  margin-bottom: var(--s-1);
  letter-spacing: -0.005em;
}
.cs-distinct-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-0);
}

/* ---- PÉLDÁK ---- */
.cs-example-list { list-style: none; padding: 0; margin: 0; }
.cs-example {
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
  display: flex; gap: var(--s-3); align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-0);
}
.cs-example:last-child { border-bottom: 0; }
.cs-example-marker {
  flex-shrink: 0;
  color: var(--leaf-dim);
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 0.8;
  font-weight: 700;
  margin-top: 4px;
}

/* ---- VIZSGA-ELŐADÁS PLAN ---- */
.cs-vizsga-plan { list-style: none; padding: 0; margin: 0; }
.cs-plan-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
}
.cs-plan-step:last-child { border-bottom: 0; }
.cs-plan-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--leaf-dim);
  letter-spacing: 0.04em;
}
.cs-plan-title {
  font-size: 13.5px;
  color: var(--fg-0);
  line-height: 1.5;
}
.cs-plan-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-2);
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: var(--r-1);
  border: 1px solid var(--border-1);
  font-variant-numeric: tabular-nums;
}

/* ---- TARTALOMJEGYZÉK ---- */
.cs-outline { list-style: none; padding: 0; margin: 0; }
.cs-outline-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: var(--s-3);
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-1);
  font-size: 13px;
}
.cs-outline-item:last-child { border-bottom: 0; }
.cs-outline-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-2);
  letter-spacing: 0.04em;
}
.cs-outline-title { color: var(--fg-0); line-height: 1.5; }
.cs-outline-len {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}

/* ---- VIZSGAKÉRDÉSEK ---- */
.cs-q-list { list-style: none; padding: 0; margin: 0; counter-reset: cs-q; }
.cs-q-list li {
  padding: var(--s-2) 0 var(--s-2) var(--s-6);
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
  color: var(--fg-0);
  counter-increment: cs-q;
  border-bottom: 1px solid var(--border-1);
}
.cs-q-list li:last-child { border-bottom: 0; }
.cs-q-list li::before {
  content: counter(cs-q, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--leaf-dim);
  font-weight: 700;
}

/* ---- SAJÁT JEGYZET ---- */
.cs-notes-editor {
  width: 100%;
  min-height: 180px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.cs-notes-status {
  color: var(--leaf-dim);
  font-size: 11px;
  margin-top: var(--s-1);
  min-height: 1em;
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ---- VIZSGAVÁLASZ TL;DR ---- */
.cs-tldr-section { border-left: 2px solid var(--leaf-dim); }
.cs-vizsga-tldr {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--fg-0);
  white-space: pre-wrap;
}

/* ---- KEY TERM EMPHASIS (inline bold) ---- */
strong.cs-key {
  color: var(--leaf-dim);
  font-weight: 700;
  letter-spacing: -0.005em;
}
.cs-vizsga-tldr strong.cs-key { font-weight: 600; }
.cs-btk-body strong.cs-key { font-weight: 700; }

/* ---- BTK ref chip in any body ---- */
.cs-bk-ref {
  font-family: var(--font-mono);
  background: var(--leaf-tint);
  padding: 1px 7px;
  border-radius: var(--r-1);
  font-size: 11.5px;
  color: var(--leaf-dim);
  border: 1px solid var(--forest);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============================================================
   Settings
   ============================================================ */
.settings-block { padding: var(--s-4) var(--s-5); margin-bottom: var(--s-3); }
.settings-block h3 {
  margin-top: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.settings-block.danger { border-color: #6e2825; }
.settings-block.danger h3 { color: var(--err); }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
}
.settings-row:last-of-type { border-bottom: 0; }

/* ============================================================
   Stats
   ============================================================ */
.stats-page { font-size: 13px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3); margin-bottom: var(--s-4);
}
.stat-card.big { border-left: 2px solid var(--leaf-dim); }
.stat-icon { display: none; }
.progress-row {
  display: grid; grid-template-columns: 200px 1fr auto;
  gap: var(--s-3); align-items: center;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-1);
}
.progress-row:last-child { border-bottom: 0; }
.progress-label { color: var(--fg-1); font-weight: 500; font-size: 13px; }
.progress-num {
  font-weight: 600; color: var(--fg-0);
  font-family: var(--font-mono); white-space: nowrap;
  font-variant-numeric: tabular-nums; font-size: 13px;
}
.exam-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-2); margin-bottom: var(--s-3);
}
.exam-history { margin-top: var(--s-2); }
.weak-row {
  display: grid; grid-template-columns: 1fr 140px 70px;
  gap: var(--s-3); align-items: center;
  padding: var(--s-2) 0; border-bottom: 1px solid var(--border-1);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.weak-row a { color: var(--fg-0); }
.weak-row a:hover { color: var(--leaf-dim); }

/* ============================================================
   Achievements
   ============================================================ */
.achievements-page h1 { margin-bottom: var(--s-1); }
.achievements-page .lead { color: var(--fg-1); margin-bottom: var(--s-4); font-size: 13px; }
.achv-summary { max-width: 320px; margin-bottom: var(--s-4); }
.achv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-2);
}
.achv-card {
  padding: var(--s-3) var(--s-4);
  display: flex; gap: var(--s-3); align-items: flex-start;
  opacity: 0.45;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}
.achv-card.unlocked {
  opacity: 1;
  border-color: var(--forest);
  background: linear-gradient(135deg, var(--leaf-tint-soft), var(--bg-2));
}
.achv-icon { font-size: 20px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.achv-name { font-weight: 600; font-size: 13.5px; color: var(--fg-0); }
.achv-desc { color: var(--fg-1); font-size: 12px; margin-top: 2px; line-height: 1.5; }
.achv-status.good {
  color: var(--leaf-dim);
  font-weight: 500;
  margin-top: var(--s-2);
  font-size: 11px;
  font-family: var(--font-mono);
}
.achv-progress { margin-top: var(--s-2); }
.achv-progress-label {
  color: var(--fg-2); font-size: 11px;
  margin-top: var(--s-1);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.achv-teaser-card {
  display: flex; gap: var(--s-3); align-items: center; justify-content: space-between;
  margin: 0 0 var(--s-4);
}
.achv-teaser-row { display: flex; gap: var(--s-1); flex-wrap: wrap; margin-top: var(--s-1); }
.achv-mini {
  background: var(--bg-3);
  padding: 2px var(--s-2);
  border-radius: var(--r-1);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-1);
  color: var(--fg-0);
}

/* Tips list */
.topics-header h1 { margin-bottom: var(--s-1); }
.tips { list-style: none; padding: 0; margin: 0; }
.tips li {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-2);
  margin-bottom: var(--s-1);
  font-size: 13px;
  color: var(--fg-0);
  line-height: 1.6;
}
.tips li strong { color: var(--leaf-dim); font-weight: 600; }

/* 404 */
.four-oh-four { text-align: center; padding: var(--s-8) var(--s-4); }

/* ============================================================
   Toast
   ============================================================ */
#toast-stack {
  position: fixed; bottom: var(--s-5); right: var(--s-5); z-index: 100;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.toast {
  background: var(--bg-3);
  color: var(--fg-0);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-2);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--leaf-dim);
  font: 500 13px var(--font-sans);
  min-width: 220px; max-width: 360px;
  animation: toast-in 220ms var(--ease-out);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.good { border-left-color: var(--ok); }
.toast.gold { border-left-color: var(--warn); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: var(--s-5);
  color: var(--fg-3);
  font-size: 11px;
  border-top: 1px solid var(--border-1);
  margin-top: var(--s-5);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ============================================================
   Print (cheat sheet PDF export)
   ============================================================ */
@media print {
  body { background: white; color: black; font-size: 11pt; }
  .app-nav, .topbar, .footer, .cs-actions, .learn-toc, .learn-actions, .back { display: none !important; }
  .app-shell { display: block; }
  .app-main { padding: 0; max-width: 100%; }
  .learn-grid { display: block; }
  .learn-main { padding: 0; background: white; border: none; }
  .cs-section { background: white; border: 1px solid #ccc; border-left: 3px solid #00684a; color: black; page-break-inside: avoid; padding: 12pt 14pt; margin-bottom: 8pt; }
  .cs-section h3 { color: #00684a; }
  .cs-bk-ref { background: #ebf8f1; color: #00684a; border-color: #b7e0c8; }
  .cs-term { background: #f3f5f4; color: black; border-color: #ccc; }
  .cs-list li { color: black; border-color: #ddd; }
  .cs-list .cs-marker { background: #00684a; }
  .cs-q-list li::before { color: #00684a; }
  h1, h2, h3, h4 { color: black; }
  .cs-vizsga-tldr { color: black; }
}

/* ============================================================
   Utility
   ============================================================ */
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.spaced { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; }
.cta-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-2 { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-4 { display: flex; flex-direction: column; gap: var(--s-4); }
