    /* ============================================================
       LEARN — recommended next + active path, the six learning paths,
       path detail (Path → Unit → Lesson), and the lesson player.
       Uses the Learn accent (blue/violet) via [data-pillar="learn"].
       ============================================================ */
    .learn-crumb { color: var(--accent-2, var(--violet)); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.01em; }
    .learn-why { color: var(--muted); font-size: 0.84rem; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; line-height: 1.4; }
    .learn-why svg { width: 14px; height: 14px; color: var(--accent-2, var(--violet)); flex: 0 0 auto; }

    .learn-active-path { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 13px; align-items: center; width: 100%; text-align: left; padding: 13px 15px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); cursor: pointer; transition: border-color var(--motion-ui) var(--ease-ui), transform var(--motion-ui) var(--ease-ui); }
    .learn-active-path:hover { border-color: var(--accent, var(--blue)); transform: translateY(-1px); }
    .lap-ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft, rgba(86,104,138,0.12)); color: var(--accent-2, var(--violet)); }
    .lap-ico svg { width: 20px; height: 20px; }
    .lap-copy { display: grid; gap: 1px; min-width: 0; }
    .lap-kicker { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 820; }
    .lap-copy strong { color: var(--ink); font-size: 1rem; }
    .lap-detail { color: var(--soft); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lap-prog { display: grid; gap: 4px; justify-items: end; min-width: 100px; }
    .lap-prog .pbar { width: 100px; flex: none; }
    .lap-prog small { color: var(--muted); font-size: 0.74rem; font-weight: 800; }
    .learn-instrument-context { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--soft); font-size: 0.88rem; line-height: 1.45; margin: 0 0 14px; }
    .learn-instrument-context svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent-2, var(--violet)); margin-top: 2px; }
    .learn-assess-save-note { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--soft); line-height: 1.45; }
    .learn-assess-save-note strong { color: var(--ink); }
    .learn-assess-save-note .ghost-button { justify-self: start; margin-top: 2px; }

    .progress-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 4px 0 18px; }
    .progress-pill { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .progress-pill span { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 820; }
    .progress-pill strong { display: block; font-size: 1.3rem; margin-top: 2px; color: var(--ink); }
    body[data-theme="dark"] .progress-pill { background: var(--panel-strong); }

    .path-card-foot { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; flex-wrap: wrap; }
    .pbar { flex: 1 1 92px; min-width: 72px; height: 6px; border-radius: 999px; background: rgba(43,33,20,0.09); overflow: hidden; }
    .pbar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent, var(--teal)); }
    body[data-theme="dark"] .pbar { background: rgba(255,255,255,0.1); }
    .path-card-foot small { color: var(--muted); font-size: 0.74rem; font-weight: 750; min-width: 0; overflow-wrap: anywhere; }

    .lesson-back { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--soft); font-weight: 830; font-size: 0.95rem; cursor: pointer; padding: 6px 2px; margin-bottom: 8px; }
    .lesson-back:hover { color: var(--ink); }
    .lesson-back svg { width: 16px; height: 16px; }
    /* Units inside a path */
    .learn-unit { margin-top: 16px; padding: 14px 15px 6px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, var(--bg-soft), transparent 60%); }
    .learn-unit.is-locked { opacity: 0.86; }
    .learn-unit.is-completed { border-color: rgba(176,112,31,0.32); }
    .unit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
    .unit-head-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 240px; }
    .unit-badge { color: var(--accent-2, var(--violet)); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 850; }
    .unit-head-main strong { color: var(--ink); font-size: 1.05rem; letter-spacing: -0.01em; }
    .unit-objective { color: var(--soft); font-size: 0.86rem; line-height: 1.4; }
    .unit-head-meta { display: grid; justify-items: end; gap: 5px; min-width: 120px; }
    .unit-head-meta .pbar { width: 120px; flex: none; }
    .unit-head-meta small { color: var(--muted); font-size: 0.74rem; font-weight: 800; }
    .unit-state-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 850; border: 1px solid var(--line); color: var(--soft); background: var(--panel-strong); }
    .unit-state-chip svg { width: 14px; height: 14px; }
    .unit-state-chip.is-completed { color: var(--teal-deep); border-color: rgba(176,112,31,0.3); background: rgba(176,112,31,0.08); }
    .unit-state-chip.is-active { color: var(--accent-2, var(--violet)); border-color: var(--accent, var(--blue)); background: var(--accent-soft, rgba(86,104,138,0.1)); }
    .unit-state-chip.is-locked { color: var(--muted); }
    .unit-lessons { display: grid; gap: 0; }
    /* Premium upsell on the first locked unit */
    .learn-unit.is-premium { border-color: rgba(217,169,40,0.36); background: linear-gradient(180deg, rgba(217,169,40,0.08), transparent 60%); }
    .unit-premium { display: grid; gap: 9px; margin: 4px 0 12px; padding: 12px 13px; border: 1px solid rgba(217,169,40,0.4); border-radius: 12px; background: var(--panel); }
    .unit-premium p { margin: 0; color: var(--soft); font-size: 0.9rem; line-height: 1.45; }
    .unit-premium p strong { color: var(--ink); }
    .unit-premium .primary-button { justify-self: start; }
    body[data-theme="dark"] .unit-premium { background: var(--panel-strong); }
    .lesson-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); cursor: pointer; margin-bottom: 8px; transition: border-color 0.16s ease, transform 0.16s ease; }
    .lesson-row:hover { border-color: var(--accent, var(--blue)); transform: translateX(2px); }
    .lesson-row[aria-disabled="true"] { cursor: default; opacity: 0.6; }
    .lesson-row[aria-disabled="true"]:hover { border-color: var(--line); transform: none; }
    .lesson-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.6px solid var(--line); color: transparent; }
    .lesson-check svg { width: 14px; height: 14px; }
    .lesson-row.is-done .lesson-check { background: var(--teal); border-color: var(--teal); color: #fff; }
    .lesson-row .lesson-name { display: block; font-weight: 750; color: var(--ink); line-height: 1.28; }
    .lesson-row .lesson-meta { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 6px; line-height: 1.38; }
    .lesson-row .lesson-go { color: var(--accent-2, var(--violet)); font-weight: 800; font-size: 0.82rem; white-space: nowrap; }
    body[data-theme="dark"] .lesson-row { background: var(--panel-strong); }

    .lesson-player { max-width: 720px; margin: 0 auto; }
    .lesson-stepper { display: flex; gap: 5px; margin-bottom: 16px; }
    .lesson-stepper i { flex: 1 1 0; height: 5px; border-radius: 999px; background: rgba(43,33,20,0.1); }
    .lesson-stepper i.is-done { background: var(--accent, var(--blue)); }
    .lesson-stepper i.is-current { background: var(--accent-2, var(--violet)); }
    body[data-theme="dark"] .lesson-stepper i { background: rgba(255,255,255,0.12); }
    .lesson-step { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); padding: 22px; display: grid; gap: 14px; }
    .lesson-step-kind { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-2, var(--violet)); font-weight: 850; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; }
    .lesson-step h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
    .lesson-step p { color: var(--soft); line-height: 1.55; }
    .lesson-step p + p { margin-top: -4px; }
    .lesson-step strong { color: var(--ink); font-weight: 800; }
    /* THE KEY LINE (owner 2026-07-15), writer-authored {pull:"…"}. Must be p.lesson-pull (the rule
       above is (0,1,1) and wins otherwise). var() is RIGHT here — ground+ink flip together (inverse
       of the front door's always-dark overlay). Check which way the GROUND flips first. */
    .lesson-step p.lesson-pull { color: var(--ink); font-size: 1.2rem; font-weight: 800; line-height: 1.34; letter-spacing: -0.012em; border-left: 3px solid var(--gold); padding-left: 14px; }
    .lesson-step p.lesson-pull + p { margin-top: 0; }
    .lesson-play-btn { justify-self: start; display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 12px; background: var(--accent, var(--blue)); color: #fff; -webkit-text-fill-color: #fff; font-weight: 800; cursor: pointer; }
    /* Learn's --accent is pale blue in DARK: white on it hit 2.43:1. Ink = 6.51:1. Needs BOTH
       -webkit-text-fill-color and color or Safari keeps the white. */
    body[data-theme="dark"] .lesson-play-btn { color: #2b2114; -webkit-text-fill-color: #2b2114; }
    .lesson-play-btn:hover { filter: brightness(1.06); }
    .lesson-play-btn svg { width: 16px; height: 16px; }
    .lesson-visual { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); }
    /* The map: nesting shown by a left RAIL, not by indenting the label off the screen. The first
       version pushed "PROGRESSION" past the edge on a phone (owner's screenshot) and the connectors
       collided with the text. Rows wrap; the rail carries the depth. Tokens only, both themes. */
    .layer-stack { gap: 0; }
    .layer-stack .layer { position: relative; margin-left: calc(var(--depth) * 14px); padding: 8px 0 8px 12px; border-left: 2px solid var(--gold); }
    .layer-stack .layer:first-child { border-left-color: transparent; padding-left: 0; }
    .layer-stack .layer:last-of-type { border-left-color: transparent; }
    .layer-stack .layer:last-of-type::before { content: ""; position: absolute; left: 0; top: 0; bottom: 50%; border-left: 2px solid var(--gold); }
    .layer-stack .layer:not(:first-child)::after { content: ""; position: absolute; left: 0; top: 50%; width: 8px; border-top: 2px solid var(--gold); }
    .layer-head { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; }
    .layer-name { color: var(--teal-text); font-weight: 900; font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
    .layer-what { color: var(--soft); font-size: 0.86rem; line-height: 1.35; }
    .layer-eg { margin: 3px 0 0; color: var(--ink); font-weight: 800; font-size: 0.98rem; }
    .layer-eg em { color: var(--muted); font-weight: 650; font-size: 0.85rem; font-style: normal; }
    /* The scale is NOT a rung — it is where the notes come from. Detached on purpose. */
    .layer-palette { margin-top: 14px; padding: 11px 13px; border: 1px dashed rgba(176, 112, 31, 0.5); border-radius: 10px; background: rgba(176, 112, 31, 0.07); }
    .staff-labels { display: flex; justify-content: space-between; gap: 10px; color: var(--soft); font-size: 0.8rem; font-weight: 750; }
    /* The note grid — ONE primitive, reused by every "which notes does this use / what do these two
       share" diagram in Learn. --cols keeps it honest at 7 notes or 12; row head + notes still fits a
       375px card (art181 fixed the clipping this would otherwise reintroduce). */
    .ng-grid { display: grid; grid-template-columns: auto repeat(var(--cols, 7), 1fr); gap: 3px; align-items: center; }
    .ng-note { text-align: center; font-weight: 900; font-size: 0.74rem; color: var(--teal-text); }
    .ng-rowhead { padding-right: 7px; text-align: right; font-weight: 850; font-size: 0.82rem; color: var(--ink); }
    .ng-cell { height: 24px; border-radius: 5px; background: rgba(58, 45, 28, 0.07); }
    /* Literal brass, not var(--gold) — the same call art176 made for .mini-k … (git) */
    .ng-cell.is-on { display: grid; place-items: center; background: #e7c266; color: #2b2114; font-weight: 850; font-size: 0.72rem; }
    /* :not(.is-on) is load-bearing: (0,2,1) beats .ng-cell.is-on (0,2,0) — without it dark mode
       repaints the LIT cells dark. Tests were green; a screenshot caught it. */
    body[data-theme="dark"] .ng-cell:not(.is-on) { background: rgba(240, 232, 214, 0.09); }
    .rhythm-demo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .rhythm-beat { min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); display: grid; place-items: center; color: var(--soft); font-weight: 900; }
    .rhythm-beat.strong { background: rgba(176,112,31,0.14); color: var(--teal-deep); border-color: rgba(176,112,31,0.25); }
    .chord-stack-demo { display: grid; justify-items: center; gap: 7px; }
    .chord-stack-demo span { width: min(260px, 100%); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-strong); text-align: center; font-weight: 850; color: var(--ink); }
    .melody-contour-demo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; min-height: 90px; }
    .contour-dot { border-radius: 999px 999px 8px 8px; background: rgba(86,104,138,0.22); border: 1px solid rgba(86,104,138,0.32); min-height: calc(var(--h) * 1px); display: grid; place-items: end center; padding: 4px; color: var(--blue); font-size: 0.72rem; font-weight: 900; }
    /* Pitch-direction (ear) visual: two EQUAL pills with an arrow — "lower → higher". Replaced the old
       uneven Low/High cards that wrongly appeared on chord lessons and looked broken. */
    .pitch-dir-demo { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
    .pitch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-strong); color: var(--soft); font-weight: 850; }
    .pitch-pill.is-high { color: var(--teal-deep); border-color: var(--teal); background: var(--accent-soft, rgba(176,112,31,.1)); }
    .pitch-pill svg { width: 16px; height: 16px; }
    .pitch-arrow { color: var(--muted); font-weight: 900; font-size: 1.3rem; }
    /* Major vs minor "T-chart" (owner ask): one idea, two colours, side by side. */
    .majmin-chart { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .mm-col { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-strong); color: var(--soft); font-size: 0.82rem; }
    .mm-col strong { font-size: 0.95rem; color: var(--ink); }
    .mm-col .mm-ex { font-weight: 800; font-size: 0.78rem; }
    .mm-col.is-major { border-color: rgba(217,169,40,0.45); background: rgba(217,169,40,0.08); }
    .mm-col.is-major strong, .mm-col.is-major .mm-ex { color: var(--gold-deep, #9a7514); }
    .mm-col.is-minor { border-color: rgba(86,104,138,0.4); background: rgba(86,104,138,0.07); }
    .mm-col.is-minor strong, .mm-col.is-minor .mm-ex { color: var(--blue); }
    /* Octave-repeat visual: the same alphabet block tiling upward across the keyboard. */
    .octave-repeat-demo { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
    .oct-block { display: grid; justify-items: center; gap: 2px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-strong); color: var(--ink); font-weight: 900; }
    .oct-block small { color: var(--muted); font-weight: 700; font-size: 0.62rem; }
    .oct-block.is-low { transform: scale(0.86); opacity: 0.75; }
    .oct-block.is-high { transform: scale(1.12); border-color: var(--teal); color: var(--teal-deep); }
    .oct-arrow { color: var(--muted); font-weight: 900; }
    /* Per-page lead-out: the quiet "Next up: …" line that ties each page to the next. */
    .lesson-next-hint { display: block; margin: 10px 0 0; color: var(--muted); font-size: 0.8rem; font-weight: 750; }
    .lesson-keys-wrap { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); }
    .mini-fret { display: flex; justify-content: center; }
    .mini-fret svg { max-width: 100%; height: auto; }
    body[data-theme="dark"] .lesson-step, body[data-theme="dark"] .lesson-keys-wrap, body[data-theme="dark"] .lesson-visual { background: var(--panel-strong); }
    .lesson-note-tags { display: flex; flex-wrap: wrap; gap: 6px; }
    .note-tag { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.86rem; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--accent-soft, rgba(86,104,138,0.12)); color: var(--accent-2, var(--violet)); }
    .note-tag.is-hit { background: rgba(46,160,116,.16); color: #1e7a56; }
    .note-tag.is-miss { background: rgba(200,84,80,.14); color: #a44540; }
    .lesson-echo { margin-top: 10px; display: grid; gap: 8px; justify-items: start; }
    .quiz-q { font-weight: 800; color: var(--ink); font-size: 1.02rem; line-height: 1.4; margin: 2px 0 10px; }
    .account-wall, .lesson-lock { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 30px 22px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--panel-strong); max-width: 540px; margin: 16px auto; }
    .account-wall .aw-icon, .lesson-lock .aw-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft, rgba(176,112,31,0.14)); color: var(--accent-2, var(--teal-deep)); }
    .account-wall .aw-icon svg, .lesson-lock .aw-icon svg { width: 20px; height: 20px; }
    .account-wall h3, .lesson-lock h3 { margin: 0; font-size: 1.18rem; }
    .account-wall p, .lesson-lock p { margin: 0; color: var(--soft); line-height: 1.5; max-width: 420px; }
    .aw-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
    .aw-note { font-size: 0.82rem; color: var(--muted) !important; display: inline-flex; align-items: center; gap: 5px; }
    .aw-note svg { width: 14px; height: 14px; }
    .lesson-row.is-locked .lesson-check { background: var(--accent-soft, rgba(176,112,31,0.14)); color: var(--accent-2, var(--teal-deep)); }
    .lesson-row.is-locked .lesson-go { color: var(--accent-2, var(--teal-deep)); font-weight: 800; }
    .lesson-recap { text-align: left; width: 100%; max-width: 460px; margin: 6px auto 2px; padding: 14px 16px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); }
    .lesson-recap .recap-head { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-2, var(--teal-deep)); margin-bottom: 8px; }
    .lesson-recap .recap-head svg { width: 14px; height: 14px; }
    .lesson-recap ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
    .lesson-recap li { color: var(--soft); line-height: 1.45; font-size: 0.9rem; }
    .quiz-options { display: grid; gap: 8px; }
    .quiz-option { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel-strong); color: var(--ink); font-weight: 650; cursor: pointer; transition: border-color 0.14s ease; }
    .quiz-option:hover { border-color: var(--accent, var(--blue)); }
    .quiz-option.is-correct { border-color: var(--teal); background: rgba(176,112,31,0.08); }
    .quiz-option.is-wrong { border-color: var(--rose); background: rgba(216,109,100,0.08); }
    .quiz-option .opt-mark { margin-left: auto; font-weight: 900; }
    .quiz-option.is-correct .opt-mark { color: var(--teal); }
    .quiz-option.is-wrong .opt-mark { color: var(--rose); }
    .quiz-why { color: var(--soft); font-size: 0.9rem; line-height: 1.5; padding: 11px 13px; border-radius: 8px; background: var(--bg-soft); border-left: 3px solid var(--accent, var(--blue)); }
    body[data-theme="dark"] .quiz-option { background: var(--panel-strong); }
    body[data-theme="dark"] .quiz-why { background: rgba(255,255,255,0.04); }
    .reflect-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
    .reflect-list li { color: var(--soft); line-height: 1.5; padding-left: 20px; position: relative; }
    .reflect-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent, var(--blue)); }
    .lesson-nav { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
    .lesson-nav .ghost-button { min-width: 88px; }
    .lesson-nav .spacer { flex: 1 1 auto; }
    /* Lesson complete: ONE thing that looks like a button. It had three side by side (next lesson,
       the band, the path) and read as a mission-control board — so nothing read as the answer, which
       is "next lesson" ~95% of the time. Everything else is a quiet link. */
    .lesson-nav-quiet { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 14px; }
    .lesson-quiet-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-min); padding: 4px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.86rem; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
    .lesson-quiet-link:hover { color: var(--ink); text-decoration-color: currentColor; }
    .lesson-quiet-link svg { width: 14px; height: 14px; color: var(--teal-text); }
    .lesson-done { text-align: center; display: grid; gap: 12px; padding: 30px 22px; }
    .lesson-done .done-ring { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: var(--teal); color: #fff; }
    .lesson-done .done-ring svg { width: 30px; height: 30px; }
    .lesson-done h3 { font-size: 1.4rem; }
    .lesson-done p { color: var(--soft); max-width: 46ch; margin: 0 auto; line-height: 1.5; }
    .lesson-done .lesson-nav { justify-content: center; }
    .apply-card { display: grid; gap: 8px; padding: 16px; border-radius: 12px; border: 1px dashed var(--accent, var(--blue)); background: var(--accent-soft, rgba(86,104,138,0.08)); }
    .apply-card strong { color: var(--ink); }
    .apply-card small { color: var(--muted); line-height: 1.4; }
    .learn-next-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 22px; margin: 0 0 18px; padding: 22px; border: 1px solid var(--accent, var(--blue)); border-radius: 12px; background: var(--panel-strong); box-shadow: 0 12px 30px rgba(86,104,138,0.09); }
    .learn-next-copy { display: grid; gap: 7px; min-width: 0; }
    /* Eyebrow + breadcrumb share a row that wraps cleanly (they used to crowd on one line); a small
       dot separates them so the hierarchy reads: context → title → summary → why. */
    .learn-next-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
    .learn-next-head .learn-crumb { position: relative; padding-left: 13px; }
    .learn-next-head .learn-crumb::before { content: ""; position: absolute; left: 0; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--accent-2, var(--violet)); opacity: 0.6; }
    .learn-next-card h3 { margin: 1px 0 0; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.01em; }
    .learn-next-card p { color: var(--soft); line-height: 1.45; }
    .learn-next-summary { font-size: 0.95rem; }
    .learn-next-card.is-complete { border-color: var(--teal); }
    .learn-next-actions { display: grid; justify-items: end; align-content: center; gap: 10px; min-width: 180px; }
    .learn-spine-card { position: relative; margin: 0 0 22px; padding: 24px 24px 24px 28px; border: 1px solid var(--accent, var(--teal)); border-radius: 18px; background: linear-gradient(152deg, var(--accent-soft, rgba(176,112,31,0.12)), var(--panel-strong) 60%); box-shadow: var(--shadow); overflow: hidden; }
    .learn-spine-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: linear-gradient(var(--accent, var(--teal)), var(--accent-2, var(--violet))); }
    .learn-spine-copy { display: grid; gap: 12px; }
    .learn-spine-card[role="link"] { cursor: pointer; }
    .learn-spine-eyebrow-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .learn-spine-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-text, var(--teal-deep)); font-size: 0.74rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.05em; }
    .learn-spine-eyebrow svg { width: 14px; height: 14px; }
    .learn-spine-card h3 { margin: 0; font-size: 1.55rem; line-height: 1.12; letter-spacing: -0.015em; }
    .learn-spine-copy > p { margin: 0; color: var(--soft); line-height: 1.5; max-width: 60ch; }
    .learn-spine-scope { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; font-weight: 760; letter-spacing: 0.01em; }
    .learn-spine-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
    .learn-spine-steps li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-strong); color: var(--soft); font-size: 0.82rem; font-weight: 750; }
    .learn-spine-steps .spine-step-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-soft); color: var(--muted); font-size: 0.72rem; font-weight: 850; }
    .learn-spine-steps .spine-step-ico svg { width: 14px; height: 14px; }
    .learn-spine-steps li.is-active { border-color: var(--accent, var(--teal)); color: var(--ink); box-shadow: 0 0 0 2px var(--accent-soft, rgba(176,112,31,0.18)); }
    .learn-spine-steps li.is-active .spine-step-ico { background: var(--accent, var(--teal)); color: var(--panel-strong); }
    .learn-spine-steps li.is-done { color: var(--ink); }
    /* Genre mini-courses — "Explore by style" cards on the Learn overview. */
    .genre-courses { margin-top: 30px; }
    .genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
    .genre-card { display: flex; align-items: center; gap: 11px; text-align: left; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; transition: border-color var(--motion-ui) var(--ease-ui), transform var(--motion-ui) var(--ease-ui); }
    .genre-card:hover { border-color: var(--teal); transform: translateY(-2px); }
    /* Clean on-brand icon tile (replaced the off-brand emoji). */
    .genre-ico { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--accent-soft, rgba(176,112,31,0.12)); color: var(--teal-deep); }
    .genre-ico svg { width: 20px; height: 20px; }
    .genre-card-body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
    .genre-card-body strong { color: var(--ink); font-size: 0.98rem; }
    .genre-card-body small { color: var(--muted); font-size: 0.78rem; }
    .genre-card-go { color: var(--soft); flex: 0 0 auto; display: inline-flex; }
    .genre-card-go svg { width: 16px; height: 16px; }
    body[data-theme="dark"] .genre-card { background: var(--panel-strong); }
    .learn-spine-steps li.is-done .spine-step-ico { background: var(--teal); color: var(--panel-strong); }
    .learn-spine-foot { display: flex; align-items: center; gap: 12px; }
    .learn-spine-foot small { color: var(--muted); font-size: 0.78rem; font-weight: 750; white-space: nowrap; }
    .learn-spine-card .primary-button { justify-self: start; }
    .learn-spine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
    .learn-spine-actions .primary-button { justify-self: start; margin: 0; }
    .learn-spine-browse { margin: 0; }
    .learn-spine-browse-note { margin: -2px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
    .learn-spine-card.is-done { border-color: var(--teal); }
    .learn-guest-progress { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 16px 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
    .learn-guest-progress strong { display: block; color: var(--ink); margin-bottom: 3px; }
    .learn-guest-progress p { color: var(--soft); line-height: 1.45; font-size: 0.9rem; }
    .learn-area-card { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .learn-area-card h3 { font-size: 1rem; }
    .learn-area-card > p { color: var(--soft); line-height: 1.42; font-size: 0.88rem; min-height: 2.5em; }
    .learn-area-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .learn-area-head .pillar-card-ico { margin: 0; }
    .learn-area-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
    .learn-area-meta div { display: grid; gap: 2px; }
    .learn-area-meta dt { color: var(--muted); font-size: 0.68rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.06em; }
    .learn-area-meta dd { margin: 0; color: var(--ink); font-size: 0.78rem; font-weight: 700; line-height: 1.35; }
    .learn-area-card .ghost-button { justify-self: stretch; margin-top: auto; }
    .learn-area-card.is-completed { border-color: rgba(176,112,31,0.32); }
    .learn-area-card.is-progress { border-color: var(--accent, var(--blue)); }
    .path-head-tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    /* THE STATE PILL LIVES IN THE CARD'S CORNER on BOTH paths (owner 2026-07-15) — the same place
       Home puts "Done today". It used to sit inline beside the eyebrow / icon tile, which read as a
       different component on each card. Cards get right padding so a long title can't run under it. */
    .learn-spine-card, .learn-area-card { position: relative; }
    /* NB: on the spine the pill is nested .learn-spine-card > .learn-spine-copy > .learn-spine-eyebrow-row,
       so this must be a DESCENDANT selector — a child combinator silently matches nothing. */
    .learn-spine-card .learn-spine-eyebrow-row > .path-state,
    .learn-area-card > .learn-area-head > .path-head-tags { position: absolute; top: 14px; right: 14px; margin: 0; }
    .learn-spine-card .learn-spine-eyebrow-row, .learn-spine-card .learn-spine-copy > h3,
    .learn-area-card > h3, .learn-area-card > .learn-area-head { padding-right: 104px; }
    .path-state { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid var(--line); color: var(--muted); background: var(--bg-soft); }
    .path-state svg { width: 14px; height: 14px; }
    .path-state.is-completed { color: var(--teal-deep); border-color: rgba(176,112,31,0.3); background: rgba(176,112,31,0.08); }
    .path-state.is-progress { color: var(--accent-2, var(--violet)); border-color: var(--accent, var(--blue)); background: var(--accent-soft, rgba(86,104,138,0.1)); }
    .path-rec { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 850; color: #fff; background: #5b4bc4; }
    .path-rec svg { width: 14px; height: 14px; }
    .path-outcome { display: inline-flex; align-items: baseline; gap: 6px; color: var(--soft); font-size: 0.82rem; line-height: 1.38; min-height: 0 !important; }
    .path-outcome svg { width: 14px; height: 14px; color: var(--accent-2, var(--violet)); flex: 0 0 auto; position: relative; top: 2px; }
    /* THE SECOND PATH (owner 2026-07-14): Play By Ear is a SIDE path, not a peer of the 13-lesson
       spine. It had NO rule, so it rendered full-bleed at the spine's width and read as an equal
       choice. Indent + shrink says "subordinate" without a word of copy. */
    /* No indent (owner 2026-07-15): indenting a single item implies a hierarchy that isn't there —
   there is one side trail, not a tree. It lines up with the spine above it now. */
    .learn-second-path { margin: 0 0 22px; }
    .learn-second-path .home-section-head { margin-bottom: 10px; }
    .learn-second-path .learn-area-card { max-width: 560px; padding: 14px; }
    .learn-second-path .learn-area-card h3 { font-size: 0.94rem; }
    /* The chip only LOOKED corner-pinned: .learn-area-head is space-between, so the icon tile shoved
       it right. The spine packs icon+chip left together above the title — match that exactly. */
    .learn-second-path .learn-area-head { justify-content: flex-start; }
    .learn-second-path .path-head-tags { justify-content: flex-start; }
    /* The card now carries the spine's action pair, so the old stretch-to-fill single button
       (.learn-area-card .ghost-button) must not stretch them apart. */
    .learn-second-path .learn-spine-actions .ghost-button { justify-self: start; margin-top: 0; }
    .learn-full-library { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius-surface); background: var(--panel-strong); overflow: clip; }
    .learn-full-library > summary { min-height: 62px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--ink); cursor: pointer; }
    .learn-full-library > summary span { display: grid; gap: 2px; }
    .learn-full-library > summary small { color: var(--muted); font-weight: 500; }
    .learn-full-library > summary > span:last-child { display: inline-flex; grid-auto-flow: column; align-items: center; color: var(--muted); font-size: .8rem; font-weight: 800; white-space: nowrap; }
    .learn-full-library-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
    .learn-library-group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); margin-bottom: 8px; overflow: clip; }
    .learn-library-group summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 50px; padding: 11px 14px; cursor: pointer; color: var(--ink); }
    .learn-library-group summary span { display: inline-flex; align-items: center; gap: 8px; }
    .learn-library-group summary > span:last-child { color: var(--muted); font-size: 0.78rem; font-weight: 750; }
    .learn-library-rows { padding: 0 12px 8px; }
    .path-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
    .path-detail-meta span { padding: 5px 8px; border-radius: 8px; background: var(--bg-soft); color: var(--soft); font-size: 0.76rem; font-weight: 750; }
    .path-guest-note { margin: 10px 0; color: var(--muted) !important; font-size: 0.86rem; }
    .path-tool-card { margin-top: 18px; }
    .lesson-row.is-current { border-color: var(--accent, var(--blue)); box-shadow: 0 0 0 2px var(--accent-soft); }
    .lesson-player-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 10px; }
    .lesson-player-head > div { display: grid; gap: 2px; min-width: 0; }
    .lesson-player-head span { color: var(--muted); font-size: 0.76rem; font-weight: 750; }
    .lesson-player-head strong { color: var(--ink); overflow-wrap: anywhere; }
    .lesson-instrument-coach { display: grid; gap: 5px; padding: 13px 14px; border-left: 3px solid var(--accent-2, var(--violet)); border-radius: 8px; background: var(--bg-soft); }
    .lesson-instrument-coach p { margin: 0 !important; font-size: 0.9rem; }
    .lesson-shape { display: grid; gap: 9px; justify-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); overflow-x: auto; }
    .lesson-check-note { margin-top: 8px; color: var(--rose); font-size: 0.84rem; text-align: right; }
    .progress-pill strong small { color: var(--muted); font-size: 0.75em; }@media (max-width: 820px) { }@media (max-width: 560px) {
      .learn-spine-card { padding: 18px 18px 18px 21px; }
      .learn-spine-card h3 { font-size: 1.3rem; }
      .learn-next-card { grid-template-columns: 1fr; padding: 16px; }
      .learn-next-actions { justify-items: stretch; min-width: 0; }
      .learn-guest-progress { display: grid; }
      .learn-area-card > p { min-height: 0; }
      .lesson-player-head { align-items: start; }
      .lesson-row { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
      .lesson-row .lesson-go { grid-column: 2; white-space: normal; }
      .lesson-nav { flex-wrap: wrap; }
      .lesson-nav .primary-button, .lesson-nav .ghost-button { flex: 1 1 130px; }
    }

    /* ============================================================
       STUDIO — groove locks, tools, library, arrangement, recorder.
       ============================================================ */
    .lock-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
    .lock-row-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.78rem; font-weight: 800; }
    .lock-row-label svg { width: 14px; height: 14px; }
    .lock-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .lock-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-strong); color: var(--soft); font-weight: 750; font-size: 0.8rem; cursor: pointer; transition: border-color 0.14s, background-color 0.14s; }
    .lock-chip svg { width: 14px; height: 14px; }
    .lock-chip.is-locked { border-color: var(--teal); background: rgba(176,112,31,0.1); color: var(--teal-deep); }
    body[data-theme="dark"] .lock-chip { background: var(--panel-strong); }
    body[data-theme="dark"] .lock-chip.is-locked { color: #e7c266; }
    .chord-edit { cursor: pointer; transition: box-shadow 0.14s ease, transform 0.1s ease; }
    .chord-edit:hover { box-shadow: 0 0 0 2px var(--accent-soft, rgba(176,112,31,0.22)); }
    .chord-edit:active { transform: translateY(1px); }

    .tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
    .tool-panel { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); align-content: start; min-width: 0; }
    /* The pulse card borrows the Home markup — inside a tool panel it must dress like its
       siblings and WRAP, never spill past the card edge (owner 2026-07-12: Mac overflow). */
    .tool-pulse-host .home-pulse { margin: 0; min-width: 0; display: grid; gap: 12px; }
    .tool-pulse-host .home-section-head { gap: 8px; max-width: none; }
    .tool-pulse-host .home-section-head h3 { font-size: 1.05rem; letter-spacing: 0; }
    .tool-pulse-host .home-section-head > p:last-child { font-size: 0.84rem; line-height: 1.4; }
    .tool-pulse-host .home-pulse > div, .tool-pulse-host .home-pulse span { flex-wrap: wrap; }
    .tool-panel-head { display: flex; align-items: center; gap: 9px; }
    .tool-panel-head h3 { font-size: 1.05rem; }
    .tool-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft, rgba(176,112,31,0.12)); color: var(--accent-2, var(--teal-deep)); }
    .tool-ico svg { width: 16px; height: 16px; }
    .tool-bpm { font-size: 2rem; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
    .tool-bpm small { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
    .tool-slider { width: 100%; accent-color: var(--teal); }
    .tool-note { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
    .tool-row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
    .tool-row-btns .ghost-button { flex: 1 1 0; }
    .chordfind { display: grid; gap: 10px; }
    /* Tempo-trainer range steppers: settable start / max / step / bars, big tap targets for mobile. */
    /* Tempo-trainer is a query container: steppers stack 1-up when the card is narrow,
       2x2 only with real room — never overflows. */
    .tool-train { container-type: inline-size; }
    .train-fields { display: grid; grid-template-columns: 1fr; gap: 8px 10px; }@container (min-width: 250px) { .train-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    .train-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .train-field > span { color: var(--muted); font-size: 0.68rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
    .train-stepper { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
    .train-stepper .mini-button { width: 32px; min-height: 32px; flex: none; padding: 0; font-size: 1.2rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
    .train-stepper strong { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 0.98rem; }
    .train-stepper strong small { color: var(--muted); font-weight: 700; font-size: 0.64rem; margin-left: 2px; }
    body[data-theme="dark"] .tool-panel { background: var(--panel-strong); }

    .lib-head { font-size: 0.95rem; margin: 20px 0 8px; color: var(--soft); }
    .lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
    /* art237 (owner screenshot: buttons stamped over titles, giant cards): the merged library's
       cards STACK — title block up top wraps naturally, the action row wraps below it. */
    .mp-body .lib-card, .account-shell .lib-card { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px; }
    .mp-body .lib-card .lib-actions, .account-shell .lib-card .lib-actions { display: flex; flex-wrap: wrap; gap: 6px; }
    .mp-body .lib-card > div > strong, .account-shell .lib-card > div > strong { display: block; overflow-wrap: anywhere; }
    .mp-body .lib-card > div > span, .account-shell .lib-card > div > span { display: block; color: var(--muted); font-size: 0.85rem; }
    /* THE SHELF (design bible 2026-07-12): kept things are OBJECTS, not sheets. Every saved
       card carries a tinted spine (its room/style), a serif name, and — when loved — a gold
       folded corner. Same data, ten times the meaning. */
    .lib-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 12px 14px 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--shelf-tint, var(--line-strong)); border-radius: 12px; background: var(--panel-strong); box-shadow: var(--shadow-soft); transition: transform var(--motion-ui) var(--ease-ui), box-shadow var(--motion-ui) var(--ease-ui), border-color var(--motion-ui) var(--ease-ui); }
    .lib-card > div > strong { font-family: var(--font-display); font-size: 1.04rem; letter-spacing: 0.1px; }
    .lib-card.shelf-rock { --shelf-tint: var(--rose); }
    .lib-card.shelf-jazz { --shelf-tint: var(--blue); }
    .lib-card.shelf-soul { --shelf-tint: var(--gold); }
    .lib-card.shelf-lofi { --shelf-tint: var(--violet); }
    .lib-card.shelf-cinematic { --shelf-tint: var(--teal-deep); }
    .lib-card.shelf-arr { --shelf-tint: var(--teal); }
    .lib-card.shelf-take { --shelf-tint: #8a6425; }
    /* The save moment: the object settles onto the shelf. */
    .shelf-moment { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(14px) scale(.72); opacity: 0; z-index: 90; pointer-events: none; transition: transform .34s var(--ease-ui), opacity .26s ease; }
    .shelf-moment.is-shown { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    .shelf-moment .lib-card { box-shadow: var(--shadow); min-width: 220px; }
    .shelf-moment .lib-card span { color: var(--teal-text); font-weight: 750; font-size: .82rem; }
    @media (prefers-reduced-motion: reduce) { .shelf-moment { transition: opacity .2s ease; transform: translateX(-50%); } }
    .lib-card.is-loved::after { content: ""; position: absolute; top: 0; right: 0; border-top: 20px solid var(--gold); border-left: 20px solid transparent; }
    button.lib-card { cursor: pointer; }
    button.lib-card:hover, button.lib-card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-soft); border-color: var(--accent, var(--teal)); outline: none; }@media (prefers-reduced-motion: reduce) { .lib-card { transition: none; } button.lib-card:hover, button.lib-card:focus-visible { transform: none; } }
    .lib-card > div { min-width: 0; }
    .lib-card strong { display: block; color: var(--ink); font-size: 0.95rem; }
    .lib-card span { color: var(--muted); font-size: 0.8rem; }
    .lib-actions { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
    .lib-empty { display: grid; gap: 9px; justify-items: start; color: var(--muted); font-size: 0.88rem; padding: 10px 2px; }
    .lib-empty::before { content: ""; width: 156px; height: 44px; border: 1.5px dashed var(--line-strong); border-left: 4px solid var(--line-strong); border-radius: 12px; opacity: .55; }
    body[data-theme="dark"] .lib-card { background: var(--panel-strong); }

    /* Library cards with several actions (Studio): stack info above the action row so the meta text
       never collides with the buttons in the multi-column grid. */
    .lib-grid-stack .lib-card { flex-direction: column; align-items: stretch; gap: 10px; }
    .lib-grid-stack .lib-card > div:first-child { width: 100%; }
    .lib-grid-stack .lib-card .lib-actions { justify-content: flex-start; align-items: center; }
    /* ----- Setlists / folders for saved grooves ----- */
    .lib-sub { color: var(--muted); font-size: 0.85rem; margin: -2px 0 10px; line-height: 1.45; }
    .lib-folder-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
    .lib-chips { display: flex; gap: 7px; flex-wrap: wrap; min-width: 0; }
    .lib-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--soft); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: border-color var(--motion-ui) var(--ease-ui), background var(--motion-ui) var(--ease-ui), color var(--motion-ui) var(--ease-ui); }
    .lib-chip:hover { border-color: var(--teal); color: var(--ink); }
    .lib-chip.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
    .lib-chip-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: rgba(120,130,140,0.18); color: inherit; font-size: 0.72rem; font-weight: 800; }
    .lib-chip.is-active .lib-chip-count { background: rgba(255,255,255,0.26); }
    .lib-folder-tools { display: flex; gap: 6px; flex-wrap: wrap; }
    .mini-button.is-primary { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 750; }
    .mini-button.is-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
    .mini-button.is-danger { color: #b4452f; border-color: rgba(180, 69, 47, 0.4); }
    .mini-button.is-danger:hover { background: rgba(180, 69, 47, 0.1); border-color: rgba(180, 69, 47, 0.6); }
    body[data-theme="dark"] .mini-button.is-danger { color: #f0937f; border-color: rgba(240, 147, 127, 0.34); }
    .lib-folder-pick { display: inline-flex; min-width: 0; }
    .lib-folder-select { max-width: 132px; min-height: 30px; padding: 2px 24px 2px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8690' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 13px; color: var(--soft); font: inherit; font-size: 0.78rem; font-weight: 650; cursor: pointer; -webkit-appearance: none; appearance: none; }
    .lib-folder-select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
    body[data-theme="dark"] .lib-chip, body[data-theme="dark"] .lib-folder-select { background-color: var(--panel-strong); }
    .folder-dialog .auth-form { display: grid; gap: 14px; }
    .folder-dialog .field { display: grid; gap: 6px; }
    .folder-dialog .field > span { font-size: 0.82rem; font-weight: 700; color: var(--soft); }
    .folder-dialog .field input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); color: var(--ink); font: inherit; }
    .folder-dialog .field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
    .folder-dialog .form-error { color: #b4452f; font-size: 0.84rem; margin: 0; }
    body[data-theme="dark"] .folder-dialog .form-error { color: #f0937f; }
    .folder-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

    .text-input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); color: var(--ink); font: inherit; }
    .text-input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
    body[data-theme="dark"] .text-input { background: var(--panel-strong); }
    .arr-name-field { display: grid; gap: 5px; max-width: 420px; margin-bottom: 12px; }
    .arr-summary { color: var(--muted); font-size: 0.84rem; font-weight: 700; margin-bottom: 12px; }
    .arr-list { display: grid; gap: 10px; }
    .arr-row { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); transition: border-color 0.16s, box-shadow 0.16s; }
    .arr-row.is-playing { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(176,112,31,0.18); }
    .arr-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .arr-type { padding: 7px 14px; border-radius: 8px; background: var(--accent-soft, rgba(176,112,31,0.12)); color: var(--accent-2, var(--teal-deep)); font-weight: 850; cursor: pointer; font-size: 0.95rem; }
    .arr-chords { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
    .arr-chord-count { display: inline-flex; gap: 4px; margin-left: 2px; }   /* the per-section +/– chord-count stepper */
    .arr-chord { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); font-weight: 750; cursor: pointer; transition: border-color .14s, background .14s; }
    .arr-chord:hover, .arr-chord:focus-visible { border-color: var(--accent, var(--teal)); background: var(--accent-soft, rgba(176,112,31,.1)); outline: none; }
    .arr-chord .chord-name { font-size: 0.95rem; }
    /* Section chord cell: tap to cycle diatonic, ✎ to type any chord */
    .arr-chord-cell { display: inline-flex; align-items: stretch; }
    .arr-chord-cell .arr-chord { border-top-right-radius: 0; border-bottom-right-radius: 0; }
    .arr-chord-edit { padding: 0 8px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--bg-soft); color: var(--muted); font-size: 0.82rem; cursor: pointer; transition: color .14s, background .14s; }@media (hover: hover) { .arr-chord-edit:hover { color: var(--teal-deep); background: var(--accent-soft, rgba(176,112,31,.1)); } }
    .arr-chord-edit:focus-visible { color: var(--teal-deep); outline: 2px solid var(--teal); }
    .arr-chord-input { width: 90px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--teal); background: var(--panel); color: var(--ink); font: inherit; font-weight: 750; }
    .arr-unsaved { color: var(--teal-text); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
    .arr-saved-tag { color: var(--teal-deep); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
    .arr-unsaved svg, .arr-saved-tag svg { width: 14px; height: 14px; }
    body[data-theme="dark"] .arr-chord-edit { background: rgba(255,255,255,0.05); }
    .arr-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
    .arr-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.68rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
    .arr-save-needed { border-color: rgba(176, 112, 31, 0.55); color: #8a6a12; }   /* unsaved song → the Save button visibly asks for it */
    body[data-theme="dark"] .arr-save-needed { color: var(--gold); }
    /* Build instrument row + history: breathing room from each other and clear, labeled undo/redo
       (the bare ↶↷ icon-minis read as too faint / crammed under the "Play it on" row). */
    .arr-build-inst { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 18px; }
    .arr-summary { margin-top: 6px; }
    .arr-history { display: inline-flex; gap: 8px; margin-right: 12px; vertical-align: middle; }
    .arr-hist-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-strong); color: var(--ink); font-size: 1.05rem; font-weight: 800; cursor: pointer; }
    .arr-hist-btn em { font-style: normal; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; }
    .arr-hist-btn[disabled] { opacity: 0.38; cursor: default; }
    .arr-hist-btn:not([disabled]):hover { border-color: var(--teal-deep); }@media (max-width: 560px) { .arr-hist-btn em { display: none; } .arr-hist-btn { padding: 4px 10px; } }
    .arr-stepper { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
    .arr-stepper .mini-button { width: 34px; min-height: 34px; padding: 0; font-size: 1.15rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
    .arr-stepper strong { color: var(--ink); min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.95rem; text-transform: none; letter-spacing: 0; }
    .arr-stepper strong small { color: var(--muted); font-weight: 700; font-size: 0.62rem; margin-left: 2px; }
    .arr-meter { padding: 0 14px; min-height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
    .arr-field-energy { flex: 1 1 210px; }
    .arr-row-actions { display: flex; gap: 4px; }
    .icon-mini { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-strong); color: var(--soft); cursor: pointer; font-weight: 800; font-size: 0.95rem; }
    .icon-mini:hover:not([disabled]) { border-color: var(--teal); color: var(--ink); }
    .icon-mini[disabled] { opacity: 0.4; cursor: default; }
    /* Touch devices: 30px is half the iOS minimum — taps on ▶/◼/↑/↓/✕ were missing or grazing
       neighbours (read as "the stop button does nothing"). Full 44px targets on touch only. */
    @media (hover: none) {
      .arr-row .icon-mini, .arr-chords .icon-mini { width: var(--control-min); height: var(--control-min); font-size: 1.05rem; }
      .arr-row .arr-sec-play { font-size: 0.85rem; }
      .arr-row-actions { gap: 6px; }
    }
    .arr-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
    .arr-add > span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
    .arr-add-full { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-deep); }
    .arr-add-full svg { width: 14px; height: 14px; }
    .arr-actions { display: flex; gap: 10px; flex-wrap: wrap; }
    body[data-theme="dark"] .arr-row, body[data-theme="dark"] .icon-mini { background: var(--panel-strong); }
    body[data-theme="dark"] .arr-chord, body[data-theme="dark"] .arr-meter, body[data-theme="dark"] .arr-stepper { background: rgba(255,255,255,0.05); }

    .rec-stage { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); margin-bottom: 8px; }
    /* One layout for the button row on BOTH recording surfaces (owner 2026-07-12: Record's
       chips sat flush against the button while Capture's breathed). */
    /* Record IS the star, truly page-centered; the two small toggles stack quietly at its side
       (owner 2026-07-17: inline chips read large + busy next to the one button that matters). */
    .rec-buttons { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; width: 100%; }
    .rec-buttons > .primary-button { grid-column: 2; }
    /* art244: switch labels share a width so both knobs align (no subgrid: old-mobile fallback) */
    .rec-switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 650; color: var(--soft); } .rec-switch-row .gi { width: 15px; height: 15px; flex: none; }
    .rec-switch-row > span { min-width: 5.4em; }
    .rec-chipstack { grid-column: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; justify-self: start; }
    .rec-status { font-weight: 850; color: var(--muted); }
    .rec-status.rec-recording { color: var(--rose); animation: recPulse 1.4s ease-in-out infinite; }@media (prefers-reduced-motion: reduce) { .rec-status.rec-recording { animation: none; } }
    /* LIQUID RECORDING (owner 2026-07-12): while the mic is actually capturing, the stop pill's
       fill drifts slowly like liquid — a live "I'm listening" signal, RECORDING surfaces only.
       The pill supplies its own contrast, so one treatment serves both themes; reduced-motion
       gets a steady rose pill. */
    .rec-stage.is-recording .rec-stop {
      background: linear-gradient(118deg, #7e3a31, var(--rose) 26%, #93412f 50%, #c26e52 74%, #7e3a31);
      background-size: 320% 320%;
      color: #fff;
      border-color: transparent;
      animation: recLiquid 6s ease-in-out infinite;
    }
    body[data-theme="dark"] .rec-stage.is-recording .rec-stop { background-color: transparent; color: #fff; }
    @keyframes recLiquid { 0% { background-position: 0% 40%; } 50% { background-position: 100% 60%; } 100% { background-position: 0% 40%; } }
    @media (prefers-reduced-motion: reduce) { .rec-stage.is-recording .rec-stop { animation: none; background: var(--rose); } }
    @keyframes recPulse { 50% { opacity: 0.55; } }
    .rec-warn { color: var(--rose); font-size: 0.86rem; max-width: 46ch; }
    /* "How to enable your mic" expander — shown under a blocked-mic message in Record + the Tuner. */
    .mic-help { margin-top: 10px; max-width: 46ch; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); overflow: hidden; text-align: left; }
    .mic-help > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 800; font-size: 0.86rem; color: var(--ink); }
    .mic-help > summary::-webkit-details-marker { display: none; }
    .mic-help > summary .gi { width: 18px; height: 18px; color: var(--teal-deep); flex: none; }
    .mic-help[open] > summary { border-bottom: 1px solid var(--line); }
    .mic-help-steps { margin: 0; padding: 10px 12px 12px 30px; display: grid; gap: 6px; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
    .mic-help-steps strong { color: var(--ink); }
    .mic-help-note { margin: 0; padding: 0 12px 12px; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
    .mic-help-note strong { color: var(--ink); }
    .mic-help-diag { margin: 0; padding: 0 12px 12px; color: var(--muted); font-size: 0.72rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-break: break-word; opacity: 0.85; }body[data-theme="dark"] .rec-stage { background: var(--panel-strong); }
    .lib-card.take-card { display: block; }
    .take-main { display: grid; grid-template-columns: minmax(190px, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-width: 0; }
    .take-main > div:first-child { min-width: 0; max-width: 100%; }
    .take-main strong { overflow-wrap: break-word; word-break: normal; }
    .take-main span, .take-saved { overflow-wrap: anywhere; }
    .take-card .lib-actions { max-width: 100%; justify-content: flex-end; }
    .take-card .mini-button { flex: 0 1 auto; }
    .take-saved { margin-top: 8px; color: var(--soft); font-size: 0.86rem; line-height: 1.45; }
    .take-focus { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-2, var(--teal-deep)); font-weight: 750; }
    .take-focus svg { width: 14px; height: 14px; }
    .take-reflect { display: grid; gap: 8px; margin-top: 10px; }
    .take-reflect textarea { resize: vertical; padding: 9px 11px; line-height: 1.4; min-height: 48px; }
    .take-reflect .primary-button { justify-self: start; }
    /* Capture 2.0: idea actions, lyrics chip, transcript, A2HS. */
    .idea-song-actions { margin-top: 10px; justify-content: flex-start !important; }
    .idea-song-cta { padding: 9px 16px; font-size: 0.86rem; }
    .idea-sugg-close { float: right; margin-left: 8px; }
    /* Shared on/off chip state for every recording-surface toggle (Count-in, Live lyrics):
       ON = accent border + ink, OFF = neutral — identical in light and dark. */
    .rec-chip.is-on, .capture-lyrics-chip.is-on { border-color: var(--accent, var(--teal)); color: var(--accent-2, var(--teal-deep)); }
    /* Button hierarchy (owner 2026-07-13): Record/Capture are THE action — the count-in and
       lyrics toggles are settings, not siblings. Chips shrink and step aside; the primary
       button stays the one dominant thing in the stage. */
    .rec-buttons .primary-button { font-size: 17px; padding: 14px 30px; }
    /* Record is the ACTION. Count-in and Live lyrics are SETTINGS — but all three rendered as solid
       dark pills, so the row read as three equal things to press (owner 2026-07-15: "way too busy").
       Same size isn't the problem; same WEIGHT is. Drop the switches to a ghost outline so the eye
       lands on Record and reads them as toggles sitting beside it. */
    .rec-buttons .rec-chip { font-size: 11.5px; padding: 5px 11px; opacity: .78; margin-left: 2px;
      background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
    .rec-buttons .rec-chip:hover { opacity: 1; border-color: var(--teal-text); color: var(--ink); }
    /* an ON switch is stated in the one metal, not by turning into a second Record button */
    .rec-buttons .rec-chip.is-on { background: transparent; border-color: var(--gold); color: var(--teal-text); }
    .rec-buttons .rec-chip:hover, .rec-buttons .rec-chip:focus-visible { opacity: 1; }
    .idea-lyrics { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; text-align: left; }
    .idea-lyrics summary { cursor: pointer; font-size: 0.82rem; font-weight: 750; color: var(--soft); display: inline-flex; align-items: center; gap: 6px; }
    .idea-lyrics summary svg { width: 14px; height: 14px; }
    .idea-lyrics ol { margin: 8px 0 0; padding-left: 6px; list-style: none; display: grid; gap: 4px; font-size: 0.86rem; line-height: 1.4; color: var(--ink); }
    .idea-lyrics .lyr-t { display: inline-block; min-width: 38px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.76rem; }
    .capture-a2hs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); font-size: 0.86rem; color: var(--soft); }
    .capture-a2hs svg { width: 14px; height: 14px; vertical-align: -2px; }
    .arr-lyrics { margin-top: 8px; }
    .arr-lyrics summary { cursor: pointer; font-size: 0.8rem; font-weight: 750; color: var(--soft); display: inline-flex; align-items: center; gap: 5px; }
    .arr-lyrics summary svg { width: 14px; height: 14px; }
    .arr-lyrics-input { width: 100%; margin-top: 7px; resize: vertical; padding: 9px 11px; line-height: 1.45; font-size: 0.88rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); color: var(--ink); }
    .take-analyze { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); display: grid; gap: 9px; }
    .jam-live-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.82rem; padding: 4px 11px; border-radius: 999px; }
    .jam-live-chip.on { color: #fff; background: var(--accent-2, var(--teal-deep)); }
    .jam-live-chip.connecting { color: var(--soft); background: var(--panel-strong); border: 1px solid var(--line); }
    .jam-live-chip.off { color: var(--muted); background: transparent; border: 1px dashed var(--line); font-weight: 650; }@media (max-width: 700px) {
      .take-main { grid-template-columns: 1fr; align-items: stretch; }
      .take-card .lib-actions { justify-content: flex-start; }
      .take-reflect .primary-button { width: 100%; justify-content: center; }
    }@media (max-width: 520px) { }

    /* ============================================================
       JAM — mode hierarchy, three-step setup, session orientation,
       playable roles, and honest Experimental Remote shared cues.
       ============================================================ */
    .jam-overview { display: grid; gap: 18px; }
    .jam-hero { display: grid; grid-template-columns: 1fr; gap: clamp(16px, 3vw, 26px); padding: clamp(24px, 5vw, 50px); border-radius: 18px; color: #f0e8d6; background: radial-gradient(80% 120% at 0 0, rgba(217,169,90,.20), transparent 58%), linear-gradient(135deg, #2a2013, #120e07); box-shadow: var(--shadow); }
    .jam-hero-copy { display: grid; gap: 14px; max-width: 760px; }
    .jam-hero-copy .pillar-eyebrow { color: #e7c266; }
    .jam-hero-copy h2 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.03; letter-spacing: -.025em; }
    .jam-hero-copy p { color: rgba(240,232,214,.78); line-height: 1.55; }
    .jam-hero-points { list-style: none; display: grid; gap: 11px; margin: 2px 0; padding: 0; }
    .jam-hero-points li { color: rgba(240,232,214,.8); line-height: 1.45; font-size: .95rem; }
    .jam-hero-points strong { display: inline-flex; align-items: center; gap: 7px; color: #f0e8d6; }
    .jam-hero-points svg { width: 16px; height: 16px; color: #d9a95a; flex: 0 0 auto; }
    .jam-mode-label { color: var(--accent-2, var(--rose)); font-size: .72rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
    .jam-hero .jam-mode-label { color: #e7c266; }
    .jam-primary-actions { display: flex; flex-wrap: wrap; gap: 9px; }
    .jam-primary-actions > button { flex: 1 1 170px; }
    .jam-hero .primary-button { background: #f4f1e9; color: #16190f; border: 1px solid rgba(255,255,255,.55); }
    .jam-hero .primary-button:hover { background: #fffdf6; }
    .jam-hero .ghost-button { --gb-fg: #f0e8d6; --gb-bg: rgba(255,255,255,.06); --gb-bd: rgba(240,232,214,.22); --gb-bg-hover: rgba(255,255,255,.16); --gb-bd-hover: rgba(240,232,214,.44); }
    .jam-continue { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .jam-continue strong, .jam-continue span { display: block; }
    .jam-continue span { margin-top: 3px; color: var(--muted); font-size: .84rem; }
    .jam-saved { margin-top: 24px; }

    .jam-builder { max-width: 980px; display: grid; gap: 18px; }
    .jam-builder-title { min-height: 24px; }
    .jam-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
    .jam-step { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-bottom: 2px solid var(--line); color: var(--muted); font-weight: 850; }
    .jam-step small { font: inherit; }
    .jam-step svg { width: 14px; height: 14px; }
    .jam-step.is-current { border-color: var(--accent, var(--gold)); color: var(--ink); }
    .jam-step.is-done { border-color: var(--teal); color: var(--teal-deep); }
    .jam-step-head { display: grid; gap: 6px; max-width: 720px; }
    .jam-step-head h3 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
    .jam-step-head p { color: var(--soft); line-height: 1.5; }
    .jam-player-list { display: grid; gap: 9px; }
    .jam-player-edit { display: grid; grid-template-columns: auto minmax(150px,1fr) minmax(130px,.65fr) auto auto; gap: 10px; align-items: end; padding: 12px; border-bottom: 1px solid var(--line); }
    .jam-player-edit label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 800; }
    .jam-player-edit .text-input, .jam-player-edit .jam-select { width: 100%; min-height: 42px; }
    .musician-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; align-self: center; background: var(--accent-soft, rgba(217,169,40,.14)); color: var(--accent-2, var(--rose)); font-weight: 850; }
    .musician-av svg { width: 20px; height: 20px; }
    .musician-av.big { width: 50px; height: 50px; }
    .musician-av.big svg { width: 25px; height: 25px; }
    .jam-select { min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); color: var(--ink); font: inherit; }
    .jam-status-chip { align-self: center; justify-self: start; padding: 4px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--soft); font-size: .7rem; font-weight: 850; }
    .jam-status-chip.leader { color: var(--accent-2, var(--rose)); background: var(--accent-soft, rgba(217,169,40,.14)); }
    .jam-status-chip.ready { color: var(--teal-deep); background: rgba(176,112,31,.12); }
    .jam-add-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 2px; }
    .jam-add-row > span { margin-right: 4px; color: var(--muted); font-size: .8rem; font-weight: 800; }
    .jam-music-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.8fr); gap: 14px; }
    .jam-setup-section { display: grid; align-content: start; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .jam-setup-section h4 { font-size: 1.1rem; }
    .jam-source-choice { display: flex; flex-wrap: wrap; gap: 7px; }
    .jam-dir-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
    .jam-groove-preview { display: grid; gap: 5px; padding: 13px; border-radius: 8px; background: var(--bg-soft); }
    .jam-groove-preview span { color: var(--muted); font-size: .8rem; }
    .jam-groove-preview strong { color: var(--ink); font-family: "JetBrains Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
    .jam-groove-preview .mini-button { justify-self: start; margin-top: 4px; }
    .jam-section-editor { display: grid; gap: 9px; }
    .jam-section-edit { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: end; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
    .jam-section-edit .jam-sec-name { min-width: 0; }
    .jam-section-edit .jam-sec-name .jam-select { width: 100%; min-height: 42px; }
    .jam-section-edit .jam-sec-bars { display: grid; gap: 4px; width: 76px; }
    .jam-sec-barlabel { color: var(--muted); font-size: .72rem; font-weight: 800; }
    .jam-section-edit .jam-sec-bars .number-input { width: 100%; min-height: 42px; }
    .jam-sec-controls { display: inline-flex; align-items: center; gap: 5px; }
    .jam-sec-controls .icon-mini { width: 36px; height: 42px; }

    /* ============================================================
       JAM ROOM — one always-immersive screen. */
    body.jam-immersive { overflow: hidden; }
    body.jam-immersive .app-header, body.jam-immersive .bottom-nav, body.jam-immersive .site-footer, body.jam-immersive .trial-ribbon, body.jam-immersive .instrument-bar { display: none !important; }
    body.jam-immersive .shell { max-width: none; width: 100%; padding: 0; margin: 0; }
    body.jam-immersive #app, body.jam-immersive .app-section { margin: 0; padding: 0; }
    body.jam-immersive .app-section { animation: none; }

    /* Adaptive console: immersive stage centrepiece, controls dock around it. */
    .jam-room-v2 { position: fixed; inset: 0; z-index: 58; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; background: #0b0805; color: #f0e8d6; overflow: hidden; }

    /* The stage is a single scaling scene: the room AND the band live in one SVG (1200×600), so
       they always scale + anchor together. Console open = slice (fill + crop); console AWAY =
       meet, letterboxing on this gradient so a shrunken window never cuts musicians off. */
    .jam-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; color: #f0e8d6; background: linear-gradient(#140d07, #221711); }
    .jam-stage[data-scene="lofi"] { background: linear-gradient(#31191e, #1e1013); }
    .jam-stage[data-scene="jazz"] { background: linear-gradient(#160d0c, #0d0808); }
    .jam-stage[data-scene="soul"] { background: linear-gradient(#150d08, #150b06); }
    .jam-stage[data-scene="rock"] { background: linear-gradient(#281812, #1f1209); }
    .jam-stage[data-scene="cinematic"] { background: linear-gradient(#141013, #1b0e0d); }
    .jam-stage-scene { position: absolute; inset: 0; }
    .jam-stage-scene svg { width: 100%; height: 100%; display: block; }
    .jam-stage .studio-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(125% 92% at 50% 10%, transparent 56%, rgba(10,7,4,.55) 100%); }
    .jam-stage-hud { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(9px + env(safe-area-inset-top)) clamp(10px, 3vw, 22px) 0; }
    .jam-stage-room { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: rgba(16,12,6,.5); border: 1px solid rgba(255,255,255,.16); color: #fdf3df; font-size: .76rem; font-weight: 850; white-space: nowrap; }
    .jam-stage-room svg { width: 14px; height: 14px; }
    .jam-stage-now { flex: 1 1 auto; min-width: 0; text-align: center; color: rgba(240,232,214,.86); font-size: .82rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .jam-stage-hud-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
    .jam-stage-iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(20,14,8,.85); color: #f0e8d6; cursor: pointer; }
    .jam-stage-iconbtn svg { width: 16px; height: 16px; }
    .jam-stage-iconbtn:hover { background: rgba(38,28,16,.92); }
    .jam-stage-exit { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(20,14,8,.85); color: #f0e8d6; font-weight: 800; font-size: .8rem; cursor: pointer; }
    .jam-stage-exit svg { width: 14px; height: 14px; }
    .jam-stage-exit:hover { background: rgba(38,28,16,.92); }
    .jam-stage-iconbtn.is-on { background: var(--gold, #e7c266); color: #20160a; border-color: transparent; }
    /* Console hidden → the stage takes the WHOLE frame; the floating orb is the transport.
       Higher specificity than the responsive grid rules below. */
    .jam-room-v2.is-console-hidden { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
    .jam-room-v2.is-console-hidden .jam-dock { display: none; }
    /* Watch mode keeps every musician's NAME; only the PLAYING/READY chip is dropped. */
    .jam-room-v2.is-console-hidden .jfig:not(.is-back) .jfig-statewrap { display: none; }
    /* WIDE view: scene fills the frame (slice); portrait phones get the rotate prompt instead. */
    /* Name plates melt away while playing. */
    .jam-stage.is-live .jfig-labels { animation: jamPlateFade .6s ease 4s forwards; }
    /* Past the 4s grace, re-renders paint the plates PRE-melted (plates-faded on the stage
       root) — else every chord-change re-render restarted jamPlateFade (blinking plates). */
    .jam-stage.is-live.plates-faded .jfig-labels { animation: none; opacity: .12; }
    .jam-stage.is-live .jfig.is-you .jfig-labels { animation-name: jamPlateFadeYou; }
    .jam-stage.is-live.plates-faded .jfig.is-you .jfig-labels { opacity: .55; }   /* YOUR plate stays readable */
    .jam-stage.is-live .jfig:hover .jfig-labels, .jam-stage.is-live .jfig:focus-within .jfig-labels { animation: none; opacity: 1; }
    @keyframes jamPlateFade { to { opacity: .12; } }
    @keyframes jamPlateFadeYou { to { opacity: .55; } }
    /* Section-energy lighting. */
    .jam-stage .jam-stage-scene { transition: filter 1.2s ease; }
    .jam-stage.is-live.is-energy-high .jam-stage-scene { filter: brightness(1.07) saturate(1.06); }
    .jam-stage.is-live.is-energy-low .jam-stage-scene { filter: brightness(.96); }@media (prefers-reduced-motion: reduce) { .jam-stage.is-live .jfig-labels { animation: none; } }
    /* Stage-ready veil (decode-gated, once per room/session). */
    .jam-stage-veil { position: absolute; inset: 0; z-index: 45; display: grid; place-content: center; justify-items: center; gap: 12px; background: radial-gradient(120% 90% at 50% 30%, #1a130c, #0d0a06); transition: opacity .22s ease; }
    .jam-stage-veil.is-ready { opacity: 0; pointer-events: none; }
    .jam-stage-veil p { color: #b1a488; font-size: .85rem; letter-spacing: .04em; }
    /* iOS "install = fullscreen" hint chip. */
    .jam-a2hs-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; max-width: min(92%, 520px); padding: 9px 12px; border-radius: 12px; background: rgba(18, 13, 8, 0.94); border: 1px solid rgba(255,255,255,0.14); color: #f0e8d6; }
    .jam-a2hs-hint p { margin: 0; font-size: 0.78rem; line-height: 1.35; }
    .jam-a2hs-hint .mini-button { flex: 0 0 auto; }
    .jam-rotate { display: none; }
    .jam-rotate .jr-desk { display: none; }                 /* default copy = touch (rotate) */
    @media (pointer: fine) { .jam-rotate .jr-touch { display: none; } .jam-rotate .jr-desk { display: block; } }/* +width: 768 iPad portrait plays; width alone walls the 667x375 SE both ways. */@media (orientation: portrait) and (max-width: 700px) {
      .jam-rotate { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 26px; background: radial-gradient(120% 90% at 50% 30%, #1a130c, #0d0a06); }
      .jam-rotate-card { display: grid; justify-items: center; gap: 12px; max-width: 340px; text-align: center; }
      .jam-rotate-ic { color: var(--gold, #e7c266); animation: jamRotateHint 2.6s ease-in-out infinite; }
      .jam-rotate-card strong { color: #f7f0e0; font-size: 1.35rem; }
      .jam-rotate-card p { color: rgba(240,232,214,.74); line-height: 1.5; }
      .jam-rotate-card .ghost-button { margin-top: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); color: #f0e8d6; }
    }
    /* A desktop window dragged tall + narrow is landscape-classified but still too tight for the band:
       show the same prompt (desktop copy) below a comfortable width so it never looks cramped. */
    @media (pointer: fine) and (orientation: landscape) and (max-width: 720px) {
      .jam-rotate { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 26px; background: radial-gradient(120% 90% at 50% 30%, #1a130c, #0d0a06); }
      .jam-rotate-card { display: grid; justify-items: center; gap: 12px; max-width: 340px; text-align: center; }
      .jam-rotate-ic { color: var(--gold, #e7c266); }
      .jam-rotate-card strong { color: #f7f0e0; font-size: 1.35rem; }
      .jam-rotate-card p { color: rgba(240,232,214,.74); line-height: 1.5; }
      .jam-rotate-card .ghost-button { margin-top: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); color: #f0e8d6; }
    }
    /* "Leave the room" sits on the dark rotate/widen prompt. The global ghost-button hover turns the
       background light → white-on-white against this dark card; override with a dark-context hover. */
    .jam-rotate-card .ghost-button:hover, .jam-rotate-card .ghost-button:focus-visible { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; transform: translateY(-1px); }
    @keyframes jamRotateHint { 0%, 60% { transform: rotate(0); } 80% { transform: rotate(-90deg); } 100% { transform: rotate(-90deg); } }@media (prefers-reduced-motion: reduce) { .jam-rotate-ic { animation: none; } }
    /* Floating Play orb — the only transport when the console is hidden; pinned to a bottom
       corner, clear of the band. Section nav lives in the console (reopen via the handle). */
    .jam-orb { position: absolute; z-index: 6; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 9px; min-height: 54px; padding: 0 22px 0 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 850; font-size: .96rem; color: #16190f; background: #f4f1e9; box-shadow: 0 14px 34px rgba(0,0,0,.5), 0 0 0 6px rgba(244,241,233,.08); transition: transform var(--motion-ui) var(--ease-ui), background var(--motion-ui) var(--ease-ui); }
    .jam-orb:hover { transform: translateY(-1px); }
    .jam-orb:active { transform: translateY(1px); }
    .jam-orb:focus-visible { outline: 2px solid var(--gold, #e7c266); outline-offset: 3px; }
    .jam-orb .jam-orb-ic { display: inline-grid; place-items: center; }
    .jam-orb .jam-orb-ic svg { width: 20px; height: 20px; }
    .jam-orb.is-playing { background: var(--gold, #e7c266); }@media (max-width: 560px) { .jam-orb { padding: 0; width: 56px; justify-content: center; } .jam-orb .jam-orb-label { display: none; } }
    /* Console collapse handle: slim arrow tab on the stage-facing edge. */
    .jam-rail-handle { position: absolute; z-index: 6; left: 50%; bottom: min(46vh, 440px); transform: translate(-50%, 50%); width: 62px; height: 26px; display: grid; place-items: center; padding: 0; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #1d150d, #0e0a06); border: 1px solid rgba(255,255,255,.14); border-bottom: 0; color: #d6cbb2; cursor: pointer; box-shadow: 0 -7px 18px rgba(0,0,0,.34); transition: color var(--motion-ui) var(--ease-ui), background var(--motion-ui) var(--ease-ui); }
    .jam-rail-handle:hover { color: #f7f0e0; background: linear-gradient(180deg, #281c11, #0e0a06); }
    .jam-rail-handle:focus-visible { outline: 2px solid var(--gold, #e7c266); outline-offset: 2px; }
    .jam-rail-handle-ic { display: flex; }
    .jam-rail-handle-ic svg { width: 20px; height: 20px; transition: transform var(--motion-ui) var(--ease-ui); }
    .jam-room-v2.is-console-hidden .jam-rail-handle { bottom: 0; transform: translate(-50%, 0); }
    .jam-room-v2.is-console-hidden .jam-rail-handle-ic svg { transform: rotate(180deg); }

    /* ---- The band (SVG figures, 1200×600 user space) ---- */
    .jfig { --fig: #cdd7df; cursor: pointer; }
    .jfig.inst-drums, .jfig.inst-percussion { --fig: #ef9f86; }
    .jfig.inst-bass { --fig: #9b8cf0; }
    .jfig.inst-keys { --fig: #57d6bd; }
    .jfig.inst-guitar { --fig: #e7c266; }
    .jfig.inst-ukulele { --fig: #f0b65e; }
    .jfig.inst-sax { --fig: #f0a878; }
    /* coverage cast wardrobe */
    .jfig.inst-eguitar { --fig: #d96c5a; }
    .jfig.inst-organ { --fig: #c98a3f; }
    .jfig.inst-strings { --fig: #a887c9; }
    .jfig.inst-violin { --fig: #caa2d8; }
    .jfig.inst-trumpet { --fig: #e3b25c; }
    .jfig.inst-flute { --fig: #cfd3a8; }
    .jfig.inst-harp { --fig: #d8c07a; }
    .jfig.inst-vocals { --fig: #ef8aa0; }.jfig-art { transition: transform var(--motion-ui) var(--ease-ui); transform-box: fill-box; transform-origin: bottom center; }.jfig:hover .jfig-art { transform: translateY(-5px); }
    /* Selection reads as a glow hugging the musician's SILHOUETTE (drop-shadow follows the
       sprite's alpha), not a bounding box (owner 2026-07-11: "not really a box, an outline"). */
    .jfig-art:focus { outline: none; }
    .jfig-art image, .jfig-art .jfig-glow, .jfig-art .jfig-shadow-core { pointer-events: none; }   /* the person-width .jfig-hit rect is the ONE click target (2026-07-12) */
      /* a mouse click must never draw the UA's blue bounding box (owner, re-reported 2026-07-12) */
    .jfig-art:focus-visible, .jfig.is-role-open .jfig-art { outline: none; filter: drop-shadow(0 0 2px var(--gold, #e7c266)) drop-shadow(0 0 7px rgba(231,194,102,.55)); }
    .jfig-mute:focus, .jam-stage [role="button"][tabindex="0"]:focus { outline: none; }
    .jfig.is-flipped .jfig-art > image { transform: translate(120px, 0) scaleX(-1); }   /* face the stage center; direct-child spares the sheet strip */
    .jfig.is-flipped .jfig-art .jfig-sheet { transform: translate(120px, 0) scaleX(-1); }
    .jfig-mute:focus-visible { outline: 2px solid var(--gold, #e7c266); outline-offset: 3px; border-radius: 4px; }
    /* figure part fills (shared with the scene) — clothed people: skin + hair + a shirt (in the
       player's instrument colour) + trousers. Skin/hair/trousers vary per musician (set inline). */
    .jfig-shadow { fill: url(#jr-figshadow); }
    /* "Now playing" glow halo — opacity-driven (iOS-safe), hidden until the musician is active. */
    .jfig-glow { opacity: 0; }
    .jam-stage.is-live .jfig.is-active .jfig-glow { opacity: 0.85; animation: jamGlow var(--beat, .6s) ease-in-out infinite; animation-delay: var(--jdelay, 0s); }
    @keyframes jamGlow { 50% { opacity: 0.42; } }
    /* Drums: the glow ellipse sizes from the whole KIT canvas (no pw), so the per-beat opacity
       pulse reads as the halo swelling around the furniture (owner 2026-07-13: "pulsatingly
       enlarging"). The kit's halo holds steady; the drummer's motion lives in his frames. */
    .jam-stage.is-live .jfig.is-active.inst-drums .jfig-glow { animation: none; opacity: 0.6; }
    .jfig-shadow-core { fill: rgba(0,0,0,.32); }
    .jfig-shadow-core.is-kit { fill: rgba(0,0,0,.18); }
    .jfig-shadow-img.is-kit { opacity: .55; }
    .jfig-shirt { fill: var(--fig); }
    .jfig-skin { fill: var(--skin, #e7b48f); }
    .jfig-hair { fill: var(--hair, #2b2620); }
    .jfig-pants { fill: var(--pants, #323845); }
    .jfig-shoe { fill: #171b22; }
    .jfig-rim { fill: none; stroke: rgba(255,223,184,.32); stroke-width: 1.7; stroke-linecap: round; }
    /* rim light follows the room's light temperature */
    .jam-stage[data-scene="cinematic"] .jfig-rim { stroke: rgba(180,212,255,.36); }
    .jam-stage[data-scene="lofi"] .jfig-rim { stroke: rgba(255,196,220,.32); }
    /* life layer: motes drift up the beam (staggered via --md/--mdel); Soul neon breathes */
    .jam-motes circle { animation: jamMoteDrift var(--md, 9s) linear infinite; animation-delay: var(--mdel, 0s); }
    @keyframes jamMoteDrift { 0% { transform: translateY(8px); opacity: 0; } 25% { opacity: .55; } 75% { opacity: .3; } 100% { transform: translateY(-30px); opacity: 0; } }
    .jam-neon-breathe { animation: jamNeonBreathe 4.6s ease-in-out infinite; }
    @keyframes jamNeonBreathe { 50% { opacity: .3; } }@media (prefers-reduced-motion: reduce) { .jam-motes circle, .jam-neon-breathe { animation: none; } }
    /* "Add a musician" open spot on stage */
    .jfig-spot { cursor: pointer; }
    .jfig-spot-ring { fill: rgba(255,255,255,.04); stroke: rgba(255,255,255,.32); stroke-width: 2.4; stroke-dasharray: 7 7; transition: stroke var(--motion-ui) var(--ease-ui), fill var(--motion-ui) var(--ease-ui); }
    .jfig-spot-plus { fill: none; stroke: rgba(240,232,214,.66); stroke-width: 4; stroke-linecap: round; }
    .jfig-spot-label { fill: rgba(240,232,214,.62); font: 800 12px Inter, system-ui, sans-serif; letter-spacing: .04em; }
    .jfig-spot:hover .jfig-spot-ring, .jfig-spot:focus-visible .jfig-spot-ring { stroke: var(--gold, #e7c266); fill: rgba(231,194,102,.12); }
    .jfig-spot:hover .jfig-spot-plus { stroke: var(--gold, #e7c266); }
    /* In-room add-a-musician picker */
    .jam-add-backdrop { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(6,9,13,.62); }
    .jam-add-sheet { width: min(420px, 100%); max-height: 80%; overflow-y: auto; padding: 16px; border-radius: 12px; background: linear-gradient(180deg, #1c140c, #0e0a06); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
    .jam-add-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
    .jam-add-head strong { color: #fff; font-size: 1.05rem; }
    .jam-add-head .auth-close { background: rgba(255,255,255,.08); border: 0; color: #f0e8d6; width: 30px; height: 30px; border-radius: 8px; font-size: 1.2rem; cursor: pointer; }
    .jam-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .jam-add-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #f0e8d6; font-weight: 800; cursor: pointer; }
    .jam-add-pick svg { width: 16px; height: 16px; color: var(--gold, #e7c266); }
    .jam-add-pick:hover:not(:disabled) { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); }
    .jam-add-pick:disabled { opacity: .45; cursor: not-allowed; }
    .jam-add-full { margin-left: auto; font-size: .72rem; font-weight: 700; color: rgba(240,232,214,.6); }
    .jfig-hi { fill: rgba(255,255,255,.2); }
    .jfig-sh { fill: rgba(0,0,0,.2); }
    /* Faceless heads, soft shading; clothing seams for depth */
    .jfig-hair-hi { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 2.2; stroke-linecap: round; }
    /* Single-silhouette figure: clipped colour regions + shading shapes painted inside the body. */
    .jfig-ao { fill: rgba(0,0,0,.26); }                                                /* ambient occlusion (creases) */
    .jfig-ao2 { fill: none; stroke: rgba(0,0,0,.24); stroke-width: 1.5; stroke-linecap: round; }  /* inseam */
    .jfig-fold { fill: none; stroke: rgba(0,0,0,.13); stroke-width: 1; stroke-linecap: round; } /* soft contour */
    .jfig-arm-fill { fill: var(--fig); stroke: rgba(0,0,0,.16); stroke-width: 0.6; stroke-linejoin: round; }
    .jfig-arm { fill: none; stroke: var(--fig); stroke-width: 7.5; stroke-linecap: round; }
    .jfig-pants-hi { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 2.6; stroke-linecap: round; }
    .jfig-stick { stroke: #e7d3a8; stroke-width: 3.5; stroke-linecap: round; }
    .jfig-stand { fill: none; stroke: rgba(225,230,235,.55); stroke-width: 3; }
    .jfig-wood { fill: #b07a45; }
    .jfig-dark { fill: rgba(6,9,13,.62); }
    .jfig-metal { fill: #d9b25a; }
    .jfig-keys { fill: #eef2f5; }
    /* labels + state: one plate style for the whole band; dark pill + halo stay legible over paint */
    .jfig-label-bg { fill: rgba(20,15,8,.58); stroke: rgba(255,255,255,.1); stroke-width: 1; }
    .jfig.is-you .jfig-label-bg { stroke: rgba(255,216,112,.2); }   /* QUIET You-marker (owner 2026-07-16): keep the tell, drop the shout */
    .jfig-name { fill: #fff; font: 800 13px Inter, system-ui, sans-serif; paint-order: stroke; stroke: rgba(7,10,14,.62); stroke-width: 3.4px; stroke-linejoin: round; }
    .jfig-state { fill: rgba(240,232,214,.7); font: 800 9px Inter, system-ui, sans-serif; letter-spacing: .6px; paint-order: stroke; stroke: rgba(7,10,14,.5); stroke-width: 2.4px; stroke-linejoin: round; }
    .jfig-dot { fill: rgba(255,255,255,.42); }
    .jfig-badge { fill: var(--gold, #e7c266); }
    .jfig.is-you .jfig-name { fill: #f3ddab; }   /* muted gold — reads as 'mine' without flagging the whole stage */
    .jfig.is-dim { opacity: .55; filter: grayscale(.5); }.jfig.is-back .jfig-art { filter: brightness(.85) saturate(.84) contrast(.97); }
    .jfig.is-back .jfig-shadow { opacity: .78; }
    .jfig.is-back .jfig-shadow-img { opacity: .78; }
    .jfig.is-active .jfig-dot { fill: #e7c266; }
    /* No filter on is-active art: the old teal drop-shadow read as a chroma-key cutout in the warm
       rooms, and it clobbered both the back-row dimming (907) and the gold focus ring (833). The
       "now playing" state is carried by .jfig-glow + the gold dot + the PLAYING pill. */
    /* Selection out-ranks "is sounding" AND back-row dimming — (0,4,0) beats both 907 and any state rule. */
    .jam-stage .jfig.is-role-open .jfig-art { filter: drop-shadow(0 0 2px var(--gold, #e7c266)) drop-shadow(0 0 7px rgba(231,194,102,.55)); }
    .jfig.is-solo .jfig-dot { fill: var(--gold); }
    /* one-tap mute, top-right of each virtual musician */
    /* Mute is visible from the start (not a hidden hover gesture) so it's discoverable; it brightens
       on hover/focus and when active. */
    .jfig-mute { cursor: pointer; color: #f0e8d6; opacity: .82; transition: opacity var(--motion-ui) var(--ease-ui); }
    /* Chips live in their own top layer now (never buried behind a neighbour's sprite) — they
       brighten on their OWN hover/focus, not the figure's. */
    .jfig-mute:hover, .jfig-mute:focus-within, .jfig-mute.is-muted { opacity: 1; }
    .jfig-mute-bg { fill: rgba(10,14,20,.82); stroke: rgba(255,255,255,.26); stroke-width: 1; }
    .jfig-mute.is-muted .jfig-mute-bg { fill: var(--rose, #c0556b); stroke: none; }
    .jfig-mute-ic { color: #f0e8d6; }/* Playing animation — only while the band is live + this musician is sounding. */
    .jam-stage.is-live .jfig.is-active .jfig-art { animation: jamBob var(--beat, .6s) ease-in-out infinite; animation-delay: var(--jdelay, 0s); transform-box: fill-box; transform-origin: bottom center; }
    .jam-stage.is-live .jfig.is-active .jfig-arm-fill { animation: jamPluck var(--beat, .6s) ease-in-out infinite; animation-delay: var(--jdelay, 0s); transform-box: fill-box; transform-origin: top center; }
    .jam-stage.is-live .jfig.is-active .jfig-stick { animation: jamStick calc(var(--beat, .6s) / 2) ease-in-out infinite; transform-box: fill-box; }
    /* String players strum: the picking arm sweeps instead of just bobbing. */
    .jam-stage.is-live .jfig.is-active.inst-guitar .jfig-arm-fill, .jam-stage.is-live .jfig.is-active.inst-bass .jfig-arm-fill, .jam-stage.is-live .jfig.is-active.inst-ukulele .jfig-arm-fill { animation: jamStrum var(--beat, .6s) ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
    @keyframes jamBob { 50% { transform: translateY(var(--bob, -5px)) rotate(.6deg); } }
    /* Vector idle = breath (scaleY, bottom origin — feet never move); --jdelay staggers. */
    .jam-stage .jfig .jfig-art { animation: jamIdle 4.8s ease-in-out infinite; animation-delay: var(--jdelay, 0s); transform-box: fill-box; transform-origin: bottom center; }
    @keyframes jamIdle { 50% { transform: scaleY(1.006); } }@media (prefers-reduced-motion: reduce) { .jam-stage .jfig .jfig-art { animation: none; } }
    /* Sprites idle STILL (owner 2026-07-08: any pulse reads fake; foot-tap frames planned). */
    .jam-stage .jfig.is-sprite .jfig-art { animation: none; }
    /* Playing pulse: a small settle into the beat — no rotation, no hop (the painted frames carry
       the real limb motion; the old -5px hop + tilt read as cardboard puppets). */
    .jam-stage.is-live .jfig.is-sprite.is-active .jfig-art { animation: jamBobSprite var(--beat, .6s) ease-in-out infinite; animation-delay: var(--jdelay, 0s); transform-box: fill-box; transform-origin: bottom center; }
    @keyframes jamBobSprite { 30% { transform: translateY(-2.5px); } 65% { transform: translateY(-0.5px); } }
    /* Drums opt OUT of the settle (owner 2026-07-13: "pulsatingly enlarging" — the canvas IS the
       kit). Placed BEFORE the groove layer so on frame-404 the later equal-specificity
       jamGrooveRock still wins (grooves, never freezes). */
    .jam-stage.is-live .jfig.is-sprite.is-active.inst-drums .jfig-art { animation: none; }
    /* THE GROOVE LAYER (owner 2026-07-13): only .is-still figures groove — a rigid whole-figure
       transform can't tear pixels. scaleY (bottom origin), so feet + shadows stay planted. */
    .jam-stage.is-live .jfig.is-sprite.is-active.is-still .jfig-art { animation: jamGrooveRock calc(var(--beat, .6s) * 4) ease-in-out infinite; animation-delay: var(--jdelay, 0s); transform-box: fill-box; transform-origin: bottom center; }
    .jam-stage.is-live .jfig.is-sprite.is-active.is-still:is(.inst-violin, .inst-strings) .jfig-art { animation-name: jamGrooveSway; }
    .jam-stage.is-live .jfig.is-sprite.is-active.is-still:is(.inst-flute, .inst-trumpet, .inst-sax, .inst-vocals) .jfig-art { animation-name: jamGrooveLift; animation-duration: calc(var(--beat, .6s) * 2); }
    .jam-stage.is-live .jfig.is-sprite.is-active.is-still:is(.inst-guitar, .inst-eguitar, .inst-bass, .inst-ukulele) .jfig-art { animation-name: jamGrooveStrum; animation-duration: calc(var(--beat, .6s) * 2); }
    @keyframes jamGrooveRock { 0%, 100% { transform: rotate(-0.5deg); } 50% { transform: rotate(0.5deg); } }
    @keyframes jamGrooveSway { 0%, 100% { transform: rotate(-0.9deg); } 50% { transform: rotate(0.9deg); } }
    /* ROUND-5 (owner 2026-07-13): scaleY REMOVED — a bottom-anchored vertical scale read as the
       whole body "enlarging/pulsating" on the beat. Rotate-only sway can't change a figure's size. */
    @keyframes jamGrooveLift { 0%, 100% { transform: rotate(0.55deg); } 50% { transform: rotate(-0.55deg); } }
    @keyframes jamGrooveStrum { 0%, 100% { transform: rotate(-0.6deg); } 35% { transform: rotate(0.6deg); } }
    /* A frameless drummer must NOT groove either — the canvas is the kit, and a rocking kit is
       furniture motion (same reasoning as his settle opt-out above). Last in the cascade so it
       wins over jamGrooveRock at equal specificity. */
    .jam-stage.is-live .jfig.is-sprite.is-active.is-still.inst-drums .jfig-art { animation: none; }
    @media (prefers-reduced-motion: reduce) { .jam-stage.is-live .jfig.is-sprite.is-active.is-still .jfig-art { animation: none; } }
    /* THE LIVING BAND (art207): 31-cell video strip, stepped -100% of its fill-box, phase-locked
       via the jamFrame filter. Base cross-fades under (160ms); cell 0 ≈ base. No CSS bob. */
    /* Movable band: lifted figure dims, target glows. */
    .jfig.is-dragging { opacity: .55; }
    .jfig.is-drop-target .jfig-art { filter: drop-shadow(0 0 10px rgba(231, 194, 102, .9)); }
    .jam-add-spot.is-drop-target, [data-action="jam-add-spot"].is-drop-target { filter: drop-shadow(0 0 10px rgba(231, 194, 102, .9)); }
    .jfig-sheet { opacity: 0; transition: opacity 160ms linear; }
    .jam-stage.is-live .jfig.is-active.has-sheet .jfig-sheet { opacity: 1; }
    .jam-stage.is-live .jfig.is-active.has-sheet .jfig-art > .jfig-sprite { opacity: 0; transition: opacity 160ms linear; }
    .jam-stage.is-live .jfig.is-active.has-sheet .jfig-sheet-strip { animation: jamFrameSheet calc(var(--beat, .6s) * var(--sheetbeats, 4)) steps(31) infinite; transform-box: fill-box; }
    @keyframes jamFrameSheet { to { transform: translateX(-100%); } }
    .jam-stage.is-live .jfig.is-active.has-sheet .jfig-art { animation: none; }
    /* Nobody is a statue: resting musicians BREATHE (drums excluded; count-in still freezes). */
    .jam-stage:not(.is-countin) .jfig.is-sprite:not(.is-active) .jfig-art { animation: jamIdleBreathe 3.8s ease-in-out infinite; animation-delay: var(--jdelay, 0s); transform-box: fill-box; transform-origin: bottom center; }
    .jam-stage .jfig.is-sprite.inst-drums:not(.is-active) .jfig-art { animation: none; }
    @keyframes jamIdleBreathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.0065); } }   /* owner 2026-07-17: the whole-figure rock read as HOVERING — breathe instead (feet planted, instrument still) */
    /* frames: strike f1 → base → lift f3 → poised f2; no --jdelay (jamFrameSync phase-locks). */
    .jfig-sprite-b, .jfig-sprite-f { opacity: 0; }
    .jam-stage.is-live .jfig.is-active .jfig-sprite-b { animation: jamFrameStep var(--beat, .6s) linear infinite; }
    @keyframes jamFrameStep { 0% { opacity: 1; } 9%, 46% { opacity: 0; } 55%, 100% { opacity: 1; } }
    .jam-stage.is-live .jfig.is-active .jfig-sprite-f { animation: jamFrame4a var(--beat, .6s) linear infinite; }
    .jam-stage.is-live .jfig.is-active .jfig-sprite-f3 { animation-name: jamFrame4c; }
    .jam-stage.is-live .jfig.is-active .jfig-sprite-f2 { animation-name: jamFrame4d; }
    /* Base shows only its recover quarter (always-on ghosted); direct-child spares the
       reflection; idle/broken figures drop has-frames4 so base stays the fallback. */
    .jam-stage.is-live .jfig.is-active.has-frames4 .jfig-art > .jfig-sprite { animation: jamFrame4b var(--beat, .6s) linear infinite; }
    /* HARD CUTS (owner 2026-07-12: crossfades ghosted). Same quarters/order, instant. Legacy rooms. */
    @keyframes jamFrame4a { 0%, 24.9% { opacity: 1; } 25%, 99.9% { opacity: 0; } 100% { opacity: 1; } }
    @keyframes jamFrame4b { 0%, 24.9% { opacity: 0; } 25%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
    @keyframes jamFrame4c { 0%, 49.9% { opacity: 0; } 50%, 74.9% { opacity: 1; } 75%, 100% { opacity: 0; } }
    @keyframes jamFrame4d { 0%, 74.9% { opacity: 0; } 75%, 100% { opacity: 1; } }
    /* SIX POSES/BEAT (legacy rooms): base + f1..f5, exclusive sixths, hard cuts, clip order.
       Needs .has-frames6 (>=5 frames) and must sit AFTER jamFrame4* — source order wins. */
    .jam-stage.is-live .jfig.is-active.has-frames6.has-frames4 .jfig-art > .jfig-sprite { animation-name: jamFrame6a; }
    .jam-stage.is-live .jfig.is-active.has-frames6 .jfig-sprite-f  { animation-name: jamFrame6b; }
    .jam-stage.is-live .jfig.is-active.has-frames6 .jfig-sprite-f2 { animation-name: jamFrame6c; }
    .jam-stage.is-live .jfig.is-active.has-frames6 .jfig-sprite-f3 { animation-name: jamFrame6d; }
    .jam-stage.is-live .jfig.is-active.has-frames6 .jfig-sprite-f4 { animation: jamFrame6e var(--beat, .6s) linear infinite; }
    .jam-stage.is-live .jfig.is-active.has-frames6 .jfig-sprite-f5 { animation: jamFrame6f var(--beat, .6s) linear infinite; }
    @keyframes jamFrame6a { 0%, 16.5% { opacity: 1; } 16.6%, 99.9% { opacity: 0; } 100% { opacity: 1; } }
    @keyframes jamFrame6b { 0%, 16.5% { opacity: 0; } 16.6%, 33.2% { opacity: 1; } 33.3%, 100% { opacity: 0; } }
    @keyframes jamFrame6c { 0%, 33.2% { opacity: 0; } 33.3%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
    @keyframes jamFrame6d { 0%, 49.9% { opacity: 0; } 50%, 66.5% { opacity: 1; } 66.6%, 100% { opacity: 0; } }
    @keyframes jamFrame6e { 0%, 66.5% { opacity: 0; } 66.6%, 83.2% { opacity: 1; } 83.3%, 100% { opacity: 0; } }
    @keyframes jamFrame6f { 0%, 83.2% { opacity: 0; } 83.3%, 100% { opacity: 1; } }
    /* Drum pose extras: pose-machine only, never the carousel. MOVED 4/5 -> 6/7 because the six-pose
       carousel owns f1..f5. They were dormant — every set shipped 3 frames, so both resolved to null. */
    .jam-stage.is-live .jfig.is-active :is(.jfig-sprite-f6, .jfig-sprite-f7) { animation: none; }
    /* Foot-tap only while the beat RUNS (owner: tapping to no beat = glitch) — count-in grid +
       live frames only. */
    .jfig-sprite-tap { opacity: 0; }
    /* Under .is-hitdriven only .is-posed figures park their CSS
       loop; the vocalist + sustained coverage cast keep their beat-locked playing loop — parking
       them froze half the band mid-song (2026-07-11 QA). */
    .jam-stage.is-live.is-hitdriven .jfig.is-active.is-posed :is(.jfig-sprite-b, .jfig-sprite-f, .jfig-sprite-f3, .jfig-sprite-f2, .jfig-sprite-f4, .jfig-sprite-f5),
    .jam-stage.is-live.is-hitdriven .jfig.is-active.has-frames4.is-posed .jfig-art > .jfig-sprite { animation: none; }
    .jam-stage.is-hitdriven .jfig.is-posed :is(.jfig-sprite, .jfig-sprite-f, .jfig-sprite-f3, .jfig-sprite-f2, .jfig-sprite-f4, .jfig-sprite-f5, .jfig-sprite-f6, .jfig-sprite-f7) { transition: opacity 55ms linear; }
    /* .is-phrased players phrase over TWO beats (per-beat reads robotic); rhythm stays on the beat. */
    .jam-stage.is-live .jfig.is-active.is-phrased .jfig-sprite-f, .jam-stage.is-live .jfig.is-active.has-frames4.is-phrased .jfig-art > .jfig-sprite { animation-duration: calc(var(--beat, .6s) * 2); }@media (prefers-reduced-motion: reduce) { .jam-stage .jfig.is-sprite .jfig-art, .jam-stage:not(.is-countin) .jfig.is-sprite:not(.is-active) .jfig-art, .jam-stage.is-live .jfig.is-active.has-sheet .jfig-sheet-strip, .jam-stage.is-live .jfig.is-active .jfig-sprite-b, .jam-stage.is-live .jfig.is-active .jfig-sprite-f, .jam-stage.is-live .jfig.is-active.has-frames4 .jfig-art > .jfig-sprite { animation: none; } }
    /* The ponytail's hair tie: a soft dark band over the hair at the tail's gather. */
    .jfig-hairtie { fill: rgba(10, 14, 18, 0.42); }
    @keyframes jamPluck { 50% { transform: translateY(3px); } }
    @keyframes jamStick { 50% { transform: translateY(4px); } }
    @keyframes jamStrum { 25% { transform: translateY(2px) rotate(2.5deg); } 75% { transform: translateY(-1px) rotate(-1.5deg); } }
    

    /* Count-in: the stage is NOT .is-live, so the band is frozen for free. Only a phase-locked
       foot tap moves (jamCountInBegin pins jamCountTap's startTime to the count grid). */
    .jam-stage.is-countin .jfig .jfig-sprite-tap { opacity: 0; }
    /* art240 (owner: the count-in tap read laggy): the lifted-foot overlay stays visible and
       BOUNCES with an ease curve instead of popping on/off — reads as a foot keeping count. */
    .jam-stage.is-countin .jfig.can-tap .jfig-sprite-tap { opacity: 1; animation: jamCountTap var(--countbeat, .6s) ease-in-out infinite; transform-origin: 50% 100%; }
    @keyframes jamCountTap { 0%, 100% { transform: translateY(0); opacity: .0; } 18% { opacity: 1; } 38% { transform: translateY(-2.5px); opacity: 1; } 72% { transform: translateY(0); opacity: .55; } }
    /* art218: live taps are baked INTO the sheet cells (overlays ghost a double shoe); overlay taps are count-in-only. */
    @media (prefers-reduced-motion: reduce) { .jam-stage.is-countin .jfig.can-tap .jfig-sprite-tap { animation: none; opacity: 0; } }

    /* ---- The studio console: a brushed-dark control surface of labelled modules. Default is a
       bottom panel (portrait); landscape/desktop turn it into a full-height side rail (below). ---- */
    .jam-dock { min-height: 0; max-height: min(58vh, 480px); overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; grid-auto-rows: min-content; gap: 9px; padding: 11px clamp(12px, 3vw, 24px) calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #1a130a 0%, #0d0906 70%); border-top: 1px solid rgba(255,255,255,.11); box-shadow: 0 -16px 34px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05); }
    /* Landscape phones: taller panel, tighter gaps */
    @media (orientation: landscape) and (max-height: 560px) { .jam-dock { max-height: min(72vh, 360px); gap: 6px; padding-top: 8px; } .jam-mod { padding: 7px 9px; gap: 5px; } }
    /* Console header: brand + a read-only key/style/BPM readout, like the strip atop a real desk. */
    .jam-console-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; min-height: 18px; }
    .jam-console-readout { min-width: 0; }
    .jam-console-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--gold, #e7c266); font-size: .66rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
    .jam-console-brand svg { width: 14px; height: 14px; }
    .jam-console-readout { color: rgba(240,232,214,.62); font: 700 .72rem/1 "JetBrains Mono", ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .jam-console-readout b { color: #fff; }
    /* Each control group is an inset "module" with a tiny legend, like a section of a console. */
    .jam-mod { display: grid; gap: 7px; padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
    .jam-mod-label { display: inline-flex; align-items: center; gap: 6px; color: rgba(240,232,214,.5); font-size: .6rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
    .jam-mod-label svg { width: 14px; height: 14px; color: var(--gold, #e7c266); }
    .jam-mod-transport { background: rgba(255,255,255,.05); }
    .jam-dock-transport { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
    /* "My part" toggle. */
    .jam-guide-chip { margin-top: 8px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #d6cbb2; cursor: pointer; font-size: .82rem; }
    .jam-guide-chip strong { color: #f0e8d6; }
    .jam-guide-chip.is-on { border-color: rgba(231,194,102,.55); color: #e8dcc0; }
    .jam-guide-chip.is-on strong { color: #e7c266; }
    .jam-guide-chip svg { width: 14px; height: 14px; }
    .jam-dock-transport .jam-dock-section { min-height: 44px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #f0e8d6; }
    .jam-dock-transport .jam-dock-section:first-child { justify-self: end; }
    .jam-dock-transport .jam-dock-section:last-child { justify-self: start; }
    .jam-dock-transport .jam-dock-section:hover:not(:disabled) { background: rgba(255,255,255,.12); }
    .jam-dock-transport .jam-dock-section:disabled { opacity: .4; cursor: default; }
    /* THE go button: solid paper (owner 2026-07-11 — the olive primary clashed with the room).
       The extra .primary-button outranks the dark-theme primary override (room is always dark). */
    .jam-dock-play { min-height: 46px; min-width: clamp(150px, 38vw, 220px); }
    .jam-room-v2 .primary-button.jam-dock-play { background: #f4f1e9; color: #16190f; border: 1px solid rgba(255,255,255,.28); box-shadow: 0 6px 22px rgba(0,0,0,.45); }
    .jam-room-v2 .primary-button.jam-dock-play:hover { background: #fffdf6; }
    .jam-dock-now { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
    .jam-dock-chip { display: grid; gap: 2px; align-content: center; padding: 7px 14px; border-radius: 8px; background: rgba(4,8,12,.5); border: 1px solid rgba(255,255,255,.07); box-shadow: inset 0 1px 4px rgba(0,0,0,.5); min-width: 74px; }
    .jam-dock-chip em { color: var(--gold, #e7c266); font-style: normal; font-size: .62rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
    .jam-dock-chip strong { color: #fff; font: 900 clamp(1.5rem, 5vw, 2.1rem)/1 "JetBrains Mono", ui-monospace, monospace; }
    .jam-dock-chip .jam-dock-chord { color: #e7c266; text-shadow: 0 0 12px rgba(231,194,102,.45); }
    .jam-dock-chip.jam-dock-sec { flex: 1 1 130px; }
    .jam-dock-chip.jam-dock-sec strong { font-size: clamp(1rem, 3.5vw, 1.3rem); }
    .jam-dock-chip.jam-dock-sec small { color: rgba(240,232,214,.6); font-size: .72rem; }
    .jam-dock-prog { display: flex; flex-wrap: wrap; gap: 6px; }
    .jam-prog-chip { display: inline-grid; place-items: center; min-width: 46px; padding: 6px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(255,255,255,.05); color: rgba(240,232,214,.82); }
    .jam-prog-chip .chord-name { font-size: .96rem; font-weight: 750; white-space: nowrap; overflow: visible; max-width: none; --chord-scale: 1; }
    .jam-prog-chip.is-now { background: var(--teal, #8a5613); border-color: transparent; color: #fff; font-weight: 800; box-shadow: 0 0 0 2px rgba(95,224,198,.3); }
    .jam-prog-chip.is-now .chord-name { color: #fff; }
    .jam-segment { flex: 1 0 96px; display: grid; justify-items: start; gap: 2px; min-height: 44px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(255,255,255,.05); color: rgba(240,232,214,.82); font-weight: 800; cursor: pointer; }
    .jam-segment small { color: rgba(240,232,214,.55); font-size: .68rem; }
    .jam-segment.is-current { border-color: transparent; background: var(--gold, #e7c266); color: #20160a; }
    .jam-segment.is-current small { color: rgba(32,22,10,.7); }
    .jam-segment:disabled { cursor: default; opacity: .55; }
    .jam-dock-cue { margin: 0; color: #f0e8d6; font-size: .92rem; line-height: 1.45; }
    .jam-dock-hint { margin: 0; display: flex; align-items: center; gap: 6px; color: rgba(240,232,214,.6); font-size: .78rem; line-height: 1.35; }
    .jam-dock-hint svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--gold, #e7c266); }
    .jam-dock-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    /* Quick groove controls in the console — inline */
    .jam-quickrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
    .jam-quick-tempo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.05); }
    .jam-quick-tempo strong { color: #f0e8d6; font-size: 0.9rem; white-space: nowrap; min-width: 58px; text-align: center; font-variant-numeric: tabular-nums; }
    .jam-quick-tempo small { color: rgba(240,232,214,.66); font-weight: 600; }
    /* Jam room is ALWAYS dark: fixed light-on-dark control colors. */
    .jam-room-v2 .step-btn { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #f0e8d6; }
    .jam-room-v2 .step-btn:hover:not(:disabled) { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); }
    .jam-room-v2 .jam-quickrow .mini-button { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); color: #f0e8d6; }@media (hover: hover) { .jam-room-v2 .jam-quickrow .mini-button:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); } }
    .jam-stage-room { cursor: pointer; }.jam-stage-room.is-static { cursor: default; }
    .jam-stage-room .gi-chevron { width: 13px; height: 13px; opacity: .72; }@media (hover: hover) { .jam-stage-room:hover { background: rgba(34,28,18,.72); border-color: rgba(240,232,214,.3); }   /* was rgba(18,26,34): cold slate hover */ }
    .jam-dock-actions .ghost-button { flex: 1 1 auto; min-height: 44px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #f0e8d6; --gb-fg: #f0e8d6; --gb-bg: rgba(255,255,255,.06); --gb-bd: rgba(255,255,255,.16); --gb-bg-hover: rgba(255,255,255,.14); --gb-bd-hover: rgba(255,255,255,.28); }
    .jam-dock-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .jam-dock-live small { color: rgba(240,232,214,.7); font-size: .78rem; }
    .jam-dock-live strong { color: #f0e8d6; }

    /* ---- Jam overhaul additions (song map, passcode, musician drawer, customize, join picker) ---- */
    /* Song map (console): clickable section track + explainer, or the single-groove prompt. */
    .jam-songmap { display: grid; gap: 8px; }
    .jam-songmap-track { display: flex; flex-wrap: wrap; gap: 6px; }
    .jam-segment { display: grid; gap: 1px; padding: 7px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #f0e8d6; cursor: pointer; text-align: left; min-height: 40px; transition: background var(--motion-ui) var(--ease-ui), border-color var(--motion-ui) var(--ease-ui); }
    .jam-segment small { color: rgba(240,232,214,.6); font-size: .68rem; font-weight: 700; }
    .jam-segment:hover:not(:disabled) { background: rgba(255,255,255,.12); }
    .jam-segment.is-current { background: var(--gold, #e7c266); color: #20160a; border-color: transparent; }
    .jam-segment.is-current small { color: rgba(32,22,10,.7); }
    .jam-segment:disabled { opacity: .5; cursor: default; }
    .jam-songmap-note { margin: 0; color: rgba(240,232,214,.66); font-size: .8rem; line-height: 1.4; }
    .jam-songmap.is-single { gap: 10px; }
    .jam-add-structure-btn { justify-self: start; }
    .jam-linkbtn { background: none; border: 0; padding: 0; color: var(--gold, #e7c266); font-weight: 800; font-size: .8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
    .jam-linkbtn:hover { color: #fff; }
    /* Host passcode row in the live session module. */
    .jam-passcode-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
    .jam-passcode-label { color: rgba(240,232,214,.66); font-size: .74rem; font-weight: 700; flex: 1 1 100%; }
    .jam-passcode-code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.15rem; font-weight: 850; letter-spacing: .16em; color: #ffd870; background: rgba(4,8,12,.5); padding: 4px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); }
    .jam-passcode-row .jam-linkbtn { margin-left: auto; }

    /* Musician drawer — simple by default, advanced behind a toggle. */
    .jam-role-head { display: flex; align-items: center; gap: 13px; }
    .jam-role-head h2 { font-size: 1.4rem; line-height: 1.1; }
    .jam-role-head p { color: var(--muted); }
    .jam-role-simple { display: grid; gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); margin: 14px 0 10px; }
    .jam-role-instruction { margin: 0; color: var(--ink); font-size: 1.05rem; line-height: 1.5; font-weight: 600; }
    .jam-role-quickactions { display: flex; flex-wrap: wrap; gap: 8px; }
    .jam-role-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 750; cursor: pointer; transition: border-color var(--motion-ui) var(--ease-ui), background var(--motion-ui) var(--ease-ui); }
    .jam-role-btn svg { width: 16px; height: 16px; }
    .jam-role-btn:hover { border-color: var(--teal); }
    .jam-role-btn.is-on { background: var(--teal); border-color: var(--teal); color: #fff; }
    .jam-role-btn-danger:hover { border-color: var(--rose); color: var(--rose); }
    .jam-role-advtoggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; color: var(--teal-deep, var(--teal)); font-weight: 800; font-size: .86rem; cursor: pointer; }
    .jam-role-advtoggle svg { width: 16px; height: 16px; transition: transform var(--motion-ui) var(--ease-ui); }
    .jam-role-advtoggle.is-open svg { transform: rotate(180deg); }
    .jam-role-advanced { display: grid; gap: 12px; margin-top: 4px; }
    .jam-role-levels { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .jam-role-levelbtns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .jam-role-level-now { font-weight: 800; color: var(--ink); }

    /* In-room Customize drawer. */
    .jam-cust-body { display: grid; gap: 13px; }
    .jam-cust-block { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .jam-cust-note { margin: 0; color: var(--soft); font-size: .88rem; line-height: 1.45; }
    .jam-cust-tempo { display: inline-flex; align-items: center; gap: 14px; }
    .jam-cust-tempo strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; min-width: 92px; text-align: center; }
    .step-btn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
    .step-btn:hover:not(:disabled) { border-color: var(--teal); }
    .step-btn:disabled { opacity: .4; cursor: default; }
    .jam-cust-section { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .jam-cust-sectype { flex: 1 1 110px; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 750; cursor: pointer; text-align: left; }
    .jam-cust-sectype:hover { border-color: var(--teal); }
    .jam-cust-bars { display: inline-flex; align-items: center; gap: 7px; }
    .jam-cust-bars > span { min-width: 52px; text-align: center; font-size: .82rem; color: var(--soft); }
    .jam-cust-bars .step-btn { width: 32px; height: 32px; font-size: 1.1rem; }
    .jam-cust-drawer .jam-linkbtn { color: var(--teal-deep, var(--teal)); }

    /* Join — instrument picker (taken / available, live). */
    .jam-join-insts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
    .jam-join-inst { display: grid; gap: 4px; justify-items: center; padding: 15px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; transition: border-color var(--motion-ui) var(--ease-ui), transform var(--motion-ui) var(--ease-ui); }
    .jam-join-inst:hover:not(.is-taken) { border-color: var(--teal); transform: translateY(-2px); }
    .jam-join-inst-ic svg { width: 26px; height: 26px; color: var(--teal-deep, var(--teal)); }
    .jam-join-inst-name { font-weight: 800; }
    .jam-join-inst-state { font-size: .74rem; font-weight: 750; color: var(--teal-deep, var(--teal)); }
    .jam-join-inst.is-taken { opacity: .55; cursor: not-allowed; }
    .jam-join-inst.is-taken .jam-join-inst-state { color: var(--muted); }
    .jam-passcode-input { text-transform: uppercase; letter-spacing: .22em; font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 800; }
    .jam-live-chip { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 850; }
    .jam-live-chip.on { color: #fff; background: var(--teal-deep, #14796a); }
    .jam-live-chip.connecting { color: #f0e8d6; background: rgba(255,255,255,.1); }
    .jam-live-chip.off { color: rgba(240,232,214,.7); border: 1px dashed rgba(255,255,255,.25); }

    /* Phones (portrait): keep the bottom console from eating the room (the scene SVG slices to
       fill whatever height the stage gets). */
    @media (max-width: 560px) {
      .jam-dock { max-height: 46vh; gap: 8px; padding-left: 12px; padding-right: 12px; }
      .jam-dock-chip strong { font-size: 1.45rem; }
      .jam-stage-now { font-size: .76rem; }
    }
    /* Landscape/desktop: console = full-height right rail; stage keeps the whole left. */
    @media (orientation: landscape) and (min-width: 640px) {
      .jam-room-v2 { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) clamp(296px, 32vw, 384px); }
      .jam-dock {
        max-height: none; height: 100%; align-content: start;
        border-top: 0; border-left: 1px solid rgba(255,255,255,.11);
        box-shadow: -18px 0 36px rgba(0,0,0,.42), inset 1px 0 0 rgba(255,255,255,.05);
        padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, #1a130a 0%, #0e0906 100%);
      }
      .jam-dock-transport { grid-template-columns: 1fr 1fr; grid-template-areas: "play play" "prev next"; gap: 8px; }
      .jam-dock-play { grid-area: play; min-width: 0; }
      .jam-dock-transport .jam-dock-section { justify-self: stretch; }
      .jam-dock-transport .jam-dock-section:first-child { grid-area: prev; }
      .jam-dock-transport .jam-dock-section:last-child { grid-area: next; }
      /* The handle becomes a vertical pull on the rail's left edge (arrow → collapses, ← expands). */
      .jam-rail-handle { left: auto; bottom: auto; top: 50%; right: clamp(296px, 32vw, 384px); transform: translate(50%, -50%); width: 24px; height: 60px; border-radius: 8px 0 0 8px; border: 1px solid rgba(255,255,255,.14); border-right: 0; box-shadow: -7px 0 18px rgba(0,0,0,.34); }
      .jam-rail-handle-ic svg { transform: rotate(-90deg); }
      /* Notch on the RIGHT in landscape: the safe-area inset keeps the handle tappable
         (owner 2026-07-11 iPhone pass). */
      .jam-room-v2.is-console-hidden .jam-rail-handle { right: env(safe-area-inset-right, 0px); top: 50%; transform: translate(0, -50%); }
      .jam-room-v2.is-console-hidden .jam-rail-handle-ic svg { transform: rotate(90deg); }
    }
    /* Wide desktop: a slightly roomier rail. */
    @media (orientation: landscape) and (min-width: 1180px) {
      .jam-room-v2 { grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 420px); }
      .jam-dock { padding: 16px 18px; gap: 11px; }
      .jam-room-v2:not(.is-console-hidden) .jam-rail-handle { right: clamp(340px, 26vw, 420px); }
    }
    /* STACKED desktop/iPad-portrait (narrow-but-tall): the tab's old seam was a GUESS (46vh)
       under an auto-height dock — it floated inside the scrolling panel (owner 2026-07-16).
       One shared height = a real seam; stage keeps ≥50vh. */
    @media (orientation: portrait) and (min-width: 701px) {
      .jam-room-v2 { --dockh: min(50vh, 480px); }
      .jam-dock { height: var(--dockh); max-height: none; padding-top: 14px; }
      .jam-rail-handle { bottom: var(--dockh); transform: translate(-50%, 0); }
    }

    /* Role/guidance drawer that layers OVER the room */
    .jam-drawer-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; background: rgba(16,12,6,.55); animation: jamDrawerFade var(--motion-ui) var(--ease-ui); }
    @keyframes jamDrawerFade { from { opacity: 0; } }
    .jam-drawer { width: min(440px, 92vw); height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--panel-strong); border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(16,12,6,.3); display: grid; grid-template-rows: auto 1fr; align-content: start; animation: jamDrawerIn var(--motion-ui) var(--ease-ui); }
    @keyframes jamDrawerIn { from { transform: translateX(26px); opacity: .55; } }

    /* First-time "How Jam works" overlay (P12) — a centered, dismissible intro over the room. */
    .jam-intro-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(16,12,6,.6); animation: jamDrawerFade var(--motion-ui) var(--ease-ui); }
    .jam-intro-card { width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: clamp(20px, 4vw, 30px); border-radius: 18px; border: 1px solid var(--line); background: var(--panel-strong); box-shadow: var(--shadow); }
    .jam-intro-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
    .jam-intro-card h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.12; margin-bottom: 14px; }
    .jam-intro-points { list-style: none; display: grid; gap: 12px; margin: 0 0 18px; padding: 0; }
    .jam-intro-points li { color: var(--soft); line-height: 1.45; }
    .jam-intro-points strong { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
    .jam-intro-points svg { width: 14px; height: 14px; color: var(--accent-2, var(--teal-deep)); flex: 0 0 auto; }
    .jam-intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    .jam-intro-actions .primary-button { flex: 1 1 auto; }
    .jam-intro-hint { margin-top: 12px; color: var(--muted); font-size: 0.82rem; }@media (prefers-reduced-motion: reduce) { .jam-intro-backdrop { animation: none; } }
    .jam-drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel-strong); }
    .jam-drawer-head-copy { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
    .jam-drawer-head-copy strong { color: var(--ink); font-size: 1.05rem; }
    .jam-drawer-body { padding: 16px; }
    .jam-drawer-body.jam-role-detail { max-width: none; gap: 14px; }
    .jam-drawer-body .jam-guidance-grid { grid-template-columns: 1fr; }
    .ghost-button.is-on { color: #fff; background: var(--teal); border-color: var(--teal); }
    .ghost-button.is-on:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
    /* NB (measured 2026-07-14, after getting it wrong once): --teal is gold on dark, s … (full note in git) */

    .jam-role-detail { max-width: 920px; display: grid; gap: 16px; }
    .jam-role-detail > header { display: flex; align-items: center; gap: 13px; }
    .jam-role-detail > header h2 { font-size: 1.65rem; }
    .jam-role-detail > header p { color: var(--muted); }
    .jam-guidance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .jam-guidance-grid article, .jam-section-guidance { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
    .jam-guidance-grid p, .jam-section-guidance p { color: var(--soft); line-height: 1.48; }
    .role-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2, var(--rose)); font-size: .7rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
    .role-kicker svg { width: 14px; height: 14px; }
    .jam-section-guidance > div { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
    .role-actions { display: flex; flex-wrap: wrap; gap: 8px; }

    .jam-join { max-width: 680px; display: grid; gap: 14px; padding: clamp(20px,4vw,34px); border: 1px solid var(--line); border-radius: 18px; background: var(--panel-strong); }
    .jam-join h2 { font-size: clamp(1.7rem,4vw,2.5rem); }
    .jam-join > p { color: var(--soft); line-height: 1.5; }
    .jam-join .field { max-width: 420px; }
    .jam-join-error { color: #a63b36 !important; font-weight: 750; }

    body[data-theme="dark"] .jam-setup-section, body[data-theme="dark"] .jam-guidance-grid article, body[data-theme="dark"] .jam-section-guidance, body[data-theme="dark"] .jam-join { background: var(--panel-strong); }@media (prefers-reduced-motion: reduce) {.jam-stage.is-live .jfig.is-active .jfig-art, .jam-stage.is-live .jfig.is-active .jfig-arm-fill, .jam-stage.is-live .jfig.is-active .jfig-stick, .jam-stage.is-live .jfig.is-active .jfig-glow, .jam-stage:not(.is-live) .jfig-art { animation: none; }.jfig:hover .jfig-art { transform: none; }
      .jam-drawer-backdrop, .jam-drawer { animation: none; }
    }@media (max-width: 760px) {
      .jam-hero, .jam-music-grid { grid-template-columns: 1fr; }
      .jam-hero { padding: 22px 18px; }
      .jam-player-edit { grid-template-columns: auto minmax(0,1fr) auto; align-items: center; }
      .jam-player-edit label:nth-of-type(2) { grid-column: 2 / -1; }
      .jam-player-edit .jam-status-chip, .jam-player-edit .mini-button { justify-self: start; }
      .jam-guidance-grid { grid-template-columns: 1fr; }
    }
    /* Role drawer becomes a bottom sheet on phones */
    @media (max-width: 620px) {
      .jam-drawer-backdrop { justify-content: stretch; align-items: flex-end; }
      .jam-drawer { width: 100%; height: min(86vh, 660px); border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px rgba(16,12,6,.32); animation: jamSheetIn var(--motion-ui) var(--ease-ui); }
      @keyframes jamSheetIn { from { transform: translateY(32px); opacity: .55; } }
    }@media (max-width: 520px) {
      .jam-hero-copy h2 { font-size: clamp(2rem,11vw,2.8rem); }
      .jam-primary-actions > button { flex-basis: 100%; }
      .jam-continue { align-items: stretch; flex-direction: column; }
      .jam-steps { gap: 4px; }
      .jam-step { font-size: .78rem; }
      .jam-player-edit { grid-template-columns: auto minmax(0,1fr); }
      .jam-player-edit label, .jam-player-edit label:nth-of-type(2) { grid-column: 2; }
      .jam-player-edit > button, .jam-player-edit > .jam-status-chip { grid-column: 2; }
      .jam-dir-grid { grid-template-columns: 1fr; }
      .jam-section-edit { grid-template-columns: 76px 1fr; }
      .jam-section-edit .jam-sec-name { grid-column: 1 / -1; }
      .jam-section-edit .jam-sec-controls { justify-self: end; }
      .jam-section-guidance > div { grid-template-columns: 1fr; gap: 4px; }
    }@media print { }

    /* ============================================================
       MY PRACTICE — skills, library filters, goals, journal.
       ============================================================ */
    /* One rhythm for every My Practice tab: a single column gap replaces the ad-hoc
       per-element margins that crowded the cards (P15). */
    .mp-body { margin-top: 8px; display: grid; gap: 18px; align-content: start; }
    .mp-body > * { margin-block: 0; }
    .mp-disclaimer { display: flex; align-items: flex-start; gap: 8px; color: var(--soft); font-size: 0.88rem; line-height: 1.45; padding: 12px 14px; border-radius: 8px; background: var(--bg-soft); margin-bottom: 14px; }
    .mp-disclaimer svg { width: 16px; height: 16px; color: var(--teal); flex: 0 0 auto; margin-top: 1px; }
    body[data-theme="dark"] .mp-disclaimer { background: rgba(255,255,255,0.04); }
    .skill-list { display: grid; gap: 9px; }
    .skill-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; }
    .skill-name { color: var(--soft); font-weight: 700; font-size: 0.9rem; }
    .skill-row small { color: var(--muted); font-size: 0.78rem; font-weight: 750; }@media (max-width: 560px) { .skill-row { grid-template-columns: 110px 1fr auto; } .skill-name { font-size: 0.82rem; } }
    .lib-toolbar { margin-bottom: 10px; }
    .lib-search { max-width: 420px; }
    .lib-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
    .lib-filter { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-strong); color: var(--soft); font-weight: 750; font-size: 0.84rem; cursor: pointer; }
    .lib-filter.is-active { border-color: var(--teal); background: rgba(176,112,31,0.1); color: var(--teal-deep); }
    body[data-theme="dark"] .lib-filter { background: var(--panel-strong); }
    .goal-list { display: grid; gap: 8px; margin-bottom: 12px; }
    .goal-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); }
    .goal-item span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; }
    .goal-item svg { width: 14px; height: 14px; color: var(--accent-2, var(--teal-deep)); }
    .goal-add { display: flex; gap: 8px; flex-wrap: wrap; }
    .goal-add .text-input { flex: 1 1 220px; }
    body[data-theme="dark"] .goal-item { background: var(--panel-strong); }
    .journal-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); margin-bottom: 8px; }
    .journal-q { font-weight: 800; color: var(--ink); }
    .journal-feels { display: flex; gap: 8px; flex-wrap: wrap; }
    .journal-text { resize: vertical; padding: 10px 12px; min-height: 52px; line-height: 1.45; }
    .journal-list { display: grid; gap: 8px; }
    .journal-entry { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); }
    .journal-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
    .journal-meta strong { color: var(--ink); font-size: 0.86rem; }
    .journal-feel { font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
    .journal-feel.feel-easy { color: var(--blue); background: rgba(86,104,138,0.12); }
    .journal-feel.feel-right { color: var(--teal-deep); background: rgba(176,112,31,0.12); }
    .journal-feel.feel-hard { color: var(--rose); background: rgba(216,109,100,0.12); }
    .journal-entry p { color: var(--soft); line-height: 1.45; font-size: 0.9rem; }
    .recent-list { display: grid; gap: 8px; }
    body[data-theme="dark"] .journal-card, body[data-theme="dark"] .journal-entry { background: var(--panel-strong); }
    .practice-next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: clamp(18px, 3vw, 26px); border: 1px solid rgba(176,112,31,0.32); border-radius: var(--radius); background: linear-gradient(135deg, rgba(176,112,31,0.13), rgba(86,104,138,0.06)); box-shadow: var(--shadow); }
    .practice-next-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-strong); color: var(--teal-deep); }
    .practice-next-icon svg { width: 20px; height: 20px; }
    .practice-next-copy { min-width: 0; display: grid; gap: 5px; }
    .practice-next-copy h3 { color: var(--ink); font-size: clamp(1.2rem, 2.4vw, 1.65rem); line-height: 1.15; }
    .practice-next-detail { color: var(--ink); font-weight: 750; overflow-wrap: anywhere; }
    .practice-next-reason { color: var(--soft); font-size: 0.9rem; line-height: 1.45; }
    .practice-next-when { color: var(--soft); font-weight: 700; text-transform: none; letter-spacing: 0; }
    /* Hero variant — the dominant "Continue where you left off" launchpad above the tabs. */
    .practice-next.is-hero { margin-bottom: 16px; border-color: rgba(176,112,31,0.5); background: linear-gradient(135deg, rgba(176,112,31,0.18), rgba(86,104,138,0.08)); box-shadow: var(--shadow); }
    .practice-next.is-hero .practice-next-icon { width: 54px; height: 54px; }
    .practice-next.is-hero h3 { font-size: clamp(1.35rem, 2.8vw, 1.9rem); }
    .practice-next.is-hero .primary-button { font-size: 1rem; padding-block: 13px; }
    .mp-tabs { scrollbar-width: thin; }
    .mp-tabs > button { white-space: nowrap; }
    .mp-secondary-actions { display: flex; flex-wrap: wrap; gap: 9px; }
    .mp-empty-stack { display: grid; gap: 12px; }
    .mp-empty strong { display: block; color: var(--ink); margin-bottom: 3px; }
    .mp-storage-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--bg-soft); color: var(--soft); font-size: 0.86rem; line-height: 1.45; }
    .practice-preferences { display: grid; gap: 14px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
    .practice-preferences h3 { color: var(--ink); font-size: 1.15rem; margin-top: 3px; }
    .mp-quick-goals { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }   /* breathing room between quick-add chips (owner 2026-07-12) */
    .progress-pill small { color: var(--muted); font-size: 0.85rem; font-weight: 700; }@media (max-width: 680px) {
      .practice-next { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
      .practice-next > .primary-button { grid-column: 1 / -1; width: 100%; }
      .practice-next-icon { width: 42px; height: 42px; }
      .mp-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
      .mp-secondary-actions > button { flex: 1 1 100%; }
    }
    /* Blank chord slot (post-Clear song): a dashed invitation that opens the chord editor. */
    .arr-chord-empty { border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); font-weight: 800; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
    .arr-chord-empty:hover { border-color: var(--teal-deep); color: var(--teal-text); }
    .arr-sec-play { font-size: 0.72rem; }
    /* Heart a jam: explicit keep — pinned + gold in the saved list. */
    /* Same heart as the deck's (owner 2026-07-12): one icon, one fill-when-saved treatment. */
    .jam-love-btn svg { width: 16px; height: 16px; }
    .jam-love-btn.is-loved { color: var(--gold); border-color: rgba(217,169,40,0.55); }
    .jam-love-btn.is-loved svg { fill: currentColor; }
    .lib-card.is-loved { border-color: rgba(217,169,40,0.45); border-left-color: var(--shelf-tint, rgba(217,169,40,0.45)); }
    /* One quiet purpose line at the top of a lesson — the "why this matters" framing. */
    .lesson-why { display: flex; align-items: flex-start; gap: 7px; margin: 2px 0 10px; padding: 10px 13px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--soft); font-size: 0.9rem; line-height: 1.45; }
    .lesson-why svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--teal-text); }
