/* TypingSpark: one stylesheet. White by default; dark blue-graphite with the header button.
   Tokens first; components after. No inline styles (strict Content-Security-Policy). */

@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-display: swap; font-weight: 400 900; src: url(/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-display: swap; font-weight: 400 900; src: url(/assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Red Hat Mono'; font-style: normal; font-display: swap; font-weight: 300 700; src: url(/assets/fonts/red-hat-mono-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Red Hat Mono'; font-style: normal; font-display: swap; font-weight: 300 700; src: url(/assets/fonts/red-hat-mono-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1220; --bg-deep: #0A0D18; --surface: #151A2B; --surface-2: #1C2238; --surface-3: #232A44;
  --line: #262E47; --line-2: #343D5E;
  --text: #E3E8F5; --text-strong: #F7F9FF; --text-2: #B9C1D9; --muted: #8E97B3; --faint: #7C85A3;
  --accent: #4C7DFF; --accent-hover: #6A93FF; --accent-ink: #FFFFFF; --btn: #3A66F0; --btn-hover: #3360E8; --accent-soft: rgba(76, 125, 255, 0.14); --glow: rgba(91, 134, 255, 0.55);
  --indigo: #8B7BFF; --link: #7FA3FF;
  --bad: #FF7A90; --bad-soft: rgba(255, 122, 144, 0.16); --good: #C9D6FF;
  --series-1: #5B86FF; --series-2: #C88430; --heat: #FF7A90;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -28px rgba(0, 0, 0, 0.6);
}
:root {
  color-scheme: light;
  --bg: #FFFFFF; --bg-deep: #F4F6FB; --surface: #FFFFFF; --surface-2: #F3F5FA; --surface-3: #E8ECF6;
  --line: #E1E5EF; --line-2: #C9D0E2;
  --text: #1A2036; --text-strong: #0B1022; --text-2: #3C4560; --muted: #5A6385; --faint: #646D8C;
  --accent: #2449D8; --accent-hover: #1C3BB5; --accent-ink: #FFFFFF; --btn: #2449D8; --btn-hover: #1C3BB5; --accent-soft: rgba(36, 73, 216, 0.1); --glow: rgba(36, 73, 216, 0.35);
  --indigo: #5B49E0; --link: #2449D8;
  --bad: #C8264A; --bad-soft: rgba(200, 38, 74, 0.1); --good: #1A2036;
  --series-1: #2F5BE0; --series-2: #B86A00; --heat: #D23A5C;
  --shadow: 0 1px 2px rgba(20, 30, 70, 0.06), 0 18px 40px -26px rgba(20, 30, 70, 0.25);
  --f-ui: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Red Hat Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r-s: 6px; --r-m: 10px; --r-l: 16px;
  --page: 1240px; --gutter: clamp(16px, 4vw, 40px);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--f-ui); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 64px; outline: none; }
img, svg, canvas { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin: 0.25em 0; }
kbd { font: 500 0.85em/1 var(--f-mono); padding: 0.2em 0.45em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--text-strong); white-space: nowrap; }
code, pre { font-family: var(--f-mono); }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); } .small { font-size: 0.875rem; }
.notice { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: var(--r-s); }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--btn); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-s); }
.skip:focus { top: 12px; }
.ico { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------------ header */
.site-head { position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: saturate(140%) blur(8px); }
.head-in { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { text-decoration: none; color: var(--text-strong); display: flex; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 1.2rem; letter-spacing: -0.02em; font-weight: 500; color: var(--text-strong); }
.wordmark b { font-weight: 800; }
.mark { width: 26px; height: 26px; }
.mark rect { fill: var(--accent); }
.mark-spark { stroke: var(--indigo); stroke-width: 2; stroke-linecap: round; fill: none; }
.nav-desktop ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-desktop a, .nav-mobile a { display: block; padding: 8px 12px; border-radius: var(--r-s); color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-desktop a:hover, .nav-mobile a:hover { color: var(--text-strong); background: var(--surface); }
.nav-desktop a[aria-current="page"], .nav-mobile a[aria-current="page"] { color: var(--text-strong); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.head-progress { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-s); font-weight: 500; font-size: 0.95rem; }
.head-progress:hover { color: var(--text-strong); background: var(--surface); }
.nav-mobile summary { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-s); border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; }
.theme-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: transparent; color: var(--text-2); font: 500 0.9rem var(--f-ui); cursor: pointer; }
.theme-lbl-light { display: none; } :root[data-theme="dark"] .theme-lbl-light { display: inline; } :root[data-theme="dark"] .theme-lbl-dark { display: none; }
@media (max-width: 520px) { .theme-btn span { display: none; } .theme-btn { padding: 0; width: 40px; justify-content: center; } }
.theme-btn:hover, .nav-mobile summary:hover { color: var(--text-strong); border-color: var(--line-2); }
.ico-sun { display: none; } :root[data-theme="dark"] .ico-sun { display: block; } :root[data-theme="dark"] .ico-moon { display: none; }
.nav-mobile { position: relative; display: none; }
.nav-mobile summary { list-style: none; } .nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav { position: absolute; right: 0; top: 48px; min-width: 220px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 6px; box-shadow: var(--shadow); }
.nav-mobile ul { list-style: none; margin: 0; padding: 0; }
@media (max-width: 960px) { .nav-desktop { display: none; } .nav-mobile { display: block; } }
@media (max-width: 520px) { .head-progress span { display: none; } }

/* ------------------------------------------------------------------ page scaffolding */
.page-intro { padding: 40px 0 24px; max-width: 760px; }
.lede { font-size: 1.15rem; color: var(--text-2); max-width: 62ch; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; font-size: 0.875rem; color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.page-body { max-width: 760px; margin-top: 56px; }
.prose-sec { margin-bottom: 40px; }
.prose-sec p, .prose-sec li, .prose p, .prose li { color: var(--text-2); }
.prose strong, .prose-sec strong { color: var(--text-strong); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2em; }
.prose table { margin: 1em 0 1.5em; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.byline { color: var(--muted); font-size: 0.9rem; }
.info-layout { max-width: 760px; }
.info-layout .prose h2 { font-size: 1.25rem; }
.faq { max-width: 760px; margin: 56px 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 600; color: var(--text-strong); position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--text-2); padding: 0 0 16px; margin: 0; max-width: 66ch; }
.related { margin: 56px 0 0; }
.related h2 { font-size: 1.1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.related li { margin: 0; border-bottom: 1px solid var(--line); }
.related a { display: block; padding: 16px 0; text-decoration: none; }
.rel-t { display: block; color: var(--text-strong); font-weight: 600; }
.rel-d { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.related a:hover .rel-t { color: var(--accent-hover); }

/* ------------------------------------------------------------------ buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--r-s); border: 1px solid var(--btn); background: var(--btn); color: var(--accent-ink) !important; font: 600 0.95rem/1.2 var(--f-ui); text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost, .btn-quiet { background: transparent; color: var(--text) !important; border-color: var(--line-2); }
.btn-ghost:hover, .btn-quiet:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-quiet { min-height: 36px; font-size: 0.9rem; }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad) !important; }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.field { display: grid; gap: 6px; font-size: 0.875rem; color: var(--muted); }
.field > span { font-weight: 500; }
.field.inline { display: inline-flex; align-items: center; gap: 8px; }
input:not([type=checkbox]):not([type=file]), select, textarea { font: 400 1rem/1.4 var(--f-ui); color: var(--text-strong); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 8px 12px; min-height: 40px; width: 100%; }
.field.inline select, .field.inline input { width: auto; }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; font-family: var(--f-mono); font-size: 0.95rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; }
legend { color: var(--text-strong); font-weight: 600; padding: 0 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.seg button { font: 500 0.875rem/1 var(--f-ui); color: var(--text-2); background: transparent; border: 0; border-radius: 7px; padding: 8px 11px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text-strong); background: var(--surface-2); }
.seg button[aria-pressed="true"] { color: var(--text-strong); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.file-btn { position: relative; }

/* ------------------------------------------------------------------ tools and the typing stage */
.tool { margin: 8px 0 0; }
.tool-layout { display: grid; gap: 32px; align-items: start; }
.tool-layout.has-rail { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .tool-layout.has-rail { grid-template-columns: minmax(0, 1fr) 300px; } }
.tool-rail { display: none; position: sticky; top: 88px; }
@media (min-width: 1280px) { .tool-rail { display: block; } }
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.bar-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fixed-len { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.settings { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-m); padding: 16px; margin-bottom: 14px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 16px; }
.set-checks { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 14px; }
.custom-box { display: grid; gap: 10px; margin-bottom: 14px; justify-items: start; }
.custom-box .field { width: 100%; }
.stage-help { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }
.stage-help li { margin: 0; }

.stage { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px clamp(16px, 3vw, 36px) 26px; box-shadow: var(--shadow); min-height: 236px; }
.stage[data-size="s"] { --t-size: 1.2rem; } .stage, .stage[data-size="m"] { --t-size: 1.5rem; } .stage[data-size="l"] { --t-size: 1.85rem; } .stage[data-size="xl"] { --t-size: 2.3rem; }
.stage[data-width="narrow"] .typer-window { max-width: 44ch; } .stage[data-width="normal"] .typer-window { max-width: 68ch; } .stage[data-width="wide"] .typer-window { max-width: none; }
.typer { position: relative; }
.typer-live { display: flex; align-items: flex-end; gap: clamp(16px, 4vw, 40px); margin-bottom: 14px; flex-wrap: wrap; }
.live-stat { display: flex; align-items: baseline; gap: 8px; }
.live-num { font: 600 1.9rem/1 var(--f-mono); color: var(--text-strong); font-variant-numeric: tabular-nums; min-width: 2ch; }
.live-lbl { color: var(--muted); font-size: 0.9rem; }
.live-trace { margin-left: auto; width: 140px; height: 32px; overflow: visible; }
.live-trace polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.typer-progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 18px; }
.typer-progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 0.25s linear; }
.typer-window { position: relative; height: calc(var(--t-size) * 1.75 * 3); overflow: hidden; font: 400 var(--t-size)/1.75 var(--f-mono); cursor: text; }
.typer-track { position: relative; transition: transform 0.18s ease-out; }
.typer-text { color: var(--muted); word-break: normal; overflow-wrap: anywhere; white-space: normal; }
.typer-text .w { display: inline-block; white-space: pre; vertical-align: top; }
.typer-text.is-code .w { white-space: pre; }
.c { transition: color 0.06s; }
.c.ok { color: var(--text-strong); }
.c.bad { color: var(--bad); text-decoration: underline 2px; text-underline-offset: 6px; }
.c.bad-sp { background: var(--bad-soft); }
.c.auto { color: var(--faint); }
.c.miss { animation: miss 0.22s ease-out; }
.c.nl::after { content: '↵'; color: var(--faint); font-size: 0.8em; }
.c.nl.ok::after { color: var(--text-2); }
.caret { position: absolute; left: 0; top: 0; width: 2px; height: 1.75em; background: var(--accent); border-radius: 2px; box-shadow: 0 0 10px 1px var(--glow); transition: transform 0.085s linear; pointer-events: none; }
.caret.no-anim { transition: none; }
.typer:not(.has-focus) .caret { opacity: 0.35; box-shadow: none; }
.typer.has-focus:not(.is-done) .caret { animation: blink 1.1s step-end infinite; }
.typer.is-done .caret { opacity: 0; }
.typer-cover { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in oklab, var(--surface) 45%, transparent); border-radius: var(--r-m); z-index: 2; }
.cover-msg { margin: 0; font: 500 1rem/1.4 var(--f-ui); color: var(--text-strong); background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 999px; }
.typer-input { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; border: 0; padding: 0; margin: 0; resize: none; overflow: hidden; color: transparent; background: transparent; caret-color: transparent; font-size: 16px; }
.typer[data-flash]::after { content: attr(data-flash); position: absolute; right: 0; bottom: -34px; font-size: 0.85rem; color: var(--bad); }
.stage-numeric { --t-size: 1.6rem; }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes miss { 0% { background: var(--bad-soft); } 100% { background: transparent; } }

/* focus mode: the page dims while a test runs; the stage stays on top */
.focus-veil { position: fixed; inset: 0; z-index: 20; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
body.is-typing .focus-veil { opacity: 0.94; }
body.is-typing .site-head { z-index: 10; }
body.is-typing .stage { z-index: 25; }

/* keyboard */
.kb-holder { margin-top: 18px; display: grid; justify-items: center; }
.kb { --u: clamp(22px, calc((100vw - 64px) / 15.5), 46px); display: grid; gap: 5px; user-select: none; font-family: var(--f-mono); }
.kb-row { display: flex; gap: 5px; }
.key { position: relative; width: var(--u); height: calc(var(--u) * 0.92); display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text-2); font-size: calc(var(--u) * 0.32); line-height: 1; transition: background-color 0.12s, color 0.12s; }
.key b { font-weight: 500; } .key i { position: absolute; top: 3px; left: 5px; font-style: normal; font-size: 0.75em; color: var(--faint); }
.key.mod { font-family: var(--f-ui); font-size: calc(var(--u) * 0.24); color: var(--muted); }
.key.w125 { width: calc(var(--u) * 1.25 + 1px); } .key.w15 { width: calc(var(--u) * 1.5 + 2px); } .key.w175 { width: calc(var(--u) * 1.75 + 3px); } .key.w2 { width: calc(var(--u) * 2 + 5px); } .key.w225 { width: calc(var(--u) * 2.25 + 5px); } .key.w275 { width: calc(var(--u) * 2.75 + 7px); }
.key.space { width: calc(var(--u) * 6.5); margin: 0 auto; }
.kb-row:last-child { justify-content: center; }
.key.home::after { content: ''; position: absolute; bottom: 5px; width: 8px; height: 2px; border-radius: 2px; background: var(--faint); }
.show-fingers .key[data-finger="0"], .show-fingers .key[data-finger="7"] { background: color-mix(in oklab, #9B7BFF 20%, var(--surface-2)); }
.show-fingers .key[data-finger="1"], .show-fingers .key[data-finger="6"] { background: color-mix(in oklab, #2FB3B3 20%, var(--surface-2)); }
.show-fingers .key[data-finger="2"], .show-fingers .key[data-finger="5"] { background: color-mix(in oklab, #D9923A 20%, var(--surface-2)); }
.show-fingers .key[data-finger="3"], .show-fingers .key[data-finger="4"] { background: color-mix(in oklab, #5B86FF 22%, var(--surface-2)); }
.key.next { background: var(--btn) !important; color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 14px -2px var(--glow); }
.key.next i { color: var(--accent-ink); }
.key.next-shift { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--text-strong); }
.key.heat { background: color-mix(in oklab, var(--heat) calc(var(--heat-v, 0) * 100%), var(--surface-2)); }
.kb-finger { min-height: 1.4em; margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; text-align: center; }
.kb-pad { --u: clamp(40px, 12vw, 56px); grid-template-columns: repeat(4, var(--u)); grid-auto-rows: calc(var(--u) * 0.92); }
.kb-pad .kb-row { display: contents; }
.kb-pad .key { width: auto; height: auto; }
.kb-pad .key.tall { grid-row: span 2; } .kb-pad .key.wide { grid-column: span 2; }
.kb-pad [data-code="NumpadAdd"] { grid-column: 4; grid-row: 2 / span 2; } .kb-pad [data-code="NumpadEnter"] { grid-column: 4; grid-row: 4 / span 2; }
.heat-kb .kb { --u: clamp(20px, calc((100vw - 96px) / 16), 40px); }

/* ------------------------------------------------------------------ results */
.results { margin-top: 32px; outline: none; }
.res-head { display: grid; grid-template-columns: minmax(200px, auto) 1fr; gap: 24px 40px; align-items: end; padding: 28px 0 20px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .res-head { grid-template-columns: 1fr; } }
.res-kicker { color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.pb { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hover); font-size: 0.8rem; font-weight: 600; }
.big { display: flex; align-items: baseline; gap: 12px; margin: 0; flex-wrap: wrap; }
.big-num { font: 600 clamp(3.5rem, 2rem + 6vw, 6rem)/0.95 var(--f-mono); color: var(--text-strong); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.big-lbl { color: var(--text-2); font-size: 1.05rem; max-width: 12ch; line-height: 1.25; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.tiles > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 16px; }
.tiles dt { color: var(--muted); font-size: 0.8rem; }
.tiles dd { margin: 4px 0 0; font: 600 1.45rem/1.15 var(--f-mono); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.res-counts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }
.res-counts div { display: flex; gap: 6px; } .res-counts dd { margin: 0; color: var(--text-strong); font-family: var(--f-mono); }
.res-actions, .done-actions, .data-actions, .cert-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.res-note { color: var(--muted); font-size: 0.875rem; }
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
@media (max-width: 860px) { .res-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; min-width: 0; }
.panel h2, .panel h3 { font-size: 1.05rem; letter-spacing: 0; }
.panel-wide { grid-column: 1 / -1; }
.mini { font-size: 0.92rem; }
.mini th, .mini td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.mini thead th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.mini tbody th { font-weight: 500; color: var(--text-strong); }
.table-wrap { overflow-x: auto; }
.conf { list-style: none; padding: 0; margin: 0 0 12px; } .conf li { margin: 6px 0; color: var(--text-2); }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.coach { margin-top: 28px; }
.coach-title { font-size: 1.35rem; }
.findings { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 12px; counter-reset: f; }
.finding { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-m); padding: 16px 20px; margin: 0; }
.finding h4 { margin: 0 0 4px; font-size: 1.05rem; }
.finding p { margin: 0 0 4px; color: var(--text-2); }
.finding .evidence { font: 400 0.85rem/1.5 var(--f-mono); color: var(--muted); }
@media (max-width: 640px) { .finding { grid-template-columns: 1fr; } }
.verdict { border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 16px 20px; margin: 0 0 16px; background: var(--surface); }
.verdict.pass { border-left: 4px solid var(--series-1); } .verdict.gap { border-left: 4px solid var(--series-2); }
.verdict h3, .verdict h2 { margin-bottom: 8px; }

/* charts */
.chart-fig { margin: 0; }
.chart-box { position: relative; }
.chart { width: 100%; height: auto; display: block; font-family: var(--f-ui); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.series-1, .chart .dot.series-1 { stroke: var(--series-1); } .chart .line.series-2, .chart .dot.series-2 { stroke: var(--series-2); }
.chart .dot { stroke-width: 2; } .chart .dot.series-1 { fill: var(--series-1); stroke: var(--surface); } .chart .dot.series-2 { fill: var(--series-2); stroke: var(--surface); }
.chart .area.series-1 { fill: var(--series-1); opacity: 0.1; } .chart .area.series-2 { fill: var(--series-2); opacity: 0.1; }
.chart .err-mark path { stroke: var(--bad); stroke-width: 2; stroke-linecap: round; }
.chart .cross { stroke: var(--faint); stroke-width: 1; }
.chart .hit { cursor: crosshair; }
.tip { position: absolute; top: 4px; min-width: 150px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 8px 10px; font-size: 0.82rem; pointer-events: none; display: grid; gap: 2px; color: var(--text); }
.tip[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 16px; height: 2px; border-radius: 2px; }
.key-line.series-1 { background: var(--series-1); } .key-line.series-2 { background: var(--series-2); }
.key-x { display: inline-block; width: 10px; height: 10px; background: linear-gradient(45deg, transparent 42%, var(--bad) 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--bad) 42% 58%, transparent 58%); }
.chart-table { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.chart-table summary { cursor: pointer; }
.chart-table table { margin-top: 8px; } .chart-table th, .chart-table td { padding: 4px 8px 4px 0; text-align: left; border-bottom: 1px solid var(--line); }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 0.9fr) 1.6fr auto; gap: 12px; align-items: center; margin: 0; font-size: 0.9rem; }
.bar-label { color: var(--text-2); } .bar-val { font-family: var(--f-mono); color: var(--text-strong); font-size: 0.85rem; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(var(--w, 0)); border-radius: 0 4px 4px 0; background: var(--series-1); }
.spark { width: 120px; height: 28px; } .spark polyline { fill: none; stroke: var(--series-1); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* ------------------------------------------------------------------ ads */
.ad { width: 100%; margin: 36px auto; text-align: center; contain: layout; }
.ad-label { display: block; color: var(--muted); font-size: 0.72rem; margin-bottom: 6px; text-align: left; }
.ad ins.adsbygoogle { display: block; width: 100%; }
.ad-h-100-100 ins, .ad-h-100-100 .ad-box { min-height: 100px; }
.ad-h-120-280 ins, .ad-h-120-280 .ad-box { min-height: 120px; }
.ad-h-280-280 ins, .ad-h-280-280 .ad-box { min-height: 280px; }
.ad-h-400-600 ins, .ad-h-400-600 .ad-box { min-height: 400px; }
.ad-h-600-0 ins, .ad-h-600-0 .ad-box { min-height: 600px; width: 300px; }
@media (max-width: 760px) {
  .ad-h-120-280 ins, .ad-h-120-280 .ad-box { min-height: 280px; }
  .ad-h-400-600 ins, .ad-h-400-600 .ad-box { min-height: 600px; }
  .ad-no-mobile { display: none; }
}
@media (min-width: 761px) { .ad-no-desktop { display: none; } }
.ad-rail { margin: 0; }
.ad-sticky { position: sticky; top: 88px; }
.ad-collapsed { display: none; }
.ad[hidden] { display: none; }
.ad-preview .ad-box { display: grid; place-items: center; border: 1px dashed var(--line-2); border-radius: var(--r-s); color: var(--faint); font-size: 0.8rem; }
.article .ad, .prose .ad { margin: 32px 0; }

/* ------------------------------------------------------------------ home */
.hero { padding: 48px 0 0; }
.hero-copy { margin-bottom: 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hero h1 { font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5rem); line-height: 0.98; margin: 0; max-width: 14ch; }
.hero h1::after { content: ''; display: inline-block; width: 0.08em; height: 0.82em; margin-left: 0.08em; vertical-align: -0.04em; background: var(--accent); border-radius: 2px; box-shadow: 0 0 22px 2px var(--glow); animation: blink 1.1s step-end 4; }
.hero .lede { margin: 12px 0 0; }
.band { margin: 88px 0 0; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: s; }
.steps li { margin: 0; padding-top: 18px; border-top: 2px solid var(--line-2); counter-increment: s; }
.steps li::before { content: counter(s); font: 600 0.9rem/1 var(--f-mono); color: var(--accent-hover); display: block; margin-bottom: 12px; }
.steps p { color: var(--text-2); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 20px; } }
.tool-grid { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.tool-grid li { margin: 0; background: var(--bg); }
.tool-card { display: grid; gap: 6px; padding: 22px 20px 24px; text-decoration: none; height: 100%; transition: background-color 0.15s; }
.tool-card:hover { background: var(--surface); }
.tool-card .ico { width: 24px; height: 24px; color: var(--accent-hover); margin-bottom: 6px; }
.tc-t { color: var(--text-strong); font-weight: 600; }
.tc-d { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 960px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tool-grid { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: start; }
.split p { color: var(--text-2); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.formula { font: 400 1rem/1.7 var(--f-mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px 28px; color: var(--text-2); }
.formula p { margin: 0 0 12px; } .formula p:last-child { margin: 0; }
.f-k { color: var(--text-strong); font-weight: 600; } .f-v { color: var(--accent-hover); }
.guide-list { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.guide-list li { margin: 0; border-bottom: 1px solid var(--line); }
.guide-list a { display: block; padding: 18px 0; text-decoration: none; }
.g-t { display: block; color: var(--text-strong); font-weight: 600; font-size: 1.05rem; } .g-d { display: block; color: var(--muted); font-size: 0.92rem; }
.guide-list a:hover .g-t { color: var(--accent-hover); }
@media (max-width: 760px) { .guide-list { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ guides */
.article-layout { display: grid; gap: 48px; align-items: start; }
@media (min-width: 1280px) { .article-layout.has-rail { grid-template-columns: minmax(0, 1fr) 300px; } }
.article .page-intro { max-width: 70ch; }

/* ------------------------------------------------------------------ lessons */
.layout-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 24px; }
.layout-pick p { margin: 0; }
.unit { margin: 36px 0; }
.unit-head { max-width: 70ch; }
.unit-head p { color: var(--text-2); }
.lesson-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.lesson-list li { margin: 0; }
.lesson { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-decoration: none; height: 100%; transition: border-color 0.15s; }
.lesson:hover { border-color: var(--accent); }
.lesson-t { color: var(--text-strong); font-weight: 600; }
.lesson-d { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; }
.stars { grid-row: 1; grid-column: 2; color: var(--faint); font-size: 0.85rem; letter-spacing: 1px; }
.star.on { color: var(--series-2); }
.stars-big { font-size: 2rem; letter-spacing: 4px; margin: 0 0 12px; }
.runner-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.runner-head h2 { margin: 0; }
.runner-unit { margin: 0; color: var(--muted); font-size: 0.9rem; }
.runner-tip { color: var(--text-2); }
.ex-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: ex; }
.ex-steps li { counter-increment: ex; margin: 0; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.ex-steps li::before { content: counter(ex); display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--surface-2); font: 600 0.75rem/1 var(--f-mono); }
.ex-steps li.now { border-color: var(--accent); color: var(--text-strong); }
.ex-steps li.done { color: var(--text-2); } .ex-steps li.done::before { background: var(--accent); color: var(--accent-ink); }
.stage-lesson { min-height: 200px; }
.lesson-done { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; }
.lesson-done p:not(.stars-big) { color: var(--text-2); margin-top: 16px; }

/* ------------------------------------------------------------------ coach, progress */
.coach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .coach-grid { grid-template-columns: 1fr; } }
.goal-panel { margin-top: 24px; }
.goal-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 16px; align-items: end; }
.checkpoints { padding-left: 1.2em; }
.plan-days { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan-days > li { background: var(--surface-2); border-radius: var(--r-s); padding: 12px 14px; margin: 0; }
.plan-days ul { padding-left: 1em; margin: 6px 0 0; font-size: 0.9rem; }
.empty { text-align: left; padding: 32px; border: 1px dashed var(--line-2); border-radius: var(--r-l); max-width: 640px; }
.prog-tiles { margin-bottom: 20px; }
.tool-progress .panel { margin: 16px 0; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.badge { margin: 0; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-s); color: var(--faint); display: grid; gap: 2px; }
.badge.got { border-style: solid; border-color: var(--accent); color: var(--text-2); background: var(--accent-soft); }
.badge-t { font-weight: 600; color: inherit; } .badge.got .badge-t { color: var(--text-strong); }
.badge-d { font-size: 0.82rem; }
.cal { list-style: none; padding: 0; margin: 0; display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 3px; }
.cal li { margin: 0; border-radius: 3px; background: var(--surface-2); }
.cal .cal-1 { background: color-mix(in oklab, var(--series-1) 35%, var(--surface-2)); } .cal .cal-2 { background: color-mix(in oklab, var(--series-1) 65%, var(--surface-2)); } .cal .cal-3 { background: var(--series-1); }

/* ------------------------------------------------------------------ workplace */
.work-summary { color: var(--text-2); }
.work-clock { font: 600 1.4rem/1 var(--f-mono); color: var(--text-strong); margin: 0 0 14px; }
.work-clock .muted { font: 400 0.9rem var(--f-ui); }
.work-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .work-split { grid-template-columns: 1fr; } }
.src-card { background: #FBFAF6; color: #1B1D24; border-radius: var(--r-m); padding: 20px 22px; box-shadow: var(--shadow); position: sticky; top: 88px; }
.src-card dl { margin: 0; display: grid; gap: 10px; }
.src-card dt { font-size: 0.78rem; color: #5D6170; }
.src-card dd { margin: 0; font: 500 1.05rem/1.35 var(--f-mono); color: #12141B; }
.src-n { color: var(--muted); font-size: 0.85rem; margin: 0 0 10px; }
.src-card .src-n { color: #5D6170; }
.entry-form { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.entry-form input, .entry-form textarea, .entry-grid input { font-family: var(--f-mono); }
.grid-src { margin-bottom: 20px; }
.entry-grid { min-width: 640px; } .entry-grid th, .entry-grid td { padding: 4px; text-align: left; } .entry-grid thead th { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.entry-grid input { min-height: 36px; padding: 6px 8px; }

/* ------------------------------------------------------------------ assessment, calculator, teachers */
.assess-form, .teach-form, .calc-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; }
.teach-form h2 { grid-column: 1 / -1; margin: 0; font-size: 1.15rem; }
.teach-form [data-custom-wrap] { grid-column: 1 / -1; }
.calc-form { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: start; }
.calc-form .btn { align-self: end; justify-self: start; }
.calc-out { margin-top: 20px; min-height: 120px; }
.count-box { margin-top: 20px; }
.count-box summary { cursor: pointer; color: var(--text-2); }
.assess-req { margin-bottom: 14px; color: var(--text-2); }
.assign-out { margin-top: 20px; }
.link-box input { font-family: var(--f-mono); font-size: 0.9rem; }
.asg-form { display: grid; gap: 12px; max-width: 520px; justify-items: start; margin-bottom: 20px; } .asg-form .field { width: 100%; }
.verify-form { display: flex; gap: 12px; align-items: end; max-width: 760px; margin-bottom: 24px; } .verify-form .field { flex: 1; }
.verify { border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 20px 24px; max-width: 760px; }
.verify.ok { border-left: 4px solid var(--series-1); } .verify.bad { border-left: 4px solid var(--bad); }
.verify .tiles { margin: 12px 0; }
.report { min-width: 640px; }

/* ------------------------------------------------------------------ shortcuts */
.sc-stage { min-height: 220px; display: grid; place-content: center; text-align: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px; transition: border-color 0.15s; }
.sc-stage:focus-visible { outline-offset: 4px; }
.sc-stage.sc-ok { border-color: var(--series-1); } .sc-stage.sc-bad { border-color: var(--bad); }
.sc-action { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); font-weight: 700; color: var(--text-strong); margin: 0; letter-spacing: -0.02em; }
.sc-progress { color: var(--muted); margin: 0; font-family: var(--f-mono); font-size: 0.85rem; }
.plus { margin: 0 4px; color: var(--faint); }
.sc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
@media (max-width: 860px) { .sc-cols { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ games */
.game-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.game-grid li { margin: 0; }
.game-card { display: grid; gap: 6px; padding: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); text-decoration: none; overflow: hidden; height: 100%; transition: border-color 0.15s; }
.game-card:hover { border-color: var(--accent); }
.game-card > span:not(.game-art) { padding: 0 20px; }
.game-t { color: var(--text-strong); font-weight: 700; font-size: 1.1rem; margin-top: 8px; }
.game-d { color: var(--muted); font-size: 0.9rem; }
.game-best { color: var(--text-2); font: 500 0.85rem var(--f-mono); }
.game-art { height: 120px; background-color: var(--bg-deep); border-bottom: 1px solid var(--line); background-repeat: no-repeat; }
.game-art-word-rain { background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--indigo), var(--indigo)); background-size: 48px 8px, 64px 8px, 40px 8px, 56px 8px; background-position: 20% 22%, 70% 40%, 35% 64%, 80% 82%; }
.game-art-pace-race { background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--series-2), var(--series-2)), linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--line), var(--line)), linear-gradient(var(--line), var(--line)), linear-gradient(var(--line), var(--line)); background-size: 70% 6px, 52% 6px, 40% 6px, 100% 1px, 100% 1px, 100% 1px; background-position: 0 30%, 0 52%, 0 74%, 0 40%, 0 62%, 0 84%; }
.game-art-survival { background-image: linear-gradient(90deg, var(--accent) 0 38%, var(--surface-3) 38%); background-size: 76% 10px; background-position: 50% 50%; }
.game-art-accuracy-challenge { background-image: radial-gradient(circle, var(--accent) 0 9px, transparent 10px), radial-gradient(circle, transparent 0 26px, var(--line-2) 27px 28px, transparent 29px), radial-gradient(circle, transparent 0 44px, var(--line-2) 45px 46px, transparent 47px); background-position: center; }
.game-art-daily-challenge { background-image: linear-gradient(var(--accent), var(--accent)), repeating-linear-gradient(90deg, var(--line-2) 0 22px, transparent 22px 30px); background-size: 22px 22px, 210px 22px; background-position: calc(50% + 60px) 50%, 50% 50%; }
.game-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.game-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 0.95rem; }
.game-stats b { color: var(--text-strong); font-family: var(--f-mono); }
.game-field { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; min-height: 260px; outline: none; }
.rain-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); margin: 0; }
.rain { position: relative; height: clamp(320px, 52vh, 460px); overflow: hidden; border-bottom: 2px solid var(--line-2); }
.drop { position: absolute; top: 0; font: 500 1.25rem/1 var(--f-mono); color: var(--text-strong); background: var(--surface-2); border: 1px solid var(--line); padding: 6px 10px; border-radius: 6px; will-change: transform; white-space: nowrap; }
.drop.match { border-color: var(--accent); color: var(--accent-hover); }
.drop.pop { opacity: 0; transition: opacity 0.18s; }
.rain-input { margin-top: 12px; font: 500 1.2rem var(--f-mono); min-height: 1.6em; }
.rain-buf { color: var(--text-strong); border-bottom: 2px solid var(--accent); padding: 0 2px; }
.game-field .typer-input, .rain + .rain-input + .typer-input { position: absolute; }
.shake { animation: shake 0.2s; } @keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.lanes { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.lane { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; margin: 0; font-size: 0.9rem; color: var(--muted); }
.lane.you { color: var(--text-strong); font-weight: 600; }
.lane-track { position: relative; height: 22px; border-bottom: 1px dashed var(--line-2); container-type: inline-size; }
.runner { position: absolute; left: 0; bottom: 3px; width: 26px; height: 10px; border-radius: 5px; background: var(--line-2); transition: transform 0.12s linear; }
.lane.you .runner { background: var(--accent); box-shadow: 0 0 10px var(--glow); } .lane.ghost .runner { background: var(--series-2); }
@media (max-width: 560px) { .lane { grid-template-columns: 110px 1fr; } }
.surv-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-bottom: 18px; }
.surv-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.surv-bar span.low { background: var(--bad); }
.game-over { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; }
.week { margin-top: 20px; }
.week-days { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-days li { margin: 0; display: grid; gap: 4px; justify-items: center; padding: 10px 4px; border-radius: var(--r-s); background: var(--surface-2); font-size: 0.8rem; color: var(--muted); }
.week-days b { font: 600 1rem var(--f-mono); color: var(--faint); }
.week-days li.done b { color: var(--text-strong); } .week-days li.today { outline: 1px solid var(--accent); }

/* ------------------------------------------------------------------ certificates */
.cert-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; }
.cert-out { margin-top: 20px; }
.cert-out canvas { width: 100%; height: auto; border-radius: var(--r-m); border: 1px solid var(--line); background: #fff; }

/* ------------------------------------------------------------------ footer */
.site-foot { background: var(--bg-deep); border-top: 1px solid var(--line); margin-top: 48px; }
.foot-in { max-width: var(--page); margin: 0 auto; padding: 48px var(--gutter) 24px; display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 32px; }
.foot-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 12px; max-width: 32ch; }
.foot-col h2 { font-size: 0.9rem; color: var(--text-strong); letter-spacing: 0; margin-bottom: 10px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin: 6px 0; }
.foot-col a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.foot-col a:hover { color: var(--text-strong); text-decoration: underline; }
.foot-base { max-width: var(--page); margin: 0 auto; padding: 16px var(--gutter) 32px; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }
.foot-base p { margin: 0; } .foot-base a, .foot-base .linklike { color: var(--muted); }
@media (max-width: 1100px) { .foot-in { grid-template-columns: repeat(3, 1fr); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 600px) { .foot-in { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------------ owner */
.owner-main { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.owner-main h2 { margin-top: 32px; font-size: 1.2rem; }
.owner-form { display: grid; gap: 12px; max-width: 360px; }
.inline-form { display: inline; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 640px) {
  .page-intro { padding-top: 28px; }
  .stage { padding: 16px 14px 18px; min-height: 200px; }
  .stage, .stage[data-size="m"] { --t-size: 1.3rem; }
  .live-num { font-size: 1.5rem; }
  .live-trace { display: none; }
  .tool-bar { gap: 10px; }
  .bar-right { margin-left: 0; }
  .seg button { padding: 8px 9px; }
  .band { margin-top: 64px; }
}

/* ------------------------------------------------------------------ motion and print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f3f4f8; --text: #111; --text-strong: #000; --text-2: #222; --muted: #555; --line: #ccc; --line-2: #bbb; }
  body { background: #fff; }
  .site-head, .site-foot, .ad, .tool-bar, .settings, .data-panel, .res-actions, .skip, .focus-veil, .chart-table, form, .stage, .kb-holder, .related, .tool-rail { display: none !important; }
  .panel, .tiles > div { break-inside: avoid; }
  main { padding: 0; max-width: none; }
}

/* ------------------------------------------------------------------ accounts and continue */
.continue { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; min-height: 112px; padding: 18px 22px; margin: 0 0 24px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-m); background: var(--surface); }
.continue p { margin: 0; }
.continue-k { color: var(--muted); font-size: 0.9rem; }
.continue-t { color: var(--text-strong); font-weight: 600; font-size: 1.1rem; margin: 2px 0 4px !important; }
.band-continue { margin-top: 56px; }
.head-account { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-s); font-weight: 500; font-size: 0.95rem; max-width: 180px; }
.head-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-account:hover { color: var(--text-strong); background: var(--surface-2); }
.signed-in .head-account { color: var(--text-strong); }
@media (max-width: 640px) { .head-account span { display: none; } }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 760px) { .acct-grid { grid-template-columns: 1fr; } }
.acct-form { display: grid; gap: 12px; }
.acct-form h2 { margin: 0; font-size: 1.2rem; }
.form-msg { margin: 0; min-height: 1.4em; color: var(--bad); font-size: 0.9rem; }
.form-msg.ok { color: var(--text-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.recovery { font: 600 1.4rem/1.3 var(--f-mono); letter-spacing: 0.04em; color: var(--text-strong); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-s); padding: 12px 16px; display: inline-block; margin: 4px 0 8px; }
.acct-in .tiles { margin: 12px 0 20px; }
.sync-state { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--series-1); }
.sync-dot.saving { background: var(--series-2); } .sync-dot.offline { background: var(--bad); }
.acct-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
