/*
 * tests.css - shared test shell, screens, result screen, charts and the
 * styles of all eleven tests.
 * Timing rule: measured stimuli never get transitions or animations.
 */

/* ---------- Shell ---------- */
.section-test { padding-top: var(--s-2); }
.test-shell {
  position: relative;
  max-width: 880px;
  min-height: 560px;
  margin-inline: auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-shell);
  scroll-margin-top: 80px;
}
.screen { padding: var(--s-5) var(--s-4); }
@media (min-width: 640px) { .screen { padding: var(--s-6); } }
.shell-head { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
.shell-title { font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.shell-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--success); margin-top: 2px; }
.noscript-note { padding: var(--s-5); background: var(--warning-soft); border-top: 1px solid var(--warning); }
.test-note { display: flex; gap: var(--s-2); align-items: flex-start; max-width: 880px; margin: var(--s-5) auto 0; font-size: var(--fs-small); color: var(--ink-2); }
.test-note .icon { flex: none; margin-top: 2px; color: var(--accent); }

/* Mode cards */
.mode-grid { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .mode-count-3 { grid-template-columns: repeat(3, 1fr); }
  .mode-count-2 { grid-template-columns: repeat(2, 1fr); }
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-4);
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out), border-color var(--t-micro) var(--ease-out);
}
.mode-card:hover { border-color: var(--ink); box-shadow: var(--shadow-hover); transform: translate(-2px, -2px); }
.mode-card:active { box-shadow: 0 0 0 var(--ink); transform: translate(0, 0); }
.mode-card:focus-visible, .mode-card.is-selected { outline: 2px solid var(--ink); outline-offset: -2px; border-color: var(--ink); }
.mode-top { display: flex; align-items: center; gap: var(--s-2); width: 100%; flex-wrap: wrap; }
.mode-top .badge { margin-left: auto; }
.mode-top .badge + .badge { margin-left: 0; }
.mode-title { font-size: 18px; font-weight: 800; margin-top: var(--s-1); }
.mode-desc { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.mode-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); width: 100%; margin-top: auto; padding-top: var(--s-3); flex-wrap: wrap; }
.mode-start { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--accent); }
.badge-last { border-color: var(--accent); color: var(--accent); }

/* Intro */
.intro { max-width: 620px; }
.intro-title { font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.intro-mode { margin-top: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.intro-rules { margin-top: var(--s-5); display: grid; gap: var(--s-3); }
.intro-rules li { display: flex; gap: var(--s-3); align-items: flex-start; }
.intro-rules .icon { color: var(--success); margin-top: 3px; }
.intro-hints { margin-top: var(--s-5); display: grid; gap: var(--s-2); padding: var(--s-4); background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.intro-hints p { display: flex; gap: var(--s-2); align-items: flex-start; }
.intro-hints .icon { flex: none; margin-top: 2px; color: var(--ink); }
.intro-extra { margin-top: var(--s-5); }
.intro-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* Countdown */
.screen[data-screen="countdown"] { display: flex; align-items: center; justify-content: center; min-height: 520px; }
.countdown-num { font-size: clamp(96px, 20vw, 180px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.countdown-hint { position: absolute; bottom: var(--s-5); left: 0; right: 0; text-align: center; font-size: 13px; color: var(--ink-3); }

/* Run screen */
.screen[data-screen="run"] { padding: 0; }
.run-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.run-status { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-right { display: flex; align-items: center; gap: var(--s-2); }
.run-timer { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: right; }
.lives { display: inline-flex; gap: 4px; }
.lives span { width: 12px; height: 12px; border: 2px solid var(--ink); }
.lives span.is-full { background: var(--ink); }
.run-top .btn { height: 40px; padding: 0 12px; }
.run-top .btn .label { display: none; }
@media (min-width: 640px) { .run-top .btn .label { display: inline; } }
.run-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  padding: var(--s-4);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 640px) { .run-stage { padding: var(--s-5); } }

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  background: var(--overlay);
  text-align: center;
  padding: var(--s-5);
}
.pause-title { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.pause-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }

/* Stimulus card shared by several tests */
.stim-card {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 2px solid var(--line);
  background: var(--bg);
}
.stim-card.pulse-ok { animation: pulse-ok .25s ease-out; }
.stim-card.pulse-bad { animation: pulse-bad .25s ease-out; }
@keyframes pulse-ok { 0%, 60% { border-color: var(--success); } 100% { border-color: var(--line); } }
@keyframes pulse-bad { 0%, 60% { border-color: var(--danger); } 100% { border-color: var(--line); } }
.fb-text {
  position: absolute;
  left: 0; right: 0; bottom: var(--s-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-size: 15px;
  font-weight: 700;
  min-height: 24px;
}
.fb-text.is-ok { color: var(--success); }
.fb-text.is-bad { color: var(--danger); }
.fixation { position: relative; width: 24px; height: 24px; }
.fixation::before, .fixation::after { content: ""; position: absolute; background: var(--ink); }
.fixation::before { left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; }
.fixation::after { top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; }

/* Stimuli: never animated */
.stroop-word, .gng-stim, .rt-panel, .flanker-row, .nb-letter, .nm-number, .seq-tile, .vm-tile, .chimp-cell, .schulte-cell { transition: none !important; animation: none; }

/* ---------- Stroop ---------- */
.stroop-word { font-size: var(--fs-stimulus); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); margin-top: var(--s-4); }
@media (min-width: 560px) { .answer-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); } }
.answer-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 60px;
  padding: 0 var(--s-4);
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
}
.answer-btn:hover { background: var(--bg-soft); }
.answer-btn:active, .answer-btn.is-pressed { background: var(--ink); color: var(--white); }

/* ---------- Go/No-Go ---------- */
.gng-area { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 240px; border: 2px solid var(--line); position: relative; }
.gng-stim { width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; color: var(--white); }
.gng-stim.is-go { background: var(--success); }
.gng-stim.is-nogo { background: var(--danger); }
.response-pad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 88px;
  margin-top: var(--s-4);
  border: 1px solid var(--ink);
  background: var(--bg-soft);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.response-pad:active, .response-pad.is-pressed { background: var(--ink); color: var(--white); }

/* ---------- Reaction time ---------- */
.rt-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 360px;
  padding: var(--s-5);
  text-align: center;
  color: var(--white);
  background: var(--ink-2);
  cursor: pointer;
}
.rt-panel.is-wait { background: var(--danger); }
.rt-panel.is-go { background: var(--success); }
.rt-panel.is-result { background: var(--accent); }
.rt-panel.is-early { background: var(--ink); }
.rt-big { font-size: clamp(36px, 7vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rt-small { font-size: 17px; font-weight: 600; opacity: .9; }
.screen .rt-panel .icon { width: 44px; height: 44px; }

/* ---------- Number memory ---------- */
.nm-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-5); text-align: center; min-height: 360px; }
.nm-number { font-size: clamp(36px, 7vw, 72px); font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; line-height: 1.1; word-break: break-all; max-width: 100%; }
.nm-timer { width: min(360px, 80%); height: 4px; background: var(--bg-sunken); overflow: hidden; }
.nm-timer span { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.nm-form { display: grid; gap: var(--s-4); width: min(520px, 100%); }
.nm-input { height: 72px; font-size: 32px; font-weight: 800; text-align: center; letter-spacing: .08em; font-variant-numeric: tabular-nums; border: 1px solid var(--ink); }
.nm-compare { display: grid; gap: var(--s-3); text-align: left; }
.nm-row { display: grid; gap: 2px; }
.nm-digits { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; word-break: break-all; }
.nm-digits .is-wrong { color: var(--danger); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.nm-digits .is-missing { color: var(--danger); opacity: .7; }
.nm-verdict { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 800; font-size: 20px; }
.nm-verdict.is-ok { color: var(--success); }
.nm-verdict.is-bad { color: var(--danger); }

/* ---------- Grid boards (sequence, visual, chimp) ---------- */
.board-label { text-align: center; font-weight: 800; font-size: 18px; min-height: 28px; margin-bottom: var(--s-4); }
.board-label.is-turn { color: var(--accent); }
.board-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.seq-board { display: grid; grid-template-columns: repeat(3, minmax(80px, 120px)); gap: 8px; padding: 8px; background: var(--bg-sunken); }
.seq-tile { aspect-ratio: 1; min-width: 80px; background: var(--bg); border: 1px solid var(--line); }
.seq-tile.is-flash { background: var(--accent); border-color: var(--accent); }
.seq-tile.is-press { background: var(--ink); border-color: var(--ink); }
.seq-board.is-locked .seq-tile { cursor: default; }

.vm-board { --n: 3; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(480px, 100%); aspect-ratio: 1; padding: 6px; background: var(--bg-sunken); }
.vm-tile { display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line); color: var(--white); min-width: 0; }
.vm-tile.is-lit, .vm-tile.is-found { background: var(--accent); border-color: var(--accent); }
.vm-tile.is-wrong { background: var(--ink); border-color: var(--ink); }
.vm-board.is-locked .vm-tile { cursor: default; }

.chimp-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; width: 100%; max-width: 720px; }
@media (max-width: 639px) { .chimp-board { grid-template-columns: repeat(5, 1fr); max-width: 420px; } }
.chimp-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(16px, 3vw, 26px); font-variant-numeric: tabular-nums; min-width: 0; }
.chimp-cell.is-num { background: var(--ink); color: var(--white); border: 1px solid var(--ink); }
.chimp-cell.is-hidden { background: var(--bg); color: transparent; border: 1px solid var(--ink); }
.chimp-cell.is-done { visibility: hidden; }
.chimp-cell.is-empty { pointer-events: none; }
.chimp-study { width: min(360px, 80%); height: 4px; margin: 0 auto var(--s-4); background: var(--bg-sunken); overflow: hidden; }
.chimp-study span { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.interstitial { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4); text-align: center; min-height: 360px; }
.interstitial-big { font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Aim trainer ---------- */
.run-stage.stage-aim { padding: 0; }
.aim-arena {
  position: relative;
  flex: 1;
  height: max(360px, 60vh);
  min-height: 360px;
  overflow: hidden;
  background-color: var(--bg-soft);
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  touch-action: none;
  cursor: crosshair;
}
.aim-target {
  position: absolute;
  width: 64px; height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
@media (max-width: 639px) { .aim-target { width: 56px; height: 56px; } }
.aim-visual { position: absolute; inset: 0; background: var(--danger); outline: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.aim-visual::before { content: ""; position: absolute; inset: 22%; background: var(--white); }
.aim-visual::after { content: ""; position: absolute; inset: 38%; background: var(--danger); }
.aim-start-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 800;
  font-size: 15px;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 6px 10px;
  pointer-events: none;
}
.aim-miss { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--ink); pointer-events: none; animation: miss-fade .6s ease-out forwards; }
@keyframes miss-fade { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Flanker ---------- */
.flanker-row { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); }
.flanker-arrow { width: 36px; height: 36px; }
@media (min-width: 640px) { .flanker-arrow { width: 48px; height: 48px; } }
.flanker-arrow.is-left { transform: scaleX(-1); }
.pair-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-4); }
.pair-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 72px;
  border: 1px solid var(--ink);
  background: var(--bg);
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.pair-btn:hover { background: var(--bg-soft); }
.pair-btn:active, .pair-btn.is-pressed { background: var(--ink); color: var(--white); }

/* ---------- Schulte table ---------- */
.schulte-next { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: var(--s-4); font-variant-numeric: tabular-nums; }
.schulte-next strong { display: inline-block; min-width: 2ch; padding: 0 8px; background: var(--ink); color: var(--white); }
.schulte-board { --n: 5; display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(560px, 100%); aspect-ratio: 1; margin: 0 auto; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.schulte-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: calc(min(560px, 100vw - 64px) / var(--n) * .42);
}
.schulte-cell:hover { background: var(--bg-soft); }
.schulte-cell.is-found { background: var(--accent-soft); color: var(--ink-3); }
.schulte-cell.flash-ok { background: var(--success); color: var(--white); }
.schulte-cell.flash-bad { background: var(--danger); color: var(--white); }

/* ---------- N-Back ---------- */
.nb-area { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 260px; position: relative; }
.nb-card { width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); background: var(--bg); }
.nb-letter { font-size: var(--fs-stimulus); font-weight: 800; line-height: 1; }
.nb-diagram { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin-top: var(--s-3); }
.nb-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nb-cell b { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--ink); font-size: 20px; font-weight: 800; background: var(--bg); }
.nb-cell.is-pair b { background: var(--accent); color: var(--white); border-color: var(--accent); }
.nb-cell small { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.nb-link { position: relative; height: 14px; border: 2px solid var(--accent); border-bottom: 0; margin: 0 20px 2px; }
.nb-wrap { display: inline-grid; }

/* ---------- Static example panels on test pages ---------- */
.example-panel { padding: var(--s-5); background: var(--bg); border: 1px solid var(--line); display: grid; gap: var(--s-4); }
.ex-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.ex-card { display: grid; gap: var(--s-2); justify-items: center; padding: var(--s-5) var(--s-3); border: 1px solid var(--line); text-align: center; }
.ex-word { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1; }
.ex-caption { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.ex-row { display: flex; gap: 6px; justify-content: center; align-items: center; }
.ex-sq { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; color: var(--white); }
.ex-sq.is-go { background: var(--success); }
.ex-sq.is-nogo { background: var(--danger); }
.ex-grid { display: grid; gap: 4px; width: 168px; margin: 0 auto; }
.ex-grid span { aspect-ratio: 1; border: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.ex-grid span.is-on { background: var(--accent); border-color: var(--accent); }
.ex-grid span.is-num { background: var(--ink); border-color: var(--ink); color: var(--white); }
.ex-panel { min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 800; font-size: 18px; }
.ex-panel.is-wait { background: var(--danger); }
.ex-panel.is-go { background: var(--success); }
.ex-digits { font-size: 36px; font-weight: 800; letter-spacing: .08em; text-align: center; font-variant-numeric: tabular-nums; }
.ex-target { position: relative; width: 56px; height: 56px; background: var(--danger); outline: 1px solid var(--ink); margin: 0 auto; }
.ex-target::before { content: ""; position: absolute; inset: 22%; background: var(--white); }
.ex-target::after { content: ""; position: absolute; inset: 38%; background: var(--danger); }

/* ---------- Result screen ---------- */
.result:focus { outline: none; }
.result-head { display: flex; align-items: center; gap: var(--s-4); }
.result-head .icon-tile { background: var(--ink); color: var(--white); }
.result-title { font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.result-sub { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.result-headline { display: grid; gap: var(--s-5); margin-top: var(--s-6); padding: var(--s-5); border: 1px solid var(--ink); }
@media (min-width: 640px) { .result-headline.is-double { grid-template-columns: 1fr 1fr; } }
.headline-item { display: grid; gap: var(--s-2); align-content: start; }
.headline-value { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.metric-big { font-size: var(--fs-metric); font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-unit { font-size: 22px; font-weight: 800; color: var(--ink-3); }
.headline-text { color: var(--ink-2); font-size: 15px; max-width: 52ch; }
.result-compare { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; margin-top: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.result-compare span { display: inline-flex; align-items: center; gap: 6px; }
.result-compare .is-better { color: var(--success); }
.result-compare .is-worse { color: var(--danger); }
.result-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-5); }
@media (min-width: 720px) { .result-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.result-charts { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
@media (min-width: 720px) { .result-charts.is-double { grid-template-columns: 3fr 2fr; } }
.chart-card { padding: var(--s-4); border: 1px solid var(--line); min-width: 0; }
.chart-title { font-size: 15px; font-weight: 800; margin-bottom: var(--s-3); }
.result-notes { margin-top: var(--s-5); display: grid; gap: var(--s-2); color: var(--ink-2); }
.result-notes p { display: flex; gap: var(--s-2); align-items: flex-start; }
.result-notes .icon { flex: none; margin-top: 4px; color: var(--accent); }
.result-unsaved { margin-top: var(--s-5); }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.result-disclaimer { margin-top: var(--s-5); font-size: 13px; color: var(--ink-3); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-label { fill: var(--ink-3); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
.chart-dot { fill: var(--accent); }
.chart-dot.is-ok { fill: var(--success); }
.chart-dot.is-bad { fill: var(--danger); }
.chart-bar { fill: var(--accent); }
.chart-bar.is-alt { fill: var(--ink); }
.chart-ref { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart-ref-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart-value { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-2); font-size: 12px; color: var(--ink-3); font-weight: 600; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; background: var(--accent); }
.chart-legend i.is-ok { background: var(--success); }
.chart-legend i.is-bad { background: var(--danger); }
.chart-legend i.is-ref { height: 0; width: 16px; border-top: 2px dashed var(--ink); background: none; }

/* Shake (sequence memory mistakes) without Motion */
.shake { animation: shake .3s linear; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
