/* Part 2: the lesson screen: lesson list (drawer), transport, sheet music, falling notes, feedback strip, practice settings + mixer, songs, rhythm bar, results, loop summary, focus mode, Kit page, import.
   Loaded in order by index.html; a later file wins over an earlier one. */
.kit-pick { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.kit-pick select { max-width: 170px; min-height: 34px; }
#calibrateBtn { min-height: 34px; font-size: 13px; }
.status { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; font-weight: 600; white-space: nowrap; }
.layout { flex: 1; display: block; min-height: 0; }
.sidebar {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.sidebar section { margin-bottom: 18px; }
.sidebar h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.sidebar details { margin-bottom: 12px; }
.sidebar summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.tempo { display: grid; gap: 6px; margin: 6px 0 10px; }
.tempo-head { display: flex; justify-content: space-between; align-items: baseline; }
.tempo-head output { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tempo-row { display: flex; align-items: center; gap: 8px; }
.tempo-row input[type=range] { flex: 1; min-width: 0; }
.tempo-row .step { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
.tempo-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mapping { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.mapping td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.mapping .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.mapping kbd { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.mapping button.learning { border-color: var(--good); color: var(--good); }
.kit-help { margin: 8px 0; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--panel-2); font-size: 13px; }
.kit-help > summary { cursor: pointer; display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--muted); }
.kit-help[open] > summary { border-bottom: 1px solid var(--line); }
.kit-help ol { margin: 0; padding: 8px 12px 8px 30px; line-height: 1.5; }
.monitor { list-style: none; padding: 0; margin: 0; font: 12px ui-monospace, monospace; color: var(--muted); }
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 12px 24px 8px; gap: 10px; }
.stage-head { display: flex; justify-content: flex-start; align-items: center; gap: 12px; flex-wrap: nowrap; }
.lesson-title { font-size: 20px; font-weight: 700; }
#highway { display: block; width: 100%; height: 100%; }
.feedback {
  position: absolute;
  left: 0;
  right: 0;
  top: 30%;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  pointer-events: none;
  text-shadow: 0 2px 12px #000;
  opacity: 0;
  transition: opacity 0.4s;
}
.feedback.show { opacity: 1; transition: none; }
.grade { font-size: 84px; font-weight: 900; width: 120px; text-align: center; color: var(--perfect); }
.timing-note { background: var(--panel-2); border-radius: var(--r-ctl); padding: 10px 12px; }
.timing-chart { width: 100%; height: 160px; background: var(--stage); border-radius: var(--r-ctl); display: block; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lanes-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lanes-table th, .lanes-table td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.lanes-table th:first-child, .lanes-table td:first-child { text-align: left; }
.leaderboard { margin: 0; padding-left: 22px; }
.leaderboard li { padding: 3px 0; }
.leaderboard li.me { color: var(--good); font-weight: 700; }
.cal-beats { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.cal-beats span { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); }
.cal-beats span.on { background: var(--good); }
.cal-beats span.hit { border-color: var(--perfect); box-shadow: 0 0 0 2px var(--perfect); }

/* view toggle */
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.view-toggle button { border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.view-toggle button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }

/* sheet music */
.notation {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
}
.notation[hidden] { display: none; }
.notation-svg { position: relative; margin: 0 auto; max-width: 100%; user-select: none; -webkit-user-select: none; }
.notation-svg svg { display: block; }
.playhead {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
  pointer-events: none;
  will-change: transform;
}
.notation .j-perfect, .notation .j-perfect path { fill: var(--perfect-ink); stroke: var(--perfect-ink); }
.notation .j-good, .notation .j-good path { fill: var(--good-ink); stroke: var(--good-ink); }
.notation .j-miss, .notation .j-miss path { fill: var(--miss); stroke: var(--miss); }
.sheet-view .feedback { top: auto; bottom: 34px; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; }
  .res-grid { grid-template-columns: 1fr; }
}
.status i { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; color: #0f1218; }
.leaderboard.big li { padding: 4px 0; }
.cal-head { font-size: 10px; color: var(--muted); text-align: center; }
.cal-legend { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.cal-legend .cal-cell { width: 12px; height: 12px; }
.campaign-result { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.campaign-result li { padding: 8px 10px; border-radius: var(--r-ctl); background: var(--panel-2); }
.score-head { position: relative; text-align: center; margin: 2px 0 6px; }
.score-title { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; color: var(--ink); }
.score-tempo { position: absolute; left: 16px; top: 6px; font-size: 13px; color: var(--ink); }
.score-tempo .tempo-note { font-size: 20px; line-height: 1; vertical-align: -2px; margin-right: 1px; }

/* play-along track */
.track-file { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 13px; }
.track-label { width: 68px; flex: none; }
.track-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offset-row { font-size: 13px; gap: 5px; flex-wrap: nowrap; }
.offset-row .step { width: 26px; height: 26px; padding: 0; font-size: 16px; line-height: 1; }
.offset-row input { width: 58px; }
.import-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-ctl); color: var(--muted); font-size: 14px; }
.import-drop.over { border-color: var(--accent); color: var(--text); }
.import-empty { margin: 10px 0; }
.import-table-wrap { overflow-x: auto; margin-top: 10px; }
.import-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.import-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.import-table td.file { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-table select, .import-table input[type=text] { width: 100%; min-width: 110px; font-size: 13px; }
.import-table .row-note { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: normal; }
.import-table .row-note.warn { color: var(--good); }
.import-table .row-note.ok { color: var(--perfect); }
.import-table .row-note.bad { color: var(--miss); }
.bar1-edit { margin: 6px 0; }
.bar1-edit canvas { display: block; width: 100%; border-radius: var(--r-ctl); background: var(--stage); border: 1px solid var(--line); touch-action: none; cursor: ew-resize; margin-top: 6px; }
.bar1-overview { height: 34px; }
.bar1-zoom { height: 70px; }
#bar1Check { margin-left: auto; }
.offset-row span, #bar1Check { white-space: nowrap; }

/* practise part of a lesson (#19) */
.section-box { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 6px 8px; margin: 8px 0; }
.section-row { flex-wrap: nowrap; gap: 6px; font-size: 13px; }
.section-row input { width: 52px; }
.section-box .hint { font-size: 11px; }
.notation-svg .bar-hit { cursor: pointer; }
.sel-bar { position: absolute; background: rgba(77, 140, 255, 0.10); border: 1px solid rgba(77, 140, 255, 0.45); border-radius: 4px; pointer-events: none; }
.res-section { font-weight: 600; margin: 4px 0 0; }

/* transport: above the sheet music */
.transport { display: flex; align-items: flex-end; gap: 12px; flex-wrap: nowrap; margin: 4px 0 2px; }
.transport button { padding: 8px 14px; min-height: 40px; }
.transport .primary { padding: 8px 18px; font-weight: 700; }
.transport .live { margin-left: auto; align-self: center; }
.sel-bar.looping { background: rgba(245, 197, 66, 0.16); border-color: rgba(245, 197, 66, 0.8); }
.loop-pill {
  position: absolute;
  z-index: 2;
  font: 600 12px system-ui, sans-serif;
  height: 22px;
  min-width: 22px;
  padding: 0 5px;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d9a400;
  color: #8a6a00;
  background: #fff6d6;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.loop-pill .ico { font-size: 15px; line-height: 1; }
.loop-pill .txt { display: none; }
.loop-pill:hover, .loop-pill:focus-visible { padding: 0 8px; }
.loop-pill:hover .txt, .loop-pill:focus-visible .txt { display: inline; }
.loop-pill.on { background: #f5c542; color: #3b2c00; border-color: #c99a00; }
.loop-pill:hover:not(:disabled) { background: #ffefb8; border-color: #c99a00; color: #6b5200; }

/* not the dark button hover */
.loop-pill.on:hover:not(:disabled) { background: #f7cf5c; color: #3b2c00; }

/* loop practice summary */
.pr-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 6px 0 18px; border-bottom: 1px solid var(--line); margin: 6px 0 10px; overflow-x: auto; }
.pr-bar { position: relative; flex: 1 0 10px; max-width: 28px; border-radius: 3px 3px 0 0; background: var(--good); min-height: 2px; }
.pr-bar.hi { background: var(--perfect); }
.pr-bar.lo { background: var(--miss); }
.pr-bar.best { outline: 2px solid var(--text); outline-offset: 1px; }
.pr-bar span { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.pr-tips { margin: 8px 0; padding-left: 18px; line-height: 1.5; font-size: 15px; }
.pr-tips li { margin: 3px 0; }
.transport.looping .live { visibility: hidden; }

/* lesson menu: folders that open and close (#4) */
.lesson-tools { display: flex; gap: 6px; margin-bottom: 6px; }
.lesson-tools input { flex: 1; min-width: 0; }
.lesson-tools select { width: 104px; }
.lesson-tree, .lesson-tree ul { list-style: none; margin: 0; padding: 0; }
.lesson-tree { max-height: 46vh; overflow-y: auto; margin-bottom: 8px; }
.lesson-tree .folder-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: var(--r-ctl);
  padding: 5px 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.lesson-tree .folder-head:hover { background: var(--panel-2); }
.lesson-tree .caret { width: 10px; color: var(--muted); }
.lesson-tree .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-tree .lesson-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--r-ctl);
  cursor: pointer;
  font-size: 13px;
  border: 1px solid transparent;
}
.lesson-tree .lesson-item:hover, .lesson-tree .lesson-item:focus-visible { background: var(--panel-2); outline: none; }
.lesson-tree .lesson-item.active { background: var(--panel-2); border-color: var(--accent); }
.lesson-tree .ltitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-tree .lvl { font-size: 11px; color: var(--muted); }
.lesson-tree .has-song { color: var(--good); font-size: 12px; }
.lesson-tree .unlocked { font-size: 11px; }
.lesson-tree .empty { padding: 6px; }
.track-file .no-manage { display: none; }
.import-target { margin: 8px 0; }
.import-target select { min-width: 220px; }

/* pages from the top menu (Progress, Campaigns, Library) open in the lesson area, like Home */
.stage > .dashboard { position: static; inset: auto; z-index: auto; flex: 1; min-height: 0; margin: -12px -16px; background: var(--bg); }
.stage > .dashboard[hidden] { display: none; }
.stage > .dashboard .dash-bar { background: transparent; border-bottom: 0; padding: 12px 16px 4px; }
.stage:has(> .dashboard:not([hidden])) > :not(.dashboard) { display: none !important; }

/* People and My account: pages in the lesson area too (they keep their ids and Close buttons) */
.stage > .page-modal {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: none;
  padding: 0;
}
.stage > .page-modal.hidden { display: none; }
.stage:has(> .page-modal:not(.hidden)) > :not(.page-modal) { display: none !important; }

/* one page header everywhere: title on the left, its button at the far right, no rule under it */

/* tempo you can type */
.tempo-type { display: inline-flex; align-items: baseline; gap: 6px; font-size: 20px; font-weight: 700; }
.tempo-type input { width: 76px; min-height: 34px; font-size: 20px; font-weight: 700; text-align: right; padding: 0 6px; }

/* timing meter (#20): early – perfect – late */
.meter { margin: 10px 0 4px; }
.meter-bar { position: relative; height: 26px; border-radius: var(--r-ctl); background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.meter-zone { position: absolute; top: 0; bottom: 0; }
.meter-zone.good { background: color-mix(in srgb, var(--good) 22%, transparent); }
.meter-zone.perfect { background: color-mix(in srgb, var(--perfect) 30%, transparent); }
.meter-centre { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--perfect); }
.meter-marks { position: absolute; inset: 0; }
.meter-mark { position: absolute; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.meter-mark.perfect { background: var(--perfect); }
.meter-mark.good { background: var(--good); }
.meter-mark.miss { background: var(--miss); }
.meter-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 3px; }
.live-meter { position: absolute; left: 50%; bottom: 10px; width: min(360px, 60%); transform: translateX(-50%); pointer-events: none; opacity: 0.9; }
.live-meter .meter { margin: 0; }
.live-meter .meter-bar { height: 14px; }
.focus-btn { position: absolute; top: 8px; right: 10px; z-index: 3; opacity: 0.8; }
.focus-btn:hover { opacity: 1; }
.focus-bar { display: none; }
body.focus-mode .topbar, body.focus-mode .sidebar, body.focus-mode .transport, body.focus-mode .stage-head, body.focus-mode #focusBtn, body.focus-mode #playHint, body.focus-mode #loopInfo { display: none !important; }
body.focus-mode .layout { height: calc(100vh - 92px); }
body.focus-mode .stage { padding: 8px 16px 0; }
body.focus-mode .canvas-wrap { flex: 1; min-height: 0; }
body.focus-mode #notation { height: 100%; overflow-y: auto; }
body.focus-mode .focus-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--panel); border-top: 1px solid var(--line); padding: 0 16px 10px; }
.fm-progress { position: relative; height: 22px; cursor: pointer; }
.fm-progress::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--panel-2); }
.fm-fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--accent); width: 0; }
.fm-markers { position: absolute; inset: 0; pointer-events: none; }
.fm-marker { position: absolute; top: -14px; transform: translateX(-2px); pointer-events: auto; min-height: 0; padding: 1px 6px; font-size: 11px; border-radius: 4px; background: var(--panel-2); white-space: nowrap; }
.fm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-title { font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-play { min-width: 52px; font-size: 18px; }
.fm-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 92px; }
.fm-tempo { display: inline-flex; align-items: center; gap: 6px; }
.fm-tempo button { min-width: 30px; padding: 0; }
.fm-toggle.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); }
.fm-mixer { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 10px; }
.fm-mixer label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.kit-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--perfect); }
.kit-pill .dot.off { background: #6B7590; }
.kit-list { left: auto; right: 0; min-width: 300px; padding: 12px; gap: 10px; }
.kit-list .kit-pick { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.kit-list .kit-pick select { max-width: none; width: 100%; font-size: 14px; }
.kit-list #midiStatus { justify-self: start; }
.kit-list #calibrateBtn { justify-content: center; }
.kit-list .hint { margin: 0; font-size: 12.5px; }

/* ---------- lesson screen (#39): drawer, settings panel, transport row, feedback strip ---------- */
.sidebar.drawer, .settings-panel {
  position: fixed;
  top: 56px;
  bottom: 0;
  z-index: 45;
  width: 340px;
  max-width: 92vw;
  overflow-y: auto;
  background: var(--panel);
  padding: 16px 18px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease-out;
  visibility: hidden;
}
.sidebar.drawer { left: 0; border-right: 1px solid var(--line); transform: translateX(-102%); }
.settings-panel { right: 0; width: 380px; border-left: 1px solid var(--line); transform: translateX(102%); overflow-x: hidden; }
body.drawer-open .sidebar.drawer, body.settings-open .settings-panel { transform: none; visibility: visible; }
.drawer-shade { position: fixed; inset: 56px 0 0 0; z-index: 44; background: rgba(5, 8, 15, 0.5); display: none; }
body.drawer-open .drawer-shade, body.settings-open .drawer-shade { display: block; }
@media (prefers-reduced-motion: reduce) { .sidebar.drawer, .settings-panel { transition: none; } }
.drawer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.drawer-head h3 { font-size: 17px; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); }
.drawer-head .hint { font-size: 12px; }
.drawer-head button { margin-left: auto; }
.settings-panel section { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.settings-panel h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.settings-panel .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.settings-panel .section-box { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.settings-panel summary { cursor: pointer; color: var(--muted); }
.settings-panel .mapping { width: 100%; }
.stage-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; margin-right: auto; }
.stage-title .lesson-title { font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-title .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-title .loop-hint { white-space: normal; overflow: visible; }
.fm-hint { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 12px 0; }

/* transport: one row, the play button is the one colour */
.transport .play-big { min-height: 48px; padding: 0 18px; font-size: 15px; border-radius: 999px; }
.transport .tempo { margin: 0; gap: 6px; display: flex; align-items: center; }
.transport .tempo-head label, .transport .tempo-foot #bpmInfo, .transport #tempo { display: none; }
.transport .tempo-head { order: 2; }
.transport .tempo-row { display: contents; }
.transport .tempo-row #tempoDown { order: 1; }
.transport .tempo-row #tempoUp { order: 3; }
.transport .tempo-foot { order: 4; }
.transport .tempo-type { font-size: 0; }
.transport .tempo-type input { width: 70px; font-size: 24px; min-height: 40px; text-align: center; }
.transport .section-row { display: flex; align-items: center; gap: 6px; }
.transport .section-row input { width: 56px; min-height: 40px; text-align: center; }
.transport .tr-group .check { min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.transport .tr-group .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.transport .tr-group label.row { display: block; }
.transport #backingTrack { min-height: 40px; }
.transport .live b { font-size: 24px; font-variant-numeric: tabular-nums; }
.transport .loop-info { align-self: center; }

/* feedback strip under the music: the last hit, the meter, the counts (never over the notes) */
.feedback-strip { display: grid; grid-template-columns: 260px 1fr 320px; gap: 24px; align-items: center; min-height: 52px; padding: 6px 4px 0; border-top: 1px solid var(--line); }
.feedback-strip .feedback, .sheet-view .feedback-strip .feedback { position: static; inset: auto; text-align: left; font-size: 24px; font-weight: 700; text-shadow: none; opacity: 0.5; transition: opacity 0.6s; pointer-events: none; }
.feedback-strip .feedback.show { opacity: 1; transition: none; }
.feedback-strip .feedback small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.feedback-strip .live-meter { position: static; transform: none; width: auto; opacity: 1; }
.feedback-strip .live-meter[hidden] { display: block !important; visibility: hidden; }
.live-counts { display: flex; justify-content: flex-end; gap: 16px; font-variant-numeric: tabular-nums; color: var(--text); }
.live-counts i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.layout > .stage { height: 100%; }
@media (max-width: 1100px) { .transport { flex-wrap: wrap; } .feedback-strip { grid-template-columns: 1fr; } }
body.focus-mode .feedback-strip { display: none; }
.transport button:not(.play-big):not(.step) { padding: 0 12px; }
.transport .tempo-foot .link { font-size: 11px; }
.transport .section-row #secAll { font-size: 11px; }
.feedback-strip .meter-bar { height: 16px; }
.feedback-strip .meter-mark { top: 1px; bottom: 1px; width: 4px; margin-left: -2px; }
.feedback-strip .meter-labels { display: none; }
.transport .live .hint { white-space: nowrap; }
.cal70 { display: flex; gap: 4px; }
.cal70 .cal-days { display: grid; gap: 4px; font-size: 11px; color: var(--muted); margin-right: 4px; }
.cal70 .cal-days span { height: 16px; line-height: 16px; }
.cal70 .cal-col { display: grid; gap: 4px; }
.cal70 i { width: 16px; height: 16px; border-radius: 3px; background: var(--panel-2); }
.cal70 i.l1 { background: rgba(224, 168, 75, 0.35); }
.cal70 i.l2 { background: rgba(224, 168, 75, 0.65); }
.cal70 i.l3 { background: var(--accent); }
.cal70 i.future { background: transparent; border: 1px dashed var(--line); }

/* Kit page (#35) */
.kit-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.kit-page section { display: grid; gap: 12px; align-content: start; }
.kit-page .rule-head { margin-top: 0; }
.kit-page .rule-head + * { margin-top: 0; }
.kit-pads .rule-head:not(:first-child) { margin-top: 18px; }
.cal-live { min-height: 22px; margin: 0; font-weight: 600; color: var(--muted); }
.cal-live.ok, .timing-note.ok { color: var(--perfect); }
.cal-live.bad, .timing-note.bad { color: var(--miss); }
.cal-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cal-manual { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.cal-manual input { width: 76px; }
.kit-page .monitor { max-height: 220px; overflow-y: auto; }
.kit-page .mapping { width: 100%; }
@media (max-width: 1000px) { .kit-page { grid-template-columns: 1fr; } }
.kit-cal #calResult:empty { display: none; }
.kit-page .monitor:empty::before { content: 'Hit a pad: each hit shows here (pad, note, how hard).'; color: var(--muted); font-size: 13px; }
.kit-pads #resetMapping { justify-self: start; width: auto; }

/* ---------- results (#39) ---------- */
.results-card { max-width: 900px; }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.res-kicker { margin: 0 0 6px; color: var(--muted); }
.res-big { display: flex; align-items: center; gap: 18px; }
.res-big .grade { font-size: 72px; line-height: 1; width: auto; }
.res-acc { display: block; font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-sub { color: var(--muted); font-variant-numeric: tabular-nums; }
.res-actions { display: flex; gap: 8px; align-items: center; }
.res-actions .icon-btn { width: 36px; padding: 0; }
.res-counts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 8px; font-size: 17px; }
.res-count { display: inline-flex; align-items: baseline; gap: 6px; }
.res-count .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; align-self: center; }
.dot.perfect { background: var(--perfect); }
.dot.good { background: var(--good); }
.dot.miss { background: var(--miss); }
.dot.extra { background: var(--extra); }
.res-timing { font-size: 16px; margin: 6px 0 14px; }
.results-card .res-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
.results-card .timing-chart { height: 150px; }
.res-board { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.res-board summary { cursor: pointer; font-weight: 600; }
@media (max-width: 760px) { .results-card .res-grid { grid-template-columns: 1fr; } .res-big .grade { font-size: 56px; } }

/* loop summary (#39) */
.loop-card { max-width: 680px; }
.pr-head { margin: 4px 0 8px; font-size: 26px; }
.pr-bars.few { height: 150px; gap: 10px; padding: 22px 0 22px; overflow: visible; }
.pr-bars.few .pr-bar { max-width: none; flex: 1 1 0; border-radius: 4px 4px 0 0; }
.pr-bar em { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-bars.few .pr-bar span { font-size: 12px; bottom: -19px; white-space: nowrap; }

/* mixer in Practice settings (#42); the panel never scrolls sideways */
.settings-panel section, .settings-panel .row, .settings-panel label { min-width: 0; }
.settings-panel canvas { max-width: 100%; }
.settings-panel .offset-row, .settings-panel .track-file { flex-wrap: wrap; }
.settings-panel select { max-width: 100%; }
.mix-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 46px; align-items: center; gap: 10px; margin: 6px 0; }
.mix-row input { width: 100%; }
.mix-row output { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; font-size: 13px; }
.mix-row.off span, .mix-row.off output { opacity: 0.5; }
.mix-row input, .fm-mixer input { accent-color: var(--accent); }

/* rhythm reading on the lesson screen (#45) */
.rhythm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; margin: 0 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); }
.rhythm-bar[hidden] { display: none; }
.rhythm-bar label, .rhythm-bar .rb-group { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rhythm-bar .rb-group[hidden] { display: none; }
.rhythm-bar select { padding: 5px 8px; }
.rb-title { font-size: 15px; margin-right: 4px; }
.rhythm-bar button[hidden] { display: none; }
.rhythm-bar #rtStreak.notice { font-size: 15px; font-weight: 700; color: var(--accent); }
.rhythm-bar select#rtSound { max-width: 200px; }
.rhythm-bar select#rtPreset { max-width: 240px; }

/* bar-range message (#105) */
#secMsg { margin: 2px 0 0; font-size: 12px; white-space: normal; max-width: 220px; }

/* first-time help (#106) */
.play-hint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; font-size: 13px; }
.play-hint button { min-height: 32px; padding: 0 12px; }
@media (max-width: 700px) { .play-hint button { min-height: 44px; } }
#resLegend { margin: 4px 0 8px; }
