/* Liber — czytnik. Papier i atrament, jedna barwa akcentu (rubryka), te same kroje co w PDF. */

@font-face { font-family: 'Liber Serif'; src: url(fonts/woff2/SourceSerif4-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Serif'; src: url(fonts/woff2/SourceSerif4-It.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Liber Serif'; src: url(fonts/woff2/SourceSerif4-Semibold.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Serif'; src: url(fonts/woff2/SourceSerif4-Bold.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Serif'; src: url(fonts/woff2/SourceSerif4-BoldIt.woff2) format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Liber Sans'; src: url(fonts/woff2/SourceSans3-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Sans'; src: url(fonts/woff2/SourceSans3-It.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Liber Sans'; src: url(fonts/woff2/SourceSans3-Semibold.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Sans'; src: url(fonts/woff2/SourceSans3-Bold.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Mono'; src: url(fonts/woff2/JetBrainsMono-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Liber Mono'; src: url(fonts/woff2/JetBrainsMono-Italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Liber Mono'; src: url(fonts/woff2/JetBrainsMono-SemiBold.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --paper: #f8f6f1;
  --surface: #fffdf8;
  --sunk: #f1ede5;
  --ink: #1c1b19;
  --ink-2: #47433d;
  --ink-3: #78726a;
  --ink-4: #a39d93;
  --rule: #e4ded3;
  --rule-strong: #cfc7b9;
  --accent: #8c2a1e;
  --accent-ink: #fffaf5;
  --accent-soft: rgba(140, 42, 30, 0.08);
  --code-bg: #f3efe7;
  --code-ink: #26241f;
  --mark: #f5dfa6;
  --c-comment: #7d776d; --c-key: #8c2a1e; --c-type: #255a7a; --c-str: #3f6b2a; --c-num: #8a4b0f; --c-attr: #6a3d82;
  --co-note: #255a7a; --co-tip: #3f6b2a; --co-important: #6a3d82; --co-warning: #a86a0b; --co-caution: #8c2a1e; --co-task: #1c1b19;
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.06), 0 8px 28px rgba(28, 27, 25, 0.08);
  --serif: 'Liber Serif', 'Source Serif 4', Georgia, serif;
  --sans: 'Liber Sans', 'Source Sans 3', system-ui, sans-serif;
  --mono: 'Liber Mono', 'JetBrains Mono', ui-monospace, monospace;
  --top: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151412; --surface: #1c1b18; --sunk: #22211d; --ink: #ebe6dc; --ink-2: #c4beb2; --ink-3: #928b80; --ink-4: #6c665d;
    --rule: #2c2a26; --rule-strong: #3d3a34; --accent: #e08a74; --accent-ink: #1a0f0c; --accent-soft: rgba(224, 138, 116, 0.1);
    --code-bg: #1f1e1b; --code-ink: #e4dfd5; --mark: #6b5420;
    --c-comment: #8d877c; --c-key: #ec9a84; --c-type: #86b6d6; --c-str: #a6c98a; --c-num: #e0ab6c; --c-attr: #c3a0dc;
    --co-note: #86b6d6; --co-tip: #a6c98a; --co-important: #c3a0dc; --co-warning: #e0ab6c; --co-caution: #ec9a84; --co-task: #ebe6dc;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151412; --surface: #1c1b18; --sunk: #22211d; --ink: #ebe6dc; --ink-2: #c4beb2; --ink-3: #928b80; --ink-4: #6c665d;
  --rule: #2c2a26; --rule-strong: #3d3a34; --accent: #e08a74; --accent-ink: #1a0f0c; --accent-soft: rgba(224, 138, 116, 0.1);
  --code-bg: #1f1e1b; --code-ink: #e4dfd5; --mark: #6b5420;
  --c-comment: #8d877c; --c-key: #ec9a84; --c-type: #86b6d6; --c-str: #a6c98a; --c-num: #e0ab6c; --c-attr: #c3a0dc;
  --co-note: #86b6d6; --co-tip: #a6c98a; --co-important: #c3a0dc; --co-warning: #e0ab6c; --co-caution: #ec9a84; --co-task: #ebe6dc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 20px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.68 var(--serif); font-kerning: normal; text-rendering: optimizeLegibility; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--mark); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- elementy wspólne ---------- */
.mark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 700 17px var(--serif); letter-spacing: 0.01em; color: var(--ink); }
.kicker { font: 600 12px var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); font: 600 15px var(--sans); text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-small { padding: 6px 11px; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}

/* ---------- strony proste: wejście, kod, komunikaty ---------- */
.page-plain { min-height: 100vh; display: flex; flex-direction: column; }
.plain-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; }
.entry { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 9vh 24px 60px; }
.entry-title { font: 700 clamp(36px, 6vw, 56px)/1.05 var(--serif); letter-spacing: -0.015em; margin: 0 0 22px; }
.entry-title-course { font-size: clamp(30px, 5vw, 44px); }
.entry-sub { font: italic 400 21px/1.4 var(--serif); color: var(--ink-2); margin: -8px 0 22px; }
.entry-lead { color: var(--ink-2); font-size: 18px; margin: 0 0 30px; max-width: 34em; }
.code-form { display: flex; gap: 10px; flex-wrap: wrap; }
.code-input { flex: 1 1 220px; min-width: 0; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); font: 600 22px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; transition: border-color .15s, box-shadow .15s; }
.code-input::placeholder { color: var(--ink-4); }
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--accent); font: 600 15px var(--sans); margin: 14px 0 0; animation: nudge .35s ease; }
@keyframes nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.plain-foot, .site-foot { padding: 22px 28px; font: 400 13px var(--sans); color: var(--ink-4); }
.binding { display: flex; gap: 6px; margin: 0 0 26px; }
.binding span { width: 10px; height: 34px; border-radius: 2px; background: var(--rule-strong); animation: leaf 1.4s ease-in-out infinite; }
.binding span:nth-child(2) { animation-delay: .12s; } .binding span:nth-child(3) { animation-delay: .24s; } .binding span:nth-child(4) { animation-delay: .36s; } .binding span:nth-child(5) { animation-delay: .48s; }
@keyframes leaf { 0%, 100% { background: var(--rule-strong); transform: scaleY(.7); } 50% { background: var(--accent); transform: scaleY(1); } }

/* ---------- pasek górny ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 16px 0 20px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.topbar .mark span { display: none; }
.topbar-course { font: 600 15px var(--sans); color: var(--ink-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.topbar-course:hover { color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* wyszukiwarka */
.search { position: relative; display: flex; align-items: center; gap: 8px; flex: 0 1 340px; margin-left: 12px; height: 36px; padding: 0 10px; border-radius: 8px; background: var(--sunk); color: var(--ink-3); border: 1px solid transparent; transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--rule-strong); background: var(--surface); }
.search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font: 400 15px var(--sans); }
.search-input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 600 11px var(--mono); color: var(--ink-4); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 1px 6px; }
.search:focus-within kbd { display: none; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; width: min(560px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.search-results a { display: block; padding: 10px 12px; border-radius: 7px; text-decoration: none; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--sunk); }
.sr-where { display: block; font: 600 12px var(--sans); color: var(--ink-3); letter-spacing: 0.02em; }
.sr-head { display: block; font: 600 16px/1.35 var(--sans); color: var(--ink); }
.sr-snip { display: block; font: 400 14px/1.45 var(--sans); color: var(--ink-2); margin-top: 2px; }
.sr-snip mark, .sr-head mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-empty { padding: 14px; font: 400 15px var(--sans); color: var(--ink-3); }

/* menu PDF */
.pdf-menu { position: relative; }
.pdf-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.pdf-pop a { display: block; padding: 10px 12px; border-radius: 7px; text-decoration: none; font-family: var(--sans); }
.pdf-pop a:hover { background: var(--sunk); }
.pdf-pop strong { display: block; font-size: 15px; }
.pdf-pop span { display: block; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- strona kursu ---------- */
.course { max-width: 880px; margin: 0 auto; padding: 64px 28px 40px; }
.course-hero { padding-bottom: 44px; border-bottom: 1px solid var(--rule); }
.course-title { font: 700 clamp(38px, 6vw, 60px)/1.04 var(--serif); letter-spacing: -0.018em; margin: 0; }
.course-sub { font: italic 400 clamp(19px, 2.4vw, 23px)/1.4 var(--serif); color: var(--ink-2); margin: 16px 0 0; max-width: 36em; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font: 400 15px var(--sans); color: var(--ink-3); margin: 22px 0 0; }
.course-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.course-hint { font: 400 14px var(--sans); color: var(--ink-3); margin: 16px 0 0; }
.course-hint a { color: var(--accent); }
.contents { padding-top: 34px; }
.contents-h { font: 600 12px var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.contents-list { list-style: none; margin: 0; padding: 0; }
.contents-item { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.contents-row { display: flex; align-items: baseline; gap: 18px; }
.contents-no { font: 600 13px var(--mono); color: var(--ink-4); width: 22px; flex: none; }
.contents-link { flex: 1; font: 600 22px/1.3 var(--serif); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .25s ease; }
.contents-link:hover { background-size: 100% 1.5px; }
.contents-pdf { font: 600 12px var(--sans); letter-spacing: 0.08em; color: var(--ink-3); text-decoration: none; border: 1px solid var(--rule-strong); border-radius: 5px; padding: 2px 7px; opacity: .7; transition: opacity .15s, color .15s, border-color .15s; }
.contents-item:hover .contents-pdf { opacity: 1; }
.contents-pdf:hover { color: var(--accent); border-color: var(--accent); }
.contents-secs { margin: 6px 0 0 40px; font: 400 15px/1.6 var(--sans); color: var(--ink-3); }
.contents-secs a { text-decoration: none; }
.contents-secs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- czytnik: trzy kolumny ---------- */
.reader { display: grid; grid-template-columns: 268px minmax(0, 1fr) 232px; gap: 0; max-width: 1440px; margin: 0 auto; }
.chapters { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 14px 40px 20px; border-right: 1px solid var(--rule); font-family: var(--sans); }
.chapters-home { display: block; font: 600 12px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; padding: 0 10px 12px; }
.chapters-home:hover { color: var(--accent); }
.chapters ol { list-style: none; margin: 0; padding: 0; }
.chapters li a { position: relative; display: flex; gap: 10px; padding: 7px 10px; border-radius: 7px; font-size: 15px; line-height: 1.35; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s; }
.chapters li a:hover { background: var(--sunk); color: var(--ink); }
.chapters li a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--accent-soft); }
.chapters li a[aria-current="page"]::before { content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.chapters-no { font: 600 12px/1.9 var(--mono); color: var(--ink-4); min-width: 16px; }
.chapters li a[aria-current="page"] .chapters-no { color: var(--accent); }

.page { min-width: 0; padding: 48px clamp(20px, 5vw, 72px) 80px; }
.prose { max-width: 720px; margin: 0 auto; }

.onpage { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 34px 20px 30px 8px; font-family: var(--sans); }
.onpage-h { font: 600 12px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.onpage ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.onpage li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.4; color: var(--ink-3); text-decoration: none; transition: color .15s, border-color .15s; }
.onpage li.lvl-3 a { padding-left: 24px; font-size: 13.5px; }
.onpage li a:hover { color: var(--ink); }
.onpage li a.is-active { color: var(--accent); border-left-color: var(--accent); }
.onpage-top { display: inline-block; margin: 16px 0 0 12px; font-size: 13px; color: var(--ink-4); text-decoration: none; }
.onpage-top:hover { color: var(--ink); }

.pager { max-width: 720px; margin: 64px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; transition: border-color .15s, transform .2s; }
.pager a:hover { border-color: var(--rule-strong); transform: translateY(-2px); }
.pager span { display: block; font: 600 12px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.pager strong { display: block; font: 600 17px/1.35 var(--serif); margin-top: 4px; }
.pager-next { text-align: right; grid-column: 2; }

/* ---------- treść ---------- */
.prose > h1:first-child { font: 700 clamp(32px, 4.4vw, 44px)/1.12 var(--serif); letter-spacing: -0.014em; margin: 0 0 30px; padding-bottom: 22px; border-bottom: 2px solid var(--accent); }
.prose h1 { font: 700 34px/1.15 var(--serif); margin: 2em 0 .6em; }
.prose h2 { font: 700 27px/1.25 var(--serif); letter-spacing: -0.008em; margin: 2.1em 0 .55em; }
.prose h3 { font: 600 20px/1.35 var(--sans); margin: 1.8em 0 .45em; }
.prose h4 { font: 600 17px/1.4 var(--sans); color: var(--ink-2); margin: 1.5em 0 .4em; }
.prose h2, .prose h3, .prose h4 { position: relative; }
.prose :is(h2, h3, h4) .anchor { position: absolute; left: -1.1em; padding-right: .3em; color: var(--ink-4); text-decoration: none; opacity: 0; transition: opacity .15s; font-weight: 400; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; }
.prose p, .prose ul, .prose ol, .prose dl { margin: 0 0 1.05em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--ink-3); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; height: 1px; background: var(--rule); margin: 3em 0; }
.prose img { max-width: 100%; height: auto; }
.prose sup { line-height: 0; }

.prose code { font: 400 0.84em var(--mono); background: var(--code-bg); padding: 0.12em 0.36em; border-radius: 4px; overflow-wrap: anywhere; }
.prose .code { position: relative; margin: 1.3em 0 1.6em; background: var(--code-bg); border-radius: 10px; border: 1px solid var(--rule); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--rule); font: 600 11.5px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.copy { border: 0; background: none; font: 600 12.5px var(--sans); color: var(--ink-3); padding: 4px 9px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.copy:hover { background: var(--sunk); color: var(--ink); }
.copy.is-done { color: var(--co-tip); }
.prose pre { margin: 0; padding: 14px 18px 16px; overflow-x: auto; font: 400 14.5px/1.6 var(--mono); color: var(--code-ink); tab-size: 4; }
.prose pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }

.c, .c1, .cm, .ch, .cs, .cpf, .cp { color: var(--c-comment); font-style: italic; }
.cp { font-style: normal; }
.k, .kd, .kn, .kr, .kc, .kp, .ow { color: var(--c-key); }
.kt, .nc, .nn, .nb, .bp, .nf, .fm { color: var(--c-type); }
.s, .s1, .s2, .sb, .sc, .sd, .se, .sh, .si, .sx, .sr, .ss, .dl { color: var(--c-str); }
.m, .mi, .mf, .mh, .mo, .il, .mb, .nv, .vi, .vg, .vc { color: var(--c-num); }
.na, .nt { color: var(--c-attr); }
.gp { color: var(--ink-4); user-select: none; }
.gh, .gu { color: var(--c-type); font-weight: 600; }
.gi { color: var(--c-str); } .gd { color: var(--c-key); }

.table-wrap { margin: 1.3em 0 1.7em; overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font: 400 15.5px/1.5 var(--sans); }
.prose th { text-align: left; font-weight: 700; padding: 10px 14px; border-bottom: 1.5px solid var(--rule-strong); background: var(--sunk); white-space: nowrap; }
.prose td { padding: 9px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr { transition: background .12s; }
.prose tbody tr:hover { background: var(--accent-soft); }

.prose figure { margin: 1.6em 0 2em; }
.prose figure img { display: block; margin: 0 auto; border-radius: 8px; border: 1px solid var(--rule); cursor: zoom-in; transition: box-shadow .2s; }
.prose figure img:hover { box-shadow: var(--shadow); }
.prose figcaption { font: italic 400 15px/1.45 var(--sans); color: var(--ink-3); text-align: center; margin-top: 10px; }

.prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--rule-strong); color: var(--ink-2); font-style: italic; }
.prose blockquote strong { font-style: normal; color: var(--ink); }
.callout { --co: var(--co-note); margin: 1.4em 0 1.7em; padding: 14px 20px 4px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--co) 26%, var(--rule)); border-left: 4px solid var(--co); background: color-mix(in srgb, var(--co) 6%, var(--surface)); }
.callout-title { font: 700 12px var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--co); margin: 0 0 6px !important; }
.callout > :last-child { margin-bottom: 12px; }
.callout-tip { --co: var(--co-tip); } .callout-important { --co: var(--co-important); } .callout-warning { --co: var(--co-warning); }
.callout-caution { --co: var(--co-caution); } .callout-zadanie { --co: var(--co-task); } .callout-rozwiazanie { --co: var(--ink-3); }

.contains-task-list { list-style: none; padding-left: .2em !important; }
.task-list-item-checkbox { accent-color: var(--accent); margin-right: .5em; }
.prose dt { font-weight: 700; }
.prose dd { margin: 0 0 .8em 1.4em; }
.footnotes-sep { margin-top: 3em !important; }
.footnotes { font-size: 15.5px; color: var(--ink-2); }

/* podgląd ryciny */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vh 3vw; background: color-mix(in srgb, var(--paper) 94%, transparent); cursor: zoom-out; animation: fade .18s ease; }
.lightbox img { max-width: 100%; max-height: 94vh; border-radius: 8px; box-shadow: var(--shadow); }
@keyframes fade { from { opacity: 0; } }

/* ---------- węższe ekrany ---------- */
@media (max-width: 1240px) {
  .reader { grid-template-columns: 260px minmax(0, 1fr); }
  .onpage { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 54px; }
  body { font-size: 17px; }
  .reader { display: block; }
  .nav-toggle { display: inline-grid; margin-left: -6px; }
  .topbar { gap: 8px; padding: 0 10px 0 12px; }
  .topbar .mark { display: none; }
  .topbar-course { max-width: none; flex: 1; }
  .search { position: static; flex: 0 0 36px; width: 36px; margin: 0; padding: 0; justify-content: center; background: none; cursor: pointer; }
  .search kbd, .search-input { display: none; }
  .search.is-open { position: absolute; left: 8px; right: 8px; top: 9px; width: auto; flex: none; padding: 0 10px; justify-content: flex-start; background: var(--surface); border-color: var(--rule-strong); z-index: 45; }
  .search.is-open .search-input { display: block; }
  .search-results { left: 0; right: 0; width: auto; }
  .chapters { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: auto; width: min(320px, 86vw); background: var(--paper); border-right: 1px solid var(--rule); transform: translateX(-102%); transition: transform .25s ease; padding-top: 22px; }
  .chapters.is-open { transform: none; box-shadow: var(--shadow); }
  .scrim { position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .28); }
  .page { padding: 30px 16px 60px; }
  .prose pre { font-size: 13.5px; padding: 12px 14px 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .course { padding: 40px 16px 30px; }
  .contents-secs { margin-left: 0; }
  .contents-row { gap: 12px; }
  .pdf-trigger span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .topbar, .chapters, .onpage, .pager, .copy { display: none !important; } .reader { display: block; } }
