/* Sit in the Pocket: shared styles for every page (screen and print).
   The light colours below are the paper look: printing and the PDFs use them.
   On screen, the "screen theme" section at the end turns them into the dark looper look. */
:root {
  --ink: #1a1a1a; --muted: #555; --line: #d9d9d9; --accent: #1f4e79; --bg: #fafafa; --card: #fff;
  --root: #D55E00; --third: #0072B2; --fifth: #009E73; --seventh: #CC79A7;
  --hi: #B5400F;                     /* rust highlight on the cheat sheet */
  --sharp: #0072B2; --flat: #D55E00; --tint-sharp: #CFE3F1; --tint-flat: #F7DDCB; --tint-both: #E3E3E3;
  --shade: #FBE9E1; --head: #EEF2F6;
  --on-accent: #fff; --go: #0a7b4f; --warn: #b3261e;   /* text on the accent colour; go / right; warning / wrong */
  --bar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* hidden always wins over a display set below */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.55 var(--font); }
a { color: var(--accent); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 8px; z-index: 50; background: #fff; padding: 8px 12px; }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

/* ---------- top bar: home link and site menu */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--accent); color: #fff; }
.topbar-in { max-width: 1320px; margin: 0 auto; padding: 8px 16px; min-height: var(--bar-h);
             display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.topbar a { color: #fff; }
.home { font-weight: 700; text-decoration: none; font-size: 17px; }
.home:hover { text-decoration: underline; }
.dl a { display: inline-block; margin-left: 4px; padding: 3px 10px; border: 1.5px solid var(--accent);
        border-radius: 8px; font-weight: 600; text-decoration: none; color: var(--accent); }
.dl a:hover { background: #EEF3F8; }
.keypanel { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 18px 0 4px;
            padding: 16px 20px; background: #EEF3F8; border: 2px solid var(--accent); border-radius: 12px; }
.keypick { font-size: 21px; font-weight: 700; color: var(--ink); }
.keypanel select { font: inherit; font-size: 22px; font-weight: 700; padding: 8px 14px; border-radius: 10px;
                   border: 2px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; }
.keypanel select:hover { background: #f6f9fc; }
.keyhint { color: var(--muted); font-size: 16px; flex-basis: 100%; }
.showpanel { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 12px 0 4px; }
.showlabel { font-size: 19px; font-weight: 700; color: var(--ink); }
.showpanel button { font: inherit; font-size: 19px; font-weight: 700; padding: 6px 16px; border-radius: 10px;
                    border: 2px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; }
.showpanel button:hover { background: #f6f9fc; }
.showpanel button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tbl tr.here > * { background: #FFF1C2; font-weight: 700; }
.bw .tbl tr.here > * { background: #e4e4e4; }
.dlrow { margin-top: 10px !important; font-size: 15px; color: var(--muted); }

/* ---------- page layout: contents on the left on wide screens, on top on narrow ones */
.layout { max-width: 1320px; margin: 0 auto; padding: 0 16px;
          display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
.layout.single { grid-template-columns: minmax(0, 1fr); max-width: 1020px; }
.side { position: sticky; top: calc(var(--bar-h) + 16px); align-self: start;
        max-height: calc(100vh - var(--bar-h) - 32px); overflow-y: auto; padding: 24px 4px 24px 0; }
.contents h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.contents ul { list-style: none; margin: 0; padding: 0; }
.navsec > span { display: block; font-weight: 700; font-size: 15px; margin: 14px 0 4px; }
.navsec li a { display: block; padding: 4px 10px; border-left: 3px solid transparent;
               text-decoration: none; color: var(--ink); font-size: 15px; line-height: 1.35; }
.navsec li a:hover { background: #eef3f8; }
.navsec li a.here { border-left-color: var(--accent); background: #eef3f8; font-weight: 700; color: var(--accent); }

main { min-width: 0; padding-bottom: 60px; }
.pagehead { padding: 28px 0 8px; }
h1 { font-size: 36px; line-height: 1.15; margin: 0 0 6px; }
.pagehead > p { margin: 0; color: var(--muted); }
.key { margin: 18px 0 0; padding: 14px 18px; background: var(--card); border: 1px solid var(--line);
       border-radius: 10px; font-size: 16px; color: var(--muted); }
.key p { margin: 0 0 8px; }
.key p:last-child { margin-bottom: 0; }
.key b { color: var(--ink); }
.key summary { font-weight: 700; color: var(--ink); cursor: pointer; }   /* home page: folds shut on phones */
.key[open] summary { margin-bottom: 8px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 0; color: var(--ink); }
.li { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.sw { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
      font: 700 12px/1 var(--font); color: #fff; border: 1.5px solid transparent; }
.sw.root { background: var(--root); } .sw.third { background: var(--third); }
.sw.fifth { background: var(--fifth); } .sw.seventh { background: var(--seventh); color: #000; }
.sw.other { background: #fff; color: var(--ink); border-color: var(--ink); }
.sw.tint { border-radius: 4px; width: 30px; height: 18px; border-color: #555; }
.sw.tint.sharp { background: var(--tint-sharp); } .sw.tint.flat { background: var(--tint-flat); }
.bwonly { display: none; }
.c-root { color: var(--root); } .c-third { color: var(--third); } .c-fifth { color: var(--fifth); } .c-seventh { color: #9E4F7F; }

.sectitle { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
            margin: 40px 0 0; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.scale { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
         margin: 18px 0 0; padding: 22px 24px 14px; scroll-margin-top: calc(var(--bar-h) + 14px); }
.scale header h3 { font-size: 28px; line-height: 1.2; margin: 0 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { background: #f1f4f7; border-radius: 6px; padding: 4px 10px; font-size: 16px; }
.chip b { margin-right: 6px; }
.desc { margin: 4px 0 0; }

/* ---------- blocks: two columns on wide screens */
.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin-top: 14px; align-items: start; }
.blk { grid-column: 1 / -1; min-width: 0; }
.blk.half { grid-column: auto; }
.fig { margin: 0; padding: 8px 0 0; min-width: 0; }
.fig.wide { grid-column: 1 / -1; }
.fig figcaption { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.fig .sub { font-weight: 400; color: var(--muted); font-size: 15px; margin-left: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.fig .cap { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.fig.leftout p { margin: 6px 0; color: var(--muted); font-size: 15px; font-style: italic; }
.svgwrap { min-width: 0; }
/* "Hear it" (site/sound.js): the button, and each dot grows and rings while it sounds */
.hear { font: inherit; font-size: 14px; font-weight: 600; margin-left: 10px; padding: 2px 10px; vertical-align: 1px;
        border: 1.5px solid var(--accent); border-radius: 8px; background: #fff; color: var(--accent); cursor: pointer; }
/* a chord has two: on their own line under the title */
.hears { display: flex; gap: 8px; margin-top: 6px; }
.hears .hear { margin-left: 0; }
.hear:hover { background: #EEF3F8; }
.hear[aria-pressed="true"] { background: var(--accent); color: #fff; }
.fig .svgwrap svg:has(.dot[data-p]) { cursor: pointer; }
.dot[data-p] { transform-box: fill-box; transform-origin: center; transition: transform .08s; }
.neck:not(.chord) .dot.sounding { transform: scale(1.3); }   /* chords: just the ring, open-string dots sit by the labels */
.neck .dot.sounding circle { stroke: var(--ink); stroke-width: 3.5; }
.fig.wide .svgwrap { overflow-x: auto; }
.fig.wide svg.neck { min-width: 640px; }
.btitle { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--hi); margin: 8px 0 8px; }
.btitle.big { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 22px; margin: 0; }
.bnote { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 8px; }
.after { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.colsblk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; align-items: start; }
.colsblk .col > .blk + .blk { margin-top: 14px; }
.blk p { margin: 6px 0; }

/* ---------- diagrams */
svg.neck { display: block; max-width: 100%; height: auto; }
.neck text { font-family: var(--font); }
.neck .sname { font-size: 14px; fill: #555; text-anchor: end; }
.neck .fnum { font-size: 15px; fill: #333; text-anchor: middle; }
.neck .fret { stroke: #8c8c8c; stroke-width: 1; }
.neck .nut { stroke: #000; stroke-width: 5; }
.neck .string { stroke: #404040; }
.neck .inlay { fill: #8c8c8c; }
.neck .mute { font-size: 20px; font-weight: 700; text-anchor: middle; fill: var(--ink); }
.neck .colhead { font-size: 11px; fill: #555; text-anchor: middle; }
.dot circle { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
.dot text { font-size: 14px; font-weight: 700; text-anchor: middle; fill: var(--ink); }
.dot.small text { font-size: 11.5px; }
.chord .dot text { font-size: 15px; }
.dot text.sm { font-size: 12.5px; }
/* a diagram that can show intervals, fingers or notes draws all three; the Show button (site.js) picks one.
   Intervals until a choice is made. On paper a chord diagram shows its finger numbers. */
.dot text.t-int, .dot text.t-fin, .dot text.t-note { display: none; }
html:not([data-show]) .dot text.t-int, html[data-show="int"] .dot text.t-int,
html[data-show="fin"] .dot text.t-fin, html[data-show="note"] .dot text.t-note { display: inline; }
@media print {
  .chord .dot text.t-int, .chord .dot text.t-note { display: none !important; }
  .chord .dot text.t-fin { display: inline !important; }
}
.dot.root circle { fill: var(--root); stroke: var(--root); }
.dot.third circle { fill: var(--third); stroke: var(--third); }
.dot.fifth circle { fill: var(--fifth); stroke: var(--fifth); }
.dot.seventh circle { fill: var(--seventh); stroke: var(--seventh); }
.dot.root text, .dot.third text, .dot.fifth text { fill: #fff; }
.dot.seventh text { fill: #000; }

/* ---------- tables */
.twrap { overflow-x: auto; }
.twrap.boxed { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.tcap { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.tcap b { color: var(--ink); font-size: 16px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 16px; }
.tbl th, .tbl td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl thead th { background: var(--head); font-weight: 700; border-bottom: 1px solid #b9c2cc; }
.tbl tbody th { font-weight: 700; white-space: nowrap; }
.tbl.center td, .tbl.center thead th:not(:first-child) { text-align: center; }
.tbl .shade { background: var(--shade); }
.tbl.big td { font-size: 18px; }
.tbl.notes td, .tbl.notes th { border-bottom: 0; padding: 2px 6px; font-size: 17px; text-align: center; }
.tbl.notes td:nth-child(1) { color: var(--muted); font-size: 15px; }
.tbl.pattern td { font-weight: 700; font-size: 20px; text-align: center; }
.tbl.notation td { padding: 2px 4px; }
.hi { color: var(--hi); }
.sharp { color: var(--sharp); } .flat { color: var(--flat); }
big { font-size: 1.3em; font-weight: 700; letter-spacing: .25em; margin-left: 10px; }
[class^="chip-"] { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 5px;
                   font: 700 13px/1 var(--font); }
.chip-maj { background: #1f3550; color: #fff; }
.chip-min { background: #d3e0ec; color: #1f3550; }
.chip-dim { border: 1.5px dashed #1f3550; color: #1f3550; }
.chip-w { background: #d3e0ec; color: #1f3550; min-width: 20px; height: 20px; font-size: 12px; }
.chip-h { background: var(--hi); color: #fff; min-width: 20px; height: 20px; font-size: 12px; }

/* 12-bar blues and chord boxes */
.bars { border-collapse: collapse; width: 100%; }
.bars td { border: 1.5px solid #333; padding: 6px 10px; width: 25%; }
.bars .bar { font-size: 18px; }
.bars .num { float: right; color: var(--muted); font-size: 14px; margin-top: 3px; }
.bar.hi { color: var(--hi); }
/* a Nashville chart: big numbers, one bar per box; a split bar's numbers are underlined together */
.nchart { border-collapse: collapse; width: 100%; }
.nchart td { border: 1.5px solid #333; border-width: 0 1.5px; padding: 8px 10px 6px; width: 25%; text-align: center; }
.nchart tr + tr td { border-top: 1px dashed #999; }
.nchart .nums { display: inline-flex; gap: 14px; font-size: 26px; line-height: 1.1; padding: 0 4px 2px; }
.nchart .nums.split { border-bottom: 2.5px solid #333; }
.nchart .names { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; white-space: pre; }
.boxes { border-collapse: separate; border-spacing: 6px; }
.boxes th { text-align: left; padding-right: 12px; white-space: nowrap; }
.boxes td { border: 1px solid #333; text-align: center; padding: 4px 10px; min-width: 58px; }
.boxes td.first { border-width: 2.5px; }
.boxes td b { display: block; font-size: 19px; }
.boxes td span { font-size: 13px; color: var(--muted); }
@media screen and (max-width: 560px) {
  .boxes, .boxes tbody { display: block; }
  .boxes tr { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
  .boxes th { flex: 0 0 100%; padding: 0; }
  .boxes td { flex: 1 1 0; min-width: 0; padding: 4px 1px; }
  .boxes td b { font-size: 15px; }
}

/* scale step lines (cheat sheet) */
.sbox { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.sname span { color: var(--muted); font-size: 14px; letter-spacing: .1em; margin-left: 6px; }
.sline { border-collapse: collapse; }
.sline td { text-align: center; padding: 1px 2px; min-width: 18px; }
.sline .deg td { color: var(--muted); font-size: 15px; }
.sline .sn { font-weight: 700; font-size: 18px; }

/* definitions, bullets, time signatures */
.defs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 6px 0; }
.defs dt { font-weight: 700; }
.defs dd { margin: 0; }
.bul { margin: 4px 0; padding-left: 20px; }
.bul li { margin: 4px 0; }
.bul.cols2 { columns: 2 320px; column-gap: 32px; }
.bul.cols2 li { break-inside: avoid; }
.timesigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 10px; font-size: 15px; }
.ts { display: flex; gap: 10px; align-items: flex-start; }
.tsnum { display: inline-flex; flex-direction: column; line-height: 1; font-size: 22px; }

/* music symbols */
svg.music { display: inline-block; vertical-align: middle; overflow: visible; }
.music .staff { stroke: #777; stroke-width: .8; }
.music .nh { fill: var(--ink); }
.music .nh.open { fill: #fff; stroke: var(--ink); stroke-width: 1.8; }
.music .stem { stroke: var(--ink); stroke-width: 1.6; }
.music .beam { stroke: var(--ink); stroke-width: 4; }
.music .flag { fill: var(--ink); }
.music .restq { fill: var(--ink); }
.music .tuplet { font: 700 12px var(--font); text-anchor: middle; fill: var(--ink); }
.music .pickline { fill: none; stroke: var(--ink); stroke-width: 2; }

/* practice routine */
.rblk { margin-top: 8px; }
.rhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 2px solid var(--ink); padding-top: 12px; }
.tempo { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; }
.bnote2 { color: var(--muted); margin: 4px 0 8px !important; }
.rhythm { border-collapse: collapse; width: 100%; }
.rhythm th, .rhythm td { text-align: left; border-top: 1px solid var(--line); padding: 6px 10px; }
.rhythm th { width: 150px; }
.rhythm .rsym { width: 130px; }

/* circle of fifths */
.circ { text-align: center; }
svg.circle5 { max-width: 100%; height: auto; }
.circle5 .sec { fill: #fff; stroke: #333; stroke-width: .8; }
.circle5 .sec.sharp { fill: var(--tint-sharp); } .circle5 .sec.flat { fill: var(--tint-flat); } .circle5 .sec.both { fill: var(--tint-both); }
.circle5 .outline { fill: none; stroke: #000; stroke-width: 3.2; }
.circle5 text { font-family: var(--font); text-anchor: middle; fill: var(--ink); }
.circle5 .maj { font-size: 26px; font-weight: 700; } .circle5 .maj.small { font-size: 17px; }
.circle5 .min { font-size: 17px; } .circle5 .min.small { font-size: 12px; }
.circle5 .sig { font-size: 15px; }
.circle5 .mid { font-size: 13px; }

/* black & white: the root is a solid black dot, everything else is white; highlights are bold black */
.bw .dot circle { fill: #fff; stroke: var(--ink); }
.bw .dot text { fill: var(--ink); }
.bw .dot.root circle { fill: #000; stroke: #000; }
.bw .dot.root text { fill: #fff; }
.bw .sw.root { background: #000; }
.bw .legend .bwhide { display: none; }
.bw .legend .bwonly { display: inline-flex; }
.bw .hi, .bw .sharp, .bw .flat, .bw .c-root, .bw .c-third, .bw .c-fifth, .bw .c-seventh { color: #000; }
.bw .bar.hi { text-decoration: underline; }
.bw .chip-h { background: #000; }
.bw .btitle { color: #000; }
.bw .tbl .shade { background: #e9e9e9; }
.bw .circle5 .sec { fill: #fff !important; }

.pager, .sheetnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; }
.pager { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager a, .sheetnav a { text-decoration: none; font-weight: 600; }
.pager a:hover, .sheetnav a:hover { text-decoration: underline; }
.pager > :last-child, .sheetnav > :last-child { text-align: right; }
.foot { margin-top: 30px; color: var(--muted); font-size: 14px; }
.foot p { margin: 4px 0; }
.foot .credit { margin-top: 14px; font-size: 12px; }
.foot .credit a { color: inherit; }
.sitefoot { max-width: 1200px; margin: 28px auto 0; padding: 14px 20px 22px; border-top: 1px solid var(--line);
            color: var(--muted); font-size: 13px; text-align: center; }
.sheetnav { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 16px; }

.fab { position: fixed; right: 18px; bottom: 18px; z-index: 30; background: var(--accent); color: #fff;
       text-decoration: none; font-weight: 700; padding: 10px 16px; border-radius: 999px;
       box-shadow: 0 2px 10px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s; }
.fab.show { opacity: 1; pointer-events: auto; }
.cover-print { display: none; }
.cover-print h1 { font-size: 26pt; }
.cover-print .csec { font-weight: 700; font-size: 14pt; margin: 14pt 0 4pt; }
.cover-print ol { list-style: none; margin: 0; padding: 0 0 0 12pt; }
.cover-print li { display: flex; justify-content: space-between; font-size: 12.5pt; padding: 2pt 0; border-bottom: 1px dotted #aaa; max-width: 5.5in; }

/* ---------- practice page */
.practice-main { max-width: 1020px; margin: 0 auto; padding: 0 16px 60px; }
.pstep { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-top: 16px; }
.plabel-big { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; margin-bottom: 10px; }
.plabel-big .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
                   background: var(--accent); color: #fff; font-size: 16px; }
.bigselect { font: inherit; font-size: 20px; font-weight: 600; padding: 8px 12px; border-radius: 10px;
             border: 2px solid var(--accent); background: #fff; color: var(--ink); max-width: 100%; }
.prhythm { display: flex; align-items: center; gap: 16px; margin-top: 26px; }
.prhythm p { margin: 0; color: var(--muted); }
.rsym.big svg.music { transform: scale(1.5); transform-origin: left center; margin-right: 30px; }
.mrow { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; }
.mrow.small { margin-top: 14px; font-size: 16px; gap: 10px 26px; }
.mrow.small label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 100%; }   /* a long menu drops under its label */
.mrow.small select { font: inherit; padding: 4px 6px; border-radius: 6px; min-width: 0; max-width: 100%; }
.mstart { font: inherit; font-size: 24px; font-weight: 700; padding: 12px 28px; border-radius: 12px; border: 0;
          background: var(--accent); color: #fff; cursor: pointer; min-width: 150px; }
.mstart[aria-pressed="true"] { background: #8a2b0c; }
.tempo-ctl { display: flex; align-items: center; gap: 10px; }
.mstep { font: inherit; font-size: 28px; font-weight: 700; width: 48px; height: 48px; border-radius: 50%;
         border: 2px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; line-height: 1; }
.bpm { display: flex; flex-direction: column; align-items: center; min-width: 84px; }
.bpm output { font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bpm span { font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.mtap { font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--accent);
        background: #fff; color: var(--accent); cursor: pointer; }
#m-slider { width: 100%; margin: 16px 0 6px; accent-color: var(--accent); }
.lights { display: flex; gap: 12px; margin: 8px 0 0; }
.lights span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #999; background: #fff; }
.lights span.one { border-color: var(--root); }
.lights span.on { background: var(--accent); border-color: var(--accent); }
.lights span.one.on { background: var(--root); border-color: var(--root); }
.presets { display: inline-flex; align-items: center; gap: 6px; }
.plabel { font-weight: 700; margin-right: 4px; }
.plabel small { font-weight: 400; color: var(--muted); }
.preset { font: inherit; font-weight: 600; padding: 4px 10px; border-radius: 8px; border: 1.5px solid var(--accent);
          background: #fff; color: var(--accent); cursor: pointer; }
.preset.on { background: var(--accent); color: #fff; }
.pscale h3 { font-size: 26px; margin: 0 0 4px; }
/* the floating metronome: bottom right of the screen; on a phone, along the bottom edge */
.mopen { font: inherit; font-size: 20px; font-weight: 700; padding: 8px 18px; border-radius: 10px; cursor: pointer;
         border: 2px solid var(--accent); background: var(--accent); color: #fff; white-space: nowrap; }
.mopen.running { background: #8a2b0c; border-color: #8a2b0c; }
.mfloat { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 440px; max-width: calc(100vw - 40px);
          max-height: calc(100vh - 100px); overflow-y: auto; padding: 14px 16px; background: #fff;
          border: 2px solid var(--accent); border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.mfloat[hidden] { display: none; }
.mfrow { display: flex; align-items: center; gap: 12px; }
.mfloat .mstart { font-size: 20px; padding: 10px 16px; min-width: 112px; }
.mfloat .mstep { width: 42px; height: 42px; font-size: 24px; }
.mfloat .bpm { min-width: 62px; }
.mfloat .bpm output { font-size: 34px; }
.mclose { margin-left: auto; font: inherit; font-size: 28px; line-height: 1; width: 40px; height: 40px; border: 0;
          background: none; color: var(--muted); cursor: pointer; }
.mfloat .lights { margin: 10px 0 0; }
.mfloat .lights span { width: 22px; height: 22px; }
.mmore { margin-top: 10px; }
.mmore summary { cursor: pointer; font-weight: 600; color: var(--accent); }
@media screen and (max-width: 560px) {
  .mfloat { left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 70vh; padding: 8px 10px;
            border-width: 2px 0 0; border-radius: 0; }
  .mfrow { gap: 8px; }
  .mfloat .mstart { font-size: 18px; min-width: 96px; padding: 8px 10px; }
  .mclose { width: 34px; }
}
@media print { .mfloat, .mopen { display: none !important; } }

/* ---------- Scales page */
.scalepick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px 18px; align-items: end; }
.pfield label { display: block; font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.pfield .bigselect { width: 100%; }
.pfield .mopen { display: block; padding-top: 10px; padding-bottom: 10px; }
.prhythms .prhythm { margin-top: 0; }
.prhythms .bothways { margin: 14px 0 0; }
.prhythms .dlrow { margin-bottom: 0; }
.pwhat { font-size: 20px; font-weight: 700; margin: 2px 0 6px; }
.pnotes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 8px 0 10px; }
.pnotes span { font-weight: 700; color: var(--muted); }
.pnotes b { font-size: 24px; }
.pnotes small { flex-basis: 100%; font-size: 15px; color: var(--muted); }
@media screen and (max-width: 760px) {
  .scalepick { grid-template-columns: minmax(0, 1fr); }
  .pfield .mopen { width: 100%; }
}
.bw .lights span.one.on { background: #000; border-color: #000; }

/* ---------- reading page */
.small-note { font-size: 15px; color: var(--muted); }
.quizrow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 28px; align-items: start; }
.staffbox { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
svg.staff { display: block; width: 100%; height: auto; overflow: visible; }
.staff .sl { stroke: #333; stroke-width: 1.1; }
.staff .nh { fill: var(--ink); }
.staff .stem { stroke: var(--ink); stroke-width: 1.4; }
.staff .beam { stroke: var(--ink); stroke-width: 4.5; }
.staff .clefline { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.staff .clef8 { font: 700 11px var(--font); text-anchor: middle; fill: var(--ink); }
.staff .tsig { font: 800 21px var(--font); fill: var(--ink); text-anchor: middle; }
.staff .barline { stroke: #333; stroke-width: 1.2; }
.staff .barline.end { stroke-width: 4; }
.staff .barnum { font: 11px var(--font); fill: var(--muted); }
.staff .nname { font: 700 13px var(--font); text-anchor: middle; fill: var(--accent); }
/* play along: the note being played lights up */
.staff .pn .glow { fill: transparent; }
.staff .pn.now .glow { fill: #FBE3D2; }
.staff .pn.now .nh { fill: var(--root); }
.staff .pn.now .stem { stroke: var(--root); stroke-width: 2.2; }
.follow-status { font-size: 18px; margin: 0 0 6px; min-height: 1.5em; }
.follow-status .dim { color: #bbb; }
.qprompt { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.names { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.nbtn { font: inherit; font-size: 24px; font-weight: 800; padding: 10px 0; border-radius: 10px; cursor: pointer;
        border: 2px solid var(--accent); background: #fff; color: var(--accent); }
.nbtn:hover:not(:disabled) { background: #eef3f8; }
.nbtn:disabled { cursor: default; opacity: .55; }
.nbtn.right { background: #0a7b4f; border-color: #0a7b4f; color: #fff; opacity: 1; }
.nbtn.wrong { background: #fff; border-color: #b3261e; color: #b3261e; text-decoration: line-through; }
.qresult { font-size: 18px; font-weight: 700; min-height: 1.6em; margin: 12px 0 4px; }
.qresult.right { color: #0a7b4f; } .qresult.wrong { color: #b3261e; }
.minineck { width: 100%; max-width: 300px; height: auto; display: block; }
.minineck .nstring { stroke: #404040; } .minineck .nfret { stroke: #8c8c8c; } .minineck .nnut { stroke: #000; stroke-width: 5; }
.minineck .nlab { font: 12px var(--font); fill: #555; } .minineck .nlab.mid { text-anchor: middle; }
.minineck .ndot { fill: var(--accent); } .minineck .ndotlab { font: 700 12px var(--font); fill: #fff; text-anchor: middle; }
.score { font-size: 16px; color: var(--muted); margin: 10px 0 0; }
.score b { color: var(--ink); }
.linkbtn { font: inherit; font-size: 14px; background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.small-opt { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 15px; }
.mstart.small { font-size: 18px; padding: 8px 18px; min-width: 0; }
.piece { margin-top: 10px; }
.piece svg.staff { margin-bottom: 4px; }
@media screen and (max-width: 760px) {
  .quizrow { grid-template-columns: minmax(0, 1fr); }
  .piece { overflow-x: auto; }
  .piece svg.staff { min-width: 640px; }
  .nbtn { font-size: 21px; }
}
@media print {
  .readingpage .pagehead, .readingpage .pstep:not(:last-of-type), .readingpage .mrow, .readingpage .small-note, .follow-status { display: none !important; }
  .readingpage .pstep { border: 0; padding: 0; }
  .readingpage .plabel-big { display: none; }
  .readingpage .piece svg.staff { margin-bottom: 18pt; }
}

/* ---------- site menu (top bar) */
.topnav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-right: auto; margin-left: 18px; }
.topnav a { text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 10px; border-radius: 6px; }
.topnav a:hover { background: rgba(255,255,255,.15); }
@media screen and (max-width: 900px) {
  .topnav { order: 3; flex-basis: 100%; margin: 0 -6px; }
}
.accentpick { margin-left: 8px; font-size: 14px; }      /* the colour menu, at the right end of the bar */
@media screen and (max-width: 900px) {
  .accentpick { order: 2; margin-left: auto; }
}
@media screen and (max-width: 560px) {      /* phones: the menu stays on one row (slides sideways if it must) */
  .topnav { flex-wrap: nowrap; justify-content: space-between; gap: 0; margin: 0 -4px; overflow-x: auto; }
  .topnav a { font-size: 14px; padding: 6px 3px; white-space: nowrap; }
}
@media screen and (max-width: 380px) {
  .topnav a { font-size: 13px; padding: 6px 2px; }
}

/* ---------- home page groups, printables */
.group { scroll-margin-top: calc(var(--bar-h) + 10px); }
.gtitle { font-size: 26px; margin: 34px 0 2px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.gblurb { margin: 6px 0 0; color: var(--muted); }
.group .grid { margin-top: 14px; }

/* ---------- landing page: one card per category (each opens cat-<id>.html) */
.landing { max-width: 820px; padding-top: 40px; }
.landing .lead { font-size: 20px; color: var(--ink); margin-bottom: 12px; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin: 32px 0 30px; }
.catcard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
           overflow: hidden; text-decoration: none; color: var(--ink); }
.catcard:hover { border-color: var(--accent); }
.catthumb { aspect-ratio: 4 / 3; overflow: hidden; background: #eee; border-bottom: 1px solid var(--line); }
.catthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.catbody { padding: 16px 18px 18px; }
.catbody h2 { margin: 0 0 8px; font-size: 24px; color: var(--accent); }
.catbody p { margin: 0 0 8px; font-size: 16px; }
.catbody .meta { margin: 0; }
/* category pages */
.back { margin: 0 0 6px !important; font-size: 15px; }
.back a { text-decoration: none; }
.topnav a.on { background: rgba(255,255,255,.25); }
/* a card that joins several sheets (Diatonic thirds): a button for each, its PDF beside it */
.parts { display: flex; flex-direction: column; gap: 8px; }
.part { display: flex; align-items: center; gap: 10px; }
.partbtn { flex: 1; padding: 8px 12px; border-radius: 8px; background: #eef3f8; color: var(--ink);
           font-weight: 600; font-size: 16px; text-decoration: none; }
.partbtn:hover { filter: brightness(1.05); }
.ptable { table-layout: fixed; }
.ptable th { width: 38%; } .ptable .pn { width: 14%; } .ptable td:nth-child(3) { width: 20%; }
.ptable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.ptable th, .ptable td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable th a { font-size: 18px; text-decoration: none; }
.ptable th a:hover { text-decoration: underline; }
.ptable .pn { color: var(--muted); white-space: nowrap; }
.ptable .pdl { text-align: right; white-space: nowrap; }
.pbtn { display: inline-block; margin-left: 8px; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 15px;
        text-decoration: none; border: 1.5px solid var(--accent); color: var(--accent); background: #fff; }
.pbtn:first-child { background: var(--accent); color: #fff; }
.pbtn:hover { filter: brightness(1.1); }
.rowkey { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.rowkey select { font: inherit; font-weight: 700; color: var(--ink); padding: 3px 6px; border-radius: 6px; }
@media screen and (max-width: 640px) {
  .ptable tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .ptable th, .ptable td { border: 0; padding: 0; }
  .ptable .pdl { grid-column: 1 / -1; text-align: left; }
  .ptable .pdl .pbtn:first-child { margin-left: 0; }
}

/* ---------- home page */
.home-main { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 22px 0 30px; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ctop { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ctop h2 { font-size: 21px; margin: 0; }
.ctop h2 a { text-decoration: none; color: var(--accent); }
.ctop h2 a:hover { text-decoration: underline; }
.thumb { background: #eee; border-bottom: 1px solid var(--line); aspect-ratio: 8.5 / 11; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
/* card pictures come in each accent colour (violet is img/<slug>.png): show the one that matches the colour menu */
.thumb img.acc-sky, .thumb img.acc-lime, .catthumb img.acc-sky, .catthumb img.acc-lime { display: none; }
:root[data-accent="sky"] :is(.thumb, .catthumb) img.acc-violet,
:root[data-accent="lime"] :is(.thumb, .catthumb) img.acc-violet { display: none; }
:root[data-accent="sky"] :is(.thumb, .catthumb) img.acc-sky,
:root[data-accent="lime"] :is(.thumb, .catthumb) img.acc-lime { display: block; }
.cbody { padding: 14px 16px 16px; }
.cbody p { margin: 0 0 8px; font-size: 16px; }
.meta { font-size: 14px; color: var(--muted); }
.meta a { margin-left: 8px; font-weight: 600; }

/* ---------- narrow screens */
@media screen and (max-width: 900px) {
  .layout { display: block; }
  .side { position: static; max-height: none; overflow: visible; padding: 20px 0 0; }
  .contents > ul { columns: 2 240px; column-gap: 20px; }
  .navsec { break-inside: avoid; }
  .pagehead { padding-top: 16px; }
  .blocks { grid-template-columns: minmax(0, 1fr); }
  .blk.half { grid-column: 1 / -1; }
  .colsblk { grid-template-columns: minmax(0, 1fr); }
  .colsblk .col + .col { margin-top: 14px; }
}
@media screen and (max-width: 560px) {
  body { font-size: 17px; }
  h1 { font-size: 30px; }
  .scale { padding: 18px 10px 12px; scroll-margin-top: 8px; }
  .scale header h3 { font-size: 24px; }
  /* diagrams shrink to fit the phone, so draw their text and circles bigger */
  .neck:not(.chord) .dot circle { r: 16.5px; }
  .neck:not(.chord) .dot text { font-size: 16.5px; transform: translateY(1px); transform-box: fill-box; }
  .neck:not(.chord) .dot text.sm { font-size: 13px; }
  .neck .fnum { font-size: 18px; }
  .neck .sname { font-size: 16px; }
  .topbar { position: static; }
  .topbar-in { padding: 8px 12px; min-height: 0; }
  .dl a { padding: 4px 8px; }
  .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 3px 5px; }
  .timesigs { grid-template-columns: 1fr; }
  .rhythm th { width: auto; }
}

/* ---------- printing (also how the PDFs are made): one page per sheet page */
@media print {
  @page { size: letter; margin: 0.45in 0.5in 0.6in; }
  .thirdstab .tabsvg { max-width: 70%; }   /* diatonic thirds: four lines of tab and the diagram fit one page at full size */
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 11.5pt; }
  .topbar, .side, .pager, .fab, .skip, .foot, .sitefoot, .dlrow, .keypanel, .showpanel, .sectitle { display: none !important; }
  .layout, .layout.single { display: block; padding: 0; max-width: none; }
  main { padding: 0; }
  .pagehead { display: none; }
  .cover-print { display: block; break-after: page; }
  .scale { border: 0; border-radius: 0; padding: 0; margin: 0; break-before: page; }
  .cover-print + .section .scale:first-of-type, .section:first-of-type .scale:first-of-type { break-before: auto; }
  .scale header h3 { font-size: 22pt; }
  .scale header { border-bottom: 1px solid #999; padding-bottom: 6pt; }
  .blocks { gap: 6pt 18pt; margin-top: 8pt; }
  .fig { break-inside: avoid; }
  .hear, .hears { display: none !important; }
  .fig.wide .svgwrap { overflow: visible; }
  .fig.wide svg.neck { min-width: 0; }
  svg.neck { width: auto; max-width: 100%; }
  /* pages with just two diagrams: one above the other, full width, like the binder sheets */
  .blocks:has(> .neckfig:first-child + .neckfig:last-child) { grid-template-columns: minmax(0, 1fr); }
  .blocks:has(> .neckfig:first-child + .neckfig:last-child) svg.neck { width: 100%; max-width: 6.6in; }
  .twrap { overflow: visible; }
  .tbl { font-size: 10pt; }
  .tbl th, .tbl td { padding: 2px 5px; }
  .tbl.big td { font-size: 12pt; }
  .btitle { margin: 4pt 0 3pt; font-size: 10pt; }
  .bnote { font-size: 9.5pt; }
  .after, .fig .cap { font-size: 9.5pt; }
  .bul li { margin: 2px 0; }
  .fig figcaption { font-size: 12pt; margin-bottom: 2pt; }
  .chips { margin: 4pt 0 2pt; }
  .chip { font-size: 11pt; padding: 2px 8px; }
  .desc { margin: 2pt 0 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Fretboard page (site/fretboard.js) */
.neckbox { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px 0; margin-bottom: 16px;
           overflow-x: auto; }
.neck.trainer { width: 100%; min-width: 620px; height: auto; display: block; }   /* phones: slide sideways */
.trainer .fcol { fill: transparent; }
.trainer .fcol.outside { fill: #ececec; }
.trainer .boardmark { fill: #cfcfcf; }
.trainer .spot { display: none; }
.trainer .spot.ask, .trainer .spot.also { display: inline; }
.trainer .spot.ask circle { fill: var(--root); stroke: var(--root); }
.trainer .spot.ask text { fill: #fff; }
.trainer .spot.also circle { fill: #fff; stroke: var(--ink); }
/* Find the notes: every place in play can be clicked; marks, then right / wrong / missed at the end */
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.modebtn { font-size: 17px; padding: 6px 14px; }
.findbtns { margin: 4px 0 0; gap: 10px; }
.findbtns button:disabled { opacity: .45; cursor: default; }
.trainer.finding .spot.inplay { display: inline; cursor: pointer; }
.trainer.finding .spot.inplay circle { fill: transparent; stroke: transparent; }
.trainer.finding .spot.inplay:not(.mark):hover circle { stroke: var(--muted); stroke-dasharray: 3 3; }
.trainer.finding .spot.mark circle { fill: var(--accent); stroke: var(--accent); }
.trainer.finding .spot.mark text { fill: var(--on-accent); }
.trainer.finding .spot.good circle { fill: var(--go); stroke: var(--go); }
.trainer.finding .spot.bad circle { fill: var(--warn); stroke: var(--warn); }
.trainer.finding .spot.good text, .trainer.finding .spot.bad text { fill: #fff; }
.trainer.finding .spot.missed circle { fill: var(--card); stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 5 4; }
.trainer.finding .spot.missed text { fill: var(--ink); }
.trainer .octline, .trainer .uniline { stroke: var(--ink); stroke-width: 3; opacity: .5; stroke-linecap: round; }
.trainer .uniline { stroke-dasharray: 6 5; }
/* My map: every place in play, coloured by how well it's known */
.trainer.mapping .spot[class*="map-"] { display: inline; }
.trainer.mapping .spot.map-strong circle, .maplegend .lg.strong { fill: var(--go); stroke: var(--go); background: var(--go); }
.trainer.mapping .spot.map-shaky circle, .maplegend .lg.shaky { fill: var(--accent); stroke: var(--accent); background: var(--accent); }
.trainer.mapping .spot.map-weak circle, .maplegend .lg.weak { fill: var(--warn); stroke: var(--warn); background: var(--warn); }
.trainer.mapping .spot.map-new circle { fill: transparent; stroke: var(--muted); stroke-dasharray: 3 3; }
.trainer.mapping .spot.map-strong text, .trainer.mapping .spot.map-weak text { fill: #fff; }
.trainer.mapping .spot.map-shaky text { fill: var(--on-accent); }
.trainer.mapping .spot.map-new text { fill: var(--muted); }
.maplegend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 10px; font-size: 15px; }
.maplegend span { display: inline-flex; align-items: center; gap: 7px; }
.maplegend .lg { display: inline-block; width: 16px; height: 16px; border-radius: 50%; }
.maplegend .lg.new { border: 1.5px dashed var(--muted); }
.names.accs { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 8px; max-width: 72%; }
.nbtn.acc { font-size: 17px; line-height: 1.15; padding: 6px 0; }
.f-where { font-size: 16px; color: var(--muted); margin: 0 0 8px; min-height: 1.3em; }
.strings { margin-top: 10px; }
.strbox { font-weight: 600; }
.fretboardpage .small-opt { display: block; margin-top: 6px; }

/* ---------- Interval Finder page (site/interval-finder.js); Find mode reuses the Fretboard's .finding styles */
.ibtns.ivbtns { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 4px; }
@media (max-width: 560px) { .ibtns.ivbtns { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ivbtn.flash { border-color: #b3261e; color: #b3261e; }
.trainer .spot.root, .trainer .spot.q, .trainer .spot.named { display: inline; }
.trainer .spot.root circle { fill: var(--root); stroke: var(--root); }
.trainer .spot.root text { fill: #fff; }
.trainer .spot.q circle { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.trainer .spot.q text { fill: var(--ink); }
.trainer .spot.q.cur circle { stroke: var(--accent); stroke-width: 4; }
.trainer .spot.named circle { stroke-width: 0; }
.trainer .spot.named text { fill: #fff; }
.trainer .spot text .sub { font-size: 10px; font-weight: 400; }
.trainer .spot.c-root circle { fill: var(--root); } .trainer .spot.c-third circle { fill: var(--third); }
.trainer .spot.c-fifth circle { fill: var(--fifth); } .trainer .spot.c-seventh circle { fill: var(--seventh); }
.trainer .spot.c-other circle { fill: #6b6b6b; }
.ivfpage .if-ivs .strbox { margin-right: 2px; }
.trainer.mapping .spot.root circle { fill: var(--card); stroke: var(--root); stroke-width: 3.5; }   /* not to be read as Weak */
.trainer.mapping .spot.root text { fill: var(--root); }
.ivfpage #if-next { margin-top: 4px; }

/* ---------- Ear training page (site/ear.js) */
.ear-main .mrow .qprompt { margin: 0; }
.ibtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 16px; }
.ibtn { font: inherit; padding: 8px 4px; border-radius: 10px; cursor: pointer; border: 2px solid var(--accent);
        background: #fff; color: var(--accent); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ibtn b { font-size: 22px; font-weight: 800; }
.ibtn span { font-size: 13px; }
.ibtn:hover:not(:disabled) { background: #eef3f8; }
.ibtn:disabled { cursor: default; opacity: .55; }
.ibtn[hidden] { display: none; }
.ibtn.right { background: #0a7b4f; border-color: #0a7b4f; color: #fff; opacity: 1; }
.ibtn.wrong { border-color: #b3261e; color: #b3261e; text-decoration: line-through; }
@media (max-width: 560px) {
  .ibtns { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ibtn { padding: 6px 2px; }
  .ibtn b { font-size: 19px; }
  .ibtn span { font-size: 10.5px; line-height: 1.15; text-align: center; }
}

/* ---------- strumming patterns: counts on top, an arrow under each strum */
.strum { border-collapse: collapse; margin: 6px 0 4px; }
.strum th, .strum td { width: 44px; text-align: center; padding: 4px 0; }
.strum th { font-size: 22px; font-weight: 800; border-bottom: 2px solid var(--ink); }
.strum th.and { font-weight: 500; color: var(--muted); font-size: 19px; }
.strum th.beat:not(:first-child) { border-left: 1px solid var(--line); }
.strum td { height: 46px; vertical-align: middle; }
.strum td:nth-child(odd):not(:first-child) { border-left: 1px solid var(--line); }
.strumarrow { display: block; margin: 0 auto; width: 22px; height: 38px; }
.strumarrow path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.strum td.acc .strumarrow path { stroke-width: 5; }
.strum td { position: relative; }
.strum.accents td { padding-top: 26px; }          /* room for the accent mark, so every arrow lines up */
.strum .accmark { position: absolute; top: 3px; left: 0; right: 0; font: 800 20px/1 var(--font); }

/* ---------- Scale Sequences page (site/scale-sequences.js) */
.seqtitle { font-size: 26px; margin: 0; }
.seqpattern { margin: 2px 0 14px; color: var(--muted); }
.seqctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.seqctl label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.seqctl select { font: inherit; padding: 6px 8px; border-radius: 8px; }
.seqwhere { font-weight: 700; min-width: 8.5em; }
.neckwrap { margin: 16px 0 6px; }
.neckwrap svg.neck { width: 100%; max-width: 760px; }
.seq .neck .dot.seqdot circle { fill: #fff; stroke: #999; stroke-width: 1.5; }
.seq .neck .dot.seqdot text { fill: #777; font-size: 15px; font-weight: 700; text-anchor: middle; }
.seq .neck .dot.seqdot.ingroup circle { fill: var(--accent); stroke: var(--accent); }
.seq .neck .dot.seqdot.ingroup text { fill: #fff; }
.seq .neck .dot.seqdot.now circle { fill: #000; stroke: #000; stroke-width: 4; }
.seq .neck .dot.seqdot.now text { fill: #fff; font-size: 18px; }
.seq .neck .rootring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.seqkey { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 4px 0 14px; font-size: 15px; color: var(--muted); }
.seqkey span { display: inline-flex; align-items: center; gap: 7px; }
.k { display: inline-block; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box; }
.k.group { background: var(--accent); }
.k.now { background: #000; }
.k.ring { border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 4px #999; }
.seqgroup { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.gcell { font: inherit; padding: 8px 4px; text-align: center; background: #fff; color: var(--ink); cursor: pointer;
         border: 2px solid var(--line); border-radius: 10px; }
.gcell.on { border-color: #000; border-width: 3px; }
.gcell b { display: block; font-size: 28px; line-height: 1.1; }
.gcell span { display: block; font-size: 14px; color: var(--muted); }
.gcell .gf { font-size: 18px; font-weight: 700; color: var(--ink); }
.seqnote { font-size: 20px; font-weight: 700; margin: 14px 0 0; min-height: 0; }
.seqnote:empty { display: none; }
.seqstatus { font-size: 15px; color: var(--muted); margin: 8px 0 0; }
.mcount { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; }
.seqwhere.counting { font-size: 22px; }
.seqh { font-size: 18px; margin: 0 0 8px; }
.seqline + .seqh { margin-top: 18px; }
.seqline { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { font: inherit; font-size: 16px; font-weight: 600; padding: 4px 8px; border-radius: 8px; cursor: pointer;
         border: 1.5px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap; }
.gchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seq .neck .fnum, .seq .neck .inlay { transform: translateY(7px); }   /* clear of the double ring on the 6th string */

/* ---------- Circle of Fifths Made Easy (circle-easy.html) */
.ce-keyrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ce-keylabel { font-size: 22px; font-weight: 700; margin-right: 6px; }
.ce-key { font: inherit; font-size: 24px; font-weight: 800; min-width: 58px; padding: 8px 12px; border-radius: 10px;
          border: 2px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; }
.ce-key:hover { background: #eef3f8; }
.ce-key[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ce-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ce-wheel svg { width: 100%; height: auto; display: block; }
.ce-rules { display: flex; flex-direction: column; gap: 12px; }
.ce-rule { font: inherit; text-align: left; display: block; width: 100%; padding: 14px 16px; border-radius: 12px;
           border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.ce-rule:hover { border-color: var(--accent); }
.ce-rule[aria-pressed="true"] { border: 3px solid var(--accent); background: #EEF3F8; }
.ce-rtitle { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; }
.ce-rtitle .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
                  background: var(--accent); color: #fff; font-size: 17px; }
.ce-how { display: block; margin-top: 6px; }
.ce-result { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 20px; line-height: 1.6; }
.ce-rule[aria-pressed="true"] .ce-result { display: block; }
.ce-result b { white-space: pre-wrap; }
.ce-flat, .ce-more { max-width: 820px; }
.ce-flat { margin-top: 20px; padding: 12px 16px; border-left: 5px solid var(--accent); background: var(--card); }

.ce-circle text { font-family: var(--font); text-anchor: middle; fill: var(--ink); }
.ce-note-bg, .ce-chord-bg { fill: #fff; stroke: #444; stroke-width: 1; }
.ce-note { font-size: 30px; font-weight: 700; }
.ce-note.two { font-size: 20px; } .ce-note.alt { font-weight: 400; }
.ce-sfx { font-size: 20px; font-weight: 600; }
.ce-pos.named .ce-note.two { display: none; }       /* B♭/A♯ place: one name in F and in B */
.ce-chord { font-size: 20px; font-weight: 700; }
.ce-badge { fill: none; stroke: none; }
.ce-num { font-size: 18px; font-weight: 800; }
.ce-mid { font-size: 18px; fill: var(--muted) !important; }
.ce-mid.big { font-size: 26px; font-weight: 800; fill: var(--ink) !important; }

.ce-pos.in .ce-note-bg { fill: #CFE3F1; }
.ce-pos.step .ce-badge { fill: #fff; stroke: var(--accent); stroke-width: 2.5; }
.ce-note-ol, .ce-chord-ol { fill: none; stroke: none; }
.ce-pos.key .ce-note-ol { stroke: #000; stroke-width: 5; }
.ce-pos.key .ce-note { text-decoration: underline; }
.ce-pos.maj .ce-note-bg { fill: #CFE3F1; }            /* major chord / the major key */
.ce-pos.min .ce-note-bg { fill: #F7DDCB; }            /* minor chord / the relative minor */
.ce-pos.dim .ce-note-bg { fill: #D6D6D6; }            /* diminished chord */
.ce-pos.faded .ce-note-bg, .ce-pos.faded .ce-chord-bg { fill: #f2f2f2; stroke: #ccc; }
.ce-pos.faded .ce-note { fill: #b0b0b0; }
.ce-circle[data-rule="minor"] .ce-chord-bg { fill: #f2f2f2; stroke: #ccc; }
.ce-circle[data-rule="minor"] .ce-pos.relhome .ce-chord-bg { fill: #F7DDCB; }
.ce-pos.relhome .ce-chord-ol { stroke: #000; stroke-width: 4; }

@media (max-width: 760px) {
  .ce-body { grid-template-columns: 1fr; }
  .ce-key { min-width: 48px; font-size: 21px; }
}

/* ---------- tab (draw.tab): six lines, fret numbers on them */
.tabsvg { display: block; max-width: 100%; height: auto; }
.tabsvg + .tabsvg { margin-top: 10px; }
.metrorow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; }    /* a long tab drawn as several lines */   /* width: set by draw.tab, the same scale for every tab */
.tabsvg .tline { stroke: #777; stroke-width: 1.3; }
.tabsvg .tbar { stroke: var(--ink); stroke-width: 1.6; }
.tabsvg .tname { font: 600 14px var(--font); fill: var(--muted); text-anchor: middle; }
.tabsvg .tnum { font: 800 17px var(--font); fill: var(--ink); text-anchor: middle;
                paint-order: stroke; stroke: #fff; stroke-width: 7px; stroke-linejoin: round; }
.tabsvg .tabove { font: 700 13px var(--font); fill: var(--ink); text-anchor: middle; }
.tabsvg .tabline { stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 4 3; }
.tabsvg .tabline.end { stroke-dasharray: none; }
.tabsvg .tslur, .tabsvg .tbend, .tabsvg .tvib { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.tabsvg .tslide { stroke: var(--ink); stroke-width: 1.8; }
.tabsvg .tarrowhead { fill: var(--ink); }
.tabsvg .tsmall { font: 700 12px var(--font); fill: var(--ink); text-anchor: middle; }
.tabsvg .tnum.sounding { fill: var(--root); }            /* "Hear it": the note sounding now */
.typedtab { font: 600 16px/1.35 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: #f1f1f1;
            border-radius: 8px; padding: 10px 14px; margin: 6px 0; overflow-x: auto; white-space: pre; }

/* ======================================================================
   SCREEN THEME: the dark looper look (matches looper.bosoxny.com).
   Screen only: printing and the PDFs keep the light paper colours above.
   A new rule above that sets a light colour (white, a pale tint, a dark line)
   needs its dark version added here.
   ====================================================================== */
@font-face { font-family: "Rock Salt"; src: url("fonts/RockSalt-Regular.woff2") format("woff2");
             font-display: swap; }          /* Apache 2.0 licence: fonts/RockSalt-LICENSE.txt */
@media screen {
  :root {
    --bg: #1b1d21; --card: #2a2d33; --btn: #3a3d44; --btn-hover: #474a52;
    --ink: #f2f2f2; --muted: #aaaaaa; --line: #3a3d44; --line-strong: #6b6e75;
    --accent: #a78bfa; --on-accent: #000;          /* links, highlights, the item that's on; violet unless the colour menu says otherwise (below) */
    --go: #3c8c5a; --warn: #c0473d; --warn-text: #e8796f; --right-text: #6fcf97;
    --title-font: "Rock Salt", var(--font);
    /* note colours: the dots keep their paper colours; 3rds a lighter blue so they show on grey */
    --third: #2f8fd4;
    --hi: #f0875a; --sharp: #e8a33d; --flat: #6fcf97;          /* sharp keys amber, flat keys green */
    --tint-sharp: #6b4f1f; --tint-flat: #2d5a3e; --tint-both: #3a3d44;
    --shade: #3d3524; --head: #3a3d44;
  }
  /* the colour menu in the top bar (site.js) puts data-accent on <html>; violet is the default above */
  :root[data-accent="sky"]  { --accent: #5bb8f5; --third: #4d6ef0; }   /* 3rds change so they don't look like the accent */
  :root[data-accent="lime"] { --accent: #b8e04a; }
  body { background: var(--bg); color: var(--ink); }
  a { color: var(--accent); }
  :focus-visible { outline-color: var(--accent); }        /* the ring on a clicked or tabbed-to control follows the accent colour */
  .skip:focus { background: var(--card); }

  /* titles: Rock Salt; the end of a title sits in a tilted outline in the accent colour (inline-block + tight lines, or the box grows tall) */
  h1, .sitename { font-family: var(--title-font); font-weight: 400; color: var(--ink); }
  h1 { font-size: 32px; line-height: 1.6; }
  .sitename { text-transform: lowercase; }        /* the site's name only; page titles keep their capitals */
  .wood { display: inline-block; line-height: 1; color: var(--accent); border: 2px solid var(--accent);
          padding: 6px 12px 2px; border-radius: 4px; transform: rotate(-2deg); }
  .home .wood { padding: 5px 8px 2px; }
  h1.brand { font-size: 34px; }

  /* top bar and contents list */
  .topbar { background: var(--card); border-bottom: 1px solid var(--line); }
  .topbar a { color: var(--ink); }
  .home { font-weight: 400; font-size: 18px; }
  .topnav a:hover { background: var(--btn); }
  .navsec li a { color: var(--ink); }
  .navsec li a:hover { background: var(--card); }
  .navsec li a.here { border-left-color: var(--accent); background: var(--card); color: var(--ink); }

  /* buttons: grey; the one that's on is the accent colour; play/start is green; stop is red */
  .dl a, .hear, .mstep, .mtap, .preset, .nbtn, .ibtn, .ce-key, .gchip, .pbtn, .mopen {
    background: var(--btn); border-color: var(--btn); color: var(--ink); }
  .dl a:hover, .hear:hover, .mstep:hover, .mtap:hover, .preset:hover, .nbtn:hover:not(:disabled),
  .ibtn:hover:not(:disabled), .ce-key:hover, .gchip:hover, .pbtn:hover { background: var(--btn-hover); filter: none; }
  .preset.on, .gchip.on, .ce-key[aria-pressed="true"], .pbtn:first-child {
    background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .hear[aria-pressed="true"], .mstart, .mopen.running { background: var(--go); border-color: var(--go); color: #fff; }
  .mstart[aria-pressed="true"] { background: var(--warn); }
  .nbtn.right, .ibtn.right { background: var(--go); border-color: var(--go); color: #fff; }
  .nbtn.wrong, .ibtn.wrong { background: var(--btn); border-color: var(--warn); color: var(--warn-text); }
  .qresult.right { color: var(--right-text); } .qresult.wrong { color: var(--warn-text); }
  .fab, .plabel-big .num, .ce-rtitle .num { background: var(--accent); color: var(--on-accent); }
  .fab { box-shadow: 0 2px 12px rgba(0,0,0,.6); }
  input { accent-color: var(--accent); }

  /* a one-page sheet shows its title at the top, so its page header (kept for the PDF) is not repeated */
  .onepage article.scale > header h3 { display: none; }

  /* landing and category pages */
  .catthumb { background: var(--btn); }
  .partbtn { background: var(--btn); }
  .partbtn:hover { background: var(--btn-hover); filter: none; }
  .topnav a.on, .topnav a.on:hover { background: var(--accent); color: var(--on-accent); }

  /* menus (drop-downs) */
  select { background: var(--btn); color: var(--ink); border: 1px solid var(--line-strong); }
  .keypanel { background: var(--card); border-color: var(--line); }
  .keypanel select, .bigselect { background: var(--btn); border-color: var(--btn); color: var(--ink); }
  .keypanel select:hover { background: var(--btn-hover); }
  .showpanel button { background: var(--btn); border-color: var(--btn); color: var(--ink); }
  .showpanel button:hover { background: var(--btn-hover); }
  .showpanel button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

  /* panels and cards */
  .card, .ptable, .staffbox, .neckbox, .gcell, .ce-rule { background: var(--card); }
  .mfloat { background: var(--card); border-color: var(--line-strong); box-shadow: 0 6px 24px rgba(0,0,0,.6); }
  .ce-rule[aria-pressed="true"] { background: #3a3326; border-color: var(--accent); }
  .gcell.on { border-color: var(--ink); }
  .chip { background: var(--btn); }
  .typedtab { background: #1f2125; }
  .tbl thead th { border-bottom-color: var(--line-strong); }
  .tbl tr.here > * { background: #4a3d22; }
  .chip-maj { background: #4f6f94; }
  .chip-dim { border-color: #9fb6cf; color: #9fb6cf; }
  .c-root { color: #ee8a4d; } .c-third { color: #5aaee8; } .c-fifth { color: #2fc59a; } .c-seventh { color: #d68fb5; }
  .follow-status .dim { color: #777; }
  .lights span { background: var(--card); border-color: var(--line-strong); }
  .lights span.on { background: var(--accent); border-color: var(--accent); }
  .lights span.one.on { background: var(--root); border-color: var(--root); }
  .sw.other { background: var(--card); }

  /* lines in boxes and charts */
  .bars td, .nchart td, .boxes td { border-color: var(--line-strong); }
  .nchart tr + tr td { border-top-color: #55585f; }
  .nchart .nums.split { border-bottom-color: var(--ink); }

  /* diagrams: neck, chord boxes, mini neck, fretboard trainer */
  .neck .sname, .neck .colhead, .minineck .nlab { fill: var(--muted); }
  .neck .fnum { fill: #cfcfcf; }
  .neck .fret, .minineck .nfret { stroke: var(--line-strong); }
  .neck .string, .minineck .nstring { stroke: #c8c8c8; }
  .neck .nut, .minineck .nnut { stroke: var(--ink); }
  .neck .inlay { fill: var(--line-strong); }
  .dot circle, .trainer .spot.also circle { fill: var(--card); stroke: var(--ink); }
  .minineck .ndot { fill: var(--accent); } .minineck .ndotlab { fill: var(--on-accent); }
  .trainer .fcol.outside { fill: #33363c; }
  .trainer .boardmark { fill: #55585f; }
  .trainer .spot.q circle { fill: var(--card); stroke: var(--ink); }      /* Interval Finder */
  .trainer .spot.c-other circle { fill: #8a8d94; }
  .ivbtn.flash { border-color: var(--warn); color: var(--warn-text); }

  /* Scale Sequences */
  .seq .neck .dot.seqdot circle { fill: var(--card); stroke: var(--line-strong); }
  .seq .neck .dot.seqdot text { fill: var(--muted); }
  .seq .neck .dot.seqdot.ingroup text { fill: var(--on-accent); }
  .seq .neck .dot.seqdot.now circle { fill: var(--ink); stroke: var(--ink); }
  .seq .neck .dot.seqdot.now text { fill: #000; }
  .k.now { background: var(--ink); }
  .k.ring { box-shadow: inset 0 0 0 2.5px var(--card), inset 0 0 0 4px var(--line-strong); }

  /* music, staff and tab */
  .music .staff, .tabsvg .tline { stroke: #8a8d94; }
  .music .nh.open { fill: var(--card); }
  .staff .sl, .staff .barline { stroke: #b0b0b0; }
  .staff .pn.now .glow { fill: #4a3020; }
  .tabsvg .tnum { stroke: var(--card); }

  /* circle of fifths */
  .circle5 .sec { fill: var(--card); stroke: var(--line-strong); }
  .circle5 .outline { stroke: var(--ink); }

  /* Circle of Fifths Made Easy */
  .ce-note-bg, .ce-chord-bg { fill: var(--card); stroke: var(--line-strong); }
  /* in the key / major: amber; minor: green; diminished: grey */
  .ce-pos.in .ce-note-bg, .ce-pos.maj .ce-note-bg { fill: var(--accent); stroke: var(--accent); }
  .ce-pos.in .ce-note, .ce-pos.maj .ce-note, .ce-pos.in .ce-sfx, .ce-pos.maj .ce-sfx { fill: var(--on-accent); }
  .ce-pos.min .ce-note-bg { fill: var(--go); stroke: var(--go); }
  .ce-pos.min .ce-note, .ce-pos.min .ce-sfx { fill: #fff; }
  .ce-pos.dim .ce-note-bg { fill: #55585f; stroke: #55585f; }
  .ce-pos.faded .ce-note-bg, .ce-pos.faded .ce-chord-bg,
  .ce-circle[data-rule="minor"] .ce-chord-bg { fill: #232529; stroke: var(--line); }
  .ce-pos.faded .ce-note { fill: #6b6e75; }
  .ce-circle[data-rule="minor"] .ce-pos.relhome .ce-chord-bg { fill: var(--go); stroke: var(--go); }
  .ce-pos.step .ce-badge { fill: var(--card); }
  .ce-pos.key .ce-note-ol, .ce-pos.relhome .ce-chord-ol { stroke: var(--ink); }
}
@media screen and (max-width: 560px) {     /* phones: Rock Salt runs wide, so the titles are a bit smaller */
  h1 { font-size: 23px; }
  h1.brand { font-size: 25px; }
  h1 .wood { padding: 6px 9px 3px; }
}
