/* Shared colours: every reading surface inherits its selected edition. */
:root {
 color-scheme: light;
 --canvas:#f5f6f8; --surface:#ffffff; --surface-soft:#edf0f5; --surface-hover:#e7ebf3;
 --ink:#1c2130; --body:#4c5565; --muted:#626b7c;
 --accent:#4255ba; --accent-strong:#303f96; --accent-text:#ffffff; --accent-soft:#eceffc;
 --border:#d6dbe5; --line:#e3e6ec; --code-bg:#f3f5f9; --code-ink:#263247;
 --shadow:0 20px 70px #20273b14; --card-shadow:0 6px 22px #20273b06;
 --sans:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 --serif:Georgia,"Times New Roman",serif; --reading-font:var(--sans);
 --mono:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
 --reader-scale:1; --header:76px; --radius:16px;
 --kw:#6845a0; --string:#27694d; --number:#994812; --comment:#626b7c; --fn:#31599c;
}
html[data-theme="dark"] {
 color-scheme:dark;
 --canvas:#101216; --surface:#191c22; --surface-soft:#22262e; --surface-hover:#292e38;
 --ink:#f0f1f5; --body:#c6cad2; --muted:#a4acb9;
 --accent:#b1bcff; --accent-strong:#ccd3ff; --accent-text:#161b32; --accent-soft:#2a3047;
 --border:#363c48; --line:#2c313a; --code-bg:#14171d; --code-ink:#e0e4ee;
 --shadow:0 20px 70px #0006; --card-shadow:0 6px 22px #0002;
 --kw:#c8afff; --string:#a1d4b8; --number:#efc38c; --comment:#a4acb9; --fn:#adc8f7;
}
html[data-theme="epaper"] {
 color-scheme:light;
 --canvas:#e9e7e1; --surface:#faf9f5; --surface-soft:#f0eee8; --surface-hover:#e5e2da;
 --ink:#252523; --body:#41413d; --muted:#62625b;
 --accent:#343430; --accent-strong:#181816; --accent-text:#fffef9; --accent-soft:#e8e6de;
 --border:#bbb9af; --line:#d5d2c8; --code-bg:#f0eee8; --code-ink:#30302c;
 --shadow:none; --card-shadow:none; --reading-font:var(--serif);
 --kw:#30302c; --string:#41413d; --number:#30302c; --comment:#62625b; --fn:#30302c;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button svg { pointer-events: none; }
h1, h2, h3, p { margin-top: 0; }
img { max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--ink); }
:where(button, a, input, textarea, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
input[type="search"] { appearance: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 110; top: 10px; left: 12px; padding: 12px 20px; background: var(--accent); color: var(--accent-text); transform: translateY(-160%); border-radius: 8px; }
.skip-link:focus { transform: none; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 24px; border: 1px solid transparent; border-radius: 9px; font-size: 15px; font-weight: 600; line-height: 1.5; transition: background .18s, box-shadow .18s, transform .18s; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 4px 9px #4059d81c; }
.button-primary:hover { background: var(--accent-strong); box-shadow: 0 6px 16px #4059d82b; }
.button-secondary { background: var(--surface); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-hover); }
.button.small { min-height: 42px; padding: 0 15px; font-size: 13px; }
.button svg { width: 18px; height: 18px; }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.text-button { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.text-button svg { width: 17px; height: 17px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; min-width: 42px; height: 42px; border-radius: 8px; color: var(--body); }
.icon-button:hover { background: var(--surface-hover); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; font-weight: 500; line-height: 1.3; }
.tag.green { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.muted { color: var(--muted); }
