/* FirstTake design system: a dark studio surface, one warm signal colour, quiet chrome
   so the music (clips, waveforms, chords) carries the colour. */
:root {
  --bg: #0b0c0f;
  --surface-1: #111318;
  --surface-2: #171a20;
  --surface-3: #1e2229;
  --surface-4: #262b34;
  --line: #22262e;
  --line-2: #2e333d;
  --text: #f2f0ec;
  --text-2: #a8adb7;
  --text-3: #6d727d;
  --accent: #ff6b3d;
  --accent-hi: #ff8a63;
  --accent-ink: #1b0b05;
  --accent-soft: rgba(255, 107, 61, .14);
  --rec: #ff3b4e;
  --ok: #3ddc97;
  --warn: #ffc65c;
  --info: #5fb3ff;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --header-w: 224px;
  --track-h: 84px;
  --ruler-h: 46px;
  --font: "Inter", "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Ubuntu, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--font);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 13.5px; }
body { display: grid; grid-template-rows: auto 1fr auto auto; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
::selection { background: var(--accent-soft); }
.hidden { display: none !important; }
.spacer { flex: 1; }
.ico { flex: none; display: block; }

/* ---------- controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  cursor: pointer; white-space: nowrap; font-weight: 500; letter-spacing: .005em;
  transition: background .12s, border-color .12s, color .12s, transform .06s;
}
button:hover { background: var(--surface-3); border-color: #3a404c; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
button.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
button.toggle.on { background: var(--accent-soft); border-color: rgba(255, 107, 61, .45); color: var(--accent-hi); }
.icon-btn { width: 32px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.icon-btn.toggle.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-hi); }
button.mini { height: 24px; padding: 0 8px; font-size: 12px; gap: 4px; }
button.q {
  width: 18px; height: 18px; min-width: 18px; padding: 0; border-radius: 50%;
  font-size: 10.5px; font-weight: 650; color: var(--text-3); background: transparent; border-color: var(--line-2);
}
button.q:hover { color: var(--text); border-color: var(--text-3); }
input, select, textarea {
  height: 32px; background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 0 10px; transition: border-color .12s;
}
input:hover, select:hover { border-color: #3a404c; }
select { padding-right: 26px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8adb7' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
input[type=checkbox] { appearance: none; width: 16px; height: 16px; padding: 0; border-radius: 4px; flex: none; cursor: pointer; position: relative; background: var(--surface-1); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; padding: 0; border: 0; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--surface-4) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-4); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px #0009, 0 0 0 4px rgba(255, 107, 61, 0); transition: box-shadow .15s; }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 1px 4px #0009, 0 0 0 5px rgba(255, 107, 61, .18); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 500; }
.note { color: var(--text-3); font-size: 12px; line-height: 1.5; }
.err { color: var(--rec); font-size: 12px; }
.link, #coach a { color: var(--accent-hi); cursor: pointer; text-decoration: none; font-weight: 550; }
.link:hover, #coach a:hover { text-decoration: underline; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-1); border: 1px solid var(--line-2); border-radius: 8px; flex-wrap: wrap; }
.seg button { height: 26px; padding: 0 10px; font-size: 12px; background: transparent; border: 0; color: var(--text-2); border-radius: 6px; }
.seg button:hover { color: var(--text); background: var(--surface-3); }
.seg button.on { background: var(--surface-4); color: var(--text); box-shadow: 0 1px 2px #0006; }

/* ---------- top bar ---------- */
#topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  height: 60px; padding: 0 14px; background: var(--surface-1); border-bottom: 1px solid var(--line);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.brand { display: flex; flex: none; }
.song-id { display: flex; flex-direction: column; min-width: 0; margin-left: 4px; }
.title-input { height: 24px; padding: 0 6px; margin-left: -6px; width: 220px; max-width: 100%; background: transparent; border-color: transparent; font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.title-input:hover { border-color: var(--line-2); }
.title-input:focus { border-color: var(--accent); background: var(--surface-1); }
.song-sub { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport { display: flex; align-items: center; gap: 6px; padding: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.play-btn, .rec-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.play-btn { background: var(--text); border-color: var(--text); color: var(--bg); }
.play-btn:hover { background: #fff; border-color: #fff; }
.play-btn.playing { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rec-btn { background: var(--surface-2); color: var(--rec); }
.rec-btn.active { background: var(--rec); border-color: var(--rec); color: #fff; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 59, 78, .25); } }
.lcd { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--line); font-family: var(--mono); }
.lcd span { font-size: 17px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lcd small { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bpm { display: flex; flex-direction: column; align-items: center; height: 40px; justify-content: center; padding: 0 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-1); }
.bpm input { width: 46px; height: 22px; padding: 0; border: 0; background: transparent; text-align: center; font-family: var(--mono); font-weight: 600; font-size: 15px; -moz-appearance: textfield; }
.bpm input::-webkit-inner-spin-button { display: none; }
.bpm small { font-size: 9.5px; color: var(--text-3); letter-spacing: .08em; }
.magic { height: 36px; padding: 0 14px; border-radius: 10px; box-shadow: 0 4px 20px rgba(255, 107, 61, .25); }
#btnCompare { height: 36px; border-radius: 10px; }
.divider { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.menu { position: relative; }
.menu-btn { height: 36px; border-radius: 10px; }
.menu-btn.icon-btn { width: 36px; }
.menu-items {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 270px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 48px #000b;
}
.menu.open .menu-items { display: block; }
.menu-items button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; height: auto; min-height: 34px; padding: 7px 10px; text-align: left; background: transparent; border: 0; border-radius: 8px; white-space: normal; }
.menu-items button:hover { background: var(--surface-3); }
.menu-items button b { font-weight: 550; }
.menu-items button small { color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.menu-label { color: var(--text-3); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px 4px; }
.add-menu { z-index: 60; max-height: 72vh; overflow: auto; }

/* ---------- workspace ---------- */
#workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
#arrange { display: grid; grid-template-columns: var(--header-w) minmax(0, 1fr); min-height: 0; }
#trackHeaders { background: var(--surface-1); border-right: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.ruler-spacer { height: var(--ruler-h); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 14px; flex: none; }
.ruler-spacer .label { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
#headerList { flex: 1; overflow: hidden; position: relative; }
.th { height: var(--track-h); border-bottom: 1px solid var(--line); padding: 10px 10px 8px 16px; position: relative; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .12s; }
.th::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.th:hover { background: #14171c; }
.th.selected { background: var(--surface-2); }
.th.selected::after { content: ""; position: absolute; inset: 0; border-right: 2px solid var(--c); pointer-events: none; }
.th .row { display: flex; gap: 4px; align-items: center; }
.th .name { flex: 1; min-width: 0; height: 22px; background: transparent; border-color: transparent; padding: 0 4px; margin-left: -4px; font-weight: 600; letter-spacing: -.005em; }
.th .name:hover { border-color: var(--line-2); }
.th .name:focus { border-color: var(--accent); background: var(--surface-1); }
.th .kind { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.th .row button { width: 24px; height: 22px; padding: 0; font-size: 11px; font-weight: 650; background: transparent; border-color: var(--line-2); color: var(--text-2); border-radius: 5px; }
.th .row button:hover { background: var(--surface-3); color: var(--text); }
.th .row button.q { width: 18px; height: 18px; border: 0; opacity: 0; }
.th:hover .row button.q { opacity: 1; }
.th button.on.m { background: var(--warn); border-color: var(--warn); color: #1a1405; }
.th button.on.s { background: var(--info); border-color: var(--info); color: #06121f; }
.th button.arm { color: var(--rec); }
.th button.on.arm { background: var(--rec); border-color: var(--rec); color: #fff; }
.th button.on.mon { background: var(--accent-soft); border-color: rgba(255, 107, 61, .5); color: var(--accent-hi); }
.meter { height: 3px; margin-top: auto; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 60ms linear; }
.meter i.hot { background: var(--warn); }
.meter i.clip { background: var(--rec); }
.add-track-row { padding: 10px; }
.add-track-row button { width: 100%; height: 36px; border-style: dashed; background: transparent; color: var(--text-3); }
.add-track-row button:hover { color: var(--text); border-color: var(--text-3); }
#timelineWrap { position: relative; overflow: hidden; min-width: 0; background: #0d0f13; }
#timeline { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.empty-hint { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); color: var(--text-3); text-align: center; pointer-events: none; max-width: 420px; line-height: 1.6; }

/* ---------- inspector ---------- */
#sidebar { background: var(--surface-1); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 2px; margin: 10px 12px 0; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.tabs button { flex: 1; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); font-weight: 550; }
.tabs button:hover { color: var(--text); background: transparent; }
.tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px #0008; }
.tab { display: none; overflow: auto; padding: 16px 16px 40px; flex: 1; }
.tab.active { display: block; }
.tab::-webkit-scrollbar, .modal-card::-webkit-scrollbar, #editorBody::-webkit-scrollbar { width: 10px; height: 10px; }
.tab::-webkit-scrollbar-thumb, .modal-card::-webkit-scrollbar-thumb, #editorBody::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 5px; border: 3px solid transparent; background-clip: padding-box; }
.tab h3 { margin: 0 0 14px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.tab h4, .modal h4 { display: flex; align-items: center; gap: 6px; margin: 22px 0 10px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); }
.knob { margin-bottom: 12px; }
.knob .lbl { display: flex; align-items: center; gap: 6px; margin-bottom: 1px; font-weight: 500; }
.knob .lbl .val { margin-left: auto; color: var(--text-2); font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.knob .hint { color: var(--text-3); font-size: 11.5px; line-height: 1.45; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; line-height: 1.4; }
.check .hint { display: block; color: var(--text-3); font-size: 11.5px; }
.hood { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; font-family: var(--mono); font-size: 11px; color: var(--text-2); line-height: 1.7; }
.hood div::before { content: "› "; color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > button { justify-content: flex-start; }
.row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 28px; font-size: 12px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); }
.big-meter { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.big-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok) 0 70%, var(--warn) 70% 90%, var(--rec) 90%); background-size: 100vw 100%; transition: width 60ms linear; }

/* sounds, stems, bass */
.sound-box { padding: 12px; margin-bottom: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.sound-box .field { margin-bottom: 10px; }
.sound-box > button { width: 100%; }
.stems { display: flex; flex-direction: column; gap: 2px; }
.stem-row { display: grid; grid-template-columns: 28px 92px 1fr 52px 24px 22px; align-items: center; gap: 6px; height: 34px; padding: 0 6px; border-radius: 8px; }
.stem-row:hover { background: var(--surface-2); }
.stem-row.off .stem-name, .stem-row.off .val { color: var(--text-3); text-decoration: line-through; }
.stem-row.off input[type=range] { opacity: .35; }
.stem-row.unused .stem-name { color: var(--text-3); }
.stem-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stem-row .val { font-family: var(--mono); font-size: 11px; color: var(--text-2); text-align: right; }
.stem-switch { width: 26px; height: 16px; padding: 0; border-radius: 999px; background: var(--surface-4); border: 0; position: relative; }
.stem-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: left .15s, background .15s; }
.stem-switch.on { background: var(--ok); }
.stem-switch.on::after { left: 12px; background: #06140d; }
.stem-btn { width: 24px; height: 22px; padding: 0; font-size: 11px; font-weight: 650; background: transparent; color: var(--text-2); }
.stem-btn.solo.on { background: var(--info); border-color: var(--info); color: #06121f; }
.bass-opts .seg { width: 100%; }
.bass-opts .seg button { flex: 1; }
.smp { color: var(--warn); }

/* ---------- bottom editor ---------- */
#editor { min-width: 0; background: var(--surface-1); border-top: 1px solid var(--line); height: 300px; display: flex; flex-direction: column; min-height: 0; }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-bar strong { font-weight: 650; }
#editorTools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#editorTools select, #editorTools button { height: 28px; font-size: 12px; }
#editorBody { flex: 1; overflow: auto; position: relative; }
.stem-filter { margin: 10px 12px 2px; }
.steps { display: grid; gap: 3px; padding: 8px 12px; }
.steps .pad { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); padding-right: 6px; white-space: nowrap; }
.steps .pad .pname { cursor: pointer; padding: 2px 8px; border-radius: 6px; border: 1px dashed transparent; }
.steps .pad .pname:hover { border-color: var(--line-2); color: var(--text); }
.steps .pad .pname.drop { border-color: var(--accent); color: var(--accent-hi); }
.step { width: 22px; height: 22px; min-width: 0; padding: 0; border-radius: 5px; background: var(--surface-3); border: 0; }
.step:hover { background: var(--surface-4); }
.step.beat { background: #262b34; }
.step.bar { box-shadow: inset 2px 0 0 #4a5160; }
.step.on { background: var(--ok); box-shadow: 0 0 10px rgba(61, 220, 151, .25); }
.step.on.acc { background: #a6f3cf; }
.step.on.ghost { background: #2a7a57; box-shadow: none; }
.step.now { outline: 2px solid var(--warn); outline-offset: -1px; }
#pianoroll { display: block; }

/* ---------- coach bar ---------- */
#coach { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 36px; background: var(--surface-1); border-top: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; }
.coach-icon { color: var(--warn); }
#coachText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.ai-status.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 6, 8, .72); backdrop-filter: blur(6px); animation: fade .15s ease; }
.modal + .modal { background: rgba(5, 6, 8, .5); }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(780px, 100%); max-height: 90vh; overflow: auto; padding: 28px 30px; background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 30px 80px #000c; animation: rise .18s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-close { position: absolute; right: 14px; top: 14px; width: 32px; padding: 0; background: transparent; border-color: transparent; color: var(--text-3); }
.modal-close:hover { color: var(--text); }
.modal h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.modal p { line-height: 1.6; color: var(--text-2); margin: 0 0 14px; }
.modal ul { color: var(--text-2); line-height: 1.8; padding-left: 20px; }
.wizard-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizard-nav button { height: 38px; padding: 0 18px; }
.wiz-steps { display: flex; gap: 4px; margin-bottom: 20px; }
.wiz-steps span { flex: 1; padding-top: 8px; border-top: 3px solid var(--surface-4); color: var(--text-3); font-size: 11px; font-weight: 550; }
.wiz-steps span.done { border-color: rgba(255, 107, 61, .45); color: var(--text-2); }
.wiz-steps span.on { border-color: var(--accent); color: var(--text); }
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 16px 0; }
.genre-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: auto; padding: 14px 14px 12px; border-radius: 12px; text-align: left; white-space: normal; background: var(--surface-2); overflow: hidden; }
.genre-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gc, var(--accent)); opacity: .7; }
.genre-card b { font-size: 14px; font-weight: 650; }
.genre-card span { color: var(--text-2); font-size: 12px; line-height: 1.45; font-weight: 400; }
.genre-card small { color: var(--text-3); font-size: 11px; font-family: var(--mono); }
.genre-card.sel { border-color: var(--accent); background: linear-gradient(180deg, rgba(255, 107, 61, .10), var(--surface-2) 60%); box-shadow: 0 0 0 1px var(--accent); }
.learn-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.learn-list { display: flex; flex-direction: column; gap: 1px; max-height: 64vh; overflow: auto; padding-right: 6px; }
.learn-list button { justify-content: flex-start; height: auto; min-height: 30px; padding: 5px 10px; text-align: left; white-space: normal; background: transparent; border: 0; color: var(--text-2); font-weight: 450; }
.learn-list button.sel { background: var(--surface-3); color: var(--text); }
.learn-body { white-space: pre-wrap; line-height: 1.7; color: var(--text-2); }
.tuner-note { font-size: 72px; font-weight: 700; text-align: center; letter-spacing: -.03em; font-family: var(--mono); }
.tuner-bar { position: relative; height: 12px; background: var(--surface-3); border-radius: 6px; margin: 14px 0; }
.tuner-bar i { position: absolute; top: -3px; bottom: -3px; width: 6px; border-radius: 3px; background: var(--accent); left: 50%; transform: translateX(-50%); transition: left .08s; }
.tuner-bar::after { content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px; background: var(--ok); }
.toast { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); z-index: 90; max-width: 80vw; padding: 10px 16px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 10px 30px #000a; font-weight: 500; }
.progress { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; background: rgba(5, 6, 8, .7); backdrop-filter: blur(4px); font-size: 15px; font-weight: 550; }

/* chord picker */
.chordpicker { display: flex; flex-direction: column; gap: 10px; }
.cp-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-slot { flex-direction: column; gap: 2px; min-width: 84px; height: 60px; border-radius: 12px; border-width: 2px; background: var(--surface-2); }
.cp-slot b { font-size: 16px; font-weight: 650; }
.cp-slot small { color: var(--text-3); font-size: 10.5px; font-family: var(--mono); }
.cp-slot.sel { border-color: var(--text) !important; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.cp-slot.empty { border-style: dashed; }
.cp-slot.empty b { color: var(--text-3); }
.cp-add { width: 44px; height: 60px; border-radius: 12px; border-style: dashed; background: transparent; font-size: 18px; color: var(--text-3); }
.cp-tools button { height: 30px; font-size: 12px; }
.cp-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 10.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.cp-legend { display: inline-flex; gap: 10px; text-transform: none; letter-spacing: 0; }
.cp-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); font-weight: 500; }
.cp-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--role); }
.cp-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.cp-palette.small { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
.cp-chord { flex-direction: column; gap: 2px; height: 58px; border-radius: 12px; background: var(--surface-2); position: relative; overflow: hidden; }
.cp-chord::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--role, transparent); }
.cp-chord b { font-size: 17px; font-weight: 650; }
.cp-chord small { font-size: 10px; color: var(--text-3); }
.cp-chord.spice { height: 48px; }
.cp-chord.spice b { font-size: 13.5px; }
[data-role=home] { --role: var(--ok); }
[data-role=away] { --role: var(--info); }
[data-role=tension] { --role: var(--accent); }
.cp-slot[data-role] { border-color: var(--role); }
.cp-type summary { cursor: pointer; color: var(--text-3); font-size: 12px; }
.cp-type input { width: 100%; margin-top: 6px; }
.chips button .note { font-size: 11px; }

/* structure */
.structure { display: flex; flex-direction: column; gap: 6px; }
.struct-map { display: flex; gap: 3px; height: 30px; margin: 6px 0 4px; }
.struct-block { height: 30px; padding: 0 4px; min-width: 0; overflow: hidden; font-size: 10.5px; font-weight: 650; color: #fff; border: 0; border-radius: 6px; text-overflow: ellipsis; justify-content: flex-start; opacity: .85; }
.struct-block:hover { opacity: 1; }
.struct-block.sel { opacity: 1; box-shadow: 0 0 0 2px var(--text); }
.struct-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); position: relative; }
.struct-row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sc); }
.struct-row.sel { border-color: var(--sc); }
.struct-row select { height: 28px; font-size: 12px; }
.struct-row .q { border: 0; }
.struct-chords { justify-content: flex-start; height: auto; min-height: 30px; padding: 5px 8px; text-align: left; white-space: normal; background: var(--bg); border-color: var(--line); color: var(--warn); font-family: var(--mono); font-size: 12px; font-weight: 500; }

/* sounds modal */
.pad-row { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.pad-row.open { background: var(--surface-2); border-radius: var(--r-md); border-color: transparent; padding: 10px; margin: 4px 0; }
.pad-chooser { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sample-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.sample-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 4px; border-radius: 6px; }
.sample-row:hover { background: var(--surface-3); }
.sample-row button:not(.q) { height: 26px; font-size: 12px; }
.sample-row .sname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* report, library */
.report h4 { margin: 18px 0 6px; font-size: 13px; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--text); }
.report-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.report-row > .ok { color: var(--ok); }
.song-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.song-row.sel { border-color: var(--accent); }
.song-row b { font-weight: 650; }

/* tour */
.tour-shade { position: fixed; inset: 0; z-index: 80; }
.tour-hole { position: fixed; z-index: 81; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(5, 6, 8, .72), 0 0 0 2px var(--accent); transition: all .28s cubic-bezier(.3, .7, .3, 1); }
.tour-card { position: fixed; z-index: 82; width: 340px; padding: 18px 18px 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px #000d; animation: rise .2s ease; }
.tour-card h3 { margin: 4px 0 8px; font-size: 16px; font-weight: 650; }
.tour-card p { margin: 0 0 14px; line-height: 1.55; color: var(--text-2); }

@media (max-width: 1380px) {
  .magic span, .menu-btn span { display: none; }
  .magic { width: 40px; padding: 0; }
  .title-input { width: 160px; }
}
@media (max-width: 1080px) {
  #topbar { grid-template-columns: auto 1fr; height: auto; padding: 8px 12px; }
  .tb-center { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  #workspace { grid-template-columns: 1fr; grid-template-rows: 1fr 300px; }
  #sidebar { border-left: 0; border-top: 1px solid var(--line); }
  :root { --header-w: 170px; }
}

/* layout fixes */
.wiz-steps { padding-right: 40px; }
.stem-row { grid-template-columns: 28px minmax(0, 1fr) 96px 44px 24px 22px; }
.struct-row .row2 { flex-wrap: nowrap; gap: 4px; }
.struct-row .row2 select:first-child { flex: 1; min-width: 0; }
.struct-row .row2 select { width: auto; }
.struct-row .row2 .q { width: 22px; height: 22px; min-width: 22px; font-size: 12px; }
.struct-row .row2 .spacer { display: none; }
.struct-block { font-size: 0; }
.struct-block[style*="flex:8"], .struct-block[style*="flex:12"], .struct-block[style*="flex:16"], .struct-block[style*="flex:24"], .struct-block[style*="flex:32"] { font-size: 10.5px; }

/* website demo mode (app/?demo) */
body.demo { cursor: none; }
body.demo * { pointer-events: none !important; }
.demo-cursor { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; transition: transform .7s cubic-bezier(.45, .05, .25, 1); filter: drop-shadow(0 3px 6px #000a); }
.demo-cursor::after { content: ""; position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 107, 61, .45); transform: scale(0); transition: transform .15s; }
.demo-cursor.down::after { transform: scale(1.2); }

/* accounts and cloud */
.cloud-btn { height: 30px; padding: 0 10px; margin-left: 4px; font-size: 12.5px; border-radius: 8px; background: transparent; color: var(--text-2); }
.cloud-btn:hover { color: var(--text); }
.cloud-btn.dirty { color: var(--accent-hi); border-color: rgba(255, 107, 61, .45); }
.account-btn { height: 36px; padding: 0 12px; border-radius: 10px; }
.account-btn:has(.avatar) { width: 36px; padding: 0; border-radius: 50%; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; flex: none; }
.menu-head { display: grid; gap: 3px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head small { color: var(--text-3); font-size: 11.5px; }
.quota { height: 4px; border-radius: 2px; background: var(--surface-4); overflow: hidden; margin-top: 6px; }
.quota i { display: block; height: 100%; background: var(--accent); }
.modal-card:has(.narrow) { width: min(520px, 100%); }
.modal-card:has(.narrow.wide) { width: min(640px, 100%); }
.perks { margin: 18px 0 8px; padding-left: 20px; color: var(--text-2); line-height: 1.8; }
.callout-msg { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text) !important; }
button.danger { background: var(--rec); border-color: var(--rec); color: #fff; font-weight: 650; }
.members { display: grid; gap: 4px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.member small, .version-row small { display: block; color: var(--text-3); font-size: 12px; }
.version-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--surface-2); }
.version-row.sel { border-color: var(--accent); }
.version-row .vnum { font-family: var(--mono); font-weight: 600; color: var(--accent-hi); min-width: 34px; }
.version-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cloud-promo { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 8px; border: 1px dashed var(--line-2); border-radius: 12px; }
.cloud-promo p { margin: 2px 0 0; }
.mono-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-hi); margin-bottom: 6px; }

/* sign-in screen (required on the website) */
body.gated #topbar, body.gated #workspace, body.gated #editor, body.gated #coach { filter: blur(6px) brightness(.5); pointer-events: none; user-select: none; }
.gate { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: rgba(5, 6, 8, .55); overflow: auto; }
.gate-card { width: min(460px, 100%); display: grid; gap: 14px; padding: 34px 34px 28px; background: var(--surface-1); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 100px #000d; animation: rise .25s ease; }
.gate-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.gate h1 { margin: 6px 0 0; font-size: 26px; line-height: 1.15; letter-spacing: -.025em; }
.gate p { margin: 0; color: var(--text-2); line-height: 1.6; }
.gate .field { margin: 4px 0 0; }
.gate input[type=email] { height: 44px; font-size: 15px; }
.gate button.primary { height: 46px; font-size: 15px; }
.gate .perks { margin: 4px 0 0; }
.gate a { color: var(--accent-hi); text-decoration: none; }
.gate a:hover { text-decoration: underline; }
button.linklike { justify-self: start; height: auto; padding: 0; border: 0; background: none; color: var(--accent-hi); font-weight: 550; }
button.linklike:hover { background: none; text-decoration: underline; }

/* plans */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }
.plan { display: grid; gap: 6px; align-content: start; padding: 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.plan.pro { border-color: rgba(255, 107, 61, .5); background: linear-gradient(180deg, rgba(255, 107, 61, .08), var(--surface-2) 70%); }
.plan.current { box-shadow: 0 0 0 2px var(--accent); }
.plan b { font-size: 15px; }
.plan .price { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.plan ul { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.7; font-size: 13px; }
.plan .pill { justify-self: start; }
a.btn-primary { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 650; text-decoration: none; }
a.btn-primary:hover { background: var(--accent-hi); }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }

/* phones: the app is built for a computer screen */
.phone-note { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg); overflow: auto; }
.phone-card { width: min(440px, 100%); display: grid; gap: 14px; }
.phone-card h1 { margin: 4px 0 0; font-size: 26px; line-height: 1.15; letter-spacing: -.025em; }
.phone-card p { margin: 0; color: var(--text-2); line-height: 1.6; }
.phone-card button.primary { height: 46px; font-size: 15px; }
.phone-card a { color: var(--accent-hi); text-decoration: none; }

/* notes panel (testers) */
.notes-btn { height: 36px; border-radius: 10px; }
.notes-btn.on { background: var(--accent-soft); border-color: rgba(255, 107, 61, .45); color: var(--accent-hi); }
.notes-panel { position: fixed; top: 64px; right: 12px; bottom: 48px; z-index: 45; width: min(400px, calc(100vw - 24px)); display: flex; flex-direction: column; background: var(--surface-1); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 24px 70px #000c; animation: rise .18s ease; }
.notes-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.notes-head b { font-size: 15px; }
.notes-list { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.note-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; line-height: 1.5; }
.note-msg.theirs { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.note-msg.mine { align-self: flex-end; background: var(--accent-soft); border: 1px solid rgba(255, 107, 61, .3); border-bottom-right-radius: 4px; }
.note-body { white-space: pre-wrap; word-wrap: break-word; }
.note-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.note-meta .q { margin-left: auto; border: 0; }
.notes-compose { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.notes-compose textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
