  :root {
    /* === Surface palette === */
    --bg: #1A1614;
    --bg-warm: #221D1A;
    --bg-elevated: #221D1A;
    --panel: #2A231F;
    --panel-light: #342C27;
    --surface-1: #2A231F;
    --surface-2: #342C27;
    --surface-3: #3E342E;
    --rule: #433730;
    --border-subtle: #433730;
    --border-strong: #5A4A41;

    /* === Text === */
    --ink: #F5F1E8;
    --ink-dim: #C9BDAF;
    --ink-faint: #8F7F72;
    --text-primary: #F5F1E8;
    --text-secondary: #C9BDAF;
    --text-muted: #8F7F72;
    --text-inverse: #1A1614;

    /* === Accent === */
    --accent: #E8C36B;
    --accent-primary: #E8C36B;
    --accent-secondary: #C99B45;
    --accent-deep: #C99B45;

    /* === Fretboard === */
    --fret: #b9a88f;
    --nut: #e9e0cf;

    /* === Chord colors (Heritage palette — Okabe-Ito derived, colorblind-aware.
       Yellow is intentionally gone so the brand gold never collides.) === */
    --c1: #EC6A43;  --c1-dim: #B4502F;   /* vermillion */
    --c2: #4FA0EC;  --c2-dim: #3A77B0;   /* azure      */
    --c3: #E8C36B;  --c3-dim: #B08F45;   /* gold (the animation yellow) */
    --c4: #C56BD0;  --c4-dim: #8E4D97;   /* orchid     */

    /* faint vintage-amp tolex grain — applied only to chassis panels via .amp-tex */
    --tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");

    /* === Other === */
    --danger: #E85D4E;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    /* === Elevation (depth) — named so panels, cards, and graphics stay
       consistent instead of hardcoding shadows everywhere === */
    --elev-1: 0 2px 8px rgba(0,0,0,0.16);
    --elev-2: 0 8px 22px rgba(0,0,0,0.24);
    --elev-3: 0 14px 40px rgba(0,0,0,0.28);

    /* === Surface gradients (top-lit depth) — the "raised panel" look the Map
       uses; reference these instead of re-writing the gradient === */
    --grad-surface: linear-gradient(180deg, var(--surface-2), var(--bg-warm));
    --grad-raised: linear-gradient(180deg, var(--surface-3), var(--surface-1));
  }

  :root {
    --font-display: 'Sora', 'Avenir Next', sans-serif;
    --font-editorial: 'Sora', 'Avenir Next', sans-serif;   /* editorial register folded into the display face (type cleanup 2026-09-23) */
    --font-ui: 'Mulish', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
  }

  /* === Stage-light ambience (Tweaks): reshapes the room around the instrument.
     Default (no attribute) is the warm "tube" glow already defined in :root. === */
  html[data-ambience="studio"] {
    --bg: #191a1c; --bg-warm: #212325; --bg-elevated: #212325;
    --panel: #26282b; --panel-light: #30343a;
    --surface-1: #26282b; --surface-2: #30343a; --surface-3: #3a3f46;
    --accent: #E4CC8F; --accent-primary: #E4CC8F;
  }
  html[data-ambience="studio"] body {
    background-image:
      radial-gradient(ellipse at 50% -8%, rgba(214, 222, 235, 0.05), transparent 52%),
      var(--bg);
  }
  html[data-ambience="midnight"] {
    --bg: #0D1017; --bg-warm: #131826; --bg-elevated: #131826;
    --panel: #161d2d; --panel-light: #1f2839;
    --surface-1: #161d2d; --surface-2: #1f2839; --surface-3: #28324a;
    --border-subtle: #26314c; --border-strong: #364364;
    --accent: #86B2EA; --accent-primary: #86B2EA;
    --accent-secondary: #5C86C2; --accent-deep: #5C86C2;
  }
  html[data-ambience="midnight"] body {
    background-image:
      radial-gradient(ellipse at 18% -2%, rgba(94, 138, 200, 0.12), transparent 46%),
      radial-gradient(ellipse at 82% 8%, rgba(60, 92, 150, 0.09), transparent 40%),
      var(--bg);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  /* Phones: two quick taps on a button (the Frets + and −, a card's step arrows) made Safari zoom the page in,
     and it stayed zoomed. Scrolling and pinching are untouched. */
  html { touch-action: manipulation; }
  /* iPhone Safari enlarges the text of any block wider than the screen. A Practice Builder page is 816
     wide and drawn smaller, so its words grew and ran over the boards beside them (Robert 2026-11-21:
     "From Root to Triad"). 100% keeps every size as written. */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  body {
    background: var(--bg);
    background-image:
      radial-gradient(ellipse at 20% 0%, rgba(232, 196, 104, 0.07), transparent 45%),
      radial-gradient(ellipse at 80% 10%, rgba(201, 147, 61, 0.05), transparent 35%),
      var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding: 28px 20px 56px;
    -webkit-tap-highlight-color: transparent;
  }
  @media (max-width: 700px) {
    body { padding: 16px 12px 40px; }
  }

  /* ============ Brand header & tabs ============ */
  /* subtle amp-skin texture — apply to "chassis" panels only, never to controls */
  .amp-tex { position: relative; }
  .amp-tex::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background-image: var(--tex); background-size: 170px 170px;
    opacity: 0.12; mix-blend-mode: overlay; z-index: 0;
  }
  .amp-tex > * { position: relative; z-index: 1; }

  /* brand lockup — lit fretboard fragment behind the wordmark */
  .brand-lock { position: relative; display: inline-block; }
  .brand-frag {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    z-index: 0; pointer-events: none; line-height: 0;
    -webkit-mask-image: linear-gradient(90deg, #000 46%, transparent 96%);
    mask-image: linear-gradient(90deg, #000 46%, transparent 96%);
  }
  .brand-frag svg { height: 60px; width: auto; display: block; }
  /* the wordmark starts just past the dots, over the fading board art */
  .brand-text { position: relative; z-index: 2; margin-left: 78px; text-align: left; }
  .brand-lock h1 { text-shadow: 0 2px 14px rgba(8,6,4,0.85), 0 0 2px rgba(8,6,4,0.7); }
  @media (max-width: 700px) {
    .brand-frag svg { height: 48px; }
    .brand-text { margin-left: 62px; }
  }

  .brand-header {
    border-bottom: 1px solid var(--rule);
    padding-bottom: 20px;
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
  }
  .tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-warm);
    padding: 4px;
    border-radius: 999px;   /* full pill (Design exploration 8c) */
    border: 1px solid var(--rule);
  }
  .tab {
    background: transparent;
    border: none;
    color: var(--ink-faint);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 80px;
    white-space: nowrap;
  }
  .tab:hover { color: var(--ink); }
  .tab.active {
    background: var(--accent);
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: none;
  }
  /* Resume chip (Design exploration 8c) — jump back into the last lesson from anywhere */
  .resume-chip {
    display: none;
    align-items: center; gap: 6px;
    background: var(--accent); color: var(--text-inverse);
    border: none; border-radius: 999px;
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em;
    padding: 8px 14px; cursor: pointer;
  }
  .resume-chip.on { display: inline-flex; }
  .resume-chip:hover { background: var(--accent-deep); }
  @media (max-width: 900px) { .resume-chip { display: none !important; } }
  @media (max-width: 700px) {
    .brand-header { align-items: stretch; }
    /* Cap the tab strip's container to the viewport so the scrollable .tabs
       stays inside it instead of pushing the page ~18px wider. */
    .brand-right { width: 100%; min-width: 0; }
    .tabs {
      width: 100%;
      max-width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { flex: 0 0 auto; min-width: 0; font-size: 12px; padding: 11px 14px; }
  }

  /* ============ Views ============ */
  .view { animation: fadeIn 0.18s ease-out; }
  .view[hidden] { display: none; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ============ Fretboard hide-labels toggle ============ */
  .fretboard-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 5px 11px 5px 9px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ink-dim);
    text-transform: uppercase;
    transition: all 0.15s;
    user-select: none;
  }
  .toggle-pill:hover { border-color: var(--accent); color: var(--ink); }
  .toggle-pill input { display: none; }
  .toggle-pill input:checked ~ span { color: var(--accent); }
  .toggle-pill:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-warm));
    border-color: var(--accent);
  }

  /* ============ Popover layer (js/02-map.js IFBPop, spec §9) ============
     One body-level fixed layer; every Map menu is placed inside it by the
     shared positioner. position:fixed is !important so no skin rule (the
     hardware hatch sets position:relative for its corner screws) can drop
     a menu back into the page flow. */
  #ifb-popover-layer { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
  #ifb-popover-layer > * { pointer-events: auto; }
  #ifb-popover-layer > .ifb-pop { position: fixed !important; right: auto !important; bottom: auto !important; margin: 0 !important; overflow-y: auto; z-index: auto; }
  #ifb-popover-layer > .ifb-pop[hidden] { display: none !important; }
  .pop-open { border-color: var(--accent-primary) !important; }

  /* ============ Map preset library panel ============ */
  #presetLibPanel {
    position: absolute; right: 18px; top: 54px; z-index: 300;
    width: 360px; max-height: 70vh; overflow-y: auto;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 12px;
    box-shadow: var(--elev-2), 0 14px 44px rgba(0,0,0,.5);
    padding: 10px;
  }
  #presetLibPanel .plib-cat-h {
    font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
    padding: 10px 8px 6px;
  }
  #presetLibPanel .plib-item {
    display: block; width: 100%; text-align: left;
    background: transparent; border: 0; border-radius: 8px;
    padding: 8px 10px; cursor: pointer;
    transition: background .12s;
  }
  #presetLibPanel .plib-item:hover { background: rgba(232,195,107,.08); }
  #presetLibPanel .plib-item b { display: block; font-family: 'Sora', sans-serif; font-size: 13.5px; color: var(--ink); margin-bottom: 1px; }
  #presetLibPanel .plib-item span { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; }

  /* ---- AI Maps input row (js/22-ai-maps.js, internal-gated) ---- */
  #aiMapsRow { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 4px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
  #aiMapsRow input[type="text"] {
    flex: 1 1 0; min-width: 0; padding: 8px 10px; font-size: 12.5px;
    font-family: 'Mulish', sans-serif; color: var(--ink);
    background: rgba(0,0,0,.25); border: 1px solid var(--rule); border-radius: 8px;
  }
  #aiMapsRow input[type="text"]:focus { outline: none; border-color: var(--accent); }
  #aiMapsGo {
    flex: none; padding: 8px 12px; border: none; border-radius: 8px; cursor: pointer;
    background: var(--accent); color: #241d10; font-family: 'Sora', sans-serif;
    font-weight: 700; font-size: 12.5px;
  }
  #aiMapsGo:disabled { opacity: .55; cursor: progress; }
  #aiMapsStatus { flex-basis: 100%; font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); }
  #aiMapsStatus.busy { color: var(--accent); }
  #aiMapsStatus.err { color: #E07B6B; }
  #aiMapsStatus.ok { color: var(--ink-faint); }
  /* floating progress pill while a practice sheet builds (panel is closed) */
  #aiMapsFloat {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    z-index: 9600; padding: 10px 18px; border-radius: 999px;
    background: #26201A; border: 1px solid var(--accent);
    color: var(--accent); font-family: 'Sora', sans-serif; font-size: 13px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5); white-space: nowrap;
  }
  #aiMapsFloat.err { color: #E07B6B; border-color: #E07B6B; }

  /* ============ Welcome + Quick Check (the front door) ============ */
  #welcome {
    position: fixed; inset: 0; z-index: 9500;
    overflow-y: auto;
    /* minmax(0, …): the column may not grow past the screen to fit a wide card */
    display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center;
    background: radial-gradient(ellipse 900px 500px at 50% 0%, rgba(232,195,107,.08), transparent 60%), #160F0A;
    padding: 6vh 20px 40px;
  }
  #welcome .wl-card {
    max-width: 660px; width: 100%;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 18px;
    box-shadow: var(--elev-2), 0 0 70px -20px rgba(232,195,107,.22);
    padding: 36px 40px; text-align: center;
  }
  #welcome.running .wl-card { max-width: min(1320px, 94vw); }
  #welcome .wl-kicker {
    font-family: 'IBM Plex Mono', monospace; font-size: 11px;
    letter-spacing: .18em; color: var(--accent); margin-bottom: 14px;
  }
  #welcome .wl-kicker-sub {
    font-family: 'Mulish', sans-serif; font-size: 12.5px; line-height: 1.5;
    color: var(--ink-faint); margin: -8px 0 16px; max-width: 34em;
  }
  #welcome .wl-snapshot-lead {
    font-family: 'Mulish', sans-serif; font-size: 15px; line-height: 1.5;
    color: var(--ink-dim); margin: 0 0 18px;
  }
  #welcome h1 { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 800; line-height: 1.2; margin: 0 0 12px; color: var(--ink); }
  #welcome .wl-sub { font-family: var(--font-ui); color: var(--ink-dim); font-size: 15.5px; line-height: 1.6; margin: 0 0 24px; }
  #welcome .wl-doors { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  /* Tool-first Map welcome: wider card, brand lockup, two-column showcase grid */
  #welcome.map-welcome .wl-card { max-width: 780px; }
  #welcome.map-welcome .wl-lockup { height: 54px; margin: 0 auto 10px; display: block; }
  #welcome.map-welcome .wl-hatch-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
  #welcome.map-welcome .wl-showcase {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
  }
  #welcome.map-welcome .wl-showcase .wl-door:last-child:nth-child(odd) { grid-column: 1 / -1; }
  @media (max-width: 640px) {
    #welcome.map-welcome .wl-showcase { grid-template-columns: 1fr; }
    #welcome.map-welcome .wl-showcase .wl-door:last-child:nth-child(odd) { grid-column: auto; }
  }
  #welcome .wl-door {
    text-align: left; background: var(--grad-surface); border: 1px solid var(--rule);
    border-radius: 12px; padding: 15px 20px; cursor: pointer;
    box-shadow: var(--elev-1); transition: transform .14s, border-color .14s, box-shadow .14s;
  }
  #welcome .wl-door:hover { transform: translateY(-1px); border-color: var(--accent-deep); box-shadow: var(--elev-2); }
  #welcome .wl-door b { display: block; font-family: 'Sora', sans-serif; font-size: 16px; color: var(--ink); margin-bottom: 3px; }
  #welcome .wl-door span { font-size: 13px; color: var(--ink-faint); line-height: 1.45; }
  #welcome .wl-door.wl-primary { border-color: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel)); }
  #welcome .wl-door.wl-primary b { color: var(--accent); }
  #welcome .wl-hatch { display: inline-block; font-size: 13px; color: var(--ink-faint); text-decoration: underline; cursor: pointer; margin-top: 4px; }
  #welcome .wl-hatch:hover { color: var(--accent); }
  #welcome .wl-progress { height: 6px; background: var(--bg-warm); border-radius: 99px; overflow: hidden; margin: 0 0 18px; }
  #welcome .wl-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width .3s; }
  #welcome .wl-host { text-align: left; min-height: 300px; }
  /* inside the Quick Check, the card's own progress + bail link replace the
     runner's Quit affordance */
  #welcome .wl-host [data-action="quit-auto"] { display: none; }
  #welcome .wl-scores { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
  #welcome .wl-score-row {
    display: flex; align-items: center; gap: 12px; text-align: left;
    background: var(--bg-warm); border: 1px solid var(--rule); border-radius: 10px; padding: 11px 16px;
  }
  #welcome .wl-score-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14.5px; color: var(--ink); flex: 0 0 150px; }
  #welcome .wl-score-blurb { font-size: 12.5px; color: var(--ink-faint); flex: 1; }
  #welcome .wl-verdict { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 3px 12px; border-radius: 99px; }
  #welcome .wl-solid { color: #9DC487; background: rgba(157,196,135,.12); }
  #welcome .wl-slow { color: var(--accent); background: rgba(232,195,107,.12); }
  #welcome .wl-weak { color: #E07A4A; background: rgba(224,122,74,.14); }
  #welcome .wl-look { color: #E0A44A; background: rgba(224,164,74,.14); }
  #welcome .wl-untested { color: var(--ink-faint); background: rgba(255,255,255,.05); }
  #welcome .wl-diag { color: var(--ink-dim); font-size: 15px; line-height: 1.6; font-style: italic; margin: 0 0 20px; }
  #welcome .wl-foot { font-size: 12.5px; color: var(--ink-faint); line-height: 1.6; margin: 14px 0 0; }
  #welcome .wl-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
  #welcome .wl-dismiss {
    position: absolute; top: 18px; right: 22px; z-index: 2;
    background: transparent; border: 1px solid var(--rule); color: var(--ink-faint);
    font-size: 12.5px; padding: 6px 13px; border-radius: 99px; cursor: pointer;
  }
  #welcome .wl-dismiss:hover { color: var(--accent); border-color: var(--accent); }

  /* ---- Launch front door (2026-08-25): one action + See/Test/Practice ---- */
  /* Front-door card is 720px — but NOT once the Quick Check is running: the
     overlay keeps .wl-launch AND gains .running, and this rule (equal
     specificity, later in source) would otherwise override the wide running
     width. :not(.running) hands the running panel back to the 1320px rule. */
  #welcome.wl-launch:not(.running) .wl-card { max-width: 720px; }
  #welcome .wl-cta {
    display: inline-block; font-family: 'Sora', sans-serif; font-weight: 800;
    font-size: 18px; color: #160F0A; background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    border: none; border-radius: 12px; padding: 15px 34px; cursor: pointer;
    box-shadow: var(--elev-2), 0 0 40px -12px rgba(232,195,107,.5);
    transition: transform .14s, box-shadow .14s; margin-top: 4px;
  }
  #welcome .wl-cta:hover { transform: translateY(-1px); box-shadow: var(--elev-2), 0 0 56px -10px rgba(232,195,107,.65); }
  #welcome .wl-cta2 {
    display: inline-block; margin: 12px 0 0 12px; font-family: 'Sora', sans-serif; font-weight: 600;
    font-size: 14.5px; color: var(--ink-dim); background: none; border: 1px solid var(--rule);
    border-radius: 12px; padding: 14px 22px; cursor: pointer; transition: border-color .14s, color .14s;
  }
  #welcome .wl-cta2:hover { border-color: var(--accent); color: var(--ink); }
  @media (max-width: 520px) { #welcome .wl-cta2 { margin-left: 0; display: block; width: 100%; } }
  #welcome .wl-nosignup { font-size: 12.5px; color: var(--ink-faint); margin: 14px 0 26px; }
  #welcome .wl-loop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
  #welcome .wl-step {
    background: var(--grad-surface); border: 1px solid var(--rule); border-radius: 12px;
    padding: 15px 17px; cursor: pointer; box-shadow: var(--elev-1);
    transition: transform .14s, border-color .14s, box-shadow .14s;
  }
  #welcome .wl-step:hover { transform: translateY(-1px); border-color: var(--accent-deep); box-shadow: var(--elev-2); }
  #welcome .wl-step-k {
    display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
    letter-spacing: .16em; color: var(--accent); margin-bottom: 7px;
  }
  #welcome .wl-step b { display: block; font-family: 'Sora', sans-serif; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
  #welcome .wl-step span { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; }
  @media (max-width: 640px) { #welcome .wl-loop { grid-template-columns: 1fr; } }
  /* Practice Builder — the creation tool, a distinct card below the learning flow */
  #welcome .wl-build {
    display: block; width: 100%; text-align: left; margin-top: 16px;
    background: rgba(232, 195, 107, 0.06); border: 1px solid var(--accent-deep); border-radius: 12px;
    padding: 15px 18px; cursor: pointer; box-shadow: var(--elev-1);
    transition: transform .14s, border-color .14s, box-shadow .14s;
  }
  #welcome .wl-build:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: var(--elev-2); }
  #welcome .wl-build b { display: block; font-family: 'Sora', sans-serif; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
  #welcome .wl-build span { display: block; font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; }
  /* Mobile: trim the running Quick Check panel's padding so the fretboard gets
     as much width as possible (tap-the-fret questions are tight at 375px). */
  @media (max-width: 560px) {
    #welcome.running .wl-card { padding: 20px 10px; }
    #welcome.running .wl-kicker-sub { padding: 0 6px; }
    /* The scorecard on a phone: name and rating on one line, the blurb under them. */
    #welcome:not(.running) .wl-card { padding: 28px 20px; }
    /* Close sits in the space over the card, clear of the card's edge. */
    #welcome { padding-top: max(6vh, 48px); }
    #welcome .wl-dismiss { top: 7px; right: 20px; min-height: 34px; font-size: 14px; padding: 6px 15px; }
    #welcome .wl-score-row { flex-wrap: wrap; gap: 6px 12px; }
    #welcome .wl-score-name { flex: 1 1 auto; }
    #welcome .wl-verdict { order: 2; }
    #welcome .wl-score-blurb { order: 3; flex: 1 1 100%; }
  }
  /* Assess/quiz board scroll wrapper (js/07 buildMiniFretboardAllStrings). On
     phones a full-neck board would shrink to ~25px/fret; instead it holds a
     tappable per-fret width and scrolls sideways. Cropped boards fit and don't. */
  .mini-fb-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  @media (max-width: 560px) {
    .mini-fb-scroll > svg { min-width: var(--tap-min, 480px); }
  }
  /* js/07 focusMiniBoard adds .can-scroll when the board is wider than its card:
     a one-line hint that stays put (sticky) while the board slides under it. */
  .mini-fb-scroll.can-scroll::after {
    content: 'Swipe the board sideways to see every fret';
    display: block; position: sticky; left: 0;
    padding: 4px 2px 0; font-size: 11px; letter-spacing: 0.02em;
    color: var(--ink-faint, #9a8b7c); text-align: center;
  }

  /* ============ Plans — Free / Pro tiers (js/20-plans.js) ============ */
  #plans {
    position: fixed; inset: 0; z-index: 9600; overflow-y: auto;
    display: grid; place-items: start center;
    background: radial-gradient(ellipse 900px 500px at 50% 0%, rgba(232,195,107,.08), transparent 60%), rgba(15,10,7,.86);
    padding: 6vh 20px 40px;
  }
  #plans .pl-card {
    position: relative; max-width: 820px; width: 100%;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 18px;
    box-shadow: var(--elev-2), 0 0 70px -20px rgba(232,195,107,.22);
    padding: 34px 38px;
  }
  #plans .pl-x {
    position: absolute; top: 14px; right: 16px; width: 34px; height: 34px;
    background: none; border: 1px solid var(--rule); border-radius: 50%;
    color: var(--ink-dim); font-size: 20px; line-height: 1; cursor: pointer;
  }
  #plans .pl-x:hover { border-color: var(--accent); color: var(--ink); }
  #plans .pl-head { text-align: center; margin-bottom: 26px; }
  #plans .pl-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .22em; color: var(--accent-secondary); }
  #plans .pl-head h2 { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 800; margin: 8px 0 10px; color: var(--ink); }
  #plans .pl-head p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; max-width: 560px; margin: 0 auto; }
  #plans .pl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  #plans .pl-col { border: 1px solid var(--rule); border-radius: 14px; padding: 20px 20px 22px; background: var(--bg-warm); }
  #plans .pl-col-pro { opacity: .96; }
  #plans .pl-tier { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  #plans .pl-tier-name { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 800; color: var(--ink); }
  #plans .pl-badge { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .12em; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
  #plans .pl-badge-free { background: rgba(232,195,107,.16); color: var(--accent); border: 1px solid rgba(232,195,107,.35); }
  #plans .pl-badge-pro { background: rgba(143,127,114,.14); color: var(--ink-faint); border: 1px solid var(--rule); }
  #plans .pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
  #plans .pl-plus { margin: 0 0 10px; font-size: 13px; color: var(--ink-dim); }
  #plans .pl-item { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; position: relative; }
  #plans .pl-item b { color: var(--ink); font-size: 14.5px; font-weight: 700; }
  #plans .pl-item span { color: var(--ink-dim); font-size: 13px; line-height: 1.5; }
  #plans .pl-item.is-free::before { content: '✓'; position: absolute; left: 0; top: 1px; color: var(--accent); font-weight: 700; }
  #plans .pl-item.is-pro::before { content: '○'; position: absolute; left: 2px; top: 1px; color: var(--ink-faint); }
  #plans .pl-item.is-pro b { color: var(--ink-dim); }
  #plans .pl-quiet { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-muted, #8F857A); }
  #plans .pl-notify { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
  #plans .pl-notify:hover { border-bottom-color: var(--accent); }
  #plans .pl-badge-active {
    color: #7BBE6B;
    border-color: color-mix(in srgb, #7BBE6B 45%, transparent);
  }

  /* Licence activation (contract step 9). The panel renders only when a
     licensing endpoint is compiled in — see js/20-plans.js. */
  #plans .pl-licence:empty { display: none; }
  #plans .pl-licence { border-top: 1px solid var(--rule); margin-top: 22px; padding-top: 18px; }
  #plans .pl-lic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  #plans .pl-buy {
    background: var(--accent); color: var(--text-inverse); text-decoration: none;
    font-weight: 700; font-size: 15px; padding: 11px 22px; border-radius: var(--radius-pill);
  }
  #plans .pl-buy:hover { background: var(--accent-secondary); }
  #plans .pl-soon { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  #plans .pl-lic-toggle {
    background: none; border: 0; color: var(--text-secondary); font-size: 14px;
    text-decoration: underline; cursor: pointer; padding: 6px 0; font-family: inherit;
  }
  #plans .pl-lic-toggle:hover { color: var(--text-primary); }
  #plans .pl-lic-form { margin-top: 14px; }
  #plans .pl-lic-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
  #plans .pl-lic-input { display: flex; gap: 8px; flex-wrap: wrap; }
  #plans .pl-lic-input input {
    flex: 1 1 280px; min-width: 0; font-family: var(--font-mono); font-size: 14px;
    color: var(--text-primary); background: var(--bg-warm);
    border: 1px solid var(--border-subtle); border-radius: 10px; padding: 11px 14px;
  }
  #plans .pl-lic-input input:focus { outline: none; border-color: var(--accent-primary); }
  #plans .pl-lic-input input:disabled { opacity: 0.6; }
  #plans .pl-lic-go {
    background: var(--accent); color: var(--text-inverse); border: 0; cursor: pointer;
    font-weight: 700; font-size: 14px; padding: 11px 22px; border-radius: 10px; font-family: inherit;
  }
  #plans .pl-lic-go:disabled { opacity: 0.55; cursor: default; }
  #plans .pl-lic-msg { font-size: 14px; margin: 10px 0 0; min-height: 1.2em; color: var(--text-secondary); }
  #plans .pl-lic-msg.is-good { color: #7BBE6B; }
  #plans .pl-lic-msg.is-bad  { color: var(--danger); }
  #plans .pl-lic-msg.is-warn { color: var(--accent); }
  #plans .pl-lic-hint { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; max-width: 60ch; }
  #plans .pl-lic-hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
  #plans .pl-lic-active { display: flex; flex-direction: column; align-items: flex-start; }
  #plans .pl-lic-badge {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: #7BBE6B;
    border: 1px solid color-mix(in srgb, #7BBE6B 45%, transparent);
    border-radius: var(--radius-pill); padding: 3px 12px;
  }
  #plans .pl-lic-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 0 0; }
  #plans .pl-lic-facts dt { font-size: 12px; color: var(--text-muted); margin: 0; }
  #plans .pl-lic-facts dd { font-family: var(--font-mono); font-size: 13.5px; color: var(--text-primary); margin: 2px 0 0; }
  #plans .pl-lic-release {
    margin-top: 12px; background: transparent; cursor: pointer; font-family: inherit; font-size: 14px;
    color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
    border-radius: 10px; padding: 9px 18px;
  }
  #plans .pl-lic-release:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
  #plans .pl-lic-release:disabled { opacity: 0.55; cursor: default; }
  @media (max-width: 560px) {
    #plans .pl-lic-go, #plans .pl-buy { width: 100%; text-align: center; }
  }

  #plans .pl-foot { text-align: center; color: var(--ink-faint); font-size: 12px; margin: 22px 0 0; }
  footer .pl-open,
  footer .foot-link { color: var(--ink-faint); text-decoration: none; border-bottom: 1px solid transparent; }
  footer .pl-open:hover,
  footer .foot-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
  @media (max-width: 640px) { #plans .pl-cols { grid-template-columns: 1fr; } }

  /* ============ Beta chrome — invite gate + feedback pill ============ */
  html.beta-gated { overflow: hidden; }
  #betaGate {
    position: fixed; inset: 0; z-index: 10000;
    display: grid; place-items: center;
    background: radial-gradient(ellipse 900px 500px at 50% 0%, rgba(232,195,107,.07), transparent 60%), #160F0A;
    padding: 20px;
  }
  #betaGate .bg-card {
    max-width: 480px; width: 100%;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 16px;
    box-shadow: var(--elev-2), 0 0 60px -20px rgba(232,195,107,.25);
    padding: 34px 36px; text-align: center;
  }
  #betaGate .bg-kicker {
    font-family: 'IBM Plex Mono', monospace; font-size: 11px;
    letter-spacing: .2em; color: var(--accent); margin-bottom: 12px;
  }
  #betaGate h1 { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 800; margin: 0 0 12px; color: var(--ink); }
  #betaGate h1 span { color: var(--accent); }
  #betaGate p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
  #betaGate .bg-row { display: flex; gap: 8px; margin-bottom: 8px; }
  #betaGate input {
    flex: 1; background: var(--bg-warm); border: 1px solid var(--rule); border-radius: 8px;
    color: var(--ink); padding: 11px 14px; font-size: 15px; font-family: 'IBM Plex Mono', monospace;
  }
  #betaGate input:focus { outline: none; border-color: var(--accent); }
  #betaGate button {
    background: var(--accent); color: #3a2c08; border: 0; border-radius: 8px;
    padding: 11px 22px; font-weight: 700; font-size: 14px; cursor: pointer;
  }
  #betaGate .bg-err { color: #d68a6c; font-size: 13px; margin-bottom: 8px; }
  #betaGate .bg-foot { font-size: 13px; color: var(--ink-faint); margin: 10px 0 0; }
  #betaGate .bg-foot a { color: var(--accent); }
  #betaPill {
    background: rgba(26,22,20,.92);
    border: 1px solid var(--rule); border-radius: 999px;
    color: var(--ink-dim); font-size: 11px; font-family: 'IBM Plex Mono', monospace;
    padding: 5px 12px; text-decoration: none; white-space: nowrap;
    align-self: center;
    transition: border-color .15s, color .15s;
  }
  #betaPill b { color: var(--accent); font-weight: 700; letter-spacing: .08em; }
  #betaPill:hover { border-color: var(--accent); color: var(--ink); }
  /* fallback when no header exists */
  #betaPill.bp-floating { position: fixed; left: 16px; bottom: 16px; z-index: 9000; backdrop-filter: blur(6px); }

  /* ============ Today view ============ */
  .today-wrap { max-width: 900px; margin: 0 auto; }
  /* ---- Today's Plan cards ---- */
  .plan-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--grad-surface);
    border: 1px solid var(--rule); border-left: 3px solid var(--accent);
    border-radius: 11px; padding: 15px 18px; margin-bottom: 12px;
    box-shadow: var(--elev-1);
    transition: border-color .15s, opacity .2s;
  }
  .plan-card.done { border-left-color: #6bb583; opacity: .68; }
  .plan-n {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 14px;
    color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--rule));
  }
  .plan-card.done .plan-n { background: #6bb583; border-color: #6bb583; color: #13210f; }
  .plan-main { flex: 1; min-width: 0; }
  .plan-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; }
  .plan-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15.5px; color: var(--ink); }
  .plan-time { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-faint); letter-spacing: .06em; }
  .plan-body { font-size: 13.5px; color: var(--ink-dim); line-height: 1.5; }
  .plan-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; align-items: stretch; }
  .plan-actions .btn { font-size: 12px; padding: 8px 14px; white-space: nowrap; }
  .plan-check { opacity: .7; }
  @media (max-width: 760px) {
    .plan-card { flex-wrap: wrap; }
    .plan-actions { flex-direction: row; width: 100%; }
  }

  .progress-portability {
    margin-top: 28px;
    padding: 14px 18px;
    border: 1px dashed var(--rule);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .progress-portability .pp-note {
    color: var(--ink-dim);
    font-size: 13px;
    flex: 1;
    min-width: 240px;
  }
  .progress-portability .pp-actions {
    display: flex;
    gap: 8px;
    /* Three buttons total ~460px. With flex-shrink:0 this row kept its
       max-content width inside a 351px parent on a 390px phone, bursting it and
       scrolling the whole document sideways — and flex-wrap alone could not
       help, because the width was never constrained enough to wrap into.
       Allowing it to shrink is what lets the wrap take effect. Desktop is
       unaffected: there is room, so nothing shrinks. (Gate-6, 2026-09-01) */
    flex-wrap: wrap;
    flex-shrink: 1;
    max-width: 100%;
  }
  .progress-portability .pp-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
  .progress-portability .pp-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
  .today-header {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  .today-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }
  .today-nav-center { flex: 1; min-width: 0; }
  .day-nav-btn {
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    color: var(--ink-dim);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 18px;
    font-family: 'IBM Plex Mono', monospace;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .day-nav-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
  }
  .day-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
  .today-day {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    font-style: italic;
    color: var(--ink);
    line-height: 1.15;
  }
  .today-day .accent { color: var(--accent); font-weight: 600; font-style: normal; }
  .today-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
  }
  .streak-display {
    text-align: right;
    font-family: 'IBM Plex Mono', monospace;
  }
  .streak-num {
    font-size: 32px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
  }
  .streak-label {
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 4px;
  }

  .block-card {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: all 0.18s;
  }
  .block-card.done {
    border-left-color: #6bb583;
    opacity: 0.7;
  }
  .block-card.readonly {
    border-left-color: var(--ink-faint);
    opacity: 0.85;
  }
  .btn-ghost-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 8px 14px;
    border: 1px dashed var(--rule);
    border-radius: 4px;
    font-style: italic;
  }
  .block-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }
  .block-letter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
  }
  .block-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
    font-weight: 500;
    color: var(--ink);
  }
  .block-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
  }
  .block-body {
    color: var(--ink-dim);
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 14px;
  }
  .block-body p { margin-bottom: 8px; }
  .block-body p:last-child { margin-bottom: 0; }
  .block-body strong { color: var(--ink); font-weight: 600; }
  .block-body em { color: var(--accent); font-style: italic; }
  .block-body code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    background: var(--bg-warm);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--ink);
  }
  .block-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .btn {
    background: var(--panel-light);
    border: 1px solid var(--rule);
    color: var(--ink);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn:hover { border-color: var(--accent); color: var(--accent); }
  .btn.primary {
    background: var(--accent);
    color: #1a1614;
    border-color: var(--accent);
    font-weight: 600;
  }
  .btn.primary:hover { background: #f0d178; }
  .btn.done {
    background: transparent;
    border-color: #6bb583;
    color: #6bb583;
  }
  .btn.ghost {
    background: transparent;
    color: var(--ink-faint);
  }
  .btn.big {
    padding: 14px 28px;
    font-size: 13px;
  }

  /* ============ Guided exercise view ============ */
  .exercise-wrap {
    max-width: 1100px;
    margin: 0 auto;
  }
  .exercise-frame {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 28px 32px 32px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
  }
  @media (max-width: 600px) {
    .exercise-frame { padding: 20px 16px 24px; min-height: 520px; }
  }
  .exercise-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
  }
  .exercise-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-style: italic;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.1;
  }
  .exercise-phase {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 5px;
  }
  .exercise-progress {
    display: flex;
    gap: 3px;
    margin-bottom: 28px;
    flex-wrap: wrap;
  }
  .ex-dot {
    flex: 1;
    min-width: 8px;
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    transition: background 0.2s;
  }
  .ex-dot.done { background: #6bb583; }
  .ex-dot.current { background: var(--accent); }

  .exercise-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 16px 0 24px;
  }
  .exercise-prompt-row {
    text-align: center;
  }
  .exercise-prompt-note {
    font-family: var(--font-display);
    font-size: clamp(80px, 12vw, 140px);
    font-weight: 600;
    line-height: 1;
    color: var(--accent);
    letter-spacing: -0.02em;
  }
  .exercise-prompt-loc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 8px;
  }
  .exercise-fretboard {
    width: 100%;
    max-width: 900px;
    background: rgba(0,0,0,0.18);
    padding: 6px;
    border-radius: 8px;
  }

  .exercise-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
  }
  .metronome-controls {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .met-btn {
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    color: var(--ink);
    width: 38px;
    height: 38px;
    border-radius: 6px;
    font-size: 22px;
    font-family: 'IBM Plex Mono', monospace;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .met-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  .met-display {
    text-align: center;
    min-width: 70px;
  }
  .met-bpm {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
  }
  .met-bpm-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 3px;
  }
  .exercise-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .exercise-beat-indicator {
    height: 6px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .beat-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--rule);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .beat-pulse.flash {
    animation: beatFlash 0.18s ease-out;
  }
  .beat-pulse.downbeat.flash {
    animation: beatFlashDown 0.22s ease-out;
  }
  @keyframes beatFlash {
    0% { opacity: 0.9; transform: scale(1.4); background: var(--accent); }
    100% { opacity: 0.15; transform: scale(1); background: var(--rule); }
  }
  @keyframes beatFlashDown {
    0% { opacity: 1; transform: scale(1.8); background: #fff; }
    100% { opacity: 0.2; transform: scale(1); background: var(--rule); }
  }

  /* Exercise result screen */
  .exercise-result {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
  }
  .exercise-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #6bb583;
    color: #1a1614;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 18px;
  }
  .exercise-result-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
  }
  .exercise-result-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 30px;
  }
  .exercise-rate-prompt {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    color: var(--ink-dim);
    margin-bottom: 14px;
  }
  .exercise-rate-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .rate-btn {
    background: var(--bg-warm);
    border: 1.5px solid var(--rule);
    color: var(--ink);
    padding: 12px 22px;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.12s;
  }
  .rate-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .assess-atom-screen-cat {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .assess-cat-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
  }
  .assess-cat-banner-letter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 700;
  }
  .assess-cat-banner-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-style: italic;
    font-weight: 500;
    color: var(--ink);
    flex: 1;
  }
  .assess-cat-banner-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
  }
  .assess-key-tag {
    float: right;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: none;
    background: var(--bg);
    color: var(--accent);
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--rule);
  }
  .grid-sub, .grid-sub-head {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--ink);
    text-align: left !important;
    padding-right: 16px !important;
    white-space: nowrap;
  }
  .grid-sub-head {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
  }
  .assess-notes {
    margin-top: 22px;
  }
  .assess-notes-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 8px;
  }
  .assess-notes-input {
    width: 100%;
    min-height: 70px;
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
  }
  .assess-notes-input:focus {
    outline: none;
    border-color: var(--accent);
  }
  .assess-incomplete-note {
    background: var(--bg-warm);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--ink-dim);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  /* ============ Assess view ============ */
  .assess-wrap { width: 100%; margin: 0 auto; }

  /* Landing */
  .assess-landing {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 32px;
  }
  .assess-landing-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 10px;
  }
  .assess-landing-sub {
    color: var(--ink-dim);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 680px;
  }
  .assess-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
  }
  .assess-cat-chip {
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 12px 14px;
  }
  .assess-cat-chip-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
  }
  .assess-cat-chip-count {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 3px;
  }
  .assess-landing-note {
    background: var(--bg-warm);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 22px;
    color: var(--ink-dim);
    font-size: 14px;
    line-height: 1.55;
  }
  .assess-landing-note p { margin-bottom: 8px; }
  .assess-landing-note p:last-child { margin-bottom: 0; }
  .assess-landing-note strong { color: var(--ink); }
  .assess-landing-actions { display: flex; gap: 12px; flex-wrap: wrap; }
  .assess-history-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    margin-top: 16px;
  }

  /* Overview */
  .assess-overview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .assess-overview-title {
    font-family: var(--font-editorial);
    font-size: 30px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.05;
    color: var(--ink);
  }
  .assess-overview-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 9px;
  }
  .assess-overview-progress { min-width: 210px; }
  .assess-prog-num {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-dim);
    text-align: right;
    letter-spacing: 0.04em;
  }
  .assess-prog-num b {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 27px;
    color: var(--accent);
    vertical-align: -3px;
    margin-right: 2px;
  }
  .assess-prog-bar {
    height: 7px;
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 9px;
  }
  .assess-prog-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
  }
  .assess-overview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
  }
  .assess-cat-block { margin-bottom: 24px; }
  .assess-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 11px;
    padding-left: 2px;
  }
  .assess-cat-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
  }
  .assess-cat-title {
    font-family: var(--font-editorial);
    font-size: 19px;
    font-style: normal;
    font-weight: 600;
    color: var(--ink);
    flex: 1 1 auto;
    white-space: nowrap;
  }
  .assess-cat-count {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .assess-atom-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .assess-atom-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 14px 17px;
    cursor: pointer;
    transition: all 0.14s;
    box-shadow: 0 8px 22px -16px rgba(0,0,0,0.6);
  }
  .assess-atom-row:hover { border-color: var(--border-strong); transform: translateY(-1px); }
  .assess-atom-row.complete { opacity: 0.66; }
  .assess-atom-status {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--ink-faint);
    flex-shrink: 0;
  }
  .assess-atom-row.complete .assess-atom-status {
    background: #5FAE7E;
    border-color: #5FAE7E;
    color: #fff;
  }
  .assess-atom-info { flex: 1; min-width: 0; }
  .assess-atom-label {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
  }
  .assess-atom-tests {
    font-size: 13.5px;
    color: var(--ink-faint);
    line-height: 1.45;
    margin-top: 2px;
  }
  .assess-atom-band { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
  .assess-band-pip {
    width: 8px;
    height: 20px;
    border-radius: 2px;
    background: var(--bg-warm);
    border: 1px solid var(--rule);
  }
  .assess-band-pip.fill { background: #5FAE7E; border-color: #5FAE7E; }
  .assess-atom-type {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    background: var(--bg-warm);
    color: var(--ink-dim);
    border: 1px solid var(--rule);
  }
  .assess-atom-type.self { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
  .assess-atom-go {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--ink-faint);
    flex-shrink: 0;
  }
  .assess-atom-row:hover .assess-atom-go { color: var(--accent); }

  /* Atom scoring screen */
  .assess-atom-screen {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 28px 32px;
  }
  .assess-atom-screen-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  .assess-atom-screen-pos {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
  }
  .assess-atom-screen-cat {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .assess-atom-screen-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 8px;
  }
  .assess-atom-screen-tests {
    color: var(--ink-dim);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
  }
  .assess-criterion {
    background: var(--bg-warm);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 20px;
  }
  .assess-criterion-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 7px;
  }
  .assess-criterion-body {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
    font-style: italic;
    font-family: var(--font-display);
  }
  .assess-score-anchors-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--ink-faint);
  }
  .assess-score-anchors-legend strong { color: var(--accent); margin-right: 4px; }
  .assess-score-grid {
    width: 100%;
    border-collapse: collapse;
  }
  .assess-score-grid th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    font-weight: 500;
    text-align: center;
    padding: 8px;
  }
  .assess-score-grid th .th-bpm {
    display: block;
    font-size: 9px;
    color: var(--ink-faint);
    opacity: 0.7;
    margin-top: 2px;
  }
  .assess-score-grid td {
    padding: 6px 8px;
    text-align: center;
  }
  .assess-score-grid .grid-key {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    text-align: left;
  }
  .assess-score-row {
    display: inline-flex;
    gap: 5px;
  }
  .score-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 1.5px solid var(--rule);
    background: var(--bg-warm);
    color: var(--ink-dim);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
  }
  .score-btn:hover { border-color: var(--accent); color: var(--ink); }
  .score-btn.selected {
    background: var(--accent);
    color: #1a1614;
    border-color: var(--accent);
  }
  .assess-atom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    gap: 12px;
  }

  /* Auto placeholder */
  /* ============ Auto-runner UI ============ */

  /* Walk-pattern step prompt */
  .walk-step-prompt {
    font-family: var(--font-display);
    font-size: clamp(18px, 3vw, 24px);
    font-style: italic;
    color: var(--ink);
    line-height: 1.4;
    text-align: center;
    margin-bottom: 8px;
  }
  .walk-sub-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    margin-bottom: 12px;
  }

  /* Chord clock UI */
  .clock-display {
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-warm);
    border-radius: 8px;
    margin-bottom: 18px;
  }
  .clock-key-info {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 6px;
  }
  .clock-key-info strong { color: var(--accent); }
  .clock-chord-name {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 72px);
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 12px;
  }
  .clock-target-info {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 15px;
    color: var(--ink-dim);
    margin-bottom: 14px;
  }
  .clock-progress-bar {
    height: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto 12px;
  }
  .clock-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 100ms linear;
  }
  .clock-stats {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.06em;
  }
  .clock-warmup { color: var(--accent-secondary, #C99B45); font-weight: 600; }
  .clock-region-hint {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
  }

  .auto-ready-card {
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 18px 22px;
  }
  .auto-ready-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  .auto-ready-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-style: italic;
    font-weight: 500;
    color: var(--ink);
  }
  .auto-ready-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    margin-top: 4px;
  }
  .auto-ready-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .auto-runner {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 28px 32px 32px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
  }
  @media (max-width: 600px) {
    .auto-runner { padding: 20px 16px 24px; }
  }
  .auto-runner-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 18px;
  }
  .auto-question {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 20px 0;
  }
  .auto-prompt-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
  }
  .auto-prompt-line strong {
    color: var(--accent);
    font-weight: 600;
  }
  .auto-prompt-text {
    text-align: center;
    padding: 16px 0;
  }
  .auto-prompt-text-pos {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 600;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: 10px;
  }
  .auto-prompt-text-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .auto-find-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .auto-find-target {
    background: var(--accent);
    color: #1a1614;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 6px;
    line-height: 1;
  }
  .auto-find-string {
    font-family: var(--font-display);
    font-size: clamp(16px, 2.5vw, 22px);
    font-style: italic;
    color: var(--ink-dim);
  }
  .auto-find-string strong { color: var(--ink); font-weight: 500; font-style: normal; }
  .auto-tries-left {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    background: rgba(214, 138, 108, 0.95);
    color: #2a1410;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    letter-spacing: 0.06em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.45);
    pointer-events: none;
  }
  .atom-board { position: relative; }
  .c-keyline {
    font-family: var(--font-display, 'Sora'), sans-serif;
    font-weight: 700;
    font-size: 21px;
    color: var(--accent);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
  }
  .c-direction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 2px;
    color: #ffffff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .c-direction .dir-arrow {
    font-size: 26px;
    line-height: 1;
    color: #4FA0EC;
  }
  /* phraseShift step indicator (C11 5.7.4/5.7.5): target → travel → target */
  .c-phrase-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .c-phrase-steps .c-step {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle, #433730);
    color: var(--ink-faint, #8F7F72);
    background: transparent;
  }
  .c-phrase-steps .c-step.cur {
    color: #1a1614;
    background: var(--accent, #E8C36B);
    border-color: var(--accent, #E8C36B);
  }
  .c-phrase-steps .c-step.done {
    color: var(--ink-dim, #C9BDAF);
    border-color: #6bb583;
  }
  .c-phrase-steps .c-step-arrow { color: var(--ink-faint, #8F7F72); }
  .auto-prompt-step {
    text-align: center;
    color: var(--ink-dim, #C9BDAF);
    font-size: 14px;
    margin: 2px 0 6px;
  }
  .auto-prompt-step strong { color: var(--accent, #E8C36B); font-weight: 600; }
  .auto-fretboard {
    width: 100%;
    background: rgba(0,0,0,0.18);
    padding: 6px;
    border-radius: 8px;
  }
  .auto-fretboard svg .fb-cell-multi {
    transition: fill 0.1s;
  }
  .auto-fretboard svg .fb-cell-multi:hover {
    fill: rgba(232, 196, 104, 0.12);
  }
  .auto-fretboard svg .afb-cell {
    transition: fill 0.1s;
  }
  .auto-fretboard svg .afb-cell:hover {
    fill: rgba(232, 196, 104, 0.14);
  }
  .auto-helper-hint {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .auto-actions-row {
    display: flex;
    gap: 10px;
  }
  .auto-answers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 640px;
  }
  .auto-answers.four-cols { grid-template-columns: repeat(4, 1fr); }
  @media (max-width: 480px) {
    .auto-answers { grid-template-columns: repeat(2, 1fr); }
  }
  .auto-answer-btn {
    background: var(--bg-warm);
    border: 1.5px solid var(--rule);
    color: var(--ink);
    padding: 18px 8px;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
  }
  .auto-answer-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .auto-answer-btn:active:not(:disabled) { transform: scale(0.97); }
  .auto-answer-btn.correct {
    background: #6bb583; color: #1a1614; border-color: #6bb583;
  }
  .auto-answer-btn.wrong {
    background: #d68a6c; color: #1a1614; border-color: #d68a6c;
  }
  .auto-answer-btn.fade { opacity: 0.3; }
  .auto-answer-btn:disabled { cursor: not-allowed; }

  /* readable instruction line for the spell-chord checks (B1/B2) — the generic
     12px uppercase sub-caption was too small to read as an instruction */
  .auto-spell-instruction {
    font-family: var(--font-ui);
    font-size: 15.5px;
    color: var(--ink-dim);
    line-height: 1.45;
    margin-top: 4px;
  }
  .auto-spell-instruction b { color: var(--ink); }
  .auto-note-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 660px;
  }
  @media (max-width: 480px) {
    .auto-note-grid { grid-template-columns: repeat(4, 1fr); }
  }
  .auto-note-btn {
    background: var(--bg-warm);
    border: 1.5px solid var(--rule);
    color: var(--ink);
    padding: 18px 6px;
    border-radius: 9px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
  }
  .auto-note-btn:hover:not(:disabled) { border-color: var(--accent); }
  .auto-note-btn.picked {
    background: var(--accent);
    color: #1a1614;
    border-color: var(--accent);
  }
  .auto-note-btn.correct {
    background: #6bb583; color: #1a1614; border-color: #6bb583;
  }
  .auto-note-btn.wrong {
    background: #d68a6c; color: #1a1614; border-color: #d68a6c;
  }
  .auto-note-btn.missed {
    border-color: #6bb583; background: rgba(107, 181, 131, 0.22); color: #6bb583;
  }
  .auto-note-btn.fade { opacity: 0.3; }
  .auto-note-btn:disabled { cursor: not-allowed; }

  /* === Unified atom screen layout (Assess) ===
     Used by atom-entry placeholder, question screen, and result screen.
     Top card holds prompts/instructions/results, fretboard area is below. */
  .atom-card {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 22px 28px;
    margin-bottom: 16px;
  }
  .atom-card-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 6px;
  }
  .atom-card-detail {
    font-family: var(--font-ui);
    color: var(--ink-dim);
    line-height: 1.55;
    font-size: 15px;
  }
  .atom-card-detail p { margin: 0 0 8px; }
  .atom-reminder { margin-top: 10px; }
  .atom-reminder > summary {
    cursor: pointer; font-family: 'Mulish', sans-serif; font-size: 13px; font-weight: 600;
    color: var(--accent-secondary, #C99B45); list-style: none; user-select: none;
  }
  .atom-reminder > summary::before { content: '▸ '; }
  .atom-reminder[open] > summary::before { content: '▾ '; }
  .atom-reminder-body {
    margin-top: 8px; padding: 10px 12px; border-left: 2px solid var(--border-subtle, #433730);
    font-family: var(--font-ui); color: var(--ink-dim); font-size: 14px; line-height: 1.55;
  }
  .atom-card-detail strong { color: var(--ink); font-weight: 600; }
  .atom-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
  }
  .atom-meta-pill {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-dim);
    background: var(--bg-warm);
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.04em;
  }
  .atom-meta-pill.done { background: rgba(107, 181, 131, 0.18); color: #6bb583; }
  .atom-band-targets {
    margin-top: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    padding: 8px 12px;
    background: var(--bg-warm);
    border-radius: 6px;
    letter-spacing: 0.04em;
  }
  .atom-band-targets strong { color: var(--accent); font-weight: 600; }
  .atom-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
  }
  .atom-card-section + .atom-card-section { margin-top: 18px; }

  /* Bigger "Start" button */
  .btn.btn-large {
    font-size: 17px;
    padding: 14px 28px;
    font-weight: 600;
  }
  .atom-result-badge {
    font-size: 10px;
    background: rgba(255,255,255,0.16);
    padding: 2px 7px;
    border-radius: 8px;
    margin-left: 6px;
    letter-spacing: 0.06em;
  }

  /* Atom options row (e.g. accidental style toggle) */
  .atom-options-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 0 0;
    padding: 12px 14px;
    background: var(--bg-warm);
    border-radius: 6px;
    flex-wrap: wrap;
  }
  .atom-option-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .atom-option-toggle {
    display: inline-flex;
    gap: 4px;
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
    padding: 3px;
  }
  .atom-option-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-dim);
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .atom-option-btn:hover { color: var(--ink); }
  .atom-option-btn.selected {
    background: var(--accent);
    color: #1a1614;
    font-weight: 600;
  }

  /* Countdown overlay */
  .countdown-overlay {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 80px 40px;
    text-align: center;
    margin-top: 80px;
  }
  .countdown-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 16px;
  }
  .countdown-number {
    font-family: var(--font-display);
    font-size: 180px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 16px;
    animation: countPulse 0.8s ease-out;
  }
  .countdown-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-dim);
    letter-spacing: 0.06em;
  }
  @keyframes countPulse {
    0% { transform: scale(0.5); opacity: 0; }
    40% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }

  /* Fretboard area below the card */
  .atom-board {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 18px;
    overflow-x: auto;
  }
  .atom-board.atom-board-preview {
    opacity: 0.55;
    filter: saturate(0.7);
  }

  /* Question-state card: big prompt, tight spacing to fretboard below */
  .atom-question-card {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px 8px 0 0;
    padding: 18px 28px 12px;
    margin-bottom: 0;
    border-bottom: none;
    text-align: center;
  }
  .atom-question-card + .atom-board {
    border-radius: 0 0 8px 8px;
    border-top: none;
    margin-top: 0;
    padding-top: 4px;
  }
  .atom-question-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  /* Compact the prompt — note chip + label on a single visual line just above fretboard */
  .atom-question-card .auto-find-centered {
    margin-top: 2px;
  }
  .atom-question-card .auto-find-note-chip {
    margin-bottom: 4px;
    padding: 8px 24px;
    font-size: clamp(36px, 5.5vw, 52px);
  }
  .atom-question-card .auto-find-target-line {
    font-size: clamp(14px, 1.6vw, 16px);
  }

  /* A4 centered prompt (no instruction text — just the note in a chip) */
  .auto-find-centered {
    text-align: center;
  }
  .auto-find-note-chip {
    display: inline-block;
    background: var(--accent);
    color: #1a1614;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(44px, 7vw, 64px);
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 10px;
    line-height: 1;
    margin-bottom: 10px;
  }
  .auto-find-target-line {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(15px, 2vw, 19px);
    color: var(--ink-dim);
  }

  /* Bright prompt variant for B6 — fix dim text contrast */
  .auto-prompt-line.auto-prompt-bright {
    font-size: 14px;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-display);
    font-style: italic;
    line-height: 1.4;
  }
  .auto-prompt-line.auto-prompt-bright strong {
    color: var(--accent);
    font-style: normal;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
  }

  /* Per-question breakdown in result screen (A5) */
  .auto-result-breakdown {
    background: var(--bg-warm);
    border-radius: 6px;
    padding: 14px 18px;
    margin: 0 auto 20px;
    max-width: 360px;
    text-align: left;
  }
  .auto-result-breakdown-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 8px;
  }
  .auto-result-breakdown ul {
    list-style: none;
    padding: 0; margin: 0;
  }
  .auto-result-breakdown li {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-dim);
    padding: 3px 0;
  }
  .auto-result-breakdown li strong { color: var(--ink); }
  .auto-result-breakdown .res-part-row { display: flex; justify-content: space-between; padding: 4px 2px; font-size: 13px; color: var(--ink-dim); }
  .auto-result-breakdown .res-part-row strong { color: var(--ink); }
  .auto-hint-dim { color: var(--ink-faint); font-size: 0.92em; }

  /* Timing block on result screen */
  .auto-result-timings {
    margin: 16px auto 20px;
    max-width: 360px;
    background: var(--bg-warm);
    border-radius: 6px;
    padding: 14px 18px;
  }
  .auto-result-time-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
  }
  .auto-result-time-row + .auto-result-time-row {
    border-top: 1px dashed var(--rule);
    margin-top: 4px;
    padding-top: 9px;
  }
  .auto-result-time-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .auto-result-time-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    color: var(--ink);
    font-weight: 600;
  }

  /* History table */
  .auto-result-history {
    margin: 0 auto 20px;
    max-width: 460px;
    text-align: left;
  }
  .auto-result-history-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 8px;
    text-align: center;
  }
  .auto-result-history-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
  }
  .auto-result-history-table thead th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    font-weight: 500;
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--rule);
  }
  .auto-result-history-table tbody td {
    padding: 6px 8px;
    color: var(--ink-dim);
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .auto-result-history-table tbody tr:last-child td {
    border-bottom: none;
  }

  .btn.shake { animation: shake 0.4s; }
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
  }

  .auto-next-row {
    text-align: center;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
  }
  .auto-next-row .btn { margin-top: 10px; padding: 12px 24px; }

  .auto-result {
    flex: 1;
    text-align: center;
    padding: 30px 0;
  }
  .auto-result-band {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 8px;
    margin-bottom: 18px;
  }
  .auto-result-band.band-3 { background: #6bb583; color: #1a1614; }
  .auto-result-band.band-2 { background: #c9c24a; color: #1a1614; }
  .auto-result-band.band-1 { background: #e0a23c; color: #1a1614; }
  .auto-result-band.band-0 { background: #d65c4e; color: #fff; }
  .auto-result-score {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 6px;
  }
  .auto-result-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 24px;
  }
  .auto-result-next {
    background: var(--bg-warm);
    border-left: 3px solid var(--accent);
    padding: 16px 18px;
    border-radius: 4px;
    margin: 0 auto 22px;
    max-width: 480px;
    color: var(--ink-dim);
    font-size: 14px;
    line-height: 1.5;
  }
  .auto-result-next p { margin-bottom: 10px; }
  .auto-result-next strong { color: var(--ink); }
  .auto-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
  /* The way out of a result sits on its own line under a rule, apart from the buttons that run
     another check. The same button is at the top of the result. */
  .auto-result-leave {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
  }

  .assess-auto-placeholder {
    background: var(--bg-warm);
    border: 1px dashed var(--rule);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
  }
  .assess-auto-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.6; }
  .assess-auto-text { color: var(--ink-dim); font-size: 15px; line-height: 1.55; margin-bottom: 10px; }
  .assess-auto-text strong { color: var(--ink); }
  .assess-auto-note { color: var(--ink-faint); font-size: 13px; line-height: 1.5; margin-bottom: 20px; }
  .assess-self-estimate { border-top: 1px solid var(--rule); padding-top: 18px; }
  .assess-score-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 10px;
  }
  .assess-self-estimate .assess-score-row { justify-content: center; }
  .assess-score-anchors {
    font-size: 11px;
    color: var(--ink-faint);
    margin-top: 10px;
  }

  /* Fluency map */
  .map-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .map-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-style: italic;
    font-weight: 500;
  }
  .map-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
  }
  .map-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--ink-dim);
  }
  .map-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
  }
  .map-grids {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
  }
  .map-cat {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 16px 18px;
  }
  .map-cat-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-left: 10px;
    margin-bottom: 14px;
  }
  .map-cat-letter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-faint);
  }
  .map-cat-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-style: italic;
    font-weight: 500;
  }
  .map-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .map-dot-wrap { text-align: center; }
  .map-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1a1614;
  }
  .map-dot.untested { color: var(--ink-faint); }
  /* Not yet covered by the course — a dashed ring, no fill, distinct from "not
     demonstrated" (a solid grey dot). */
  .map-dot.notcovered {
    background: transparent !important;
    border: 1.5px dashed var(--border-strong, #5A4A41);
    color: var(--ink-faint);
  }
  .map-dot.notcovered::before { content: '·'; }
  .map-dot.dimmed { opacity: 0.4; }
  .map-legend-dot.notcovered {
    background: transparent;
    border: 1.5px dashed var(--border-strong, #5A4A41);
  }
  /* Taught, but the formal check isn't wired yet — a dotted ring in the accent hue,
     distinct from the dashed "not yet covered". */
  .map-dot.coming {
    background: transparent !important;
    border: 1.5px dotted var(--accent-secondary, #C99B45);
    color: var(--accent-secondary, #C99B45);
  }
  .map-dot.coming::before { content: '⋯'; }
  .map-legend-dot.coming {
    background: transparent;
    border: 1.5px dotted var(--accent-secondary, #C99B45);
  }
  .map-dot-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: var(--ink-faint);
    margin-top: 4px;
  }
  /* In progress: some parts of a multi-part skill done — a ring with the right
     half filled in the band reached so far (matches the list's half-disc icon),
     never a full lamp, because it isn't a score yet. */
  .map-dot.partial, .map-legend-dot.partial {
    background: linear-gradient(90deg, transparent 50%, var(--pc, var(--ink-faint)) 50%) !important;
    border: 2px solid var(--pc, var(--ink-faint));
    box-sizing: border-box;
  }
  /* "1 of 2 parts" hangs under the id without widening the dot's column. */
  .map-dot-wrap.is-partial { position: relative; }
  .map-dot-part {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9.5px;
    line-height: 1.2;
    color: var(--ink-faint);
    white-space: nowrap;
    pointer-events: none;
  }
  /* Placement ↔ Course-mastery segmented toggle */
  .map-viewtoggle {
    display: inline-flex; gap: 2px; margin: 4px 0 16px;
    background: var(--surface-1, #2A231F); border: 1px solid var(--border-subtle, #433730);
    border-radius: var(--radius-pill, 999px); padding: 3px;
  }
  .map-viewbtn {
    font-family: 'Mulish', sans-serif; font-size: 13px; font-weight: 600;
    padding: 6px 16px; border-radius: var(--radius-pill, 999px);
    border: none; background: transparent; color: var(--ink-dim, #C9BDAF); cursor: pointer;
  }
  .map-viewbtn.active { background: var(--accent, #E8C36B); color: var(--text-inverse, #1A1614); }
  .map-diagnostics {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 24px;
  }
  .map-diag-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 16px;
  }
  .map-diag-item {
    color: var(--ink-dim);
    font-size: 15px;
    line-height: 1.6;
    padding: 12px 16px;
    background: var(--bg-warm);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    margin-bottom: 10px;
  }

  /* ============ Drill view ============ */
  .drill-wrap { max-width: 1320px; margin: 0 auto; }   /* match the guided practice's use of the window */
  /* Drill menu can stay narrower since it's just a list */
  .drill-wrap .drill-menu { max-width: 720px; margin: 0 auto; }
  .drill-menu {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 24px;
  }
  .drill-menu-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 6px;
  }
  .drill-menu-sub {
    color: var(--ink-faint);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
  }
  .drill-list { display: grid; gap: 12px; }
  .drill-cat .drill-list { margin-top: 14px; }
  .drill-item {
    background: var(--grad-surface);
    border: 1px solid var(--rule);
    border-radius: 11px;
    padding: 16px 18px;
    box-shadow: var(--elev-1);
    cursor: pointer;
    transition: transform .14s, box-shadow .14s, border-color .14s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
  }
  .drill-item:hover {
    border-color: var(--accent-deep);
    transform: translateY(-1px);
    box-shadow: var(--elev-2);
  }
  .drill-item-info { flex: 1; }
  .drill-item-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 2px;
  }
  .drill-item-desc {
    color: var(--ink-faint);
    font-size: 13px;
    line-height: 1.4;
  }
  .drill-item-stats {
    text-align: right;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    min-width: 80px;
  }
  .drill-item-stats .big {
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
  }

  .drill-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .opt-pill {
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    color: var(--ink-dim);
    padding: 6px 14px;
    border-radius: 999px;
    /* app body font — the mono pills read as a different product (Robert) */
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .opt-pill:hover { color: var(--ink); border-color: var(--ink-faint); }
  .opt-pill.active {
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-warm));
    border-color: var(--accent);
    color: var(--accent);
  }

  /* Drill runner — the actual question/answer screen */
  .drill-runner {
    background: var(--grad-surface);
    border: 1px solid var(--rule);
    border-radius: 14px;
    box-shadow: var(--elev-2);
    padding: 28px 32px 32px;
    min-height: 520px;
    display: flex;
    flex-direction: column;
  }

  /* Custom-drill setup page (shares the Practice Room hero) */
  .drill-setup { max-width: 760px; }
  .drill-setup-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  }
  .drill-setup-card {
    margin-top: 22px;
    background: var(--grad-surface);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: var(--elev-1);
    padding: 22px 24px;
  }
  .drill-opt-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px; color: var(--ink-faint);
    letter-spacing: 0.15em; text-transform: uppercase;
    margin: 18px 0 10px;
  }
  .drill-opt-label:first-child { margin-top: 0; }
  .drill-opt-help {
    font-size: 13px; color: var(--ink-faint); font-style: italic;
    margin: -4px 0 6px; line-height: 1.4;
  }
  .drill-setup-actions {
    display: flex; justify-content: flex-end;
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid var(--rule);
  }
  @media (max-width: 600px) {
    .drill-runner { padding: 20px 16px 24px; min-height: 440px; }
  }
  .drill-runner-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 24px;
  }
  .drill-runner-head .quit {
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--ink-faint);
    padding: 6px 12px;
    border-radius: 3px;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: all 0.15s;
  }
  .drill-runner-head .quit:hover { color: var(--ink); border-color: var(--ink-faint); }
  .drill-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
  }
  .drill-progress .dot {
    flex: 1;
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    transition: background 0.2s;
  }
  .drill-progress .dot.correct { background: #6bb583; }
  .drill-progress .dot.wrong { background: #d68a6c; }
  .drill-progress .dot.current { background: var(--accent); }

  .drill-question {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 20px 0;
  }
  .drill-prompt {
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--ink-faint);
    text-align: center;
  }
  .drill-prompt strong {
    color: var(--accent);
    font-weight: 600;
    font-style: normal;
  }

  /* "Name that fret" — visual mode: short prompt line above the fretboard */
  .drill-prompt-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
  }

  /* "Name that fret" — text mode: large position label, no visual */
  .drill-prompt-text {
    text-align: center;
    padding: 40px 0 24px;
  }
  .drill-prompt-text-position {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 500;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: 10px;
  }
  .drill-prompt-text-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  /* Mini fretboard container */
  .drill-mini-fb {
    width: 100%;
    background: rgba(0,0,0,0.18);
    padding: 6px;
    border-radius: 8px;
  }
  @media (max-width: 600px) {
    .drill-mini-fb { padding: 4px; }
  }
  .drill-mini-fb svg .fb-cell {
    transition: fill 0.1s;
  }
  .drill-mini-fb svg .fb-cell:hover {
    fill: rgba(232, 196, 104, 0.18);
  }
  .drill-mini-fb svg .fb-cell:active {
    fill: rgba(232, 196, 104, 0.32);
  }

  /* "Find the Note" simplified prompt — yellow chip + string label inline */
  .drill-find-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0 4px;
  }
  .drill-find-prompt .target {
    background: var(--accent);
    color: #1a1614;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    padding: 8px 22px;
    border-radius: 8px;
    line-height: 1;
    letter-spacing: 0.02em;
  }
  .drill-find-prompt-string {
    font-family: var(--font-display);
    font-size: clamp(20px, 3vw, 28px);
    font-style: italic;
    color: var(--ink-dim);
  }
  .drill-find-prompt-string strong {
    color: var(--ink);
    font-weight: 500;
    font-style: normal;
  }

  /* Helper hint below the fretboard */
  .drill-helper-hint {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
  }

  /* Wrong-answer review row */
  .drill-next-row {
    width: 100%;
    max-width: 600px;
    margin-top: 12px;
    text-align: center;
  }
  .drill-next-btn {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
  }
  .drill-review-msg {
    text-align: center;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ink-dim);
    font-size: 16px;
    line-height: 1.5;
  }
  .drill-review-msg strong {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
  }

  /* "Name that fret" — show one string with a highlighted fret */
  .drill-single-fret {
    background: linear-gradient(180deg, #7a5a38, #5a3f24);
    border-radius: 6px;
    padding: 18px 12px;
    width: 100%;
    max-width: 560px;
    position: relative;
  }
  .drill-single-fret-row {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    height: 50px;
  }
  .drill-single-fret-string {
    position: absolute;
    left: 36px;
    right: 12px;
    top: 50%;
    height: 1.5px;
    background: #e8e0d4;
    opacity: 0.85;
    transform: translateY(-50%);
  }
  .drill-string-label {
    width: 28px;
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-dim);
    z-index: 2;
  }
  .drill-frets {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    position: relative;
    z-index: 1;
    height: 100%;
    margin-left: 8px;
  }
  .drill-fret-cell {
    border-right: 1.5px solid #d4d0c8;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .drill-fret-cell:first-child {
    border-left: 4px solid #ede8e0;
  }
  .drill-fret-cell .marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  }
  .drill-fret-numbers {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    margin-left: 36px;
    margin-top: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
  }
  .drill-fret-numbers div {
    text-align: center;
    padding-left: 8px;
  }

  /* Answer buttons */
  .drill-answers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 720px;
    margin-top: 8px;
  }
  @media (max-width: 480px) {
    .drill-answers { grid-template-columns: repeat(3, 1fr); }
  }
  .drill-answer-btn {
    background: var(--bg-warm);
    border: 1.5px solid var(--rule);
    color: var(--ink);
    padding: 20px 8px;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .drill-answer-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
  }
  .drill-answer-btn:active:not(:disabled) {
    transform: scale(0.96);
  }
  .drill-answer-btn.correct {
    background: #6bb583;
    color: #1a1614;
    border-color: #6bb583;
  }
  .drill-answer-btn.wrong {
    background: #d68a6c;
    color: #1a1614;
    border-color: #d68a6c;
  }
  .drill-answer-btn.fade {
    opacity: 0.3;
  }
  .drill-answer-btn:disabled { cursor: not-allowed; }

  /* "Find on one string" — show a row of frets, tap the correct one */
  .drill-fretrow-question {
    text-align: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-style: italic;
  }
  .drill-fretrow-question .target {
    background: var(--accent);
    color: #1a1614;
    padding: 4px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-style: normal;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 22px;
    margin: 0 4px;
  }
  .drill-fretrow {
    background: linear-gradient(180deg, #7a5a38, #5a3f24);
    border-radius: 6px;
    padding: 18px 8px;
    width: 100%;
    max-width: 620px;
    position: relative;
  }
  .drill-fretrow-string {
    display: flex;
    height: 50px;
    align-items: center;
    position: relative;
  }
  .drill-fretrow-string::before {
    content: '';
    position: absolute;
    left: 36px;
    right: 8px;
    top: 50%;
    height: 1.5px;
    background: #e8e0d4;
    opacity: 0.85;
  }
  .drill-fretrow-cells {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    height: 100%;
    margin-left: 8px;
    position: relative;
    z-index: 1;
  }
  .drill-fretrow-cell {
    border-right: 1.5px solid #d4d0c8;
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .drill-fretrow-cell:first-child {
    border-left: 4px solid #ede8e0;
  }
  .drill-fretrow-cell:hover {
    background: rgba(232, 196, 104, 0.12);
  }
  .drill-fretrow-cell.correct {
    background: rgba(107, 181, 131, 0.4);
  }
  .drill-fretrow-cell.wrong {
    background: rgba(214, 138, 108, 0.4);
  }
  .drill-fretrow-cell.reveal {
    background: rgba(232, 196, 104, 0.25);
  }
  .drill-fretrow-cell .picked {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
  }
  .drill-fretrow-cell.correct .picked { background: #6bb583; }
  .drill-fretrow-cell.wrong .picked { background: #d68a6c; }
  .drill-fretrow-numbers {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    margin-left: 44px;
    margin-top: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
  }
  .drill-fretrow-numbers div {
    text-align: center;
  }

  /* Drill results screen */
  .drill-result {
    text-align: center;
    padding: 24px 0;
  }
  .drill-result-score {
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 4px;
  }
  .drill-result-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 24px;
  }
  .drill-result-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
    flex-wrap: wrap;
  }
  .drill-stat {
    text-align: center;
  }
  .drill-stat-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
  }
  .drill-stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 4px;
  }
  .drill-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
  }


  .container { max-width: 1600px; margin: 0 auto; }

  h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: -0.015em;
    line-height: 1;
    color: var(--ink);
  }
  h1 .accent { color: var(--accent); font-style: normal; font-weight: 700; }
  /* The slogan line that sat under the wordmark ("Know your fretboard.") was
     removed 2026-11-20 (Robert): the header, the lockup pictures, exported
     board images and the share picture show the name only. */

  .brand-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .version-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    background: var(--bg-warm);
    border: 1px solid var(--rule);
    padding: 5px 10px;
    border-radius: 4px;
  }

  /* ================================================================
     MAP VIEW — new design v1.0.0
     ================================================================ */

  /* ---- Map icon set (redesign v3 §8): one 16px stroked family (2px, round caps).
     Buttons carry class .ib + data-ico; the glyph is a ::before mask in
     currentColor, so JS that resets a button's textContent keeps its icon. ---- */
  :root {
    --ico-star: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z%22/%3E%3C/svg%3E");
    --ico-copy: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%229%22 y=%229%22 width=%2212%22 height=%2212%22 rx=%222%22/%3E%3Cpath d=%22M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1%22/%3E%3C/svg%3E");
    --ico-load: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3v12%22/%3E%3Cpath d=%22m7 10 5 5 5-5%22/%3E%3Cpath d=%22M5 21h14%22/%3E%3C/svg%3E");
    --ico-share: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 15V3%22/%3E%3Cpath d=%22m7 8 5-5 5 5%22/%3E%3Cpath d=%22M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-7%22/%3E%3C/svg%3E");
    --ico-layers: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m12 3 9 5-9 5-9-5z%22/%3E%3Cpath d=%22m3 13 9 5 9-5%22/%3E%3C/svg%3E");
    --ico-eye: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/svg%3E");
    --ico-eyeoff: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 3l18 18%22/%3E%3Cpath d=%22M10.6 5.1A10 10 0 0 1 12 5c6.4 0 10 7 10 7a17 17 0 0 1-3.2 4%22/%3E%3Cpath d=%22M6.6 6.6C3.8 8.5 2 12 2 12s3.6 7 10 7a9.7 9.7 0 0 0 5.4-1.6%22/%3E%3Cpath d=%22M9.9 9.9a3 3 0 0 0 4.2 4.2%22/%3E%3C/svg%3E");
    --ico-x: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 6l12 12M18 6 6 18%22/%3E%3C/svg%3E");
    --ico-band: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%224%22 width=%2218%22 height=%2216%22 rx=%222%22/%3E%3Cpath d=%22M9 4v16M15 4v16%22/%3E%3C/svg%3E");
    --ico-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 8V5a2 2 0 0 1 2-2h3M16 3h3a2 2 0 0 1 2 2v3M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3%22/%3E%3Crect x=%228%22 y=%228%22 width=%228%22 height=%228%22 rx=%221%22/%3E%3C/svg%3E");
    --ico-cref: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 5h18%22/%3E%3Ccircle cx=%227%22 cy=%2210%22 r=%222.2%22/%3E%3Ccircle cx=%2212%22 cy=%2215%22 r=%222.2%22/%3E%3Ccircle cx=%2217%22 cy=%2210%22 r=%222.2%22/%3E%3Cpath d=%22M3 20h18%22/%3E%3C/svg%3E");
    --ico-shapes: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%227%22 cy=%227%22 r=%223.5%22/%3E%3Crect x=%2213.5%22 y=%223.5%22 width=%227%22 height=%227%22 rx=%221%22/%3E%3Cpath d=%22M7 13.5l3.8 7H3.2z%22/%3E%3Cpath d=%22M17 13.5l3.5 3.5-3.5 3.5-3.5-3.5z%22/%3E%3C/svg%3E");
    --ico-palette: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3a9 9 0 0 0 0 18c1 0 1.6-.7 1.6-1.5 0-.4-.2-.8-.4-1-.3-.3-.4-.7-.4-1.1 0-.9.7-1.5 1.6-1.5H16a5 5 0 0 0 5-5c0-4.3-4-7.9-9-7.9z%22/%3E%3Ccircle cx=%227.5%22 cy=%2211%22 r=%221.1%22/%3E%3Ccircle cx=%2210%22 cy=%227%22 r=%221.1%22/%3E%3Ccircle cx=%2214.5%22 cy=%227%22 r=%221.1%22/%3E%3C/svg%3E");
    --ico-pencil: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 20h9%22/%3E%3Cpath d=%22M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z%22/%3E%3C/svg%3E");
    --ico-plus: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 5v14M5 12h14%22/%3E%3C/svg%3E");
    --ico-pointer: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 3l14 7-6 2-2 6z%22/%3E%3C/svg%3E");
    --ico-pen: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 21c3-1 5-3 7-6l7-7a2.1 2.1 0 0 0-3-3l-7 7c-3 2-5 4-6 7%22/%3E%3C/svg%3E");
    --ico-line: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 19 19 5%22/%3E%3C/svg%3E");
    --ico-arrow: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 19 19 5%22/%3E%3Cpath d=%22M10 5h9v9%22/%3E%3C/svg%3E");
    --ico-text: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 6V4h14v2%22/%3E%3Cpath d=%22M12 4v16%22/%3E%3Cpath d=%22M9 20h6%22/%3E%3C/svg%3E");
    --ico-eraser: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M20 20H9L4 15a2 2 0 0 1 0-2.8l9-9a2 2 0 0 1 2.8 0l4.4 4.4a2 2 0 0 1 0 2.8L12 18.6%22/%3E%3Cpath d=%22M8 11l6 6%22/%3E%3C/svg%3E");
    --ico-circle: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cellipse cx=%2212%22 cy=%2212%22 rx=%229%22 ry=%227%22/%3E%3C/svg%3E");
    --ico-box: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%226%22 width=%2218%22 height=%2212%22 rx=%224%22/%3E%3C/svg%3E");
    --ico-spot: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%224%22/%3E%3Cpath d=%22M12 2v3M12 19v3M2 12h3M19 12h3%22/%3E%3C/svg%3E");
    --ico-darken: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z%22/%3E%3C/svg%3E");
    --ico-toolbag: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%227%22 width=%2218%22 height=%2213%22 rx=%222%22/%3E%3Cpath d=%22M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2%22/%3E%3Cpath d=%22M3 12h18%22/%3E%3C/svg%3E");
    --ico-camera: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z%22/%3E%3Ccircle cx=%2212%22 cy=%2213%22 r=%223.5%22/%3E%3C/svg%3E");
    --ico-export: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3v12%22/%3E%3Cpath d=%22m7 10 5 5 5-5%22/%3E%3Cpath d=%22M5 21h14%22/%3E%3C/svg%3E");
    --ico-gear: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3Cpath d=%22M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z%22/%3E%3C/svg%3E");
    --ico-help: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M9.5 9a2.5 2.5 0 0 1 4.9.8c0 1.7-2.4 2.2-2.4 3.7%22/%3E%3Cpath d=%22M12 17h.01%22/%3E%3C/svg%3E");
    --ico-trash: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 7h16%22/%3E%3Cpath d=%22M10 11v6M14 11v6%22/%3E%3Cpath d=%22M6 7l1 13h10l1-13%22/%3E%3Cpath d=%22M9 7V4h6v3%22/%3E%3C/svg%3E");
    --ico-solo: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228%22/%3E%3C/svg%3E");
    --ico-film: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%224%22 width=%2218%22 height=%2216%22 rx=%222%22/%3E%3Cpath d=%22M7 4v16M17 4v16M3 9h4M3 15h4M17 9h4M17 15h4%22/%3E%3C/svg%3E");
    --ico-book: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 19V5a2 2 0 0 1 2-2h14v16H6a2 2 0 0 0-2 2 2 2 0 0 0 2 2h14%22/%3E%3C/svg%3E");
    --ico-done: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 6l12 12M18 6 6 18%22/%3E%3C/svg%3E");
  }
  .ib::before, .ib-i { content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
  .ib-i { display: inline-block; }
  [data-ico="star"] { --ico: var(--ico-star); }
  [data-ico="copy"] { --ico: var(--ico-copy); }
  [data-ico="load"] { --ico: var(--ico-load); }
  [data-ico="share"] { --ico: var(--ico-share); }
  [data-ico="layers"] { --ico: var(--ico-layers); }
  [data-ico="eye"] { --ico: var(--ico-eye); }
  [data-ico="eyeoff"] { --ico: var(--ico-eyeoff); }
  [data-ico="x"] { --ico: var(--ico-x); }
  [data-ico="band"] { --ico: var(--ico-band); }
  [data-ico="mask"] { --ico: var(--ico-mask); }
  [data-ico="cref"] { --ico: var(--ico-cref); }
  [data-ico="shapes"] { --ico: var(--ico-shapes); }
  [data-ico="palette"] { --ico: var(--ico-palette); }
  [data-ico="pencil"] { --ico: var(--ico-pencil); }
  [data-ico="plus"] { --ico: var(--ico-plus); }
  [data-ico="pointer"] { --ico: var(--ico-pointer); }
  [data-ico="pen"] { --ico: var(--ico-pen); }
  [data-ico="line"] { --ico: var(--ico-line); }
  [data-ico="arrow"] { --ico: var(--ico-arrow); }
  [data-ico="text"] { --ico: var(--ico-text); }
  [data-ico="eraser"] { --ico: var(--ico-eraser); }
  [data-ico="circle"] { --ico: var(--ico-circle); }
  [data-ico="box"] { --ico: var(--ico-box); }
  [data-ico="spot"] { --ico: var(--ico-spot); }
  [data-ico="darken"] { --ico: var(--ico-darken); }
  [data-ico="toolbag"] { --ico: var(--ico-toolbag); }
  [data-ico="camera"] { --ico: var(--ico-camera); }
  [data-ico="export"] { --ico: var(--ico-export); }
  [data-ico="gear"] { --ico: var(--ico-gear); }
  [data-ico="help"] { --ico: var(--ico-help); }
  [data-ico="trash"] { --ico: var(--ico-trash); }
  [data-ico="solo"] { --ico: var(--ico-solo); }
  [data-ico="film"] { --ico: var(--ico-film); }
  [data-ico="book"] { --ico: var(--ico-book); }
  [data-ico="done"] { --ico: var(--ico-done); }

  /* === KEY BAR (Map redesign v3, spec §5) ===
     Two fixed rows on the flat surface-1 panel. Row 1 = Key center ·
     Diatonic chords · Progression (today's order, one size up); row 2 = the
     "Map" actions as words + icons with Clear map alone at the right.
     Nothing on either row moves when you click. */
  .key-bar {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 20px 14px;
    margin-bottom: 14px;
    display: flex; flex-direction: column; gap: 12px;
  }
  .kb-row { display: flex; align-items: stretch; gap: 20px; min-width: 0; }
  .kb-row-key .kb-ctrls, .kb-row-key .diatonic-grid { min-height: 52px; }
  .kb-row-map { align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
  .key-bar-group { display: flex; align-items: center; gap: 10px; }
  .kb-sec { flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
  .kb-sec + .kb-sec { padding-left: 20px; border-left: 1px solid var(--border-subtle); }
  .kb-ctrls { display: flex; align-items: center; gap: 10px; }
  .kb-sec-prog { flex: 1 1 auto; }
  .kb-hint { font: 500 12.5px var(--font-ui); color: var(--ink-faint); white-space: nowrap; }
  @media (max-width: 1399px) { .kb-hint { display: none; } }
  .kb-spacer { flex: 1 1 auto; }
  /* group headings: non-interactive, brass mono micro-labels (10.5px) */
  .key-bar-label {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
    color: color-mix(in srgb, var(--accent-primary) 45%, var(--text-muted));
  }
  .kb-inline-label { margin-right: 6px; }
  .key-select, .prog-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0 30px 0 12px; height: 38px;
    border-radius: 8px;
    font: 600 13.5px var(--font-ui);
    cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--accent-primary) 50%), linear-gradient(135deg, var(--accent-primary) 50%, transparent 50%);
    background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  }
  .key-select { font: 700 22px var(--font-display); min-width: 74px; padding-left: 14px; font-feature-settings: "kern"; }
  .prog-select { width: 250px; height: 36px; }
  .key-select:hover, .prog-select:hover { border-color: var(--border-strong); }
  .key-select:focus-visible, .prog-select:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }

  .quality-toggle {
    display: flex; height: 38px; box-sizing: border-box;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 3px; gap: 2px;
  }
  .quality-btn {
    font: 600 13.5px var(--font-ui);
    background: transparent; border: none; color: var(--ink-dim);
    padding: 0 16px; border-radius: var(--radius-pill); cursor: pointer;
  }
  .quality-btn:hover:not(.selected) { color: var(--ink); }
  .quality-btn.selected { background: var(--accent-primary); color: var(--text-inverse); font-weight: 700; }

  /* Lock chords — a labelled switch (track + word); gold when on */
  .kb-switch.key-retain-btn {
    display: inline-flex; align-items: center; gap: 9px; height: 38px;
    background: transparent; border: none; padding: 0 4px; cursor: pointer;
    font: 600 13px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-dim);
  }
  .kb-switch .sw {
    position: relative; width: 36px; height: 20px; flex: none; border-radius: 999px; box-sizing: border-box;
    background: var(--surface-3); border: 1.5px solid var(--border-strong); transition: background .15s, border-color .15s;
  }
  .kb-switch .sw .knob {
    position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
    background: var(--ink-faint); transition: left .18s cubic-bezier(.3,1.3,.5,1), background .15s;
  }
  .kb-switch:hover { color: var(--ink); }
  .kb-switch:hover .sw { border-color: var(--ink-faint); }
  .kb-switch.on.key-retain-btn { background: transparent; color: var(--ink); }
  .kb-switch.on .sw { background: var(--accent-primary); border-color: var(--accent-primary); }
  .kb-switch.on .sw .knob { left: 18px; background: var(--text-inverse); }

  /* Diatonic chips — the chord NAME is the big primary text, numeral small above */
  .diatonic-grid { display: flex; gap: 6px; align-items: center; }
  .diatonic-chip {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    width: 62px; height: 52px; box-sizing: border-box; padding: 0 2px;
    font-family: var(--font-display);
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-subtle);
    color: var(--ink-dim);
    border-radius: 9px; cursor: pointer; line-height: 1;
    transition: border-color 150ms, color 150ms, background 150ms;
  }
  .diatonic-chip:hover { border-color: var(--border-strong); color: var(--ink); }
  .diatonic-chip .roman { order: -1; font: 700 11.5px var(--font-display); letter-spacing: .02em; color: var(--ink-faint); line-height: 1; }
  .diatonic-chip .chord-label { font: 700 19px var(--font-display); color: inherit; line-height: 1.05; font-feature-settings: "kern"; white-space: nowrap; }
  .diatonic-chip.in-use { background: rgba(232,195,107,0.14); border-color: var(--accent-primary); color: var(--ink); }
  .diatonic-chip.in-use .roman { color: var(--accent-primary); }
  .diatonic-chip.card-tint { background: var(--chip-wash); border-color: var(--chip-border); color: var(--ink); }
  .diatonic-chip.card-tint .roman { color: var(--chip-ink); }
  @media (max-width: 1399px) { .diatonic-chip { width: 58px; } .diatonic-grid { gap: 5px; } .kb-row { gap: 16px; } .kb-sec + .kb-sec { padding-left: 16px; } }
  @media (max-width: 1180px) { .kb-row-key { flex-wrap: wrap; row-gap: 12px; } }

  /* Map-row buttons: outline pills, words first + a 16px icon */
  .kb-btn.key-retain-btn {
    height: 34px; box-sizing: border-box; padding: 0 14px 0 12px; gap: 7px;
    font: 600 13px var(--font-ui); letter-spacing: 0; text-transform: none;
    color: var(--ink-dim); border-color: var(--border-subtle); white-space: nowrap;
  }
  .kb-btn.key-retain-btn:hover { color: var(--ink); border-color: var(--border-strong); }
  .kb-btn.key-retain-btn.on { background: transparent; color: var(--accent-primary); border-color: var(--accent-primary); }
  .kb-caret { width: 8px; height: 8px; margin-left: 1px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .8; }
  #cardsVisBtn.on { --ico: var(--ico-eyeoff); }
  .kb-clear.clear-btn {
    height: 34px; box-sizing: border-box; padding: 0 14px 0 12px; gap: 7px; margin-left: 0;
    border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); border-radius: var(--radius-pill);
    font: 600 13px var(--font-ui); letter-spacing: 0; color: var(--danger);
  }
  .kb-clear.clear-btn:hover { background: rgba(232, 93, 78, 0.12); color: #ff8a7c; }
  @media (max-width: 1100px) { .kb-btn.key-retain-btn, .kb-clear.clear-btn { padding: 0 10px; } }

  @media (max-width: 700px) {
    .key-bar { padding: 12px; }
    .kb-row-key { flex-direction: column; align-items: stretch; }
    .kb-sec + .kb-sec { padding-left: 0; border-left: 0; }
    .diatonic-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: 100%; }
    .diatonic-chip { width: auto; height: 46px; }
    .diatonic-chip .chord-label { font-size: 15px; }
    .prog-select { width: 100%; }
    .kb-sec-prog .kb-ctrls { width: 100%; }
  }

  /* Clear All (legacy class kept for any other surface using it) */
  .clear-btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 6px 0; font-family: var(--font-mono); font-size: 12px; font-weight: 500;
    letter-spacing: 0.04em; cursor: pointer; margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  }
  .clear-btn:hover { color: var(--danger); }
  .clear-btn .x { font-size: 14px; line-height: 1; }

  /* Blank-view guard — filters are hiding a loaded view */
  .map-blank-toast {
    position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-1); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 10px 14px; z-index: 30;
    font-size: 12.5px; color: var(--text-primary);
    box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  }
  .map-blank-toast button {
    border: 1px solid var(--border-subtle); border-radius: 7px;
    padding: 5px 10px; cursor: pointer; font-family: var(--font-mono); font-size: 11px;
    background: var(--bg-elevated); color: var(--text-secondary);
  }
  .map-blank-toast .mbt-reset { background: var(--accent-primary); color: var(--text-inverse); border-color: var(--accent-primary); font-weight: 600; }

  /* === CHORD CARDS === */
  .chord-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
  }
  @media (max-width: 1200px) { .chord-cards-row { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 700px)  { .chord-cards-row { grid-template-columns: 1fr; } }

  /* Full hide (the key-bar "Hide chord cards" toggle) — board-first view.
     Distinct from cc-collapsed, which shrinks cards to summary strips. */
  .chord-cards-row.cards-hidden { display: none; }

  .chord-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: all 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
  }
  /* Compact-chip cards manage their own vertical rhythm via row margins. */
  .chord-card:not(.empty) { gap: 0; }
  .chord-card.ch1 { --card-stripe: var(--c1); }
  .chord-card.ch2 { --card-stripe: var(--c2); }
  .chord-card.ch3 { --card-stripe: var(--c3); }
  .chord-card.ch4 { --card-stripe: var(--c4); }
  /* top identity stripe — a straight bar inset from the sides so it stops BEFORE the rounded
     corners (never fights the curved focus/selection ring at the corners) */
  .chord-card:not(.empty)::before {
    /* top:-1px rides over the card border so the stripe sits flush against
       the focus ring — touching it, not floating a border-width below it */
    content: ''; position: absolute; left: 20px; right: 20px; top: -1px; height: 3px;
    background: var(--card-stripe); border-radius: 2px;
    z-index: 2; pointer-events: none;
  }
  /* FOCUSED = the chord you're isolating: full lit ring (chord colour) + glow + tint */
  .chord-card.focused {
    box-shadow: 0 0 0 2px var(--card-stripe), 0 0 16px -2px var(--card-stripe), 0 12px 28px rgba(0,0,0,0.35);
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-stripe) 8%, var(--surface-1)), var(--surface-1));
  }
  /* SELECTED (where the next Diatonic chip lands) = a clear full cream ring, distinct from focus */
  .chord-card.selected:not(.empty):not(.focused) {
    box-shadow: 0 0 0 2px #F2EDE2, 0 8px 22px rgba(0,0,0,0.3);
  }

  /* Empty card (no chord assigned) */
  .chord-card.empty {
    background: transparent;
    border: 1.5px dashed var(--border-subtle);
    text-align: center;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    /* mono-caps invitation (Design exploration 9a/10a) */
    font-family: var(--font-mono); font-size: 11.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    min-height: 232px;
    gap: 12px;
  }
  /* When all cards are collapsed, empty slots drop their tall min-height and the
     grid's align-items:stretch sizes them to the collapsed filled cards → uniform row. */
  .chord-card.empty.cc-collapsed { min-height: 0; padding: 10px; gap: 8px; }
  .chord-card.empty.cc-collapsed::after { width: 24px; height: 24px; font-size: 15px; }
  /* the "+" disc above the label */
  .chord-card.empty::after {
    content: '+';
    order: -1;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    color: var(--text-muted);
    font-family: var(--font-body); font-size: 20px; font-weight: 400;
    line-height: 32px; text-align: center;
    transition: all 150ms;
  }
  .chord-card.empty:hover::after,
  .chord-card.empty.selected::after {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
  }
  .chord-card.empty:hover {
    border-color: var(--border-strong);
    color: var(--text-secondary);
  }
  /* H1 (verification pass, approved 2026-08-14): a fresh Map leads with the
     BOARD. Until any chord is assigned, the empty slots collapse to a slim
     inline "+ CHORD N" invitation row instead of four tall dashed boxes
     burying the hero board below the fold. Full cards return the moment
     the first chord exists. */
  #chordSlots:not(:has(.chord-card:not(.empty))) .chord-card.empty {
    min-height: 0; padding: 11px 10px; gap: 9px;
    flex-direction: row; justify-content: center; align-items: center;
  }
  #chordSlots:not(:has(.chord-card:not(.empty))) .chord-card.empty::after {
    width: 22px; height: 22px; font-size: 14px; line-height: 20px;
  }
  .chord-card.empty.selected {
    border-color: var(--accent-primary);
    border-style: dashed;
    background: rgba(232, 196, 104, 0.05);
    color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary), 0 8px 22px rgba(232, 196, 104, 0.08);
  }

  /* Disabled state — chord turned off (ring OFF). Keep the header interactive
     (ring/caret/×) and the toggle controls readable; dim everything else. */
  .chord-card.disabled > *:not(.cc-head) { opacity: 0.4; }
  .chord-card.disabled .cc-body .mini-toggle-row { opacity: 1; }

  /* ========================================================================
     COMPACT CHIP — restyled chord card (identity header · quality row ·
     collapsed summary strip · expanded body). All 29 data-actions preserved.

     DARK-ACCENT-SAFE SELECTED STATE: the identity colour (--card-stripe) can be
     anything, incl. near-black. Every FILLED selected control adds a subtle
     always-present hairline so a black selection never disappears into the card.
     ======================================================================== */
  .chord-card:not(.empty) {
    /* boundary applied to any filled selection so it stays visible on a dark accent */
    --cc-sel-ring: inset 0 0 0 1px rgba(255,255,255,0.28);
  }

  /* --- Header row 1: ring · outlined note/deg field · spacer · pencil · caret · × --- */
  .cc-head { display: flex; align-items: center; gap: 8px; position: relative; }
  .cc-sp { flex: 1 1 auto; }

  /* Ring = show on/off. Filled (active) / hollow (off), always in the card colour. */
  .cc-ring {
    width: 16px; height: 16px; border-radius: 50%; flex: none; padding: 0; cursor: pointer;
    border: 3px solid var(--card-fill, var(--card-stripe)); background: var(--card-fill, var(--card-stripe));
    box-shadow: var(--cc-sel-ring);
    transition: background 120ms, opacity 120ms, transform 120ms;
  }
  .cc-ring:not(.on) { background: transparent; opacity: 0.6; box-shadow: none; }
  .cc-ring:hover { transform: scale(1.08); }

  /* Outlined note/degree field — reads as one interactive dropdown selection. */
  .cc-idfield {
    display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: rgba(0,0,0,0.18);
    padding: 2px 6px 2px 8px;
  }
  /* Note / degree: a composed DISPLAY ("Gm ▾", "vi ▾") with a transparent native
     <select> laid over the whole thing — so clicking anywhere (letter, suffix, or
     chevron) opens the dropdown, and the label has no native-select gap. */
  .cc-note, .cc-deg { position: relative; display: inline-flex; align-items: center; }
  .cc-note-disp, .cc-deg-disp { display: inline-flex; align-items: center; pointer-events: none; }
  .cc-note-disp { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; color: var(--ink); }
  .cc-qual { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; color: var(--ink); }
  .cc-qual:empty { display: none; }
  .cc-deg-disp { font-family: var(--font-display); font-style: normal; font-weight: 600; font-size: 15px; color: var(--text-muted); margin-left: 6px; }
  .cc-deg.borrowed .cc-deg-disp { color: #d68a6c; }
  .cc-cv { color: var(--accent-primary); font-size: 10px; margin-left: 4px; }
  .cc-note-select, .cc-deg-select {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; border: 0; margin: 0; padding: 0; cursor: pointer;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
  }

  /* Icon buttons (pencil / caret / ×) — unified control language */
  .cc-iconbtn {
    width: 28px; height: 28px; flex: none; border-radius: 7px;
    border: 1px solid var(--border-subtle); background: var(--bg);
    color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer;
    display: inline-grid; place-items: center; position: relative;
    transition: color 120ms, border-color 120ms;
  }
  .cc-iconbtn:hover { color: var(--text-primary); border-color: var(--border-strong); }
  .cc-close:hover { color: var(--danger); border-color: var(--danger); background: rgba(232,93,78,0.12); }
  .chord-card:not(.cc-collapsed) .cc-caret { color: var(--accent-primary); border-color: var(--border-strong); }
  .cc-collapse-all-slot { display: inline-flex; }
  .cc-collapse-all-slot:empty { display: none; }

  /* Per-card colour pencil (opens the card-palette popover) + ↺ reset */
  .chord-color-wrap { display: inline-flex; align-items: center; gap: 2px; flex: none; }
  .chord-color-pencil.cc-iconbtn { color: var(--card-stripe); }
  .chord-color-pencil svg { width: 15px; height: 15px; display: block; }
  .chord-color-reset {
    width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: var(--text-muted); font-size: 11px; line-height: 1;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .chord-color-reset:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

  /* --- Card palette popover (the pencil's popover): card-colour swatches +
     custom/hex on top, then one colour row per degree of the chord. Matches the
     degree-palette popover's dark chrome. --- */
  .card-pal-pop {
    position: fixed; z-index: 9000; width: 236px;
    background: rgba(36, 29, 23, 0.98); border: 1px solid #4a3d31; border-radius: 10px;
    padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: var(--text-primary); font-size: 12px;
  }
  .cpp-title { font-weight: 700; font-size: 12px; margin-bottom: 8px; }
  .cpp-degtitle { margin-top: 13px; margin-bottom: 2px; }
  .cpp-hint { font-size: 10.5px; color: var(--text-muted); margin-bottom: 9px; }
  .cpp-swrow { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
  .cpp-sw {
    width: 20px; height: 20px; flex: none; padding: 0; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 6px;
  }
  .cpp-sw.on { outline: 2px solid #F5F1E8; outline-offset: 1px; }
  .cpp-degpick {
    width: 26px; height: 22px; flex: none; padding: 0; cursor: pointer;
    border: 1px solid var(--border-subtle); border-radius: 6px; background: none;
  }
  .cpp-degpick.set { border-color: #F5F1E8; }
  .cpp-hex {
    width: 58px; height: 22px; padding: 0 6px; border: 1px solid var(--border-subtle);
    border-radius: 6px; background: var(--bg); color: var(--text-primary);
    font-family: var(--font-mono); font-size: 10.5px;
  }
  .cpp-degrow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .cpp-deglabel { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }
  .cpp-degspacer { flex: 1; }
  .cpp-rowreset {
    width: 20px; height: 20px; flex: none; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: var(--text-muted); font-size: 11px; line-height: 1;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .cpp-rowreset:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }
  .cpp-clear {
    width: 100%; margin-top: 4px; padding: 5px 0; border: 1px solid var(--border-subtle);
    border-radius: 7px; background: var(--bg); color: var(--text-secondary);
    font-size: 11px; cursor: pointer;
  }
  .cpp-clear:hover { color: var(--text-primary); border-color: var(--border-strong); }
  /* Per-card colour mode (Chord color | Degrees) at the top of the popover. */
  .cpp-seg {
    display: flex; margin-bottom: 12px; border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill); overflow: hidden; background: var(--bg);
  }
  .cpp-seg button {
    flex: 1; padding: 5px 0; border: none; background: transparent; cursor: pointer;
    color: var(--text-secondary); font-size: 11px; font-weight: 600;
  }
  .cpp-seg button.on { background: var(--accent); color: var(--text-inverse); }
  .cpp-sub { font-weight: 400; color: var(--text-muted); font-size: 10.5px; }

  /* --- Chord picker popover (the + on an empty chord card) --- */
  .chord-picker-pop {
    position: fixed; z-index: 9000; width: 250px;
    background: rgba(36, 29, 23, 0.98); border: 1px solid #4a3d31; border-radius: 10px;
    padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); color: var(--text-primary);
  }
  .cpk-head { font-weight: 700; font-size: 12px; margin-bottom: 9px; }
  .cpk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .cpk-chip {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 2px; cursor: pointer; border: 1px solid var(--border-subtle);
    border-radius: 7px; background: var(--bg); color: var(--text-primary);
  }
  .cpk-chip:hover { border-color: var(--accent); background: rgba(232, 195, 107, 0.1); }
  .cpk-rn { font-family: var(--font-mono); font-size: 11px; color: var(--accent); line-height: 1; }
  .cpk-nm { font-size: 12px; font-weight: 600; line-height: 1.1; }
  .cpk-or { font-size: 10.5px; color: var(--text-muted); text-align: center; margin: 11px 0 7px; }
  .cpk-note { font-size: 12px; line-height: 1.4; color: var(--text-muted); margin: 8px 2px 0; max-width: 260px; }
  .cpk-form { display: flex; gap: 6px; }
  .cpk-input {
    flex: 1; min-width: 0; height: 28px; padding: 0 8px; border: 1px solid var(--border-subtle);
    border-radius: 7px; background: var(--bg); color: var(--text-primary);
    font-family: var(--font-mono); font-size: 12px;
  }
  .cpk-input:focus { outline: none; border-color: var(--accent); }
  .cpk-input.cpk-bad { border-color: #c9564b; }
  .cpk-add {
    flex: none; height: 28px; padding: 0 12px; border: 1px solid var(--accent);
    border-radius: 7px; background: rgba(232, 195, 107, 0.14); color: var(--accent);
    font-size: 12px; font-weight: 600; cursor: pointer;
  }
  .cpk-add:hover { background: rgba(232, 195, 107, 0.24); }

  /* --- Header row 2: quality pills · spacer · Focus pill (always visible) --- */
  .cc-qrow { display: flex; align-items: center; gap: 8px; margin-top: 11px; }

  .quality-row { display: flex; gap: 4px; flex-shrink: 0; }
  .quality-pill {
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    color: var(--text-secondary); padding: 4px 11px; border-radius: 7px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
    transition: all 120ms;
  }
  .quality-pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
  .quality-pill.selected {
    background: var(--card-fill, var(--card-stripe)); border-color: var(--card-fill, var(--card-stripe));
    color: var(--card-ink, #fff); box-shadow: var(--cc-sel-ring);
  }

  .focus-btn {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    background: var(--bg); border: 1px solid var(--border-subtle);
    color: var(--text-muted); padding: 0 11px; height: 26px;
    border-radius: 7px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
    transition: all 150ms;
  }
  .focus-btn:hover { border-color: var(--border-strong); color: var(--text-secondary); }
  .focus-btn .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; }
  .focus-btn.focused {
    background: var(--card-fill, var(--card-stripe)); border-color: var(--card-fill, var(--card-stripe));
    color: var(--card-ink, #fff); box-shadow: var(--cc-sel-ring);
  }
  .focus-btn.focused .dot { background: currentColor; border-color: currentColor; }

  /* --- Summary strip: collapsed only, sits above the divider --- */
  .cc-summ {
    display: flex; border: 1px solid var(--border-subtle); border-radius: 8px;
    overflow: hidden; margin-top: 11px;
  }
  .cc-summ span {
    flex: 1; text-align: center; font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-secondary); padding: 6px 4px; border-right: 1px solid var(--border-subtle);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cc-summ span:last-child { border-right: 0; }
  .cc-summ .k {
    color: var(--text-muted); font-size: 8px; letter-spacing: 0.1em;
    display: block; margin-bottom: 1px;
  }
  .chord-card:not(.cc-collapsed) .cc-summ { display: none; }

  /* --- Body: expanded only --- */
  .cc-body {
    margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border-subtle);
    display: flex; flex-direction: column; gap: 12px;
  }
  .chord-card.cc-collapsed .cc-body { display: none; }

  /* Legacy classes kept as no-ops so any stray reference is harmless */
  .note-select, .degree-select { background: var(--surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-family: var(--font-mono); font-size: 11px; padding: 3px 4px; border-radius: 5px; cursor: pointer; }
  .degree-select.borrowed { color: #d68a6c; font-style: italic; }

  .chord-controls-grid {
    /* Root-string column slightly wider so "6th / 1st (E)" never clips;
       Extension gives up the slack (Robert 2026-08-29). */
    display: grid; grid-template-columns: 1.18fr 0.82fr; gap: 8px;
  }
  .ctrl-label {
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 4px;
    display: flex; align-items: center; gap: 4px;
  }
  .ctrl-label.disabled { opacity: 0.45; }
  .ctrl-select {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 8px; border-radius: 6px;
    font-family: var(--font-mono); font-size: 11px;
    width: 100%;
    cursor: pointer;
  }
  .ctrl-select:disabled { opacity: 0.45; cursor: not-allowed; }

  /* Display mode — compact 3-way switch (recording-console style) */
  .display-mode {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 2px;
    gap: 0;
  }
  .display-mode-btn {
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
    background: transparent; border: none;
    color: var(--text-muted);
    padding: 3px 2px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
    transition: color 120ms;
  }
  .display-mode-btn.selected {
    background: var(--surface-3);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35), inset 0 0 0 1px var(--border-subtle);
  }

  .scale-select { margin-top: 6px; width: 100%; }

  /* Triad string-set + inversion chips (shown only in Triad mode) */
  .triad-opts { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
  .triad-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
  .triad-row-label { font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); flex: 0 0 54px; }
  .triad-chip { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-muted); padding: 3px 7px; border-radius: var(--radius-pill); cursor: pointer; transition: color 120ms, background 120ms; }
  .triad-chip.on { background: var(--surface-3); color: var(--text-primary); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-subtle); }

  /* Mini-toggle row (Show, Labels, Extend, All) */
  .mini-toggle-row {
    display: flex; gap: 10px; padding-top: 4px;
    flex-wrap: wrap;
  }
  .mini-toggle {
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-muted);
    background: transparent; border: none; padding: 0;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .mini-toggle .check {
    width: 12px; height: 12px; border-radius: 3px;
    border: 1.5px solid var(--text-muted);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; color: transparent;
  }
  .mini-toggle.on { color: var(--text-secondary); }
  .mini-toggle.on .check {
    background: var(--text-secondary); border-color: var(--text-secondary);
    color: var(--text-inverse);
  }

  /* Neighbor — 3-way direction control: ◄ nut / ◆ both / ► bridge.
     Reads like the mini-toggles (mono caps) but with a small segmented selector. */
  .nbr-seg {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-muted);
  }
  .nbr-seg.on { color: var(--text-secondary); }
  .nbr-seg .nbr-seg-label { user-select: none; }
  .nbr-seg .nbr-arrow {
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    width: 19px; height: 17px; padding: 0;
    border-radius: 4px; cursor: pointer;
    font-size: 9px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .nbr-seg .nbr-arrow:hover { border-color: var(--border-strong); color: var(--text-secondary); }
  .nbr-seg .nbr-arrow.on {
    background: var(--text-secondary); border-color: var(--text-secondary);
    color: var(--text-inverse); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
  }

  /* === Labels dropdown (per-chord degree filter) === */
  .label-dd { position: relative; padding-top: 2px; }
  .label-dd-trigger {
    width: 100%;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: 8px; padding: 7px 10px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
  }
  .label-dd-trigger:hover { border-color: var(--border-strong); }
  .label-dd-trigger .ldd-key { color: var(--text-muted); }
  .label-dd-trigger .ldd-val { color: var(--accent-primary); margin-left: auto; font-weight: 700; }
  .label-dd-trigger .ldd-caret { color: var(--text-muted); font-size: 9px; }
  .label-dd-menu {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    z-index: 30; background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 8px; box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    min-width: 188px;
  }
  .label-dd.open .label-dd-menu { display: block; }
  /* portalled into #ifb-popover-layer (spec §9) */
  .label-dd-menu.ldd-portal { display: block; min-width: 250px; max-width: 320px; padding: 10px; }
  .label-dd.open .label-dd-trigger { border-color: var(--accent-primary); }
  .ldd-presets { display: flex; gap: 5px; margin-bottom: 7px; }
  .ldd-presets button {
    flex: 1; font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-secondary); background: var(--bg-elevated);
    border: 1px solid var(--border-subtle); border-radius: 6px; padding: 6px 4px; cursor: pointer;
  }
  .ldd-presets button:hover { border-color: var(--accent-primary); color: var(--text-primary); }
  .ldd-degrees { display: flex; gap: 5px; }
  .ldd-deg {
    flex: 1; font-family: var(--font-mono); font-size: 12px; font-weight: 700;
    color: var(--text-muted); background: var(--bg-elevated);
    border: 1.5px solid var(--border-subtle); border-radius: 6px; padding: 7px 2px; cursor: pointer;
  }
  .ldd-deg:hover { border-color: var(--accent-primary); }
  .ldd-deg.on { background: var(--accent-primary); border-color: var(--accent-primary); color: var(--text-inverse); }

  /* Small string-scope tag on the trigger (e.g. "GDA") when a chord is
     restricted to specific strings. */
  .label-dd-trigger .ldd-strtag {
    font-family: var(--font-mono); font-size: 9px; font-weight: 700;
    letter-spacing: 0.06em; color: var(--text-inverse);
    background: var(--accent-primary); border-radius: 4px;
    padding: 1px 4px; margin-left: 6px;
  }
  /* Isolate toggle inside the menu */
  .ldd-isolate {
    display: flex; align-items: center; gap: 6px; width: 100%;
    margin-top: 8px; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.02em; text-transform: uppercase; cursor: pointer;
    color: var(--text-muted); background: var(--bg-elevated);
    border: 1px solid var(--border-subtle); border-radius: 6px; padding: 7px 8px;
  }
  .ldd-isolate:hover { border-color: var(--border-strong); color: var(--text-secondary); }
  .ldd-isolate .check {
    width: 13px; height: 13px; flex: 0 0 auto; border-radius: 3px;
    border: 1.5px solid var(--border-strong); display: inline-flex;
    align-items: center; justify-content: center; font-size: 9px; line-height: 1;
  }
  .ldd-isolate.on {
    color: var(--text-inverse); background: var(--accent-primary); border-color: var(--accent-primary);
  }
  .ldd-isolate.on .check { background: var(--text-inverse); color: var(--accent-primary); border-color: var(--text-inverse); }
  /* Section label + "All" reset for the strings row */
  .ldd-sec-label {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
    margin: 10px 0 5px;
  }
  .ldd-str-all {
    font-family: var(--font-mono); font-size: 8px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
    color: var(--text-muted); background: transparent;
    border: 1px solid var(--border-subtle); border-radius: 5px; padding: 2px 6px;
  }
  .ldd-str-all:hover { border-color: var(--accent-primary); color: var(--text-primary); }
  .ldd-strings { display: flex; gap: 4px; }
  .ldd-str {
    flex: 1; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    color: var(--text-muted); background: var(--bg-elevated);
    border: 1.5px solid var(--border-subtle); border-radius: 6px; padding: 6px 2px; cursor: pointer;
  }
  .ldd-str:hover { border-color: var(--accent-primary); }
  .ldd-str.on { background: var(--accent-primary); border-color: var(--accent-primary); color: var(--text-inverse); }


  /* ==== CHORD CARD v3 (spec §6): today's card, five targeted fixes ====
     readable words (no letter-spaced caps on anything you click), one-size
     title with real ♯/♭, clear Off state, fixed-height shape slot. Section
     headings stay mono caps (labels, not buttons), 9 → 10px. */
  .chord-card:not(.empty) { padding: 12px 14px 14px; }
  .cc-note-disp .cc-name { font: 800 22px var(--font-display); line-height: 1; color: var(--ink); font-feature-settings: "kern"; white-space: nowrap; }
  .cc-cv { display: inline-block; width: 6px; height: 6px; margin: 0 2px 4px 7px; border-right: 1.6px solid var(--accent-primary); border-bottom: 1.6px solid var(--accent-primary); transform: rotate(45deg); font-size: 0; }
  .cc-deg-disp { font: 600 14px var(--font-display); color: var(--ink-faint); margin-left: 8px; }
  .cc-borrowed { font: 600 11.5px var(--font-ui); margin-left: 5px; color: #d68a6c; }
  .cc-idfield { padding: 3px 7px 3px 9px; min-height: 32px; box-sizing: border-box; }
  .cc-offtag {
    flex: none; font: 700 11.5px var(--font-ui); color: var(--ink-dim);
    border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 7px; line-height: 1.2;
  }
  .cc-ring:not(.on) { opacity: 1; background: transparent; }
  .chord-card.disabled > *:not(.cc-head) { opacity: 0.55; }
  .quality-pill {
    font: 600 12.5px var(--font-ui); letter-spacing: 0; text-transform: none;
    height: 26px; padding: 0 11px; box-sizing: border-box;
  }
  .focus-btn { font: 600 12.5px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-dim); }
  .ctrl-label { font-size: 10px; font-weight: 600; margin-bottom: 5px; color: var(--ink-faint); }
  .ctrl-select { font: 600 13px var(--font-ui); height: 30px; padding: 0 8px; border-radius: 7px; color: var(--ink); }
  .chord-controls-grid { grid-template-columns: 1.3fr 0.7fr; }
  .display-mode-btn { font: 600 13px var(--font-ui); letter-spacing: 0; text-transform: none; padding: 5px 2px; color: var(--ink-faint); }
  .display-mode-btn:hover:not(.selected) { color: var(--ink-dim); }
  .display-mode-btn.selected { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
  .cc-slot-label { margin-top: 10px; }
  .cc-shape-slot { height: 60px; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; }
  .cc-shape-slot .scale-select { margin-top: 0; text-overflow: ellipsis; }
  /* Formula beside the two diminished pentatonics (names alone don't pin the notes). */
  .scale-formula { margin-left: auto; font: 500 11px var(--font-mono); color: var(--ink-dim); white-space: nowrap; cursor: help; }
  .triad-row { flex-wrap: nowrap; gap: 5px; min-height: 24px; }
  .triad-row-label { font: 600 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); flex: 0 0 72px; }
  .triad-chip { font: 500 11px var(--font-mono); height: 24px; padding: 0 8px; box-sizing: border-box; color: var(--ink-dim); }
  .cc-shape-slot [data-action="toggle-shift"] { font: 600 12.5px var(--font-ui); padding: 0 10px; }
  .triad-chip:disabled { opacity: .38; cursor: not-allowed; }
  /* Triad mode (2026-10-08): multi-select Strings / Inversion chips, and the
     Position readout that stands in for the Root-string select (the ▾▴ arrows
     step the voicing through its positions). The readout is a FIXED width —
     wide enough for "12 of 12 · frets 19–21" in tabular figures — so the
     arrows beside it never move as the text changes (Robert 2026-10-08). */
  .cc-seg-row .triad-chip.cc-seg { min-width: 38px; padding: 0 6px; text-align: center; }
  .cc-seg-row .triad-chip.cc-seg.subst { box-shadow: inset 0 0 0 1px var(--border-strong); font-style: italic; }
  .cc-posread { display: inline-flex; align-items: center; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 11px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); padding: 0 4px; box-sizing: border-box; }
  .anchor-step-row .ctrl-select.cc-posread { flex: 0 0 auto; width: calc(22ch + 10px); min-width: 0; letter-spacing: 0; }
  .chord-controls-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); }   /* content never widens a column */
  /* A Triad card's first column is at least the readout + arrows (the Extension
     select beside it is inert in Triad mode and gives up the slack at 1280). */
  .chord-card.cc-triad .chord-controls-grid { grid-template-columns: minmax(212px, 1.3fr) minmax(0, 0.7fr); }
  .mini-toggle-row { gap: 8px 14px; padding-top: 2px; }
  .mini-toggle { font: 600 12.5px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-faint); gap: 6px; }
  .mini-toggle:hover:not(:disabled) { color: var(--ink-dim); }
  .mini-toggle .check { width: 14px; height: 14px; font-size: 11px; }
  .mini-toggle.on { color: var(--ink-dim); }
  .mini-toggle:disabled { opacity: .38; cursor: not-allowed; }
  .nbr-seg { font: 600 12.5px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
  .nbr-seg.disabled { opacity: .38; }
  .nbr-seg .nbr-arrow { width: 22px; height: 20px; }
  .nbr-seg .nbr-arrow:disabled { cursor: not-allowed; }
  .nbr-g { display: block; width: 0; height: 0; border-style: solid; }
  .nbr-l { border-width: 4px 6px 4px 0; border-color: transparent currentColor transparent transparent; }
  .nbr-r { border-width: 4px 0 4px 6px; border-color: transparent transparent transparent currentColor; }
  .nbr-b { width: 6px; height: 6px; border: 0; background: currentColor; border-radius: 50%; }
  .label-dd-trigger { font: 700 12.5px var(--font-ui); letter-spacing: 0; text-transform: none; height: 32px; padding: 0 10px; box-sizing: border-box; }
  .label-dd-trigger .ldd-key { color: var(--ink-dim); }
  .label-dd-trigger .ldd-val { font: 500 12.5px var(--font-mono); color: var(--ink); text-transform: none; }
  .label-dd-trigger .ldd-strtag { font: 600 11px var(--font-mono); letter-spacing: 0; }
  .label-dd-trigger .ldd-caret { font-size: 0; width: 6px; height: 6px; border-right: 1.6px solid var(--accent-primary); border-bottom: 1.6px solid var(--accent-primary); transform: translateY(-2px) rotate(45deg); }
  .ldd-presets button { font: 600 12.5px var(--font-ui); letter-spacing: 0; text-transform: none; padding: 6px 4px; }
  .ldd-deg, .ldd-str { font: 700 13px var(--font-mono); }
  .ldd-isolate { font: 600 12.5px var(--font-ui); letter-spacing: 0; text-transform: none; }
  .ldd-sec-label { font-size: 10px; }
  .ldd-str-all { font: 600 11.5px var(--font-ui); letter-spacing: 0; text-transform: none; padding: 2px 8px; }
  .cc-summ span { font: 600 12px var(--font-ui); }
  .cc-summ .k { font: 600 9.5px var(--font-mono); }
  @media (max-width: 1399px) { .chord-card:not(.empty) { padding: 12px 12px 13px; } .quality-pill { padding: 0 9px; } .triad-row-label { flex-basis: 64px; } }

  /* === FRETBOARD DOCK === */
  .fretboard-dock {
    position: relative;  /* anchors the blank-view toast */
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 22px 22px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  }
  .fretboard-dock-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
    min-height: 30px;
  }
  /* Active chords, centered above the wood, each in its card color — and
     clickable: tap a letter to focus that chord (focused one gets a ring). */
  .fretboard-chord-indicator {
    font-family: var(--font-display);
    font-weight: 700; font-size: 19px;
    letter-spacing: 0.01em;
    white-space: nowrap;
    pointer-events: auto;
    flex: 0 0 auto;
    display: flex; align-items: flex-start; gap: 2px;
  }
  .fretboard-chord-indicator .ci-unit {
    display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
  }
  /* per-chord DIM switch — small vertical pedal-style toggle beneath the letter.
     Lever UP (housing lit in the chord colour) = full; flip DOWN (housing dark) = dimmed. */
  .fretboard-chord-indicator .ci-mute {
    width: 17px; height: 27px; border-radius: 9px; padding: 3px 0;
    border: 1px solid rgba(0,0,0,.55);
    background: linear-gradient(180deg,
       color-mix(in srgb, var(--cc) 48%, #2A231F),
       color-mix(in srgb, var(--cc) 24%, #15110f));
    box-shadow: inset 0 1px 1.5px rgba(255,255,255,.18),
                inset 0 -3px 5px rgba(0,0,0,.45),
                0 1px 2px rgba(0,0,0,.4);
    display: flex; flex-direction: column; align-items: center; cursor: pointer;
    transition: background .16s;
    -webkit-tap-highlight-color: transparent;
  }
  .fretboard-chord-indicator .ci-mute .knob {
    width: 11px; height: 11px; border-radius: 4px;
    background: linear-gradient(180deg, #f3ecde, #b9ac99);
    box-shadow: 0 1px 2px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.5);
    margin-bottom: auto;   /* lever UP = full / lit */
    transition: margin .18s cubic-bezier(.34,1.45,.5,1);
  }
  .fretboard-chord-indicator .ci-mute.muted {
    background: linear-gradient(180deg, #2A231F, #120f0d);
    box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  }
  .fretboard-chord-indicator .ci-mute.muted .knob {
    margin-bottom: 0; margin-top: auto;   /* lever DOWN = dimmed */
    background: linear-gradient(180deg, #9b9082, #5f5446);
  }
  /* "Dim others" — utility toggle styled to match the pedal switches */
  .dim-all-btn {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    background: transparent; border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill); padding: 4px 12px 4px 5px; cursor: pointer;
    color: var(--text-muted); font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
    transition: border-color .15s, color .15s;
  }
  .dim-all-btn:hover { border-color: var(--border-strong); color: var(--text-secondary); }
  .dim-all-btn.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
  .dim-all-sw {
    width: 15px; height: 22px; border-radius: 7px; padding: 2px 0; flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.55);
    background: linear-gradient(180deg, #3a322c, #15110f);
    box-shadow: inset 0 1px 1.5px rgba(255,255,255,.14), inset 0 -2px 4px rgba(0,0,0,.45);
    display: flex; flex-direction: column; align-items: center;
  }
  .dim-all-sw .knob {
    width: 9px; height: 9px; border-radius: 3.5px;
    background: linear-gradient(180deg, #9b9082, #5f5446);
    box-shadow: 0 1px 2px rgba(0,0,0,.5);
    margin-bottom: auto;
    transition: margin .18s cubic-bezier(.34,1.45,.5,1);
  }
  .dim-all-btn.on .dim-all-sw .knob {
    margin-bottom: 0; margin-top: auto;
    background: linear-gradient(180deg, #f3ecde, #b9ac99);
  }
  /* chord letters + their dimmers + the Group Dim switch, kept together */
  .chord-dim-cluster { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
  .chord-dim-divider { width: 1px; align-self: stretch; min-height: 30px; background: var(--border-subtle); }
  /* Finish selector beneath the fretboard */
  .fretboard-finish-bar {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 8px;
  }
  .ffb-label {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted);
  }
  .ffb-seg {
    display: inline-flex; border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill); overflow: hidden; background: rgba(0,0,0,0.18);
  }
  .ffb-seg button {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-family: var(--font-mono); font-size: 10px;
    font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 5px 16px; transition: background .15s, color .15s;
  }
  .ffb-seg button + button { border-left: 1px solid var(--border-subtle); }
  .ffb-seg button:hover:not(.on) { color: var(--text-secondary); }
  .ffb-seg button.on {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--text-primary);
  }
  /* Paper tint picker — a small round swatch beside the finish seg; only
     rendered while the Paper finish is active (renderFretboard toggles it). */
  .paper-color-pick {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 18px; height: 18px; padding: 0;
    border: 1.5px solid var(--border-strong, #5a4a3c);
    border-radius: 50%; background: none; cursor: pointer;
    transition: transform 150ms;
  }
  .paper-color-pick:hover { transform: scale(1.12); }
  .paper-color-pick::-webkit-color-swatch-wrapper { padding: 0; }
  .paper-color-pick::-webkit-color-swatch { border: none; border-radius: 50%; }
  .paper-color-pick::-moz-color-swatch { border: none; border-radius: 50%; }
  .fretboard-chord-indicator .ci-chord {
    font: inherit; color: inherit; line-height: 1;
    background: transparent; border: 1.5px solid transparent;
    border-radius: 8px; padding: 3px 9px; cursor: pointer;
    transition: background .14s, border-color .14s;
  }
  .fretboard-chord-indicator .ci-chord:hover {
    background: color-mix(in srgb, currentColor 12%, transparent);
  }
  .fretboard-chord-indicator .ci-roman {
    font-size: 0.92em;
    font-weight: 700;
    opacity: 0.82;
    margin-left: 5px;
    letter-spacing: 0.01em;
    vertical-align: 0;
  }
  /* chord names are never case-transformed: "Gm" must not read "GM" */
  .fretboard-chord-indicator .ci-chord, .fretboard-chord-indicator .ci-roman { text-transform: none; }
  .fretboard-chord-indicator .ci-chord.focused {
    border-color: currentColor;
    background: color-mix(in srgb, currentColor 16%, transparent);
  }
  .fretboard-chord-indicator .ci-dash {
    color: #ffffff;
    margin: 0 7px;
    font-weight: 600;
    align-self: flex-start;
    padding-top: 3px;
  }
  /* Two fixed rows (Robert 2026-08-27: "buttons in the same place, not moving"):
     row 1 = the always-there mode buttons, row 2 = contextual options for
     whatever is on. Hidden options contribute nothing, so the ctx row
     collapses to zero height when everything is off. */
  .fretboard-dock-head-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    flex: 1 1 0;
  }
  .fdh-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; min-height: 29px; }
  /* chord-ref identity chip floats BELOW the row, over the board's top air —
     it never takes layout space, so nothing moves when it appears. */
  .fdh-chip { position: absolute; right: 0; top: calc(100% + 3px); white-space: nowrap; pointer-events: none; }
  .fdh-cref-opts {
    position: absolute; right: 0; top: calc(100% + 3px); z-index: 5;
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
  }
  .fdh-cref-opts .band-select { height: 25px; padding-top: 0; padding-bottom: 0; }
  .fdh-cref-opts #chordRefChip { margin-right: 4px; pointer-events: none; text-transform: none; }
  /* Dim cycle (2026-10-04): fixed width so 100% → 75% never shifts the strip */
  .fdh-cref-opts .cref-dim-btn { min-width: 82px; height: 25px; padding: 0 10px; font-variant-numeric: tabular-nums; }
  /* Bug 2026-09-30 ("none of the chord-ref controls work"): .amp-tex > * gives
     BOTH the dock head and .fb-scroll z-index 1, and .fb-scroll comes later in
     the DOM, so the board's SVG sat on top of the absolutely-positioned strip
     and swallowed every click. Lift the head (and everything that floats out
     of it) above the board. */
  .fretboard-dock.amp-tex > .fretboard-dock-head { z-index: 3; }
  /* While Chord ref is on, reserve the strip's height under the tool row so it
     never covers the board's top air — that's where the form tags + span line
     live. */
  .fretboard-dock-head.cref-on { margin-bottom: 32px; }
  /* Narrower windows: the strip would overrun the header, so it drops into
     the flow as its own wrapped row (the phone toolbar already stacks). */
  @media (max-width: 1024px) {
    .fdh-cref-opts { position: static; flex-wrap: wrap; justify-content: flex-start; margin-top: 6px; white-space: normal; }
    .fretboard-dock-head.cref-on { margin-bottom: 12px; }   /* strip is in the flow here */
    .fdh-cref-opts:not(:has(> :not([style*="display: none"]))) { display: none; }
  }
  /* Position band cluster: button + position picker + steppers read as ONE control. */
  .fdh-group { display: inline-flex; align-items: center; gap: 6px; }
  .fdh-lbl {
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
    margin-right: -4px;
  }
  /* one consistent control height across the row */
  .fdh-row .dock-toggle, .fdh-row .band-select, .fdh-row .ffb-seg button, .fdh-row .step-btn {
    height: 27px; box-sizing: border-box; display: inline-flex; align-items: center;
  }
  .fdh-row .band-select { padding-top: 0; padding-bottom: 0; }
  /* the key readout keeps its natural width; the button rows get the rest,
     so the mode buttons fit on ONE stable line wherever possible. */
  #fretboardContext { flex: 0 0 auto; }
  .fretboard-context {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.1em; color: var(--text-muted);
  }
  .fretboard-context strong { color: var(--text-primary); font-weight: 600; }
  /* Chord-ref chip when the picked form/quality combo has no honest grip —
     the chip explains instead of the board going silently empty. */
  .fretboard-context.cref-warn { color: var(--accent, #E8C36B); letter-spacing: 0.04em; }

  .dock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-transform: uppercase;
  }
  .dock-toggle:hover {
    color: var(--text-secondary);
    border-color: var(--border-strong);
  }
  .dock-toggle.on {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-inverse);
  }
  /* "not applicable right now" — e.g. Position band with no scale card active */
  .dock-toggle.na { opacity: 0.45; }
  .band-select {
    appearance: none;
    background: var(--bg-warm);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
  }
  /* Row 1 of the fretboard dock is documented as never moving when a tool is
     toggled (see .fdh-row-main in index.html). A revealed .band-select was 2px
     taller than the .dock-toggle beside it — 11px/6px vs 10px/5px — so turning
     Chord ref on grew the row and nudged the board down (Gate-6 pre-pass,
     2026-09-01). Pin both to one height so the row cannot change. */
  .fdh-row-main .dock-toggle,
  .fdh-row-main .band-select,
  .fdh-row-main .step-btn,
  .fdh-row-main .step-pair {
    height: 28px;
    box-sizing: border-box;
    padding-top: 0;
    padding-bottom: 0;
  }
  .fdh-row-main .step-pair { align-items: center; }
  .fdh-row-main .band-select { line-height: 26px; }

  .band-select:hover { border-color: var(--border-strong); }
  .band-select:focus { outline: none; border-color: var(--accent-primary); }

  /* Retain toggle in the Key Center bar — same look as dock-toggle */
  .key-retain-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-transform: uppercase;
  }
  .key-retain-btn:hover {
    color: var(--text-secondary);
    border-color: var(--border-strong);
  }
  .key-retain-btn.on {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-inverse);
  }

  /* Scroll the board horizontally inside its dock instead of forcing the whole
     page to scroll. Keeps fret/note labels at a legible size on mobile (a
     shrink-to-fit board renders the labels at ~3px). */
  .fb-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .fret-win-bar { display: none; align-items: center; gap: 8px; padding: 0 12px 8px; }
  /* Per-card collapse (Robert 2026-08-12): the ▸/▾ chevron folds one card to
     its header line — big win on phones where three open cards bury the board */
  .cc-fold { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 14px; padding: 4px 6px; line-height: 1; }
  @media (max-width: 740px) { .cc-fold { display: inline-block; } }
  .chord-card.card-folded > *:not(.cc-head) { display: none; }
  .chord-card.card-folded { padding-bottom: 6px; }

  /* ---- Edit mode on a phone (Robert 2026-11-21) ----
     Rows right under the board, one job to a row. First, over a rule: undo,
     redo, Clear all, Help and Done, so they are on the screen with the board
     whatever the rows below run to. Then, each with its name above it:
     Tools · Lines and shapes · Color · Note shape · Stroke · Selection.
     Every row runs the whole width in 44px buttons, so nothing scrolls
     sideways and nothing sits at the bottom edge of the screen, where iPhone
     Safari's own toolbar came up over the old dock. The first pass that day had two rows
     only ("very minimalistic"); he liked the look and asked for the rest
     "in an organized row… each row grouped according to its function".
     Still for a computer: Sets, Root, Capture, Export, Settings, the Guitar
     Toolbag (a floating panel), Spot and Darken. Press and hold a note to
     take it off (holdErase in js/13-map-edit.js). The Text tool hands over
     to Select after each label, so a finished label can be dragged. */
  .meb-more-btn { display: none; }
  @media (min-width: 741px) { #mapEditBar .meb-h-phone { display: none; } }
  @media (max-width: 740px) {
    #mapEditBar.map-edit-bar {
      display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px 5px;
      margin: 10px 0 0; padding: 0; border: none; border-radius: 0; background: none;
    }
    #mapEditBar :is(.meb-actions, .meb-history) { display: contents; }
    #mapEditBar :is(.meb-spacer, .meb-sets, .meb-rootgrp, .meb-internal, #mebToolbag, #mebMore, .meb-kbd, #mebHex, .meb-h-sub,
      .meb-actions > :not(#mebClear), [data-tool="spotlight"], [data-tool="darken"]) { display: none; }
    /* a row: its name, then its buttons across the whole width */
    #mapEditBar.map-edit-bar :is(.meb-tools, .meb-swatches, .meb-shapes, .meb-thick, .meb-selgrp) {
      display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px 5px;
      flex: 0 0 100% !important; max-width: none; min-width: 0; margin-top: 12px;
    }
    #mapEditBar.map-edit-bar .meb-tools { order: 10; margin-top: 0; }
    #mapEditBar.map-edit-bar .meb-swatches { order: 20; }
    #mapEditBar.map-edit-bar .meb-shapes { order: 30; }
    #mapEditBar.map-edit-bar .meb-thick { order: 40; }
    #mapEditBar.map-edit-bar .meb-selgrp { order: 50; }
    html body #mapEditBar.map-edit-bar .meb-h {
      display: block; flex: 0 0 100%; margin: 0;
      font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: #B9AB9A;
    }
    html body #mapEditBar.map-edit-bar .meb-history > .meb-h { display: none; }
    #mapEditBar.map-edit-bar :is(.meb-tool, .meb-btn) { min-width: 0; width: auto; height: 44px; padding: 0 6px; justify-content: center; }
    #mapEditBar.map-edit-bar .meb-tool { flex: 1 1 0; }
    #mapEditBar [data-tool="add"] { order: 1; }
    #mapEditBar [data-tool="select"] { order: 2; }
    #mapEditBar [data-tool="pen"] { order: 3; }
    #mapEditBar [data-tool="text"] { order: 4; }
    #mapEditBar [data-tool="eraser"] { order: 5; }
    #mapEditBar.map-edit-bar .meb-h-phone { order: 6; margin-top: 12px; }
    #mapEditBar [data-tool="line"] { order: 7; }
    #mapEditBar [data-tool="arrow"] { order: 8; }
    #mapEditBar [data-tool="ellipse"] { order: 9; }
    #mapEditBar [data-tool="box"] { order: 10; }
    /* Color: nine chips and the picker for any other color. The hex box is for a keyboard. */
    #mapEditBar.map-edit-bar :is(.meb-sw, .meb-custom) { flex: 1 1 0; min-width: 0; width: auto; height: 40px; border-radius: 9px; box-sizing: border-box; }
    #mapEditBar.map-edit-bar .meb-custom::-webkit-color-swatch { border-radius: 4px; }
    #mapEditBar.map-edit-bar :is(.meb-sw, .meb-custom).on { transform: none; border-color: #fff; box-shadow: 0 0 0 2px #1A1614, 0 0 0 4px #E8C36B; }
    /* Note shape and Stroke */
    #mapEditBar.map-edit-bar :is(.meb-shape, .meb-w, .meb-fill) { flex: 1 1 0; min-width: 0; width: auto; height: 44px; }
    #mapEditBar.map-edit-bar .meb-shape { font-size: 18px; }
    #mapEditBar.map-edit-bar .meb-fill { font-size: 13px; padding: 0 4px; justify-content: center; text-align: center; }
    #mapEditBar.map-edit-bar .meb-w span { width: 28px; }
    #mapEditBar.map-edit-bar .meb-dash { font-size: 20px; }
    /* Selection: what is picked, then what can be done to it; it wraps to a second line */
    #mapEditBar.map-edit-bar .meb-sel {
      flex: 1 1 100%; height: auto; min-height: 44px; flex-wrap: wrap; align-items: center; gap: 6px;
      padding: 5px 8px; box-sizing: border-box; overflow: visible;
    }
    #mapEditBar.map-edit-bar .meb-sel .meb-mini { height: 34px; padding: 0 11px; font-size: 13px; }
    #mapEditBar.map-edit-bar .meb-sel > .meb-seltag { flex: 1 1 100%; font-size: 13px; }
    #mapEditBar.map-edit-bar .meb-sel > .meb-seltag.meb-keep { flex: 0 0 auto; }
    #mapEditBar.map-edit-bar .meb-sel .meb-range { flex: 1 1 0; min-width: 0; height: 34px; }
    #mapEditBar.map-edit-bar .meb-bgs { flex-wrap: wrap; gap: 6px; }
    #mapEditBar.map-edit-bar .meb-bg { width: 28px; height: 28px; }
    /* the first row, over a rule: undo, redo, Clear all, Help, Done */
    #mapEditBar.map-edit-bar :is(#mebUndo, #mebRedo) { order: 1; flex: 0 0 44px; }
    #mapEditBar.map-edit-bar #mebRedo { order: 2; }
    #mapEditBar.map-edit-bar #mebClear { order: 3; flex: 0 0 auto; padding: 0 10px; }
    /* Help keeps its words for a screen reader and shows "?" (css/help.css gives it its tap area) */
    #mapEditBar.map-edit-bar #mebHelp { order: 4; flex: 0 0 44px; font-size: 0; }
    #mapEditBar #mebHelp::before { content: '?'; font: 700 16px Mulish, sans-serif; }
    #mapEditBar.map-edit-bar #mebExit { order: 5; flex: 0 0 auto; min-width: 84px; margin-left: auto; }
    #mapEditBar.map-edit-bar::before { content: ''; order: 6; flex: 0 0 100%; height: 1px; margin: 4px 0; background: rgba(255, 255, 255, .12); }
  }
  /* the narrowest phones (320 wide): the rows take the dock's side room, and the colors go five to a line */
  @media (max-width: 350px) {
    #mapEditBar.map-edit-bar { gap: 6px 4px; margin: 10px -16px 0; }
    #mapEditBar.map-edit-bar .meb-tool { padding: 0 2px; }
    #mapEditBar.map-edit-bar :is(.meb-sw, .meb-custom) { flex: 1 1 calc(20% - 5px); }
    #mapEditBar.map-edit-bar #mebExit { min-width: 64px; }
    #mapEditBar.map-edit-bar #mebClear { padding: 0 6px; }
    .meb-textpop { left: 8px !important; right: 8px; width: auto; }   /* the Text tool's 300px card ran 2px off the left */
  }

  /* ---- Mobile map cleanup, wave 1 (Robert 2026-08-10) ---- */
  #mapToolsBtn { display: none; }
  @media (max-width: 740px) {
    .fretboard-finish-bar { flex-wrap: wrap; row-gap: 6px; }
    #chordSlots { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  }
  /* R1 (verification pass, approved 2026-08-14): the 741–1100px band got the
     desktop dock-head it can't fit — CHORD REF and friends ran off the right
     edge. The ⚙ Tools collapse now covers the whole band, and the board's
     horizontal scrollbar stays visible so "more neck to the right" reads as
     scrollable instead of cut off. */
  @media (max-width: 1080px) {
    .fretboard-finish-bar { flex-wrap: wrap; row-gap: 6px; }
    #mapToolsBtn { display: inline-flex; align-items: center; }
    .fretboard-dock-head-right { display: none; }
    body.map-tools-open .fretboard-dock-head-right {
      display: flex; flex-direction: column; align-items: stretch; gap: 8px;
      flex-basis: 100%; padding: 8px 0 4px;
    }
    body.map-tools-open .fretboard-dock-head-right > * { justify-content: flex-start; }
  }
  @media (max-width: 1100px) and (min-width: 741px) {
    .fb-scroll { scrollbar-width: thin; }
    .fb-scroll::-webkit-scrollbar { height: 8px; }
    .fb-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
    .fb-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }
  }
  @media (max-width: 740px) {
    /* Presenter is a desktop/stream feature — off the phone bar (Robert 2026-08-12).
       The old `+ .ffb-label` hid the NOTES label after the seg and left the
       "Presenter" caption orphaned (Robert saw it 2026-08-13) — :has() hides
       the caption BEFORE the seg instead. */
    #presenterSeg, #presenterSizeSeg, .ffb-label:has(+ #presenterSeg) { display: none; }
    /* While Edit mode is open, EVERYTHING above and below the board stands
       down — key bar, chord cards, dock head (Key/chords/Focus/Tools), finish
       rows, fret-window bar. Edit = the board + the edit dock, nothing else
       (Robert 2026-08-13: "I can't see the fretboard"). The board is full-neck
       'All' during edit (set in JS), so the paging bar has nothing to do. */
    body:has(#mapEditBar:not([hidden])) :is(.fretboard-finish-bar,
      .fretboard-dock-head, #chordSlots, .fret-win-bar, .key-bar,
      .brand-header, .tabs, .preset-explain) { display: none; }
    /* Edit mode is ANCHORED (Robert 2026-08-14: "jumpy… should be solid"):
       the page can't pan in any direction — the board's own strip is the
       only thing that scrolls, left/right. */
    /* (2026-11-21) The page lock that stood here (overflow: hidden; height: 100dvh) is gone. On a real
       iPhone it froze the page wherever it had been scrolled to when Edit mode opened, with the top of
       the board under Safari's address bar and no way to bring it back. The page in Edit mode is now the
       board and two short rows, so there is little to scroll; js/13 toggle() puts it at the top. */
    /* Dock head: left-align + WRAP inside the viewport — the chord letters +
       "Focus one chord" row was overflowing and skewing the page width */
    .fretboard-dock-head { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
    #fretboardContext { flex: 0 1 auto; }
    .chord-dim-cluster { flex-wrap: wrap; min-width: 0; max-width: 100%; row-gap: 6px; }
    .fretboard-chord-indicator { flex-wrap: wrap; white-space: normal; }
    .chord-dim-divider { display: none; }
  }
  @media (pointer: coarse) {
    /* touch targets: nothing tappable under 36px tall */
    .dock-toggle, .ffb-seg button, .step-btn, .band-select, .dim-all-btn { min-height: 36px; }
    .plib-item { min-height: 44px; }
    /* drawing on a touch screen: the board must not pan under the pen — but
       ONLY while a drawing tool is armed; Add/Select keep normal panning
       (Robert 2026-08-12: "once in Edit mode I can no longer move the board") */
    /* Select LOCKS too (Robert 2026-08-14: finger-drag = marquee multi-select,
       not panning). ＋ Note is the one pannable tool — swipe scrolls the neck,
       tap adds a note. */
    svg.fretboard.map-editing:not([data-tool="add"]) { touch-action: none; }
    /* press and hold takes a note off: no iPhone copy bubble over the board */
    svg.fretboard.map-editing { -webkit-touch-callout: none; }
    .fb-scroll:has(> .map-editing:not([data-tool="add"])) { overflow-x: hidden; }
  }
  @media (max-width: 740px) {
    .fret-win-bar { display: flex; }
    body.fret-windowed svg.fretboard { min-width: 0; }
  }
  /* On a narrow phone the Frets row did not fit: the button group shrank and its
     clipped edge hid Full (the Editor, 2026-11-20, at 375 wide). The buttons now
     keep their size with tighter sides, and the fret range ("8–12") sits under
     the word Frets, so the row is one fixed height whether a range shows or not. */
  @media (max-width: 480px) {
    .fret-win-bar { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto;
      justify-content: start; align-items: center; column-gap: 8px; padding-left: 8px; padding-right: 8px; }
    .fret-win-bar > .ffb-label:first-child { grid-area: 1 / 1; align-self: end; }
    .fret-win-bar > #fretWinLabel { grid-area: 2 / 1; align-self: start; letter-spacing: .04em; }
    .fret-win-bar:has(> #fretWinLabel:empty) > .ffb-label:first-child { grid-row: 1 / 3; align-self: center; }
    .fret-win-bar > #fretWinLabel:empty { display: none; }
    .fret-win-bar > .ffb-seg { grid-area: 1 / 2 / 3 / 3; }
    .fret-win-bar .ffb-seg button { padding-left: 7px; padding-right: 7px; min-width: 36px; }
  }

  /* ==== BOARD DOCK v3 (spec §7): three fixed rows above the board ====
     C1 On the board (key · chord pills + labelled switches · Focus one chord ‖
     Note labels · Edit mode), C2 Board tools, C3 Options shelf (fixed 40px).
     Toggling any tool never widens, wraps or grows a row. */
  .fretboard-dock-head { display: block; margin-bottom: 12px; min-height: 0; }
  .fretboard-dock-head.cref-on { margin-bottom: 12px; }
  .fdh-h {
    display: block; font: 600 10.5px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
    color: color-mix(in srgb, var(--accent-primary) 45%, var(--text-muted));
  }
  .fdh-row-board { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; min-height: 0; flex-wrap: nowrap; }
  .fdh-sec { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
  .fdh-sec-body { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
  .fdh-onboard .fretboard-context {
    height: 34px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--accent-primary) 55%, transparent); border-radius: 8px;
    font: 600 11.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-primary);
    white-space: nowrap;
  }
  .fdh-onboard .fretboard-context strong { color: inherit; font-weight: 600; }
  .chord-dim-cluster { align-items: flex-start; gap: 12px; }
  .chord-dim-divider { width: 1px; align-self: stretch; min-height: 50px; background: var(--border-subtle); }
  .fretboard-chord-indicator { align-items: flex-start; gap: 10px; font-size: 20px; }
  .fretboard-chord-indicator .ci-unit { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
  .fretboard-chord-indicator .ci-tick { width: 1px; height: 26px; margin-top: 4px; background: var(--border-subtle); flex: none; }
  .fretboard-chord-indicator .ci-chord {
    display: inline-flex; align-items: center; height: 34px; box-sizing: border-box; padding: 0 10px;
    font: 700 20px var(--font-display); letter-spacing: 0; line-height: 1; font-feature-settings: "kern";
    border: 1.5px solid transparent; border-radius: 8px; background: transparent; white-space: nowrap;
  }
  .fretboard-chord-indicator .ci-chord:hover { background: color-mix(in srgb, var(--ci-fill) 14%, transparent); }
  .fretboard-chord-indicator .ci-roman { font-size: 13.5px; font-weight: 700; opacity: .82; margin-left: 5px; }
  .fretboard-chord-indicator .ci-chord.focused {
    background: var(--ci-fill); color: var(--ci-ink) !important; border-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
  }
  .fretboard-chord-indicator .ci-disc { width: 10px; height: 10px; border-radius: 50%; background: var(--ci-fill); box-shadow: 0 0 0 1px rgba(255,255,255,.35); margin-right: 7px; flex: none; }
  .fretboard-chord-indicator .ci-shape { margin-right: 6px; flex: none; }
  .fretboard-chord-indicator .ci-off .ci-chord:not(.focused) { opacity: .5; }
  .ci-sw {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 2px; cursor: pointer;
    background: none; border: none; font: 700 12px var(--font-ui); color: var(--ink);
  }
  .ci-track { position: relative; width: 34px; height: 20px; box-sizing: border-box; border-radius: 999px; flex: none;
    background: var(--cc); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); transition: background .15s; }
  .ci-track .knob { position: absolute; top: 3px; left: 17px; width: 14px; height: 14px; border-radius: 50%; background: var(--cc-ink); transition: left .18s cubic-bezier(.3,1.3,.5,1); }
  .ci-sw:not(.on) { color: var(--ink-dim); }
  .ci-sw:not(.on) .ci-track { background: var(--surface-3); box-shadow: none; border: 1.5px solid var(--border-strong); }
  .ci-sw:not(.on) .ci-track .knob { top: 1.5px; left: 1.5px; background: var(--ink-faint); }
  .ci-sw:not(.on):hover .ci-track { border-color: var(--ink-faint); }
  .ci-sw:not(.on):hover { color: var(--ink); }
  .ci-sw:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; border-radius: 6px; }
  /* Focus one chord — a labelled switch (gold, it names no chord) */
  .dim-all-btn {
    height: 34px; box-sizing: border-box; padding: 0 6px; gap: 9px; border: none; background: transparent;
    font: 600 13px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-dim);
  }
  .dim-all-btn:hover { color: var(--ink); }
  .dim-all-btn.on { color: var(--ink); }
  .dim-all-sw { position: relative; width: 36px; height: 20px; border-radius: 999px; padding: 0; flex: none; box-sizing: border-box; display: block;
    background: var(--surface-3); border: 1.5px solid var(--border-strong); box-shadow: none; }
  .dim-all-sw .knob { position: absolute; top: 1.5px; left: 1.5px; width: 14px; height: 14px; border-radius: 50%; margin: 0 !important; background: var(--ink-faint); box-shadow: none; transition: left .18s cubic-bezier(.3,1.3,.5,1); }
  .dim-all-btn.on .dim-all-sw { background: var(--accent-primary); border-color: var(--accent-primary); }
  .dim-all-btn.on .dim-all-sw .knob { left: 17px; background: var(--text-inverse); }
  /* right group: Note labels + Edit mode */
  .fretboard-dock-head-right { flex: 0 0 auto; flex-direction: row; align-items: flex-end; gap: 14px; }
  .fdh-seg { height: 34px; box-sizing: border-box; }
  .fdh-seg button { height: 32px; padding: 0 16px; }
  #editModeBtn { height: 34px; }
  /* C2 — board tools */
  .fdh-row-tools { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: nowrap; justify-content: flex-start; min-height: 32px; }
  .fdh-h-inline { margin-right: 8px; }
  /* Neck menu (Auto · 12 · 15 · 17 · 21) — rides the right end of the board-tools row;
     one select, the same height as the dock toggles so the row keeps its 32px */
  .fdh-neck { display: inline-flex; align-items: center; margin-left: auto; flex: 0 0 auto; }
  .fdh-neck .neck-select { min-width: 104px; }
  .dock-toggle {
    height: 32px; box-sizing: border-box; padding: 0 14px 0 12px; gap: 7px;
    font: 600 13px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--ink-dim); white-space: nowrap;
  }
  .dock-toggle:hover:not(:disabled) { color: var(--ink); border-color: var(--border-strong); }
  .dock-toggle:disabled, .dock-toggle.na { opacity: .38; cursor: not-allowed; }
  .dock-toggle.on { color: var(--text-inverse); }
  /* C3 — options shelf: fixed height, always present */
  .fdh-shelf {
    height: 40px; box-sizing: border-box; margin-top: 10px; display: flex; align-items: center; gap: 0;
    padding: 0 6px; overflow: hidden; white-space: nowrap;
    background: rgba(0,0,0,.18); border: 1px solid var(--rule); border-radius: 10px;
  }
  .shelf-hint { display: none; padding: 0 8px; font: 500 12.5px var(--font-ui); color: var(--ink-faint); }
  .fdh-shelf.is-empty .shelf-hint { display: inline; }
  .shelf-grp { display: none; align-items: center; gap: 8px; padding: 0 12px; height: 28px; }
  .fdh-shelf.has-band .shelf-grp[data-shelf="band"],
  .fdh-shelf.has-mask .shelf-grp[data-shelf="mask"],
  .fdh-shelf.has-cref .shelf-grp[data-shelf="cref"] { display: inline-flex; }
  .shelf-grp + .shelf-grp { border-left: 1px solid var(--rule); }
  .fdh-shelf .fdh-h { margin-right: 2px; }
  .fdh-shelf .fdh-cref-opts { position: static; z-index: auto; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
  .fdh-shelf #chordRefChip { margin-left: auto; font: 600 11.5px var(--font-mono); letter-spacing: .02em; text-transform: none;
    color: var(--cref, #FF2E9A); border: 1px solid currentColor; border-radius: 6px; padding: 3px 8px; pointer-events: none; }
  .fdh-shelf #chordRefChip.cref-warn { color: var(--accent-primary); }
  /* Form chips (round 6): Auto + C·A·G·E·D toggles, any combination. Each
     letter wears its form's neon (--fc, set per render); lit = filled. */
  .cref-forms { display: inline-flex; align-items: center; gap: 3px; }
  .cref-fchip {
    --fc: var(--accent-primary);
    height: 26px; min-width: 24px; box-sizing: border-box; padding: 0 6px; border-radius: 6px; cursor: pointer;
    border: 1.5px solid color-mix(in srgb, var(--fc) 50%, transparent); background: transparent;
    color: var(--fc); font: 700 12.5px var(--font-mono); line-height: 1;
  }
  .cref-fchip.cref-auto { font: 600 12.5px var(--font-ui); padding: 0 9px; margin-right: 3px; }
  .cref-fchip:hover:not(:disabled) { background: color-mix(in srgb, var(--fc) 16%, transparent); }
  .cref-fchip:active:not(:disabled) { transform: translateY(1px); }
  .cref-fchip.on { background: var(--fc); border-color: var(--fc); color: #120C08; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
  .cref-fchip:disabled { opacity: .35; cursor: not-allowed; }
  .cref-fchip:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
  /* All 5 forms: five lettered swatches (C·A·G·E·D), each its form's neon. */
  .cref-form-cols { display: inline-flex; align-items: center; gap: 7px; }
  .cref-fc { display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
    font: 700 11px var(--font-mono); color: var(--ink-faint); }
  .cref-fc .paper-color-pick { width: 16px; height: 16px; }
  .shelf-note { font: 500 12.5px var(--font-ui); color: var(--ink-faint); }
  .fdh-shelf.is-crowded .shelf-note { display: none; }
  /* measured shedding (syncToolShelf): decoration words first, never controls */
  .fdh-shelf.tight-1 .shelf-dec, .fdh-shelf.tight-1 .shelf-note, .fdh-shelf.tight-2 .shelf-dec2 { display: none !important; }
  .fdh-shelf.tight-1 .shelf-grp { padding: 0 9px; gap: 7px; }
  .fdh-shelf.tight-3 .shelf-grp[data-shelf="band"] .fdh-h, .fdh-shelf.tight-3 .shelf-grp[data-shelf="mask"] .fdh-h { display: none; }
  .shelf-lbl { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--font-ui); color: var(--ink-faint); }
  .fdh-shelf .band-select, .fdh-neck .neck-select {
    height: 28px; padding: 0 26px 0 10px; border-radius: 7px; font: 600 13px var(--font-ui); letter-spacing: 0; line-height: 26px;
    background-color: var(--bg-warm);
    background-image: linear-gradient(45deg, transparent 50%, var(--accent-primary) 50%), linear-gradient(135deg, var(--accent-primary) 50%, transparent 50%);
    background-position: calc(100% - 13px) 12px, calc(100% - 9px) 12px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
  }
  .fdh-shelf #bandSelect { font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; }
  .fdh-neck .neck-select { height: 30px; line-height: 28px; }   /* the Neck menu sits in the 32px tools row */
  .fdh-shelf .step-btn, .fdh-shelf .step-pair { height: 28px; }
  .shelf-btn { height: 28px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-subtle); background: transparent; color: var(--ink-dim); font: 600 12.5px var(--font-ui); cursor: pointer; }
  .shelf-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--border-strong); }
  .shelf-btn:disabled, .fdh-shelf .step-btn:disabled, .fretboard-finish-bar .step-btn:disabled { opacity: .35; cursor: not-allowed; }
  .paper-color-pick:disabled { opacity: .3; cursor: not-allowed; transform: none; }
  /* Presenter on a touch screen (a tablet): the finger moves the spotlight, so it must not slide the page.
     Set by paintPresenterSeg in js/02-map.js; a phone has no Presenter. */
  html.ifb-presenting #fretboard:not(.map-editing) { touch-action: none; }
  /* Presenter spotlight size (S · M · L) — a compact seg, keys disabled until Presenter is on */
  #presenterSizeSeg button { padding: 0 10px; min-width: 30px; }
  #presenterSizeSeg button:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
  /* C5 — board settings bar */
  .fretboard-finish-bar { gap: 10px; margin-top: 10px; flex-wrap: wrap; row-gap: 8px; }
  .ffb-label { font-size: 10px; letter-spacing: .14em; color: var(--ink-faint); }
  .ffb-seg button { font: 600 13px var(--font-ui); letter-spacing: 0; text-transform: none; padding: 0 14px; height: 30px; color: var(--ink-faint); }
  .ffb-seg button.on { color: var(--ink); font-weight: 700; }
  .ffb-sep { width: 1px; height: 18px; background: var(--border-subtle); margin: 0 4px; }
  .fretboard-finish-bar .dock-toggle { height: 30px; }
  /* Edit mode takes the settings bar's slot (spec §8) */
  body.map-editing-on .fretboard-finish-bar { display: none; }
  #mapToolsBtn { display: none; }
  /* Marker legend under the board (round 5): plain words for the rings. A
     FIXED-height row — items appear and go without moving anything. Phones
     get the short wording and may clip the tail rather than grow a line. */
  .board-legend {
    display: flex; align-items: center; justify-content: center; gap: 22px;
    height: 22px; margin-top: 6px; overflow: hidden; white-space: nowrap;
    font: 600 12.5px var(--font-ui); color: var(--ink-dim);
  }
  .board-legend .lg-item { display: inline-flex; align-items: center; gap: 7px; }
  .board-legend .lg-ico { width: 18px; height: 18px; flex: 0 0 auto; }
  .board-legend .lg-ico-wide { width: 30px; }
  .board-legend .lg-short { display: none; }
  /* Root-label switch inside the legend (round 6): "R on every chord" */
  .board-legend .lg-sw {
    display: inline-flex; align-items: center; gap: 6px; height: 20px; margin-left: 10px; padding: 0 2px;
    border: none; background: none; cursor: pointer; font: 600 12px var(--font-ui); color: var(--ink-faint);
  }
  .board-legend .lg-sw:hover, .board-legend .lg-sw.on { color: var(--ink); }
  .board-legend .lg-sw:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; border-radius: 6px; }
  .lg-sw-track { position: relative; width: 28px; height: 16px; box-sizing: border-box; border-radius: 999px; flex: none;
    background: var(--surface-3); border: 1.5px solid var(--border-strong); }
  .lg-sw-track .knob { position: absolute; top: 1.5px; left: 1.5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-faint); transition: left .18s cubic-bezier(.3,1.3,.5,1); }
  .lg-sw.on .lg-sw-track { background: var(--accent-primary); border-color: var(--accent-primary); }
  .lg-sw.on .lg-sw-track .knob { left: 13.5px; background: var(--text-inverse); }
  @media (max-width: 740px) {
    /* a phone wraps the row (2026-11-21): the clipped tail read "R on every c" on Robert's iPhone */
    .board-legend { justify-content: flex-start; flex-wrap: wrap; gap: 6px 14px; padding: 0 12px; font-size: 12px; height: auto; min-height: 22px; overflow: visible; }
    /* Position band is a computer tool (Robert 2026-11-21). One that is already on keeps its button, so it can be switched off. */
    #bandBtn:not(.on) { display: none; }
    /* Load preset pastes a long line of text: a computer job (Robert 2026-11-21) */
    #loadPresetBtn { display: none; }
    .board-legend .lg-long { display: none; }
    .board-legend .lg-short { display: inline; }
  }
  @media (max-width: 1399px) { .dock-toggle { padding: 0 11px 0 10px; } .fdh-seg button { padding: 0 13px; } }
  @media (max-width: 1080px) {
    #mapToolsBtn { display: inline-flex; align-self: flex-end; }
    .fdh-collapsible { display: none; }
    body.map-tools-open .fdh-row-tools.fdh-collapsible { display: flex; flex-wrap: wrap; }
    body.map-tools-open .fdh-shelf.fdh-collapsible { display: flex; height: auto; min-height: 40px; flex-wrap: wrap; padding: 6px; white-space: normal; }
    .fdh-row-board { flex-wrap: wrap; }
    body.map-tools-open .fretboard-dock-head-right { flex-direction: row; flex-basis: 100%; justify-content: flex-start; align-items: flex-end; }
  }
  @media (max-width: 740px) {
    .fdh-sec-body { flex-wrap: wrap; }
    .fretboard-chord-indicator { flex-wrap: wrap; }
  }

  svg.fretboard {
    display: block;
    width: 100%;
    min-width: 1100px;
    height: auto;
  }
  /* tablets and small laptops: let the whole neck fit instead of clipping
     frets 14–17 behind a sideways scroll (audit 2026-10-27); phones keep the
     1100px floor and scroll */
  @media (min-width: 700px) and (max-width: 1199px) { svg.fretboard { min-width: 0; } }
  /* 21-fret neck (Neck: Auto/21): the drawing is ~11% wider (1492 vs 1340
     units), so the sideways-scroll floor grows with it — frets keep the same
     size on a phone instead of shrinking to fit four more. */
  svg.fretboard.frets-21 { min-width: 1225px; }
  /* Shorter necks (Neck: 12 / 15): the drawing narrows (1094 / 1250 units), so the
     scroll floor shrinks in step — the frets stay the same size. */
  svg.fretboard.frets-15 { min-width: 1026px; }
  svg.fretboard.frets-12 { min-width: 898px; }

  .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-dim);
    letter-spacing: 0.05em;
  }
  .legend-item { display: flex; align-items: center; gap: 8px; }
  .legend-swatch {
    width: 16px; height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 600;
    color: white;
  }

  footer {
    margin-top: 36px;
    text-align: center;
    color: var(--ink-faint);
    font-family: var(--font-editorial);
    font-size: 13px;
    font-style: italic;
  }

/* ============================================================
   ASSESS POLISH (phase 3, step 1) — shell typography + card feel
   matched to the Map tab. Scoped to #view-assess so Practice and
   Dashboard are untouched. Inner test-interface detail comes next.
   ============================================================ */
  #view-assess .assess-landing-title,
  #view-assess .assess-overview-title,
  #view-assess .assess-cat-title,
  #view-assess .assess-cat-chip-name,
  #view-assess .assess-cat-banner-name,
  #view-assess .assess-atom-label,
  #view-assess .assess-atom-screen-title,
  #view-assess .map-title,
  #view-assess .map-cat-name,
  #view-assess .map-diag-title,
  #view-assess .auto-ready-title,
  #view-assess .auto-result-band,
  #view-assess .auto-result-score,
  #view-assess .clock-chord-name,
  #view-assess .countdown-number,
  #view-assess .walk-step-prompt,
  #view-assess .block-title {
    font-family: var(--font-display);
    font-style: normal;
    letter-spacing: -0.01em;
  }
  /* Heritage: editorial serif on reading-level titles (not numeric/score displays) */
  #view-assess .assess-landing-title,
  #view-assess .assess-overview-title,
  #view-assess .assess-cat-title,
  #view-assess .assess-atom-screen-title,
  #view-assess .auto-ready-title,
  #view-assess .map-title,
  #view-assess .map-cat-name,
  #view-assess .map-diag-title,
  #view-assess .block-title {
    font-family: var(--font-editorial);
    font-weight: 600;
    letter-spacing: 0;
  }
  #view-assess .assess-criterion-body,
  #view-assess .atom-card-detail,
  #view-assess .assess-notes-input {
    font-family: var(--font-ui);
    font-style: normal;
  }
  #view-assess .assess-landing,
  #view-assess .atom-card {
    border-radius: var(--radius-md);
  }
  #view-assess .assess-cat-chip,
  #view-assess .assess-atom-row,
  #view-assess .assess-cat-banner {
    border-radius: var(--radius-sm);
  }
  #view-assess .assess-landing,
  #view-assess .atom-card {
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  }
  #view-assess svg text { font-family: "IBM Plex Mono", monospace; }

  /* ============ Chord-Tone Targeting module (Heritage-styled) ============ */
  .ctt-wrap { width: 100%; margin: 0 auto; }
  .ctt-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 18px;
  }
  .ctt-kicker {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
  }
  .ctt-title {
    font-family: var(--font-display); font-size: 30px;
    font-style: italic; font-weight: 500; margin-bottom: 10px;
  }
  .ctt-lede { color: var(--ink-dim); font-size: 15px; line-height: 1.6; max-width: 680px; }

  /* start screen */
  .ctt-opts { display: flex; gap: 12px; margin: 22px 0 12px; flex-wrap: wrap; }
  .ctt-lenbtn {
    flex: 1; min-width: 170px; text-align: left; border: 1px solid var(--rule);
    background: var(--bg-warm); border-radius: 8px; padding: 16px 18px;
    cursor: pointer; transition: all 0.15s;
  }
  .ctt-lenbtn:hover { border-color: var(--accent); transform: translateY(-1px); }
  .ctt-lenbtn .lt { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); }
  .ctt-lenbtn .ls { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-top: 5px; letter-spacing: 0.06em; }
  .ctt-startnote { font-size: 13px; color: var(--ink-faint); margin-top: 10px; }

  /* rep screen */
  .ctt-progress {
    font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
    letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px;
  }
  .ctt-pbar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin: 6px 0 18px; }
  .ctt-pbar .pf { height: 100%; background: var(--accent); transition: width 0.2s; }
  .ctt-prompt {
    background: var(--bg-warm); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
    border-radius: 8px; padding: 16px 20px; margin-bottom: 8px;
  }
  .ctt-prompt .find { font-size: 14px; color: var(--ink-dim); }
  .ctt-prompt .target { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-top: 2px; }
  .ctt-prompt .target b { color: var(--accent); }
  .ctt-zonehint {
    font-family: var(--font-mono); font-size: 13px; color: var(--accent);
    letter-spacing: 0.08em; margin: 12px 2px 14px;
  }
  .ctt-board { width: 100%; background: rgba(0,0,0,0.18); padding: 6px; border-radius: 8px; }
  .ctt-board svg .afb-cell { transition: fill 0.1s; }
  .ctt-board svg .afb-cell:hover { fill: rgba(232,196,104,0.14); }
  .ctt-fb {
    margin-top: 16px; border: 1px solid var(--rule); border-radius: 8px;
    padding: 14px 18px; background: var(--bg-warm);
  }
  .ctt-fb .verd { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-bottom: 5px; }
  .ctt-fb .verd.ok { color: #6bb583; } .ctt-fb .verd.no { color: var(--danger); }
  .ctt-fb .meta { font-size: 14px; color: var(--ink-dim); } .ctt-fb .meta b { color: var(--ink); }
  .ctt-chip {
    display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
    padding: 2px 9px; border-radius: 20px; border: 1px solid var(--rule); margin-left: 8px; vertical-align: middle;
  }
  .ctt-controls { display: flex; gap: 12px; margin-top: 18px; }
  .b-Instant { color: #6bb583; } .b-Deliberate { color: var(--accent); }
  .b-Hunting { color: var(--accent-secondary); } .b-Lost, .b-Notyet { color: var(--danger); }

  /* results */
  .ctt-atom { text-align: center; padding: 22px 0 8px; }
  .ctt-atom .num { font-family: var(--font-display); font-weight: 700; font-size: 54px; color: var(--accent); line-height: 1; }
  .ctt-atom .cap {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--ink-faint); margin-top: 6px;
  }
  .ctt-stat { text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); margin-bottom: 6px; }
  .ctt-verdictbox {
    border: 1px solid var(--rule); border-left: 3px solid var(--accent-secondary); border-radius: 8px;
    padding: 16px 18px; margin: 16px 0; background: var(--bg-warm);
  }
  .ctt-verdictbox .t {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--accent-secondary); margin-bottom: 6px;
  }
  .ctt-verdictbox p { font-size: 15px; line-height: 1.55; }
  .ctt-sect {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent); margin: 24px 0 11px;
  }
  .ctt-bars .bar { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; font-size: 14px; }
  .ctt-bars .nm { flex: 0 0 110px; color: var(--ink-dim); }
  .ctt-bars .track { flex: 1; height: 10px; background: rgba(255,255,255,0.06); border-radius: 5px; overflow: hidden; }
  .ctt-bars .fill { height: 100%; background: linear-gradient(90deg, var(--accent-secondary), var(--accent)); border-radius: 5px; }
  .ctt-bars .pct { flex: 0 0 40px; text-align: right; font-family: var(--font-mono); color: var(--ink); }
  .ctt-heat { border-collapse: collapse; width: 100%; }
  .ctt-heat th {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-faint); font-weight: 400; padding: 6px 8px; text-align: center;
  }
  .ctt-heat th.row { text-align: left; }
  .ctt-heat td { padding: 0; }
  .ctt-heat .hc {
    height: 42px; border-radius: 6px; margin: 3px; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 14px; color: var(--ink);
  }
  .ctt-heat .rowlbl { font-size: 13px; color: var(--ink-dim); padding: 6px 8px; white-space: nowrap; }
  .ctt-logwrap { max-height: 300px; overflow: auto; border: 1px solid var(--rule); border-radius: 8px; margin-top: 6px; }
  table.ctt-log { width: 100%; border-collapse: collapse; font-size: 13px; }
  table.ctt-log th, table.ctt-log td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--rule); }
  table.ctt-log th {
    position: sticky; top: 0; background: var(--bg-warm); font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 400;
  }
  table.ctt-log td.r { text-align: right; font-family: var(--font-mono); }
  .ctt-note { font-size: 13px; color: var(--ink-faint); margin-top: 20px; font-style: italic; line-height: 1.55; }


/* ============================================================
   v1.9.0 — Slice 1 design system (assessment screens)
   ============================================================ */

/* Centered content column — nothing runs edge-to-edge */
#assessContent .assess-wrap,
#drillContent .assess-wrap { max-width: min(1360px, 96vw); margin: 0 auto; }

/* The question is a headline, not a label */
.auto-prompt-line {
  font-family: var(--font-display, 'Sora'), sans-serif;
  font-size: 30px; font-weight: 600;
  color: var(--ink);
  text-transform: none; letter-spacing: 0;
  padding: 18px 0 14px;
}
.auto-prompt-line strong { color: var(--accent); font-weight: 600; }

/* Shared answer strip — centered, large chips */
.auto-answers {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px; max-width: 640px; margin: 22px auto 8px;
}
.auto-answers.four-cols { display: flex; }
.auto-answer-btn {
  min-width: 104px; padding: 18px 0;
  font-size: 26px; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  border-radius: 14px;
  border: 1px solid rgba(245,241,232,0.16);
  background: rgba(255,255,255,0.03);
}
.auto-answer-btn:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
  background: rgba(232,195,107,0.07);
}
.auto-fretboard { background: rgba(0,0,0,0.24); padding: 10px; border-radius: 12px; }

/* Text mode: the callout is data, read under time pressure — sans */
.auto-prompt-text-pos {
  font-family: var(--font-display, 'Sora'), sans-serif;
  font-weight: 700; color: var(--ink);
}

/* Countdown: a swift, flat number — no bead, no halo */
.countdown-overlay { background: transparent; border: none; padding: 60px 40px; margin-top: 40px; }
.countdown-number {
  font-family: var(--font-display, 'Sora'), sans-serif;
  font-size: 132px; font-weight: 700;
  margin: 0 auto; line-height: 1;
  color: var(--ink);
  letter-spacing: -0.03em;
  animation: countTick 0.45s ease-out;
}
@keyframes countTick {
  0%   { transform: scale(0.82); opacity: 0; }
  45%  { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 0.92; }
}

/* Results — hero score, band word, verdict, dual gauges */
.res-score {
  font-family: var(--font-display, 'Sora'), sans-serif;
  font-size: 64px; font-weight: 700;
  color: var(--ink); line-height: 1; margin-bottom: 4px;
}
.res-bandword {
  font-family: 'IBM Plex Mono', monospace; font-size: 14px;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px;
}
.res-verdict {
  font-family: 'Mulish', sans-serif; font-size: 15px;
  color: var(--ink-dim); margin-bottom: 18px;
}
.res-gaugerow {
  display: flex; align-items: center; gap: 14px;
  max-width: 540px; margin: 12px auto;
}
.res-gaugerow .lbl {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; color: var(--ink-faint); width: 86px; text-align: right;
}
.res-gaugerow .val {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  color: var(--ink); width: 86px; text-align: left;
}
.res-bar {
  position: relative; flex: 1; height: 8px; border-radius: 5px;
  background: linear-gradient(90deg, #d65c4e 0%, #e0a23c 38%, #c9c24a 62%, #6bb583 100%);
}
.res-needle {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); border: 3px solid #1a1614;
  box-shadow: 0 0 0 2px rgba(245,241,232,0.55), 0 3px 8px rgba(0,0,0,0.5);
}
.res-tick {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: rgba(245,241,232,0.35); border-radius: 1px;
}
/* the speed ticks name themselves (audit M11) — label sits under the bar */
.res-tick span {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; white-space: nowrap;
  color: var(--ink-faint); letter-spacing: 0.04em;
}
.res-gaugerow:has(.res-tick) { margin-bottom: 26px; }
/* On a phone the bar is short and the two names would print over each other: Solid ends at its mark, Fluent starts at its mark. */
@media (max-width: 480px) {
  .res-tick:nth-of-type(1) span { transform: translateX(calc(-100% + 8px)); }
  .res-tick:nth-of-type(2) span { transform: translateX(-8px); }
}
.res-encourage {
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  color: var(--ink-dim); max-width: 460px; margin: 14px auto 4px;
}
.res-parts {
  max-width: 420px; margin: 16px auto 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px;
}
.res-parts .res-part-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 6px 4px; border-bottom: 1px dashed var(--rule);
}
.res-parts .res-part-row span:first-child { color: var(--ink-dim); }

/* Drills tab — the Practice Room home */
.drill-home { max-width: 1020px; margin: 0 auto; padding: 8px 4px 40px; }
/* big screens (Robert's 3440 ultrawide, audit M7): the Drills home fills the
   shell from 1600px up — see "Wide screens" at the end of this file */
.drill-hero {
  border: 1px solid var(--rule); border-radius: 16px; padding: 26px 28px; margin-bottom: 8px;
  background: radial-gradient(ellipse 640px 260px at 22% -40px, rgba(232,195,107,.13), transparent 62%),
              linear-gradient(180deg, #241c12, var(--bg-warm));
  box-shadow: var(--elev-2), 0 0 54px -22px rgba(232,195,107,.2);
}
.drill-hero-kicker {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.drill-hero-title {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 28px;
  line-height: 1.12; margin: 8px 0; letter-spacing: -.01em; color: var(--ink);
}
.drill-hero-sub { font-size: 16px; line-height: 1.6; color: var(--ink-dim); max-width: 82ch; margin: 0; }
.drill-hero-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-faint);
}
.drill-hero-meta b { color: var(--accent); font-weight: 600; }
.drill-hero-meta .dh-dot { opacity: .5; }
.drill-hero-meta .toggle-pill { margin-left: auto; font-size: 12px; }
/* Jump row (Robert 2026-11-22): every section of the page, one tap away. A button
   wears the same letter chip as the heading it goes to. */
.drill-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.drill-jump-btn {
  display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 6px 15px 6px 8px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--grad-surface); color: var(--ink);
  font: 600 14px/1.2 'Sora', sans-serif; text-align: left; cursor: pointer;
}
.drill-jump-btn:hover { border-color: var(--accent); }
.drill-jump-btn:focus-visible, .drill-cat-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drill-cat-name:focus { outline: none; }
/* each heading's way back to the jump row */
.drill-cat-top {
  flex: 0 0 auto; margin-left: 12px; min-height: 32px; padding: 4px 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: transparent; color: var(--ink-dim);
  font: 600 13px/1 'Mulish', sans-serif; cursor: pointer;
}
.drill-cat-top:hover { color: var(--ink); border-color: var(--accent); }
.drill-cat { margin-top: 30px; scroll-margin-top: 12px; }
.drill-cat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 4px 12px; border-left: 4px solid var(--rule);
}
.drill-cat-letter {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 13px; flex: 0 0 auto;
}
.drill-cat-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.drill-cat-count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); margin-left: auto; }
.drill-skill-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-top: 14px;
}
.drill-skill-card {
  border: 1px solid var(--rule);
  border-left: 3px solid color-mix(in srgb, var(--cat, var(--accent)) 55%, transparent);
  border-radius: 12px; padding: 16px 18px;
  background: var(--grad-surface); box-shadow: var(--elev-1);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.drill-skill-card:hover {
  transform: translateY(-1px); box-shadow: var(--elev-2);
  border-color: color-mix(in srgb, var(--cat, var(--accent)) 45%, var(--rule));
  border-left-color: var(--cat, var(--accent));
}
.drill-skill-card .dsc-id {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; color: color-mix(in srgb, var(--cat, var(--accent)) 70%, var(--ink-faint));
}
.drill-skill-card .dsc-name {
  font-family: var(--font-display, 'Sora'), sans-serif;
  font-size: 16px; font-weight: 600; color: var(--ink); margin: 4px 0 10px;
}
.drill-skill-card .dsc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drill-skill-card .dsc-actions .btn { font-size: 12px; padding: 8px 14px; }
.drill-skill-card-wide { grid-column: 1 / -1; }
.drill-skill-card .dsc-sub {
  font-size: 13px; color: var(--ink-dim); line-height: 1.5;
  margin: -6px 0 12px; max-width: 68ch;
}
.drill-skill-card-wide .drill-options { margin-bottom: 14px; }
.drill-skill-card .dsc-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap;
}
.drill-skill-card .dsc-stat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: var(--ink-faint); white-space: nowrap; padding-top: 2px;
}
.drill-skill-card .dsc-stat b { color: var(--accent); font-weight: 600; }
.drill-skill-card .dsc-slow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px; color: var(--ink-faint);
  margin: -4px 0 12px;
}
.drill-skill-card .dsc-slow b { color: var(--accent); font-weight: 600; }

/* Wrong-answer diagnosis + slow-notes on the results screen */
.drill-diagnosis {
  text-align: center;
  font-size: 13.5px; line-height: 1.5;
  color: var(--ink-dim);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 8px;
  padding: 9px 14px;
  margin: 0 auto 10px;
  max-width: 480px;
}
.drill-slow-notes {
  margin: 18px auto 0;
  padding: 14px 18px;
  border: 1px dashed var(--rule);
  border-radius: 10px;
  max-width: 380px;
  text-align: left;
}
.drill-slow-rule { font-size: 13px; color: var(--ink-dim); margin: 2px 0 8px; line-height: 1.4; }
.drill-slow-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.drill-slow-row { font-size: 13.5px; color: var(--ink-dim); padding: 2px 0; }
.drill-slow-row b { color: var(--ink); }
.drill-slow-hint { font-size: 12px; color: var(--ink-faint); font-style: italic; margin-top: 8px; }
.drill-section-title {
  font-family: var(--font-display, 'Sora'), sans-serif;
  font-size: 18px; font-weight: 600; color: var(--ink);
  margin: 26px 0 4px;
}
.drill-section-sub {
  font-size: 13px; color: var(--ink-dim); margin-bottom: 8px;
}


/* Helper line under a question prompt — quiet, never competes with the question */
.auto-prompt-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; color: var(--ink-faint);
  margin: -6px 0 10px;
}


/* Answer chips with text labels (quality/inversion etc.) — smaller type, same strip */
.auto-answers.text-choices { max-width: 760px; }
.auto-answers.text-choices .auto-answer-btn {
  font-family: 'Mulish', sans-serif;
  font-size: 16px; font-weight: 600;
  padding: 14px 18px; min-width: 0;
}
.auto-find-done-row { text-align: center; margin-top: 14px; }


/* Key picker on keyable drill cards */
.drill-key-select {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--ink); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(245,241,232,0.18); border-radius: 6px;
  padding: 7px 8px;
}

/* Inline text button (the give-up affordance inside a helper line) */
.btn-inline {
  font: inherit; color: var(--ink-dim);
  background: none; border: none; cursor: pointer;
  text-decoration: underline dotted; padding: 0;
}
.btn-inline:hover { color: var(--accent); }


/* Note markers are visual only — taps always pass through to the cells */
.auto-fretboard svg circle, .auto-fretboard svg text { pointer-events: none; }
  /* drills pass 2026-07-19: the "N of M found" line was easy to miss */
  .auto-prompt-sub { font-size: 14px; color: var(--ink-dim); }
  .auto-prompt-sub:empty { display: none; }
  /* Notes on the Strings rebuild (drills pass 2026-07-19) */
  .drill-answers.five { display: flex; gap: 10px; max-width: 640px; }
  .drill-answers.five .drill-answer-btn { flex: 1; }
  .drill-answer-btn.kbd-sel { outline: 2px solid var(--accent); outline-offset: 2px; }
  .drill-kbd-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
  .drill-head-right { display: flex; gap: 10px; align-items: center; }
  .drill-sound-btn { background: transparent; border: 1px solid var(--rule); color: var(--ink-dim); border-radius: 999px; font-size: 11.5px; padding: 5px 12px; cursor: pointer; font-family: var(--font-body); }
  .drill-mode-split { display: flex; gap: 14px; justify-content: center; margin-top: 10px; }
  .drill-mode-cell { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 10px; padding: 9px 16px; font-size: 13.5px; color: var(--ink-dim); }
  .drill-mode-cell b { color: var(--ink); }
  .drill-slow-notes { font-family: var(--font-body); }
  .drill-slow-row { font-family: var(--font-body); font-size: 14px; color: var(--ink-dim); }
  .drill-these-btn { margin-top: 10px; }
  .dsc-slow { font-family: var(--font-body); font-size: 13px; color: var(--ink-dim); }
  .dsc-slow-btn { margin-left: 8px; padding: 4px 12px; font-size: 12px; }
  /* options framework (drills pass) */
  /* A5's custom-fret picker (2026-09-02). It was an inline-flex competing for
     space in a wrapped option row inside a narrow card: the inputs were 58px
     with 9px padding and no border-box, so the "fret" placeholder clipped to
     "fre", and "Custom range" wrapped onto two lines while A6/A7 stayed on one.
     It now takes its own full-width row and the button will not wrap. */
  .drill-range {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%;
    color: var(--ink-faint); font-size: 13px; margin-top: 2px;
  }
  .drill-range-in {
    width: 74px; box-sizing: border-box; flex: 0 0 auto;
    background: var(--bg-warm); border: 1px solid var(--rule); border-radius: 8px;
    color: var(--ink); font-family: var(--font-body); font-size: 13px; padding: 7px 9px;
  }
  .drill-range .btn { white-space: nowrap; flex: 0 0 auto; }
  .triad-ask { display: block; line-height: 1.45; }
  .triad-ask b { font-size: 1.15em; }
  .triad-ask-set { color: var(--ink-dim); font-size: 0.85em; }
  .dsc-lesson-link { background: transparent; border: 1px solid var(--rule); color: var(--ink-faint); border-radius: 999px; font-family: var(--font-body); font-size: 10.5px; padding: 2px 9px; cursor: pointer; margin-left: 8px; vertical-align: 1px; }
  .dsc-lesson-link:hover { color: var(--accent); border-color: var(--accent); }
  .auto-hint-row { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
  .auto-hint-btn { font-size: 12.5px; padding: 7px 14px; }
  .auto-hint-text { font-size: 13.5px; color: var(--accent); }
  /* ===== Dashboard v2 (2026-07-19) ===== */
  .dashv2 { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
  .dashv2-strip { display: flex; align-items: baseline; gap: 18px; font-size: 13.5px; color: var(--ink-faint); }
  .ds-flame { color: var(--accent); font-weight: 700; font-size: 15px; }
  .ds-date { margin-left: auto; }
  .dashv2-hero { background: linear-gradient(180deg, var(--surface-2), var(--panel)); border: 1px solid var(--rule); border-radius: 16px; padding: 26px 28px;
    box-shadow: 0 0 60px -20px rgba(232,195,107,.22); }
  /* journal + Neck land here (practice-journal.js) — kill their outer margins
     so the dashboard's flex gap does the spacing */
  #pj-slot { display: flex; flex-direction: column; gap: 18px; }
  #pj-slot:empty { display: none; }
  #pj-slot .pj-neck, #pj-slot .pj-dash { margin: 0; }
  .dashv2 .progress-portability { margin-top: 0; }
  .dh-k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; }
  .dashv2-hero h2 { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin: 8px 0 6px; }
  .dashv2-hero p { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 16px; max-width: 60ch; }
  .dh-go { background: var(--accent); color: var(--text-inverse); border: none; border-radius: 999px; font-family: var(--font-body); font-weight: 800; font-size: 15px; padding: 13px 26px; cursor: pointer; }
  .dh-go:hover { background: var(--accent-deep); }
  .dh-alts { margin-top: 12px; font-size: 12.5px; color: var(--ink-faint); }
  .dh-alts a { color: var(--ink-dim); text-decoration: underline; cursor: pointer; }
  .dashv2-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  @media (max-width: 800px) { .dashv2-row3 { grid-template-columns: 1fr; } }
  .dashv2-tile { background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; }
  .dt-t { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 10px; }
  .dashv2-mods { display: flex; flex-direction: column; gap: 6px; }
  .dashv2-mod { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-faint); }
  .dm-tag { width: 22px; font-family: 'IBM Plex Mono', monospace; }
  .dm-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; }
  .dm-bar i { display: block; height: 100%; border-radius: 3px; }
  .dm-n { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; }
  .dt-big { font-family: var(--font-display); font-weight: 800; font-size: 26px; }
  .dt-big span { font-size: 14px; color: var(--ink-faint); font-weight: 400; }
  .dt-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
  .dashv2-dots { display: flex; gap: 5px; margin-top: 10px; }
  .dashv2-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--rule); }
  .dashv2-dots i.on { background: var(--good, #7BBE6B); }
  /* Weak spots — the dashboard's primary tap targets: full-row buttons,
     colored by finding type with the locked degree palette */
  .dashv2-weak { background: var(--grad-surface, var(--panel)); border: 1px solid var(--border-strong, var(--rule)); border-radius: 16px; padding: 18px 20px;
    box-shadow: var(--elev-2, 0 8px 24px rgba(0,0,0,.3)), 0 0 46px -18px rgba(236,106,67,.14); }
  .dt-pri { color: var(--c1, #EC6A43); font-size: 11.5px; }
  .dashv2-wrow { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 10px; padding: 13px 15px;
    background: var(--surface-1); border: 1px solid var(--rule); border-left-width: 3px; border-radius: 12px;
    color: var(--ink); font-family: var(--font-ui); cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
  .dashv2-wrow:first-of-type { margin-top: 0; }
  .dashv2-wrow:hover { transform: translateX(2px); }
  .dashv2-wrow.acc-c1 { border-left-color: var(--c1); }
  .dashv2-wrow.acc-c1:hover { border-color: var(--c1); background: linear-gradient(90deg, rgba(236,106,67,.10), var(--surface-1) 55%); }
  .dashv2-wrow.acc-c2 { border-left-color: var(--c2); }
  .dashv2-wrow.acc-c2:hover { border-color: var(--c2); background: linear-gradient(90deg, rgba(79,160,236,.10), var(--surface-1) 55%); }
  .dashv2-wrow.acc-c3 { border-left-color: var(--c3); }
  .dashv2-wrow.acc-c3:hover { border-color: var(--c3); background: linear-gradient(90deg, rgba(232,195,107,.10), var(--surface-1) 55%); }
  .dw-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 700; }
  .acc-c1 .dw-ico { color: var(--c1); background: rgba(236,106,67,.14); }
  .acc-c2 .dw-ico { color: var(--c2); background: rgba(79,160,236,.14); }
  .acc-c3 .dw-ico { color: var(--c3); background: rgba(232,195,107,.14); }
  .dw-what { flex: 1; min-width: 0; }
  .dw-what b { font-size: 14.5px; }
  .dw-what span { display: block; font-size: 12.5px; color: var(--ink-faint); }
  .dw-fix { color: var(--accent); font-weight: 700; font-size: 13px; white-space: nowrap; }
  /* Progress — course sections + solid skills, collapsed by default so the
     road ahead never reads as never-ending; one line says what's already won */
  .dashv2-prog { background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; }
  .dp-head { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 13px 18px;
    background: transparent; border: none; color: var(--ink-dim); font-family: var(--font-ui); cursor: pointer; }
  .dp-t { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
  .dp-sum { flex: 1; font-size: 13px; color: var(--ink-dim); }
  .dp-arrow { color: var(--ink-faint); font-size: 14px; }
  .dp-head:hover .dp-t, .dp-head:hover .dp-arrow { color: var(--accent); }
  .dp-body { display: none; padding: 4px 18px 18px; }
  .dashv2-prog.open .dp-body { display: block; }
  .dp-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
  @media (max-width: 700px) { .dp-cols { grid-template-columns: 1fr; } }

  /* Steppers: root-string (chord card) + position band (dock). One matched
     side-by-side pair per control, to the right of its dropdown; stepping
     wraps at both ends so it never dead-ends (Robert 2026-08-09). */
  .anchor-step-row { display: flex; align-items: center; gap: 5px; }
  .anchor-step-row .ctrl-select { flex: 1; min-width: 0; }
  .step-pair {
    display: inline-flex; flex: none; border: 1px solid var(--border-subtle);
    border-radius: 7px; overflow: hidden; background: var(--bg-elevated);
  }
  .step-btn {
    width: 24px; height: 26px; padding: 0; border: none; background: transparent;
    color: var(--text-secondary); font-size: 10px; line-height: 1; cursor: pointer;
  }
  .step-btn + .step-btn { border-left: 1px solid var(--border-subtle); }
  .step-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.07); }
  /* Clean CSS chevrons for stepper buttons — the ▾/▴ font glyphs rendered as
     smudges at 10px (Robert 2026-08-27: "the arrows look terrible"). */
  .step-btn.chev { display: inline-flex; align-items: center; justify-content: center; font-size: 0; }
  .step-btn.chev::after {
    content: ''; width: 7px; height: 7px; box-sizing: border-box;
    border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  }
  .step-btn.chev-dn::after { transform: rotate(45deg) translate(-1px, -1px); }
  .step-btn.chev-up::after { transform: rotate(-135deg) translate(-1px, -1px); }

/* ---- State clarity pass (P0.2, 2026-08-13): keyboard focus is visible on
   every map-surface control — same gold ring the composer uses. ---- */
:is(.dock-toggle, .key-retain-btn, .dim-all-btn, .clear-btn,
    .ffb-seg button, .step-btn, .band-select,
    .meb-btn, .meb-tool, .meb-shape, .meb-sw, .meb-w, .meb-seg button,
    .meb-select, .meb-custom, .meb-hex):focus-visible {
  outline: 2px solid var(--accent-primary); outline-offset: 2px;
}

/* State sweep 2026-08-14: edit-dock buttons had no hover at all */
:is(.meb-btn, .meb-tool, .meb-shape, .meb-w, .meb-mini):hover {
  background: rgba(255, 255, 255, 0.07);
}

/* Welcome overlay joins the focus convention (P2, verification pass) */
#welcome :is(button, a):focus-visible {
  outline: 2px solid var(--accent-primary); outline-offset: 2px;
}

/* ---- Preset helper card (Robert 2026-08-23): what a Showcase board is for.
   Sits above the board; ✕ closes this one, the checkbox retires them all. ---- */
.preset-explain { position: relative; margin: 0 0 14px; padding: 13px 40px 12px 16px;
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary); border-radius: 10px; }
.preset-explain .pe-k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-primary); margin-bottom: 6px; }
.preset-explain p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); max-width: 72ch; }
.preset-explain .pe-x { position: absolute; top: 8px; right: 8px; background: none; border: none;
  color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 4px 7px; }
.preset-explain .pe-x:hover { color: var(--text-primary); }
.preset-explain .pe-off-l { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 11px; color: var(--text-muted); cursor: pointer; }
.preset-explain .pe-off-l input { accent-color: var(--accent-primary); }
.preset-explain :is(button, input):focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* Explanations toggle at the top of the preset library (Robert 2026-08-23) */
.plib-expl { display: flex; align-items: center; gap: 7px; padding: 9px 12px 7px;
  font-size: 11.5px; color: var(--text-secondary); cursor: pointer;
  border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.plib-expl input { accent-color: var(--accent-primary); }

/* Try line inside the preset helper card — the one thing to play right now */
.preset-explain .pe-try { margin-top: 7px; }
.preset-explain .pe-try span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-primary); border: 1px solid
  color-mix(in srgb, var(--accent-primary) 45%, transparent); border-radius: 5px;
  padding: 2px 6px; margin-right: 8px; vertical-align: 1px; }

  /* Locked Sets / Pro-only inspector rows (entitlement audit 2026-09-02). */
  #mebLayer .meb-locked { opacity: 0.42; }
  #mebLayer .meb-locked:hover { opacity: 0.6; }
  .cmp-insp .ichk.is-pro { opacity: 0.6; }
  .cmp-insp .ichip.is-pro { opacity: 0.75; }
  .cmp-insp .ichk .ipro, .cmp-insp .ichip .ipro {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: middle;
  }

  /* Published-lessons block on Drills (2026-09-02). Renders only when
     IFB_PUBLIC_LESSONS is non-empty; see js/08-app.js renderDrillMenu. */
  .drill-lesson-lead {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap; padding: 14px 16px; margin: 10px 0 4px;
    background: var(--grad-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
  }
  .drill-lesson-lead b { display: block; font-family: var(--font-display); font-size: 15px; }
  .drill-lesson-lead span { display: block; color: var(--text-secondary); font-size: 13.5px; margin-top: 2px; }
  /* .drill-item is space-between with three children, so without a flex:1 on
     the middle one the title strands itself in the centre with the marker and
     arrow pinned to the edges. */
  .lesson-item .di-main { flex: 1; text-align: left; }
  .lesson-item .di-main b { font-weight: 600; }
  .lesson-item .di-mk { color: var(--c2); font-family: var(--font-mono); flex: 0 0 auto; }
  .lesson-item .di-go { color: var(--text-muted); flex: 0 0 auto; }
  .lesson-item.is-done .di-mk { color: #7BBE6B; }

/* Backup reminder (js/08-app.js SAFEKEEPING) — bottom card, never covers the board's centre */
.ifb-backup-nudge {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 900;
  width: min(520px, calc(100vw - 32px)); box-sizing: border-box;
  background: var(--bg-elevated); color: var(--ink); border: 1px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 10px; font-family: var(--font-ui); font-size: 14px; line-height: 1.45;
}
.ifb-backup-nudge p { margin: 0; }
.ifb-bn-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ifb-bn-actions button { font: 600 13px var(--font-ui); border-radius: 7px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--accent); }
.ifb-bn-dl { background: var(--accent); color: #1A1614; }
.ifb-bn-later { background: transparent; color: var(--ink-dim); border-color: var(--ink-faint) !important; }
.ifb-bn-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mask is desktop/tablet only (Robert 2026-09-29) — keep in step with
   MASK_PHONE_MQ in js/02-map.js. */
@media (max-width: 740px), (pointer: coarse) and (max-height: 500px) {
  #maskBtn, #maskResetBtn { display: none !important; }
}


/* ============================================================================
   DASHBOARD v3 (2026-09-30) — layout + "Your fretboard" centrepiece.
   Markup: renderToday() in js/08-app.js; the fretboard card: IFBNeck in
   js/practice-journal.js. Hardware-skin overrides: DASHBOARD v3 block at
   the end of css/hardware.css. v2 classes still used (and styled above):
   .dashv2-strip / -hero / -weak / -wrow / -mods, .progress-portability.
   ========================================================================= */
.dashv3 { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; padding-bottom: 32px; }
.dashv3 .progress-portability { margin-top: 0; }
.dashv3 #pj-slot:empty { display: none; }
.dashv3 #pj-slot { display: flex; flex-direction: column; gap: 18px; }
.dashv3 #pj-slot .pj-dash { margin: 0; }
.dv3-top { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 18px; align-items: stretch; }
.dv3-top.solo { grid-template-columns: minmax(0, 1fr); }
.dv3-hero { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; margin: 0; }
.dv3-hero h2 { margin-top: 8px; }
.dv3-lower { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.dv3-lower:empty { display: none; }
.dv3-weak .dt-t { margin-bottom: 12px; }
/* in a one-third column the fix key drops under the finding, so the
   finding keeps a readable measure */
.dv3-weak .dashv2-wrow { flex-wrap: wrap; row-gap: 10px; align-items: flex-start; }
.dv3-weak .dw-what { flex: 1 1 calc(100% - 60px); }
.dv3-weak .dw-fix { margin-left: 48px; }

/* generic dashboard panel */
.dv3-panel { background: var(--grad-surface, var(--panel)); border: 1px solid var(--rule); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.dv3-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dv3-k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.dv3-link { background: none; border: 0; padding: 0; color: var(--accent); font-family: var(--font-ui); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.dv3-link:hover { text-decoration: underline; }
.dv3-empty { margin: 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.55; }
.dv3-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.dv3-count b { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--ink); }
.dv3-count span { font-size: 13px; color: var(--ink-faint); }
.dv3-rows { display: flex; flex-direction: column; }
.dv3-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.dv3-row:first-child { border-top: 0; padding-top: 2px; }
.dv3-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dv3-row-main b { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv3-row-main span { font-size: 12px; color: var(--ink-faint); }
.dv3-row-when { flex: none; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }

/* this week */
.dv3-week { display: flex; flex-direction: column; }
.dv3-lamps { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 16px; }
.dv3-lamp { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.dv3-lamp i { width: 16px; height: 16px; border-radius: 50%; background: var(--rule); }
.dv3-lamp.on i { background: var(--good, #7BBE6B); box-shadow: 0 0 10px -2px var(--good, #7BBE6B); }
.dv3-lamp em { font-style: normal; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }
.dv3-lamp.today em { color: var(--accent); font-weight: 700; }
.dv3-readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dv3-ro { display: flex; flex-direction: column; gap: 2px; }
.dv3-ro b { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.dv3-ro span { font-size: 11.5px; color: var(--ink-faint); }
.dv3-note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }

/* ---- Your fretboard ---- */
.dn-card {
  --st-solid: #4DBF83; --st-solid-ink: #0e2318;
  --st-getting: #E3B94A; --st-getting-ink: #2b1f06;
  --st-needs: #DC5B42; --st-needs-ink: #1c0b06;
  background: var(--grad-surface, var(--panel)); border: 1px solid var(--border-strong, var(--rule)); border-radius: 18px;
  padding: 22px 24px 20px; box-shadow: var(--elev-2, 0 8px 24px rgba(0,0,0,.3)), 0 0 60px -24px rgba(232,195,107,.18);
}
.dn-head { display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.dn-title { flex: 1 1 220px; min-width: 0; }
.dn-kick { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.dn-title h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin: 4px 0 0; color: var(--ink); }
.dn-score { display: flex; align-items: baseline; gap: 8px; }
.dn-score b { font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--st-solid); line-height: 1; }
.dn-score span { font-size: 13px; color: var(--ink-dim); }
.dn-go { background: var(--accent); color: var(--text-inverse, #1A1614); border: 0; border-radius: 999px; padding: 11px 20px;
  font-family: var(--font-ui); font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; }
.dn-go:hover { background: var(--accent-deep); }
.dn-meter { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--rule); margin-bottom: 14px; }
.dn-meter i { display: block; height: 100%; }
.dn-meter i.st-solid { background: var(--st-solid); }
.dn-meter i.st-getting { background: var(--st-getting); }
.dn-meter i.st-needs { background: var(--st-needs); }
.dn-board-wrap { position: relative; }
.dn-board { background: #1d1712; border: 1px solid var(--rule); border-radius: 12px; padding: 12px 10px 4px; }
.dn-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.dn-svg { display: block; width: 100%; height: auto; }
.dn-svg .dn-snum, .dn-svg .dn-fnum { font-family: 'IBM Plex Mono', monospace; font-size: 13px; fill: #a89a87; }
.dn-spot { cursor: pointer; outline: none; }
.dn-spot .dn-hit { fill: transparent; }
.dn-spot .dn-bead { stroke-width: 1.5; transition: stroke .12s, stroke-width .12s; }
.dn-spot .dn-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; font-weight: 700; pointer-events: none; }
.dn-spot.st-none .dn-bead { fill: rgba(22,16,12,.62); stroke: rgba(232,221,201,.26); stroke-dasharray: 2.5 2.5; }
.dn-spot.st-none .dn-lbl { fill: #a89a87; font-weight: 500; opacity: .8; }
.dn-spot.st-solid .dn-bead { fill: var(--st-solid); stroke: rgba(255,255,255,.55); }
.dn-spot.st-solid .dn-lbl { fill: var(--st-solid-ink); }
.dn-spot.st-getting .dn-bead { fill: var(--st-getting); stroke: rgba(255,255,255,.5); }
.dn-spot.st-getting .dn-lbl { fill: var(--st-getting-ink); }
.dn-spot.st-needs .dn-bead { fill: var(--st-needs); stroke: rgba(255,225,215,.7); }
.dn-spot.st-needs .dn-lbl { fill: var(--st-needs-ink); }
.dn-spot:hover .dn-bead, .dn-spot:focus-visible .dn-bead { stroke: #fff; stroke-width: 2.5; stroke-dasharray: none; }
.dn-spot.sel .dn-bead { stroke: #fff; stroke-width: 3.2; stroke-dasharray: none; }
.dn-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin-top: 14px; }
.dn-legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-dim); }
.dn-leg { display: inline-flex; align-items: center; gap: 7px; }
.dn-leg i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.dn-leg b { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink); margin-left: 2px; }
.dn-leg.st-solid i { background: var(--st-solid); }
.dn-leg.st-getting i { background: var(--st-getting); }
.dn-leg.st-needs i { background: var(--st-needs); }
.dn-leg.st-none i { background: transparent; border: 1.5px dashed rgba(232,221,201,.4); }
.dn-strings { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dn-strings::before { content: 'Strings'; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-right: 4px; }
.dn-str { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 9px; border-radius: 999px; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--rule); color: var(--ink-dim); font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; }
.dn-str:hover { border-color: var(--accent); color: var(--ink); }
.dn-str-n { font-weight: 700; }
.dn-str-c { font-size: 11.5px; color: var(--ink-faint); }
.dn-str-bar { width: 34px; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.dn-str-bar i { display: block; height: 100%; background: var(--st-solid); }
.dn-basis { margin: 14px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-dim); max-width: 110ch; }
.dn-basis b { color: var(--ink); font-weight: 700; }
.dn-tip { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 12.5px; }

/* spot popover — placed by JS beside the bead, clamped inside the board */
.dn-pop { position: absolute; z-index: 30; width: min(320px, calc(100% - 12px)); padding: 14px 16px;
  background: var(--surface-2, #342C27); border: 1px solid var(--border-strong, #5A4A41); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5); color: var(--ink); box-sizing: border-box; }
.dn-pop[hidden] { display: none; }
.dn-pop-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-dim); cursor: pointer; font-size: 11px; }
.dn-pop-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; padding-right: 30px; }
.dn-pop-h b { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.dn-pop-h span { font-size: 12.5px; color: var(--ink-faint); }
.dn-pop-st { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--ink-dim); }
.dn-pop-st i { flex: none; width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; box-sizing: border-box; }
.dn-pop-st.st-solid i { background: var(--st-solid); }
.dn-pop-st.st-getting i { background: var(--st-getting); }
.dn-pop-st.st-needs i { background: var(--st-needs); }
.dn-pop-st.st-none i { border: 1.5px dashed rgba(232,221,201,.45); }
.dn-pop-hist { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.dn-pop-hist span { font-size: 11.5px; color: var(--ink-faint); margin-right: 4px; }
.dn-h { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; }
.dn-h.quick { background: var(--st-solid); color: var(--st-solid-ink); }
.dn-h.slow { background: var(--st-getting); color: var(--st-getting-ink); }
.dn-h.miss { background: var(--st-needs); color: var(--st-needs-ink); }
.dn-h.untimed { background: var(--surface-3, #3E342E); color: var(--ink-dim); }
.dn-pop-acts { display: flex; flex-direction: column; gap: 7px; margin-top: 13px; }
.dn-pop-go, .dn-pop-alt { width: 100%; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: 13px; text-align: center; }
.dn-pop-go { background: var(--accent); color: var(--text-inverse, #1A1614); border: 0; }
.dn-pop-go:hover { background: var(--accent-deep); }
.dn-pop-alt { background: transparent; color: var(--ink-dim); border: 1px solid var(--rule); }
.dn-pop-alt:hover { color: var(--ink); border-color: var(--ink-faint); }
.dn-pop-note { margin: 0 2px 2px; font: 400 12.5px/1.45 var(--font-ui); color: var(--ink-faint); text-align: center; }
/* Name the Note: what a targeted run is weighting toward */
.drill-focus-line { margin: 4px 0 10px; font: 400 13.5px/1.5 var(--font-ui); color: var(--ink-dim); text-align: center; }
.drill-focus-line b { color: var(--accent); font-weight: 700; }

/* wide screens: more room for the board */
@media (min-width: 1700px) { .dashv3 { max-width: none; } }
/* wide screens: the Dashboard fills the shell (same edges as the header) —
   see "Wide screens" at the end of this file */
@media (max-width: 900px) {
  .dv3-top { grid-template-columns: minmax(0, 1fr); }
}
/* phones: the board keeps readable beads and scrolls sideways */
@media (max-width: 640px) {
  .dn-card { padding: 16px 12px; border-radius: 14px; }
  .dn-head { gap: 10px 14px; }
  .dn-title h2 { font-size: 20px; }
  .dn-score b { font-size: 28px; }
  .dn-go { width: 100%; text-align: center; }
  .dn-board { padding: 8px 4px 2px; }
  .dn-svg { min-width: 640px; }
  .dn-tip::before { content: 'Swipe the board sideways to see the whole neck. '; }
  .dv3-panel { padding: 16px; }
  .dv3-hero { padding: 20px 18px; }
}

.kb-switch { white-space: nowrap; }
.chord-controls-grid .ctrl-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .08em; display: block; }
@media (max-width: 740px) {
  .kb-ctrls { flex-wrap: wrap; row-gap: 8px; }
  .kb-sec, .kb-sec-diat, .fdh-sec, .fdh-onboard, .fdh-sec-body, .chord-dim-cluster, .fretboard-chord-indicator { max-width: 100%; min-width: 0; }
  .kb-sec-diat, .kb-sec-diat .diatonic-grid { width: 100%; }
  .fdh-row-board { flex-wrap: wrap; }
  .fretboard-chord-indicator { flex-wrap: wrap; row-gap: 8px; }
  .fretboard-chord-indicator .ci-tick { display: none; }
}

/* ---- Map in-app dialogs (Load preset / Clear map) — popover layer ---- */
.map-dlg {
  width: 300px; box-sizing: border-box; padding: 14px 16px;
  background: rgba(36, 29, 23, 0.98); border: 1px solid #4a3d31; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); color: var(--ink); font: 500 13px var(--font-ui);
}
.map-dlg-load { width: 360px; }
.map-dlg-t { font: 700 14px var(--font-display); margin-bottom: 6px; }
.map-dlg-b { color: var(--ink-dim); line-height: 1.45; margin-bottom: 12px; }
.map-dlg-in { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border-subtle); color: var(--ink); font: 500 12px var(--font-mono); }
.map-dlg-in:focus { outline: none; border-color: var(--accent-primary); }
.map-dlg-err { color: #F08A7C; font-weight: 600; margin-top: 8px; }
.map-dlg-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.map-dlg-btn { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-subtle); background: transparent; color: var(--ink-dim); font: 600 13px var(--font-ui); cursor: pointer; }
.map-dlg-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.map-dlg-btn.primary { background: var(--accent-primary); border-color: var(--accent-primary); color: var(--text-inverse); }
.map-dlg-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---- Shared map links (js/23-map-share.js) — "Shared map · view only" bar +
   the confirmation toast after Make a copy. Fixed at the bottom so opening a
   link never shifts the board (screen marks are placed against the board).
   Above the markup layer (z 150) and Spot dim; below popovers (9000) and the
   Pro card (12000). ---- */
.shared-bar, .shared-toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 8000;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  box-sizing: border-box; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px;
  background: var(--grad-raised); color: var(--ink); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: var(--elev-3); font: 500 13px var(--font-ui);
}
.shared-bar .sb-k { font: 700 10.5px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-inverse); background: var(--accent); border-radius: var(--radius-pill); padding: 5px 9px 4px; }
.shared-bar .sb-msg { color: var(--ink-dim); }
.shared-bar .sb-acts { display: flex; gap: 8px; }
.sb-btn { height: 32px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: transparent; color: var(--ink); font: 600 13px var(--font-ui); cursor: pointer; white-space: nowrap; }
.sb-btn:hover { background: var(--surface-2); }
.sb-btn:active { transform: translateY(1px); }
.sb-btn:focus-visible, .shared-toast .st-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shared-bar .sb-copy { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }
.shared-bar .sb-copy:hover { background: var(--accent); filter: brightness(1.07); }
.shared-bar.sb-pulse { animation: sbPulse 1.1s ease 2; }
.shared-bar.sb-pulse .sb-msg { color: var(--ink); }
@keyframes sbPulse { 0%, 100% { box-shadow: var(--elev-3); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent), var(--elev-3); } }
.shared-toast { bottom: 18px; z-index: 8100; }
.shared-toast .st-msg { color: var(--ink-dim); max-width: 520px; line-height: 1.45; }
.shared-toast .st-close { border: 0; background: none; color: var(--ink-faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.shared-toast .st-close:hover { color: var(--ink); }
body.shared-view .shared-toast { bottom: 82px; }
@media (max-width: 560px) {
  .shared-bar, .shared-toast { left: 16px; right: 16px; transform: none; max-width: none; bottom: 12px; gap: 8px; }
  .shared-bar .sb-acts { width: 100%; }
  .shared-bar .sb-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .shared-bar.sb-pulse { animation: none; } }
/* Ultrawide (audit M14): see "Wide screens" at the end of this file — the
   whole shell (header included) now grows past 1600px on big monitors. */

/* ============ Skill Check audit fixes (2026-09-30) ============ */
/* Quick Check home on the Skill Check landing */
.assess-qc-card { margin-top: 18px; }
/* a multi-part skill with some parts run: "1 of 2 parts" instead of a ✓ */
.assess-atom-partial {
  flex-shrink: 0; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px;
  color: var(--accent); letter-spacing: .04em; white-space: nowrap;
}
.assess-atom-row.partial .assess-atom-status { color: var(--accent); }
.assess-atom-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A7's clean-question rule, said once above the per-question list */
.auto-result-rule { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; margin: 0 0 8px; }
.auto-result-breakdown .rq-ok { color: #9DC487; }
.auto-result-breakdown .rq-no { color: var(--ink-faint); }
.auto-result-breakdown:has(.auto-result-rule) { max-width: 440px; }
/* runner header tools + the sound key (an SVG icon that follows the text colour) */
.auto-runner-tools { display: flex; gap: 8px; align-items: center; }
.auto-sound-btn { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.auto-sound-btn svg { width: 16px; height: 16px; display: block; }
/* Quick Check: the sub-line sits centred under the centred kicker (audit M-14) */
#welcome .wl-kicker-sub { margin-left: auto; margin-right: auto; }
#welcome .qc-step .atom-question-progress-row { justify-content: center; }
#welcome .wl-card:focus { outline: none; }
#welcome .wl-card :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Dashboard Skill Checks panel: the Quick Check row opens the snapshot */
.dv3-row.dv3-row-btn { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dv3-row.dv3-row-btn:hover .dv3-row-main span { color: var(--accent); }
.dv3-row.dv3-row-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dv3-skill-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
a.dv3-link { text-decoration: none; }
a.dv3-link:hover { text-decoration: underline; }
/* On a phone each link in the row takes a full-height tap. */
@media (max-width: 700px) { .dv3-skill-links { gap: 4px 16px; } .dv3-skill-links .dv3-link { display: inline-flex; align-items: center; min-height: 44px; } }

/* ============================================================================
   SKILL CHECK LAYOUT (2026-09-30, Robert: "too busy on the eyes … it all
   blends together"; "the Drills section … should be more of an example").
   Landing, Deep Check list and placement map now follow the Drills home:
   a faceplate hero (.drill-hero) for the title, progress and actions, then
   each category as its own panel — letter chip, name, one-line blurb, its
   own progress — and skills as quiet rows inside it (no card per row).
   Skills run DOWN then over: A1–A4 in the first column, A5 on in the next.
   The hardware skin's version lives in css/hardware.css ("SKILL CHECK
   LAYOUT"); these are the flat-skin rules both skins build on.
   ========================================================================= */
#assessContent .assess-wrap.sc-page { max-width: none; }
.sc-page .sc-hero { margin-bottom: 22px; }
.sc-hero-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px 32px; flex-wrap: wrap;
}
.sc-hero-text { flex: 1 1 420px; min-width: 0; }
.sc-hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 22px;
}
.sc-hero-actions .btn { white-space: normal; text-align: left; }
/* keys on these screens never drop below 12px (13" legibility, audit M-15) */
#view-assess .sc-page .btn { font-size: 12px; }
#view-assess .sc-page .btn.big { font-size: 13px; }
.sc-hero-actions .assess-history-note { margin: 0 0 0 6px; }
/* the one destructive action: quiet text, pushed to the far end */
.sc-quiet-btn {
  margin-left: auto; background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font: 600 13px var(--font-ui); color: var(--ink-faint);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: color .14s, text-decoration-color .14s;
}
.sc-quiet-btn:hover { color: var(--danger); text-decoration-color: currentColor; }
.sc-quiet-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* landing: three short facts instead of a paragraph box */
.sc-facts {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  font: 400 14px/1.5 var(--font-ui); color: var(--ink-dim);
}
.sc-facts li { position: relative; padding-left: 16px; }
.sc-facts li::before {
  content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); opacity: .8;
}

/* Deep Check progress meter (hero, right) */
.sc-meter { min-width: 230px; text-align: right; }
.sc-meter-num { font-family: var(--font-display); color: var(--ink-dim); }
.sc-meter-num b { font-size: 44px; font-weight: 800; line-height: 1; color: var(--accent); margin-right: 6px; }
.sc-meter-num span { font-size: 18px; font-weight: 600; }
.sc-meter-lbl {
  font: 600 12px var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 6px;
}
.sc-meter .assess-prog-bar { margin-top: 10px; }

/* panels (landing Quick Check / what it covers / CTT; map categories) */
.sc-panel, .sc-cat {
  background: var(--grad-surface, var(--panel)); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--elev-1);
}
.sc-panel { padding: 22px 24px; }
.sc-panel-kicker {
  font: 600 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.sc-panel-title {
  font: 700 21px var(--font-display); color: var(--ink); margin: 8px 0 6px; letter-spacing: -.01em;
}
.sc-panel-sub { font: 400 14px/1.6 var(--font-ui); color: var(--ink-dim); margin: 0; max-width: 70ch; }
.sc-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sc-status-line {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font: 600 12px var(--font-mono); color: var(--ink-faint);
}
.sc-status-line b { color: var(--ink-dim); font-weight: 600; }
.sc-lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: 0 0 auto; }
.sc-lamp.on { background: #5FAE7E; box-shadow: 0 0 6px rgba(95, 174, 126, .5); }
/* landing: the Deep Check hero (with what it covers on its right), the
   Quick Check beside it from 1600px, stacked below that */
.sc-landing-page { display: grid; gap: 18px; align-items: stretch; }
.sc-landing-page > .sc-hero { margin-bottom: 0; }
.sc-landing-page > .assess-qc-card { margin-top: 0; display: flex; flex-direction: column; }
@media (min-width: 1600px) {
  .sc-landing-page { grid-template-columns: minmax(0, 1fr) minmax(380px, 30%); }
  .sc-landing-page > .sc-ctt { grid-column: 1 / -1; }
  .sc-landing-page > .assess-qc-card .sc-panel-actions { margin-top: auto; padding-top: 18px; }
}
.sc-landing-hero .sc-hero-text { flex: 1 1 440px; }
.sc-cover {
  flex: 1 1 440px; max-width: 760px; padding: 16px 20px 8px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}

/* category letter chip — shared by the landing, the list and the map */
.sc-letter {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto;
  font: 700 13px var(--font-mono);
  color: var(--catc, var(--accent));
  background: color-mix(in srgb, var(--catc, var(--accent)) 16%, transparent);
}

/* landing: what the Deep Check covers */
.sc-cover-list { list-style: none; margin: 6px 0 0; padding: 0; }
.sc-cover-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.sc-cover-row:first-child { border-top: 0; }
.sc-cover-text { display: block; min-width: 0; }
.sc-cover-name { display: block; font: 600 15px var(--font-display); color: var(--ink); }
.sc-cover-blurb { display: block; font: 400 13px/1.45 var(--font-ui); color: var(--ink-faint); margin-top: 2px; }
.sc-cover-count { font: 600 12px var(--font-mono); color: var(--ink-faint); white-space: nowrap; }

/* Deep Check: one panel per category (2026-10-10, Robert: "the page looks
   busy; the sections are offset from each other; line the containers up").
   Every panel opens with the same header BAND — a lightened fill that bleeds
   to the panel's edges, one fixed height, letter + name + blurb on the left,
   the "n of m scored" bar on the right — so the headers of two panels
   side by side sit on one line. */
.sc-cat { padding: 0 22px 14px; margin-bottom: 20px; container-type: inline-size; break-inside: avoid; overflow: hidden; }
.sc-cat-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  box-sizing: border-box; min-height: 96px;   /* room for a two-line blurb, so every band is the same height */
  padding: 14px 22px; margin: 0 -22px 8px;
  background: color-mix(in srgb, var(--ink) 4.5%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
}
.sc-cat-head .sc-letter { width: 34px; height: 34px; font-size: 14px; }
.sc-cat-name { font: 700 18px var(--font-display); color: var(--ink); margin: 0; letter-spacing: -.01em; }
.sc-cat-blurb {
  font: 400 13.5px/1.45 var(--font-ui); color: var(--ink-faint); margin: 3px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sc-cat-prog { min-width: 170px; text-align: right; align-self: center; }
.sc-cat-prog-num { font: 600 12px var(--font-mono); color: var(--ink-faint); white-space: nowrap; }
.sc-cat-prog-num b { color: var(--ink); font-weight: 700; }
.sc-cat-prog-bar {
  height: 5px; margin-top: 8px; border-radius: 3px; overflow: hidden;
  background: color-mix(in srgb, var(--rule) 70%, transparent);
}
.sc-cat-prog-bar i { display: block; height: 100%; background: var(--catc, var(--accent)); border-radius: 3px; }
/* The band carries a PLATE (2026-10-10, Robert: "a plate behind it, much like
   the page header has … it makes the text pop and read better"): a lightened
   plate with a hairline border sits on the band with a few px of band showing
   all around, and the letter, name, blurb and progress bar sit on it. The
   hardware skin draws its own plate (a satin-black pedal enclosure on the
   tweed, css/hardware.css). */
.sc-cat-head { position: relative; --sc-plate-inset: 7px 10px; padding: 16px 32px; min-height: 100px; background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.sc-cat-head > * { position: relative; z-index: 1; }
.sc-cat-head::before {
  content: ''; position: absolute; inset: var(--sc-plate-inset); border-radius: 8px; pointer-events: none;
  background: color-mix(in srgb, var(--ink) 7%, var(--panel));
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
/* copy on the plate: --ink-faint was 3.1:1 against it and --ink-dim 6.9:1 —
   a step brighter than body ink reads 8.2:1 */
.sc-cat-head .sc-cat-blurb, .sc-cat-head .sc-cat-prog-num { color: color-mix(in srgb, var(--ink) 35%, var(--ink-dim)); }

/* skills: down then over (two columns once the panel is wide enough) */
.assess-atom-list.sc-skill-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 28px; }
@container (min-width: 780px) {
  .assess-atom-list.sc-skill-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 4), auto);
  }
}
.assess-atom-row.sc-skill {
  display: grid; grid-template-columns: 20px 30px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center;
  padding: 11px 12px; margin: 0; border: 0; border-radius: 10px;
  background: transparent; box-shadow: none; transform: none;
  transition: background-color .14s;
}
.assess-atom-row.sc-skill:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); transform: none; border: 0; }
.sc-skill-icon { width: 20px; height: 20px; display: block; }
.sc-skill-icon svg { width: 20px; height: 20px; display: block; }
.sc-skill.is-todo .sc-skill-icon circle { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.sc-skill.is-partial .sc-skill-icon circle { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.sc-skill.is-partial .sc-skill-icon path { fill: var(--accent); }
.sc-skill.is-done .sc-skill-icon circle { fill: #5FAE7E; }
.sc-skill.is-done .sc-skill-icon path { stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-skill-id {
  font: 700 12.5px var(--font-mono); letter-spacing: .04em;
  color: color-mix(in srgb, var(--catc, var(--accent)) 80%, var(--ink));
}
.sc-skill-text { display: block; min-width: 0; }
.sc-skill .assess-atom-label { display: block; font: 600 15px/1.35 var(--font-display); color: var(--ink); letter-spacing: 0; }
.sc-skill .assess-atom-tests {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 400 13px/1.45 var(--font-ui); color: var(--ink-faint); margin-top: 2px;
}
.sc-skill.is-done .assess-atom-label { color: var(--ink-dim); }
.sc-badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font: 600 12px var(--font-mono); padding: 4px 10px; border-radius: 999px;
}
.sc-badge-band { color: var(--ink-dim); background: color-mix(in srgb, var(--lamp, #5FAE7E) 13%, transparent); }
.sc-badge-band i { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp, #5FAE7E); }
.sc-badge-part { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sc-chev { width: 14px; height: 14px; }
.sc-chev path { stroke: var(--ink-faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .14s; }
.sc-skill:hover .sc-chev path, .sc-skill:focus-visible .sc-chev path { stroke: var(--accent); }
/* phones: the badge drops under the text so the title keeps its width */
@media (max-width: 560px) {
  .sc-page .sc-hero.drill-hero { padding: 22px 18px; }
  .sc-cover { padding: 14px 14px 6px; }
  .sc-hero-actions .btn { width: 100%; justify-content: center; text-align: center; }
  .sc-quiet-btn { margin: 4px auto 0; }
  .sc-meter { text-align: left; min-width: 0; width: 100%; }
  .sc-cat { padding: 0 14px 10px; }
  .sc-cat-head { grid-template-columns: auto minmax(0, 1fr); min-height: 0; padding: 14px 20px; margin: 0 -14px 6px; row-gap: 10px; --sc-plate-inset: 5px 7px; }
  .sc-cat-prog { grid-column: 1 / -1; text-align: left; min-width: 0; }
  .assess-atom-row.sc-skill { grid-template-columns: 20px 28px minmax(0, 1fr) 14px; padding: 10px 6px; gap: 10px; }
  .sc-skill .sc-badge { grid-column: 3; grid-row: 2; justify-self: start; }
  .sc-skill .sc-chev { grid-column: 4; grid-row: 1; }
}

/* landing: Skills (2026-10-09, Robert: see every skill, run the whole check or
   one at a time) — full width under the hero + Quick Check; every category
   as a panel with its own progress, quiet rows, a Run key on each row */
.sc-landing-page > .sc-single { grid-column: 1 / -1; }
/* the category panels: one column on narrow screens; from a ~1000px panel
   (a 1100px window) a two-column GRID — never masonry — so the panels in a
   row start on the same line and their header bands line up. An odd last
   panel takes the full row. Every skill row reserves two lines of text so
   rows line up across a panel whether the description is one line or two. */
.sc-single.sc-skills { container-type: inline-size; }   /* the panel is what the grid below measures */
.sc-single .sc-single-cats { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.sc-single .sc-cat { margin-bottom: 0; box-shadow: none; background: color-mix(in srgb, var(--bg) 35%, transparent); }
@container (min-width: 1040px) {
  .sc-single .sc-single-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .sc-single .sc-cat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 561px) {
  .sc-single .sc-skill .assess-atom-tests { min-height: calc(2 * 1.45 * 13px); }
}
.assess-atom-row.sc-skill.sc-skill-run { grid-template-columns: 20px 30px minmax(0, 1fr) auto auto; cursor: default; }
.sc-skill-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sc-skill-badges:empty { display: none; }
/* a skill not yet run this round, with a graded result in its history */
.sc-badge-last { color: var(--ink-faint); background: color-mix(in srgb, var(--ink) 6%, transparent); font-weight: 500; }
.sc-badge-last i { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp, #5FAE7E); opacity: .7; }
.sc-run-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 14px; font-size: 13px; }
.sc-run-btn svg { width: 11px; height: 11px; fill: currentColor; }
.sc-skills-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  /* badges and the Run key drop under the text; row-gap 0 so a row with no
     badge leaves no empty band above its key */
  .assess-atom-row.sc-skill.sc-skill-run { grid-template-columns: 20px 28px minmax(0, 1fr); row-gap: 0; }
  .sc-skill-run .sc-skill-badges { grid-column: 3; grid-row: 2; justify-self: start; justify-content: flex-start; margin-top: 8px; }
  .sc-skill-run .sc-run-btn { grid-column: 3; grid-row: 3; justify-self: start; margin-top: 8px; }
}

/* placement map: the same panels; dot labels readable */
.sc-map-page .map-grids { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
/* laptops: three across (3 + 2) rather than four and a straggler; big
   monitors: every category in one row */
@media (min-width: 1100px) { .sc-map-page .map-grids { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 2000px) { .sc-map-page .map-grids { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }
.sc-map-page .map-cat { border-radius: 14px; padding: 18px 20px 20px; }
.sc-map-page .map-cat-head {
  display: flex; align-items: center; gap: 12px; padding: 0 0 12px; margin-bottom: 16px;
  border-left: 0; border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
}
.sc-map-page .map-cat-name { font-size: 16px; font-weight: 700; flex: 1 1 auto; }
.map-cat-count { font: 600 12px var(--font-mono); color: var(--ink-faint); white-space: nowrap; }
.sc-map-page .map-dots { gap: 14px 16px; }
.sc-map-page .map-dot { width: 44px; height: 44px; font-size: 14px; }
.sc-map-page .map-dot-label { font-size: 11.5px; margin-top: 6px; }
.sc-map-page .map-legend { font-size: 13px; gap: 10px 22px; }
.sc-map-page .map-sub { margin-top: 8px; font-size: 12px; }
.sc-map-page .map-diagnostics { border-radius: 14px; }
.sc-map-page .map-diag-title { font-size: 18px; }

/* wide monitors: the category panels are already a two-column grid (see
   .sc-single-cats above); the former column-count masonry left the panels
   offset from each other, so it is gone. */

/* ============================================================================
   WIDE SCREENS (2026-09-30) — Robert's 3440×1440 ultrawide, 2560×1440, 1920.
   One rule for the app shell: .container (header included) is 1600px up to a
   2000px window, then grows to 92% of the window, capped at 2400px. Every
   view fills that shell, so the header always spans the same width as the
   page under it. Views that hold reading text keep their own measure INSIDE
   the shell (text columns stay ~65–90 characters) and use the extra width
   for columns, not longer lines. Below 1600px nothing here applies.
   ========================================================================= */
@media (min-width: 2000px) {
  .container { max-width: min(2400px, 92vw); }
}

/* ---- Drills home: fill the shell (laptops too — the header and the page
   now share edges); guided practice runs in columns ---- */
@media (min-width: 1200px) {
  .drill-home:not(.drill-setup) { max-width: none; }
  .drill-guided-grid { grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); }
  .drill-guided-grid > .drill-skill-card-wide { grid-column: auto; display: flex; flex-direction: column; }
  .drill-guided-grid > .drill-skill-card-wide .dsc-actions { margin-top: auto; }
  .drill-hero-sub { max-width: 90ch; }
}
@media (min-width: 2000px) {
  .drill-skill-grid:not(.drill-guided-grid) { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* ---- Skill Check: the landing, Deep Check list and placement map fill the
   shell (see "SKILL CHECK LAYOUT" above — category panels, two columns of
   panels from 2400px); question screens keep a focused column but a bigger
   board ---- */
/* guided practice: "← Back to Drills" lines up with the centred card instead
   of floating at the shell's left edge */
@media (min-width: 1600px) {
  #drillContent .ft-wrap:has(.ft-card) > .ft-back { margin-left: max(0px, calc((100% - 1280px) / 2)); }
}
@media (min-width: 2000px) and (min-height: 1100px) {
  #assessContent .assess-wrap:not(.sc-page),
  #drillContent .assess-wrap { max-width: min(1760px, 100%); }
  #drillContent .ft-card, .drill-wrap .ft-card { max-width: 1760px; }
  #drillContent .ft-wrap:has(.ft-card) > .ft-back { margin-left: max(0px, calc((100% - 1760px) / 2)); }
}

/* ---- Dashboard: from 2000px the panels become a right-hand column beside
   the hero and the neck, so the whole dashboard sits on one screen (below
   that the neck would shrink under the laptop-width neck, so they stack) ---- */
@media (min-width: 2000px) {
  .dashv3:has(> .dv3-lower:not(:empty)) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(460px, 560px);
    grid-template-rows: auto auto 1fr;   /* a tall side column grows the neck row, never the hero row */
    column-gap: 18px; row-gap: 18px; align-items: start;
  }
  .dashv3:has(> .dv3-lower:not(:empty)) > * { grid-column: 1 / -1; }
  .dashv3:has(> .dv3-lower:not(:empty)) > .dv3-top,
  .dashv3:has(> .dv3-lower:not(:empty)) > .dv3-neck { grid-column: 1; }
  .dashv3 > .dv3-lower:not(:empty) {
    grid-column: 2; grid-row: 2 / span 2; align-self: stretch;
    display: flex; flex-direction: column; gap: 18px;
  }
  .dashv3 > .dv3-lower:not(:empty) > * { width: 100%; max-width: none; margin: 0; }
}

/* ---- Practice Builder split view: the Map under the pages is a flex item of
   body, and its auto side margins shrank it to its content width (~1435px) —
   15px wider than a 1440 window, so the whole page scrolled sideways, and on
   a big monitor the board stopped at 1435px. Give it the shell width. ---- */
body.composer-on .container { width: 100%; }

/* ---------- Shared Pro card (IFBProNudge, js/00-entitlements.js) ----------
   Robert 2026-10-03: the old Edit-mode toast was a faint one-liner that faded
   in ~3s. This is a real card: gold PRO chip, plain title, one sentence, and a
   Go Pro button that opens the Plans page. Tasteful, on-brand, never modal. */
.ifb-pronudge { position: fixed; z-index: 12000; width: min(340px, calc(100vw - 24px)); box-sizing: border-box;
  background: linear-gradient(180deg, #2E2620, #221C17); color: var(--ink, #F5F1E8);
  border: 1px solid rgba(232, 195, 107, .75); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 0 0 4px rgba(232, 195, 107, .10), 0 18px 44px rgba(0, 0, 0, .6);
  font-family: var(--font-ui, 'Mulish', sans-serif);
  opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .16s ease, transform .16s ease; }
.ifb-pronudge.in { opacity: 1; transform: none; }
.ifb-pronudge .pn-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.ifb-pronudge .pn-chip { flex: none; font: 700 10px/1 'IBM Plex Mono', monospace; letter-spacing: .16em;
  color: #1A1614; background: var(--accent, #E8C36B); border-radius: 5px; padding: 4px 6px 3px; }
.ifb-pronudge .pn-title { flex: 1; font: 700 14.5px/1.3 var(--font-display, 'Sora', sans-serif); color: var(--ink, #F5F1E8); }
.ifb-pronudge .pn-x { flex: none; width: 26px; height: 26px; margin: -4px -6px 0 0; border: 0; border-radius: 6px; background: none;
  color: var(--ink-dim, #C9BDAF); font-size: 18px; line-height: 1; cursor: pointer; }
.ifb-pronudge .pn-x:hover { background: rgba(255, 255, 255, .07); color: var(--ink, #F5F1E8); }
.ifb-pronudge .pn-msg { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: #E7DCCB; }
.ifb-pronudge .pn-msg b { color: var(--ink, #F5F1E8); }
.ifb-pronudge .pn-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ifb-pronudge .pn-btn { font: 700 12.5px/1 var(--font-display, 'Sora', sans-serif); border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.ifb-pronudge .pn-ghost { background: transparent; border: 1px solid #4a3d31; color: var(--ink-dim, #C9BDAF); }
.ifb-pronudge .pn-ghost:hover { border-color: #6b5946; color: var(--ink, #F5F1E8); }
.ifb-pronudge .pn-go { background: var(--accent, #E8C36B); border: 1px solid var(--accent, #E8C36B); color: #1A1614; }
.ifb-pronudge .pn-go:hover { filter: brightness(1.07); }
.ifb-pronudge .pn-btn:focus-visible, .ifb-pronudge .pn-x:focus-visible { outline: 2px solid var(--accent, #E8C36B); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ifb-pronudge { transition: none; } }

/* ==========================================================================
   MAP — 13" LAPTOP PASS (2026-10-03, Robert's testing notes)
   ========================================================================== */
/* 1 · Every chord card is the same width. Plain 1fr tracks grow to fit their
   longest content (B♯m borrowed > Bm); minmax(0,1fr) fixes the tracks and the
   name squeezes instead: the note LETTER keeps its size, the ♯/♭ and the
   quality suffix shrink (ccNameHTML in js/02-map.js). */
.chord-cards-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .chord-cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .chord-cards-row { grid-template-columns: minmax(0, 1fr); } }
.chord-card { min-width: 0; }
.cc-head > .cc-idfield { min-width: 0; flex: 0 1 auto; overflow: hidden; }
.cc-idfield .cc-note { flex: none; }
.cc-idfield .cc-deg { min-width: 0; overflow: hidden; }
.cc-deg-disp { white-space: nowrap; }
.cc-name { display: inline-flex; align-items: baseline; white-space: nowrap; }
.cc-name .cc-acc { font-size: .64em; position: relative; top: -.42em; margin-left: .02em; }
.cc-name .cc-q { font-size: .8em; margin-left: .03em; }
.cc-name.is-long .cc-q { font-size: .66em; }
.cc-name.is-long .cc-acc { font-size: .58em; }

/* 2 · Desktop (any height): the card row scrolls inside itself (fitCardsToViewport
   sets --cards-max) so the board below it stays in view while you edit. The
   padding keeps focus/selection rings from being clipped by the scroll box. */
.chord-cards-row.cards-scroll {
  max-height: var(--cards-max, none); overflow-y: auto; overflow-x: hidden;
  padding: 4px 8px 4px 4px; margin: -4px -8px 10px -4px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 30px), rgba(0,0,0,.25));
          mask-image: linear-gradient(180deg, #000 calc(100% - 30px), rgba(0,0,0,.25));
}
.chord-cards-row.cards-scroll.cards-at-end { -webkit-mask-image: none; mask-image: none; }
/* Edit-mode marks on the card row / on a card ride INSIDE that element
   (js/13-map-edit.js anchorLayer): a 1×1 svg with visible overflow at the
   element's padding-box origin, so the row's scroll box, a card's own scroll
   and the hover-raise move the ink natively — no scroll-event redraw. Above
   the card's content (its stripe is z 2); never interactive. */
.chord-cards-row { position: relative; }
.meb-anchor-layer { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 40; }
.chord-cards-row > .meb-anchor-layer { z-index: 5; }
/* Cards mode menu (Compact · Fit · Whole) off the Map bar's cards button. */
.cards-mode-menu { min-width: 300px; max-width: 340px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.45); }
.cmm-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-primary); font: 500 13px var(--font-ui); cursor: pointer; }
.cmm-item:hover { background: var(--bg-elevated); }
.cmm-item .cmm-check { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--border-strong); box-sizing: border-box; }
.cmm-item.on .cmm-check { border-color: var(--accent-primary); background: radial-gradient(circle, var(--accent-primary) 0 3.5px, transparent 4px); }
.cmm-item .cmm-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmm-item .cmm-name { font-weight: 700; }
.cmm-item.on .cmm-name { color: var(--accent-primary); }
.cmm-item .cmm-hint { color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
/* "Expand a card on hover" has nothing to do in Whole cards: shown, disabled. */
.kb-switch.key-retain-btn:disabled, .kb-switch.key-retain-btn.is-moot { opacity: .45; cursor: not-allowed; }
.kb-switch.key-retain-btn:disabled .sw { filter: grayscale(1); }
.chord-cards-row.cards-scroll::-webkit-scrollbar { width: 8px; }
.chord-cards-row.cards-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.chord-cards-row.cards-scroll::-webkit-scrollbar-track { background: transparent; }
.chord-card:not(.cc-collapsed) .cc-caret { display: none; }   /* retired (moved to the Map bar) */

/* 3 · Solid / Outline — how each chord is drawn (was an On/Off switch). */
.ci-look { display: inline-flex; align-items: center; height: 22px; padding: 2px; gap: 2px; box-sizing: border-box;
  border-radius: 7px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.ci-look-btn { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px 0 5px; border: none; border-radius: 5px;
  background: transparent; color: var(--ink-faint); font: 700 10.5px var(--font-ui); letter-spacing: 0; cursor: pointer; white-space: nowrap; }
.ci-look-btn:hover:not(.on) { background: rgba(255,255,255,.05); color: var(--ink-dim); }
.ci-look-btn:active { transform: translateY(1px); }
.ci-look-btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
.ci-look-btn.on { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.ci-look-ico { width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; flex: none; }
.ci-look-ico.solid { background: var(--cc); box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.ci-look-ico.outline { border: 2px solid var(--cc); opacity: .75; }

/* 4 · Board-tool options: each lit tool's options sit in their own framed
   plate with the tool's name as a tab on its left, so with two or three
   tools on it is plain which options belong to which. */
.fdh-shelf { gap: 8px; padding: 0 5px; }
.fdh-shelf .shelf-grp { height: 30px; padding: 0 10px 0 0; border-radius: 7px;
  background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.fdh-shelf .shelf-grp + .shelf-grp { border-left: none; }
.fdh-shelf .shelf-grp > .fdh-h { align-self: stretch; display: inline-flex; align-items: center; margin: 0 2px 0 0; padding: 0 9px;
  border-radius: 7px 0 0 7px; background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  border-right: 1px solid var(--border-subtle); color: color-mix(in srgb, var(--accent-primary) 70%, var(--ink-faint)); }
.fdh-shelf.tight-1 .shelf-grp { padding: 0 8px 0 0; gap: 7px; }
/* shedding order now keeps the group tabs: tight-3 drops the CAGED readout
   chip (the legend and tags say the same), tight-4 is the old last resort */
.fdh-shelf.tight-3 .shelf-grp[data-shelf="band"] .fdh-h, .fdh-shelf.tight-3 .shelf-grp[data-shelf="mask"] .fdh-h { display: inline-flex; }
.fdh-shelf.tight-3 #chordRefChip { display: none !important; }
/* tight-4: tighter tabs and gaps; the per-form swatches drop their letters
   (each swatch already wears its form's neon, same as its C·A·G·E·D chip) */
.fdh-shelf.tight-4 { gap: 5px; }
.fdh-shelf.tight-4 .shelf-grp { gap: 6px; padding-right: 7px; }
.fdh-shelf.tight-4 .shelf-grp > .fdh-h { padding: 0 6px; letter-spacing: .08em; }
.fdh-shelf.tight-4 .cref-fc > span { display: none; }
.fdh-shelf.tight-4 .cref-form-cols { gap: 4px; }
.fdh-shelf.tight-5 .shelf-grp[data-shelf="band"] .fdh-h, .fdh-shelf.tight-5 .shelf-grp[data-shelf="mask"] .fdh-h { display: none; }

/* 5 · Compact cards (Map bar) — icon: two rows folding toward a line */
:root { --ico-compact: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 12h16%22/%3E%3Cpath d=%22M12 3v5M9 5.5 12 8l3-2.5%22/%3E%3Cpath d=%22M12 21v-5M9 18.5l3-2.5 3 2.5%22/%3E%3C/svg%3E"); }
[data-ico="compact"] { --ico: var(--ico-compact); }

/* 6 · Root ring: Key / Chord / Off — the Neighbor segment's look, with words */
.nbr-seg.rr-seg .nbr-arrow { width: auto; padding: 0 6px; font: 600 11px var(--font-ui); letter-spacing: 0; text-transform: none; }

/* 7 · CAGED ref "All" sits beside Auto */
.cref-fchip.cref-all { margin-right: 5px; }
/* narrow cards drop the "borrowed" word — the roman numeral keeps its
   borrowed color, and the select's tooltip still says it */
.chord-card:not(.empty) { container-type: inline-size; container-name: cc; }
@container cc (max-width: 320px) { .cc-borrowed { display: none; } }
/* 9 · Note Drop (2026-10-03): the game frame takes the window height minus a
   slim margin (the launcher scrolls it to the top), so 13"/14" laptops get a
   full-width board instead of a 185px-tall strip. Wide screens: the frame
   already follows the shell width; games/note-drop.html now fills it. */
#drillContent #ndFrame { height: max(600px, calc(100vh - 70px)) !important; }
/* A phone held sideways (Robert 2026-11-23): the game has the whole screen like a round, over the tabs.
   games/note-drop.html lays itself out for it and has its own way back to Drills. */
body.phone-round #drillContent #ndFrame {
  position: fixed; left: 0; top: 0; z-index: 450;
  width: 100% !important; height: 100% !important; height: 100dvh !important;
  border-radius: 0 !important; box-shadow: none !important;
}
/* ---- Drills: Notes on the Strings (half width) + Note Caller tool (2026-10-03) ---- */
.drill-lead-row + .drill-skill-grid { margin-top: 14px; }
/* ---- Drills home by goal (2026-10-08): six sections, each with a one-line
   description under the heading. The 3rds loop card always spans its row;
   the Tools grid is sized for two to three tools a row (Note Caller now, a
   metronome and a tuner later). ---- */
.drill-cat-desc {
  font-size: 13.5px; line-height: 1.5; color: var(--ink-dim);
  margin: 6px 0 0 50px; max-width: 72ch;
}
.drill-cat-desc + .drill-skill-grid { margin-top: 14px; }
.drill-th3-grid > .drill-skill-card { grid-column: 1 / -1; }
@media (min-width: 1200px) {
  .drill-tools-grid { grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); }
}
@media (max-width: 700px) {
  .drill-cat-desc { margin-left: 0; }
  /* phone: the label tape drops under the heading instead of squeezing it */
  .drill-cat-head { flex-wrap: wrap; }
  .drill-cat-count { margin-left: 0; flex: 0 0 auto; order: 2; }
  /* Top stays on the heading's own line, at its right end */
  .drill-cat-top { margin-left: auto; min-height: 36px; }
  /* the jump row is two even columns */
  .drill-jump { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drill-jump-btn { min-height: 46px; padding-right: 8px; }
}
/* the smallest phones (320 wide): the names alone, so each fits in two lines */
@media (max-width: 350px) {
  .drill-jump-btn { padding: 6px 10px; font-size: 13.5px; }
  .drill-jump-btn .drill-cat-letter { display: none; }
}
.ntf-acc-radios { align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.ntf-opt-label { font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-right: 4px; }
.opt-pill.ntf-radio { display: inline-flex; align-items: center; gap: 7px; }
.ntf-radio-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto;
  border: 1.5px solid currentColor; opacity: .7; box-sizing: border-box;
}
.opt-pill.ntf-radio.active .ntf-radio-dot { opacity: 1; background: radial-gradient(circle, currentColor 0 45%, transparent 50%); }
.drill-tool-host { margin-top: auto; }
.drill-guided-grid > .ntf-card .dsc-actions { margin-top: 4px; }
.drill-tool-host .lblock-drill .drill { box-shadow: none; }
.drill-tool-host .lblock.lblock-drill { margin: 0; padding: 0; max-width: none; }
.drill-tool-host .drill-stage { padding: 20px 14px; }
.drill-tool-host .drill-note { font-size: clamp(44px, 6vw, 76px); }
.drill-tool-host .drill-bar { gap: 10px 14px; }
.drill-tool-host .drill-bar .btn { font-size: 12px; padding: 8px 14px; }

/* ---- Header "Get Pro" (2026-10-03) — gold pill; quiet "Pro" badge once active ---- */
.get-pro-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font: 700 11.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-inverse); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-pill);
  padding: 7px 14px; cursor: pointer; white-space: nowrap;
  transition: background-color .14s, transform .08s;
}
.get-pro-btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.get-pro-btn:active { transform: translateY(1px); }
.get-pro-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.get-pro-btn.is-pro {
  color: var(--accent); background: transparent;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 5px 11px; font-size: 10.5px;
}
.get-pro-btn.is-pro:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ==========================================================================
   MAP — FIT THE WINDOW (2026-10-09, Robert: "I don't want to have to scroll up
   and down on such a large monitor"; a 13" laptop should need one short
   scroll at most; a 12-fret neck must not blow up).
   The board is a whole that scales: js/02-map.js fitBoardToViewport() measures
   what the rest of the page takes and sets --board-max-h on #view-map; the
   SVG's width follows from that height (1340:310 for 17 frets) and never
   exceeds the dock. Shorter necks start from the SAME per-fret width as the
   17-fret board would at this window — 12 frets = 81.6% of it, 15 = 93.3% —
   and may grow to 1.25× that where the window has the height (see "Short
   necks use more width" below); never the full-width board. The 21-fret neck
   keeps filling the width when it needs to (the only one allowed to shrink
   its frets).
   ========================================================================== */
svg.fretboard { --fb-len: 1; }
svg.fretboard.frets-12 { --fb-len: 0.8164; }   /* 1094 / 1340 */
svg.fretboard.frets-15 { --fb-len: 0.9328; }   /* 1250 / 1340 */
svg.fretboard.frets-21 { --fb-len: 1.1134; }   /* 1492 / 1340 */
@media (min-width: 901px) {
  .fb-scroll > svg.fretboard {
    width: min(100%, calc(min(100%, var(--board-max-h, 100000px) * 4.3226) * var(--fb-len, 1)));
    margin: 0 auto;   /* a narrower board sits centred under the dock rows, legend and bar */
  }
  body.composer-on .fb-scroll > svg.fretboard { width: min(100%, calc(100% * var(--fb-len, 1))); }
}

/* Tighter vertical rhythm on every desktop window (the gaps were sized for a
   page that scrolled anyway). Header, body padding and footer are scoped to
   the Map tab so the other views keep their spacing. No text size changes. */
@media (min-width: 901px) {
  body:has(> .container > #view-map:not([hidden])) { padding-top: 20px; padding-bottom: 20px; }
  body:has(> .container > #view-map:not([hidden])) .brand-header { margin-bottom: 16px; padding-bottom: 14px; }
  body:has(> .container > #view-map:not([hidden])) footer { margin-top: 14px; }
  .key-bar { padding: 12px 20px; gap: 10px; }
  .kb-row-map { padding-top: 9px; }
  .chord-cards-row { margin-bottom: 12px; }
  .cc-qrow { margin-top: 9px; }
  .cc-body { margin-top: 10px; padding-top: 10px; gap: 9px; }
  .fretboard-dock { padding: 14px 22px 16px; }
  .fretboard-dock-head, .fretboard-dock-head.cref-on { margin-bottom: 8px; }
  .fdh-row-tools { margin-top: 9px; }
  .fdh-shelf { margin-top: 8px; }
  .fretboard-finish-bar { margin-top: 6px; }
}
/* 2400px windows and up (2560×1440, the 3440 ultrawide): the key bar's two
   rows sit side by side — Key centre / Diatonic / Progression take ~1090px,
   the Map actions ~1040px, and the shell is 2355px or more — so the board
   gains ~55px. The progression hint goes (the select's tooltip says the same). */
@media (min-width: 2400px) {
  .key-bar { flex-direction: row; align-items: stretch; gap: 0; }
  .kb-row-key { flex: 0 1 auto; min-width: 0; }
  .kb-row-key .kb-hint { display: none; }
  .kb-row-map { flex: 1 1 auto; min-width: 0; align-self: stretch; margin-left: 24px; padding: 0 0 0 24px;
    border-top: none; border-left: 1px solid var(--border-subtle); flex-wrap: nowrap; }
}
/* Header below 1400px: the seven tabs plus the version pill and Get Pro no
   longer fit beside the brand at 1280, so the tab row dropped under it (both
   skins) and cost the page 70px. The version is in the footer too — drop
   the pill here and let the flat tabs breathe a little less. */
@media (min-width: 901px) and (max-width: 1399px) {
  .brand-header .version-pill { display: none; }
  .tab { padding: 10px 14px; min-width: 0; }
  .brand-right { gap: 10px; }
}

/* ==========================================================================
   MAP — ABOVE-THE-BOARD SQUEEZE (2026-10-10, Robert's Philips 1920 and LG
   3440 screenshots: the chord cards were cut off by their scroll box while the
   key bar and the dock head wasted height). Everything here is desktop-only
   and gives its height to the cards (fitCardsToViewport measures the page).
   ========================================================================== */
@media (min-width: 901px) {
  /* 1 · The options shelf is gone while no board tool is on (it used to hold a
     40px hint line). It still never moves the board once a tool is on. */
  .fdh-shelf.is-empty { height: 0; min-height: 0; margin-top: 0; padding: 0; border-width: 0; box-shadow: none; overflow: hidden; }
  .fdh-shelf.is-empty .shelf-hint { display: none; }
  /* 2 · On the board: the Solid · Outline · Off icons sit BESIDE each chord chip
     (one 34px line instead of chip-over-words), so the row loses ~30px. */
  .fdh-sec { gap: 4px; }
  .fretboard-chord-indicator { gap: 8px; }
  .fretboard-chord-indicator .ci-unit { flex-direction: row; align-items: center; gap: 5px; }
  .fretboard-chord-indicator .ci-tick { height: 22px; margin-top: 0; }
  .chord-dim-divider { min-height: 34px; }
  .chord-dim-cluster { align-items: center; }
  .fdh-row-tools { margin-top: 6px; min-height: 30px; }
  .fretboard-dock-head, .fretboard-dock-head.cref-on { margin-bottom: 6px; }
  .fdh-shelf { margin-top: 6px; }
  /* 3 · Key bar: smaller diatonic chips (40px tall, still a 60×40 target),
     34px key / Major–Minor / Lock chords / Progression controls, 32px Map keys. */
  .key-bar { padding: 10px 20px; gap: 8px; }
  .kb-sec { gap: 5px; }
  .kb-row-key .kb-ctrls, .kb-row-key .diatonic-grid { min-height: 40px; }
  .key-select, .prog-select, .quality-toggle, .kb-switch.key-retain-btn { height: 34px; }
  .key-select { font-size: 20px; }
  .key-select, .prog-select { background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
  .diatonic-chip { width: 60px; height: 40px; gap: 1px; }
  .diatonic-chip .roman { font-size: 10.5px; }
  .diatonic-chip .chord-label { font-size: 17px; }
  .kb-btn.key-retain-btn, .kb-clear.clear-btn { height: 32px; }
}
@media (min-width: 901px) and (max-width: 2399px) {
  .kb-row-map { padding-top: 7px; }
}
/* Solid · Outline · Off — three icon keys per chord (2026-10-10): a filled
   disc, a hollow ring, a ring with a slash. Off takes the chord's notes off the
   board (the card's own ring toggle) while the card and the chip stay, so it
   can be turned back on from here. Same look in both skins; the words live in
   the tooltips and aria-labels. */
.ci-look { height: 24px; padding: 2px; gap: 1px; }
.ci-look-btn { width: 24px; height: 20px; padding: 0; justify-content: center; }
.ci-look-ico { width: 11px; height: 11px; }
.ci-look-ico.outline { border-width: 2px; opacity: .85; }
.ci-look-ico.off { position: relative; border: 2px solid var(--cc); opacity: .55; overflow: visible; }
.ci-look-ico.off::after { content: ''; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--cc); transform: rotate(45deg); border-radius: 1px; }
.ci-look-btn.on .ci-look-ico.off { opacity: .95; }
.fretboard-chord-indicator .ci-hidden .ci-chord:not(.focused) { opacity: .4; }
.fretboard-chord-indicator .ci-hidden .ci-chord.focused { opacity: .7; }
/* Wide windows: On the board and Board tools share one line when both fit —
   measured in syncToolShelf (js/02-map.js), so long chord names or Edit mode's
   set chips drop the tools back to their own row. Order on the line: On the
   board · Board tools · (right) Note labels + Edit mode. */
@media (min-width: 1600px) {
  .fretboard-dock-head.fdh-one-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 26px; }
  .fretboard-dock-head.fdh-one-line > .fdh-row-board { display: contents; }
  .fretboard-dock-head.fdh-one-line .fdh-onboard { order: 1; flex: 0 1 auto; }
  .fretboard-dock-head.fdh-one-line > .fdh-row-tools { order: 2; flex: 0 0 auto; margin-top: 0; padding-bottom: 1px; }
  .fretboard-dock-head.fdh-one-line .fretboard-dock-head-right { order: 3; margin-left: auto; }
  .fretboard-dock-head.fdh-one-line > .fdh-shelf { order: 4; flex: 1 1 100%; }
}
/* Short necks use more width (2026-10-10): 12 and 15 frets may grow to 1.25×
   the 17-fret per-fret width at this window (proportions kept, so the board
   gets taller too), still capped by the board's height budget (--board-max-h,
   fitBoardToViewport) and the dock's width — never the full-width board. */
svg.fretboard.frets-12 { --fb-grow: 1.25; }
svg.fretboard.frets-15 { --fb-grow: 1.25; }
@media (min-width: 901px) {
  .fb-scroll > svg.fretboard {
    width: min(100%,
               calc(min(100%, var(--board-max-h, 100000px) * 4.3226) * var(--fb-len, 1) * var(--fb-grow, 1)),
               calc(var(--board-max-h, 100000px) * 4.3226 * var(--fb-len, 1)));
  }
  body.composer-on .fb-scroll > svg.fretboard { width: min(100%, calc(100% * var(--fb-len, 1) * var(--fb-grow, 1))); }
}
/* Board size — Fit · Big · Max (2026-10-10, Robert's Philips 4K: the board
   filled ~55% of the width and the notes were hard to read when presenting).
   A three-key seg in the settings bar under the board (BOARD, beside
   FRETBOARD · SOUND · PRESENTER · NOTES), saved as ifb-board-size. Fit is the
   rule above; Big gives --board-max-h 1.25× the Fit height (the page may
   scroll a little); Max sets no height budget, so the min() above leaves the
   dock's width as the only cap and the page scrolls. fitBoardToViewport in
   js/02-map.js. Desktop only — phones keep the plain 100%-width board, so the
   keys are off the phone bar. */
@media (max-width: 900px) { #boardSizeSeg, .ffb-label-boardsize, .ffb-sep-boardsize { display: none; } }
/* The settings bar is one line up to a 2000px window: with the BOARD keys it
   measures ~1620px at 1920 wide, 60px over the dock, and a second line cost
   the Fit rule its zero page scroll at 1920×1080. Tighter keys (10px sides,
   not 14) and gaps keep every control; nothing is hidden. */
@media (min-width: 901px) and (max-width: 2000px) {
  .fretboard-finish-bar { gap: 8px; }
  .fretboard-finish-bar .ffb-seg button { padding: 0 10px; }
  .fretboard-finish-bar .ffb-sep { margin: 0 2px; }
}
/* Expand a card on hover (2026-10-10, experiment; Map row switch, default on
   for pointer devices, never on touch): while the card row is boxed, resting
   the pointer on a cut-off card for ~250ms lifts it out of the box at its own
   full height, over the dock; a dashed ghost keeps its place in the grid. */
.chord-card.cc-ghost { visibility: visible; border: 1.5px dashed var(--border-subtle); background: transparent; box-shadow: none; pointer-events: none; }
.chord-card.cc-ghost::before { display: none; }
.chord-card.cc-raised { position: fixed; z-index: 6000; margin: 0; overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 0 0 1px var(--border-strong), 0 26px 64px rgba(0,0,0,.65); transition: none; }
.chord-cards-row.cards-scroll.cc-has-raised { -webkit-mask-image: none; mask-image: none; }
@media (hover: none), (pointer: coarse) { #cardHoverBtn { display: none; } }
@media (max-width: 900px) { #cardHoverBtn { display: none; } }
.chord-cards-row .chord-card.cc-raised { opacity: 1; }

/* Compact cards keep the Position controls (2026-10-10, Robert): under the
   summary strip, one 25px row — the Root string select (or a Triad card's
   Position readout) with its ▾▴ arrows, and the Extension select — the same
   controls as the body's, so a user steps positions without expanding. Hidden
   on a full card (the body has them); a compact card raised by the
   hover-raise loses cc-collapsed and shows the body instead. */
.cc-summ-ctl { display: none; }
.chord-card.cc-collapsed .cc-summ-ctl { display: flex; align-items: center; gap: 5px; margin-top: 5px; height: 25px; }
.cc-summ-ctl .cc-summ-k { flex: 0 0 auto; width: 30px; font: 600 8.5px var(--font-mono); letter-spacing: .1em; color: var(--text-muted); cursor: help; }
.cc-summ-ctl .anchor-step-row { flex: 1 1 auto; min-width: 0; gap: 4px; }
.cc-summ-ctl .ctrl-select, body.hw-ui .chord-card .cc-summ-ctl .ctrl-select { height: 25px; padding: 0 6px; font-size: 11.5px; }
.cc-summ-ctl .anchor-step-row .ctrl-select.cc-posread { flex: 1 1 0; width: auto; padding: 0 4px; }
.cc-summ-ctl .step-pair { height: 25px; box-sizing: border-box; }
.cc-summ-ctl .step-btn { height: 23px; width: 22px; }
.cc-summ-ctl .cc-summ-ext { flex: 0 1 76px; min-width: 56px; width: auto; }
/* A 1280-wide window gives each card about 300px: the key label goes, so the
   Triad readout keeps its "Nearest 2–5 · with B" (the tooltips still say which control is which). */
@container cc (max-width: 330px) { .cc-summ-ctl .cc-summ-k { display: none; } .cc-summ-ctl .cc-summ-ext { flex-basis: 70px; min-width: 62px; } }

/* Phone Map (audit 2026-10-27, Robert's call): the board comes first, the chord
   cards sit under it (folded to one line each by js/02 on phones). */
@media (max-width: 700px) {
  /* :not([hidden]) matters: a bare #view-map rule outranks .view[hidden], so the
     Map stayed on screen above every other tab's page on a phone (found 2026-11-20). */
  #view-map:not([hidden]) { display: flex; flex-direction: column; }
  #view-map > * { order: 2; }
  #view-map > .key-bar { order: 0; }
  #view-map > .fretboard-dock { order: 1; }
  #view-map > #chordSlots { order: 3; }
}
/* Placement map: the named list under the dots (audit 2026-10-27) */
.map-list { margin-top: 18px; }
.map-list-cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 14px 0 6px; }
.map-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 4px; background: var(--surface-1); border: 1px solid var(--rule); border-radius: 8px; font-size: 13px; }
.map-row-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.map-row-id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); width: 34px; flex: none; }
.map-row-name { flex: 1; color: var(--ink); }
.map-row-band { color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
.map-row .btn.map-row-btn { font-size: 10.5px; padding: 5px 10px; }

/* Phone touch targets for drill option pills and string buttons (audit 2026-10-27) */
@media (max-width: 480px) {
  .opt-pill, .btn.drill-strbtn { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
}

/* Dock head at laptop widths: with a Set chip beside the chord letters the
   cluster wraps instead of clipping "Focus one chord" (audit 2026-10-27). */
@media (max-width: 1600px) {
  .chord-dim-cluster { flex-wrap: wrap; min-width: 0; row-gap: 6px; }
}

/* ---- Drill start: instructions → 3-2-1 → first question (2026-11-03) ---- */
.drill-intro { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 28px 30px 24px; max-width: 640px; margin: 24px auto; }
.drill-intro-kick { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.drill-intro-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin: 0 0 16px; color: var(--ink); }
.drill-intro-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0 0 20px; font-size: 16px; line-height: 1.5; }
.drill-intro-list dt { color: var(--ink-faint); font-weight: 600; }
.drill-intro-list dd { margin: 0; color: var(--ink); }
.drill-intro-focus { font-size: 15px; color: var(--ink-dim); margin: 0 0 18px; }
.drill-intro-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drill-intro-start { font-size: 18px; padding: 12px 34px; }
.drill-intro-hint { margin: 14px 0 0; font-size: 13px; color: var(--ink-faint); }
.auto-result-warmup, .drill-warmup-line { font-size: 13px; color: var(--ink-faint); margin: 8px 0 0; text-align: center; }
.hero-more { color: var(--ink-faint); font-size: 0.9em; }
@media (max-width: 640px) { .drill-intro { padding: 20px 18px; margin: 12px 0; } .drill-intro-list { grid-template-columns: 1fr; gap: 4px 0; } .drill-intro-list dd { margin-bottom: 8px; } .drill-intro-start { width: 100%; } }

/* ---- Dashboard fretboard views: All · Dot · Text · Find · Octaves ---- */
.dn-views { display: flex; gap: 4px; margin: 0 0 12px; flex-wrap: wrap; }
.dn-view { background: transparent; border: 1px solid var(--rule); color: var(--ink-dim); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dn-view:hover { color: var(--ink); border-color: var(--ink-faint); }
.dn-view.on { background: var(--ink); color: var(--panel, #fff); border-color: var(--ink); }
.dn-migr { display: block; margin-top: 6px; color: var(--ink-faint); }
.dn-h.m-t, .dn-h.m-f { box-shadow: inset 0 -2px 0 currentColor; }

/* ============================================================================
   PHONE SIDEWAYS: a round (Robert 2026-11-22). While the count or a question of
   a drill or a Skill Check is on a phone held sideways (body.phone-round, set by
   js/04-phone.js), the round has the whole screen: no header, no tabs, the
   board across the full width and the answers right under it. Both drill
   engines (.drill-runner and .auto-runner) get the same layout.
   ========================================================================== */
/* A round on a phone: a pull down at the top of the page must not reload it (the round would be lost), and
   the page must not bounce under a finger (Robert 2026-11-23). js/04-phone.js holds a sideways round still. */
@media (pointer: coarse) {
  html:has(body.phone-round),
  html:has(#drillContent .drill-question, #drillContent .auto-question, #assessContent .auto-question, #drillContent .vt-lesson-stage, #drillContent .vt-play-panel) { overscroll-behavior-y: none; }
  html:has(body.phone-round) body { overscroll-behavior-y: none; }
}
body.phone-round .brand-header,
body.phone-round > footer { display: none !important; }
body.phone-round .drill-runner,
body.phone-round .auto-runner {
  position: fixed; inset: 0; z-index: 450;
  margin: 0; min-height: 0; border: 0; border-radius: 0; box-shadow: none;
  background: var(--bg);
  padding: 6px max(12px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
body.phone-round .drill-runner-head,
body.phone-round .auto-runner-head { margin: 0; flex: none; }
body.phone-round .drill-runner > .drill-progress { margin: 0; flex: none; }
body.phone-round .drill-question { flex: none; padding: 0; gap: 6px; justify-content: flex-start; }
body.phone-round .drill-mini-fb { padding: 2px; }
body.phone-round .drill-answers { display: flex; max-width: none; margin-top: 0; gap: 8px; }
body.phone-round .drill-answer-btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 8px 4px; }
body.phone-round .drill-kbd-hint { display: none; }
/* The Skill Check engine: "Question 1 of 24 · 0 right" takes the place of the long title beside Quit,
   the prompt is one short row, then the board, then one row of answers. */
body.phone-round .auto-runner { position: fixed; }
body.phone-round .auto-runner-head { min-height: 36px; }
body.phone-round .auto-runner-head > span:first-child { visibility: hidden; }
body.phone-round .atom-question-card { flex: none; padding: 0; border: 0; background: none; text-align: left; }
body.phone-round .atom-question-card .drill-progress { display: none; }
body.phone-round .atom-question-progress-row {
  position: absolute; top: 6px; left: max(12px, env(safe-area-inset-left)); height: 36px; margin: 0;
  justify-content: flex-start; gap: 18px;
}
body.phone-round .auto-question { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 18px; padding: 0; min-height: 30px; }
body.phone-round .auto-question .auto-prompt-line { font-size: clamp(15px, 2.25vw, 19px); line-height: 1.25; margin: 0; padding: 0; }
body.phone-round .auto-question .auto-prompt-sub { font-size: 14px; margin: 0; }
body.phone-round .auto-question .triad-ask { display: inline; line-height: 1.25; }
body.phone-round .auto-question .triad-ask b,
body.phone-round .auto-question .triad-ask-set { font-size: 1em; }
body.phone-round .auto-question .triad-ask br { display: none; }
body.phone-round .auto-question .triad-ask b::after { content: '\00a0\00b7\00a0'; font-weight: 400; color: var(--ink-faint); }
body.phone-round .auto-question .triad-ask-set::before { content: '\00a0\00b7\00a0'; color: var(--ink-faint); }
body.phone-round .auto-question .auto-find-centered { display: flex; align-items: center; gap: 12px; margin: 0; }
body.phone-round .auto-question .auto-find-note-chip { font-size: 22px; padding: 4px 14px; margin: 0; border-radius: 7px; }
body.phone-round .auto-question .auto-find-target-line { font-size: 17px; }
body.phone-round .auto-question .auto-prompt-text { padding: 0; }
body.phone-round .atom-board,
body.phone-round .atom-question-card + .atom-board { flex: none; padding: 0; border: 0; background: none; overflow: visible; }
body.phone-round .auto-fretboard { padding: 0; margin: 0; }
body.phone-round .auto-answers { display: flex; flex-wrap: nowrap; max-width: none; width: 100%; gap: 8px; margin: 6px 0 0; }
body.phone-round .auto-answer-btn { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 6px 4px; font-size: 20px; border-radius: 10px; }
body.phone-round .auto-answers.text-choices .auto-answer-btn { font-size: 14px; line-height: 1.15; min-height: 44px; padding: 2px 4px; }
/* A board never takes more height than the screen has left: a short board (five frets) is drawn smaller. */
body.phone-round .mini-fb-scroll > svg { max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); }
/* Answer buttons under the board stop 36px above the bottom edge, like Got it: a tap right at the edge of an
   iPhone brings up its swipe line (Robert 2026-11-23). The board gives up the height. */
body.phone-round .atom-board:has(.auto-answers) .mini-fb-scroll > svg { max-height: calc(100vh - 176px); max-height: calc(100dvh - 176px); }
body.phone-round .drill-runner:has(.drill-answer-btn) .mini-fb-scroll > svg { max-height: calc(100vh - 168px); max-height: calc(100dvh - 168px); }
/* The button under a board (Start chord clock, Continue) moves up into the top row, between the count and Quit. */
body.phone-round .atom-board > .auto-actions-row { position: fixed; z-index: 2; top: 6px; left: 50%; transform: translateX(-50%); height: 36px; margin: 0; }
body.phone-round .atom-board > .auto-actions-row .btn { padding: 0 18px; height: 36px; min-height: 0; white-space: nowrap; }
/* Hint was under the board, where the bottom edge of the screen cut it off (seen 2026-11-23). It sits in the
   top row with the other buttons. A hint in words (Major or minor pentatonic?) opens as a line under the
   board, and the board gives up the height for it. */
body.phone-round .auto-hint-row { margin: 0; flex: none; }
body.phone-round .auto-hint-row:not(:has(.auto-hint-text:not([hidden]))) { display: contents; }   /* no empty row, no spare gap */
body.phone-round .auto-hint-btn { position: fixed; z-index: 2; top: 6px; left: 50%; transform: translateX(-50%); height: 36px !important; min-height: 0 !important; padding: 0 16px !important; white-space: nowrap; }
body.phone-round .auto-hint-text { font-size: 13.5px; line-height: 1.3; }
body.phone-round .auto-runner:has(.auto-hint-text:not([hidden])) .mini-fb-scroll > svg { max-height: calc(100vh - 198px); max-height: calc(100dvh - 198px); }
/* The chord clock: its card becomes one row over the board. */
body.phone-round .clock-display { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 18px; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; max-width: none; width: 100%; }
body.phone-round .clock-display > * { margin: 0; }
body.phone-round .clock-display .clock-chord-name { font-size: 28px; line-height: 1.2; min-width: 2.2em; }
body.phone-round .clock-display .clock-target-info { font-size: 15px; }
body.phone-round .clock-display .clock-progress-bar { flex: 0 0 90px; width: 90px; }
body.phone-round .clock-region-hint { margin: 0; flex: 1 0 100%; }
body.phone-round .auto-next-row { margin: 0; }
body.phone-round .auto-next-row .btn { margin-top: 4px; padding: 9px 20px; }
/* After a miss (Robert 2026-11-23: "the got it button should probably come up higher, but still be below
   the fretboard, so you're not pressing at the edge of the phone"). Got it sits at the right of one row
   under the board, 36px clear of the bottom edge, where an iPhone keeps its swipe-up line. The board gives
   up the height, so nothing has to scroll. Skill Check: the message is on the left of that row.
   Name the Note: the answers are on the left and the message takes the place of the question over the board. */
body.phone-round .auto-runner.has-next,
body.phone-round .drill-runner.has-next { padding-bottom: max(36px, calc(env(safe-area-inset-bottom) + 14px)); }
body.phone-round .auto-runner.has-next .auto-hint-row { display: none; }
body.phone-round .auto-runner.has-next .auto-next-row { display: flex !important; align-items: center; gap: 14px; flex: none; text-align: left; }
body.phone-round .auto-runner.has-next .auto-correct-info { flex: 1 1 0; min-width: 0; }
body.phone-round .auto-runner.has-next .drill-review-msg { text-align: left; font-size: 14px; line-height: 1.3; }
body.phone-round .has-next .auto-next-row .btn,
body.phone-round .has-next .drill-next-btn { flex: none; width: auto !important; margin: 0; min-height: 46px; padding: 0 26px !important; white-space: nowrap; }
/* The board takes exactly the height that is left, whatever the question over it needs. */
body.phone-round .auto-runner.has-next .atom-board { flex: 1 1 0; min-height: 90px; display: flex; flex-direction: column; }
body.phone-round .auto-runner.has-next .auto-fretboard { flex: 1 1 0; min-height: 0; position: relative; }
body.phone-round .auto-runner.has-next .auto-fretboard > .mini-fb-scroll { position: absolute; inset: 0; overflow: hidden; }
body.phone-round .auto-runner.has-next .auto-fretboard > .mini-fb-scroll > svg { width: 100% !important; min-width: 0; height: 100% !important; max-width: none !important; max-height: none; }
body.phone-round .auto-runner.has-next .auto-answer-btn { min-height: 36px; }
body.phone-round .auto-runner.has-next .auto-note-btn { padding: 8px 6px; }   /* the twelve note names: two short rows, so Got it fits under them */
body.phone-round .drill-runner.has-next .drill-question { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: stretch; }
body.phone-round .drill-runner.has-next .drill-next-row { display: contents !important; }
body.phone-round .drill-runner.has-next .drill-prompt-line { display: none; }
body.phone-round .drill-runner.has-next .drill-correct-info { grid-column: 1 / -1; grid-row: 1; }
body.phone-round .drill-runner.has-next .drill-correct-info > div { display: inline; margin: 0 !important; font-size: 14px !important; line-height: 1.3; }
body.phone-round .drill-runner.has-next .drill-correct-info br { display: none; }
body.phone-round .drill-runner.has-next .drill-correct-info span { font-size: 14px !important; }
body.phone-round .drill-runner.has-next .drill-correct-info span::before,
body.phone-round .drill-runner.has-next .drill-correct-info .drill-diagnosis::before { content: '\00a0\00b7\00a0'; color: var(--ink-faint); }
body.phone-round .drill-runner.has-next .drill-correct-info { text-align: center; color: var(--ink-dim); }
body.phone-round .drill-runner.has-next .drill-diagnosis { display: inline; margin: 0; padding: 0; border: 0; background: none; font-size: 14px; }
body.phone-round .drill-runner.has-next .drill-mini-fb { grid-column: 1 / -1; grid-row: 2; }
body.phone-round .drill-runner.has-next .drill-answers { grid-column: 1; grid-row: 3; }
body.phone-round .drill-runner.has-next .drill-next-btn { grid-column: 2; grid-row: 3; }
/* The board takes the room that is left, so a note that runs to two lines on a small phone makes the board
   shorter and leaves Got it where it is. */
body.phone-round .drill-runner.has-next .drill-question { flex: 1 1 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
body.phone-round .drill-runner.has-next .drill-mini-fb { position: relative; min-height: 90px; }
body.phone-round .drill-runner.has-next .drill-mini-fb .mini-fb-scroll { position: absolute; inset: 2px; overflow: hidden; }
body.phone-round .drill-runner.has-next .mini-fb-scroll > svg { width: 100% !important; min-width: 0; height: 100% !important; max-width: none !important; max-height: none; }

/* ============================================================================
   PHONE: the computer notice + the turn cover (Robert 2026-11-21).
   Both are drawn by js/04-phone.js and only on a phone. The notice is the first
   screen, above the welcome (9500), Plans (10000) and the tour (100000); the
   turn cover sits under it. Same card as the welcome screen, so the two first
   screens look alike.
   ========================================================================= */
#phoneNotice, #turnCover {
  position: fixed; inset: 0; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center;
  background: radial-gradient(ellipse 900px 500px at 50% 0%, rgba(232,195,107,.08), transparent 60%), #160F0A;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
#phoneNotice { z-index: 200000; }
#turnCover { z-index: 150000; }
#phoneNotice .pn-card, #turnCover .tc-card {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 18px;
  box-shadow: var(--elev-2), 0 0 70px -20px rgba(232,195,107,.22);
  padding: 30px 24px; text-align: center;
}
#phoneNotice .pn-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .18em; color: var(--accent); margin-bottom: 14px; }
#phoneNotice h1, #turnCover h2 { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 800; line-height: 1.2; margin: 0 0 14px; color: var(--ink); text-wrap: balance; }
#phoneNotice h1 { font-size: clamp(21px, 6.4vw, 26px); }
#phoneNotice p, #turnCover p { font-family: 'Mulish', sans-serif; font-size: 17px; line-height: 1.5; color: var(--ink); margin: 0 0 14px; text-wrap: balance; }
#phoneNotice p b { color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
#phoneNotice .pn-go {
  width: 100%; min-height: 52px; margin-top: 8px; padding: 12px 18px;
  font: 700 17px/1.2 'Mulish', sans-serif; color: #1A1614;
  background: var(--accent); border: 1px solid var(--accent); border-radius: 12px; cursor: pointer;
}
/* the line under the button: where to go on a larger screen */
#phoneNotice .pn-after { margin: 18px 0 0; }
#turnCover .tc-pic { color: var(--accent); margin-bottom: 10px; }
#turnCover .tc-stay {
  min-height: 48px; margin-top: 4px; padding: 10px 22px;
  font: 700 16px/1.2 'Mulish', sans-serif; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 12px; cursor: pointer;
}
#phoneNotice .pn-card:focus { outline: none; }
#phoneNotice .pn-go:focus-visible, #turnCover .tc-stay:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* the smallest phones (320 wide): the whole card and its button show without scrolling */
@media (max-width: 350px) {
  #phoneNotice { padding-top: 12px; padding-bottom: 12px; }
  #phoneNotice .pn-card { padding: 20px 16px; }
  #phoneNotice .pn-kicker { margin-bottom: 10px; }
  #phoneNotice h1 { margin-bottom: 10px; }
  #phoneNotice p { font-size: 16px; line-height: 1.42; margin-bottom: 10px; }
  #phoneNotice .pn-go { margin-top: 4px; }
  #phoneNotice .pn-after { margin-top: 12px; }
}
/* a sideways phone is about 350 tall: the card gives up its top and bottom room */
@media (max-height: 460px) {
  #phoneNotice, #turnCover { place-items: start center; padding-top: 12px; padding-bottom: 12px; }
  #phoneNotice .pn-card, #turnCover .tc-card { max-width: 620px; padding: 18px 22px; }
  #phoneNotice .pn-kicker { margin-bottom: 8px; }
  #phoneNotice h1, #turnCover h2 { font-size: 22px; margin-bottom: 8px; }
  #phoneNotice p, #turnCover p { font-size: 16px; margin-bottom: 8px; }
  #phoneNotice .pn-after { margin: 10px 0 0; }
  #turnCover .tc-pic { width: 40px; height: 40px; margin-bottom: 4px; }
}
