/* =====================================================================
 * songbook.css  -  shared styles for the instrument-agnostic songbook
 * ---------------------------------------------------------------------
 * The dark-teal look, shared so any instrument tool
 * (ukulele, guitar, ...) renders identically. Fonts: Inter + Space Mono.
 * Palette is driven by CSS variables under :root  -  swap --accent etc. to
 * re-skin per instrument without touching component rules.
 *
 * This file styles the app shell, library, practice/detail, setlist,
 * perform mode, compose grid, chord diagrams, and the Tune tab. The host
 * page provides matching markup (see music/shared/README.md).
 * ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');
:root{
  --bg:#0d0f12;--bg-2:#14171c;--surface:#181b21;--surface-2:#1f232b;
  --line:#262b34;--line-strong:#323a45;
  --txt:#e8ebf0;--txt-soft:#b6bcc6;--txt-dim:#8a92a0;
  --accent:#5eead4;--accent-dim:#244b45;--accent-deep:#16302c;
  /* accent as TEXT/line (readable on the surface). Dark = the vivid accent; light darkens it. */
  --accent-ink:var(--accent);
  --glow:rgba(94,234,212,.06);
  /* translucent (frosted) surfaces - flip per theme */
  --appbar-bg:rgba(20,23,28,.85);--label-scrim:rgba(13,15,18,.72);
  --warn:#fbbf24;--bad:#f87171;--good:#5eead4;
  --shadow:rgba(0,0,0,.5);
  /* legacy aliases used by markup + inline JS */
  --paper:var(--bg);--paper-2:var(--surface);--paper-3:var(--surface-2);--paper-edge:var(--surface-2);
  --ink:var(--txt);--ink-soft:var(--txt-soft);--ink-faint:var(--txt-dim);
  /* --brass = the muted "label" highlight (section labels VERSE/CHORUS, the
     Hear-on-YouTube / Genius links, capo + meta dots). Tied to the theme accent so
     it RE-SKINS when the accent picker changes, and muted (mixed toward the dim text)
     so it reads as SECONDARY to the bright --accent chord highlights. The literal is
     the fallback for browsers without color-mix. */
  --brass:#7fb8ad;
  --brass:color-mix(in srgb, var(--accent) 62%, var(--txt-dim));
  --brass-soft:var(--accent);--red:var(--accent);--red-deep:var(--accent-dim);
  /* GUIDANCE surface for the Notables banner cards (.notableBanner below),
     distinct from --accent-deep/--accent-dim (the SELECTION-surface pair
     .listItem.inSet/.setUndo use). Computed off --txt-dim (a neutral,
     accent-INDEPENDENT hue) rather than --brass: --brass is itself an
     accent-mix, so at any accent hue its diluted tint converges back toward
     the accent-deep family once mixed into --surface-2 - too subtle to read
     as distinct. --txt-dim carries zero accent hue, so --guide-bg reads as
     "neutral app chrome", never "you selected this", at any accent color.
     Declared once here (not re-declared under the light override) - it
     recomputes per theme because --txt-dim/--surface-2/--line-strong already
     differ per theme. The .notableBanner left accent stripe (var(--brass))
     supplies the branded touch instead, since a 3px stripe carries no
     text-contrast obligation. */
  --guide-bg:color-mix(in srgb, var(--txt-dim) 16%, var(--surface-2));
  --guide-line:color-mix(in srgb, var(--txt-dim) 55%, var(--line-strong));
  /* The ".sounding" marker on a scale-audition note/degree token - a THIRD
     surface, distinct from both --accent-deep/--accent-dim (SELECTION) and
     --guide-bg/--guide-line (GUIDANCE). A violet hue carries no existing app
     semantic: not the teal --accent (selection), not the neutral guidance
     chrome, and deliberately NOT mixed from --warn/--bad/--good (the fixed
     tuner/status colors - reusing one would risk "sounding" reading as a
     tuner warning). Declared per-theme as literal hex (like --accent-dim/
     --accent-deep below), not a color-mix formula, because a fresh hue has no
     per-theme-varying base to auto-derive from. Contrast >=4.5:1 both themes.
     Guarded by test/consistency-lint.test.js. */
  --sound-bg:#3a2f57;--sound-line:#b39ddb;
  /* text/icon placed ON an --accent fill (dark, legible on EVERY accent incl.
     light ones like amber/coral) - same in light + dark. Must be a literal, not
     var(--on-accent): a self-reference resolves empty and falls back to inherited
     --txt (dark in light theme, but WHITE in dark theme -> illegible on a light accent). */
  --on-accent:#06201c;
  --on-danger:#fff;
  /* Perform 'stage' palette: fixed warm-amber-on-black teleprompter look; does NOT follow the app theme. */
  --stage-bg:#000;--stage-panel:#141414;--stage-panel-2:#1c1c1c;
  --stage-line:#333;--stage-line-soft:#444;
  --stage-ink:#f0ead8;--stage-ink-soft:#cfc9b8;--stage-ink-dim:#bbb;
  --stage-amber:#ffce6a;--stage-on-amber:#000;
  /* Frosted scrim for a control that sits directly over scrolling stage
     content (the dim-mode counterpart to --appbar-bg, which follows the app
     theme and isn't legible against the fixed black stage). */
  --stage-scrim:rgba(0,0,0,.55);
  --video-bg:#000;
  /* chord-diagram (diagram.js SVG) structural colors - flip per theme */
  --dg-grid:#3a4150;--dg-nut:#e8ebf0;--dg-base:#9aa3b2;
  --dg-dot:#2a3340;--dg-dot-line:#4b5563;--dg-note:#cbd5e1;
  --dg-mute:#7a8294;--dg-fret-lbl:#6b7280;
}

/* ===== Radius token block (SSOT for border-radius by semantic role) =====
 * These five tokens are the single source for radius BY SEMANTIC ROLE - a
 * component of one of these roles must consume the var, never a re-hardcoded
 * literal. Guarded by test/consistency-lint.test.js. Radius doesn't flip
 * light/dark, so ONE bare block. Values are the per-role majority across
 * existing consumers (e.g. --r-card is 13px because most card-shaped consumers
 * already agree on 13; --r-chip-pill is 18px, the .chip primitive's value,
 * over the narrow 16px clones).
 * Scope: covers button, pill-chip, and card radii. Deliberately NOT applied to
 * chord-diagram tiles (their own geometry domain), modal/overlay boxes (14-16px
 * is their own accepted range), or text-input radii beyond the one consumer
 * that already matched (9-12px is an accepted range for .search/.bt-in, not a
 * scatter). */
:root{
  --r-btn:11px;       /* primary/secondary buttons + segmented-control CONTAINERS (.modeSwitch/.viewToggle/.transposeChip) */
  --r-btn-sm:10px;    /* icon/compact buttons + segmented-control INNER buttons */
  --r-chip-pill:18px; /* pill-shaped chip/token controls (the .chip family primitive) */
  --r-card:13px;      /* card/panel surfaces incl. .listItem (NOT modals/overlays - those stay their own 14-16px range) */
  --r-input:10px;     /* text-input controls (see scope note above: not force-applied to every input) */
}

/* Light theme  -  <html data-theme="light"> (set at boot by the Settings
 * Auto/Light/Dark control). Only FLIPPING tokens are overridden; the accent
 * family + --accent-ink re-derive per theme in JS (applyAccent). Stage +
 * on-accent stay fixed. Tuner status (--warn/--bad/--good) stay fixed too. */
:root[data-theme="light"]{
  --bg:#eef1f4;--bg-2:#e3e8ee;--surface:#ffffff;--surface-2:#f2f5f8;
  --line:#d6dce3;--line-strong:#bcc5cf;
  --txt:#161b22;--txt-soft:#3f4854;--txt-dim:#5f6875;
  --shadow:rgba(20,30,45,.14);--glow:rgba(13,148,136,.05);
  --accent-dim:#bfe6df;--accent-deep:#e7f6f2;--accent-ink:#0f766e;
  /* Light-theme override of the --sound-* pair declared in the bare :root
     block above (same reasoning; see that comment). */
  --sound-bg:#efe7fb;--sound-line:#6a4bc4;
  --dg-grid:#aab4c0;--dg-nut:#2b3440;--dg-base:#5f6875;
  --dg-dot:#dfe6ee;--dg-dot-line:#9aa7b5;--dg-note:#334155;
  --dg-mute:#7a8494;--dg-fret-lbl:#6b7686;
  --appbar-bg:rgba(238,241,244,.82);--label-scrim:rgba(238,241,244,.82);
}
:root[data-theme="light"] body{-webkit-font-smoothing:auto;}

/* =====================================================================
 * The --sound-bg/--sound-line pair re-derived from the user's OWN accent
 * hue via CSS Relative Color Syntax, complementary (h + 180) - the one
 * class needing MAXIMUM perceptual distance from every other accent-derived
 * hue, since "sounding" marks a transient playing-right-now state, not a
 * persistent theory class. Feature-detected: the literal hex pair declared
 * above (both bare :root and the light override) is the fallback for
 * browsers without support - nothing above this block changes.
 *
 * L/C are pinned per theme (not derived from --accent's own L/C - see
 * tracks.css's matching comment for the rationale), chosen to land close to
 * the pre-existing literal figures. Verified at the default teal accent and
 * a hue-changed accent, not against every possible user-chosen hue. */
@supports (color: oklch(from red l c h)) {
  :root{
    --sound-bg:oklch(from var(--accent) 0.22 0.06 calc(h + 180));
    --sound-line:oklch(from var(--accent) 0.72 0.10 calc(h + 180));
  }
  :root[data-theme="light"]{
    --sound-bg:oklch(from var(--accent) 0.93 0.03 calc(h + 180));
    --sound-line:oklch(from var(--accent) 0.42 0.18 calc(h + 180));
  }
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;margin:0;padding:0;}
html,body{height:100%;overflow:hidden;}
body{font-family:'Inter',sans-serif;color:var(--txt);background:var(--bg);
  background-image:radial-gradient(1100px 360px at 50% -8%,var(--glow),transparent 70%);
  -webkit-font-smoothing:antialiased;}
.app{display:flex;flex-direction:column;height:100dvh;max-width:540px;margin:0 auto;position:relative;}
/* Slim header GRID -
     row 1: Music [tab pill]            | gear
     row 2: per-tab purpose line        | (gear spans both rows, right)
   The gear anchors the right edge across both rows so the header reads as
   one block; the purpose line lives under the brand only, never under it. */
.appbar{flex:0 0 auto;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto;align-items:center;column-gap:10px;row-gap:3px;padding:calc(max(env(safe-area-inset-top,0px), 8px) + 8px) 14px 8px;border-bottom:1px solid var(--line);background:var(--appbar-bg);backdrop-filter:blur(8px);z-index:10;}
.appbar .brand{grid-column:1;grid-row:1;}
.appbar .tabPurpose{grid-column:1;grid-row:2;}
.appbar #settingsBtn{grid-column:2;grid-row:1 / span 2;justify-self:end;align-self:center;}
.tabPill{flex:0 0 auto;background:var(--accent-deep);color:var(--accent-ink);border:1px solid var(--accent-dim);border-radius:var(--r-chip-pill);padding:3px 10px;font-size:.68rem;font-weight:700;letter-spacing:.04em;}
.tabPurpose{margin:0;font-size:.72rem;color:var(--txt-dim);line-height:1.35;min-height:1em;}
.tabPurpose:empty{display:none;}
.appbar .brand{display:flex;align-items:center;line-height:1;gap:8px;min-width:0;}
.appbar .brand .nm{font-weight:800;font-size:1.02rem;letter-spacing:-.02em;}
/* Quiet connectivity status in the appbar - amber (the app's one warn accent)
   because it's a heads-up, not an error; the app keeps working offline.
   [hidden] wins the display cascade. */
.offlinePill[hidden]{display:none;}
.offlinePill{align-self:flex-start;font-size:.6rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--warn);border:1px solid var(--warn);border-radius:6px;padding:1px 6px;}
/* 44px, not 40 (issue #311): this is a real control in the app bar and the
   floor applies to it like any other. The 4px comes out of the bar's own
   padding, never off the target. */
.ab-btn{width:44px;height:44px;border:1px solid var(--line-strong);background:var(--surface-2);border-radius:var(--r-btn);font-size:1.25rem;color:var(--accent-ink);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .08s,background .15s,border-color .15s;}
.ab-btn:active{transform:scale(.9);background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
.view{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;padding:16px 14px 20px;scroll-behavior:smooth;}
.view::-webkit-scrollbar{width:0;}
.tabbar{--tabbar-pb:calc(max(env(safe-area-inset-bottom,0px), 8px) + 6px);flex:0 0 auto;display:flex;gap:2px;padding:6px 6px var(--tabbar-pb);background:var(--bg-2);border-top:1px solid var(--line);}
/* PLAYER-FEEL v5 (UAT 2026-08-08, "can see rows behind above now playing"):
   while the Studio SHEET is expanded (body.studioopen, tracks.js dispatch),
   the sheet is FULL-inset (nothing leaks through around the bar) and the
   tabbar paints ABOVE it instead - z-55 sits over the sheet (50) and under
   every real modal (perform 60, invModal 70, edit form 75), so tabs stay
   visible + tappable exactly as before and full-screen modals still cover
   them. Scoped to the body class - the app's normal stacking is untouched. */
body.studioopen .tabbar{position:relative;z-index:55;}
.tabbar button{flex:1;border:none;background:transparent;cursor:pointer;padding:6px 4px;border-radius:var(--r-btn-sm);display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--txt-dim);transition:color .15s,background .15s,transform .08s;}
.tabbar button:active{transform:scale(.92);}
/* Active tab highlight reclaims ONLY the safe-area slack below it, so the pill
   ends up with the SAME ~6px inset on the bottom as on the top and sides -
   symmetric margin, not flush to the screen edge. The tabbar's bottom padding
   is max(safe-area, 8px) + 6px; we pull the pill down by the max(safe-area,
   8px) slack only, leaving the +6px to match the top/side margin. Content
   stays put (padding-bottom absorbs the reclaimed space); corners stay fully
   rounded (it is an inset pill, not an edge-anchored tab). */
.tabbar button.on{color:var(--accent-ink);background:var(--accent-deep);margin-bottom:calc(-1 * max(env(safe-area-inset-bottom,0px), 8px));padding-bottom:calc(6px + max(env(safe-area-inset-bottom,0px), 8px));}
.tabbar button .icn{font-size:1.28rem;line-height:1;}
.tabbar button .lbl{font-size:.6rem;letter-spacing:.06em;text-transform:uppercase;font-weight:800;}
.screen{display:none;}
.screen.on{display:block;animation:fadeUp .26s cubic-bezier(.2,.7,.3,1);}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:none;}}
.searchWrap{position:relative;margin-bottom:11px;}
.search{width:100%;background:var(--surface);border:1px solid var(--line-strong);border-radius:12px;padding:12px 40px 12px 14px;font-family:inherit;font-size:.92rem;color:var(--txt);}
.search::placeholder{color:var(--txt-dim);}
.search:focus{outline:none;border-color:var(--accent-ink);}
/* clear (x) button - shown only when the search field has text (toggled in JS via [hidden]) */
.searchClear{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:26px;height:26px;display:flex;align-items:center;justify-content:center;border:none;border-radius:50%;background:transparent;color:var(--txt-dim);font-size:.85rem;line-height:1;cursor:pointer;padding:0;}
.searchClear:hover{color:var(--txt);background:var(--surface-2);}
.searchClear[hidden]{display:none;}
.chips{display:flex;gap:6px;overflow-x:auto;margin-bottom:14px;padding-bottom:3px;scrollbar-width:none;touch-action:pan-x;}
.chips[hidden]{display:none;}
.chips::-webkit-scrollbar{display:none;}
/* Horizontal-scroll affordance (scroll-hint.js). An opted-in strip lives in a
   .chipScrollWrap; the JS toggles .can-l / .can-r on the wrapper by scroll
   position. Each active edge shows a fade (blends to --bg, the strip's real
   backdrop, so it reads in both themes) + a double-chevron pointing the way
   more chips sit. The overlay is a wrapper child ABOVE the scroller
   (pointer-events:none) - a background on .chips itself would paint behind the
   chip children. The wrapper carries the strip's 14px bottom margin so the
   overlay spans exactly the chip row (chevron stays vertically centred). */
.chipScrollWrap{position:relative;margin-bottom:14px;}
.chipScrollWrap > .chips{margin-bottom:0;}
/* Tight variant: the scroller supplies its own spacing (e.g. the Compose
   starter row inside #suggest) - the wrapper adds none. */
.chipScrollWrap--tight{margin-bottom:0;}
.chipScrollWrap:has(> .chips[hidden]){display:none;}
/* Tappable: an active edge is a 44px hit target (a11y floor) that snap-scrolls
   the strip to that end - AND, by capturing the tap, shields the partially
   off-screen chip beneath it from a mis-tap (the UAT: tapping the edge used to
   pass through and select a chip you couldn't fully see). Inactive edges are
   pointer-events:none so an extreme never eats a tap. Hit area extends 6px
   above/below the row (top/bottom:-6px) into empty gutter to reach 44px tall
   without a taller visual; the chevron stays centred on the row. */
.csh{position:absolute;top:-6px;bottom:-6px;width:44px;z-index:2;pointer-events:none;display:flex;align-items:center;opacity:0;transition:opacity .15s;-webkit-tap-highlight-color:transparent;}
.csh::after{content:"";width:14px;height:22px;background:center/14px 22px no-repeat;}
.csh-l{left:0;justify-content:flex-start;padding-left:1px;background:linear-gradient(to right,var(--bg) 22%,transparent 68%);}
.csh-r{right:0;justify-content:flex-end;padding-right:1px;background:linear-gradient(to left,var(--bg) 22%,transparent 68%);}
.csh-l::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='22' viewBox='0 0 14 22'%3E%3Cpath d='M11 3l-5 8 5 8M7 3l-5 8 5 8' fill='none' stroke='%23808a96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}
.csh-r::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='22' viewBox='0 0 14 22'%3E%3Cpath d='M3 3l5 8-5 8M7 3l5 8-5 8' fill='none' stroke='%23808a96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}
.chipScrollWrap.can-l .csh-l,.chipScrollWrap.can-r .csh-r{opacity:1;pointer-events:auto;cursor:pointer;}
/* The 44px tap-target floor lives on the PRIMITIVE (issue #311). It used to
   be applied surface by surface (.keyModes, .keySoloScale, #catChips each
   carried their own copy), so any chip row nobody remembered - the Library
   key and genre filters - shipped at 30px. Measured 37-58 x 30 at 412x915;
   the narrowest (E, F at 37x30) missed on both axes. Putting the floor here
   fixes every chip surface at once and makes the next one correct by
   default. inline-flex + centering keeps the label optically centred in the
   taller box. */
.chip{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;flex:0 0 auto;border:1px solid var(--line-strong);background:transparent;color:var(--txt-soft);font-family:inherit;font-weight:600;font-size:.74rem;padding:7px 14px;border-radius:var(--r-chip-pill);cursor:pointer;letter-spacing:.02em;transition:background .15s,color .15s,border-color .15s,transform .08s;}
.chip:active{transform:scale(.94);}
.chip.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* Library head row: search (flex) + the +Add entry point, one row. */
.libSearchRow{display:flex;align-items:center;gap:8px;margin-bottom:11px;}
.libSearchRow .searchWrap{flex:1 1 auto;min-width:0;margin-bottom:0;}
.libTracks[hidden]{display:none;}
/* Library scroll model: search + facet chips stay pinned; the song list is the
   ONLY scroll container (same flat single-scroller pattern as Compose - no
   nested scroll traps). .screen.on is display:block by default, so the flex
   column is scoped to the library screen's own .on state. */
#s-library{height:100%;}
#s-library.on{display:flex;flex-direction:column;}
.libSearchRow,#genreChips,#keyChips{flex:0 0 auto;}
.libSongs{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:auto;}
.libSongs::-webkit-scrollbar{width:0;}
/* ===== Unified Library list item (SSOT - music/shared/list-item.js) =====
 * One element + one class for Songs / Tracks / Set. The three list containers
 * stack items identically; per-segment differences are only the leading number
 * (set), the trailing affordance (add vs reorder/remove), and the action label. */
.songs,.bt-results,#setBody{display:flex;flex-direction:column;gap:9px;}
.listItem{position:relative;display:flex;align-items:flex-start;gap:11px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);padding:13px 14px;cursor:pointer;transition:transform .08s,border-color .15s,background .15s;}
.listItem:active{transform:scale(.99);background:var(--surface-2);}
.listItem.inSet{border-color:var(--accent-dim);background:var(--accent-deep);}
/* Setlist drag-to-reorder (wireSetlistDrag) - the vertical mirror of the
   section-card drag markers (.songSect.dragging/.dropBefore/.dropAfter). A
   VERTICAL list, so the insertion edge is TOP (before) / BOTTOM (after), not
   left/right. Only setlist rows ever get these classes (added by the drag). */
.listItem.dragging{opacity:.45;}
.listItem.dropBefore{box-shadow:0 -3px 0 0 var(--accent-ink);}
.listItem.dropAfter{box-shadow:0 3px 0 0 var(--accent-ink);}
/* Every draggable surface opts OUT of text selection + the long-press callout,
   so a hold cleanly becomes a lift instead of triggering Android text-selection
   (the "Copy / Share / Select all" bubble), which can swallow the drag. NOT
   touch-action:none (that would kill the pre-lift scroll); selection only. */
.prog .slot, .songSect, .listItem{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;}
/* A brief accent pulse on the row a save just landed on, so it's findable in a
   long/scrolled library list. Fades on its own (no JS cleanup needed) - never
   blocks interaction, never persists. */
@keyframes justSavedPulse{from{box-shadow:0 0 0 2px var(--accent);}to{box-shadow:0 0 0 2px transparent;}}
.listItem.justSaved{animation:justSavedPulse 2s ease-out;}
/* UAT 2026-08-08 (batch 4): the leading DETAILS chip - a clear fixed-width tap
   target on every row now that a body tap PLAYS. Holds the setlist number
   (.li-num, nested - same look) when the row has one, an info glyph when it
   doesn't; fixed width means set-membership changes swap content, never
   layout (no row reflow). 44px tap floor (a11y). */
.listItem .li-lead{flex:0 0 auto;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;
  padding:0 4px;border:1px solid var(--line);background:var(--surface-2);border-radius:var(--r-btn-sm);
  cursor:pointer;font-family:inherit;color:var(--txt-soft);}
.listItem .li-lead:active{transform:scale(.95);}
.li-lead-gl{line-height:0;color:var(--txt-soft);}
.listItem .li-num{font-family:'Space Mono',monospace;font-weight:700;font-size:1.15rem;color:var(--accent-ink);flex:0 0 auto;line-height:1.3;}
.listItem .li-body{flex:1 1 auto;min-width:0;}
.listItem .li-row1{display:flex;justify-content:space-between;align-items:baseline;gap:14px;}
/* Title sized for the arm's-length <1s glance; meta + artist on --txt-soft and
 * bumped up for legibility at distance. */
/* min-width:0 + overflow-wrap:break-word - .li-title is a flex item of .li-row1,
 * and its default automatic-minimum-size (min-content, the width of its longest
 * unbroken word) can exceed the row's available space for a long/unspaced title,
 * overflowing past the card and behind the + button instead of wrapping. .li-body
 * already carries flex:1 1 auto;min-width:0 (the row-level containment) - this is
 * the same fix one level deeper, on the title span itself.
 * Round 5 (operator: "prevent vertical height growth for longer songs"): the
 * title CLAMPS at 2 lines with an ellipsis - a playlist-import title like
 * "Down With Disease (Jam) >> Backing Track >> ..." caps the row instead of
 * growing it; the full title lives one tap away in the details view. */
.listItem .li-title{font-weight:700;font-size:1.12rem;line-height:1.16;letter-spacing:-.01em;min-width:0;overflow-wrap:break-word;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
/* Setup pair (capo + key) live together, right of the title. Key is KEY-FIRST; an
 * unknown key shows a quiet "Key?" rather than a year (which read as the key). */
.listItem .li-tags{display:flex;align-items:baseline;gap:6px;flex:0 0 auto;}
.listItem .li-tag{font-family:'Space Mono',monospace;font-weight:700;color:var(--accent-ink);font-size:.82rem;flex:0 0 auto;}
.listItem .li-tag.isKeyUnknown{color:var(--txt-dim);font-weight:400;}
.listItem .li-capo{font-family:'Space Mono',monospace;font-weight:700;font-size:.72rem;color:var(--brass);background:var(--accent-deep);border:1px solid var(--accent-dim);padding:1px 6px;border-radius:6px;flex:0 0 auto;}
.listItem .li-artist{font-size:.79rem;color:var(--txt-soft);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.listItem .li-note{display:inline-block;margin-top:6px;font-family:'Space Mono',monospace;font-size:.68rem;color:var(--accent-ink);background:var(--accent-deep);border:1px solid var(--accent-dim);padding:3px 7px;border-radius:6px;}
.listItem .li-meta{display:flex;gap:8px;flex-wrap:nowrap;overflow:hidden;margin-top:8px;font-size:.78rem;color:var(--txt-soft);align-items:center;}
.listItem .li-meta:empty{display:none;margin-top:0;}
.listItem .li-meta .dot{width:4px;height:4px;background:var(--brass);border-radius:50%;flex:0 0 auto;}
/* The per-row play action retired (round 5): a body tap plays, the leading
   chip carries the equalizer - the 44px slot goes back to the title. */
/* Emphasis ladder: the resting + is a per-row SECONDARY affordance repeated down
   the whole list, so its glyph is neutral (--txt-soft) - it stops the list reading
   as a column of accent circles competing with the song titles. Accent is reserved
   for the .inSet state below (a real selection: "this song is in your set"). */
/* 44px = the a11y tap-target floor. The glyph is a TEXT character ('+' /
   '\2713'), and text centers by its LINE BOX, not its ink - the font hangs
   descender space below the glyph, so pure flex-centering paints it visibly
   HIGH. The 2.5px top pad is the optical correction that lands both glyphs
   dead-center. Don't "clean up" the fraction - line-box snapping quantizes in
   whole-px steps and 2.5 sits mid-plateau for both glyphs. */
.listItem .li-add{flex:0 0 auto;width:44px;height:44px;border-radius:50%;border:1px solid var(--line-strong);background:transparent;color:var(--txt-soft);font-size:1.5rem;line-height:1;padding:2.5px 0 0 0;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .08s,background .15s,color .15s,border-color .15s;}
.listItem .li-add:active{transform:scale(.85);}
/* Ghost add: the row CAN'T join the set (no chord sheet) - state it quietly
   instead of an empty slot that reads as broken. Dashed + faint, still a 44px
   tappable target (explains via toast). */
.listItem .li-add.ghost{border-style:dashed;color:var(--txt-dim);opacity:.6;}
.listItem.inSet .li-add{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* li-up/li-dn: the setlist reorder a11y fallback (S-SETLIST-GESTURES, below -
 * .li-a11yctrl keeps them out of the sighted-pointer view since press-and-hold
 * covers that case). .li-ctrl (the old edit-mode stacked-column wrapper) is
 * unused now - these render as flat siblings. NOTE: 40x32, below the 44px
 * floor - a pre-existing gap this mission did not introduce or grow (tracked
 * separately; the buttons are keyboard-reachable, not a new tap surface). */
.listItem .li-up,.listItem .li-dn{border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt-soft);width:40px;height:32px;border-radius:7px;cursor:pointer;font-size:.8rem;line-height:1;font-family:'Space Mono';font-weight:700;transition:background .15s,transform .08s,color .15s;}
.listItem .li-up:active,.listItem .li-dn:active{transform:scale(.9);background:var(--accent);color:var(--on-accent);}
.listItem .li-up:disabled,.listItem .li-dn:disabled{opacity:.3;cursor:default;}
/* >=44x44 via padding (NOT a bigger glyph - the "x" stays font-size:1.2rem).
 * min-width/min-height set the deterministic floor; padding keeps the glyph from
 * crowding the larger border box. */
.listItem .li-rm{flex:0 0 auto;border:1px solid var(--line);background:transparent;color:var(--txt-dim);font-size:1.35rem;cursor:pointer;padding:2px;min-width:44px;min-height:44px;border-radius:8px;align-self:center;margin-left:4px;transition:color .15s,transform .08s,border-color .15s;}
.listItem .li-rm:active{transform:scale(.9);color:var(--bad);border-color:var(--bad);}
/* The setlist remove handle follows the app's ONE inline-remove grammar: QUIET
 * at rest, red only when ARMED by a first tap (1.6s auto-disarm, gate lives in
 * list-item.js), second tap removes. Red on an inline handle reads as
 * already-armed, so red-at-rest belongs only to labeled destructive BUTTONS
 * (.btn.danger), never an inline handle at rest. S-SETLIST-GESTURES layers
 * .li-a11yctrl on TOP of this (below) - the arm grammar is unchanged, only
 * reachable by keyboard/SR now that the swipe covers the pointer case. */
.listItem .li-rm.armed{background:var(--bad);border-color:var(--bad);color:var(--on-danger);}
.listItem .li-edit{flex:0 0 auto;width:40px;height:40px;border:1px solid var(--line);background:transparent;color:var(--txt-dim);border-radius:8px;cursor:pointer;font-size:.95rem;align-self:center;}
/* S-SETLIST-GESTURES a11y fallback (WCAG 2.5.1 - a pointer-gesture-only
 * action needs a non-gesture equivalent): li-up/li-dn/li-rm stay in the DOM,
 * the tab order, and the SR tree for every set row, but are visually
 * QUIET at rest - the same "skip link" reveal-on-focus trick as a page's
 * accessible skip-nav link. A sighted mouse/touch user, who has the gesture,
 * never sees them; Tab (or a screen reader's own navigation, which does not
 * care about the visual state) reaches them exactly as before. */
/* min-width/min-height:0 is load-bearing, not decoration: .li-rm's OWN rule
 * sets min-width/min-height:44px for its normal tap-target floor, and
 * min-* always wins over a SMALLER width/height regardless of which rule
 * the cascade picks for that property - without the override here the box
 * still rendered (and painted) at 44x44 through the clip, peeking out from
 * under .li-inner's edge (caught by the setlist-gestures pw scenario). */
.listItem .li-a11yctrl{position:absolute;width:1px;height:1px;min-width:0;min-height:0;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
/* On focus: restore each control's OWN real size (not a shared guess). CSS
 * `revert` looks like the right tool here but is NOT - it skips every other
 * AUTHOR rule (li-up/li-dn's 40x32, li-rm's 44px floor) straight to the
 * user-agent default, landing on the button's bare shrink-to-fit content
 * width (~13px, caught by the setlist-gestures pw scenario) instead of
 * either control's real size. Naming each size explicitly is the fix. */
.listItem .li-up.li-a11yctrl:focus,.listItem .li-dn.li-a11yctrl:focus{position:static;width:40px;height:32px;min-width:0;min-height:0;margin:0;overflow:visible;clip:auto;white-space:normal;}
.listItem .li-rm.li-a11yctrl:focus{position:static;width:auto;height:auto;min-width:44px;min-height:44px;margin:0;overflow:visible;clip:auto;white-space:normal;}
/* S-SETLIST-GESTURES swipe shell (operator UAT 2026-09-03, "like outlook and
 * Gmail mobile"): .li-inner carries the row's real look (background/border/
 * padding, moved down from .listItem) and is the piece that TRANSLATES; the
 * now-transparent .listItem is just its positioning frame, so .li-swipe-bg
 * (a same-size danger underlay, painted first = behind in DOM order) stays
 * fixed and is revealed as .li-inner slides off it - the underlay is never
 * itself part of the moving layer. touch-action:pan-y lets the browser keep
 * native (fast, uncontested) vertical list-scrolling; only X-axis pointer
 * movement is left for wireSetlistDrag's own directional lock to claim.
 * flex-shrink:0 (UAT 2026-09-17, "setlist rows get stuck with a set height
 * switching tabs"): #setBody is itself a flex COLUMN (songbook.css above)
 * with a bounded height (overflow-y:auto), so its row children are flex
 * items. Per the flexbox spec, a flex item's automatic minimum main size
 * collapses to 0 when its own `overflow` isn't `visible` - and this rule
 * sets overflow:hidden. Once the setlist grows past what fits on screen,
 * that 0-floor let every row get flex-SHRUNK (not scrolled) to fit, and
 * overflow:hidden then clipped the now-too-tall content - rows looked
 * "stuck" at a smaller height with overlapping text. It was never about
 * switching tabs or a stale render; a fresh render with enough songs to
 * overflow showed it immediately (repro: any setlist over ~7 short rows on
 * a phone viewport). Plain All/Jams rows never had `overflow:hidden`, so
 * they never hit this floor and always scrolled correctly, which is why
 * only the Setlist view was affected. flex-shrink:0 pins each row to its
 * own content height so #setBody scrolls instead of squeezing rows. */
.listItem.swipeable{background:transparent;border:0;padding:0;overflow:hidden;flex-shrink:0;}
/* flex:1 1 auto is load-bearing: .li-inner is the outer .listItem's (still
 * display:flex, row axis) ONE in-flow flex item - without an explicit grow
 * it hugs its own content width instead of filling the row, leaving the
 * .li-swipe-bg underlay peeking out along the trailing edge even at rest
 * (caught by the setlist-gestures pw scenario's own screenshots). */
.listItem.swipeable .li-inner{display:flex;flex:1 1 auto;align-items:flex-start;gap:11px;background:var(--surface);border:1px solid var(--line);border-radius:inherit;padding:13px 14px;position:relative;touch-action:pan-y;transform:translateX(var(--swipe-x,0px));}
.listItem.swipeable.swipe-anim .li-inner{transition:transform .18s ease-out;}
/* .listItem.dragging{opacity:.45} (above) still fades a lifted set row whole
 * - opacity on the (transparent) shell composites its children too, so the
 * reorder-lift fade needs no swipeable-specific override. */
.listItem .li-swipe-bg{position:absolute;inset:0;border-radius:var(--r-card);background:var(--bad);display:flex;align-items:center;justify-content:space-between;padding:0 22px;}
.listItem .li-swipe-ico{font-size:1.3rem;font-weight:700;color:var(--on-danger);opacity:.55;transform:scale(.85);transition:opacity .12s,transform .12s;}
.listItem.swipeable.swipe-commit .li-swipe-ico{opacity:1;transform:scale(1.05);}
/* Timed toast+action undo banner - shared skin for the setlist item-remove undo
 * (showSetUndoBanner) and the Library delete-undo (showDeleteUndoBanner), both
 * toggled via the DOM hidden attribute from JS. */
.setUndo{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--accent-deep);border:1px solid var(--accent-dim);border-radius:11px;padding:9px 12px;margin-bottom:9px;font-size:.82rem;color:var(--txt-soft);}
/* .setUndo{display:flex} is an AUTHOR-origin rule, which always outranks the
 * user-agent's [hidden]{display:none} regardless of specificity (origin is
 * resolved before specificity in the cascade) - so without this explicit
 * override, setting el.hidden = true has ZERO visual effect and the emptied host
 * stays on screen as a visible, empty pill. Same guard as .composeToast[hidden]
 * below. */
.setUndo[hidden]{display:none;}
/* Edit-set toggle: ghost button that lights up accent when editing. */
#setEdit.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
.empty{text-align:center;color:var(--txt-dim);padding:36px 16px;font-size:.92rem;}
/* One-tap key-filter clearing link inside the zero-results empty state. */
.empty .emptyClear{display:block;margin:12px auto 0;border:1px solid var(--accent-dim);background:var(--accent-deep);color:var(--accent-ink);font-family:inherit;font-weight:600;font-size:.82rem;padding:10px 18px;border-radius:var(--r-btn);cursor:pointer;transition:transform .08s,background .15s,color .15s;}
.empty .emptyClear:active{transform:scale(.96);background:var(--accent);color:var(--on-accent);}
.libCount{text-align:center;color:var(--txt-dim);font-size:.72rem;margin-top:16px;letter-spacing:.04em;}

/* Song-detail panel uses the card radius token (--r-card). */
.detail{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);padding:16px;}
.detailHead{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:13px;}
/* Back = arrow ONLY, but PROMINENT (operator UAT: a labeled "← Back" ate the
   horizontal space and squashed the song title into 2-3 wrapped lines; yet the
   bare neutral arrow was too weak). Resolution: arrow glyph, accent-FILLED so it
   reads as the likeliest next tap without stealing title width. flex:0 0 auto so
   it holds its 44px and the title (min-width:0) keeps the rest. */
.detailHead .ti{flex:1;min-width:0;}
/* Title sized to breathe next to the arrow-only Back + the two header buttons
   (1.42->1.24rem), AND clamped to 2 lines with an ellipsis (operator UAT: even
   the freed width left a long parenthetical title wrapping 3 lines). The full
   title still shows big in the full-screen perform view, so the clamp trades a
   tail no one needs in the header for a tidy 2-line cap. */
.detailHead .ti h2{font-weight:800;font-size:1.24rem;line-height:1.12;letter-spacing:-.02em;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;}
.detailHead .ti p{font-size:.8rem;color:var(--txt-dim);margin-top:4px;}
.headActions{display:flex;gap:8px;flex:0 0 auto;}
/* Overflow menu (Hear-on-YouTube / Full-lyrics / Delete) off the song-view
   header - keeps rarely-used actions one tap away without crowding the title.
   Anchored to the ⋯ button. */
.moreWrap{position:relative;flex:0 0 auto;}
.moreMenu{position:absolute;top:calc(100% + 6px);right:0;z-index:20;min-width:210px;display:flex;flex-direction:column;gap:2px;
  background:var(--surface-2);border:1px solid var(--line-strong);border-radius:11px;padding:6px;box-shadow:0 10px 28px rgba(0,0,0,.4);}
.moreMenu[hidden]{display:none;}
/* One primitive for both <button> and <a> overflow items (the YouTube/Genius
   links are anchors) - text-decoration:none kills the anchor underline. */
.moreItem{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:transparent;border:0;color:var(--txt);text-decoration:none;
  font-family:inherit;font-weight:600;font-size:.88rem;padding:11px 12px;border-radius:8px;cursor:pointer;min-height:44px;white-space:nowrap;}
.moreItem:active{background:var(--accent-deep);color:var(--accent-ink);}
/* Destructive overflow item (Delete / Revert) - danger-tinted glyph so it reads
   apart from the neutral navigation items. */
.moreItemDanger{color:var(--bad);}
.moreItemDanger:active{background:var(--bad);color:var(--on-danger);}
/* Arm-to-delete (S-DELCONFIRM-ARM): first tap fills solid red, matching
   li-rm.armed / setDelete.armed - the same "armed" signal wherever a delete
   lives. No native confirm popup; a second tap while armed performs the action. */
.moreItemDanger.armed{background:var(--bad);color:var(--on-danger);}
/* Key-actions row (Full screen + Solo) kept VISIBLE under the view toggle
   (operator UAT: these are primary, not overflow). Full-width split so both are
   easy thumb targets. */
.songActRow{display:flex;gap:8px;margin:10px 0 4px;}
.songActRow .songActBtn{flex:1;min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:6px;}
/* Emphasis ladder: an icon button is a SECONDARY affordance, not a primary
   action - so its glyph is neutral (--txt-soft), not the bright --accent-ink that
   competes with the one primary per screen. Accent still flashes on :active
   (feedback) and on the .setBtn.on selected state below. */
.iconBtn{width:44px;height:44px;border:1px solid var(--line-strong);background:var(--surface-2);border-radius:var(--r-btn-sm);cursor:pointer;font-size:1.25rem;line-height:1;display:flex;align-items:center;justify-content:center;color:var(--txt-soft);flex:0 0 auto;transition:transform .08s,background .15s,color .15s,border-color .15s;}
.iconBtn:active{transform:scale(.9);background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
.iconBtn.setBtn.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* BACK - the app-wide leave-this-screen primitive (UAT batch 3 item 4: "same
   back button SSOT behavior and location"). It is NOT scoped to .detailHead any
   more: the song view (#backLib) and the Practice Studio's sheet topbar
   (.bt-st-back) compose the SAME class, so the arrow that leaves a screen wears
   one look everywhere - accent-filled, top-left, 44px. Declared AFTER .iconBtn
   and at .iconBtn.backArrowBtn specificity so the accent fill wins over the base
   surface-2 fill regardless of which stylesheet loads later. */
.iconBtn.backArrowBtn{background:var(--accent-deep);border-color:var(--accent-dim);color:var(--accent-ink);font-size:1.4rem;font-weight:800;}
.iconBtn.backArrowBtn:active{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* The scale-audition play/stop toggle - ONE primitive, composed by both the
   Studio scale panel (tracks.js) and the Compose key preview (songbook.js).
   Base = .iconBtn (44x44 icon button); the sticky on/playing state reuses the
   accent-fill selected grammar (same as .iconBtn.setBtn.on above) - "while
   playing" is a selected/active state. Compact so it fits inline beside the
   "Solo over it" label without pushing content below the fold. */
.soundToggle{width:32px;height:32px;font-size:1.05rem;}
.soundToggle.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* The per-note "currently sounding" marker, on both the notes line and the
   degrees line, on both surfaces (Studio + Compose). ONE primitive
   (--sound-bg/--sound-line, declared above) - not the SELECTION or GUIDANCE
   token pair. Small pill treatment (border-radius literal, like the .li-capo/
   .li-note tag pills - inline text tokens, not buttons/chips/cards, so outside
   the radius-by-role tokens' scope). */
.soundNote{transition:background .12s,color .12s;border-radius:4px;}
.soundNote.sounding{background:var(--sound-bg);color:var(--sound-line);padding:0 2px;}
.viewToggle{display:flex;margin:8px 0 13px;background:var(--bg-2);border:1px solid var(--line-strong);border-radius:var(--r-btn);padding:4px;}
.viewToggle button{flex:1;border:none;background:transparent;font-family:inherit;font-weight:600;font-size:.78rem;color:var(--txt-dim);padding:9px;border-radius:var(--r-btn-sm);cursor:pointer;transition:background .15s,color .15s,transform .08s;}
.viewToggle button:active{transform:scale(.96);}
/* Selected state uses the SAME accent-fill grammar as .chip.on/.modeSwitch
   button.on below - one selected-state grammar app-wide. No border-color
   override needed: the base rule has border:none. */
.viewToggle button.on{background:var(--accent);color:var(--on-accent);}
/* queue nav: prev / position / next - shown in Practice when a setlist is loaded */
.queueNav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 14px;}
.queueNav button{flex:0 0 auto;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--accent-ink);font-family:inherit;font-weight:700;font-size:.8rem;padding:8px 14px;border-radius:var(--r-btn-sm);cursor:pointer;transition:transform .08s,background .15s,opacity .15s;}
.queueNav button:active{transform:scale(.94);background:var(--accent);color:var(--on-accent);}
.queueNav button:disabled{opacity:.32;cursor:default;color:var(--txt-dim);}
.queueNav .qPos{font-family:'Space Mono',monospace;font-weight:700;font-size:.74rem;color:var(--txt-dim);letter-spacing:.04em;}
/* song-view row: Lyrics/Chords/Both segmented + compact transpose chip + Stage icon, one row.
 * Ultra-narrow screens (<350px) give the segmented its own line rather than clip labels. */
.practiceRow{display:flex;align-items:stretch;gap:6px;margin:10px 0 14px;}
@media (max-width:349px){.practiceRow{flex-wrap:wrap;}.practiceRow .modeSwitch{flex-basis:100%;}}
/* ---- SONGS-MERGE phase 1: the All | Setlist segment ---------------------
 * Composes .modeSwitch (the app's ONE segmented-control grammar - see
 * component-conventions: view switches within a surface are segmented, tabs
 * are for top-level surfaces). Only the count badge and the reorder-grip
 * suppression below are new.
 */
/* flex:0 0 auto is load-bearing, not tidiness: .screen is a flex column, and
   in the Setlist view the two ALL-view blocks are hidden - so without this the
   segment is the only growable child left and stretches to ~230px tall. The
   tap-floor gate was perfectly green while it did (44px is a FLOOR); only the
   screenshot showed it. */
/* .modeSwitch.songsSeg, not .songsSeg: the base .modeSwitch rule sets flex:1
   and sits AFTER this block at equal specificity, so a single-class selector
   here silently loses. Measured, not guessed - the segment computed
   `flex: 1 1 0%` and stretched to 238px in the Setlist view, where it is the
   only growable child once the All-view blocks are hidden. Two classes win
   regardless of source order. */
.modeSwitch.songsSeg{flex:0 0 auto;margin-bottom:11px;}
.modeSwitch.songsSeg button{flex:1;min-height:44px;align-self:stretch;border:none;background:transparent;color:var(--txt-soft);font-family:inherit;font-weight:600;font-size:.82rem;border-radius:var(--r-btn-sm);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:background .15s,color .15s;}
.songsSeg button.on{background:var(--accent);color:var(--on-accent);}
/* The count answers "is there anything in my set?" without switching views. */
.segCount{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--surface-2);color:var(--txt-soft);font-size:.72rem;font-weight:700;font-family:'Space Mono',monospace;}
.songsSeg button.on .segCount{background:var(--on-accent);color:var(--accent-ink);}
.segCount[hidden]{display:none;}
/* An in-setlist row renders its set affordances in the ALL view too - that is
   how membership stays visible without switching. Reorder still belongs only
   where the order IS the content (segment:'library' here never renders the
   .swipeable row-gesture shell - list-item.js gates it on segment:'set'). */
/* ---- collapsed search+filter control (operator UAT 2026-07-26) -----------
 * The search row and two chip strips cost 177px of a 915px screen. They
 * collapse into ONE 44px bar; the bar REPORTS the active search/filter, so
 * collapsing hides space, never state. `.on` is the active look.
 */
.filterBar{display:flex;align-items:center;gap:8px;margin-bottom:11px;}
.filterBtn{flex:1 1 auto;min-width:0;min-height:44px;display:inline-flex;align-items:center;gap:8px;padding:0 14px;border:1px solid var(--line-strong);background:var(--surface);color:var(--txt-dim);font-family:inherit;font-size:.92rem;border-radius:12px;cursor:pointer;text-align:left;transition:border-color .15s,color .15s,background .15s;}
.filterBtn.on{color:var(--accent-ink);border-color:var(--accent-dim);background:var(--accent-deep);font-weight:600;}
.filterBtnIcon{flex:0 0 auto;font-size:1.05rem;}
/* The summary is the one thing allowed to ellipsise - it is a readout, and the
   full state is one tap away in the sheet. */
.filterBtnLabel{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.filterClear{color:var(--bad);}
/* The sheet. Sits inline under the bar (not a modal overlay): the list stays
   visible behind it, so you can see the result of a filter while choosing it. */
.filterSheet{border:1px solid var(--line-strong);border-radius:12px;background:var(--bg-2);padding:11px;margin-bottom:11px;}
.filterSheet[hidden]{display:none;}
.filterSheet .searchWrap{margin-bottom:9px;}
/* Two dropdowns share one row - this is what lets the whole block collapse. */
.filterRow{display:flex;gap:8px;margin-bottom:9px;}
.filterField{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:4px;}
.filterFieldLbl{font-size:.72rem;color:var(--txt-dim);font-weight:600;letter-spacing:.02em;}
.filterSel{width:100%;min-height:44px;background:var(--surface);border:1px solid var(--line-strong);border-radius:10px;color:var(--txt);font-family:inherit;font-size:.9rem;padding:0 10px;cursor:pointer;}
/* Landscape on a phone leaves ~412px of height, and the Songs chrome (segment +
   search + two chip rows) plus the app bar and tab bar consumed essentially all
   of it - the song list was pushed to zero height and became unreachable. The
   merge added the segment, so the merge owns this.
   Per the space budget the height comes out of the GAPS first, never off a tap
   target: every stacked margin in this chrome drops to 4px in landscape. The
   segment, the search box and the chips keep their 44px hit areas untouched. */
@media (orientation:landscape) and (max-height:560px){
  .modeSwitch.songsSeg{margin-bottom:4px;}
  #segAllChrome .searchWrap,#segAllChrome .libSearchRow{margin-bottom:4px;}
  #segAllChrome .chipScrollWrap,#segAllChrome .chips{margin-bottom:4px;}
  .setHead{margin-bottom:4px;}
}
.modeSwitch{display:flex;gap:2px;flex:1;min-width:0;background:var(--bg-2);border:1px solid var(--line-strong);border-radius:var(--r-btn);padding:3px;}
.modeSwitch button{flex:1;border:none;background:transparent;font-family:inherit;font-weight:700;font-size:.72rem;color:var(--txt-dim);padding:10px 3px;border-radius:var(--r-btn-sm);cursor:pointer;transition:background .15s,color .15s,transform .08s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.modeSwitch button:active{transform:scale(.95);}
/* Selected state uses the SAME accent-fill grammar (background:accent,
   color:on-accent) as .chip.on / #setEdit.on / .iconBtn.setBtn.on /
   .pSpeed .psBtn.on - ONE selected-state grammar app-wide. No border-color
   override needed: the base rule has border:none (unlike .chip, which does). */
.modeSwitch button.on{background:var(--accent);color:var(--on-accent);}
.transposeChip{display:flex;align-items:center;gap:0;flex:0 0 auto;background:var(--bg-2);border:1px solid var(--line-strong);border-radius:var(--r-btn);padding:4px;}
.transposeChip button{border:none;background:var(--surface-2);color:var(--txt);font-family:'Space Mono';font-weight:700;font-size:.95rem;width:30px;height:34px;border-radius:var(--r-btn-sm);cursor:pointer;transition:background .15s,transform .08s,color .15s;}
.transposeChip button:active{transform:scale(.86);background:var(--accent);color:var(--on-accent);}
/* ch (not px) so the reserved width tracks the monospace glyph itself - a
   min-width in px only covers a fixed pixel count and lets a wider label
   (e.g. "A" -> "A#" after transposing) grow past it, shifting the buttons on
   either side. +12px accounts for the 0 6px padding: box-sizing is border-box
   (global reset) so a bare 3ch min-width would count that padding AGAINST the
   3 characters instead of reserving room for them, still letting 2-char labels
   overflow it. calc(3ch + 12px) reserves a full 3 characters of text room on
   top of the existing padding. */
.transposeChip .v{font-family:'Space Mono',monospace;font-weight:700;font-size:.82rem;color:var(--accent-ink);padding:0 6px;min-width:calc(3ch + 12px);text-align:center;}
.modeSwitch button:disabled{opacity:.35;cursor:default;}
/* Stage: compact fullscreen icon button on the view row - accent-filled so the
 * perform entry stays discoverable. */
.stageGo{height:auto;min-height:44px;width:40px;background:var(--accent-deep);border-color:var(--accent-dim);}
.stageGo:active{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* Campfire: big chords-only, sized for jamming with the phone on the table */
.campfireSheet{padding:18px 14px;}
.campfireSheet .chordOnly{font-size:1.7rem;line-height:1.95;}
.campfireSheet .chordOnly .bar{padding:9px 15px;margin:5px;}
.campfireSheet .sect{font-size:.78rem;margin-top:18px;}
.chordChips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px;}
/* Compact bordered chord chip using the small-button radius (--r-btn-sm), same
   bucket as .chordOnly .bar / .cofNbChip (a chip-shaped compact control, not the
   pill-shaped .chip family). Real <button>s now (S-CHORDCHIP-A11Y) - margin:0
   resets the UA default button margin (Safari/iOS) so the flex gap stays exact. */
/* touch-action:manipulation (S-CHORDCHIP-LAG, PR #300) drops the mobile
   double-tap-zoom delay on every click path through this button too - the
   pointerdown handler in songbook.js is what makes the FIRST tap instant;
   this keeps any click-only path (mouse, some a11y tooling) equally snappy. */
/* min-height/min-width are the 44px tap-target floor, not styling: as real
   <button>s these measured 32-48 x 34 at 412x915 - under the floor on both
   axes for a control whose whole purpose is being tapped to hear the chord.
   inline-flex + centering keeps the glyph optically centred in the taller
   box instead of riding the top edge. */
.chordChips .c{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;font-family:'Space Mono',monospace;font-weight:700;font-size:.82rem;background:var(--surface-2);color:var(--accent-ink);border:1px solid var(--line-strong);padding:6px 11px;margin:0;border-radius:var(--r-btn-sm);cursor:pointer;touch-action:manipulation;transition:transform .08s,background .15s,color .15s;}
.chordChips .c:active{transform:scale(.9);background:var(--accent);color:var(--on-accent);}
/* The practice-sheet card surface hosting the chord/lyric grid (--r-card). */
.sheet{background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-card);padding:15px 13px;font-family:'Space Mono',monospace;overflow-x:auto;}
.sect{font-size:.68rem;color:var(--brass);text-transform:uppercase;letter-spacing:.16em;margin:15px 0 7px;font-weight:700;}
.sect:first-child{margin-top:0;}
/* practice sheet sized for arm's-length reading (phone on a strap / music stand) */
.lyrLine{font-size:.98rem;line-height:1.32;white-space:pre;margin-bottom:11px;color:var(--txt);}
.lyrLine .crd{color:var(--accent-ink);font-weight:700;}
.chordOnly{font-size:1.28rem;font-weight:700;line-height:1.75;}
/* Compact bordered chord tile (--r-btn-sm), same bucket as .chordChips .c;
   .campfireSheet .chordOnly .bar inherits this radius (no override of its own). */
.chordOnly .bar{display:inline-block;border:1px solid var(--line-strong);border-radius:var(--r-btn-sm);padding:6px 11px;margin:3px;background:var(--surface-2);color:var(--accent-ink);
  font:inherit;-webkit-appearance:none;appearance:none;cursor:pointer;touch-action:manipulation;transition:transform .08s,background .15s,color .15s;}
/* Same press feedback as .chordChips .c - one tap-to-hear grammar for every
   chord chip in the app (UAT batch 3 item 6). */
.chordOnly .bar:active{transform:scale(.9);background:var(--accent);color:var(--on-accent);}
.actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap;}
/* A full-width action button in the song-view .actions row (e.g. "Delete
   progression") composes .btn with .full instead of an inline flex-basis hack. */
.actions .btn.full{flex-basis:100%;}
/* min-height is the 44px tap floor at the PRIMITIVE (issue #311's lesson,
   applied one level up). 12px padding + .85rem gives 42px - two short - and
   the existing tap-floor gate could not see it: the one .btn it would have
   measured (#performBtn) is display:none while the setlist is empty, and the
   fixture never seeded a setlist. A control hidden in the fixture is a
   control never measured; found by seeding one here. */
.btn{min-height:44px;flex:1;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);font-family:inherit;font-weight:600;font-size:.85rem;padding:12px;border-radius:var(--r-btn);cursor:pointer;transition:transform .08s,background .15s,border-color .15s;letter-spacing:.01em;}
.btn:active{transform:scale(.97);}
.btn.ghost{background:transparent;color:var(--txt-soft);}
.btn.red{background:var(--accent);border-color:var(--accent-ink);color:var(--on-accent);}
/* Emphasis ladder: Save is the compose PRIMARY (accent fill) only once there is a
   progression to save. On an empty canvas (.composeWrap.progEmpty) it demotes to an
   OUTLINE so it never out-shouts the chord cards - the real "obvious next move".
   #id specificity beats .btn.red; it returns to fill the moment a chord lands. */
.composeWrap.progEmpty #cSave{background:transparent;color:var(--accent-ink);border-color:var(--accent-dim);}
/* Save disabled when there is genuinely nothing to save (empty strip + no song
   draft) - dimmed + non-interactive, so a post-Clear tap can't open the intent
   modal on an empty canvas. */
#cSave:disabled{opacity:.4;cursor:default;}
/* Genuinely destructive labeled buttons (the song view's real Delete). Note
   ".btn.red" is a MISNOMER - it is the accent-fill primary, not danger; THIS is
   the actual red. Rest state = transparent bg + --bad border/text; :active
   mirrors .prog .slot .rm's tap-flash (--bad fill + --on-danger ink). Red-at-rest
   is reserved for LABELED destructive buttons like this one - inline remove
   handles (.rm, .li-rm) rest QUIET and wear red only when ARMED. */
.btn.danger{background:transparent;border-color:var(--bad);color:var(--bad);}
.btn.danger:active{background:var(--bad);color:var(--on-danger);border-color:var(--bad);}
/* both secondary links on one centered row */
.lyricsLinks{display:flex;justify-content:center;align-items:center;gap:6px 22px;flex-wrap:wrap;margin-top:12px;}
.lyricsLink{color:var(--brass);font-size:.84rem;text-decoration:none;padding:8px 6px;font-weight:500;white-space:nowrap;}
.lyricsLink:active{color:var(--accent-ink);}
.note{font-size:.69rem;color:var(--txt-dim);text-align:center;margin-top:5px;line-height:1.45;}
/* The setlist mirrors the Library's scroll model - head row static, #setBody is
   the ONLY scroll container (same flat single-scroller pattern). No h2 in the
   head (the tabbar already names the tab); the count line carries the header
   information, restyled up a step. */
#s-jam{height:100%;}
#s-jam.on{display:flex;flex-direction:column;}
.libSet{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;}
.setHead{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:10px;}
#setBody{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:auto;}
#setBody::-webkit-scrollbar{width:0;}
.setHead .ti{margin-right:auto;}  /* push Edit + Clear to the right */
.setHead .ti p{font-size:.82rem;font-weight:700;color:var(--txt-soft);}
.setHead .btn{flex:0 0 auto;padding:12px 16px;}
/* The destructive Clear (✕) wears red so it never reads as a neutral header
   control - it only appears in edit mode (JS), and red is the standard
   destructive signal. Fills red on press. */
.setHead .setDelete{color:var(--bad);border-color:var(--bad);}
.setHead .setDelete:active{background:var(--bad);border-color:var(--bad);color:var(--on-danger);}
/* Arm-to-delete: first tap fills the ✕ red (matches the per-row li-rm.armed),
   a second tap while armed clears the set. No native confirm popup. */
.setHead .setDelete.armed{background:var(--bad);border-color:var(--bad);color:var(--on-danger);}
.setEmpty{text-align:center;padding:44px 18px;color:var(--txt-dim);font-size:.95rem;line-height:1.6;}
/* #s-tune: full-viewport, no-scroll layout (mirrors #s-compose's fixed-top /
   flex-hero pattern below). #s-tune fills the .view's available height;
   .tunerWrap is the single flex column inside it. Every direct child is
   fixed-size by default (flex:0 0 auto); the auto-tuner card (.tCard) is the
   hero and expands to absorb whatever vertical space is left, with the
   reference-tone strings and the accent picker pinned below it.
   FILL, NEVER CLAMP: the column is AT LEAST the view's height (min-height +
   flex-grow), not exactly it. When the content fits (portrait, desktop), that
   is the same one-screen layout. When it does not (landscape phone with the
   mini-player up: ~119px left for a column whose strings alone need ~120px on
   two guitar rows), the column grows and the .view scrolls - which is what makes
   body.miniplayer's .view padding-bottom reservation work here like on every
   other tab. A clamped height:100% box let the strings overflow INTO that
   padding, under the fixed bar, with nothing to scroll. .screen.on is
   display:block by default, so the flex column is scoped to #s-tune.on (the
   #s-library pattern). */
#s-tune{min-height:100%;}
#s-tune.on{display:flex;flex-direction:column;}
.tunerWrap{display:flex;flex-direction:column;flex:1 0 auto;}
.tunerWrap > *{flex:0 0 auto;}
.tunerWrap .sub{font-size:.74rem;color:var(--txt-dim);margin-bottom:8px;}
.tCanvasWrap{background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-card);padding:10px;margin-bottom:6px;position:relative;overflow:hidden;}
#tCanvas{display:block;width:100%;height:70px;}
.tCanvasLbl{position:absolute;top:9px;left:13px;font-family:'Space Mono',monospace;font-size:.62rem;color:var(--txt-dim);letter-spacing:.14em;}
/* Reference tones: 4-string profiles fill one row (basis = 1/4 width); 5+
   string profiles (guitar's 6, banjo's 5) wrap to a 3-per-row grid instead of
   squeezing every button down to a sliver. :has() feature-detects a 5th
   button so no per-instrument JS/markup hook is needed. */
.tStrings{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 4px;}
.tStr{flex:1 1 calc((100% - 18px) / 4);min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:9px 3px;border:1px solid var(--line-strong);background:var(--surface);border-radius:12px;cursor:pointer;transition:transform .08s,background .15s,border-color .15s,box-shadow .2s;}
.tStrings:has(.tStr:nth-child(5)) .tStr{flex-basis:calc((100% - 12px) / 3);}
.tStr:active{transform:scale(.95);}
.tStr.droning{background:var(--accent-deep);border-color:var(--accent-ink);box-shadow:0 0 24px rgba(94,234,212,.22);}
.tStr .n{font-family:'Space Mono',monospace;font-weight:700;font-size:1.45rem;line-height:1;color:var(--accent-ink);}
.tStr .l{display:none;}
.tStr .hz{font-family:'Space Mono',monospace;font-size:.56rem;color:var(--txt-dim);white-space:nowrap;}
/* Auto-tuner card is the Tune tab's hero: flex:1 lets it absorb whatever
   vertical space #tuneTuneRow / #tStrings / the accent picker don't need, so
   the whole tab fills the viewport with no scroll. It GROWS from a 180px
   floor rather than shrinking from its content: the column is content-sized
   (see #s-tune), so a shrinkable card would never shrink, and the floor is
   what lets a tall-content column (desktop / the PIP dock reservation) still
   fit on one screen with overflow-y:auto scrolling inside the card - the
   same box main gave it. Below the floor the view scrolls instead of the
   card collapsing to a sliver. */
.tCard{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);padding:11px;margin-top:9px;flex:1 0 180px;min-height:0;display:flex;flex-direction:column;overflow-y:auto;}
/* Short landscape phone: nothing fits on one screen once the mini-player is up
   (or even without it - ~200px of view), and the view scrolls either way, so
   show the whole tuner card instead of a 180px window into it. */
@media (orientation:landscape) and (max-height:560px){
  .tCard{flex-basis:auto;}
}
/* LANDSCAPE PHONE = TWO PANES, ONE SCREEN (operator decision 2026-10-05).
   Sideways, the stacked column cannot fit, so the extra room landscape has -
   width - is spent instead: the tuner card on the left, the strings on the
   right, nothing scrolls. It lives inside the landscape RAIL shell (Direction
   A, end of this file: left rail instead of header + bottom tab bar, one-row
   mini bar along the bottom of the content column), so the panes get the
   view's full height minus the bar's .view reservation - the same reservation
   every other tab uses, which keeps the bar ONE shape in landscape.
   - The card title and the strings caption hide here (the rail names the tab;
     the idle hint lives in the cents line); copy is unchanged in
     portrait/desktop.
   - Tuner pane, four rows, primary action at the bottom in thumb reach on a
     propped phone: mode chips / cents line / note beside the 72px runway /
     Start + Tone. Every control keeps its >=44px box.
   - The strings are a grid that fills the pane (the landscape audit's grid):
     4 strings/courses 2x2 (ukulele, mandolin, mandola), 5 as 3+2 (banjo), 6
     as 3x2 (guitar), 7-8 as 4x2 - same :has() count detect as the portrait
     rule. With the header and tab bar gone a grid row never drops near the
     44px floor (>=95px at 320px tall with the bar and a tuning-preset row),
     so #367's one-row fallback is retired.
   - The docked video PIP rides INSIDE the bar in the rail shell, so the split
     holds with it docked too (#367 had to fall back to the scrolling column).
   - The tuning lab (?tunerlab=1, a power tool) goes BELOW Start in the tuner
     pane, which scrolls on its own: the everyday screen (runway + Start +
     strings) is untouched and the strings pane never moves.
   Same gate as the rail (min-height:280px included), so the split and the
   rail always come together. */
@media (orientation:landscape) and (max-height:560px) and (min-height:280px){
  body:has(#s-tune.on) .view{padding-top:6px;padding-bottom:6px;}
  body.miniplayer:has(#s-tune.on) .view{padding-bottom:var(--bar-res);}
  body:has(#s-tune.on) #s-tune{height:100%;min-height:0;}
  body:has(#s-tune.on) .tunerWrap{flex:1 1 0;min-height:0;display:grid;
    grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);
    grid-template-areas:"card tune" "card str";column-gap:12px;align-items:start;}
  body:has(#s-tune.on) .tCard{grid-area:card;align-self:stretch;margin:0;padding:6px 10px;}
  body:has(#s-tune.on) .tCard h3,
  body:has(#s-tune.on) .refSub,
  body:has(#s-tune.on) .tuneTuneRow .sub{display:none;}
  body:has(#s-tune.on) .tuneTuneRow{grid-area:tune;}
  body:has(#s-tune.on) .tuneTuneRow .chipScrollWrap{margin-bottom:6px;}
  body:has(#s-tune.on) .tStrings{grid-area:str;margin:0;align-self:stretch;display:grid;gap:6px;
    grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(44px,1fr);}
  body:has(#s-tune.on) .tStrings:has(.tStr:nth-child(5)){grid-template-columns:repeat(3,minmax(0,1fr));}
  body:has(#s-tune.on) .tStrings:has(.tStr:nth-child(7)){grid-template-columns:repeat(4,minmax(0,1fr));}
  body:has(#s-tune.on) .tStr{min-height:44px;}
  body:has(#s-tune.on) .micBox{display:grid;margin:0;column-gap:10px;row-gap:6px;
    grid-template-columns:auto minmax(0,1fr);align-content:safe center;
    grid-template-areas:"modes modes" "cents cents" "note rw" "acts acts" "lab lab";}
  body:has(#s-tune.on) .micBox > .micCents{grid-area:cents;font-size:.66rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body:has(#s-tune.on) .micBox > .micNote{grid-area:note;align-self:center;min-width:64px;margin:0;}
  body:has(#s-tune.on) .micBox > .runway,
  body:has(#s-tune.on) .micBox > .micMeter{grid-area:rw;margin:0 2px;}
  body:has(#s-tune.on) .micBox > .micActions{grid-area:acts;margin:0;}
  body:has(#s-tune.on) .micBox > .micModes{grid-area:modes;margin:0;}
  body:has(#s-tune.on) .micBox > #labSlot{grid-area:lab;}
  body:has(#s-tune.on) .micBox > .micMsg{grid-column:1 / -1;}
  body:has(#s-tune.on) #micToggle{flex:1 1 0;}
  body:has(#s-tune.on) #toneToggle{flex:0 1 auto;}
}
.tCard h3{font-weight:700;font-size:.98rem;margin-bottom:5px;letter-spacing:-.01em;flex:0 0 auto;}
.tCard p{font-size:.78rem;color:var(--txt-soft);line-height:1.55;margin-bottom:11px;}
.tCard .row{display:flex;gap:8px;flex-wrap:wrap;}
.tBtn{border:1px solid var(--accent);background:var(--accent);color:var(--on-accent);font-family:inherit;font-weight:600;font-size:.8rem;padding:10px 15px;border-radius:var(--r-btn-sm);cursor:pointer;transition:transform .08s,background .15s;}
.tBtn:active{transform:scale(.95);}
.tBtn.ghost{background:transparent;color:var(--accent-ink);}
.relStep{display:flex;gap:11px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);}
.relStep:last-child{border-bottom:none;}
.relStep .rn{font-family:'Space Mono',monospace;font-weight:700;color:var(--accent-ink);font-size:1.2rem;width:22px;text-align:center;flex:0 0 auto;}
.relStep .rt{flex:1;font-size:.8rem;line-height:1.45;color:var(--txt-soft);}
.relStep .rt b{color:var(--txt);font-weight:700;}
.relStep .rp{border:1px solid var(--line-strong);background:var(--surface-2);color:var(--accent-ink);font-family:'Space Mono';font-weight:700;font-size:.86rem;width:44px;height:44px;border-radius:var(--r-btn-sm);cursor:pointer;flex:0 0 auto;transition:transform .08s,background .15s,color .15s;}
.relStep .rp:active{transform:scale(.88);background:var(--accent);color:var(--on-accent);}
.micBox{margin-top:4px;flex:1 1 auto;min-height:0;display:flex;flex-direction:column;justify-content:center;}
/* Start-mic: a real one-handed touch target (>=56px tall, full row width via
   the existing .actions/.btn flex:1) for holding an instrument in the other
   hand while tapping to start/stop the needle. */
#micToggle{min-height:56px;font-size:1rem;}
.micMeter{position:relative;height:54px;margin:8px 2px 2px;}
.micMeter .scale{position:absolute;top:28px;left:0;right:0;height:3px;border-radius:2px;background:linear-gradient(90deg,var(--bad) 0%,var(--warn) 32%,var(--good) 50%,var(--warn) 68%,var(--bad) 100%);opacity:.55;}
/* in-tune target zone (±3¢ in the zoomed needle map) - a band to park the needle
   in; lights up + glows green when the reading LOCKS, so "in tune" reads at a
   glance without watching the number. */
.micMeter .tgt{position:absolute;top:8px;left:46%;width:8%;height:38px;border-radius:6px;background:var(--good);opacity:.12;transition:opacity .2s,box-shadow .2s;pointer-events:none;}
.micMeter.locked .tgt{opacity:.28;box-shadow:0 0 18px 3px rgba(94,234,212,.6);}
.micMeter .center{position:absolute;top:16px;left:50%;width:1px;height:26px;background:var(--accent);transform:translateX(-50%);transition:background .2s,box-shadow .2s;}
.micMeter.locked .center{background:var(--good);box-shadow:0 0 8px var(--good);}
/* sharp = overshot the pitch: the centre line goes red as "you've gone too far,
   drop below and come back up" (the always-tune-up-from-flat workflow). */
.micMeter.sharp .center{background:var(--bad);box-shadow:0 0 8px var(--bad);}
.micMeter.locked{animation:lockPulse .34s ease;}
.micMeter.sharp{box-shadow:0 0 0 2px var(--bad) inset;border-radius:8px;}
@keyframes lockPulse{0%{transform:scale(1)}45%{transform:scale(1.05)}100%{transform:scale(1)}}
/* Guided Tune runway (S-TUNER-GOAL-FLOW, 2026-09-12): the approach-from-flat
   instrument. Flat is the long left stretch, the goal POST sits at 60%, the
   short right stretch is overshoot (sharp). The puck travels toward the post
   as the peg tightens; a sustained arrival fills the hold bar under the post,
   then the post lights and the puck snaps in. Status colours FIXED (tuner
   trust rule): amber = coming up, green = there, red = overshot. */
.runway{position:relative;height:72px;margin:10px 2px 6px;}
.runway .rwTrack{position:absolute;top:30px;left:0;right:0;height:4px;border-radius:2px;opacity:.5;
  background:linear-gradient(90deg,var(--warn) 0%,var(--warn) 50%,var(--good) 58%,var(--good) 62%,var(--bad) 72%,var(--bad) 100%);}
.runway .rwPost{position:absolute;top:6px;left:60%;width:12px;height:50px;transform:translateX(-50%);border-radius:6px;background:var(--good);opacity:.22;transition:opacity .2s,box-shadow .2s;pointer-events:none;}
.runway.arriving .rwPost{opacity:.55;}
.runway.landed .rwPost{opacity:1;box-shadow:0 0 22px 4px rgba(94,234,212,.6);animation:lockPulse .34s ease;}
.runway .rwHold{position:absolute;bottom:0;left:60%;height:3px;width:0;transform:translateX(-50%);border-radius:2px;background:var(--good);transition:width .1s linear;}
/* motion is eased in JS (tune-flow.js smoothing) - keep CSS off `left` so the two don't fight + trail */
.runway .rwPuck{position:absolute;top:12px;left:0;width:16px;height:40px;border-radius:8px;background:var(--warn);transform:translateX(-50%);will-change:left;transition:background .15s,box-shadow .15s;box-shadow:0 2px 8px rgba(0,0,0,.35);}
.runway.sharp .rwPuck{background:var(--bad);}
.runway.landed .rwPuck{background:var(--good);box-shadow:0 0 14px rgba(94,234,212,.7);}
.runway .fl,.runway .sh{position:absolute;top:52px;font-size:.66rem;line-height:1.2;color:var(--txt-dim);font-weight:600;}
.runway .fl{left:0;}.runway .sh{right:0;}
.runway.waiting .rwPuck{opacity:.35;}
/* Guided-mode string row = the progress row: the current target is lit (same
   look as a droning reference tone - it IS droning), a landed string wears a
   green check. Still tappable: a tap retargets the flow. */
.tStr.cur{background:var(--accent-deep);border-color:var(--accent-ink);box-shadow:0 0 24px rgba(94,234,212,.22);}
.tStr.done .n{color:var(--good);}
.tStr.done .hz::before{content:"\2713 ";color:var(--good);}
/* Tuning lab (?tunerlab=1): four plain sliders right under the runway, cold
   to hot with the shipped default at 50, so the puck and the knobs share one
   screen. The Tune tab scrolls while the lab is present (a power tool, not
   the everyday layout). The live + last-pluck lines are the report-back
   handles (screenshot them). */
#s-tune.labOn{height:auto;overflow-y:auto;}
#s-tune.labOn .tunerWrap{height:auto;}
#s-tune.labOn .tCard{flex:0 0 auto;overflow:visible;}
#s-tune.labOn .micModes{display:none;}
.tunerLab{margin:2px 0 10px;padding:6px 8px 4px;border:1px dashed var(--line-strong);border-radius:12px;font-size:.78rem;}
.labLive,.labTry{font-family:'Space Mono',monospace;font-size:.64rem;color:var(--txt);line-height:1.5;}
.labTry{color:var(--txt-soft);margin-bottom:4px;}
.labLine{font-family:'Space Mono',monospace;font-size:.56rem;color:var(--txt-dim);margin:6px 0 2px;white-space:pre-wrap;word-break:break-word;line-height:1.4;user-select:all;-webkit-user-select:all;}
.labRow{padding:3px 0 1px;}
.labHead{display:flex;justify-content:space-between;align-items:baseline;}
.labLbl{color:var(--txt);font-weight:600;font-size:.8rem;}
.labVal{font-family:'Space Mono',monospace;color:var(--txt-soft);font-size:.7rem;}
.labRow input[type=range]{display:block;width:100%;min-height:30px;margin:0;accent-color:var(--accent);}
.labEnds{display:flex;justify-content:space-between;font-size:.6rem;color:var(--txt-dim);margin-top:-2px;}
/* The Tone toggle is a STATE, not an action: accent ink + border when on so
   'Tone: on' can never be read as 'tap to turn the tone on'. */
.micActions .btn.ghost.on{border-color:var(--accent);color:var(--accent-ink);background:var(--accent-deep);}
.labStay{display:flex;gap:8px;align-items:flex-start;font-size:.72rem;color:var(--txt-soft);margin:6px 0 2px;line-height:1.35;}
.labStay input{margin-top:2px;width:18px;height:18px;accent-color:var(--accent);flex:0 0 auto;}
.micModes{display:flex;gap:6px;margin:0 0 6px;}
.micActions{display:flex;gap:8px;}
.micActions .btn{flex:1 1 auto;}
/* motion is eased in JS (tuner.js) - keep CSS off `left` so the two don't fight + trail */
.micMeter .needle{position:absolute;top:6px;left:50%;width:3px;height:42px;border-radius:2px;background:var(--bad);transform:translateX(-50%);transition:background .2s;will-change:left;}
.micMeter .fl,.micMeter .sh{position:absolute;top:46px;font-size:.66rem;color:var(--txt-dim);font-weight:600;}
.micMeter .fl{left:0;}.micMeter .sh{right:0;}
.micNote{font-family:'Space Mono',monospace;text-align:center;font-weight:700;font-size:1.95rem;line-height:1;margin:2px 0;color:var(--txt);transition:color .15s,text-shadow .15s;}
.micNote.intune{color:var(--good);text-shadow:0 0 22px rgba(94,234,212,.4);}
.micCents{font-family:'Space Mono',monospace;text-align:center;font-size:.76rem;color:var(--txt-dim);min-height:18px;}
.micMsg{background:var(--bg-2);border:1px solid var(--line-strong);border-radius:11px;padding:12px;font-size:.76rem;line-height:1.55;color:var(--txt-soft);margin-top:8px;}
.micMsg b{color:var(--txt);}
.progHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;}
.progLbl{font-size:.68rem;font-weight:700;color:var(--txt-dim);text-transform:uppercase;letter-spacing:.1em;}
.progTools{display:flex;align-items:center;gap:6px;}
/* The progression strip is a COUNT-driven staged density ladder, never a free
   flex-wrap (a plain flex-wrap pushes a 4th chord to a 2nd row unconditionally -
   a regression). The base rule below is shared box chrome ONLY (bg, border,
   radius, padding, gap) - each stage class fully owns its own layout mode, so
   there's no "default" nowrap/scroll fallback to reconcile. Never
   horizontal-scrolls in ANY stage (overflow-x:hidden). overflow-y MUST stay
   explicit (not omitted): setting overflow-x to a non-'visible' value silently
   forces overflow-y to compute as 'auto' too (the CSS overflow paired-longhand
   rule), which would turn a 2-row grid6 strip into a clipped scroll box instead
   of growing its FIXED (non-scrolling) composeTop region. JS (progStripMode,
   songbook.js renderProg) picks the stage class + (for fill-row) the inline
   grid-template-columns per render; a resize re-check can flip stages live.
   (see decisions.md: D-PROG-WRAP) */
/* Vertical trim tuned so the common 4-6 chord case fits the fixed (non-scrolling)
   composeTop region above the fold, WITHOUT shrinking the diagram cards (the
   phone-DPI text floor forbids that). */
.prog{display:flex;gap:8px;min-height:78px;margin-bottom:0;padding:9px;border-radius:13px;background:var(--bg-2);border:1px dashed var(--line-strong);align-items:center;scrollbar-width:none;-webkit-overflow-scrolling:touch;overflow-x:hidden;overflow-y:visible;}
.prog::-webkit-scrollbar{display:none;}
/* .wrapped is threshold-gated, not an unconditional flex-wrap (an unconditional
   wrap pushes a 4th chord to row 2 - a regression). JS (progStripMode,
   songbook.js renderProg) only adds .wrapped once the diagram-card row would
   genuinely overflow the strip, so a normal 2-4 chord progression keeps the
   one-row nowrap+scroll behavior above. overflow-y stays visible - .prog sits in
   the FIXED (non-scrolling) composeTop region, so a taller wrapped strip grows
   the fixed region's own height rather than clipping content. */
.prog.wrapped{flex-wrap:wrap;overflow-x:hidden;overflow-y:visible;touch-action:auto;align-content:flex-start;}
.prog .slot{flex:0 0 auto;}
.prog .slot .chord{min-width:var(--prog-tile-min);}
/* Stage 1 (1-4 chords): full diagram cards, ONE row, never scrolls. Each slot
   flex-grows (capped by max-width - a "sane bound", never literally
   edge-to-edge) so the row fills evenly rather than sitting left-packed with
   a bare gap; justify-content:center keeps any leftover space symmetric.
   Cards are never SHRUNK below their natural diagram size here -
   progStripMode's width guard demotes to fill-row a stage early instead, for
   a viewport too narrow to fit even that natural size (see the JS-side
   comment on progStripMode). */
.prog.full{flex-wrap:nowrap;justify-content:center;gap:8px;}
/* The slot must SHRINK-WRAP the card, not flex-GROW wider than it - a grown slot
   floats the absolutely-positioned delete badge (anchored to the slot's right
   edge) in empty slot space. flex:0 1 auto sizes the slot to the card so the
   badge lands on the card's own corner at every count; justify-content:center +
   gap still space the cards across the row. */
.prog.full .slot{flex:0 1 auto;max-width:150px;min-width:0;}
/* Stage 2 (5-6 chords, or an early width-guard demotion from stage 1): the
   existing compact chord token (suggChip - see the compact-token rules
   below), ONE row, equal-width columns that fill the strip. The column COUNT
   varies with the actual chord count, so the track list is set inline by
   renderProg per render (grid6 below is fixed at 6 and needs no inline
   style). */
.prog.fill-row{display:grid;}
/* Stage 3 (7-12 chords): the SAME compact token, but a FIXED 6-column grid -
   12 chords (the COMPOSE_MAX cap) is exactly two clean rows of 6, never a 3rd
   orphan row (a plain flex-wrap breaks an 11-chord run as 5+5+1).
   align-content:flex-start keeps a short (7-11 chord) grid's row(s) pinned to
   the top of the strip's min-height rather than centered/stretched. */
.prog.grid6{display:grid;grid-template-columns:repeat(6,1fr);align-content:flex-start;}
/* Both compact stages: the token must fill its OWN grid cell, not just sit at
   its 58px CSS min-width - .slot's flex layout (below) centers children by
   default, which would otherwise leave a narrow token adrift in a wide cell. */
.prog.fill-row .suggChip,
.prog.grid6 .suggChip{width:100%;min-width:0;}
.prog .slot .chord{min-width:62px;}
/* When empty the #suggest starters (top of the chord list below) carry the
   call-to-action, so the empty #prog collapses (no min-height, no placeholder)
   instead of showing a redundant prompt. */
.prog:empty{min-height:0;padding:0;border:0;}
.prog .slot{position:relative;animation:fadeUp .2s ease;display:flex;flex-direction:column;align-items:center;gap:3px;}
.prog .slot .rn{font-family:'Space Mono',monospace;font-size:.62rem;font-weight:700;color:var(--txt-dim);letter-spacing:.04em;}
/* >=44px TAP target via padding - glyph size unchanged. The VISIBLE circle is a
   ::before, 24x24, anchored at top:-7px/right:-7px. The button (the tap target)
   keeps that IDENTICAL anchor and grows DOWN and LEFT, NOT up/right: .prog has
   overflow:auto (implied overflow-y from its overflow-x:auto), so growing the
   badge past its old footprint upward/rightward clips the added area against the
   scroll container's edge - a silently-dead invisible zone. Growing toward the
   slot's own interior (never clipped) reaches 44x44 with a fully live hit area;
   the tradeoff is more overlap with the chord diagram below (accepted -
   movement-cancelled taps via composeWireTap keep a scroll-grab from misfiring).
   isolation:isolate scopes the ::before's z-index:-1 to this button (paints it
   behind the × without affecting sibling stacking). NO transform:scale
   press-feedback here: a mousedown-time scale-shrink moves the box's edges inward
   before mouseup, so a tap near the 44px edge can miss the shrunken hit-box and
   produce no click. Color-only feedback instead. */
/* border-box + bottom/left padding of 20px (44-24) carves the CONTENT box down to
   the exact top-right 24x24 the ::before circle occupies, and flex centering
   centers the glyph in it - true centering by construction, no hand-tuned offsets,
   identical at every prog stage. The 44x44 hit area is unchanged. */
.prog .slot .rm{position:absolute;top:-7px;right:-7px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0 0 20px 20px;isolation:isolate;color:var(--txt-soft);font-size:.72rem;line-height:1;cursor:pointer;background:none;border:none;}
.prog .slot .rm::before{content:'';position:absolute;top:0;right:0;width:24px;height:24px;z-index:-1;border-radius:50%;border:1px solid var(--line-strong);background:var(--surface-2);}
/* Drag-to-reorder: the lifted slot dims; the nearest slot carries an accent
   insertion edge on the side the chord will land. box-shadow edges work
   identically across all three strip stages (flex cards + both grids). */
.prog .slot.dragging{opacity:.45;}
.prog .slot.dropBefore{box-shadow:-3px 0 0 0 var(--accent-ink);border-radius:4px;}
.prog .slot.dropAfter{box-shadow:3px 0 0 0 var(--accent-ink);border-radius:4px;}
/* armed = "tap again to delete" - the danger palette the :active state already
   uses, held for the 1.6s arm window. */
.prog .slot .rm.armed{color:var(--on-danger);}
.prog .slot .rm.armed::before{background:var(--bad);border-color:var(--bad);}
.prog .slot .rm:active::before{background:var(--bad);}
.prog .slot .rm:active{color:var(--on-danger);}
/* In the full diagram-card stage (1-4 chords) the default -7px overhang floats the
   delete badge OFF the card, reading as disconnected. Pull it just inside the
   card's top-right corner so it reads as attached to the chord it removes. Compact
   stages keep the corner-overhang (tiny tokens have no interior room for it). */
.prog.full .slot .rm{top:2px;right:2px;}
/* The jam surface carries zero song chrome - the canvas opens on demand (Save
   sheet / Library) and carries its own close: */
.songCanvasClose{align-self:flex-end;flex:0 0 auto;background:none;border:0;color:var(--txt-dim);
  font-size:1.05rem;cursor:pointer;padding:0;display:inline-flex;align-items:center;justify-content:center;
  min-width:44px;min-height:44px;margin:-4px -6px -10px 0;}
/* Song mode hides the editor + picker but must keep .progBox itself DISPLAYED:
   the save-name modal (.composeRow.asModal), its backdrop and the compose toast
   are inserted INSIDE .progBox (siblings of #prog), and position:fixed cannot
   rescue an element under a display:none ancestor. Hence the two-level :not()
   instead of hiding .composeTop wholesale. */
.composeWrap.songMode .composeTop > *:not(.progBox){display:none;}
.composeWrap.songMode .progBox > *:not(.composeRow):not(.composeToast):not(.composeModalBackdrop){display:none;}
.composeWrap.songMode .composeTop{padding-bottom:0;margin-bottom:0;border-bottom:0;}
.composeWrap.songMode .progBox{margin-bottom:0;}
.composeWrap.songMode .composeChords{display:none;}
/* The Song canvas: the ONLY scroll area in Song mode - sections can grow
   without ever burying an action. */
.composeSong{display:none;}
.composeWrap.songMode .composeSong{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;gap:10px;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:12px;}
/* The song being built, named at the top of the canvas (operator UAT). Sits
   just under the close ✕ row; -8px margin tightens the flex gap to it. */
.songCanvasTitle{margin:-8px 0 0;font-weight:800;font-size:1.15rem;line-height:1.15;letter-spacing:-.01em;color:var(--txt);}
.songCanvasTitle[hidden]{display:none;}
.songCue{margin:0;}
.songCue[hidden]{display:none;}
/* Cards stack vertically on the canvas; neutralize the .songSections wrap and
   22vh cap (the canvas scrolls as a whole, so an inner cap would re-create a
   nested scroll trap). */
.composeSong .songSections{flex-direction:column;flex-wrap:nowrap;max-height:none;overflow-y:visible;}
/* A section CARD: label row (name + play + reorder + remove) over a chords row.
   Reuses .songSect's chip chrome + the drag/armed-remove/move grammar. */
/* A labeled hairline between the section cards and the add-a-section templates.
   Centered label flanked by two lines (the app's labeled-boundary grammar, cf.
   the in-key barrier). */
.songCanvasDiv{display:flex;align-items:center;gap:10px;margin:14px 2px 8px;}
.songCanvasDiv[hidden]{display:none;}
.songCanvasDiv::before,.songCanvasDiv::after{content:'';flex:1;height:1px;background:var(--line);}
.songCanvasDivLbl{font-size:.62rem;text-transform:uppercase;letter-spacing:.12em;color:var(--txt-dim);font-weight:700;white-space:nowrap;}
.songSect.card{width:100%;flex-wrap:wrap;align-items:center;padding:9px 12px;gap:4px 0;}
/* Tighten the card controls' PITCH, not their touch targets: each 44px hit box
   keeps its size; -3px side margins overlap the boxes to a 38px pitch while the
   36px visual halos stay 2px apart. Frees ~40px per card so the longest built-in
   label (Pre-Chorus) renders whole at phone width. */
.songSect.card .songSectPlay,.songSect.card .songSectEdit,.songSect.card .songSectDup,.songSect.card .songSectMove,.songSect.card .rm{margin:0 -3px;}
.songSect.card .songSectChords{flex-basis:100%;margin-top:4px;font-family:'Space Mono',monospace;font-size:.82rem;color:var(--txt);white-space:normal;word-spacing:2px;}
/* In a flex-wrap container, LINE BREAKING is computed on items' hypothetical
   sizes BEFORE any shrinking - so a long label ("Pre-Chorus · N", or any label
   under a large device font scale) pushes the last control onto a second line
   instead of the label shrinking. flex-basis:0 makes the label's hypothetical
   size zero: the header line can never be forced to wrap by the label, it GROWS
   into whatever's left and ellipsizes at the floor. The controls (all
   flex:0 0 auto) stay on one line by construction. */
.songSect.card .songSectName{margin-right:auto;flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;}
.songSectPlay{position:relative;z-index:0;flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--accent-ink);font-size:1rem;line-height:1;cursor:pointer;}
.songSectPlay::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:36px;height:36px;z-index:-1;border-radius:50%;border:1px solid var(--accent-dim);background:var(--bg-2);}
.songSectPlay:active{color:var(--on-accent);}
.songSectPlay:active::before{background:var(--accent);border-color:var(--accent);}
/* ✎ per-section edit-into-builder button. Same 44px hit target + halo grammar as
   .songSectPlay (reuse the card's control primitive), neutral-toned so it reads
   as "edit" not "play". */
.songSectEdit{position:relative;z-index:0;flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--txt-soft);font-size:1.05rem;line-height:1;cursor:pointer;}
.songSectEdit::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:36px;height:36px;z-index:-1;border-radius:50%;border:1px solid var(--line-strong);background:var(--bg-2);}
.songSectEdit:active{color:var(--accent-ink);}
.songSectEdit:active::before{background:var(--accent-deep);border-color:var(--accent-dim);}
.songBuildBtn{min-height:44px;}
/* The duplicate handle wears the SAME 44px box + 36px circular halo grammar as
   .songSectPlay/.songSectEdit / .rm / .songSectMove (one card-control primitive). */
.songSectDup{position:relative;z-index:0;flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--txt-soft);font-size:1rem;line-height:1;cursor:pointer;}
.songSectDup::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:36px;height:36px;z-index:-1;border-radius:50%;border:1px solid var(--line-strong);background:var(--bg-2);}
.songSectDup:active{color:var(--accent-ink);}
.songSectDup:active::before{background:var(--accent-deep);border-color:var(--accent-dim);}
/* The section buffer tray. In Chords mode it is ONLY the capture row (cue +
   label + "Add to song"); the sections/templates/save all live on the Song
   canvas. [hidden] takes no space (the empty-canvas state). */
.songTray[hidden]{display:none;}
/* The capture zone reads as ONE bounded group in the song accent family, split
   from the chord picker below. Same card grammar as .songSuggest, solid not
   dashed (this is a standing control, not a suggestion). */
.songTray{display:flex;flex-direction:column;gap:8px;margin-top:8px;padding:9px 10px;border-radius:11px;border:1px solid var(--accent-dim);background:var(--accent-deep);}
.songAdd{display:flex;gap:8px;align-items:center;}
.songAdd[hidden]{display:none;}
.songSectSel{min-height:44px;padding:6px 10px;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);font-family:inherit;font-size:.86rem;}
.songSectSel:focus{outline:none;border-color:var(--accent-ink);}
/* "Add to song" sits high on the CTA ladder - accent outline + ink, above a
   ghost button, below the ONE filled primary (Save). It is the bridge into the
   song feature. */
.songAdd .songAddBtn{flex:1 1 auto;min-height:44px;border-color:var(--accent-ink);color:var(--accent-ink);font-weight:700;}
/* Teaching cues are dismissible one-shot tips - small × glyph on a full 44px hit
   target (the .rm halo convention), quiet until pressed. */
.songTrayCue{position:relative;display:flex;align-items:center;gap:6px;padding-right:30px;}
.songTrayCue .cueText{flex:1 1 auto;}
.cueDismiss{position:absolute;top:50%;right:-8px;transform:translateY(-50%);width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--txt-soft);font-size:.8rem;line-height:1;cursor:pointer;}
.cueDismiss::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:20px;height:20px;z-index:-1;border-radius:50%;border:1px solid var(--line-strong);background:var(--surface-2);}
.cueDismiss:active{color:var(--txt);}
/* The base bounded-scroll cap, kept for any .songSections OUTSIDE the canvas. In
   Song mode the .composeSong .songSections rule below overrides it
   (max-height:none) so the full-screen canvas scrolls as a whole. */
.songSections{display:flex;flex-wrap:wrap;gap:8px;max-height:22vh;overflow-y:auto;overscroll-behavior:contain;}
.songSections:empty{display:none;}
/* A buffered-section chip: label + chord count, with the ONE inline-remove
   grammar - the × rests QUIET (--txt-soft) and only wears red once ARMED. */
/* Draft chip: parked-draft status + link on the jam surface. Dashed border = the
   draft grammar (echoes the strip container); quiet accent tint, full-width tap
   target. Hidden by renderSongTray whenever the canvas or a transaction hop owns
   the context. */
.draftChip{display:block;width:100%;margin-top:8px;padding:11px 12px;min-height:44px;text-align:left;border:1px dashed var(--accent-dim);background:var(--accent-deep);color:var(--accent-ink);border-radius:var(--r-btn-sm);font-weight:600;font-size:.82rem;cursor:pointer;}
/* display:block above would defeat the [hidden] UA style - restate it so the
   chip stays hidden when hidden=true after the draft empties. */
.draftChip[hidden]{display:none;}
.draftChip:active{background:var(--accent);color:var(--on-accent);}
.songSect{position:relative;display:flex;align-items:center;gap:6px;min-height:36px;padding:5px 30px 5px 11px;border-radius:11px;border:1px solid var(--accent-dim);background:var(--accent-deep);}
.songSect .songSectName{font-family:'Space Mono',monospace;font-weight:700;font-size:.78rem;color:var(--accent-ink);white-space:nowrap;}
/* Reorder handles: real 44x44 hit target in normal flex flow (unlike the
   corner-absolute .rm), small decorative circle behind the glyph via ::before -
   the same "invisible halo over a small visual" convention as .rm, just not
   corner-pinned since two sit side by side. */
.songSect .songSectMove{position:relative;z-index:0;flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--txt-soft);font-size:.9rem;line-height:1;cursor:pointer;}
.songSect .songSectMove::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:36px;height:36px;z-index:-1;border-radius:50%;border:1px solid var(--line-strong);background:var(--bg-2);}
.songSect .songSectMove:disabled{opacity:.3;cursor:default;}
.songSect .songSectMove:disabled::before{display:none;}
.songSect .songSectMove:active:not(:disabled){color:var(--on-accent);}
.songSect .songSectMove:active:not(:disabled)::before{background:var(--accent);border-color:var(--accent);}
/* The delete X joins the SAME control row as play/edit/up/dn (not absolutely
   positioned against the whole card, which sat it vertically off-center from its
   siblings). One row, five aligned 44px targets, matching 36px visible halos. */
.songSect .rm{position:relative;z-index:0;flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--txt-soft);font-size:1.05rem;line-height:1;cursor:pointer;}
.songSect .rm::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:36px;height:36px;z-index:-1;border-radius:50%;border:1px solid var(--line-strong);background:var(--bg-2);}
.songSect .rm.armed{color:var(--on-danger);}
.songSect .rm.armed::before{background:var(--bad);border-color:var(--bad);}
.songSect .rm:active{color:var(--on-danger);}
.songSect .rm:active::before{background:var(--bad);}
/* Drag-to-reorder, same accent-edge grammar as the .prog .slot.dragging/
   .dropBefore/.dropAfter markers. No border-radius override here: the chip is a
   filled, already-rounded 11px pill, not the bare .slot - forcing 4px would
   clash/flicker mid-drag against its own rounding. */
.songSect.dragging{opacity:.45;}
.songSect.dropBefore{box-shadow:-3px 0 0 0 var(--accent-ink);}
.songSect.dropAfter{box-shadow:3px 0 0 0 var(--accent-ink);}
.songAssembleBtn[hidden]{display:none;}
.songAssembleBtn{min-height:44px;}
/* Template-suggested sections: proven-progression chips shown inside the SONG
   tray when the buffer awaits its next (empty) progression. Suggestion-tier
   grammar - dashed outline + surface fill, NOT the accent-fill of a selected
   state (these are offers, not the current pick). The label switcher reuses the
   .chordSeg segmented primitive. */
/* Assembly cue: ONE quiet chrome-tier line that names the next move - never a
   fill/accent, it is guidance, not an action. */
.songTrayCue[hidden]{display:none;}
.songTrayCue{margin:0;font-size:.74rem;color:var(--txt-dim);}
/* Song map: the draft's sections as tappable edit-target chips on the CHORDS
   surface (avoids the Song<->Chords round-trip). Action-tier pills (solid
   outline, 44px targets - these DO something), never the dashed suggestion
   grammar; the section being edited carries the accent state. */
.songMap[hidden]{display:none;}
.songMap{display:flex;flex-wrap:wrap;gap:6px;}
.songMapChip{min-height:44px;padding:0 14px;border-radius:11px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);font-size:.85rem;font-weight:600;cursor:pointer;transition:background .15s,color .15s,border-color .15s;}
.songMapChip.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
.songSuggest[hidden]{display:none;}
.songSuggest{display:flex;flex-direction:column;gap:8px;padding:9px 10px;border-radius:11px;border:1px dashed var(--accent-dim);background:var(--accent-deep);}
.songSuggestChips{display:flex;flex-direction:column;gap:6px;}
/* Each suggestion is a ROW - the fill chip (flex:1) beside a 44px "?" reveal,
   with the FEEL/WHEN/PROVEN ladder spanning full width below when open. The
   ladder mirrors the Studio solo view's labeled-guidance look (small accent
   label left, prose right). */
.songSuggestItem{display:flex;flex-wrap:wrap;align-items:stretch;gap:6px;}
.songSuggestItem .songSuggestChip{flex:1 1 auto;min-width:0;}
.ssWhy{position:relative;flex:0 0 auto;width:44px;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt-soft);font-size:1.05rem;font-weight:700;font-family:'Space Mono',monospace;line-height:1;cursor:pointer;transition:background .15s,color .15s,border-color .15s;}
.ssWhy.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent);}
.ssWhy:active{background:var(--accent-deep);color:var(--accent-ink);}
.ssWhyPanel{flex-basis:100%;display:flex;flex-direction:column;gap:5px;padding:9px 11px;border-radius:10px;border:1px solid var(--line-strong);background:var(--bg-2);}
.ssWhyRow{display:flex;gap:10px;align-items:baseline;}
.ssWhyLbl{flex:0 0 52px;font-family:'Space Mono',monospace;font-weight:700;font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-ink);}
.ssWhyTxt{flex:1;font-size:.78rem;line-height:1.45;color:var(--txt);}
.songSuggestChip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:44px;padding:7px 11px;border-radius:10px;border:1px solid var(--accent-dim);background:var(--surface-2);color:var(--txt);cursor:pointer;text-align:left;font-family:inherit;transition:transform .08s,border-color .15s,background .15s;}
.songSuggestChip:active{transform:scale(.98);background:var(--accent-deep);border-color:var(--accent-ink);}
.songSuggestChip .ssRoman{font-family:'Space Mono',monospace;font-weight:700;font-size:.82rem;color:var(--accent-ink);}
.songSuggestChip .ssChords{font-size:.8rem;color:var(--txt);}
.songSuggestChip .ssProv{font-size:.68rem;color:var(--txt-dim);}
.songSuggestNone{margin:0;font-size:.74rem;color:var(--txt-dim);}
/* #suggest leads the scrolling chord list (folded into the In key / All surface):
   starters when the progression is empty, next-chord chips otherwise. */
.suggest:not(:empty){margin:2px 0 12px;}
.suggest:empty{display:none;}
.suggEmpty{font-style:italic;margin:6px 2px 2px;}
.suggLbl{font-size:.66rem;font-weight:700;color:var(--txt-dim);text-transform:uppercase;letter-spacing:.1em;margin-bottom:8px;}
/* The suggested->in-key BARRIER: same section-label primitive as .suggLbl, plus a
   full-width top hairline so the two chord groups read as two regions. .lblNote
   opts the key ROOT out of the uppercase transform - a flat accidental must render
   "Bb", never "BB" (note-spelling / a11y rule). */
.inKeyLbl{border-top:1px solid var(--line);margin-top:4px;padding-top:12px;}
.inKeyLbl .lblNote{text-transform:none;}
.suggRow{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;}
/* COMPACT suggestion chip: chord name + interval, no fretboard diagram - keeps the
   "Next chord" panel a few short rows instead of a viewport-eating wall of diagrams.
   A chord that COMPLETES a famous progression gets an accent glow (no name caption -
   the caption blew the chip width and wrapped the row). */
/* The suggested next-chords are the app's RECOMMENDED picks (ranked strongest
   first), so they read a step warmer than the neutral browse palette below - a
   subtle accent-deep tint + an accent-ink border, WITHOUT the full accent-fill
   that would read as "selected". The .complete glow (a chord that finishes a
   famous progression) stays the strongest cue. */
.suggChip{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:58px;min-height:48px;padding:7px 12px;border-radius:12px;border:1px solid var(--accent-ink);background:var(--accent-deep);font-family:inherit;cursor:pointer;transition:transform .08s,background .15s,border-color .15s;}
.suggChip:active{transform:scale(.93);background:var(--accent-deep);border-color:var(--accent-ink);}
.suggChip .scName{font-family:'Space Mono',monospace;font-weight:700;font-size:.92rem;color:var(--accent-ink);}
.suggChip .scRn{font-family:'Space Mono',monospace;font-size:.6rem;font-weight:700;color:var(--txt-dim);letter-spacing:.04em;}
.suggChip.complete{border-color:var(--accent-ink);box-shadow:0 0 0 1px var(--accent),0 4px 12px rgba(94,234,212,.18);}
/* S-SUGG-DIFFERENTIATE: the ranked "Suggested Chords" row carries a small
   recommended-marker dot (top-right) so the recommendation reads apart from
   the browse palette by SHAPE too, not color alone - a shape-blind reader
   still sees it. .complete (above) already wins visually when both apply. */
.suggChip.sugg-reco{position:relative;}
.suggChip.sugg-reco::after{content:'';position:absolute;top:4px;right:4px;width:5px;height:5px;border-radius:50%;background:var(--accent);}
.suggChip.sugg-reco.complete::after{background:var(--accent-ink);}
/* Advanced guidance level: the Compose palettes render the SAME suggChip token in
   a dense auto-fill grid (.ccChips = the in-key lead's wrapper; .chordGrid.ccMode
   = #buildGrid re-tracked while chips are on). width:100% + min-width:0 mirrors
   the .prog fill-row/grid6 carve-out so chips fill their track instead of
   centering at 58px. The 56px track floor keeps ~6 columns at a 412px viewport.
   min-height comes from .suggChip (48px >= the 44px tap floor).
   S-SUGG-DIFFERENTIATE: this is the browse palette (chord-collapse.js's
   .ccChip), so it stays QUIET/neutral instead of sharing the ranked row's
   accent-deep/accent-ink tint - the recommended chips (sugg-reco, above) are
   the only ones that read "recommended". Active state still flashes toward
   accent-ink (matches .progPick's tap feedback) so a tap here still confirms. */
.ccChips .suggChip,
.chordGrid.ccMode .suggChip{width:100%;min-width:0;padding:7px 6px;background:var(--surface-2);border-color:var(--line-strong);}
.ccChips .suggChip .scName,
.chordGrid.ccMode .suggChip .scName{color:var(--txt);}
.ccChips .suggChip:active,
.chordGrid.ccMode .suggChip:active{background:var(--surface-2);border-color:var(--accent-ink);}
.progPicks{margin-top:14px;}
.progPickRow{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none;touch-action:pan-x;}
.progPickRow::-webkit-scrollbar{display:none;}
.progPick{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;gap:3px;cursor:pointer;
  background:var(--surface);border:1px solid var(--line-strong);border-radius:11px;padding:9px 12px;
  transition:transform .08s,border-color .15s,background .15s;}
.progPick:active{transform:scale(.96);background:var(--surface-2);border-color:var(--accent-ink);}
.progPick .ppRoman{font-family:'Space Mono',monospace;font-weight:700;font-size:.82rem;color:var(--accent-ink);letter-spacing:.02em;white-space:nowrap;}
.progPick .ppName{font-size:.66rem;color:var(--txt-dim);font-weight:600;white-space:nowrap;}
.cActions{display:flex;gap:8px;margin:14px 0;}
/* touch-action:pan-y - the chord tiles are a vertical grid (no horizontal scroll of its
   own), so a vertical swipe over it MUST pan the page/accordion, never get trapped. */
/* ===== Chord-tile/diagram geometry token block =====
 * ONE declared source for the numeric constants that keep a chord-diagram SVG
 * from spilling into its neighbour (the tile-overlap bug class) - see
 * music/engineering-wiki/systems/layout-tokens.md for the full contract and
 * the constants this deliberately does NOT fold in (diagram.js's per-string-count
 * SIZES, .prog's scroll-strip floor). --dg-canvas-w is a documentation-anchor,
 * not a live coupling: diagram.js emits a plain SVG string and cannot read a CSS
 * var, so this promotes what was a prose-only "86px" comment into a real value
 * --tile-min derives from, so the two numbers can't silently drift apart. */
:root{
  --dg-canvas-w:86px;  /* diagram.js SIZES.small canvas width, 6-string guitar (widest 'small' diagram): W=2*12+5*9.6=72, +labelPad 14 = 86 - see diagram.js's cross-ref comment on SIZES.small */
  --tile-min:calc(var(--dg-canvas-w) - 2px);  /* .chordGrid track min - just under the reference canvas so the shrink-to-fit clamp below does negligible work in the common case */
  --tile-gap:8px;  /* .chordGrid gap */
  /* --prog-tile-min is INDEPENDENT-BY-DESIGN, not derived from --dg-canvas-w:
     .prog (below) is a horizontally-SCROLLING filmstrip (overflow-x:auto,
     flex:0 0 auto slots) - tiles render at their natural SVG width and are
     never squeezed by their container, so there is no overlap-by-squeeze
     risk the way there is in a minmax(...,1fr) grid. This is a minimum
     touch/visual-size FLOOR (e.g. a 1-string reduced shape), not a
     squeeze-fit value - see music/engineering-wiki/systems/layout-tokens.md. */
  --prog-tile-min:62px;
}
/* Track min (var(--tile-min)) sizes a cell to hold a full chord card. A 6-string
   guitar diagram is an 86px-wide SVG (var(--dg-canvas-w)); its card adds
   padding+border to ~100px. Too small a min lets a wide (laptop) viewport's
   auto-fill collapse cells narrower than the card, so the in-key cards overflow
   and overlap and the fixed-width SVG spills past the scroll container. The
   current min keeps phones (<=412px) at 4 columns while widening laptop cells to
   5 columns so the native-size diagram fits - nothing shrinks below the phone-DPI
   label floor. */
.chordGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--tile-min),1fr));gap:var(--tile-gap);touch-action:pan-y;}
/* ONE chord-tile style, shared by the progression, the suggestions and the build
   grid, so every chord box reads the same. Suggestions add an accent border to
   signal "tap to add"; the current progression and the picker stay neutral. */
/* touch-action:pan-y on the tiles themselves: .chordGrid sets pan-y but it does NOT
   inherit, so a vertical swipe STARTING on a .chord tile would otherwise use `auto` and
   trap the gesture. Setting it on the tile lets a vertical swipe from a tile scroll the
   panel/page. (Progression tiles live in .prog, a horizontal strip - they keep pan-x via
   the .prog rule and are NOT in .chordGrid, so they are unaffected.) */
/* The in-key list cells are .chordCell (KeyExplorer), NOT .chord - and the In-key|All
   toggle, mode chips, and key filter are their own elements. touch-action does NOT
   inherit, so each tap target that should pass a vertical swipe must declare pan-y
   (the All-chords .chordGrid tiles already do, which is why that view scrolls). */
.chordGrid .chord,
.inKeyLead .chord,
.chordCell,
.keyPalette .chordCell,
.chordSeg,
.chordSegBtn,
.keyModes,
.keyModes .chip,
.keyFilter,
.keyPickerCompact,
.keyRoots,
.rootChip,
.keyClearBtn,
.keySoloScale,
.keySoloScale .chip{touch-action:pan-y;}
.prog .slot .chord,
.suggRow .chord.suggPick,
.chordGrid .chord{display:flex;flex-direction:column;align-items:center;gap:5px;box-sizing:border-box;cursor:pointer;border-radius:12px;padding:8px 6px 6px;border:1px solid var(--line-strong);background:var(--surface-2);transition:transform .08s,background .15s,border-color .15s;}
/* The All-view #buildGrid tiles render .chord DIRECTLY as the grid item (no
   wrapping .chordCell like the in-key view above), so they never got that view's
   min-width:0 + max-width:100% clamp (.keyPalette .chordCell > .chord, above).
   This adds the same clamp so a diagram wider than its column shrinks to fit
   instead of bleeding into the next tile. */
.chordGrid .chord{min-width:0;}
.chordGrid .chord svg{max-width:100%;height:auto;display:block;}
.prog .slot .chord .chord-name,
.suggRow .chord.suggPick .chord-name,
.chordGrid .chord .chord-name{font-family:'Space Mono',monospace;font-weight:700;font-size:.82rem;color:var(--txt);}
.prog .slot .chord:active,
.suggRow .chord.suggPick:active,
.chordGrid .chord:active{transform:scale(.92);border-color:var(--accent-dim);}
.suggRow .chord.suggPick{border-color:var(--accent-dim);}
.suggRow .chord.suggPick .chord-name{color:var(--accent-ink);}
.suggRow .chord.suggPick:active{background:var(--accent-deep);border-color:var(--accent-ink);}
.chordGrid .chord.sel{border-color:var(--accent-ink);background:var(--accent-deep);}
/* ---- Key filter (top of the single Chords panel) ---- */
/* The filter row: the injected key chip (#keyPickerCompact) + the mode toggle (#keyModes),
   with the 12-root popover (#keyRoots) dropping in below the chip on demand. Sits above
   the chord list so picking a key / mode re-leads the chords directly below it. */
.keyFilter{margin:2px 0 12px;}
.keyFilterHead{display:flex;align-items:center;justify-content:flex-end;min-height:0;}
.keyLbl{font-size:.68rem;font-weight:700;color:var(--txt-dim);text-transform:uppercase;letter-spacing:.1em;}
.keyClearBtn{display:inline-flex;align-items:center;min-height:44px;border:1px solid var(--line-strong);background:transparent;color:var(--txt-soft);font-family:inherit;font-size:.7rem;font-weight:600;padding:4px 12px;border-radius:14px;cursor:pointer;}
.keyClearBtn:active{background:var(--surface-2);transform:scale(.94);}
/* Key/mode chip - lives in the button bar (#keyChipSlot), doing double duty: shows
   the current key (root + abbreviated mode, tracking songKey so it reads as the
   transpose readout) AND toggles the key/mode fly-out. FIXED WIDTH so "C Maj" and
   "G# Mixo" render the same size and the button bar never jumps as the key name
   changes; overflow ellipsis guards an unexpectedly long label. 'shifted' lights
   it when transposed off the built-in key. 88px, not 80px, because Blues is NOT
   abbreviated (MODE_SHORT.Blues = 'Blues', full word), so "G# Blues" needs the
   extra width to clear the chip-clip fold gate. */
.keyPickerCompact{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:88px;min-width:88px;max-width:88px;height:44px;padding:0 5px;border-radius:13px;border:1px solid var(--accent-dim);background:var(--surface-2);color:var(--accent-ink);font-family:'Space Mono',monospace;font-size:.8rem;font-weight:700;cursor:pointer;overflow:hidden;white-space:nowrap;flex:0 0 auto;transition:transform .08s,background .15s,border-color .15s,color .15s;}
.keyPickerCompact:active{background:var(--accent-deep);border-color:var(--accent-ink);transform:scale(.95);}
.keyPickerCompact[hidden]{display:none;}
.keyPickerCompact.shifted{color:var(--on-accent);background:var(--accent);border-color:var(--accent-ink);}
.keyPickerCompact.shifted .kpcMode{color:var(--on-accent);}
.keyPickerCompact.shifted .kpcCaret{color:var(--on-accent);}
.keyPickerCompact .kpcMode{color:var(--txt-soft);font-weight:600;overflow:hidden;text-overflow:ellipsis;}
.keyPickerCompact .kpcCaret{font-size:.7rem;color:var(--accent-dim);transition:transform .15s;flex:0 0 auto;}
.keyPickerCompact[aria-expanded="true"] .kpcCaret{transform:rotate(180deg);color:var(--accent-ink);}
/* Slot the chip is injected into - inline so it sits inside the button-bar flex row. */
.keyChipSlot{display:inline-flex;flex:0 0 auto;}
/* Root grid - lives inside the key/mode fly-out now (always shown there). All 12 roots
   at once (wrap), each a 44px thumb target. No own border/bg: the fly-out frames it. */
.keyRoots{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px;}
.keyRoots[hidden]{display:none;}
.rootChip{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:7px 13px;font-family:'Space Mono',monospace;font-size:.78rem;}
.keyModes{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:4px;}
.keyModes[hidden]{display:none;}
.keyHint{color:var(--txt-dim);font-size:.82rem;margin:8px 2px 2px;}
.keyTitle{margin:8px 0 4px;font-size:1rem;}
.keyTitle strong{color:var(--txt);font-weight:800;}
.keyTitle span{color:var(--accent-ink);font-size:.76rem;font-weight:600;margin-left:6px;}
/* Compose key-view solo-scale PREVIEW row (decoupled, non-persisted - see
   compose-key-system.md). Composes the existing .chip base class for the buttons;
   this rule only lays out the row, no new chip-variant border/background/radius. */
.keySoloScale{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 4px;}
/* The play/stop audition toggle sits beside the notes line (not its own row) -
   costs no extra vertical space, mirrors the Studio's .bt-st-solorow layout
   (tracks.css). */
.keySoloNotesRow{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.keySoloNotes{font-size:.82rem;color:var(--txt-soft);margin:0 0 4px;}
.keySoloNotes strong{color:var(--txt);font-weight:600;}
/* The degrees line under the notes line - same styling family as the Practice
   Studio's degree glyphs (tracks.css .cofDeg .dg: monospace, dim, small) so
   "1 2 3 4 5 6 ♭7" reads as the SAME kind of label app-wide. */
.keySoloDegrees{font-family:'Space Mono',monospace;font-size:.7rem;color:var(--txt-dim);letter-spacing:.03em;margin:0 0 4px;}
.keySoloDegrees[hidden]{display:none;}
.keySoloFrame{font-size:.72rem;color:var(--txt-soft);line-height:1.5;margin:0 0 10px;}
.keySoloFrame[hidden]{display:none;}
.keySubLbl{font-size:.66rem;font-weight:700;color:var(--txt-dim);text-transform:uppercase;letter-spacing:.08em;margin:13px 0 8px;}
.keyPalette{margin-bottom:2px;}
/* Each diatonic chord tile uses the same layout as the suggCell: diagram on
   top + Roman numeral below. Keeps the visual consistent across the palettes
   (chord name bold at top via .chord-name, Roman muted at bottom via .rn). */
.keyPalette .chordCell{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;}
/* Clamp the bordered card to its cell (min-width:0 lets the cell shrink to the grid
   track). Without this the card is content-sized (~100px) and, centered in a narrower
   cell, overflows into its neighbours - the in-key overlap. The All-chords tiles never
   had this because there the card IS the grid item, already clamped to the track; this
   makes the in-key card behave the same. It is the ADDITIONAL clamp layer the in-key
   view needs because of its extra .chordCell wrapper (see the geometry token block
   above; music/engineering-wiki/systems/layout-tokens.md). */
.keyPalette .chordCell > .chord{max-width:100%;box-sizing:border-box;}
.keyPalette .chordCell .rn{font-family:'Space Mono',monospace;font-size:.62rem;font-weight:700;color:var(--txt-dim);letter-spacing:.04em;}
/* ---- Adaptive chord surface ----
   #catChips in the Chords panel becomes a vertical stack: the in-key lead palette (or
   the no-key hint), the "+ all chords" expander, and an inner scrollable category-tab
   row. Overrides the default .chips horizontal-flex behavior for this stacked layout. */
.adaptiveChips{display:flex;flex-direction:column;gap:0;overflow:visible;margin-bottom:10px;}
.inKeyLead{margin-bottom:4px;}
/* #catChips SHARES its row with the Solo entry point (#chordCtrlRow,
   play/index.html) instead of stacking a full-width CTA below it - the toggle
   flexes to fill the remaining width beside the compact Solo button. */
.chordCtrlRow{display:flex;align-items:stretch;gap:8px;margin-bottom:8px;}
/* Segmented "In key | All" toggle: ONE control (in the FIXED #catChips) that swaps the
   scrolling chord list's content. A pill pair, full-width (of its OWN flexed
   column - see .chordCtrlRow above), each segment >=44px tall. */
#catChips{flex:1 1 auto;margin:0;}
/* Uses --r-btn to match the sibling segmented-control containers
   (.modeSwitch/.viewToggle). */
.chordSeg{display:flex;gap:0;width:100%;margin:0;border:1px solid var(--line-strong);border-radius:var(--r-btn);overflow:hidden;}
/* With 7 section labels the switcher WRAPS: all 7 labels visible at once, two
   rows on a phone. A horizontal scroll was worse - options past the fold read as
   absent, not reachable (recognition over recall). Scoped: other chordSeg
   consumers (2-3 segments) keep the sealed pill look; the border-radius overflow
   clip on .chordSeg still rounds the corners. */
.songSuggestLabels{flex-wrap:wrap;}
.songSuggestLabels .chordSegBtn{flex:1 0 auto;white-space:nowrap;padding-left:12px;padding-right:12px;}
.chordSegBtn{flex:1 1 0;min-height:44px;border:0;background:transparent;color:var(--txt-soft);font-family:inherit;font-weight:700;font-size:.82rem;cursor:pointer;padding:8px 10px;transition:background .15s,color .15s;}
.chordSegBtn + .chordSegBtn{border-left:1px solid var(--line-strong);}
.chordSegBtn:active{transform:scale(.98);}
.chordSegBtn.on{background:var(--accent-deep);color:var(--accent-ink);}
/* the chromatic category tabs keep the horizontal-scroll pill-row behavior (now a direct
   child of the scroll area, not .adaptiveChips). */
.catTabRow{display:flex;gap:6px;overflow-x:auto;margin:0 0 12px;padding-bottom:3px;scrollbar-width:none;touch-action:pan-x;}
.catTabRow::-webkit-scrollbar{display:none;}
/* The All-view quality filter (Maj/Min/7th/...) is a SECONDARY narrowing control,
   not a primary action - a full accent-fill selected chip reads as a competing CTA.
   Its selected state is an accent OUTLINE (accent-ink text + border, transparent
   bg) so accent-fill stays reserved for the one primary/recommended thing.
   Lint-safe: outline is neither the surface-2 + box-shadow ring the consistency
   lint forbids nor a new hue. */
.catTabRow .chip.on{background:transparent;color:var(--accent-ink);border-color:var(--accent-ink);}
/* The SAME quiet grammar for the Library facet bars (#genreChips/#keyChips live in
   .chips containers). FILTER chips select with an outline; the accent FILL stays
   reserved for primary actions and true mode selections (.keyModes, segmented
   views) - the filter-vs-selection line. */
.chips .chip.on{background:transparent;color:var(--accent-ink);border-color:var(--accent-ink);}
.chordsHint{margin:0 2px 4px;}
/* Empty in-key state: the pick-a-key CTA is the primary action, full width so it
   reads as THE next step. */
.pickKeyCta{display:block;width:100%;margin:2px 0 8px;}
/* Solo entry point: the SAME compact companion-button treatment on BOTH surfaces -
   shares Compose's #chordCtrlRow (beside the In-key|All toggle) and the song view's
   .practiceRow (beside Lyrics/Chords/Both + transpose + Stage). Accent-outlined
   pill, matches the row's other controls' height (44px floor via the host row's
   align-items:stretch) and radius (--r-btn) rather than a bolted-on full-width CTA.
   Auto-hidden entirely (not disabled) when there's nothing to solo over
   (songbook.js's canSolo gate / renderKey). */
.soloRowBtn{flex:0 0 auto;white-space:nowrap;min-height:44px;padding:8px 14px;border-radius:var(--r-btn);border:1px solid var(--accent-dim);background:transparent;color:var(--accent-ink);font-family:inherit;font-weight:700;font-size:.82rem;cursor:pointer;}
.soloRowBtn:active{background:var(--accent-deep);border-color:var(--accent-ink);transform:scale(.97);}
/* "All chords" header: marks the revealed browse so its type tabs (Major/Minor/7th/...)
   are never mistaken for the key-MODE toggle above. */
.allChordsHdr{font-size:.66rem;font-weight:700;color:var(--txt-dim);text-transform:uppercase;letter-spacing:.08em;margin:10px 0 4px;}
/* "+ all chords" expander: a quiet full-width control under the in-key lead */
/* Full-width button-styled toggle - uses --r-btn like the other button family. */
.allChordsToggle{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;width:100%;min-height:44px;border:1px dashed var(--line-strong);background:transparent;color:var(--txt-soft);font-family:inherit;font-weight:700;font-size:.8rem;padding:8px 14px;border-radius:var(--r-btn);cursor:pointer;text-align:left;transition:background .15s,border-color .15s,transform .08s;}
.allChordsToggle:active{transform:scale(.98);}
.allChordsToggle.open{border-style:solid;border-color:var(--accent-ink);color:var(--txt);}
.allChordsToggle .acHint{font-weight:600;font-size:.66rem;color:var(--txt-dim);letter-spacing:.02em;}
.scaleBox{overflow-x:auto;padding:4px 0 2px;-webkit-overflow-scrolling:touch;scrollbar-width:none;touch-action:pan-x pan-y;}
.scaleBox::-webkit-scrollbar{display:none;}
.scaleBox svg{display:block;}
/* Position-shift control (walk the scale up the neck): a single compact row under
   the scale box, kept to one line per the one-screen rule - back/forward buttons
   flank a small "frets N-M" readout. Buttons are >=42px so they're comfortably
   tappable on phone; shown only when the pack supports startFret (see key-explorer.js). */
.scaleBoxWrap{margin-bottom:2px;}
.scalePosCtrl{display:flex;align-items:center;justify-content:center;gap:8px;margin:2px 0 10px;}
.scalePosBtn{min-width:42px;min-height:42px;border:1px solid var(--line-strong);border-radius:var(--r-btn-sm);background:transparent;color:var(--txt-soft);font-family:inherit;font-size:.95rem;line-height:1;cursor:pointer;transition:background .15s,border-color .15s,transform .08s,opacity .15s;}
.scalePosBtn:active{transform:scale(.94);}
.scalePosBtn:disabled{opacity:.32;cursor:default;}
.scalePosLbl{font-family:'Space Mono',monospace;font-size:.7rem;font-weight:700;color:var(--txt-dim);letter-spacing:.03em;min-width:76px;text-align:center;}
/* Deep-dive link (Compose fly-out "Triads & Inversions" + the Studio's "Walk the
   full cycle" - tracks.js renders the same class). Compose links to the fly-out
   scale; the Studio owns fretboard/scale teaching. */
.hsrMore{display:inline-block;margin:6px 0 14px;font-size:.78rem;color:var(--accent-ink);text-decoration:none;border-bottom:1px dashed var(--accent-dim);padding-bottom:1px;}
.hsrMore:active{opacity:.6;}
/* ---- Compose layout ----
   FLATTENED Compose (no accordions). A flex column: a FIXED top region (button bar +
   progression box + key/mode chip + In-key|All toggle) over the chord list, which is the
   ONLY scroll container. No nested scroller -> vertical swipes on the in-key cells scroll
   cleanly. */
#s-compose{height:100%;}
.composeWrap{display:flex;flex-direction:column;height:100%;}
.composeTop{flex:0 0 auto;background:var(--bg);padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid var(--line);}
/* The chord list is compose's ONLY scroll container. overscroll-behavior:auto (not
   contain) so a vertical swipe scrolls smoothly and chains to the page at a boundary. */
.composeChords{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:auto;}
.composeChords::-webkit-scrollbar{width:0;}
/* progression box: the built chords (#prog). The suggestion surface (#suggest) lives
   at the top of the scrolling chord list, not here - keeps the fixed top short. */
.progBox{margin-bottom:8px;}
/* Inline save UI (songbook.js: composeRow/composeToast) - replaces native
   prompt()/alert()/confirm() in the save + solo-backing flows. Rendered on
   demand right above the progression box; zero footprint until used. */
.composeRow{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px;padding:10px;border-radius:12px;background:var(--bg-2);border:1px solid var(--line-strong);}
.composeRow[hidden]{display:none;}
/* Full-viewport dim layer for the save-name modal - a real sibling element
   (songbook.js: composeModalBackdrop), NOT a ::before on the card. A ::before with
   z-index:-1 paints ABOVE the card's own background (CSS stacking order: an
   element's own background paints first/bottom, THEN its negative-z-index children,
   then its in-flow content) - so it would wash out the card instead of sitting
   behind it. A separate, lower-z-index sibling can never repaint over the card. */
.composeModalBackdrop{position:fixed;inset:0;z-index:74;background:rgba(0,0,0,.55);}
.composeModalBackdrop[hidden]{display:none;}
/* Save name-entry as a modal: an OPAQUE --surface card (never blended with the dim
   layer above), anchored near the TOP of the viewport rather than vertical-center -
   a soft mobile keyboard (~50% of a phone viewport) would otherwise cover the input
   and Save/Cancel. max-height + internal scroll is the guard if a short viewport
   still can't fit it. */
.composeRow.asModal{position:fixed;left:50%;top:calc(env(safe-area-inset-top,0px) + 10vh);transform:translateX(-50%);z-index:75;width:calc(100% - 32px);max-width:420px;max-height:76vh;overflow-y:auto;-webkit-overflow-scrolling:touch;margin:0;background:var(--surface);border:1px solid var(--line-strong);box-shadow:0 20px 60px var(--shadow);}
.composeRowInput{flex:1 1 140px;min-width:0;min-height:42px;padding:0 12px;border-radius:var(--r-input);border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);font-family:inherit;font-size:.85rem;}
.composeRowInput:focus{outline:none;border-color:var(--accent-ink);}
.composeRowMsg{flex:1 1 100%;font-size:.78rem;line-height:1.4;color:var(--txt-soft);}
/* Three outcome-named buttons can exceed the modal's min-content width on a phone
   (dragging the whole page into horizontal scroll). The button row WRAPS and every
   button may shrink - labels ellipsize before the sheet ever spills. */
.composeRowBtns{flex:1 1 100%;display:flex;flex-wrap:wrap;gap:8px;}
.composeRowBtns .ctrlBtn{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* "Add to setlist" checkbox on the save row - own line (flex:1 1 100% forces the
   wrap), checkbox + label kept on one compact line together. Full-contrast --txt
   (not --txt-soft) so the label reads clearly on the solid modal card. */
.composeRowSetToggle{flex:1 1 100%;display:flex;align-items:center;gap:8px;font-size:.78rem;color:var(--txt);cursor:pointer;
  min-height:44px;padding:4px 2px;} /* one-handed mobile tap target */
.composeRowSetToggle input{margin:0;width:18px;height:18px;flex:0 0 auto;accent-color:var(--accent);}
/* Save/Cancel on the save-name modal only (scoped to .asModal, not the shared
   .ctrlBtn used by the Compose action bar's own Clear/Save) - >=44px tall tap
   targets. */
.composeRow.asModal .ctrlBtn{min-height:44px;}
.composeToast{margin-bottom:8px;padding:9px 12px;border-radius:10px;font-size:.78rem;font-weight:600;background:var(--accent-deep);color:var(--accent-ink);border:1px solid var(--accent-dim);}
.composeToast.tap{cursor:pointer;} /* persistent toast: tap anywhere on it to dismiss */
.composeToast[hidden]{display:none;}
.composeToast.err{background:var(--bg-2);color:var(--bad);border-color:var(--bad);}
/* TOAST+ACTION host modifier (toast.js Toast.showAction) - any undoable-outcome
   panel (setlist item-remove undo, Compose Clear-undo) adds this class alongside
   its own visual class (.setUndo, .composeRow) so it can host the shared countdown
   .toastBar without each consumer re-declaring position:relative/overflow:hidden. */
.toastAction{position:relative;overflow:hidden;}
/* The countdown bar itself - toast.js creates + times it (Toast.showAction), this
   file only styles it, so its look is identical everywhere it appears. Accent-
   derived (never a hardcoded color); width is animated from JS via an inline
   transition/width pair - this rule supplies the static geometry + color only. */
.toastBar{position:absolute;left:0;bottom:0;height:3px;width:100%;background:var(--accent);pointer-events:none;}
/* prefers-reduced-motion fallback: NO width animation - a static full-width
   stripe for the toast's whole lifetime. The toast still auto-hides at its normal
   duration; only the motion is suppressed. !important guards against toast.js's own
   inline width/transition writes (cheap, explicit insurance). */
.toastBar-static{width:100% !important;transition:none !important;}
/* key/mode fly-out (roots + mode toggle + Triads & Inversions link). The chip that
   opens it lives in the button bar; this is just the drop-down, hidden by default
   (no row when closed). */
/* max-height leaves room for the app header + button bar + progression box +
   tab bar above/below (dvh so mobile URL-bar changes are respected); overflow-y
   is the hard guard - if a pathologically short viewport still can't fit, the
   fly-out scrolls INTERNALLY so the page itself never overflows. */
.keyFlyout{margin:0 0 6px;padding:10px;border:1px solid var(--line-strong);border-radius:12px;background:var(--bg-2);max-height:calc(100dvh - 210px);overflow-y:auto;-webkit-overflow-scrolling:touch;}
.keyFlyout[hidden]{display:none;}
/* While the key/mode fly-out is open, hide the chord picker (In-key|All toggle +
   chord list + solo-backing CTA) so the fly-out uses that freed height and the tab
   fits with no vertical overflow. The underlying chord list still rebuilds on a
   root/mode pick - only hidden, not torn down - so it's current the moment the
   fly-out closes. */
.composeWrap.keyOpen #chordCtrlRow,
.composeWrap.keyOpen .composeChords,
.composeWrap.keyOpen #maxNote{display:none;}
/* the solo scale inside the fly-out gets a top divider from the mode toggle above it */
.keyFlyout .keyView{margin-top:6px;padding-top:8px;border-top:1px solid var(--line);}
/* SINGLE control row, no wrap. DOM order is [♭] [key/mode chip] [♯] [⤢] [?] |
   [Clear] [Save]; VISUAL order (via #cClear{order}, below) moves Clear to the
   front: [Clear] [♭] [chip] [♯] [⤢] [?] | [Save] - this maximizes the on-screen
   distance between Clear and Save so a thumb stretching from an instrument grip
   can't mis-reach, without changing the row's height or which elements are in it.
   Must fit 375px (content width ~347px after the .view 14px side padding). Icon
   buttons and the buttons are compacted here; the chip is a fixed 96px. The spacer
   flexes to push Save right but collapses to 0 first when space is tight, so
   nothing overflows. */
.ctrlBar{display:flex;align-items:center;gap:3px;margin-bottom:9px;flex-wrap:nowrap;}
/* This override used to shrink .iconBtn to 36x42 "so all five controls +
   Clear/Save fit one row" - i.e. it bought horizontal room out of the TAP
   TARGET, which is the one place the space budget never takes it from. It is
   also no longer true: measured at 360px the bar has 71px of .ctrlSpacer slack
   with 36px buttons, so restoring the primitive's 44px costs 24px of slack and
   still leaves 47px. The row keeps its compact type size and small radius; only
   the hit area comes back (issue #311). */
/* Round 14 ("the icons on compose are too small (sharp, flat, etc"): symbol
   glyphs meet the app icon standard (symbol-text >= 20px in a 44px box) -
   .98rem (~15.7px) read as decoration, not controls. Gate: ui-icon-density
   now sweeps Compose too. */
.ctrlBar .iconBtn{font-size:22px;border-radius:var(--r-btn-sm);}
.ctrlSpacer{flex:1 1 0;min-width:0;}
.ctrlBtn{padding:8px 9px;font-size:.78rem;min-height:44px;flex:0 0 auto;}
/* Visual-only resequence (DOM/tab order unchanged - this app is touch-first; see
   composeWireTap/wireTap for the actual tap-safety layer). */
.ctrlBar #cClear{order:-1;}
/* 8-chord cap: gray ALL the choosers so it reads as "no more allowed". .maxed sits on
   .composeWrap so it covers both regions: the all-chords tiles (#buildGrid .chord), the
   IN-KEY cells (.chordCell) and starters (.progPick), and the next-chord suggestion
   chips. */
.maxNote{flex:0 0 auto;font-size:.7rem;color:var(--warn);font-weight:600;margin:0 2px 10px;}
.composeWrap.maxed .keyView .chordGrid .chord,
.composeWrap.maxed #buildGrid .chord,
.composeWrap.maxed .inKeyLead .chordCell,
.composeWrap.maxed .progPick,
.composeWrap.maxed .suggChip{opacity:.35;pointer-events:none;}
/* The compact progression token reuses .suggChip verbatim (same class - not a 4th
   chip variant), but the maxed-dim rule above targets the NEXT-CHORD suggestion
   chip's "add more" role, which must NOT extend to a chord already IN the
   progression - the cap's point is "remove one to add another," so the
   progression's own slots (whichever of full/fill-row/grid6 is active) stay
   tappable at the cap. 4 class selectors beats the 3-class rule above regardless
   of source order. */
.composeWrap.maxed .prog .suggChip{opacity:1;pointer-events:auto;}
/* mode toggle chips are primary controls -> 44px thumb floor (touch target) */
/* solo-scale preview chips - same 44px thumb floor */
/* keyboard focus ring. No border-radius here: the outline follows each element's
   own radius; setting it would square off pill chips/buttons when focused. */
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.search:focus-visible{outline:2px solid var(--accent);outline-offset:0;}
/* keep the "All chords" category chips on the same 44px touch floor as the key controls */
.maxOv{position:fixed;inset:0;z-index:70;background:var(--bg);display:none;flex-direction:column;padding:calc(max(env(safe-area-inset-top,0px), 30px) + 12px) calc(env(safe-area-inset-right,0px) + 14px) calc(env(safe-area-inset-bottom,0px) + 14px) calc(env(safe-area-inset-left,0px) + 14px);}
.maxOv.on{display:flex;animation:fadeUp .24s ease;}
.maxClose{align-self:flex-end;border:1px solid var(--line-strong);background:var(--surface-2);width:40px;height:40px;border-radius:var(--r-btn-sm);font-size:1.1rem;cursor:pointer;color:var(--txt);}
/* Chord-expand grid fills the screen per orientation (one screen, no scroll):
   portrait = 2 per row, rows scroll; landscape = 4 across in a single row that
   fits the height. SVG diagrams scale to their cell via the viewBox. */
.maxGrid{flex:1;display:grid;grid-template-columns:repeat(2,1fr);align-content:start;justify-items:center;gap:18px;padding:14px 4px 22px;overflow:auto;}
.maxGrid .bigC{display:flex;flex-direction:column;align-items:center;width:100%;}
/* Size big chord diagrams by HEIGHT, not width. Every big diagram shares the same
   SVG height (184), but offset shapes (base fret > 1) have a wider canvas because
   the base-fret label extends the viewBox leftward. Width-driven sizing (width:100%)
   therefore shrank the fretboard of offset shapes relative to open ones. Height-driven
   sizing keeps the fret grid a uniform size across every chord. */
.maxGrid .bigC svg{width:auto;height:auto;max-width:100%;max-height:32vh;}
@media (orientation:landscape){
  .maxGrid{grid-template-columns:repeat(4,1fr);align-content:center;gap:12px;overflow:hidden;}
  .maxGrid .bigC svg{width:auto;height:auto;max-width:100%;max-height:62vh;}
}
/* Uses the card radius token (--r-card). */
.bigC{display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer;border-radius:var(--r-card);padding:8px;transition:transform .08s,background .15s;}
.bigC:active{transform:scale(.94);background:var(--surface);}
.bigC .nm{font-family:'Space Mono',monospace;font-weight:700;font-size:1.7rem;color:var(--accent-ink);}
@media (orientation:landscape){.bigC .nm{font-size:1.35rem;}}
.perform{position:fixed;inset:0;z-index:60;background:var(--bg);display:none;flex-direction:column;padding:calc(max(env(safe-area-inset-top,0px), 8px) + 8px) calc(env(safe-area-inset-right,0px) + 16px) 0 calc(env(safe-area-inset-left,0px) + 16px);}
.perform.on{display:flex;}
.pTop{display:flex;justify-content:space-between;align-items:center;gap:10px;flex:0 0 auto;margin-bottom:6px;}
.pTop .pos{font-family:'Space Mono',monospace;color:var(--txt-dim);font-size:.8rem;font-weight:700;}
.pTop .tools{display:flex;gap:6px;align-items:center;}
/* Compact icon buttons use the small-button radius (--r-btn-sm). */
/* Stage icons at 46px (arm's-length / strap-grip targets). */
/* Icon standard (round 6, operator: "is 44px = 22px icon w 11px padding?"):
   YES - icon ink ~50% of the control box (Material: 24dp in 48dp). These are
   SVGs at 23-28px in 46px boxes; text glyphs under-render their font-size
   (ink ~60-70% of it), which is why the stage icons moved OFF font glyphs. */
.pTop .pmini{border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);width:46px;height:46px;border-radius:var(--r-btn-sm);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
.pTop .pmini svg,.pTop .x svg,.pNav .btn svg{display:block;}
.pTop .pmini:active{background:var(--accent);color:var(--on-accent);}
.pTop .x{border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);width:46px;height:46px;border-radius:var(--r-btn-sm);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
/* Title + artist + key flow inline on one row (wrap to a 2nd only if the title
   is long), baseline-aligned, to reclaim vertical space for the sheet - one row
   in landscape where width is ample (operator UAT). */
.pHead{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:9px;row-gap:1px;flex:0 0 auto;margin-bottom:5px;}
.pTitle{font-weight:800;font-size:1.2rem;line-height:1.12;letter-spacing:-.02em;}
.pArtist{font-size:.8rem;color:var(--txt-dim);}
/* Same small-pill treatment as the Library's .li-capo badge (S-DS registry) -
   the Stage never showed a track's capo (P1-5), so a capo'd-up performer had
   no reminder while actually playing. */
.pCapo{font-family:'Space Mono',monospace;font-weight:700;font-size:.72rem;color:var(--brass);background:var(--accent-deep);border:1px solid var(--accent-dim);padding:1px 6px;border-radius:6px;flex:0 0 auto;}
/* P1-6: the glance key line is the fastest thing a performer's eye checks
   mid-song - it must read at LEAST as large as the artist line beneath the
   title (previously .7rem, smaller than .pArtist's .8rem), with a 13px
   absolute floor regardless of the root font size.
   max(13px, .85rem) makes that floor REAL: .85rem alone is 13.6px only at a
   16px root - a smaller root (browser text setting, accessibility profile)
   silently dropped it under 13px, and the test, which runs at the default
   root, could never see it (volley-1). main still carried the pre-P1-6 .7rem
   here; this PR's value wins, which is the whole point of P1-6. */
.pKey{font-family:'Space Mono',monospace;font-size:max(13px, .85rem);color:var(--accent-ink);font-weight:700;}
/* WRAP-FIRST sizing model (songbook.js fitStageSheet): the sheet renders at
   the USER's size (--pscale, buttons + pinch, persisted) with long lines
   wrapped to the measured character budget; overflow-y scrolls a tall sheet.
   touch-action pan-y: one finger pans the sheet natively; the two-finger
   pinch (font size) is handled in JS. */
/* CORE INVARIANT (sizing model v3): the Perform sheet NEVER scrolls
   horizontally - overflow-x is hidden and width is absorbed by
   auto-fit-then-wrap. Landed in #302 and kept wholesale through this merge;
   z-index:1 is #305's deterministic stacking. This PR changes neither. */
.pSheet{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:4px 2px 100px;font-family:'Space Mono',monospace;position:relative;z-index:1;--pscale:1;touch-action:pan-y;}
/* pInner shrink-wraps to its widest pre line so fitStageSheet's scrollWidth
   measurement sees the CONTENT width (a plain block would fill pSheet and
   hide row overflow from the re-measure pass). */
.pSheet .pInner{width:max-content;}
/* Chords-view rows wrap their bars at the sheet's content width: --pavail is
   set by fitStageSheet (padding-aware). Without the cap the width:max-content
   pInner would stretch .chordOnly into ONE long unwrapped line - the exact
   horizontal overflow the invariant above forbids. */
.pSheet .chordOnly{max-width:var(--pavail,100%);}
.pSheet::-webkit-scrollbar{width:0;}
/* font-size scales with --pscale (perform Size control / pinch) */
.pSheet .lyrLine{font-size:calc(1.04rem * var(--pscale));line-height:1.35;margin-bottom:11px;}
.pSheet .chordOnly{font-size:calc(1.35rem * var(--pscale));line-height:1.85;}
.pSheet .sect{font-size:calc(.82rem * var(--pscale));margin:17px 0 8px;}
/* Explicit z-index (not left to DOM-order accident): .pSheet(1) < .pNav(5) <
   .pSpeed(6). The nav must always paint above the scrolling lyric sheet
   beneath it, and the settings popover must always paint above the nav if
   their boxes ever touch - deterministic regardless of markup order. */
.pNav{position:absolute;left:16px;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 14px);display:flex;gap:8px;align-items:stretch;z-index:5;}
.pNav .btn{padding:14px 10px;flex:1;display:inline-flex;align-items:center;justify-content:center;}
/* One-handed performance zoning. Advance (Next / finish) is the ONE control tapped
   constantly mid-song, so it becomes the dominant bottom-RIGHT target - the natural
   thumb-arc resting spot for a one-handed grip - ~2.6x the width of Prev and taller
   (a big target you can hit without aiming, Fitts's law). Prev (rarely used
   mid-performance) shrinks to a small left tab. Transpose is demoted OUT of the
   chrome entirely - it lives in the gear sheet's Key row. */
.pNav #pNext{flex:2.6;padding-top:19px;padding-bottom:19px;}
/* #pPrev is a ghost/secondary button (base .btn.ghost = fully transparent)
   sitting directly over the scrolling lyric sheet - transparent disappears
   into the text behind it (operator UAT: "back button transparent"). Give it
   the same frosted-glass scrim as .appbar (var(--appbar-bg) + blur) so it
   stays legible over any content while remaining visually secondary to the
   filled #pNext. ID selector so it deterministically beats the shared
   .btn.ghost rule regardless of source order. */
.pNav #pPrev{flex:1;color:var(--txt-dim);background:var(--appbar-bg);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);}
.pNav .scrollBtn{flex:0 0 auto;width:60px;}
/* Settings popover sits ABOVE the nav bar with a clear gap. The old +74px let
   its bottom edge collide with the tall #pNext (~63px + 14px bottom = ~77px top)
   in portrait (operator UAT: "settings panel overlapping bottom controls");
   +92px clears it. Both share env(safe-area-inset-bottom), so the relative gap
   is stable across devices. */
.pSpeed{position:absolute;left:16px;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 92px);display:none;flex-direction:column;gap:9px;background:var(--surface);border:1px solid var(--line-strong);border-radius:11px;padding:11px 13px;z-index:6;}
.pSpeed.on{display:flex;}
.pSpeed .psRow{display:flex;align-items:center;gap:11px;}
.pSpeed label{flex:0 0 42px;font-size:.62rem;text-transform:uppercase;letter-spacing:.1em;color:var(--txt-dim);font-weight:700;}
.pSpeed input{flex:1;accent-color:var(--accent-ink);}
.pSpeed .sv{font-family:'Space Mono';font-weight:700;font-size:.74rem;color:var(--accent-ink);width:30px;text-align:right;}
.pSpeed .psBtns{flex:1;display:flex;gap:6px;}
/* min-height is the 44px tap-target floor, not decoration: .78rem text with
   8px vertical padding computes to a 33px box (measured at 412x915), which is
   under the floor for every control in this popover. The floor comes out of
   the popover's own height, never out of the button - per the space budget,
   a tap target is the last thing that may shrink. */
.pSpeed .psBtn{flex:1;min-height:44px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt-soft);font-family:inherit;font-weight:600;font-size:.78rem;padding:8px 6px;border-radius:8px;cursor:pointer;transition:background .15s,color .15s,transform .08s;}
.pSpeed .psBtn:active{transform:scale(.94);}
.pSpeed .psBtn.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent-ink);}
/* a disabled Stage view button (Lyrics/Both on a chord-only sheet) must LOOK
   disabled, matching the practice modeSwitch. */
.pSpeed .psBtn:disabled{opacity:.35;cursor:default;}
/* Key-transpose steppers are safety-critical (a mis-tap changes the performed
   key mid-song, not just a view toggle) - give them their own >=44px tap
   target instead of the shared flex:1 settings-row treatment; View/Size stay
   on the shared .psBtn look untouched. */
.pSpeed .psRowKey .psBtns{flex:0 0 auto;gap:10px;}
.pSpeed .psRowKey .psBtn{flex:0 0 44px;width:44px;height:44px;font-size:1.2rem;padding:0;}
/* Landscape only: collapse the Stage View+Size controls into a SINGLE row and
   shrink the header so the sheet keeps the vertical room. Landscape guarantees
   width > height, so the one row always has horizontal space; a narrow SHORT
   PORTRAIT must NOT trigger this (label + 3 View buttons at ~half width would
   overlap), which is why there's no bare max-height branch. Placed AFTER the base
   .pSpeed rules so the row override wins on source order. */
@media (orientation:landscape){
  .perform{padding-top:calc(max(env(safe-area-inset-top,0px), 4px) + 4px);padding-right:calc(env(safe-area-inset-right,0px) + 12px);}
  .pTop{margin-bottom:3px;}
  /* Landscape vertical space goes to the MUSIC. The header lines are flex items
     (blockified - inline can't merge them), so they TIGHTEN instead: smaller
     title, zeroed margins, ~48px total for all three (pKey grew a few px for
     the P1-6 legibility floor, still >= pArtist here too). */
  .pTitle{font-size:.95rem;line-height:1.1;}
  .pArtist{font-size:.72rem;margin:0;}
  .pKey{font-size:.82rem;margin-bottom:2px;}
  /* ...and the nav becomes a RIGHT-EDGE thumb column below the top bar: Next
     dominant (Fitts's law, strap-grip thumb arc), Prev small beneath it. The
     sheet is padded clear of the column so chords can never run under the next
     button. */
  .pNav{left:auto;flex-direction:column;width:104px;gap:8px;top:calc(max(env(safe-area-inset-top,0px), 4px) + 64px);right:calc(env(safe-area-inset-right,0px) + 12px);bottom:calc(env(safe-area-inset-bottom,0px) + 10px);}
  .pNav #pNext{flex:2.6;padding:10px;font-size:1.6rem;}
  .pNav #pPrev{flex:1;padding:10px;}
  .pNav .scrollBtn{width:auto;}
  .pSheet{padding-right:120px;padding-bottom:16px;}
  .pSpeed{flex-direction:row;flex-wrap:nowrap;gap:8px 14px;bottom:calc(env(safe-area-inset-bottom,0px) + 10px);right:132px;}
  .pSpeed .psRow{flex:1 1 30%;min-width:0;}
  .pSpeed .psBtns{min-width:0;}
  .pSpeed .psBtn{min-width:0;padding:8px 4px;font-size:.72rem;}
  /* The 44px safety floor holds in landscape too - a key-change mis-tap is
     just as costly with a wider viewport. */
  .pSpeed .psRowKey{flex:0 0 auto;}
  .pSpeed .psRowKey .psBtns{min-width:0;flex:0 0 auto;}
  .pSpeed .psRowKey .psBtn{min-width:44px;width:44px;height:44px;font-size:1.1rem;padding:0;}
}
.perform.dim{background:var(--stage-bg);}
.perform.dim .lyrLine{color:var(--stage-ink);}
.perform.dim .lyrLine .crd{color:var(--stage-amber);}
.perform.dim .chordOnly{color:var(--stage-amber);}
.perform.dim .chordOnly .bar{color:var(--stage-ink);background:var(--stage-panel);border-color:var(--stage-line);}
.perform.dim .sect{color:var(--stage-amber);}
.perform.dim .pTitle,.perform.dim .pArtist,.perform.dim .pos{color:var(--stage-ink);}
.perform.dim .pKey{color:var(--stage-amber);}
.perform.dim .pCapo{color:var(--stage-ink);background:var(--stage-panel);border-color:var(--stage-line);}
.perform.dim .x,.perform.dim .pmini{color:var(--stage-ink);border-color:var(--stage-line);background:var(--stage-panel);}
.perform.dim .btn{background:var(--stage-amber);color:var(--stage-on-amber);border-color:var(--stage-amber);}
.perform.dim .btn.ghost{background:transparent;color:var(--stage-ink);border-color:var(--stage-line-soft);}
/* Dim-mode #pPrev override: the fixed black teleprompter stage doesn't follow
   --appbar-bg (which is theme-linked), so it needs its own translucent scrim
   (--stage-scrim) to stay legible over scrolling stage content. ID selector
   (specificity beats the .btn.ghost class rules above regardless of order) so
   this deterministically wins over both the light-mode #pPrev rule and the
   general dim ghost-button rule. */
.perform.dim #pPrev{background:var(--stage-scrim);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);}
.perform.dim .pSpeed{background:var(--stage-panel);border-color:var(--stage-line);}
.perform.dim .pSpeed label{color:var(--stage-ink-dim);}
.perform.dim .pSpeed .psBtn{background:var(--stage-panel-2);border-color:var(--stage-line);color:var(--stage-ink-soft);}
.perform.dim .pSpeed .psBtn.on{background:var(--stage-amber);color:var(--stage-on-amber);border-color:var(--stage-amber);}
footer{display:none;}

/* Triads & Inversions deep-dive: full-screen in-app modal (iframe of
   triad-inversions.html), opened from the key fly-out. Mirrors the curate
   overlay; the iframed page self-themes off music.theme.v1. */
.invModal{position:fixed;inset:0;z-index:70;display:none;align-items:stretch;justify-content:center;background:rgba(0,0,0,.6);}
.invModal.on{display:flex;}
.invModal-box{position:relative;width:100%;max-width:600px;height:100%;background:var(--bg);display:flex;flex-direction:column;box-shadow:0 0 40px rgba(0,0,0,.5);}
.invModal-x{position:absolute;top:calc(max(env(safe-area-inset-top,0px),8px));right:10px;z-index:2;width:38px;height:38px;border-radius:var(--r-btn-sm);border:1px solid var(--line-strong);background:var(--surface-2);color:var(--txt);font-size:1.05rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;}
.invModal-x:active{transform:scale(.9);background:var(--accent);color:var(--on-accent);}
.invModal-frame{flex:1;width:100%;border:0;background:var(--bg);}

/* Subtle transient toast (add-to-setlist cue etc). Sits above the tab bar. */
/* Boot-failure detail line (play/index.html fail()) - the technical residue
   under the data-safe reassurance, quiet by design. */
.failDetail{font-size:.7rem;color:var(--txt-dim);word-break:break-word;}
.empty .btn{flex:0 1 auto;display:inline-block;margin-top:2px;}
.toast{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 80px);transform:translateX(-50%) translateY(8px);background:var(--surface-2);color:var(--txt);border:1px solid var(--line-strong);border-radius:11px;padding:9px 16px;font-size:.82rem;font-weight:600;box-shadow:0 8px 24px var(--shadow);opacity:0;pointer-events:none;z-index:80;transition:opacity .2s ease,transform .2s ease;}
.toast.on{opacity:1;transform:translateX(-50%) translateY(0);}
/* SW update-ready cue: a PERSISTENT tap-to-reload toast (the rendered page is
   stale until acted on, so it never auto-hides). A real button - it accepts
   the tap plain toasts pass through. Accent border marks it actionable. */
.swUpdateToast{pointer-events:auto;cursor:pointer;border-color:var(--accent-dim);color:var(--accent-ink);font-family:inherit;}
/* Action toast - a tappable follow-through button rides the toast ("Go to
   setlist"). Only action toasts accept pointer events; plain toasts stay
   tap-through. .toastGo (not .toastAction - that's the progress-bar variant
   above). */
.toast.withAct{display:flex;align-items:center;gap:12px;pointer-events:auto;padding:6px 6px 6px 16px;max-width:calc(100vw - 24px);}
.toastGo{border:0;border-radius:var(--r-btn-sm);background:var(--accent);color:var(--on-accent);font-weight:800;font-size:.82rem;padding:10px 14px;min-height:44px;cursor:pointer;flex:0 0 auto;white-space:nowrap;}
.toastGo:active{background:var(--accent-dim);}
/* Semantic toast variants (same colored-border + colored-text discipline as
   .btn.danger / .maxNote). warn=amber CAUTION (a heads-up, e.g. "you already
   have a song in progress"), err=red FAILURE. Two different meanings never
   share one look (Element Consistency Law): amber is never a failure, red is
   never a mere caution. Text always carries the full meaning too, so the
   colour is reinforcement, not the sole signal (a11y: not colour-alone). */
.toast.warn{color:var(--warn);border-color:var(--warn);}
.toast.err{color:var(--bad);border-color:var(--bad);}

/* HELP-icon convention: a portable, CSS-only marker for an always-available
   explainer toggle - add this class ALONGSIDE a toggle's own class (e.g.
   class="bt-st-why-toggle helpIcon") to prefix its label with a small (i)-style
   glyph, no markup change needed. Declared here (not tracks.css) so it is reusable
   app-wide - songbook.css loads on every page. */
.helpIcon::before{content:'\24D8';margin-right:.35em;opacity:.75;font-weight:400;}

/* ACCORDION: the EXCLUSIVE disclosure-group primitive - shared/accordion.js owns
   the one-open-at-a-time state machine; this .accSec/.accBtn/.accBody family is its
   ONE visual (never hand-roll a second accordion look). For PANEL surfaces
   (sheets/dialogs) with a single scroller; Compose stays flattened (no accordions)
   for screen scrollers. Declared here (not a page style) for the same app-wide-SSOT
   reason as .helpIcon above. */
/* UAT batch 4 ("accordion items need individual distinction... not clear it's
   accordions... space very small between?"): the sections used to be flush rows
   separated by a hairline, which is the visual grammar of a LIST, not of a set of
   independently openable panels - so nothing said "these open". Each section is
   its own card with real space between: the mobile settings convention (grouped
   cards, iOS/Material both), where the gap is what says "separate thing". */
.accSec{background:var(--surface-2);border:1px solid var(--line-strong);
  border-radius:var(--r-card);margin-bottom:10px;overflow:hidden;}
.accSec:last-of-type{margin-bottom:2px;}
/* Header treatment: section titles must READ as tappable headings, not plain text
   rows - heavier + larger than body text with an EXPLICIT expand affordance: an
   accent-ink chevron (readable-on-surface interactive ink in BOTH themes) that
   rotates open, plus press feedback. Fixed here at the primitive, never per
   instance. */
.accBtn{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:52px;
  padding:14px;background:none;border:0;color:var(--txt);font-family:inherit;font-weight:800;
  font-size:1.08rem;letter-spacing:.01em;text-align:left;cursor:pointer;transition:transform .08s;}
/* Open state: a hairline between the header and its body, the standard cue that
   this card is the expanded one. Keyed off the button's own aria-expanded rather
   than the section, so it needs no :has() and cannot disagree with the a11y
   state that drives it. */
.accBtn[aria-expanded="true"]{border-bottom:1px solid var(--line);}
/* The section header must OUTRANK its inner .setLbl labels (Appearance > Theme is
   a hierarchy), so the primitive steps up to 800/1.08rem. Fixed here at the
   primitive: every accordion consumer gets the same heading weight. */
/* UAT batch 4 ("accordion expand handle not mobile std"): was a filled triangle
   glyph (U+25BE) at ~0.95em - the shape a desktop <select> uses, and small enough
   to read as decoration. A stroke CHEVRON is the mobile disclosure standard
   (Material expand_more / the iOS grouped-list chevron). Drawn from two borders
   rather than a font glyph so the stroke weight is ours at every DPI and it never
   depends on a glyph the device may not have. The 45deg box is optically low, so
   the box is nudged up; the open state rotates through the top, not the bottom. */
.accBtn::after{content:'';flex:0 0 auto;width:11px;height:11px;margin:-4px 2px 0 0;
  border-right:2px solid var(--accent-ink);border-bottom:2px solid var(--accent-ink);
  transform:rotate(45deg);transform-origin:center;transition:transform .18s;}
.accBtn[aria-expanded="true"]::after{transform:rotate(-135deg);margin:4px 2px 0 0;}
.accBtn:active{transform:scale(.99);} /* the .listItem press language, not the no-scale close family */
.accBody{padding:12px 14px 16px;}
/* An author display rule on the SAME element defeats [hidden] - .accBody carries
   no display rule today, but this guard keeps the collapse honest if one is ever
   added. */
.accBody[hidden]{display:none;}

/* The one-shot dismissible "notable" banner, produced by Notables.renderBanner()
 * in shared/notables.js. Uses the dedicated --guide-bg/--guide-line GUIDANCE
 * tokens (computed off --txt-dim - an accent-INDEPENDENT hue, not the
 * --accent-deep/-dim SELECTION family) PLUS a --brass left accent stripe for a
 * touch of theme personality without tinting the whole surface, so a notable reads
 * as "the app talking", distinct from an in-setlist selected row (.listItem.inSet,
 * still accent-deep/-dim). The dismiss icon uses --txt-soft, not --accent-ink, to
 * keep the control neutral (accent-ink falls below the 4.5:1 contrast floor against
 * --guide-bg in light theme). Own class (not folded into .setUndo) so a notable
 * stays shown-once-forever, not a scoped undo toast. */
.notableBanner{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--guide-bg);border:1px solid var(--guide-line);border-left:3px solid var(--brass);border-radius:11px;padding:10px 12px 10px 10px;margin-bottom:9px;font-size:.82rem;color:var(--txt-soft);}
.notableBanner-body{flex:1;min-width:0;line-height:1.4;}
.notableBanner-x{flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:1px solid var(--guide-line);background:transparent;color:var(--txt-soft);font-size:1.45rem;line-height:1;border-radius:9px;cursor:pointer;transition:transform .08s,background .15s,color .15s;}
.notableBanner-x:active{transform:scale(.9);color:var(--txt);}

/* =====================================================================
 * The Settings "Skills" panel - the per-skill competency profile viewer
 * (self-injected into #settingsBody by songbook.js mountSkillsPanel()). Uses
 * the shared .accSec/.accBtn/.accBody look for the section shell; the pieces
 * below are the panel's own primitives. .compBar is a competency-level meter,
 * deliberately NOT reusing .prog (the chord-progression strip): two different
 * meanings never share one look.
 * ===================================================================== */
.skillsPanel .skillsImportRow{margin-top:10px;}
.skillRow{border:1px solid var(--line);border-radius:var(--r-card);background:var(--surface);margin-top:10px;overflow:hidden;}
.skillHead{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:2px 10px;width:100%;min-height:44px;padding:11px 13px;background:transparent;border:0;color:var(--txt);font-family:inherit;font-weight:700;font-size:1rem;cursor:pointer;text-align:left;transition:background .15s;}
.skillHead:active{background:var(--surface-2);}
.skillHead[aria-expanded="true"]{border-bottom:1px solid var(--line);}
/* UAT 2026-10-04 (392px): the status was flex:0 0 auto - it never shrank or
   wrapped - so a long one ("not yet assessed - 1 observed in the app") crushed
   the name to one letter per line. The head wraps instead: the name keeps a
   9rem basis, and a status that does not fit beside it drops below, where it
   may itself wrap. Guarded by test/pw/scenarios/profile-row-layout.json. */
.skillName{flex:1 1 9rem;min-width:0;overflow-wrap:break-word;}
.skillMeta{flex:0 1 auto;min-width:0;max-width:100%;overflow-wrap:anywhere;font-family:'Space Mono',monospace;font-size:.74rem;color:var(--txt-dim);font-weight:400;}
.skillDetail{padding:6px 13px 12px;}
.skillDetail[hidden]{display:none;}
.compRow{display:grid;grid-template-columns:1fr;gap:3px;padding:8px 0;border-top:1px solid var(--line);}
.compRow:first-child{border-top:0;}
.compName{font-size:.86rem;color:var(--txt-soft);}
.compBar{height:8px;border-radius:6px;background:var(--bg-2);border:1px solid var(--line);overflow:hidden;}
.compBarFill{height:100%;background:var(--accent);border-radius:6px 0 0 6px;transition:width .3s ease;}
.compMeta{font-family:'Space Mono',monospace;font-size:.72rem;color:var(--txt-dim);}
.skillPref{margin-top:8px;font-size:.8rem;color:var(--txt-soft);line-height:1.4;}
/* M-MUSICIAN-PROFILE-VNEXT: the headline ("what kind of musician am I?") - one
   short line per group, read before any row is opened; and the area subhead
   inside the Musicianship row (Ear / Harmony / ...). Both compose the existing
   type scale; neither is a new control. */
.profileHead{margin-top:10px;}
.profileLine{margin:0 0 4px;font-size:.88rem;font-weight:700;color:var(--txt);line-height:1.35;}
.compArea{margin:10px 0 0;font-family:'Space Mono',monospace;font-size:.7rem;letter-spacing:.04em;text-transform:uppercase;color:var(--txt-dim);}
.skillGoals .planLink{margin-top:6px;}
.skillActs{margin-top:12px;display:flex;}
.skillExport{flex:0 0 auto;min-height:44px;}

/* =====================================================================
 * PLAY-PAGE CHROME: the appbar-adjacent controls, the Settings sheet, the
 * About rows, and the first-run welcome tour. play/index.html is the only
 * consumer; living here keeps every component rule in the one theme file
 * and inside the SW CORE cache (all CSS is external, no inline styles).
 * ===================================================================== */
/* the instrument/tuning select (lives in Settings > Preferences) */
.picker{background:var(--surface-2);color:var(--txt);border:1px solid var(--line-strong);border-radius:10px;
  font-family:inherit;font-size:.8rem;font-weight:600;padding:8px 10px;max-width:46vw;cursor:pointer;}
.picker:focus{outline:none;border-color:var(--accent);}
.picker:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
/* accent swatches - rendered inline in the Settings sheet (accentSwatches) */
.sw{width:30px;height:30px;border-radius:50%;cursor:pointer;border:2px solid transparent;padding:0;
  background:var(--sc);transition:transform .08s;}
.sw:active{transform:scale(.88);}
.sw.on{border-color:var(--txt);box-shadow:0 0 0 2px var(--surface-2),0 0 0 4px var(--sc);}
/* Settings sheet (gear in the appbar): accent + backup/restore + build. Bottom
   sheet on phone; the accent chooser lives here, not the Tune tab. Structure:
   sticky .setHd top, scrollable .setPanelBody middle, sticky .setFoot bottom - a
   plain flex column. The card's own height is auto up to max-height, so short
   content never leaves a gap above the footer; only when content exceeds
   max-height does .setPanelBody actually scroll. */
#settingsBtn{line-height:0;}
#settingsBtn svg{width:21px;height:21px;display:block;}
.setOv{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;
  background:rgba(0,0,0,.6);animation:fadeUp .18s ease;
  padding:0 12px calc(12px + env(safe-area-inset-bottom));}
.setOv[hidden]{display:none;}
/* The first-run 3-panel welcome sheet. Same overlay family as .setOv; panels are
   horizontal scroll-snap so a swipe OR the Next button advances. */
.welcomeOv{position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.6);animation:fadeUp .18s ease;padding:18px 14px;}
.welcomeOv[hidden]{display:none;}
.welcomeCard{position:relative;width:100%;max-width:440px;max-height:86dvh;display:flex;flex-direction:column;
  background:var(--surface-2);border:1px solid var(--line-strong);border-radius:16px;
  box-shadow:0 14px 40px rgba(0,0,0,.55);padding:14px 0 14px;}
.welcomeCard .x{position:absolute;top:4px;right:4px;z-index:1;background:none;border:0;color:var(--txt-dim);
  font-size:1.1rem;cursor:pointer;padding:0;display:inline-flex;align-items:center;justify-content:center;
  min-width:44px;min-height:44px;}
.wPanels{display:flex;overflow-x:auto;overflow-y:auto;scroll-snap-type:x mandatory;scrollbar-width:none;
  -webkit-overflow-scrolling:touch;min-height:0;}
.wPanels::-webkit-scrollbar{display:none;}
.wPanel{flex:0 0 100%;scroll-snap-align:start;padding:8px 18px 4px;box-sizing:border-box;}
.wPanel h2{margin:0 0 10px;font-size:1.2rem;font-weight:800;letter-spacing:-.01em;padding-right:40px;}
.wLead{margin:0 0 12px;font-size:.84rem;color:var(--txt-soft);line-height:1.45;}
.wLead b{color:var(--txt);}
/* Offline promise, elevated (UAT): a status chip at the top of the welcome
   panel so the "works offline" message reads prominently and can't be missed -
   the old toast that stated it (and overlapped Start) is suppressed while this
   panel is up. */
.wOffline{display:flex;align-items:center;gap:9px;margin:0 0 14px;padding:10px 12px;font-size:.82rem;line-height:1.4;
  color:var(--accent-ink);background:var(--accent-deep);border:1px solid var(--accent-dim);border-radius:var(--r-btn-sm);font-weight:600;}
.wOfflineDot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 30%,transparent);}
/* .askOpt - THE option-row primitive: one look for every "pick one" list - the
   welcome tour's instrument + level panels AND the in-app ask banners (.glAskOpt
   guidance level, .dgPrefOpt diagram pref). Neutral line-strong border at rest
   (GUIDANCE surfaces must not borrow the SELECTION token --accent-dim); .on is the
   selected state. */
.askOpt{display:block;width:100%;text-align:left;background:transparent;border:1px solid var(--line-strong);
  border-radius:var(--r-btn-sm);color:var(--txt);padding:10px 12px;margin-bottom:8px;min-height:44px;font-size:.88rem;
  font-family:inherit;cursor:pointer;transition:background .15s,border-color .15s,color .15s;}
.askOpt.on{border-color:var(--accent-ink);background:var(--accent-deep);color:var(--accent-ink);font-weight:700;}
.askLbl{margin-bottom:8px;font-weight:600;}
.wMap{list-style:none;margin:0;padding:0;}
.wMap li{display:flex;flex-direction:column;gap:2px;padding:10px 0;font-size:.84rem;color:var(--txt-soft);
  line-height:1.4;border-bottom:1px solid var(--line);}
.wMap li:last-child{border-bottom:0;}
.wMap b{color:var(--txt);font-size:.9rem;}
.wFoot{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:12px 18px 0;gap:12px;}
/* Single-panel tour: the lone "Start playing" CTA spans the footer (flex:1),
   reading as the one prominent primary action. (Dots are absent now; the
   space-between + flex:1 still lays out cleanly if panels are ever restored.) */
.wFoot .btn{min-height:48px;padding:12px 22px;flex:1;}
.wDots{display:flex;gap:7px;}
.wDot{width:8px;height:8px;border-radius:50%;background:var(--line-strong);transition:background .2s;}
.wDot.on{background:var(--accent);}
/* First-run per-tab callouts (callouts.js). A non-blocking coach-mark: a
   pulsing ring hugs the target + a small label names the ONE action. The layer
   sits BELOW the welcome overlay (z 65 < 70) and is pointer-events:none, so
   every tap falls straight through to the real control it points at. */
.coLayer{position:fixed;inset:0;z-index:65;pointer-events:none;}
.coRing{position:fixed;border-radius:10px;box-sizing:border-box;}
.coRing.coPrimary{border:2px solid var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 34%,transparent),0 0 14px color-mix(in srgb,var(--accent) 50%,transparent);
  animation:coPulse 1.4s ease-in-out infinite;}
.coRing.coMuted{border:1.5px dashed var(--brass);opacity:.8;}
.coLabel{position:fixed;max-width:min(72vw,240px);padding:7px 11px;border-radius:9px;font-size:.8rem;line-height:1.3;
  font-weight:600;box-shadow:0 6px 18px rgba(0,0,0,.4);}
.coLabel.coPrimary{background:var(--accent);color:var(--on-accent);border:1px solid var(--accent-ink);}
.coLabel.coMuted{background:var(--surface-2);color:var(--txt-soft);border:1px solid var(--line-strong);font-weight:500;font-size:.74rem;}
@keyframes coPulse{
  0%,100%{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 34%,transparent),0 0 14px color-mix(in srgb,var(--accent) 50%,transparent);}
  50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--accent) 16%,transparent),0 0 22px color-mix(in srgb,var(--accent) 32%,transparent);}
}
@media (prefers-reduced-motion:reduce){.coRing.coPrimary{animation:none;}}
/* The instrument picker inside Settings > Preferences. Overrides .picker's compact
   sizing (max-width:46vw, .8rem) - here it is a full Settings row: bigger type +
   44px floor. */
.setPicker{width:100%;max-width:100%;margin-bottom:4px;font-size:.95rem;padding:12px;min-height:44px;}
/* Settings sheet title carries the same gear glyph as the appbar button - icon
   takes currentColor beside the word. */
.setHdTitle{display:flex;align-items:center;gap:8px;}
/* Tune tab spacing + annotations. */
#tuneTuneRow .sub{margin:14px 0 8px;}
.refSub{margin-top:22px;margin-bottom:10px;}
.subNote{font-weight:400;font-style:italic;color:var(--ink-faint);font-size:.8rem;}
.chipTuning{opacity:.55;font-weight:400;}
.setCard{width:100%;max-width:520px;max-height:86dvh;display:flex;flex-direction:column;overflow:hidden;
  background:var(--surface-2);border:1px solid var(--line-strong);border-radius:16px 16px 0 0;
  box-shadow:0 -14px 40px rgba(0,0,0,.55);}
.setHd{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;
  padding:16px 16px 10px;border-bottom:1px solid var(--line-strong);}
.setHd h2{margin:0;font-size:1.15rem;}
.setHd .x{background:none;border:0;color:var(--txt);font-size:1.3rem;cursor:pointer;padding:0;
  display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;}
.setPanelBody{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 16px;-webkit-overflow-scrolling:touch;}
/* Sections are .accSec/.accBtn/.accBody (the shared accordion primitive); every
   "do a thing" row inside one is .setAction, below. The retired .setRow carried a
   real gotcha worth keeping: a <button> with no background falls back to the UA
   light grey, which on the dark theme renders as a washed-out bar with
   near-invisible text - so an action row must always set its own surface, border
   and color explicitly (button text inherits neither font nor color). */

/* ACTION ROW - the ONE primitive for "do a thing" inside a settings-style panel
   (UAT batch 5: "too cluttered w text. simplicity FTW. UI standard layout? for
   export etc buttons, min prose"). Before this, six rows doing the same job wore
   FOUR different looks - a bordered .setRow card with a stacked description, an
   .aboutLink with an icon and a wrapping sentence, a pair of .btn.ghost, and a
   raw URL as body text.

   The rule, per component-conventions.md: ONE ROW = ONE ACTION. Leading icon
   slot, a verb-first label on ONE line, and an optional trailing affordance.
   Descriptions do NOT go on the row - a group gets at most one caption above it.
   The label is nowrap+ellipsis on purpose: a label that would truncate is too
   long and must be shortened at the source, not wrapped to buy itself a second
   line. .saMeta is the ONE sanctioned trailing extra, and only for live STATE
   (a last-backup timestamp), never for description. */
.setAction{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;margin-top:8px;
  padding:0 12px;background:var(--surface-2);border:1px solid var(--line-strong);
  border-radius:var(--r-btn-sm);color:var(--txt);font-family:inherit;font-size:.92rem;
  font-weight:600;text-align:left;cursor:pointer;text-decoration:none;
  transition:transform .08s,background .15s,border-color .15s;}
.setAction:active{transform:scale(.99);background:var(--accent-deep);border-color:var(--accent-dim);}
.setAction:focus-visible{outline:2px solid var(--accent-dim);outline-offset:2px;}
/* The label takes the slack; nowrap+ellipsis is the guard that keeps a row one line. */
.setAction .saLbl{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* Live state only (last backup / last restore) - never a description. */
.setAction .saMeta{flex:0 0 auto;font-size:.72rem;font-weight:600;color:var(--txt-dim);}
/* Leading icon + trailing affordance glyph both hold their size. */
.setAction svg{flex:0 0 auto;}
.setAction .saGo{flex:0 0 auto;color:var(--accent-ink);font-weight:700;}
/* An action row that LEAVES the app takes the external-link ink (the Links
   convention), so "opens a doc in a new tab" still reads differently from
   "does something here" without needing a sentence to say so. */
.setAction.saExt{color:var(--brass);}
.setAction.saExt .saGo{color:var(--brass);}

/* DISCLOSURE - "for those interested" content that must never become a step
   (UAT batch 6: "the agent interactions and instructions and prompts should be
   visible and viewable so they know what we're doing with their system IF THEY
   SHOULD CHOOSE"). A <details> whose summary composes the same .setAction row,
   so the app has one row look whether the row acts or reveals. The marker is
   replaced by the accordion's own chevron for the same reason: one disclosure
   language app-wide, not a native triangle beside our drawn chevrons. */
.agentDisclose{margin-top:8px;}
.agentDisclose > summary{list-style:none;cursor:pointer;}
.agentDisclose > summary::-webkit-details-marker{display:none;}
.agentDisclose > summary::after{content:'';flex:0 0 auto;width:11px;height:11px;margin:-4px 2px 0 0;
  border-right:2px solid var(--accent-ink);border-bottom:2px solid var(--accent-ink);
  transform:rotate(45deg);transform-origin:center;transition:transform .18s;}
.agentDisclose[open] > summary::after{transform:rotate(-135deg);margin:4px 2px 0 0;}
/* The revealed rows sit slightly inset so they read as belonging to the summary
   rather than as peers of Export/Import above it. */
.agentDisclose > :not(summary){margin-left:10px;}
.agentDisclose .setHint{margin:10px 0 6px 10px;}
/* About section link rows: external-link ink (--brass, the Links convention) +
   inline-SVG icon taking currentColor; 44px touch floor. */
/* AI Agent section (round 16): the copy buttons ride one row under the live
   doc links; the URI hint beneath them shows WHERE the docs live (SSOT -
   resolved from location at boot, so previews and localhost tell their own
   truth). Reuses .btn.ghost + .setHint - no new visual language. */
#agentUriHint{word-break:break-all;margin-bottom:4px;}
/* UAT batch 4 ("settings text too similar to sections"): .setLbl sat at 600 /
   ~1rem against an .accBtn at 800 / 1.08rem - a step too small to read as a
   hierarchy, so "Theme" looked like a peer of "Appearance". It takes the app's
   existing caption convention instead (the .rf-lbl / .bt-st-urled-lbl / .progLbl
   family: small uppercase micro-caps in --txt-dim), which cannot be confused with
   a heading at any size. Safe to uppercase here - these are setting names, never
   chord or note labels, which must never be case-folded (note-spelling rule). */
.setLbl{font-weight:700;font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--txt-dim);margin-bottom:9px;}
.accBody .setLbl:not(:first-child){margin-top:18px;}
.setHint{color:var(--ink-faint);font-size:.82rem;line-height:1.45;margin:0 0 13px;}
.themeRow{display:flex;gap:11px;flex-wrap:wrap;}
/* Visual preview under the Fretboard-diagrams and Chord-charts toggles. Both
   options shown (contrast at a glance - recognition over recall), the ACTIVE one
   highlighted; the two halves align under the toggle halves above. Content is
   rendered from the app's real diagram/chart renderers (window.MusicPreview), not a
   hand-drawn copy. */
.prefPreview{display:flex;gap:8px;margin:8px 0 2px;align-items:stretch;}
.prefEx{flex:1 1 0;display:flex;align-items:center;justify-content:center;padding:6px 4px;
  border:1px solid var(--line);border-radius:10px;background:var(--bg-2);min-height:96px;overflow:hidden;cursor:pointer;
  opacity:.45;transition:opacity .15s,border-color .15s,box-shadow .15s,transform .08s;}
.prefEx.on{opacity:1;border-color:var(--accent-dim);box-shadow:0 0 0 1px var(--accent-dim);}
/* The preview cell is itself the selector (operator UAT) - press feedback +
   a focus ring so the tap affordance reads. */
.prefEx:active{transform:scale(.97);}
.prefEx:focus-visible{outline:2px solid var(--accent-dim);outline-offset:2px;}
/* the real small chord diagram is sized for chord cards - scale it to fit the
   preview cell; the compact chip needs no scaling. */
.prefEx .chord,.prefEx .bigC{transform:scale(.82);}
.prefEx .suggChip{margin:0;cursor:default;}
.themeSeg{display:flex;gap:6px;background:var(--bg-2);border:1px solid var(--line);border-radius:11px;padding:4px;}
.thSeg{flex:1;min-height:44px;padding:9px 8px;border:0;background:transparent;color:var(--txt-soft);font-family:inherit;font-weight:600;font-size:.85rem;border-radius:8px;cursor:pointer;transition:background .15s,color .15s;}
.thSeg.on{background:var(--accent);color:var(--on-accent);}
.thSeg:active{transform:scale(.97);}
.setSummary{margin:0;display:flex;flex-direction:column;gap:5px;}
.setSummary .row{display:flex;justify-content:space-between;gap:12px;font-size:.85rem;}
.setSummary .row .k{color:var(--txt);} .setSummary .row .v{color:var(--ink-faint);}
.setSummary .row.head{margin-top:3px;} .setSummary .row.head .k{font-weight:600;}
.setSummary .row.sub{padding-left:16px;} .setSummary .row.sub .k{color:var(--ink-faint);} .setSummary .row.sub .v{color:var(--txt);}
.setSummary .empty{color:var(--ink-faint);font-size:.82rem;font-style:italic;}
.setFoot{flex:0 0 auto;border-top:1px solid var(--line-strong);padding:14px 16px 18px;}
.setBtns{display:flex;gap:10px;}
.setBtns .btn{flex:1;}
.setMeta{color:var(--ink-faint);font-size:.78rem;margin-top:10px;text-align:center;
  line-height:1.4;}

/* =====================================================================
 * `hidden` means hidden - the last word in this stylesheet.
 * ---------------------------------------------------------------------
 * The UA sheet's [hidden]{display:none} is a single-selector rule, so ANY
 * component rule here that sets `display` beats it - .setHead{display:flex},
 * .iconBtn{display:flex}, and so on. That bit twice in one session: the
 * setlist head row stayed on screen in the All view, and the filter-clear
 * button showed with nothing filtered. Both times every automated check was
 * green and only the screenshot showed it.
 *
 * Placed LAST rather than as !important: equal specificity, so it wins over
 * the component rules above by source order, while a genuinely more specific
 * rule or an inline style can still override it deliberately.
 * ===================================================================== */
[hidden]{display:none;}

/* ---- PLAYER-FEEL (PR-B): now-playing row state + mini-player page space ----
   The playing track's row swaps its play glyph for a 3-bar equalizer and takes
   the accent as an OUTLINE (the fill->outline->neutral ladder - fill stays
   reserved for primary actions, no new hue). Both glyph and equalizer are
   always in the DOM (list-item.js); these classes flip which shows, so live
   play/pause updates are a class sweep - never a list re-render. */
.listItem .li-eq{display:none;align-items:flex-end;gap:2px;height:16px;}
.listItem .li-eq i{width:3px;height:8px;background:var(--accent-ink);border-radius:1px;transform-origin:50% 100%;}
.listItem .li-eq i:nth-child(2){height:14px;}
.listItem .li-eq i:nth-child(3){height:10px;}
.listItem.isPlaying{border-color:var(--accent-ink);}
.listItem.isPlaying .li-lead .li-num,.listItem.isPlaying .li-lead .li-lead-gl{display:none;}
.listItem.isPlaying .li-eq{display:inline-flex;}
.listItem.isPlaying:not(.isPaused) .li-eq i{animation:liEq 1.1s ease-in-out infinite;}
.listItem.isPlaying:not(.isPaused) .li-eq i:nth-child(2){animation-delay:.22s;}
.listItem.isPlaying:not(.isPaused) .li-eq i:nth-child(3){animation-delay:.44s;}
@keyframes liEq{0%,100%{transform:scaleY(.45);}50%{transform:scaleY(1);}}
@media (prefers-reduced-motion: reduce){.listItem.isPlaying .li-eq i{animation:none !important;}}
/* While the mini bar is up, the scrollers keep their last rows reachable above
   it, and the toast rides above the bar instead of colliding with it. */
body.miniplayer .view{padding-bottom:104px;} /* two-row bar (batch 7) */
/* ROUND 19: the docked PIP is position:fixed 152x110 at bottom+150px, so it
   covers a corner NO amount of scrolling can move content out of. For a
   scrolling view that is the accepted PIP trade (scroll and the row clears it);
   for the Tune tab it is a DEAD TARGET, because .tunerWrap is a height:100%
   flex column whose reference-tone strings are PINNED to the bottom and can
   never scroll clear. Measured at 412x915 before this rule: the E and A string
   buttons both returned .bt-st-media from elementFromPoint at their centres -
   two of four strings untappable while anything was playing.
   Reserve the dock's full height (110px + its 150px offset, less the 104px the
   bar already reserves) so the strings sit ABOVE it. Scoped to the Tune tab:
   no other view pins content into that corner. */
body.pipdock #s-tune .tunerWrap{padding-bottom:162px;}
body.miniplayer .toast{bottom:calc(max(env(safe-area-inset-bottom,0px), 8px) + 132px);}

/* =====================================================================
 * LANDSCAPE PHONE SHELL - "Direction A: side rail + compact chrome"
 * (landscape audit 2026-10-05; Nik picks between directions, Rail is the
 * recommended default).
 * ---------------------------------------------------------------------
 * Sideways on a stand, height is the scarce axis and width is free - yet the
 * portrait shell spent 136 of 340px on a header + bottom tab bar and left
 * ~190px of empty gutter on each side of a 540px column. With the mini bar up
 * the Songs list was 0px. So in landscape the chrome moves to the axis that
 * has room:
 * - The SAME .tabbar element becomes a 76px left rail (same buttons, order
 *   and labels; >=56px tall targets). The gear (#settingsBtn) sits at the
 *   rail top; the brand, tab pill and purpose line go - the lit rail button
 *   already answers "where am I". The offline pill stays, under the gear.
 *   DOM order is untouched, so keyboard focus still runs gear -> view ->
 *   tabs.
 * - The view fills the rest of the screen, top to bottom, rail to edge.
 * - The mini bar is ONE 52px row along the bottom of the content column
 *   (tracks.css, same gate): the .view reservation drops 104 -> --bar-res.
 * - Songs: the view switcher and its row controls (Search & filter + Add, or
 *   the setlist's Clear + Start) share one row; the list gets the rest.
 * Same gate as the two-pane Tune (min-height:280px included) so the split
 * and the rail always come together. Portrait and desktop never match it.
 * ===================================================================== */
@media (orientation:landscape) and (max-height:560px) and (min-height:280px){
  :root{--rail-w:calc(76px + env(safe-area-inset-left,0px));--bar-h:52px;
    --bar-b:calc(env(safe-area-inset-bottom,0px) + 8px);--bar-res:calc(var(--bar-h) + var(--bar-b) + 8px);}
  .app{display:grid;grid-template-columns:var(--rail-w) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);max-width:none;margin:0;}
  .appbar{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:center;gap:6px;
    padding:max(env(safe-area-inset-top,0px), 10px) 6px 8px calc(6px + env(safe-area-inset-left,0px));
    border-bottom:0;border-right:1px solid var(--line);background:var(--bg-2);backdrop-filter:none;-webkit-backdrop-filter:none;}
  .appbar .brand{order:2;}
  .appbar .brand .nm,.appbar .tabPill,.appbar .tabPurpose{display:none;}
  .tabbar{grid-column:1;grid-row:2;flex-direction:column;justify-content:flex-start;gap:6px;min-height:0;overflow-y:auto;
    padding:0 6px var(--tabbar-pb) calc(6px + env(safe-area-inset-left,0px));border-top:0;border-right:1px solid var(--line);}
  .tabbar button{flex:0 0 auto;min-height:56px;justify-content:center;}
  .tabbar button.on{margin-bottom:0;padding-bottom:6px;}
  .view{grid-column:2;grid-row:1 / span 2;padding:10px max(14px, env(safe-area-inset-right,0px)) 10px 14px;}
  body.miniplayer .view{padding-bottom:var(--bar-res);}
  /* The PIP docks inside the bar here (tracks.css), so Tune no longer
     reserves the portrait dock's 162px. */
  body.pipdock #s-tune .tunerWrap{padding-bottom:0;}
  .toast{left:calc(var(--rail-w) + (100vw - var(--rail-w)) / 2);bottom:calc(var(--bar-b) + 8px);}
  body.miniplayer .toast{bottom:calc(var(--bar-res) + 4px);}
  /* Songs: switcher + row controls on ONE row, the list below. #segAllChrome
     dissolves into the grid (display:contents) so its filter sheet can open
     full-width under the row instead of stretching the right column. */
  #s-library.on{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);column-gap:8px;}
  #s-library > *{grid-column:1 / -1;}
  #s-library > #songsSeg{grid-column:1;grid-row:1;}
  #s-library > #segAllChrome:not([hidden]){display:contents;}
  #segAllChrome .filterBar{grid-column:2;grid-row:1;margin-bottom:4px;}
  #segAllChrome .filterSheet{grid-column:1 / -1;grid-row:2;}
  #s-library > #setHead{grid-column:2;grid-row:1;}
  #s-library > #libSongs,#s-library > #libSet{grid-row:3;}
}
