/* Music Mind: chiaroscuro. A painted near-black ground, cream paper and ink,
   verdigris cloth, ochre wood, blood red. Classical serif caps with italic
   subtitles, mono for the machinery, dot-matrix for numbers. */
:root {
  color-scheme: dark;
  /* ground & paper */
  --bg: #0b0a08;
  --bg2: #13110e;
  --card: #181511;
  --card-hi: #201c16;
  --line: #2f2a22;
  --line-hi: #4a4134;
  --text: #ece3cf;
  --muted: #9a8f7b;
  --paper: #e9dfc7;
  --ink: #15120d;
  /* pigments */
  --accent: #c9a24e;      /* gilt ochre */
  --accent-ink: #1a1408;
  --red: #b23a3f;         /* blood */
  --verdigris: #5a957b;   /* the cloth */
  --rose: #c77486;        /* dusty rose */
  --navy: #8193cf;        /* lightened navy */
  --orange: #d9732e;
  --good: #6aa98c;
  --bad: #c4454b;
  /* layers */
  --rhythm: #c08a3e;
  --bass: #c4454b;
  --harmony: #5a957b;
  --melody: #8193cf;
  --texture: #c77486;
  --vocal: #d9732e;
  /* type */
  --serif: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --dots: 'Doto', 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 4px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.5 var(--serif);
  padding-top: var(--safe-t);
  padding-bottom: calc(66px + var(--safe-b));
  overscroll-behavior-y: none;
  background:
    radial-gradient(120% 60% at 50% -10%, #1d1912 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
/* canvas grain over everything */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#view { max-width: 920px; margin: 0 auto; padding: 14px 16px 28px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.12; margin: 6px 0 8px; letter-spacing: 0.01em; }
h2 { font-size: 21px; margin: 20px 0 8px; }
h3 { font-size: 18px; margin: 0; }
h4 { margin: 18px 0 6px; font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
p { margin: 6px 0; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 14px; font-style: italic; }
input, select, textarea {
  font: 14px var(--mono); color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 9px; min-width: 0;
}
textarea { width: 100%; resize: vertical; font: 16px/1.45 var(--serif); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
input[type=range] { padding: 0; accent-color: var(--accent); background: none; border: 0; }
input[type=checkbox] { accent-color: var(--red); }
.num { width: 68px; }

/* Buttons: mono, set like stencilled labels */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text); background: var(--card); border: 1px solid var(--line-hi); border-radius: var(--radius);
  padding: 11px 15px; cursor: pointer; text-decoration: none; min-height: 42px;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.btn:hover { background: var(--card-hi); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.primary:hover { background: #fff6e0; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 6px 10px; min-height: 32px; font-size: 11px; }
.btn.big { font-size: 14px; padding: 15px 22px; }
.btn:disabled { opacity: 0.35; }
.link { background: none; border: 0; color: var(--accent); font: inherit; padding: 6px 0; cursor: pointer; text-align: left; }
.chip {
  font: 13px var(--mono); color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 11px; cursor: pointer; min-height: 32px; text-decoration: none;
}
.chip.on { background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 600; }
.chip.wide { border-radius: var(--radius); }
.chip b { display: block; font: 600 16px var(--serif); }
.chip small { display: block; opacity: 0.7; font-size: 11px; }
.tag { display: inline-block; font: 11px var(--mono); letter-spacing: 0.06em; padding: 2px 8px; border-radius: 2px; background: transparent; border: 1px solid var(--line-hi); margin-right: 6px; color: var(--muted); }
.tag.warn { color: var(--accent); border-color: #5b4a26; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 160px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.actions.sticky { position: sticky; bottom: calc(70px + var(--safe-b)); background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
.field { display: inline-flex; flex-direction: column; gap: 3px; font: 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.field.wide { display: flex; width: 100%; margin: 8px 0; }
.field.wide input, .field.wide textarea { text-transform: none; letter-spacing: 0; font: 16px var(--serif); }
.check { display: inline-flex; align-items: center; gap: 6px; font: 13px var(--mono); }
.section-title { margin-top: 30px; }
.section-title::before { content: ''; display: block; width: 28px; height: 1px; background: var(--accent); margin-bottom: 10px; }

/* Masthead (home): caps title over an italic line, the way the record sleeve does it */
.masthead { padding: 8px 0 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.mm-title { font: 500 15px/1 var(--serif); letter-spacing: 0.32em; text-transform: uppercase; color: var(--paper); }
.mm-sub { font: italic 400 17px/1.3 var(--serif); color: var(--muted); margin-top: 4px; }

/* Bottom nav */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; background: rgba(11, 10, 8, 0.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 7px 4px calc(7px + var(--safe-b));
}
#nav a, .nav-more {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  text-decoration: none; background: none; border: 0; cursor: pointer; padding: 2px;
}
#nav .ico { font: 19px/1.25 var(--serif); }
#nav a.on { color: var(--paper); }
#nav a.on::after { content: ''; position: absolute; top: -8px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }

/* Pages */
.hero { margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 62ch; }
.hero h1::after {
  content: ''; display: block; width: 64px; height: 7px; margin-top: 10px; opacity: 0.55;
  background:
    repeating-linear-gradient(45deg, var(--muted) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, var(--muted) 0 1px, transparent 1px 4px);
}
.back { font: 12px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none; }
.artist { color: var(--muted); margin-top: -4px; font-style: italic; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; color: var(--text); text-decoration: none; transition: border-color 0.15s; }
.card:hover { border-color: var(--line-hi); }
.card h3 { font-size: 20px; }
.card p { color: var(--muted); font-size: 15px; }
.card.locked { opacity: 0.55; }
.song-top { display: flex; justify-content: space-between; gap: 8px; }
.needs { font: 11px var(--mono) !important; letter-spacing: 0.04em; color: var(--accent) !important; }

/* Path */
.concepts { display: flex; flex-direction: column; gap: 8px; }
.concept { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.concept.passed { border-color: #2e4a3d; }
.concept-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.concept-title { flex: 1; font-size: 19px; }
.status { font: 11px var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.concept.passed .status { color: var(--good); }
.badge { font: 9px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; padding: 3px 6px; border: 1px solid currentColor; border-radius: 2px; }
.side-rhythm { color: var(--rhythm); }
.side-musical { color: var(--harmony); }
.side-production { color: var(--texture); }
.side-bass { color: var(--bass); }
.concept-body { padding: 0 14px 12px; }
.concept-body p { color: #d6ccb6; }
.listen, .task, .unlocks { font-size: 15px; }

/* Drill */
.drill-start { padding: 34px 0; display: flex; justify-content: center; }
.drill { display: flex; flex-direction: column; gap: 14px; }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt { flex: 1; font: 19px var(--serif); text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; transition: border-color 0.15s; }
.opt:hover { border-color: var(--line-hi); }
.opt.correct { border-color: var(--good); background: #15241d; }
.opt.wrong { border-color: var(--bad); background: #2a1415; }
.feedback { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.progress { font: 600 15px var(--dots) !important; color: var(--accent) !important; letter-spacing: 0.06em; }
.result { background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
.result.pass { border-color: var(--good); }
.set-picker summary { cursor: pointer; color: var(--muted); font: 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 0; }

/* Studio */
.studio { display: flex; flex-direction: column; gap: 12px; }
.transport { position: sticky; top: var(--safe-t); z-index: 10; display: flex; gap: 6px; align-items: flex-end; background: var(--bg); padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
.transport select { max-width: 96px; padding: 8px 6px; }
.transport .num { width: 58px; }
.transport > .btn:last-child { margin-left: auto; }
.play { flex: none; width: 48px; height: 48px; border-radius: 50%; font-size: 18px; padding: 0; letter-spacing: 0; }
.play.on { background: var(--red); border-color: var(--red); color: var(--paper); box-shadow: 0 0 22px rgba(178, 58, 63, 0.45); }
.proj-name { font: 500 20px var(--serif); }
.proj-name .tag { margin-left: 8px; vertical-align: middle; }
.lane-label { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 5px; }
.chord-cells { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.chord-cell { font: inherit; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 6px; cursor: pointer; }
.chord-cell.cur { border-color: var(--harmony); }
.chord-cell b { display: block; font: 500 21px var(--serif); }
.chord-cell small { font: 11px var(--mono); color: var(--muted); }
.pager { display: flex; gap: 6px; align-items: center; font: 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tracks { display: flex; flex-direction: column; gap: 7px; }
.track { --c: var(--muted); border-left: 2px solid var(--c); padding-left: 7px; }
.track.sel { background: linear-gradient(90deg, rgba(233, 223, 199, 0.06), transparent); }
.track.muted .steps { opacity: 0.3; }
.layer-rhythm { --c: var(--rhythm); }
.layer-bass { --c: var(--bass); }
.layer-harmony { --c: var(--harmony); }
.layer-melody { --c: var(--melody); }
.layer-texture { --c: var(--texture); }
.layer-vocal { --c: var(--vocal); }
.track-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.track-name { flex: 1; background: none; border: 0; color: var(--text); font: 500 17px var(--serif); text-align: left; padding: 2px 0; cursor: pointer; }
.track-name small { font: 11px var(--mono); color: var(--muted); margin-left: 6px; }
.ms { width: 30px; height: 26px; border-radius: 2px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font: 600 11px var(--mono); cursor: pointer; }
.ms.on { background: var(--red); color: var(--paper); border-color: var(--red); }
.ms.solo.on { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.steps { display: grid; gap: 3px; }
.cell { position: relative; height: 32px; border-radius: 2px; border: 0; background: #27221b; padding: 0; cursor: pointer; overflow: hidden; transition: background 0.08s; }
.cell.alt { background: #1d1914; }
.cell.on { background: var(--c); }
.cell.ghost { background: var(--c); opacity: 0.45; }
.cell.now { outline: 1px solid var(--paper); outline-offset: -1px; box-shadow: 0 0 10px rgba(233, 223, 199, 0.35); }
.cell i { font: normal 700 9px var(--mono); color: var(--ink); }
.panel { --c: var(--accent); background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--c); border-radius: var(--radius); padding: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-head h3 { font-size: 22px; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.slider { display: flex; flex-direction: column; font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.oct { display: inline-flex; gap: 4px; align-items: center; font: 11px var(--mono); color: var(--muted); }
.roll { margin-top: 8px; }
.roll-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.roll-row { display: grid; grid-template-columns: 44px 1fr; gap: 4px; margin-bottom: 2px; }
.roll-row .cell { height: 22px; }
.roll-row.out .cell:not(.on) { background: #15120e; }
.roll-key { font: 10px var(--mono); background: var(--bg2); border: 1px solid var(--line); border-radius: 2px; color: var(--muted); cursor: pointer; padding: 0; }
.roll-key.root { color: var(--paper); border-color: var(--red); }
.cell.rootrow:not(.on) { box-shadow: inset 0 0 0 1px rgba(178, 58, 63, 0.45); }
.spec-wrap { margin-top: 6px; }
.spectrum { width: 100%; height: 110px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); display: block; }

/* Song anatomy */
.why { background: var(--card); border-radius: var(--radius); padding: 4px 16px 12px; border: 1px solid var(--line); }
.why p { font-size: 18px; }
.meta { margin-top: 8px; }
.arr { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.arr-row { display: grid; grid-template-columns: 74px 1fr; gap: 6px; align-items: stretch; margin-bottom: 3px; min-width: 520px; }
.arr-label { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); align-self: center; }
.arr-cells { display: flex; gap: 2px; }
.arr-sec { padding: 5px 6px; border-radius: 2px; font: 13px var(--serif); overflow: hidden; background: #25201a; }
.arr-sec b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-sec small { font: 10px var(--mono); color: var(--muted); }
.arr-sec.e4, .arr-sec.e5 { background: #4a2a24; }
.arr-sec.e3 { background: #3a2f22; }
.arr-cell { height: 14px; border-radius: 2px; background: #1a1712; }
.arr-cell.on { background: var(--c); opacity: 0.85; }
.curve { height: 46px; color: var(--accent); }
.energy { width: 100%; height: 46px; }
.sections { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sec-detail { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; }
.chords { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chord { display: inline-flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 2px 8px; }
.chord b { font: 600 16px var(--serif); }
.chord small { font: 10px var(--mono); color: var(--muted); }
.chord.bad { border-color: var(--bad); }
.mission { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.mission p { margin: 2px 0 8px; }
.locked-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

/* Editor */
.sec-edit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }

/* Sheet & toast */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0); transition: background 0.2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap.show { background: rgba(0,0,0,0.6); }
.sheet { width: 100%; max-width: 640px; max-height: 86vh; overflow: auto; background: var(--bg2); border-top: 1px solid var(--line-hi); border-radius: 10px 10px 0 0; padding: 14px 16px calc(22px + var(--safe-b)); transform: translateY(100%); transition: transform 0.22s ease-out; }
.sheet-wrap.show .sheet { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { font-size: 22px; }
.pick-row { margin: 12px 0; }
.pick-label { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-grid .chip { min-width: 58px; }
.list-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; transition: all 0.25s; background: var(--paper); color: var(--ink); padding: 11px 16px; border-radius: var(--radius); z-index: 60; max-width: 90vw; font: 15px var(--serif); box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .track { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; }
  .track-head { margin: 0; }
  .sliders { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 38px; }
}

/* Bass Lab */
.callout { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-left: 2px solid var(--red); border-radius: var(--radius); padding: 13px 15px; margin: 6px 0 14px; color: var(--text); text-decoration: none; }
.callout b { font: 500 19px var(--serif); }
.callout span { color: var(--muted); font-size: 15px; }
.lessons { display: flex; flex-direction: column; gap: 8px; }
.lesson { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; transition: border-color 0.15s; }
.lesson:hover { border-color: var(--line-hi); }
.lesson b { font: 500 18px var(--serif); }
.lesson small { display: block; font: 11px var(--mono); color: var(--muted); margin-top: 2px; }
.lesson-n { flex: none; width: 34px; text-align: center; font: 700 26px/1 var(--dots); color: var(--red); }
.band-n { color: var(--accent); font-family: var(--serif); }
.idea { color: #d6ccb6; max-width: 62ch; font-size: 18px; }
.labbar { position: sticky; top: var(--safe-t); z-index: 5; display: flex; gap: 12px; align-items: center; background: var(--bg); padding: 8px 0; font: 12px var(--mono); }
.variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.variant { display: flex; align-items: center; gap: 9px; font: 500 17px var(--serif); color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; }
.variant.on { border-color: var(--paper); background: var(--card-hi); }
.v-letter { flex: none; width: 24px; height: 24px; border-radius: 2px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font: 600 12px var(--mono); }
.variant.on .v-letter { background: var(--red); border-color: var(--red); color: var(--paper); }
.what { min-height: 2.6em; font-style: italic; color: #d6ccb6; }
.bassviz { display: flex; flex-direction: column; gap: 9px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.bv-chord { font: 500 16px var(--serif); margin-bottom: 2px; }
.bv-chord .muted { font: 12px var(--mono); }
.bv-row { display: grid; grid-template-columns: 36px 1fr; gap: 6px; align-items: center; margin-bottom: 2px; }
.bv-label { font: 9px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.bv-grid { display: grid; gap: 2px; }
.bv-cell { height: 12px; border-radius: 2px; background: #201c16; }
.bv-cell.beat { background: #2c261e; }
.bv-cell.kick { background: var(--rhythm); }
.bv-row:last-child .bv-cell { height: 36px; }
.bv-cell.note { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); line-height: 1; overflow: hidden; }
.bv-cell.note b { font: 700 13px var(--mono); }
.bv-cell.note small { font: 8px var(--mono); opacity: 0.75; }
.bv-cell.now { outline: 1px solid var(--paper); outline-offset: -1px; box-shadow: 0 0 10px rgba(233, 223, 199, 0.35); }
.r-root { background: var(--red) !important; color: var(--paper) !important; }
.r-fifth { background: var(--verdigris) !important; }
.r-third { background: var(--accent) !important; }
.r-seventh { background: var(--navy) !important; }
.r-approach { background: var(--rose) !important; }
.r-other { background: #8f8573 !important; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lg { font: 11px var(--mono); padding: 3px 8px; border-radius: 2px; color: var(--ink); }
.band { background: var(--bg2); border-left: 2px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; padding: 4px 15px 10px; margin-top: 16px; }
.band h3 { margin-top: 10px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--red); }
.band p { font-size: 17px; }
.bandsong { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.bandsong h3 { font-size: 22px; }
.bandsong > p { color: var(--muted); font-size: 16px; }
.draftbox { background: var(--bg2); border: 1px solid #5b4a26; border-radius: var(--radius); padding: 11px 13px; font-size: 16px; margin-bottom: 10px; }
.draftbox b { color: var(--accent); font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.frets { margin-top: 12px; }
.fret-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fret { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 10px; }
.fret b { font: 600 17px var(--serif); color: var(--paper); }
.fret small { font: 10px var(--mono); color: var(--muted); }

/* Key */
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 2px; flex-wrap: wrap; margin: 4px 0 12px; }
.seg-btn { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: none; border: 0; border-radius: 2px; padding: 8px 10px; text-decoration: none; cursor: pointer; }
.seg-btn.on { background: var(--paper); color: var(--ink); }
.seg.small { margin: 0; }
.steps3 { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step3 { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; color: var(--text); text-decoration: none; transition: border-color 0.15s; }
.step3:hover { border-color: var(--line-hi); }
.step3 b { font: 500 20px var(--serif); }
.step3 span { color: var(--muted); font-size: 15px; }
.kg { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.kg-row { display: grid; grid-template-columns: 52px repeat(12, minmax(30px, 1fr)); gap: 3px; min-width: 430px; }
.kg-label { font: 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; align-self: center; }
.kg-cell { display: grid; place-items: center; height: 38px; border-radius: 2px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font: 600 15px var(--serif); text-decoration: none; transition: border-color 0.15s; }
.kg-cell:hover { border-color: var(--line-hi); color: var(--text); }
.kg-cell.done { background: var(--red); border-color: var(--red); color: var(--paper); }
.kg-pick { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.ask { font: 500 22px var(--serif); }

/* The neck: rosewood, pearl dots, nickel frets, a bone nut, cream note dots */
.fb-scroll { overflow-x: auto; margin: 12px 0; padding-bottom: 4px; }
.fb { min-width: 620px; }
.fb-board {
  position: relative; display: flex; flex-direction: column; padding: 6px 0;
  border-radius: 3px; box-shadow: inset 0 0 0 1px #000, 0 10px 30px rgba(0,0,0,0.5);
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(88deg, rgba(255,210,170,0.035) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, #3d2419, #2f1b13 50%, #3a2218);
}
.fb-row { display: grid; grid-template-columns: 22px 38px repeat(12, 1fr); align-items: center; position: relative; }
.fb-row.nums { margin-top: 6px; }
.fb-name { font: 600 10px var(--mono); color: #a8957c; text-align: center; }
.fb-num { font: 700 17px var(--dots); color: var(--paper); opacity: 0.8; text-align: center; }
.fb-inlays { position: absolute; inset: 0; pointer-events: none; }
.fb-inlay { position: relative; height: 100%; }
.fb-inlay.single::before, .fb-inlay.double::before, .fb-inlay.double::after {
  content: ''; position: absolute; left: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffaf0, #e2d8c4 45%, #b9ae99);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35); opacity: 0.85;
}
.fb-inlay.single::before { top: 50%; }
.fb-inlay.double::before { top: 26%; }
.fb-inlay.double::after { top: 74%; }
.fb-cell { position: relative; height: 38px; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; background: none;
  border-right: 3px solid transparent; border-image: linear-gradient(90deg, #6e6a62, #e6e1d6 45%, #8d887e) 1; }
.fb-cell::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: var(--gauge, 1.5px); transform: translateY(-50%);
  background: linear-gradient(180deg, #f2ede2, #9c968b); box-shadow: 0 1px 1px rgba(0,0,0,0.6); }
.str-0 .fb-cell::before, .str-1 .fb-cell::before { background: repeating-linear-gradient(90deg, #d8d2c5 0 1px, #9b958a 1px 2px); }
.fb-cell.open { background: rgba(0,0,0,0.35); border-image: none; border-right: 6px solid #efe6d2; }
.fb-dot {
  position: relative; z-index: 1; min-width: 27px; height: 27px; padding: 0 4px; border-radius: 14px; display: grid; place-items: center;
  font: 700 11px var(--mono); background: var(--paper); color: var(--ink);
  box-shadow: 0 2px 4px rgba(0,0,0,0.6), inset 0 -2px 0 rgba(0,0,0,0.12);
  transition: transform 0.12s;
}
.fb-cell:active .fb-dot { transform: scale(0.88); }
.fb-dot.tonic { background: var(--red); color: var(--paper); box-shadow: 0 0 0 2px rgba(233, 223, 199, 0.5), 0 2px 8px rgba(178, 58, 63, 0.6); }
.fb-dot.outside { background: rgba(21, 18, 13, 0.75); color: var(--muted); box-shadow: inset 0 0 0 1px var(--muted); }
.fb-cell.right .fb-dot { background: var(--good); color: var(--ink); }
.fb-cell.wrong .fb-dot { background: var(--bad); color: var(--paper); }
.fb-cell.ask .fb-dot { background: var(--accent); color: var(--ink); }
.fb-cell.right::after, .fb-cell.wrong::after, .fb-cell.ask::after { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; z-index: 0; }
.fb-cell.right::after { background: var(--good); }
.fb-cell.wrong::after { background: var(--bad); }
.fb-cell.ask::after { background: var(--accent); box-shadow: 0 0 14px rgba(201, 162, 78, 0.7); }

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

/* Dot-matrix frame (js/dotfield.js) and page entrance */
.dotfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#view { position: relative; z-index: 1; }
#view.enter > * { animation: enter 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes enter { from { opacity: 0.001; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Chord track (Studio) */
.chord-lane .lane-label { display: flex; gap: 4px; }
.chord-now { color: var(--paper); letter-spacing: 0.04em; }
.chord-track { display: grid; gap: 3px; }
.chord-block {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; min-width: 0; overflow: hidden;
  height: 52px; padding: 4px 8px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #24342c, #1c2923); border: 1px solid #3b5a4b; border-left: 3px solid var(--verdigris);
  border-radius: 3px; color: var(--paper); font: inherit;
}
.chord-block.carried { border-left-style: dashed; opacity: 0.8; }
.chord-block b { font: 600 18px/1.1 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chord-block small { font: 10px var(--mono); color: #a8c4b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chord-block.tight { padding: 4px 3px; align-items: center; }
.chord-block.tight b { font-size: 12px; }
.chord-block.tight small { display: none; }
.chord-ticks { display: grid; gap: 3px; margin-top: 3px; }
.tick { height: 4px; border-radius: 1px; background: #26221b; }
.tick.beat { background: #3a342a; }
.tick.now { background: var(--paper); }
.type-out { min-height: 1.4em; font: 13px var(--mono); margin: 2px 0 6px; }
.type-out b { font: 600 17px var(--serif); color: var(--paper); }

/* Studio note grid: scrolls inside the panel */
.roll-scroll { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Projects list (Studio menu) */
.list.projects .list-item { padding: 4px 0; }
.list.projects .list-item.cur .link b { color: var(--paper); }
.list.projects .list-item.cur .link b::before { content: '● '; color: var(--red); }
.list.projects .link b { font: 500 17px var(--serif); color: var(--text); }
.list.projects .link small { font: 11px var(--mono); color: var(--muted); }

/* Bass Lab: chord blocks over the line, your projects, the read view */
.bv-chords { gap: 2px; }
.bv-chord-block { display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 2px 6px; border-left: 2px solid var(--verdigris); background: #1f2b25; border-radius: 2px; }
.bv-chord-block.carried { border-left-style: dashed; }
.bv-chord-block b { font: 600 14px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-chord-block small { font: 9px var(--mono); color: #a8c4b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-n { color: var(--verdigris); font-family: var(--serif); }
.mine { margin-bottom: 12px; }
.mine-item { border-color: #3b5a4b; }
.tab { display: flex; flex-direction: column; gap: 10px; }
.tab-head { font: 500 16px var(--serif); margin-bottom: 4px; }
.tab-head .muted { font: 12px var(--mono); }
.tab-notes { display: flex; flex-wrap: wrap; gap: 5px; }
.tab-note { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 4px; align-items: baseline; min-width: 52px; padding: 5px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; color: var(--text); cursor: pointer; font: inherit; }
.tab-note .tab-str { font: 600 11px var(--mono); color: var(--muted); }
.tab-note b { font: 700 20px var(--mono); color: var(--paper); }
.tab-note small { grid-column: 1 / -1; font: 700 10px var(--mono); border-radius: 2px; padding: 0 4px; color: var(--ink); justify-self: start; }
.tab-note.now { border-color: var(--paper); box-shadow: 0 0 12px rgba(233, 223, 199, 0.35); }
.fb-cell.used .fb-dot { background: var(--paper); }
.fb-cell.used .fb-dot.tonic { background: var(--red); }
.fb-cell.now .fb-dot { background: var(--accent) !important; color: var(--ink) !important; transform: scale(1.18); box-shadow: 0 0 16px rgba(201, 162, 78, 0.8); }

/* Band songs */
.parts { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.part { background: var(--card); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.part-head b { font: 500 19px var(--serif); }
.part .lessons { margin: 8px 0; }
