/* Učení na přijímačky (vimmi.space/skola): "Tabule", a calm style of its own, apart from the poster homepage.
   A dark green school board, white chalk text, yellow chalk for what matters; headings in Patrick Hand
   (handwritten), reading and controls in Inter. The light mode is a whiteboard.
   Dark is the default, like the rest of the site; the toggle stores the same "vimmi-theme". */
:root {
  color-scheme: dark;
  --bg: #1b2420; --surface: #222d28; --surface-2: #2a3731; --line: #35463e;
  --ink: #eef1e8; --muted: #b3bdb0; --accent: #e8d68a; --accent-ink: #26230f; --accent-soft: rgb(232 214 138 / .12);
  --ok: #a7d8ac; --ok-soft: rgb(167 216 172 / .13); --bad: #f0a9a2; --bad-soft: rgb(240 169 162 / .12);
  --hand: "Patrick Hand", "Comic Neue", cursive; --read: "Inter", system-ui, sans-serif; --ui: "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px; --r-sm: 7px; --wrap: 880px; --wrap-wide: 1240px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f1; --surface: #fcfdfa; --surface-2: #eaeee6; --line: #d8dfd3;
  --ink: #1f2a24; --muted: #56635b; --accent: #8a6a00; --accent-ink: #ffffff; --accent-soft: rgb(214 176 40 / .16);
  --ok: #2c7a45; --ok-soft: rgb(44 122 69 / .1); --bad: #b1433a; --bad-soft: rgb(177 67 58 / .09);
}
/* a faint chalk haze on the board */
body { background-image: radial-gradient(ellipse at 20% 0%, rgb(255 255 255 / .035), transparent 55%), radial-gradient(ellipse at 90% 100%, rgb(255 255 255 / .025), transparent 50%); background-attachment: fixed; }
:root[data-theme="light"] body { background-image: none; }
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background-color: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--read); overflow-x: clip; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(5vw, 16px, env(safe-area-inset-left, 0px)); padding-right: max(5vw, 16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 16px; z-index: 9; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top { border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--bg) 88%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.top__bar { display: flex; align-items: center; gap: 18px; height: 60px; font: 500 15px var(--ui); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; }
.brand svg { width: 22px; height: 22px; }
.top__link { color: var(--muted); text-decoration: none; }
.top__link:hover { color: var(--ink); }
.grow { flex: 1; }
.theme { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.theme svg { width: 17px; height: 17px; }
.theme .i-sun { display: none; } :root[data-theme="dark"] .theme .i-sun { display: block; } :root[data-theme="dark"] .theme .i-moon { display: none; }
@media (max-width: 560px) { .top__bar > .top__link:nth-of-type(2) { display: none; } }

/* breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 28px 0 0; font: 400 14px var(--ui); color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* headings and text */
h1, h2, h3 { font-family: var(--hand); font-weight: 400; line-height: 1.1; letter-spacing: 0; }
h1 { font-size: clamp(40px, 5.5vw, 58px); margin: 18px 0 10px; }
h2 { font-size: clamp(28px, 3vw, 34px); margin: 0 0 12px; color: var(--accent); }
h3 { font-size: 24px; margin: 24px 0 6px; }
:root[data-theme="light"] h2 { color: var(--ink); }
.lead { font-size: 19px; color: var(--muted); margin: 0; max-width: 62ch; }
.kicker { font: 500 14px var(--ui); color: var(--accent); margin: 22px 0 0; }
p, li { max-width: 68ch; }
code { font: 400 .9em var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
strong, b { font-weight: 650; }
mark { background: var(--accent-soft); color: inherit; padding: 0 3px; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font: 400 15px/1.45 var(--ui); margin: 12px 0; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
blockquote { margin: 14px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
blockquote p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* blocks */
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 3vw, 30px); margin: 22px 0; }
.block > :last-child { margin-bottom: 0; }
.topic__head, .hub__head { margin: 6px 0 26px; }
.cermat-note { margin: 14px 0 0; font: 400 15px/1.5 var(--ui); color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-radius: var(--r-sm); max-width: none; }

/* buttons */
.btn, .ghost, .open button, .opt, .yn__b button { font: 500 15px var(--ui); cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:hover { background: color-mix(in oklab, var(--accent) 88%, var(--ink)); text-decoration: none; }
.btn--quiet { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); margin: 0 6px 6px 0; }
.btn--quiet:hover { background: var(--accent-soft); }
.ghost { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.ghost:hover { background: var(--surface-2); }
:is(.btn, .ghost, .opt, .open button):active { transform: scale(.98); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* hub and subject pages */
.tiles, .topics { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.tiles li, .topics li { max-width: none; }
.tile { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-family: var(--ui); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.tile strong { font: 400 32px/1.1 var(--hand); }
.tile .muted { font-size: 15px; line-height: 1.5; }
.tile__icon { font: 400 34px/1 var(--hand); color: var(--accent); }
.tile__meta { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--accent); }
.tile--row { flex-direction: row; align-items: flex-start; gap: 16px; padding: 18px 20px; }
.tile--row strong { font-size: 25px; display: block; margin-bottom: 2px; }
.tile--row .muted { display: block; }
.tile__n { flex: none; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 15px; }
.list-title { margin-top: 34px; }
.facts { font-family: var(--ui); font-size: 15px; background: var(--surface-2); border-radius: var(--r); padding: 16px 20px; }
.facts ul { margin: 0; padding-left: 20px; } .facts p { margin: 0 0 6px; }
.steps { padding-left: 22px; margin: 0; } .steps li { margin-bottom: 8px; }

/* exercises */
.practice__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.score { margin: 0 0 6px; font: 500 15px var(--ui); color: var(--muted); }
.score.is-done { color: var(--ok); }
.practice__intro { margin: 6px 0 18px; padding: 18px 22px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.practice__intro > :first-child { margin-top: 0; } .practice__intro > :last-child { margin-bottom: 0; }
.practice__intro h3 { margin-top: 0; }
.ex { border-top: 1px solid var(--line); padding: 20px 0 8px; }
.ex__num { margin: 0 0 4px; font: 600 13px var(--ui); color: var(--muted); text-transform: none; }
.ex__q > :first-child { margin-top: 0; } .ex__q > :last-child { margin-bottom: 12px; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.opts li { max-width: none; }
.opt { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); line-height: 1.4; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt__l { flex: none; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.opt:disabled { cursor: default; }
.opt.is-ok { border-color: var(--ok); background: var(--ok-soft); } .opt.is-ok .opt__l { background: var(--ok); color: var(--accent-ink); }
.opt.is-bad { border-color: var(--bad); background: var(--bad-soft); } .opt.is-bad .opt__l { background: var(--bad); color: var(--bg); }
.yns { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.yn { max-width: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.yn__t { flex: 1 1 260px; }
.yn__b { display: flex; gap: 6px; flex: none; }
.yn__b button { min-width: 58px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.yn__b button:hover:not(:disabled) { border-color: var(--accent); }
.yn__b button:disabled { cursor: default; }
.yn.is-ok { border-color: var(--ok); background: var(--ok-soft); } .yn.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.yn button.is-picked { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.yn button.is-right { box-shadow: 0 0 0 2px var(--ok); }
.open { display: flex; flex-wrap: wrap; gap: 8px; }
.open input { flex: 1 1 200px; font: 400 17px var(--ui); padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.open input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.open input.is-ok { border-color: var(--ok); background: var(--ok-soft); } .open input.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.open button { padding: 10px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); }
.open__right { margin: 10px 0 0; font: 400 15px var(--ui); }
.ex__explain { margin-top: 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 16px; }
.ex__explain > :first-child { margin-top: 0; } .ex__explain > :last-child { margin-bottom: 0; }
.ex__explain::before { content: attr(data-verdict); display: block; font: 600 14px var(--ui); margin-bottom: 4px; }
.ex__explain.is-ok::before { color: var(--ok); } .ex__explain.is-bad::before { color: var(--bad); }
[data-reset] { margin-top: 14px; }

/* the note to copy into Vimmi */
.zapis__text { margin: 14px 0 0; padding: 18px 20px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); font: 400 14px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
.copied { font: 500 14px var(--ui); color: var(--ok); }

/* pager and footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 30px 0 10px; }
.pager a { display: flex; flex-direction: column; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; font: 400 23px/1.2 var(--hand); }
.pager a:hover { border-color: var(--accent); }
.pager small { font: 400 13px var(--ui); color: var(--muted); margin-bottom: 4px; }
.pager .next { text-align: right; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { text-align: left; } }
.foot { margin-top: 48px; border-top: 1px solid var(--line); padding: 26px 0 calc(34px + env(safe-area-inset-bottom, 0px)); font: 400 14px/1.6 var(--ui); color: var(--muted); }
.foot a { color: var(--muted); } .foot a:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- topic page, layout D: explanation on the left, practice on the right (one task at a time) ---------- */
.wrap--wide { max-width: var(--wrap-wide); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; align-items: start; }
@media (min-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .split__practice { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; overscroll-behavior: contain; margin: 22px 0; border-radius: var(--r); }
  .split__practice .block { margin: 0; }
}
.topic__head .lead, .topic__head .cermat-note { max-width: 820px; }
.ex-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ex-nav .ghost { white-space: nowrap; }
.dots { order: -1; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dot { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 12px var(--ui); cursor: pointer; }
.dot.is-current { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 1px var(--accent); }
.dot.is-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.dot.is-bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.ex-nav .ghost:disabled { opacity: .4; cursor: default; }
.practice .ex { border-top: 0; padding-top: 6px; }
.practice__end { margin: 14px 0 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--accent-soft); font: 400 15px/1.5 var(--ui); }
.practice__end b { font-weight: 600; }
.read-text h2 { margin-bottom: 6px; }
.small-note { margin: 0 0 6px; font: 400 14px var(--ui); }
.small-note .practice__intro { margin: 0 0 8px; padding: 0; border: 0; background: none; }
