/* ============================================================
   THE INNER FRETBOARD STUDIO — Page Composer (v1 skeleton)
   Split view: sticky document pane on top, the live Map below it.
   Activated by body.composer-on (js/19-composer.js). Additive only —
   without the flag nothing here applies.
   Print: only the pages render (vector boards → crisp PDF).
   ============================================================ */

/* Two-region layout: the pane owns the top, the app (.container) gets the rest
   and scrolls INDEPENDENTLY — the board is always reachable, nothing slides
   under the pane. Layout presets: Doc (composer-full), Split, Board (composer-min
   = pane collapses to its toolbar strip). */
/* 100dvh: iOS Safari's 100vh is the LARGE viewport — with the address bar
   expanded the top row of the app sat underneath it, untappable
   (Robert 2026-08-14). dvh tracks the real visible height. */
body.composer-on { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
body.composer-on .container { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* Edit-mode's full-viewport draw layer stays BELOW the pane — board markup
   (arrows, labels, pen) can never paint over pages or the canvas. */
body.composer-on #mapDrawLayer { z-index: 130 !important; }
/* One header is enough — the composer bar takes over while it's open. */
body.composer-on .brand-header { display: none; }
/* Board-only layout: the document controls sleep until a page is visible. */
/* Grab stays LIVE in board-only layout — that's the view where you look at
   the board and decide to take it (verification pass J2, 2026-08-14: the
   dimming killed the core journey's next step). The grab lands on the
   current page; no page needs to be visible. */
body.composer-min .cmp-bar-row > *:not(#cmpLayout):not(.cmp-title):not(#cmpClose):not(.cmp-spacer):not(#cmpView):not(#cmpGrab):not(#cmpGrabOpts) { opacity: .3; pointer-events: none; }
body.composer-on #composerPane { display: flex; }
body.composer-full .container { display: none; }
body.composer-min #composerPane { flex: 0 0 auto; }
body.composer-min .cmp-body, body.composer-min .cmp-divider { display: none; }
/* While MAP EDIT MODE is live under the composer, the page Inspector has
   nothing selectable — collapse it and give the page the width back
   (Robert 2026-08-27: "empty right pane with nothing to select"). */
/* …but only while it IS empty: with an animated board selected its Steps panel
   is the authoring surface, and Edit mode is how the notes get placed (2026-10-14). */
body:has(#mapEditBar:not([hidden])) .cmp-insp:has(> .iempty),
body:has(#mapEditBar:not([hidden])) #cmpInspTab { display: none; }

#composerPane {
  display: none;               /* flipped by body.composer-on */
  flex: 0 0 var(--cmpH, 58vh);
  min-height: 0;
  flex-direction: column;
  background:
    radial-gradient(1100px 420px at 50% -180px, rgba(232, 195, 107, .05), transparent 60%),
    var(--bg, #1A1614);
  border-bottom: 1px solid var(--surface-3, #3E342E);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  position: relative; z-index: 140;
}
body.composer-full #composerPane { flex: 1 1 auto; }

/* layout preset buttons (one-click, like a pane switcher) */
.cmp-seg { display: flex; gap: 2px; background: var(--surface-1, #2A231F); border: 1px solid var(--surface-3, #3E342E); border-radius: 8px; padding: 2px; }
.cmp-seg button { font-size: 13px; line-height: 1; padding: 5px 9px; background: none; border: none; border-radius: 6px; color: var(--text-muted, #8F857A); cursor: pointer; }
.cmp-seg button.on { background: var(--surface-3, #3E342E); color: var(--accent, #E8C36B); }

/* ── toolbar — TWO FIXED ROWS. Buttons never migrate between rows as the
   window resizes; a too-narrow row scrolls horizontally instead (Robert
   2026-07-29: "buttons constantly moving around"). ── */
.cmp-bar { display: block; padding: 8px 14px 7px; border-bottom: 1px solid var(--surface-2, #342C27); flex: 0 0 auto; }
.cmp-bar-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.cmp-bar-row::-webkit-scrollbar { height: 5px; }
.cmp-bar-row::-webkit-scrollbar-thumb { background: #3E342E; border-radius: 3px; }
.cmp-bar-row + .cmp-bar-row { margin-top: 6px; }
.cmp-bar-row > * { flex: 0 0 auto; }
.cmp-bar-row .cmp-spacer { flex: 1 1 auto; }
/* long document names must never push buttons off the row */
#cmpDoc { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* narrower windows: drop the wordmark first, then the INSERT/PAGE hint labels
   and some padding — every BUTTON stays, in the same order, on the same row */
@media (max-width: 1540px) { .cmp-bar .cmp-title { display: none; } }
@media (max-width: 1300px) {
  .cmp-bar .cmp-lbl { display: none; }
  .cmp-bar-row { gap: 6px; }
  .cmp-bar .cmp-btn { padding: 6px 8px; }
}
@media (max-width: 1120px) {
  .cmp-bar .cmp-btn { padding: 5px 6px; font-size: 11px; }
  .cmp-bar .cmp-seg button { padding: 4px 6px; font-size: 11.5px; }
  .cmp-bar-row { gap: 5px; }
  #cmpDoc { max-width: 110px; }
}
.cmp-title { font-family: Sora, sans-serif; font-weight: 800; font-size: 13px; margin-right: 4px; }
.cmp-title em { font-style: normal; color: var(--accent, #E8C36B); }
.cmp-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .18em; color: var(--text-muted, #8F857A); text-transform: uppercase; padding: 0 4px 0 10px; border-left: 1px solid var(--surface-2, #342C27); }
/* toolbar group separator (IA pass 2026-08-13): File | Insert | View */
.cmp-sep { width: 1px; height: 22px; background: var(--surface-2, #342C27); margin: 0 5px; flex: 0 0 auto; }
/* undo+redo travel as ONE unit (the phone drawer's wrap split them) —
   desktop lets the pair dissolve into the row */
.cmp-histpair { display: contents; }
.cmp-btn { font-family: Sora, sans-serif; font-size: 12px; font-weight: 600; color: var(--text-primary, #F5F1E8); background: var(--surface-2, #342C27); border: 1px solid var(--surface-3, #3E342E); border-radius: 7px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.cmp-btn:hover { background: var(--surface-3, #3E342E); }
.cmp-btn.primary { background: var(--accent, #E8C36B); border-color: var(--accent, #E8C36B); color: #1A1614; font-weight: 700; }
.cmp-btn.on { border-color: var(--accent, #E8C36B); color: var(--accent, #E8C36B); }
.cmp-spacer { flex: 1; }

/* ── body: rail + canvas ── */
.cmp-body { flex: 1; display: flex; min-height: 0; }
.cmp-rail { width: 92px; flex: 0 0 auto; border-right: 1px solid var(--surface-2, #342C27); padding: 12px 10px; overflow: auto; }
.cmp-rail .cmp-thumb.on { outline: 2.5px solid #E8C36B; outline-offset: 2px; border-radius: 3px; }
.cmp-rail .cmp-thumb.on .no { color: #E8C36B; font-weight: 800; }
.cmp-thumb { display: block; width: 100%; aspect-ratio: 8.5/11; border-radius: 4px; background: #FBF8F2; border: 2px solid var(--surface-3, #3E342E); margin-bottom: 16px; cursor: pointer; position: relative; overflow: hidden; }
/* thumbs are real controls: hover lift, keyboard focus (state sweep 2026-08-14) */
.cmp-thumb:hover { border-color: var(--text-muted, #8F857A); }
.cmp-thumb:focus-visible { outline: 2px solid var(--accent, #E8C36B); outline-offset: 2px; }
.cmp-addpage:hover { border-color: var(--text-muted, #8F857A); color: var(--text-2, #C9BFB0); }
/* mid-width windows (small laptop / tight split): the EMPTY inspector is
   just a hint — give the page its width back; it returns on selection */
@media (max-width: 1040px) {
  .cmp-insp:has(> .iempty) { display: none; }
}
.cmp-mini { position: absolute; top: 0; left: 0; width: 816px; height: 1056px; transform: scale(0.0837); transform-origin: 0 0; pointer-events: none; background: #FBF8F2; font-family: Mulish, sans-serif; }
.cmp-mini * { pointer-events: none !important; }
.cmp-thumb.on { border-color: var(--accent, #E8C36B); }
.cmp-thumb .no { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--text-muted, #8F857A); }
.cmp-addpage { width: 100%; aspect-ratio: 8.5/11; border: 1.5px dashed var(--surface-3, #3E342E); border-radius: 4px; background: none; color: var(--text-muted, #8F857A); font-family: Sora, sans-serif; font-size: 11px; cursor: pointer; }
/* Rail "Clear all" — plainly visible under + Page (Robert 2026-08-27). */
.cmp-clearpages { width: 100%; margin-top: 8px; padding: 7px 0; border: 1px solid var(--surface-3, #3E342E); border-radius: 6px; background: none; color: var(--text-muted, #8F857A); font-family: Sora, sans-serif; font-size: 11px; cursor: pointer; }
.cmp-clearpages:hover { border-color: #C0392B; color: #E07B6B; }

/* No flex centering — the page wrap centers via margin:auto, which (unlike
   flex centering) keeps ALL edges reachable when the zoomed page overflows. */
.cmp-canvas { flex: 1; overflow: auto; padding: 26px 20px 40px; display: flex; position: relative; }

/* Letter page at 96dpi: 816×1056 px == 8.5×11in, so print at 100% is exact. */
.cmp-page { width: 816px; min-width: 816px; height: 1056px; background: #FBF8F2; color: #2A231F; border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4); position: relative; overflow: hidden; font-family: Mulish, sans-serif; }
.cmp-page .cmp-margin { position: absolute; inset: 48px; border: 1px dashed rgba(42,35,31,.12); pointer-events: none; }
/* The dashed safe-area guide is an editing aid: hide it on-air (editor review 2026-10-01). */
body.cmp-present .cmp-page .cmp-margin { display: none; }
/* Header band — warm brown strip like the app header, logo (dark lockup)
   vertically centred at the left. Prints with its colour. */
.cmp-page .cmp-band { position: absolute; top: 14px; left: 0; right: 0; height: 44px; background: #221A14; pointer-events: none; }
.cmp-page .cmp-brand { position: absolute; left: 22px; top: 21px; height: 30px; width: auto; pointer-events: none; }
.cmp-page, .cmp-page .cmp-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Footer strip (review P1 §7): free text · auto date · page number. Doc-level
   optional, rendered by furnHTML on the page, the rail minis, and print. */
.cmp-page .cmp-foot { position: absolute; left: 48px; right: 48px; bottom: 16px; display: flex; justify-content: space-between; gap: 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .06em; color: #6E6558; pointer-events: none;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ── blocks ── */
.cmp-blk { position: absolute; cursor: grab; border-radius: 3px; }
.cmp-blk:active { cursor: grabbing; }
/* Selection chrome (Robert 2026-08-12: "looks really poor") — pro-editor
   style: a thin cool line hugging the block, small crisp white handles. */
.cmp-blk.sel { outline: 1.5px solid #4A90D9; outline-offset: 2px; }
.cmp-blk.msel { outline: 2px dashed #E8C36B; outline-offset: 4px; }
.cmp-marq { position: absolute; border: 1px dashed #E8C36B; background: rgba(232,195,107,.08); pointer-events: none; z-index: 25; }
/* board header/footer — pure figure typography, no boxes (Robert 2026-07-28):
   title set in Sora above, caption-style muted text below. */
.cmp-blk .cmp-btitle { text-align: center; border: none; background: transparent; }
.cmp-blk .cmp-btitle.hd { font-family: Sora, sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.005em; color: #2A231F; padding: 2px 8px 0; margin-bottom: -10px; position: relative; z-index: 2; }
.cmp-blk .cmp-btitle.ft { font-family: Mulish, sans-serif; font-weight: 400; font-size: 12.5px; color: #6E6558; padding: 0 8px 2px; margin-top: -12px; position: relative; z-index: 2; }
/* inspector board-title input */
.cmp-insp .ititle { width: 100%; font: 600 12px Sora, sans-serif; color: #F5F1E8; background: #1A1614;
  border: 1px solid #3E342E; border-radius: 6px; padding: 7px 9px; margin-bottom: 7px; }

/* mode/status chip (P0.2 mode indicators, 2026-08-14): bottom-left of the
   canvas — "page 2/3 · heading selected", "placing notes — esc ends".
   Gold while an ACTIVE mode is on (editing / placing marks). */
.cmp-status { position: absolute; left: 104px; bottom: 10px; z-index: 30; pointer-events: none;
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted, #8F857A); background: rgba(26, 22, 20, .88);
  border: 1px solid var(--surface-2, #342C27); border-radius: 6px; padding: 5px 10px; }
.cmp-status:empty { display: none; }
.cmp-status.live { color: #1A1614; background: var(--accent, #E8C36B); border-color: var(--accent, #E8C36B); font-weight: 600; }
#composerPane.canvas-mode .cmp-status { left: 12px; }
body.cmp-present .cmp-status { display: none !important; }

/* smart alignment guides (drag-time) */
.cmp-guide { position: absolute; background: #EC6A43; opacity: .85; pointer-events: none; z-index: 24; }
.cmp-guide.v { width: 1px; top: 0; bottom: 0; }
.cmp-guide.h { height: 1px; left: 0; right: 0; }
/* CENTER lines (page middle / another object's center) read stronger than
   edge guides, so "you're on center" is unmistakable (Robert 2026-08-30). */
.cmp-guide.ctr { opacity: 1; }
.cmp-guide.v.ctr { width: 2px; box-shadow: 0 0 0 1px rgba(236, 106, 67, 0.3), 0 0 8px rgba(236, 106, 67, 0.65); }
.cmp-guide.h.ctr { height: 2px; box-shadow: 0 0 0 1px rgba(236, 106, 67, 0.3), 0 0 8px rgba(236, 106, 67, 0.65); }
.cmp-blk svg { display: block; width: 100%; height: auto; }
.cmp-blk img { display: block; width: 100%; height: auto; }
.cmp-blk .cmp-text { font-size: 15px; line-height: 1.6; color: #41372F; outline: none; min-height: 1.4em; }
.cmp-blk .cmp-text h2 { font-family: Sora, sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.005em; color: var(--tink, #2A231F); margin: 0 0 3px; }
.cmp-blk .cmp-text b { color: var(--tink, #2A231F); }

/* frames — border-box: a frame must not grow the block past its stored width
   (siblings couldn't align — review P1 §19). Warm near-white fill (not #fff,
   which read as a stuck-on plate against the cream page); the notch bar is
   GOLD — #EC6A43 is reserved for editor chrome (selection/guides). */
/* every frame draws in var(--frc) so the inspector's Frame-colour row can
   recolour any of them; per-style designed defaults as fallbacks. */
.cmp-blk[data-frame] { box-sizing: border-box; }
.cmp-blk[data-frame="hairline"] { box-shadow: 0 0 0 1px var(--frc, #C2B49C); padding: 10px; background: #FFFEFA; }
.cmp-blk[data-frame="rounded"]  { box-shadow: 0 0 0 1px var(--frc, #C2B49C); border-radius: 12px; padding: 12px; background: #FFFEFA; }
.cmp-blk[data-frame="band"]     { box-shadow: 0 0 0 1px #C2B49C; border-top: 5px solid var(--frc, #E8C36B); padding: 10px; background: #FFFEFA; }
.cmp-blk[data-frame="bold"]     { box-shadow: 0 0 0 2.5px var(--frc, #E8C36B); padding: 10px; background: #FFFEFA; }
.cmp-blk[data-frame="double"]   { box-shadow: 0 0 0 1px var(--frc, #B8AC97), 0 0 0 4px #FFFEFA, 0 0 0 5px var(--frc, #B8AC97); padding: 12px; background: #FFFEFA; }
.cmp-blk[data-frame="notch"]    { box-shadow: 0 0 0 1px #C2B49C; padding: 10px; background: #FFFEFA; position: absolute; }
.cmp-blk[data-frame="notch"]::before { content: ''; position: absolute; top: -3px; left: 14px; right: 14px; height: 3px; background: var(--frc, #E8C36B); border-radius: 2px; }
.cmp-blk[data-frame="ink"]      { box-shadow: 0 0 0 2px var(--frc, #2A231F); padding: 10px; background: #FFFEFA; }
.cmp-blk[data-frame="shadow"]   { box-shadow: 0 0 0 1px var(--frc, #C2B49C), 6px 6px 0 rgba(180,130,59,.20); padding: 10px; background: #FFFEFA; }

/* page borders — per-doc decorative frame. Offsets come inline from furnHTML
   (they clear the header band and footer strip); every style draws in
   currentColor so the Setup colour swatches recolour the whole family;
   per-style defaults below. Sits under the blocks, prints with its colour. */
.cmp-page .cmp-pborder { position: absolute; pointer-events: none; color: #C9BCA4;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cmp-pborder.hairline { border: 1.5px solid currentColor; }
.cmp-pborder.double { border: 1px solid currentColor; outline: 1px solid currentColor; outline-offset: 4px; }
.cmp-pborder.ink { border: 2.5px solid currentColor; color: #2A231F; }
.cmp-pborder.gold { border: 2px solid currentColor; color: #E8C36B; }
/* duet: BOTH lines follow the chosen colour — main line solid, companion line
   a 40% tint of it (a fixed gold companion ignored custom colours). */
.cmp-pborder.duet { border: 1px solid currentColor; outline: 2px solid color-mix(in srgb, currentColor 40%, #FBF8F2); outline-offset: 5px; color: #2A231F; }
.cmp-pborder.corners { color: #2A231F; background:
  linear-gradient(currentColor,currentColor) left 0 top 0/26px 2.5px,
  linear-gradient(currentColor,currentColor) left 0 top 0/2.5px 26px,
  linear-gradient(currentColor,currentColor) right 0 top 0/26px 2.5px,
  linear-gradient(currentColor,currentColor) right 0 top 0/2.5px 26px,
  linear-gradient(currentColor,currentColor) left 0 bottom 0/26px 2.5px,
  linear-gradient(currentColor,currentColor) left 0 bottom 0/2.5px 26px,
  linear-gradient(currentColor,currentColor) right 0 bottom 0/26px 2.5px,
  linear-gradient(currentColor,currentColor) right 0 bottom 0/2.5px 26px;
  background-repeat: no-repeat; }
.cmp-pborder.rules { border-top: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; color: #B4823B; }
.cmp-pborder.dashed { border: 1.5px dashed currentColor; }

/* setup popover — border colour swatches */
.cmp-bcs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cmp-bc { width: 20px; height: 20px; min-width: 20px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); cursor: pointer; padding: 0; }
.cmp-bc.on { border-color: #E8C36B; }
.cmp-bauto { font: 600 10.5px Sora, sans-serif; color: #C9BFB0; background: #1A1614; border: 1px solid #3E342E; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.cmp-bauto.on { border-color: #E8C36B; color: #E8C36B; }
.cmp-bcs input[type="color"] { width: 22px; height: 22px; padding: 0; border: 1px solid #3E342E; border-radius: 50%; background: none; cursor: pointer; }

/* setup popover — border picker chips */
.cmp-bops { display: grid; grid-template-columns: repeat(5, 34px); gap: 5px; }
.cmp-bop { aspect-ratio: 1.3; background: #FBF8F2; border: 1px solid #3E342E; border-radius: 5px; padding: 3px; cursor: pointer; }
.cmp-bop.on { border-color: #E8C36B; box-shadow: 0 0 0 1px #E8C36B; }
.cmp-bop i { display: block; width: 100%; height: 100%; pointer-events: none; }
.cmp-bop .pb-none { border: 1px dashed #b7a98f; opacity: .5; }
.cmp-bop .pb-hairline { border: 1px solid #C9BCA4; }
.cmp-bop .pb-double { border: 1px solid #B8AC97; box-shadow: inset 0 0 0 2px #FBF8F2, inset 0 0 0 3px #B8AC97; }
.cmp-bop .pb-ink { border: 2px solid #2A231F; }
.cmp-bop .pb-gold { border: 2px solid #E8C36B; }
.cmp-bop .pb-duet { border: 1px solid #2A231F; box-shadow: 0 0 0 2px #E8C36B; }
.cmp-bop .pb-corners { background:
  linear-gradient(#2A231F,#2A231F) left 0 top 0/7px 1.5px, linear-gradient(#2A231F,#2A231F) left 0 top 0/1.5px 7px,
  linear-gradient(#2A231F,#2A231F) right 0 top 0/7px 1.5px, linear-gradient(#2A231F,#2A231F) right 0 top 0/1.5px 7px,
  linear-gradient(#2A231F,#2A231F) left 0 bottom 0/7px 1.5px, linear-gradient(#2A231F,#2A231F) left 0 bottom 0/1.5px 7px,
  linear-gradient(#2A231F,#2A231F) right 0 bottom 0/7px 1.5px, linear-gradient(#2A231F,#2A231F) right 0 bottom 0/1.5px 7px;
  background-repeat: no-repeat; }
.cmp-bop .pb-rules { border-top: 2px solid #B4823B; border-bottom: 2px solid #B4823B; }
.cmp-bop .pb-dashed { border: 1px dashed #B8AC97; }

/* right inspector — P0.3 geometry pass (2026-08-14, per the audit review):
   a real docked panel. DELIBERATELY square (structural sidebar, not a card);
   fixed width so rows never reflow; its own surface tone separates it from
   the canvas; sections read as sections. */
.cmp-insp { width: 212px; flex: 0 0 auto; border-left: 1px solid var(--surface-3, #3E342E);
  background: #211B16; padding: 14px 14px 20px; overflow-y: auto; overflow-x: hidden;
  position: relative; scrollbar-width: thin; }
.cmp-insp::-webkit-scrollbar { width: 7px; }
.cmp-insp::-webkit-scrollbar-thumb { background: #3E342E; border-radius: 4px; }
.cmp-insp.collapsed { display: none; }
.cmp-insp .icollapse { position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--text-muted, #8F857A); cursor: pointer; font-size: 13px; }
.cmp-insp .iempty { font-family: Mulish, sans-serif; font-size: 11.5px; line-height: 1.55; color: var(--text-muted, #8F857A); margin-top: 26px; }
#cmpInspTab { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 30; background: var(--surface-2, #342C27); color: var(--text-2, #C9BFB0); border: 1px solid var(--surface-3, #3E342E); border-right: none; border-radius: 8px 0 0 8px; padding: 12px 5px; cursor: pointer; font-size: 12px; display: none; }
.cmp-body { position: relative; }
.cmp-body.insp-off #cmpInspTab { display: block; }
.cmp-insp .ih { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .2em; color: var(--text-muted, #8F857A); text-transform: uppercase; margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.cmp-insp .ih:first-child { margin-top: 0; }
/* the context line ("SELECTED · TEXT · TITLE") anchors the panel — brighter,
   no rule under it, breathing room before the first section */
.cmp-insp > .ih:first-of-type { color: var(--text-2, #C9BFB0); border-bottom: none; padding-bottom: 0; margin-bottom: 12px; }
.cmp-insp .irow { margin-bottom: 7px; }
.cmp-frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cmp-frame-opt { aspect-ratio: 1.35; border-radius: 5px; background: var(--surface-1, #2A231F); border: 1px solid var(--surface-3, #3E342E); position: relative; cursor: pointer; }
.cmp-frame-opt.on { border-color: var(--accent, #E8C36B); }
.cmp-frame-opt i { position: absolute; inset: 6px; border-radius: 2px; pointer-events: none; }
.cmp-frame-opt[data-frame="none"] i { border: 1px dashed var(--text-muted, #8F857A); opacity: .45; }
.cmp-frame-opt[data-frame="hairline"] i { border: 1px solid var(--text-2, #C9BFB0); }
.cmp-frame-opt[data-frame="band"] i { border: 1px solid var(--text-2, #C9BFB0); border-top: 4px solid var(--accent, #E8C36B); }
.cmp-frame-opt[data-frame="bold"] i { border: 2px solid var(--accent, #E8C36B); }
.cmp-frame-opt[data-frame="notch"] i { border: 1px solid var(--text-2, #C9BFB0); }
.cmp-frame-opt[data-frame="notch"] i::after { content: ''; position: absolute; top: -3px; left: 7px; right: 7px; height: 2px; background: #EC6A43; }
.cmp-frame-opt[data-frame="shadow"] i { border: 1px solid var(--text-2, #C9BFB0); box-shadow: 3px 3px 0 rgba(232,195,107,.5); }
.cmp-frame-opt[data-frame="rounded"] i { border: 1px solid var(--text-2, #C9BFB0); border-radius: 7px; }
.cmp-frame-opt[data-frame="double"] i { border: 1px solid var(--text-2, #C9BFB0); box-shadow: inset 0 0 0 2px var(--surface-1, #2A231F), inset 0 0 0 3px var(--text-2, #C9BFB0); }
.cmp-frame-opt[data-frame="ink"] i { border: 2px solid #EDE4D1; }
.cmp-frame-opt[data-frame="notch"] i::after { background: var(--accent, #E8C36B); }
.cmp-insp .irow { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.cmp-insp .ichip { flex: 1; font-family: Sora, sans-serif; font-size: 10.5px; font-weight: 600; padding: 6px 2px; text-align: center; background: var(--surface-1, #2A231F); border: 1px solid var(--surface-3, #3E342E); border-radius: 6px; color: var(--text-2, #C9BFB0); cursor: pointer; }
.cmp-insp .ichip.on { background: var(--accent, #E8C36B); color: #1A1614; border-color: var(--accent, #E8C36B); font-weight: 700; }
.cmp-insp .ichip.danger { color: #EC6A43; border-color: rgba(236,106,67,.4); }
.cmp-insp .ichip svg { vertical-align: middle; }
/* consolidated color menu — apply-to checkboxes above the one swatch strip */
.cmp-insp .capply { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.cmp-insp .capchk { display: inline-flex; align-items: center; gap: 5px;
  font: 600 10.5px Sora, sans-serif; color: var(--text-2, #C9BFB0);
  background: var(--surface-1, #2A231F); border: 1px solid var(--surface-3, #3E342E);
  border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.cmp-insp .capchk.on { border-color: #E8C36B; color: #E8C36B; }
.cmp-insp .capchk input { accent-color: #E8C36B; margin: 0; width: 12px; height: 12px; }
/* inspector colour row (frame / rule colour) */
.cmp-insp .ccrow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cmp-insp .cchip { font: 600 10px Sora, sans-serif; color: var(--text-2, #C9BFB0); background: var(--surface-1, #2A231F); border: 1px solid var(--surface-3, #3E342E); border-radius: 6px; padding: 3px 7px; cursor: pointer; }
.cmp-insp .cchip.on { border-color: #E8C36B; color: #E8C36B; }
.cmp-insp .ccsw { width: 17px; height: 17px; min-width: 17px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); cursor: pointer; padding: 0; }
.cmp-insp .ccsw.on { border-color: #E8C36B; }
.cmp-insp .ccrow input[type="color"] { width: 19px; height: 19px; padding: 0; border: 1px solid var(--surface-3, #3E342E); border-radius: 50%; background: none; cursor: pointer; }
/* numeric X/Y/W fields (review P1 §18) */
.cmp-insp .inum label { display: flex; align-items: center; gap: 4px; flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--text-muted, #8F857A); }
.cmp-insp .inum input { width: 100%; min-width: 0; font: 11px 'IBM Plex Mono', monospace; background: #1A1614; color: #F5F1E8; border: 1px solid #3E342E; border-radius: 5px; padding: 4px 3px; text-align: center; -moz-appearance: textfield; }
.cmp-insp .inum input::-webkit-outer-spin-button, .cmp-insp .inum input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* inspector export controls (step 7) */
.cmp-insp .ichk { display: flex; align-items: center; gap: 6px; font-family: Mulish, sans-serif; font-size: 11px; color: var(--text-2, #C9BFB0); cursor: pointer; }
.cmp-insp .ichk input { accent-color: #E8C36B; }
.cmp-toast { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70;
  background: #26201A; border: 1px solid #E8C36B; color: #F5F1E8; border-radius: 9px; padding: 8px 16px;
  font: 600 12px Sora, sans-serif; box-shadow: 0 10px 26px rgba(0,0,0,.55); pointer-events: none; }

/* rail drag-reorder */
.cmp-thumb.dragover { border-color: #EC6A43; }

/* grab / component popover */
.cmp-pop { position: absolute; z-index: 40; background: #26201A; border: 1px solid #3E342E; border-radius: 9px; padding: 10px 12px; box-shadow: 0 10px 26px rgba(0,0,0,.55); display: flex; align-items: center; gap: 7px; font-family: Sora, sans-serif; font-size: 12px; color: #E7DCCB; }
.cmp-pop input { width: 44px; font: inherit; text-align: center; background: #1A1614; color: #F5F1E8; border: 1px solid #3E342E; border-radius: 6px; padding: 5px 2px; }
.cmp-pop .go { background: #E8C36B; border: none; color: #1A1614; font-weight: 700; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-family: Sora, sans-serif; }
.cmp-pop .alt { background: none; border: 1px solid #3E342E; color: #C9BFB0; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-family: Sora, sans-serif; font-size: 11px; }
/* page-setup popover — stacked rows */
.cmp-pop.col { flex-direction: column; align-items: stretch; gap: 9px; }
.cmp-pop .row { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.cmp-pop .row label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.cmp-pop input[type="radio"], .cmp-pop input[type="checkbox"] { accent-color: #E8C36B; }
.cmp-pop input[type="text"] { width: auto; text-align: left; padding: 6px 8px; font-size: 11.5px; }

/* presentation mode — the page IS the screen */
body.cmp-present #composerPane { position: fixed; inset: 0; z-index: 600; border: none; }
body.cmp-present .cmp-bar, body.cmp-present .cmp-rail, body.cmp-present .cmp-divider, body.cmp-present .cmp-insp { display: none !important; }
body.cmp-present .container { display: none; }
body.cmp-present .cmp-canvas { padding: 18px; background: #100C09; }
.cmp-present-ui { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 620; display: none; gap: 8px; align-items: center; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #8F857A; background: rgba(22,17,12,.78); padding: 6px 10px; border-radius: 12px; transition: opacity .35s; }
.cmp-present-ui.idle { opacity: 0; pointer-events: none; }
.cmp-present-chip { position: fixed; top: 12px; right: 16px; z-index: 620; display: none;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; color: #E7DCCB;
  background: rgba(22,17,12,.72); padding: 5px 12px; border-radius: 9px; letter-spacing: .06em; }
body.cmp-present .cmp-present-chip { display: block; }
.cmp-inkcols { display: inline-flex; gap: 5px; align-items: center; margin: 0 2px; }
.cmp-inkcols button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); padding: 0; cursor: pointer; }
.cmp-inkcols button.on { border-color: #fff; }
#cmpPresLamp { position: fixed; z-index: 610; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(232,195,107,.18) 0 40%, rgba(0,0,0,.10) 60%, transparent 72%);
  border: 1.5px solid rgba(180,130,59,.55); box-shadow: 0 0 14px rgba(0,0,0,.18); }
body.cmp-present .cmp-present-ui { display: flex; }
.cmp-present-ui button { background: rgba(38,32,26,.9); color: #E7DCCB; border: 1px solid #3E342E; border-radius: 7px; padding: 6px 11px; cursor: pointer; font-family: Sora, sans-serif; font-size: 12px; }
.cmp-present-ui button.on { border-color: #E8C36B; color: #E8C36B; }
/* marks stay grabbable while no tool is armed (move / resize on-air) */
/* Existing marks stay grabbable even while a draw tool is armed — the move
   cursor promises a drag, and pointerdown routes mark-grabs to move/resize
   before starting a new stroke (Robert 2026-08-29). */
body.cmp-present #cmpInkLayer > * { pointer-events: visiblePainted; cursor: move; }
/* Blocks are INERT on-air — no drag, no selection chrome on a screen share
   (review P2). The ink layer sits above the page, below the present UI. */
body.cmp-present #cmpPage .cmp-blk, body.cmp-present #cmpPage .cmp-blk * { pointer-events: none !important; }
body.cmp-present #cmpPage .cmp-blk { cursor: default; }
body.cmp-present .cmp-blk.sel { outline: none; }
#cmpInkLayer { display: none; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 615; pointer-events: none; }
body.cmp-present #cmpInkLayer { display: block; }
#cmpInkLayer.arm { pointer-events: auto; cursor: crosshair; touch-action: none; }
.cmp-pgnav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 620; display: none;
  width: 46px; height: 64px; border: 1px solid #3E342E; border-radius: 10px; background: rgba(38,32,26,.85);
  color: #E7DCCB; font-size: 22px; cursor: pointer; }
.cmp-pgnav:hover { background: rgba(62,52,46,.95); }
body.cmp-present .cmp-pgnav.pages-only { display: block; }
#cmpPgPrev { left: 14px; } #cmpPgNext { right: 14px; }

/* selection chrome — four corners (resize) + side handles on text (wrap width).
   16px targets: the old single 10px handle was a miss magnet (review P1 §13). */
.cmp-h { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid #4A90D9; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cmp-h-br { right: -7px; bottom: -7px; cursor: nwse-resize; }
.cmp-h-tl { left: -7px; top: -7px; cursor: nwse-resize; }
.cmp-h-tr { right: -7px; top: -7px; cursor: nesw-resize; }
.cmp-h-bl { left: -7px; bottom: -7px; cursor: nesw-resize; }
.cmp-hside { position: absolute; width: 10px; height: 22px; background: #fff; border: 2px solid #E8C36B; border-radius: 3px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.cmp-hside-l { left: -14px; } .cmp-hside-r { right: -14px; }
.cmp-del { position: absolute; top: -14px; right: -14px; width: 22px; height: 22px; border-radius: 50%; border: none; background: #EC6A43; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }

/* ── divider ── */
.cmp-divider { flex: 0 0 auto; height: 9px; cursor: ns-resize; background: var(--surface-1, #2A231F); border-top: 1px solid var(--surface-3, #3E342E); position: relative; }
.cmp-divider::after { content: ''; position: absolute; left: 50%; top: 3px; transform: translateX(-50%); width: 52px; height: 3px; border-radius: 2px; background: var(--text-muted, #8F857A); opacity: .6; }
/* The split is dragged with a finger too: the divider never slides the page, and on a touch screen it is
   taller, with a grab area a finger can land on (14px above and below the strip). */
.cmp-divider { touch-action: none; -webkit-user-select: none; user-select: none; }
.cmp-divider.dragging::after { opacity: 1; background: var(--accent, #E8C36B); }
@media (pointer: coarse) {
  .cmp-divider { height: 18px; z-index: 6; }
  .cmp-divider::after { top: 6px; width: 72px; height: 5px; border-radius: 3px; opacity: .8; }
  .cmp-divider::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; bottom: -14px; }
}
body.composer-full .cmp-divider { display: none; }

/* grid (toggle) — visual guide + snap; never prints */
.cmp-page.grid { background-image:
  linear-gradient(rgba(42,35,31,.10) 1px, transparent 1px),
  linear-gradient(90deg, rgba(42,35,31,.10) 1px, transparent 1px),
  linear-gradient(rgba(42,35,31,.045) 1px, transparent 1px),
  linear-gradient(90deg, rgba(42,35,31,.045) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px; }

/* infinite workspace — the never-ending whiteboard. Same paper, no page
   bounds; the surface grows as blocks approach its edges. Pages (and PDF
   export) are untouched — this is the live-teaching surface. */
.cmp-page.cmp-infinite { height: auto; min-width: 0; aspect-ratio: auto; }
.cmp-canvas.infinite { justify-content: flex-start; padding: 18px; }
#composerPane.canvas-mode .cmp-rail { display: none; }

/* page-thumb delete + duplicate — INSIDE the thumb (overflow:hidden clipped
   the old -8px offsets to half-moons), above the mini preview. */
.cmp-thumb .tx { position: absolute; top: 3px; right: 3px; z-index: 3; width: 18px; height: 18px; border-radius: 50%; border: none; background: #EC6A43; color: #fff; font-size: 10px; line-height: 1; cursor: pointer; display: none; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.cmp-thumb:hover .tx { display: block; }
.cmp-thumb .tdup { position: absolute; top: 3px; left: 3px; z-index: 3; width: 18px; height: 18px; border-radius: 50%; border: none; background: #3E342E; color: #E7DCCB; font-size: 10px; line-height: 1; cursor: pointer; display: none; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.cmp-thumb:hover .tdup { display: block; }
.cmp-thumb .tdup:hover { background: #E8C36B; color: #1A1614; }

/* text-module presets — the lesson building blocks */
.cmp-blk .cmp-text.cmpt-title { font-family: Sora, sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -.01em; color: var(--tink, #2A231F); line-height: 1.2; }
.cmp-blk .cmp-text.cmpt-title .acc { color: #B4823B; font-style: normal; }
.cmp-blk .cmp-text.cmpt-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--tink, #6E6558); }
.cmp-blk.cmpt-callout { background: var(--cobg, #FAF3E1); border: 1.5px solid #E4D2A6; border-left: 5px solid var(--coa, #E8C36B); border-radius: 6px; padding: 12px 16px; }
.cmp-crop { cursor: ew-resize; }
.cmp-blk.dim-dots svg .fb-inlay { opacity: 0.3; }
/* ---- worksheet block suite (Robert 2026-08-12) ---- */
.cmp-menu-div { height: 1px; background: #3E342E; margin: 6px 4px; }
.cmp-text.cmpt-numbered { padding-left: 30px; position: relative; font-size: 13.5px; line-height: 1.55; }
.cmp-text.cmpt-numbered::before { content: attr(data-n); position: absolute; left: 0; top: 0;
  font-family: Sora, sans-serif; font-weight: 700; color: var(--ncol, #B4823B); font-size: var(--nfs, inherit); }
.cmp-blk .cmp-text.cmpt-badge { width: 100%; aspect-ratio: 1 / 1; height: auto;
  border: calc(var(--bw, 44px) * 0.07) solid var(--tink, #B4823B);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: Sora, sans-serif; font-weight: 800; font-size: calc(var(--bw, 44px) * 0.42);
  color: var(--tink, #B4823B); min-height: 0; line-height: 1; }
.cmp-shape-core { transform: rotate(var(--shrot, 0deg)); }
.ccsw.rec { outline: 1px dashed #8F857A; outline-offset: 1px; }
/* table block — grayscale print-first, like the diagrams */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #2A231F; background: transparent; }
.cmp-table td { border: 1px solid #B9B2A6; padding: 7px 10px; min-width: 40px; background: var(--tcbg, transparent);
  color: var(--ttxt, #2A231F); cursor: text; text-align: var(--talign, left); }
/* Blank cells keep a full row height (no "Insert cell" placeholder needed). */
.cmp-table td:empty::before { content: "\00a0"; color: transparent; }
.cmp-table td[contenteditable="true"] { outline: 2px solid #4A90D9; outline-offset: -2px; }
.cmp-table.hd tr:first-child td { font-family: Sora, sans-serif; font-weight: 700; font-size: 12px;
  border-bottom: 2px solid #2A231F; background: var(--thbg, rgba(0,0,0,.035)); }
/* chords-over-lyrics (Song Chart) */
.cmp-blk .cmp-text .chd { position: relative; top: -0.72em; font-family: Sora, sans-serif;
  font-weight: 800; font-size: 11px; color: #B4823B; margin-right: 3px; letter-spacing: .02em; }
.cmp-blk.gen-board .cmp-btitle.hd { margin-bottom: 17px; }  /* board header gap ≈ chart's */
/* an armed mark tool is a MODE — the target diagram wears a dashed gold
   coat while it's on (P0.2 mode indicators, 2026-08-14) */
.cmp-blk.marking { cursor: crosshair; outline: 2px dashed var(--accent, #E8C36B); outline-offset: 3px; }
.cmp-blk.cmpt-shape { background: transparent; }
.cmp-shape-core { position: absolute; inset: 0; background: var(--shfill, transparent);
  border: 2px solid var(--shstroke, #2A231F); border-radius: 6px; }
.cmp-shape-core.round { border-radius: 50%; }
.cmp-lockbadge { position: absolute; top: -10px; right: -10px; font-size: 13px; z-index: 5;
  background: rgba(38,32,26,.92); border-radius: 8px; padding: 2px 5px;
  display: none; }   /* only the SELECTED block shows its lock (Robert 2026-08-14) */
.cmp-blk.sel .cmp-lockbadge, .cmp-blk.msel .cmp-lockbadge { display: block; }
/* grab popover mode chips */
.cmp-pop .alt.on { border-color: #E8C36B; color: #E8C36B; }
/* resize width-match flash — "same size as that board now" */
.cmp-blk.cmp-wsnap { outline: 2px solid #EC6A43 !important; }
/* rotate zones: the strip just OUTSIDE each corner handle */
.cmp-rotz { position: absolute; width: 18px; height: 18px; z-index: 3;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M10 3a7 7 0 1 1-6.3 4" fill="none" stroke="black" stroke-width="2.4"/><path d="M1 3l3.2 4.6L8 4.4z" fill="black"/></svg>') 10 10, grab; }
.cmp-rotz-tl { left: -22px; top: -22px; } .cmp-rotz-tr { right: -22px; top: -22px; }
.cmp-rotz-bl { left: -22px; bottom: -22px; } .cmp-rotz-br { right: -22px; bottom: -22px; }

.cmp-blk.marking svg { cursor: crosshair; }
.cmp-text.cmpt-bullets ul { margin: 0; padding-left: 22px; font-size: 13.5px; line-height: 1.6; }
.cmp-text.cmpt-question { font-size: 13.5px; line-height: 1.55; }
.cmp-text.cmpt-question .q-k { font-family: Sora, sans-serif; font-weight: 800; color: #B4823B; margin-right: 7px; }
.cmp-text.cmpt-question .q-t { font-weight: 600; }
.cmp-text.cmpt-question .q-lines { display: block; height: 66px; margin-top: 8px;
  background: repeating-linear-gradient(to bottom, transparent 0 21px, #C9C0B2 21px 22px); }
/* component library boxes ride the callout engine; each sets default accents.
   Teacher-job set (editor 2026-08-12) + legacy classes so old docs keep rendering. */
.cmp-blk.cmpt-practice { --coa: #B4823B; --cobg: #FAF3E1; border-color: #E4D2A6; }
.cmp-blk.cmpt-listen { --coa: #3E7DB5; --cobg: #EBF2F9; border-color: #C3D6E8; }
.cmp-blk.cmpt-watchout { --coa: #D14B32; --cobg: #FBEDE8; border-color: #E9C4B8; }
.cmp-blk.cmpt-remember { --coa: #43B681; --cobg: #EAF6EF; border-color: #BFDECB; }
.cmp-blk.cmpt-tip { --coa: #43B681; --cobg: #EAF6EF; border-color: #BFDECB; }
.cmp-blk.cmpt-notebox { --coa: #6E6558; --cobg: #F2EFE9; border-color: #D8D0C2; }
.cmp-blk.cmpt-important { --coa: #D14B32; --cobg: #FBEDE8; border-color: #E9C4B8; }
/* the family rules above set border-color as a SHORTHAND, which flattened the
   left accent bar to the frame color at equal specificity — every teacher-job
   box was ignoring --coa on its bar (Robert 2026-08-23: "Accent changes only
   the first box"). Re-assert the bar after them. */
.cmp-blk.cmpt-callout { border-left-color: var(--coa, #E8C36B); }
.cmp-blk .cmp-text.cmpt-quote { font-family: Sora, sans-serif; font-size: 19px; font-weight: 600;
  line-height: 1.45; color: var(--tink, #4A3F35); padding-left: 16px; border-left: 4px solid #C9C0B2; font-style: italic; }
.cmp-blk .cmp-text.cmpt-definition { font-size: 13.5px; line-height: 1.55; }
.cmp-blk .cmp-text.cmpt-definition .df-t { color: var(--tink, #B4823B); }
.cmp-text.cmpt-topic { border-bottom: 1.5px solid #C9C0B2; padding-bottom: 5px; font-size: 14px; }
.cmp-text.cmpt-topic .lt-k { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .14em;
  color: #B4823B; margin-right: 9px; }
.inum-lbl { font-size: 11px; color: #8F857A; display: inline-flex; align-items: center; gap: 5px; }
.inum-lbl input { width: 52px; }
/* body text follows the Text color pick (--tink) — the hardcoded ink meant
   only <b> words recolored (Robert 2026-08-23: "only changed the word root") */
.cmp-blk.cmpt-callout .cmp-text { font-size: 13.5px; line-height: 1.55; color: var(--tink, #4A3F35); }
.cmp-blk.cmpt-callout .cmp-text .co-k { font-family: Sora, sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .08em; color: var(--coa, #B4823B); text-transform: uppercase; display: block; margin-bottom: 3px; }
.cmp-blk .cmp-text { color: var(--tink, inherit); }
.cmp-blk.cmpt-rule { height: 3px; background: linear-gradient(90deg, #E8C36B, #EC6A43); border-radius: 2px; }
/* on a 3px-tall divider the delete ✕ sat ON the corner resize anchor —
   lift it clear so the side handles stay grabbable (Robert 2026-08-23) */
.cmp-blk.cmpt-rule .cmp-del { top: -32px; right: -32px; }

/* watermark — free PDF exports only (v2.1 step 6). Rendered by stagePrint into
   the print clones; the editing canvas never carries it. Wordmark + domain,
   bottom-right, above any block (z 60), crisp text — no scaled-down lockup. */
.cmp-page .cmp-wm { position: absolute; right: 16px; bottom: 12px; z-index: 60; display: flex; align-items: baseline; gap: 7px;
  pointer-events: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cmp-page .cmp-wm.above-foot { bottom: 34px; }   /* clear the footer strip */
.cmp-page .cmp-wm b { font-family: Sora, sans-serif; font-weight: 800; font-size: 9.5px; letter-spacing: -.005em; color: #41372F; }
.cmp-page .cmp-wm b i { font-style: normal; color: #B4823B; }
.cmp-page .cmp-wm span { font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; letter-spacing: .07em; color: #8A7F70; }

/* branded dialog — replaces prompt()/confirm() (review P2) */
.cmp-dlgw { position: absolute; inset: 0; z-index: 90; background: rgba(16,12,9,.55); display: flex; align-items: center; justify-content: center; }
.cmp-dlg { width: 340px; max-width: calc(100% - 40px); background: #26201A; border: 1px solid #3E342E; border-radius: 12px; padding: 16px 18px; box-shadow: 0 18px 46px rgba(0,0,0,.6); font-family: Mulish, sans-serif; }
.cmp-dlg h4 { margin: 0 0 8px; font: 700 14px Sora, sans-serif; color: #F5F1E8; }
.cmp-dlg p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.55; color: #C9BFB0; }
.cmp-dlg .dlg-in { width: 100%; box-sizing: border-box; font: 600 13px Sora, sans-serif; color: #F5F1E8; background: #1A1614; border: 1px solid #6a583f; border-radius: 8px; padding: 9px 11px; margin-bottom: 12px; }
.cmp-dlg .dlg-choices { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; max-height: 260px; overflow: auto; }
.cmp-dlg .dlg-choice { text-align: left; font: 600 12.5px Sora, sans-serif; color: #E7DCCB; background: #1A1614; border: 1px solid #3E342E; border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.cmp-dlg .dlg-choice:hover { border-color: #E8C36B; }
.cmp-dlg .row { display: flex; gap: 7px; justify-content: flex-end; }
.cmp-dlg .row button { font: 600 12px Sora, sans-serif; border-radius: 7px; padding: 7px 14px; cursor: pointer; border: 1px solid #3E342E; background: none; color: #C9BFB0; }
.cmp-dlg .dlg-ok { background: #E8C36B; border-color: #E8C36B; color: #1A1614; font-weight: 700; }
.cmp-dlg .dlg-ok.danger { background: #EC6A43; border-color: #EC6A43; color: #fff; }

/* upgrade nudge — free-limit explanations (v2.1 step 5). Styling only; the
   limits themselves are enforced in JS via the entitlement service. */
.cmp-upgrade { position: absolute; z-index: 45; width: 290px; background: #26201A; border: 1px solid #E8C36B;
  border-radius: 10px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.6); font-family: Mulish, sans-serif; }
.cmp-upgrade .k { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .22em;
  text-transform: uppercase; color: #E8C36B; margin-bottom: 6px; }
.cmp-upgrade p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: #E7DCCB; }
.cmp-upgrade p b { color: #F5F1E8; }
.cmp-upgrade .row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cmp-upgrade button { font-family: Sora, sans-serif; font-size: 11.5px; font-weight: 600; border-radius: 7px;
  padding: 6px 11px; cursor: pointer; border: 1px solid #3E342E; background: none; color: #C9BFB0; }
.cmp-upgrade button.ok { background: #E8C36B; border-color: #E8C36B; color: #1A1614; font-weight: 700; }
.cmp-upgrade button.plans, .cmp-dlg .row button.dlg-extra { border-color: #E8C36B; color: #E8C36B; }
.cmp-dlg .row button.dlg-extra { margin-right: auto; }

/* insert menu */
.cmp-menu { position: absolute; z-index: 40; background: #26201A; border: 1px solid #3E342E; border-radius: 9px; padding: 6px; box-shadow: 0 10px 26px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 2px; min-width: 190px;
  max-height: min(68vh, 560px); overflow-y: auto; }
.cmp-menu button { text-align: left; background: none; border: none; border-radius: 6px; padding: 7px 10px; color: #E7DCCB; cursor: pointer; font-family: Mulish, sans-serif; font-size: 12.5px; }
.cmp-menu button:hover { background: #3E342E; }
.cmp-menu button b { font-family: Sora, sans-serif; font-size: 12px; display: block; }
.cmp-menu button span { color: #8F857A; font-size: 10.5px; }

/* ---- UI audit 2026-08-12: consistent control anatomy ----
   Every composer button inherits the app face; heights sit on a 24/30px
   two-tier system; radii on a 6/7px two-tier. Specific controls may override
   DELIBERATELY (mono digits, big go buttons) — never by omission. */
#composerPane button { font-family: Sora, sans-serif; }
#composerPane .cmp-btn { min-height: 30px; border-radius: 7px; }
#composerPane .ichip, #composerPane .cchip { min-height: 24px; border-radius: 6px; }

/* ---- State clarity (P0.2, 2026-08-13): ONE interaction language ----
   default → hover (one-step surface lift) → focus (gold ring, keyboard only)
   → pressed (1px sink) → selected (.on = accent) → disabled (.35 + inert).
   Documented in DESIGN.md "Control states". */
#composerPane :is(button, input, select):focus-visible {
  outline: 2px solid var(--accent, #E8C36B); outline-offset: 2px; }
#composerPane .ichip:not(.on):hover, #composerPane .cchip:not(.on):hover {
  background: var(--surface-2, #342C27); border-color: #4A4038; }
#composerPane .cmp-seg button:not(.on):hover {
  color: var(--text-2, #C9BFB0); background: rgba(255, 255, 255, .04); }
#composerPane .cmp-frame-opt:not(.on):hover { border-color: var(--text-muted, #8F857A); }
#composerPane .cmp-menu button:active, #composerPane .cmp-btn:active,
#composerPane .ichip:active, #composerPane .cchip:active { transform: translateY(1px); }
#composerPane [disabled], #composerPane .is-off { opacity: .35; pointer-events: none; }
/* selection chrome speaks its state: single = steel-blue line + handles;
   multi = gold dashed; LOCKED = gray dashed, "held, not movable" */
.cmp-blk.sel:has(.cmp-lockbadge) { outline: 1.5px dashed #8F857A; }
/* hover whisper: an unselected block hints it's grabbable (P2 cosmetic) —
   never on-air, never while another block is being edited */
body:not(.cmp-present) .cmp-page .cmp-blk:not(.sel):not(.msel):not(.editing):hover {
  outline: 1px solid rgba(74, 144, 217, .35); outline-offset: 2px; }

/* text editing */
.cmp-blk .cmp-text[contenteditable="false"] { cursor: grab; }
.cmp-blk.editing { outline: 2px solid #E8C36B; outline-offset: 4px; cursor: text; }
.cmp-textbar { position: absolute; display: flex; flex-wrap: wrap; max-width: 480px; gap: 3px; align-items: center; background: #26201A; border: 1px solid #3E342E; border-radius: 8px; padding: 4px 6px; box-shadow: 0 8px 22px rgba(0,0,0,.5); z-index: 30; }
.cmp-textbar button { min-width: 26px; height: 26px; border: none; border-radius: 5px; background: none; color: #E7DCCB; font-size: 12.5px; cursor: pointer; font-family: Sora, sans-serif; display: inline-flex; align-items: center; justify-content: center; }
.cmp-textbar button svg { display: block; }
.cmp-textbar button:hover { background: #3E342E; }
.cmp-textbar button.b { font-weight: 800; }
.cmp-textbar button.i { font-style: italic; }
.cmp-textbar button.u { text-decoration: underline; }
.cmp-textbar .sw { width: 18px; height: 18px; min-width: 18px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.25); padding: 0; }
.cmp-textbar .sep { width: 1px; height: 18px; background: #3E342E; margin: 0 3px; }
.cmp-textbar input[type="color"] { width: 22px; height: 22px; padding: 0; border: 1.5px solid rgba(255,255,255,.25); border-radius: 50%; background: none; cursor: pointer; }
.cmp-textbar .done { background: #E8C36B; color: #1A1614; font-weight: 700; padding: 0 10px; }

/* ── print: pages only, exact size, vector ── */
@media print {
  @page { size: letter; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; height: auto !important; background: #fff !important; }
  /* Only the staged print root exists on paper. Everything else — app, pane,
     inspector, fixed layers — is gone (review P0 §1/§2, P1 §3). */
  body.cmp-printing > *:not(#cmpPrintRoot) { display: none !important; }
  body.composer-on:not(.cmp-printing) > *:not(#cmpPrintRoot) { display: none !important; }
  #cmpPrintRoot { display: block; }
  #cmpPrintRoot .cmp-page { width: 816px; height: 1056px; position: relative; overflow: hidden;
    background: #FBF8F2; color: #2A231F; font-family: Mulish, sans-serif;
    box-shadow: none; border-radius: 0; margin: 0; page-break-after: always;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #cmpPrintRoot .cmp-page:last-child { page-break-after: auto; }
  #cmpPrintRoot .cmp-margin { display: none; }
  #cmpPrintRoot .cmp-blk.sel { outline: none; }
  #cmpPrintRoot .cmp-h, #cmpPrintRoot .cmp-del, #cmpPrintRoot .cmp-marq, #cmpPrintRoot .cmp-guide { display: none !important; }
  .cmp-page.grid { background-image: none !important; }
}


/* ---- Composer on phones: full mobile redesign (Robert 2026-08-13).
   Same pattern as the Map's mobile edit dock: the toolbar becomes a fixed
   BOTTOM dock — one scrollable row of essentials, the rest behind ⋯ More
   (body.cmp-more = wrap drawer). The page gets the whole screen (Doc layout
   is the phone default, set in JS); the rail becomes a filmstrip above the
   dock behind ▤ Pages (body.cmp-mrail); the inspector and every menu become
   bottom sheets. Buttons for these toggles carry .cmp-mob — desktop never
   shows them. ---- */
.cmp-btn.cmp-mob, #cmpSheetPill, .cmp-mgrp, .cmp-segword { display: none; }
@media (max-width: 740px) {
  /* Map Edit mode owns the screen — the composer dock and Style pill stand
     down until ✕ Done (two stacked docks fought for the bottom edge —
     Robert 2026-08-14 "jumpy") */
  body:has(#mapEditBar:not([hidden])) :is(.cmp-bar, #cmpSheetPill, #cmpInspTab) { display: none !important; }
  /* — bottom dock (2026-11-21, Robert on his iPhone: "a blob of tools", and he could not find the way back
       from the fretboard) — two rows that never scroll sideways. Row 1 is the view switch, in words:
       Page | Fretboard. Row 2 is undo, redo, ?, Tools and Close; in the Fretboard view it is Grab board,
       ? and Close, the one job of that view. Tools opens the sheet above the dock: four named groups. — */
  body { --cmp-dock: 116px; --cmp-rail: 0px; }
  /* the pages strip is up (see "pages filmstrip" below): everything that clears the dock clears it too */
  body.cmp-mrail.composer-full:not(.cmp-more):not(.cmp-isheet) { --cmp-rail: 104px; }
  .cmp-bar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 960;
    display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px;
    max-height: 84vh; overflow-x: hidden; overflow-y: auto;
    padding: 8px 10px calc(14px + env(safe-area-inset-bottom));   /* extra base padding clears Safari's gesture zone */
    background: #1C1611; border-top: 1px solid #3E342E; border-bottom: none;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .4); }
  /* the two fixed rows dissolve — every control flows into the dock */
  .cmp-bar-row { display: contents; }
  .cmp-bar .cmp-title, .cmp-bar .cmp-lbl, .cmp-bar .cmp-spacer, .cmp-bar .cmp-sep { display: none; }
  /* desktop-only on phones: the infinite canvas and Present are computer
     features (Robert 2026-08-13: two "Pages" buttons confused; keep mobile
     limited, full capabilities live on the computer). The grab-range ▾ is
     redundant too — phone ⇪ Grab opens the chooser itself. The layout grid
     is a computer tool as well (Robert 2026-11-21). */
  .cmp-bar :is(#cmpView, #cmpPresent, #cmpGrabOpts, #cmpToCanvas, #cmpGrid) { display: none !important; }
  /* the sheet's tools wait behind Tools */
  body:not(.cmp-more) .cmp-bar :is(.cmp-mgrp, #cmpDoc, #cmpTpl, #cmpMPages, #cmpText, #cmpImage, #cmpSetup, #cmpGrid, #cmpZoom, #cmpPDF),
  body:not(.cmp-more):not(.composer-min) .cmp-bar #cmpGrab { display: none; }
  /* the Fretboard view: the page tools have no page to work on */
  body.composer-min .cmp-bar :is(.cmp-histpair, #cmpMore) { display: none; }
  body.composer-min .cmp-bar :is(#cmpHelp, #cmpGrab) { opacity: 1 !important; pointer-events: auto !important; }   /* the computer's board-only layout dims Help */
  /* the sheet: a heading, then its buttons, group by group */
  .cmp-mgrp { display: block; flex: 0 0 100%; box-sizing: border-box; margin: 8px 0 -1px; padding: 0 2px;
    font: 600 11.5px 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: #CFC4B2; }
  .cmp-mgrp[data-g="set"] { order: 10; margin-top: 2px; } #cmpDoc { order: 11; } #cmpTpl { order: 12; } #cmpMPages { order: 13; }
  .cmp-mgrp[data-g="add"] { order: 20; } #cmpText { order: 21; } body:not(.composer-min) #cmpGrab { order: 22; } #cmpImage { order: 23; }
  .cmp-mgrp[data-g="page"] { order: 30; } #cmpSetup { order: 31; } #cmpGrid { order: 32; } #cmpZoom { order: 33; }
  .cmp-mgrp[data-g="save"] { order: 40; } #cmpPDF { order: 41; }
  #composerPane .cmp-bar .cmp-seg button { min-height: 36px; }
  body.cmp-more #composerPane .cmp-bar :is(#cmpDoc, #cmpTpl, #cmpMPages, #cmpText, #cmpGrab, #cmpImage, #cmpSetup, #cmpGrid, #cmpPDF) { flex: 1 1 auto; justify-content: center; text-align: center; }
  body.cmp-more #composerPane .cmp-bar #cmpDoc { flex: 1 1 100%; max-width: none; }   /* the set's name gets the whole row */
  body.cmp-more .cmp-bar #cmpZoom { flex: 1 1 auto; } body.cmp-more .cmp-bar #cmpZoom button { flex: 1 1 auto; }
  body.cmp-more .cmp-bar::before { content: ''; order: 50; flex: 0 0 100%; height: 0; margin: 6px 0 2px; border-top: 1px solid #3E342E; }
  /* row 1: the view switch */
  .cmp-bar #cmpLayout { order: 60; flex: 0 0 100%; box-sizing: border-box; }
  .cmp-bar #cmpLayout button { flex: 1 1 0; min-height: 36px; font: 700 13.5px Sora, sans-serif; }
  #cmpLayout .cmp-segico { display: none; }
  #cmpLayout .cmp-segword { display: inline; }
  /* row 2 */
  .cmp-histpair { order: 70; display: inline-flex; gap: 6px; flex: 0 0 auto; }
  #composerPane .cmp-histpair .cmp-btn { width: 46px; padding: 0; }
  body.composer-min .cmp-bar #cmpGrab { order: 70; background: var(--accent, #E8C36B); border-color: var(--accent, #E8C36B); color: #1A1614; font-weight: 700; }   /* the one job of this view */
  #composerPane .cmp-bar #cmpHelp { order: 72; width: 46px; padding: 0; font-size: 0; }
  .cmp-bar #cmpHelp::before { content: '?'; font: 700 16px Mulish, sans-serif; }
  .cmp-bar #cmpMore { order: 80; margin-left: auto; min-width: 76px; justify-content: center; font-weight: 700;
    border-color: var(--accent, #E8C36B); color: var(--accent, #E8C36B); }
  body.cmp-more .cmp-bar #cmpMore { background: var(--accent, #E8C36B); color: #1A1614; }
  .cmp-bar #cmpClose { order: 81; }
  body.composer-min .cmp-bar #cmpClose { margin-left: auto; }
  .cmp-btn.cmp-mob { display: inline-flex; align-items: center; }
  /* touch targets */
  #composerPane .cmp-bar .cmp-btn { min-height: 44px; padding: 8px 12px; font-size: 12.5px; flex: 0 0 auto; }
  .cmp-bar .cmp-seg { flex: 0 0 auto; }
  .cmp-bar .cmp-seg button { min-height: 34px; padding: 6px 10px; font-size: 12.5px; }
  #composerPane .cmp-divider { display: none; }
  .cmp-status { display: none; }   /* the dock owns the bottom edge on phones */
  /* clear the dock — generous page headroom so blocks near the page bottom
     scroll up into comfortable reach, above the dock and Safari's own bar */
  body.composer-on .cmp-canvas { padding: 12px 8px calc(160px + var(--cmp-rail) + env(safe-area-inset-bottom)); }
  body.composer-on .container { padding-bottom: calc(var(--cmp-dock) + var(--cmp-rail) + 10px + env(safe-area-inset-bottom)); }
  /* CONTAIN the app under the composer: as a flex item the container's
     min-width:auto let wide rows (key bar, cards) force sideways overflow —
     the phone map stopped wrapping and half the UI hung off-screen
     (Robert 2026-08-14 screenshots). */
  body.composer-on .container { min-width: 0; max-width: 100vw; overflow-x: hidden; }
  body.composer-min #composerPane { flex: 0 0 0px; }

  @media (max-width: 350px) {
    .cmp-bar { gap: 6px 4px; }
    #composerPane .cmp-histpair { gap: 4px; }
    #composerPane .cmp-histpair .cmp-btn, #composerPane .cmp-bar #cmpHelp { width: 42px; }
    #composerPane .cmp-bar :is(#cmpMore, #cmpClose) { padding: 8px 9px; }
    .cmp-bar #cmpMore { min-width: 64px; }
  }

  /* — pages filmstrip (▤ Pages) — up from the start in the Page view (Robert
       2026-11-21); horizontal, above the dock. It steps aside for the Tools
       sheet, the style sheet and the Fretboard view. — */
  .cmp-rail { display: none; }
  body.cmp-mrail.composer-full:not(.cmp-more):not(.cmp-isheet) .cmp-rail { display: flex; flex-direction: row; align-items: flex-start; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: calc(var(--cmp-dock) + env(safe-area-inset-bottom)); z-index: 955;
    width: auto; height: 104px; padding: 8px 12px 18px; border-right: none;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    background: rgba(28, 22, 17, .97); border-top: 1px solid #342C27; }
  body.cmp-mrail .cmp-thumb { width: 60px; flex: 0 0 auto; margin-bottom: 0; }
  body.cmp-mrail .cmp-addpage { width: 60px; height: 78px; aspect-ratio: auto; flex: 0 0 auto; }
  body.cmp-mrail .cmp-clearpages { width: auto; flex: 0 0 auto; margin-top: 0; padding: 7px 10px; }
  /* thumb hover chrome never fires on touch — show the per-thumb controls */
  body.cmp-mrail .cmp-thumb .tx, body.cmp-mrail .cmp-thumb .tdup { display: block; width: 22px; height: 22px; font-size: 12px; top: 2px; }
  body.cmp-mrail .cmp-thumb .tx { right: 2px; } body.cmp-mrail .cmp-thumb .tdup { left: 2px; }

  /* — inspector: closed by default (it ate the bottom third of the screen —
       Robert 2026-08-13); the gold ✦ Style pill hints it's there and opens
       the bottom sheet. Its ⟩ closes it again. — */
  .cmp-insp { display: none; }
  body.cmp-isheet .cmp-insp { display: block; position: fixed; left: 0; right: 0; top: auto;
    bottom: calc(var(--cmp-dock) + env(safe-area-inset-bottom)); z-index: 950;
    width: auto; max-height: 42vh; overflow-y: auto;
    background: #241D17; border-left: none; border-top: 1px solid #3E342E;
    border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  body.cmp-isheet .cmp-insp:has(.iempty) { display: none; }
  .cmp-insp .ichip { min-height: 34px; }
  .cmp-insp .icollapse { font-size: 17px; padding: 6px 10px; }
  #cmpInspTab { display: none !important; }   /* replaced by the pill on phones */
  #cmpSheetPill:not([hidden]) { display: inline-flex; align-items: center;
    position: fixed; right: 10px; bottom: calc(var(--cmp-dock) + var(--cmp-rail) + 12px + env(safe-area-inset-bottom)); z-index: 949;
    font: 700 12px Sora, sans-serif; color: #1A1614; background: var(--accent, #E8C36B);
    border: none; border-radius: 999px; padding: 10px 15px; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }

  /* — menus, popovers, upgrade nudges = bottom sheets (placePop's inline
       left/top loses to the fixed sheet position) — */
  #composerPane .cmp-menu, #composerPane .cmp-pop, #composerPane .cmp-upgrade {
    position: fixed !important; left: 10px !important; right: 10px; top: auto !important;
    bottom: calc(var(--cmp-dock) + 8px + env(safe-area-inset-bottom)) !important;
    width: auto; min-width: 0; max-height: 55vh; overflow-y: auto; z-index: 970; }
  #composerPane .cmp-pop { flex-wrap: wrap; }
  .cmp-menu button { padding: 11px 12px; }

  /* — text-format toolbar pins to the top: the keyboard owns the bottom — */
  #composerPane .cmp-textbar { position: fixed !important; left: 8px !important; right: 8px;
    top: calc(8px + env(safe-area-inset-top)) !important; max-width: none; z-index: 980; }

  /* — present mode: controls wrap inside the screen — */
  .cmp-present-ui { left: 8px; right: 8px; transform: none; flex-wrap: wrap; justify-content: center; }
  .cmp-pgnav { width: 36px; height: 54px; font-size: 18px; }

  /* — selection chrome sized for fingers — */
  .cmp-h { width: 15px; height: 15px; }
  .cmp-h-br { right: -10px; bottom: -10px; } .cmp-h-tl { left: -10px; top: -10px; }
  .cmp-h-tr { right: -10px; top: -10px; } .cmp-h-bl { left: -10px; bottom: -10px; }
  .cmp-hside { width: 14px; height: 28px; }
  .cmp-hside-l { left: -18px; } .cmp-hside-r { right: -18px; }
  /* the ✕ sat right on the corner anchor of thin blocks (divider lines) —
     lift it well above the handles and rotate zones */
  .cmp-del { width: 30px; height: 30px; font-size: 14px; top: -48px; right: -6px; }
  /* ONE deliberately big grab-me anchor (bottom-right) — precise fingers are
     a myth; the other three corners stay small (Robert 2026-08-13) */
  .cmp-h-br { width: 26px; height: 26px; right: -15px; bottom: -15px; border-radius: 7px; }
  /* split layout is a tablet/desktop idea — phones switch Doc ⇄ Board */
  #cmpLayout [data-layout="split"] { display: none; }
  /* thin blocks (rules, shape outlines) get an invisible fat tap area so a
     finger can land on them without pixel-hunting the stroke */
  .cmp-blk.cmpt-rule::after, .cmp-blk.cmpt-shape::after {
    content: ''; position: absolute; inset: -14px; }
}

/* writing lines + movable chord labels (Robert 2026-08-12) */
.cmp-blk .cmp-text .wl-ruled { display: block; height: 110px;
  background: repeating-linear-gradient(to bottom, transparent 0 26px, #C9C0B2 26px 27px); }
.cmp-blk .cmp-text.cmpt-chordlab { font-family: Sora, sans-serif; font-weight: 800; font-size: 13px;
  color: var(--tink, #B4823B); min-height: 0; line-height: 1.2; }

/* Mobile hint: the Composer is usable on phones but best on a larger screen.
   Shown once at the top of the pane on narrow viewports; "Got it" dismisses it
   (remembered via localStorage -> body.cmp-hint-off). Hidden on desktop. */
.cmp-mobile-hint { display: none; }
@media (max-width: 740px) {
  body.composer-on:not(.cmp-hint-off) #composerPane .cmp-mobile-hint {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 14px; background: rgba(232, 195, 107, 0.14);
    color: var(--ink, #f5f1e8); border-bottom: 1px solid var(--rule, #4a3d31);
    font-size: 13px; line-height: 1.35;
  }
  /* in the Fretboard view the pane has no height, and the notice lay across the top of the Map */
  body.composer-on.composer-min:not(.cmp-hint-off) #composerPane .cmp-mobile-hint { display: none; }
  #composerPane .cmp-mobile-hint button {
    flex: none; padding: 6px 12px; border: 1px solid var(--accent, #e8c36b);
    border-radius: 8px; background: none; color: var(--accent, #e8c36b);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
  }
}

/* Pro template cards in the picker: visible (the library's breadth is part of
   the pitch) but marked, slightly dimmed thumbnail, no fake padlock. */
.cmp-pick-card.cmp-pick-lockedcard .cmp-pick-thumb { opacity: 0.55; }
.cmp-pick-card { position: relative; }
.cmp-pick-pro {
  position: absolute; top: 8px; right: 8px; padding: 3px 7px; border-radius: 6px;
  background: rgba(232, 195, 107, 0.16); border: 1px solid rgba(232, 195, 107, 0.55);
  color: #E8C36B; font: 600 9px 'IBM Plex Mono', monospace; letter-spacing: 0.12em;
}

/* Inspector fine-print (e.g. "re-grab this board to get note tools"). */
.cmp-insp-note { font-size: 11px; line-height: 1.45; color: #8F857A; }

/* Quick-label chips (label tool): compact squares so R·3·♭3·5… fit one row. */
.cmp-lblrow { flex-wrap: wrap; gap: 4px; }
.cmp-lblrow .cmp-lbl-chip { min-width: 26px; padding: 4px 6px; text-align: center; justify-content: center; }

/* Blank-fretboard dialog: CENTERED over the page with a dim veil so the fret
   range can't be missed (Robert 2026-08-27 — the corner popover got skipped). */
.cmp-pop-veil { position: fixed; inset: 0; z-index: 9490; background: rgba(12, 9, 7, 0.45); }
.cmp-pop.cmp-pop-center {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 9500; padding: 18px 22px; font-size: 13.5px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65);
}
.cmp-pop-center .cmp-pop-title {
  font-family: Sora, sans-serif; font-weight: 700; font-size: 15px; color: #F5F1E8;
}
.cmp-pop-center input.cmp-frethl { width: 54px; font-size: 15px; padding: 8px 4px; }
.cmp-pop-center .go { padding: 8px 16px; font-size: 13px; }

/* Blank-fretboard popover: the fret inputs keep their normal outline and flash/
   bounce ONCE when the popover opens, so the eye lands on the range without a
   ring that never goes away (Robert 2026-08-27). */
.cmp-pop input.cmp-frethl { animation: cmpFretFlash 0.85s ease-in-out 1; }
@keyframes cmpFretFlash {
  0%, 100% { box-shadow: none; transform: none; }
  25% { box-shadow: 0 0 0 2px var(--accent, #E8C36B), 0 0 12px rgba(232, 195, 107, 0.75); transform: translateY(-3px); }
  55% { box-shadow: 0 0 0 1px var(--accent, #E8C36B), 0 0 6px rgba(232, 195, 107, 0.35); transform: translateY(1px); }
  75% { transform: translateY(-1px); }
}

/* Table column resize: drag a header cell's right edge; fixed layout pins widths.
   Pinned <col>s are percentages of the block's inner width (19-composer.js
   colPercents), so the table always fits its frame; min-width: 0 on the cells
   so a narrow column can't push the sum past the box either. */
.cmp-table.fixed { table-layout: fixed; max-width: 100%; }
.cmp-table.fixed td { overflow: hidden; min-width: 0; }
.cmp-col-resize { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; z-index: 3; }
.cmp-col-resize:hover { background: rgba(74, 144, 217, 0.45); }

/* ============================================================
   Visual template picker (Robert 2026-08-26) — grouped gallery
   with a thumbnail of each template's first page.
   ============================================================ */
.cmp-pick { position: fixed; inset: 0; z-index: 9000; background: rgba(12,9,7,.72);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.cmp-pick-panel { width: min(1000px, 96vw); max-height: 92vh; background: #201A15;
  border: 1px solid #3E342E; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column; overflow: hidden; }
.cmp-pick-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #3E342E; flex: none; }
.cmp-pick-title { font-family: Sora, sans-serif; font-weight: 700; font-size: 16px; color: #F5F1E8; }
.cmp-pick-title span { font-family: Mulish, sans-serif; font-weight: 400; font-size: 12px; color: #8F857A; }
.cmp-pick-actions { display: flex; gap: 8px; }
.cmp-pick-body { padding: 4px 18px 20px; overflow-y: auto; }
.cmp-pick-group { margin-top: 18px; }
.cmp-pick-group h4 { font-family: Sora, sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: #E8C36B; margin: 0 0 12px; }
/* --pick-w: the card width the picker was drawn at (js pickCardW: 208px, less on a phone so two fit a row) */
.cmp-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, var(--pick-w, 208px));
  justify-content: center; gap: 20px 16px; }
.cmp-pick-card { width: var(--pick-w, 208px); display: flex; flex-direction: column; background: none;
  border: 0; padding: 0; cursor: pointer; text-align: left; }
.cmp-pick-thumb { position: relative; width: var(--pick-w, 208px); height: calc(var(--pick-w, 208px) * 1.2933); border-radius: 6px;
  overflow: hidden; border: 2px solid #3E342E; background: #FBF8F2; transition: border-color .12s; }
.cmp-pick-card:hover .cmp-pick-thumb { border-color: #E8C36B; }
.cmp-pick-thumb .cmp-mini { transform-origin: 0 0; }
.cmp-pick-name { font-family: Sora, sans-serif; font-weight: 700; font-size: 13px;
  color: #F5F1E8; margin-top: 8px; line-height: 1.25; }
.cmp-pick-card:hover .cmp-pick-name { color: #E8C36B; }
.cmp-pick-desc { font-family: Mulish, sans-serif; font-size: 11px; line-height: 1.4;
  color: #8F857A; margin-top: 3px; }
/* Card meta line (editor's redesign spec §12): tier + pages/screens/Canvas. */
.cmp-pick-meta { font: 600 9.5px 'IBM Plex Mono', monospace; letter-spacing: 0.1em;
  color: #B4A88F; margin-top: 4px; }

/* Template picker search (2026-08-26) */
.cmp-pick-head { gap: 12px; }
.cmp-pick-search { flex: 1; min-width: 120px; max-width: 300px; background: #171310;
  border: 1px solid #3E342E; border-radius: 8px; color: #F5F1E8; font-family: Mulish, sans-serif;
  font-size: 13px; padding: 7px 12px; }
.cmp-pick-search::placeholder { color: #8F857A; }
.cmp-pick-search:focus { outline: none; border-color: #E8C36B; }
.cmp-pick-empty { color: #8F857A; font-family: Mulish, sans-serif; font-size: 13px;
  text-align: center; padding: 40px 0; }
/* All | Free (2026-11-21). The panel is never taller than the screen it is on:
   92vh is measured without iPhone Safari's address bar, so the top of a centered
   panel (search, New Practice Set, Close) went up under the bar. */
.cmp-pick-panel { max-height: min(92vh, 100%); }
.cmp-pick-body { flex: 1 1 auto; min-height: 0; }
.cmp-pick-filter { flex: none; }
.cmp-pick-filter button { font: 600 12.5px Mulish, sans-serif; padding: 6px 13px; }
/* A phone: the picker is the whole screen. Templates and Close, then the search,
   then All | Free with New Practice Set beside it. */
@media (max-width: 740px) {
  .cmp-pick { padding: 0; align-items: stretch; }
  .cmp-pick-panel { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .cmp-pick-head { flex-wrap: wrap; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .cmp-pick-actions { display: contents; }
  .cmp-pick-title { order: 1; flex: 1 1 auto; align-self: center; font-size: 18px; }
  .cmp-pick-title span { display: none; }
  .cmp-pick-head .cmp-btn { min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .cmp-pick-head [data-pickclose] { order: 2; }
  .cmp-pick-search { order: 3; flex: 0 0 100%; max-width: none; box-sizing: border-box; min-height: 44px; font-size: 16px; }
  .cmp-pick-filter { order: 4; }
  .cmp-pick-filter button { min-height: 38px; padding: 6px 18px; font-size: 14px; }
  .cmp-pick-head [data-picknewdoc] { order: 5; margin-left: auto; }
  .cmp-pick-head [data-picksave] { order: 6; }
  .cmp-pick-body { padding: 0 12px calc(24px + env(safe-area-inset-bottom)); }
  .cmp-pick-grid { justify-content: space-between; gap: 18px 12px; }
}

/* Practice Builder getting-started guide (Robert 2026-08-26) — over a blank page */
.cmp-empty { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 96px 40px 40px; z-index: 5; }
.cmp-empty-card { max-width: 580px; width: 100%; text-align: center; }
.cmp-empty-k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .16em; color: #C99B45; margin-bottom: 8px; }
.cmp-empty-card h2 { font-family: Sora, sans-serif; font-size: 24px; color: #26201A; margin: 0 0 8px; }
.cmp-empty-card > p { font-family: Mulish, sans-serif; font-size: 14px; color: #6E6257; margin: 0 0 22px; }
.cmp-empty-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.cmp-empty-opts button { background: #FFFFFF; border: 1px solid #D9CFC0; border-radius: 12px; padding: 14px 16px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.cmp-empty-opts button:hover { border-color: #E8C36B; box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.cmp-empty-opts button b { display: block; font-family: Sora, sans-serif; font-size: 14px; color: #26201A; margin-bottom: 4px; }
.cmp-empty-opts button span { display: block; font-family: Mulish, sans-serif; font-size: 12px; line-height: 1.4; color: #6E6257; }
@media (max-width: 620px) { .cmp-empty-opts { grid-template-columns: 1fr; } }

/* Note-colour palette in the mark toolbar (Robert 2026-08-26) */
.cmp-markcols { align-items: center; gap: 6px; flex-wrap: wrap; }
.cmp-mc-lbl { font-size: 11px; color: #8F857A; margin-right: 2px; }
.cmp-mcsw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #3E342E; background: var(--mc, #1A1A1A); cursor: pointer; padding: 0; }
.cmp-mcsw.on { border-color: #E8C36B; box-shadow: 0 0 0 2px rgba(232,195,107,.3); }
.cmp-markcols input[type="color"] { width: 26px; height: 22px; padding: 0; border: 1px solid #3E342E; border-radius: 5px; background: none; cursor: pointer; }

/* ── Magic Move blocks (js/24-magic-move.js) ─────────────────────────────── */
.cmp-blk .cmp-move-live, .cmp-blk .cmp-move-live svg { display: block; width: 100%; }
.cmp-move-pop textarea { width: 380px; height: 150px; resize: vertical; font: 11.5px/1.45 'IBM Plex Mono', monospace;
  background: #1A1614; color: #F5F1E8; border: 1px solid #3E342E; border-radius: 6px; padding: 8px; }
.cmp-move-pop .cmp-move-msg { max-width: 380px; color: #F2B8A6; line-height: 1.45; font-size: 12px; }
.cmp-move-pop .cmp-move-msg:empty { display: none; }
.cmp-move-pop .cmp-move-msg b { color: #F5F1E8; }
.cmp-move-pop textarea:focus { outline: 2px solid #E8C36B; outline-offset: 1px; }
/* Present, hand still: nothing on screen but the page (recording-clean). */
body.cmp-present .cmp-pgnav, body.cmp-present .cmp-present-chip, body.cmp-present #cmpPresLamp { transition: opacity .35s; }
body.cmp-present.cmp-pres-idle .cmp-pgnav, body.cmp-present.cmp-pres-idle .cmp-present-chip,
body.cmp-present.cmp-pres-idle #cmpPresLamp { opacity: 0; pointer-events: none; }
body.cmp-present.cmp-pres-idle, body.cmp-present.cmp-pres-idle * { cursor: none !important; }

/* Magic Move — hover play bar on the page (Pages + Canvas). Never on air, never in print. */
.cmp-blk .cmp-mm-bar { position: absolute; left: 50%; top: 100%; margin-top: 8px; transform: translateX(-50%); z-index: 6;   /* under the board, never over it (Robert 2026-10-14: recordings) */
  display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 999px;
  background: rgba(26,22,20,.9); border: 1px solid #5A4A41; box-shadow: 0 6px 16px rgba(0,0,0,.35);
  opacity: 1; pointer-events: auto; transition: opacity .25s ease .4s; white-space: nowrap; }
.cmp-blk .cmp-mm-bar.placed { left: 0; top: 0; margin-top: 0; transform: none; }
.cmp-blk .cmp-mm-bar.dragging { transition: none; opacity: 1 !important; }
/* Auto-hide: the bar shows for 2.5 s after the pointer moves over the board (or the bar), and stays while the pointer is on it */
.cmp-blk .cmp-mm-bar.auto { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.cmp-blk .cmp-mm-bar.auto.show, .cmp-blk .cmp-mm-bar.auto.playing, .cmp-blk .cmp-mm-bar.auto:focus-within { opacity: 1; pointer-events: auto; }
.cmp-mm-grip { cursor: grab; color: #8F7F72; font-size: 14px; padding: 0 4px; user-select: none; }
.cmp-mm-grip:active { cursor: grabbing; }
.cmp-mm-hide { opacity: .7; }
.cmp-mm-add { display: flex; flex-direction: column; gap: 3px; margin: 0 0 8px; }
.cmp-mm-add .ichip { align-self: flex-start; }
.cmp-mm-add span { font: 12px/1.4 Mulish, sans-serif; color: #8F7F72; }
.cmp-mm-bar button { font: 600 12px 'IBM Plex Mono', monospace; color: #E7DCCB; background: #2A231F; border: 1px solid #3E342E;
  border-radius: 999px; padding: 4px 10px; cursor: pointer; line-height: 1.2; }
.cmp-mm-bar button:hover { background: #342C27; }
.cmp-mm-bar button:active { transform: translateY(1px); }
.cmp-mm-bar button:focus-visible { outline: 2px solid #E8C36B; outline-offset: 2px; }
.cmp-mm-bar button:disabled { opacity: .35; pointer-events: none; }
.cmp-mm-bar .cmp-mm-play { color: #1A1614; background: #E8C36B; border-color: #E8C36B; }
.cmp-mm-bar .cmp-mm-n { font: 600 12px 'IBM Plex Mono', monospace; color: #C9BDAF; min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
body.cmp-present .cmp-mm-bar, body.cmp-printing .cmp-mm-bar { display: none !important; }

/* Magic Move — Inspector settings */
.cmp-insp .cmp-mm-k { font: 600 9.5px 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: #8F7F72; margin: 8px 0 4px; }
.cmp-insp .cmp-mm-row .ichip { padding: 6px 1px; }
.cmp-insp .ichip:disabled { opacity: .35; pointer-events: none; }
.cmp-insp .cmp-mm-lbl { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.cmp-insp select[data-mmset] { width: 100%; font: 600 11px Sora, sans-serif; color: #F5F1E8; background: #1A1614; border: 1px solid #3E342E; border-radius: 6px; padding: 6px; }
.cmp-insp select[data-mmset]:focus-visible { outline: 2px solid #E8C36B; outline-offset: 1px; }

/* Magic Move — Present → Stage: a 1920×1080 stage scaled to the screen, the same
   look as the exported player page (dev/magic-move/stage.html). */
#cmpStage { position: fixed; inset: 0; z-index: 615; display: none; align-items: center; justify-content: center;
  background: #1A1614; overflow: hidden; cursor: pointer; }
body.cmp-present.cmp-stage-on #cmpStage { display: flex; }
#cmpStage .mms-stage { font-style: normal; text-align: left; position: relative; width: 1920px; height: 1080px; flex: 0 0 auto; transform-origin: center center; grid-template-columns: minmax(0, 1fr);
  background: radial-gradient(1200px 520px at 50% 52%, rgba(232,195,107,0.075), rgba(232,195,107,0) 70%), #1A1614;
  display: grid; grid-template-rows: auto 1fr auto; padding: 72px 80px 64px; box-sizing: border-box; }
#cmpStage .mms-head { text-align: center; display: grid; justify-items: center; transition: opacity .35s ease; }
#cmpStage .mms-kicker { font: 600 22px 'IBM Plex Mono', monospace; letter-spacing: .16em; text-transform: uppercase;
  color: color-mix(in srgb, #E8C36B 60%, #8F7F72); margin-bottom: 14px; min-height: 1.2em; }
#cmpStage .mms-title { margin: 0; font-family: var(--mms-title, 'Sora', sans-serif); font-weight: 700; font-size: 60px; line-height: 1.08;
  color: #F5F1E8; letter-spacing: -0.01em; text-wrap: balance; }
#cmpStage .mms-title .acc { color: #E8C36B; }
#cmpStage .mms-boardwrap { align-self: stretch; min-height: 0; display: flex; align-items: center; justify-content: center; }
#cmpStage .mms-board { width: 100%; }
#cmpStage .mms-foot { display: grid; gap: 22px; justify-items: center; transition: opacity .35s ease; min-width: 0; max-width: 100%; }
#cmpStage .mms-legend { display: flex; gap: 28px; min-height: 34px; align-items: center; font: 600 22px 'IBM Plex Mono', monospace; color: #C9BDAF; }
#cmpStage .mms-legend span { display: inline-flex; align-items: center; gap: 10px; }
#cmpStage .mms-legend i { width: 20px; height: 20px; border-radius: 50%; display: inline-block; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
#cmpStage .mms-caption { font-family: var(--mms-caption, 'Mulish', sans-serif); font-size: 34px; line-height: 1.35; color: #C9BDAF;
  max-width: 1500px; text-align: center; min-height: 92px; transition: opacity .3s ease; text-wrap: balance; }
#cmpStage .mms-caption b, #cmpStage .mms-caption strong { color: #F5F1E8; font-weight: 700; }
#cmpStage .mms-steps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 100%; row-gap: 8px; }
/* Many steps: the pips become small dots and the current step's name is written once underneath */
#cmpStage .mms-steps.many { gap: 7px; }
#cmpStage .mms-steps.many .mms-pip { font-size: 0; width: 14px; height: 14px; padding: 0; border-radius: 50%; min-width: 0; }
#cmpStage .mms-stepname { font: 600 17px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: #E8C36B; min-height: 1.2em; text-align: center; }
#cmpStage .mms-stepname:empty { display: none; }
#cmpStage .mms-pip { font: 600 17px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: #8F7F72;
  background: #2A231F; border: 1px solid #433730; border-radius: 999px; padding: 9px 18px; cursor: pointer; }
#cmpStage .mms-pip.on { color: #1A1614; background: #E8C36B; border-color: #E8C36B; }
#cmpStage .mms-pip.done { color: #C9BDAF; border-color: #5A4A41; }
#cmpStage .mms-pip:focus-visible { outline: 2px solid #E8C36B; outline-offset: 2px; }
#cmpStage.font-wait .mms-head, #cmpStage.font-wait .mms-caption { visibility: hidden; }
body.cmp-stage-notext #cmpStage .mms-head, body.cmp-stage-notext #cmpStage .mms-foot { opacity: 0; }
/* Ink, fit-width and the lamp work on the page, not over the stage. */
body.cmp-stage-on .cmp-present-ui #cmpFitW, body.cmp-stage-on .cmp-present-ui #cmpInkBtn, body.cmp-stage-on .cmp-present-ui #cmpBoxBtn,
body.cmp-stage-on .cmp-present-ui #cmpCircBtn, body.cmp-stage-on .cmp-present-ui #cmpArrowBtn, body.cmp-stage-on .cmp-present-ui #cmpLampBtn,
body.cmp-stage-on .cmp-present-ui .cmp-inkcols, body.cmp-stage-on .cmp-present-ui #cmpInkClear, body.cmp-stage-on #cmpPresLamp { display: none !important; }
#cmpStageBtn.on, #cmpCleanBtn.on { border-color: #E8C36B; color: #E8C36B; }

/* Present → Clean (H): every control hidden until H or Esc. */
body.cmp-present.cmp-pres-clean .cmp-present-ui, body.cmp-present.cmp-pres-clean .cmp-pgnav,
body.cmp-present.cmp-pres-clean .cmp-present-chip, body.cmp-present.cmp-pres-clean #cmpPresLamp { opacity: 0 !important; pointer-events: none !important; }
body.cmp-present.cmp-pres-clean, body.cmp-present.cmp-pres-clean * { cursor: none !important; }
@media (prefers-reduced-motion: reduce) { #cmpStage .mms-caption, #cmpStage .mms-head, #cmpStage .mms-foot, .cmp-blk .cmp-mm-bar { transition: none; } }

/* Magic Move steps list (Inspector, authoring only) */
.cmp-mm-steps { display: flex; flex-direction: column; gap: 3px; margin: 4px 0 6px; }
.cmp-mm-step { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; }
.cmp-mm-step:hover { background: #241e1a; }
.cmp-mm-step.on { border-color: #5A4A41; background: #2A231F; }
.cmp-mm-sn { font: 600 11px 'IBM Plex Mono', monospace; color: #8F7F72; min-width: 16px; text-align: right; }
.cmp-mm-sname { flex: 1; min-width: 0; font: 12.5px Mulish, sans-serif; color: #F5F1E8; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; }
.cmp-mm-sname:focus { border-color: #C99B45; background: #1A1614; outline: none; }
.cmp-mm-step button { font: 600 11px 'IBM Plex Mono', monospace; color: #C9BDAF; background: #342C27; border: 1px solid #3E342E; border-radius: 4px; padding: 2px 5px; cursor: pointer; line-height: 1.2; }
.cmp-mm-step button:hover { background: #3E342E; color: #F5F1E8; }
.cmp-mm-step button:disabled { opacity: .35; cursor: default; }
.cmp-mm-cap { width: 100%; font: 12.5px Mulish, sans-serif; color: #F5F1E8; background: #1A1614; border: 1px solid #3E342E; border-radius: 6px; padding: 6px; resize: vertical; }
.cmp-mm-cap:focus { border-color: #C99B45; outline: none; }
.cmp-mm-cnt { font-weight: 400; color: #8F7F72; }
.cmp-mm-legs { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cmp-mm-leg { display: flex; align-items: center; gap: 6px; }
.cmp-mm-leg i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.cmp-mm-legname { flex: 1; min-width: 0; font: 12.5px Mulish, sans-serif; color: #F5F1E8; background: #1A1614; border: 1px solid #3E342E; border-radius: 4px; padding: 3px 6px; }
.cmp-mm-legname:focus { border-color: #C99B45; outline: none; }
.cmp-mm-ask { background: #2A231F; border: 1px solid #5A4A41; border-radius: 6px; padding: 6px; }

/* Stage dock: the exported page's controls, on the app's stage */
#cmpStage .mms-dock { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 620; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: rgba(26,22,20,.92); border: 1px solid #5A4A41; box-shadow: 0 8px 24px rgba(0,0,0,.45); cursor: default; }
#cmpStage .mms-dock button { font: 600 12px 'IBM Plex Mono', monospace; color: #E7DCCB; background: #2A231F; border: 1px solid #3E342E; border-radius: 999px; padding: 6px 11px; cursor: pointer; }
#cmpStage .mms-dock button:hover { background: #342C27; }
#cmpStage .mms-dock button.on { background: #E8C36B; color: #1A1614; border-color: #E8C36B; }
#cmpStage .mms-dock .mms-count { font: 600 12px 'IBM Plex Mono', monospace; color: #C9BDAF; padding: 0 4px; }
#cmpStage .mms-dock .mms-sep { width: 1px; height: 18px; background: #3E342E; margin: 0 2px; }
#cmpStage .mms-dock .mms-speed { display: inline-flex; gap: 2px; }
#cmpStage .mms-look { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 620; display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px;
  background: rgba(26,22,20,.96); border: 1px solid #5A4A41; box-shadow: 0 8px 24px rgba(0,0,0,.45); cursor: default; }
#cmpStage .mms-look[hidden] { display: none; }
#cmpStage .mms-look-row { display: flex; align-items: center; gap: 4px; }
#cmpStage .mms-look-row > span { font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: #8F7F72; width: 58px; }
#cmpStage .mms-look-row button, #cmpStage .mms-look-row select { font: 600 12px 'IBM Plex Mono', monospace; color: #C9BDAF; background: #2A231F; border: 1px solid #3E342E; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
#cmpStage .mms-look-row button.on { background: #E8C36B; color: #1A1614; border-color: #E8C36B; }
#cmpStage .mms-look-row button:disabled { opacity: .35; cursor: default; }
body.cmp-present.cmp-pres-clean #cmpStage .mms-dock, body.cmp-present.cmp-pres-clean #cmpStage .mms-look { opacity: 0 !important; pointer-events: none !important; }
.cmp-mm-under { width: 100%; font: 12.5px Mulish, sans-serif; color: #F5F1E8; background: #1A1614; border: 1px solid #3E342E; border-radius: 6px; padding: 5px 7px; }
.cmp-mm-under:focus { border-color: #C99B45; outline: none; }

/* Stage beat row: one dot per beat, the current one lit */
#cmpStage .mms-beats { display: flex; align-items: center; gap: 10px; min-height: 18px; }
#cmpStage .mms-beats:empty { display: none; }
#cmpStage .mms-beats .mms-bar { font: 600 15px 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: #8F7F72; margin-right: 8px; }
#cmpStage .mms-beats i { width: 14px; height: 14px; border-radius: 50%; background: #3E342E; display: inline-block; }
#cmpStage .mms-beats i.done { background: #5A4A41; }
#cmpStage .mms-beats i.on { background: #E8C36B; box-shadow: 0 0 0 0 rgba(232,195,107,.6); }
#cmpStage .mms-beats i.on.pulse { animation: mmsBeat .5s ease-out; }
@keyframes mmsBeat { 0% { transform: scale(1.5); box-shadow: 0 0 0 0 rgba(232,195,107,.6); } 100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(232,195,107,0); } }
body.cmp-stage-notext #cmpStage .mms-beats { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #cmpStage .mms-beats i.on.pulse { animation: none; } }
body.cmp-present.cmp-stage-on .cmp-present-ui { display: none; }   /* the stage dock carries Clean, Page and Exit */
#cmpStage .mms-dock button[data-sd="exit"] { color: #F5F1E8; }
.cmp-mm-rec { border: 1px solid #EC6A43; border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; background: rgba(236,106,67,.06); }
.cmp-mm-rec .cmp-mm-k { color: #EC6A43; margin-top: 0; }
body.cmp-mm-rec-on #fretboard, body.cmp-mm-rec-on #fretboard * { cursor: crosshair !important; }   /* beats Edit mode's inline hand/pointer cursors */
body.cmp-mm-rec-on #fretboard { outline: 2px solid #EC6A43; outline-offset: 4px; border-radius: 6px; }
#cmpRecBar { position: fixed; z-index: 9000; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; background: #1B1613; border: 1px solid #EC6A43; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.45); font: 13px/1.3 Mulish, sans-serif; color: #F5F1E8; box-sizing: border-box; }
#cmpRecBar .rb-dot { width: 10px; height: 10px; border-radius: 50%; background: #EC6A43; animation: cmpRecBlink 1.1s ease-in-out infinite; }
#cmpRecBar .rb-head { font-family: Sora, sans-serif; font-size: 12.5px; margin-right: 6px; }
#cmpRecBar .rb-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #8F7F72; margin-left: 6px; }
#cmpRecBar .rb-grp { display: inline-flex; gap: 4px; flex-wrap: wrap; }
#cmpRecBar .rb-end { margin-left: auto; }
#cmpRecBar .ichip { font-family: Sora, sans-serif; font-size: 11px; font-weight: 600; padding: 5px 9px; background: #2A231F; border: 1px solid #3D3430; border-radius: 7px; color: #F5F1E8; cursor: pointer; }
#cmpRecBar .ichip.on { background: #E8C36B; color: #1A1614; border-color: #E8C36B; font-weight: 700; }
#cmpRecBar .ichip:disabled { opacity: .4; cursor: default; }
@keyframes cmpRecBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.cmp-rec-pulse { fill: none; stroke: #EC6A43; stroke-width: 3; animation: cmpRecPulse .6s ease-out forwards; pointer-events: none; }
@keyframes cmpRecPulse { from { opacity: 1; transform-box: fill-box; transform-origin: center; transform: scale(.6); } to { opacity: 0; transform: scale(1.8); } }
body.cmp-mm-rec-on .cmp-blk.cmp-rec-target { outline: 2px solid #EC6A43; outline-offset: 6px; }
body.cmp-mm-rec-on .cmp-blk.cmp-rec-target, body.cmp-mm-rec-on .cmp-blk.cmp-rec-target * { cursor: crosshair !important; }
#cmpRecBar .rb-sw, .cmp-mm-rec .rb-sw { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; flex: 0 0 auto; }
#cmpRecBar .rb-sw.on, .cmp-mm-rec .rb-sw.on { border-color: #F5F1E8; box-shadow: 0 0 0 2px #1B1613, 0 0 0 3px #F5F1E8; }
.rb-custom { position: relative; overflow: hidden; background: conic-gradient(#EC6A43, #E8C36B, #43B681, #4FA0EC, #C56BD0, #EC6A43); cursor: pointer; display: inline-block; }
.rb-custom input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.rb-colors { gap: 5px; align-items: center; }
.rb-lens .ichip { font-size: 15px; line-height: 1; padding: 3px 8px; }
.rb-bpm, .cmp-mm-bpm { width: 56px; background: #2A231F; border: 1px solid #3D3430; border-radius: 7px; color: #F5F1E8; font: 600 12px Sora, sans-serif; padding: 4px 6px; }
#cmpRecBar .rb-grip { cursor: grab; color: #8F7F72; font-size: 16px; padding: 0 4px 0 0; user-select: none; }
#cmpRecBar .rb-grip:active { cursor: grabbing; }
body.cmp-pres-clean #cmpRecBar { display: none; }
#cmpStage .mms-countin { font: 800 140px/1 Sora, sans-serif; color: #E8C36B; text-align: center; margin-top: -40px; letter-spacing: .04em; }
#cmpStage .mms-countin.pulse { animation: mmsCount .55s ease-out; }
@keyframes mmsCount { from { transform: scale(1.25); opacity: .6; } to { transform: scale(1); opacity: 1; } }
#cmpStage .mms-dock button[data-sd="countin"].on, #cmpStage .mms-dock button[data-sd="click"].on { background: #E8C36B; color: #1A1614; }
.cmp-mm-len { font: 600 10.5px Sora, sans-serif; background: #2A231F; color: #F5F1E8; border: 1px solid #3D3430; border-radius: 6px; padding: 3px 2px; max-width: 76px; }
#cmpStage .mms-tempo { display: inline-flex; align-items: center; gap: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #F5F1E8; }
#cmpStage .mms-tempo input { width: 56px; background: #2A231F; border: 1px solid #3D3430; border-radius: 6px; color: #F5F1E8; font: 600 13px 'IBM Plex Mono', monospace; padding: 3px 5px; text-align: center; }
#cmpStage.editing .mms-title, #cmpStage.editing .mms-kicker, #cmpStage.editing .mms-caption { outline: 1.5px dashed #E8C36B; outline-offset: 6px; border-radius: 4px; cursor: text; min-height: 1em; }
#cmpStage .mms-dock button[data-sd="edit"].on { background: #E8C36B; color: #1A1614; }
/* Stage dock on a laptop screen: nothing wraps inside a button; the dock itself wraps to two centred rows and the stage foot keeps clear of it. */
#cmpStage .mms-dock { flex-wrap: wrap; justify-content: center; row-gap: 6px; width: max-content; max-width: min(96vw, 1180px); border-radius: 22px; }
#cmpStage .mms-dock button, #cmpStage .mms-dock .mms-count, #cmpStage .mms-dock .mms-tempo { white-space: nowrap; flex: 0 0 auto; }
#cmpStage .mms-dock [hidden] { display: none !important; }
#cmpStage .mms-dock .mms-speed { flex: 0 0 auto; }
@media (max-width: 1500px) {
  #cmpStage .mms-dock { gap: 4px; padding: 5px 8px; }
  #cmpStage .mms-dock button { padding: 5px 9px; font-size: 11.5px; }
}
#cmpStage .mms-foot { padding-bottom: 96px; }
