/*
 * dailyguitarscale styles.
 * Colours are custom properties at the top; the page follows the system
 * light or dark setting, or a data-theme attribute on <html> if one is set.
 * A data-palette attribute picks a colour theme (see progress/themes.js),
 * note colours included; the captions name each theme's colours.
 */

/* ---- Tokens ---- */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #16110e);
  --ink: light-dark(#1d1511, #f2ebe5);
  --muted: light-dark(#6d5f56, #b5a89e);
  --line: light-dark(#ebe3dd, #33271f);
  --panel: light-dark(#f6f2ef, #221a15);
  --focus: #e3ab1f;

  /* Fretboard */
  --wood: #2e1912;
  --board: #4c2c1f;
  --fb-number-marked: #fff;
  --dot-edge: transparent;
  --fret: #cfc8bf;
  --nut: #efe7da;
  --inlay: #ebe2d4;
  --string-plain: #dcd7d1;
  --string-wound: #c99d62;
  --fb-label: #c9b6a8;
  --fb-number: #a8968a;

  /* Note roles: each theme sets its own (see progress/themes.js) */
  --root: #e2482f;
  --root-text: #fff;
  --third: #3172e0;
  --third-text: #fff;
  --fifth: #e3ab1f;
  --fifth-text: #2a1a12;
  --seventh: #17a08d;
  --seventh-text: #fff;
  --ext: #d9469a;
  --ext-text: #fff;
  --characteristic: #8a4fd8;
  --characteristic-text: #fff;
  --right: light-dark(#1f7a4a, #5fd49a);
  --wrong: light-dark(#b8321f, #ff8a75);
  --pearl: #efe8de;
  --on-light: #2a1a12;

  --font-display: Fraunces, "Noto Music", Georgia, serif;
  /* Chord symbols and numerals: the serif, with ♭ ♯ 𝄫 𝄪 from Noto Music (Fraunces has no music signs). */
  --font-music: Fraunces, "Noto Music", Georgia, serif;
  /* Neither text font has ♭ or ♯: they come from Noto Music everywhere, so they match. */
  --font-text: "Instrument Sans", "Noto Music", system-ui, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---- Themes: page and fretboard colours (Rosewood is the default above) ---- */
/* Monokai and Sonokai are dark-only, after the editor colour schemes; the light or dark choice doesn't apply. */
:root[data-palette="monokai"], :root[data-palette="monokai"][data-theme],
:root[data-palette="sonokai"], :root[data-palette="sonokai"][data-theme] { color-scheme: dark; }
:root[data-palette="monokai"] {
  --bg: #272822;
  --ink: #f8f8f2;
  --muted: #b3ad94;
  --line: #49483e;
  --panel: #3e3d32;
  --focus: #e6db74;
  --wood: #1e1f1a;
  --board: #292a23;
  --fret: #a59f85;
  --nut: #f8f8f2;
  --inlay: #75715e;
  --string-plain: #f8f8f2;
  --string-wound: #e6db74;
  --fb-label: #f8f8f2;
  --fb-number: #b3ad94;
  --root: #f92672;
  --root-text: #272822;
  --third: #66d9ef;
  --third-text: #272822;
  --fifth: #e6db74;
  --fifth-text: #272822;
  --seventh: #a6e22e;
  --seventh-text: #272822;
  --ext: #fd971f;
  --ext-text: #272822;
  --characteristic: #ae81ff;
  --characteristic-text: #272822;
}
:root[data-palette="sonokai"] {
  --bg: #2c2e34;
  --ink: #e2e2e3;
  --muted: #a3a8b4;
  --line: #414550;
  --panel: #33353f;
  --focus: #76cce0;
  --wood: #222327;
  --board: #2c2e35;
  --fret: #9a9fab;
  --nut: #e2e2e3;
  --inlay: #595f6f;
  --string-plain: #e2e2e3;
  --string-wound: #e7c664;
  --fb-label: #e2e2e3;
  --fb-number: #a3a8b4;
  --root: #fc5d7c;
  --root-text: #2c2e34;
  --third: #76cce0;
  --third-text: #2c2e34;
  --fifth: #e7c664;
  --fifth-text: #2c2e34;
  --seventh: #9ed072;
  --seventh-text: #2c2e34;
  --ext: #f39660;
  --ext-text: #2c2e34;
  --characteristic: #b39df3;
  --characteristic-text: #2c2e34;
}
:root[data-palette="maple"] {
  --bg: light-dark(#fffdf8, #18140d);
  --ink: light-dark(#1f1a12, #f3ede2);
  --muted: light-dark(#6b604f, #b8ac98);
  --line: light-dark(#ece4d3, #352d20);
  --panel: light-dark(#f8f3e8, #231d14);
  --wood: #b9864a;
  --board: #c08f53;
  --fret: #2f2b27;
  --nut: #1d1915;
  --inlay: #1d140c;
  --string-plain: #26221f;
  --string-wound: #3d2f1c;
  --fb-label: #1d140c;
  --fb-number: #2f2216;
  --fb-number-marked: #000000;
  --pearl: #fffaf0;
  --dot-edge: #1d140c;
  --root: #c0392b;
  --root-text: #fff;
  --third: #1f5fbf;
  --third-text: #fff;
  --fifth: #e0a106;
  --fifth-text: #1d140c;
  --seventh: #0f7f6f;
  --seventh-text: #fff;
  --ext: #b8327e;
  --ext-text: #fff;
  --characteristic: #6b3fb8;
  --characteristic-text: #fff;
}
:root[data-palette="ebony"] {
  --bg: light-dark(#fafafa, #121212);
  --ink: light-dark(#151515, #ececec);
  --muted: light-dark(#5f5f5f, #a8a8a8);
  --line: light-dark(#e6e6e6, #2b2b2b);
  --panel: light-dark(#f3f3f3, #1c1c1c);
  --wood: #141210;
  --board: #1e1b19;
  --fret: #bdbdbd;
  --nut: #ece8e0;
  --inlay: #e9e4da;
  --string-plain: #d8d8d8;
  --string-wound: #b8925c;
  --fb-label: #b9b2aa;
  --fb-number: #9a948d;
  --root: #ff5a4e;
  --root-text: #1a0d0b;
  --third: #5aa9ff;
  --third-text: #0b1626;
  --fifth: #ffc94a;
  --fifth-text: #1f1600;
  --seventh: #3fd0b8;
  --seventh-text: #04201b;
  --ext: #ff6fb5;
  --ext-text: #2a0a1a;
  --characteristic: #b29bff;
  --characteristic-text: #160e33;
}
:root[data-palette="slate"] {
  --bg: light-dark(#f7f9fb, #0f151b);
  --ink: light-dark(#121a22, #e6edf3);
  --muted: light-dark(#566472, #9fb0c0);
  --line: light-dark(#e1e8ee, #24303b);
  --panel: light-dark(#eef3f7, #18212a);
  --wood: #1d2731;
  --board: #27333e;
  --fret: #c3ccd4;
  --nut: #eef1f4;
  --inlay: #dfe6ec;
  --string-plain: #d9dee3;
  --string-wound: #b99a6a;
  --fb-label: #aebbc7;
  --fb-number: #8e9caa;
  --root: #f2665c;
  --root-text: #1b0a08;
  --third: #4f9dff;
  --third-text: #08162b;
  --fifth: #f5c451;
  --fifth-text: #1e1600;
  --seventh: #2fbf8f;
  --seventh-text: #03201a;
  --ext: #e86fd3;
  --ext-text: #2a0a24;
  --characteristic: #9b7bff;
  --characteristic-text: #120b30;
}
:root[data-palette="contrast"] {
  --bg: light-dark(#ffffff, #000000);
  --ink: light-dark(#000000, #ffffff);
  --muted: light-dark(#333333, #d6d6d6);
  --line: light-dark(#767676, #8a8a8a);
  --panel: light-dark(#f0f0f0, #141414);
  --focus: light-dark(#0047ff, #ffd400);
  --wood: #000000;
  --board: #000000;
  --fret: #ffffff;
  --nut: #ffffff;
  --inlay: #ffffff;
  --string-plain: #ffffff;
  --string-wound: #e8c48a;
  --fb-label: #ffffff;
  --fb-number: #e6e6e6;
  --dot-edge: #000000;
  --root: #ff3b30;
  --root-text: #000;
  --third: #3d8bff;
  --third-text: #000;
  --fifth: #ffd400;
  --fifth-text: #000;
  --seventh: #00c2a8;
  --seventh-text: #000;
  --ext: #ff5cd6;
  --ext-text: #000;
  --characteristic: #b388ff;
  --characteristic-text: #000;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-text);
  overflow-x: clip;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
h1 { font-size: clamp(32px, 5vw, 44px); }
h2 { font-size: 24px; margin-top: 36px; }
button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) max(4vw, 16px) 56px;
}

.btn {
  font: 600 15px var(--font-text);
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Header ---- */
/* Title on the left, the date shown on the right, the account controls on a row below. */
.top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: baseline;
}
.top-date { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(17px, 2.4vw, 22px); color: var(--muted); text-align: right; white-space: nowrap; }
.top-date.past { color: var(--root); }
.account { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.badge { color: var(--muted); font-size: 15px; white-space: nowrap; margin-right: 4px; }
.badge b { color: var(--ink); font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-right: 2px; }
.load-drop { display: inline-flex; align-items: center; border: 2px dashed var(--muted); background: none; }
.load-drop.over { border-color: var(--characteristic); background: var(--panel); }
.account:has(#profile-file:focus-visible) .load-drop { outline: 3px solid var(--focus); outline-offset: 2px; }
.look-select { padding: 0 8px; }
.profile-note { grid-column: 1 / -1; text-align: right; margin: 4px 0 0; }
.profile-note:empty { display: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.start { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 600; margin-top: 14px; }

.alert {
  margin: 16px 0 8px;
  padding: 12px 16px;
  border: 2px solid var(--wrong);
  border-radius: 10px;
  background: var(--panel);
}
.alert p { margin: 0; max-width: 70ch; }
.today { margin: 8px 0 20px; color: var(--muted); font-size: 17px; }

.step-link { color: var(--muted); white-space: nowrap; }
/* Chord chart: symbol over Roman numeral, in the serif; accidentals from Noto Music, which has them. */
.cc { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); max-width: 600px; margin: 4px 0 8px; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cc li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; }
.cc li + li { border-left: 1px solid var(--line); }
.cc-sym, .cc-rn { font-family: var(--font-music); font-feature-settings: "lnum"; white-space: nowrap; line-height: 1.1; }
.cc-sym { font-size: 21px; font-weight: 600; color: var(--ink); }
.cc-rn { font-size: 15px; color: var(--muted); }
.cc sup { font-size: 0.62em; line-height: 0; vertical-align: 0.75em; margin-left: 0.05em; }
/* Noto Music's signs are small beside the serif's letters: enlarge them a little and lift them onto the letters' middle. */
.cc-acc { font-size: 1.15em; line-height: 0; position: relative; top: -0.05em; margin: 0 0.02em; }
/* Noto Music's sharp is tall and thin: same height as the letters, drawn a little wider. */
.cc-acc.sharp { display: inline-block; font-size: 1em; transform: scaleX(1.3); margin: 0 0.1em; }
.cc-rn .cc-acc { color: var(--ink); opacity: 0.75; }
/* Slash chords and figured bass (6 over 4, stacked), as theory books print them. */
.cc-slash { font-weight: 400; margin: 0 0.04em; }
.cc-fig { display: inline-flex; flex-direction: column; vertical-align: 0.1em; margin-left: 0.08em; font-size: 0.62em; line-height: 0.95; text-align: left; }
.cc-fig.one { vertical-align: 0.55em; }
.cc-cap { font: 500 12px var(--font-text); color: var(--muted); margin-top: 2px; }
/* Long progressions: four bars to a line, like a lead sheet. */
.cc-bars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cc-bars li:nth-child(4n + 1) { border-left: 0; }
.cc-bars li:nth-child(n + 5) { border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .cc:not(.cc-bars) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cc li + li { border-left: 0; }
  .cc li:nth-child(4n + 2), .cc li:nth-child(4n + 3), .cc li:nth-child(4n + 4) { border-left: 1px solid var(--line); }
  .cc li:nth-child(n + 5) { border-top: 1px solid var(--line); }
}
/* A chord named in a line's label, typeset like the chart but at text size. */
.chord .cc-sym { font-size: 1.08em; }
.chord .cc-rn { font-size: 0.92em; }
.chord-caption { font-family: var(--font-music); }
/* Brightness: the seven modes as an index, with the scale's place or range in red */
.b-scale { display: flex; align-items: flex-start; gap: 6px; max-width: 600px; margin: 2px 0 8px; }
.b-end { font-size: 12px; line-height: 14px; color: var(--muted); font-style: italic; }
.b-index { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); margin: 0; padding: 0; list-style: none; }
.b-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 1px; }
.b-col::before, .b-col.b-in::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: color-mix(in srgb, var(--muted) 40%, transparent); }
.b-col:first-child::before { left: 50%; }
.b-col:last-child::before { right: 50%; }
.b-col.b-in::after { top: 4px; height: 5px; border-radius: 3px; background: var(--root); }
.b-col.b-in.b-from::after { left: 50%; }
.b-col.b-in.b-to::after { right: 50%; }
.b-col.b-from.b-to::after { display: none; }
/* Each mode is a vertical tick on the line; inside the scale's range it becomes a red dot. */
.b-dot { position: relative; z-index: 1; width: 1px; height: 11px; background: color-mix(in srgb, var(--muted) 70%, var(--bg)); }
.b-col.b-in .b-dot { width: 7px; height: 7px; margin-top: 2px; border-radius: 50%; background: var(--root); }
.b-col.b-from.b-to .b-dot { width: 13px; height: 13px; margin-top: -1px; }
.b-name, .b-short { font-size: 12px; color: var(--muted); white-space: nowrap; }
.b-col.b-in .b-name, .b-col.b-in .b-short { color: var(--ink); font-weight: 600; }
.b-short { display: none; }
@media (max-width: 640px) { .b-name { display: none; } .b-short { display: inline; } }

/* ---- Calendar of past days: a popover under its button ---- */
.calendar {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 232px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.25);
}
.cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.cal-nav {
  width: 28px;
  height: 28px;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.cal-nav:hover:not(:disabled) { border-color: var(--line); }
.cal-nav:disabled { opacity: 0.3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-sq {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
}
.cal-sq.blank { background: none; }
button.cal-sq { cursor: pointer; }
button.cal-sq:hover { filter: brightness(1.25); }
button.cal-sq:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cal-sq.done { background: var(--root); }
.viewing-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: -8px 0 16px;
  padding: 8px 12px;
  border-left: 4px solid var(--characteristic);
  background: var(--panel);
  border-radius: 6px;
}
.viewing-bar p { margin: 0; }
.today span { white-space: nowrap; }
.today b { color: var(--ink); font-weight: 600; }

/* ---- Steps: the day's blocks in a row ---- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Each step is a pill: a circle that ticks the block, then its name. */
.step { position: relative; display: flex; }
.step-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px 0 42px;
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.step-btn:hover { border-color: var(--muted); }
.step-btn b { font-weight: 600; }
.step-btn .min { color: var(--muted); font-size: 13px; }
.step-btn[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.step-btn[aria-current="true"] .min { color: inherit; opacity: 0.7; }
.step-tick {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}
.step.current .step-tick { color: var(--bg); }
.step-tick:hover .dot { border-color: var(--root); }
.step-tick:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: grid;
  place-items: center;
  flex: none;
}
.step.done .dot { background: var(--root); border-color: var(--root); }
.step.done .dot::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid var(--root-text);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.step.done:not(.current) .step-btn b { color: var(--muted); }

/* ---- Stage: the selected block, its text right above the neck ---- */
.stage { margin-top: 16px; }
.stage-head { display: block; }
.block-meta { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.stage-head h2 { margin: 0; }
.block-text { margin: 10px 0 14px; font-size: 17px; max-width: 75ch; }

/* ---- Fretboard ---- */
.neck { background: var(--wood); border-radius: 4px; overflow-x: auto; }
.neck-inner { min-width: 760px; }
.fretboard { position: relative; height: 290px; }
.fretboard > svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.fb-fret { stroke: var(--fret); stroke-width: 2.6; }
.fb-nut { fill: var(--nut); }
.fb-inlay { fill: var(--inlay); opacity: 0.8; }
.fb-string.plain { stroke: var(--string-plain); }
.fb-string.wound { stroke: var(--string-wound); }
.fb-string-name { font: 600 13px var(--font-text); fill: var(--fb-label); }
.fb-fret-number { font: 500 13px var(--font-text); fill: var(--fb-number); text-anchor: middle; }
.fb-fret-number.marked { fill: var(--fb-number-marked); font-weight: 700; }
.fb-board { fill: var(--board); }

.mk text { font: 700 12px var(--font-text); text-anchor: middle; }
.mk-root circle { fill: var(--root); }
.mk-third circle { fill: var(--third); }
.mk-fifth circle { fill: var(--fifth); }
.mk-seventh circle { fill: var(--seventh); }
.mk-ext circle { fill: var(--ext); }
.mk-characteristic circle { fill: var(--characteristic); }
.mk-target circle { fill: var(--third); }
.mk circle { stroke: var(--dot-edge); stroke-width: 1.5; }
.mk-note circle, .mk-hint circle { fill: var(--pearl); }
.mk-root text { fill: var(--root-text); }
.mk-third text, .mk-target text { fill: var(--third-text); }
.mk-fifth text { fill: var(--fifth-text); }
.mk-seventh text { fill: var(--seventh-text); }
.mk-ext text { fill: var(--ext-text); }
.mk-characteristic text { fill: var(--characteristic-text); }
.mk-note text { fill: var(--on-light); }

.under-neck {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.caption-wrap { flex: 1 1 360px; }
.caption { margin: 0; color: var(--muted); }
/* Legend: each dot on a chip of the board's colour, so pale dots show as they do on the neck. */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-chip { flex: none; }
.lg-board { fill: var(--board); }
.lg-faded { opacity: 0.25; }

/* ---- How to play it, under the tool ---- */
.breakdown { margin-top: 18px; }
.breakdown h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.breakdown dl { margin: 0; display: grid; gap: 10px; }
.breakdown dl > div { padding-left: 14px; border-left: 3px solid var(--line); max-width: 75ch; }
.breakdown dt { font-weight: 600; }
.breakdown dd { margin: 2px 0 0; }
.breakdown dl > div.shown { border-left-color: var(--root); }
.shape-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px 4px 8px;
  margin-left: -8px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
}
.shape-btn:hover { border-color: var(--muted); }
.shape-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.shape-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Small diagrams in the breakdown lines (views/breakdown-visuals.js) */
.bv { margin: 6px 0 4px; overflow-x: auto; overscroll-behavior-x: contain; }
.bv-svg { display: block; overflow: visible; }
.bv-boxes { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.bv-boxes figure { margin: 0; }
.bv-boxes figcaption { font-size: 13px; font-weight: 600; color: var(--muted); }
.bv-string { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.bv-fret { stroke: var(--muted); stroke-width: 1; opacity: 0.35; }
.bv-nut { stroke: var(--ink); stroke-width: 3.5; }
.bv-label, .bv-fret-num { font: 600 10px var(--font-text); fill: var(--muted); }
.bv-fret-num { text-anchor: middle; }
.bv .mk text { font-size: 10px; }
.bv-ghost { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 2; }
.bv-arrow { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.bv-head { fill: var(--ink); }
.bv-step { font: 700 11px var(--font-text); fill: var(--muted); text-anchor: middle; }
.bv-step.half { fill: var(--root); }
.bv-step.wide { fill: var(--characteristic); }
.bv-tab-bg { fill: var(--bg); }
.bv-tab-num { font: 700 12px var(--font-text); fill: var(--ink); text-anchor: middle; }
.bv-tab-name { font: 600 10px var(--font-text); fill: var(--muted); text-anchor: middle; }
.bv-r-root { fill: var(--root); }
.bv-r-third { fill: var(--third); }
.bv-r-fifth { fill: var(--fifth); }
.bv-r-seventh { fill: var(--seventh); }
.bv-r-ext { fill: var(--ext); }
.bv-r-characteristic { fill: var(--characteristic); }
.eye { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.shape-btn[aria-pressed="true"] .eye { background: var(--root); border-color: var(--root); }

/* ---- Tool under the fretboard ---- */
.tool {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.tool > :first-child { margin-top: 0; }
.tool > :last-child { margin-bottom: 0; }
.tool-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.tool .note { margin: 6px 0 0; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }


.confirm {
  max-width: min(480px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  padding: 20px;
}
.confirm::backdrop { background: rgb(0 0 0 / 0.45); }
.confirm h3 { margin: 0 0 12px; font-size: 18px; }
.confirm table { width: 100%; border-collapse: collapse; font-size: 15px; }
.confirm th, .confirm td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }

/* ---- About ---- */
.about { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 8px; }
.about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.about p, .about ul { margin: 6px 0 12px; max-width: 68ch; }
.note { color: var(--muted); font-size: 14px; }

/* ---- Tall screens: the neck stays in view while you read and play below it ---- */
@media (min-width: 641px) and (min-height: 720px) {
  .neck { position: sticky; top: 0; z-index: 5; box-shadow: 0 6px 16px rgb(0 0 0 / 0.18); }
}

/* ---- Phones: vertical neck ---- */
@media (max-width: 640px) {
  .steps { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .neck { max-width: 420px; margin: 0 auto; }
  .neck-inner { min-width: 0; }
  .fretboard { height: 720px; }
}
