/* ==========================================================================
   Piano Tutor — design system
   Tokens → base → layout shell → components → screens → responsive
   ========================================================================== */
:root {
  --bg: #f6f6fa; --bg-2: #eeeef6; --surface: #ffffff; --surface-2: #f9f9fd; --text: #14152a; --text-2: #4a4d68; --muted: #7b7f99;
  --border: #e4e5ef; --border-2: #d3d5e4;
  --primary: #5b5bd6; --primary-strong: #4a48c4; --primary-soft: #ececfd; --on-primary: #fff;
  --good: #15a34a; --good-soft: #e3f7ea; --bad: #e0384f; --bad-soft: #fde8eb; --warn: #e88a0c; --warn-soft: #fff2dc; --gold: #f2a900;
  --rh: #5b5bd6; --lh: #0d9f8f; --grid: rgba(20,21,42,.06); --target: #8b8bf0; --hint: #6ee7d6;
  --staff: #262840; --white-key: #ffffff; --white-key-edge: #c9cbdb; --black-key: #1a1b2e;
  --shadow-sm: 0 1px 2px rgba(20,21,42,.05); --shadow: 0 1px 2px rgba(20,21,42,.04), 0 6px 20px -6px rgba(20,21,42,.10);
  --shadow-lg: 0 20px 50px -12px rgba(20,21,42,.28);
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --tab-h: 64px; --top-h: 56px;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e1a; --bg-2: #13142a; --surface: #171931; --surface-2: #1c1e3a; --text: #ecedf9; --text-2: #b8bbd6; --muted: #8c90b0;
    --border: #262946; --border-2: #33375c;
    --primary: #8183f4; --primary-strong: #9a9cf7; --primary-soft: #23254d; --on-primary: #0d0e1a;
    --good: #34d17a; --good-soft: #12301f; --bad: #ff6b81; --bad-soft: #3a1621; --warn: #ffb547; --warn-soft: #3a2a10; --gold: #ffc53d;
    --rh: #7a7cf2; --lh: #1fc7b3; --grid: rgba(255,255,255,.07); --target: #6366f1; --hint: #0f8f80;
    --staff: #d9dbf2; --white-key: #f3f3f8; --white-key-edge: #9ea1bb; --black-key: #090a14;
    --shadow-sm: none; --shadow: 0 0 0 1px rgba(255,255,255,.02); --shadow-lg: 0 20px 60px -10px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e1a; --bg-2: #13142a; --surface: #171931; --surface-2: #1c1e3a; --text: #ecedf9; --text-2: #b8bbd6; --muted: #8c90b0;
  --border: #262946; --border-2: #33375c;
  --primary: #8183f4; --primary-strong: #9a9cf7; --primary-soft: #23254d; --on-primary: #0d0e1a;
  --good: #34d17a; --good-soft: #12301f; --bad: #ff6b81; --bad-soft: #3a1621; --warn: #ffb547; --warn-soft: #3a2a10; --gold: #ffc53d;
  --rh: #7a7cf2; --lh: #1fc7b3; --grid: rgba(255,255,255,.07); --target: #6366f1; --hint: #0f8f80;
  --staff: #d9dbf2; --white-key: #f3f3f8; --white-key-edge: #9ea1bb; --black-key: #090a14;
  --shadow-sm: none; --shadow: 0 0 0 1px rgba(255,255,255,.02); --shadow-lg: 0 20px 60px -10px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { overflow-x: hidden; }
.dash-main > section, .dash-side > section { min-width: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 var(--s3); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
:focus { outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--primary-soft); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stack { display: grid; gap: var(--s4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5) var(--s4); border-right: 1px solid var(--border); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); padding: 0 var(--s2) var(--s4); letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #a855f7); color: #fff; box-shadow: 0 6px 16px -6px var(--primary); flex: none; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; transition: background .15s, color .15s; }
.side-nav a:hover { background: var(--bg-2); color: var(--text); }
.side-nav a.on { background: var(--primary-soft); color: var(--primary); }
.side-foot { margin-top: auto; display: grid; gap: var(--s2); }
.side-stats { display: flex; gap: var(--s2); }
.side-stats .chip { flex: 1; justify-content: center; }
.topbar { display: none; }
.tabbar { display: none; }
main#view { width: 100%; max-width: 1080px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); min-width: 0; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s4); }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }

.btn { font: inherit; font-weight: 650; font-size: .95rem; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s var(--ease), background .15s, border-color .15s, box-shadow .15s; user-select: none; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--primary); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px -8px var(--primary); }
.btn.primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); padding: 0 10px; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { color: var(--bad); }
.btn.lg { min-height: 54px; font-size: 1.05rem; padding: 0 26px; border-radius: 16px; }
.btn.sm { min-height: 36px; font-size: .85rem; padding: 0 12px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; transition: background .15s; flex: none; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn.solid { background: var(--surface); border-color: var(--border); }
.icon-btn.on { background: var(--primary-soft); color: var(--primary); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.chip.fire { background: var(--warn-soft); color: var(--warn); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.primary { background: var(--primary-soft); color: var(--primary); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.good { background: var(--good-soft); color: var(--good); }

.input-pill { font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.input-pill:hover { border-color: var(--primary); }
.input-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 20%, transparent); }
.input-pill.live .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.input-pill .lbl { display: grid; line-height: 1.25; min-width: 0; }
.input-pill .lbl b { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-pill .lbl span { font-size: .75rem; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--good); transition: width .06s linear; }

.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .5s var(--ease); }
.progress.good > i { background: var(--good); }

.stars { display: inline-flex; gap: 2px; color: var(--border-2); }
.stars .on { color: var(--gold); }
.stars .on svg { fill: currentColor; }

.ring { --p: 0; --s: 120px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--good) calc(var(--p) * 360deg), var(--bg-2) 0); flex: none; }
.ring-in { width: calc(var(--s) - 18px); height: calc(var(--s) - 18px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; text-align: center; line-height: 1.1; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-2); }
.seg button { font: inherit; font-size: .85rem; font-weight: 650; min-height: 34px; padding: 0 12px; border: none; border-radius: 9px; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 1px 3px rgba(0,0,0,.08); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--border); font-weight: 600; cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--border-2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch small { display: block; font-weight: 400; color: var(--muted); }
select { font: inherit; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); }
input[type=range] { accent-color: var(--primary); }

/* toasts */
.toasts { position: fixed; z-index: 130; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); display: grid; gap: 8px; pointer-events: none; width: min(92vw, 420px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-10px) scale(.98); transition: all .25s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast.good .icon { color: var(--good); } .toast.bad .icon { color: var(--bad); }

/* sheet / dialog */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10,10,25,.45); backdrop-filter: blur(3px); display: grid; place-items: center; opacity: 0; transition: opacity .2s; padding: var(--s4); }
.sheet-backdrop.in { opacity: 1; }
.sheet { width: min(560px, 100%); min-width: 0; max-height: 88dvh; overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: var(--s5); transform: translateY(16px) scale(.98); transition: transform .25s var(--ease); }
.sheet-backdrop.in .sheet { transform: none; }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 120; }

/* option cards (onboarding, input picker) */
.choice-list { display: grid; gap: var(--s3); }
.choice { font: inherit; display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left; padding: var(--s4); border-radius: var(--r); border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.choice:hover { border-color: var(--border-2); }
.choice:active { transform: scale(.99); }
.choice.on { border-color: var(--primary); background: var(--primary-soft); }
.choice b { display: block; }
.choice small { color: var(--muted); font-size: .85rem; display: block; line-height: 1.35; }
.choice .state { margin-left: auto; flex: none; color: var(--primary); }
.ico-tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.ico-tile.c1 { background: #ecebfe; color: #5b5bd6; } .ico-tile.c2 { background: #dff7f2; color: #0d9f8f; } .ico-tile.c3 { background: #fff1db; color: #d97706; }
.ico-tile.c4 { background: #fde7f1; color: #db2777; } .ico-tile.c5 { background: #e3f1ff; color: #2563eb; } .ico-tile.c6 { background: #eaf7e3; color: #4d9a16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico-tile.c1 { background: #26285a; color: #a5a7ff; } :root:not([data-theme="light"]) .ico-tile.c2 { background: #0f3a35; color: #4fe0cc; } :root:not([data-theme="light"]) .ico-tile.c3 { background: #3d2c10; color: #ffbf5e; } :root:not([data-theme="light"]) .ico-tile.c4 { background: #3d1529; color: #ff8fc0; } :root:not([data-theme="light"]) .ico-tile.c5 { background: #132a4a; color: #7db6ff; } :root:not([data-theme="light"]) .ico-tile.c6 { background: #1d3313; color: #9be06a; } }
:root[data-theme="dark"] .ico-tile.c1 { background: #26285a; color: #a5a7ff; } :root[data-theme="dark"] .ico-tile.c2 { background: #0f3a35; color: #4fe0cc; } :root[data-theme="dark"] .ico-tile.c3 { background: #3d2c10; color: #ffbf5e; } :root[data-theme="dark"] .ico-tile.c4 { background: #3d1529; color: #ff8fc0; } :root[data-theme="dark"] .ico-tile.c5 { background: #132a4a; color: #7db6ff; } :root[data-theme="dark"] .ico-tile.c6 { background: #1d3313; color: #9be06a; }

/* ---------- onboarding ---------- */
.onboard { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow: auto; display: flex; flex-direction: column; }
.onboard-top { display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s4) + env(safe-area-inset-top)) var(--s5) var(--s4); max-width: 640px; width: 100%; margin: 0 auto; }
.onboard-top .progress { flex: 1; }
.onboard-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 560px; width: 100%; margin: 0 auto; padding: var(--s4) var(--s5) var(--s6); animation: rise .35s var(--ease); }
.onboard-body h1 { margin-bottom: var(--s2); }
.onboard-body .lead { color: var(--text-2); font-size: 1.05rem; margin-bottom: var(--s5); }
.onboard-foot { position: sticky; bottom: 0; padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; background: linear-gradient(transparent, var(--bg) 30%); display: grid; gap: var(--s2); }
.welcome-art { display: flex; justify-content: center; margin-bottom: var(--s5); }
.welcome-art .keys { display: flex; gap: 4px; position: relative; height: 120px; }
.welcome-art .keys i { width: 34px; border-radius: 0 0 8px 8px; background: var(--white-key); border: 1px solid var(--white-key-edge); animation: keydance 2.4s var(--ease) infinite; }
.welcome-art .keys i:nth-child(2) { animation-delay: .15s; } .welcome-art .keys i:nth-child(3) { animation-delay: .3s; } .welcome-art .keys i:nth-child(4) { animation-delay: .45s; } .welcome-art .keys i:nth-child(5) { animation-delay: .6s; }
.welcome-art .keys b { position: absolute; top: 0; width: 22px; height: 72px; background: var(--black-key); border-radius: 0 0 5px 5px; z-index: 1; }
@keyframes keydance { 0%, 70%, 100% { background: var(--white-key); transform: none; } 20% { background: var(--target); transform: translateY(3px); } }
.feature-list { display: grid; gap: var(--s3); margin: var(--s4) 0; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: var(--s3); align-items: flex-start; color: var(--text-2); }
.feature-list .icon { color: var(--good); margin-top: 3px; }
.plan-summary { display: grid; gap: var(--s3); }
.plan-summary .card { display: flex; gap: var(--s4); align-items: center; padding: var(--s4); margin: 0; }

/* ---------- page headers ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 60ch; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: var(--s6) 0 var(--s3); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.dash-main, .dash-side { display: grid; gap: var(--s4); min-width: 0; }
.dash .card + .card { margin-top: 0; }
.continue { position: relative; overflow: hidden; border: none; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #a855f7 0%, transparent 55%), linear-gradient(135deg, #4f46e5, #6d5df0); box-shadow: 0 18px 40px -18px #4f46e5; }
.continue .eyebrow { color: rgba(255,255,255,.75); }
.continue h2 { font-size: 1.6rem; margin: 6px 0 4px; }
.continue p { color: rgba(255,255,255,.85); margin-bottom: var(--s4); max-width: 46ch; }
.continue .progress { background: rgba(255,255,255,.22); }
.continue .progress > i { background: #fff; }
.continue .btn { background: #fff; color: #3f37c9; border-color: #fff; box-shadow: none; }
.continue .deco { position: absolute; right: -14px; bottom: -22px; opacity: .14; transform: rotate(-12deg); pointer-events: none; }
.continue-meta { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); font-size: .85rem; color: rgba(255,255,255,.85); }
.continue-meta .progress { flex: 1; max-width: 220px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plan-item { display: flex; align-items: center; gap: var(--s3); padding: 10px; margin: 0 -10px; border-radius: var(--r); color: var(--text); transition: background .15s; }
.plan-item:hover { background: var(--bg-2); }
.plan-item .txt { flex: 1; min-width: 0; }
.plan-item .txt b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item .txt span { font-size: .82rem; color: var(--muted); }
.plan-item .check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; color: transparent; flex: none; }
.plan-item.done .check { background: var(--good); border-color: var(--good); color: #fff; }
.plan-item.done .txt b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-2); }
.goal-card { display: flex; gap: var(--s4); align-items: center; }
.goal-card .ring b { font-size: 1.6rem; font-weight: 800; display: block; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: var(--s4); }
.week div { display: grid; gap: 4px; justify-items: center; font-size: .72rem; color: var(--muted); font-weight: 650; }
.week i { width: 100%; height: 44px; border-radius: 8px; background: var(--bg-2); position: relative; overflow: hidden; }
.week i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--h) * 100%); background: var(--good); border-radius: 6px; }
.week .today { color: var(--text); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.stat { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--bg-2); }
.stat b { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 240px); gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.hscroll > * { scroll-snap-align: start; }
.tip-card { display: flex; gap: var(--s3); align-items: flex-start; }
.tip-card .icon { color: var(--warn); margin-top: 2px; }
.tip-card p { margin: 0; color: var(--text-2); }

/* ---------- song cards ---------- */
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.song-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: transform .15s var(--ease), box-shadow .15s; }
.song-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.song-cover { position: relative; height: 100px; display: grid; place-items: center; color: rgba(255,255,255,.92); }
.song-cover .badge { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); color: #222; }
.song-cover .best { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.32); color: #fff; }
.song-body { padding: var(--s3) var(--s4) var(--s4); }
.song-body b { display: block; line-height: 1.3; }
.song-body .muted { font-size: .82rem; line-height: 1.4; margin-top: 2px; }
.filters { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 4px; margin-bottom: var(--s4); scrollbar-width: none; }
.filters button { font: inherit; font-weight: 650; font-size: .88rem; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.filters button.on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- course path ---------- */
.unit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.unit + .unit { margin-top: var(--s3); }
.unit > summary { list-style: none; display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); cursor: pointer; }
.unit > summary::-webkit-details-marker { display: none; }
.unit-emoji { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: var(--bg-2); flex: none; }
.unit.current .unit-emoji { background: var(--primary-soft); }
.unit.complete .unit-emoji { background: var(--good-soft); }
.unit-info { flex: 1; min-width: 0; }
.unit-info .muted { font-size: .85rem; }
.unit-info .progress { margin-top: 8px; max-width: 260px; height: 6px; }
.unit-meta { text-align: right; flex: none; display: flex; align-items: center; gap: var(--s2); }
.unit > summary .chev { transition: transform .2s; color: var(--muted); }
.unit[open] > summary .chev { transform: rotate(90deg); }
.path { list-style: none; margin: 0; padding: 0 var(--s5) var(--s4); position: relative; }
.path li { position: relative; }
.path li::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.path li:first-child::before { top: 50%; } .path li:last-child::before { bottom: 50%; }
.path li:only-child::before { display: none; }
.path a { position: relative; display: flex; align-items: center; gap: var(--s4); padding: 8px 10px 8px 0; color: var(--text); border-radius: var(--r); }
.path a:hover .node { transform: scale(1.06); }
.path a:hover .ltitle { color: var(--primary); }
.node { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-2); color: var(--muted); font-weight: 750; font-size: .9rem; flex: none; transition: transform .15s var(--ease); }
.done .node { background: var(--good); border-color: var(--good); color: #fff; }
.next .node { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 6px var(--primary-soft); }
.ltitle { font-weight: 650; flex: 1; min-width: 0; }
.ltitle small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.next .ltitle small { color: var(--primary); font-weight: 700; }

/* ---------- hub tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s3); }
.tile { display: flex; gap: var(--s4); align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); color: var(--text); box-shadow: var(--shadow); transition: transform .15s var(--ease), border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: var(--border-2); }
.tile > div:last-child { min-width: 0; }
.tile b { display: block; }
.tile .muted { font-size: .84rem; line-height: 1.35; }
.tile .ico-tile { width: 48px; height: 48px; border-radius: 14px; }
.tool-page { max-width: 820px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 600; margin-bottom: var(--s3); min-height: 40px; }
.back-link:hover { color: var(--primary); }

/* ---------- immersive screens (lesson + player) ---------- */
.immersive-top { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.immersive-top .progress { flex: 1; height: 10px; }

/* lesson */
.lesson { max-width: 860px; margin: 0 auto; }
.lesson-intro { animation: rise .35s var(--ease); }
.lesson-intro .unit-tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--s3); }
.lesson-intro h1 { margin-bottom: var(--s4); }
.lesson-intro .prose { font-size: 1.04rem; color: var(--text-2); }
.lesson-intro .prose p:first-child { font-size: 1.12rem; color: var(--text); }
.lesson-intro .prose b { color: var(--text); }
.lesson-intro .prose ul { padding-left: 0; list-style: none; display: grid; gap: 10px; margin: var(--s3) 0; }
.lesson-intro .prose li { position: relative; padding: 12px 14px 12px 42px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.lesson-intro .prose li::before { content: ''; position: absolute; left: 16px; top: 20px; width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.lesson-intro .prose i { color: var(--muted); }
.lesson-intro .what-next { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--primary-soft); color: var(--primary); border-radius: var(--r); font-weight: 600; font-size: .92rem; margin-top: var(--s4); }
.exercise { animation: rise .3s var(--ease); }
.ex-kicker { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.prompt { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); font-weight: 750; letter-spacing: -.01em; margin-bottom: var(--s3); line-height: 1.35; }
.feedback { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border-radius: var(--r); background: var(--bg-2); color: var(--text-2); font-weight: 600; margin: var(--s3) 0; transition: background .2s, color .2s; }
.feedback .icon { flex: none; }
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pop { animation: pop .3s var(--ease); }
@keyframes pop { 50% { transform: scale(1.03); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.ex-controls { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.ex-controls .btn.primary { margin-left: auto; }
.chord-symbol { font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem); font-weight: 850; text-align: center; color: var(--primary); letter-spacing: -.03em; min-height: 1.2em; line-height: 1.1; }
.chord-symbol.sm { font-size: 1.5rem; min-width: 3rem; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.btn.option { min-height: 56px; font-size: 1rem; white-space: normal; }
.btn.option.good { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.btn.option.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.camera-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
video.mirror { width: 100%; aspect-ratio: 4/3; background: var(--bg-2); border-radius: var(--r); transform: scaleX(-1); object-fit: cover; }
.checklist { display: grid; gap: var(--s2); }
.checklist label { display: flex; gap: var(--s3); align-items: center; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); cursor: pointer; font-weight: 600; transition: background .15s; }
.checklist input { width: 20px; height: 20px; accent-color: var(--good); flex: none; }
.checklist label:has(input:checked) { background: var(--good-soft); border-color: transparent; color: var(--good); }
.beat-lights { display: flex; gap: 10px; justify-content: center; margin: var(--s3) 0; }
.beat-lights span { width: 16px; height: 16px; border-radius: 50%; background: var(--border-2); transition: transform .08s, background .08s; }
.beat-lights span.on { background: var(--primary); transform: scale(1.3); }
.beat-lights span.count { background: var(--warn); transform: scale(1.3); }
.tap-pad { display: grid; place-items: center; width: 100%; min-height: 110px; font: inherit; font-weight: 800; letter-spacing: .06em; border-radius: var(--r-lg); border: 2px dashed var(--border-2); background: var(--surface-2); color: var(--primary); cursor: pointer; touch-action: manipulation; user-select: none; transition: background .06s, transform .06s; }
.tap-pad { gap: 4px; align-content: center; position: relative; overflow: hidden; }
.tap-pad > span, .tap-pad > small { position: relative; z-index: 1; }
.pad-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: color-mix(in srgb, var(--primary) 22%, transparent); z-index: 0; }
.pad-fill.full { background: color-mix(in srgb, var(--good) 35%, transparent); }
.pad-fill.short { background: color-mix(in srgb, var(--warn) 35%, transparent); }
.tap-pad.hit { background: var(--primary-soft) !important; color: var(--primary) !important; transform: scale(.985); }
.tap-pad .pad-main { font-size: 1.25rem; letter-spacing: 0; }
.tap-pad .pad-sub { font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tap-pad.armed { border-style: solid; border-color: var(--primary); animation: armedPulse 1.6s ease-in-out infinite; }
@keyframes armedPulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 18%, transparent); } }
.rhythm-mode { justify-content: space-between; margin: 4px 0 0; }
.tap-pad.small { width: auto; min-height: 44px; padding: 0 20px; }
.tap-pad.hit { background: var(--primary); color: var(--on-primary); transform: scale(.985); }
.timing { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s2) 0; font-size: .8rem; font-weight: 650; }
.timing span { padding: 4px 8px; border-radius: 8px; background: var(--bg-2); }
.timing .perfect { color: var(--good); background: var(--good-soft); } .timing .ok { color: var(--warn); background: var(--warn-soft); } .timing .off, .timing .miss { color: var(--bad); background: var(--bad-soft); }
.complete { text-align: center; padding: var(--s6) var(--s5); animation: rise .4s var(--ease); }
.complete .stars { gap: 8px; margin: var(--s3) 0; }
.complete .stars span { animation: starIn .5s var(--ease) both; }
.complete .stars span:nth-child(2) { animation-delay: .15s; } .complete .stars span:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.25); } }
.complete .stat-grid { grid-template-columns: repeat(3, 1fr); max-width: 440px; margin: var(--s5) auto; }
.complete .row { justify-content: center; }
.complete p { color: var(--text-2); }

/* ---------- visual lesson slides ---------- */
.deck { display: grid; gap: var(--s3); }
.deck-stage { position: relative; min-height: 190px; display: grid; place-items: center; padding: var(--s4) var(--s3); border-radius: var(--r-lg); background: linear-gradient(160deg, var(--primary-soft), var(--surface-2) 70%); border: 1px solid var(--border); overflow: hidden; touch-action: pan-y; }
.deck-stage.in-r { animation: slideInR .35s var(--ease); } .deck-stage.in-l { animation: slideInL .35s var(--ease); }
@keyframes slideInR { from { opacity: 0; transform: translateX(28px); } } @keyframes slideInL { from { opacity: 0; transform: translateX(-28px); } }
.deck-visual { width: 100%; display: grid; place-items: center; }
.deck-visual > svg { width: 100%; max-width: 560px; height: auto; max-height: 240px; }
.deck-staff { background: var(--surface); border-radius: var(--r); padding: 4px 8px; width: 100%; max-width: 460px; }
.deck-staff .staff-svg { width: 100%; }
.deck-staff .note-label { font-size: 15px; font-weight: 900; fill: var(--primary); }
.deck-text h2 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.55rem); font-weight: 800; letter-spacing: -.02em; }
.deck-text p { margin: 6px 0 0; font-size: 1.05rem; color: var(--text-2); }
.deck-dots { display: flex; gap: 6px; justify-content: center; }
.deck-dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: none; background: var(--border-2); cursor: pointer; transition: width .2s, background .2s; }
.deck-dots button.on { width: 24px; background: var(--primary); }
.deck-nav { display: flex; gap: var(--s2); align-items: center; }
.deck-nav .btn.primary { margin-left: auto; min-width: 140px; }
.deck-try { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--text); font-size: .95rem; border: 2px dashed color-mix(in srgb, var(--warn) 50%, transparent); }
.deck-try .try-ico { color: var(--warn); display: grid; }
.deck-try .try-prog { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--warn); }
.deck-try.done { background: var(--good-soft); border: 2px solid transparent; color: var(--good); }
.deck-try.done .try-ico, .deck-try.done .try-prog { color: var(--good); }
.deck-more summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.deck-more .prose { margin-top: var(--s3); color: var(--text-2); }
.do-avoid.single { grid-template-columns: minmax(0, 320px); justify-content: center; margin: 0; width: 100%; }
/* keyboard diagram */
.vk { overflow: visible; }
.vk-w { fill: var(--white-key); stroke: var(--white-key-edge); stroke-width: 1.2; }
.vk-b { fill: var(--black-key); }
.vk-b.vk-g2 { fill: #4f46e5; } .vk-b.vk-g3 { fill: #d97706; }
.vk-t { fill: var(--target) !important; } .vk-b.vk-t { fill: #4f46e5 !important; }
.vk-l { fill: #5eead4 !important; } .vk-b.vk-l { fill: #0f766e !important; }
.vk-r { fill: #fbbf24 !important; } .vk-b.vk-r { fill: #b45309 !important; }
.vk-x { fill: color-mix(in srgb, var(--white-key) 70%, var(--border-2)) !important; }
.vk-lab { font: 800 10px var(--font); fill: #6b6e86; } .vk-lab.on { fill: #1e1b4b; } .vk-lab-b { fill: #fff; font-size: 7.5px; }
.vk-fing { fill: var(--primary); } .vk-fing.l { fill: var(--lh); }
.vk-fing-t { font: 800 12px var(--font); fill: #fff; }
.vk-star { font: 900 14px var(--font); fill: #b45309; }
.vk-arc { fill: none; stroke: var(--primary); stroke-width: 2.4; } .vk-arc.alt { stroke: var(--warn); }
.vk-ah { fill: var(--primary); }
.vk-arc-t { font: 800 10px var(--font); fill: var(--primary); } .vk-arc-t.alt { fill: var(--warn); }
/* hands */
.hands { max-width: 380px !important; }
.hands .palm { fill: #f6d3b8; stroke: #d9a47e; stroke-width: 2; }
.hands .finger-out { stroke: #d9a47e; stroke-width: 19; stroke-linecap: round; }
.hands .finger-in { stroke: #f6d3b8; stroke-width: 15; stroke-linecap: round; }
.hands .tip { fill: var(--surface); stroke: var(--primary); stroke-width: 2.5; }
.hands .L .tip { stroke: var(--lh); }
.hands .tip.on { fill: var(--primary); }
.hands .tip-t { font: 900 12px var(--font); fill: var(--text); }
.hands .hand-lab { font: 700 11px var(--font); fill: var(--muted); }
/* rhythm */
.beats { max-width: 520px !important; }
.bt-grid { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 3 4; } .bt-grid.bar { stroke: var(--text-2); stroke-dasharray: none; stroke-width: 1.5; }
.bt-block { fill: var(--primary); opacity: .85; transition: transform .1s, opacity .1s; }
.bt-block.k-h, .bt-block.k-hd { fill: #0d9f8f; } .bt-block.k-w { fill: #d97706; } .bt-block.k-e { fill: #db2777; } .bt-block.k-qd { fill: #2563eb; }
.bt-block.rest { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; opacity: 1; }
.bt-block.lit { opacity: 1; filter: brightness(1.25); }
.bt-lab { font: 800 12px var(--font); fill: #fff; } .bt-block.rest + .bt-lab { fill: var(--muted); }
.bt-head { fill: none; stroke: var(--staff); stroke-width: 1.8; } .bt-head.f { fill: var(--staff); }
.bt-stem { stroke: var(--staff); stroke-width: 1.6; fill: none; } .bt-dot, .bt-rest-f { fill: var(--staff); } .bt-rest { fill: none; stroke: var(--staff); stroke-width: 2.4; }
.bt-count { font: 800 13px var(--font); fill: var(--text-2); } .bt-count.and { fill: var(--muted); font-weight: 600; }
/* misc visuals */
.dyn { display: flex; align-items: flex-end; gap: 8px; height: 170px; width: 100%; max-width: 440px; }
.dyn-col { flex: 1; display: grid; justify-items: center; align-content: end; gap: 4px; height: 100%; }
.dyn-col i { width: 100%; height: calc(var(--h) * 110px); border-radius: 8px 8px 4px 4px; background: linear-gradient(var(--primary), color-mix(in srgb, var(--primary) 40%, var(--surface))); }
.dyn-col b { font: italic 900 1.15rem Georgia, serif; } .dyn-col small { font-size: .65rem; color: var(--muted); text-align: center; line-height: 1.1; }
.tempo-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 460px; }
.tempo-scale > div { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.tempo-scale .emo { font-size: 2rem; } .tempo-scale small { color: var(--muted); font-size: .72rem; }
.pedal-tl { max-width: 460px !important; } .pt-chord { fill: var(--primary); } .pt-t { font: 800 14px var(--font); fill: #fff; } .pt-line { fill: none; stroke: var(--warn); stroke-width: 4; stroke-linejoin: round; } .pt-s { font: 700 11px var(--font); fill: var(--text-2); } .pt-s.up { fill: var(--warn); }
.bigword { display: grid; justify-items: center; margin-bottom: 6px; } .bigword b { font-size: 3rem; font-weight: 900; color: var(--primary); line-height: 1; } .bigword small { color: var(--muted); font-weight: 700; }
.vchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0; }
.vchip { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--border-2); font-weight: 750; font-size: .95rem; }
.vchip.w { border-color: var(--primary); color: var(--primary); } .vchip.l { border-color: var(--lh); color: var(--lh); }
.tb { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; max-width: 420px; }
.tb span { display: grid; place-items: center; padding: 12px 0 6px; border-radius: 10px; font-weight: 900; color: #fff; position: relative; }
.tb span small { font-size: .62rem; opacity: .8; font-weight: 700; }
.tb-C { background: #5b5bd6; } .tb-F { background: #0d9f8f; } .tb-G { background: #d97706; }
.stepseq { display: flex; gap: 4px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.stepseq span { padding: 6px 10px; border-radius: 8px; font-weight: 800; font-size: .8rem; background: var(--primary); color: #fff; } .stepseq span.h { background: var(--warn); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; width: 100%; }
.vs-mid { font-weight: 900; color: var(--muted); }
.vs-lab, .vlab-t { text-align: center; font-weight: 800; font-size: .9rem; margin-bottom: 4px; }
.vrow { display: flex; gap: 10px; width: 100%; justify-content: center; flex-wrap: wrap; }
.vrow > * { flex: 1; min-width: 140px; max-width: 280px; }
.vlab svg { width: 100%; height: auto; }

/* listen button */
.listen-btn { font: inherit; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .85rem; cursor: pointer; flex: none; white-space: nowrap; }
.listen-btn:hover { border-color: var(--primary); }
.listen-btn.pending { border-color: var(--warn); color: var(--warn); }
.listen-btn.on { background: var(--good-soft); border-color: transparent; color: var(--good); }
.listen-btn .lvl { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; width: 16px; }
.listen-btn .lvl i { flex: 1; background: currentColor; border-radius: 2px; height: calc(25% + var(--l) * 75%); transition: height .08s; }
.listen-btn .lvl i:nth-child(2) { height: calc(35% + var(--l) * 65%); }
.listen-btn .lvl i:nth-child(3) { height: calc(15% + var(--l) * 60%); }
@media (max-width: 760px) { .player-head .listen-btn span:last-child { display: none; } .player-head .listen-btn { padding: 0 11px; } }

/* keyboard navigation (when wider than the screen) */
.kb-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kb-arrow { width: 44px; height: 36px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: 800 1.3rem/1 var(--font); cursor: pointer; flex: none; }
.kb-arrow:disabled { opacity: .35; }
.kb-map { position: relative; flex: 1; height: 36px; border-radius: 8px; overflow: hidden; cursor: grab; touch-action: none; border: 1px solid var(--border-2); }
.kb-map-keys { position: absolute; inset: 0; background-color: var(--white-key); background-image: linear-gradient(90deg, transparent calc(100% - 1px), var(--white-key-edge) 0); }
.kb-map-dots i { position: absolute; bottom: 4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--white-key); }
.kb-window { position: absolute; top: 0; bottom: 0; border: 3px solid var(--primary); border-radius: 7px; background: color-mix(in srgb, var(--primary) 14%, transparent); pointer-events: none; transition: left .15s; }

/* posture coach */
.posture { display: grid; gap: var(--s4); }
.posture-stage { display: grid; gap: var(--s3); }
.posture-head h3 { font-size: 1.15rem; margin-top: 2px; }
.do-avoid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s3) 0; }
.do-avoid figure { position: relative; margin: 0; padding: 30px 8px 10px; border-radius: var(--r); background: var(--surface-2); border: 2px solid var(--border); text-align: center; }
.do-avoid figure.do { border-color: color-mix(in srgb, var(--good) 55%, var(--border)); background: color-mix(in srgb, var(--good-soft) 45%, var(--surface)); }
.do-avoid figure.avoid { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.do-avoid figcaption { font-size: .82rem; font-weight: 650; color: var(--text-2); margin-top: 4px; line-height: 1.3; }
.fig-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.fig-badge.good { background: var(--good); color: #fff; } .fig-badge.bad { background: var(--bad); color: #fff; }
.ill { width: 100%; height: auto; display: block; max-height: 190px; }
.ill .ill-body, .ill .ill-good, .ill .ill-bad { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-body { stroke: var(--text-2); }
.ill .ill-good { stroke: var(--good); }
.ill .ill-bad { stroke: var(--bad); }
.ill .thick { stroke-width: 12; } .ill .thin { stroke-width: 4; }
.ill .ill-head { fill: var(--surface); stroke: var(--text-2); stroke-width: 5; }
.ill .ill-floor { stroke: var(--border-2); stroke-width: 3; }
.ill .ill-piano { fill: var(--surface); stroke: var(--border-2); stroke-width: 3; }
.ill .ill-keys { fill: var(--white-key); stroke: var(--white-key-edge); stroke-width: 2; }
.ill .ill-keytop { fill: var(--black-key); }
.ill .ill-keyline { stroke: var(--border-2); stroke-width: 2; }
.ill .ill-pedal { stroke: var(--gold); stroke-width: 5; stroke-linecap: round; }
.ill .ill-bench { fill: var(--muted); }
.ill .ill-bench-leg { stroke: var(--muted); stroke-width: 4; }
.ill .ill-good-fill { fill: var(--good); } .ill .ill-bad-fill { fill: var(--bad); }
.ill .ill-guide { fill: none; stroke: var(--good); stroke-width: 2.5; stroke-dasharray: 5 5; }
.ill .ill-dot-good { fill: var(--good); }
.posture-tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--text); font-size: .95rem; margin: 0; }
.posture-tip .icon { color: var(--warn); margin-top: 2px; }
.posture-actions { margin-top: var(--s3); }
.mirror-wrap { position: relative; }
.mirror-wrap video.mirror { max-height: 300px; }
.mirror-tip { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .85rem; font-weight: 600; }
.check-item { font: inherit; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; }
.check-item .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; color: transparent; flex: none; }
.check-item.cur { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.check-item.done { color: var(--good); background: var(--good-soft); border-color: transparent; }
.check-item.done .tick { background: var(--good); border-color: var(--good); color: #fff; }

/* staff */
.staff-box, .sheet-strip { overflow-x: auto; margin: var(--s2) 0; border-radius: var(--r); }
.staff-box { background: var(--surface-2); border: 1px solid var(--border); padding: 4px 8px; }
.staff-svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.staff-line, .ledger, .bar-line, .stem { stroke: var(--staff); stroke-width: 1; }
.ledger { stroke-width: 1.2; } .bar-line { stroke-width: 1.2; } .stem { stroke-width: 1.3; }
.clef, .timesig, .accidental, .rest-glyph { fill: var(--staff); font-family: "Noto Music", "Bravura", "Segoe UI Symbol", "Apple Symbols", serif; }
.timesig { font: 800 20px Georgia, serif; }
.notehead { fill: none; stroke: var(--staff); stroke-width: 1.6; transition: fill .15s, stroke .15s; }
.notehead.filled { fill: var(--staff); }
.dot, .rest, .clef-fill { fill: var(--staff); }
.clef-stroke { fill: none; stroke: var(--staff); stroke-width: 2.6; stroke-linecap: round; }
.brace-path { stroke-width: 2.2; }
.flag { fill: none; stroke: var(--staff); stroke-width: 2; }
.finger-num { font: 700 11px var(--font); fill: var(--muted); }
.note-label { font: 700 11px var(--font); fill: var(--muted); }
.lyric { font: 12px var(--font); fill: var(--muted); }
.current.notehead { stroke: var(--primary); } .current.notehead.filled, .current.dot { fill: var(--primary); } .current.stem, .current.flag { stroke: var(--primary); } .current.accidental, .current.finger-num { fill: var(--primary); }
.good.notehead { stroke: var(--good); } .good.notehead.filled, .good.dot { fill: var(--good); } .good.stem, .good.flag { stroke: var(--good); } .good.accidental { fill: var(--good); }
.bad.notehead { stroke: var(--bad); } .bad.notehead.filled, .bad.dot { fill: var(--bad); } .bad.stem, .bad.flag { stroke: var(--bad); } .bad.accidental { fill: var(--bad); }

/* keyboard */
.kb-wrap { margin-top: var(--s3); }
.kb-scroll { overflow-x: auto; scrollbar-width: none; border-radius: 10px 10px 12px 12px; }
.kb-scroll::-webkit-scrollbar { display: none; }
.keyboard { position: relative; height: 160px; user-select: none; -webkit-user-select: none; touch-action: none; background: var(--black-key); padding-top: 5px; border-radius: 10px 10px 12px 12px; box-shadow: 0 10px 24px -14px rgba(0,0,0,.5); }
.keys-in { position: relative; height: 100%; }
.key { position: absolute; top: 0; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; transition: background .06s, transform .06s; }
.key.white { height: 100%; background: linear-gradient(var(--white-key) 86%, color-mix(in srgb, var(--white-key) 88%, #000)); border: 1px solid var(--white-key-edge); border-top: none; border-radius: 0 0 7px 7px; z-index: 1; }
.key.black { height: 62%; background: linear-gradient(#2d2f48, var(--black-key)); border-radius: 0 0 5px 5px; z-index: 2; box-shadow: inset 0 -5px 0 rgba(255,255,255,.08), 0 2px 3px rgba(0,0,0,.35); }
.key .label { font-size: 10px; color: #6b6e86; margin-bottom: 6px; font-weight: 700; pointer-events: none; }
.key .qlabel { font-size: 9px; color: #9a9db3; position: absolute; top: 6px; font-weight: 600; pointer-events: none; }
.key .finger { position: absolute; bottom: 26px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 12px var(--font); color: #fff; background: rgba(0,0,0,.22); pointer-events: none; }
.key .finger:empty { display: none; }
.key.white.target { background: var(--target); border-color: color-mix(in srgb, var(--target) 70%, #000); }
.key.black.target { background: #4f46e5; }
.key.white.hint { background: var(--hint); } .key.black.hint { background: #0f766e; }
.key.white.root { background: #fbbf24; } .key.black.root { background: #b45309; }
.key.pressed { transform: translateY(2px); }
.key.white.pressed { background: #c7cbff; } .key.black.pressed { background: #5b5bd6; }
.key.white.good { background: #7ee2a1 !important; } .key.black.good { background: #15a34a !important; }
.key.white.bad { background: #ff9aa8 !important; } .key.black.bad { background: #e0384f !important; }
.key.white.target .label, .key.white.hint .label, .key.white.root .label { color: rgba(0,0,0,.55); }

/* ---------- player ---------- */
.player { display: flex; flex-direction: column; gap: var(--s3); }
.player-head { display: flex; align-items: center; gap: var(--s2); }
.player-head .title { flex: 1; min-width: 0; }
.player-head h2 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-head .sub { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-chip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--bg-2); font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.score-chip .acc { font-size: 1.05rem; }
.score-chip .combo { color: var(--warn); font-size: .85rem; display: inline-flex; align-items: center; gap: 2px; }
.score-chip .combo:empty { display: none; }
.transport { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.play-btn { width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px -8px var(--primary); transition: transform .08s; flex: none; }
.play-btn:active { transform: scale(.94); }
.tempo-ctl { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border-radius: 12px; padding: 3px; }
.tempo-ctl button { width: 34px; height: 34px; border: none; border-radius: 9px; background: transparent; color: var(--text); font: 700 1.1rem var(--font); cursor: pointer; }
.tempo-ctl button:hover { background: var(--surface); }
.tempo-ctl span { min-width: 4rem; text-align: center; font-weight: 750; font-size: .88rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tempo-ctl span small { display: block; font-size: .65rem; color: var(--muted); font-weight: 600; }
.bars { display: flex; gap: 4px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.bar-cell { --heat: 0; flex: none; font: 700 .72rem var(--font); width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; color: var(--text-2); background: color-mix(in srgb, var(--bad) calc(var(--heat) * 55%), var(--surface)); }
.bar-cell.looped { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); }
.bar-cell.cur { outline: 2px solid var(--primary); outline-offset: 1px; }
.loop-row { display: flex; align-items: center; gap: var(--s2); min-height: 32px; flex-wrap: wrap; }
.hintline { flex: 1; min-width: 0; font-size: .88rem; font-weight: 650; color: var(--text-2); }
.hintline.good { color: var(--good); } .hintline.bad { color: var(--bad); }
.stage-area { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.player .sheet-strip { margin: 0; padding: 4px 8px; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--surface-2); }
.fall-wrap { position: relative; height: 280px; background: linear-gradient(var(--surface), color-mix(in srgb, var(--primary-soft) 70%, var(--surface))); }
.fall-wrap canvas { width: 100%; height: 100%; display: block; }
.player .kb-wrap { margin: 0; }
.player .keyboard { border-radius: 0; box-shadow: none; }
.overlay-count { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 5rem; font-weight: 900; color: var(--primary); opacity: 0; z-index: 3; }
.overlay-count.show { animation: countIn .55s var(--ease); }
@keyframes countIn { 0% { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.rotate-tip { display: none; }
.result-card { text-align: center; }
.result-card .ring { margin: var(--s3) auto; }
.result-card .ring b { font-size: 2rem; font-weight: 850; }
.result-card .row { justify-content: center; }
.result-card p { color: var(--text-2); }
.player.focus { position: fixed; inset: 0; z-index: 70; background: var(--bg); padding: calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom)); overflow: auto; }
.player.focus .stage-area { flex: 1; min-height: 0; }
.player.focus .fall-wrap { flex: 1; height: auto; min-height: 120px; }
.player.focus .bars, .player.focus .rotate-tip { display: none; }

/* tools */
.metro-display { text-align: center; padding: var(--s4) 0; }
.metro-display .bpm { font-size: 4.2rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; display: block; }
.cof-wrap { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: center; }
.cof { width: 320px; max-width: 100%; margin: 0 auto; }
.cof-key circle { fill: var(--bg-2); stroke: var(--border-2); cursor: pointer; transition: fill .15s; }
.cof-key:hover circle { fill: var(--primary-soft); }
.cof-key text { fill: var(--text); font: 700 13px var(--font); pointer-events: none; }
.cof-key text.minor { font-size: 10px; fill: var(--muted); }
.cof-key.sel circle { fill: var(--primary); stroke: var(--primary); }
.cof-key.sel text:not(.minor) { fill: var(--on-primary); }
.cof-info { flex: 1; min-width: 260px; }
.settings-group h3 { margin: var(--s5) 0 var(--s2); }
.settings-group h3:first-child { margin-top: 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--border); font-weight: 600; flex-wrap: wrap; }
.settings-row small { display: block; font-weight: 400; color: var(--muted); }

/* input sheet */
.input-option { display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r); border: 1px solid var(--border); transition: border-color .2s, background .2s; }
.input-option + .input-option { margin-top: var(--s3); }
.input-option.live { border-color: var(--good); background: color-mix(in srgb, var(--good-soft) 50%, var(--surface)); }
.input-option header { display: flex; align-items: center; gap: var(--s3); }
.input-option header > div { flex: 1; min-width: 0; }
.input-option header small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.35; }
.note-test { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s4); padding: var(--s4); border-radius: var(--r); background: var(--bg-2); min-height: 76px; color: var(--muted); font-weight: 600; }
.note-test b { font-size: 2rem; font-weight: 850; color: var(--primary); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 76px 1fr; }
  .sidebar { padding: var(--s4) 10px; align-items: center; }
  .sidebar .brand { padding: 0 0 var(--s4); }
  .brand-text, .side-nav a span, .side-foot { display: none; }
  .side-nav a { justify-content: center; padding: 12px; }
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px; align-items: center; gap: var(--s2); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
  .topbar .brand { padding: 0; font-size: 1.02rem; flex: 1; min-width: 0; }
  .topbar .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .topbar .input-pill { width: auto; padding: 0 12px; height: 36px; border-radius: 99px; gap: 8px; }
  .topbar .input-pill .lbl span { display: none; }
  .topbar .input-pill .lbl b { max-width: 96px; font-size: .8rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--border); }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 3px; font-size: .68rem; font-weight: 700; color: var(--muted); }
  .tabbar a .icon { transition: transform .15s; }
  .tabbar a.on { color: var(--primary); }
  .tabbar a.on .icon { transform: translateY(-1px) scale(1.08); }
  main#view { padding: var(--s4) 16px calc(var(--tab-h) + var(--s6) + env(safe-area-inset-bottom)); }
  body.immersive .topbar, body.immersive .tabbar { display: none; }
  body.immersive main#view { padding: calc(10px + env(safe-area-inset-top)) 12px calc(var(--s4) + env(safe-area-inset-bottom)); }
  .card { padding: var(--s4); border-radius: var(--r); }
  .page-head { margin-bottom: var(--s4); }
  .sheet-backdrop { place-items: end stretch; padding: 0; }
  .sheet { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s3) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border-2); margin: 0 auto var(--s3); }
  .camera-row { grid-template-columns: 1fr; }
  .keyboard { height: 136px; }
  .fall-wrap { height: 220px; }
  .complete { padding: var(--s5) var(--s3); }
  .complete .stat-grid { gap: var(--s2); }
  .complete .stat { padding: var(--s2) var(--s3); }
  .continue h2 { font-size: 1.35rem; }
  .unit > summary { padding: var(--s3) var(--s4); gap: var(--s3); }
  .unit-emoji { width: 44px; height: 44px; font-size: 1.35rem; border-radius: 13px; }
  .path { padding: 0 var(--s4) var(--s3); }
  .unit-meta .badge { display: none; }
  .ex-controls { position: sticky; bottom: 0; margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); z-index: 5; }
  .ex-controls .btn { flex: 1; padding: 0 10px; }
  .player-head h2 { font-size: 1rem; }
  .transport { padding: 6px; gap: 6px; }
  .transport .seg button { padding: 0 9px; }
  body.immersive .player { min-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); gap: 8px; }
  body.immersive .player .stage-area { flex: 1; }
  body.immersive .player .fall-wrap { flex: 1; height: auto; min-height: 110px; }
  .player .sheet-strip svg { max-height: 150px; }
  .player-head .sub { display: none; }
  .loop-row { min-height: 0; }
  .loop-row .hintline:empty { display: none; }
  .rotate-tip { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-2); background: var(--warn-soft); padding: 8px 12px; border-radius: 12px; }
  .song-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
  .song-cover { height: 80px; }
  .tile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) and (orientation: landscape) { .rotate-tip { display: none; } }
@media (orientation: landscape) and (max-height: 520px) {
  .topbar { position: static; }
  .fall-wrap { height: 150px; }
  .keyboard { height: 110px; }
  .player.focus .keyboard { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- install app (PWA) ---------- */
.install-card { display: flex; align-items: center; gap: 14px; }
.install-card img { border-radius: 12px; flex: none; }
.install-card > div:nth-child(2) { flex: 1; min-width: 0; }
.install-card p { margin: 2px 0 0; }
.install-card .row { flex: none; gap: 4px; flex-wrap: nowrap; }
@media (max-width: 420px) { .install-card { flex-wrap: wrap; } .install-card .row { width: 100%; justify-content: flex-end; } }
.install-steps { padding-left: 1.2em; line-height: 1.7; }
/* installed app: respect phone notches / status bar */
@media (display-mode: standalone) { .topbar { padding-top: max(env(safe-area-inset-top), 0px); } }

/* ---------- song library / my songs ---------- */
.songs-tabs { margin: 0 0 16px; }
.songs-tabs button { flex: 1; }
.lib-search { position: relative; margin-bottom: 10px; }
.lib-search input { width: 100%; padding: 12px 14px 12px 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; }
.lib-search .lib-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.lib .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.lib .filters::-webkit-scrollbar { display: none; }
.lib .filters button { flex: none; }
.lib-count { margin: 6px 2px 10px; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-width: 0; }
.lib-row:active { transform: scale(.99); }
.lib-cover { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lib-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-credit { margin-top: 18px; line-height: 1.5; }
.import-actions { display: grid; gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .import-actions { grid-template-columns: 1fr 1fr; } }
.import-tile { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); border: 1.5px dashed var(--primary); cursor: pointer; color: var(--text); text-decoration: none; }
.import-tile > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.import-tile small { color: var(--muted); line-height: 1.35; }
.arr-row { display: flex; align-items: center; gap: 10px; padding: 0 4px 8px; flex-wrap: wrap; }
.arr-row .lic { margin-left: auto; }

/* ---------- music → song ---------- */
.transcribe h2 { margin-bottom: 6px; }
.tr-src { display: grid; gap: 10px; margin: 14px 0; }
@media (min-width: 760px) { .tr-src { grid-template-columns: 1fr 1fr; } }
.tr-src button.import-tile { font: inherit; text-align: left; width: 100%; }
.import-tile.recording { border-style: solid; border-color: var(--bad); background: var(--bad-soft); animation: rec-pulse 1.2s ease-in-out infinite; }
.tr-status { margin: 10px 0; }
.tr-status .progress { margin-bottom: 8px; }
.tr-roll { width: 100%; height: 160px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: block; margin-bottom: 10px; }
.tr-title { flex: 1; min-width: 0; max-width: 60%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.transcribe input[type=range] { max-width: 45%; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }
.songs-tabs { display: flex; width: 100%; }
.songs-tabs button { white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
