/* Excel oktatás: site styles. Tokens first; light + dark (system or manual). */
:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #f0f3ef;
  --surface-3: #e7ece6;
  --ink: #18211b;
  --ink-soft: #4b5750;
  --ink-muted: #5f6b63;
  --rule: #dde3dc;
  --rule-strong: #c3ccc3;
  --brand: #107c41;
  --brand-strong: #0c6534;
  --brand-ink: #0b6a37;
  --brand-tint: #e5f2ea;
  --brand-tint-2: #cfe7d8;
  --on-brand: #ffffff;
  --focus: #1a73e8;
  --ok: #157a3c;
  --ok-tint: #e3f4e8;
  --bad: #b3261e;
  --bad-tint: #fdeceb;
  --warn: #9a5b00;
  --warn-tint: #fff5df;
  --warn-rule: #f0c56a;
  --note: #1f5fbf;
  --note-tint: #eaf1fd;
  --note-rule: #a9c4f0;
  --tip-rule: #9fd2b2;
  /* spreadsheet mock */
  --grid: #d9dcd9;
  --grid-head: #f2f3f2;
  --grid-head-ink: #5c635e;
  --cell: #ffffff;
  --cell-sel: #dcefe3;
  --cell-hl: #fff2b8;
  --cell-err: #fbe3e1;
  --shadow-sm: 0 1px 2px rgba(20, 30, 24, .06);
  --shadow: 0 1px 2px rgba(20, 30, 24, .05), 0 6px 20px -8px rgba(20, 30, 24, .18);
  --shadow-lg: 0 20px 60px -20px rgba(10, 20, 14, .35);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SFMono-Regular", ui-monospace, Menlo, monospace;
  --topbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1310;
    --surface: #151b17;
    --surface-2: #1b231e;
    --surface-3: #232d27;
    --ink: #e6ece7;
    --ink-soft: #b8c3bb;
    --ink-muted: #9aa69e;
    --rule: #28322c;
    --rule-strong: #38443d;
    --brand: #3fbf7a;
    --brand-strong: #5fd394;
    --brand-ink: #74d9a2;
    --brand-tint: #16301f;
    --brand-tint-2: #1d4029;
    --on-brand: #04170b;
    --focus: #7fb1ff;
    --ok: #6fd69a;
    --ok-tint: #143020;
    --bad: #ff8a80;
    --bad-tint: #3a1715;
    --warn: #f3bf5a;
    --warn-tint: #2e2410;
    --warn-rule: #6b5320;
    --note: #8fb8ff;
    --note-tint: #142238;
    --note-rule: #2f4a78;
    --tip-rule: #2d6a45;
    --grid: #303a34;
    --grid-head: #1d2520;
    --grid-head-ink: #a3aea7;
    --cell: #151b17;
    --cell-sel: #1c3a28;
    --cell-hl: #4a3f12;
    --cell-err: #45201d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1310;
  --surface: #151b17;
  --surface-2: #1b231e;
  --surface-3: #232d27;
  --ink: #e6ece7;
  --ink-soft: #b8c3bb;
  --ink-muted: #9aa69e;
  --rule: #28322c;
  --rule-strong: #38443d;
  --brand: #3fbf7a;
  --brand-strong: #5fd394;
  --brand-ink: #74d9a2;
  --brand-tint: #16301f;
  --brand-tint-2: #1d4029;
  --on-brand: #04170b;
  --focus: #7fb1ff;
  --ok: #6fd69a;
  --ok-tint: #143020;
  --bad: #ff8a80;
  --bad-tint: #3a1715;
  --warn: #f3bf5a;
  --warn-tint: #2e2410;
  --warn-rule: #6b5320;
  --note: #8fb8ff;
  --note-tint: #142238;
  --note-rule: #2f4a78;
  --tip-rule: #2d6a45;
  --grid: #303a34;
  --grid-head: #1d2520;
  --grid-head-ink: #a3aea7;
  --cell: #151b17;
  --cell-sel: #1c3a28;
  --cell-hl: #4a3f12;
  --cell-err: #45201d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); font-feature-settings: "tnum" 0;
  min-height: 100vh; display: flex; flex-direction: column;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem); margin: .2em 0 .4em; font-weight: 700; }
h2 { font-size: 1.4rem; margin: 2em 0 .6em; font-weight: 650; }
h3 { font-size: 1.12rem; margin: 1.6em 0 .4em; font-weight: 650; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 10px; }
.ic { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.ic svg, .icon-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 .3em; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 62ch; }
.loading { color: var(--ink-muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: .5em 1.05em; border-radius: 8px;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink);
  font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-muted); }
.btn:active { transform: translateY(1px); }
.btn small { font-weight: 500; opacity: .8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-lg { min-height: 50px; padding: .7em 1.4em; font-size: 1.02rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--rule); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 9px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .ic { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 16px; max-width: 1480px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 500 1.08rem/1 var(--font-display); white-space: nowrap; }
.brand b { font-weight: 700; color: var(--brand-ink); }
.logo-mark { width: 30px; height: 30px; }
.topnav { display: flex; gap: 2px; margin-left: 18px; }
.topnav a, .bottomnav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 7px; white-space: nowrap;
}
.topnav a:hover, .bottomnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a[aria-current="page"], .bottomnav a[aria-current="page"] { color: var(--brand-ink); background: var(--brand-tint); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--surface-2);
  color: var(--ink-muted); font: 500 .92rem var(--font); cursor: pointer; min-width: 200px;
}
.search-btn:hover { border-color: var(--ink-muted); color: var(--ink); }
.search-btn .ic { width: 18px; height: 18px; }
.search-kbd { margin-left: auto; font-size: .72rem; padding: 2px 6px; border: 1px solid var(--rule-strong); border-radius: 5px; background: var(--surface); color: var(--ink-muted); }
[data-theme-toggle] .ic:last-child { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .ic:first-child { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .ic:last-child { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .ic:first-child { display: none; }
  :root:not([data-theme="light"]) [data-theme-toggle] .ic:last-child { display: inline-flex; }
}
.bottomnav { display: none; }
.only-narrow { display: none; }

/* ---------------------------------------------------------------- layout */
.layout { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; }
.layout.with-sidebar { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.main { min-width: 0; padding: 28px 40px 64px; outline: none; }
.main-wide { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 24px 72px; }

/* sidebar */
.sidebar { border-right: 1px solid var(--rule); background: var(--surface); }
.sidebar-inner { position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 18px 12px 40px; overscroll-behavior: contain; }
.sidebar-title { margin: 0 8px 10px; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.sidebar-title a { color: var(--ink-muted); text-decoration: none; }
.side-modules, .side-lessons { list-style: none; margin: 0; padding: 0; }
.side-module details > summary {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px;
  cursor: pointer; list-style: none; font-weight: 600; font-size: .93rem; color: var(--ink);
}
.side-module summary::-webkit-details-marker { display: none; }
.side-module summary:hover { background: var(--surface-2); }
.side-mnum, .mod-num {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--surface-3); color: var(--ink-soft); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.side-module details[open] .side-mnum { background: var(--brand); color: var(--on-brand); }
.side-mtitle { flex: 1; line-height: 1.3; }
.side-mprog { font-size: .75rem; color: var(--ink-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.side-mprog.complete { color: var(--ok); }
.side-lessons { margin: 2px 0 8px 20px; padding-left: 12px; border-left: 1px solid var(--rule); }
.side-lessons a {
  display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 7px;
  color: var(--ink-soft); text-decoration: none; font-size: .9rem; line-height: 1.35;
}
.side-lessons a:hover { background: var(--surface-2); color: var(--ink); }
.side-lessons a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.side-num { flex: none; min-width: 2.2em; font-size: .78rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; padding-top: .1em; }
.side-num .ic { width: 16px; height: 16px; }
.side-label { flex: 1; }
.side-done { width: 16px; height: 16px; flex: none; color: var(--ok); visibility: hidden; margin-top: 2px; }
.side-done svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; }
a.is-done .side-done { visibility: visible; }
.side-score { font-size: .75rem; font-weight: 700; color: var(--ok); }
.sidebar-scrim { display: none; }

/* ---------------------------------------------------------------- lesson */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .88rem; color: var(--ink-muted); margin-bottom: 10px; }
.crumbs a { color: var(--ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.lesson-head { margin-bottom: 20px; }
.lesson-head h1 { max-width: 24em; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 48px; align-items: start; }
.lesson-grid > .prose:only-child { grid-column: 1 / -1; max-width: 760px; }
.toc { position: sticky; top: calc(var(--topbar-h) + 24px); font-size: .88rem; border-left: 1px solid var(--rule); padding-left: 14px; }
.toc-title { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 4px 0; color: var(--ink-soft); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--brand-ink); }
.toc a.is-active { color: var(--brand-ink); font-weight: 600; }

.prose { font-size: 1.04rem; }
.prose > h2:first-child, .prose > .lead + h2 { margin-top: 1.2em; }
.prose h2 { padding-top: .4em; border-top: 1px solid var(--rule); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--ink-muted); }
.prose code:not(.fbar-formula):not(.syntax code) {
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 5px; padding: .08em .35em;
  overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.prose strong { font-weight: 650; }
.prose .lead { font-size: 1.15rem; }
ul.summary { list-style: none; padding: 16px 20px; background: var(--brand-tint); border-radius: var(--radius); }
ul.summary li { position: relative; padding-left: 1.5em; }
ul.summary li::before { content: ""; position: absolute; left: 0; top: .55em; width: .55em; height: .55em; border-radius: 2px; background: var(--brand); }

kbd {
  display: inline-block; min-width: 1.6em; padding: .1em .45em; margin: 0 .05em;
  font: 600 .82em/1.4 var(--font); text-align: center; color: var(--ink);
  background: linear-gradient(var(--surface), var(--surface-2)); border: 1px solid var(--rule-strong);
  border-bottom-width: 2px; border-radius: 6px; white-space: nowrap; vertical-align: .05em;
}

/* steps */
ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6em; margin: .65em 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .05em; width: 1.8em; height: 1.8em;
  display: grid; place-items: center; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink);
  font-weight: 700; font-size: .85em; border: 1px solid var(--brand-tint-2);
}

/* callouts */
.callout { border: 1px solid var(--rule); border-left-width: 4px; border-radius: var(--radius-sm); padding: 12px 16px; margin: 1.3em 0; background: var(--surface); }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; font-size: .9rem; margin-bottom: .3em; display: flex; align-items: center; gap: .45em; }
.callout-title::before { content: ""; width: 1.05em; height: 1.05em; flex: none; background: currentColor; -webkit-mask: var(--callout-ic) center / contain no-repeat; mask: var(--callout-ic) center / contain no-repeat; }
.callout.tip { border-color: var(--tip-rule); border-left-color: var(--brand); background: var(--brand-tint); }
.callout.tip .callout-title { color: var(--brand-ink); --callout-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
.callout.warn { border-color: var(--warn-rule); border-left-color: var(--warn); background: var(--warn-tint); }
.callout.warn .callout-title { color: var(--warn); --callout-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3zM12 10v4M12 17h.01'/%3E%3C/svg%3E"); }
.callout.note { border-color: var(--note-rule); border-left-color: var(--note); background: var(--note-tint); }
.callout.note .callout-title { color: var(--note); --callout-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5h.01'/%3E%3C/svg%3E"); }

/* formula bar */
.fbar {
  display: flex; align-items: stretch; margin: 1em 0; max-width: 100%;
  border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--cell); box-shadow: var(--shadow-sm);
  font-family: var(--mono); font-size: .92rem; overflow: hidden;
}
.fbar-name { flex: none; min-width: 64px; padding: 8px 10px; border-right: 1px solid var(--rule-strong); background: var(--grid-head); color: var(--ink-soft); font-family: var(--font); font-size: .85rem; font-weight: 600; display: flex; align-items: center; }
.fbar-fx { flex: none; padding: 8px 10px; color: var(--ink-muted); font-style: italic; font-family: Georgia, "Times New Roman", serif; font-weight: 700; border-right: 1px solid var(--rule); display: flex; align-items: center; }
.fbar-formula, .prose .fbar-formula { flex: 1; min-width: 0; padding: 8px 12px; color: var(--ink); background: none; border: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: flex; align-items: center; }

/* syntax */
.syntax { margin: 1em 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--rule-strong); }
.syntax code { font-size: .95rem; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; background: none; border: 0; padding: 0; }

/* mock sheet */
.sheet-wrap { margin: 1.2em 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sheet-wrap .sheet { margin: 0; }
table.sheet {
  border-collapse: collapse; background: var(--cell); font: 400 .9rem/1.3 var(--font);
  border: 1px solid var(--grid); box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums;
}
table.sheet th, table.sheet td { border: 1px solid var(--grid); padding: 5px 9px; white-space: nowrap; text-align: left; height: 30px; }
table.sheet thead th { background: var(--grid-head); color: var(--grid-head-ink); font-weight: 500; font-size: .8rem; text-align: center; min-width: 54px; padding: 3px 8px; height: 24px; }
table.sheet thead th:first-child { min-width: 34px; width: 34px; }
table.sheet tbody th { background: var(--grid-head); color: var(--grid-head-ink); font-weight: 500; font-size: .8rem; text-align: center; padding: 3px 6px; }
table.sheet td.n { text-align: right; }
table.sheet td.c { text-align: center; }
table.sheet td.h { font-weight: 700; }
table.sheet td.sel { background: var(--cell-sel); }
table.sheet td.hl { background: var(--cell-hl); }
table.sheet td.err { background: var(--cell-err); color: var(--bad); font-weight: 600; }
table.sheet td.f { font-family: var(--mono); font-size: .82rem; color: var(--ink-muted); }
table.sheet td.act { outline: 2px solid var(--brand); outline-offset: -2px; position: relative; }
table.sheet td.act::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 6px; height: 6px; background: var(--brand); border: 1px solid var(--cell); }
.sheet-cap { margin: .5em 0 0; font-size: .88rem; color: var(--ink-muted); }

/* data tables */
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1.2em 0; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; font-size: .94rem; margin: 1.2em 0; }
.table-wrap table.data { margin: 0; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.data thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); border-bottom: 2px solid var(--rule-strong); font-weight: 700; }
table.data tbody tr:hover { background: var(--surface-2); }

/* screenshots */
figure.shot { margin: 1.4em 0; }
figure.shot img { display: block; border: 1px solid var(--rule); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] figure.shot img { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) figure.shot img { filter: brightness(.9); } }
figure.shot figcaption { margin-top: .5em; font-size: .86rem; color: var(--ink-muted); }

/* practice + CTA */
.practice { margin-top: 2.6em; padding: 20px 22px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.prose .practice h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.practice-file { padding: 14px 0 0; }
.practice-file + .practice-file { border-top: 1px solid var(--rule); margin-top: 14px; }
.practice-file-title { display: flex; align-items: center; gap: .5em; font-weight: 650; margin-bottom: .4em; }
.practice-file-title .ic { color: var(--brand-ink); }
ul.practice-sheets { list-style: none; padding: 0; margin: 0 0 12px; font-size: .95rem; }
ul.practice-sheets li { margin: .4em 0; color: var(--ink-soft); }
.sheet-tab {
  display: inline-block; padding: 1px 10px; margin-right: 4px; font-size: .82rem; font-weight: 600; color: var(--brand-ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-bottom: 2px solid var(--brand); border-radius: 4px 4px 0 0;
}
.sheet-lesson { font-size: .85rem; white-space: nowrap; }
.practice-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz-cta { display: flex; align-items: center; gap: 16px; margin: 2em 0 0; padding: 18px 20px; border-radius: var(--radius); background: var(--brand-tint); border: 1px solid var(--brand-tint-2); }
.quiz-cta > .ic { width: 34px; height: 34px; color: var(--brand-ink); }
.quiz-cta > div { flex: 1; }
.quiz-cta p { margin: 0; color: var(--ink-soft); }
.quiz-cta .quiz-cta-title { font-weight: 700; color: var(--ink); }
.done-row { margin: 2.2em 0 0; display: flex; justify-content: flex-start; }
.btn-done[aria-pressed="true"] { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.btn-done .ic { width: 1.1em; height: 1.1em; }
.btn-done .ic svg { stroke-width: 3; }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; max-width: 760px; }
.pn { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.pn:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.pn-label { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--ink-muted); font-weight: 600; }
.pn-label .ic { width: 14px; height: 14px; }
.pn-title { font-weight: 650; line-height: 1.3; }
.pn-next { text-align: right; grid-column: 2; }
.pn-next .pn-label { justify-content: flex-end; flex-direction: row-reverse; }

/* ---------------------------------------------------------------- index pages */
.page-head { margin-bottom: 28px; }
.narrow { max-width: 680px; }
.mod-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.mod-card { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 18px 18px 12px; box-shadow: var(--shadow-sm); scroll-margin-top: 80px; }
.mod-card-head { display: flex; gap: 12px; align-items: flex-start; }
.mod-card-head .mod-num { width: 34px; height: 34px; font-size: .95rem; background: var(--brand); color: var(--on-brand); border-radius: 9px; }
.mod-card h2 { margin: 2px 0 4px; font-size: 1.15rem; }
.mod-card h2 a { color: var(--ink); text-decoration: none; }
.mod-card h2 a:hover { color: var(--brand-ink); }
.mod-card-head p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.mod-lessons { list-style: none; padding: 0; margin: 10px 0 0; }
.mod-lessons a { display: flex; gap: 8px; align-items: flex-start; padding: 6px 6px; border-radius: 6px; color: var(--ink-soft); text-decoration: none; font-size: .93rem; line-height: 1.35; }
.mod-lessons a:hover { background: var(--surface-2); color: var(--ink); }
.ml-num { flex: none; min-width: 2.4em; color: var(--ink-muted); font-size: .8rem; font-variant-numeric: tabular-nums; padding-top: .1em; }
.ml-num .ic { width: 16px; height: 16px; }
.ml-done { margin-left: auto; width: 16px; height: 16px; color: var(--ok); visibility: hidden; flex: none; }
.ml-done svg, .lr-done svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; }
a.is-done .ml-done, a.is-done .lr-done { visibility: visible; }
.ml-quiz { font-weight: 600; }
.ml-score { margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--ok); }
.module-progress { margin: 14px 0 0; }
.module-progress .bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.module-progress .bar span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .4s; }
.module-progress .bar-label { margin: 6px 0 0; font-size: .82rem; color: var(--ink-muted); }
.module-progress.small .bar { height: 4px; }
.module-head { margin-bottom: 8px; max-width: 760px; }
.module-section { max-width: 820px; }
.module-section h2 { font-size: 1.15rem; margin: 1.8em 0 .7em; }
.lesson-rows { list-style: none; padding: 0; margin: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.lesson-rows li + li { border-top: 1px solid var(--rule); }
.lesson-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.lesson-row:hover { background: var(--surface-2); }
.lr-num { flex: none; width: 2.6em; color: var(--ink-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.lr-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lr-title { font-weight: 650; }
.lr-sum { font-size: .9rem; color: var(--ink-soft); }
.lr-meta { flex: none; font-size: .82rem; color: var(--ink-muted); }
.lr-done { flex: none; width: 18px; height: 18px; color: var(--ok); visibility: hidden; }
.practice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.practice-list .practice-file { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; margin: 0; box-shadow: var(--shadow-sm); }
.practice-file.compact { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }

/* függvénytár */
.fn-filter { display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 0 12px; height: 44px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--surface); color: var(--ink-muted); }
.fn-filter:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); }
.fn-filter input { flex: 1; border: 0; background: none; font: inherit; color: var(--ink); outline: none; height: 100%; }
.fn-cat h2 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.fn-table { background: var(--surface); }
.fn-table td:first-child, .fn-table td:nth-child(2) { white-space: nowrap; }
.fn-hu { font-weight: 700; color: var(--brand-ink); }
.fn-en { color: var(--ink-muted); }
.fn-syn { display: inline-block; margin-top: 4px; font-size: .82rem; color: var(--ink-soft); }
.fn-lessons a { font-size: .85rem; margin-right: 6px; white-space: nowrap; }
.fn-empty { color: var(--ink-muted); }

/* ---------------------------------------------------------------- home */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; padding: 28px 0 40px; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); line-height: 1.1; margin-bottom: .45em; }
.hl-text { color: var(--brand-ink); background: linear-gradient(transparent 62%, var(--brand-tint-2) 62%); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
.hero-sheet { min-width: 0; overflow-x: auto; border-radius: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-lg); transform: rotate(-1deg); }
.hero-sheet .fbar { margin: 0 0 10px; }
.hero-sheet table.sheet { width: 100%; box-shadow: none; }
.hero-sheet table.sheet td { font-size: .86rem; }
.home-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.home-stats > div { display: flex; flex-direction: column; }
.stat-num { font: 700 1.6rem/1.1 var(--font-display); color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .85rem; color: var(--ink-muted); }
.home-section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0 0 14px; }
.home-mods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.home-mod { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); height: 100%; transition: border-color .15s, box-shadow .15s; }
.home-mod:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.home-mod-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.home-mod-title { font-weight: 650; }
.home-mod-desc { font-size: .88rem; color: var(--ink-soft); line-height: 1.45; }
.home-mod-prog { font-size: .78rem; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.home-mod-prog.complete { color: var(--ok); }
.home-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.feature { padding: 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--rule); }
.feature h3 { margin: 10px 0 6px; }
.feature p { color: var(--ink-soft); font-size: .95rem; }
.feature-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-ink); }
.feature-ic .ic { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- search */
.search-dialog { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
.search-dialog[hidden] { display: none; }
.search-scrim { position: absolute; inset: 0; background: rgba(8, 14, 10, .45); }
.search-panel { position: relative; width: 100%; max-width: 640px; max-height: 80vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--rule); color: var(--ink-muted); }
.search-field .ic { width: 20px; height: 20px; }
.search-field input { flex: 1; height: 56px; border: 0; background: none; font: 500 1.05rem var(--font); color: var(--ink); outline: none; min-width: 0; }
.search-esc { border: 1px solid var(--rule-strong); background: var(--surface-2); color: var(--ink-muted); border-radius: 6px; font: 600 .75rem var(--font); padding: 3px 7px; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--brand-tint); }
.sr-title { font-weight: 650; }
.sr-meta { font-size: .78rem; color: var(--ink-muted); margin-bottom: 2px; }
.sr-snip { font-size: .88rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: var(--cell-hl); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-hint { margin: 0; padding: 14px 18px; font-size: .88rem; color: var(--ink-muted); }

/* ---------------------------------------------------------------- questions (quiz + test) */
.q-card { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 20px 22px; margin: 0 0 18px; box-shadow: var(--shadow-sm); }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .8rem; color: var(--ink-muted); font-weight: 600; }
.q-type { padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--rule); }
.q-text { font-size: 1.08rem; font-weight: 600; line-height: 1.45; margin: 0 0 14px; }
.test-intro code, .callout code, .q-feedback code, .q-text code { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 5px; padding: .05em .35em; font-weight: 500; }
.q-sheet { margin: 0 0 14px; }
.q-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; border: 0; }
fieldset.q-options { min-width: 0; }
.q-option { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border: 1px solid var(--rule-strong); border-radius: 9px; background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.q-option:hover { border-color: var(--brand); }
.q-option input { margin: .25em 0 0; width: 18px; height: 18px; accent-color: var(--brand); flex: none; cursor: pointer; }
.q-option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.q-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.q-option code { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 5px; padding: .05em .35em; }
.q-option.is-correct, .q-option.is-correct:has(input:checked) { border-color: var(--ok); background: var(--ok-tint); }
.q-option.is-wrong, .q-option.is-wrong:has(input:checked) { border-color: var(--bad); background: var(--bad-tint); }
.q-option .q-mark { margin-left: auto; font-weight: 700; font-size: .85rem; flex: none; }
.q-option.is-correct .q-mark { color: var(--ok); }
.q-option.is-wrong .q-mark { color: var(--bad); }
.q-locked .q-option { cursor: default; }
.q-formula { display: flex; align-items: stretch; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--cell); overflow: hidden; }
.q-formula:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); }
.q-formula .fbar-fx { border-right: 1px solid var(--rule); }
.q-formula input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font: 500 1rem var(--mono); color: var(--ink); background: none; outline: none; }
.q-formula.is-correct { border-color: var(--ok); background: var(--ok-tint); }
.q-formula.is-wrong { border-color: var(--bad); background: var(--bad-tint); }
.q-formula-help { font-size: .82rem; color: var(--ink-muted); margin: 6px 0 0; }
.q-hint-multi { font-size: .85rem; color: var(--ink-muted); margin: -6px 0 12px; }
.q-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface-2); font-size: .96rem; }
.q-feedback p:last-child { margin-bottom: 0; }
.q-feedback.ok { border-color: var(--ok); background: var(--ok-tint); }
.q-feedback.bad { border-color: var(--bad); background: var(--bad-tint); }
.q-verdict { font-weight: 700; margin-bottom: 4px; }
.q-feedback.ok .q-verdict { color: var(--ok); }
.q-feedback.bad .q-verdict { color: var(--bad); }
.q-correct-answer code { background: var(--surface); border: 1px solid var(--rule); border-radius: 5px; padding: .05em .35em; }
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.quiz-root { max-width: 760px; }
.quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: .9rem; color: var(--ink-muted); font-weight: 600; }
.quiz-progress .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.quiz-progress .bar span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.quiz-summary { text-align: left; }
.score-ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring, var(--brand)) calc(var(--p) * 1%), var(--surface-3) 0); flex: none; }
.score-ring > span { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 700 1.7rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.score-ring.fail { --ring: var(--bad); }
.result-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.result-head h2 { margin: 0 0 6px; border: 0; padding: 0; }
.result-head p { margin: 0; color: var(--ink-soft); }

/* test */
.test-page { max-width: 860px; margin: 0 auto; }
.test-intro { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); padding: 28px; box-shadow: var(--shadow); }
.test-intro h1 { margin-top: 0; }
.test-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; padding: 0; list-style: none; }
.test-facts li { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); }
.test-facts b { display: block; font: 700 1.35rem/1.2 var(--font-display); color: var(--brand-ink); }
.test-facts span { font-size: .85rem; color: var(--ink-muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; max-width: 420px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input { height: 46px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: 1rem var(--font); }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); }
.field small { color: var(--ink-muted); font-size: .83rem; }
.test-bar { position: sticky; top: var(--topbar-h); z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 0; margin-bottom: 14px; background: var(--bg); border-bottom: 1px solid var(--rule); }
.test-bar .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.test-bar .bar span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.test-count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.test-timer { display: inline-flex; align-items: center; gap: 6px; font: 700 .95rem var(--mono); color: var(--ink-soft); white-space: nowrap; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 99px; background: var(--surface); }
.test-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.palette-title { width: 100%; margin: 0 0 4px; font-size: .82rem; color: var(--ink-muted); font-weight: 600; }
.palette button { width: 38px; height: 38px; border-radius: 7px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-soft); font: 600 .85rem var(--font); cursor: pointer; font-variant-numeric: tabular-nums; }
.palette button.answered { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--brand-ink); }
.palette button[aria-current="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); color: var(--ink); }
.breakdown { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 1fr) 160px 64px; gap: 12px; align-items: center; font-size: .93rem; }
.breakdown .bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.breakdown .bar span { display: block; height: 100%; background: var(--brand); }
.breakdown .bar span.low { background: var(--bad); }
.breakdown b { text-align: right; font-variant-numeric: tabular-nums; }
.result-card { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.result-card h2 { font-size: 1.2rem; margin: 0 0 8px; }
.review-item { border-left: 3px solid var(--bad); }
.review-item.ok { border-left-color: var(--ok); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .9rem; }
.status-pill.pass { background: var(--ok-tint); color: var(--ok); }
.status-pill.fail { background: var(--bad-tint); color: var(--bad); }

/* certificate */
.cert { display: none; }
.cert-preview .cert { display: block; }
.cert {
  position: relative; margin: 20px auto; max-width: 820px; aspect-ratio: 297 / 210; padding: 6% 8%;
  background: #fff; color: #17201a; border: 1px solid #c9d3cb; box-shadow: var(--shadow-lg);
  text-align: center; font-family: var(--font-display);
  background-image: linear-gradient(#e9efe9 1px, transparent 1px), linear-gradient(90deg, #e9efe9 1px, transparent 1px);
  background-size: 28px 28px; overflow: hidden;
}
.cert::before { content: ""; position: absolute; inset: 14px; border: 2px solid #107c41; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 20px; border: 1px solid #9fd2b2; pointer-events: none; }
.cert-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(255,255,255,.88); padding: 4% 6%; border-radius: 4px; }
.cert .logo-mark { width: 48px; height: 48px; --brand: #107c41; --on-brand: #fff; }
.cert-kicker { margin: 10px 0 0; font-size: .85rem; letter-spacing: .3em; text-transform: uppercase; color: #3d6b4f; font-weight: 600; }
.cert-title { margin: 6px 0 14px; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 700; color: #0c5a30; }
.cert-name { margin: 6px 0; font-size: clamp(1.3rem, 3.2vw, 2rem); font-weight: 600; border-bottom: 1px solid #9fb3a5; padding: 0 24px 4px; min-width: 50%; }
.cert-text { margin: 10px 0 0; font-size: 1rem; color: #3b4a40; max-width: 46ch; line-height: 1.5; }
.cert-score { margin: 14px 0 0; font-size: 1.15rem; font-weight: 700; color: #0c5a30; }
.cert-foot { display: flex; justify-content: space-between; width: 100%; margin-top: 24px; font-size: .82rem; color: #55665a; }
.cert-foot span { border-top: 1px solid #9fb3a5; padding-top: 4px; min-width: 30%; }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--rule); background: var(--surface); margin-top: auto; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 22px 24px 28px; font-size: .85rem; color: var(--ink-muted); }
.footer-inner p { margin: 0 0 .5em; max-width: 90ch; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1240px) {
  .lesson-grid { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
}
@media (max-width: 1100px) {
  .search-btn { min-width: 0; }
  .search-btn-label, .search-kbd { display: none; }
}
@media (max-width: 960px) {
  .layout.with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .only-narrow { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(330px, 88vw);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); visibility: hidden;
  }
  .sidebar .sidebar-inner { position: static; max-height: 100%; height: 100%; padding-top: 18px; }
  body.sidebar-open .sidebar { transform: none; visibility: visible; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 14, 10, .45); }
  .main { padding: 22px 20px 56px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-sheet { transform: none; }
  .home-features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --topbar-h: 56px; }
  .topnav { display: none; }
  .bottomnav { display: flex; gap: 2px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
  .bottomnav::-webkit-scrollbar { display: none; }
  .bottomnav a { padding: 6px 10px; font-size: .9rem; }
  html { scroll-padding-top: 116px; }
  .test-bar { top: 0; position: relative; }
  .main, .main-wide { padding: 18px 16px 48px; }
  .test-facts { grid-template-columns: repeat(2, 1fr); }
  .prevnext { grid-template-columns: 1fr; }
  .pn-next { grid-column: 1; }
  .q-card { padding: 16px; }
  .breakdown li { grid-template-columns: minmax(0, 1fr) 90px 56px; }
  .quiz-cta { flex-direction: column; align-items: flex-start; }
  .mod-grid, .home-mods { grid-template-columns: minmax(0, 1fr); }
  .lr-meta { display: none; }
  h2 { font-size: 1.28rem; }
  .prose { font-size: 1rem; }
  .test-intro { padding: 20px 16px; }
  .cert { aspect-ratio: auto; padding: 40px 18px; }
}
@media (max-width: 760px) {
  .prose table.data { display: block; overflow-x: auto; }
  .hero-sheet table.sheet td:nth-child(3), .hero-sheet table.sheet th:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- print */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  .topbar, .footer, .sidebar, .skip-link, .search-dialog, .no-print, .test-bar, .palette { display: none !important; }
  .main, .main-wide { padding: 0; max-width: none; }
  body.print-cert .test-root > *:not(.cert-holder) { display: none !important; }
  body.print-cert .cert-holder { display: block !important; margin: 0; }
  body.print-cert .test-page, body.print-cert .main-wide { max-width: none; margin: 0; padding: 0; }
  body.print-cert .cert { display: block; box-shadow: none; margin: 0; max-width: none; width: 297mm; height: 209mm; aspect-ratio: auto; border: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
