/* Luyện Gõ Bàn Phím — style.css
   Themes: "Neon" (default, dark + glow) and "Cute" (light, clay, rounded) — same token approach as our sibling apps
   (Mưa Hán Tự, Nói Hán Tự). Components use semantic tokens only. Desktop-first, fluid down to 360 px. */

/* ============================================================ tokens */
:root {
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --r-btn: 14px; --r-card: 20px; --r-chip: 999px; --r-modal: 24px; --r-key: 9px;
  --tap: 44px;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 120ms; --t-mid: 220ms;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --type-size: 28px;
  --maxw: 1180px;
}
html[data-font="s"] { --type-size: 22px; }
html[data-font="l"] { --type-size: 36px; }

html[data-theme="neon"] {
  color-scheme: dark;
  --bg: #070A14;
  --bg-grid: rgba(120, 140, 255, .05);
  --bg-glow-1: rgba(34, 211, 238, .12);
  --bg-glow-2: rgba(192, 132, 252, .12);
  --surface: #0F1426;
  --surface-2: #141B33;
  --surface-3: #1B2444;
  --line: rgba(140, 160, 255, .18);
  --line-strong: rgba(160, 180, 255, .36);
  --ink: #EAF0FF;
  --ink-soft: #A9B4D6;
  --ink-faint: #8591B5;
  --primary: #22D3EE;
  --primary-2: #38BDF8;
  --on-primary: #04121A;
  --primary-soft: rgba(34, 211, 238, .14);
  --accent: #C084FC;
  --pink: #FF5FA2;
  --star: #FCD34D;
  --good: #4ADE80; --good-bg: rgba(74, 222, 128, .14);
  --warn: #FBBF24; --warn-bg: rgba(251, 191, 36, .14);
  --bad: #FF5C77; --bad-bg: rgba(255, 92, 119, .16); --bad-strong: #FF2E55;
  --miss: #8D98B8;
  --text-pending: #7A86AB;
  --caret: #FF5FA2;
  --shadow-card: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, .45);
  --shadow-btn: 0 0 16px rgba(34, 211, 238, .40);
  --glow-primary: 0 0 22px rgba(34, 211, 238, .5);
  --border-w: 1px;
  /* finger pairs (keyboard): used as key border/top stripe colours in Neon */
  --f-pinky: #FF5FA2; --f-ring: #FBBF24; --f-middle: #4ADE80; --f-indexL: #22D3EE; --f-indexR: #A78BFA; --f-thumb: #94A3B8;
  --key-bg: #141B33; --key-ink: #C7D2FE; --key-bg-active: #22D3EE;
}
html[data-theme="cute"] {
  color-scheme: light;
  --bg: #FFF8EE;
  --bg-grid: rgba(91, 75, 219, .04);
  --bg-glow-1: rgba(255, 200, 221, .5);
  --bg-glow-2: rgba(189, 224, 254, .55);
  --surface: #FFFFFF;
  --surface-2: #F7F2FF;
  --surface-3: #EEE6FF;
  --line: #E6DDF6;
  --line-strong: #CFC2EE;
  --ink: #2B2350;
  --ink-soft: #57527C;
  --ink-faint: #6E6992;
  --primary: #5B4BDB;
  --primary-2: #4636C4;
  --on-primary: #FFFFFF;
  --primary-soft: #E9E4FF;
  --accent: #E86A1C;
  --pink: #E23E6E;
  --star: #E89B0C;
  --good: #1B8A57; --good-bg: #DDF5E9;
  --warn: #A86200; --warn-bg: #FFF0CF;
  --bad: #C9303A; --bad-bg: #FFE1E3; --bad-strong: #A3121F;
  --miss: #6B6790;
  --text-pending: #8A85AC;
  --caret: #5B4BDB;
  --shadow-card: 0 5px 0 rgba(43, 35, 80, .08), 0 14px 28px rgba(43, 35, 80, .09);
  --shadow-btn: 0 4px 0 #3B2DAE, 0 10px 18px rgba(91, 75, 219, .22);
  --glow-primary: 0 0 0 5px rgba(91, 75, 219, .14);
  --border-w: 2px;
  --r-btn: 18px; --r-card: 24px; --r-modal: 28px; --r-key: 12px;
  --f-pinky: #FFD6E7; --f-ring: #FFE8B8; --f-middle: #D4F3CC; --f-indexL: #CDE7FF; --f-indexR: #E5DBFF; --f-thumb: #ECEAF5;
  --key-bg: #FFFFFF; --key-ink: #2B2350; --key-bg-active: #5B4BDB;
}
html[data-contrast="high"][data-theme="neon"] { --ink-soft: #D5DCF5; --ink-faint: #B9C3E3; --text-pending: #A9B4D6; --line: rgba(200, 210, 255, .45); }
html[data-contrast="high"][data-theme="cute"] { --ink-soft: #2B2350; --ink-faint: #403A66; --text-pending: #5A5580; --line: #9C8FD0; }

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg);
  background-image:
    radial-gradient(60vw 40vh at 0% 0%, var(--bg-glow-1), transparent 70%),
    radial-gradient(60vw 40vh at 100% 100%, var(--bg-glow-2), transparent 70%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: 12px; font-weight: 800; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 30px; height: 30px; }
main { flex: 1; outline: none; width: 100%; }
kbd {
  font: 700 12px/1 var(--font-mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink); box-shadow: 0 2px 0 var(--line);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(26px, 3.2vw, 36px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 .8em; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.spacer { flex: 1; }

/* ============================================================ header / nav / footer */
.site-header {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 10px max(16px, calc((100vw - var(--maxw)) / 2)); min-height: 64px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: opacity .25s, transform .25s;
}
body.focus-mode .site-header, body.focus-mode .site-footer, body.focus-mode .hide-on-focus { opacity: 0; pointer-events: none; }
body.focus-mode .site-header { transform: translateY(-6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { color: var(--primary); display: grid; }
html[data-theme="neon"] .brand-mark { filter: drop-shadow(0 0 8px rgba(34, 211, 238, .6)); }
.brand-text { font: 800 19px/1 var(--font-display); letter-spacing: .01em; white-space: nowrap; }
.brand-text b { color: var(--primary); }
.site-nav { display: flex; gap: 4px; margin-left: 12px; flex: 1; min-width: 0; overflow: hidden; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; min-height: 40px;
  color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.site-nav .ic { width: 18px; height: 18px; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-tools .menu-btn { display: none; }
.profile-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; min-height: 44px;
  border: var(--border-w) solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 14px;
}
.profile-chip:hover { border-color: var(--line-strong); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 15px/1 var(--font-display);
  background: var(--av, var(--primary)); color: #0B1020; flex: none;
}
.avatar.frame-gold { box-shadow: 0 0 0 3px #F5B700; }
.avatar.frame-leaf { box-shadow: 0 0 0 3px #3FAE5A, 0 0 0 6px #BDE7B5; }
.avatar.frame-neon { box-shadow: 0 0 0 2px #22D3EE, 0 0 14px #22D3EE; }
.avatar.frame-rainbow { box-shadow: 0 0 0 3px transparent; background-clip: padding-box; outline: 3px solid; outline-color: #FF5FA2; outline-offset: 0; }
.pc-coins { display: inline-flex; align-items: center; gap: 3px; color: var(--star); font-variant-numeric: tabular-nums; }
.pc-coins:empty { display: none; }
.mobile-menu {
  position: fixed; inset: 64px 8px auto 8px; z-index: 45; background: var(--surface); border: var(--border-w) solid var(--line-strong);
  border-radius: 18px; box-shadow: var(--shadow-card); padding: 8px; display: grid; gap: 2px; max-height: calc(100dvh - 76px); overflow: auto; overscroll-behavior: contain;
}
.mobile-menu a, .mobile-menu button {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; color: var(--ink); text-decoration: none;
  font-weight: 700; background: none; border: 0; text-align: left; min-height: var(--tap);
}
.mobile-menu a:hover, .mobile-menu button:hover { background: var(--surface-2); }
.site-footer {
  padding: 18px max(16px, calc((100vw - var(--maxw)) / 2)) calc(18px + var(--safe-b)); color: var(--ink-faint); font-size: 13px;
  display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 32px;
  transition: opacity .25s;
}
.site-footer p { margin: 0; }
.boot { padding: 80px 16px; text-align: center; color: var(--ink-soft); }

/* ============================================================ layout */
.screen { max-width: var(--maxw); margin: 0 auto; padding: 22px 16px 8px; animation: screen-in var(--t-mid) ease-out; }
.screen-narrow { max-width: 860px; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--ink-soft); max-width: 680px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink-faint); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.crumbs a:hover { color: var(--primary); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section { margin: 28px 0 0; }
.section > h2 { display: flex; align-items: center; gap: 8px; }

/* ============================================================ cards, buttons, chips */
.card {
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 18px;
  border: var(--border-w) solid var(--line);
}
html[data-theme="neon"] .card { border-color: transparent; }
.card h2, .card h3 { margin-top: 0; }
.card-tight { padding: 12px 14px; }
.btn {
  min-height: var(--tap); padding: 9px 18px; border-radius: var(--r-btn);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; letter-spacing: .01em; border: var(--border-w) solid var(--line-strong);
  background: var(--surface-2); color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) ease-out, box-shadow var(--t-fast), background-color .2s, opacity .2s;
  touch-action: manipulation; user-select: none;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(2px) scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: var(--shadow-btn); }
html[data-theme="neon"] .btn-primary { background: linear-gradient(135deg, #22D3EE, #38BDF8 60%, #818CF8); }
html[data-theme="cute"] .btn-primary:active { box-shadow: 0 1px 0 #3B2DAE; transform: translateY(3px); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
.btn-lg { min-height: 54px; font-size: 18px; padding: 12px 24px; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 13px; display: inline-grid; place-items: center;
  background: var(--surface); border: var(--border-w) solid var(--line); color: var(--ink);
  transition: transform var(--t-fast), background-color .2s, border-color .2s; flex: none;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="false"] { color: var(--ink-faint); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-chip); font-size: 13px; font-weight: 800;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); white-space: nowrap;
}
.chip.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button {
  min-height: 34px; padding: 4px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-soft); font-weight: 800; font-size: 14px;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--primary-soft); color: var(--primary); }
html[data-theme="neon"] .seg button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .45); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 36px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-faint); transition: transform .2s, background .2s; }
.switch input:checked + .track { background: var(--primary); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--on-primary); }
.switch input:focus-visible + .track { outline: 3px solid var(--primary); outline-offset: 2px; }

/* form fields */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 9px 12px; border-radius: 12px; border: var(--border-w) solid var(--line-strong);
  background: var(--surface-2); color: var(--ink);
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow-primary); }
.hint { font-size: 13px; color: var(--ink-faint); }
.error-text { font-size: 13px; color: var(--bad); font-weight: 700; }

/* ============================================================ banners, toasts, modal */
.banners { position: sticky; top: 64px; z-index: 30; display: grid; gap: 6px; padding: 0 8px; }
.banners:not(:empty) { padding-top: 8px; }
.banner {
  display: flex; gap: 10px; align-items: flex-start; max-width: 900px; margin: 0 auto; width: 100%;
  background: var(--surface); border: var(--border-w) solid var(--warn); border-radius: 16px; padding: 10px 8px 10px 14px;
  box-shadow: var(--shadow-card); font-size: 14px;
}
.banner.info { border-color: var(--primary); }
.banner .b-text { flex: 1; padding-top: 3px; }
.banner .b-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.toasts { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 80; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--surface); color: var(--ink); border: var(--border-w) solid var(--line-strong); border-left: 5px solid var(--primary);
  border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-card); font-weight: 700; font-size: 14px; animation: toast-in .25s var(--ease-pop);
  display: flex; gap: 10px; align-items: center;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.coin { border-left-color: var(--star); }
.toast .ic { color: var(--star); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(5, 8, 18, .62); display: grid; place-items: center; padding: 16px;
  animation: fade-in .18s ease-out;
}
html[data-theme="cute"] .modal-backdrop { background: rgba(43, 35, 80, .38); }
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-modal);
  box-shadow: var(--shadow-card), 0 30px 80px rgba(0, 0, 0, .4); padding: 22px; border: var(--border-w) solid var(--line-strong);
  animation: pop-in .26s var(--ease-pop);
}
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { flex: 1; margin: 6px 0 0; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================ hub */
.hub-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: stretch; margin-bottom: 22px; }
.hub-hero h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 8px; }
.hub-hero h1 span { color: var(--primary); }
html[data-theme="neon"] .hub-hero h1 span { text-shadow: 0 0 22px rgba(34, 211, 238, .45); }
.hub-hero .lead { color: var(--ink-soft); font-size: 17px; max-width: 560px; }
.hub-today { display: grid; gap: 10px; align-content: start; }
.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; border: 1px solid var(--line); min-width: 0; }
.mini-stat b { display: block; font: 800 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.quest-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.quest { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.quest .q-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.quest.done .q-box { background: var(--good); border-color: var(--good); color: #062014; }
.quest.done .q-text { color: var(--ink-faint); text-decoration: line-through; }
.quest .q-prog { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; font-weight: 800; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card {
  position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 20px; min-height: 210px;
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink);
  border: var(--border-w) solid var(--line); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s;
}
html[data-theme="neon"] .tool-card { border-color: transparent; }
.tool-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tc, var(--primary));
}
html[data-theme="neon"] .tool-card::before { box-shadow: 0 0 18px var(--tc, var(--primary)); }
.tool-card:hover { transform: translateY(-3px); border-color: var(--tc); }
.tool-card .tc-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--tc);
  background: color-mix(in srgb, var(--tc) 16%, transparent);
}
.tool-card .tc-icon .ic { width: 28px; height: 28px; }
.tool-card h2 { font-size: 21px; margin: 4px 0 0; }
.tool-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.tool-card .tc-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--ink-faint); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; flex: 1; min-width: 60px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--tc, var(--primary)); border-radius: inherit; transition: width .4s; }
.hub-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ============================================================ lesson map */
.course-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-bottom: 18px; }
.course-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.chapter { margin-bottom: 22px; }
.chapter-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chapter-head h2 { margin: 0; font-size: 20px; }
.chapter-head .ch-num { font: 800 13px/1 var(--font-display); color: var(--on-primary); background: var(--primary); padding: 5px 9px; border-radius: 999px; }
.chapter-head p { margin: 0; color: var(--ink-soft); font-size: 14px; flex-basis: 100%; }
.chapter.locked .chapter-head h2 { color: var(--ink-faint); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.lesson-tile {
  position: relative; display: grid; text-align: left; font: inherit; justify-items: start; width: 100%; gap: 6px; align-content: start; padding: 12px 14px 12px; min-height: 104px; border-radius: 16px;
  background: var(--surface); border: var(--border-w) solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card);
  transition: transform .15s, border-color .15s;
}
html[data-theme="neon"] .lesson-tile { box-shadow: 0 0 0 1px var(--line); border-color: transparent; }
.lesson-tile:hover { transform: translateY(-2px); border-color: var(--primary); }
html[data-theme="neon"] .lesson-tile:hover { box-shadow: 0 0 0 1px var(--primary), 0 0 18px rgba(34, 211, 238, .25); }
.lesson-tile .lt-code { font: 800 12px/1 var(--font-mono); color: var(--primary); }
.lesson-tile .lt-title { font-weight: 800; font-size: 15px; line-height: 1.25; }
.lesson-tile .lt-stars { display: flex; gap: 2px; color: var(--star); margin-top: auto; }
.lesson-tile .lt-stars .ic { width: 18px; height: 18px; }
.lesson-tile .lt-stars .off { color: var(--line-strong); }
.lesson-tile.current { border-color: var(--primary); }
html[data-theme="neon"] .lesson-tile.current { box-shadow: 0 0 0 2px var(--primary), 0 0 22px rgba(34, 211, 238, .3); }
.lesson-tile.locked { opacity: .55; cursor: not-allowed; }
.lesson-tile.locked:hover { transform: none; border-color: var(--line); }
.lesson-tile .lt-lock { position: absolute; top: 10px; right: 10px; color: var(--ink-faint); }
.lesson-tile.checkpoint { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface)); }
.lesson-tile.checkpoint .lt-code { color: var(--accent); }
.lesson-tile.review .lt-code { color: var(--good); }
.lt-kind { position: absolute; top: 10px; right: 10px; color: var(--accent); }

/* ============================================================ practice screen */
.practice { max-width: 1100px; margin: 0 auto; padding: 14px 16px 8px; }
.practice-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border-radius: 18px; background: var(--surface);
  box-shadow: var(--shadow-card); border: var(--border-w) solid var(--line); margin-bottom: 14px;
}
html[data-theme="neon"] .practice-bar { border-color: transparent; }
.practice-bar .pb-title { display: grid; line-height: 1.2; min-width: 0; flex: 1; padding: 0 6px; }
.practice-bar .pb-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.practice-bar .pb-title span { font-size: 13px; color: var(--ink-faint); font-weight: 700; }
.pb-stat { display: grid; text-align: center; min-width: 64px; padding: 2px 8px; border-left: 1px solid var(--line); }
.pb-stat b { font: 800 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.pb-stat span { font-size: 11px; color: var(--ink-faint); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.pb-count { font-weight: 800; font-size: 14px; color: var(--ink-soft); padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.typing-card {
  position: relative; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 26px 26px 22px;
  border: var(--border-w) solid var(--line); cursor: text;
}
html[data-theme="neon"] .typing-card { border-color: transparent; }
.typing-card.bg-bg-stars { background-image: radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.5), transparent), radial-gradient(1.5px 1.5px at 70% 60%, rgba(255,255,255,.4), transparent), radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,.5), transparent); background-size: 160px 120px; }
.typing-card.bg-bg-waves { background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 22px, color-mix(in srgb, var(--primary) 7%, transparent) 22px 24px); }
.typing-card.bg-bg-grid { background-image: linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.typing-card.bg-bg-leaves { background-image: radial-gradient(ellipse 18px 9px at 15% 20%, color-mix(in srgb, var(--good) 14%, transparent), transparent), radial-gradient(ellipse 18px 9px at 75% 75%, color-mix(in srgb, var(--good) 14%, transparent), transparent); background-size: 140px 110px; }
.typing-text {
  position: relative; font: 500 var(--type-size)/1.75 var(--font-mono); letter-spacing: .01em; color: var(--text-pending);
  word-break: normal; overflow-wrap: anywhere; user-select: none; min-height: 1.75em;
}
.typing-text.lines-3 { height: calc(var(--type-size) * 1.75 * 3); overflow: hidden; }
.typing-text .tt-inner { position: relative; transition: transform .18s ease-out; }
.typing-text .w { display: inline; white-space: nowrap; }
.typing-text .c { position: relative; transition: color .08s; }
.typing-text .c.correct { color: var(--ink); }
.typing-text .c.corrected { color: var(--ink); text-decoration: underline dotted var(--warn) 2px; text-underline-offset: 6px; }
.typing-text .c.incorrect { color: var(--bad); text-decoration: underline solid var(--bad) 2px; text-underline-offset: 6px; }
.typing-text .c.missed { color: var(--miss); text-decoration: underline wavy var(--bad) 1.5px; text-underline-offset: 6px; }
.typing-text .c.flash { animation: char-err .35s ease-out; }
.typing-text .x { color: var(--bad-strong); font-weight: 800; opacity: .9; text-decoration: line-through 2px; }
.typing-text .w.err-word { text-decoration: underline solid var(--bad) 2px; text-underline-offset: 10px; }
.typing-text .sp { white-space: normal; }
.typing-text .sp.incorrect { background: var(--bad-bg); border-radius: 4px; }
.typing-text .w.active .c.pending:first-child { }
@keyframes char-err { 0% { background: var(--bad-bg); } 100% { background: transparent; } }
.caret {
  position: absolute; left: 0; top: 0; width: 3px; height: 1.25em; border-radius: 2px; background: var(--caret); pointer-events: none;
  transition: transform .09s linear; animation: caret-blink 1.05s steps(1) infinite; z-index: 2;
}
html[data-theme="neon"] .caret { box-shadow: 0 0 10px var(--caret); }
.caret.typing { animation: none; }
.caret.no-smooth { transition: none; }
.caret.style-block { width: .62em; opacity: .45; border-radius: 3px; }
.caret.style-underline { width: .62em; height: 3px; }
.caret.skin-caret-rainbow { background: linear-gradient(180deg, #FF5FA2, #FBBF24, #4ADE80, #22D3EE, #A78BFA); }
.caret.skin-caret-glow { box-shadow: 0 0 6px 2px var(--caret), 0 0 18px 4px var(--caret); }
.caret.skin-caret-heart::after { content: "♥"; position: absolute; top: -.9em; left: -.3em; font-size: .55em; color: var(--pink); }
@keyframes caret-blink { 50% { opacity: 0; } }
.composing-bubble {
  position: absolute; z-index: 3; transform: translate(-50%, -100%); padding: 2px 10px; border-radius: 10px; pointer-events: none;
  font: 700 calc(var(--type-size) * .6)/1.4 var(--font-mono); background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary);
  white-space: nowrap;
}
.focus-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; z-index: 5;
  background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(3px); font-weight: 800; color: var(--ink); text-align: center; padding: 12px;
}
.typing-card.blurred .typing-text { filter: blur(4px); }
.hidden-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; font-size: 16px; }
.hint-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 40px; margin-top: 14px; font-weight: 700; color: var(--ink-soft); }
.finger-label { display: inline-flex; gap: 8px; align-items: center; }
.finger-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--fc, var(--primary)); border: 2px solid color-mix(in srgb, var(--fc) 60%, #000); flex: none; }
.key-seq { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.key-seq kbd.next { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.key-seq kbd.done { opacity: .45; }
.energy { display: grid; gap: 4px; margin-bottom: 12px; }
.energy-bar { height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.energy-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--pink)); transition: width .2s; }
.energy-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.timer-low { color: var(--bad); }

/* drawer (lesson list) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(5, 8, 18, .45); z-index: 60; animation: fade-in .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 61; background: var(--surface); border-left: var(--border-w) solid var(--line-strong);
  box-shadow: -20px 0 50px rgba(0, 0, 0, .35); padding: 16px; overflow: auto; animation: drawer-in .22s ease-out;
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.drawer-list a, .drawer-list span.dl-locked {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink);
  border: var(--border-w) solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 14px;
}
.drawer-list a[aria-current="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.drawer-list span.dl-locked { opacity: .55; }
.drawer-list .dl-code { font: 800 12px/1 var(--font-mono); color: var(--primary); }
.drawer-list .dl-state { font-size: 12px; color: var(--ink-faint); display: flex; gap: 1px; align-items: center; }
.drawer-list .dl-state .ic { width: 14px; height: 14px; color: var(--star); }

/* ============================================================ on-screen keyboard + hands */
.kb-wrap { margin-top: 16px; display: grid; gap: 10px; justify-items: center; }
.kb { display: grid; gap: 6px; width: min(860px, 100%); user-select: none; }
.kb-row { display: flex; gap: 6px; justify-content: center; }
.key {
  flex: 1 1 0; min-width: 0; height: 46px; border-radius: var(--r-key); display: grid; place-items: center; position: relative;
  font: 700 15px/1 var(--font-mono); color: var(--key-ink); background: var(--key-bg);
  border: 1px solid var(--line); border-bottom: 4px solid var(--fcol, var(--line-strong)); transition: transform .08s, background .12s, box-shadow .12s;
}
html[data-theme="cute"] .key { background: var(--fcol, var(--key-bg)); border: 2px solid rgba(43, 35, 80, .12); border-bottom-width: 4px; }
.key small { position: absolute; top: 4px; left: 6px; font-size: 10px; opacity: .7; }
.key.w15 { flex-grow: 1.5; } .key.w175 { flex-grow: 1.75; } .key.w2 { flex-grow: 2.1; } .key.w225 { flex-grow: 2.3; } .key.w6 { flex-grow: 6.5; }
.key.home { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--fcol) 70%, transparent); }
html[data-theme="cute"] .key.home { box-shadow: inset 0 0 0 2px rgba(43, 35, 80, .28); }
.key.bump::after { content: ""; position: absolute; bottom: 7px; width: 12px; height: 2px; border-radius: 2px; background: currentColor; opacity: .8; }
.key.next { background: var(--fcol); color: #0B1020; transform: translateY(-2px); z-index: 1; }
html[data-theme="neon"] .key.next { box-shadow: 0 0 0 2px var(--fcol), 0 0 20px var(--fcol); }
html[data-theme="cute"] .key.next { background: var(--primary); color: #fff; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(91, 75, 219, .28); }
.key.press-ok { transform: translateY(2px); }
.key.press-bad { background: var(--bad) !important; color: #fff !important; }
.key.f-pinky { --fcol: var(--f-pinky); } .key.f-ring { --fcol: var(--f-ring); } .key.f-middle { --fcol: var(--f-middle); }
.key.f-indexL { --fcol: var(--f-indexL); } .key.f-indexR { --fcol: var(--f-indexR); } .key.f-thumb { --fcol: var(--f-thumb); }
.hands { width: min(560px, 100%); height: auto; }
.hands .finger { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1.5; transition: fill .15s; }
.hands .palm { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.hands .finger.on { fill: var(--fcol); stroke: var(--ink); stroke-width: 2.2; }
html[data-theme="neon"] .hands .finger.on { filter: drop-shadow(0 0 8px var(--fcol)); }
.hands .finger.f-pinky { --fcol: var(--f-pinky); } .hands .finger.f-ring { --fcol: var(--f-ring); } .hands .finger.f-middle { --fcol: var(--f-middle); }
.hands .finger.f-indexL { --fcol: var(--f-indexL); } .hands .finger.f-indexR { --fcol: var(--f-indexR); } .hands .finger.f-thumb { --fcol: var(--f-thumb); }
.finger-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.finger-legend span { display: inline-flex; gap: 5px; align-items: center; }

/* ============================================================ results */
.result-modal .rm-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; }
.big-stat { background: var(--surface-2); border-radius: 16px; padding: 12px; text-align: center; border: 1px solid var(--line); }
.big-stat b { display: block; font: 800 34px/1.05 var(--font-display); font-variant-numeric: tabular-nums; color: var(--primary); }
.big-stat span { font-size: 12px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.stars-row { display: flex; justify-content: center; gap: 10px; margin: 4px 0 10px; }
.stars-row .ic { width: 52px; height: 52px; color: var(--line-strong); }
.stars-row .ic.on { color: var(--star); animation: star-pop .45s var(--ease-pop) both; }
html[data-theme="neon"] .stars-row .ic.on { filter: drop-shadow(0 0 10px rgba(252, 211, 77, .6)); }
.stars-row .ic.on:nth-child(2) { animation-delay: .12s; } .stars-row .ic.on:nth-child(3) { animation-delay: .24s; }
@keyframes star-pop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.result-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; font-size: 14px; }
.result-lines div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.result-lines b { font-variant-numeric: tabular-nums; }
.result-msg { text-align: center; font-weight: 800; font-size: 18px; margin: 0 0 6px; }
.reward-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* ============================================================ tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { background: var(--surface-2); font-weight: 800; color: var(--ink-soft); position: sticky; top: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: var(--surface-2); }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-faint); font-weight: 700; border: 2px dashed var(--line); border-radius: 16px; }

/* ============================================================ responsive */
@media (max-width: 1240px) {
  .site-nav span { display: none; }
  .site-nav a { padding: 8px 10px; }
}
@media (max-width: 960px) {
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-hero { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .site-nav, .header-tools #btn-sound, .header-tools #btn-theme, .header-tools .profile-chip { display: none; }
  .header-tools .menu-btn { display: inline-grid; }
  .site-header { min-height: 58px; padding: 8px 12px; }
  .brand-text { font-size: 17px; }
  .banners { top: 58px; }
  .mobile-menu { inset: 60px 8px auto 8px; }
  .tools-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .screen { padding: 16px 12px 8px; }
  .practice { padding: 10px 10px 8px; }
  .typing-card { padding: 18px 16px; }
  .pb-stat { min-width: 52px; }
  .course-head { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-modal .rm-hero { grid-template-columns: 1fr 1fr 1fr; }
  .big-stat b { font-size: 26px; }
  .stars-row .ic { width: 40px; height: 40px; }
  .site-footer { flex-direction: column; }
  .footer-keys { display: none; }
  .key { height: 34px; font-size: 12px; }
  .kb { gap: 4px; } .kb-row { gap: 4px; }
  .today-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.is-phone .hands, body.is-phone .finger-legend { display: none; }
  :root { --type-size: 22px; }
}
@media (max-width: 400px) {
  .lesson-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lesson-tile { padding: 10px; min-height: 92px; }
}

/* ============================================================ motion / print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
}
@media print {
  .site-header, .site-footer, .banners, .toasts, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ============================================================ command palette */
.modal.palette { width: min(620px, 100%); align-self: start; margin-top: 8vh; }
.palette-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; display: grid; gap: 2px; }
.palette-list li[role="option"] { padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.palette-list li[role="option"]:hover { background: var(--surface-2); }
.palette-list li.on { background: var(--primary-soft); color: var(--primary); }

/* ============================================================ charts */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-faint); font-size: 11px; font-weight: 700; }
.chart .axis-title { fill: var(--ink-soft); font-size: 11px; font-weight: 800; }
.chart .series-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { opacity: .12; }
.chart .err-dot { fill: var(--bad); }
.chart .bar { rx: 4; }
.chart-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chart-legend button { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 13px; color: var(--ink-soft); min-height: 32px; }
.chart-legend button[aria-pressed="false"] { opacity: .5; text-decoration: line-through; }
.chart-legend i { width: 12px; height: 4px; border-radius: 2px; background: var(--sc); display: inline-block; }
.heat-kb { display: grid; gap: 4px; }
.heat-kb .kb-row { gap: 4px; }
.heat-kb .key { height: 38px; border-bottom-width: 1px; font-size: 13px; background: color-mix(in srgb, var(--bad) var(--heat, 0%), var(--surface-2)); color: var(--ink); }
html[data-theme="cute"] .heat-kb .key { background: color-mix(in srgb, var(--bad) var(--heat, 0%), #fff); border: 1px solid var(--line); }
.heat-kb .key.none { opacity: .45; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-faint); font-weight: 700; margin-top: 8px; }
.heat-legend .scale { width: 120px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-2), var(--bad)); border: 1px solid var(--line); }

/* ============================================================ round-1 visual fixes */
@media (max-width: 767px) {
  .practice-bar .pb-title { flex: 1 1 calc(100% - 110px); }
  .practice-bar .pb-live { flex: 1 1 100%; justify-content: space-around; order: 5; border-top: 1px solid var(--line); padding-top: 6px; }
  .practice-bar .pb-live .pb-stat:first-child { border-left: 0; }
  .practice-bar .pb-count { margin-right: auto; }
  .hub-today .row-between { flex-wrap: nowrap; }
  .hub-today .row-between h2 { font-size: 19px; }
}

.chart-legend .scale-btn { margin-left: auto; opacity: 1 !important; text-decoration: none !important; }
.chart-legend .scale-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); border-color: transparent; }


/* phase-2 QA fixes: phones show only the next-key hint (L-22b), never the full on-screen keyboard */
body.is-phone:not(.has-physical-kb) .kb-wrap { display: none; }
@media (max-width: 767px) { .key small { display: none; } }

