:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #121826;
  --muted: #4b5565;
  --border: #dfe3ec;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --accent-soft: #dbeafe;
  --on-accent: #ffffff;
  --spin: #16a34a;
  --spin-strong: #15803d;
  --ok: #157f3b;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(18, 24, 38, .05), 0 8px 24px rgba(18, 24, 38, .07);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1f;
    --surface: #121a2e;
    --surface-2: #1a2440;
    --text: #e8ecf5;
    --muted: #a3adc2;
    --border: #26324f;
    --accent: #60a5fa;
    --accent-strong: #93c5fd;
    --accent-soft: #132447;
    --on-accent: #06122b;
    --spin: #22c55e;
    --spin-strong: #4ade80;
    --ok: #4ade80;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1f;
  --surface: #121a2e;
  --surface-2: #1a2440;
  --text: #e8ecf5;
  --muted: #a3adc2;
  --border: #26324f;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --accent-soft: #132447;
  --on-accent: #06122b;
  --spin: #22c55e;
  --spin-strong: #4ade80;
  --ok: #4ade80;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only, .skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-links { display: none; gap: 2px; }
.nav-links a { padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--surface-2); }
.menu, .langs { position: relative; }
.menu > summary, .langs > summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .92rem; display: flex; align-items: center; gap: 6px; min-height: 40px; }
.menu > summary::-webkit-details-marker, .langs > summary::-webkit-details-marker { display: none; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; display: grid; z-index: 30; max-height: 70vh; overflow: auto; }
.dropdown a { padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dropdown a:hover, .dropdown a[aria-current="page"] { background: var(--surface-2); }
@media (min-width: 1180px) {
  .nav-links { display: flex; }
}
/* Very small phones (320 px): the menu keeps its icon and its name stays readable by screen readers. */
@media (max-width: 359.98px) {
  .site-header .wrap { gap: 8px; }
  .menu > summary, .langs > summary { padding: 8px 10px; }
  .menu > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Hero */
main { padding-bottom: 40px; }
.hero { padding: 22px 0 4px; max-width: 780px; }
.hero h1 { font-size: clamp(1.55rem, 4.2vw, 2.25rem); line-height: 1.15; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 14px 0 -8px; }
.crumbs a { color: var(--muted); }

/* Content */
.content { margin-top: 34px; max-width: 780px; }
.content h2 { font-size: 1.3rem; line-height: 1.3; margin: 28px 0 10px; letter-spacing: -.01em; }
.content p { margin: 0 0 12px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 12px 14px 12px 50px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.entry-list { columns: 2 180px; column-gap: 24px; padding-left: 18px; margin: 0; }
.entry-list li { break-inside: avoid; padding: 2px 0; }
.more-entries > summary { cursor: pointer; color: var(--accent); font-weight: 650; margin-bottom: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 13px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 13px; color: var(--muted); }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.related a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; height: 100%; }
.related a:hover { border-color: var(--accent); }
.ad-slot { margin: 26px 0; min-height: 100px; }
.privacy-note { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--muted); margin-top: 18px; }
.to-top { display: inline-block; margin-top: 24px; font-size: .9rem; }

/* Static pages */
.prose { max-width: 700px; overflow-wrap: anywhere; }
.prose h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 26px 0 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 40px; background: var(--surface); font-size: .92rem; }
.foot-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.foot-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-wheels ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.foot-grid a { color: var(--text); text-decoration: none; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-brand p { color: var(--muted); margin: 8px 0 0; }
.foot-brand .foot-sisters-title { margin-top: 18px; }
.foot-sisters li { display: grid; gap: 0; }
.foot-sisters a { font-weight: 700; }
.foot-sisters span { color: var(--muted); font-size: .86rem; }
.copyright { color: var(--muted); margin-top: 22px; font-size: .85rem; }

/* Toast, language bar, confetti */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); width: max-content; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action.is-on { pointer-events: auto; }
.toast-action { border: 0; background: transparent; color: var(--accent-soft); font-weight: 800; text-decoration: underline; cursor: pointer; padding: 4px; }
.lang-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 44px 8px 16px; background: var(--accent-soft); color: var(--text); font-size: .9rem; position: relative; flex-wrap: wrap; }
.lang-bar-go { font-weight: 700; }
.lang-bar-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; width: 36px; height: 36px; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 85; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}


/* ---------- Shared bits of the tests ---------- */
.tool { margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 0 14px; cursor: pointer; font-size: .92rem; min-height: 42px; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--accent); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-quiet { background: transparent; }
.spin-btn { min-width: 200px; min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--spin); color: #fff; font-size: 1.1rem; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px rgba(22, 163, 74, .3); }
.spin-btn:hover { background: var(--spin-strong); }
.hint { margin: 8px 2px 0; font-size: .86rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 36px; padding: 0 12px; font-weight: 700; cursor: pointer; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; display: grid; gap: 2px; min-width: 0; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 650; }
.stat-value { font-size: 1.35rem; font-weight: 850; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; }
.result .stats { margin-top: 10px; }
.result-big { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.result-big strong { font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.result-big span { font-weight: 700; color: var(--muted); }
.result-sub { margin: 8px 0 0; color: var(--muted); }
.best-line { margin: 10px 0 0; font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tool > [data-rt] .result-actions, .tool > [data-memory] .result-actions { justify-content: flex-start; }

/* Big press area (reaction, clicks) */
.pad { width: 100%; min-height: clamp(260px, 46vh, 400px); border: 0; border-radius: 22px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; color: #fff; cursor: pointer; text-align: center; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; box-shadow: var(--shadow); transition: background-color .08s; }
.pad-icon { font-size: 2.6rem; line-height: 1; }
.pad-big { font-size: clamp(1.7rem, 6.5vw, 3rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pad-small { font-size: clamp(.95rem, 2.8vw, 1.15rem); opacity: .92; max-width: 46ch; }
.pad.is-idle, .pad.is-result, .pad.is-done { background: #1d4ed8; }
.pad.is-wait { background: #dc2626; }
.pad.is-go { background: #16a34a; }
.pad.is-early { background: #ea580c; }
.cps-pad.is-run { background: #1e3a8a; }
.cps-pad.is-hit { animation: hit .12s ease-out; }
@keyframes hit { from { box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .35); } to { box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0); } }
.tries { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tries li { background: var(--surface-2); border-radius: 12px; padding: 8px 6px; display: grid; justify-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.tries li.is-done { background: var(--accent-soft); }
.try-n { font-size: .75rem; color: var(--muted); font-weight: 700; }
.try-v { font-weight: 800; font-size: .95rem; }
.ty-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* Typing */
.ty-live { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.ty-clock { font-size: 1.8rem; font-weight: 900; color: var(--accent); }
.ty-live-wpm { color: var(--muted); font-weight: 650; }
.ty-live-wpm strong { color: var(--text); font-size: 1.2rem; }
.ty-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; cursor: text; box-shadow: var(--shadow); }
.ty-clip { height: calc(3 * 2.3rem); overflow: hidden; }
.ty-words { font-size: clamp(1.15rem, 3.4vw, 1.45rem); line-height: 2.3rem; color: var(--muted); transition: transform .15s; overflow-wrap: anywhere; }
.ty-words .w { white-space: nowrap; border-radius: 6px; padding: 1px 2px; }
.ty-words .w i { font-style: normal; }
.ty-words .w.is-current { background: var(--accent-soft); color: var(--text); }
.ty-words .w i.ok { color: var(--ok); }
.ty-words .w i.bad { color: #fff; background: var(--danger); border-radius: 3px; }
.ty-words .w.is-over { box-shadow: inset 0 -3px 0 var(--danger); }
.ty-words .w.is-ok { color: var(--ok); }
.ty-words .w.is-bad { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 2px; }
.ty-box.is-done { opacity: .6; }
.ty-input { width: 100%; margin-top: 12px; font-size: 1.25rem; border: 2px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg); color: var(--text); }
.ty-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ty-input:disabled { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .ty-words { transition: none; } }

/* Keyboard tester */
.kb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.kb-layout { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.kb-layout select { min-height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; background: var(--surface); color: var(--text); }
.kb-count { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; flex: 1; }
.kb-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.kb-wrap:focus-visible { outline: 3px solid var(--accent); }
.kb-board { display: flex; gap: 14px; min-width: 760px; }
.kb-main { flex: 15 1 0; display: grid; gap: 5px; }
.kb-nav { flex: 3 1 0; display: grid; gap: 5px; align-content: start; margin-top: calc((100% / 3) * 0); }
.kb-nav .kb-row:first-child { margin-top: calc(2.6rem + 5px); }
.kb-row { display: flex; gap: 5px; }
.kb-key, .kb-gap { min-width: 0; height: 2.6rem; }
.kb-key { display: grid; place-items: center; align-content: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 3px; font-weight: 750; font-size: .88rem; line-height: 1; color: var(--text); user-select: none; -webkit-user-select: none; transition: background-color .1s; }
.kb-key small { font-size: .62rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.kb-key.is-tested { background: color-mix(in srgb, var(--ok) 22%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.kb-key.is-down { background: var(--accent); border-color: var(--accent-strong); color: var(--on-accent); }
.kb-key.is-down small { color: inherit; }
.kb-info { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kb-last, .kb-other { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; }
.kb-last-title { margin: 0; font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kb-last-key { margin: 4px 0 8px; font-size: 1.8rem; font-weight: 900; overflow-wrap: anywhere; }
.kb-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.kb-dl dt { color: var(--muted); }
.kb-dl dd { margin: 0; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.kb-other p:last-child { margin: 6px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* Number memory */
.nm-stage { background: #1d4ed8; color: #fff; border-radius: 22px; min-height: clamp(260px, 44vh, 380px); display: grid; place-items: center; padding: 24px; box-shadow: var(--shadow); text-align: center; }
.nm-screen { display: grid; justify-items: center; gap: 12px; width: 100%; max-width: 560px; }
.nm-screen[hidden] { display: none; }
.nm-title { margin: 0; font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 900; }
.nm-text { margin: 0; opacity: .92; max-width: 44ch; }
.nm-label { margin: 0; font-weight: 700; opacity: .9; }
.nm-number { margin: 0; font-size: clamp(2.2rem, 10vw, 4rem); font-weight: 900; letter-spacing: .06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; user-select: none; -webkit-user-select: none; }
.nm-bar { width: min(320px, 80%); height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.nm-bar i { display: block; height: 100%; background: #fff; transform-origin: left center; }
.nm-input { width: min(420px, 100%); text-align: center; font-size: 1.8rem; font-weight: 800; letter-spacing: .08em; border: 0; border-radius: 12px; padding: 10px 12px; color: #0f172a; background: #fff; }
.nm-input:focus { outline: 3px solid #facc15; }
.nm-stage .spin-btn { background: #facc15; color: #111827; box-shadow: none; }
.nm-stage .spin-btn:hover { background: #fde047; }
.nm-verdict { margin: 0; font-size: 1.4rem; font-weight: 850; }
.nm-compare { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; text-align: left; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.nm-compare dt { opacity: .85; }
.nm-compare dd { margin: 0; font-weight: 800; letter-spacing: .05em; overflow-wrap: anywhere; }

/* Aim trainer */
.aim-field { position: relative; height: clamp(320px, 52vh, 460px); border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; background-image: radial-gradient(circle, var(--surface-2) 1.5px, transparent 1.6px); background-size: 26px 26px; }
.aim-field.is-run { cursor: crosshair; }
.aim-intro { position: absolute; left: 0; right: 0; top: 18%; text-align: center; padding: 0 16px; pointer-events: none; }
.aim-intro .nm-text { margin: 8px auto 0; color: var(--muted); }
.aim-target { position: absolute; width: 58px; height: 58px; margin: -29px 0 0 -29px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; background: radial-gradient(circle, #fff 0 18%, #dc2626 19% 38%, #fff 39% 58%, #dc2626 59%); box-shadow: 0 4px 14px rgba(220, 38, 38, .35); touch-action: manipulation; }
.aim-target i { display: none; }
.aim-target:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Bar of tests (all tests, one tap away) ---------- */
.testbar { background: var(--bg); border-bottom: 1px solid var(--border); }
.testbar ul { list-style: none; margin: 0; padding: 8px 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.testbar ul::-webkit-scrollbar { display: none; }
.testbar li { flex: none; scroll-snap-align: start; }
.testbar a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 650; font-size: .92rem; white-space: nowrap; }
.testbar a:hover { border-color: var(--accent); }
.testbar a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.testbar svg { width: 18px; height: 18px; flex: none; }
@media (min-width: 900px) { .testbar ul { flex-wrap: wrap; overflow: visible; } }

/* ---------- How a result compares, and the last results ---------- */
.result .compare, .nm .compare { margin-top: 14px; }
.compare { padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.compare-line { margin: 0; font-weight: 700; }
.gauge { position: relative; height: 10px; border-radius: 999px; margin: 16px 6px 8px; background: linear-gradient(90deg, #f87171, #fbbf24 45%, #4ade80); }
.gauge i { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); transform: translate(-50%, -50%); }
.compare-more { margin: 8px 0 0; font-size: .9rem; }
.progress { margin-top: 14px; }
.progress-title { margin: 0 0 6px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.spark { background: var(--surface-2); border-radius: 12px; padding: 4px; }
.spark svg { width: 100%; height: 64px; display: block; overflow: visible; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.spark .dot { fill: var(--accent); }
.spark .dot.is-best { fill: var(--ok); }
.spark .dot.is-last { fill: var(--text); }
.progress-best { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.rank { margin: 10px 0 0; font-weight: 800; font-size: 1.1rem; }
.rt-after .tries { margin-top: 12px; }

/* ---------- Data pages ---------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 18px; max-width: 780px; }
.figure { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.figure strong { font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.figure span { color: var(--muted); font-weight: 600; }
.cta { margin: 18px 0; }
.btn-big { min-height: 52px; padding: 0 22px; font-size: 1.05rem; border-radius: 14px; }
.btn-big svg { width: 20px; height: 20px; }
.chart { margin: 18px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; max-width: 680px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-area { fill: var(--accent-soft); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart-axis { stroke: var(--border); stroke-width: 1.5; }
.chart-tick { fill: var(--muted); font-size: 14px; }
.chart-mark line { stroke: var(--muted); stroke-dasharray: 4 4; }
.chart-mark text { fill: var(--text); font-size: 15px; font-weight: 700; }
.chart-mark.is-main line { stroke: var(--accent); stroke-dasharray: none; stroke-width: 2; }
.chart figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.chart figcaption strong { color: var(--text); }
.pct { border-collapse: collapse; width: 100%; max-width: 420px; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.pct caption { text-align: start; font-weight: 700; margin-bottom: 6px; }
.pct th, .pct td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; }
.pct th { font-size: .85rem; color: var(--muted); }
.sources { padding-inline-start: 20px; font-size: .92rem; }
.sources li { margin-bottom: 6px; overflow-wrap: anywhere; }
.tries li { padding: 8px 4px; }
.try-v { white-space: nowrap; font-size: .88rem; }

/* Embed code dialog, and the page as it looks inside another site (?embed) */
.embed-row { margin: 10px 0 0; text-align: center; }
.embed-credit { display: none; }
.embed-dialog { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: var(--radius); padding: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.embed-dialog::backdrop { background: rgba(10, 14, 25, .55); }
.embed-dialog h2 { margin: 0 0 6px; font-size: 1.2rem; }
.embed-help { margin: 0; color: var(--muted); font-size: .92rem; }
.embed-dialog textarea { width: 100%; box-sizing: border-box; margin: 10px 0 12px; padding: 10px; font: .8rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; resize: vertical; }
.embed-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
html.embed .site-header, html.embed .testbar, html.embed .site-footer, html.embed .hero, html.embed .content,
html.embed .embed-row, html.embed .lang-bar, html.embed .skip { display: none !important; }
html.embed main { padding: 8px 0 0; }
html.embed .embed-credit { display: block; margin: 12px 0 0; text-align: center; font-size: .85rem; }
