/*
 * **************************************************************** theory
 * /theory/ pages: root motion, circle of fifths, cadences, progression relationships, glossary.
 * Chords, notes and keys are coloured by pitch class (C = 0 … B = 11), the same colours as the
 * reference pages' chord badges (reference.css --ref-root-N). Roman numerals use brand tones, and a
 * shape per scale degree, so they never share a colour with a chord.
 *   chord   <span class="theory-chord theory-root-N theory-q-QUALITY">    solid pill
 *   note    <span class="theory-note theory-pc-N">                        outlined circle
 *   key     <span class="theory-key theory-pc-N">                         coloured, underlined text
 *   numeral <span class="theory-num theory-num-D theory-num-upper|lower [theory-num-altered]">
*/
:root {
  --theory-ink: #303030;          /* = --ws-ink */
  --theory-quirk-bg: #fff8e1;     /* quirky shape tag: amber 50 */
  --theory-quirk-fg: #5d4300;     /* 8.9:1 on amber 50 */
  --theory-quirk-line: #ffb300;   /* amber 600 */
  --theory-ink-soft: #6b6f76;     /* = --ws-ink-soft */
  --theory-paper: #ffffff;
  --theory-line: #e6e9ee;         /* = --ws-line */
  --theory-field: #f5f6f8;        /* = --ws-field */
  --theory-zebra: #fafbfc;
  --theory-accent: #a8dade;       /* = --ws-accent, the brand border colour */
  /* maps: fretboard, keyboard map, beats, song forms (build_theory.py Maps) */
  --theory-fretmap-bg: #fbf8f3;   /* neck */
  --theory-fretmap-fret: #b9b3aa;
  --theory-fretmap-nut: #303030;
  --theory-fretmap-string: #8d8780;
  --theory-fretmap-inlay: #e3d9cc;
  --theory-fretmap-label: #6b6f76;
  --theory-beat-bg: #ffffff;
  --theory-beat-accent: #ffe082;  /* = --theory-num-4: amber 200 */
  --theory-form-0: #a8dade;       /* section colours: A / verse, B / chorus, ... (cycle of 6) */
  --theory-form-1: #ffe082;
  --theory-form-2: #cfd8dc;
  --theory-form-3: #ffb300;
  --theory-form-4: #b2dfdb;
  --theory-form-5: #f8bbd0;
  --theory-accent-soft: rgba(168, 218, 222, 0.45);
  --theory-hover: #eef7f8;
  --theory-link: #1565c0;
  --theory-focus: rgba(48, 48, 48, 0.35);
  --theory-radius: 14px;
  --theory-shadow: 0 1px 2px rgba(16, 18, 22, 0.06), 0 8px 24px rgba(16, 18, 22, 0.06);
  --theory-hit: 44px;
  --theory-nav-h: 64px;           /* glossary letter bar height (sticky); letters scroll in below it */

  /* chord roots, by pitch class: SYNC with reference.css --ref-root-N */
  --theory-root-0: #d32f2f;       /* C */
  --theory-root-1: #c2185b;       /* C♯/D♭ */
  --theory-root-2: #7b1fa2;       /* D */
  --theory-root-3: #512da8;       /* D♯/E♭ */
  --theory-root-4: #303f9f;       /* E */
  --theory-root-5: #1565c0;       /* F */
  --theory-root-6: #01579b;       /* F♯/G♭ */
  --theory-root-7: #00695c;       /* G */
  --theory-root-8: #2e7d32;       /* G♯/A♭ */
  --theory-root-9: #33691e;       /* A */
  --theory-root-10: #6d4c41;      /* A♯/B♭ */
  --theory-root-11: #bf360c;      /* B */

  /* Roman numerals, by scale degree: brand ink, blue-grey, brand accent and amber (no chord root uses these) */
  --theory-num-1: #303030;  --theory-num-1-fg: #ffffff;   /* I   home: ink, circle */
  --theory-num-2: #546e7a;  --theory-num-2-fg: #ffffff;   /* ii  blue grey 600, square */
  --theory-num-3: #a8dade;  --theory-num-3-fg: #303030;   /* iii brand accent, leaf */
  --theory-num-4: #ffe082;  --theory-num-4-fg: #303030;   /* IV  amber 200, arch */
  --theory-num-5: #ffb300;  --theory-num-5-fg: #303030;   /* V   amber 600, arrow (tension pointing home) */
  --theory-num-6: #cfd8dc;  --theory-num-6-fg: #303030;   /* vi  blue grey 100, mirrored leaf */
  --theory-num-7: #78909c;  --theory-num-7-fg: #ffffff;   /* vii blue grey 400, hexagon */

  /* level tags on the Part headings */
  --theory-level-1: #a8dade;  --theory-level-1-fg: #303030;
  --theory-level-2: #ffe082;  --theory-level-2-fg: #303030;
  --theory-level-3: #303030;  --theory-level-3-fg: #ffffff;
  /* chord diagrams: SYNC with reference.css --ref-key-* / --ref-gd-* (the site's .mk keyboards and .gd chord diagrams) */
  --theory-key-white: #fbfaf7;
  --theory-key-white-line: #c9c4b8;
  --theory-key-black: #1d1d1f;
  --theory-key-black-line: #000000;
  --theory-key-chord-fg: #ffffff;
  --theory-gd-line: #8a8a92;
  --theory-gd-nut: #1d1d1f;
  --theory-gd-label: #6b6b70;
  --theory-gd-barre: rgba(29, 29, 31, 0.18);
  --theory-card-w: 128px;         /* one chord card in a Try it row */
  /* circle of fifths drawings (build_theory.py Circles): fills, and the arrows and lines drawn in the same family */
  /* staff notation (build_theory.py Staff): a soft accent page, lavender lines, cyan clefs */
  --theory-staff-bg: #f4fbfc;     /* accent 50 */
  --theory-staff-line: #b9c3e8;   /* indigo 100-200 */
  --theory-staff-bar: #9fa8da;    /* indigo 200 */
  --theory-staff-ink: #00838f;    /* cyan 800: clefs, key signature, accidentals */
  --theory-staff-halo: #ffffff;   /* the ring round each note head */
  /* note lines (build_theory.py note_line): half steps in a straight line */
  --theory-noteline-white: #ffffff;
  --theory-noteline-black: #eef1f6;   /* the black-key columns, softly shaded */
  --theory-noteline-grid: #e1e5ec;
  --theory-noteline-row: #c9d3e0;
  --theory-noteline-span: #00838f;    /* cyan 800: the bracket over an interval */
  --theory-scale-panel: #f2f8fa;    /* the tinted ground behind a scale's details and keyboard */
  --theory-circle-plain: #ffffff;
  --theory-circle-line: #d5dae1;
  --theory-circle-label: #303030;
  --theory-circle-sub: #6b6f76;
  --theory-circle-home: #303030;  --theory-circle-home-fg: #ffffff;  --theory-circle-home-stroke: #303030;
  --theory-circle-a: #ffe082;     --theory-circle-a-fg: #303030;     --theory-circle-a-stroke: #b26a00;   /* amber 200 / amber, 4.0:1 on white */
  --theory-circle-b: #a8dade;     --theory-circle-b-fg: #303030;     --theory-circle-b-stroke: #00838f;   /* brand accent / cyan 800, 4.5:1 */
  --theory-circle-c: #cfd8dc;     --theory-circle-c-fg: #303030;     --theory-circle-c-stroke: #546e7a;   /* blue grey 100 / 600 */
  --theory-circle-w: 320px;       /* the circle beside a long text column (narrow) */
  --theory-circle-max-w: 440px;   /* a circle stacked above its text on phones */
  --theory-section-gap: 2vh;      /* extra space above every section, so a new one shows as the page scrolls */
}

/* pitch class -> colour, shared by chords, notes and keys */
.theory .theory-root-0, .theory .theory-pc-0 { --theory-c: var(--theory-root-0); }
.theory .theory-root-1, .theory .theory-pc-1 { --theory-c: var(--theory-root-1); }
.theory .theory-root-2, .theory .theory-pc-2 { --theory-c: var(--theory-root-2); }
.theory .theory-root-3, .theory .theory-pc-3 { --theory-c: var(--theory-root-3); }
.theory .theory-root-4, .theory .theory-pc-4 { --theory-c: var(--theory-root-4); }
.theory .theory-root-5, .theory .theory-pc-5 { --theory-c: var(--theory-root-5); }
.theory .theory-root-6, .theory .theory-pc-6 { --theory-c: var(--theory-root-6); }
.theory .theory-root-7, .theory .theory-pc-7 { --theory-c: var(--theory-root-7); }
.theory .theory-root-8, .theory .theory-pc-8 { --theory-c: var(--theory-root-8); }
.theory .theory-root-9, .theory .theory-pc-9 { --theory-c: var(--theory-root-9); }
.theory .theory-root-10, .theory .theory-pc-10 { --theory-c: var(--theory-root-10); }
.theory .theory-root-11, .theory .theory-pc-11 { --theory-c: var(--theory-root-11); }

/* ---------------------------------------------------------------- page */
.theory {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 0 64px;
  color: var(--theory-ink);
  font-size: 1.0625rem;
  font-weight: 400;               /* the site body is font-weight 100 (proxima-nova Thin): too light to read at text sizes */
  line-height: 1.75;
  text-align: left;
}
.theory.theory-page {
  width: 100%;
}
/* glossary: a little narrower, so definitions read as a column */
.theory.theory-glossary-page {
  max-width: 820px;
}
.theory .theory-title {
  margin: 24px 0 12px;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.theory .theory-lede {
  margin: 0 0 40px;
  padding: 18px 22px;
  border-left: 5px solid var(--theory-accent);
  border-radius: 0 var(--theory-radius) var(--theory-radius) 0;
  background: var(--theory-field);
  color: var(--theory-ink);
  font-size: 1.1875rem;
  line-height: 1.7;
}
.theory .theory-section {
  margin: 0 0 56px;
}
.theory .theory-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--theory-line);
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.25;
}
/* level tag before "Part 1/2/3" headings */
.theory .theory-section[id$="-basics"] > .theory-heading::before,
.theory .theory-section[id$="-deeper"] > .theory-heading::before,
.theory .theory-section[id$="-pro"] > .theory-heading::before {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
}
.theory .theory-section[id$="-basics"] > .theory-heading::before { content: "Beginner"; background: var(--theory-level-1); color: var(--theory-level-1-fg); }
.theory .theory-section[id$="-deeper"] > .theory-heading::before { content: "Intermediate"; background: var(--theory-level-2); color: var(--theory-level-2-fg); }
.theory .theory-section[id$="-pro"] > .theory-heading::before { content: "Professional"; background: var(--theory-level-3); color: var(--theory-level-3-fg); }

.theory .theory-subheading {
  margin: calc(36px + var(--theory-section-gap)) 0 12px;
  padding-left: 14px;
  border-left: 4px solid var(--theory-accent);
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.35;
}
.theory .theory-text {
  margin: 0 0 16px;
}
.theory .theory-term,
.theory .theory-emphasis {
  font-weight: 700;
}
/* new words: a brand-accent highlighter stroke */
.theory .theory-word {
  font-style: italic;
  background: linear-gradient(transparent 62%, var(--theory-accent-soft) 62%);
  padding: 0 2px;
}

/* lists */
.theory .theory-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.theory .theory-item {
  position: relative;
  margin: 0 0 12px;
  padding-left: 26px;
}
.theory .theory-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.68em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--theory-accent);
  box-shadow: 0 0 0 3px var(--theory-accent-soft);
}
.theory .theory-steps {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: theory-step;
}
.theory .theory-step {
  position: relative;
  margin: 0 0 14px;
  padding-left: 44px;
  counter-increment: theory-step;
}
.theory .theory-step::before {
  content: counter(theory-step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--theory-ink);
  color: var(--theory-paper);
  font-size: 0.875rem;
  font-weight: 800;
}

/* ---------------------------------------------------------------- chords, notes, keys */
.theory .theory-chord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1em;
  padding: 0.05em 0.6em;
  margin: 0.1em 0.06em;
  border-radius: 999px;
  background: var(--theory-c, var(--theory-ink));
  color: #ffffff;
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: baseline;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
/* chord quality: a small mark on the badge, so C, Cm, C7 and C° share a colour but not a look */
.theory .theory-chord.theory-q-major { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.theory .theory-chord.theory-q-power { box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.28), inset -3px 0 0 rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.18); }
.theory .theory-chord.theory-q-minor { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.18); }
.theory .theory-chord.theory-q-dominant { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.18); }
.theory .theory-chord.theory-q-diminished { outline: 1.5px dotted rgba(255, 255, 255, 0.9); outline-offset: -4px; }
.theory .theory-chord.theory-q-augmented { outline: 1.5px dashed rgba(255, 255, 255, 0.9); outline-offset: -4px; }
.theory .theory-chord.theory-q-suspended { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), inset 0 0 0 4px rgba(0, 0, 0, 0.15); }

.theory .theory-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 0.3em;
  margin: 0.1em 0.04em;
  border: 2px solid var(--theory-c, var(--theory-ink));
  border-radius: 999px;
  background: var(--theory-paper);
  color: var(--theory-c, var(--theory-ink));
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  vertical-align: 0.05em;
}
.theory .theory-key {
  color: var(--theory-c, var(--theory-ink));
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 2px solid var(--theory-c, var(--theory-ink));
}

/* a progression written out (badges joined by – or →): one unit, kept on one line inside tables */
/* a run (C – E – G, I → IV → V) moves to the next line as a whole when it doesn't fit; one longer than a line wraps inside */
.theory .theory-run { display: inline-block; max-width: 100%; white-space: normal; }
.theory .theory-table .theory-run { white-space: nowrap; }

/* ---------------------------------------------------------------- Roman numerals */
.theory .theory-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2em;
  padding: 0.05em 0.55em;
  margin: 0.1em 0.06em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  vertical-align: baseline;
}
.theory .theory-num-upper { font-style: normal; }
.theory .theory-num-lower { font-style: italic; }
.theory .theory-num-1 { background: var(--theory-num-1); color: var(--theory-num-1-fg); border-radius: 999px; }
.theory .theory-num-2 { background: var(--theory-num-2); color: var(--theory-num-2-fg); border-radius: 3px; }
.theory .theory-num-3 { background: var(--theory-num-3); color: var(--theory-num-3-fg); border-radius: 12px 3px 12px 3px; }
.theory .theory-num-4 { background: var(--theory-num-4); color: var(--theory-num-4-fg); border-radius: 12px 12px 3px 3px; }
.theory .theory-num-5 {
  background: var(--theory-num-5);
  color: var(--theory-num-5-fg);
  padding-right: 0.95em;
  clip-path: polygon(0 0, calc(100% - 0.55em) 0, 100% 50%, calc(100% - 0.55em) 100%, 0 100%);
  border-radius: 3px 0 0 3px;
}
.theory .theory-num-6 { background: var(--theory-num-6); color: var(--theory-num-6-fg); border-radius: 3px 12px 3px 12px; }
.theory .theory-num-7 {
  background: var(--theory-num-7);
  color: var(--theory-num-7-fg);
  padding-left: 0.85em;
  padding-right: 0.85em;
  clip-path: polygon(0.45em 0, calc(100% - 0.45em) 0, 100% 50%, calc(100% - 0.45em) 100%, 0.45em 100%, 0 50%);
}
/* ♭VII, ♭VI, ♭II: borrowed from outside the key — striped */
.theory .theory-num-altered {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 4px, transparent 4px 8px);
}

/* ---------------------------------------------------------------- tables */
.theory .theory-table-wrap {
  margin: 8px 0 28px;
  border: 1px solid var(--theory-line);
  border-radius: var(--theory-radius);
  background: var(--theory-paper);
  box-shadow: var(--theory-shadow);
}
.theory .theory-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--theory-ink);
  font-size: 0.97rem;
}
.theory .theory-table .theory-table-cell {
  padding: 12px 16px;
  border-top: 0;
  border-bottom: 1px solid var(--theory-line);
  vertical-align: middle;
  text-align: left;
}
.theory .theory-table-head .theory-table-cell {
  position: sticky;
  top: 0;
  background: var(--theory-field);
  border-bottom: 2px solid var(--theory-line);
  color: var(--theory-ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* badges in a header cell keep their own case: the case of a numeral is its meaning (ii = minor, II = major) */
.theory .theory-table-head .theory-num,
.theory .theory-table-head .theory-chord {
  font-size: 0.875rem;
  letter-spacing: normal;
  text-transform: none;
}
.theory .theory-table-head .theory-table-row:first-child .theory-table-cell:first-child { border-top-left-radius: var(--theory-radius); }
.theory .theory-table-head .theory-table-row:first-child .theory-table-cell:last-child { border-top-right-radius: var(--theory-radius); }
.theory .theory-table-body .theory-table-row:nth-child(even) .theory-table-cell { background: var(--theory-zebra); }
.theory .theory-table-body .theory-table-row:hover .theory-table-cell { background: var(--theory-hover); }
.theory .theory-table-body .theory-table-row:last-child .theory-table-cell { border-bottom: 0; }
.theory .theory-table-body .theory-table-cell:first-child { font-weight: 700; }

/* quirky shape tag under a keyboard or guitar diagram (build_reference.py Drawing.guitar_quirk / piano_quirk) */
.theory .theory-quirk {
  display: inline-block;
  margin: 4px 0 2px;
  padding: 1px 8px;
  border: 1px solid var(--theory-quirk-line);
  border-radius: 999px;
  background: var(--theory-quirk-bg);
  color: var(--theory-quirk-fg);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.theory .theory-quirk-sample { margin: 0 2px; padding: 0 6px; vertical-align: 1px; }

/* ---------------------------------------------------------------- glossary */
.theory .theory-glossary-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 32px;
  padding: 10px 0;
  list-style: none;
  background: var(--theory-paper);
  border-bottom: 1px solid var(--theory-line);
}
.theory .theory-glossary-nav-item { margin: 0; }
.theory .theory-glossary-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--theory-hit);
  height: var(--theory-hit);
  border-radius: 12px;
  background: var(--theory-field);
  color: var(--theory-ink);
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.theory .theory-glossary-nav-link:hover { background: var(--theory-accent); color: var(--theory-ink); text-decoration: none; }
.theory .theory-glossary-nav-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--theory-focus); }
.theory .theory-glossary-letter {
  margin: 0 0 40px;
  scroll-margin-top: calc(var(--theory-nav-h) + 12px);
}
.theory .theory-glossary-letter-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 0 16px;
  border-radius: 16px;
  background: var(--theory-ink);
  color: var(--theory-paper);
  font-size: 1.75rem;
  font-weight: 800;
}
.theory .theory-glossary-list { margin: 0; }
.theory .theory-glossary-entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--theory-line);
  scroll-margin-top: calc(var(--theory-nav-h) + 12px);
}
.theory .theory-glossary-entry:target {
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: 12px;
  background: var(--theory-hover);
}
.theory .theory-glossary-term {
  margin: 0 0 4px;
  font-size: 1.125rem;
  font-weight: 800;
}
.theory .theory-glossary-definition { margin: 0; }
/* chord-type entries: definition | chord card, stacked on phones (see .theory-split) */
.theory .theory-glossary-text { margin: 0; }
.theory .theory-glossary-definition .theory-try-link { margin: 8px 0 0; }
.theory .theory-glossary-definition .theory-chart-position:empty { display: none; }
.theory .theory-glossary-see {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 8px;
  color: var(--theory-ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
}
.theory .theory-glossary-see-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1.5px solid var(--theory-accent);
  border-radius: 999px;
  color: var(--theory-ink);
  font-weight: 700;
  text-decoration: none;
}
.theory .theory-glossary-see-link:hover { background: var(--theory-accent); color: var(--theory-ink); text-decoration: none; }
.theory .theory-glossary-see-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--theory-focus); }

/* ---------------------------------------------------------------- chord cards and diagrams */
/* chord chart: one card per chord (numeral, chord, notes, keyboard, guitar), as the reference pages' progression tables */
.theory .theory-chart {
  margin: 8px 0 20px;
}
/* a scale: seven cards in one row, wrapping on narrow screens */
.theory .theory-chart-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
/* a progression (Try it): cards in playing order with arrows between */
.theory .theory-chart-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 6px;
}
.theory .theory-chart-flow .theory-chart-chord {
  flex: 0 0 var(--theory-card-w);
  width: var(--theory-card-w);
}
/* an aside's chart: cards at their natural width */
.theory .theory-chart-small.theory-chart-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 128px));
}
.theory .theory-chart-chord {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 6px 12px;
  border: 1px solid var(--theory-line);
  border-radius: var(--theory-radius);
  background: var(--theory-paper);
  box-shadow: var(--theory-shadow);
  text-align: center;
}
.theory .theory-chart-position,
.theory .theory-chart-name {
  display: flex;
  justify-content: center;
  min-height: 1.9em;
}
.theory .theory-chart-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  font-size: 0.9rem;
}
.theory .theory-chart-piano,
.theory .theory-chart-guitar {
  width: 100%;
}
.theory .theory-chart-arrow {
  display: flex;
  align-items: center;
  color: var(--theory-ink-soft);
  font-size: 1.5rem;
  font-weight: 800;
}

/* one-octave keyboard <svg> (as .mk on the rest of the site) */
.theory .theory-piano {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
  margin: 0 auto;
}
.theory .theory-piano-white {
  fill: var(--theory-oct-light, var(--theory-key-white));
  stroke: var(--theory-key-white-line);
  stroke-width: 1;
}
.theory .theory-piano-black {
  fill: var(--theory-key-black);
  stroke: var(--theory-key-black-line);
  stroke-width: 1;
}
/* key of a chord note */
.theory .theory-piano-white.theory-piano-chord,
.theory .theory-piano-black.theory-piano-chord { fill: var(--theory-oct-chord, var(--theory-key-black)); }
.theory .theory-piano-black.theory-piano-chord { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; }
.theory .theory-piano-label {
  fill: var(--theory-key-chord-fg);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-piano-mark {
  fill: var(--theory-dot, #555555);
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 0.75;
}
.theory .theory-piano-mark-label {
  fill: var(--theory-key-chord-fg);
  font-size: 7px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

/* chord diagram <svg> (as .gd on the rest of the site) */
.theory .theory-guitar {
  display: block;
  width: 100%;
  max-width: 110px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.theory .theory-guitar-fret,
.theory .theory-guitar-string {
  stroke: var(--theory-gd-line);
  stroke-width: 1.2;
}
.theory .theory-guitar-nut { fill: var(--theory-gd-nut); }
.theory .theory-guitar-base {
  fill: var(--theory-gd-label);
  font-size: 9px;
  font-weight: 700;
  text-anchor: end;
  dominant-baseline: central;
}
.theory .theory-guitar-mute {
  fill: var(--theory-gd-label);
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-guitar-barre { fill: var(--theory-gd-barre); }
.theory .theory-guitar-dot { }
.theory .theory-guitar-open { }
.theory .theory-guitar-dot-circle {
  fill: var(--theory-dot, #555555);
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1;
}
.theory .theory-guitar-dot-label {
  fill: var(--theory-dot-fg, #ffffff);
  font-size: 9.5px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-guitar-open .theory-guitar-dot-label { font-size: 7.5px; }
.theory .theory-guitar-none { color: var(--theory-ink-soft); }
/* the chord's root: white ring with a dark outline */
.theory .theory-chord-root { }
.theory .theory-guitar-dot.theory-chord-root .theory-guitar-dot-circle,
.theory .theory-piano-mark.theory-chord-root { stroke: #ffffff; stroke-width: 2; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9)); }
/* octave of a key or note: the site's octave colours (www.css STATIC PAGES --ww-oN-*) */
.theory .theory-oct-0 { --theory-oct-light: var(--ww-o0-100); --theory-oct-chord: var(--ww-o0-700); --theory-r0: var(--ww-o0-900); --theory-r0-fg: var(--ww-o0-900-fg); --theory-r1: var(--ww-o0-700); --theory-r1-fg: var(--ww-o0-700-fg); --theory-r2: var(--ww-o0-500); --theory-r2-fg: var(--ww-o0-500-fg); --theory-r3: var(--ww-o0-300); --theory-r3-fg: var(--ww-o0-300-fg); }
.theory .theory-oct-1 { --theory-oct-light: var(--ww-o1-100); --theory-oct-chord: var(--ww-o1-700); --theory-r0: var(--ww-o1-900); --theory-r0-fg: var(--ww-o1-900-fg); --theory-r1: var(--ww-o1-700); --theory-r1-fg: var(--ww-o1-700-fg); --theory-r2: var(--ww-o1-500); --theory-r2-fg: var(--ww-o1-500-fg); --theory-r3: var(--ww-o1-300); --theory-r3-fg: var(--ww-o1-300-fg); }
.theory .theory-oct-2 { --theory-oct-light: var(--ww-o2-100); --theory-oct-chord: var(--ww-o2-700); --theory-r0: var(--ww-o2-900); --theory-r0-fg: var(--ww-o2-900-fg); --theory-r1: var(--ww-o2-700); --theory-r1-fg: var(--ww-o2-700-fg); --theory-r2: var(--ww-o2-500); --theory-r2-fg: var(--ww-o2-500-fg); --theory-r3: var(--ww-o2-300); --theory-r3-fg: var(--ww-o2-300-fg); }
.theory .theory-oct-3 { --theory-oct-light: var(--ww-o3-100); --theory-oct-chord: var(--ww-o3-700); --theory-r0: var(--ww-o3-900); --theory-r0-fg: var(--ww-o3-900-fg); --theory-r1: var(--ww-o3-700); --theory-r1-fg: var(--ww-o3-700-fg); --theory-r2: var(--ww-o3-500); --theory-r2-fg: var(--ww-o3-500-fg); --theory-r3: var(--ww-o3-300); --theory-r3-fg: var(--ww-o3-300-fg); }
.theory .theory-oct-4 { --theory-oct-light: var(--ww-o4-100); --theory-oct-chord: var(--ww-o4-700); --theory-r0: var(--ww-o4-900); --theory-r0-fg: var(--ww-o4-900-fg); --theory-r1: var(--ww-o4-700); --theory-r1-fg: var(--ww-o4-700-fg); --theory-r2: var(--ww-o4-500); --theory-r2-fg: var(--ww-o4-500-fg); --theory-r3: var(--ww-o4-300); --theory-r3-fg: var(--ww-o4-300-fg); }
.theory .theory-oct-5 { --theory-oct-light: var(--ww-o5-100); --theory-oct-chord: var(--ww-o5-700); --theory-r0: var(--ww-o5-900); --theory-r0-fg: var(--ww-o5-900-fg); --theory-r1: var(--ww-o5-700); --theory-r1-fg: var(--ww-o5-700-fg); --theory-r2: var(--ww-o5-500); --theory-r2-fg: var(--ww-o5-500-fg); --theory-r3: var(--ww-o5-300); --theory-r3-fg: var(--ww-o5-300-fg); }
.theory .theory-oct-6 { --theory-oct-light: var(--ww-o6-100); --theory-oct-chord: var(--ww-o6-700); --theory-r0: var(--ww-o6-900); --theory-r0-fg: var(--ww-o6-900-fg); --theory-r1: var(--ww-o6-700); --theory-r1-fg: var(--ww-o6-700-fg); --theory-r2: var(--ww-o6-500); --theory-r2-fg: var(--ww-o6-500-fg); --theory-r3: var(--ww-o6-300); --theory-r3-fg: var(--ww-o6-300-fg); }
.theory .theory-oct-7 { --theory-oct-light: var(--ww-o7-100); --theory-oct-chord: var(--ww-o7-700); --theory-r0: var(--ww-o7-900); --theory-r0-fg: var(--ww-o7-900-fg); --theory-r1: var(--ww-o7-700); --theory-r1-fg: var(--ww-o7-700-fg); --theory-r2: var(--ww-o7-500); --theory-r2-fg: var(--ww-o7-500-fg); --theory-r3: var(--ww-o7-300); --theory-r3-fg: var(--ww-o7-300-fg); }
.theory .theory-oct-8 { --theory-oct-light: var(--ww-o8-100); --theory-oct-chord: var(--ww-o8-700); --theory-r0: var(--ww-o8-900); --theory-r0-fg: var(--ww-o8-900-fg); --theory-r1: var(--ww-o8-700); --theory-r1-fg: var(--ww-o8-700-fg); --theory-r2: var(--ww-o8-500); --theory-r2-fg: var(--ww-o8-500-fg); --theory-r3: var(--ww-o8-300); --theory-r3-fg: var(--ww-o8-300-fg); }
/* chord role of a note: root darkest -> 7th lightest */
.theory .theory-role-0 { --theory-dot: var(--theory-r0); --theory-dot-fg: var(--theory-r0-fg); }
.theory .theory-role-1 { --theory-dot: var(--theory-r1); --theory-dot-fg: var(--theory-r1-fg); }
.theory .theory-role-2 { --theory-dot: var(--theory-r2); --theory-dot-fg: var(--theory-r2-fg); }
.theory .theory-role-3 { --theory-dot: var(--theory-r3); --theory-dot-fg: var(--theory-r3-fg); }

/* ---------------------------------------------------------------- Try it, asides, links */
/* small heading inside a section (h4) */
.theory .theory-minor-heading {
  margin: calc(28px + var(--theory-section-gap)) 0 10px;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.35;
}
/* Try it: the cadence as chord cards, to play along */
.theory .theory-try {
  margin: 20px 0 32px;
  padding: 18px 20px 8px;
  border: 2px solid var(--theory-accent);
  border-radius: var(--theory-radius);
  background: var(--theory-hover);
}
/* Try it heading: the "Try it" tag, then what is being tried */
.theory .theory-try-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.4;
}
.theory .theory-try-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--theory-ink);
  color: var(--theory-paper);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.theory .theory-try-title {
  color: var(--theory-ink);
}
/* a sentence under the title that sets up the example */
.theory .theory-try-intro {
  margin: 0 0 14px;
}
.theory .theory-try-points {
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
}
/* a Try it with one row per card (tryit_rows): each card beside its own text, a dashed rule between rows */
.theory .theory-try-row + .theory-try-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--theory-accent);
}
.theory .theory-try-summary {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--theory-accent);
}
.theory .theory-try-point {
  margin: 0 0 10px;
}
.theory .theory-try-label {
  display: block;
  color: var(--theory-ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* two columns: Meet the chord = text | cards, Try it = cards | text; stacked on phones and in wide boxes */
.theory .theory-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 28px;
  align-items: start;
}
.theory .theory-try .theory-split {
  grid-template-columns: auto minmax(0, 1fr);
}
.theory .theory-wide .theory-split,
.theory .theory-try.theory-wide .theory-split {
  grid-template-columns: minmax(0, 1fr);
}
.theory .theory-split-text,
.theory .theory-split-diagrams {
  min-width: 0;
}
.theory .theory-split-diagrams .theory-chart {
  margin: 0 0 12px;
}
/* several cards beside the text: one row, side by side (an "auto" column would otherwise squeeze a grid to one card wide) */
.theory .theory-split-diagrams .theory-chart-small {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.theory .theory-split-diagrams .theory-chart-small .theory-chart-chord {
  flex: 0 0 var(--theory-card-w);
  width: var(--theory-card-w);
}
/* a chord wider than an octave (9ths, 11ths, 13ths): two-octave keyboard, so the card is two cards wide;
   the guitar diagram keeps its normal size (.theory-guitar max-width) (build_reference.py Drawing.octaves_for) */
.theory .theory-chart-grid .theory-chart-chord-wide { grid-column: span 2; }
.theory .theory-chart-chord-wide .theory-piano { max-width: 240px; }
.theory .theory-chart-flow .theory-chart-chord-wide,
.theory .theory-split-diagrams .theory-chart-small .theory-chart-chord-wide {
  flex: 0 0 calc(var(--theory-card-w) * 2 + 10px);
  width: calc(var(--theory-card-w) * 2 + 10px);
}
/* a box that spans the full width (several cards) */
.theory .theory-wide { }
.theory .theory-try-link,
.theory .theory-aside-link {
  margin: 4px 0 12px;
}
/* Meet the chord: a chord from outside the two scales, defined where it first appears */
.theory .theory-aside {
  margin: 16px 0 28px;
  padding: 16px 20px 6px;
  border-left: 5px solid var(--theory-num-5);
  border-radius: 0 var(--theory-radius) var(--theory-radius) 0;
  background: var(--theory-field);
}
.theory .theory-aside-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 800;
}
/* links: inline text links, and the Warbling Wren permalinks */
.theory .theory-link {
  color: var(--theory-link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.theory .theory-link:hover { color: var(--theory-ink); }
.theory .theory-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--theory-focus); border-radius: 4px; }
.theory .theory-try-link .theory-link,
.theory .theory-aside-link .theory-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--theory-hit);
}
.theory .theory-try-link .theory-link::before,
.theory .theory-aside-link .theory-link::before {
  content: "▶";
  flex: 0 0 auto;
  margin-right: 8px;
  font-size: 0.75em;
}

/* ---------------------------------------------------------------- maps (build_theory.py Maps) */
/* fretboard_map, scale_chart, interval_card: the neck drawn sideways, lowest string at the bottom */
.theory .theory-fretmap-figure { margin: 8px 0 20px; }
.theory .theory-fretmap-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.theory .theory-fretmap {
  display: block;
  width: 100%;
  min-width: 420px;
  max-width: 760px;
  height: auto;
  background: var(--theory-fretmap-bg);
  border-radius: 8px;
}
.theory .theory-interval-guitar .theory-fretmap { min-width: 0; max-width: 220px; margin: 0 auto; }
/* fretboard_map: every neck drawn at one scale (build_theory.py FRETMAP_SCALE sets the svg's width), so frets and dots match
   from drawing to drawing; it shrinks to fit the page, and a long neck scrolls on a phone rather than shrinking below 420px */
.theory .theory-fretmap-natural { width: auto; min-width: 0; max-width: 100%; height: auto; }
.theory .theory-fretmap-natural.theory-fretmap-long { min-width: 420px; }   /* build_theory.py FRETMAP_PHONE */
/* fretboard_grid: short necks side by side, wrapping as the page narrows */
.theory .theory-fretmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 4px 24px;
  align-items: start;
  margin: 8px 0 20px;
}
.theory .theory-fretmap-grid .theory-fretmap-figure { margin: 0; }
.theory .theory-fretmap-grid .theory-fretmap-natural.theory-fretmap-long { min-width: 0; }
.theory .theory-fretmap-string-name {
  fill: var(--theory-fretmap-label);
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-fretmap-fret { stroke: var(--theory-fretmap-fret); stroke-width: 1.5; }
.theory .theory-fretmap-nut { fill: var(--theory-fretmap-nut); }
.theory .theory-fretmap-string { stroke: var(--theory-fretmap-string); stroke-width: 1; }
.theory .theory-fretmap-inlay { fill: var(--theory-fretmap-inlay); }
.theory .theory-fretmap-number {
  fill: var(--theory-fretmap-label);
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
}
.theory .theory-fretmap-caption,
.theory .theory-keymap-caption,
.theory .theory-beats-caption,
.theory .theory-form-caption,
.theory .theory-bars-caption {
  margin-top: 6px;
  color: var(--theory-ink-soft);
  font-size: 0.875rem;
}

/* keyboard_map: every key named, white keys tinted by octave family */
.theory .theory-keymap-figure { margin: 8px 0 20px; }
.theory .theory-keymap-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.theory .theory-keymap { display: block; width: 100%; min-width: 420px; max-width: 760px; height: auto; }
.theory .theory-keymap-white { fill: var(--theory-oct-light, #ffffff); stroke: var(--theory-key-black-line); stroke-width: 1; }
.theory .theory-keymap-black { fill: var(--theory-key-black); }
.theory .theory-keymap-label {
  fill: var(--theory-ink);
  font-size: 8px;
  font-weight: 700;
  text-anchor: middle;
}
.theory .theory-keymap-black-label {
  fill: #ffffff;
  font-size: 5px;
  font-weight: 700;
  text-anchor: middle;
}

/* interval_card / interval_grid: the interval's name, size, notes, keyboard and neck */
.theory .theory-interval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 8px 0 20px;
}
.theory .theory-interval {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid var(--theory-line);
  border-radius: var(--theory-radius);
  background: var(--theory-paper);
  box-shadow: var(--theory-shadow);
  text-align: center;
}
.theory .theory-interval-name { font-size: 1.0625rem; font-weight: 800; text-transform: capitalize; }
.theory .theory-interval-size { color: var(--theory-ink-soft); font-size: 0.875rem; font-weight: 700; }
.theory .theory-interval-notes { display: flex; align-items: center; gap: 6px; }
.theory .theory-interval-piano,
.theory .theory-interval-guitar { width: 100%; }
.theory .theory-interval-piano .theory-piano { max-width: 200px; margin: 0 auto; }

/* scale_chart: notes with their degrees, one octave of keyboard, the neck */
.theory .theory-scale {
  margin: 8px 0 24px;
  padding: 14px 14px 4px;
  border: 1px solid var(--theory-line);
  border-radius: var(--theory-radius);
  background: var(--theory-paper);
  box-shadow: var(--theory-shadow);
}
.theory .theory-scale-title { margin-bottom: 8px; font-size: 1.125rem; font-weight: 800; text-transform: capitalize; }
.theory .theory-scale-notes { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.theory .theory-scale-note { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.theory .theory-scale-degree { color: var(--theory-ink-soft); font-size: 0.8125rem; font-weight: 700; }
/* top panel: the scale's details beside its keyboard, on a tinted ground; the neck fills the width below */
.theory .theory-scale-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: var(--theory-radius);
  background: var(--theory-scale-panel);
}
.theory .theory-scale-info .theory-scale-notes { margin-bottom: 12px; }
.theory .theory-scale-steps { font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.06em; color: var(--theory-ink); }
.theory .theory-scale-steps-label {
  margin-right: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--theory-ink-soft);
}
.theory .theory-scale-piano .theory-piano { max-width: none; margin: 0; }
.theory .theory-scale .theory-fretmap { width: 100%; max-width: none; }   /* the scale chart's neck fills its panel */

/* beat_grid: bars of beats to count; accented beats shaded, swing eighths drawn long-short */
.theory .theory-beats { margin: 8px 0 20px; }
.theory .theory-beats-bars { display: flex; flex-wrap: wrap; gap: 10px; }
.theory .theory-beats-bar { flex: 1 1 220px; min-width: 0; }
.theory .theory-beats-chord { min-height: 1.9em; margin-bottom: 4px; }
.theory .theory-beats-row {
  display: flex;
  border: 2px solid var(--theory-ink);
  border-radius: 6px;
  overflow: hidden;
}
.theory .theory-beats-cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 2px;
  border-left: 1px solid var(--theory-line);
  background: var(--theory-beat-bg);
  color: var(--theory-ink-soft);
  font-weight: 700;
  text-align: center;
}
.theory .theory-beats-cell:first-child { border-left: 0; }
.theory .theory-beats-beat { color: var(--theory-ink); border-left-color: var(--theory-ink-soft); }
.theory .theory-beats-accent { background: var(--theory-beat-accent); }
.theory .theory-beats-long { flex-grow: 2; }
.theory .theory-beats-short { flex-grow: 1; }

/* form_map: song sections as blocks, as wide as their bars */
.theory .theory-form { margin: 8px 0 20px; }
.theory .theory-form-row { display: flex; flex-wrap: wrap; gap: 6px; }
.theory .theory-form-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 64px;
  padding: 10px 10px;
  border-radius: 8px;
  color: var(--theory-ink);
}
.theory .theory-form-label { font-size: 1.125rem; font-weight: 800; }
.theory .theory-form-length { font-size: 0.8125rem; font-weight: 700; opacity: 0.8; }
.theory .theory-form-detail { margin-top: 4px; font-size: 0.875rem; }
.theory .theory-form-kind-0 { background: var(--theory-form-0); }
.theory .theory-form-kind-1 { background: var(--theory-form-1); }
.theory .theory-form-kind-2 { background: var(--theory-form-2); }
.theory .theory-form-kind-3 { background: var(--theory-form-3); }
.theory .theory-form-kind-4 { background: var(--theory-form-4); }
.theory .theory-form-kind-5 { background: var(--theory-form-5); }
.theory .theory-form-bars-1 { flex: 1 1 0; }
.theory .theory-form-bars-2 { flex: 2 1 0; }
.theory .theory-form-bars-3 { flex: 3 1 0; }
.theory .theory-form-bars-4 { flex: 4 1 0; }
.theory .theory-form-bars-5 { flex: 5 1 0; }
.theory .theory-form-bars-6 { flex: 6 1 0; }
.theory .theory-form-bars-7 { flex: 7 1 0; }
.theory .theory-form-bars-8 { flex: 8 1 0; }
.theory .theory-form-bars-9 { flex: 9 1 0; }
.theory .theory-form-bars-10 { flex: 10 1 0; }
.theory .theory-form-bars-11 { flex: 11 1 0; }
.theory .theory-form-bars-12 { flex: 12 1 0; }
.theory .theory-form-bars-13 { flex: 13 1 0; }
.theory .theory-form-bars-14 { flex: 14 1 0; }
.theory .theory-form-bars-15 { flex: 15 1 0; }
.theory .theory-form-bars-16 { flex: 16 1 0; }
.theory .theory-form-bars-17 { flex: 17 1 0; }
.theory .theory-form-bars-18 { flex: 18 1 0; }
.theory .theory-form-bars-19 { flex: 19 1 0; }
.theory .theory-form-bars-20 { flex: 20 1 0; }
.theory .theory-form-bars-21 { flex: 21 1 0; }
.theory .theory-form-bars-22 { flex: 22 1 0; }
.theory .theory-form-bars-23 { flex: 23 1 0; }
.theory .theory-form-bars-24 { flex: 24 1 0; }
.theory .theory-form-bars-25 { flex: 25 1 0; }
.theory .theory-form-bars-26 { flex: 26 1 0; }
.theory .theory-form-bars-27 { flex: 27 1 0; }
.theory .theory-form-bars-28 { flex: 28 1 0; }
.theory .theory-form-bars-29 { flex: 29 1 0; }
.theory .theory-form-bars-30 { flex: 30 1 0; }
.theory .theory-form-bars-31 { flex: 31 1 0; }
.theory .theory-form-bars-32 { flex: 32 1 0; }

/* bar_chart: one numbered box per bar with its chord (a 12-bar blues is three rows of 4) */
.theory .theory-bars { margin: 8px 0 20px; }
.theory .theory-bars-grid { display: grid; gap: 6px; }
.theory .theory-bars-per-2 .theory-bars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theory .theory-bars-per-4 .theory-bars-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.theory .theory-bars-per-8 .theory-bars-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.theory .theory-bars-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 16px 4px 8px;
  border: 1px solid var(--theory-line);
  border-left: 3px solid var(--theory-ink);
  border-radius: 6px;
  background: var(--theory-paper);
}
.theory .theory-bars-number {
  position: absolute;
  top: 3px;
  left: 6px;
  color: var(--theory-ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

/* bar_cards(): the enhanced chord chart: one card per different chord as a header row, then the plain grid of badges */
.theory .theory-bars-enhanced {    /* the header and the grid framed as one figure */
  padding: 14px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-staff-bg);
}
.theory .theory-bars-chords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--theory-line);
}
.theory .theory-bars-chords .theory-chart-chord { flex: 0 0 var(--theory-card-w); width: var(--theory-card-w); }
.theory .theory-bars-chords .theory-chart-position:empty { display: none; }

/* ---------------------------------------------------------------- circles (build_theory.py Circles) */
/* a section's opening: heading and text | circle, half and half, the circle on alternating sides (circle_split);
   narrow keeps the circle at --theory-circle-w beside a long text column; stacked on phones, circle first */
.theory .theory-circle-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "text figure";
  gap: 12px 32px;
  align-items: start;
  margin: calc(36px + var(--theory-section-gap)) 0 8px;
}
.theory .theory-circle-split-flip { grid-template-areas: "figure text"; }
.theory .theory-circle-split-narrow { grid-template-columns: minmax(0, 1fr) var(--theory-circle-w); }
.theory .theory-circle-split-narrow.theory-circle-split-flip { grid-template-columns: var(--theory-circle-w) minmax(0, 1fr); }
.theory .theory-circle-split-text { grid-area: text; min-width: 0; }
.theory .theory-circle-split-figure { grid-area: figure; min-width: 0; }
.theory .theory-circle-split-text > :first-child { margin-top: 0; }
.theory .theory-circle-split-text > .theory-list:last-child,
.theory .theory-circle-split-text > .theory-text:last-child { margin-bottom: 12px; }
/* a circle on its own, centred (above a table) */
.theory .theory-circle-solo {
  max-width: 400px;
  margin: 0 auto 20px;
}
/* the figure */
.theory .theory-circle {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-circle-plain);
  text-align: left;
}
.theory .theory-circle-svg {
  display: block;
  width: 100%;
  height: auto;
}
.theory .theory-circle-caption {
  margin: 4px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}
.theory .theory-circle-title {
  display: block;
  margin: 0 0 6px;
  font-weight: 700;
}
.theory .theory-circle-legend {
  margin: 0;
  padding: 0;
  list-style: none;
}
.theory .theory-circle-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 4px;
}
.theory .theory-circle-legend-text { min-width: 0; }
.theory .theory-circle-swatch {
  flex: 0 0 auto;
  width: 18px;
  height: 12px;
  margin-top: 0.3em;
  border-radius: 3px;
  border: 1px solid var(--theory-circle-line);
}
.theory .theory-circle-swatch-fill-plain { background: var(--theory-circle-plain); }
.theory .theory-circle-swatch-fill-home { background: var(--theory-circle-home); border-color: var(--theory-circle-home); }
.theory .theory-circle-swatch-fill-a { background: var(--theory-circle-a); }
.theory .theory-circle-swatch-fill-b { background: var(--theory-circle-b); }
.theory .theory-circle-swatch-fill-c { background: var(--theory-circle-c); }
.theory .theory-circle-swatch-arrow-home,
.theory .theory-circle-swatch-arrow-a,
.theory .theory-circle-swatch-arrow-b,
.theory .theory-circle-swatch-arrow-c {
  height: 0;
  margin-top: 0.75em;
  border: 0;
  border-top: 3px solid;
  border-radius: 0;
}
.theory .theory-circle-swatch-arrow-home { border-top-color: var(--theory-circle-home-stroke); }
.theory .theory-circle-swatch-arrow-a { border-top-color: var(--theory-circle-a-stroke); }
.theory .theory-circle-swatch-arrow-b { border-top-color: var(--theory-circle-b-stroke); }
.theory .theory-circle-swatch-arrow-c { border-top-color: var(--theory-circle-c-stroke); }
/* rings: one segment per key */
.theory .theory-circle-seg {
  stroke: var(--theory-circle-line);
  stroke-width: 1.5;
}
.theory .theory-circle-fill-plain { fill: var(--theory-circle-plain); }
.theory .theory-circle-fill-home { fill: var(--theory-circle-home); }
.theory .theory-circle-fill-a { fill: var(--theory-circle-a); }
.theory .theory-circle-fill-b { fill: var(--theory-circle-b); }
.theory .theory-circle-fill-c { fill: var(--theory-circle-c); }
.theory .theory-circle-label {
  fill: var(--theory-circle-label);
  font-family: inherit;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-circle-label-outer { font-size: 18px; }
.theory .theory-circle-label-inner { font-size: 14px; }
.theory .theory-circle-label-centre { font-size: 11px; }
.theory .theory-circle-label-outer.theory-circle-two { font-size: 14px; }
.theory .theory-circle-label-inner.theory-circle-two { font-size: 11px; }
.theory .theory-circle-sub {
  fill: var(--theory-circle-sub);
  font-size: 11px;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-circle-ink-plain { fill: var(--theory-circle-label); }
.theory .theory-circle-sub.theory-circle-ink-plain { fill: var(--theory-circle-sub); }
.theory .theory-circle-ink-home { fill: var(--theory-circle-home-fg); }
.theory .theory-circle-ink-a { fill: var(--theory-circle-a-fg); }
.theory .theory-circle-ink-b { fill: var(--theory-circle-b-fg); }
.theory .theory-circle-ink-c { fill: var(--theory-circle-c-fg); }
.theory .theory-circle-outside {
  fill: var(--theory-circle-sub);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theory .theory-circle-centre {
  fill: var(--theory-circle-label);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
/* arrows, brackets, lines across, shapes */
.theory .theory-circle-arrow,
.theory .theory-circle-tick,
.theory .theory-circle-line,
.theory .theory-circle-outline {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}
.theory .theory-circle-outline { stroke-width: 3.5; stroke-linejoin: round; }
.theory .theory-circle-line { stroke-width: 2.5; }
.theory .theory-circle-shape { stroke-width: 2.5; stroke-linejoin: round; fill-opacity: 0.35; }
.theory .theory-circle-shape-a { fill: var(--theory-circle-a); }
.theory .theory-circle-shape-b { fill: var(--theory-circle-b); }
.theory .theory-circle-stroke-home { stroke: var(--theory-circle-home-stroke); }
.theory .theory-circle-stroke-a { stroke: var(--theory-circle-a-stroke); }
.theory .theory-circle-stroke-b { stroke: var(--theory-circle-b-stroke); }
.theory .theory-circle-stroke-c { stroke: var(--theory-circle-c-stroke); }
.theory .theory-circle-head-home, .theory .theory-circle-dot-home { fill: var(--theory-circle-home-stroke); }
.theory .theory-circle-head-a, .theory .theory-circle-dot-a, .theory .theory-circle-note-a { fill: var(--theory-circle-a-stroke); }
.theory .theory-circle-head-b, .theory .theory-circle-dot-b, .theory .theory-circle-note-b { fill: var(--theory-circle-b-stroke); }
.theory .theory-circle-head-c, .theory .theory-circle-dot-c { fill: var(--theory-circle-c-stroke); }
.theory .theory-circle-note { font-size: 13px; font-weight: 700; dominant-baseline: central; }
.theory .theory-circle-defs, .theory .theory-circle-marker { overflow: visible; }

/* ---------------------------------------------------------------- STAFF (build_theory.py Staff) */
/* chords as whole notes; note heads take the octave and role colours of the keyboard and guitar drawings */
.theory .theory-staff-figure {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-staff-bg);
  text-align: left;
}
.theory .theory-staff {
  display: block;
  max-width: 100%;     /* the svg's width attribute is its natural size: shrink to fit, never stretch */
  height: auto;
  overflow: visible;
}
.theory .theory-staff-line { stroke: var(--theory-staff-line); stroke-width: 1.2; }
.theory .theory-staff-ledger { stroke: var(--theory-staff-bar); stroke-width: 1.6; stroke-linecap: round; }
.theory .theory-staff-barline, .theory .theory-staff-system { stroke: var(--theory-staff-bar); stroke-width: 1.4; }
.theory .theory-staff-barline-end { stroke: var(--theory-staff-bar); stroke-width: 4; }
.theory .theory-staff-clef, .theory .theory-staff-signature, .theory .theory-staff-accidental { fill: var(--theory-staff-ink); }
.theory .theory-staff-note-head {
  fill: var(--theory-dot);
  stroke: var(--theory-staff-halo);
  stroke-width: 1.6;
  filter: drop-shadow(0 1px 1.5px rgba(48, 48, 48, 0.28));
}
.theory .theory-staff-note.theory-chord-root .theory-staff-note-head { stroke: var(--theory-ink); stroke-width: 1.8; }
.theory .theory-staff-note-label {
  fill: var(--theory-dot-fg);
  font-size: 7px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.theory .theory-staff-voice {
  stroke: var(--theory-dot);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 1 5;
  opacity: 0.75;
}
.theory .theory-staff-label { fill: var(--theory-dot); font-size: 13px; font-weight: 800; text-anchor: middle; }
.theory .theory-staff-caption { margin-top: 8px; font-size: 0.95rem; color: var(--theory-ink-soft); }
.theory .theory-staff-title { display: block; font-weight: 700; color: var(--theory-ink); }

/* staff pairs (staff_keys, staff_neck): a staff with its keyboard or guitar neck underneath, read together */
.theory .theory-staff-pair .theory-staff-instrument { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--theory-staff-line); }
.theory .theory-staff-pair .theory-keymap { min-width: 560px; max-width: 760px; }   /* build_theory.py STAFF_PAIR_KEYS; scrolls on phones */
.theory .theory-staff-pair .theory-fretmap-figure { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
/* keys marked on a keyboard map: the key takes the note's octave and role colour, like the staff note above it */
.theory .theory-keymap-white.theory-keymap-on { fill: var(--theory-dot); }
.theory .theory-keymap-label.theory-keymap-label-on { fill: var(--theory-dot-fg); font-weight: 800; }
.theory .theory-keymap-dot { cursor: default; }   /* a black key's mark: a coloured dot on the key, like the guitar's */
.theory .theory-keymap-dot-circle { fill: var(--theory-dot); stroke: var(--theory-staff-halo); stroke-width: 1.4; }
.theory .theory-keymap-dot-label { fill: var(--theory-dot-fg); font-size: 6.5px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }

/* song and work titles */
.theory .theory-cite { font-style: italic; }

/* ---------------------------------------------------------------- NOTE LINES (build_theory.py note_line) */
/* the keyboard straightened out: every half step the same width, rows stacked on shared columns */
.theory .theory-noteline-figure {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-paper);
  text-align: left;
}
.theory .theory-noteline-scroll { overflow-x: auto; }
.theory .theory-noteline { display: block; max-width: 100%; min-width: 500px; height: auto; }   /* natural size; scrolls on phones */
.theory .theory-noteline-cell { stroke: var(--theory-noteline-grid); stroke-width: 1; }
.theory .theory-noteline-cell-white { fill: var(--theory-noteline-white); }
.theory .theory-noteline-cell-black { fill: var(--theory-noteline-black); }
.theory .theory-noteline-name { fill: var(--theory-ink-soft); font-size: 11px; font-weight: 700; text-anchor: middle; }
.theory .theory-noteline-name-black { font-size: 8px; font-weight: 600; }
.theory .theory-noteline-label { fill: var(--theory-ink); font-size: 12px; font-weight: 800; text-anchor: end; dominant-baseline: central; }
.theory .theory-noteline-row { stroke: var(--theory-noteline-row); stroke-width: 1.5; stroke-dasharray: 2 4; }
.theory .theory-noteline-span { fill: none; stroke: var(--theory-noteline-span); stroke-width: 1.8; stroke-linejoin: round; }
.theory .theory-noteline-span-label { fill: var(--theory-noteline-span); font-size: 10px; font-weight: 700; text-anchor: middle; }
.theory .theory-noteline-dot-circle {
  fill: var(--theory-dot);
  stroke: var(--theory-staff-halo);
  stroke-width: 1.6;
  filter: drop-shadow(0 1px 1.5px rgba(48, 48, 48, 0.25));
}
.theory .theory-noteline-dot.theory-chord-root .theory-noteline-dot-circle { stroke: var(--theory-ink); stroke-width: 1.8; }
.theory .theory-noteline-dot-label { fill: var(--theory-dot-fg); font-size: 9px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.theory .theory-noteline-link { stroke: var(--theory-dot); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1 5; opacity: 0.8; }
.theory .theory-noteline-caption { margin-top: 8px; font-size: 0.95rem; color: var(--theory-ink-soft); }

/* ---------------------------------------------------------------- BREAKPOINTS (theory) */
/* ---------------------------------------------------------------- NOTATION (build_theory.py Notation) */
/* rhythm on a one-line staff, single symbols in tables, guitar tab, piano roll: printed music's conventions, drawn in the
   staff's colours; every drawing at its natural size (the svg's width attribute), shrinking to fit, never stretched */
.theory .theory-notation-figure {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-staff-bg);
  text-align: left;
}
.theory .theory-notation-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.theory .theory-notation { display: block; max-width: 100%; height: auto; overflow: visible; }
.theory .theory-notation-caption { margin-top: 8px; font-size: 0.95rem; color: var(--theory-ink-soft); }
.theory .theory-notation-title { display: block; font-weight: 700; color: var(--theory-ink); }
.theory .theory-notation-line { stroke: var(--theory-staff-line); stroke-width: 1.2; }
.theory .theory-notation-bar { stroke: var(--theory-staff-bar); stroke-width: 1.4; }
.theory .theory-notation-bar-end { stroke: var(--theory-staff-bar); stroke-width: 4; }
.theory .theory-notation-head, .theory .theory-notation-flag, .theory .theory-notation-rest,
.theory .theory-notation-glyph, .theory .theory-notation-dot, .theory .theory-notation-beam,
.theory .theory-notation-mark-dot { fill: var(--theory-ink); }
.theory .theory-notation-stem { stroke: var(--theory-ink); stroke-width: 1.3; }
.theory .theory-notation-mark { fill: none; stroke: var(--theory-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theory .theory-notation-tie { fill: none; stroke: var(--theory-ink); stroke-width: 1.5; stroke-linecap: round; }
.theory .theory-notation-time { fill: var(--theory-staff-ink); }
.theory .theory-notation-text { fill: var(--theory-ink); font-size: 13px; font-weight: 700; dominant-baseline: central; }
/* the counting row: bold where a note starts, bracketed while it is held, grey through a rest */
.theory .theory-notation-count { font-size: 11px; text-anchor: middle; }
.theory .theory-notation-count-on { fill: var(--theory-ink); font-weight: 800; }
.theory .theory-notation-count-held { fill: var(--theory-ink-soft); }
.theory .theory-notation-count-rest { fill: #a9adb4; }
/* rhythm(): one svg per bar, side by side, wrapping to a new line on a narrow screen instead of shrinking */
.theory .theory-notation-bars { display: flex; flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
.theory .theory-notation-bar-svg { flex: none; overflow: hidden; }
/* symbol(): a notation sign in a table cell, at the staff's size */
.theory .theory-notation-symbol { display: inline-block; vertical-align: middle; max-width: none; }

/* tab(): six lines, the thinnest string at the top, fret numbers on the lines */
.theory .theory-tab-line { stroke: var(--theory-staff-line); stroke-width: 1.2; }
.theory .theory-tab-bar { stroke: var(--theory-staff-bar); stroke-width: 1.4; }
.theory .theory-tab-string-name { fill: var(--theory-fretmap-label); font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.theory .theory-tab-clef {
  fill: var(--theory-staff-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  stroke: var(--theory-staff-bg);    /* clears the lines behind the letters */
  stroke-width: 4px;
  paint-order: stroke;
}
.theory .theory-tab-fret {
  fill: var(--theory-ink);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  stroke: var(--theory-staff-bg);    /* clears the line behind the number */
  stroke-width: 5px;
  paint-order: stroke;
}
/* the badges under the tab: a note badge under a single note, a chord badge under a chord, as everywhere on the site */
.theory .theory-tab-badge { fill: none; }
.theory .theory-tab-badge-ring { fill: var(--theory-paper); stroke: var(--theory-c, var(--theory-ink)); stroke-width: 2; }
.theory .theory-tab-badge-note-text { fill: var(--theory-c, var(--theory-ink)); font-size: 9.5px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.theory .theory-tab-badge-pill { fill: var(--theory-c, var(--theory-ink)); }
.theory .theory-tab-badge-chord-text { fill: #ffffff; font-size: 10.5px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }

/* piano_roll(): a keyboard on its end down the left, time across, each note a bar */
.theory {
  --theory-roll-row: #ffffff;
  --theory-roll-row-black: #eef1f6;
  --theory-roll-grid: #e1e5ec;
  --theory-roll-grid-bar: #9fa8da;
  --theory-roll-note: #00838f;     /* cyan 800 */
  --theory-roll-note-fg: #ffffff;
}
.theory .theory-roll-row { fill: var(--theory-roll-row); }
.theory .theory-roll-row-black { fill: var(--theory-roll-row-black); }
.theory .theory-roll-key { fill: var(--theory-key-white); stroke: var(--theory-key-white-line); stroke-width: 0.8; }
.theory .theory-roll-key-black { fill: var(--theory-key-black); }
.theory .theory-roll-key-name { fill: var(--theory-ink-soft); font-size: 8px; font-weight: 700; text-anchor: end; dominant-baseline: central; }
.theory .theory-roll-grid { stroke: var(--theory-roll-grid); stroke-width: 1; }
.theory .theory-roll-grid-bar { stroke: var(--theory-roll-grid-bar); stroke-width: 1.4; }
.theory .theory-roll-beat { fill: var(--theory-ink-soft); font-size: 9px; }
.theory .theory-roll-beat-bar { fill: var(--theory-ink); font-weight: 800; }
.theory .theory-roll-note-box { fill: var(--theory-roll-note); }
.theory .theory-roll-note-name { fill: var(--theory-roll-note-fg); font-size: 8.5px; font-weight: 700; dominant-baseline: central; }
.theory .theory-roll-note { fill: none; }
.theory .theory-notation-symbol-body { fill: none; }

/* ornaments and grace notes in symbol() */
.theory .theory-notation-grace { fill: var(--theory-ink); }
.theory .theory-notation-mordent { stroke-width: 2; }

/* fingering(): a finger number on a key, 1 = thumb .. 5 = little finger */
.theory .theory-keymap-finger-circle { fill: #ffffff; stroke: var(--theory-ink); stroke-width: 1; }
.theory .theory-keymap-finger-label { fill: var(--theory-ink); font-size: 8px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.theory .theory-keymap-finger { pointer-events: none; }

/* polyrhythm(): one row per hand on a shared grid, and the rhythm the two make together */
.theory {
  --theory-poly-upper: #00838f;    /* cyan 800: the right hand */
  --theory-poly-lower: #3949ab;    /* indigo 600: the left hand */
  --theory-poly-both: #303030;     /* both hands at once */
}
.theory .theory-poly-cell { fill: #ffffff; stroke: var(--theory-noteline-grid); stroke-width: 1; }
.theory .theory-poly-cell-next { fill: var(--theory-field); }
.theory .theory-poly-row { stroke: var(--theory-noteline-row); stroke-width: 1; stroke-dasharray: 2 3; }
.theory .theory-poly-label { fill: var(--theory-ink); font-size: 12px; font-weight: 700; text-anchor: end; dominant-baseline: central; }
.theory .theory-poly-head { fill: var(--theory-ink-soft); font-size: 9px; text-anchor: middle; }
.theory .theory-poly-upper { --theory-poly-dot: var(--theory-poly-upper); }
.theory .theory-poly-lower { --theory-poly-dot: var(--theory-poly-lower); }
.theory .theory-poly-both { --theory-poly-dot: var(--theory-poly-both); }
.theory .theory-poly-dot { fill: var(--theory-poly-dot); stroke: #ffffff; stroke-width: 1.5; }
.theory .theory-poly-num { fill: #ffffff; font-size: 11px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.theory .theory-poly-hit { fill: none; }
.theory .theory-poly-faded { opacity: 0.35; }

/* routine(): a timed practice session; each block as wide as its minutes (build_theory.py ROUTINE_SPAN steps) */
.theory {
  --theory-routine-technique: #00838f;   /* cyan 800 */
  --theory-routine-reading: #3949ab;     /* indigo 600 */
  --theory-routine-repertoire: #c2185b;  /* pink 700 */
  --theory-routine-creative: #2e7d32;    /* green 800 */
}
.theory .theory-routine {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-staff-bg);
}
.theory .theory-routine-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.theory .theory-routine-key { font-size: 0.8rem; font-weight: 700; color: var(--theory-ink-soft); }
.theory .theory-routine-key::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  background: var(--theory-routine-colour);
  vertical-align: -1px;
}
.theory .theory-routine-kind-technique { --theory-routine-colour: var(--theory-routine-technique); }
.theory .theory-routine-kind-reading { --theory-routine-colour: var(--theory-routine-reading); }
.theory .theory-routine-kind-repertoire { --theory-routine-colour: var(--theory-routine-repertoire); }
.theory .theory-routine-kind-creative { --theory-routine-colour: var(--theory-routine-creative); }
.theory .theory-routine-bar { display: flex; gap: 6px; }
.theory .theory-routine-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-top: 5px solid var(--theory-routine-colour);
  border-radius: 8px;
  background: var(--theory-paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.theory .theory-routine-time { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--theory-routine-colour); }
.theory .theory-routine-label { font-weight: 700; color: var(--theory-ink); line-height: 1.3; }
.theory .theory-routine-detail { font-size: 0.9rem; color: var(--theory-ink-soft); line-height: 1.45; }
.theory .theory-routine-span-5 { flex: 5 1 0; }
.theory .theory-routine-span-10 { flex: 10 1 0; }
.theory .theory-routine-span-15 { flex: 15 1 0; }
.theory .theory-routine-span-20 { flex: 20 1 0; }
.theory .theory-routine-span-25 { flex: 25 1 0; }
.theory .theory-routine-span-30 { flex: 30 1 0; }
.theory .theory-routine-span-35 { flex: 35 1 0; }
.theory .theory-routine-span-40 { flex: 40 1 0; }
.theory .theory-routine-span-45 { flex: 45 1 0; }

/* fretboard_map barres and regions: one finger laid across several strings; brackets over stretches of the neck (CAGED shapes) */
.theory .theory-fretmap-barre { fill: var(--theory-ink); opacity: 0.22; }
.theory {
  --theory-region-0: #e53935;   /* the C shape: C's badge red family */
  --theory-region-1: #2e7d32;
  --theory-region-2: #00796b;
  --theory-region-3: #3949ab;
  --theory-region-4: #8e24aa;
  --theory-region-5: #e53935;
}
.theory .theory-fretmap-region-0 { --theory-region: var(--theory-region-0); }
.theory .theory-fretmap-region-1 { --theory-region: var(--theory-region-1); }
.theory .theory-fretmap-region-2 { --theory-region: var(--theory-region-2); }
.theory .theory-fretmap-region-3 { --theory-region: var(--theory-region-3); }
.theory .theory-fretmap-region-4 { --theory-region: var(--theory-region-4); }
.theory .theory-fretmap-region-5 { --theory-region: var(--theory-region-5); }
.theory .theory-fretmap-region { fill: none; stroke: var(--theory-region); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theory .theory-fretmap-region-label { fill: var(--theory-region); font-size: 10px; font-weight: 800; text-anchor: middle; }

/* shape_cards(): one card per shape, two to a row: a numbered heading, the drawing, then what it is and how to use it */
.theory .theory-shapes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 20px;
}
.theory .theory-shape-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  border: 1px solid var(--theory-circle-line);
  border-radius: 12px;
  background: var(--theory-paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.theory .theory-shape-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1.02rem; font-weight: 700; color: var(--theory-ink); }
.theory .theory-shape-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--theory-ink);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
}
.theory .theory-shape-figure { display: flex; justify-content: center; padding: 6px 0 10px; border-bottom: 1px dashed var(--theory-line); overflow-x: auto; }
.theory .theory-shape-figure .theory-fretmap-natural.theory-fretmap-long { min-width: 0; }
.theory .theory-shape-body { padding-top: 10px; font-size: 0.95rem; line-height: 1.6; color: var(--theory-ink); }
.theory .theory-shape-text { margin: 0 0 6px; }
.theory .theory-shape-text:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- SOUND (build_theory.py Sound) */
/* the science-of-sound drawings: waveforms, spectra, envelopes, ranges, decibels, standing waves, chains, the stereo
   field, compressor and response curves, rooms and reverb, recording tracks, and simple cut-away drawings */
.theory {
  --theory-sound-1: #00838f;    /* cyan 800 */
  --theory-sound-2: #3949ab;    /* indigo 600 */
  --theory-sound-3: #c2185b;    /* pink 700 */
  --theory-sound-4: #2e7d32;    /* green 800 */
  --theory-sound-5: #ef6c00;    /* orange 800 */
  --theory-sound-axis: #9aa3ae;
  --theory-sound-grid: #e3e7ed;
  --theory-sound-panel: #ffffff;
  --theory-sound-wood: #8d6e63;
}
.theory .theory-sound-c1 { --theory-sound: var(--theory-sound-1); }
.theory .theory-sound-c2 { --theory-sound: var(--theory-sound-2); }
.theory .theory-sound-c3 { --theory-sound: var(--theory-sound-3); }
.theory .theory-sound-c4 { --theory-sound: var(--theory-sound-4); }
.theory .theory-sound-c5 { --theory-sound: var(--theory-sound-5); }
.theory .theory-sound-text { fill: var(--theory-ink); font-size: 11px; }
.theory .theory-sound-label, .theory .theory-sound-sublabel, .theory .theory-sound-note, .theory .theory-sound-tick,
.theory .theory-sound-axis-label, .theory .theory-sound-zone-text, .theory .theory-sound-bar-text, .theory .theory-sound-pole,
.theory .theory-sound-step-num, .theory .theory-sound-region-text { text-anchor: middle; }
.theory .theory-sound-end { text-anchor: end; }
.theory .theory-sound-start { text-anchor: start; }
.theory .theory-sound-label { fill: var(--theory-ink); font-size: 12px; font-weight: 700; }
.theory .theory-sound-label.theory-sound-c1, .theory .theory-sound-label.theory-sound-c2, .theory .theory-sound-label.theory-sound-c3,
.theory .theory-sound-label.theory-sound-c4, .theory .theory-sound-label.theory-sound-c5 { fill: var(--theory-sound); }
.theory .theory-sound-sublabel { fill: var(--theory-ink-soft); font-size: 10px; }
.theory .theory-sound-note { fill: var(--theory-ink-soft); font-size: 10.5px; font-weight: 700; }
.theory .theory-sound-tick { fill: var(--theory-ink-soft); font-size: 9.5px; }
.theory .theory-sound-name { font-weight: 800; fill: var(--theory-ink); }
.theory .theory-sound-axis-label { fill: var(--theory-ink-soft); font-size: 10px; font-style: italic; }
.theory .theory-sound-axis { stroke: var(--theory-sound-axis); stroke-width: 1.2; }
.theory .theory-sound-grid { stroke: var(--theory-sound-grid); stroke-width: 1; }
.theory .theory-sound-zero { stroke: var(--theory-sound-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.theory .theory-sound-guide { stroke: var(--theory-sound-axis); stroke-width: 1; stroke-dasharray: 2 3; }
.theory .theory-sound-limit { stroke: var(--theory-sound-3); stroke-width: 1; stroke-dasharray: 5 3; }
.theory .theory-sound-panel { fill: var(--theory-sound-panel); stroke: var(--theory-sound-grid); stroke-width: 1; }
.theory .theory-sound-curve { fill: none; stroke: var(--theory-sound, var(--theory-ink)); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.theory .theory-sound-thick { stroke-width: 3; }
.theory .theory-sound-ghost { stroke: var(--theory-sound-axis); stroke-width: 1.4; stroke-dasharray: 4 3; }
.theory .theory-sound-faint { stroke-opacity: 0.35; }
.theory .theory-sound-dashed { stroke: var(--theory-sound-axis); stroke-width: 1.4; stroke-dasharray: 5 4; }
.theory .theory-sound-step { stroke-width: 1.8; }
.theory .theory-sound-sample { fill: var(--theory-sound, var(--theory-ink)); }
.theory .theory-sound-bracket { fill: none; stroke: var(--theory-ink-soft); stroke-width: 1.4; }
.theory .theory-sound-arrow { fill: none; }
.theory .theory-sound-arrow-line { stroke: var(--theory-ink-soft); stroke-width: 1.4; }
.theory .theory-sound-arrow-head { fill: var(--theory-ink-soft); }
.theory .theory-sound-time .theory-sound-arrow-line { stroke: var(--theory-sound-axis); }
.theory .theory-sound-time .theory-sound-arrow-head { fill: var(--theory-sound-axis); }
.theory .theory-sound-bar { fill: var(--theory-sound); }
.theory .theory-sound-bar-text { fill: #ffffff; font-size: 10px; font-weight: 700; }
.theory .theory-sound-zone { stroke: #ffffff; stroke-width: 1.5; }   /* white gaps between the decibel zones */
.theory .theory-sound-zone-safe { fill: #c8e6c9; }
.theory .theory-sound-zone-care { fill: #fff3c4; }
.theory .theory-sound-zone-risk { fill: #ffd8b0; }
.theory .theory-sound-zone-danger { fill: #f8bbbb; }
.theory .theory-sound-zone-text { fill: var(--theory-ink); font-size: 9.5px; font-weight: 700; }
.theory .theory-sound-mode-fill { fill: var(--theory-sound); fill-opacity: 0.12; stroke: none; }
.theory .theory-sound-string { fill: none; stroke: var(--theory-ink-soft); stroke-width: 1.2; }
.theory .theory-sound-string-thick { stroke: var(--theory-ink); stroke-width: 2.4; }
.theory .theory-sound-bridge { fill: var(--theory-ink); }
.theory .theory-sound-node { fill: #ffffff; stroke: var(--theory-ink); stroke-width: 1.4; }
.theory .theory-sound-field { fill: var(--theory-field); stroke: var(--theory-sound-grid); stroke-width: 1.2; }
.theory .theory-sound-field-ring { fill: none; stroke: var(--theory-sound-grid); stroke-width: 1; stroke-dasharray: 3 4; }
.theory .theory-sound-speaker { fill: #37474f; }
.theory .theory-sound-cone { fill: #90a4ae; }
.theory .theory-sound-listener { fill: var(--theory-ink); }
.theory .theory-sound-source { fill: var(--theory-sound); stroke: #ffffff; stroke-width: 2; }
.theory .theory-sound-room { fill: var(--theory-field); stroke: var(--theory-ink-soft); stroke-width: 3; }
.theory .theory-sound-reflect { stroke: var(--theory-sound-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.theory .theory-sound-reflect-arrow .theory-sound-arrow-line { stroke: var(--theory-sound-2); stroke-dasharray: 5 4; }
.theory .theory-sound-reflect-arrow .theory-sound-arrow-head { fill: var(--theory-sound-2); }
.theory .theory-sound-direct .theory-sound-arrow-line { stroke: var(--theory-sound-3); stroke-width: 2.4; }
.theory .theory-sound-direct .theory-sound-arrow-head { fill: var(--theory-sound-3); }
.theory .theory-sound-bounce { fill: var(--theory-sound-2); }
.theory .theory-sound-spike { stroke: var(--theory-sound); stroke-width: 2; stroke-linecap: round; }
.theory .theory-sound-lane { fill: var(--theory-field); }
.theory .theory-sound-region { fill: var(--theory-sound); fill-opacity: 0.85; }
.theory .theory-sound-region-text { fill: #ffffff; font-size: 10px; font-weight: 700; }
.theory .theory-sound-magnet { fill: #b0bec5; stroke: #607d8b; stroke-width: 1; }
.theory .theory-sound-pole { fill: #37474f; font-size: 11px; font-weight: 800; }
.theory .theory-sound-coil { fill: none; stroke: #b87333; stroke-width: 1.6; }   /* copper */
.theory .theory-sound-wire { fill: none; stroke: #b87333; stroke-width: 2; }
.theory .theory-sound-damper { fill: #5d4037; }
.theory .theory-sound-wood { fill: var(--theory-sound-wood); }
.theory .theory-sound-board { fill: #d7b98e; stroke: var(--theory-sound-wood); stroke-width: 1; }
.theory .theory-sound-key { fill: #ffffff; stroke: var(--theory-ink); stroke-width: 1.4; }
.theory .theory-sound-pivot { fill: var(--theory-ink-soft); }
.theory .theory-sound-shank { stroke: var(--theory-sound-wood); stroke-width: 3; }
.theory .theory-sound-hammer { fill: #f5f0e6; stroke: var(--theory-sound-wood); stroke-width: 2; }
.theory .theory-sound-press .theory-sound-arrow-line { stroke: var(--theory-sound-3); stroke-width: 2; }
.theory .theory-sound-press .theory-sound-arrow-head { fill: var(--theory-sound-3); }
.theory .theory-sound-step-dot { fill: var(--theory-ink); }
.theory .theory-sound-step-num { fill: #ffffff; font-size: 10px; font-weight: 800; }
.theory .theory-sound-body { fill: #e8c99a; stroke: var(--theory-sound-wood); stroke-width: 2; }
.theory .theory-sound-neck { fill: #6d4c41; }
.theory .theory-sound-hole { fill: #3e2723; }
.theory .theory-sound-ripple { fill: none; stroke: var(--theory-sound-1); stroke-width: 1.4; stroke-opacity: 0.6; }
.theory .theory-sound-particle { fill: var(--theory-sound-2); fill-opacity: 0.75; }

/* chain(): boxes joined by arrows, wrapping; stacked with downward arrows on narrow screens */
.theory .theory-chain-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.theory .theory-chain-step {
  display: flex;
  flex-direction: column;
  flex: 1 1 130px;
  gap: 4px;
  padding: 10px 12px;
  border-top: 4px solid var(--theory-sound);
  border-radius: 8px;
  background: var(--theory-paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.theory .theory-chain-name { font-weight: 700; color: var(--theory-ink); line-height: 1.3; }
.theory .theory-chain-detail { font-size: 0.88rem; line-height: 1.45; color: var(--theory-ink-soft); }
.theory .theory-chain-arrow { align-self: center; font-size: 1.3rem; font-weight: 700; color: var(--theory-ink-soft); }
.theory .theory-sound-k1 { --theory-sound: var(--theory-sound-1); }
.theory .theory-sound-k2 { --theory-sound: var(--theory-sound-2); }
.theory .theory-sound-k3 { --theory-sound: var(--theory-sound-3); }
.theory .theory-sound-k4 { --theory-sound: var(--theory-sound-4); }
.theory .theory-sound-k5 { --theory-sound: var(--theory-sound-5); }
.theory .theory-sound { min-width: 520px; }   /* sound plots scroll sideways on a phone rather than shrinking past legibility */
.theory .theory-chain { background: var(--theory-staff-bg); }

/* waveform anatomy, ADSR stages, decibel labels, piano action and grand piano drawings */
.theory .theory-sound-peak { stroke: var(--theory-sound-3); stroke-width: 1.4; stroke-dasharray: 6 4; }
.theory .theory-sound-amp .theory-sound-arrow-line { stroke: var(--theory-sound-3); stroke-width: 1.8; }
.theory .theory-sound-amp .theory-sound-arrow-head { fill: var(--theory-sound-3); }
.theory .theory-sound-amp-text { fill: var(--theory-sound-3); }
.theory .theory-sound-mark-label { fill: var(--theory-ink); font-size: 12px; font-weight: 700; text-anchor: middle; }
.theory .theory-sound-hash { stroke: var(--theory-ink); stroke-width: 2; }
.theory .theory-sound-hash-half { stroke: var(--theory-ink-soft); stroke-width: 1.2; }
.theory .theory-sound-cycle { stroke: var(--theory-sound-2); stroke-width: 1.6; }
.theory .theory-sound-stage-1 { --theory-stage: var(--theory-sound-3); }
.theory .theory-sound-stage-2 { --theory-stage: var(--theory-sound-5); }
.theory .theory-sound-stage-3 { --theory-stage: var(--theory-sound-4); }
.theory .theory-sound-stage-4 { --theory-stage: var(--theory-sound-2); }
.theory .theory-sound-stage { fill: var(--theory-stage); fill-opacity: 0.12; }
.theory .theory-sound-stage-label { fill: var(--theory-stage); font-size: 11.5px; font-weight: 800; text-anchor: middle; }
.theory .theory-sound-db-label { fill: var(--theory-ink); font-size: 11.5px; font-weight: 700; text-anchor: middle; }
.theory .theory-sound-part { fill: #e2c48e; stroke: #8d6e3f; stroke-width: 1; }        /* action wood */
.theory .theory-sound-rail { fill: #a1887f; stroke: #6d4c41; stroke-width: 1; }
.theory .theory-sound-felt { fill: #d26c6c; stroke: #9a3f3f; stroke-width: 0.8; }
.theory .theory-sound-felt-head { fill: #f3efd2; stroke: #8d6e3f; stroke-width: 1.2; }
.theory .theory-sound-metal { fill: #b0bec5; stroke: #607d8b; stroke-width: 1; }
.theory .theory-sound-keytop { fill: #ffffff; stroke: var(--theory-ink-soft); stroke-width: 1; }
.theory .theory-sound-shank-wood { fill: #d9b46f; stroke: #8d6e3f; stroke-width: 1; }
.theory .theory-sound-wire-steel { stroke: #78909c; stroke-width: 2; }
.theory .theory-sound-spring { fill: none; stroke: #b87333; stroke-width: 1.6; }
.theory .theory-sound-pivot-dot { fill: #ffffff; stroke: var(--theory-ink); stroke-width: 1.2; }
.theory .theory-sound-rim { fill: #263238; }
.theory .theory-sound-soundboard { fill: #e9cf9c; }
.theory .theory-sound-piano-string { stroke: #8a8f94; stroke-width: 0.8; }
.theory .theory-sound-piano-bass { stroke: #b87333; stroke-width: 1.6; }
.theory .theory-sound-piano-bridge { fill: none; stroke: #6d4c41; stroke-width: 3.2; stroke-linecap: round; }
.theory .theory-sound-strut { stroke: #c9a227; stroke-width: 5; stroke-linecap: round; stroke-opacity: 0.85; }   /* the gold iron plate */
.theory .theory-sound-plate-bar { fill: #c9a227; }
.theory .theory-sound-pin { fill: #455a64; }
.theory .theory-sound-dampers { fill: #3e2723; }
.theory .theory-sound-keybed { fill: #212121; }
.theory .theory-sound-wkey { fill: #ffffff; stroke: #9e9e9e; stroke-width: 0.5; }
.theory .theory-sound-bkey { fill: #111111; }
.theory .theory-sound-leader { fill: none; stroke: var(--theory-ink-soft); stroke-width: 1; }
.theory .theory-sound-leader-dot { fill: var(--theory-ink); }

/* guitars: acoustic front, cut-away section, electric front */
.theory .theory-sound-fretboard { fill: #3e2a22; }
.theory .theory-sound-fret { stroke: #cfd8dc; stroke-width: 1.4; }
.theory .theory-sound-inlay { fill: #f5f0e6; }
.theory .theory-sound-nut { fill: #f5f0e6; stroke: #9e9e9e; stroke-width: 0.6; }
.theory .theory-sound-headstock { fill: #5d4037; stroke: #3e2723; stroke-width: 1; }
.theory .theory-sound-tuner-shaft { fill: #90a4ae; }
.theory .theory-sound-tuner { fill: #cfd8dc; stroke: #607d8b; stroke-width: 1; }
.theory .theory-sound-post { fill: #b0bec5; stroke: #455a64; stroke-width: 0.8; }
.theory .theory-sound-gstring { stroke: #9e9e9e; stroke-width: 0.9; fill: none; }
.theory .theory-sound-pickguard { fill: #5d4037; fill-opacity: 0.6; }
.theory .theory-sound-rosette { fill: none; stroke: #6d4c41; stroke-width: 4; stroke-dasharray: 2 2; }
.theory .theory-sound-bridge-wood { fill: #4e342e; }
.theory .theory-sound-saddle { fill: #f5f0e6; stroke: #9e9e9e; stroke-width: 0.6; }
.theory .theory-sound-bridge-pin { fill: #f5f0e6; stroke: #6d4c41; stroke-width: 0.8; }
.theory .theory-sound-guitar-air { fill: var(--theory-sound-1); fill-opacity: 0.12; }
.theory .theory-sound-block { fill: #a1887f; }
.theory .theory-sound-flex { fill: none; stroke: var(--theory-sound-1); stroke-width: 1.2; stroke-dasharray: 4 3; }
.theory .theory-sound-top-plate { fill: #e8c99a; stroke: #8d6e63; stroke-width: 0.8; }
.theory .theory-sound-brace { fill: #c8a77a; stroke: #8d6e63; stroke-width: 0.6; }
.theory .theory-sound-ebody { fill: #a32025; stroke: #1f1f1f; stroke-width: 1.6; }
.theory .theory-sound-pickguard-e { fill: #ecebe6; stroke: #1f1f1f; stroke-width: 1; }
.theory .theory-sound-pickup-cover { fill: #212121; }
.theory .theory-sound-pole-dot { fill: #b0bec5; }
.theory .theory-sound-bridge-plate { fill: #b0bec5; stroke: #607d8b; stroke-width: 1; }
.theory .theory-sound-e-saddle { fill: #78909c; }
.theory .theory-sound-switch { stroke: #424242; stroke-width: 3; stroke-linecap: round; }
.theory .theory-sound-knob { fill: #424242; stroke: #212121; stroke-width: 1; }
.theory .theory-sound-magfield { fill: none; stroke: var(--theory-sound-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.theory .theory-sound-binding { fill: none; stroke: #f5f0e6; stroke-width: 1.2; stroke-dasharray: 1 2; transform: scale(1); }
.theory .theory-sound-heel { fill: #5d4037; }
.theory .theory-sound-pickup-ring { fill: #f2f1ec; stroke: #1f1f1f; stroke-width: 0.9; }
.theory .theory-sound-whammy { fill: none; stroke: #9e9e9e; stroke-width: 3; stroke-linecap: round; }
.theory .theory-sound-switch-ring { fill: #f2f1ec; stroke: #1f1f1f; stroke-width: 1; }
.theory .theory-sound-knob-top { fill: #f5f0e6; }
.theory .theory-sound-fretboard-light { fill: #f2f1ec; stroke: #1f1f1f; stroke-width: 1; }
.theory .theory-sound-fret-dark { stroke: #1f1f1f; stroke-width: 0.9; }
.theory .theory-sound-inlay-gold { fill: #f6c21c; stroke: #1f1f1f; stroke-width: 0.5; }
.theory .theory-sound-ehead { fill: #a32025; stroke: #1f1f1f; stroke-width: 1.4; }
.theory .theory-sound-bridge-dark { fill: #4a4a4a; stroke: #1f1f1f; stroke-width: 1; }
.theory .theory-sound-screw { fill: #e0e0e0; stroke: #1f1f1f; stroke-width: 0.8; }
.theory .theory-sound-estring { fill: none; stroke: #1f1f1f; stroke-width: 0.8; }
.theory .theory-sound-tuner-stem { stroke: #9e9e9e; stroke-width: 2.4; }
.theory .theory-sound-whammy-dark { fill: none; stroke: #1f1f1f; stroke-width: 2.6; stroke-linecap: round; }
.theory .theory-sound-whammy-grip { stroke: #1f1f1f; stroke-width: 7; stroke-linecap: round; }
.theory .theory-sound-switch-tip { fill: #1f1f1f; }
.theory .theory-sound-knob-cream { fill: #f2f1ec; stroke: #1f1f1f; stroke-width: 1; }
.theory .theory-sound-knob-gold { fill: #f6c21c; stroke: #1f1f1f; stroke-width: 0.6; }
.theory .theory-sound-jack-dark { fill: #1f1f1f; }
.theory .theory-sound-strap { fill: #f2f1ec; stroke: #1f1f1f; stroke-width: 0.8; }
.theory .theory-sound-jack { fill: #b0bec5; stroke: #455a64; stroke-width: 2; }


@media (max-width: 991.98px) {
  .theory .theory-routine-bar { flex-direction: column; }   /* routine blocks stack: no narrow text columns */
  .theory .theory-routine-block { flex: none; }
  .theory .theory-chart-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* tablets: chord cards and their text stack, so the text never squeezes into a narrow column beside the cards */
  .theory .theory-split,
  .theory .theory-try .theory-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .theory .theory-chain-row { flex-direction: column; }   /* chains stack on phones */
  .theory .theory-chain-arrow { transform: rotate(90deg); }
  .theory .theory-chain-step { flex: none; }
  .theory .theory-shapes { grid-template-columns: minmax(0, 1fr); }   /* shape cards: one to a row on phones */
  .theory .theory-scale-top { grid-template-columns: 1fr; }   /* phones: details above the keyboard */
  .theory { font-size: 1rem; }
  .theory .theory-circle-split,
  .theory .theory-circle-split-flip,
  .theory .theory-circle-split-narrow,
  .theory .theory-circle-split-narrow.theory-circle-split-flip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "figure" "text";
  }
  .theory .theory-circle-split-figure { width: 100%; max-width: var(--theory-circle-max-w); justify-self: center; }
  .theory .theory-try { padding: 14px 12px 6px; }
  .theory .theory-split,
  .theory .theory-try .theory-split { grid-template-columns: minmax(0, 1fr); }
  .theory .theory-aside { padding: 14px 12px 4px; }
  .theory .theory-title { font-size: 2rem; }
  .theory .theory-lede { padding: 14px 16px; font-size: 1.0625rem; }
  .theory .theory-heading { font-size: 1.5rem; }
  .theory .theory-subheading { font-size: 1.1875rem; }
  .theory .theory-table { font-size: 0.9375rem; }
  .theory .theory-table .theory-table-cell { padding: 10px 12px; }
}
@media (max-width: 575.98px) {
  .theory .theory-chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  :root { --theory-card-w: 104px; }
  .theory .theory-chart-arrow { font-size: 1.125rem; }
  .theory .theory-bars-per-8 .theory-bars-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .theory .theory-form-section { flex-basis: 100%; }
}
@media (max-width: 430px) {
  .theory .theory-title { font-size: 1.75rem; }
  .theory .theory-table { font-size: 0.875rem; }
  .theory .theory-table .theory-table-cell { padding: 9px 10px; }
  .theory .theory-chord { padding: 0.05em 0.5em; }
  .theory .theory-glossary-nav { gap: 4px; }
  :root { --theory-nav-h: 112px; }
}
@media (hover: none) and (pointer: coarse) {
  .theory .theory-glossary-see-link { min-height: var(--theory-hit); }
}
