/* ==========================================================================
   MauriFret — styles
   ========================================================================== */

/* Fonts (self-hosted; licences in fonts/*): Mona Sans (GitHub) · JetBrains Mono (JetBrains) */
@font-face {
  font-family: 'Mona Sans';
  src: url('../fonts/mona-sans/MonaSans-Variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d0f13;
  --bg-2: #12151b;
  --surface: #161a21;
  --surface-2: #1c212a;
  --surface-3: #242a35;
  --border: #262c37;
  --border-2: #323a48;
  --text: #e9ebf1;
  --muted: #8b93a6;
  --faint: #5c6478;
  --accent: #f5a524;
  --accent-2: #ffbe55;
  --accent-ink: #1a1206;
  --accent-soft: rgba(245, 165, 36, 0.12);

  --c-root: #f5a524;
  --c-3: #3dd6b5;
  --c-5: #6f9cff;
  --c-7: #c48cff;
  --c-other: #3a4253;
  --c-other-ink: #e4e8ef;
  --c-char: #ff5f8f;
  --note-ink: #11131a;

  --good: #34d17e;
  --mid: #f5b941;
  --bad: #ff5d5d;

  --board-1: #241c15;
  --board-2: #1a1410;
  --fret: #a7afbf;
  --string: #c9cdd6;
  --nut: #e7dcc4;
  --inlay: rgba(255, 255, 255, 0.09);
  --hit-hover: rgba(255, 255, 255, 0.06);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  --font: 'Mona Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f6f4f0;
    --bg-2: #efece6;
    --surface: #ffffff;
    --surface-2: #f7f5f1;
    --surface-3: #eeebe5;
    --border: #e6e1d8;
    --border-2: #d8d2c6;
    --text: #1c1d22;
    --muted: #6b6f7c;
    --faint: #a2a6b2;
    --accent: #e08c00;
    --accent-2: #f5a524;
    --accent-ink: #ffffff;
    --accent-soft: rgba(224, 140, 0, 0.1);
    --c-root: #f29b0f;
    --c-3: #17b896;
    --c-5: #4a7dff;
    --c-7: #a463f2;
    --c-other: #dcd7cd;
    --c-other-ink: #2a2b31;
    --c-char: #ea3d74;
    --board-1: #efe3d0;
    --board-2: #e6d6bd;
    --fret: #9b9488;
    --string: #7d7466;
    --nut: #fdfaf2;
    --inlay: rgba(90, 60, 20, 0.14);
    --hit-hover: rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 2px rgba(30, 20, 0, 0.04), 0 8px 24px -14px rgba(30, 20, 0, 0.18);
    color-scheme: light;
  }
}
:root[data-theme='light'] {
  --bg: #f6f4f0;
  --bg-2: #efece6;
  --surface: #ffffff;
  --surface-2: #f7f5f1;
  --surface-3: #eeebe5;
  --border: #e6e1d8;
  --border-2: #d8d2c6;
  --text: #1c1d22;
  --muted: #6b6f7c;
  --faint: #a2a6b2;
  --accent: #e08c00;
  --accent-2: #f5a524;
  --accent-ink: #ffffff;
  --accent-soft: rgba(224, 140, 0, 0.1);
  --c-root: #f29b0f;
  --c-3: #17b896;
  --c-5: #4a7dff;
  --c-7: #a463f2;
  --c-other: #dcd7cd;
  --c-other-ink: #2a2b31;
  --c-char: #ea3d74;
  --board-1: #efe3d0;
  --board-2: #e6d6bd;
  --fret: #9b9488;
  --string: #7d7466;
  --nut: #fdfaf2;
  --inlay: rgba(90, 60, 20, 0.14);
  --hit-hover: rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 2px rgba(30, 20, 0, 0.04), 0 8px 24px -14px rgba(30, 20, 0, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -0.025em; }
h1 span { color: var(--muted); font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 10px; }
h3:first-child { margin-top: 0; }
h4 { font-size: 0.95rem; margin-bottom: 6px; }
p { margin: 0 0 10px; }
a, [data-go] { cursor: pointer; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
ul, ol { padding-left: 20px; margin: 0 0 10px; }
li { margin-bottom: 6px; }
button { font: inherit; color: inherit; }
select, input[type='number'] {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 38px;
}
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 100%; }
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.86rem; margin: -2px 0 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; }
.brand-name { font-weight: 800; font-size: 1.08rem; letter-spacing: -0.02em; }
.logo-bg { fill: var(--accent); }
.logo-str { fill: none; stroke: var(--accent-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.6; }
.logo-dot { fill: var(--accent-ink); }
.tabs { order: 3; width: 100%; display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -6px; padding-bottom: 2px; } /* wraps instead of scrolling: every section always visible */
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none;
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button.active { color: var(--accent-ink); background: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.metro { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.metro .icon-btn { width: 30px; height: 30px; border: 0; }
.metro input { width: 52px; min-height: 30px; padding: 4px; text-align: center; border: 0; background: transparent; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.metro input::-webkit-outer-spin-button, .metro input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mini { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; font-weight: 700; }
.mini:hover { color: var(--text); background: var(--surface-2); }
.mini.tap { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.metro-led { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); transition: background 0.05s; }
.metro-led.on { background: var(--c-3); box-shadow: 0 0 8px var(--c-3); }
.metro-led.on.accent { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.vol { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.vol input { width: 80px; }

/* ---------- layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 40px; }
.view { display: none; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; }
.sub { color: var(--muted); max-width: 680px; margin: 8px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
.align-start { align-items: start; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h3 { margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.center { justify-content: center; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cols-3 p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.footer { text-align: center; color: var(--faint); font-size: 0.8rem; padding: 10px 24px 30px; }
.footer p { margin: 4px 0; }
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.primary.active { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.big { padding: 12px 22px; font-size: 1rem; }
.btn.sm { padding: 5px 11px; min-height: 30px; font-size: 0.82rem; }
.btn.link { background: none; border-color: transparent; color: var(--accent); padding-left: 4px; padding-right: 4px; }
.btn.link:hover { background: var(--accent-soft); }
.ico { font-size: 0.8em; }

/* ---------- controls ---------- */
.controls { display: flex; flex-direction: column; gap: 14px; }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl > label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ctl > label output { color: var(--text); font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.ctl.inline { flex-direction: row; align-items: center; gap: 10px; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.more summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.more summary::before { content: '⚙'; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { margin-bottom: 12px; }
input[type='range'] { accent-color: var(--accent); min-width: 160px; }

.chips, .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button, .seg button {
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 0.12s;
}
.chips button:hover, .seg button:hover { border-color: var(--faint); }
.chips button.on, .seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips.keys button { min-width: 44px; font-family: var(--font); }
.chips.small button { padding: 4px 10px; min-height: 30px; font-size: 0.82rem; }
.seg { gap: 0; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 3px; flex-wrap: nowrap; width: max-content; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; min-height: 30px; padding: 4px 12px; color: var(--muted); white-space: nowrap; }
.seg button.on { color: var(--accent-ink); }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.88rem; color: var(--text); min-height: 38px; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: background 0.15s; flex-shrink: 0; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.toggle input:checked + span { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; gap: 6px; align-items: center; }
.stepper input { width: 76px; text-align: center; font-weight: 700; }

/* ---------- fretboard ---------- */
.fb-card { padding: 14px 14px 10px; }
.fb-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.fretboard { min-width: 860px; }
.fretboard svg { display: block; width: 100%; height: auto; user-select: none; }
.fretboard .fb-board { fill: var(--board-2); stroke: rgba(0, 0, 0, 0.15); }
.fb-inlay { fill: var(--inlay); }
.fb-fret { stroke: var(--fret); stroke-width: 2.2; opacity: 0.65; }
.fb-nut { fill: var(--nut); }
.fb-string { stroke: var(--string); opacity: 0.8; }
.fb-tuning { fill: var(--muted); font-size: 12px; font-weight: 700; text-anchor: middle; font-family: var(--font); }
.fb-fretnum { fill: var(--faint); font-size: 12px; font-weight: 600; text-anchor: middle; font-family: var(--font); }
.fb-hits rect { fill: transparent; cursor: pointer; }
.fb-hits rect:hover { fill: var(--hit-hover); }
.fb-note { pointer-events: none; }
.fb-note circle { fill: var(--c-other); stroke: rgba(0, 0, 0, 0.25); stroke-width: 1; transition: transform 0.12s, opacity 0.2s; transform-box: fill-box; transform-origin: center; }
.fb-note text { fill: var(--c-other-ink); font-family: var(--font); font-weight: 700; text-anchor: middle; }
.fb-note.role-root circle { fill: var(--c-root); }
.fb-note.role-third circle { fill: var(--c-3); }
.fb-note.role-fifth circle { fill: var(--c-5); }
.fb-note.role-seventh circle { fill: var(--c-7); }
.fb-note.role-root text, .fb-note.role-third text, .fb-note.role-fifth text, .fb-note.role-seventh text, .fb-note.hit text, .fb-note.miss text, .fb-note.target text, .fb-note.hint text, .fb-note.playing text { fill: var(--note-ink); }
.fb-note.char circle { stroke: var(--c-char); stroke-width: 3; }
.fb-note.ghost { opacity: 0.16; }
.fb-note.ghost text { opacity: 0.8; }
.fb-note.blank circle { fill: var(--surface-2); stroke: var(--faint); stroke-width: 1.5; }
.fb-note.playing { opacity: 1; }
.fb-note.playing circle { transform: scale(1.3); stroke: var(--text); stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--accent)); }
.fb-note.fx.playing circle { fill: var(--accent); }
.fb-note.outside circle { fill: var(--surface-3); stroke: var(--faint); }
.fb-note.outside text { fill: var(--text); }
.fb-note.target circle { fill: var(--accent); stroke: var(--text); stroke-width: 2; animation: pulse 1.2s ease-in-out infinite; }
.fb-note.hit circle { fill: var(--good); transform: scale(1.15); }
.fb-note.miss circle { fill: var(--bad); }
.fb-note.hint circle { fill: var(--mid); stroke: var(--text); stroke-dasharray: 3 2; stroke-width: 2; }
.fb-note.heat-none circle { fill: var(--surface-3); opacity: 0.6; }
.fb-note.heat-good circle { fill: var(--good); }
.fb-note.heat-mid circle { fill: var(--mid); }
.fb-note.heat-bad circle { fill: var(--bad); }
.fb-note.heat-good text, .fb-note.heat-mid text, .fb-note.heat-bad text { fill: var(--note-ink); }
@keyframes pulse { 50% { transform: scale(1.18); } }
.fb-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 6px 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: var(--c-other); }
.dot.role-root { background: var(--c-root); }
.dot.role-third { background: var(--c-3); }
.dot.role-fifth { background: var(--c-5); }
.dot.role-seventh { background: var(--c-7); }
.dot.ring { background: transparent; border: 2.5px solid var(--c-char); }
.focus { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.focus button { border: 1px solid var(--border-2); background: none; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.focus button:hover { color: var(--text); }
.focus button.on { color: var(--accent); border-color: var(--accent); }

/* ---------- explore info ---------- */
.degchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.degchip {
  min-width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: var(--c-other);
  color: var(--c-other-ink);
  transition: transform 0.1s, opacity 0.15s;
}
.degchip:hover { transform: translateY(-2px); }
.degchip.role-root { background: var(--c-root); color: var(--note-ink); }
.degchip.role-third { background: var(--c-3); color: var(--note-ink); }
.degchip.role-fifth { background: var(--c-5); color: var(--note-ink); }
.degchip.role-seventh { background: var(--c-7); color: var(--note-ink); }
.degchip.char { box-shadow: 0 0 0 3px var(--c-char); }
.degchip.off { opacity: 0.25; }
.notes-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.note-pill { padding: 4px 12px; border-radius: 999px; font-weight: 700; background: var(--surface-3); border: 1px solid var(--border-2); }
.note-pill.role-root { border-color: var(--c-root); color: var(--c-root); }
.note-pill.char { box-shadow: 0 0 0 1px var(--c-char) inset; color: var(--c-char); }
.tip { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 0.92rem; }
.tip strong { display: block; color: var(--accent); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.chord-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; text-align: left; transition: all 0.12s; }
.chord-btn:hover { border-color: var(--faint); transform: translateY(-1px); }
.chord-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.chord-btn .rn { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.chord-btn .cn { font-weight: 700; }

/* ---------- practice ---------- */
.subnav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.subnav button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; }
.subnav button strong { font-size: 0.95rem; }
.subnav button span { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.subnav button:hover { border-color: var(--border-2); }
.subnav button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.pr-panel { display: none; }
.pr-panel.active { display: block; animation: fade 0.2s ease; }
.prompt-card { text-align: center; }
.prompt { font-size: 1.15rem; font-weight: 500; margin-bottom: 12px; }
.prompt .big { display: inline-block; font-size: 2rem; font-weight: 800; color: var(--accent); margin: 0 6px; vertical-align: middle; }
.prompt .big.deg { min-width: 54px; background: var(--accent-soft); border-radius: 12px; padding: 0 10px; }
.answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0; }
.btn.ans { min-width: 64px; justify-content: center; }
.btn.ans.good { background: var(--good); border-color: var(--good); color: #062012; }
.btn.ans.bad { background: var(--bad); border-color: var(--bad); color: #2a0606; }
.feedback { min-height: 26px; margin: 8px 0; }
.feedback .btn { margin-left: 6px; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; min-width: 92px; }
.stat .v { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.coach ul, .coach ol { color: var(--muted); }
.coach strong { color: var(--text); }
.coach p { color: var(--muted); }
.iv-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.iv-cell { position: relative; overflow: hidden; display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; }
.iv-cell i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--faint); }
.iv-cell.good i { background: var(--good); }
.iv-cell.mid i { background: var(--mid); }
.iv-cell.bad i { background: var(--bad); }

/* tab */
.tab-wrap { overflow-x: auto; }
.tab { display: flex; flex-wrap: wrap; gap: 0 0; font-family: var(--mono); font-size: 0.86rem; row-gap: 14px; }
.tab-beat { display: flex; border-left: 1px solid var(--border-2); padding: 0 6px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 10px, var(--border-2) 10px, var(--border-2) 11px, transparent 11px, transparent 21px); }
.tab-names { border-left: 0; background: none; flex-direction: column; color: var(--muted); padding-right: 8px; }
.tab-names span { height: 21px; line-height: 21px; font-weight: 700; }
.tab-col { display: flex; flex-direction: column; min-width: 22px; align-items: center; border-radius: 6px; transition: background 0.08s; }
.tab-col span { height: 21px; line-height: 21px; font-weight: 700; padding: 0 2px; }
.tab-col span:not(:empty) { background: var(--surface); }
.tab-col.now { background: var(--accent); }
.tab-col.now span { background: transparent; color: var(--accent-ink); }
.spark { display: block; margin: 12px 0 6px; max-width: 100%; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); }

/* ---------- improvise ---------- */
.prog-card { padding: 16px 20px; }
.prog-desc { font-size: 0.93rem; }
.tag { display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-right: 6px; vertical-align: 1px; }
.prog-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pchord { --p: 0; position: relative; flex: 1 1 0; min-width: 72px; display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; overflow: hidden; transition: border-color 0.15s, background 0.15s; text-align: left; }
.pchord:hover { border-color: var(--faint); }
.pchord.on { border-color: var(--accent); background: var(--accent-soft); }
.pc-name { font-weight: 800; font-size: 1.02rem; white-space: nowrap; }
.pc-rn { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.pc-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p) * 100%); background: var(--accent); transition: width 0.2s linear; }
.pchord:not(.on) .pc-bar { width: 0; }
.now-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.now-grid > .card { margin-bottom: 0; }
.now-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.now-chord { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.now-rn { color: var(--muted); font-weight: 600; }
.now-scale { margin: 12px 0; font-size: 1.02rem; }
.now-scale strong { color: var(--accent); }
.now-tones { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tone { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 6px 10px; border-radius: 12px; background: var(--c-other); color: var(--c-other-ink); }
.tone b { font-size: 1.05rem; }
.tone small { font-size: 0.72rem; font-weight: 700; opacity: 0.8; }
.tone.role-root { background: var(--c-root); color: var(--note-ink); }
.tone.role-third { background: var(--c-3); color: var(--note-ink); }
.tone.role-fifth { background: var(--c-5); color: var(--note-ink); }
.tone.role-seventh { background: var(--c-7); color: var(--note-ink); }
.now-guide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.92rem; min-height: 30px; }
.gt { padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--border-2); font-weight: 700; }
.gt small { font-size: 0.7rem; color: var(--muted); margin-left: 3px; font-weight: 600; }
.gt em { color: var(--c-3); font-style: normal; font-size: 0.72rem; }
.cr-badge { font-weight: 700; padding: 6px 12px; border-radius: 999px; font-size: 0.9rem; }
.cr-badge:empty { display: none; }
.cr-badge.listen { background: var(--surface-3); }
.cr-badge.yours { background: var(--accent); color: var(--accent-ink); }
.challenge-card { display: flex; flex-direction: column; }
.challenge-card p { font-size: 1.05rem; font-weight: 500; flex: 1; }
.challenge-card .btn { align-self: flex-start; }
.c3 { color: var(--c-3); font-weight: 700; }
.c7 { color: var(--c-7); font-weight: 700; }

/* ---------- plan ---------- */
.plan-top { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-bottom: 8px; }
.plan-top > .card { margin-bottom: 0; }
.overview { display: flex; gap: 20px; align-items: flex-start; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.5s; }
.ring text { fill: var(--text); font-weight: 800; font-size: 15px; font-family: var(--font); }
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; max-width: 300px; margin: 8px 0; }
.cal i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.cal i.on { background: var(--accent); }
.streak-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.blocks { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.block { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.block.now { border-color: var(--accent); }
.block.done { opacity: 0.55; }
.block p { margin: 6px 0 4px; color: var(--muted); }
.b-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.b-bar { height: 3px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.b-bar i { display: block; height: 100%; background: var(--accent); }
.timer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.clock { font-family: var(--mono); font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.phase { margin: 28px 0 8px; }
.phase h2 { margin-bottom: 4px; }
.weeks { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.week { padding: 0; margin: 0; overflow: hidden; }
.week-head { width: 100%; display: grid; grid-template-columns: 52px 1fr 120px 44px; align-items: center; gap: 14px; padding: 14px 18px; background: none; border: 0; cursor: pointer; text-align: left; }
.week-head:hover { background: var(--surface-2); }
.wk-num { font-weight: 800; color: var(--muted); font-family: var(--mono); }
.wk-title { font-weight: 700; }
.wk-prog { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.wk-prog i { display: block; height: 100%; background: var(--accent); }
.wk-count { color: var(--muted); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.week.current { border-color: var(--accent); }
.week.current .wk-num { color: var(--accent); }
.week.complete .wk-num { color: var(--good); }
.week.complete .wk-prog i { background: var(--good); }
.week-body { padding: 0 18px 16px 84px; }
.wk-focus { color: var(--muted); font-style: italic; }
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); margin: 0; }
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check input { position: absolute; opacity: 0; }
.check span { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-2); margin-top: 1px; display: grid; place-items: center; transition: all 0.12s; }
.check input:checked + span { background: var(--good); border-color: var(--good); }
.check input:checked + span::after { content: '✓'; color: #062012; font-size: 13px; font-weight: 900; }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check em { font-style: normal; }
.check input:checked ~ em { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }

/* ---------- theory ---------- */
.circle-wrap { max-width: 400px; margin: 0 auto; }
.circle { width: 100%; height: auto; display: block; }
.circle .seg { fill: var(--surface-2); stroke: var(--surface); stroke-width: 2; cursor: pointer; transition: fill 0.15s; }
.circle .seg.min { fill: var(--surface-3); }
.circle .seg:hover { fill: var(--border-2); }
.circle .seg.on { fill: var(--accent); }
.seg-t { fill: var(--text); text-anchor: middle; font-family: var(--font); font-weight: 700; pointer-events: none; }
.seg-t.maj { font-size: 14px; }
.seg-t.min { font-size: 10.5px; fill: var(--muted); }
.seg-t.on { fill: var(--accent-ink); }
.center-t { fill: var(--text); font-size: 20px; font-weight: 800; text-anchor: middle; font-family: var(--font); }
.center-s { fill: var(--muted); font-size: 9px; text-anchor: middle; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font); }
.key-title { font-size: 1.8rem; margin-bottom: 12px; }
.facts { color: var(--muted); margin-top: 16px; }
.facts strong { color: var(--text); }
.ladder { display: flex; flex-direction: column; gap: 6px; }
.rung { --b: 1; display: grid; grid-template-columns: minmax(200px, 1.1fr) 2fr auto; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) calc(var(--b) * 22%), transparent), transparent 70%); }
.rung-name { display: flex; flex-direction: column; }
.rung-degs { display: flex; gap: 6px; flex-wrap: wrap; }
.rung-degs .deg { min-width: 38px; text-align: center; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border-2); font-weight: 700; font-size: 0.88rem; }
.rung-degs .deg.char { border-color: var(--c-char); color: var(--c-char); }
.rung-degs .deg.changed { background: var(--c-char); color: #fff; border-color: var(--c-char); }
.rung-act { display: flex; gap: 4px; }
.lessons details { border-top: 1px solid var(--border); }
.lessons details:first-child { border-top: 0; }
.lessons summary { cursor: pointer; padding: 14px 4px; font-weight: 700; font-size: 1.02rem; list-style: none; display: flex; align-items: center; gap: 14px; }
.lessons summary::-webkit-details-marker { display: none; }
.lessons summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 1.3rem; font-weight: 400; transition: transform 0.2s; }
.lessons details[open] summary::after { transform: rotate(45deg); }
.ln-num { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; }
.lesson-body { padding: 0 4px 16px 44px; color: var(--muted); max-width: 820px; }
.lesson-body strong, .lesson-body em { color: var(--text); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { text-align: center; padding: 40px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .subnav { grid-template-columns: repeat(3, 1fr); }
  .vol { display: none; }
}
@media (max-width: 900px) {
  .grid-2, .now-grid, .plan-top, .cols-3 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; width: 100%; margin-right: 0; }
  .top-actions { margin-left: auto; }
  .rung { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  main { padding: 18px 16px 32px; }
  .card { padding: 16px; border-radius: 14px; }
  .subnav { grid-template-columns: repeat(2, 1fr); }
  .subnav button span { display: none; }
  .metro .tap { display: none; }
  .week-head { grid-template-columns: 40px 1fr 40px; }
  .wk-prog { display: none; }
  .week-body { padding: 0 16px 14px 16px; }
  .now-chord { font-size: 2rem; }
  .lesson-body { padding-left: 4px; }
  .chips.keys button { min-width: 40px; padding: 4px 8px; }
  .prompt .big { font-size: 1.6rem; }
  .fb-card { padding: 10px 8px 8px; }
  .fretboard { min-width: 760px; }
  .view-head .head-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- analyzer ---------- */
.an-form { display: flex; gap: 10px; }
.an-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.an-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.an-syntax { margin: 12px 0; }
.an-examples { margin-top: 4px; }
.an-error { color: var(--bad); margin-top: 10px; font-size: 0.9rem; }
.an-error:empty { display: none; }
.an-summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.an-key-name { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent); }
.an-key-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.an-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.an-chord { flex: 1 1 0; min-width: 96px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; }
.an-chord:hover { border-color: var(--faint); }
.an-chord.on { border-color: var(--accent); background: var(--accent-soft); }
.an-cn { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.an-rn { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ftag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.ftag.diatonic { background: color-mix(in srgb, var(--c-3) 18%, transparent); color: var(--c-3); }
.ftag.secondary { background: color-mix(in srgb, var(--c-5) 18%, transparent); color: var(--c-5); }
.ftag.tritone { background: color-mix(in srgb, var(--c-char) 18%, transparent); color: var(--c-char); }
.ftag.borrowed { background: color-mix(in srgb, var(--c-7) 18%, transparent); color: var(--c-7); }
.ftag.harmonic { background: var(--accent-soft); color: var(--accent); }
.ftag.passing { background: color-mix(in srgb, var(--mid) 18%, transparent); color: var(--mid); }
.ftag.blues { background: color-mix(in srgb, var(--c-5) 14%, transparent); color: var(--c-5); }
.ftag.chromatic { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.now-rn .ftag { font-size: 0.75rem; vertical-align: 1px; white-space: normal; }
.an-opts { display: flex; flex-direction: column; gap: 8px; }
.an-opt { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.an-opt:hover { border-color: var(--faint); }
.an-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.an-opt p { margin: 6px 0 0; }
.an-opt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.an-opt-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cov { width: 90px; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; flex-shrink: 0; }
.cov i { display: block; height: 100%; background: var(--accent); }
.fit { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fit.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.fit.safe { background: color-mix(in srgb, var(--c-5) 18%, transparent); color: var(--c-5); }
.fit.care { background: color-mix(in srgb, var(--mid) 20%, transparent); color: var(--mid); }
.clash { color: var(--text); border-left: 3px solid var(--mid); padding-left: 8px; }
.an-why { color: var(--muted); margin: 10px 0 12px; }
.an-scales { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.an-scales.more { margin-top: 8px; }
.an-scales.more .an-scbtn strong { font-weight: 600; font-size: 0.88rem; }
.an-scbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; text-align: left; }
.an-scbtn:hover { border-color: var(--faint); }
.an-scbtn.on { border-color: var(--accent); background: var(--accent-soft); }
.an-fb-head { padding: 4px 6px 10px; }
.an-theory { max-width: 860px; }
.an-theory h4 { margin: 18px 0 8px; }
.an-theory ul, .an-theory ol { color: var(--muted); }
.an-theory li strong, .an-theory p strong { color: var(--text); }
.an-theory em { color: var(--text); }
.table-wrap { overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.an-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.an-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.an-table tbody tr { cursor: pointer; }
.an-table tbody tr:hover { background: var(--surface-2); }
.an-table tbody tr.on { background: var(--accent-soft); }
.an-table .ftag { white-space: normal; }
@media (max-width: 640px) {
  .an-form { flex-direction: column; }
  .an-key-name { font-size: 1.9rem; }
}

/* ---------- analyzer focus view (pop-up) ---------- */
body.fx-lock { overflow: hidden; }
.fx { position: fixed; inset: 0; z-index: 90; display: flex; align-items: stretch; justify-content: center; padding: 20px; background: rgba(5, 6, 9, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.2s ease; outline: none; }
.fx-panel { width: 100%; max-width: 1240px; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); overflow: hidden; }
.fx-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.fx-title { min-width: 0; flex: 1; }
.fx-title .eyebrow { margin: 0 0 2px; }
.fx-title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-ctl { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.fx-close { flex-shrink: 0; font-size: 1rem; }
.fx-body { flex: 1; overflow-y: auto; padding: 16px 18px 8px; }
.fx-strip { margin-bottom: 14px; }
.fx-strip .an-chord { --p: 0; position: relative; overflow: hidden; min-width: 72px; padding: 8px 10px 10px; }
.fx-prog { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p) * 100%); background: var(--accent); transition: width 0.15s linear; }
.fx-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.fx-main > .card { margin-bottom: 0; }
.fx-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 4px; }
.fx-label .small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.fx-next .fx-label { color: var(--muted); }
.fx-chord { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.fx-chord.sm { font-size: 2.2rem; }
.fx-scale { display: flex; flex-direction: column; gap: 2px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.fx-scale strong { font-size: 1.35rem; color: var(--accent); letter-spacing: -0.01em; }
.fx-beats { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-beats i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-2); transition: background 0.1s, border-color 0.1s; }
.fx-beats i.on { background: var(--accent); border-color: var(--accent); }
.fx-next { transition: border-color 0.2s, box-shadow 0.2s; }
.fx.soon .fx-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fx.soon .fx-next .fx-label { color: var(--accent); }
.fx-switch { margin: 12px 0 4px; }
.fx-switch strong { color: var(--accent); }
.fx-change b { color: var(--text); }
.fx-change s { color: var(--muted); }
.fx-fbcard { margin-bottom: 16px; }
.dot.nxt { background: transparent; border: 2px dashed var(--text); }
.fb-note.nxt circle { stroke: var(--text); stroke-width: 2.5; stroke-dasharray: 4 3; }
.fb-note.nxt-only circle { fill: var(--surface); }
.fb-note.nxt-only text { fill: var(--text); }
.fx.soon .fb-note.nxt circle { animation: pulse 0.6s ease-in-out infinite; }
.fx-role { margin-bottom: 12px; }
.fx-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fx-points li { margin: 0; padding-left: 12px; border-left: 3px solid var(--border-2); color: var(--muted); }
.fx-points li strong { color: var(--text); }
.fx-pt { display: block; font-weight: 700; color: var(--text); font-size: 0.88rem; }
.fx-var p { margin-bottom: 8px; }
.fx-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); }
.fx-tempo { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); margin-left: 8px; }
.fx-tempo span { white-space: nowrap; }
.fx-keys { margin-left: auto; }
@media (max-width: 900px) {
  .fx { padding: 0; }
  .fx-panel { border-radius: 0; border: 0; }
  .fx-main { grid-template-columns: 1fr; }
  .fx-head { flex-wrap: wrap; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .fx-ctl { order: 3; width: 100%; justify-content: flex-start; }
  .fx-keys { display: none; }
}
@media (max-width: 640px) {
  .fx-body { padding: 12px 12px 6px; }
  .fx-tempo { margin-left: 0; }
}

/* ---------- harmony course ---------- */
.hm-meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 8px 0 14px; }
.hm-meter.big { height: 8px; margin-bottom: 0; }
.hm-meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.4s ease; }
.hm-center { text-align: center; }
.hm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.hm-check input { accent-color: var(--accent); }
.hm-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.hm-inline select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); border-radius: 8px; padding: 5px 8px; font: inherit; }
.hm-inline input[type='range'] { accent-color: var(--accent); width: 110px; }
.hm-inline output { font-family: var(--mono); font-size: 0.78rem; min-width: 56px; }

/* course home */
.hm-overview { padding: 16px 20px; }
.hm-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.hm-unit { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color 0.15s, transform 0.15s; box-shadow: var(--shadow); }
.hm-unit:hover { border-color: var(--border-2); transform: translateY(-2px); }
.hm-unit.done { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.hm-unit.locked { opacity: 0.55; cursor: not-allowed; }
.hm-unit.locked:hover { transform: none; }
.hm-unit-num { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.hm-unit-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hm-unit-body strong { font-size: 1.02rem; }
.hm-unit-top { display: flex; align-items: center; gap: 8px; }
.hm-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.hm-pills i { font-style: normal; font-size: 0.72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.hm-pills i.on { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }

/* unit page */
.hm-unit-head { margin-bottom: 18px; }
.hm-unit-head .btn.link { margin-left: -4px; margin-bottom: 8px; }
.hm-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.hm-stepbtn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer; transition: all 0.15s; }
.hm-stepbtn > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.hm-stepbtn > span:last-child span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-stepbtn:hover { border-color: var(--border-2); }
.hm-stepbtn.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.hm-stepnum { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); font-weight: 800; font-size: 0.85rem; }
.hm-stepbtn.on .hm-stepnum { background: var(--accent); color: var(--accent-ink); }
.hm-stepbtn.done .hm-stepnum { background: var(--good); color: #062012; }

/* learn */
.hm-section h3 { display: flex; align-items: baseline; gap: 14px; margin-top: 0; }
.hm-section .lesson-body { padding-bottom: 4px; }
.hm-section .lesson-body code { font-family: var(--mono); font-size: 0.86em; color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.hm-big-formula { font-family: var(--mono); font-size: 1.02rem; color: var(--text) !important; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; text-align: center; }
.hm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: 0; background: var(--c-other); }
.hm-dot.role-root { background: var(--c-root); }
.hm-dot.role-third { background: var(--c-3); }
.hm-dot.role-fifth { background: var(--c-5); }
.hm-dot.role-seventh { background: var(--c-7); }
.hm-demo { margin: 14px 0 0 44px; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.hm-demo-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hm-chord-grid { margin-bottom: 12px; }
.hm-ci { min-height: 60px; }
.hm-ci-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.hm-ci-name { font-size: 1.5rem; font-weight: 800; }
.hm-ci-rn { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.hm-tones { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-tone { display: inline-flex; flex-direction: column; align-items: center; min-width: 50px; padding: 6px 10px; border-radius: 10px; background: var(--surface-3); border: 2px solid var(--c-other); transition: opacity 0.2s; }
.hm-tone b { font-size: 1.05rem; }
.hm-tone i { font-style: normal; font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }
.hm-tone.role-root { border-color: var(--c-root); }
.hm-tone.role-third { border-color: var(--c-3); }
.hm-tone.role-fifth { border-color: var(--c-5); }
.hm-tone.role-seventh { border-color: var(--c-7); }
.hm-tone.hm-dim { opacity: 0.4; }
.hm-scale-line { margin: 10px 0 0; font-size: 0.9rem; color: var(--muted); }
.hm-scale-line strong { color: var(--text); }
.hm-scale-line .hm-ct { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.hm-compare { display: flex; flex-direction: column; gap: 8px; }
.hm-cmp-row { display: grid; grid-template-columns: auto minmax(130px, 200px) 1fr; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.hm-play { width: 36px; justify-content: center; padding: 0; }
.hm-cmp-label { display: flex; flex-direction: column; line-height: 1.3; }
.hm-cmp-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-step { font-weight: 700; font-size: 0.86rem; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); transition: background 0.1s, color 0.1s; }
.hm-step.on { background: var(--accent); color: var(--accent-ink); }
.hm-stack-row { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-bottom: 12px; }
.hm-cell { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 8px; background: var(--surface-2); border: 2px solid transparent; color: var(--faint); transition: all 0.15s; }
.hm-cell b { font-size: 0.95rem; }
.hm-cell i { font-style: normal; font-size: 0.68rem; font-family: var(--mono); }
.hm-cell.on { color: var(--text); background: var(--surface-3); }
.hm-cell.on.role-root { border-color: var(--c-root); }
.hm-cell.on.role-third { border-color: var(--c-3); }
.hm-cell.on.role-fifth { border-color: var(--c-5); }
.hm-cell.on.role-seventh { border-color: var(--c-7); }
.hm-stack-degs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.hm-next { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--accent); background: var(--accent-soft); }

/* progression lab */
.hm-lab { display: flex; flex-direction: column; gap: 12px; }
.hm-demo.hm-lab, .card.hm-lab { gap: 12px; }
.hm-lab-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hm-lab-bar .btn.primary { min-width: 96px; justify-content: center; }
.hm-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.hm-strip .pchord { padding-bottom: 10px; }
.hm-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.hm-now-head { display: flex; align-items: baseline; gap: 10px; }
.hm-now-name { font-size: 1.6rem; font-weight: 800; }
.hm-now-rn { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.hm-now-grid { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hm-now-grid > div { display: flex; flex-direction: column; }
.hm-k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--muted); }
.hm-v { font-weight: 700; }
.hm-v .role-root { color: var(--c-root); }
.hm-v .role-third { color: var(--c-3); }
.hm-v .role-fifth { color: var(--c-5); }
.hm-v .role-seventh { color: var(--c-7); }
.hm-target { margin: 0; }
.hm-lab .fretboard .fb-hits rect { cursor: pointer; }
.hm-link { margin: 0; }
.hm-game .stats { margin-top: 0; }

/* quiz, build, practice */
.hm-quiz-top { display: flex; justify-content: space-between; gap: 10px; }
.hm-quiz .prompt { margin: 14px 0 6px; line-height: 1.6; }
.hm-quiz .prompt .big, .hm-build .prompt .big { font-size: 1.5rem; }
.hm-answers .btn.ans { white-space: normal; max-width: 100%; text-align: center; }
.hm-why { text-align: left; max-width: 640px; margin: 4px auto 12px; padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; background: var(--surface-2); border: 1px solid var(--border); }
.hm-why.ok { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.hm-why.ok strong { color: var(--good); }
.hm-why.no { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.hm-why.no strong { color: var(--bad); }
.hm-result .hm-score { font-size: 3.4rem; font-weight: 800; line-height: 1; margin: 8px 0; font-variant-numeric: tabular-nums; }
.hm-result .hm-score span { font-size: 1.4rem; color: var(--muted); }
.hm-result.pass .hm-score { color: var(--good); }
.hm-build .prompt { text-align: center; margin: 12px 0; }
.hm-slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.hm-slot { min-width: 92px; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 2px dashed var(--border-2); background: var(--surface-2); color: var(--faint); font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.hm-slot.filled { border-style: solid; border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.hm-slot.good { border-color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.hm-slot.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.hm-palette { margin: 8px 0 4px; }
.hm-palette .chord-btn { align-items: center; }
.hm-practice-intro p:last-child { margin-bottom: 0; }
.hm-tasks h3 { margin-top: 0; }
.hm-task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.hm-task:first-of-type { border-top: 0; }
.hm-task input { margin-top: 4px; accent-color: var(--good); width: 18px; height: 18px; flex: none; }
.hm-task input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.hm-tasks .btn-row { margin-top: 12px; }
.hm-done { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.hm-done p { margin: 0; }

@media (max-width: 900px) {
  .hm-demo { margin-left: 0; }
  .hm-cmp-row { grid-template-columns: auto 1fr; }
  .hm-cmp-steps { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hm-steps { gap: 6px; }
  .hm-stepbtn { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .hm-stepbtn > span:last-child span { display: none; }
  .hm-stack-row { gap: 2px; }
  .hm-cell { padding: 4px 0; border-width: 1.5px; }
  .hm-cell b { font-size: 0.72rem; }
  .hm-cell i { display: none; }
  .hm-stack-degs { grid-template-columns: repeat(4, 1fr); }
  .hm-units { grid-template-columns: 1fr; }
  .hm-demo { padding: 10px; }
  .hm-quiz .prompt .big, .hm-build .prompt .big { font-size: 1.25rem; }
}

/* ---------- fretboard shapes & arrows ---------- */
.fb-path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; opacity: 0.35; }
.fb-path.move { stroke: var(--text); stroke-width: 2.5; opacity: 0.85; stroke-dasharray: 6 4; }
.fb-arrowhead { fill: var(--text); }
.fb-note.common circle { stroke: var(--text); stroke-width: 3; stroke-dasharray: 3 2; }
.fb-note.shape-note circle { stroke: var(--accent); stroke-width: 2; }

/* ---------- XP, levels, badges ---------- */
.xp-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.xp-pill:hover { border-color: var(--accent); }
.xp-lv { color: var(--accent); }
.xp-bar { width: 44px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: var(--accent); }
.xp-streak { font-size: 0.78rem; }
.xp-panel { position: fixed; top: 64px; right: 16px; z-index: 80; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5); padding: 18px; }
.xp-head { display: flex; gap: 16px; align-items: center; }
.xp-head .hm-meter { margin: 6px 0; }
.xp-ring { --p: 0; flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.xp-ring span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--surface); font-weight: 800; line-height: 1; }
.xp-ring small { font-size: 0.62rem; color: var(--muted); font-weight: 600; }
.xp-sub { font-weight: 800; margin: 16px 0 8px; }
.xp-badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.xp-badge { display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); opacity: 0.45; filter: grayscale(1); }
.xp-badge.on { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.xp-badge span { grid-row: span 2; font-size: 1.4rem; text-align: center; }
.xp-badge strong { font-size: 0.8rem; }
.xp-badge small { font-size: 0.7rem; color: var(--muted); line-height: 1.3; }
.xp-how { margin: 12px 0 0; }
#xpFloat { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.xp-float { padding: 7px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 0.86rem; box-shadow: var(--shadow); animation: xpIn 0.3s ease; transition: opacity 0.5s, transform 0.5s; }
.xp-float span { font-weight: 600; opacity: 0.8; margin-left: 4px; }
.xp-float.big { font-size: 1rem; padding: 10px 18px; background: var(--surface); color: var(--text); border: 2px solid var(--accent); }
.xp-float.out { opacity: 0; transform: translateY(-10px); }
@keyframes xpIn { from { opacity: 0; transform: translateY(12px) scale(0.9); } }

/* ---------- harmony: completion ---------- */
.hm-combo { color: var(--accent); font-weight: 800; }
.hm-unit.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.hm-unit.done .hm-unit-num { color: var(--good); }
.hm-next-tag { font-size: 0.72rem; font-weight: 800; color: var(--accent-ink); background: var(--accent); padding: 2px 9px; border-radius: 999px; }
.hm-done-tag { font-size: 0.72rem; font-weight: 800; color: var(--good); }
.hm-stars { color: #f5c542; font-size: 2.6rem; letter-spacing: 6px; line-height: 1; margin: 6px 0 10px; }
.hm-stars i { font-style: normal; color: var(--surface-3); }
.hm-stars.small { font-size: 0.9rem; letter-spacing: 1px; margin: 0; }
.hm-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5, 7, 10, 0.6); backdrop-filter: blur(3px); animation: fadeIn 0.2s ease; }
.hm-modal-card { position: relative; overflow: hidden; width: min(460px, 100%); text-align: center; background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; padding: 28px 24px 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); animation: popIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.hm-modal.win .hm-modal-card { border-color: var(--accent); }
.hm-modal-icon { font-size: 3rem; line-height: 1; }
.hm-modal h2 { margin: 10px 0 4px; }
.hm-modal-body p { margin: 8px 0; }
.hm-modal .btn-row { margin-top: 16px; }
.hm-modal .hm-meter { margin: 14px 0 0; height: 4px; }
.hm-countbar { transition: width 1s linear !important; }
.hm-confetti { position: absolute; inset: 0; pointer-events: none; }
.hm-confetti i { position: absolute; top: -12px; left: calc(var(--x) * 1%); width: 8px; height: 12px; border-radius: 2px; background: hsl(var(--h) 85% 60%); animation: confetti 1.8s ease-in var(--d) forwards; opacity: 0; }
@keyframes confetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(380px) rotate(540deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.85); } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- arpeggios ---------- */
.ar-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.ar-grid > .card { margin-bottom: 0; }
.ar-now-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ar-next { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ar-next strong { font-size: 1.3rem; }
.ar-tip { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; }
.ar-tip strong { color: var(--text); }
.ar-score { display: flex; flex-direction: column; gap: 10px; position: relative; }
.ar-score .stats { margin-top: 0; justify-content: flex-start; }
.ar-score .stat small { font-size: 0.75rem; color: var(--muted); }
.ar-mic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-mic .btn.on, .im-coach .btn.on { border-color: var(--good); color: var(--good); }
.ar-meter { width: 90px; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ar-meter i { display: block; height: 100%; width: 0; background: var(--good); transition: width 0.08s; }
.ar-heard { font-family: var(--mono); font-weight: 700; min-width: 40px; }
.ar-score .hint { margin: 0; }
.ar-banner { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); animation: popIn 0.3s ease; }
.ar-banner strong { color: var(--good); }
.ar-banner .muted { display: block; font-size: 0.85rem; }
.ar-lane-card { padding: 12px 14px; }
.ar-lane { display: flex; gap: 6px; overflow-x: auto; padding: 16px 2px 4px; scrollbar-width: thin; }
.ar-cell { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 58px; border-radius: 12px; background: var(--surface-2); border: 2px solid var(--c-other); cursor: pointer; transition: transform 0.12s, background 0.12s; }
.ar-cell b { font-size: 1rem; }
.ar-cell i { font-style: normal; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.ar-cell em { position: absolute; top: -16px; left: 0; font-style: normal; font-size: 0.7rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.ar-cell.role-root { border-color: var(--c-root); }
.ar-cell.role-third { border-color: var(--c-3); }
.ar-cell.role-fifth { border-color: var(--c-5); }
.ar-cell.role-seventh { border-color: var(--c-7); }
.ar-cell.rest { border-style: dashed; border-color: var(--border-2); opacity: 0.6; }
.ar-cell.first { margin-left: 8px; }
.ar-cell.cur { transform: scale(1.12); background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -6px var(--accent); }
.ar-cell.cur i { color: var(--accent-ink); }
.ar-cell.hit { background: color-mix(in srgb, var(--good) 30%, var(--surface-2)); }
.ar-cell.miss { background: color-mix(in srgb, var(--bad) 30%, var(--surface-2)); }
.dot.ar-dot-now { background: var(--accent); box-shadow: 0 0 0 2px var(--text); }
.dot.ar-dot-next { background: transparent; border: 2px dashed var(--text); }
.dot.ar-dot-common { background: transparent; border: 2px dotted var(--text); }

/* ---------- improvise: helpers & note coach ---------- */
.im-overlay-info { margin: 8px 4px 2px; font-size: 0.88rem; color: var(--muted); line-height: 1.7; }
.im-overlay-info strong { color: var(--text); }
.im-overlay-info small { font-family: var(--mono); color: var(--accent); }
.im-coach .row-between { margin-bottom: 4px; }
.im-explain { min-height: 52px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.93rem; line-height: 1.55; }
.im-kind { display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 9px; border-radius: 999px; margin-right: 6px; background: var(--surface-3); }
.im-kind.chord { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.im-kind.tension { background: color-mix(in srgb, var(--c-5) 22%, transparent); color: var(--c-5); }
.im-kind.avoid { background: color-mix(in srgb, var(--mid) 25%, transparent); color: var(--mid); }
.im-kind.outside { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }

@media (max-width: 900px) {
  .ar-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .xp-bar, .xp-streak { display: none; }
  .ar-cell { width: 46px; height: 52px; }
  .ar-next { align-items: flex-start; text-align: left; }
}
.seg { scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.ar-lane { scrollbar-color: var(--border-2) transparent; }
@media (max-width: 640px) {
  /* every section visible: tabs wrap instead of scrolling sideways */
  .tabs { justify-content: center; margin: 0; }
  .tabs button { padding: 6px 10px; font-size: 0.86rem; }
  .brand-name { display: none; }
  .topbar-inner { gap: 8px; }
}
/* finger badge on the top-right corner of a lane cell */
.ar-fg { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--text); color: var(--bg); font-family: var(--font); font-style: normal; font-size: 0.66rem; font-weight: 800; box-shadow: 0 0 0 2px var(--surface); }
.ar-cell.cur .ar-fg { background: var(--accent-ink); color: var(--accent); }
