
    html, body { width:100%; height:100%; min-height:0; overflow:hidden; }
    body { min-height:100dvh; height:100dvh; overflow:hidden; }
    .shell { width:100%; max-width:none; height:100dvh; min-height:0; margin:0; padding:12px 0 10px; display:flex; flex-direction:column; }
    header { flex:none; margin:0 18px; padding-bottom:10px; }
    .hero, .footer { display:none; }
    .studio { flex:1; min-height:0; display:flex; flex-direction:column; justify-content:center; gap:12px; padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
    .controls { flex:none; margin:0 18px; }
    .score-panel { width:calc(100% - 36px); }
    .keyboard-frame { width:100vw; max-width:100%; flex:none; overflow:hidden; padding:0; scrollbar-width:none; outline:none; }
    .keyboard-frame::-webkit-scrollbar { display:none; }
    .keyboard { width:100%; min-width:0; height:min(360px, 11.92vw, calc(100dvh - 180px)); border:2px solid #090b10; border-top:8px solid #090b10; border-radius:0 0 8px 8px; background:#090b10; box-shadow:0 8px 0 #05060a,0 14px 24px #07090d80; }
    .white-key { flex:1 1 0; width:calc(100% / 52); min-width:0; }
    .black-key { width:1.12%; min-width:0; max-width:none; }
    .keyboard.keys-61 .black-key { width:1.61%; }
    .lower-bar { flex:none; margin:0 18px; }
    .key-range-toggle { border:1px solid #f0c875; border-radius:8px; padding:8px 11px; color:#f0c875; background:#242938; font:inherit; font-size:.8rem; font-weight:800; letter-spacing:.12em; cursor:pointer; }
    .key-range-toggle:hover { color:#171923; background:#f0c875; }
    .tools { margin-left:auto; }
    .legend { margin-left:auto; }
    .song-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .song-label,.song-status { color:var(--muted); font-size:.84rem; }
    .song-status { min-width:42px; }
    .select-wrap { position:relative; display:inline-flex; }
    .select-wrap::after { content:""; position:absolute; right:11px; top:13px; width:7px; height:7px; border-right:1.5px solid #c9ced9; border-bottom:1.5px solid #c9ced9; transform:rotate(45deg); pointer-events:none; }
    #songSelect { appearance:none; min-width:190px; height:36px; padding:0 30px 0 11px; border:1px solid #43495a; border-radius:8px; color:var(--ink); background:#202432; font:inherit; font-size:.86rem; }
    .play-button,.stop-button { height:36px; min-width:56px; padding:0 13px; border-radius:8px; font:inherit; font-size:.86rem; font-weight:700; cursor:pointer; }
    .sample-test-button { height:36px; padding:0 10px; border:1px solid #555d70; border-radius:8px; color:#e2e5ed; background:#242938; font:inherit; font-size:.8rem; font-weight:650; cursor:pointer; }
    .sample-test-button:hover:not(:disabled) { border-color:#f0c875; color:#f0c875; }
    .sample-test-button:disabled { opacity:.6; cursor:wait; }
    .midi-input-select { height:36px; max-width:170px; padding:0 8px; border:1px solid #43495a; border-radius:8px; color:var(--ink); background:#202432; font:inherit; font-size:.78rem; }
    .midi-status { color:var(--muted); font-size:.76rem; white-space:nowrap; }
    .tempo-control { display:flex; align-items:center; gap:6px; color:#d8dce5; font-size:.84rem; white-space:nowrap; }
    #tempoBpm { width:62px; height:32px; padding:0 5px; border:1px solid #43495a; border-radius:7px; color:var(--ink); background:#202432; font:inherit; font-size:.82rem; text-align:center; }
    .metronome-controls { display:flex; align-items:center; gap:7px; color:#d8dce5; font-size:.78rem; }
    .meter-display { color:var(--gold); font-weight:800; font-variant-numeric:tabular-nums; }
    .metronome-beats { display:flex; align-items:center; gap:4px; min-height:15px; }
    .metronome-beat { width:8px; height:8px; border-radius:50%; background:#555b6b; transition:background .06s,transform .06s,box-shadow .06s; }
    .metronome-beat.accent { width:10px; height:10px; background:#7b6333; }
    .metronome-beat.active { background:#f5c451; transform:scale(1.35); box-shadow:0 0 9px #f5c45188; }
    .metronome-beat.accent.active { background:#fff0aa; box-shadow:0 0 12px #f5c451aa; }
    .metronome-status { min-width:54px; color:var(--muted); font-size:.72rem; white-space:nowrap; }
    .play-button { border:1px solid #f0c875; color:#171923; background:#f0c875; }
    .play-button:hover:not(:disabled) { background:#ffda91; }
    .stop-button { border:1px solid #4b5263; color:#e7e9ef; background:#292e3b; }
    .loop-button.active { border-color:#4d8dff; color:#dce9ff; background:#25385c; }
    .loop-status { min-width:72px; color:#8eb7ff; font-size:.78rem; }
    .tutor-button.active { border-color:#4caf68; color:#e3ffe9; background:#214a31; }
    .tutor-status { min-width:110px; color:#bfc5d2; font-size:.76rem; }
    .white-key.tutor-correct,.white-key.observed-correct { background:linear-gradient(180deg,#effff2,#65cd7b); color:#14351c; }
    .white-key.tutor-wrong,.white-key.observed-wrong { background:linear-gradient(180deg,#fff0ef,#ea7770); color:#4a1715; }
    .black-key.tutor-correct,.black-key.observed-correct { background:linear-gradient(90deg,#17612e,#5fce77); }
    .black-key.tutor-wrong,.black-key.observed-wrong { background:linear-gradient(90deg,#791f1d,#e56e67); }
    .play-button:disabled,.stop-button:disabled { opacity:.48; cursor:default; }
    @media (max-width:640px) {
      .shell { padding-top:8px; }
      header { margin:0 10px; padding-bottom:6px; font-size:.82rem; }
      .brand-mark { width:30px; height:30px; }
      .controls { margin:0 10px; gap:8px; }
      .score-panel { width:calc(100% - 20px); height:clamp(202px,27vh,242px); margin:0 10px; padding:8px; }
      .score-heading { font-size:.72rem; margin-bottom:5px; }
      .score-viewport { height:calc(100% - 22px); }
      .tools { width:100%; margin-left:0; justify-content:flex-start; gap:8px; }
      .song-controls { width:100%; flex:0 0 100%; gap:6px; }
      .song-label { display:none; }
      #songSelect { min-width:0; width:min(45vw,190px); font-size:.78rem; }
      .play-button,.stop-button { height:32px; min-width:48px; padding:0 9px; }
      .sample-test-button { height:32px; font-size:.74rem; }
      .midi-input-select { height:32px; max-width:140px; font-size:.72rem; }
      .midi-status { font-size:.7rem; }
      .tempo-control { font-size:.72rem; }
      #tempoBpm { width:54px; height:30px; font-size:.72rem; }
      .metronome-controls { gap:5px; font-size:.68rem; }
      .metronome-beats { gap:3px; }
      .metronome-beat { width:6px; height:6px; }
      .metronome-beat.accent { width:8px; height:8px; }
      .metronome-status { min-width:40px; font-size:.64rem; }
      .tutor-status { min-width:80px; font-size:.68rem; }
      .sound-hint { display:none; }
      .readout { min-width:0; gap:8px; }
      .note-dot { width:34px;height:34px; }
      .keyboard { height:min(230px, 52vh, calc(100dvh - 145px)); }
      .lower-bar { margin:0 10px; font-size:.72rem; gap:6px; }
      .legend { display:none; }
      .white-key .key-name { font-size:7px; bottom:4px; }
      .black-key .key-name { display:none; }
    }
    @media (max-height:640px) {
      .shell { padding-top:6px; padding-bottom:6px; }
      .studio { gap:7px; }
      .score-panel { height:188px; }
      .keyboard { height:min(180px, 39vh, calc(100dvh - 220px)); }
      .lower-bar { padding-top:7px; }
    }
    @media (max-width:640px) and (max-height:640px) {
      .tools { width:auto; flex:1; justify-content:flex-end; }
      .song-controls { width:auto; flex:0 0 auto; }
      .keyboard { height:min(150px, 39vh, calc(100dvh - 220px)); }
    }
    @media (max-width:640px) and (max-height:420px) {
      .score-panel { height:140px; }
      .keyboard { height:min(96px, 28vh, calc(100dvh - 248px)); }
      .lower-bar { display:none; }
    }
  
    /* Remote held-note presentation is independent of local voice/feedback classes. */
    .white-key.observed-held:not(.observed-correct):not(.observed-wrong) { background:linear-gradient(#dedbd4,#e8c77a); }
    .black-key.observed-held:not(.observed-correct):not(.observed-wrong) { background:linear-gradient(#413c32,#b39052); }
