@font-face { font-family: Bravura; src: url(../fonts/Bravura.woff2) format('woff2'); font-display: block; }

:root {
  --paper: #f5f1e8; --card: #fffdf8; --ink: #1d1b18; --muted: #776f64;
  --line: #ddd5c6; --accent: #1e4f7a; --accent-soft: #dbe6f0;
  --ok: #2e7d4f; --ok-soft: #d7eedf; --bad: #b4382d; --bad-soft: #f6dcd8; --meh: #b7791f;
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino", Georgia, serif;
  --kbh: 150px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
/* Pin the page so iOS can't rubber-band it when a finger slides on the keyboard. */
body { position: fixed; inset: 0; overflow: hidden; }
#app { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
h2 { font-size: 1.15rem; margin: 22px 16px 10px; }
h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--muted); font-family: inherit; font-weight: 600; }
p { margin: .4em 0; }
.smufl { font-family: Bravura; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.pad { padding: 8px 14px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 24px; }

/* header */
header.bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
header.bar h1 { font-size: 1.05rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { font-size: 2rem; line-height: 1; padding: 0 10px 4px 2px; color: var(--accent); }
.hero { padding: 26px 18px 6px; }
.hero h1 { font-size: 2rem; display: flex; align-items: center; gap: 6px; }
.clef-mark { font-size: 2.2rem; line-height: 1; position: relative; top: 4px; }
.hero p { color: var(--muted); margin-top: 4px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 0 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; position: relative; min-height: 86px; }
.tile:active { background: var(--accent-soft); }
.tile-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.has-extra .tile-title { padding-right: 40px; }
.tile-sub { color: var(--muted); font-size: .82rem; }
.tile-extra { position: absolute; top: 12px; right: 12px; font-size: .78rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.settings-row { display: flex; flex-wrap: wrap; gap: 16px; padding: 22px 16px 6px; font-size: .9rem; color: var(--muted); }
.settings-row select { font: inherit; }

/* step list */
.steps { list-style: none; margin: 0; padding: 0 14px; display: flex; flex-direction: column; gap: 8px; }
.step > a, .step > div { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.step > a:active { background: var(--accent-soft); }
.step.locked { opacity: .45; }
.step-tick { width: 22px; text-align: center; color: var(--accent); }
.step.done .step-tick { color: var(--ok); font-weight: 700; }
.step-main { flex: 1; display: flex; flex-direction: column; }
.step-kind { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.step-title { font-weight: 600; }
.step-best { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* buttons, chips */
.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 9px 18px; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 4px 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg { display: inline-flex; background: #e9e3d6; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .88rem; border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; color: var(--ink); cursor: pointer; }
.seg button.on { background: var(--card); box-shadow: 0 1px 2px #0002; font-weight: 600; }

/* play screens */
.play { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.play .pad { flex: none; }
.progress { height: 4px; background: var(--line); }
.progress .fill { height: 100%; background: var(--accent); width: 0; transition: width .25s; }
.stats { text-align: center; color: var(--muted); font-size: .85rem; padding: 6px; font-variant-numeric: tabular-nums; }
.drill-stats { display: flex; justify-content: space-around; padding: 10px 8px 0; font-variant-numeric: tabular-nums; }
.drill-stats div { display: flex; flex-direction: column; align-items: center; }
.drill-stats span { font-size: .8rem; color: var(--muted); }
.drill-stats b { font-size: 1.6rem; font-weight: 500; }
.stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 6px 12px; min-height: 0; }
.play .stage svg.staff { height: 100%; }
.seg-small button { padding: 4px 10px; font-size: .8rem; }
.stage svg.staff { width: 100%; max-width: 620px; max-height: 42vh; }
.lesson-stage svg.staff { max-width: 460px; }
svg .sl { stroke: var(--ink); stroke-width: 1; }
svg .ledger { stroke: var(--ink); stroke-width: 1.2; }
svg .stem { stroke: var(--ink); stroke-width: 1.2; }
svg .ink { fill: var(--ink); }
svg text.smufl { fill: var(--ink); }
svg .note.cur text.smufl { fill: var(--accent); }
svg .note.cur .ledger { stroke: var(--accent); }
svg .note.ok text.smufl, svg .rev.ok text.smufl { fill: var(--ok); }
svg .note.bad text.smufl, svg .rev.bad text.smufl { fill: var(--bad); }
svg .mark { font-size: 12px; font-weight: 600; fill: var(--muted); }
svg .ok .mark { fill: var(--ok); }
svg .bad .mark { fill: var(--bad); }
svg .meh .mark { fill: var(--meh); }
svg .note.meh text.smufl { fill: var(--meh); }
svg .note .hit text.smufl { fill: var(--ok); }
svg text.brace { fill: var(--ink, currentColor); }
svg .guide { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 5 4; opacity: .55; }
svg .guide-ring { fill: rgba(30,79,122,.12); stroke: var(--accent); stroke-width: 2; }
svg .guide-label { font-size: 9px; font-weight: 600; fill: var(--accent); }
svg .count { font-size: 11px; fill: var(--muted); }
svg .rev.now text.smufl { fill: var(--accent); }
svg .rev.now .stem { stroke: var(--accent); }
.result { text-align: center; }
.result .big { font-family: var(--serif); font-size: 3rem; font-weight: 600; }

/* lesson */
.lesson-text { padding: 10px 18px 0; max-width: 640px; margin: 0 auto; font-size: 1.02rem; }

/* keyboard */
.kb { width: 100%; }
.kb-view { position: relative; height: var(--kbh); overflow: hidden; border-radius: 8px; background: #222; touch-action: none; }
.kb-inner { position: absolute; top: 0; bottom: 0; left: 0; }
.key { position: absolute; top: 0; cursor: pointer; }
.key.white { bottom: 0; background: #fffefb; border: 1px solid #b9b2a5; border-top: 0; border-radius: 0 0 6px 6px; display: flex; align-items: flex-end; justify-content: center; }
.key.black { height: 62%; background: linear-gradient(#2b2a28, #111); border-radius: 0 0 4px 4px; z-index: 2; }
.key .lbl { font-size: .7rem; color: var(--muted); padding-bottom: 6px; pointer-events: none; }
.key.mid { background: #fff5dc; }
.key.mid .lbl { color: var(--accent); font-weight: 700; }
.key.mid::before { content: ''; position: absolute; bottom: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.key.down { filter: brightness(.88); }
.key.hint { background: var(--accent-soft); }
.key.black.hint { background: var(--accent); }
.key.ok { background: var(--ok) !important; }
.key.bad { background: var(--bad) !important; }
.kb-slider-row { display: flex; align-items: center; gap: 8px; padding: 10px 2px 0; color: var(--muted); font-size: .8rem; touch-action: none; }
.kb-slider { flex: 1; position: relative; height: 28px; touch-action: none; cursor: grab; }
.kb-slider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: #d8d1c3; }
.kb-thumb { position: absolute; top: 50%; height: 14px; margin-top: -7px; border-radius: 7px; background: var(--accent); opacity: .75; }
.kb-slider.dragging .kb-thumb { opacity: 1; }

/* name buttons */
.names { display: grid; grid-template-columns: repeat(14, 1fr); grid-template-rows: auto auto; gap: 6px; max-width: 560px; margin: 0 auto; }
.nb { font: inherit; font-weight: 700; font-size: 1.05rem; padding: 14px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.nb.black { background: #ece6da; font-size: .95rem; }
.nb.ok { background: var(--ok); color: #fff; }
.nb.bad { background: var(--bad); color: #fff; }
.nb.hint { background: var(--accent-soft); }
.pad-body { padding-top: 8px; }
.pad > .seg { display: flex; width: max-content; margin: 0 auto; }

/* mic */
.mic-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; justify-content: center; font-size: .85rem; color: var(--muted); padding: 0 6px 6px; }
.mic-bar b { color: var(--ink); font-size: 1rem; min-width: 2.4em; display: inline-block; }
.mic-bar.warn { color: var(--bad); }
.meter { width: 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter div { height: 100%; width: 0; background: var(--accent); transition: width .05s; }

/* fretboard */
.fb svg { width: 100%; display: block; max-height: 38vh; }
.fb-wood { fill: #efe2c8; }
.fb-fret { stroke: #a8a091; stroke-width: 2; }
.fb-nut { stroke: var(--ink); stroke-width: 5; }
.fb-string { stroke: #5d5850; }
.fb-string.off { opacity: .25; }
.fb-inlay { fill: #d6c7a8; }
.fb-num { font-size: 10px; fill: var(--muted); }
.fb-hit { cursor: pointer; }
.fb-mark circle { fill: var(--ink); }
.fb-mark text { font-size: 9px; font-weight: 700; fill: #fff; pointer-events: none; }
.fb-mark.cur circle { fill: var(--accent); }
.fb-mark.ok circle { fill: var(--ok); }
.fb-mark.bad circle { fill: var(--bad); }
.fb-mark.hint circle { fill: var(--accent); opacity: .75; }
.fb-mark { pointer-events: none; }

/* quiz bits */
.prompt { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; text-align: center; padding: 6px 12px; }
.feedback { text-align: center; min-height: 1.6em; padding: 4px 16px; font-weight: 500; }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 8px 14px; }
.ans { font: inherit; font-weight: 600; padding: 14px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.ans.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.ans.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.big-play { padding: 12px 28px; font-size: 1.05rem; }
details.intro { margin: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; }
details.intro summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.intro-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
svg.rhythm.mini { width: 150px; flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card h3 { color: var(--ink); font-family: var(--serif); font-size: 1.1rem; margin: 0 0 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-staff svg { width: 100%; }

/* key signatures */
.key-stage svg.staff { width: 100%; max-width: 340px; max-height: 30vh; }
.key-stage { flex: none; min-height: 0; padding: 0 12px; }
.answers.compact { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.answers.compact .ans { padding: 10px 4px; font-size: .9rem; }
@media (orientation: landscape) and (max-height: 520px) { .answers.compact { grid-template-columns: repeat(5, 1fr); } }

/* rhythm */
.rhythm-stage svg { width: 100%; max-width: 760px; max-height: 34vh; }
.status { text-align: center; font-weight: 600; min-height: 1.5em; padding: 2px 14px; }
.tap-pad { display: block; width: calc(100% - 28px); margin: 6px 14px; height: 110px; border-radius: 18px; border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); font: 700 1.4rem/1 var(--serif); letter-spacing: .2em; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.tap-pad.hit { background: var(--accent); color: #fff; }
.rhythm-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 14px; font-size: .9rem; }
.rhythm-settings input[type=range], details input[type=range] { vertical-align: middle; accent-color: var(--accent); width: 160px; }

/* landscape phones: staff left of nothing — just squeeze vertical space */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --kbh: clamp(80px, 30dvh, 170px); }
  .play .stats { display: none; }
  /* lessons: text left, staff right, keyboard underneath — one screen, no page scroll */
  main.lesson { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 4px; }
  .lesson-top { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.15fr; gap: 8px; }
  .lesson-text { overflow-y: auto; padding: 6px 4px 0 16px; font-size: .85rem; }
  .lesson-text p { margin: 0 0 .5em; }
  .lesson-side { display: flex; flex-direction: column; min-height: 0; }
  .lesson-side .stage { flex: 1; min-height: 0; }
  .lesson-side .stage svg.staff { height: 100%; width: auto; max-width: 100%; max-height: none; }
  .lesson-side .row { padding: 4px 8px; }
  .lesson-side .btn { padding: 7px 14px; }
  main.lesson > .pad { flex: none; padding: 4px 12px; --kbh: clamp(72px, 25dvh, 150px); }
  .play .stage svg.staff { max-height: none; height: 100%; width: auto; max-width: 100%; }
  .play .stage { padding: 0 8px; }
  header.bar h1 { font-size: .95rem; }
  header.bar { padding: 4px 12px; }
  .kb-slider-row { padding-top: 6px; }
  .kb-slider { height: 22px; }
  .hero { padding-top: 12px; }
  .stage { min-height: 0; padding: 2px 12px; }
  .stats, .drill-stats { padding: 2px; }
  .drill-stats b { font-size: 1.2rem; }
  .play .pad { padding: 4px 12px; }
  .pad-body { padding-top: 4px; }
  .nb { padding: 10px 0; }
  .tap-pad { height: 80px; }
  .fb svg { max-height: 46vh; }
}
@media (min-width: 900px) { :root { --kbh: 190px; } }
/* Key signatures → Play: wider staff (8 notes + signature + bar line). */
.feedback.why { font-size: .92rem; min-height: 2.6em; }
/* Key cards: notes the key signature changes. */
svg .note.sig text.smufl, svg .sig .mark { fill: var(--meh); }
svg .note.cur.sig text.smufl { fill: var(--accent); }
.portrait-only { display: none; }
@media (orientation: portrait) { .portrait-only { display: block; } }
/* rhythm timing strip (after a play-along) */
svg.timing { width: 100%; max-width: 760px; display: block; margin: 4px auto 0; font-family: var(--sans, system-ui); }
.tl-beat { stroke: currentColor; opacity: .12; }
.tl-bar { stroke: currentColor; opacity: .35; }
.tl-label { font-size: 12px; fill: currentColor; opacity: .6; }
.tl-note { fill: currentColor; opacity: .22; }
.tl-tap { fill: #3a8a4f; }
.tl-extra { fill: #c0392b; }
.tl-link { stroke: currentColor; opacity: .3; stroke-dasharray: 2 2; }
.tl-ms { font-size: 11px; text-anchor: middle; fill: currentColor; opacity: .75; }
.tl-ms.off { fill: #c0392b; opacity: 1; }
.tl-avg { font-size: 12px; text-anchor: end; fill: currentColor; opacity: .7; }
.timing-box { padding: 0 14px; }
/* practice card (home) */
.practice-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 4px 14px 6px; padding: 12px 14px 8px; }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pc-today b { font-family: var(--serif); font-size: 1.5rem; margin-right: 2px; }
.pc-meter { height: 6px; width: 180px; max-width: 50vw; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.pc-meter div { height: 100%; background: var(--accent); border-radius: 3px; }
.pc-streak { text-align: right; font-size: .78rem; color: var(--muted); line-height: 1.2; }
.pc-streak b { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--ink, inherit); }
.pc-chart { display: block; width: 100%; max-width: 420px; margin: 10px 0 2px; }
.pc-base { stroke: var(--line); }
.pc-hit { fill: transparent; }
.pc-bar { fill: var(--accent); opacity: .45; }
.pc-bar.met { opacity: 1; }
.pc-goal { stroke: currentColor; opacity: .45; stroke-dasharray: 3 3; }
.pc-axis { font-size: 10px; fill: currentColor; opacity: .55; }
.pc-axis.end { text-anchor: end; }
.mic-toggle { font-size: .92rem; display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
/* "written an octave higher" line with an info toggle (fretboard Read it) */
.octave-note { margin: 4px 14px; text-align: center; font-size: 0.9em; color: var(--muted, #666); }
.octave-note p { margin: 0; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 4px; border-radius: 50%; border: 1.5px solid var(--accent); background: none; color: var(--accent); font: italic 700 13px/1 Georgia, serif; cursor: pointer; vertical-align: middle; padding: 0; }
.info-btn[aria-expanded="true"] { background: var(--accent); color: var(--card, #fff); }
.info-text { max-width: 34em; margin: 8px auto 0; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; line-height: 1.45; }
/* Full-screen toggle in the top bar */
.fs-btn { flex: none; margin-left: 6px; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--accent); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
/* Landscape phones: give the staff the height — one-line stats, shorter keyboard. */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --kbh: clamp(70px, 26dvh, 150px); }
  .drill-stats { padding: 0 8px; }
  .drill-stats div { flex-direction: row; align-items: baseline; gap: 6px; }
  .drill-stats b { font-size: 1rem; }
  .play .stage { padding: 0 4px; }
  .fs-btn { width: 28px; height: 28px; font-size: 15px; }
}
/* Very short landscape (Safari with tabs + address bar: ~200–300 px tall):
   stats move up into the empty middle of the title bar; everything slims. */
@media (orientation: landscape) and (max-height: 330px) {
  :root { --kbh: clamp(56px, 28dvh, 90px); }
  header.bar { min-height: 34px; padding: 2px 10px; }
  header.bar h1 { font-size: .85rem; }
  .seg-small button, .seg-small .seg-btn { padding: 3px 9px; font-size: .78rem; }
  .fs-btn { width: 26px; height: 26px; font-size: 14px; }
  .play .drill-stats span { font-size: .7rem; }
  .play .drill-stats b { font-size: .9rem; }
  .play .pad { padding: 2px 10px; }
  .kb-slider-row { padding-top: 2px; }
  .kb-slider { height: 16px; }
}
@media (orientation: landscape) and (max-height: 330px) and (min-width: 820px) {
  .play .drill-stats { position: fixed; top: 0; left: 50%; transform: translateX(-50%); height: 38px; padding: 0; gap: 18px; justify-content: center; align-items: center; z-index: 5; }
}

/* Note colours (optional): rainbow by letter, C red … B violet, as on school
   Boomwhackers/handbells. Sharps and flats keep their letter's colour.
   Off in timed runs (.no-colour). */
:root { --n0: #d62828; --n1: #e8710a; --n2: #c99a00; --n3: #2b9348; --n4: #1971c2; --n5: #5f3dc4; --n6: #c2255c; }
/* With colours, right/wrong is the ✓/✗ under the note; the notehead keeps its letter colour. */
html.note-colours main:not(.no-colour) svg .note:is(.ok,.bad,.meh) text.smufl { fill: var(--ink); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="0"] { fill: var(--n0); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="1"] { fill: var(--n1); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="2"] { fill: var(--n2); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="3"] { fill: var(--n3); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="4"] { fill: var(--n4); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="5"] { fill: var(--n5); }
html.note-colours main:not(.no-colour) svg .note text.head[data-li="6"] { fill: var(--n6); }
html.note-colours main:not(.no-colour) svg .note .hit text.head { fill: var(--ok); }
/* The current note keeps its colour; a soft halo marks it instead of blue. */
html.note-colours main:not(.no-colour) svg .note.cur text.head { filter: drop-shadow(0 0 2.5px rgba(30,79,122,.9)); }
html.note-colours main:not(.no-colour) .key.white[data-li]:not(.ok):not(.bad)::after { content: ''; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 6px; border-radius: 3px; background: var(--c); }
.key.white[data-li="0"] { --c: var(--n0); }
.key.white[data-li="1"] { --c: var(--n1); }
.key.white[data-li="2"] { --c: var(--n2); }
.key.white[data-li="3"] { --c: var(--n3); }
.key.white[data-li="4"] { --c: var(--n4); }
.key.white[data-li="5"] { --c: var(--n5); }
.key.white[data-li="6"] { --c: var(--n6); }

/* Guitar tab */
svg.tab { width: 100%; max-width: 420px; display: block; margin: 4px auto; }
.stage svg.tab { max-width: 260px; }
svg.tab .tab-line { stroke: var(--muted); stroke-width: 1; }
svg.tab .tab-name { font-size: 9px; fill: var(--muted); }
svg.tab .tab-clef { font: 700 12px var(--serif); fill: var(--ink); }
svg.tab .tab-bg { fill: var(--card); }
.stage svg.tab .tab-bg { fill: var(--paper); }
svg.tab .tab-num { font: 600 12px ui-monospace, Menlo, monospace; fill: var(--ink); }
svg.tab .cur .tab-num { fill: var(--accent); }
.inline-glyph { font-size: 1.6em; line-height: 0; vertical-align: -0.15em; padding: 0 2px; }

/* Form & road maps */
.form-demo { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.form-sec { border-left: 4px solid var(--accent); padding: 2px 0 2px 8px; }
.form-sec.sec-b, .form-sec.sec-bridge, .form-sec.sec-chorus { border-color: var(--meh); }
.form-sec.sec-intro, .form-sec.sec-outro { border-color: var(--line); }
.form-sec.sec-2 { border-color: var(--ok); } .form-sec.sec-3 { border-color: var(--meh); }
.form-tag { font-size: .78rem; font-weight: 700; color: var(--muted); }
.form-bars { display: flex; flex-wrap: wrap; gap: 4px; }
.form-bar { min-width: 38px; text-align: center; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; font-size: .85rem; background: var(--paper); transition: background .1s; }
.form-bar.now { background: var(--accent); color: #fff; border-color: var(--accent); }
svg.roadmap { width: 100%; max-width: 480px; display: block; margin: 0 auto; }
svg.roadmap .rm-line { stroke: var(--ink); stroke-width: 1.2; }
svg.roadmap .rm-line.thick { stroke-width: 3.5; }
svg.roadmap .rm-label { font: 600 20px var(--serif); fill: var(--ink); }
svg.roadmap .rm-volta { fill: none; stroke: var(--ink); stroke-width: 1.2; }
svg.roadmap .rm-small { font: 600 10px -apple-system, system-ui, sans-serif; fill: var(--ink); }
svg.roadmap .rm-word { font: italic 600 10px var(--serif); fill: var(--ink); }

/* Chords in a key */
svg .chord-sym { fill: var(--ink); font-size: 12px; }
.chord-btns { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0; }
.chord-btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-width: 0; }
.chord-btn b { font-size: .78rem; white-space: nowrap; letter-spacing: -.02em; }
.chord-btn span { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.prog-list { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mode-chords { border-collapse: collapse; width: 100%; font-size: .85rem; }
.mode-chords th { text-align: left; font-weight: 600; font-size: .8rem; padding: 4px 6px 4px 0; }
.mode-chords td { padding: 4px 4px; }
.mode-chords td.nums { font-size: .8rem; white-space: nowrap; word-spacing: .15em; }

/* Note colours on the fretboard: dots take their letter's colour; right or
   wrong is a small ✓/✗ badge. Name buttons get a strip. */
html.note-colours main:not(.no-colour) .fb-mark[data-li] > circle { fill: var(--c); }
.fb-badge { display: none; }
html.note-colours main:not(.no-colour) .fb-mark[data-li] .fb-badge { display: inline; }
.fb-badge circle { stroke: #fff; stroke-width: 1.5; }
.fb-mark.ok .fb-badge circle { fill: var(--ok); }
.fb-mark.bad .fb-badge circle { fill: var(--bad); }
.fb-mark .fb-badge text { font-size: 9px; }
html.note-colours main:not(.no-colour) .fb-mark[data-li].hint circle { opacity: 1; }
html.note-colours main:not(.no-colour) .nb[data-li]:not(.ok):not(.bad) { box-shadow: inset 0 -6px 0 var(--c); }
.fb-mark[data-li="0"], .nb[data-li="0"] { --c: var(--n0); }
.fb-mark[data-li="1"], .nb[data-li="1"] { --c: var(--n1); }
.fb-mark[data-li="2"], .nb[data-li="2"] { --c: var(--n2); }
.fb-mark[data-li="3"], .nb[data-li="3"] { --c: var(--n3); }
.fb-mark[data-li="4"], .nb[data-li="4"] { --c: var(--n4); }
.fb-mark[data-li="5"], .nb[data-li="5"] { --c: var(--n5); }
.fb-mark[data-li="6"], .nb[data-li="6"] { --c: var(--n6); }

/* Tune runs: the name of the piece after the last note. */
.tune-reveal { text-align: center; margin: 6px 0 2px; display: grid; gap: 6px; justify-items: center; }
