/* Gearnostic — "test bench" design system.
   Paper + ink like a lab notebook, instrument panels for live readouts.
   Accent: signal orange (actions), phosphor lime (readouts on dark). */
:root {
  --paper: #f2efe8; --paper-2: #e8e4da; --card: #fbfaf7;
  --ink: #121418; --ink-2: #2b2f36; --muted: #5b616b; --line: #d6d1c5; --line-2: #bdb7a9;
  --signal: #ff5b1f; --signal-text: #b93a07; --phos: #c6f24e; --ok: #1d8a4c; --bad: #c62f1c;
  --panel: #121418; --panel-2: #1b1e23; --panel-line: #2c3038; --panel-muted: #8b919b;
  --radius: 16px; --radius-s: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1013; --paper-2: #15181c; --card: #16191e;
    --ink: #eceae4; --ink-2: #c9c6bf; --muted: #9a9fa8; --line: #2a2e35; --line-2: #3a3f47;
    --signal-text: #ff8a5c; --panel: #08090b; --panel-2: #121418;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--signal-text); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; width: 100%; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 9; }
.ico { width: 20px; height: 20px; flex: none; vertical-align: -4px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.logo b { font-weight: 800; color: var(--signal-text); }
.logo-ico { width: 30px; height: 30px; }
.menu { margin-left: auto; }
header details { position: relative; }
header summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 999px; display: flex; gap: 6px; align-items: center; font-weight: 650; font-size: 15px; border: 1px solid transparent; }
header summary::-webkit-details-marker { display: none; }
header summary:hover, header details[open] summary { border-color: var(--line-2); background: var(--card); }
header details ul { position: absolute; right: 0; top: 48px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(18,20,24,.14); list-style: none; margin: 0; padding: 6px; min-width: 230px; }
header details li a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 15px; }
header details li a:hover, header details li a[aria-current] { background: var(--paper-2); }

/* language switcher */
.flag { width: 21px; height: 14px; flex: none; border-radius: 2px; overflow: hidden; }
.langs summary { gap: 7px; }
.langs .lcode { font: 600 13px/1 var(--mono); letter-spacing: .04em; }
.langs details ul { min-width: 190px; }
.langs details li a { gap: 10px; }
@media (max-width: 560px) { .langs .lcode { display: none; } }

/* ---------- generic page ---------- */
main { flex: 1; width: 100%; }
main.wrap { padding: 28px 20px 64px; }
h1 { hyphens: auto; overflow-wrap: break-word; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 820; margin: 8px 0 10px; }
h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -.025em; margin: 48px 0 14px; }
h3 { font-size: 18px; letter-spacing: -.01em; margin: 24px 0 8px; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 22px; max-width: 620px; }
.content { max-width: 760px; overflow-wrap: anywhere; }
.tool { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px; min-height: 340px; }
.privacy { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.privacy .ico { color: var(--ok); width: 18px; height: 18px; }
details.faq { border-top: 1px solid var(--line); padding: 14px 0; margin: 0; }
details.faq:last-child { border-bottom: 1px solid var(--line); }
details.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font: 600 20px/1 var(--mono); color: var(--signal-text); transition: transform .15s; }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq p { margin: 10px 0 0; color: var(--ink-2); max-width: 720px; }

/* small "other tests" cards on tool pages */
.cards { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cards a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--ink); font-weight: 650; }
.cards a:hover { border-color: var(--ink); }
.cards .ico.big { width: 22px; height: 22px; }

/* ---------- home: hero ---------- */
.hero { position: relative; padding: 44px 0 56px; border-bottom: 1px solid var(--line); overflow: hidden;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 80% at 20% 40%, var(--paper) 35%, color-mix(in srgb, var(--paper) 55%, transparent) 75%, transparent); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.08fr; gap: 48px; align-items: center; }
.kicker { font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; display: inline-flex; gap: 8px; align-items: center; }
.kicker::before { content: ""; width: 18px; height: 2px; background: var(--signal); }
.hero h1 { font-size: clamp(38px, 6vw, 68px); margin: 0 0 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; }
.hero-cta .privacy { margin: 0; max-width: 300px; line-height: 1.4; }
.btn { display: inline-flex; gap: 8px; align-items: center; padding: 13px 22px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; transition: transform .12s, background .12s; }
.btn:hover { background: var(--signal); color: #120802; transform: translateY(-1px); }

/* live bench — instrument panel */
.bench { background: var(--panel); color: #e9e7e1; border-radius: 22px; padding: 16px; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px -20px rgba(18,20,24,.45); border: 1px solid var(--panel-line); }
.bench-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 4px 6px 14px; font-size: 13px; color: var(--panel-muted); }
.bench-head strong { font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--phos); box-shadow: 0 0 0 0 rgba(198,242,78,.6); animation: pulse 2s infinite; align-self: center; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(198,242,78,0); } 100% { box-shadow: 0 0 0 0 rgba(198,242,78,0); } }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cell { position: relative; background: var(--panel-2); border: 1px solid var(--panel-line); border-radius: 12px; padding: 12px 12px 10px; min-height: 118px; display: flex; flex-direction: column; gap: 4px; transition: border-color .2s; }
.cell.hit { border-color: var(--phos); }
.cell-label { font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--panel-muted); }
.cell-val { font: 700 22px/1.15 var(--mono); color: var(--phos); letter-spacing: -.02em; margin-top: 6px; overflow-wrap: anywhere; text-shadow: 0 0 18px rgba(198,242,78,.25); }
.cell-val.idle { color: #f0eee8; font-size: 16px; font-weight: 600; text-shadow: none; }
.cell-val.no { color: #ff8a6b; text-shadow: none; }
.cell-sub { font-size: 12px; color: var(--panel-muted); line-height: 1.35; margin-top: auto; }
.cell-link { font-size: 12px; font-weight: 650; color: #fff; text-decoration: none; }
.cell-link:hover { color: var(--phos); }
.cell[data-cell="mouse"] { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.btns { display: flex; gap: 4px; margin-top: 2px; }
.btns i { font: 700 10px/1 var(--mono); font-style: normal; padding: 4px 6px; border-radius: 4px; border: 1px solid var(--panel-line); color: var(--panel-muted); transition: all .1s; }
.btns i.on { background: var(--phos); border-color: var(--phos); color: #10140a; }

/* ---------- home: test grid ---------- */
.tests { padding: 64px 0 24px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 32px; margin-bottom: 8px; }
.sec-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); }
.sec-head p { margin: 0; color: var(--muted); max-width: 440px; }
.group { font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; display: flex; align-items: center; gap: 12px; }
.group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.grid-core, .grid-rest { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.grid-core { grid-template-columns: repeat(6, 1fr); }
.grid-core li { grid-column: span 2; }
.grid-core li:nth-child(n+4) { grid-column: span 3; }
.grid-rest { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 0 -4px var(--paper-2), 0 10px 0 -3px var(--line-2); }
.ch { font: 600 11px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }
.card-ico { width: 40px; height: 40px; padding: 8px; border-radius: 11px; background: var(--paper-2); color: var(--ink); margin: 10px 0 6px; }
a.card:hover .card-ico { background: var(--ink); color: var(--phos); }
.card strong { font-size: 20px; letter-spacing: -.02em; line-height: 1.2; }
.card .desc { color: var(--muted); font-size: 15px; line-height: 1.45; }
.chips { list-style: none; padding: 0; margin: auto 0 0; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 500 11.5px/1 var(--mono); padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); }
.go { position: absolute; top: 16px; right: 18px; font-size: 20px; color: var(--muted); transition: transform .15s, color .15s; }
a.card:hover .go { color: var(--signal); transform: translateX(3px); }
.soon { position: absolute; top: 14px; right: 14px; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.row .card { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-s); }
.row .card-ico { margin: 0; width: 36px; height: 36px; padding: 7px; }
.row .card strong { font-size: 16px; }
.row .ch { display: none; }
.row .soon { position: static; margin-left: auto; order: 5; }
.card[aria-disabled] { color: var(--muted); background: transparent; border-style: dashed; }
.card[aria-disabled] .card-ico { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- home: text blocks ---------- */
.home-body { padding: 8px 0 72px; }
.why-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.why-list li { padding: 18px 22px 8px 0; border-right: 1px solid var(--line); }
.why-list li + li { padding-left: 22px; }
.why-list li:last-child { border-right: 0; }
.why-list .num { font: 600 12px/1 var(--mono); color: var(--signal-text); }
.why-list h3 { margin: 10px 0 6px; }
.why-list p { margin: 0; color: var(--muted); font-size: 15px; }
.how, .faq-block { max-width: 820px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 52px; color: var(--ink-2); }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--ink); font: 600 12px/1 var(--mono); color: var(--ink); background: var(--card); }
.steps strong { color: var(--ink); }


/* ---------- tool pages ---------- */
[hidden] { display: none !important; }
.k-tool .tool { background: transparent; border: 0; padding: 0; min-height: 0; }
.btn { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.btn[data-on] { background: var(--signal); color: #120802; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* mic test */
.mt-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 4px 0 14px; }
.mt-select { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.mt-select span { font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.mt-select select { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; max-width: 320px; }
.mt-switch { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14px; margin-left: auto; }
.mt-switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.mt-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.mt-switch input:checked { background: var(--ink); }
.mt-switch input:checked::after { transform: translateX(18px); background: var(--phos); }
.mt-switch span { display: flex; flex-direction: column; line-height: 1.25; }
.mt-switch small { color: var(--muted); font-size: 12px; }
.mt-panel { padding: 18px; }
.mt-readout { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 14px; }
.mt-db { display: block; font: 700 clamp(38px, 6vw, 56px)/1 var(--mono); color: var(--phos); letter-spacing: -.04em; margin-top: 8px; min-width: 6.2ch; text-shadow: 0 0 24px rgba(198,242,78,.25); font-variant-numeric: tabular-nums; }
.mt-db small { font-size: 14px; color: var(--panel-muted); letter-spacing: 0; text-shadow: none; }
.mt-scope { width: 100%; height: 84px; border-radius: 10px; background: #0b0d10; border: 1px solid var(--panel-line); }
.mt-meter { position: relative; height: 16px; border-radius: 6px; overflow: hidden; border: 1px solid var(--panel-line); background: linear-gradient(90deg, #2f9e57 0%, #c6f24e 62%, #ffc130 82%, #ff5b1f 96%); }
.mt-mask { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background: #0b0d10; transition: width .05s linear; }
.mt-peak { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: 0; margin-left: -1px; }
.mt-scale { position: relative; height: 18px; margin: 4px 0 14px; font: 500 10.5px/1 var(--mono); color: var(--panel-muted); }
.mt-scale span { position: absolute; top: 4px; transform: translateX(-50%); }
.mt-scale span:first-child { transform: none; }
.mt-scale span:last-child { transform: translateX(-100%); }
.mt-panel .cell { min-height: 96px; }
.mt-panel .cell-val { font-variant-numeric: tabular-nums; }
.mt-panel[data-state="ok"] { border-color: #3d5a1c; }
.mt-panel[data-state="bad"] { border-color: #6a2a1d; }
.verdict { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; line-height: 1.45; }
.verdict::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--line-2); }
.verdict[data-state="ok"] { border-color: var(--ok); }
.verdict[data-state="ok"]::before { background: var(--ok); }
.verdict[data-state="warn"] { border-color: #d08a00; }
.verdict[data-state="warn"]::before { background: #e39a00; }
.verdict[data-state="bad"] { border-color: var(--bad); }
.verdict[data-state="bad"]::before { background: var(--bad); }
.mt-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 14px 0 0; }
.mt-rec audio { height: 40px; max-width: 100%; }
.mt-rec-hint { color: var(--muted); font-size: 14px; font-family: var(--mono); }
.mt-details { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 0 16px; }
.mt-details summary { cursor: pointer; padding: 12px 0; font-weight: 650; }
.spec { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 8px 0; border-top: 1px solid var(--line); }
.spec th { font-weight: 500; color: var(--muted); width: 45%; }
.spec td { font-family: var(--mono); overflow-wrap: anywhere; }
.k-tool .content { margin-top: 8px; }
.content h3 { margin-top: 22px; }
.content ul.fix { padding-left: 18px; }
.content ul.fix li { margin: 4px 0; }
.content .steps { margin-top: 12px; }
@media (max-width: 640px) {
  .mt-readout { grid-template-columns: 1fr; gap: 10px; }
  .mt-scope { height: 64px; }
  .mt-switch { margin-left: 0; }
  .mt-panel { padding: 14px; }
  .mt-panel .cells { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .mt-panel .cell { min-height: 84px; padding: 10px 8px; }
  .mt-panel .cell-val { font-size: 16px; }
}

/* shared controls */
.btn-s { padding: 9px 16px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; background: var(--card); flex-wrap: wrap; }
.seg button { font: 600 13px/1 var(--sans); border: 0; background: transparent; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--paper-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg-big button { font-size: 15px; padding: 11px 18px; }

/* webcam */
.wc-panel { padding: 14px; }
.wc-stage { position: relative; aspect-ratio: 16 / 9; background: #0b0d10; border: 1px solid var(--panel-line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; display: grid; place-items: center; }
.wc-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.wc-stage video.mirror { transform: scaleX(-1); }
.wc-stage:fullscreen { border-radius: 0; border: 0; }
.wc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--panel-line); }
.wc-empty .ico { width: 64px; height: 64px; }
.wc-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.wc-btn { font: 600 13px/1 var(--sans); padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(10,12,14,.7); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.wc-btn:hover { background: var(--phos); color: #10140a; border-color: var(--phos); }
.wc-shot { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; }
.wc-shot img { max-width: 320px; width: 100%; border-radius: 10px; border: 1px solid var(--line); }

/* keyboard */
.kb-panel { padding: 14px; }
.kb-board { background: #0b0d10; border: 1px solid var(--panel-line); border-radius: 12px; padding: 12px; outline: none; margin-bottom: 10px; }
.kb-board:focus-visible { border-color: var(--phos); }
.kb-board svg { display: block; width: 100%; height: auto; }
.kb-board .k rect, .kb-board .k path { fill: #1b1e23; stroke: #2c3038; stroke-width: .03; transition: fill .08s; }
.kb-board .k text { fill: #8b919b; font-family: var(--mono); font-weight: 600; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.kb-board .k.done rect, .kb-board .k.done path { fill: #24361a; stroke: #4e7a22; }
.kb-board .k.done text { fill: #c6f24e; }
.kb-board .k text.sub { fill: #6b717b; font-weight: 500; }
.kb-board .k.done text.sub { fill: #9fc33f; }
.kb-board .k.down text.sub { fill: #2a3a0c; }
.kb-board .k.down rect, .kb-board .k.down path { fill: #c6f24e; stroke: #c6f24e; }
.kb-board .k.down text { fill: #10140a; }
.kb-hist { display: flex; gap: 12px; align-items: center; padding: 10px 4px 2px; flex-wrap: wrap; }
.kb-hist-list { display: flex; gap: 5px; flex-wrap: wrap; min-height: 26px; }
.kb-hist kbd { font: 600 12px/1 var(--mono); padding: 6px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--panel-line); color: #e9e7e1; }
.kb-hist kbd:first-child { border-color: var(--phos); color: var(--phos); }
.kb-none { color: var(--panel-muted); font-size: 13px; }

/* mouse */
.ms-panel { padding: 14px; }
.ms-pad { position: relative; height: 320px; background: #0b0d10; border: 1px solid var(--panel-line); border-radius: 12px; display: grid; place-items: center; cursor: crosshair; outline: none; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; margin-bottom: 10px;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 24px 24px; }
.ms-svg { width: 120px; height: 190px; pointer-events: none; }
.ms-body { fill: #1b1e23; stroke: #3a3f47; stroke-width: 2; }
.ms-b { fill: #23272e; stroke: #3a3f47; stroke-width: 1.5; transition: fill .08s; }
.ms-b.done { fill: #24361a; stroke: #4e7a22; }
.ms-b.on { fill: #c6f24e; stroke: #c6f24e; }
.ms-arrow { fill: #3a3f47; transition: fill .1s; }
.ms-arrow.on { fill: #c6f24e; }
.ms-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font: 500 12px/1.3 var(--mono); color: var(--panel-muted); padding: 0 12px; pointer-events: none; }
.ms-dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); pointer-events: none; transform: translate(-100px, -100px); }
.ms-cells { grid-template-columns: repeat(4, 1fr); }

/* sound */
.st-controls { gap: 10px 12px; }
.st-panel { padding: 16px; }
.st-stage { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 16px; padding: 8px 6px 18px; }
.st-read { text-align: center; }
.st-spk { width: 60px; height: 80px; }
.st-spk rect { fill: #1b1e23; stroke: #3a3f47; stroke-width: 2; }
.st-spk circle { fill: #0b0d10; stroke: #3a3f47; stroke-width: 2; transition: all .1s; }
.st-spk.on circle { stroke: #c6f24e; }
.st-spk.on circle:nth-of-type(2) { fill: #c6f24e; }
.st-spk.on { filter: drop-shadow(0 0 10px rgba(198,242,78,.35)); }
.st-vol input { width: 100%; accent-color: #c6f24e; margin: 6px 0 2px; }
@media (max-width: 640px) {
  .ms-pad { height: 260px; }
  .ms-cells { grid-template-columns: repeat(2, 1fr); }
  .st-stage { grid-template-columns: 44px 1fr 44px; gap: 8px; }
  .st-spk { width: 44px; height: 60px; }
  .kb-board { padding: 6px; overflow-x: auto; }
  .kb-board svg { min-width: 560px; }
  .kb-panel .kb-cells, .wc-panel .cells { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .kb-panel .cell, .wc-panel .cell { padding: 10px 8px; min-height: 92px; }
  .kb-panel .cell-val, .wc-panel .cell-val { font-size: 16px; }
  .st-panel .st-vol { grid-column: span 2; }
  .wc-tools { right: 6px; bottom: 6px; }
}

/* additions: spectrum, scan, recordings, chatter, DPI */
.seg-dark { background: #0b0d10; border-color: var(--panel-line); }
.seg-dark button { color: var(--panel-muted); font-size: 12px; padding: 6px 10px; }
.seg-dark button:hover { background: var(--panel-2); color: #fff; }
.seg-dark button[aria-pressed="true"] { background: var(--phos); color: #10140a; }
.mt-viz { position: relative; }
.mt-viz .seg { position: absolute; top: 6px; right: 6px; z-index: 1; }
.wc-swatch { position: absolute; left: 10px; bottom: 10px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.6); }
.wc-media { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.wc-media figure { margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 360px; width: 100%; }
.wc-media img, .wc-media video { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.wc-media figcaption { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wc-scan { margin-top: 16px; }
.wc-scan h3 { margin: 0 0 10px; }
.wc-res { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.wc-res li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13px; }
.wc-res b { font-family: var(--mono); font-weight: 600; }
.wc-res span { color: var(--muted); font-size: 12px; grid-column: 1; }
.wc-res i { font-style: normal; grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; color: var(--muted); }
.wc-res li[data-ok="1"] { border-color: var(--ok); }
.wc-res li[data-ok="1"] i { color: var(--ok); }
.wc-res li[data-ok="0"] { opacity: .55; }
.wc-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.kb-board .k.chatter rect, .kb-board .k.chatter path { fill: #4a1f12; stroke: #ff5b1f; }
.kb-board .k.chatter text { fill: #ff8a5c; }
.ms-dpi { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; align-items: center; margin-top: 8px; padding: 14px 16px; border: 1px solid var(--panel-line); border-radius: 12px; background: var(--panel-2); color: #e9e7e1; }
.ms-dpi .mt-db { font-size: 34px; }
.ms-dpi-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; justify-content: flex-end; }
.ms-dpi .mt-select span { color: var(--panel-muted); }
.ms-dist { display: flex; gap: 4px; }
.ms-dist input, .ms-dist select { font: inherit; font-size: 15px; width: 72px; padding: 8px; border-radius: 10px; border: 1px solid var(--panel-line); background: #0b0d10; color: #fff; }
.ms-dist select { width: auto; }
.ms-dpi .btn { background: var(--phos); color: #10140a; }
.ms-dpi-msg { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--panel-muted); }
.ms-pad.locked { border-color: var(--phos); box-shadow: inset 0 0 0 2px rgba(198,242,78,.25); }
@media (max-width: 640px) { .ms-dpi { grid-template-columns: 1fr; } .ms-dpi-ctl { justify-content: flex-start; } }

/* без зсувів під час завантаження: поки тест не намальований (data-ld), вміст під ним невидимий;
   site.js знімає атрибут на DOMContentLoaded, запасний показ — через 2,5 с */
main[data-ld] > :not(h1):not(.lead):not(#tool) { visibility: hidden; animation: ld-show 0s 2.5s forwards; }
@keyframes ld-show { to { visibility: visible; } }
#tool[data-tool="mic-test"] { min-height: 424px; } #tool[data-tool="webcam-test"] { min-height: 560px; }
#tool[data-tool="keyboard-test"] { min-height: 725px; } #tool[data-tool="mouse-test"] { min-height: 794px; } #tool[data-tool="sound-test"] { min-height: 394px; }
@media (max-width: 640px) {
  #tool[data-tool="mic-test"] { min-height: 557px; } #tool[data-tool="webcam-test"] { min-height: 497px; }
  #tool[data-tool="keyboard-test"] { min-height: 616px; } #tool[data-tool="mouse-test"] { min-height: 960px; } #tool[data-tool="sound-test"] { min-height: 611px; }
}

/* side column on tool pages (≥1100 px) */
.pcols { display: block; }
.pside { display: none; }
@media (min-width: 1100px) {
  .pcols { display: grid; grid-template-columns: minmax(0, 760px) 260px; gap: 56px; justify-content: space-between; }
  .pside { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 84px; align-self: start; margin-top: 48px; font-size: 14px; }
}
.pside-top { font-weight: 650; text-decoration: none; color: var(--ink); }
.pside-top:hover { color: var(--signal-text); }
.pside .cell-label { color: var(--muted); display: block; margin-bottom: 8px; }
.ptoc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.ptoc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.ptoc a:hover { color: var(--ink); }
.ptoc a[aria-current] { color: var(--ink); border-left-color: var(--signal); font-weight: 600; }
.pnext ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pnext a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; background: var(--card); font-weight: 600; }
.pnext a:hover { border-color: var(--ink); }
.content h2[id] { scroll-margin-top: 80px; }
details.faq summary h3 { font-size: inherit; margin: 0; font-weight: inherit; display: inline; letter-spacing: 0; }

/* 404 */
.nf { padding: 48px 0 40px; border-bottom: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; }
.nf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.nf h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 14px; }
.nf-pulse { background: var(--signal); animation: none; }
.nf-screen { position: relative; background: #0b0d10; border: 1px solid var(--panel-line); border-radius: 12px; height: 180px; overflow: hidden; margin-bottom: 8px; }
.nf-code { position: absolute; inset: 0; display: grid; place-items: center; font: 800 96px/1 var(--mono); color: rgba(198,242,78,.12); letter-spacing: -.04em; }
.nf-scope { position: absolute; inset: 0; width: 100%; height: 100%; }
.nf-grid-l { stroke: rgba(255,255,255,.06); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.nf-line { stroke: var(--phos); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(198,242,78,.5));
  stroke-dasharray: 600; stroke-dashoffset: 600; animation: nf-draw 2.4s ease-out infinite; }
@keyframes nf-draw { 60%, 100% { stroke-dashoffset: 0; } }
.nf-cells { grid-template-columns: 1fr 1fr; }
.nf-tests { padding-top: 40px; }
.nf-tests h2 { margin: 0 0 16px; }
@media (max-width: 860px) { .nf-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- footer ---------- */
.foot { background: var(--panel); color: var(--panel-muted); padding: 40px 0 44px; font-size: 14px; }
.foot .wrap { display: grid; gap: 28px; grid-template-columns: 2fr 1fr 1fr; }
.foot .logo { color: #f2efe8; }
.foot .logo b { color: var(--signal); }
.foot p { max-width: 320px; }
.foot h3 { font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #f2efe8; margin: 6px 0 12px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 5px 0; }
.foot a { color: var(--panel-muted); text-decoration: none; }
.foot a:hover { color: var(--phos); }
.foot .wrap { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.foot li { overflow-wrap: anywhere; }
.flangs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 18px; border-top: 1px solid var(--panel-line); }
.flangs a { display: inline-flex; gap: 8px; align-items: center; }
.flangs a[aria-current] { color: #f2efe8; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .grid-core { grid-template-columns: repeat(2, 1fr); }
  .grid-core li, .grid-core li:nth-child(n+4) { grid-column: span 1; }
  .grid-core li:last-child:nth-child(odd) { grid-column: span 2; }
  .grid-rest { grid-template-columns: repeat(2, 1fr); }
  .why-list { grid-template-columns: repeat(2, 1fr); }
  .why-list li, .why-list li + li { padding: 18px 18px 14px 0; border-right: 0; }
}
@media (max-width: 640px) {
  .top .wrap { gap: 4px; height: 56px; }
  .logo { font-size: 17px; }
  header summary { padding: 7px 9px; font-size: 14px; }
  .hero { padding: 28px 0 36px; }
  .hero h1 { font-size: 38px; }
  .lead { font-size: 17px; }
  .cells { grid-template-columns: repeat(2, 1fr); }
  .cell { min-height: 104px; }
  .cell-val { font-size: 19px; }
  .grid-core, .grid-rest, .why-list { grid-template-columns: 1fr; }
  .grid-core li:last-child:nth-child(odd) { grid-column: span 1; }
  .foot .wrap { grid-template-columns: 1fr; }
  .tool { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
