
/* The first rules (they were a style tag of their own): safe-area insets, a dark page and plain text before anything else is set, images never wider than their box, [hidden] always hidden. The rules below take over from them. */
:root { color-scheme: light; box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; padding: 0; font: 14px -apple-system, BlinkMacSystemFont, sans-serif; background: #231610; color: #000; }
img { max-width: 100%; }
[hidden]:not([hidden=until-found i]) { display: none !important; }
/* Layout: chord families stacked as sections; each a wrapping grid of fretboard cards. Filter chips on top, tap any card to strum it. */
:root, [data-theme="wood"] {
  /* Acoustic wood – Dark: rosewood-brown back, honey accent, cream text. The default theme; Settings > Theme swaps in the two below. (Ember orange is the shared house palette elsewhere.) */
  --bg: #231610;
  --card: #2f1f16;
  --ink: #f0e4d0;
  --muted: #b39d84;
  --line: #4b3527;
  --fret: #8a7258;
  --accent: #d99a4e;
  --accent-ink: #231610;
  --dot: #f0e4d0;
  --dot-ink: #231610;
  --ok: #9bb86a;
  color-scheme: dark;
  --display: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
/* the header logo follows the theme too: its dark centre and lower string curve, one plain colour each per theme (both woods keep the exact shades of icon.svg; a dark soundhole reads on white too; Studio's are the two mixes of its own background and teal, worked out once) */
:root, :root[data-theme="wood"], :root[data-theme="wood-light"] { --logo-hole: #120a06; --logo-low: #6b4b27; }
:root[data-theme="studio"] { --logo-hole: #0e1012; --logo-low: #24625d; }
/* Acoustic wood – Light: warm white, cream cards, dark brown ink; the same honey, darkened only as far as small text needs (4.5:1 on the cards) */
[data-theme="wood-light"] { --bg: #fdfaf4; --card: #f5ecdc; --ink: #2b1a10; --muted: #6b5540; --line: #dccab0; --fret: #8f7458; --accent: #956020; --accent-ink: #fffaf0; --dot: #3b2717; --dot-ink: #f5ecdc; --ok: #3f6b1c; color-scheme: light; }
/* Studio: cool slate, teal */
[data-theme="studio"] { --bg: #1b1f24; --card: #232a31; --ink: #e6edf0; --muted: #93a1ab; --line: #36404a; --fret: #62717c; --accent: #2fb5a3; --accent-ink: #10201e; --dot: #e6edf0; --dot-ink: #1b1f24; --ok: #7ad06a; }
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5;
  padding: 0 20px;
}
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 40px 64px; display: grid; gap: 36px; }

header { display: flex; align-items: center; gap: 10px; }
.brand-mark { flex: none; width: clamp(2.75rem, 7.66vw, 4.62rem); /* about twice the title's height, so the thin ripples stay visible */ height: auto; display: block; }
h1 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.45rem, 4.05vw, 2.46rem); line-height: 1; letter-spacing: .02em; margin: 0;
  text-wrap: balance;
}
h1 span { color: var(--accent); }
.lede { margin: 0; max-width: 62ch; color: var(--muted); }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
  font-size: 13px; color: var(--muted);
}
.legend > div { display: flex; align-items: center; gap: 8px; }
.legend svg { flex: none; }

[hidden] { display: none !important; }
/* Quick taps on a control (Tap tempo, chords, chips) don't zoom the page on iPhone. Pinch-zoom still works. */
a, button, .chip, summary, label, select, input { touch-action: manipulation; }
.wrap { gap: 16px; }
.view { display: grid; gap: 16px; min-width: 0; align-content: start; }
.tabbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  padding-block: 8px; background: var(--bg); box-shadow: -20px 0 0 var(--bg), 20px 0 0 var(--bg);
}
.nav-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font: 600 14px/1 var(--body); color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; cursor: pointer;
}
.nav-tab:hover { color: var(--ink); border-color: var(--ink); }
.nav-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nav-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 520px) {
  .tabbar { gap: 6px; }
  .nav-tab { flex-direction: column; gap: 4px; min-height: 54px; padding: 6px 2px; font-size: 12px; border-radius: 16px; }
}
/* Five tabs on the smallest phones: a little less space between them, and "Progressions" keeps the width it needs (the others share the rest). */
@media (max-width: 360px) {
  .tabbar { gap: 4px; }
  .nav-tab { font-size: 11px; padding: 6px 0; }
}
.linkish { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* Settings > Theme: one button per theme on the current theme's card surface; its dot carries that palette's own colours */
.theme { display: grid; gap: 10px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; font: 500 13px/1.2 var(--body); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; text-align: left; cursor: pointer; }
.sw-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--card); margin-left: 4px; }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faqs { display: grid; gap: 8px; }
.faqs .faq { max-width: none; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; text-align: left; }
.faqs .faq summary { text-align: left; display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.faqs .faq summary::after { content: "+"; font-size: 18px; line-height: 1; }
.faqs .faq[open] summary::after { content: "–"; }
.faqs .legend { padding: 4px 0 8px; }
.feedback { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.fb-title { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.feedback textarea, .feedback input[type="email"] { width: 100%; font: 400 16px/1.4 var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; resize: vertical; }
.feedback textarea::placeholder, .feedback input::placeholder { color: var(--muted); }
.feedback textarea:focus-visible, .feedback input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-count { justify-self: end; margin-top: -4px; font: 400 12px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-count.near { color: var(--accent); }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fb-row .btn-live { min-height: 44px; padding-inline: 26px; }
.btn-live:disabled { opacity: .55; cursor: default; }
.fb-status { font-size: 14px; color: var(--muted); }
.fb-note { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.fb-status.ok { color: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding-block: 8px; }
.actions .note { flex: 1 1 100%; max-width: none; }
.actions a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; }
.view .capo-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 2px;
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent); mask-image: linear-gradient(to right, #000 90%, transparent); }
.view .capo-row::-webkit-scrollbar { display: none; }
.view .capo-row > * { flex: none; }
.chip.more { color: var(--accent); border-style: dashed; }
@media (min-width: 900px) {
  .view .capo-row { -webkit-mask-image: none; mask-image: none; }
}
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  font: 500 13px/1 var(--body); color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.capo-row { display: flex; gap: 8px; align-items: center; }
.capo-row .lbl { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip.sm { padding: 9px 12px; min-width: 40px; text-align: center; font-family: var(--mono); }
.from { font-size: 11px; color: var(--accent); font-weight: 500; letter-spacing: .02em; }
.chip:focus-visible, .chord:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { font-size: 13px; color: var(--muted); margin-left: auto; }

section { display: grid; gap: 14px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--accent); padding-bottom: 8px; }
h2 {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  font-size: 1.15rem; letter-spacing: .08em; margin: 0; line-height: 1; color: var(--ink);
}
.formula { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.chord {
  display: grid; justify-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 8px 10px; cursor: pointer; color: inherit; font: inherit; text-align: center;
  transition: border-color .15s, transform .15s;
}
.chord:hover { border-color: var(--fret); }
.chord.playing { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .chord.playing { transform: translateY(-2px); } }
.name { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1; }
.name small { font-size: .7em; font-weight: 700; }
.kind { max-width: 100%; font: 500 10px/1.15 var(--mono); color: var(--muted); text-align: center; overflow-wrap: break-word; }
/* Search results: one flat grid with more, smaller cards than the browsing grid (no headings, each card names its own type) */
.grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.compact .chord { padding: 8px 4px 6px; border-radius: 8px; }
.compact .name { font-size: 1.25rem; }
.compact .chord svg { max-width: 110px; }
.subtabs { margin-top: -4px; }
.chord svg { width: 100%; max-width: 180px; height: auto; display: block; }
.voice { display: grid; grid-template-rows: 1fr; grid-auto-rows: auto; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 4px; }
.voice-nav { display: flex; align-items: center; font: 500 11px/1 var(--mono); color: var(--muted); }
.voice-nav button { flex: 1; min-height: 32px; padding: 0; background: none; border: 0; border-radius: 6px; color: var(--ink); font: 500 18px/1 var(--body); cursor: pointer; }
.voice-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fav-row { display: flex; justify-content: center; }
.fav { min-width: 44px; min-height: 32px; padding: 0; background: none; border: 0; border-radius: 6px; color: var(--muted); font: 400 18px/1 var(--body); cursor: pointer; }
.fav[aria-pressed="true"] { color: var(--accent); }
.fav:disabled { opacity: .4; cursor: default; }
.fav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A row for a share button (and its note, and the link when the browser will not copy): Scales, Progressions */
.shelf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.favs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; box-sizing: border-box; padding: 0 14px; font: 500 14px/1.2 var(--body); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-align: left; }
.favs-head::after { content: "▾"; color: var(--muted); }
.favs-head[aria-expanded="true"]::after { content: "▴"; }
.favs-head:hover { border-color: var(--ink); }
.favs-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.favs-body { margin-top: 10px; }
.prog-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; font-size: 13px; background: var(--card); border: 1px solid var(--accent); border-radius: 8px; }
.prog-ask-btns { display: flex; gap: 8px; }
.prog-ask-btns .btn-live, .prog-ask-btns .btn-alt, .local-notice .chip { min-height: 44px; min-width: 44px; }
.local-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 12px; font-size: 13px; background: var(--card); border: 1px solid var(--accent); border-radius: 8px; }
.saves { display: grid; gap: 10px; margin-top: 8px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.saves .note { margin: 0; text-align: left; max-width: none; }
.save-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.save-slot { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.save-head { display: grid; gap: 2px; }
.save-name { font: 600 15px/1.2 var(--body); overflow-wrap: anywhere; }
.save-sum { font: 400 12px/1.3 var(--mono); color: var(--muted); }
.save-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.save-actions .btn-alt, .save-actions .btn-live { min-height: 44px; padding: 9px 14px; }
.save-ask { flex: 1 1 100%; font-size: 13px; }
.save-input { flex: 1 1 100%; min-width: 0; min-height: 44px; padding: 0 10px; box-sizing: border-box; font: 400 16px/1.2 var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.save-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn:disabled { opacity: .55; cursor: default; }
.share-status { font: 400 12px/1.3 var(--mono); color: var(--muted); }
.share-status:empty { display: none; }
.share-url { flex: 1 1 100%; min-width: 0; padding: 8px; font: 400 12px/1.3 var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.share-url:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.note { margin: 0 auto; font-size: 13px; color: var(--muted); max-width: 70ch; text-align: center; text-wrap: balance; }
footer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.mono { font-family: var(--mono); }
.faq { max-width: 52ch; margin-inline: auto; font-size: 14px; color: var(--muted); }
.faq summary { cursor: pointer; text-align: center; color: var(--ink); font-weight: 500; padding: 8px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: " +"; color: var(--accent); }
.faq[open] summary::after { content: " –"; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.faq ul { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 6px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.tab { padding: 8px 12px; }
.tune-pick { display: grid; gap: 6px; justify-items: center; font-size: 13px; color: var(--muted); }
.tune-pick select { width: 100%; min-height: 44px; box-sizing: border-box; font: 500 13px/1.2 var(--mono); color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 34px; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.tune-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tune-pick option, .tune-pick optgroup { background: var(--bg); color: var(--ink); }

.fact { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fact-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; justify-content: space-between; }
.fact-tag { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.fact-text { margin: 0; max-width: 70ch; font-size: 14px; line-height: 1.5; min-height: 3em; }
/* On a wide screen the same box (script moves it, at this same width) sits in the header, right of the wordmark, on every tab: the tag over the text, the button beside them,
   four lines of room for the text (the longest fact needs four) so the header keeps its height when the fact changes. Phones and tablets keep it at the top of Chords. */
@media (min-width: 1024px) {
  header h1 { flex: none; }
  header .fact { margin-left: auto; flex: 0 1 560px; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 14px; padding: 8px 12px; }
  header .fact .fact-top { display: contents; }
  header .fact .fact-tag { grid-column: 1; grid-row: 1; }
  header .fact .btn-alt { grid-column: 2; grid-row: 1 / span 2; }
  header .fact .fact-text { grid-column: 1; grid-row: 2; max-width: none; font-size: 13px; line-height: 1.4; min-height: 5.6em; }
}
.tuner { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.str { display: grid; gap: 4px; justify-items: center; padding: 16px 2px; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; }
.str:hover { border-color: var(--fret); }
.str:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.str[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.str.heard { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.str.heard.ok { border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.str .nn { font: 600 1.25rem/1 var(--display); }
.str .pos { font: 500 11px/1.1 var(--mono); opacity: .8; text-align: center; }
.gauge { display: grid; justify-items: center; gap: 4px; text-align: center; }
.gauge svg { width: 100%; max-width: 340px; height: auto; display: block; }
.gauge .g-name { font: 700 2.4rem/1 var(--display); }
.gauge .g-msg { font: 600 1.15rem/1.3 var(--display); min-height: 1.4em; color: var(--muted); }
.gauge .g-msg.up, .gauge .g-msg.down { color: var(--accent); }
.gauge .g-msg.ok { color: var(--ok); }
.gauge .g-meta { font: 400 12px/1.4 var(--mono); color: var(--muted); min-height: 1.4em; }
.gauge .needle { transition: transform .07s linear, opacity .15s; }
@media (prefers-reduced-motion: reduce) { .gauge .needle { transition: none; } }
.check { display: grid; justify-items: center; gap: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.btn-file { font: 600 14px/1 var(--body); color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 12px 18px; cursor: pointer; }
.btn-file:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-live { font: 600 14px/1 var(--body); color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer; }
.btn-live[aria-pressed="true"] { background: var(--ink); }
.btn-live:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-alt { font: 500 13px/1 var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; cursor: pointer; }
.btn-alt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-alt:hover { border-color: var(--ink); }
.btn-alt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-alt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
/* Chord search, at the top of the Chords tab. */
.search { position: relative; }
.search input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 46px 10px 16px; font: 400 16px/1.2 var(--body); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font: 400 24px/1 var(--body); cursor: pointer; }
.search button:hover { color: var(--ink); }
.search button:focus-visible { outline: 2px solid var(--accent); }
/* Identify a chord: the button sits next to the search box (below it on a narrow phone), and opens a blank neck to tap notes on */
.search-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search-row .search { flex: 1 1 240px; }
.search-row > .btn-alt { flex: none; min-height: 44px; }
.search-row > .btn-alt[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.identify { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 12px; }
.id-out { margin: 0; min-height: 44px; display: grid; gap: 4px; align-content: center; justify-items: center; text-align: center; font-size: 13px; color: var(--muted); }
.id-out .name { color: var(--ink); }
/* the neck: high e on top, the nut on the left (on the right when Left-handed), frets 1 to 12. Every spot is at least 44 x 44 so it's easy
   to hit; on a phone the neck scrolls sideways in its own box (the page doesn't), and it opens at the nut */
.id-board { display: flex; align-items: flex-start; min-width: 0; }
.id-board.lefty { flex-direction: row-reverse; }
.id-names { flex: none; width: 18px; }
.id-names svg { display: block; width: 18px; height: 264px; } /* six 44 px rows, one name level with each; outside the scroll box, so they stay put */
.id-neck { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(13, minmax(44px, 1fr)); overflow-x: auto; overflow-y: hidden; padding-bottom: 12px; } /* only sideways: a sub-pixel of height must not bring a vertical scrollbar; the room below keeps a sideways scrollbar (an overlay one on a phone) off the fret numbers */
.id-neck.lefty { direction: rtl; }
.id-spot { position: relative; height: 44px; min-width: 0; padding: 0; border: 0; border-inline-end: 1.5px solid var(--line); cursor: pointer;
  background: linear-gradient(var(--fret), var(--fret)) center / 100% var(--sw) no-repeat; }
.id-spot.open { border-inline-end: 4px solid var(--muted); }
.id-spot.open::after, .id-spot[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); box-sizing: border-box; border-radius: 50%; }
.id-spot.open::after { width: 12px; height: 12px; border: 1.5px solid var(--muted); background: var(--card); }
.id-spot[aria-pressed="true"]::after { content: attr(data-note); width: 22px; height: 22px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 10px/1 var(--mono); direction: ltr; }
.id-spot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.id-num { padding-top: 6px; text-align: center; font: 400 11px/1 var(--mono); color: var(--muted); }
.identify .id-foot { display: flex; justify-content: center; }
#prog { display: grid; gap: 14px; }
#prog .lbl { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); align-self: center; margin-right: 4px; }
#prog .chip:disabled { opacity: .45; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot { min-height: 48px; padding: 6px 2px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: 600 15px/1.1 var(--body); cursor: pointer; }
.slot:hover { border-color: var(--fret); }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot-cell { display: grid; min-width: 0; }
.slot-len { width: 100%; min-width: 0; min-height: 36px; margin-top: 4px; padding: 0 2px; box-sizing: border-box; font: 500 11px/1 var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.slot-len:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot-x { justify-self: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font: 400 18px/1 var(--body); cursor: pointer; }
.slot-x:hover { color: var(--ink); }
.slot-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.prog-show { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: end; }
.prog-now, .prog-next { display: grid; justify-items: center; gap: 6px; min-width: 0; padding: 12px 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.prog-dia { width: 100%; }
.prog-dia svg { width: 100%; height: auto; display: block; }
.prog-now .prog-dia { max-width: 200px; }
.prog-next .prog-dia { max-width: 120px; }
.prog-next .name { font-size: 1.1rem; }
.beats { display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 14px; }
.beat { box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--fret); }
.beat.one { width: 14px; height: 14px; }
.beat.on { background: var(--accent); border-color: var(--accent); }
.prog-tempo { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.prog-tempo .chip.sm { min-width: 44px; min-height: 44px; padding: 0 12px; font-size: 18px; }
.prog-bpm { min-width: 8ch; text-align: center; font: 500 11px/1 var(--mono); letter-spacing: .1em; color: var(--muted); }
.prog-bpm input, .m-bpm input { width: 3ch; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; text-align: center; letter-spacing: 0; font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none; }
.prog-bpm input { font: 700 1.5rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink); }
.prog-bpm input:focus, .m-bpm input:focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.prog-bpm input::selection, .m-bpm input::selection { background: var(--accent); color: var(--accent-ink); } /* the selected number takes the theme, not the browser blue */
.prog-tempo select { min-height: 44px; font: 500 14px/1 var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.prog-tempo select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prog-ramp { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin-top: 4px; font: 500 12px/1 var(--mono); color: var(--muted); }
.prog-ramp .opt { font: inherit; color: var(--ink); }
.ramp-f { display: flex; align-items: center; gap: 6px; }
.ramp-f input { width: 4ch; min-height: 44px; box-sizing: content-box; padding: 0 6px; text-align: center; font: 500 14px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.ramp-f input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tuner-opts { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 13px; color: var(--muted); }
.scales .tuner-opts { justify-content: center; }
.opt { display: flex; align-items: center; gap: 8px; }
.opt input { accent-color: var(--accent); width: 16px; height: 16px; }
.opt select { font: 500 13px/1 var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.opt select:focus-visible, .opt input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* one column that never grows past the screen, so on a 320 phone the key chips wrap and the Scale select shrinks instead of pushing the card wider */
.scales { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.scales .tabs { justify-content: center; }
.sc-pick { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sc-pick select { flex: 1; max-width: 280px; min-width: 0; font-size: 14px; padding: 10px 8px; }
.sc-info { display: grid; gap: 4px; text-align: center; }
.sc-title { font: 700 1.5rem/1.1 var(--display); text-wrap: balance; }
.sc-notes { font: 500 1.05rem/1.4 var(--mono); letter-spacing: .08em; }
.sc-degs { font: 400 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .08em; }
.sc-rel { margin: 0 auto; max-width: 52ch; font-size: 13px; color: var(--muted); text-wrap: balance; }
.sc-board { overflow-x: auto; } /* the whole neck is wider than the card and scrolls sideways in here; positions 1 to 5 fit */
.sc-board svg { width: 100%; height: auto; display: block; }
/* the string names sit in their own column beside the board, outside its scroll box, so they stay put while the whole neck scrolls.
   Both are drawn at one scale: the names 18 units wide, a position board 360. Left-handed, the names go on the right. */
.sc-neck { display: flex; align-items: flex-start; }
.sc-neck.lefty { flex-direction: row-reverse; }
.sc-neck .sc-board { flex: 1; min-width: 0; }
.sc-strings { flex: none; width: calc(100% * 18 / 378); }
.sc-strings svg { width: 100%; height: auto; display: block; }
.sc-legend { display: flex; justify-content: center; gap: 18px; font: 400 12px/1 var(--mono); color: var(--muted); }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sc-legend svg { flex: none; }
.sc-dot { transition: opacity .08s; }
.sc-board svg.lit .sc-dot { opacity: .28; }
.sc-board svg.lit .sc-dot.on { opacity: 1; }
.sc-dot.on circle.d { stroke: var(--ink); stroke-width: 3; }
@media (prefers-reduced-motion: no-preference) { .sc-dot.on { transform: scale(1.22); transform-box: fill-box; transform-origin: center; } }
.metro { display: grid; gap: 14px; justify-items: center; }
.m-title { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); justify-self: start; }
.m-tempo { display: flex; align-items: center; gap: 18px; }
.m-bpm { display: grid; justify-items: center; gap: 4px; min-width: 5ch; }
.m-bpm input { height: 1em; font: 700 3rem/1 var(--display); font-variant-numeric: tabular-nums; color: inherit; }
.m-bpm small { font: 500 11px/1 var(--mono); letter-spacing: .1em; color: var(--muted); }
.metro input[type="range"] { width: 100%; accent-color: var(--accent); }
.metro .tabs { justify-content: center; }
.rhythm { width: 100%; border-top: 1px solid var(--line); }
.rhythm summary { cursor: pointer; display: flex; justify-content: center; gap: 8px; padding: 12px 0 4px; font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); list-style: none; }
.rhythm summary::-webkit-details-marker { display: none; }
.rhythm summary::after { content: "+"; color: var(--accent); }
.rhythm[open] summary::after { content: "–"; }
.rhythm summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.rhythm-body { display: grid; gap: 12px; justify-items: center; padding-top: 10px; }
.rhythm-body .opt { font-size: 13px; color: var(--muted); }
.m-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 20px; }
.mdot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); }
.mdot.first { border-color: var(--accent); }
.mdot.on { background: var(--ink); border-color: var(--ink); }
.mdot.first.on { background: var(--accent); border-color: var(--accent); }

@media (max-width: 600px) {
  body { padding: 0 16px; }
  .grid { gap: 8px; }
  .grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .compact .chord { padding: 8px 2px 6px; }
  .chord { padding: 8px 2px 6px; border-radius: 8px; }
  .name { font-size: 1.25rem; }
  .strings { gap: 4px; }
  .str .nn { font-size: 1rem; }
  .str .pos { font-size: 10px; }
  .hint { margin-left: 0; width: 100%; }
}
