/* Fonic Tonic Studio — "Obsidian Luthier" theme, v3. © 2026 Isaac Leonard / Fonic Tonic LLC.
   Principles: the neck is the only loud thing on screen. Gold (#F59E0B) belongs to the root note alone;
   the interface itself speaks in brass and bone. No cards — surfaces are separated by brass hairlines. */
:root {
  --bg: #0B0F17; --deep: #070a10; --raise: #131924; --raise2: #1a2130;
  --line: rgba(232, 199, 122, .16); --line2: rgba(236, 230, 216, .08);
  --text: #ece6d8; --soft: #c9c2b2; --mute: #948d7d;
  --brass: #e8c77a; --brass2: #b8893b; --gold: #F59E0B; --emerald: #10B981; --navy: #16233f;
  --ui: Bahnschrift, "DIN Alternate", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Sitka Heading", "Sitka Text", Constantia, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: var(--ui);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 350 14.5px/1.5 var(--ui); min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h2, h4 { margin: 0; font-weight: 400; }
select:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
::selection { background: rgba(232, 199, 122, .3); }

/* ── top bar ── */
.top { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 9px 22px; border-bottom: 1px solid var(--line); background: var(--deep); }
.brand { display: flex; align-items: center; gap: 11px; font: 400 21px/1 var(--serif); color: var(--text); }
.brand b { font-weight: 600; color: var(--brass); }
.brand small { display: block; font: 11.5px var(--ui); color: var(--mute); margin-top: 4px; }
.modeswitch { display: flex; gap: 22px; align-self: stretch; margin: -9px 0; }
.modeswitch button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 0 7px; text-align: left; font-size: 14.5px; color: var(--mute); }
.modeswitch button small { display: block; font-size: 11.5px; opacity: .85; }
.modeswitch button:hover { color: var(--soft); }
.modeswitch button.on { color: var(--text); border-bottom-color: var(--brass); }
.tools { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.tools label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mute); }
select { background: var(--raise); border: 1px solid var(--line2); border-radius: 6px; padding: 5px 8px; color: var(--text); min-height: 30px; }
select:hover { border-color: var(--line); }

.btn { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 7px 14px; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn.gold { background: var(--brass); border-color: var(--brass); color: #1c1300; font-weight: 600; }
.btn.gold:hover { background: #f3d994; color: #1c1300; }
.btn.sm { padding: 4px 11px; font-size: 13px; }
.btn.big { padding: 9px 26px; font-size: 16px; }

/* ── stage: the neck, edge to edge ── */
.stage { background: radial-gradient(70% 120% at 50% 0%, #161d2b 0%, var(--bg) 62%, var(--deep) 100%); border-bottom: 1px solid var(--line); padding: 12px 0 10px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); }
@media (min-height: 900px) and (min-width: 1001px) { .stage { position: sticky; top: 0; z-index: 10; } }
.stage-top { display: flex; align-items: baseline; gap: 18px; padding: 0 22px 2px; }
#caption { font: 400 23px/1.25 var(--serif); color: var(--text); min-width: 0; }
#caption b { font-weight: 600; }
#caption .pos { color: var(--brass); font-style: italic; margin-left: .35em; }
#caption .now { display: inline-block; margin-left: .7em; color: #fff; font: 600 15px var(--ui); background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; padding: 1px 12px 2px; vertical-align: 3px; }
#caption .rel { margin-left: .7em; color: var(--mute); font: 14px var(--ui); }
#readout { margin-left: auto; color: var(--mute); font-size: 13.5px; white-space: nowrap; }
#readout b { color: var(--text); font: 600 20px var(--serif); margin-right: 8px; }
#readout sub { font-size: 12px; color: var(--mute); }
#readout em { color: var(--brass); font-style: normal; }
#board { overflow-x: auto; }
#board svg { min-width: 940px; display: block; }
body.theme-print #board { background: #fff; padding: 8px 14px; margin: 6px 22px; border-radius: 4px; }
.stage-foot { display: flex; align-items: center; gap: 10px 28px; flex-wrap: wrap; padding: 2px 22px 0; }
.chordbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chordbar .lbl { margin-right: 8px; }
.chordbar button { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 11px 4px; font: 600 17px/1.15 var(--serif); min-width: 54px; color: var(--text); }
.chordbar button small { display: block; font: 11.5px var(--ui); color: var(--mute); }
.chordbar button:hover { border-color: var(--line); }
.chordbar button.on { border-color: #fff; background: rgba(255, 255, 255, .08); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 15px; margin-left: auto; color: var(--mute); font-size: 12.5px; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg svg { width: 16px; height: 16px; }
.lg .halo { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; display: inline-block; }

/* ── fretboard svg ── */
.ft-svg text { font-family: var(--ui); font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.ft-svg .ft-num { fill: #6f695d; font-weight: 400; dominant-baseline: auto; }
.ft-svg .ft-num.mk { fill: var(--brass); font-weight: 600; }
.ft-print .ft-num { fill: #54617a; }
.ft-print .ft-num.mk { fill: #16233f; }
.ft-cell { fill: transparent; cursor: pointer; }
.ft-studio .ft-cell:hover { fill: rgba(255, 255, 255, .08); }
.ft-print .ft-cell:hover { fill: rgba(22, 35, 63, .07); }
.ft-node, .ft-mark { cursor: pointer; }
.ft-studio .ft-node { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.ft-studio .ft-node.tg { filter: drop-shadow(0 0 7px var(--c)) drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.ft-studio .ft-node:hover { filter: brightness(1.15) drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.ft-studio .ft-halo { animation: ftHalo 1.3s ease-in-out infinite; }
@keyframes ftHalo { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .45; } }
.ft-str.vib { animation: ftVib .42s linear; }
@keyframes ftVib { 0% { transform: translateY(0); } 12% { transform: translateY(-2px); } 30% { transform: translateY(1.7px); } 48% { transform: translateY(-1.2px); } 66% { transform: translateY(.8px); } 84% { transform: translateY(-.4px); } 100% { transform: translateY(0); } }
.ft-mark.bad { animation: ftBad .9s ease-out forwards; }
@keyframes ftBad { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ft-studio .ft-halo, .ft-str.vib { animation: none; } }

/* ── layout under the neck ── */
.shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); align-items: start; }
main { min-width: 0; }
.foot { color: var(--mute); font-size: 12.5px; padding: 18px 28px 26px; }
@media (max-width: 1000px) { .shell { grid-template-columns: 1fr; } #curric { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--line); } }

/* ── curriculum rail ── */
#curric { border-right: 1px solid var(--line); padding: 16px 12px 30px 22px; min-height: 100%; }
.passport { padding: 0 0 14px; }
.pp-top { display: flex; justify-content: space-between; align-items: baseline; font: 18px var(--serif); }
.pp-top span { color: var(--mute); font: 13px var(--ui); }
.pips { display: flex; flex-wrap: wrap; gap: 3px 7px; margin-top: 9px; }
.pips span { display: inline-flex; gap: 2px; }
.pips i { width: 5px; height: 11px; border-radius: 1px; background: var(--raise2); }
.pips i.d { background: var(--brass); }
.lvl { border-top: 1px solid var(--line2); }
.lvl-h { width: 100%; display: flex; align-items: baseline; gap: 10px; background: none; border: 0; padding: 9px 0 8px; text-align: left; }
.lvl-h .num { flex: none; width: 24px; font: italic 600 21px/1 var(--serif); color: var(--brass2); text-align: right; }
.lvl.open .num, .lvl-h:hover .num { color: var(--brass); }
.lvl.complete .num { color: var(--emerald); }
.lvl-h .nm { flex: 1; min-width: 0; }
.lvl-h .nm b { display: block; font-weight: 600; font-size: 14.5px; color: var(--text); }
.lvl-h .nm small { color: var(--mute); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvl-h .cnt { color: var(--mute); font-size: 12px; }
.lvl ul { list-style: none; margin: 0 0 10px; padding: 0 0 0 34px; }
.lvl li button { width: 100%; display: flex; gap: 8px; align-items: baseline; text-align: left; background: none; border: 0; border-radius: 4px; padding: 4px 8px; margin-left: -8px; color: var(--soft); font-size: 13.5px; line-height: 1.35; }
.lvl li button:hover { color: var(--text); background: var(--line2); }
.lvl li button.on { color: var(--brass); background: rgba(232, 199, 122, .09); }
.lvl li .n { flex: none; width: 17px; color: var(--mute); font-size: 12px; text-align: right; }
.lvl li button.on .n { color: var(--brass); }
.lvl li .n.done { color: var(--emerald); }

/* ── controls: one faceplate strip ── */
.controls { display: flex; flex-wrap: wrap; gap: 14px 30px; padding: 16px 28px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent); }
.ctl { display: flex; flex-direction: column; gap: 5px; }
.lbl, .lp-row label, .tr-row label { font-size: 12.5px; color: var(--mute); }
.lp-row label, .tr-row label { display: flex; flex-direction: column; gap: 5px; }
.chips { display: flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; background: var(--raise); }
.chips button { width: 40px; padding: 5px 0 6px; background: none; border: 0; border-right: 1px solid var(--line2); font: 600 15px var(--serif); color: var(--soft); }
.chips button:last-child { border-right: 0; }
.chips button:hover { color: var(--text); background: var(--line2); }
.chips button.on { background: var(--brass); color: #1c1300; }
.segrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; background: var(--raise); width: fit-content; }
.seg button { background: none; border: 0; border-right: 1px solid var(--line2); padding: 5px 12px 6px; color: var(--soft); font-size: 13.5px; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); background: var(--line2); }
.seg button.on { background: rgba(232, 199, 122, .15); color: var(--brass); box-shadow: inset 0 -2px 0 var(--brass); }
.controls select { min-height: 33px; font-size: 14px; width: 200px; }
.filter { margin-top: 4px; background: none; border: 1px dashed var(--brass2); color: var(--brass); border-radius: 6px; padding: 3px 9px; font-size: 12.5px; }

/* ── dock ── */
.dock { padding: 6px 28px 10px; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line2); margin: 0 0 20px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 0 9px; margin-bottom: -1px; color: var(--mute); font-size: 15px; }
.tabs button:hover { color: var(--soft); }
.tabs button.on { color: var(--text); border-bottom-color: var(--brass); }
.ls-head { display: flex; gap: 20px 40px; justify-content: space-between; flex-wrap: wrap; }
.ls-head > div:first-child { flex: 1 1 420px; }
.ls-lv { font-size: 13px; color: var(--brass); }
.ls-head h2 { font: 400 36px/1.12 var(--serif); margin: 4px 0 10px; letter-spacing: -.2px; }
.ls-head p { margin: 0; color: var(--soft); max-width: 64ch; font: 16.5px/1.6 var(--serif); }
.ls-actions { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; max-width: 400px; padding-top: 6px; }
.donebox { display: flex; gap: 7px; align-items: center; color: var(--mute); flex-basis: 100%; font-size: 13.5px; margin-top: 2px; }
.donebox input { accent-color: var(--emerald); width: 16px; height: 16px; }
.donebox.inline { flex-basis: auto; flex-direction: row; padding-bottom: 8px; }
.ls-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 4px 40px; margin-top: 20px; padding-top: 6px; border-top: 1px solid var(--line2); }
.ls-cols h4 { font: italic 16px var(--serif); color: var(--brass); margin: 14px 0 5px; }
.ls-cols ul { margin: 0; padding-left: 17px; color: var(--soft); }
.ls-cols li { margin-bottom: 4px; }
.ls-cols li::marker { color: var(--brass2); }
.ls-cols p { margin: 0; color: var(--soft); }
.ls-cols .span { grid-column: 1 / -1; }
.chartchips { display: flex; flex-direction: column; gap: 2px; }
.ls-cols .span .chartchips { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.chartchips button { text-align: left; background: none; border: 0; border-left: 2px solid var(--line); padding: 3px 10px; color: var(--soft); }
.chartchips button:hover { border-left-color: var(--brass); color: var(--brass); }
.ls-cols .span .chartchips button { border: 1px solid var(--line); border-radius: 6px; padding: 4px 11px; }
.paper { background: #fff; color: #16233f; border-radius: 4px; padding: 10px 12px; margin-top: 12px; overflow-x: auto; }
.paper svg.ft-chord { cursor: pointer; }

.lp-row, .tr-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.lp-row label b { color: var(--brass); font-size: 14px; }
.lp-row input[type=range] { width: 170px; accent-color: var(--brass); }
.hint { color: var(--mute); font-size: 13px; flex: 1 1 300px; max-width: 70ch; }
.beats { display: flex; gap: 8px; align-items: center; padding-bottom: 13px; }
.beats i { width: 13px; height: 13px; border-radius: 50%; background: var(--raise2); }
.beats i.on { background: var(--brass); box-shadow: 0 0 10px var(--brass); }
.beats i.pre { background: var(--mute); }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.bar { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 14px 11px; }
.bar small { display: block; color: var(--mute); font-size: 12px; }
.bar b { font: 600 24px/1.2 var(--serif); }
.bar.on { background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1.5px #fff; }
.tr-row label.off { opacity: .35; }
.tr-mastery { color: var(--mute); margin-left: auto; }
.tr-mastery b { color: var(--emerald); font-size: 17px; }
.tr-hud { margin-top: 16px; border-left: 2px solid var(--line); padding: 8px 16px 10px; }
.tr-hud.on { border-left-color: var(--brass); }
.tr-prompt { font: 600 24px var(--serif); }
.tr-hud:not(.on) .tr-prompt { font: 15px var(--ui); color: var(--mute); }
.tr-timer { height: 4px; background: var(--raise2); border-radius: 2px; margin: 10px 0 8px; overflow: hidden; max-width: 640px; }
.tr-timer i { display: block; height: 100%; background: var(--brass); transition: width .1s linear; }
.tr-stats { color: var(--mute); }

/* teaser preview */
#teaserFrame { width: 100%; height: calc(100vh - 56px); border: 0; display: block; background: #0B0F17; }

/* ── v4: play-along tab, tuner, practice log, weak spots ── */
.ft-tab text { font-family: var(--ui); font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.ft-tab .clef { font-family: var(--serif); font-weight: 600; }
.tabwrap { margin-top: 18px; overflow-x: auto; padding-bottom: 6px; }
.tabwrap svg { min-width: 760px; display: block; }
.ft-tab .tn.cur rect { fill: var(--brass); }
.ft-tab .tn.cur text { fill: #1c1300; }
.ft-studio .ft-node.cur { filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 4px #fff) brightness(1.25); }
.ft-studio .ft-node.cur circle:last-of-type, .ft-studio .ft-node.cur > circle { stroke: #fff; stroke-opacity: 1; stroke-width: 2.6; }
.btn.on { border-color: var(--brass); color: var(--brass); background: rgba(232, 199, 122, .12); }
.tr-mic { margin-top: 14px; font-size: 14px; flex-wrap: wrap; }
.heard { margin-left: 12px; color: var(--brass); font-weight: 600; }
.heard.err { color: #f08a7a; font-weight: 400; }
.practice { padding: 0 0 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line2); }
.week { display: flex; gap: 6px; height: 54px; margin-top: 10px; align-items: flex-end; }
.week span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.week i { width: 100%; background: var(--raise2); border-radius: 2px 2px 0 0; min-height: 2px; }
.week span.now i { background: var(--brass); }
.week b { font-weight: 400; font-size: 11.5px; color: var(--mute); }
.week span.now b { color: var(--brass); }
.tuner { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr); gap: 24px 56px; align-items: center; padding: 8px 0 18px; }
@media (max-width: 900px) { .tuner { grid-template-columns: 1fr; } }
.tu-read { text-align: center; }
.tu-note { font: 400 120px/1 var(--serif); color: var(--mute); letter-spacing: -2px; min-height: 120px; }
.tu-note sub { font-size: 34px; letter-spacing: 0; vertical-align: baseline; margin-left: 4px; }
.tuner.live .tu-note { color: var(--text); }
.tuner.ok .tu-note { color: var(--emerald); }
.tu-meter { position: relative; height: 34px; margin: 18px auto 10px; max-width: 460px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10%) bottom / 100% 12px no-repeat; }
.tu-meter span { position: absolute; left: 45%; width: 10%; bottom: 0; height: 100%; background: rgba(16, 185, 129, .14); border-left: 1px solid var(--emerald); border-right: 1px solid var(--emerald); }
.tu-meter i { position: absolute; left: 50%; bottom: 0; width: 3px; margin-left: -1.5px; height: 100%; background: var(--mute); border-radius: 2px; transition: left .09s linear; }
.tuner.live .tu-meter i { background: var(--brass); }
.tuner.ok .tu-meter i { background: var(--emerald); }
.tu-cents { color: var(--soft); min-height: 1.5em; }
.tu-strs { display: flex; gap: 6px; margin: 10px 0 18px; }
.tu-strs button { flex: 1; background: none; border: 1px solid var(--line2); border-radius: 6px; padding: 6px 0 8px; font: 600 22px/1.1 var(--serif); color: var(--text); }
.tu-strs button small { display: block; font: 11.5px var(--ui); color: var(--mute); margin-bottom: 2px; }
.tu-strs button sub { font-size: 12px; color: var(--mute); }
.tu-strs button:hover { border-color: var(--brass); }
.tu-strs button.on { border-color: var(--emerald); background: rgba(16, 185, 129, .12); }
.tu-side .hint { display: block; margin-top: 14px; }

/* ── v5: lesson depth ── */
.ls-deep { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px 56px; margin-top: 22px; padding-top: 6px; border-top: 1px solid var(--line2); }
@media (max-width: 1100px) { .ls-deep { grid-template-columns: 1fr; } }
.ls-deep h4 { font: italic 16px var(--serif); color: var(--brass); margin: 16px 0 6px; }
.ls-read p, .ls-read li { font: 16.5px/1.62 var(--serif); color: var(--text); max-width: 66ch; margin: 0 0 10px; }
.ls-read ol { margin: 0; padding-left: 22px; }
.ls-read li { margin-bottom: 5px; color: var(--soft); }
.ls-read li::marker { color: var(--brass2); font-family: var(--ui); }
.ls-read .pass { border-left: 2px solid var(--emerald); padding-left: 14px; color: var(--text); }
.ls-side p { color: var(--soft); margin: 0 0 9px; max-width: 60ch; }
.ls-side p b { color: var(--text); font-weight: 600; }
.qa { border-bottom: 1px solid var(--line2); }
.qa summary { cursor: pointer; list-style: none; display: flex; gap: 12px; align-items: baseline; padding: 9px 0; color: var(--text); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary span { font: italic 600 18px/1 var(--serif); color: var(--brass2); width: 14px; flex: none; }
.qa summary::after { content: "show answer"; margin-left: auto; padding-left: 14px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.qa[open] summary::after { content: "hide"; }
.qa summary:hover::after { color: var(--brass); }
.qa p { margin: 0 0 11px 26px; color: var(--brass); }

/* ---------- v6: pedalboard, pad synth, recording studio ---------- */
.tabs { flex-wrap: wrap; gap: 0 26px; }
.btn.rec i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #d8483c; margin-right: 8px; }
.btn.rec.on { border-color: #d8483c; color: #ffb4ac; background: rgba(216, 72, 60, .16); }
.btn.rec.on i { animation: recpulse 1s steps(2, end) infinite; }
@keyframes recpulse { 50% { opacity: .25; } }
.btn:disabled { opacity: .4; cursor: default; }
.fx-tip { color: var(--mute); font-size: 13.5px; line-height: 1.55; max-width: 78ch; margin: 18px 0 0; }
.fx-save { display: flex; gap: 6px; }
.fx-save input { background: var(--raise); border: 1px solid var(--line2); border-radius: 6px; color: var(--text); padding: 6px 9px; width: 170px; font: inherit; font-size: 14px; }

.board { display: flex; align-items: stretch; gap: 0; margin: 22px 0 12px; padding: 22px 18px 20px; overflow-x: auto; background: repeating-linear-gradient(90deg, #10151e 0 46px, #0d1119 46px 48px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.board.off .pedal { filter: saturate(.25) brightness(.7); }
.jack { align-self: center; font-size: 12.5px; color: var(--mute); padding: 0 12px; white-space: nowrap; }
.cable { align-self: center; flex: 0 0 18px; height: 3px; background: #2a3140; }
.board-empty { align-self: center; color: var(--mute); margin: 0 18px; flex: 1; }
.pedal { flex: 0 0 auto; min-width: 132px; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px 12px 12px; border-radius: 9px; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 92%, #fff) 0%, var(--pc) 18%, color-mix(in srgb, var(--pc) 72%, #000) 100%); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 18px rgba(0,0,0,.5); color: #0c0f14; opacity: .62; }
.pedal.on { opacity: 1; }
.pd-move { display: flex; gap: 4px; align-self: stretch; justify-content: space-between; }
.pd-move button { background: rgba(0,0,0,.28); border: 0; border-radius: 4px; color: #fff; width: 24px; height: 22px; line-height: 1; font-size: 15px; }
.pd-move button:hover:not(:disabled) { background: rgba(0,0,0,.55); }
.pd-move button:disabled { opacity: .25; }
.pd-knobs { display: flex; gap: 10px; }
.knob { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: rgba(0,0,0,.78); }
.knob i { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a4f59, #0e1116 70%); box-shadow: 0 2px 3px rgba(0,0,0,.5); transform: rotate(calc(-135deg + var(--v) * 270deg)); position: relative; }
.knob i::after { content: ""; position: absolute; left: 50%; top: 3px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px; background: #f4efe2; }
.knob input { position: absolute; left: -4px; top: -2px; width: 42px; height: 38px; margin: 0; opacity: 0; cursor: ew-resize; }
.knob:focus-within i { outline: 2px solid #fff; outline-offset: 2px; }
.pd-name { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.pd-sw { background: none; border: 0; padding: 2px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pd-sw::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3a0f0c; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.pedal.on .pd-sw::before { background: #ff5a4a; box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 10px #ff5a4a; }
.pd-sw i { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f2f2f2, #8b8f97 65%, #5a5e66); box-shadow: 0 2px 4px rgba(0,0,0,.55); }
.pd-sw:active i { transform: translateY(1px); }
.fx-about { color: var(--soft); max-width: 78ch; margin: 0 0 16px; min-height: 2.9em; line-height: 1.5; }
.fx-about b { color: var(--text); }
.shelf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shelf .btn i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; }

.sy-leds { display: grid; grid-template-columns: repeat(32, 1fr); gap: 3px; margin: 20px 0 8px; }
.sy-leds i { height: 5px; border-radius: 2px; background: var(--line2); }
.sy-leds i.beat { background: rgba(236, 230, 216, .2); }
.sy-leds i.now { background: var(--brass); }
.sy-pad { position: relative; display: flex; height: min(46vh, 380px); min-height: 240px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; touch-action: none; cursor: crosshair; user-select: none; background: linear-gradient(180deg, rgba(232, 199, 122, .13), rgba(11, 15, 23, 0) 70%), var(--deep); }
.sy-pad:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.sy-col { flex: 1; border-right: 1px solid var(--line2); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-size: 12.5px; color: var(--mute); pointer-events: none; }
.sy-col.root { background: rgba(245, 158, 11, .1); color: var(--gold); }
.sy-col.hit { background: rgba(236, 230, 216, .12); color: var(--text); }
.sy-free { flex: 1; background: repeating-linear-gradient(90deg, transparent 0 8.33%, rgba(236,230,216,.04) 8.33% 8.43%); pointer-events: none; }
.sy-y { position: absolute; left: 8px; top: 8px; bottom: 30px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--mute); pointer-events: none; }
.sy-dot { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid var(--text); background: rgba(236, 230, 216, .25); box-shadow: 0 0 26px rgba(236, 230, 216, .5); pointer-events: none; }
.sy-read { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin: 10px 0 20px; color: var(--mute); font-size: 13.5px; }
.sy-read b { color: var(--text); font-size: 16px; min-width: 15ch; }
.sy-lay-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.sy-layer { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line2); font-size: 13.5px; color: var(--soft); }
.sy-mini { display: grid; grid-template-columns: repeat(32, 1fr); gap: 2px; height: 22px; align-items: end; }
.sy-mini i { height: 2px; background: var(--line2); }
.sy-mini i.on { height: var(--h); background: var(--brass); border-radius: 1px; }

.dw-grid { --hd: 250px; position: relative; margin: 20px 0 14px; border-top: 1px solid var(--line); overflow-x: auto; }
.dw-row { display: grid; grid-template-columns: var(--hd) minmax(calc(var(--n) * 62px), 1fr); border-bottom: 1px solid var(--line2); min-height: 46px; }
.dw-ruler { min-height: 26px; }
.dw-ruler .dw-cells span { font-size: 12px; color: var(--mute); padding: 5px 0 0 6px; border-left: 1px solid var(--line2); }
.dw-th { display: flex; align-items: center; gap: 7px; padding: 0 12px 0 10px; border-left: 3px solid var(--tc, transparent); }
.dw-name { flex: 1; font-size: 14px; white-space: nowrap; }
.dw-th input[type=range] { width: 74px; accent-color: var(--brass); }
.dw-ms { width: 24px; height: 22px; border: 1px solid var(--line2); border-radius: 4px; background: none; color: var(--mute); font-size: 11.5px; font-weight: 700; padding: 0; }
.dw-ms.on { background: #d8483c; border-color: #d8483c; color: #fff; }
.dw-ms.solo.on { background: var(--brass); border-color: var(--brass); color: #1c1300; }
.dw-cells { display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.dw-cell { background: none; border: 0; border-left: 1px solid var(--line2); color: var(--text); font-size: 12.5px; padding: 4px 6px; text-align: left; line-height: 1.2; overflow: hidden; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.dw-cell.full { background: color-mix(in srgb, var(--tc) 30%, transparent); box-shadow: inset 0 3px 0 var(--tc); }
.dw-cell b { font-size: 14px; }
.dw-cell small { color: var(--soft); font-size: 11px; }
.dw-cell:hover { background: rgba(236, 230, 216, .07); }
.dw-cell.full:hover { background: color-mix(in srgb, var(--tc) 42%, transparent); }
.dw-cell.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.dw-take { display: flex; align-items: center; color: var(--tc); border-left: 1px solid var(--line2); min-width: 0; }
.dw-take span { color: var(--mute); font-size: 13px; padding: 0 12px; }
.dw-take svg { width: 100%; height: 40px; display: block; }
.dw-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; }
.dw-pal { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; min-height: 40px; }
.dw-takerow { margin-top: 16px; align-items: center; }
.dw-msg { color: var(--soft); font-size: 13.5px; flex-basis: 100%; min-height: 1.4em; }
@media (max-width: 700px) { .dw-grid { --hd: 172px; } .dw-th input[type=range] { display: none; } .sy-layer { grid-template-columns: 80px 1fr auto; } }
@media (prefers-reduced-motion: reduce) { .btn.rec.on i { animation: none; } }

/* ---------- v7: lesson video ---------- */
.ls-video { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px 56px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line2); }
.ls-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #05070b; border-radius: 4px; }
.ls-vside h4 { margin-bottom: 6px; }
.ls-vside p { margin: 0 0 12px; color: var(--soft); max-width: 46ch; }
.ls-chaps { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.ls-chaps button { display: flex; gap: 12px; align-items: baseline; text-align: left; background: none; border: 0; border-top: 1px solid var(--line2); padding: 6px 0; color: var(--soft); }
.ls-chaps button span { color: var(--mute); font-variant-numeric: tabular-nums; min-width: 3.2ch; }
.ls-chaps button:hover { color: var(--brass); }
@media (max-width: 1100px) { .ls-video { grid-template-columns: 1fr; } }

/* ---------- v8: today, songs, account, phone layout ---------- */
.td { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px 56px; align-items: start; }
.td-head { display: flex; justify-content: space-between; gap: 16px 30px; flex-wrap: wrap; align-items: flex-start; }
.td-head h2 { font: 400 36px/1.12 var(--serif); margin: 4px 0 10px; letter-spacing: -.2px; }
.td-head p { margin: 0; color: var(--soft); font: 16.5px/1.6 var(--serif); }
.td-goal { color: var(--mute); font-size: 13.5px; display: flex; gap: 8px; align-items: center; padding-top: 8px; }
.td-goal select, .ac input[type=text], .ac input[type=email], .ac input[type=password] { background: var(--raise); border: 1px solid var(--line2); border-radius: 6px; color: var(--text); padding: 6px 9px; font: inherit; }
.td-list { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--line); }
.td-list li { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 6px 20px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line2); }
.td-tick { display: flex; gap: 9px; align-items: center; color: var(--mute); font-size: 13.5px; padding-top: 4px; cursor: pointer; }
.td-tick input { accent-color: var(--emerald); width: 20px; height: 20px; }
.td-what h3 { font: 400 21px/1.25 var(--serif); margin: 0 0 4px; color: var(--text); }
.td-what p { margin: 0; color: var(--soft); max-width: 68ch; line-height: 1.55; }
.td-list li.done h3 { color: var(--mute); text-decoration: line-through; text-decoration-color: rgba(148, 141, 125, .5); }
.td-list li.done .td-what p { color: var(--mute); }
.td-more { color: var(--mute) !important; font-size: 13.5px; margin-top: 6px !important; }
.td-rate { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--mute); font-size: 13.5px; }
.td-side { border-left: 1px solid var(--line2); padding-left: 28px; }
.td-streak { display: flex; gap: 16px; align-items: center; }
.td-streak b { font: 400 68px/1 var(--serif); color: var(--brass); min-width: 1.1ch; text-align: center; }
.td-streak h4 { margin: 0 0 2px; }
.td-streak p { margin: 0; color: var(--mute); font-size: 13.5px; }
.td-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 20px 0 18px; }
.td-cal small { color: var(--mute); font-size: 11.5px; text-align: center; }
.td-cal i { aspect-ratio: 1; border-radius: 4px; background: var(--raise2); }
.td-cal i.on { background: var(--brass2); }
.td-cal i.now { box-shadow: 0 0 0 1.5px var(--text); }
.td-cal i.now.on { background: var(--brass); }
.td-cal i.fut { background: none; box-shadow: inset 0 0 0 1px var(--line2); }
.td-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
.td-stats dt { color: var(--mute); font-size: 12.5px; }
.td-stats dd { margin: 0; font: 400 21px/1.2 var(--serif); }
.td-foot { color: var(--mute); font-size: 13px; line-height: 1.55; margin: 18px 0 0; }

.sg { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px 44px; align-items: start; }
.sg-list { display: flex; flex-direction: column; }
.sg-list h4 { margin-bottom: 8px; }
.sg-list button { text-align: left; background: none; border: 0; border-left: 2px solid var(--line2); padding: 8px 12px; color: var(--soft); }
.sg-list button b { display: block; font: 400 16.5px/1.25 var(--serif); color: inherit; }
.sg-list button span { color: var(--mute); font-size: 12.5px; }
.sg-list button:hover { color: var(--brass); }
.sg-list button.on { border-left-color: var(--brass); color: var(--text); background: rgba(232, 199, 122, .06); }
.sg-note { color: var(--mute); font-size: 13px; line-height: 1.5; margin: 16px 0 0; }
.sg-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px 30px; align-items: flex-start; }
.sg-head h2 { font: 400 34px/1.12 var(--serif); margin: 0 0 6px; }
.sg-head p { margin: 0; color: var(--soft); max-width: 60ch; }
.sg-head .row { align-items: center; }
.sg-head input[type=range] { accent-color: var(--brass); width: 120px; vertical-align: middle; }
.sg-head label { color: var(--mute); font-size: 13.5px; }
.sg-how { color: var(--mute); font-size: 13.5px; margin: 12px 0 0; }
.sg-bars { display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-top: 16px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.sg-bar { position: relative; display: flex; gap: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 12px 8px; min-height: 58px; }
.sg-bar small { position: absolute; left: 6px; top: 3px; color: var(--mute); font-size: 11px; }
.sg-bar b { flex: 1; font: 600 22px/1.2 var(--serif); }
.sg-bar.on { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1.5px #fff; }
.sg-bar.on b.now { color: var(--brass); }
.sg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px 36px; margin-top: 22px; }
.sg-tab { min-width: 0; overflow-x: auto; }
.sg-tab svg { min-width: 640px; }
.sg-chords { display: flex; flex-wrap: wrap; gap: 4px 8px; }

.ac { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px 56px; }
.ac h4 { margin: 22px 0 6px; }
.ac h4:first-child { margin-top: 0; }
.ac-p { color: var(--soft); margin: 0 0 12px; max-width: 62ch; line-height: 1.55; }
.ac-stats { grid-template-columns: repeat(4, auto); justify-content: start; gap: 12px 34px; margin-bottom: 12px; }
.ac-file { cursor: pointer; }
#tab-account .row { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-msg { color: var(--brass); min-height: 1.5em; margin: 14px 0 0; }

@media (max-width: 1000px) {
  .td, .sg, .ac { grid-template-columns: 1fr; }
  .td-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line2); padding-top: 20px; max-width: 420px; }
  .sg-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .sg-list h4, .sg-note { flex-basis: 100%; }
  .sg-list button { border: 1px solid var(--line2); border-radius: 6px; }
  .sg-list button.on { border-color: var(--brass); }
  .sg-cols { grid-template-columns: 1fr; }
}
/* phones: one thumb-reachable row of tabs along the bottom, tools tucked away, nothing wider than the screen */
@media (max-width: 700px) {
  body { padding-bottom: 62px; }
  .top { gap: 10px 16px; padding: 8px 14px; }
  .top .tools { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .modeswitch { margin: 0; gap: 14px; }
  .modeswitch button small { display: none; }
  .stage-top, .stage-foot { padding-left: 14px; padding-right: 14px; flex-wrap: wrap; }
  #board { overflow-x: auto; }
  #board > svg { min-width: 760px; }
  main { min-width: 0; }
  body[data-tab=today] .stage, body[data-tab=account] .stage, body[data-tab=today] #controls, body[data-tab=account] #controls, body[data-tab=today] .top .tools, body[data-tab=account] .top .tools { display: none; }
  .shell { display: flex; flex-direction: column; }
  .shell > main { order: 1; }
  #curric { order: 2; max-height: none; border-bottom: 0; border-top: 1px solid var(--line); padding: 16px 14px 24px; }
  .stage-top .btn, #readout { display: none; }
  #legend { display: none; }
  .dock { padding-left: 14px; padding-right: 14px; }
  #dockTabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto; background: var(--deep); border-top: 1px solid var(--line); padding: 0 6px; margin: 0; scrollbar-width: none; }
  #dockTabs::-webkit-scrollbar { display: none; }
  #dockTabs button { flex: 0 0 auto; padding: 18px 12px 17px; font-size: 14px; white-space: nowrap; border-bottom: 0; border-top: 2px solid transparent; }
  #dockTabs button.on { border-top-color: var(--brass); }
  .td-head h2, .sg-head h2, .ls-head h2 { font-size: 27px; }
  .td-list li { grid-template-columns: 1fr; gap: 8px; }
  .td-list li .btn { justify-self: start; }
  .sg-bars { --n: 2 !important; }
  .ac-stats { grid-template-columns: 1fr 1fr; }
  .btn { min-height: 40px; }
}

/* ---------- v9: elective tracks ---------- */
.trk { display: block; font-style: normal; font-size: 11.5px; color: var(--brass2); margin-top: 1px; }

/* ---------- v10: level tests, songbook groups ---------- */
.sg-list .sg-h2 { margin-top: 16px; }
.tt { max-width: 880px; }
.tt h2 { font: 400 36px/1.12 var(--serif); margin: 4px 0 10px; }
.tt-p { color: var(--soft); margin: 0 0 6px; max-width: 70ch; }
.tt-list { margin: 18px 0 20px; padding-left: 26px; }
.tt-list li { padding: 14px 0 16px; border-bottom: 1px solid var(--line2); }
.tt-list li::marker { color: var(--mute); }
.tt-q { margin: 0 0 10px; font: 400 19px/1.4 var(--serif); color: var(--text); }
.tt-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tt-opts label { display: flex; gap: 10px; align-items: flex-start; color: var(--soft); cursor: pointer; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 6px; max-width: 640px; }
.tt-opts input { accent-color: var(--brass); margin-top: 3px; }
.tt-opts label:has(input:checked) { border-color: var(--brass); color: var(--text); }
.tt-list li.ok .tt-q::after { content: "  \2713"; color: #5fd3a3; }
.tt-list li.bad .tt-q::after { content: "  \2717"; color: #f08a7e; }
.tt-opts label.right { border-color: #5fd3a3; color: var(--text); }
.tt-fix { color: #f0b3aa; margin: 10px 0 0; font-size: 14px; }
.tt-left { color: var(--mute); font-size: 13.5px; align-self: center; }
.tt-score { display: flex; gap: 18px; align-items: center; margin: 10px 0 4px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tt-score b { font: 400 50px/1 var(--serif); }
.tt-score.ok b { color: #5fd3a3; }
.tt-score.bad b { color: #f08a7e; }
.tt-score h3 { margin: 0 0 4px; font: 400 20px/1.3 var(--serif); }
.tt-score p { margin: 0; color: var(--mute); }
#curric button.lt .n { border-style: dashed; }

/* ---------- v11: tool tabs near the top, grouped; phone bar with More ---------- */
.dock-nav { padding-top: 10px; padding-bottom: 0; }
.dock-nav .tabs { margin: 0 0 4px; align-items: baseline; }
.tabgrp { font-size: 12px; color: var(--brass2); margin-left: 8px; padding-left: 18px; border-left: 1px solid var(--line2); }
.tabgrp:first-child { margin-left: 0; padding-left: 0; border-left: 0; }
.tabgrp:empty { padding-left: 0; }
#dockTabs .more { display: none; }
body[data-tab=today] #controls, body[data-tab=songs] #controls, body[data-tab=account] #controls, body[data-tab=test] #controls { display: none; }
@media (max-width: 700px) {
  .dock-nav { padding: 0; }
  .tabgrp { display: none; }
  #dockTabs button:not(.pri):not(.more) { display: none; }
  #dockTabs .more { display: block; margin-left: auto; }
  #dockTabs.open { flex-wrap: wrap; padding-top: 8px; box-shadow: 0 -14px 30px rgba(0, 0, 0, .55); }
  #dockTabs.open button:not(.more) { display: block; flex: 1 0 45%; text-align: left; padding: 13px 12px; border-top: 0; }
  #dockTabs.open button.on { color: var(--brass); }
  #dockTabs.open .more { flex-basis: 100%; text-align: right; }
}

/* chords from outside the key (secondary dominants, borrowed chords) */
.chordbar .xchords { flex-basis: 100%; margin-top: 2px; }
.chordbar .xchords summary { cursor: pointer; color: var(--mute); font-size: 12.5px; padding: 3px 0; width: max-content; }
.chordbar .xchords summary:hover { color: var(--brass); }
.chordbar .xchords[open] { padding-bottom: 4px; }
.chordbar .xgrp { display: inline-flex; flex-direction: column; gap: 2px; margin: 4px 28px 0 0; vertical-align: top; }
.chordbar .xbtns { display: flex; flex-wrap: wrap; gap: 4px; }
.chordbar .lbl.sub { font-size: 11.5px; margin: 0; }
.chordbar button.out { font-size: 15px; color: var(--soft); }
.chordbar button.out small { color: var(--brass2); }

/* lesson notes */
.ls-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px 40px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line2); }
.ls-notes label { display: flex; flex-direction: column; gap: 6px; }
.ls-notes textarea { background: var(--raise); border: 1px solid var(--line2); border-radius: 6px; color: var(--text); padding: 8px 10px; font: 14px/1.45 var(--ui); resize: vertical; min-height: 70px; }
.ls-notes textarea:focus { outline: none; border-color: var(--brass2); }
.ls-notes .hint { grid-column: 1 / -1; }

/* ear quiz (Trainer tab) */
#earBox { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line2); }
.eq h3 { font: italic 19px var(--serif); color: var(--brass); margin: 0 0 10px; }
.eq-q { color: var(--soft); margin: 14px 0 10px; }
.eq-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.eq-opts .btn.right { border-color: var(--emerald); background: rgba(16, 185, 129, .16); }
.eq-opts .btn.wrong { border-color: #F43F5E; background: rgba(244, 63, 94, .14); }
.eq-res { margin: 12px 0 0; }
.eq-res.ok { color: var(--emerald); }
.eq-res.bad { color: #fb7185; }

/* phones: the twelve key buttons wrap into two rows of six instead of pushing the page wider than the screen */
@media (max-width: 700px) {
  #controls .chips { flex-wrap: wrap; max-width: 100%; }
  #controls .chips button { width: calc(100% / 6); border-bottom: 1px solid var(--line2); }
  #controls .seg { max-width: 100%; }
}
/* narrow screens: the one-column layout may not grow wider than the screen; wide parts (tab, pedal row, song grid) scroll inside */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell > *, .dock, .tabbody { min-width: 0; }
}
@media (max-width: 700px) { .shell > main, .shell > aside { align-self: stretch; width: 100%; } }
@media (max-width: 700px) { #tab-account .btn { white-space: normal; } }

/* review flags */
.flagbtn { color: var(--soft); }
.flagbtn:hover { color: var(--brass); border-color: var(--brass2); }
.flaglink { margin-left: 10px; background: none; border: 0; padding: 0 2px; color: var(--mute); font: inherit; font-size: .82em; cursor: pointer; }
.flaglink:hover, .flaglink:focus-visible { color: var(--brass); }
button[data-act="tab"][data-v="account"][data-flags]:not([data-flags=""])::after { content: attr(data-flags); margin-left: 6px; padding: 0 6px; border-radius: 9px; background: var(--brass); color: var(--deep); font-size: .78em; font-weight: 700; }
.flagdlg { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); color: var(--text); }
.flagdlg::backdrop { background: rgba(4, 6, 10, .7); }
.fl-form { padding: 20px 22px; display: grid; gap: 12px; }
.fl-form h3 { margin: 0; }
.fl-form label { display: grid; gap: 6px; color: var(--soft); }
.fl-form textarea, .fl-form select { width: 100%; box-sizing: border-box; background: var(--deep); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; }
.fl-form .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fl-where { margin: 0; color: var(--brass); }
.fl-err { margin: 0; min-height: 1.2em; color: #f08a7a; }
.ac-flags.span { grid-column: 1 / -1; border-top: 1px solid var(--line2); padding-top: 8px; }
.ac-flags .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fl-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.fl-list li { padding: 12px 14px; border: 1px solid var(--line2); border-left: 3px solid var(--brass2); border-radius: 6px; background: var(--raise); }
.fl-list li.fixed { border-left-color: var(--emerald); opacity: .75; }
.fl-list li.fl-none { border-left-color: var(--line2); color: var(--mute); }
.fl-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.fl-kind { color: var(--mute); font-size: .85em; }
.fl-part { margin: 4px 0 0; color: var(--mute); font-size: .88em; }
.fl-body { margin: 6px 0 10px; white-space: pre-wrap; line-height: 1.5; }
.fl-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fl-msg { color: var(--brass); min-height: 1.4em; margin: 10px 0 0; }
#flToast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; padding: 10px 16px; border-radius: 8px; background: var(--raise2); border: 1px solid var(--line); color: var(--text); transition: opacity .2s, transform .2s; }
#flToast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #flToast { transition: none; } }

/* song chart editor */
.sg-list .sg-new { align-self: flex-start; margin: 0 0 18px; border: 1px solid var(--brass2); border-radius: 6px; padding: 7px 14px; background: var(--brass); color: var(--deep); font-weight: 600; }
.sg-list .sg-new:hover { background: var(--gold); }
.sg-edits { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 8px 0 0; color: var(--mute); font-size: 13px; }
.sg-msg { margin: 0 0 12px; color: var(--brass); }
.se-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 18px; margin: 16px 0 6px; }
.se-grid label { display: grid; gap: 6px; color: var(--soft); font-size: 13.5px; align-content: start; }
.se-grid label.wide { grid-column: 1 / -1; }
.se-grid .se-minor { display: flex; align-self: end; padding-bottom: 8px; }
.se-grid input[type=text], .se-grid input[type=number], .se-grid select, .se-grid textarea { width: 100%; box-sizing: border-box; background: var(--deep); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 15px; }
.se-grid textarea { font-family: ui-monospace, Consolas, monospace; line-height: 1.6; resize: vertical; }
.se-grid small { color: var(--mute); font-size: 12.5px; line-height: 1.45; }
.se-err { color: #f08a7a; min-height: 1.3em; margin: 8px 0; }
.sg-edit .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* record yourself */
.rec { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 8px; background: var(--raise); }
.rec-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.rec-head h4 { margin: 0; }
.rec-msg { color: var(--soft); font-size: 13.5px; }
.btn.rec-on { background: #c2413a; border-color: #c2413a; color: #fff; }
.rec-takes { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 8px; }
.rec-takes li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rec-takes li span { color: var(--mute); font-size: 13px; flex: 1 1 160px; }
.rec-takes a.btn { text-decoration: none; }
.rec-nudge { display: inline-flex; gap: 8px; align-items: center; color: var(--soft); font-size: 13px; margin-right: 12px; }

/* practice graph */
.pg { margin-top: 30px; }
.pg-card { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 8px; background: var(--raise); }
.pg-head h4 { margin: 0 0 4px; }
.pg-head p { margin: 4px 0 8px; color: var(--soft); font-size: 13.5px; }
.pg-head label { display: flex; gap: 8px; align-items: center; color: var(--soft); font-size: 13.5px; margin: 6px 0; }
.pg-head select { max-width: 100%; background: var(--deep); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 13.5px; }
.pg-plot { position: relative; }
.pg-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pg-grid { stroke: var(--line2); stroke-width: 1; }
.pg-base { stroke: var(--mute); stroke-width: 1; }
.pg-ax { fill: var(--mute); font-size: 11px; }
.pg-val { fill: var(--text); font-size: 12px; font-weight: 600; }
.pg-val.soft { fill: var(--soft); font-weight: 400; }
.pg-bar { fill: var(--brass2); }
.pg-bar.now { fill: var(--brass); }
.pg-goal { stroke: var(--soft); stroke-width: 1; stroke-dasharray: 4 4; }
.pg-goaltx { fill: var(--text); font-size: 11px; paint-order: stroke; stroke: var(--raise); stroke-width: 4px; stroke-linejoin: round; }
.pg-line { fill: none; stroke: var(--brass); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pg-dot { fill: var(--brass); stroke: var(--raise); stroke-width: 2; }
.pg-hit { fill: transparent; }
.pg-tip { position: absolute; z-index: 2; pointer-events: none; padding: 5px 9px; border-radius: 6px; background: var(--raise2); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; white-space: nowrap; }
.pg-table summary { cursor: pointer; color: var(--mute); font-size: 13px; margin-top: 6px; }
.pg-table table { margin-top: 8px; }
