:root {
  --bg: #0b0f1f;
  --panel: #141a33;
  --panel-2: #1a2142;
  --panel-3: #232b55;
  --line: #2a3363;
  --text: #eef1ff;
  --muted: #98a2cc;
  --dim: #69729c;
  --accent: #ffcc33;
  --accent-ink: #2a1f00;
  --rec: #ff4d6d;
  --good: #3ddc97;
  --ok: #ffc845;
  --bad: #ff5d73;
  --head-w: 330px;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1100px 520px at 75% -220px, #1f2a6b 0%, transparent 65%), var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
input[type='range'] { accent-color: var(--accent); }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--muted); }

.btn {
  border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 800;
  background: var(--panel-3); transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.rec { background: var(--rec); color: #fff; box-shadow: 0 4px 18px rgba(255, 77, 109, .35); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); border-color: rgba(255, 93, 115, .4); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ---------- top bar ---------- */
.topbar {
  height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: rgba(11, 15, 31, .85);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 900; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.brand-star {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #ffcc33, #ff7a59); color: #2a1300; font-size: 20px;
}
.player { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); font-size: 20px; }
.player-name { font-weight: 800; line-height: 1.1; }
.xp { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.xp .lvl b { color: var(--accent); }
.xpbar { width: 140px; height: 8px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.xpfill { height: 100%; width: 0; background: linear-gradient(90deg, #ffcc33, #ff7a59); transition: width .6s; }
.top-actions { display: flex; gap: 8px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar {
  border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 12px;
  background: rgba(13, 17, 36, .6);
}
.side-title { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.side-foot { margin-top: auto; }
.unit { margin-bottom: 14px; }
.unit-title { font-weight: 900; font-size: 14px; padding: 6px 6px 2px; }
.unit-blurb { font-size: 12px; color: var(--dim); padding: 0 6px 6px; }
.song-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px;
  border-radius: 12px; border: 1.5px solid transparent; background: transparent; margin-top: 4px;
}
.song-item:hover:not(:disabled):not(.soon) { background: var(--panel-2); }
.song-item.active { background: var(--panel-2); border-color: var(--accent); }
.song-item.locked, .song-item.soon { opacity: .5; cursor: default; }
.si-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--panel-3); display: grid; place-items: center; flex: none; }
.si-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.si-title { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-sub { font-size: 11.5px; color: var(--dim); }

.stars { letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; color: #3a4378; }
.stars i.on { color: var(--accent); text-shadow: 0 0 8px rgba(255, 204, 51, .5); }

.main { padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------- song header ---------- */
.song-header {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 24px; align-items: end;
}
.sh-kicker { color: var(--accent); font-weight: 900; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.song-header h1 { font-size: 30px; font-weight: 900; line-height: 1.15; margin: 2px 0 4px; }
.sh-meta { color: var(--muted); font-weight: 700; font-size: 14px; }
.sh-desc { color: var(--muted); margin: 8px 0 0; font-size: 14px; max-width: 60ch; }
.sh-progress-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sh-progress-label b { color: var(--text); }
.progress { height: 10px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #3ddc97, #4cc9f0); border-radius: 99px; transition: width .6s; }
.part-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.part-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 99px; border: 1.5px solid var(--line); color: var(--muted);
}
.part-chip.todo { border-color: var(--c); color: var(--text); }
.part-chip.yours { background: var(--c); border-color: var(--c); color: #0b0f1f; }
.part-chip.yours .stars i { color: rgba(0, 0, 0, .25); }
.part-chip.yours .stars i.on { color: #0b0f1f; text-shadow: none; }
.sh-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ---------- transport ---------- */
.transport {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
}
.tgroup { display: flex; align-items: center; gap: 6px; }
.tbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--panel-3);
  display: grid; place-items: center; font-size: 16px;
}
.tbtn:hover { filter: brightness(1.2); }
.tbtn.play { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 20px; }
.tbtn.mini { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; font-weight: 900; }
.clock { min-width: 120px; font-variant-numeric: tabular-nums; }
.clock-time { font-size: 24px; font-weight: 900; line-height: 1; }
.clock-sub { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.tlabel { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-right: 2px; }
.speed input { width: 110px; }
.speed-val { font-weight: 900; min-width: 44px; font-variant-numeric: tabular-nums; }
.toggle {
  border: 1.5px solid var(--line); background: transparent; border-radius: 99px; padding: 7px 12px; font-weight: 800; font-size: 13px;
}
.toggle[aria-pressed='true'] { background: var(--panel-3); border-color: var(--accent); color: var(--accent); }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 99px; padding: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 99px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.seg.small button { padding: 4px 10px; font-size: 12.5px; }
.tbtn.rec-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--rec); color: #fff; font-size: 20px; box-shadow: 0 4px 16px rgba(255, 77, 109, .35); }
#btnFinish { margin-left: auto; }
body.is-recording #btnRecord { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 77, 109, .15); } }

/* ---------- notation ---------- */
.notation-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.notation-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.nb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.nb-tab {
  border: 1.5px solid var(--line); background: transparent; border-radius: 99px; padding: 5px 12px;
  font-weight: 800; font-size: 13px; color: var(--muted);
}
.nb-tab.on { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); }
.nb-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nb-viewlabel { font-size: 13px; font-weight: 800; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); cursor: pointer; }
.legend { display: inline-flex; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 700; }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; background: var(--c); }
.notation-stage { position: relative; height: 270px; }
.notation-stage canvas { width: 100%; height: 100%; display: block; }
.countin {
  position: absolute; inset: 0; display: none; place-items: center; pointer-events: none;
  font-size: 110px; font-weight: 900; color: var(--accent); text-shadow: 0 6px 40px rgba(255, 204, 51, .5);
}
.countin.show { display: grid; background: rgba(11, 15, 31, .35); }
.countin.rec {
  display: block; inset: auto; top: 12px; right: 14px; font-size: 13px; color: #fff; text-shadow: none;
  background: var(--rec); padding: 4px 10px; border-radius: 99px; animation: pulse 1s infinite;
}

/* ---------- lanes ---------- */
.lanes { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.lane { display: grid; grid-template-columns: var(--head-w) minmax(0, 1fr); border-bottom: 1px solid var(--line); min-height: 72px; }
.lane:last-child { border-bottom: 0; }
.lane.selected { background: color-mix(in srgb, var(--c) 8%, transparent); }
.lane.recording { background: rgba(255, 77, 109, .12); }
.lane-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-right: 1px solid var(--line);
  cursor: pointer; border-left: 5px solid var(--c);
}
.lane-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, transparent); font-size: 20px; flex: none; }
.lane-info { flex: 1; min-width: 0; }
.lane-name { font-weight: 900; }
.lane-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tag { font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; }
.tag.yours { background: var(--c); color: #0b0f1f; }
.tag.todo { border: 1.5px solid var(--c); color: var(--text); }
.tag.band { background: var(--panel-3); color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 12px; }
.lane-ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lane-ctl .row { display: flex; gap: 4px; }
.chip-btn { width: 24px; height: 22px; border-radius: 6px; border: 0; background: var(--panel-3); font-size: 11px; font-weight: 900; color: var(--muted); }
.chip-btn.mute.on { background: #ff9f43; color: #1b0f00; }
.chip-btn.solo.on { background: var(--accent); color: var(--accent-ink); }
.lane-ctl input { width: 54px; }
.lane-rec {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--rec); background: transparent;
  color: var(--rec); font-size: 14px; flex: none;
}
.lane-rec:hover { background: var(--rec); color: #fff; }
.lane-wave { position: relative; cursor: pointer; }
.lane-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lane-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #ffd54d; box-shadow: 0 0 10px #ffcc33;
  pointer-events: none; left: var(--head-w);
}

/* ---------- modals ---------- */
.modal-root { position: fixed; inset: 0; display: none; place-items: center; background: rgba(5, 8, 20, .7); backdrop-filter: blur(4px); z-index: 50; padding: 16px; }
.modal-root.open { display: grid; }
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 24px; width: min(560px, 100%);
  max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: pop .18s ease-out;
}
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal h2 { font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.modal p { margin: 6px 0; }
.modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.mh-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: color-mix(in srgb, var(--c) 25%, transparent); flex: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions.spread { justify-content: space-between; }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-weight: 800; font-size: 14px; }
.field input[type='text'], .field input:not([type]) {
  font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--text);
}
.inst-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.inst-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--panel-2); font-weight: 800; font-size: 13px;
}
.inst-tile .it-emoji { font-size: 28px; }
.inst-tile.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, var(--panel-2)); }

.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-box { background: var(--panel-2); border-radius: 14px; padding: 12px; }
.rs-label { font-weight: 900; font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.rs-hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
.rs-box input[type='range'] { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; margin: 4px 0; cursor: pointer; }
.check.warn { color: var(--accent); }
.meter { height: 12px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, #3ddc97, #ffc845 75%, #ff5d73); transition: width .06s; }
.rs-goal { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 204, 51, .1); color: #ffe08a; font-size: 13.5px; font-weight: 700; }
.rs-warn { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 93, 115, .12); color: #ffb3bf; font-size: 13px; font-weight: 700; display: none; }
.rs-warn.show { display: block; }
.rs-test { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 700; }

/* results */
.res-top { display: flex; gap: 20px; align-items: center; }
.score-ring {
  --p: 0; --c: var(--good);
  width: 120px; height: 120px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--panel-3) 0);
  position: relative;
}
.score-ring::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--panel); }
.score-ring span { position: relative; font-size: 36px; font-weight: 900; }
.score-ring small { font-size: 16px; }
.stars.big { font-size: 30px; }
.res-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.metric { background: var(--panel-2); border-radius: 14px; padding: 10px 12px; }
.metric b { display: block; font-size: 20px; font-weight: 900; }
.metric span { font-size: 12px; color: var(--muted); font-weight: 700; }
.chart-wrap { margin-top: 14px; background: var(--panel-2); border-radius: 14px; padding: 10px 12px; }
.chart-title { font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.timing-chart { width: 100%; height: 130px; display: block; }
.res-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.res-cols h4 { font-size: 14px; font-weight: 900; margin-bottom: 6px; }
.res-cols ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: #d4d9f5; }
.res-cols li { margin: 4px 0; }
.banner { margin-top: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 800; }
.banner.good { background: rgba(61, 220, 151, .14); color: #9ff3cb; }
.banner.bad { background: rgba(255, 93, 115, .12); color: #ffb3bf; }

/* settings */
.presets { display: flex; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-label { font-weight: 900; }
.set-help { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.set-ctl { display: flex; align-items: center; gap: 10px; }
.set-ctl input { flex: 1; }
.set-val { min-width: 92px; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; font-size: 13px; }
.set-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-toggle input { margin-top: 4px; }

.import-steps { font-size: 14px; color: #d4d9f5; padding-left: 20px; }
.import-steps li { margin: 6px 0; }
code { background: var(--panel-3); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
pre.code { background: var(--panel-2); border-radius: 12px; padding: 12px; font-size: 12px; overflow: auto; color: #cfd6ff; }

/* busy + toasts */
.busy { position: fixed; inset: 0; display: none; place-items: center; align-content: center; gap: 14px; background: rgba(5, 8, 20, .6); z-index: 60; font-weight: 800; }
.busy.show { display: grid; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--panel-3); border-top-color: var(--accent); animation: spin .8s linear infinite; justify-self: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast {
  background: var(--panel-3); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px;
  border-radius: 12px; font-weight: 800; font-size: 14px; max-width: 360px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: pop .2s ease-out; white-space: pre-line;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti span { position: absolute; top: -40px; font-size: 26px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (max-width: 1100px) {
  :root { --head-w: 250px; }
  .song-header { grid-template-columns: 1fr; }
  .lane-ctl input { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .top-actions .btn { padding: 8px 10px; font-size: 13px; }
  .xpbar { width: 80px; }
  .main { padding: 14px 16px 30px; }
  :root { --head-w: 190px; }
  .lane-ctl { display: none; }
  .rs-grid, .res-cols { grid-template-columns: 1fr; }
  .res-metrics { grid-template-columns: repeat(2, 1fr); }
  .inst-grid { grid-template-columns: repeat(3, 1fr); }
  .set-row { grid-template-columns: 1fr; }
  #btnRecord { margin-left: 0; }
}

/* add-a-song form */
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.add-grid.three { grid-template-columns: repeat(3, 1fr); }
.add-grid .field.wide { grid-column: 1 / -1; }
.add-grid .field { margin-top: 10px; font-size: 13px; }
.field input[type='number'], .add-row input, .add-row select, .add-row textarea {
  font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--panel-2); color: var(--text); min-width: 0;
}
.dropzone {
  margin-top: 14px; padding: 18px; border: 2px dashed var(--line); border-radius: 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px;
}
.dropzone.over { border-color: var(--accent); background: rgba(255, 204, 51, .06); }
.add-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.file-chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.add-h { margin: 16px 0 6px; font-size: 14px; font-weight: 900; }
.add-h .muted { font-weight: 700; font-size: 12.5px; }
.add-table { display: flex; flex-direction: column; gap: 6px; }
.add-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 56px; gap: 8px; align-items: center; }
.add-row.head { font-size: 11.5px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.add-row textarea { grid-column: 1 / -1; min-height: 54px; resize: vertical; }
@media (max-width: 860px) {
  .add-grid, .add-grid.three { grid-template-columns: 1fr; }
  .add-row { grid-template-columns: 1fr 1fr; }
}

.version-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.version-pick select {
  font: inherit; font-size: 13px; font-weight: 800; color: var(--text); background: var(--panel-3);
  border: 1.5px solid var(--accent); border-radius: 99px; padding: 4px 10px;
}
.inst-grid { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.add-row.xml { grid-template-columns: 1fr 1fr 1fr 1.4fr 48px; }
.add-row.other { grid-template-columns: 1fr 1.6fr; }
[hidden] { display: none !important; }

/* edit song */
.ed-list { display: flex; flex-direction: column; gap: 6px; }
.ed-track {
  display: grid; grid-template-columns: auto 30px minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 10px; align-items: center;
  background: var(--panel-2); border-left: 4px solid var(--c); border-radius: 12px; padding: 8px 10px;
}
.ed-move { display: flex; flex-direction: column; gap: 2px; }
.ed-emoji { font-size: 20px; text-align: center; }
.ed-name { font: inherit; font-weight: 800; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); min-width: 0; }
.ed-audio { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-actions { display: flex; gap: 6px; }
.ed-versions { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.ed-ver { display: inline-flex; align-items: center; gap: 2px; }
.ed-ver input { font: inherit; font-size: 12px; width: 150px; padding: 4px 6px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); }
.new-tag { color: var(--good); font-size: 11px; text-transform: uppercase; }
@media (max-width: 860px) { .ed-track { grid-template-columns: auto 30px 1fr; } .ed-audio, .ed-actions { grid-column: 3; } }
.level-pick { display: inline-flex; align-items: center; gap: 8px; }
.lvl-badge { font-size: 12px; font-weight: 900; color: var(--accent); background: rgba(255, 204, 51, .12); padding: 4px 10px; border-radius: 99px; }
.level-btn { background: linear-gradient(135deg, #ffcc33, #ff7a59); color: #2a1300; }
.lane-level {
  border: 0; background: rgba(255, 204, 51, .14); color: var(--accent); font-size: 10.5px; font-weight: 900;
  padding: 2px 8px; border-radius: 99px; cursor: pointer;
}
.lane-level:hover { background: rgba(255, 204, 51, .28); }
.add-help { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.add-toggle { margin-top: 10px; font-size: 13px; font-weight: 800; }
.add-table.unused { opacity: .8; margin-top: 6px; }
.add-row.needs .ad-inst { border-color: var(--accent); }
.ad-silent { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: #ffe08a; background: rgba(255, 204, 51, .08); border-radius: 8px; padding: 6px 10px; display: flex; gap: 8px; align-items: center; }
.ed-bars { grid-column: 3 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.ed-bars input { font: inherit; width: 120px; padding: 4px 8px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); }
.ed-bars .muted { font-weight: 600; }

/* ---------- whole-song sheet music ---------- */
.modal.sheet { width: min(1180px, 100%); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-tabs { margin: 12px 0; }
.sheet-lines { display: flex; flex-direction: column; gap: 6px; }
.sheet-line { position: relative; border-radius: 12px; background: var(--panel-2); cursor: pointer; border: 1.5px solid transparent; }
.sheet-line:hover { border-color: var(--line); }
.sheet-line.here { border-color: rgba(255, 204, 51, .5); }
.sheet-line canvas { width: 100%; height: 100%; display: block; }

/* ---------- studying the strip ---------- */
.notation-stage { cursor: grab; touch-action: pan-y; }
.notation-stage.dragging { cursor: grabbing; }
body.is-recording .notation-stage { cursor: default; }
.scrub-hint { position: absolute; right: 12px; bottom: 8px; font-size: 11.5px; font-weight: 800; color: var(--dim); pointer-events: none; }

/* ---------- punch-in ---------- */
[hidden] { display: none !important; }
.rs-punch { margin-top: 10px; }
.punch-row { margin-top: 10px; font-weight: 800; font-size: 13.5px; }
.punch-row input[type='number'] {
  width: 64px; margin: 0 6px; padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit;
}
.punch-note { font-size: 13px; font-weight: 800; color: #ffb3bf; }

/* ---------- vocal range ---------- */
.range-step { margin-top: 14px; font-size: 15px; }
.range-note { font-size: 44px; font-weight: 900; text-align: center; margin: 12px 0 8px; color: #ff6fae; }
.range-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }

/* ---------- singer's key ---------- */
.key-box { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 800; }
.key-box .key-name { min-width: 64px; text-align: center; padding: 4px 10px; border-radius: 99px; background: var(--panel-3); }
.key-box .key-name.moved { background: rgba(255, 111, 174, .22); color: #ffd0e5; }
.key-box .key-hint { color: var(--muted); font-weight: 700; }
.key-box.locked { color: var(--dim); }

/* ---------- camera & music video ---------- */
.cam-preview {
  position: fixed; right: 18px; bottom: 18px; width: 220px; aspect-ratio: 16 / 9; object-fit: cover; z-index: 40;
  border-radius: 14px; border: 2px solid var(--rec); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transform: scaleX(-1); background: #000;
}
.vm-stage { margin: 14px 0 10px; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.vm-stage canvas, .vm-stage video { width: 100%; height: 100%; display: block; }
#vmProgress { margin-bottom: 6px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- developer mode ---------- */
.dev-badge {
  align-self: center; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 900;
  background: rgba(61, 220, 151, .16); color: #8ff0c4; border: 1.5px dashed rgba(61, 220, 151, .55); white-space: nowrap;
}
body.dev-mode .topbar { box-shadow: inset 0 -3px 0 rgba(61, 220, 151, .6); }
.dev-row { border: 1.5px dashed rgba(61, 220, 151, .5); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }

/* ---------- page view while playing ---------- */
.notation-stage.paged { cursor: pointer; }
.notation-stage.paged { height: min(66vh, 620px); }
.page-view { display: flex; flex-direction: column; gap: 6px; height: 100%; overflow-y: auto; scrollbar-gutter: stable; padding: 4px 0 30px; }
.pv-line { flex: none; }
.pv-line { position: relative; border-radius: 12px; border: 1.5px solid transparent; transition: border-color .2s; }
.pv-line.current { border-color: rgba(255, 204, 51, .45); }
.pv-line canvas { width: 100%; height: 100%; display: block; }

/* ---------- friendly scoring notes ---------- */
.res-notes { margin: 12px 0 4px; padding: 10px 14px; border-radius: 12px; background: rgba(76, 201, 240, .1); border: 1px solid rgba(76, 201, 240, .3); }
.res-notes p { margin: 4px 0; font-size: 13.5px; font-weight: 700; color: #bfeaff; }

/* ---------- clean it up ---------- */
.cl-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); font-weight: 800; }
.cl-name { flex: 1; }
.cl-score { font-size: 13.5px; }
.small-note { font-size: 12.5px; }

/* ---------- everything on one screen (laptop and up) ---------- */
@media (min-width: 861px) {
  html, body { height: 100%; overflow: hidden; }
  .layout { height: calc(100vh - 64px); min-height: 0; }
  .sidebar { overflow-y: auto; }
  .main { height: 100%; overflow: hidden; padding: 12px 18px; gap: 10px; }
  .song-header { align-items: start; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(250px, 400px); }
  .song-header h1 { font-size: 24px; }
  .sh-desc { display: none; }
  .part-chips { margin-top: 6px; }
  .transport { padding: 8px 12px; gap: 10px; }
  .tbtn.play { width: 46px; height: 46px; }
  .notation-card { flex: 1 1 auto; min-height: 180px; display: flex; flex-direction: column; }
  .notation-stage, .notation-stage.paged { flex: 1 1 auto; height: auto; min-height: 120px; }
  .lanes { flex: 0 1 auto; min-height: 96px; max-height: 23vh; display: flex; flex-direction: column; }
  .lane { min-height: 44px; }
  .sh-progress-label { margin-bottom: 4px; }
  .next-step { padding: 6px 12px; }
  #laneList { overflow-y: auto; min-height: 0; }
  .lane { min-height: 50px; }
  .lane-head { padding: 5px 10px; }
  .lane-icon { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
  .lane-rec { width: 30px; height: 30px; }
}

/* ---------- "Next:" hint ---------- */
.next-step {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 204, 51, .16), rgba(255, 204, 51, .04));
  border: 1.5px solid rgba(255, 204, 51, .45); font-weight: 800; font-size: 14.5px;
}
.next-step:empty { display: none; }
.next-step .ns-label { color: var(--accent); text-transform: uppercase; font-size: 12px; letter-spacing: .1em; font-weight: 900; }
.next-step .btn { margin-left: auto; }

/* ---------- results: what next? ---------- */
.res-next { margin-top: 16px; padding: 14px; border-radius: 14px; background: rgba(255, 204, 51, .08); border: 1.5px solid rgba(255, 204, 51, .4); }
.res-next h4 { margin-bottom: 10px; }
.res-next-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.big { padding: 12px 20px; font-size: 16px; }
.rs-tip { margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }

/* ---------- tuner ---------- */
#tuInst { margin: 12px 0 4px; flex-wrap: wrap; }
.tu-strings { display: flex; justify-content: center; gap: 10px; margin: 14px 0 4px; }
.tu-string { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 8px 6px; border-radius: 12px; background: var(--panel-2); border: 2px solid transparent; }
.tu-string b { font-size: 20px; }
.tu-string span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.tu-string.on { border-color: var(--accent); background: rgba(255, 204, 51, .12); }
.tu-note { text-align: center; font-size: 64px; font-weight: 900; margin: 6px 0; }
.tu-note.dim { opacity: .35; }
.tu-meter { position: relative; height: 36px; border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.tu-meter span { position: absolute; top: 6px; font-weight: 900; color: var(--muted); }
.tu-meter span:first-of-type { left: 10px; }
.tu-meter span:last-of-type { right: 10px; }
.tu-zone { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; background: rgba(61, 220, 151, .2); }
.tu-needle { position: absolute; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; left: 50%; border-radius: 2px; background: var(--accent); transition: left .08s; }
.tu-meter.good .tu-needle { background: var(--good); box-shadow: 0 0 12px var(--good); }
.tu-msg { text-align: center; font-weight: 800; margin-top: 10px; font-size: 15px; }

/* ---------- screens: songs, instruments ---------- */
body[data-screen='home'] #recordScreen, body[data-screen='parts'] #recordScreen { display: none !important; }
body:not([data-screen='home']) #homeScreen, body:not([data-screen='parts']) #partsScreen { display: none; }
.screen { height: calc(100vh - 64px); overflow-y: auto; }
.screen-inner { max-width: 900px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.screen-title { font-size: 32px; font-weight: 900; }
.screen-sub { font-size: 20px; font-weight: 800; color: var(--muted); }
.screen-inner > .btn.ghost.small { align-self: flex-start; }
.song-grid { display: flex; flex-direction: column; gap: 10px; }
.song-card {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line); transition: border-color .15s, transform .1s;
}
.song-card:hover:not(.locked) { border-color: var(--accent); transform: translateY(-1px); }
.song-card.locked { opacity: .5; cursor: default; }
.song-play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 18px; flex: none; }
.song-play:disabled { background: var(--panel-3); color: var(--dim); }
.sc-text { flex: 1; min-width: 0; }
.sc-level { color: var(--accent); font-weight: 900; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.sc-title { font-size: 19px; font-weight: 900; }
.sc-end { font-size: 18px; white-space: nowrap; }
.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.part-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px; border-radius: 18px;
  background: var(--panel); border: 2px solid var(--line); transition: border-color .15s, transform .1s;
}
.part-card:hover { border-color: var(--c); transform: translateY(-2px); }
.part-card.done { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--panel)); }
.pc-emoji { font-size: 40px; }
.pc-name { font-size: 18px; font-weight: 900; }
.pc-status { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.parts-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.done-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.done-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel-2); }
.done-tile:hover:not(:disabled) { border-color: var(--accent); }
.done-tile:disabled { opacity: .5; cursor: not-allowed; }
.done-tile .dt-icon { font-size: 30px; }
.done-tile span:last-child { font-size: 12px; color: var(--muted); text-align: center; }
.dn-msg { text-align: center; min-height: 1.5em; margin-top: 12px; }
.rec-head { display: flex; align-items: center; gap: 12px; }
.rec-head h1 { font-size: 22px !important; margin: 0 !important; }
.rh-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--c) 22%, transparent); }
#recordScreen { grid-template-columns: minmax(0, 1fr); }

/* ---------- recording screen: one track + slim mixer ---------- */
.nb-title { font-weight: 900; font-size: 15px; color: var(--c); }
.lane.mini { min-height: 0 !important; }
.lane.mini .lane-head { padding: 3px 10px; border-right: 0; }
.lane.mini .lane-icon { width: 24px; height: 24px; font-size: 13px; border-radius: 7px; }
.lane.mini .lane-name { font-size: 13px; }
.lane.mini .lane-status { display: none; }
.lane.mini .lane-ctl { flex-direction: row; gap: 8px; }
.lane.mini .lane-ctl input { display: block; width: 90px; }
.lane-spacer { background: transparent; }
.lane-switch { width: 28px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); background: transparent; color: var(--text); font-weight: 900; flex: none; }
.lane-switch:disabled { opacity: .35; cursor: help; }
.lane-switch:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
@media (min-width: 861px) { .lanes { max-height: 30vh; } }
.lane.mini { grid-template-columns: minmax(0, 1fr); } .lane.mini .lane-spacer { display: none; }

/* ---------- recording screen: slim top line, mixer on the left, track at the bottom ---------- */
.rec-top { display: flex; align-items: center; gap: 10px; min-height: 0; }
.rec-top .song-header { display: flex !important; align-items: center; gap: 10px; flex: none; grid-template-columns: none !important; }
.rec-top .next-step { flex: 1; min-width: 0; font-size: 13.5px; padding: 6px 12px; }
.rh-title { font-size: 16px; white-space: nowrap; }
.rh-title b { color: var(--c); }
.rh-song { color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.rec-top .key-box { margin-top: 0; }
.rec-body { display: flex; gap: 10px; flex: 1 1 auto; min-height: 0; }
.rec-body .notation-card { flex: 1 1 auto; min-width: 0; }
.mixer {
  width: 132px; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
}
.mx-title { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 2px; }
.mx-strip { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: var(--panel-2); border-left: 4px solid var(--c); }
.mx-name { font-size: 12.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-strip .row { display: flex; gap: 4px; }
.mx-strip .vol { width: 100%; }
.mx-strip .lane-switch { width: 24px; height: 22px; margin-left: auto; font-size: 12px; }
@media (min-width: 861px) {
  .lanes { flex: none; min-height: 0; max-height: none; }
  .lane.selected { min-height: 64px; }
}
@media (max-width: 860px) {
  .rec-top { flex-wrap: wrap; }
  .rec-body { flex-direction: column; }
  .mixer { width: auto; flex-direction: row; overflow-x: auto; }
  .mx-strip { min-width: 120px; }
}
.next-step .ns-text { flex: 1; min-width: 0; }
.next-step .btn { margin-left: 0; white-space: nowrap; }

/* ---------- record window: camera ---------- */
.rs-cam { margin-top: 10px; }
.cam-setup { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.cam-setup video { width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #000; transform: scaleX(-1); border: 2px solid var(--line); flex: none; }
.cam-setup p { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
@media (max-width: 860px) { .cam-setup { flex-direction: column; align-items: stretch; } .cam-setup video { width: 100%; } }

/* ===================== recording screen, Level 1 (calm) ===================== */
/* The app's top bar steps aside while recording: the music gets the whole screen. */
body[data-screen='record'] .topbar { display: none; }
body[data-screen='record'] #recordScreen { height: 100vh; }
body[data-screen='record'] .main { padding: 10px 16px 12px; gap: 10px; }

.rec-top { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  flex: none; height: 44px; min-width: 44px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--panel); color: var(--text); font-weight: 900; font-size: 15px;
}
.icon-btn:hover, .icon-btn.on { border-color: var(--accent); color: var(--accent); }
#recBack { font-size: 20px; padding: 0; }

/* The "Next" line: the guide through the song. */
.rec-top .next-step {
  flex: 1; min-height: 52px; padding: 10px 18px; font-size: 17px; border-radius: 16px; line-height: 1.35;
  background: linear-gradient(90deg, rgba(255, 204, 51, .2), rgba(255, 204, 51, .06));
  border: 2px solid rgba(255, 204, 51, .55);
}
.rec-top .next-step .ns-label { font-size: 12px; }
.rec-top .next-step .btn.small { padding: 8px 14px; font-size: 14px; }

/* Tools: optional controls, folded away by default. */
.tools-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
}
.tools-panel[hidden] { display: none !important; }
.tools-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools-panel .notation-bar { padding: 0; border: 0; gap: 10px; }
.tools-panel .notation-bar:empty { display: none; }
#keyArea:empty { display: none; }
#keyArea .key-box { margin: 0; }

/* The Band mixer: a slim tab on the left that opens out. */
.mixer-wrap { flex: none; display: flex; gap: 8px; }
.mixer-tab {
  width: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font-size: 20px; cursor: pointer;
}
.mixer-tab span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mixer-tab:hover, .mixer-wrap:not(.collapsed) .mixer-tab { border-color: var(--accent); color: var(--accent); }
.mixer-panel {
  width: 200px; display: flex; flex-direction: column; gap: 10px; padding: 10px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.mixer-wrap.collapsed .mixer-panel { display: none; }
.mixer-panel .mixer { width: auto; padding: 0; border: 0; background: none; overflow: visible; }
.mx-modes { display: flex; flex-direction: column; gap: 4px; }
.mx-modes button {
  text-align: left; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--muted);
  border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 13px;
}
.mx-modes button.on { border-color: var(--accent); color: var(--text); background: rgba(255, 204, 51, .12); }

/* The music: as big as possible. */
.rec-body { flex: 1 1 auto; min-height: 0; }
.rec-body .notation-card { border-radius: 18px; }

/* Transport controls: big and centered, with Record biggest. */
body[data-screen='record'] .transport {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 18px; flex-wrap: nowrap;
}
.transport .clock { justify-self: start; }
.transport-main { gap: 14px; }
.transport-main .tbtn { width: 56px; height: 56px; border-radius: 50%; font-size: 22px; }
.transport-main .tbtn.play { width: 68px; height: 68px; font-size: 26px; }
.transport-main .tbtn.rec-btn { width: 82px; height: 82px; font-size: 34px; }
.transport-end { justify-self: end; }
body.is-recording .transport-main .rec-btn { animation: pulse 1s infinite; }

/* Your part's track: a slim strip at the bottom. */
body[data-screen='record'] .lanes { max-height: 70px; }
body[data-screen='record'] .lane.selected { min-height: 56px; }

/* ===================== recording screen, take 2 ===================== */
/* Top row: back and the clock on the left, the transport controls on the right,
   so your eyes can keep reading down the page. */
.rec-top { display: flex; align-items: center; gap: 14px; }
.rec-top .clock { min-width: 0; }
.rec-top-end { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.rec-top .transport-main .tbtn { width: 50px; height: 50px; font-size: 20px; }
.rec-top .transport-main .tbtn.play { width: 60px; height: 60px; font-size: 24px; }
.rec-top .transport-main .tbtn.rec-btn { width: 72px; height: 72px; font-size: 30px; }

/* Left column: Tools above the Mixer, as small tabs. */
.rec-body { position: relative; display: flex; gap: 10px; }
.side-col { flex: none; display: flex; flex-direction: column; gap: 8px; }
.side-tab {
  width: 50px; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font-size: 19px; cursor: pointer;
}
.side-tab span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.side-tab:hover, .side-tab.on { border-color: var(--accent); color: var(--accent); }

/* Tools opens as a panel over the music, so the page doesn't jump. */
.tools-panel { position: absolute; left: 62px; top: 0; z-index: 25; max-width: min(640px, calc(100% - 80px)); }
.mixer-wrap { flex: none; }
.mixer-wrap.collapsed { display: none; }

/* Suggestions: a card in the middle of the music until you press "Got it". */
.next-card {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 20;
  width: min(540px, 90%); padding: 20px 22px; border-radius: 20px;
  background: var(--panel); border: 2px solid rgba(255, 204, 51, .7);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 0 9999px rgba(5, 8, 20, .35);
  display: flex; flex-direction: column; gap: 12px; animation: pop .2s ease-out;
}
.next-card[hidden] { display: none; }
.nc-label { color: var(--accent); font-weight: 900; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.nc-text { font-size: 18px; font-weight: 800; line-height: 1.4; }
.nc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.nc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.nc-off { font-size: 13px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- Let's get set up (big, friendly cards like the song and instrument screens) ---------- */
body:not([data-screen='setup']) #setupScreen { display: none; }
body[data-screen='setup'] #recordScreen { display: none !important; }
.setup { gap: 16px; }
.setup-card { padding: 20px 22px; border-radius: 22px; background: var(--panel); border: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.su-q { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 12px; }
.su-icon { font-size: 30px; }
.su-choices { display: flex; gap: 12px; flex-wrap: wrap; }
.su-choice {
  flex: 1; min-width: 200px; padding: 16px 18px; border-radius: 18px; border: 2px solid var(--line);
  background: var(--panel-2); color: var(--muted); font-size: 18px; font-weight: 900; transition: border-color .15s, transform .1s;
}
.su-choice:hover { transform: translateY(-1px); border-color: var(--accent); }
.su-choice.on { border-color: var(--accent); color: var(--text); background: rgba(255, 204, 51, .14); box-shadow: 0 0 0 3px rgba(255, 204, 51, .15); }
.su-note { margin: 0; font-size: 15px; font-weight: 700; color: var(--muted); }
.su-meter { height: 16px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.su-meter > div { height: 100%; width: 0; background: linear-gradient(90deg, #3ddc97, #ffc845, #ff5d73); transition: width .08s; }
.setup-card .cam-setup video { width: 280px; }
.setup-card .cam-setup p { font-size: 15px; }
.setup-extras { display: flex; gap: 12px; flex-wrap: wrap; }
.su-extra { padding: 12px 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font-size: 16px; font-weight: 800; }
.su-extra:hover { border-color: var(--accent); }
.su-next { align-self: center; font-size: 19px; padding: 16px 30px; margin-top: 4px; }
.screen-inner.setup { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 20px; }
.screen-inner.setup > * { grid-column: 1 / -1; }
.screen-inner.setup > .su-half { grid-column: auto; }
.setup .su-choice { min-width: 0; padding: 14px; font-size: 17px; }
.setup .screen-title { margin: 0; }

/* ---------- "Show my take on the music": what the colours mean ---------- */
.take-banner {
  position: absolute; left: 12px; right: 12px; top: 10px; z-index: 12; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  padding: 10px 14px; border-radius: 14px; background: rgba(20, 26, 51, .95); border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.take-banner[hidden] { display: none; }
.tb-key::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; background: var(--c); vertical-align: -1px; }
.tb-note { font-size: 12.5px; font-weight: 700; color: var(--muted); flex-basis: 100%; order: 9; }
.take-banner .btn { margin-left: auto; }
.mx-strip.mx-you { border-left-width: 6px; background: color-mix(in srgb, var(--c) 14%, var(--panel-2)); }
.mx-strip em { font-style: normal; color: var(--muted); font-weight: 800; }

/* ---------- the player: on every screen and over every pop-up ---------- */
.mini-player { position: fixed; left: 16px; bottom: 16px; z-index: 55; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: calc(100vw - 32px); }
.mini-player[hidden] { display: none; }
.mp-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.mp-bar .tbtn.play { width: 44px; height: 44px; font-size: 18px; }
.mp-text { min-width: 0; max-width: 220px; }
.mp-title { font-weight: 900; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#mpMix.on { border-color: var(--accent); color: var(--accent); }
.mp-mixer { width: 240px; max-height: min(60vh, 520px); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.mp-mixer[hidden] { display: none; }
/* Leave room so the player never covers a pop-up's buttons or the bottom of a screen. */
.has-player .modal-root { padding-bottom: 88px; }
.has-player .screen { padding-bottom: 88px; }

/* ---------- More advanced parts ---------- */
#partsAdvanced { display: block; margin: 18px auto 0; }
.adv-note { text-align: center; margin: 10px auto 0; max-width: 560px; font-size: 14px; }
.part-grid.advanced { margin-top: 12px; }
.part-grid.advanced .part-card { border-style: dashed; }
.pc-kind { font-size: 12.5px; font-weight: 800; color: var(--muted); }
#btnReading { margin-left: 4px; }

/* ---------- "Keep my version" ---------- */
.res-own { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); }
.res-own .muted { font-size: 13.5px; flex: 1; min-width: 200px; }
