
    :root { color-scheme:dark; --bg:#0a0f1d; --pane:#141d30; --pane-2:#19243a; --line:#303d55; --sub:#a1adc5; --muted:#72809a; --text:#f2f6ff; --mint:#4ae2c2; --blue:#7b97ff; --violet:#b29aff; --amber:#ffd078; --red:#ff8492; --white-width:42px; --black-width:25px; --radius:20px; }
    * { box-sizing:border-box; }
    html { scroll-behavior:smooth; }
    body { margin:0; min-height:100vh; background:radial-gradient(ellipse 70% 38% at 50% -7%, #202c58 0%, transparent 68%), var(--bg); color:var(--text); font-family:-apple-system, BlinkMacSystemFont,'Segoe UI','Hiragino Kaku Gothic ProN','Noto Sans JP',Meiryo,sans-serif; -webkit-font-smoothing:antialiased; }
    button, input { font:inherit; }
    button { cursor:pointer; }
    button:disabled { cursor:not-allowed; opacity:.43; }
    button:focus-visible, input:focus-visible { outline:3px solid var(--amber); outline-offset:3px; }
    .shell { max-width:1070px; margin:0 auto; padding:20px clamp(15px,3.4vw,34px) calc(34px + env(safe-area-inset-bottom)); }
    .topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 0 25px; }
    .brand { border:0; display:flex; align-items:center; gap:11px; background:none; color:inherit; padding:0; text-align:left; }
    .logo { width:39px; height:39px; border-radius:13px; display:grid; place-items:center; background:linear-gradient(145deg,var(--mint),var(--blue)); color:#111c32; font-size:24px; font-weight:800; box-shadow:0 8px 32px #4ae2c22a; }
    .brand b { font-size:16px; letter-spacing:.10em; display:block; font-weight:780; }
    .brand small { font-size:10px; letter-spacing:.16em; color:var(--sub); }
    .toplinks { display:flex; gap:8px; align-items:center; }
    .mini-button { background:#1b2840; border:1px solid #35435e; color:#d7e0f5; padding:10px 12px; border-radius:12px; line-height:1; font-size:12px; }
    .mini-button:hover { background:#263653; }
    .eyebrow { color:var(--mint); font-size:11px; letter-spacing:.16em; font-weight:800; text-transform:uppercase; }
    h1,h2,h3,p { margin-top:0; }
    .hero { display:grid; grid-template-columns:1.3fr .7fr; gap:18px; align-items:stretch; margin-bottom:29px; }
    .hero-copy { padding:26px 0 10px; }
    h1 { font-size:clamp(29px,4.6vw,50px); letter-spacing:-.06em; line-height:1.22; margin:15px 0 17px; }
    .grad { background:linear-gradient(95deg,#dffaff,#76ddff 45%,#a8a6ff); -webkit-background-clip:text; background-clip:text; color:transparent; }
    .lead { color:var(--sub); font-size:14px; line-height:1.9; max-width:540px; margin-bottom:0; }
    .hero-art { position:relative; isolation:isolate; min-height:200px; background:radial-gradient(ellipse at 50% 95%,#324a75 0,transparent 70%),linear-gradient(145deg,#17213a,#111827); border:1px solid #2e405f; border-radius:24px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
    .orb { width:175px;height:175px;border-radius:50%;border:1px solid #6281a855;display:grid;place-items:center;box-shadow:0 0 0 25px #83a6e30b,0 0 0 58px #83a6e30b,inset 0 0 70px #344e8650; }
    .orb .chord-symbol { font-size:42px; font-weight:800; color:#d6f9ef; letter-spacing:-.06em; }
    .floating-label { position:absolute; background:#1c3048e8; border:1px solid #6485a05e; border-radius:10px; padding:7px 11px; font-size:11px; color:#bad8ee; }
    .floating-label.a { top:22px;right:17px; }.floating-label.b { left:14px;bottom:21px; }
    .section-title { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px; }
    h2 { font-size:19px; letter-spacing:-.025em; margin-bottom:0; }
    .subtle { color:var(--sub); font-size:12px; }
    .grid-modes { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px; }
    .mode-card { position:relative; display:flex; gap:16px; flex-direction:column; text-align:left; min-height:212px; padding:20px; color:var(--text); background:linear-gradient(153deg,#1b2942,#121d30); border:1px solid #31405b; border-radius:20px; transition:transform .2s,border-color .2s,background .2s; overflow:hidden; }
    .mode-card:hover { transform:translateY(-3px); border-color:#647ca6; background:linear-gradient(153deg,#233451,#15233c); }
    .mode-card:active { transform:translateY(0); }
    .mode-top { display:flex;justify-content:space-between;align-items:center; }
    .mode-icon { width:49px;height:49px;display:grid;place-items:center;background:#2c3c5c;border:1px solid #435979;border-radius:15px;font-size:26px; }
    .mode-arrow { color:#b3bfda; font-size:23px; }
    .mode-card h3 { margin:0 0 8px; font-size:18px; letter-spacing:-.02em; }
    .mode-card p { color:var(--sub);font-size:12px;line-height:1.75;margin:0; }
    .mode-bottom { margin-top:auto; display:flex;align-items:center;gap:11px;justify-content:space-between; color:#9fb0ce;font-size:11px; }
    .mode-level { color:var(--mint);font-weight:700; }
    .track { height:4px;background:#33415c;border-radius:3px;overflow:hidden;margin-top:10px; }
    .track .fill { height:100%;background:linear-gradient(90deg,var(--mint),var(--blue));border-radius:3px; }
    .dashboard { border:1px solid #2b3953;border-radius:20px;background:#111a2c;margin-top:20px;padding:18px 20px;display:flex;gap:20px;align-items:center;justify-content:space-between; }
    .dashboard .stats { display:flex;gap:clamp(18px,3vw,36px); }
    .stat b { display:block;font-variant-numeric:tabular-nums;font-size:24px;line-height:1.2; }
    .stat small { color:var(--sub);font-size:11px; }
    .footnote { color:var(--muted);font-size:11px;text-align:center;margin-top:30px;line-height:1.8; }
    .game-toolbar { display:flex;gap:10px;justify-content:space-between;align-items:center;margin-bottom:17px; }
    .back { display:inline-flex;align-items:center;gap:7px;background:none;color:#b6c4dd;border:0;padding:10px 0;font-size:12px; }
    .back:hover { color:white; }
    .pill { border:1px solid #385270;border-radius:99px;padding:6px 10px;color:#ace8de;background:#16263c;font-size:11px;white-space:nowrap; }
    .game-title { display:flex;justify-content:space-between;align-items:flex-end;gap:8px;margin-bottom:17px; }
    .game-title h1 { font-size:clamp(21px,3.3vw,30px);margin:5px 0 2px;letter-spacing:-.03em; }
    .game-title .caption { color:var(--sub);font-size:12px;line-height:1.5; }
    .game-meta { display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end; }
    .question-card { position:relative;overflow:hidden;background:linear-gradient(135deg,#1a2943,#121c30);border:1px solid #334665;border-radius:22px;padding:22px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;margin-bottom:15px;min-height:158px; }
    .question-card:before { content:'';position:absolute;inset:auto -50px -160px 40%;height:240px;background:radial-gradient(ellipse,#4578b31b,transparent 70%);pointer-events:none; }
    .prompt-eyebrow {font-size:11px;color:#92d9df;font-weight:700;letter-spacing:.06em;margin-bottom:12px;}
    .question-card h2 {font-size:clamp(21px,4vw,32px);line-height:1.25;letter-spacing:-.04em;margin:0 0 9px;}
    .question-card p {font-size:12px;color:var(--sub);line-height:1.7;margin:0;max-width:420px;}
    .play-group { display:flex;flex-direction:column;align-items:center;gap:8px;justify-content:center;min-width:110px; }
    .play-button { width:76px;height:76px;display:grid;place-items:center;border-radius:50%;border:1px solid #6ae8d7aa;background:linear-gradient(150deg,#72ebd4,#4fc1b6);font-size:28px;color:#11313b;box-shadow:0 10px 32px #2aceb632;transition:transform .12s,filter .12s; }
    .play-button:hover:not(:disabled) {filter:brightness(1.08);transform:scale(1.03);}
    .play-group small { font-size:10px;color:#b9c8e0;text-align:center; }
    .wave { display:flex;gap:3px;align-items:center;height:34px;margin-top:10px; }
    .wave i { width:3px;background:#62d4c5;border-radius:3px;height:var(--h);opacity:.45;transform-origin:center; }
    .wave.on i { opacity:.95;animation:dance .42s ease-in-out infinite alternate;animation-delay:var(--d); }
    @keyframes dance { from{transform:scaleY(.3)}to{transform:scaleY(1.22)} }
    .answer-card { border-radius:22px;background:#131d30;border:1px solid #2d3d56;padding:20px; }
    .answer-header { display:flex;align-items:center;justify-content:space-between;gap:10px; margin-bottom:17px; }
    .answer-header strong {font-size:15px;}.answer-header small {font-size:11px;color:var(--sub);}
    .choices { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
    .choice { border:1px solid #3c4b67;background:#1d2a42;min-height:72px;border-radius:14px;color:#f0f5ff;font-size:20px;font-weight:700;letter-spacing:.01em;transition:background .12s,border-color .12s; }
    .choice:hover:not(:disabled) {background:#283c58;border-color:#6c85af;}
    .choice.right { background:#154a43;border-color:#52dac0;color:#c4fff3; }
    .choice.wrong { background:#56303d;border-color:#ed8b9f;color:#ffced8; }
    .choice.muted { opacity:.55; }
    .answer-actions {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:15px;}
    .text-button {border:0;color:#adbee0;background:none;font-size:12px;padding:10px 6px;}
    .text-button:hover:not(:disabled) {color:#fff;}
    .primary { border:0;border-radius:13px; padding:14px 23px; color:#071f2b;background:linear-gradient(110deg,#70ead4,#7aafef);font-size:13px;font-weight:800;min-height:45px; }
    .primary:hover:not(:disabled) {filter:brightness(1.09);}
    .primary:disabled { opacity:.4;}
    .secondary {border:1px solid #53698d;border-radius:12px;padding:11px 15px;background:#263751;color:#e1ecff;font-size:12px;}
    .secondary:hover:not(:disabled) {background:#2f4867;}
    .key-scroller { position:relative;overflow-x:auto;overflow-y:hidden;border-radius:13px;border:1px solid #46516c;scrollbar-color:#637895 #19243a;scrollbar-width:thin;overscroll-behavior-inline:contain; }
    .piano { position:relative;width:calc(52 * var(--white-width));height:168px;touch-action:pan-x;user-select:none; }
    .key {position:absolute;border:1px solid #748099;transition:background .06s; padding:0;touch-action:manipulation;}
    .key.white {z-index:1;left:calc(var(--white-index) * var(--white-width));width:var(--white-width);height:168px;border-radius:0 0 6px 6px;background:linear-gradient(#eff5ff,#cbd8e8);color:#53607b;}
    .key.white:hover:not(:disabled) { background:#c2e7e3; }
    .key.white.selected { background:linear-gradient(#a2f2df,#3fbdbe);color:#10333b;border-color:#398a88; }
    .key.black {z-index:2;left:calc((var(--white-index) + 1) * var(--white-width) - var(--black-width) / 2);width:var(--black-width);height:105px;border-radius:0 0 5px 5px;background:linear-gradient(#1c2737,#0a111d);border:1px solid #3a4455;box-shadow:0 4px 6px #0a13225c;color:#b6c7e5;}
    .key.black:hover:not(:disabled) {background:#364764;}
    .key.black.selected {background:linear-gradient(#9be4ff,#447ab6);color:#061e32;border-color:#80dbe6;}
    .key .keylabel {position:absolute;bottom:9px;left:0;right:0;font-size:10px;}
    .key.black .keylabel {font-size:9px;bottom:7px;}
    .key.correct.white {background:linear-gradient(#b5ffd3,#68caaa);}.key.correct.black {background:linear-gradient(#9cf1c8,#348474);}
    .key.incorrect {box-shadow:inset 0 0 0 3px #fa7d8f;}
    .piano-controls {display:flex;align-items:center;gap:8px;margin:10px 0 12px;justify-content:space-between;flex-wrap:wrap;}
    .piano-controls small {color:var(--sub);font-size:10px;}
    .octave {display:flex;gap:7px;}.octave button {font-size:11px;min-width:70px;}
    .selected-notes {min-height:32px;display:flex;flex-wrap:wrap;align-items:center;gap:6px;}
    .note-chip {padding:5px 9px;border-radius:8px;border:1px solid #3f6b86;background:#213d53;color:#b5f8ee;font-size:12px;}
    .note-placeholder {font-size:12px;color:var(--muted);}
    .voice-row {border:1px solid #35435d;background:#17233a;border-radius:14px;padding:12px 13px;margin-bottom:10px;}
    .voice-head {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;}
    .voice-head strong {font-size:12px;color:#d8e4fa;}.voice-meta {font-size:12px;font-variant-numeric:tabular-nums;color:#b6e9e3;}
    .voice-control {display:flex;align-items:center;gap:12px;}
    .voice-control input[type=range] {width:100%;height:24px;accent-color:#61dac6;cursor:ew-resize;touch-action:none;}
    .voice-preview {border:1px solid #456e81;color:#b7f2e5;background:#213c51;border-radius:10px;height:36px;min-width:44px;}
    .voice-preview:hover {background:#2d5262;}
    .info {font-size:11px;color:#aebdd9;line-height:1.75;}
    .result {margin-top:15px;border-radius:18px;padding:18px;border:1px solid #49607a;background:#19263b;}
    .result.success {border-color:#286b66;background:#14322f;}
    .result.fail {border-color:#735568;background:#302337;}
    .result h3 {font-size:19px;margin:0 0 6px;}.result p {color:#c7d3e5;font-size:12px;line-height:1.7;margin:0 0 10px;}
    .result-data {display:flex;flex-wrap:wrap;gap:7px;margin:10px 0 6px;}
    .result-note {display:inline-block;border-radius:8px;padding:6px 10px;font-size:12px;background:#294253;border:1px solid #426475;color:#e1f8f1;}
    .result-more {font-size:11px;color:#d2def2;line-height:1.75;margin:10px 0 0;}
    .result-actions {display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;margin-top:15px;}
    .settings {max-width:700px;margin:10px auto;}
    .settings h1 {font-size:29px;}
    .setting-card {padding:20px;border-radius:20px;border:1px solid #35435e;background:#18233a;margin:14px 0;}
    .setting-card h3 {font-size:15px;margin:0 0 12px;}
    .setting-card p {font-size:12px;color:var(--sub);line-height:1.7;margin:0 0 12px;}
    .segment {display:flex;gap:6px;background:#101a2c;border-radius:12px;padding:5px;}
    .segment button {flex:1;border:0;border-radius:9px;background:none;color:#aab6cb;padding:11px 8px;font-size:12px;font-weight:700;}
    .segment button.active {background:#304460;color:#f3f7ff;}
    .level-picker {display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
    .level-picker button {border:1px solid #445577;background:#192941;color:#d9e7ff;padding:11px 8px;border-radius:10px;font-size:12px;}
    .level-picker button.active {background:#235a59;border-color:#5fe3cc;color:#e9fff9;}
    .setting-label {font-size:12px;color:#d2ddf1;display:flex;justify-content:space-between;align-items:center;gap:12px;}
    .setting-label input {width:54%;accent-color:var(--mint);}
    .toggle-row {display:flex;gap:12px;align-items:center;font-size:12px;color:#d7e5f8;margin-top:14px;}
    .toggle-row input {accent-color:var(--mint);width:17px;height:17px;}
    .danger {color:#ffb9c5;border-color:#8b4e65;background:#3b2335;}
    .hidden {display:none!important;}
    
    .mini-button{position:relative;display:grid;place-items:center;min-width:48px;min-height:48px;border-radius:15px;background:linear-gradient(180deg,#152238,#111829);border:1px solid #33435e;box-shadow:inset 0 1px 0 #ffffff0f,0 10px 30px #0408121a;transition:transform .14s ease,background .18s ease,border-color .18s ease,box-shadow .18s ease;}
    .mini-button:hover{background:linear-gradient(180deg,#1d2d47,#162033);border-color:#4e6285;box-shadow:inset 0 1px 0 #ffffff14,0 14px 36px #04081224;}
    .mini-button:active{transform:translateY(1px) scale(.985);}
    .mini-button .icon{width:20px;height:20px}
    .settings-trigger{color:#e9f1ff}
    .settings-overlay{position:fixed;inset:0;z-index:70;display:flex;align-items:flex-end;justify-content:center;padding:18px;pointer-events:auto}
    .settings-scrim{position:absolute;inset:0;border:0;background:rgba(3,6,12,.56);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
    .settings-panel{position:relative;z-index:1;width:min(100%,520px);max-height:min(84dvh,760px);overflow:auto;border:1px solid #31415c;border-radius:24px;background:linear-gradient(180deg,#131b2d,#0f1524);box-shadow:0 28px 90px #0009,inset 0 1px 0 #ffffff10;padding:14px 14px 16px}
    .settings-handle{width:56px;height:5px;border-radius:999px;background:#c6d4f51f;margin:2px auto 14px}
    .settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:0 2px 8px}
    .settings-kicker{display:block;color:#8ea1c8;font-size:10px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;margin-bottom:6px}
    .settings-head h2{margin:0;font-size:24px;letter-spacing:-.03em}
    .settings-head p{margin:6px 0 0;color:var(--sub);font-size:12px;line-height:1.6}
    .settings-close{width:44px;height:44px;border-radius:14px;border:1px solid #32435f;background:#151f31;color:#e6edff;display:grid;place-items:center;box-shadow:inset 0 1px 0 #ffffff0d}
    .settings-close:hover{background:#1c2940;border-color:#506789}
    .settings-body{padding-top:2px}
    .settings-body .setting-card{margin:0 0 10px;border-radius:18px;background:linear-gradient(180deg,#171f31,#121a2a);border:1px solid #2f405d;box-shadow:inset 0 1px 0 #ffffff09}
    .settings-body .setting-card h3{font-size:14px;letter-spacing:.01em;margin-bottom:10px}
    .settings-body .setting-card p{color:var(--sub)}
    .settings-body .segment{padding:4px;border-radius:13px;background:#0d1320;border:1px solid #26344d}
    .settings-body .segment button{min-height:40px;border-radius:10px;transition:background .15s ease,color .15s ease,transform .12s ease}
    .settings-body .segment button:active{transform:translateY(1px)}
    .settings-body .segment button.active{background:linear-gradient(180deg,#31466f,#293d61);box-shadow:inset 0 1px 0 #ffffff0f}
    .settings-body .level-picker button{min-height:58px;border-radius:13px;box-shadow:inset 0 1px 0 #ffffff08}
    .settings-body .level-picker button.active{background:linear-gradient(180deg,#2a5f5d,#1f4747)}
    .settings-body .setting-label{align-items:center;gap:10px;flex-wrap:wrap}
    .settings-body .setting-label label{font-weight:700;color:#e4ecfb}
    .settings-body .setting-label input{flex:1;min-width:160px;width:auto}
    .settings-body .setting-label span{min-width:40px;text-align:right}
    .settings-open{overflow:hidden}
    .settings-open .topbar{position:relative;z-index:72;isolation:isolate}
    .settings-backdrop-safe{position:fixed;inset:0}

    @media(max-width:680px) {
      :root {--white-width:36px;--black-width:22px;}
      .shell {padding:14px 13px calc(26px + env(safe-area-inset-bottom));}
      .topbar {padding-bottom:14px;}
      .toplinks {gap:6px;}.mini-button {padding:9px 10px;min-width:44px;min-height:44px;border-radius:14px;} .settings-overlay{padding:12px;} .settings-panel{max-height:min(88dvh,760px);border-radius:22px;} .settings-head h2{font-size:21px;}
      .hero {grid-template-columns:1fr;gap:13px;margin-bottom:22px;}.hero-copy {padding:11px 1px 0;}.hero-art {min-height:0;height:125px;}.orb {width:91px;height:91px;box-shadow:0 0 0 18px #83a6e30b,0 0 0 38px #83a6e30b;}.orb .chord-symbol {font-size:27px;}
      .floating-label.a {top:12px;right:13px;}.floating-label.b {bottom:11px;left:13px;}
      .grid-modes {gap:10px;}.mode-card {padding:14px;min-height:206px;gap:12px;}.mode-icon {width:42px;height:42px;font-size:23px;}.mode-card h3 {font-size:15px;}.mode-card p {font-size:11px;line-height:1.65;}.mode-bottom {font-size:10px;}
      .dashboard {padding:16px;display:block;}.dashboard .stats {justify-content:space-between;margin-top:10px;}.dashboard .stat b {font-size:20px;}
      .question-card {padding:16px;grid-template-columns:1fr 80px;min-height:138px;}.question-card h2 {font-size:21px;}.question-card p {font-size:11px;}.play-group {min-width:0;}.play-button {width:61px;height:61px;font-size:25px;}
      .answer-card {padding:14px;}.answer-header {margin-bottom:13px;}.answer-header strong {font-size:14px;}.answer-header small {font-size:10px;}
      .choice {min-height:65px;font-size:17px;}.game-title {align-items:center;}.game-title h1 {font-size:21px;}.game-meta {max-width:140px;}
      .piano {height:144px;}.key.white {height:144px;}.key.black {height:87px;}
      .setting-card {padding:15px;}
      .game-toolbar {margin-bottom:8px;}
      .game-title {margin-bottom:10px;}
      .question-card {padding:14px;min-height:120px;margin-bottom:10px;}
      .wave {margin-top:5px;}
      .answer-card {padding:12px;}
      .answer-header {margin-bottom:10px;}
      .voice-row {padding:9px 11px;margin-bottom:8px;}
      .voice-head {margin-bottom:6px;}
      .voice-control input[type=range] {height:22px;}
      .answer-actions {margin-top:11px;}
      .footnote {margin-top:22px;}
    }
    @media(max-width:370px) { .mode-card h3 {font-size:13px;}.mode-card {padding:12px;}.question-card {grid-template-columns:1fr 69px;}.play-button {width:54px;height:54px;} }
    @media(prefers-reduced-motion:reduce) {*,*:before,*:after {animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important;} }

    /* Chord Lab v0.2: dense, thumb-first UI inspired by user-supplied v2 */
    :root { --bg:#11151c; --pane:#1b222d; --pane-2:#222d3d; --line:#344252; --sub:#adbbcc; --muted:#8494a9; --text:#edf4ff; --mint:#41d2c6; --blue:#7098ff; --amber:#ffcb80; --white-width:42px; --black-width:25px; --radius:15px; }
    :root[data-theme="light"] { color-scheme:light; --bg:#f3f5f9; --pane:#fff; --pane-2:#f7faff; --line:#d5dce6; --sub:#5b6675; --muted:#687888; --text:#16202a; --mint:#148f84; --blue:#426fee; --amber:#bd7116; }
    body { min-height:100dvh; background:var(--bg); }
    .shell { max-width:820px; min-height:100dvh; display:flex;flex-direction:column; padding:12px 16px calc(9px + env(safe-area-inset-bottom)); }
    .topbar { flex:none; padding:0 0 10px; min-height:43px; }
    .logo { width:33px;height:33px;border-radius:10px;font-size:20px;box-shadow:none; }
    .brand b { font-size:15px; letter-spacing:.04em; }.brand small { font-size:9px;letter-spacing:.08em; }
    .mini-button { padding:9px 11px;min-height:38px;border-radius:11px; }
    #root { flex:1;min-height:0; }
    .footnote { flex:none;margin:8px 0 0;font-size:10px;line-height:1.25; }
    .home-screen {display:flex; flex-direction:column;gap:9px;}
    .hero { display:block;margin:0; }
    .hero-copy {padding:0;}.hero .eyebrow{font-size:10px;letter-spacing:.06em;}
    .hero h1 {font-size:clamp(23px,4vw,29px);letter-spacing:-.04em;margin:4px 0 3px;line-height:1.32;}
    .hero .lead {font-size:11px;line-height:1.45;max-width:none;}
    .hero-art{display:none;}.section-title{margin:3px 0 0;}.section-title h2{font-size:13px;}.section-title .subtle{font-size:10px;}
    .grid-modes { display:grid;grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(75px,1fr)); gap:9px;flex:1; }
    .mode-card { min-height:75px; padding:13px 15px; display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;background:var(--pane);border:1.4px solid var(--line);border-left:5px solid var(--mode-accent);border-radius:14px;box-shadow:none; }
    .mode-card:before{ content:'';position:absolute;inset:0;background:linear-gradient(90deg,var(--mode-tint),transparent 70%);pointer-events:none;opacity:.7; }
    .mode-card:hover {border-color:var(--mode-accent);background:var(--pane-2);transform:none;}
    .mode-card:active {transform:scale(.992)}
    .mode-text, .mode-side{position:relative;z-index:1;}
    .mode-text h3{font-size:clamp(15px,3.7vw,20px);font-weight:750;margin:0 0 3px;}
    .mode-text p{font-size:11px;line-height:1.35;margin:0;color:var(--sub)}
    .mode-side{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:3px;min-width:65px;}
    .mode-side b{font-size:16px;color:var(--mode-accent)}.mode-side small{font-size:10px;color:var(--sub);font-weight:500;white-space:nowrap;}
    .dashboard {margin:0;padding:10px 13px;border-color:var(--line);border-radius:14px;background:var(--pane);gap:8px;}
    .quick-level{display:flex;align-items:center;gap:8px;min-height:39px;}
    .quick-level label{font-size:11px;color:var(--sub);white-space:nowrap;}
    .quick-buttons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;flex:1;}
    .quick-buttons button{border:1px solid var(--line);background:var(--pane);border-radius:10px;min-height:35px;padding:4px 0;color:var(--text);font-size:12px;}
    .quick-buttons button.active{background:linear-gradient(110deg,#4774ed,#199e96);color:#fff;border-color:transparent;}
    :root[data-theme="light"] .result.success{background:#e7f7ed;}
    :root[data-theme="light"] .result.fail{background:#fff0f0;}
    :root[data-theme="light"] .result p,:root[data-theme="light"] .result-more{color:#394758;}
    :root[data-theme="light"] .mode-text h3{color:#19283b;}
    .dashboard .stats {gap:clamp(12px,4vw,34px);}.dashboard .stat b{font-size:20px;}.dashboard .stat small{font-size:10px;}.dashboard-intro{color:var(--sub);font-size:11px;}
    .game-screen{max-width:680px;width:100%;margin:0 auto;display:flex;flex-direction:column;gap:9px;}
    .game-toolbar{margin:0;flex:none;display:flex;gap:10px;min-height:38px;}
    .game-toolbar .back{border:1px solid var(--line);background:var(--pane);border-radius:11px;min-width:46px;height:42px;justify-content:center; padding:4px 10px;font-size:15px;color:var(--text);}
    .game-heading{flex:1;min-width:0;display:flex;justify-content:space-between;align-items:center;gap:8px;}
    .game-heading strong{font-size:17px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.game-heading .pill{font-size:12px;font-weight:750;}
    .pill{border:0;background:color-mix(in srgb,var(--blue) 16%,transparent);color:var(--blue);}
    .question-card{padding:0;margin:0;min-height:0;display:block;flex:none;border:0;background:none;border-radius:0;}
    .question-card:before{display:none;}
    .listen-button{display:flex;width:100%;justify-content:center;align-items:center;gap:12px;min-height:64px;padding:10px 14px;border:0;border-radius:13px;color:#fff;background:linear-gradient(110deg,#4774ed,#199e96);font-size:20px;font-weight:750;box-shadow:0 3px 10px #4774ed24;}
    .listen-button:disabled{filter:grayscale(.5);}
    .listen-button small{font-size:11px;font-weight:500;opacity:.85}
    .build-prompt{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:64px;border-radius:13px;background:var(--pane);border:1px solid var(--line);}
    .build-prompt h2{font-size:29px;color:var(--blue);margin:0}.build-prompt small{font-size:10px;color:var(--sub)}
    .answer-card { flex:1;min-height:0;padding:12px;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;background:var(--pane); }
    #answerPane{flex:1;min-height:0;display:flex;flex-direction:column;gap:9px;}
    .answer-header{margin:0;flex:none;gap:8px;}.answer-header strong{font-size:12px;}.answer-header small{font-size:10px;color:var(--sub);}
    .choices { flex:1;min-height:0;gap:9px; }
    .choice{border:1px solid var(--line);border-radius:13px;background:var(--pane-2);color:var(--text);min-height:68px;font-size:clamp(20px,5vw,27px);}
    .choice:hover:not(:disabled){background:color-mix(in srgb,var(--blue) 18%,var(--pane));}
    .key-scroller{flex:none;border:2px solid var(--line);border-radius:12px;}
    .piano{height:min(33dvh,290px)}
    .key.white{height:100%;}.key.black{height:61%;}
    .piano-controls{margin:0;}.piano-controls small{font-size:10px;}
    .selected-notes{flex:1;min-height:38px;justify-content:center;align-content:center;}.note-placeholder{font-size:13px;text-align:center}.note-chip{font-size:15px;padding:7px 11px}.answer-actions{margin-top:auto;gap:8px;}
    .primary{background:linear-gradient(110deg,#4774ed,#199e96);color:white;border-radius:12px;min-height:47px;font-size:14px;}
    .secondary{border-color:var(--line);background:var(--pane-2);color:var(--text);border-radius:12px;min-height:43px;}
    .pitch-grid{flex:1;min-height:215px;display:flex;gap:8px;}
    .pitch-voice{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;}
    .pitch-voice header{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:39px;}
    .pitch-voice header strong{font-size:10px;color:var(--sub);letter-spacing:.05em;}
    .pitch-voice header .voice-meta{font-size:11px;line-height:1.2;white-space:nowrap;color:var(--text);font-variant-numeric:tabular-nums;}
    .pitch-track{touch-action:none;position:relative;flex:1;min-height:150px;border:1.5px solid var(--line);border-radius:12px;background:var(--pane-2);overflow:hidden;cursor:ns-resize;outline:none;}
    .pitch-track:focus-visible,.pitch-track.active{outline:2px solid var(--blue);outline-offset:1px;}
    .pitch-track:before{position:absolute;inset:0;content:'';background:repeating-linear-gradient(to top, transparent 0 23%,color-mix(in srgb,var(--line) 65%,transparent) 23.15% 23.4%,transparent 23.5% 25%);pointer-events:none;}
    .pitch-fill{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(0deg,color-mix(in srgb,var(--blue) 16%,transparent),color-mix(in srgb,var(--mint) 37%,transparent));border-top:2px solid var(--mint);pointer-events:none;}
    .pitch-track[aria-disabled="true"]{opacity:.76;cursor:default;}
    .pitch-preview{min-height:36px;max-height:36px;width:100%;font-size:15px;padding:3px;border:1px solid var(--mint);border-radius:10px;background:color-mix(in srgb,var(--mint) 12%,var(--pane));color:var(--text);}
    .pitch-nudge{flex:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
    .pitch-nudge button{font-size:12px;font-weight:700;min-height:36px;border-radius:10px;border:1px solid var(--line);background:var(--pane-2);color:var(--text);padding:4px;}
    .pitch-nudge button.up{border-color:#cb9e4a;color:var(--amber);}
    .pitch-nudge button.down{border-color:#6f8cde;color:var(--blue);}
    .pitch-bottom{flex:none;display:grid;grid-template-columns:1fr 1fr;gap:8px;}
    .pitch-bottom button{min-height:46px;}
    .pitch-hint{font-size:10px;color:var(--sub);line-height:1.4;}
    .result{flex:none;max-width:100%;margin:0;border-radius:13px;padding:12px;border-color:var(--line);background:var(--pane);}
    .result.success{background:#17352f;}.result.fail{background:#33232b;}
    .result h3{font-size:17px;}.result p{font-size:11px;margin:0 0 6px;}.result-data{margin:5px 0;}.result-note{font-size:11px;padding:4px 8px;}.result-more{font-size:10px;}
    .result-actions{margin-top:8px;}.result-actions button{min-height:39px;}
    .game-screen.has-result{overflow-y:auto;}
    .game-screen.has-result .answer-card{flex:none;}
    .game-screen.has-result .pitch-grid{height:170px;}
    .settings{margin:0 auto;overflow-y:auto;max-width:680px;}.setting-card{background:var(--pane);border-color:var(--line);}
    .setting-card h3{color:var(--text)}
    @media(min-width:700px){ .home-screen{max-width:680px;margin:0 auto;width:100%;}.grid-modes{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,minmax(126px,1fr));}.mode-card{min-height:126px;} .home-screen .hero{margin-bottom:12px;} .pitch-grid{min-height:310px;} }
    @media(max-width:600px){
      .shell {padding:8px 12px calc(6px + env(safe-area-inset-bottom));}
      .topbar {padding-bottom:6px;min-height:39px;}
      .brand small {display:none;}
      .hero h1{font-size:22px;}.hero h1 br{display:none;}.hero .lead{display:none;}
      .section-title{display:none;}
      .grid-modes{gap:8px;grid-template-rows:repeat(4,minmax(69px,1fr));}
      .mode-card{min-height:69px;padding:10px 14px;}.mode-text p{font-size:11px;}
      .dashboard{padding:9px 12px}.dashboard-intro{display:none;}
      .quick-level label{font-size:10px;}
      .game-toolbar{min-height:40px;}.game-heading strong{font-size:16px;}
      .listen-button{min-height:58px;font-size:20px;}
      .build-prompt{min-height:58px;}.build-prompt h2{font-size:25px;}
      .answer-card{padding:10px;}.pitch-grid{min-height:190px;gap:6px;}.pitch-nudge{gap:5px;}.pitch-nudge button{min-height:34px;}
      .piano{height:min(37dvh,300px)}
      .piano-controls small{max-width:45%;}.octave button{padding:7px 9px;min-width:64px;}
      .footnote{display:none;}
    }
    @media(max-height:680px) and (max-width:600px){.hero .eyebrow{display:none}.hero h1{font-size:18px;margin:0}.answer-header small{display:none}.pitch-voice header{min-height:28px}.pitch-track{min-height:110px}.pitch-nudge button{min-height:29px}.pitch-preview{min-height:30px;max-height:30px}.mode-card{min-height:58px}.grid-modes{grid-template-rows:repeat(4,minmax(58px,1fr))}.mode-text h3{font-size:14px}.dashboard{padding:6px 9px}}

    /* Chord Lab v0.3: almost-black UI, fixed pitch ruler, same-pane review */
    :root{color-scheme:dark;--bg:#050506;--pane:#0e0f11;--pane-2:#16181b;--line:#292c32;--sub:#aeb4bf;--muted:#808793;--text:#f4f5f7;--mint:#5ed7b5;--blue:#83a8ff;--amber:#ddb17b;--radius:13px;}
    :root[data-theme="dark"]{color-scheme:dark;--bg:#050506;--pane:#0e0f11;--pane-2:#17191d;--line:#292c32;--sub:#aeb4bf;--muted:#808793;--text:#f4f5f7;--mint:#5ed7b5;--blue:#83a8ff;}
    :root[data-theme="light"]{--bg:#f4f5f6;--pane:#fff;--pane-2:#eceff3;--line:#cbd2dc;--sub:#58616e;--muted:#667483;--text:#15191e;--mint:#177d6c;--blue:#305cdc;}
    html,body{background:var(--bg)!important;}
    body{font-size:14px}
    .shell{max-width:820px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));min-height:100dvh;}
    .topbar{padding:0 0 9px;min-height:40px}
    .brand{gap:9px}.brand b{font-size:14px;letter-spacing:.09em}.brand small{display:none}
    .logo{width:31px;height:31px;background:#181b20;color:var(--mint);border:1px solid var(--line);border-radius:9px;box-shadow:none}
    .icon{width:19px;height:19px;display:inline-block;flex:none;vertical-align:middle}
    .logo .icon{width:21px;height:21px}
    .mini-button{display:grid;place-items:center;width:39px;height:38px;padding:0;border-radius:10px;color:var(--text);background:var(--pane);border:1px solid var(--line)}
    .mini-button:hover{background:var(--pane-2)}
    #root{min-height:0;flex:1}
    .home-screen{display:flex;flex-direction:column;gap:9px;max-width:660px;width:100%;margin:0 auto}
    .grid-modes{display:grid;flex:1;gap:8px;grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(76px,1fr));}
    .mode-card{display:grid;grid-template-columns:40px minmax(0,1fr) auto 15px;gap:10px;align-items:center;text-align:left;padding:10px 13px;min-height:76px;max-width:100%;background:var(--pane);border:1px solid var(--line);border-left:3px solid var(--mode-accent);border-radius:13px;box-shadow:none}
    .mode-card:hover{background:var(--pane-2);border-color:var(--mode-accent);transform:none}
    .mode-card:before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,var(--mode-tint),transparent 60%);pointer-events:none}
    .mode-icon-modern{z-index:1;display:grid;place-items:center;width:40px;height:40px;border:1px solid color-mix(in srgb,var(--mode-accent) 38%,var(--line));border-radius:11px;color:var(--mode-accent);background:color-mix(in srgb,var(--mode-accent) 10%,transparent)}
    .mode-text{z-index:1}.mode-text h3{margin:0;font-size:clamp(15px,3.6vw,18px);color:var(--text)}
    .mode-side{z-index:1;min-width:40px;display:flex;align-items:flex-end;gap:1px;flex-direction:column}.mode-side b{font-size:14px;color:var(--mode-accent)}.mode-side small{font-size:10px;color:var(--sub)}
    .mode-chevron{z-index:1;width:16px;height:16px;color:var(--muted)}
    .dashboard{margin:0;padding:8px 12px;border-radius:12px;background:var(--pane);border:1px solid var(--line)}
    .dashboard .stats{width:100%;gap:0;justify-content:space-around}.dashboard .stat{text-align:center}.dashboard .stat b{font-size:17px;color:var(--text)}.dashboard .stat small{font-size:10px}
    .quick-level{gap:7px}.quick-level label{font-size:11px}.quick-buttons button{background:var(--pane);border-color:var(--line);color:var(--text);min-height:37px}.quick-buttons button.active{background:#244785;color:#fff}
    .game-screen{max-width:680px;width:100%;margin:0 auto;display:flex;flex-direction:column;gap:8px;min-height:0;}
    .game-toolbar{min-height:37px;margin:0;flex:none}.game-toolbar .back{height:37px;min-width:40px;padding:0;border:1px solid var(--line);border-radius:10px;color:var(--text);background:var(--pane)}
    .game-heading strong{display:flex;align-items:center;gap:8px;font-size:15px}.game-heading strong .icon{width:19px;height:19px;color:var(--blue)}
    .pill{font-weight:700;font-size:11px;border:1px solid var(--line);border-radius:30px;padding:5px 10px;background:var(--pane-2);color:var(--sub)}
    .question-card{margin:0;border:0;background:none;min-height:0}.listen-button{min-height:53px;width:100%;border:1px solid #2d425b;border-radius:11px;background:#162235;color:#e9f0ff;font-size:16px;gap:9px;box-shadow:none;padding:10px 12px}
    .listen-button .icon{width:20px;height:20px}.listen-button small{font-size:11px;margin-left:auto;opacity:.85}.listen-button span{flex:1;text-align:left}
    :root[data-theme="light"] .listen-button{color:#fff;background:#345bb5}
    .build-prompt{min-height:52px;background:var(--pane);border:1px solid var(--line);border-radius:11px}.build-prompt h2{font-size:26px}
    .answer-card{flex:1;min-height:0;padding:10px;border-radius:12px;background:var(--pane);border:1px solid var(--line);display:flex;flex-direction:column}
    #answerPane{display:flex;flex-direction:column;flex:1;gap:8px;min-height:0}
    .choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;flex:1;min-height:150px}
    .choice{background:var(--pane-2);border:1px solid var(--line);color:var(--text);border-radius:10px;font-size:clamp(19px,5vw,25px);min-height:62px}
    .choice.right{background:#103c2f;border-color:#47bc99;color:#adf6df}.choice.wrong{background:#451d2a;border-color:#c86b7b;color:#ffe4eb}.choice.muted{opacity:.6}
    :root[data-theme="light"] .choice.right{color:#16563e;background:#d4f4e7}:root[data-theme="light"] .choice.wrong{color:#872536;background:#ffe1e5}
    .key-scroller{border:1px solid var(--line);border-radius:10px;scrollbar-color:#454b54 #111216}
    .piano{height:clamp(150px,32dvh,275px)}
    .key.white{height:100%;background:linear-gradient(#262a30,#191c22);border:1px solid #3a414c;color:#adb7c4}
    .key.black{height:61%;background:linear-gradient(#0d0f12,#020304);border:1px solid #16191e;color:#7d91a8;box-shadow:0 4px 7px #000a}
    .key.white:hover,.key.white:hover:not(:disabled){background:#333d4a}.key.black:hover,.key.black:hover:not(:disabled){background:#222b3c}
    .key.white.selected{background:linear-gradient(#4b719c,#234b7f);border-color:#6f9ed8;color:#fff}
    .key.black.selected{background:linear-gradient(#446a99,#18355d);border-color:#77b3ed;color:#fff}
    .key.correct.white{background:linear-gradient(#3f9478,#1f654c);color:#e4fff2;border-color:#67d2a6;}
    .key.correct.black{background:linear-gradient(#3c8a76,#164638);color:#e8fff7;border-color:#4ab990;}
    .key.incorrect{box-shadow:inset 0 0 0 3px #f57c8d}
    :root[data-theme="light"] .key.white{background:linear-gradient(#fff,#e1e6ee);border-color:#aab4c1;color:#566273}
    :root[data-theme="light"] .key.black{background:linear-gradient(#242934,#0c111a);border-color:#485569;color:#e3efff}
    :root[data-theme="light"] .key.white.selected{background:#8cb9ff;color:#0f2b4e}:root[data-theme="light"] .key.black.selected{background:#4d79ba}
    :root[data-theme="light"] .key.correct.white{background:#76d8b4;color:#0d3d2a}:root[data-theme="light"] .key.correct.black{background:#2b8066;color:#fff}
    .piano-controls{display:flex;flex:none;align-items:center;gap:9px;margin:0;justify-content:space-between;flex-wrap:nowrap}
    .octave{display:flex;gap:5px;flex:none}.octave button{min-width:42px;padding:5px 9px;min-height:36px}.octave .icon{width:17px;height:17px}
    .selected-notes{flex:1;display:flex;min-height:35px;justify-content:flex-end;overflow:hidden;flex-wrap:nowrap;gap:4px}.note-chip{border:1px solid var(--line);background:var(--pane-2);color:var(--text);padding:5px 7px;font-size:11px;white-space:nowrap}
    .answer-actions{display:flex;justify-content:space-between;margin-top:auto;gap:8px}
    .answer-actions .icon{width:15px;height:15px}
    .text-button{color:var(--sub);display:inline-flex;align-items:center;gap:5px;font-size:12px}
    .primary{background:#2f5aa0;color:#fff;border:0;min-height:43px;border-radius:10px;padding:10px 18px;font-size:13px;font-weight:750}
    .primary:hover{background:#4072bf}.secondary{background:var(--pane-2);border:1px solid var(--line);border-radius:10px;min-height:39px;color:var(--text);padding:8px 12px;font-size:12px}
    .secondary:hover{background:color-mix(in srgb,var(--blue) 12%,var(--pane-2))}
    .pitch-grid{flex:1;min-height:200px;display:flex;gap:7px}.pitch-voice{display:flex;flex-direction:column;flex:1;min-width:0;gap:5px}
    .pitch-voice header{min-height:22px;display:grid;place-items:center}.pitch-voice header strong{font-size:10px;color:var(--sub)}
    .pitch-track{position:relative;min-height:155px;flex:1;background:#121417;border:1px solid #30343b;border-radius:10px;overflow:hidden;touch-action:none;cursor:ns-resize}
    .pitch-track:before{display:none!important;content:none!important}
    :root[data-theme="light"] .pitch-track{background:#edf0f4;border-color:#b6c0cd}
    .pitch-track.active{outline:2px solid var(--blue);outline-offset:1px}
    .pitch-fill{position:absolute;left:0;right:0;bottom:0;pointer-events:none;border-top:2px solid #58c8b1;background:linear-gradient(0deg,#2c4b7220,#3b8b7d60)}
    .pitch-target{position:absolute;left:1px;right:1px;height:0;border-top:3px solid #ffcc71;z-index:3;pointer-events:none;filter:drop-shadow(0 0 4px #efaf45aa)}
    .pitch-target span{position:absolute;right:0;top:-7px;width:9px;height:9px;background:#ffcc71;border-radius:50%}
    .pitch-answer-name{font-size:10px;text-align:center;line-height:1.3;min-height:26px}.pitch-answer-name b{display:block;font-size:11px;color:#ffcc71}.pitch-answer-name small{color:var(--sub);font-size:9px}
    :root[data-theme="light"] .pitch-answer-name b{color:#ab6410}
    .pitch-preview{min-height:35px;max-height:35px;border:1px solid var(--line);background:var(--pane-2);color:var(--text);display:grid;place-items:center;border-radius:9px}
    .pitch-preview .icon{width:16px;height:16px}
    .pitch-nudge{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.pitch-nudge button{display:flex;align-items:center;justify-content:center;gap:3px;min-height:34px;padding:3px;border:1px solid var(--line);color:var(--text);background:var(--pane-2);font-size:11px;border-radius:9px}
    .pitch-nudge button .icon{width:13px;height:13px}.pitch-nudge button.up{color:var(--amber);border-color:var(--line)}.pitch-nudge button.down{color:var(--blue);border-color:var(--line)}
    .pitch-bottom{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pitch-bottom button{min-height:43px}.pitch-bottom .icon{width:17px;height:17px}
    .verdict{display:flex;gap:9px;align-items:center;justify-content:space-between;min-height:42px;padding:7px 10px;border-radius:10px;background:var(--pane-2);border:1px solid var(--line)}
    .verdict-title{display:inline-flex;gap:6px;align-items:center;font-weight:750;white-space:nowrap}.verdict .icon{width:17px;height:17px}.verdict strong{font-size:16px;white-space:nowrap}.verdict.success .verdict-title{color:#5bddac}.verdict.fail .verdict-title{color:#fb8b9b}.level-change{color:var(--sub);font-size:10px;white-space:nowrap}
    .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px}.result-actions button{display:flex;align-items:center;justify-content:center;gap:5px;min-height:41px}.result-actions .icon{width:17px;height:17px}
    .correct-piano{display:flex;flex-direction:column;gap:5px;min-height:0;flex:none}.correct-piano-label{font-size:10px;color:var(--sub)}
    .compact-scroller{border-color:var(--line)}.compact-piano{height:105px}.compact-piano .key.white{height:100%}.compact-piano .key.black{height:61%}
    .game-screen.has-result{overflow:visible}.game-screen.has-result .answer-card{flex:1;min-height:0}.game-screen.has-result .pitch-grid{height:clamp(150px,24dvh,260px);flex:none}
    .game-screen.has-result .choices{min-height:140px;flex:1}
    .settings{max-width:680px;margin:0 auto;overflow-y:auto}.setting-card{background:var(--pane);border:1px solid var(--line);border-radius:12px;padding:14px;margin:10px 0}.setting-card h3{color:var(--text);margin-bottom:9px}.settings h1{font-size:22px;margin:8px 0 10px}
    .segment{background:var(--pane-2)}.segment button{color:var(--sub)}.segment button.active{background:#273b63;color:#fff}
    .level-picker button{background:var(--pane-2);border-color:var(--line);color:var(--text)}.level-picker button.active{background:#244a44;color:#fff}
    .setting-label{color:var(--text)}.danger{background:#351e27;border-color:#6a3746;color:#ffd3d9}
    @media(min-width:700px){.home-screen{max-width:660px}.grid-modes{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(124px,1fr))}.mode-card{min-height:124px}.pitch-grid{min-height:320px}}
    @media(max-width:600px){.shell{padding:7px 10px calc(7px + env(safe-area-inset-bottom))}.topbar{padding-bottom:6px}.grid-modes{grid-template-rows:repeat(4,minmax(68px,1fr))}.mode-card{min-height:68px;padding:8px 10px}.dashboard{padding:7px 8px}.listen-button{min-height:50px}.answer-card{padding:8px}.piano{height:clamp(145px,32dvh,280px)}.compact-piano{height:92px}.pitch-grid{min-height:190px}.game-screen.has-result .pitch-grid{height:clamp(130px,22dvh,205px);min-height:0}.result-actions button{font-size:12px}}
    @media(max-height:680px) and (max-width:600px){.grid-modes{grid-template-rows:repeat(4,minmax(58px,1fr))}.mode-card{min-height:58px}.piano{height:clamp(128px,29dvh,185px)}.compact-piano{height:82px}.game-screen.has-result .pitch-grid{height:130px}.correct-piano-label{display:none}.verdict{min-height:36px;padding:5px 8px}.question-card .listen-button{min-height:43px}.answer-card{padding:7px}}
    @media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}
  

    /* v0.4 · tactile near-black instrument design */
    :root{--bg:#040405;--pane:#0d0e10;--pane-2:#141619;--line:#272a31;--text:#f6f7f9;--sub:#acb2c0;--blue:#92b6ff;--mint:#68e2c4}
    :root[data-theme="dark"]{--bg:#040405;--pane:#0d0e10;--pane-2:#141619;--line:#272a31;--text:#f6f7f9;--sub:#acb2c0;--blue:#92b6ff;--mint:#68e2c4}
    :root[data-theme="light"]{--bg:#f6f7f9;--pane:#fff;--pane-2:#f0f2f6;--line:#d5dbe5;--text:#151821;--sub:#5d6676;--blue:#305bc9;--mint:#178575}
    button{-webkit-tap-highlight-color:transparent;touch-action:manipulation;position:relative;isolation:isolate;overflow:hidden;transition:background-color .17s ease,border-color .17s ease,box-shadow .17s ease,transform .14s cubic-bezier(.2,.8,.2,1),filter .14s ease}
    button:not(:disabled):active{transform:translateY(1px) scale(.978);filter:brightness(1.13)}
    button:focus-visible{outline:2px solid var(--blue);outline-offset:3px}
    .tap-ripple{position:absolute;z-index:5;border-radius:999px;transform:scale(0);opacity:0;pointer-events:none;background:radial-gradient(circle,#d6eeff5c 0%,#93b6ff18 60%,transparent 72%);animation:tap-spread .55s ease-out forwards}
    @keyframes tap-spread{0%{transform:scale(0);opacity:.75}72%{opacity:.45}100%{transform:scale(1);opacity:0}}
    @keyframes pane-enter{from{opacity:.55;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
    .home-screen,.game-screen,.analyzer-screen{animation:pane-enter .21s ease-out both}
    .mode-card{border-left-width:2px;box-shadow:inset 0 1px 0 #ffffff07,0 7px 22px #0000001c}
    .mode-card:hover:not(:disabled){background:color-mix(in srgb,var(--mode-accent) 7%,var(--pane));box-shadow:0 9px 26px #00000022,inset 0 1px 0 #ffffff12}
    .mode-card:active:not(:disabled){transform:translateY(1px) scale(.988);box-shadow:inset 0 2px 10px #0008}
    .mode-icon-modern,.tool-symbol{transition:transform .18s ease,background .18s ease}
    .mode-card:hover .mode-icon-modern,.tool-launch:hover .tool-symbol{transform:scale(1.07)}
    .mode-card:active .mode-icon-modern,.tool-launch:active .tool-symbol{transform:scale(.96)}
    .mode-chevron{transition:transform .18s ease}
    .mode-card:hover .mode-chevron,.tool-launch:hover .mode-chevron{transform:translateX(3px)}
    .primary{background:#416fc1;border:1px solid #729bec4d;box-shadow:inset 0 1px #ffffff24,0 4px 12px #174d952b}
    .primary:hover:not(:disabled){background:#5082d3;box-shadow:inset 0 1px #ffffff38,0 5px 16px #316bc743}
    .primary:active:not(:disabled){box-shadow:inset 0 2px 10px #0a183b91,0 0 0 1px #95b6ff48}
    .secondary,.mini-button,.game-toolbar .back,.choice,.pitch-nudge button,.pitch-preview,.quick-buttons button{box-shadow:inset 0 1px 0 #ffffff06}
    .secondary:active:not(:disabled),.mini-button:active:not(:disabled),.choice:active:not(:disabled),.quick-buttons button:active:not(:disabled){box-shadow:inset 0 2px 8px #0008}
    .listen-button{box-shadow:inset 0 1px #ffffff14;background:linear-gradient(115deg,#162b49,#172033)}
    .listen-button:active:not(:disabled){background:#203a60;box-shadow:inset 0 2px 9px #0008}
    .key{transition:background .09s ease,box-shadow .09s ease,filter .09s ease}
    .key:active:not(:disabled){filter:brightness(1.4);box-shadow:inset 0 5px 8px #0005}
    .key.selected.white{box-shadow:inset 0 -4px 0 #90baff, inset 0 2px 9px #19273b}
    .key.selected.black{box-shadow:inset 0 -3px 0 #bad8ff,0 3px 7px #000a}
    .key-scroller:focus-within{border-color:#6581b4}
    /* Game modes retain their level selection and score; tool is deliberately not a game. */
    .tool-launch{display:grid;grid-template-columns:39px minmax(0,1fr) auto 16px;align-items:center;gap:10px;text-align:left;min-height:70px;padding:10px 13px;background:linear-gradient(100deg,#0c1621,#11141a 68%);border:1px solid #35506c;border-radius:13px;color:var(--text)}
    .tool-launch:hover{border-color:#779ed3;background:linear-gradient(100deg,#182537,#131821)}
    .tool-symbol{display:grid;place-items:center;width:39px;height:39px;border-radius:11px;border:1px solid #54718a;background:#1b2b38;color:#b2d7ff}
    .tool-symbol .icon{width:21px;height:21px}
    .tool-title{display:flex;flex-direction:column;gap:3px;min-width:0}
    .tool-title strong{font-size:16px;letter-spacing:-.015em}
    .tool-title small{color:#9bafc2;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .tool-type{font-size:10px;letter-spacing:.12em;color:#8fa8ca;border:1px solid #34485c;padding:5px 7px;border-radius:6px}
    :root[data-theme="light"] .tool-launch{background:linear-gradient(100deg,#e9f2ff,#fff);border-color:#aec9e7}
    :root[data-theme="light"] .tool-title small{color:#4c6482}
    :root[data-theme="light"] .tool-symbol{background:#e2ecfa;color:#315f9e;border-color:#bdcde4}
    :root[data-theme="light"] .tool-type{color:#3b638e;border-color:#ccd7e3}
    .home-screen .grid-modes{min-height:0}
    .home-screen .tool-launch{flex:none}
    /* The keyboard and recognition remain visible together, with no modal/dialog. */
    .analyzer-screen{max-width:680px;width:100%;margin:0 auto;display:flex;flex-direction:column;gap:10px;min-height:0}
    .analyzer-display{background:radial-gradient(ellipse 65% 85% at 85% 12%,#2f527025,transparent 70%),var(--pane);border:1px solid var(--line);border-radius:17px;padding:17px 17px 19px;min-height:164px;display:flex;flex-direction:column;justify-content:flex-start;gap:14px;box-shadow:inset 0 1px 0 #ffffff06}
    .analyzer-caption{color:var(--muted);font-size:10px;font-weight:750;letter-spacing:.19em}
    .analyzer-empty{min-height:86px;display:flex;flex-direction:column;gap:7px;align-items:flex-start;justify-content:center}
    .analyzer-empty strong{font-size:clamp(24px,6vw,36px);letter-spacing:-.03em;color:var(--text);line-height:1.15}
    .analyzer-empty span{color:var(--sub);font-size:12px}
    .analyzer-answer{display:flex;flex-wrap:wrap;align-items:center;gap:3px 12px}
    .analyzer-main-chord{font-size:clamp(38px,10vw,62px);font-weight:800;letter-spacing:-.06em;line-height:1.18;color:#bcd4ff;overflow-wrap:anywhere;max-width:100%}
    .analyzer-minor-label{width:100%;color:var(--sub);font-size:11px}
    .analyzer-alts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
    .analyzer-alt{font-size:13px;color:var(--text);border:1px solid var(--line);padding:5px 9px;border-radius:7px;background:var(--pane-2)}
    .analyzer-instrument{display:flex;flex-direction:column;gap:11px;flex:1;min-height:0;background:var(--pane);border:1px solid var(--line);border-radius:17px;padding:13px}
    .analyzer-instrument .piano{height:clamp(180px,39dvh,340px)}
    .analyzer-instrument .key-scroller{flex:none}
    .analyzer-instrument .piano-controls{min-height:38px}
    .analyzer-instrument .selected-notes{justify-content:flex-end;gap:5px}
    .analyzer-actions{display:grid;grid-template-columns:1fr 1.3fr;gap:9px;margin-top:auto}
    .analyzer-actions button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:48px}
    .analyzer-actions .icon{width:18px;height:18px}
    :root[data-theme="light"] .analyzer-display{background:radial-gradient(ellipse 65% 85% at 85% 12%,#a8c9f13e,transparent 70%),var(--pane)}
    :root[data-theme="light"] .analyzer-main-chord{color:#345dae}
    @media(min-width:700px){.home-screen .grid-modes{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(120px,1fr))}.tool-launch{min-height:76px}.analyzer-instrument .piano{height:min(40vh,330px)}}
    @media(max-width:600px){.home-screen{gap:7px}.home-screen .grid-modes{gap:7px;grid-template-rows:repeat(4,minmax(61px,1fr))}.mode-card{min-height:61px}.tool-launch{min-height:63px;padding:8px 10px;gap:8px;grid-template-columns:35px minmax(0,1fr) auto 15px}.tool-symbol{width:35px;height:35px}.analyzer-display{padding:13px 14px;min-height:145px;gap:8px}.analyzer-instrument{padding:9px;gap:9px}.analyzer-instrument .piano{height:clamp(166px,40dvh,300px)}.tool-title small{font-size:9px}}
    @media(min-height:681px) and (max-width:699px){.analyzer-instrument .piano{height:clamp(225px,50dvh,430px)}}
    @media(max-height:680px) and (max-width:600px){.home-screen .grid-modes{grid-template-rows:repeat(4,minmax(53px,1fr))}.mode-card{min-height:53px}.tool-launch{min-height:53px}.tool-title small{display:none}.tool-symbol{height:32px;width:32px}.analyzer-display{min-height:116px;padding:10px 12px;gap:6px}.analyzer-empty{min-height:57px}.analyzer-instrument .piano{height:clamp(145px,35dvh,220px)}}
    @media(prefers-reduced-motion:reduce){.tap-ripple{display:none!important}.home-screen,.game-screen,.analyzer-screen{animation:none!important}}

    /* v0.5 · always-on audio, stable inline review and compositor friendly faders */
    .topbar{display:flex;align-items:center;gap:8px}
    .topbar .brand{flex:none;min-width:0}
    .global-volume{display:flex;align-items:center;gap:7px;flex:1;min-width:90px;max-width:255px;margin-left:auto;padding:6px 9px;border:1px solid var(--line);border-radius:12px;background:var(--pane)}
    .global-volume .icon{width:17px;height:17px;color:var(--sub)}
    .global-volume input{display:block;width:100%;flex:1;min-width:36px;accent-color:var(--blue);touch-action:pan-x;cursor:pointer;height:22px;margin:0}
    .global-volume output{width:35px;flex:none;text-align:right;color:var(--sub);font-size:10px;font-variant-numeric:tabular-nums}
    .toplinks{flex:none}
    .game-screen{animation:none!important}
    .verdict{min-height:43px;flex:none;border:1px solid var(--line);transition:color .16s ease,border-color .16s ease,background .16s ease}
    .verdict.neutral{background:transparent;color:var(--sub);border-color:transparent}
    .verdict.neutral .verdict-title{font-size:12px;font-weight:650;color:var(--sub)}
    .game-screen .answer-card,.game-screen.has-result .answer-card{flex:1;min-height:0}
    .game-screen .pitch-grid,.game-screen.has-result .pitch-grid{height:clamp(205px,36dvh,390px);min-height:0;flex:none;transition:none!important}
    .pitch-track{overflow:hidden}
    .pitch-fill{height:100%!important;bottom:0!important;transform-origin:center bottom;will-change:transform;border-top:0!important;pointer-events:none}
    .pitch-current{position:absolute;left:1px;right:1px;z-index:4;height:0;border-top:2.5px solid #66e6c4;pointer-events:none;filter:drop-shadow(0 0 4px #61e6bc77)}
    .pitch-current i{position:absolute;right:0;top:-5px;width:9px;height:9px;background:#65dbba;border-radius:50%;box-shadow:0 0 0 2px #0d1114}
    .pitch-target{z-index:5;border-top:2.5px solid #f3b762;filter:drop-shadow(0 0 3px #f6ad5688)}
    .pitch-target i{position:absolute;left:0;top:-5px;width:9px;height:9px;border-radius:50%;background:#f3b762;box-shadow:0 0 0 2px #0d1114}
    .pitch-error-span{position:absolute;right:8px;width:12px;background:linear-gradient(#ffc7772b,#ffc77770);border-left:1px solid #f3b762b2;border-right:1px solid #f3b762b2;pointer-events:none;z-index:3}
    .pitch-detail{height:37px;flex:none;display:flex;align-items:center;justify-content:flex-start;flex-direction:column;gap:1px;font-variant-numeric:tabular-nums}
    .pitch-detail-space{display:block;height:22px}
    .pitch-detail small{font-size:9px;color:var(--sub);white-space:nowrap}
    .pitch-delta{font-size:12px;letter-spacing:-.01em;color:var(--amber);font-weight:750;line-height:1.3}
    .pitch-delta.close{color:#68dcb3}
    .comparison-legend{display:flex;align-items:center;justify-content:center;gap:16px;min-height:17px;font-size:10px;color:var(--sub)}
    .comparison-legend span{display:flex;align-items:center;gap:5px}
    .comparison-legend span:before{content:'';width:11px;height:3px;border-radius:3px;background:var(--blue)}
    .comparison-legend .legend-own:before{background:#65dbba}
    .comparison-legend .legend-target:before{background:#f3b762}
    .comparison-legend .legend-match:before{background:#58c8a2}
    .comparison-legend .legend-extra:before{background:#d96d7e}
    .result-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin:2px 0 0}
    .result-actions button{font-size:11px;padding:6px 4px;min-width:0;white-space:nowrap;gap:3px}
    .result-actions .icon{width:14px;height:14px}
    .pitch-bottom .secondary{display:flex;gap:5px;align-items:center;justify-content:center;font-size:12px}
    .answer-actions{display:grid;grid-template-columns:1.3fr .85fr 1fr;gap:6px}
    .answer-actions button{font-size:12px;padding:7px 4px;min-width:0}
    .answer-actions .icon{width:15px;height:15px}
    .game-screen.has-result .correct-piano{margin:1px 0 0}
    .game-screen.has-result .compact-piano{height:clamp(76px,12dvh,124px)}
    .correct-piano-label{margin:0}
    .game-screen.has-result .pitch-track[aria-disabled="true"]{opacity:1}
    /* For keyboard modes: chosen right = mint, missed = amber, unnecessary = red */
    .key.correct:not(.selected){background:linear-gradient(#d59b4c,#8c591e)!important;border-color:#f6c87a!important;color:white!important}
    .key.correct.selected{background:linear-gradient(#368d78,#19654f)!important;border-color:#65d8ae!important;color:#effff8!important}
    .key.incorrect{background:linear-gradient(#bd6a76,#7e3447)!important;border-color:#ec98a8!important;color:white!important}
    @media(max-width:600px){
      .topbar{gap:6px}.topbar .brand{gap:6px}.brand b{font-size:12px;letter-spacing:.055em}
      .global-volume{max-width:none;gap:4px;padding:6px 6px;border-radius:10px}
      .global-volume .icon{width:15px;height:15px}.global-volume output{font-size:9px;width:29px}
      .game-screen .pitch-grid,.game-screen.has-result .pitch-grid{height:clamp(195px,35dvh,345px)}
      .pitch-detail small{font-size:8px}
      .result-actions button{font-size:10px;min-height:42px}.result-actions .icon{width:13px;height:13px}
    }
    @media(max-width:355px){
      .brand b{font-size:11px}.topbar .logo{width:27px;height:27px}
      .global-volume{gap:3px}.global-volume output{width:27px}
      .result-actions{grid-template-columns:1fr 1fr}.result-actions #nextBtn{grid-column:1/-1}
      .game-screen .pitch-grid,.game-screen.has-result .pitch-grid{height:clamp(173px,34dvh,290px)}
    }
    @media(max-height:660px) and (max-width:600px){
      .game-screen .pitch-grid,.game-screen.has-result .pitch-grid{height:clamp(170px,34dvh,255px)}
      .pitch-detail{height:29px}
      .game-screen.has-result .compact-piano{height:76px}
    }
    @media(prefers-reduced-motion:reduce){.pitch-current,.pitch-fill{transition:none}}

    /* v0.6 — charcoal materials, restrained highlights and a true full-height instrument */
    :root { --bg:#060608;--pane:#111216;--pane-2:#191a20;--line:#2a2c33;
      --sub:#b5b7bf;--muted:#8a8e9a;--text:#f2f2f4;--blue:#8eafff;--mint:#66dfc3;--amber:#f0bb78;
      --shadow-deep:0 12px 36px #00000024;--stroke-inset:inset 0 1px 0 #ffffff08; }
    :root[data-theme="dark"] { --bg:#060608;--pane:#111216;--pane-2:#191a20;--line:#2a2c33;
      --sub:#b5b7bf;--muted:#8a8e9a;--text:#f2f2f4;--blue:#8eafff;--mint:#66dfc3;--amber:#f0bb78; }
    :root[data-theme="light"] { --bg:#f2f3f6;--pane:#fff;--pane-2:#f7f8fb;--line:#dce0e7;
      --sub:#596170;--muted:#7a8290;--text:#1b2028;--blue:#426dc7;--mint:#1d9180;--amber:#b0772e; }
    html,body {height:100%;overscroll-behavior:none;background:var(--bg)!important;}
    body {overflow:hidden;}
    .shell {height:100vh;height:100dvh;min-height:0;max-height:100dvh;display:flex;flex-direction:column;
      padding:clamp(6px,1.2vh,12px) clamp(9px,1.8vw,18px) calc(8px + env(safe-area-inset-bottom));overflow:hidden;}
    #root {flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;overflow:hidden;}
    .topbar {flex:none;min-height:42px;padding:0 0 8px;gap:8px;}
    .logo{width:33px;height:33px;border:1px solid #34363d;background:linear-gradient(155deg,#202228,#101115);border-radius:10px;}
    .brand b{font-size:13px;letter-spacing:.07em;font-weight:770;white-space:nowrap;}
    .global-volume {height:38px;max-width:280px;border-color:var(--line);background:linear-gradient(160deg,#17181d,#0e0f13);box-shadow:var(--stroke-inset);border-radius:12px;}
    :root[data-theme="light"] .global-volume{background:linear-gradient(#fff,#f7f8fb)}
    .global-volume input {appearance:none;-webkit-appearance:none;height:5px;border:0;border-radius:6px;
      background:linear-gradient(90deg,var(--blue) 0 var(--volume-progress,65%),#41434a var(--volume-progress,65%) 100%);outline:0;}
    .global-volume input::-webkit-slider-thumb {appearance:none;-webkit-appearance:none;width:15px;height:15px;border-radius:50%;background:#a7bfff;border:2px solid #c5d5ff;box-shadow:0 0 0 3px #8eafff1a;cursor:pointer;}
    .global-volume input::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:#a7bfff;border:2px solid #c5d5ff;cursor:pointer}
    .mini-button,.game-toolbar .back{background:linear-gradient(150deg,var(--pane-2),var(--pane));border-color:var(--line);box-shadow:var(--stroke-inset);}
    .home-screen,.game-screen,.analyzer-screen {width:100%;margin:0 auto;min-height:0;flex:1;animation:none;}
    .home-screen{max-width:680px;gap:10px;padding:4px 0 1px;overflow-y:auto;scrollbar-width:thin;}
    .home-screen .grid-modes {grid-template-rows:repeat(4,minmax(78px,1fr));gap:9px;min-height:0;flex:1;}
    .mode-card {border:1px solid var(--line);border-radius:17px;min-height:0;padding:12px 14px;gap:12px;
      background:linear-gradient(110deg,#17181d,#111215 75%);box-shadow:var(--stroke-inset);}
    .mode-card:before {background:linear-gradient(100deg,var(--mode-tint),transparent 40%);opacity:.42;}
    .mode-card:after {content:'';position:absolute;left:0;top:25%;bottom:25%;width:2px;border-radius:0 3px 3px 0;background:var(--mode-accent);opacity:.77;}
    .mode-icon-modern {border-radius:12px;border-color:color-mix(in srgb,var(--mode-accent) 28%,var(--line));background:color-mix(in srgb,var(--mode-accent) 8%,var(--pane));}
    .mode-text h3{font-size:clamp(15px,3.6vw,18px);font-weight:710;letter-spacing:-.035em;}
    .mode-side b{font-size:15px;font-variant-numeric:tabular-nums}
    .mode-side small{color:var(--muted)}
    .mode-card:hover:not(:disabled){background:linear-gradient(110deg,#22242b,#15161a);border-color:#454956;box-shadow:inset 0 1px #ffffff12,0 5px 16px #0003}
    .mode-card:active:not(:disabled){transform:translateY(1px) scale(.996);background:#21242b;box-shadow:inset 0 3px 12px #0008}
    .dashboard,.tool-launch {border-radius:16px;background:linear-gradient(135deg,#15161a,#101115);border:1px solid var(--line);box-shadow:var(--stroke-inset)}
    .tool-launch{min-height:68px}
    .tool-launch:hover{background:linear-gradient(135deg,#1c222c,#14161a);border-color:#495568}
    .tool-type{border-color:#3b4658;color:#8fa2c0}
    .quick-buttons button{border-radius:11px;background:linear-gradient(#191a1f,#111216);box-shadow:var(--stroke-inset);}
    .quick-buttons button.active{background:#263e70;border-color:#6c8cc144;box-shadow:inset 0 1px #ffffff26}
    .game-screen {max-width:680px;gap:8px;overflow:hidden;}
    .game-toolbar{flex:none;height:43px;min-height:43px;}
    .game-toolbar .back{height:43px;min-width:43px;border-radius:13px;}
    .game-heading strong{font-size:16px;letter-spacing:-.025em;font-weight:710}
    .pill{background:#191a1f;border:1px solid #33353e;color:#bbbfc9;border-radius:30px;font-weight:650}
    .question-card {flex:none;}
    .listen-button{height:56px;min-height:56px;border-radius:14px;background:linear-gradient(110deg,#1a2a40,#182032);
      border:1px solid #35455c;color:#f1f4fb;box-shadow:var(--stroke-inset);}
    .listen-button:hover{background:linear-gradient(110deg,#263d5b,#1c2b40)}
    .build-prompt{min-height:56px;height:56px;border-radius:14px;background:linear-gradient(#191a1e,#121317);}
    .answer-card{flex:1!important;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:12px;
      border-radius:17px;background:linear-gradient(150deg,#101114 0%,#0d0e10 100%);
      border:1px solid #30313a;box-shadow:var(--stroke-inset);}
    #answerPane{display:flex;flex-direction:column;flex:1;min-height:0;gap:8px;overflow:hidden}
    .verdict{min-height:41px;height:41px;border-radius:12px;background:#17191e;border:1px solid #2e3038;padding:7px 11px;}
    .verdict.neutral{border-color:#26282f;background:#151619;}
    .verdict .verdict-title{font-size:13px;}
    .primary,.secondary,.choice,.pitch-nudge button,.pitch-preview {transition:background-color .16s ease,border-color .16s ease,transform .13s cubic-bezier(.2,.8,.2,1),box-shadow .16s ease}
    .primary{background:linear-gradient(165deg,#527bc0,#385eab);color:#f8faff;border:1px solid #6a8fd052;box-shadow:var(--stroke-inset);border-radius:13px;font-weight:750}
    .primary:hover:not(:disabled){background:linear-gradient(160deg,#628ed7,#3c66ba)}
    .secondary,.pitch-preview,.pitch-nudge button {background:linear-gradient(160deg,#191a1e,#111216);border:1px solid #303139;border-radius:12px;box-shadow:var(--stroke-inset)}
    .secondary:hover:not(:disabled),.pitch-preview:hover:not(:disabled),.pitch-nudge button:hover:not(:disabled){background:linear-gradient(160deg,#23252b,#17181d);border-color:#444751}
    .primary:active:not(:disabled),.secondary:active:not(:disabled),.pitch-nudge button:active:not(:disabled),.pitch-preview:active:not(:disabled){transform:translateY(1px) scale(.989);filter:brightness(.96);box-shadow:inset 0 3px 10px #0008}
    .mode-pitch .pitch-grid,.mode-pitch.has-result .pitch-grid {height:auto!important;min-height:0!important;flex:1 1 0!important;display:flex;gap:9px;}
    .mode-pitch .pitch-voice {min-height:0;flex:1 1 0;gap:7px;}
    .mode-pitch .pitch-voice header {min-height:18px;height:18px;flex:none;}
    .mode-pitch .pitch-voice header strong{font-size:11px;font-weight:690;color:#a5aab7;letter-spacing:.09em}
    .mode-pitch .pitch-track {min-height:0!important;flex:1 1 0;border-radius:15px;border:1px solid #30323a;
      background:linear-gradient(175deg,#141518 0%,#101114 48%,#16191e 100%);box-shadow:inset 0 2px 10px #0003;overflow:hidden;}
    .mode-pitch .pitch-track:before {display:none!important;content:none!important}
    .mode-pitch .pitch-track:after {content:'';position:absolute;inset:0;border-radius:14px;box-shadow:inset 0 1px 0 #ffffff0b;pointer-events:none}
    .mode-pitch .pitch-track.active {outline:2px solid #87a8ed;outline-offset:1px;border-color:#556b8c}
    .mode-pitch .pitch-fill {background:linear-gradient(to top,#263b39b8,#23443e7a 90%,#21473e55);box-shadow:none;will-change:transform}
    .mode-pitch .pitch-current{border-top-color:#74e5c7;filter:drop-shadow(0 0 5px #74e5c766)}
    .mode-pitch .pitch-current i{background:#74e5c7;border:1px solid #11251f;width:13px;height:13px;top:-7px;right:2px;box-shadow:0 0 0 2px #1a2628}
    .mode-pitch .pitch-preview {height:38px;min-height:38px;max-height:38px;flex:none;display:flex;align-items:center;justify-content:center;gap:7px;}
    .mode-pitch .pitch-preview .pitch-delta{font-size:10px;line-height:1;font-weight:750;}
    .mode-pitch .pitch-preview .icon{width:15px;height:15px;}
    .mode-pitch .pitch-detail {height:30px;min-height:30px;flex:none;}
    .mode-pitch .pitch-detail-space{height:19px}
    .mode-pitch .pitch-nudge{gap:6px;flex:none;}
    .mode-pitch .pitch-nudge button{min-height:38px;font-size:12px;font-weight:690;}
    .mode-pitch .pitch-nudge button.up{color:#e9b881}.mode-pitch .pitch-nudge button.down{color:#97b9fa}
    .mode-pitch .pitch-bottom{flex:none;gap:8px;}
    .mode-pitch .pitch-bottom button{min-height:46px}
    .mode-pitch .correct-piano-label{display:none}
    .mode-pitch.has-result .correct-piano{margin:0;flex:none;}
    .mode-pitch.has-result .compact-piano {height:82px;min-height:82px;}
    .mode-pitch .comparison-legend{min-height:14px;gap:18px;}
    .mode-pitch .result-actions{flex:none;gap:7px;margin:0}
    .mode-pitch .result-actions button{height:43px;min-height:43px;font-size:11px}
    .mode-pitch .pitch-target{border-top-color:#f5c079}
    .mode-pitch .pitch-error-span{background:linear-gradient(#ffc7772b,#ffc77770)}
    :root[data-theme="light"] .mode-card,:root[data-theme="light"] .dashboard,:root[data-theme="light"] .tool-launch,
    :root[data-theme="light"] .answer-card,:root[data-theme="light"] .global-volume,:root[data-theme="light"] .secondary,
    :root[data-theme="light"] .pitch-preview,:root[data-theme="light"] .pitch-nudge button {background:var(--pane)}
    :root[data-theme="light"] .mode-pitch .pitch-track{background:linear-gradient(#f5f7fb,#ebeff5)}
    :root[data-theme="light"] .mode-pitch .pitch-fill{background:linear-gradient(#b5e6dc,#d6f0ea)}
    :root[data-theme="light"] .verdict.neutral{background:var(--pane-2)}
    :root[data-theme="light"] .global-volume input{background:linear-gradient(90deg,var(--blue) 0 var(--volume-progress,65%),#c9ced9 var(--volume-progress,65%) 100%)}
    @media(min-width:700px){
      .home-screen .grid-modes{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(90px,1fr))}
      .game-screen{max-width:720px}
    }
    @media(max-width:600px){
      .shell{padding:7px 9px calc(7px + env(safe-area-inset-bottom));}
      .topbar{gap:6px;min-height:42px;padding-bottom:7px}
      .brand b{font-size:12px}.global-volume{height:37px;padding:5px 8px}
      .home-screen{gap:8px;padding:1px 0;}
      .home-screen .grid-modes{grid-template-rows:repeat(4,minmax(68px,1fr));gap:8px}
      .mode-card{padding:11px 12px;gap:10px;border-radius:15px}
      .game-screen{gap:8px}
      .game-toolbar{height:41px;min-height:41px}.game-toolbar .back{height:41px;min-width:41px}
      .listen-button{min-height:52px;height:52px}.build-prompt{min-height:52px;height:52px}
      .answer-card{padding:10px;border-radius:15px}
      #answerPane{gap:7px}
      .mode-pitch .pitch-grid{gap:8px}
      .mode-pitch .pitch-preview{height:36px;min-height:36px;max-height:36px}
      .mode-pitch .pitch-nudge button{min-height:37px}
      .mode-pitch .pitch-detail{height:27px;min-height:27px}
      .mode-pitch.has-result .compact-piano{height:78px;min-height:78px}
    }
    @media(max-height:700px) and (max-width:600px){
      .shell{padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom))}
      .topbar{min-height:36px;padding-bottom:4px}.global-volume{height:34px}.mini-button{height:34px}
      .game-screen{gap:5px}.game-toolbar{height:36px;min-height:36px}.game-toolbar .back{height:36px;min-width:36px}
      .listen-button{height:43px;min-height:43px}.build-prompt{height:43px;min-height:43px}
      .answer-card{padding:7px}#answerPane{gap:5px}.verdict{height:34px;min-height:34px}
      .mode-pitch .pitch-preview{height:31px;min-height:31px;max-height:31px}
      .mode-pitch .pitch-detail{height:24px;min-height:24px}
      .mode-pitch .pitch-voice{gap:5px}.mode-pitch .pitch-nudge{gap:4px}.mode-pitch .pitch-nudge button{min-height:30px}
      .mode-pitch .pitch-bottom button{min-height:40px}
      .mode-pitch.has-result .compact-piano{height:65px;min-height:65px}
      .mode-pitch .result-actions button{height:39px;min-height:39px}
    }
    @media(max-width:355px){
      .shell{padding-inline:7px}.topbar{gap:4px}.global-volume{padding-inline:5px}.global-volume output{width:25px}
      .mode-pitch .pitch-grid{gap:6px}.mode-pitch .pitch-nudge button{font-size:11px}
    }
    @media(prefers-reduced-motion:reduce){.mode-card,.primary,.secondary,.pitch-preview,.pitch-nudge button{transition:none!important}}


    /* v0.7 — a prominent three-way mode, ten graduated levels, timed mastery, answer-overlay piano */
    .home-screen .grid-modes{grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(68px,1fr));gap:8px}
    .mode-featured{border-color:#696fac;background:linear-gradient(105deg,#24243b,#15161d 70%)!important;box-shadow:inset 0 1px #ffffff18,0 0 0 1px #746fd91f;}
    .mode-featured:after{width:3px;top:14%;bottom:14%;opacity:1}
    .mode-featured .mode-icon-modern{background:#696fd21c;border-color:#8b89d855}
    .mode-featured .mode-text h3{font-size:clamp(17px,4vw,20px);color:#f5f3ff}
    .mode-featured .mode-side b{color:#b5b2ff}
    .mix-subtitle{display:block;font-size:10px;font-weight:500;color:#b5b5cf;margin-top:3px;white-space:nowrap}
    .mode-side small{white-space:nowrap;font-variant-numeric:tabular-nums;font-size:10px}
    .dashboard .stats{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;text-align:center}
    .dashboard .stat b{font-size:clamp(13px,3.3vw,20px);white-space:nowrap;font-variant-numeric:tabular-nums}
    .dashboard .stat small{font-size:10px}
    .quick-level{gap:8px}
    .quick-auto,.quick-level-selector{border:1px solid var(--line);border-radius:11px;background:linear-gradient(180deg,#191a20,#101115);min-height:39px;display:flex;align-items:center}
    .quick-auto{padding:0 15px;color:var(--text);font-size:12px;font-weight:700}
    .quick-auto.active{background:#2d4578;border-color:#5475b1}
    .quick-level-selector{flex:1;min-width:0;gap:7px;padding:0 12px;color:var(--sub);font-size:12px}
    .quick-level-selector select{flex:1;min-width:0;appearance:auto;background:transparent;color:var(--text);border:0;outline:0;padding:8px 0;font-size:12px;font-weight:750;cursor:pointer}
    .quick-level-selector option{background:#151820;color:#f2f2f4}
    .game-heading{flex:1;min-width:0;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
    .game-heading strong{min-width:0;white-space:nowrap}
    .mode-context{display:none}
    .game-heading .pill{margin-left:auto}
    .timer-pill,.speed-pill{border:1px solid #383b47;border-radius:999px;padding:5px 8px;font-size:11px;color:#c3c6d0;background:#191b22;white-space:nowrap;font-variant-numeric:tabular-nums}
    .speed-pill{border-color:#67543b;color:#f1bd78;background:#2b2118}
    .verdict{gap:7px;flex-wrap:nowrap;min-width:0}
    .verdict strong{font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis}
    .verdict.overtime .verdict-title{color:#efba76}
    .result-time{font-variant-numeric:tabular-nums;font-size:12px;font-weight:750;color:#e3e5ee;white-space:nowrap}
    .time-target{font-size:10px;color:var(--amber);white-space:nowrap}
    .level-change{display:none}
    .compact-piano .key.correct.selected,.compact-piano .key.match-note{background:linear-gradient(#278d73,#145d49)!important;border-color:#66dcac!important}
    .compact-piano .key.missing-note{background:linear-gradient(#dfaa5e,#946020)!important;border-color:#f2c275!important;color:#fff!important}
    .compact-piano .key.extra-note{background:linear-gradient(#c56f7e,#793342)!important;border-color:#ee8fa0!important}
    .compact-piano .key.correct:not(.selected){background:linear-gradient(#dfaa5e,#946020)!important;border-color:#f2c275!important}
    .comparison-legend{gap:11px;flex-wrap:wrap}
    .comparison-legend .legend-match:before{background:#48c59c}
    .comparison-legend .legend-target:before{background:#f0b86d}
    .comparison-legend .legend-extra:before{background:#dc7688}
    .settings-body .level-picker{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
    .settings-body .level-picker button{padding:8px 2px;min-height:50px;font-size:10px}
    :root[data-theme="light"] .mode-featured{background:linear-gradient(105deg,#e3e6ff,#fff)!important}
    :root[data-theme="light"] .mode-featured .mode-text h3{color:#252a55}
    :root[data-theme="light"] .quick-auto,:root[data-theme="light"] .quick-level-selector{background:#f8faff}
    :root[data-theme="light"] .quick-level-selector option{background:#fff;color:#1b2028}
    @media(min-width:700px){.home-screen .grid-modes{grid-template-columns:1fr 1fr 1fr;grid-template-rows:minmax(100px,1.12fr) minmax(98px,1fr);gap:10px}
      .home-screen .mode-featured{grid-column:1/-1}}
    @media(max-width:600px){.home-screen .grid-modes{grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(66px,1fr))}
      .dashboard{padding:9px 5px}
      .game-heading{gap:5px}.game-heading strong{font-size:clamp(12px,3.5vw,15px)}.game-heading .pill{font-size:10px;padding:5px 7px}
      .timer-pill,.speed-pill{font-size:10px;padding:5px 6px}
      .mode-side small{font-size:9px}
      .mode-featured .mode-text h3{font-size:18px}
      .mix-subtitle{font-size:9px}
      .quick-level{min-height:39px}}
    @media(max-width:355px){.game-heading{gap:3px}.game-heading strong{font-size:12px}.timer-pill,.speed-pill{font-size:9px;padding:4px 5px}
      .game-heading .pill{font-size:9px}.quick-level label{display:none}
      .result-time{font-size:10px}.time-target{display:none}}


    .history-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
    .history-head h3{margin:0!important}
    .history-head button{font-size:11px;padding:8px 12px;min-height:35px}
    .history-recent{display:flex;flex-direction:column;gap:0;border:1px solid #2d3748;border-radius:12px;overflow:hidden;background:#101622}
    .history-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:9px 10px;border-bottom:1px solid #273346;font-size:11px}
    .history-item:last-child{border-bottom:0}
    .history-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d2d8e5}
    .history-item strong{font-size:12px;font-variant-numeric:tabular-nums;color:#e8effa}
    .history-item small{font-size:10px;white-space:nowrap}
    .history-ok{color:#67daba}.history-ng{color:#ff999e}
    .history-empty{font-size:11px;color:var(--sub);padding:8px 0}
    .history-reset{margin-top:12px;font-size:11px;padding:9px 12px}
    :root[data-theme="light"] .history-recent{background:#f9fbff;border-color:#d7dfe8}
    :root[data-theme="light"] .history-item{border-color:#d7dfe8}
    :root[data-theme="light"] .history-item span,:root[data-theme="light"] .history-item strong{color:#212836}


    /* v0.8 - pitch view modes and unobtrusive response diagnostics */
    .pitch-voice header.pitch-voice-top{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:3px;min-height:30px;padding:0 3px;}
    .pitch-voice-top strong{flex:none;}
    .pitch-zoom{display:grid;place-items:center;border:1px solid var(--line);border-radius:9px;background:var(--pane-2);color:var(--sub);font-size:10px;font-weight:730;letter-spacing:0;padding:4px 8px;min-height:27px;min-width:48px;box-shadow:inset 0 1px 0 #ffffff0a;}
    .pitch-zoom.on{background:#213c43;border-color:#488b86;color:#b1f7e7;}
    .pitch-zoom:active{transform:translateY(1px);}
    .pitch-track.zoomed{border-color:#3c796d;}
    .pitch-track.zoomed:before{opacity:.25;}
    .pitch-track.fine{border-color:#d5a75c;box-shadow:inset 0 0 0 1px #d5a75c44;}
    .pitch-fine-indicator{display:none;position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:7;border-radius:8px;background:#c8964c2b;border:1px solid #dcab57;color:#f9c477;font-weight:800;font-size:10px;padding:4px 8px;pointer-events:none;}
    .pitch-track.fine .pitch-fine-indicator{display:inline-block;}
    .diagnostic-summary{padding:10px;border-radius:11px;background:var(--bg);border:1px solid var(--line);font-size:11px;color:var(--sub);line-height:1.5;}
    .diag-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 10px;}
    .diag-grid span{color:var(--sub);}
    .diag-grid b{font-size:12px;color:var(--text);font-variant-numeric:tabular-nums;font-weight:650;}
    .diag-disclaimer{font-size:10px;line-height:1.5;margin:10px 0 0;color:var(--muted);}
    .diagnostic-export{width:100%;margin-top:8px;min-height:36px;}
    @media(max-width:370px){.pitch-zoom{font-size:9px;padding:4px 5px;min-width:42px}.pitch-voice header.pitch-voice-top{padding:0 1px;}}

  
    /* v0.8.1: lightweight correctness feedback, no layout shift */
    .game-screen .answer-card{position:relative;isolation:isolate}
    .game-screen.has-result .answer-card{overflow:hidden}
    .game-screen.has-result .answer-card::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;opacity:0;border-radius:inherit}
    .game-screen.has-result .answer-card > *{position:relative;z-index:1}
    .game-screen.reveal-good .answer-card::before{background:radial-gradient(ellipse 90% 65% at 50% 0%,rgba(77,226,175,.17),transparent 80%);animation:answerHalo 900ms ease-out both}
    .game-screen.reveal-bad .answer-card::before{background:radial-gradient(ellipse 90% 65% at 50% 0%,rgba(243,105,126,.15),transparent 80%);animation:answerHalo 870ms ease-out both}
    .game-screen.reveal-good .verdict{animation:answerVerdict 420ms cubic-bezier(.18,.8,.25,1) both;box-shadow:inset 3px 0 0 #61e6af,0 0 24px rgba(58,214,167,.12)}
    .game-screen.reveal-bad .verdict{animation:answerVerdict 420ms cubic-bezier(.18,.8,.25,1) both;box-shadow:inset 3px 0 0 #f47f96,0 0 24px rgba(232,88,115,.10)}
    .game-screen.reveal-good .verdict-title .icon{animation:answerIcon 460ms cubic-bezier(.2,.9,.2,1) both}
    .game-screen.reveal-bad .verdict-title .icon{animation:answerIcon 350ms cubic-bezier(.2,.9,.2,1) both}
    @keyframes answerHalo{0%{opacity:0}18%{opacity:1}100%{opacity:0}}
    @keyframes answerVerdict{0%{opacity:.6;transform:translateY(5px) scale(.992)}100%{opacity:1;transform:translateY(0) scale(1)}}
    @keyframes answerIcon{0%{transform:scale(.65);opacity:.4}65%{transform:scale(1.2);opacity:1}100%{transform:scale(1)}}
    @media(prefers-reduced-motion:reduce){.game-screen.reveal-good .answer-card::before,.game-screen.reveal-bad .answer-card::before,.game-screen.reveal-good .verdict,.game-screen.reveal-bad .verdict,.game-screen .verdict-title .icon{animation:none!important}}

  
    /* v0.8.2 Output diagnostics. One compact card; keep gameplay unchanged. */
    .output-diag{display:grid;gap:11px;min-width:0}
    .output-route{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
    .output-route button{min-width:0;min-height:40px;border-radius:11px;border:1px solid #34425b;background:#101726;color:#adbdd6;padding:7px 3px;font-size:12px;font-weight:720;transition:transform .1s,border-color .13s,background .13s}
    .output-route button.selected{background:#243553;color:#e1edff;border-color:#79a5ff;box-shadow:inset 0 0 0 1px #6595e31f}
    .output-route button:active{transform:scale(.975)}
    .output-info{display:grid;grid-template-columns:1fr auto;align-items:center;gap:5px 10px;border:1px solid #2b394d;border-radius:12px;padding:10px 11px;background:#0c1320}
    .output-info span{font-size:12px;color:var(--sub)}
    .output-info strong{font-size:13px;font-variant-numeric:tabular-nums;font-weight:760;max-width:188px;text-align:right;overflow-wrap:anywhere}
    .output-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
    .output-actions button{min-width:0;min-height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:8px}
    .output-hear{width:100%;min-height:56px;border-radius:14px;background:linear-gradient(145deg,#304d7f,#28436f);border:1px solid #7ca2e9;color:white;font-weight:800}
    .output-hear:active{transform:scale(.992)}
    .output-message{font-size:12px;color:#c2d0e5;line-height:1.6;margin:0}
    .output-message.important{color:#f2c582}
    .output-metrics{font-size:11px;color:var(--sub);line-height:1.5}
    .output-badges{display:flex;gap:6px;flex-wrap:wrap}
    .output-badges span{font-size:11px;border-radius:9px;background:#18263a;border:1px solid #2b4159;padding:4px 8px;color:#d0e3fd}
    .output-diag small{font-size:11px;color:var(--sub);line-height:1.65}
    :root[data-theme="light"] .output-route button{background:#f0f4fb;color:#374966;border-color:#c8d4e6}
    :root[data-theme="light"] .output-route button.selected{background:#d9e6ff;color:#1d416e;border-color:#6c93dd}
    :root[data-theme="light"] .output-info{background:#f6f8fc;border-color:#d4deed}
    :root[data-theme="light"] .output-badges span{background:#ecf2fa;border-color:#cddbea;color:#254365}
    :root[data-theme="light"] .output-message{color:#40546f}

  
    /* v0.8.3: dense, accessible audio-engine switch with measurable browser estimates */
    .latency-mode-label{color:var(--sub);font-weight:750;font-size:12px;margin:15px 0 7px}
    .latency-mode-control{margin-top:0}
    .latency-mode-control button{min-height:42px;font-size:13px}
    .latency-mode-note{font-size:11px!important;line-height:1.55!important;color:var(--muted)!important;margin:8px 2px 0!important}
    .audio-comparison{display:grid;gap:5px;padding:8px 10px;background:#151e2d;border:1px solid #304057;border-radius:11px;font-variant-numeric:tabular-nums;font-size:11px;color:var(--sub)}
    .audio-comparison span{display:block}
    :root[data-theme="light"] .audio-comparison{background:#f5f8fd;border-color:#d4ddec}

    /* v0.9.3: music notation raster glyphs and mixed-mode scope */
    .score-question{display:block;min-height:0!important;padding:9px 11px!important;background:#111720!important;border-color:#354051!important;overflow:visible}
    .score-card{width:100%;border:1px solid #303a4b;background:linear-gradient(155deg,#171c27,#10151c);border-radius:15px;overflow:hidden;display:grid;place-items:center;color:#dbe6f4}
    .score-svg{display:block;width:100%;max-width:560px;height:auto;max-height:192px;min-height:120px}
    .score-lines{stroke:#6d8298;stroke-width:1.3;opacity:.76}
    .score-ledgers{stroke:#8c9dad;stroke-width:1.55;stroke-linecap:round}
    .score-note{fill:#151b25;stroke:#e6f1ff;stroke-width:2.25}
    .score-acc{fill:#efc987;font:700 25px system-ui,'Noto Sans Symbols 2',sans-serif}
    .score-clef{stroke:#b6c6db;stroke-width:3.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
    .score-clef-fill{fill:#b6c6db}
    .score-bracket{stroke:#4b5a70;stroke-width:1.3;fill:none}
    .answer-score{margin:9px 0 8px}
    .answer-score .score-svg{max-height:166px}
    .answer-score .score-card{background:#121720;border-color:#334054}
    .game-screen.mode-score .question-card{margin-bottom:10px}
    .game-screen.mode-score .answer-card{min-height:0}
    .mix-settings-home{display:flex;align-items:center;gap:9px 13px;padding:9px 12px;border:1px solid var(--line);border-radius:14px;background:#10151e;margin-top:7px}
    .mix-settings-home>span{color:var(--sub);font-size:11px;font-weight:700;white-space:nowrap}
    .mix-filter-buttons{display:flex;flex:1;gap:6px;min-width:0;flex-wrap:wrap}
    .mix-filter{display:inline-flex;align-items:center;justify-content:center;gap:4px;border:1px solid #3b4353;border-radius:10px;color:#99a4b5;background:#171b23;padding:7px 8px;font-size:11px;font-weight:720;min-height:33px;white-space:nowrap;transition:background .12s,border-color .12s,transform .12s}
    .mix-filter .icon{width:12px;height:12px}
    .mix-filter.enabled{background:#24344a;color:#e2ebfa;border-color:#5b7ba4}
    .mix-filter:active:not(:disabled){transform:scale(.97)}
    .mix-filter:disabled{opacity:.83;cursor:default}
    :root[data-theme="light"] .score-card{background:#f8fafc;border-color:#cad5e5}
    :root[data-theme="light"] .score-note{fill:#f8fafc;stroke:#273b52}
    :root[data-theme="light"] .score-lines{stroke:#60728a}
    :root[data-theme="light"] .score-acc{fill:#885524}
    :root[data-theme="light"] .score-clef,:root[data-theme="light"] .score-bracket{stroke:#52617b}
    :root[data-theme="light"] .score-clef-fill{fill:#52617b}
    :root[data-theme="light"] .mix-settings-home{background:#eff3f9}
    :root[data-theme="light"] .mix-filter{background:#e8edf5;color:#516178;border-color:#bac9db}
    :root[data-theme="light"] .mix-filter.enabled{background:#d9e8ff;color:#214975;border-color:#799ac8}
    @media(max-width:520px){.mix-settings-home{display:block;padding:9px}.mix-settings-home>span{display:block;margin-bottom:7px}.mix-filter-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.mix-filter{font-size:10px;padding:6px 2px;min-height:34px}.score-svg{max-height:182px;min-height:0}.answer-score .score-svg{max-height:164px}.score-question{padding:8px!important}.answer-score{margin:7px 0}}
    @media(max-width:340px){.mix-filter .icon{display:none}.mix-filter{font-size:9px}}

  
    /* v0.9.3: precise transparent music glyphs and horizontal open noteheads */
    .score-card{background:linear-gradient(180deg,#121822,#0c1119);border-color:#354253;min-height:154px}
    .score-card::before{display:none}
    .score-svg{width:100%;height:auto;max-width:680px;max-height:225px;min-height:130px}
    .score-lines{stroke:#8795a9;stroke-width:1.45;opacity:.92}
    .score-ledgers{stroke:#94a4b8;stroke-width:1.6;stroke-linecap:round;opacity:1}
    .score-open-head{fill:none;stroke:#edf4ff;stroke-width:3.4;stroke-linejoin:round}
    .score-noteheads{pointer-events:none}
    .score-acc-images{pointer-events:none}
    .score-question{padding:8px 10px!important;}
    .answer-score .score-svg{max-height:210px}
    :root[data-theme="light"] .score-open-head{stroke:#26354c}
    :root[data-theme="light"] .score-lines{stroke:#5c708d}
    :root[data-theme="light"] .score-card{background:#f6f9fd}
    :root[data-theme="light"] .score-svg image{filter:brightness(.26)}
    @media (max-width:520px){.score-svg{min-height:0;max-height:166px}.answer-score .score-svg{max-height:150px}}

  
    /* v0.9.5: five equally sized mode cards and consistent control icon sizes */
    .settings-mix-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}
    .settings-mix-buttons .mix-filter{min-height:44px;justify-content:flex-start;padding:9px 12px;font-size:12px;gap:8px}
    .settings-mix-buttons .mix-filter .icon{width:16px;height:16px}
    .analyzer-score{width:100%;flex:none;min-height:0}
    .analyzer-score .score-card{width:100%;padding:4px}
    .analyzer-score .score-svg{height:auto;max-height:155px;min-height:0}
    .analyzer-screen{gap:8px}
    .analyzer-instrument{flex:1;min-height:0}
    .analyzer-instrument .piano{height:clamp(150px,28dvh,265px)}
    .settings-trigger .icon{width:21px;height:21px}
    .mode-icon-modern .icon,.game-heading .icon,.tool-symbol .icon{stroke-width:1.9}
    @media(min-width:700px){
      .home-screen .grid-modes{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(90px,1fr))}
      .home-screen .mode-featured{grid-column:1/-1}
    }
    @media(max-width:699px){
      .home-screen .grid-modes{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(5,minmax(65px,1fr));gap:8px}
      .home-screen .mode-card{min-height:65px}
    }
    @media(max-width:520px){
      .analyzer-score .score-svg{max-height:120px}
      .analyzer-display{min-height:105px}
      .settings-mix-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
    }
    @media(max-height:680px) and (max-width:699px){
      .home-screen .grid-modes{grid-template-rows:repeat(5,minmax(54px,1fr))}
      .home-screen .mode-card{min-height:54px}
      .analyzer-score .score-svg{max-height:96px}
    }

  