/*
 * **************************************************************** CHORD REFERENCE
 * Styles for the /chords/<chord type>/<chord type>-<progression>.html pages
 * (structure: reference-shell.html, written by build_reference.py).
 * Chord badges are coloured by root note, so the same chord, and its enharmonic
 * spelling (C♯7 / D♭7), looks the same on every page.
 */

:root {
  --ref-ink: #303030;
  --ref-quirk-bg: #fff8e1;        /* quirky shape tag: amber 50 (= --theory-quirk-bg) */
  --ref-quirk-fg: #5d4300;        /* 8.9:1 on amber 50 */
  --ref-quirk-line: #ffb300;      /* amber 600 */
  --ref-muted: #5f6368;
  --ref-rule: #e0e0e0;
  --ref-surface: #ffffff;
  --ref-surface-alt: #f5f5f5;
  --ref-relative-bg: #e0f7fa;      /* Material Cyan 50: the site's relative panels (= --cp-relative-bg) */
  --ref-heading: #303030;
  --ref-link: #1565c0;             /* Material Blue 800: 5.6:1 on --ref-surface-alt */
  --ref-focus: rgba(21, 101, 192, 0.35);
  /* drawings: same colours as the keyboard and chord diagrams on the rest of the site */
  --ref-key-white: #fbfaf7;        /* = --pk-white-bg */
  --ref-key-white-line: #c9c4b8;   /* = --pk-white-border */
  --ref-key-black: #1d1d1f;        /* = --pk-black-bg */
  --ref-key-black-line: #000000;
  --ref-key-chord-fg: #ffffff;     /* = --ww-chord-fg */
  --ref-gd-line: #8a8a92;          /* = --gd-line */
  --ref-gd-nut: #1d1d1f;           /* = --gd-nut */
  --ref-gd-label: #6b6b70;         /* = --gd-label */
  --ref-gd-barre: rgba(29, 29, 31, 0.18);   /* = --gd-barre */
  /* circle of fifths: same values as the home page (circle-o-5ths.css --cf-*) */
  --ref-cf-root: #37474f;          /* Blue Grey 800: root progression chords (larger, filled) */
  --ref-cf-root-fg: #ffffff;
  --ref-cf-relative: #ff5722;      /* Deep Orange 500: relative progression chords (outline) */
  --ref-cf-dot: #eceff1;           /* Blue Grey 50: every other chord */
  --ref-cf-dot-fg: #546e7a;        /* Blue Grey 600 */
  --ref-cf-track: #cfd8dc;         /* Blue Grey 100 */
  --ref-cf-max: 300px;
  /* home page menu */
  --ref-title-h: 60px;             /* pinned <h1>: one line, fixed height, so the <h2> can pin right below it */
  --ref-title-space: var(--ref-title-h);   /* contents links land with the section's <h2> just below the <h1> */
  --ref-menu-gap: 64px;            /* space above the menu */
  --ref-menu-sticky-top: 0px;      /* where the genre headers stick; set to the pinned fretboard's height if it overlaps */
  /* Roman numeral icons: shape + colour per scale degree. SYNC: --theory-num-* in theory.css, --cp-num-* in circle-o-5ths.css */
  --ref-num-1: #303030;  --ref-num-1-fg: #ffffff;   /* I   home: ink, circle */
  --ref-num-2: #546e7a;  --ref-num-2-fg: #ffffff;   /* ii  blue grey 600, square */
  --ref-num-3: #a8dade;  --ref-num-3-fg: #303030;   /* iii brand accent, leaf */
  --ref-num-4: #ffe082;  --ref-num-4-fg: #303030;   /* IV  amber 200, arch */
  --ref-num-5: #ffb300;  --ref-num-5-fg: #303030;   /* V   amber 600, arrow (tension pointing home) */
  --ref-num-6: #cfd8dc;  --ref-num-6-fg: #303030;   /* vi  blue grey 100, mirrored leaf */
  --ref-num-7: #78909c;  --ref-num-7-fg: #ffffff;   /* vii blue grey 400, hexagon */
  --ref-badge-fg-default: #ffffff;
  --ref-badge-bg-default: #303030;
  --ref-radius: 10px;
  --ref-gap: 16px;
  --ref-section-gap: 2vh;          /* extra space above every section, so a new one shows as the page scrolls (= --theory-section-gap) */
  --ref-root-0: #d32f2f;  /* C */
  --ref-root-1: #c2185b;  /* C♯/D♭ */
  --ref-root-2: #7b1fa2;  /* D */
  --ref-root-3: #512da8;  /* D♯/E♭ */
  --ref-root-4: #303f9f;  /* E */
  --ref-root-5: #1565c0;  /* F */
  --ref-root-6: #01579b;  /* F♯/G♭ */
  --ref-root-7: #00695c;  /* G */
  --ref-root-8: #2e7d32;  /* G♯/A♭ */
  --ref-root-9: #33691e;  /* A */
  --ref-root-10: #6d4c41; /* A♯/B♭ */
  --ref-root-11: #bf360c; /* B */
}

/* page wrapper <div> */
.ref-page {
  color: var(--ref-ink);
  font-weight: 400;               /* the site body is font-weight 100 (proxima-nova Thin): too light to read at text sizes */
  text-align: left;
  padding: 8px 0 32px;
}

/* page <h1> */
.ref-title {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;                     /* above the pinned <h2>, tables, drawings and circle */
  box-sizing: border-box;
  height: var(--ref-title-h);
  margin: 16px 0 8px;
  padding: 0;
  background: var(--ref-surface);  /* opaque, so the page scrolls behind it */
  color: var(--ref-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: var(--ref-title-h);
  white-space: nowrap;             /* one line: the genre leads, a long progression name ends in … */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* table of contents <div> */
.ref-toc {
  background: var(--ref-surface-alt);
  border-radius: var(--ref-radius);
  padding: 8px 16px;
  margin: 0 0 16px;
}

/* table of contents <ul> */
.ref-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 3;
  column-gap: 24px;
}

/* table of contents <li> */
.ref-toc-item {
  break-inside: avoid;
  margin: 0;
}

/* table of contents <a> */
.ref-toc-link {
  display: flex;
  align-items: center;
  min-height: 44px;                /* touch target */
  color: var(--ref-link);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}
.ref-toc-link:hover { text-decoration: underline; color: var(--ref-link); }
/* www.css removes :focus outlines with !important, so focus is shown with a shadow */
.ref-toc-link:focus-visible { box-shadow: 0 0 0 3px var(--ref-focus); }

/* progression description <div> */
.description {
  color: var(--ref-muted);
  font-size: 1.125rem;
  line-height: 1.5;
  margin: 0 0 24px;
  max-width: 72ch;
}

/* progression data <div>: summary and steps side by side */
.ref-prog-info {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--ref-gap);
  margin: 0 0 24px;
}

/* progression summary <table> */
.ref-prog-table {
  flex: 1 1 320px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--ref-surface-alt);
  border-radius: var(--ref-radius);
  overflow: hidden;
}

/* progression summary <tr> */
.ref-prog-row {
}

/* progression summary label <th> */
.ref-prog-label {
  width: 1%;
  padding: 8px 16px;
  color: var(--ref-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: top;
}

/* progression summary value <td> */
.ref-prog-value {
  padding: 8px 16px 8px 0;
  color: var(--ref-ink);
  font-weight: 600;
}

/* progression steps <table> */
.ref-steps-table {
  flex: 1 1 320px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--ref-surface-alt);
  border-radius: var(--ref-radius);
  overflow: hidden;
  text-align: center;
}

/* progression steps header <tr> */
.ref-steps-head {
}

/* progression steps header <th> */
.ref-steps-heading {
  padding: 8px 10px;
  color: var(--ref-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ref-rule);
}

/* progression steps <tr> */
.ref-steps-row {
}

/* progression steps <td> */
.ref-steps-cell {
  padding: 8px 10px;
  color: var(--ref-ink);
  font-weight: 600;
}

/* chord section <div> */
.ref-section {
  margin-top: var(--ref-section-gap);
  padding: 20px 0;
  border-top: 1px solid var(--ref-rule);
  scroll-margin-top: calc(var(--ref-title-space) - 20px);   /* contents links land with the <h2> right below the pinned title (20px = padding-top) */
}

/* chord section <h2> */
.ref-section-title {
  position: -webkit-sticky;
  position: sticky;
  top: var(--ref-title-h);         /* right below the pinned <h1>; scrolls away with its section */
  z-index: 25;
  margin: 0 0 12px;
  padding: 8px 0;
  background: var(--ref-surface);
  box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.15);
  color: var(--ref-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 16px;
}

/* heading text <span> in the <h2> */
.ref-section-name {
  min-width: 0;
}

/* Customize Voicing: permalink to the interactive page, at the right of the <h2> */
.ref-section-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ref-link);
  text-decoration: underline;
  white-space: nowrap;
}
.ref-section-link:hover { color: var(--ref-ink); }
.ref-section-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ref-focus); border-radius: 4px; }

/* progression in order <div class="row"> / <div class="col-12">: round chord badges with | or – between */
.ref-sequence-row {
  margin-bottom: 16px;
}

.ref-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* chord badge in the sequence: the chord badge, sized to its name
   (scoped under .ref-sequence so it wins over the .ref-chord-badge rule further down) */
.ref-sequence-badge {
}
.ref-sequence .ref-sequence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  max-width: none;
  margin: 0;
  padding: 8px 14px;
}

/* separator <span> */
.ref-sequence-sep {
  color: var(--ref-muted);
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}

/* two-column layout under the <h2> <div>: tables 70% | circle of fifths 30% (stacked on phones) */
.ref-section-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: var(--ref-gap);
  align-items: start;
}

/* left column: Root and Relative tables <div> */
.ref-section-tables {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* right column: circle of fifths <div> */
.ref-section-aside {
  min-width: 0;
}

/* circle of fifths <div> */
.ref-circle {
  width: 100%;
  max-width: calc(var(--ref-cf-max) + 40px);
  margin: 0 auto;
  padding: 12px 8px 10px;
  border: 1px solid var(--ref-cf-track);
  border-radius: 12px;
  background: var(--ref-surface);
}

/* "Circle of Fifths" <div> */
.ref-cf-title {
  padding: 0 4px;
  color: var(--ref-cf-dot-fg);
  font-size: 14px;
  font-weight: 700;
}

/* key and numerals <div> */
.ref-cf-key {
  margin-top: 2px;
  padding: 0 4px;
  color: var(--ref-cf-root);
  font-size: 15px;
  font-weight: 600;
}

/* circle <svg> */
.ref-cf {
  display: block;
  width: 100%;
  max-width: var(--ref-cf-max);
  height: auto;
  margin: 6px auto 4px;
  overflow: visible;
}

/* ring track <circle> */
.ref-cf-track {
  fill: none;
  stroke: var(--ref-cf-track);
  stroke-width: 1;
}

/* chord node <g> and its ring */
.ref-cf-node {
}

.ref-cf-major {
}

.ref-cf-minor {
}

.ref-cf-dim {
}

/* chord of the root progression, of the relative progression, of both */
.ref-cf-root {
}

.ref-cf-relative {
}

.ref-cf-both {
}

/* node <circle> */
.ref-cf-dot {
  fill: var(--ref-cf-dot);
  stroke: #ffffff;
  stroke-width: 1.5;
}
.ref-cf-root .ref-cf-dot,
.ref-cf-both .ref-cf-dot { fill: var(--ref-cf-root); }

/* relative outline <circle> */
.ref-cf-ring {
  fill: none;
  stroke: var(--ref-cf-relative);
  stroke-width: 3.5;
}

/* chord name <text> */
.ref-cf-label {
  fill: var(--ref-cf-dot-fg);
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
}
.ref-cf-major .ref-cf-label { font-size: 16px; }
.ref-cf-minor .ref-cf-label { font-size: 13.5px; }
.ref-cf-dim .ref-cf-label { font-size: 11px; }
.ref-cf-root .ref-cf-label,
.ref-cf-both .ref-cf-label { fill: var(--ref-cf-root-fg); font-weight: 700; }
.ref-cf-minor.ref-cf-root .ref-cf-label,
.ref-cf-minor.ref-cf-both .ref-cf-label { font-size: 14px; }
.ref-cf-relative .ref-cf-label { fill: var(--ref-cf-root); font-weight: 700; }

/* numeral <text> */
.ref-cf-roman {
  fill: var(--ref-cf-root-fg);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  opacity: 0.85;
}
.ref-cf-dim .ref-cf-roman { font-size: 8.5px; }

/* key tonic <text> and mode <text> in the centre */
.ref-cf-center {
  fill: var(--ref-cf-root);
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.ref-cf-center-mode {
  fill: var(--ref-cf-dot-fg);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
}

/* legend <div>, entries <span>, swatches <span> */
.ref-cf-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  color: var(--ref-cf-dot-fg);
  font-size: 13px;
}

.ref-cf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ref-cf-legend-root {
}

.ref-cf-legend-relative {
}

.ref-cf-swatch {
  display: inline-block;
  border-radius: 50%;
}
.ref-cf-legend-root .ref-cf-swatch { width: 14px; height: 14px; background: var(--ref-cf-root); }
.ref-cf-legend-relative .ref-cf-swatch { width: 12px; height: 12px; background: var(--ref-cf-dot); box-shadow: 0 0 0 2.5px var(--ref-cf-relative); }

/* Root / Relative <div> */
.ref-table-group {
  min-width: 0;
  background: var(--ref-surface-alt);
  border-radius: var(--ref-radius);
  padding: 12px;
}

/* Root <div> */
.ref-table-group-root {
}

/* Relative <div>: light teal, as the relative panels on the rest of the site */
.ref-table-group-relative {
  background: var(--ref-relative-bg);
}

/* Root / Relative <h3> */
.ref-table-title {
  color: var(--ref-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* progression <table>: white card inside its panel */
.ref-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 6px 0;
  margin: 0;
  padding: 6px 2px 10px;
  background: var(--ref-surface);
  border-radius: var(--ref-radius);
}

/* numerals <tr> */
.ref-row-positions {
}

/* chord names <tr> */
.ref-row-chords {
}

/* numeral <th> */
.ref-position {
  color: var(--ref-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  padding: 0 0 6px;
  white-space: nowrap;
}

/* Roman numeral icon <span>: one shape and colour per scale degree (same as the theory pages and the app) */
.ref-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;
}
.ref-num-upper { font-style: normal; }
.ref-num-lower { font-style: italic; }
.ref-num-1 { background: var(--ref-num-1); color: var(--ref-num-1-fg); border-radius: 999px; }
.ref-num-2 { background: var(--ref-num-2); color: var(--ref-num-2-fg); border-radius: 3px; }
.ref-num-3 { background: var(--ref-num-3); color: var(--ref-num-3-fg); border-radius: 12px 3px 12px 3px; }
.ref-num-4 { background: var(--ref-num-4); color: var(--ref-num-4-fg); border-radius: 12px 12px 3px 3px; }
.ref-num-5 {
  background: var(--ref-num-5);
  color: var(--ref-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;
}
.ref-num-6 { background: var(--ref-num-6); color: var(--ref-num-6-fg); border-radius: 3px 12px 3px 12px; }
.ref-num-7 {
  background: var(--ref-num-7);
  color: var(--ref-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: borrowed from outside the key, striped */
.ref-num-altered {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 4px, transparent 4px 8px);
}

/* chord name <td> */
.ref-chord {
  text-align: center;
  padding: 0;
  vertical-align: middle;
}

/* chord badge <div> */
.ref-chord-badge {
  display: block;
  max-width: 120px;
  margin: 0 auto;
  padding: 8px 4px;
  border-radius: 999px;
  background: var(--ref-badge-bg, var(--ref-badge-bg-default));
  color: var(--ref-badge-fg, var(--ref-badge-fg-default));
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* tone badges <tr>, <td>, and the badges of one chord <div> */
.ref-row-tones {
}

.ref-tones-cell {
  padding: 8px 0 0;
  text-align: center;
  vertical-align: top;
}

.ref-tones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

/* tone badge <div>: chord-role shade of its octave (as the site's tone circles) */
.ref-tone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 3px;
  border-radius: 12px;
  background: var(--ref-dot, #555555);
  color: var(--ref-dot-fg, #ffffff);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.ref-tone.ref-root { box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #1d1d1f; }

/* keyboards <tr> and guitar diagrams <tr> */
.ref-row-piano {
}

.ref-row-guitar {
}

/* keyboard <td> and guitar diagram <td> */
.ref-piano-cell,
.ref-guitar-cell {
  padding: 10px 0 0;
  text-align: center;
  vertical-align: top;
}

/* one-octave keyboard <svg> (as .mk on the rest of the site) */
.ref-piano {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
  margin: 0 auto;
}

/* white key <rect>: octave tint; chord keys in the octave's chord shade */
.ref-piano-white {
  fill: var(--ref-oct-light, var(--ref-key-white));
  stroke: var(--ref-key-white-line);
  stroke-width: 1;
}

/* black key <rect> */
.ref-piano-black {
  fill: var(--ref-key-black);
  stroke: var(--ref-key-black-line);
  stroke-width: 1;
}

/* key of a chord note */
.ref-piano-chord {
}
.ref-piano-white.ref-piano-chord,
.ref-piano-black.ref-piano-chord { fill: var(--ref-oct-chord, var(--ref-key-black)); }
.ref-piano-black.ref-piano-chord { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; }

/* note name on a white key <text> */
.ref-piano-label {
  fill: var(--ref-key-chord-fg);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

/* note circle on a black key <circle>: chord-role shade */
.ref-piano-mark {
  fill: var(--ref-dot, #555555);
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 0.75;
}

/* note name on a black key <text> */
.ref-piano-mark-label {
  fill: var(--ref-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) */
.ref-guitar {
  display: block;
  width: 100%;
  max-width: 110px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

/* fret <line> and string <line> */
.ref-guitar-fret,
.ref-guitar-string {
  stroke: var(--ref-gd-line);
  stroke-width: 1.2;
}

/* nut <rect> */
.ref-guitar-nut {
  fill: var(--ref-gd-nut);
}

/* lowest fret label <text> */
.ref-guitar-base {
  fill: var(--ref-gd-label);
  font-size: 9px;
  font-weight: 700;
  text-anchor: end;
  dominant-baseline: central;
}

/* muted string <text> */
.ref-guitar-mute {
  fill: var(--ref-gd-label);
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

/* barre <rect> */
.ref-guitar-barre {
  fill: var(--ref-gd-barre);
}

/* fretted or open note <g> */
.ref-guitar-dot {
}

/* open string note */
.ref-guitar-open {
}

/* note <circle>: chord-role shade of its octave */
.ref-guitar-dot-circle {
  fill: var(--ref-dot, #555555);
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1;
}

/* note name <text> */
.ref-guitar-dot-label {
  fill: var(--ref-dot-fg, #ffffff);
  font-size: 9.5px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.ref-guitar-open .ref-guitar-dot-label { font-size: 7.5px; }

/* no playable shape <span> */
.ref-guitar-none {
  color: var(--ref-muted);
}

/* quirky shape marker under a keyboard or guitar diagram <span> (Drawing.guitar_quirk / piano_quirk): a voicing worth noticing, not an error */
.ref-quirk {
  display: inline-block;
  margin: 4px 0 2px;
  padding: 1px 8px;
  border: 1px solid var(--ref-quirk-line);
  border-radius: 999px;
  background: var(--ref-quirk-bg);
  color: var(--ref-quirk-fg);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* chord root: white ring with a dark outline, as on the keyboard and the chord diagrams */
.ref-root {
}
.ref-guitar-dot.ref-root .ref-guitar-dot-circle,
.ref-piano-mark.ref-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-*) */
.ref-oct-0 { --ref-oct-light: var(--ww-o0-100); --ref-oct-chord: var(--ww-o0-700); --ref-r0: var(--ww-o0-900); --ref-r0-fg: var(--ww-o0-900-fg); --ref-r1: var(--ww-o0-700); --ref-r1-fg: var(--ww-o0-700-fg); --ref-r2: var(--ww-o0-500); --ref-r2-fg: var(--ww-o0-500-fg); --ref-r3: var(--ww-o0-300); --ref-r3-fg: var(--ww-o0-300-fg); }
.ref-oct-1 { --ref-oct-light: var(--ww-o1-100); --ref-oct-chord: var(--ww-o1-700); --ref-r0: var(--ww-o1-900); --ref-r0-fg: var(--ww-o1-900-fg); --ref-r1: var(--ww-o1-700); --ref-r1-fg: var(--ww-o1-700-fg); --ref-r2: var(--ww-o1-500); --ref-r2-fg: var(--ww-o1-500-fg); --ref-r3: var(--ww-o1-300); --ref-r3-fg: var(--ww-o1-300-fg); }
.ref-oct-2 { --ref-oct-light: var(--ww-o2-100); --ref-oct-chord: var(--ww-o2-700); --ref-r0: var(--ww-o2-900); --ref-r0-fg: var(--ww-o2-900-fg); --ref-r1: var(--ww-o2-700); --ref-r1-fg: var(--ww-o2-700-fg); --ref-r2: var(--ww-o2-500); --ref-r2-fg: var(--ww-o2-500-fg); --ref-r3: var(--ww-o2-300); --ref-r3-fg: var(--ww-o2-300-fg); }
.ref-oct-3 { --ref-oct-light: var(--ww-o3-100); --ref-oct-chord: var(--ww-o3-700); --ref-r0: var(--ww-o3-900); --ref-r0-fg: var(--ww-o3-900-fg); --ref-r1: var(--ww-o3-700); --ref-r1-fg: var(--ww-o3-700-fg); --ref-r2: var(--ww-o3-500); --ref-r2-fg: var(--ww-o3-500-fg); --ref-r3: var(--ww-o3-300); --ref-r3-fg: var(--ww-o3-300-fg); }
.ref-oct-4 { --ref-oct-light: var(--ww-o4-100); --ref-oct-chord: var(--ww-o4-700); --ref-r0: var(--ww-o4-900); --ref-r0-fg: var(--ww-o4-900-fg); --ref-r1: var(--ww-o4-700); --ref-r1-fg: var(--ww-o4-700-fg); --ref-r2: var(--ww-o4-500); --ref-r2-fg: var(--ww-o4-500-fg); --ref-r3: var(--ww-o4-300); --ref-r3-fg: var(--ww-o4-300-fg); }
.ref-oct-5 { --ref-oct-light: var(--ww-o5-100); --ref-oct-chord: var(--ww-o5-700); --ref-r0: var(--ww-o5-900); --ref-r0-fg: var(--ww-o5-900-fg); --ref-r1: var(--ww-o5-700); --ref-r1-fg: var(--ww-o5-700-fg); --ref-r2: var(--ww-o5-500); --ref-r2-fg: var(--ww-o5-500-fg); --ref-r3: var(--ww-o5-300); --ref-r3-fg: var(--ww-o5-300-fg); }
.ref-oct-6 { --ref-oct-light: var(--ww-o6-100); --ref-oct-chord: var(--ww-o6-700); --ref-r0: var(--ww-o6-900); --ref-r0-fg: var(--ww-o6-900-fg); --ref-r1: var(--ww-o6-700); --ref-r1-fg: var(--ww-o6-700-fg); --ref-r2: var(--ww-o6-500); --ref-r2-fg: var(--ww-o6-500-fg); --ref-r3: var(--ww-o6-300); --ref-r3-fg: var(--ww-o6-300-fg); }
.ref-oct-7 { --ref-oct-light: var(--ww-o7-100); --ref-oct-chord: var(--ww-o7-700); --ref-r0: var(--ww-o7-900); --ref-r0-fg: var(--ww-o7-900-fg); --ref-r1: var(--ww-o7-700); --ref-r1-fg: var(--ww-o7-700-fg); --ref-r2: var(--ww-o7-500); --ref-r2-fg: var(--ww-o7-500-fg); --ref-r3: var(--ww-o7-300); --ref-r3-fg: var(--ww-o7-300-fg); }
.ref-oct-8 { --ref-oct-light: var(--ww-o8-100); --ref-oct-chord: var(--ww-o8-700); --ref-r0: var(--ww-o8-900); --ref-r0-fg: var(--ww-o8-900-fg); --ref-r1: var(--ww-o8-700); --ref-r1-fg: var(--ww-o8-700-fg); --ref-r2: var(--ww-o8-500); --ref-r2-fg: var(--ww-o8-500-fg); --ref-r3: var(--ww-o8-300); --ref-r3-fg: var(--ww-o8-300-fg); }

/* chord role of a note (root darkest -> 7th lightest), in its octave's colours */
.ref-role-0 { --ref-dot: var(--ref-r0); --ref-dot-fg: var(--ref-r0-fg); }
.ref-role-1 { --ref-dot: var(--ref-r1); --ref-dot-fg: var(--ref-r1-fg); }
.ref-role-2 { --ref-dot: var(--ref-r2); --ref-dot-fg: var(--ref-r2-fg); }
.ref-role-3 { --ref-dot: var(--ref-r3); --ref-dot-fg: var(--ref-r3-fg); }

/*
 * **************************************************************** HOME PAGE MENU
 * Bootstrap .row of six genre columns (col-12 col-sm-6 col-md-4 col-xl-2), full width of its parent.
*/

/* home page menu <div>: space above it, so it starts well clear of the pinned keyboard / fretboard */
.ref-menu {
  margin-top: var(--ref-menu-gap);
  padding-top: 16px;
  text-align: left;
  color: var(--ref-ink);
}

/* menu column <div>: one or more genres, balanced by Liquid; light vertical line between columns (which column starts a row: BREAKPOINTS) */
.ref-menu-col {
  margin-bottom: 24px;
  border-left: 1px solid var(--ref-rule);
}

/* genre <h2>: sticks to the top of the screen while its genre scrolls past */
.ref-menu-genre {
  position: -webkit-sticky;
  position: sticky;
  top: var(--ref-menu-sticky-top);
  z-index: 5;                      /* above the links; below the pinned keyboard / fretboard (1020 / 1021) */
  margin: 0 0 8px;
  padding: 10px 0 8px;
  border-bottom: 2px solid var(--ref-cf-root);
  background: var(--ref-surface);  /* opaque, so the links scroll behind it */
  color: var(--ref-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

/* a second genre in the same column (Bluegrass under Country): space above its <h2> */
.ref-menu-group + .ref-menu-genre,
.ref-menu-list + .ref-menu-genre {
  margin-top: 32px;
}

/* progression <details>: starts collapsed; several can be open at once (no JavaScript) */
.ref-menu-group {
  margin: 22px 0 0;
}

/* progression <summary>: the whole heading opens / closes the links; browser marker replaced by the chevron */
.ref-menu-toggle {
  display: block;
  list-style: none;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
}
.ref-menu-toggle::-webkit-details-marker { display: none; }
.ref-menu-toggle:focus { outline: none; }
.ref-menu-toggle:focus-visible { box-shadow: 0 0 0 3px var(--ref-focus); }

/* progression <h3>: a clear break between progressions, at least 44px tall, chevron at the right */
.ref-menu-progression {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 6px 10px;
  border-left: 3px solid var(--ref-cf-root);
  border-radius: 0 6px 6px 0;
  background: var(--ref-surface-alt);
  color: var(--ref-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  /* no uppercase: the case of a numeral is its meaning (ii = minor, II = major) */
}
.ref-menu-toggle:hover .ref-menu-progression { color: var(--ref-link); }

/* chevron: points down when collapsed, up when open */
.ref-menu-progression::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: 0 4px 4px 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.ref-menu-group[open] > .ref-menu-toggle .ref-menu-progression::after {
  margin: 4px 4px 0 0;
  transform: rotate(-135deg);
}

/* links <ul> */
.ref-menu-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

/* link <li> */
.ref-menu-item {
  margin: 0 0 4px;
}

/* link <a> */
.ref-menu-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 0;
  color: var(--ref-link);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 4px;
}
.ref-menu-link:hover { color: var(--ref-link); text-decoration: underline; }
.ref-menu-link:focus-visible { box-shadow: 0 0 0 3px var(--ref-focus); }

/* chord badges: one class per chord, coloured by root note */

.chord-a {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-a-flat {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-a-flat-7 {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-a-flat-m {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-a-flat-m7 {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-a-flat-maj7 {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-a-sharp {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-a-sharp-7 {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-a-sharp-dim {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-a-sharp-m {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-a-sharp-m7 {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-a-sharp-m7-flat-5 {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-a7 {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-adim {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-am {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-am7 {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-am7-flat-5 {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-amaj7 {
  --ref-badge-bg: var(--ref-root-9);
}

.chord-b {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-b-flat {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-b-flat-7 {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-b-flat-m {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-b-flat-m7 {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-b-flat-maj7 {
  --ref-badge-bg: var(--ref-root-10);
}

.chord-b7 {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-bdim {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-bm {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-bm7 {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-bm7-flat-5 {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-bmaj7 {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-c {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-c-flat {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-c-flat-7 {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-c-flat-maj7 {
  --ref-badge-bg: var(--ref-root-11);
}

.chord-c-sharp {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-c-sharp-7 {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-c-sharp-dim {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-c-sharp-m {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-c-sharp-m7 {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-c-sharp-m7-flat-5 {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-c7 {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-cdim {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-cm {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-cm7 {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-cm7-flat-5 {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-cmaj7 {
  --ref-badge-bg: var(--ref-root-0);
}

.chord-d {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-d-flat {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-d-flat-7 {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-d-flat-maj7 {
  --ref-badge-bg: var(--ref-root-1);
}

.chord-d-sharp {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-d-sharp-7 {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-d-sharp-dim {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-d-sharp-m {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-d-sharp-m7 {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-d-sharp-m7-flat-5 {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-d7 {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-ddim {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-dm {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-dm7 {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-dm7-flat-5 {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-dmaj7 {
  --ref-badge-bg: var(--ref-root-2);
}

.chord-e {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-e-flat {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-e-flat-7 {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-e-flat-m {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-e-flat-m7 {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-e-flat-maj7 {
  --ref-badge-bg: var(--ref-root-3);
}

.chord-e-sharp-dim {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-e-sharp-m7-flat-5 {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-e7 {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-edim {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-em {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-em7 {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-em7-flat-5 {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-emaj7 {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-f {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-f-flat {
  --ref-badge-bg: var(--ref-root-4);
}

.chord-f-sharp {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f-sharp-7 {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f-sharp-dim {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f-sharp-m {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f-sharp-m7 {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f-sharp-m7-flat-5 {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f-sharp-maj7 {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-f7 {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-fdim {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-fm {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-fm7 {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-fm7-flat-5 {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-fmaj7 {
  --ref-badge-bg: var(--ref-root-5);
}

.chord-g {
  --ref-badge-bg: var(--ref-root-7);
}

.chord-g-flat {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-g-flat-7 {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-g-flat-maj7 {
  --ref-badge-bg: var(--ref-root-6);
}

.chord-g-sharp {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-g-sharp-7 {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-g-sharp-dim {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-g-sharp-m {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-g-sharp-m7 {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-g-sharp-m7-flat-5 {
  --ref-badge-bg: var(--ref-root-8);
}

.chord-g7 {
  --ref-badge-bg: var(--ref-root-7);
}

.chord-gdim {
  --ref-badge-bg: var(--ref-root-7);
}

.chord-gm {
  --ref-badge-bg: var(--ref-root-7);
}

.chord-gm7 {
  --ref-badge-bg: var(--ref-root-7);
}

.chord-gm7-flat-5 {
  --ref-badge-bg: var(--ref-root-7);
}

.chord-gmaj7 {
  --ref-badge-bg: var(--ref-root-7);
}

/* breadcrumb <nav>: above the <h1>, scrolls away with the page (not sticky) */
.ref-breadcrumb {
  margin: 12px 0 4px;
  font-size: 0.875rem;
  line-height: 1.4;
}
.ref-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ref-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
/* separator between levels */
.ref-breadcrumb-item + .ref-breadcrumb-item::before {
  content: "›";
  padding: 0 8px;
  color: var(--ref-muted);
  font-weight: 700;
}
/* breadcrumb <a>: every level above this page */
.ref-breadcrumb-link {
  display: inline-flex;
  align-items: center;
  color: var(--ref-link);
  font-weight: 600;
  text-decoration: none;
}
.ref-breadcrumb-link:hover { text-decoration: underline; }
.ref-breadcrumb-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ref-focus); border-radius: 4px; }
/* breadcrumb <span>: this page */
.ref-breadcrumb-current {
  color: var(--ref-muted);
  font-weight: 600;
}

/* chord type index wrapper <div> */
.ref-index {
  padding-bottom: 32px;
}
/* the chord type menu sits right under the <h1>, without the home page menu's top gap */
.ref-index .ref-menu {
  margin-top: 16px;
}

/* about this progression <div> (progressions.json history, listen_for, famous_songs, related) */
.ref-about {
  margin: 0 0 24px;
  padding: 16px 20px;
  background: var(--ref-surface-alt);
  border-radius: var(--ref-radius);
}

/* about <h2> */
.ref-about-title {
  margin: 0 0 12px;
  color: var(--ref-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

/* about blocks <div>: two columns from 768px (BREAKPOINTS) */
.ref-about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 32px;
}

/* one about block <div> */
.ref-about-block {
  min-width: 0;
}

/* about block <h3> */
.ref-about-heading {
  margin: 0 0 6px;
  color: var(--ref-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* about block <p> */
.ref-about-text {
  margin: 0;
  color: var(--ref-ink);
  line-height: 1.6;
}

/* famous songs / related progressions <ul> */
.ref-about-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* famous song / related progression <li> */
.ref-about-item {
  margin: 0 0 6px;
  line-height: 1.5;
}

/* song title <cite> */
.ref-about-song {
  color: var(--ref-ink);
  font-style: normal;
  font-weight: 700;
}

/* artist / genre <span>, after a song or a related progression */
.ref-about-note {
  color: var(--ref-muted);
}
.ref-about-note::before { content: "· "; }

/* related progression <a>: at least 44px to tap */
.ref-about-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ref-link);
  font-weight: 600;
  text-decoration: underline;
}
.ref-about-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ref-focus); border-radius: 4px; }

/* BREAKPOINTS (Bootstrap 4.6 widths: 576 / 768 / 992 / 1200) */

@media (max-width: 991.98px) {
  .ref-toc-list { column-count: 2; }
  .ref-tones { gap: 2px; }
  .ref-tone { min-width: 21px; height: 21px; padding: 0 2px; font-size: 10px; }
}

/* phones: tables and circle of fifths stack */
@media (max-width: 767.98px) {
  :root { --ref-cf-max: 280px; }      /* = circle-o-5ths.css --cf-max at 768px */
  .ref-section-body { grid-template-columns: minmax(0, 1fr); }
  .ref-title { font-size: 1.625rem; }
  :root { --ref-title-h: 52px; }
  .ref-section-title { font-size: 1.25rem; }
  .ref-about-grid { grid-template-columns: minmax(0, 1fr); }
}

/* phones: each chord is a column (numeral, badge, tones, keyboard, guitar), three chords per band, so a
   4- or 5-chord progression wraps onto a second band instead of shrinking the drawings or scrolling.
   The table is laid out as a grid; its rows only group cells (display: contents). */
@media (max-width: 575.98px) {
  .ref-table {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 8px;
    width: 100%;
  }
  .ref-table > tbody,
  .ref-table tr { display: contents; }
  .ref-position { padding-top: 10px; }
  .ref-row-positions > :nth-child(1) { grid-area: 1 / 1; }
  .ref-row-chords > :nth-child(1) { grid-area: 2 / 1; }
  .ref-row-tones > :nth-child(1) { grid-area: 3 / 1; }
  .ref-row-piano > :nth-child(1) { grid-area: 4 / 1; }
  .ref-row-guitar > :nth-child(1) { grid-area: 5 / 1; }
  .ref-row-positions > :nth-child(2) { grid-area: 1 / 2; }
  .ref-row-chords > :nth-child(2) { grid-area: 2 / 2; }
  .ref-row-tones > :nth-child(2) { grid-area: 3 / 2; }
  .ref-row-piano > :nth-child(2) { grid-area: 4 / 2; }
  .ref-row-guitar > :nth-child(2) { grid-area: 5 / 2; }
  .ref-row-positions > :nth-child(3) { grid-area: 1 / 3; }
  .ref-row-chords > :nth-child(3) { grid-area: 2 / 3; }
  .ref-row-tones > :nth-child(3) { grid-area: 3 / 3; }
  .ref-row-piano > :nth-child(3) { grid-area: 4 / 3; }
  .ref-row-guitar > :nth-child(3) { grid-area: 5 / 3; }
  .ref-row-positions > :nth-child(4) { grid-area: 6 / 1; }
  .ref-row-chords > :nth-child(4) { grid-area: 7 / 1; }
  .ref-row-tones > :nth-child(4) { grid-area: 8 / 1; }
  .ref-row-piano > :nth-child(4) { grid-area: 9 / 1; }
  .ref-row-guitar > :nth-child(4) { grid-area: 10 / 1; }
  .ref-row-positions > :nth-child(5) { grid-area: 6 / 2; }
  .ref-row-chords > :nth-child(5) { grid-area: 7 / 2; }
  .ref-row-tones > :nth-child(5) { grid-area: 8 / 2; }
  .ref-row-piano > :nth-child(5) { grid-area: 9 / 2; }
  .ref-row-guitar > :nth-child(5) { grid-area: 10 / 2; }
  .ref-row-positions > :nth-child(6) { grid-area: 6 / 3; }
  .ref-row-chords > :nth-child(6) { grid-area: 7 / 3; }
  .ref-row-tones > :nth-child(6) { grid-area: 8 / 3; }
  .ref-row-piano > :nth-child(6) { grid-area: 9 / 3; }
  .ref-row-guitar > :nth-child(6) { grid-area: 10 / 3; }
}

@media (max-width: 430px) {
  .ref-title { font-size: 1.25rem; }
  :root { --ref-title-h: 44px; }
  .ref-sequence { gap: 4px; }
  .ref-sequence .ref-sequence-badge { padding: 7px 10px; }
  .ref-toc { padding: 4px 12px; }
  .ref-toc-list { column-count: 1; }
  .ref-prog-table, .ref-steps-table { flex-basis: 100%; }
  .ref-steps-heading { padding: 6px 4px; font-size: 0.75rem; letter-spacing: 0; }
  .ref-steps-cell { padding: 6px 4px; font-size: 0.9375rem; }
  .ref-prog-label { padding: 8px 10px; }
  .description { font-size: 1rem; }
  .ref-table-group { padding: 10px 8px; }
  .ref-table { gap: 0 6px; }
  .ref-chord-badge { font-size: 0.875rem; padding: 7px 2px; }
}

/* touch screens: menu links at least 44px tall */
@media (hover: none) and (pointer: coarse) {
  .ref-menu-link { min-height: 44px; }
  .ref-breadcrumb-link { min-height: 44px; }
}

/* menu column lines: no line on the first column of each row (1 per row < 576, 2 from 576, 3 from 768, 6 from 1200) */
@media (max-width: 575.98px) {
  .ref-menu-col { border-left: none; }
}
@media (min-width: 576px) and (max-width: 767.98px) {
  .ref-menu-col:nth-child(2n+1) { border-left: none; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .ref-menu-col:nth-child(3n+1) { border-left: none; }
}
@media (min-width: 1200px) {
  .ref-menu-col:first-child { border-left: none; }
}
