/* ============================================================================
   Merryn Music — the transport, the playhead, the tabs, and the rooms
   From the top: the mark and the transport; the playhead, a row of the
   song's bars with the music moving along it; the tabs. They stay put. The
   rest of the window is the room in the chosen tab, full width, scrolling
   inside itself so nothing above it ever scrolls away.
   ============================================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--cream); color: var(--humus); font: 15px/1.4 var(--font-sans);
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------- the top bar --- */
.shellbar {
  flex: none; display: flex; align-items: center; gap: 18px;
  min-height: 56px; padding: 6px 16px;
  background: var(--kiwi-brown); color: var(--cream);
  position: relative; z-index: 3;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand .logo { width: 28px; height: 28px; color: var(--cream); }
.brand .name { font: bold 19px var(--font-serif); letter-spacing: .01em; white-space: nowrap; }

.transport {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
}
.tplay {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #9CCB7E; color: var(--humus); box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.tplay:hover { background: #b3dc97; }
.tplay svg { width: 20px; height: 20px; fill: currentColor; }
.tplay .i-pause { display: none; }
.tplay.on .i-play { display: none; }
.tplay.on .i-pause { display: inline; }
.tplay.armed { animation: pulse 1.1s ease-in-out infinite; background: #E7B36A; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(231, 179, 106, .28); } }
.tstop {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(253, 246, 227, .45); background: none; color: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
}
.tstop svg { width: 13px; height: 13px; fill: currentColor; }
.tstop:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: var(--cream); }
.tstop:disabled { opacity: .45; cursor: default; }

.tnow { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ttitle { font: bold 16px var(--font-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tinfo { font-size: 12.5px; color: rgba(253, 246, 227, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ttempo { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ttempo input[type=range] { width: 110px; accent-color: #9CCB7E; }
.tstep {
  width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1.5px solid rgba(253, 246, 227, .45); background: none; color: var(--cream); font: bold 14px/1 var(--font-sans);
}
.tstep:hover { background: rgba(255, 255, 255, .12); }
.ttempo output { font: 600 13.5px var(--font-sans); min-width: 58px; font-variant-numeric: tabular-nums; }
.tfield select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: rgba(0, 0, 0, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23FDF6E3' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center / 10px;
  color: var(--cream); border: 1.5px solid rgba(253, 246, 227, .35); border-radius: 8px;
  padding: 5px 26px 5px 9px; font: 13px var(--font-sans);
}
.tfield select option { color: var(--humus); background: #fff; }
.tcheck { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.tcheck input { accent-color: #9CCB7E; width: 15px; height: 15px; margin: 0; }
.tplay:focus-visible, .tstop:focus-visible, .tstep:focus-visible, .tfield select:focus-visible, .tcheck input:focus-visible {
  outline: 2px solid #9CCB7E; outline-offset: 2px;
}

/* ---------------------------------------------------------- playhead --- */
.playhead {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 16px 8px; background: var(--kiwi-brown); color: var(--cream);
  position: relative; z-index: 2;
}
.ptrack {
  position: relative; flex: 1 1 auto; height: 26px; border-radius: 6px; cursor: pointer;
  background: rgba(0, 0, 0, .22); overflow: hidden; touch-action: none;
}
.ptrack:focus-visible { outline: 2px solid #9CCB7E; outline-offset: 2px; }
.pbars { position: absolute; inset: 0; display: flex; }
.pbar { flex: 1 1 0; min-width: 0; border-right: 1px solid rgba(253, 246, 227, .12); position: relative; }
.pbar:last-child { border-right: 0; }
.pbar[data-n]::after {
  content: attr(data-n); position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  font: 600 10px var(--font-sans); color: rgba(253, 246, 227, .55); pointer-events: none;
}
.pbar.part { border-left: 2px solid rgba(156, 203, 126, .75); }
.pbar.part::after { color: #bfe3a6; font-size: 11px; }
.pbar.cur { background: rgba(156, 203, 126, .16); }
.pfill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(156, 203, 126, .10), rgba(156, 203, 126, .34)); pointer-events: none;
}
.phead {
  position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; left: 0;
  background: #cfeebb; box-shadow: 0 0 8px rgba(156, 203, 126, .9); border-radius: 2px; pointer-events: none;
}
.pghost {
  position: absolute; top: 2px; transform: translateX(-50%); pointer-events: none;
  background: var(--cream); color: var(--kiwi-brown); font: 600 11px var(--font-sans);
  padding: 2px 6px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.pghost[hidden] { display: none; }
.pread { flex: none; font: 600 12.5px var(--font-sans); min-width: 84px; font-variant-numeric: tabular-nums; }
.pnote { flex: none; font-size: 12.5px; color: #F2C98C; max-width: 34ch; }
.pnote:empty { display: none; }

/* -------------------------------------------------------------- tabs --- */
/* The tabs, and at the right of them the workspace: save it all to a
   file, or load one back. */
.tabrow {
  flex: none; display: flex; align-items: stretch; height: 42px;
  background: var(--brown-dark);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .18), 0 2px 8px rgba(45, 35, 24, .18);
  position: relative; z-index: 1;
}
.tabs {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; gap: 2px; padding: 0 10px;
  overflow-x: auto; scrollbar-width: none;
}
.workspace { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 6px; }
.wsbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 8px;
  border-radius: 14px; border: 1.5px solid rgba(253, 246, 227, .35); background: none; cursor: pointer;
  color: rgba(253, 246, 227, .9); font: 600 12.5px var(--font-sans); white-space: nowrap;
}
.wsbtn svg { width: 15px; height: 15px; flex: none; }
.wsbtn:hover { background: rgba(255, 255, 255, .1); border-color: var(--cream); color: #fff; }
.wsbtn:focus-visible { outline: 2px solid #9CCB7E; outline-offset: 2px; }
.wsnote { font-size: 12px; color: #cfeebb; max-width: 42ch; text-align: right; line-height: 1.25; }
.wsnote.bad { color: #F2C98C; }
.wsnote:empty { display: none; }
@media (max-width: 900px) {
  .wsbtn span { display: none; }
  .wsbtn { padding: 0 7px; }
  .wsnote { max-width: 24ch; }
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 0 14px; border: 0; background: none; cursor: pointer;
  font: 600 14px var(--font-sans); color: rgba(253, 246, 227, .78); white-space: nowrap;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.tabs button[hidden] { display: none; }
.tabs button svg { width: 17px; height: 17px; flex: none; }
.tabs button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.tabs button[aria-selected="true"] {
  color: #fff; border-bottom-color: #9CCB7E; background: rgba(0, 0, 0, .18);
}
.tabs button:focus-visible { outline: 2px solid #9CCB7E; outline-offset: -4px; border-radius: 6px; }

/* The rooms, stacked; the chosen one is the one you can see. */
.panes { flex: 1 1 auto; position: relative; min-height: 0; }
.pane { position: absolute; inset: 0; visibility: hidden; }
.pane.on { visibility: visible; }
.pane iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--cream); }

/* ------------------------------------------------------------ Help --- */
.pane.help { overflow: hidden; background: var(--cream); }
/* The topics down the left, one topic on the right; each side scrolls on
   its own (js/app/help.js). */
.helpwrap { position: absolute; inset: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.helpnav {
  overflow-y: auto; background: var(--subsoil); border-right: 1px solid var(--rule); padding: 14px 8px 24px;
  font-family: var(--font-sans);
}
.hnhead { margin: 0 10px 6px; font: bold 19px var(--font-serif); color: var(--kiwi-brown); }
.hngroup { margin: 14px 10px 4px; font: 600 11px var(--font-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hnlist { list-style: none; margin: 0; padding: 0; }
.hnitem {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; border-radius: 8px;
  padding: 7px 10px; font: 500 14px var(--font-sans); color: var(--humus);
}
.hnitem:hover { background: rgba(255, 255, 255, .55); }
.hnitem:focus-visible { outline: 2px solid var(--leaf-green); outline-offset: -2px; }
.hnitem[aria-current] { background: var(--kiwi-brown); color: var(--cream); font-weight: 600; }
.helpmain { overflow-y: auto; }
.hsec { max-width: 820px; padding: 26px 32px 40px; font-size: 14.5px; line-height: 1.5; color: var(--humus); }
.hsec[hidden] { display: none; }
.hsec h2 { margin: 0 0 8px; font: bold 26px var(--font-serif); color: var(--kiwi-brown); outline: none; }
.hsec h3 { margin: 26px 0 8px; font: bold 17px var(--font-serif); color: var(--kiwi-brown); }
.hsec p { margin: 0 0 12px; max-width: 72ch; }
.hsec .lede { margin: 0 0 18px; font-size: 15.5px; color: var(--muted); max-width: 70ch; }
.hsec a { color: var(--leaf-green); font-weight: 600; }
.hsec .tip {
  padding: 10px 14px; background: #F3F8EE; border: 1px solid #cfe0c2; border-left: 4px solid var(--leaf-green);
  border-radius: 8px; font-size: 14px;
}
.hsec .steps { margin: 0 0 14px; padding-left: 22px; max-width: 70ch; }
.hsec .steps li { margin: 0 0 6px; }
.hfoot { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rule); }
.hstep {
  display: flex; flex-direction: column; gap: 1px; border: 1.5px solid var(--rule); background: #fff; border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font: 600 14px var(--font-sans); color: var(--kiwi-brown); text-align: left;
}
.hstep.next { text-align: right; margin-left: auto; }
.hstep small { font: 500 11px var(--font-sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hstep:hover { border-color: var(--leaf-green); color: var(--green-dark); }
.hstep:focus-visible { outline: 2px solid var(--leaf-green); outline-offset: 2px; }

/* Synthesiser beside samples. */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0 0 16px; }
.compare section { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 4px 16px 10px; }
.compare h3 { margin-top: 12px; }
.compare ul { margin: 0; padding-left: 18px; }
.compare li { margin: 0 0 5px; }

/* The legend under the screen diagram. */
.legend { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.legend li { padding-left: 2px; }
.swatches { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font-size: 13px; color: var(--muted); }
.swatches i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.swatches .sw-good { background: var(--leaf-green); }
.swatches .sw-near { background: #C98A1B; }
.swatches .sw-miss { background: var(--clay-rust); }

/* ------------------------------------------------------ the diagrams --- */
.diagram { margin: 6px 0 20px; padding: 16px; background: #fff; border: 1px solid var(--rule); border-radius: 12px; }
.diagram svg { display: block; width: 100%; height: auto; max-width: 720px; overflow: visible; }
.diagram.small svg { max-width: 560px; }
.diagram figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.diagram figcaption .legend { font-size: 13.5px; color: var(--humus); }
.diagram text { font-family: var(--font-sans); font-size: 12.5px; }
.dg-t { fill: var(--humus); }
.dg-t-cream { fill: var(--cream); }
.dg-b { font-weight: 700; }
.dg-s { font-size: 11px !important; }
.dg-mute { fill: var(--muted); }
.dg-dark { fill: var(--kiwi-brown); }
.dg-dark2 { fill: var(--brown-dark); }
.dg-darkfill { fill: var(--humus); }
.dg-cream-fill { fill: var(--humus); }
.dg-play { fill: #9CCB7E; }
.dg-chip-d { fill: rgba(253, 246, 227, .12); stroke: rgba(253, 246, 227, .4); }
.dg-tabon { fill: rgba(253, 246, 227, .16); }
.dg-bars rect { fill: rgba(253, 246, 227, .1); }
.dg-fill { fill: rgba(156, 203, 126, .45); }
.dg-head { fill: #9CCB7E; }
.dg-soil { fill: var(--subsoil); }
.dg-box { fill: #fff; stroke: var(--rule); stroke-width: 1.5; }
.dg-soft { fill: var(--cream); stroke: var(--rule); }
.dg-green { fill: var(--leaf-green); }
.dg-line { fill: none; stroke: var(--kiwi-brown); stroke-width: 1.6; }
.dg-dash { stroke-dasharray: 5 4; }
.dg-arrowhead { fill: var(--kiwi-brown); }
.dg-callouts circle { fill: var(--clay-rust); stroke: #fff; stroke-width: 2; }
.dg-callouts text { fill: #fff; font-weight: 700; font-size: 11px; text-anchor: middle; }
.dg-cells rect { fill: #fff; stroke: var(--rule); stroke-width: 1.5; }
.dg-cells.dg-new rect { fill: #F3F8EE; stroke: var(--leaf-green); stroke-dasharray: 4 3; }
.dg-gridlines rect, .dg-gridlines path { fill: none; stroke: var(--subsoil); stroke-width: 1; }
.dg-gridlines rect { stroke: var(--rule); }
.dg-gridlines .dg-beat { stroke: var(--rule); stroke-width: 1.5; }
.dg-note { fill: var(--leaf-green); }
.dg-note.dg-sel { fill: var(--kiwi-brown); }
.dg-tree path { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.dg-noise { fill: #e7dcc5; }
.dg-heard { fill: var(--leaf-green); }
.dg-gate { fill: var(--clay-rust); }
.dg-white rect { fill: #fff; stroke: var(--humus); stroke-width: 1; }
.dg-black rect { fill: var(--humus); }
.dg-rh { fill: var(--leaf-green); }
.dg-lh { fill: #7FA7D6; }
.dg-next { fill: #fff; stroke: var(--clay-rust); stroke-width: 3; }
.dg-wood { fill: #E9D3AE; }
.dg-nut { fill: #FFFCF3; stroke: var(--rule); }
.dg-frets path { stroke: #b7a17c; stroke-width: 2.5; }
.dg-inlay { fill: #FFFCF3; }
.dg-strings path { stroke: #7d6a4f; stroke-width: 1.3; }
.dg-fingers circle { fill: var(--kiwi-brown); stroke: #fff; stroke-width: 1.5; }
.dg-fnum text { fill: var(--cream); font-weight: 700; font-size: 11px; text-anchor: middle; }
.dg-pick text { fill: var(--kiwi-brown); font-weight: 700; font-size: 20px; text-anchor: middle; }
.dg-pick + g text { text-anchor: middle; }
.guide { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 14.5px; }
.guide dt { font-weight: 700; color: var(--kiwi-brown); }
.guide dd { margin: 0; color: var(--humus); }
.hsec .guide { margin: 0 0 16px; }
.keys.wide td:nth-child(odd) { width: 150px; }
.hsec .keys { margin: 0 0 8px; }
.keys { border-collapse: collapse; font-size: 13.5px; width: 100%; }
.keys td { padding: 4px 10px 4px 0; vertical-align: top; }
.keys td:nth-child(odd) { white-space: nowrap; color: var(--kiwi-brown); font-weight: 600; }
.keyhead { margin: 12px 0 2px; font: 600 12.5px var(--font-sans); color: var(--muted); }
kbd {
  font: 600 11px/1 var(--font-sans); padding: 3px 6px; border-radius: 5px;
  background: #fff; border: 1px solid var(--rule); border-bottom-width: 2px; color: var(--kiwi-brown);
}
code { font-size: 13px; background: var(--subsoil); padding: 1px 5px; border-radius: 4px; }
.fine { font-size: 12.5px; color: var(--muted); margin: 18px 0 0; }

/* --------------------------------------------------------- listening --- */
/* The Listen button in the transport, with the microphone's level in it,
   and under the playhead the drawer it opens: what it hears, the tuner,
   the score, the recording. It is part of the header, so it stays put. */
.tlisten {
  flex: none; position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 9px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid rgba(253, 246, 227, .45); background: none; color: var(--cream); font: 600 13px var(--font-sans);
}
.tlisten svg { width: 17px; height: 17px; fill: currentColor; position: relative; }
.tlisten span { position: relative; }
.tlisten:hover { background: rgba(255, 255, 255, .12); border-color: var(--cream); }
.tlisten.on { background: #9CCB7E; border-color: #9CCB7E; color: var(--humus); }
.tlisten.rec { background: #d9644a; border-color: #d9644a; color: #fff; }
.tlevel { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: rgba(45, 35, 24, .55); transition: width 60ms linear; }
.tlisten:focus-visible { outline: 2px solid #9CCB7E; outline-offset: 2px; }

/* Random tune, beside Listen, and the switch between the synthesiser and
   the recorded samples: both work from any tab. */
.tpill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 9px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid rgba(253, 246, 227, .45); background: none; color: var(--cream); font: 600 13px var(--font-sans);
  white-space: nowrap;
}
.tpill svg { width: 17px; height: 17px; flex: none; }
.tpill:hover { background: rgba(255, 255, 255, .12); border-color: var(--cream); }
.tpill:focus-visible { outline: 2px solid #9CCB7E; outline-offset: 2px; }
.tsource {
  flex: none; display: inline-flex; height: 32px; padding: 2px; border-radius: 16px;
  border: 1.5px solid rgba(253, 246, 227, .45); background: rgba(0, 0, 0, .18);
}
.tsource button {
  border: 0; border-radius: 13px; padding: 0 11px; cursor: pointer; background: none;
  color: rgba(253, 246, 227, .8); font: 600 12.5px var(--font-sans); white-space: nowrap;
}
.tsource button:hover { color: #fff; }
.tsource button[aria-checked="true"] { background: #9CCB7E; color: var(--humus); }
.tsource button:focus-visible { outline: 2px solid #9CCB7E; outline-offset: 1px; }

.listen {
  flex: none; background: var(--brown-dark); color: var(--cream);
  padding: 8px 16px 12px; border-top: 1px solid rgba(0, 0, 0, .25);
  position: relative; z-index: 2; font-size: 13.5px;
}
.listen[hidden] { display: none; }
.lhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lmodes { display: inline-flex; gap: 2px; background: rgba(0, 0, 0, .22); border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.lmodes button {
  border: 0; background: none; color: rgba(253, 246, 227, .8); cursor: pointer;
  font: 600 13px var(--font-sans); padding: 5px 11px; border-radius: 7px; white-space: nowrap;
}
.lmodes button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.lmodes button[aria-selected="true"] { background: var(--cream); color: var(--kiwi-brown); }
.lmodes button:focus-visible, .lclose:focus-visible, .lbtn:focus-visible { outline: 2px solid #9CCB7E; outline-offset: 2px; }
.lmeter { width: 90px; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .3); overflow: hidden; flex: none; }
.lmeter { position: relative; }
.lmeter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9CCB7E 70%, #E7B36A 88%, #d9644a); transition: width 60ms linear; }
.lmeter.shut i { filter: grayscale(1) opacity(.55); }
.lmeter b { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--cream); left: 22%; }
.lgate { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.lgate input { width: 90px; accent-color: #9CCB7E; }
.lgate output { min-width: 48px; font-variant-numeric: tabular-nums; color: rgba(253, 246, 227, .8); }
.lstatus { flex: 1 1 200px; min-width: 0; font-size: 12.5px; color: #F2C98C; }
.lclose {
  flex: none; margin-left: auto; width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(253, 246, 227, .4); background: none; color: var(--cream); font: 18px/1 var(--font-sans);
}
.lclose:hover { background: rgba(255, 255, 255, .12); }

.lbody { display: none; align-items: center; gap: 12px 22px; flex-wrap: wrap; padding-top: 10px; }
.lbody.on { display: flex; }
.lbig { font: bold 30px/1.05 var(--font-serif); font-variant-numeric: tabular-nums; min-width: 3.2ch; }
.lbig small { font-size: 16px; font-weight: 600; margin-left: 2px; }
.lsub { margin: 2px 0 0; font-size: 12.5px; color: rgba(253, 246, 227, .72); max-width: 60ch; }
.lnow { min-width: 190px; }
.lroll {
  list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex: 1 1 300px; min-width: 0; overflow: hidden;
}
.lroll li {
  flex: none; background: rgba(0, 0, 0, .22); border-radius: 7px; padding: 4px 8px; line-height: 1.25;
  font-size: 12px; color: rgba(253, 246, 227, .8); white-space: nowrap; border-left: 3px solid rgba(253, 246, 227, .25);
}
.lroll li b { display: block; font: bold 15px var(--font-serif); color: var(--cream); }
.lroll li:first-child { background: rgba(0, 0, 0, .34); }
.lroll li.hit { border-left-color: #9CCB7E; }
.lroll li.wrong { border-left-color: #E7B36A; }
.lroll li.miss { border-left-color: #d9644a; }
.lroll li.miss b { color: rgba(253, 246, 227, .55); }

.lopts { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; }
.lopts label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.lopts input[type=checkbox] { accent-color: #9CCB7E; width: 15px; height: 15px; margin: 0; }
.lopts input[type=number], .lopts select {
  background: rgba(0, 0, 0, .22); color: var(--cream); border: 1.5px solid rgba(253, 246, 227, .35); border-radius: 7px;
  padding: 3px 6px; font: 13px var(--font-sans);
}
.lopts input[type=number] { width: 64px; }
.lopts select option { color: var(--humus); background: #fff; }
.lbtn {
  border: 1.5px solid rgba(253, 246, 227, .45); background: none; color: var(--cream); cursor: pointer;
  font: 600 12.5px var(--font-sans); padding: 5px 11px; border-radius: 8px; white-space: nowrap;
}
.lbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: var(--cream); }
.lbtn:disabled { opacity: .45; cursor: default; }

/* The tuner: a needle over fifty cents either side, and the note. */
.tuner { display: flex; align-items: center; gap: 22px; flex: 1 1 420px; min-width: 0; }
.tdial { position: relative; flex: 1 1 260px; max-width: 420px; height: 46px; }
.tscale { position: absolute; left: 0; right: 0; top: 22px; height: 2px; background: rgba(253, 246, 227, .3); }
.tscale i { position: absolute; top: -6px; width: 2px; height: 14px; margin-left: -1px; background: rgba(253, 246, 227, .45); }
.tscale i.z { top: -12px; height: 26px; background: var(--cream); }
.tzone { position: absolute; left: 45%; width: 10%; top: 6px; bottom: 6px; background: rgba(156, 203, 126, .22); border-radius: 4px; }
.tneedle {
  position: absolute; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; left: 50%; border-radius: 2px;
  background: rgba(253, 246, 227, .35); transition: left 90ms linear, background-color 150ms; z-index: 1;
}
.tneedle.near { background: #E7B36A; }
.tneedle.far { background: #d9644a; }
.tneedle.true { background: #9CCB7E; box-shadow: 0 0 10px rgba(156, 203, 126, .9); }
.tread { min-width: 150px; }
.tstrings { display: inline-flex; gap: 4px; }
.tstrings button {
  min-width: 34px; padding: 3px 7px; border-radius: 7px; cursor: pointer; font: 600 12.5px var(--font-sans);
  border: 1.5px solid rgba(253, 246, 227, .35); background: none; color: var(--cream);
}
.tstrings button.near { border-color: #E7B36A; }
.tstrings button.true { background: #9CCB7E; border-color: #9CCB7E; color: var(--humus); }

.lstats { display: flex; gap: 10px; flex-wrap: wrap; }
.lstat { background: rgba(0, 0, 0, .22); border-radius: 9px; padding: 6px 12px; min-width: 118px; line-height: 1.2; }
.lstat b { display: block; font: bold 22px var(--font-serif); font-variant-numeric: tabular-nums; }
.lstat span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(253, 246, 227, .65); }
.lstat em { display: block; font-style: normal; font-size: 12px; color: rgba(253, 246, 227, .8); }

.lrec { display: flex; align-items: center; gap: 14px; flex: 1 1 420px; }
.lbtn.rec { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 13.5px; }
.lbtn.rec i { width: 11px; height: 11px; border-radius: 50%; background: #d9644a; }
.lbtn.rec.on { background: #d9644a; border-color: #d9644a; color: #fff; }
.lbtn.rec.on i { background: #fff; border-radius: 2px; }

/* The playhead, scored: each bar tinted by how much of it was right. */
.pbar.sc-good { background: rgba(156, 203, 126, .38); }
.pbar.sc-fair { background: rgba(231, 179, 106, .38); }
.pbar.sc-poor { background: rgba(217, 100, 74, .42); }
.ptrack.recording { box-shadow: inset 0 0 0 2px rgba(217, 100, 74, .85); }

/* ---------------------------------------------------------- narrower --- */
@media (max-width: 1100px) {
  .brand .name { display: none; }
  .tcheck { font-size: 12.5px; }
  .ttempo input[type=range] { width: 80px; }
}
@media (max-width: 860px) {
  .shellbar { gap: 10px; padding: 6px 10px; }
  .playhead { padding: 0 10px 8px; }
  .tabs button { padding: 0 10px; }
  .tnow { flex-basis: 140px; }
  .pnote { display: none; }
  .listen { padding: 8px 10px 10px; }
  .lmeter { width: 60px; }
  .lgate input { width: 64px; }
}
@media (max-width: 600px) {
  .brand { display: none; }
  .tabs button span { display: none; }
  .tabs button { padding: 0 12px; }
  .tabs button svg { width: 20px; height: 20px; }
  .ttempo input[type=range] { display: none; }
  .guide { grid-template-columns: 1fr; gap: 2px; }
  .guide dd { margin-bottom: 10px; }
  .tlisten span { display: none; }
  .tlisten { padding: 0 9px; }
  .tpill span { display: none; }
  .tpill { padding: 0 9px; }
  .tsource button { padding: 0 8px; font-size: 12px; }
  .lmodes button { padding: 5px 8px; }
  .lroll { flex-basis: 100%; }
  .tuner { flex-wrap: wrap; }
  .lstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
  .lstat { min-width: 0; padding: 5px 7px; }
  .lstat b { font-size: 16px; }
  .lstat span { font-size: 10px; letter-spacing: .03em; }
  .lstat em { display: none; }
}

/* ------------------------------------------------ the side tree --- */
/* Down the left of the Backing Track tab: every setting, in branches that open
   one at a time. Its three rooms (settings, sounds, samples) sit to the
   right of it. Narrow, it folds into a bar that drops the tree down. */
:root { --setnav-w: 244px; }
.setnav {
  position: absolute; top: 0; bottom: 0; left: 0; width: var(--setnav-w); z-index: 2;
  background: var(--subsoil); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; font-family: var(--font-sans);
}
.setnav[hidden] { display: none; }
.pane.setpane { left: var(--setnav-w); }
.sntoggle { display: none; }
.snlist { flex: 1 1 auto; overflow-y: auto; padding: 12px 8px 20px; }
.setnav ul { list-style: none; margin: 0; padding: 0; }
.setnav .sn0 > li + li { margin-top: 2px; }
.setnav .sn1, .setnav .sn2, .setnav .sn3 { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1.5px solid var(--rule); }
.setnav button[role="treeitem"] {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; border-radius: 8px; padding: 6px 10px;
  font: 600 13.5px var(--font-sans); color: var(--kiwi-brown); position: relative;
}
.setnav button[data-depth="0"] { font-size: 14.5px; padding: 8px 10px 8px 26px; }
.setnav button[data-depth="0"].snleaf { padding-left: 26px; }
.setnav .snnote { font: 500 11.5px var(--font-sans); color: var(--muted); }
.setnav button:hover { background: rgba(255, 255, 255, .55); }
.setnav button:focus-visible { outline: 2px solid var(--leaf-green); outline-offset: -2px; }
.setnav .snbranch::before {
  content: ""; position: absolute; left: 11px; top: 14px; width: 0; height: 0;
  border: 4.5px solid transparent; border-left: 6px solid currentColor; border-right: 0;
  transition: transform .15s ease; opacity: .7;
}
.setnav .snbranch:not([data-depth="0"]) { padding-left: 24px; }
.setnav .snbranch:not([data-depth="0"])::before { left: 10px; top: 12px; }
.setnav .snbranch[aria-expanded="true"]::before { transform: rotate(90deg); }
.setnav .snbranch.holds > .snname { color: var(--green-dark); }
.setnav .snleaf { font-weight: 500; color: var(--humus); }
.setnav .snleaf[aria-current="true"] { background: var(--kiwi-brown); color: var(--cream); font-weight: 600; }
.setnav .snleaf[aria-current="true"] .snnote { color: rgba(253, 246, 227, .75); }
.setnav .snleaf.dim { opacity: .55; }
/* A part the song on the stand plays. */
.setnav .snleaf.inuse::after {
  content: ""; position: absolute; right: 10px; top: 50%; margin-top: -3.5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--leaf-green);
}
.setnav .snleaf.inuse > .snname { padding-right: 14px; }

@media (max-width: 760px) {
  .setnav { bottom: auto; right: 0; width: auto; border-right: 0; border-bottom: 1px solid var(--rule); }
  .pane.setpane { left: 0; top: 44px; }
  .sntoggle {
    display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; width: 100%;
    border: 0; background: none; cursor: pointer; font: 600 14px var(--font-sans); color: var(--kiwi-brown);
  }
  .sntoggle svg { width: 18px; height: 18px; flex: none; }
  .sntoggle .snnow { font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sntoggle .snnow::before { content: "\203A"; margin-right: 8px; }
  .snlist {
    display: none; position: absolute; top: 44px; left: 0; right: 0; max-height: calc(100vh - 200px);
    background: var(--subsoil); border-bottom: 1px solid var(--rule); box-shadow: 0 10px 24px rgba(45, 35, 24, .22);
  }
  .setnav.open .snlist { display: block; }
}

/* Help: the side tree, and playing the mandolin. */
.tree-help { margin: 8px 0 0; padding-left: 18px; }
.tree-help li { margin: 0 0 5px; }
.hsec [tabindex="-1"] { outline: none; scroll-margin-top: 12px; }
.guide.mando { margin-bottom: 14px; }
.keys.fingers { margin: 4px 0 18px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.keys.fingers caption { caption-side: bottom; text-align: left; padding: 6px 2px 0; font-size: 12.5px; color: var(--muted); }
.keys.fingers th { text-align: left; font: 600 11.5px var(--font-sans); letter-spacing: .04em; color: var(--muted); background: var(--subsoil); padding: 6px 10px; }
.keys.fingers td { padding: 5px 10px; border-top: 1px solid var(--rule); color: var(--humus); font-weight: 400; }
.keys.fingers td:first-child { color: var(--kiwi-brown); font-weight: 600; white-space: nowrap; }
.keys.fingers small { color: var(--muted); }
@media (max-width: 600px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .guide dd { margin-bottom: 10px; }
  .keys.fingers { display: block; overflow-x: auto; }
}
.mandolin .keyhead { margin: 18px 0 8px; font: bold 16px var(--font-serif); color: var(--kiwi-brown); }

/* Help on a narrow screen: the topics become a strip across the top. */
@media (max-width: 760px) {
  .helpwrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .helpnav {
    display: flex; align-items: center; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 8px 12px;
    border-right: 0; border-bottom: 1px solid var(--rule); scrollbar-width: thin;
  }
  .hnhead, .hngroup { display: none; }
  .hnlist { display: flex; gap: 4px; }
  .hnitem { white-space: nowrap; padding: 6px 11px; border-radius: 999px; font-size: 13.5px; }
  .hsec { padding: 18px 16px 30px; }
  .hsec h2 { font-size: 22px; }
  .diagram { padding: 10px; }
}
