/* ChordWiki — warm paper & ink, with color-coded chord tones. */

:root {
  --bg: #f6f3ec;
  --paper: #fffdf8;
  --sunken: #efeae0;
  --ink: #1d1a15;
  --muted: #6f675b;
  --line: #e4ddcf;
  --line-strong: #c9bfac;
  --accent: #c8461a;
  --accent-soft: #fbe5d9;
  --on-accent: #fff;
  --c-r: #d0491b;
  --c-t: #2767c9;
  --c-f: #2b8a4b;
  --c-s: #8447d1;
  --c-x: #b37400;
  --c-n: #5d574d;
  --on-role: #fff;
  --key-white: #fffefa;
  --key-black: #27231d;
  --key-line: #b9af9b;
  --board: #efe4d0;
  --shadow: 0 1px 2px rgba(50, 35, 10, .05), 0 10px 30px -12px rgba(50, 35, 10, .12);
  --radius: 18px;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif, 'Noto Music';
  --font-display: 'Fraunces', Georgia, serif, 'Noto Music';
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13120f; --paper: #1c1a16; --sunken: #26231e; --ink: #f2ede3; --muted: #a79f92;
    --line: #322e27; --line-strong: #4b453b; --accent: #ff7d47; --accent-soft: #3b2418; --on-accent: #1a110c;
    --c-r: #ff7d47; --c-t: #62a0ff; --c-f: #52c47f; --c-s: #b38bff; --c-x: #f1b53a; --c-n: #bdb4a5; --on-role: #14110d;
    --key-white: #e9e3d7; --key-black: #0d0c0a; --key-line: #6e665a; --board: #2a241b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13120f; --paper: #1c1a16; --sunken: #26231e; --ink: #f2ede3; --muted: #a79f92;
  --line: #322e27; --line-strong: #4b453b; --accent: #ff7d47; --accent-soft: #3b2418; --on-accent: #1a110c;
  --c-r: #ff7d47; --c-t: #62a0ff; --c-f: #52c47f; --c-s: #b38bff; --c-x: #f1b53a; --c-n: #bdb4a5; --on-role: #14110d;
  --key-white: #e9e3d7; --key-black: #0d0c0a; --key-line: #6e665a; --board: #2a241b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.role-r { --role: var(--c-r); }
.role-t { --role: var(--c-t); }
.role-f { --role: var(--c-f); }
.role-s { --role: var(--c-s); }
.role-x { --role: var(--c-x); }
.role-n { --role: var(--c-n); }

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 650 22px/1 var(--font-display); letter-spacing: -.01em; flex-shrink: 0; }
.brand b { color: var(--accent); font-weight: 650; }
.tagline { font: italic 500 15px/1 var(--font-display); color: var(--muted); white-space: nowrap; padding-left: 14px; border-left: 1px solid var(--line); }
@media (max-width: 1080px) { .tagline { display: none; } }

/* Breadcrumbs: Home › Guitar chords › F on guitar */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.breadcrumbs li + li::before { content: '›'; margin-right: 4px; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* The page's chart as a savable image */
.share-image { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: center; margin: 0; }
.share-image img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); display: block; }
.share-image figcaption { font-size: 14px; color: var(--muted); max-width: 40ch; }
.share-image figcaption b { color: var(--ink); display: block; margin-bottom: 4px; }
.share-image a { font-weight: 650; text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 640px) { .share-image { grid-template-columns: 1fr; gap: 10px; } }
.logo { width: 32px; height: 32px; }

.search { position: relative; flex: 1; max-width: 380px; margin-left: auto; display: flex; align-items: center; }
.search > svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 36px 0 38px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font: 500 14px var(--font-ui); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 10px; font: 500 11px var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--sunken); }
.search input:focus ~ kbd { display: none; }
.search-hint { position: absolute; top: calc(100% + 6px); left: 14px; right: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-hint:empty { display: none; }
.search.invalid input { border-color: var(--c-r); }
.search.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; flex-shrink: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--line-strong); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); flex-shrink: 0; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.sm button { padding: 5px 11px; font-size: 12.5px; }

/* ---- Picker ------------------------------------------------------------ */

.picker { padding-top: 22px; padding-bottom: 6px; }
.roots { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.root-key {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 58px; border-radius: 12px; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); box-shadow: 0 2px 0 var(--line);
  transition: transform .1s, border-color .15s, background .15s;
}
.root-key b { font: 600 19px/1 var(--font-display); }
.root-key small { font-size: 11px; color: var(--muted); }
.root-key.black { background: var(--key-black); border-color: var(--key-black); color: #f4efe6; box-shadow: 0 2px 0 #000; }
:root[data-theme="dark"] .root-key.black { border-color: var(--line-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .root-key.black { border-color: var(--line-strong); } }
.root-key.black small { color: #b3aa9b; }
.root-key:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.root-key.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.root-key.active small { color: color-mix(in srgb, var(--on-accent) 75%, transparent); }

.qualities { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-top: 18px; }
.qgroup { display: flex; flex-direction: column; gap: 7px; }
.qlabel { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* The picker's "More chord types / Fewer" toggle: the full list flows into the same row of groups. */
.qmore { display: contents; }
.chip.more-toggle { border-style: dashed; color: var(--muted); background: transparent; font: 600 13.5px var(--font-ui); cursor: pointer; }
.chip.more-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.more-toggle span { display: inline-block; margin-left: 2px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.chip small { font-weight: 500; margin-left: 1px; }
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Cards & chord header ---------------------------------------------- */

/* main also has .wrap (whose padding shorthand would zero the top and bottom), hence main.wrap. */
main { display: flex; flex-direction: column; gap: 18px; }
main.wrap { padding-top: 18px; padding-bottom: 48px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }

.chord-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.title-block { display: flex; flex-direction: column; }
.title-block h1 { margin: 0; }
.sym { font: 650 76px/1 var(--font-display); letter-spacing: -.03em; font-variation-settings: 'opsz' 144; }
.full { font: 500 21px/1.3 var(--font-display); color: var(--muted); margin-top: 8px; }
.feel { margin: 12px 0 0; max-width: 46ch; }
.in-keys { margin: 8px 0 0; max-width: 52ch; color: var(--muted); font-size: 14px; }
.in-keys b { color: var(--ink); font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn.sm svg { width: 13px; height: 13px; }

.facts { margin: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 14px; background: var(--sunken); }
.fact dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.fact dd { margin: 0; }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.note-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font: 600 18px/1.2 var(--font-display); }
.note-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--role); }
.formula { display: flex; gap: 12px; font: 600 20px/1 var(--font-display); }
.formula span { color: var(--role); }

/* ---- Panels ------------------------------------------------------------ */

/* Overview · Guitar · Piano · Ukulele — links between the versions of a chord/scale page */
.inst-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.inst-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.inst-tab svg { width: 17px; height: 17px; color: var(--accent); }
.inst-tab:hover { border-color: var(--line-strong); }
.inst-tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.inst-tab.active svg { color: inherit; }

/* Overview page: a preview card per instrument */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.preview { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: var(--sunken); text-decoration: none; border: 1.5px solid transparent; transition: border-color .15s; }
.preview:hover { border-color: var(--accent); }
.preview h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.preview h3 svg { width: 20px; height: 20px; color: var(--accent); }
.preview-pic { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 150px; }
.preview-pic .diagram { max-width: 150px; width: 100%; }
.preview-pic .diagram.ukulele { max-width: 120px; }
.preview-pic .keys { min-width: 0; width: 100%; }
.preview-pic .tab { font-size: 13px; width: 100%; }
.preview-cap { margin: 0; font-size: 13.5px; color: var(--muted); }
.preview-cap code { font: 600 13px var(--font-mono); color: var(--ink); }
.preview .more { font-weight: 650; font-size: 14px; color: var(--accent); }

/* About / tips sections on chord pages */
.about p { margin: 0 0 10px; max-width: 75ch; }
.about .lead { font-size: 16.5px; line-height: 1.6; margin-bottom: 18px; }
.about code { font: 600 13px var(--font-mono); background: var(--sunken); padding: 1px 5px; border-radius: 5px; }
.about a { font-weight: 650; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 28px; }
.about-grid h3 { font-size: 15px; margin-bottom: 6px; color: var(--accent); }
.about-grid p { font-size: 14.5px; }

/* Key & progression pages hold every instrument; show the visitor's */
body[data-inst="guitar"] .p-only, body[data-inst="guitar"] .u-only,
body[data-inst="ukulele"] .p-only, body[data-inst="ukulele"] .g-only,
body[data-inst="piano"] .g-only, body[data-inst="piano"] .u-only, body[data-inst="piano"] .fret-only { display: none !important; }
.voicings .diagram.ukulele, .gdetail-diagram .diagram.ukulele, .ccard .diagram.ukulele { max-width: 120px; margin: 0 auto; display: block; }

.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.panel-head h2 { display: flex; align-items: center; gap: 9px; font: 650 28px/1.1 var(--font-display); }
.panel-head h2 svg { width: 26px; height: 26px; color: var(--accent); }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
h3 { font: 650 17px/1.3 var(--font-display); margin-bottom: 10px; }
h3 .muted { font-weight: 500; }

/* Guitar */
.voicings { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.voicing {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper);
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.voicing:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.voicing.active { border-color: var(--accent); background: var(--accent-soft); }
.voicing .diagram { width: 100%; max-width: 130px; }
.vcap { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.vcap b { font-size: 12.5px; }
.vcap code { font: 500 11.5px var(--font-mono); color: var(--muted); }

.gdetail { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 28px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); align-items: start; }
.gdetail-diagram .diagram { width: 100%; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.steps li::marker { color: var(--muted); font-size: 12px; }
.nt { display: inline-block; font-weight: 700; color: var(--role); }
.tab { margin: 0; padding: 14px 18px; border-radius: 12px; background: var(--sunken); font: 500 15px/1.45 var(--font-mono); font-variant-ligatures: none; font-feature-settings: 'calt' 0, 'liga' 0; overflow-x: auto; }
.gdetail-tab .sub { max-width: 28ch; font-size: 12.5px; }
.map-title { margin-top: 28px; margin-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.neck-wrap { margin-top: 12px; }
.neck { display: block; width: 100%; min-width: 760px; }

/* Chord diagram SVG */
svg text { font-family: var(--font-ui); }
.diagram .fret { stroke: var(--line-strong); stroke-width: 1.2; }
.diagram .str { stroke: var(--muted); stroke-width: 1.1; }
.diagram .nut { fill: var(--ink); }
.diagram .fr { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: end; dominant-baseline: central; }
.diagram .mute { font-size: 15px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.diagram .open { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.diagram .barre { fill: var(--ink); }
.diagram .barre:not(.fingers) { fill: var(--line-strong); }
.diagram .sn { font-size: 10.5px; font-weight: 600; fill: var(--role); text-anchor: middle; dominant-baseline: central; }
.dot circle { fill: var(--role); }
.dot text { fill: var(--on-role); font-size: 10.5px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.dot.fingers circle { fill: var(--ink); }
.dot.fingers text { fill: var(--bg); }
.dot.fingers.role-r circle { fill: var(--c-r); }
.dot.fingers.role-r text { fill: var(--on-role); }

.neck .board { fill: var(--board); }
.neck .fret { stroke: var(--line-strong); stroke-width: 2; }
.neck .nut-line { stroke: var(--ink); stroke-width: 5; }
.neck .str { stroke: var(--muted); }
.neck .inlay { fill: var(--line-strong); opacity: .7; }
.neck .sname, .neck .fnum { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.dot.map text { font-size: 9.5px; }
.dot.map.off { opacity: .3; }
.dot.map.on circle { stroke: var(--paper); stroke-width: 2; }

/* Piano */
.keys-wrap { padding: 2px 0 4px; }
.keys { display: block; width: 100%; min-width: 560px; }
.key { cursor: pointer; transition: filter .12s, transform .12s; transform-box: fill-box; transform-origin: 50% 0; }
.key.white { fill: var(--key-white); stroke: var(--key-line); stroke-width: 1; }
.key.black { fill: var(--key-black); stroke: var(--key-black); }
.key:hover { filter: brightness(.93); }
/* Pressed: the key dips (squashes slightly from the top) and darkens, quickly on the way down. */
.key.pressed { transform: scaleY(.965); filter: brightness(.8); transition-duration: .04s; }
.key.black:not(.on).pressed { filter: none; fill: color-mix(in srgb, var(--key-black) 62%, #8a8171); }
.key.on { fill: var(--role); stroke: color-mix(in srgb, var(--role) 70%, #000); }
.key.on.bass { fill: color-mix(in srgb, var(--role) 55%, var(--key-white)); }
.kname { font-size: 12px; font-weight: 700; fill: var(--on-role); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.kname.sm { font-size: 10px; }
.coct { font-size: 9.5px; fill: var(--muted); text-anchor: middle; pointer-events: none; }
.finger circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.finger.left circle { stroke-dasharray: 3 2; }
.finger text { font-size: 12px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

.pdetail { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); align-items: center; }
.staff { width: 100%; display: block; }
.staff .sline, .staff .ledger { stroke: var(--ink); stroke-width: 1.1; }
.staff .endbar { fill: var(--ink); }
.staff .clef { font-family: 'Noto Music', serif; font-size: 40px; fill: var(--ink); }
.staff .clef.bass, .blank-line .clef.bass { font-size: 30px; }
.staff .whole ellipse { fill: var(--ink); }
.staff .whole .hole { fill: var(--paper); }
.staff .acc line, .staff .acc path { stroke: var(--ink); stroke-width: 1.3; fill: none; }
.staff .acc .thick { stroke-width: 2.6; }
.staff .acc path { stroke-width: 1.8; }

.hand-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.hand-label { font-weight: 700; font-size: 13px; min-width: 88px; }
.fchip { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px 10px; border-radius: 12px; background: var(--sunken); border-top: 3px solid var(--role); }
.fchip b { font: 650 18px/1.1 var(--font-display); }
.fchip em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; margin-bottom: 6px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Chords / Scales switch */
.mode-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.mode-tabs::-webkit-scrollbar { display: none; }
.mode-tab { flex-shrink: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 !important; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.mode-tab { padding: 8px 4px 10px; margin-right: 18px; margin-bottom: -1px; text-decoration: none; font: 650 20px/1 var(--font-display); color: var(--muted); border-bottom: 2.5px solid transparent; }
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Scale pages */
.scale-sym { font-size: clamp(40px, 6.4vw, 68px); line-height: 1.02; }
.steps-pattern { display: flex; flex-wrap: wrap; gap: 5px; }
.steps-pattern span { min-width: 30px; padding: 3px 7px; border-radius: 7px; background: var(--paper); border: 1px solid var(--line); text-align: center; font: 600 13px var(--font-mono); }
.steps-pattern .half { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.steps-pattern .wide { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pos-seg { display: flex; flex-wrap: wrap; border-radius: 14px; margin-bottom: 4px; width: fit-content; max-width: 100%; }
.pos-seg button { border-radius: 11px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 48px; }
.pos-seg button small { font-size: 10px; font-weight: 500; opacity: .8; }
.scale-tab { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 20px; }
.scale-tab > div { min-width: 0; }
.scale-tab .tab { max-width: 100%; }
.scale-tab .sub { max-width: 44ch; }
.scale-pdetail { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.staff .sfinger { font-size: 12px; font-weight: 700; fill: var(--muted); text-anchor: middle; font-family: var(--font-ui); }
.finger-seq { display: flex; flex-wrap: wrap; gap: 5px; }
.finger-seq span { display: flex; flex-direction: column; align-items: center; min-width: 38px; padding: 5px 6px; border-radius: 10px; background: var(--sunken); border-top: 3px solid var(--role); font: 700 15px/1.2 var(--font-ui); }
.finger-seq b { font: 650 14px/1.2 var(--font-display); color: var(--muted); }
.degree-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.degree { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; background: var(--sunken); text-align: center; }
.degree .numeral { font: 650 18px/1 var(--font-display); color: var(--accent); }
.degree a, .degree span > span { font-weight: 650; text-decoration: none; }
.degree a { padding: 2px 8px; border-radius: 7px; background: var(--paper); }
.degree a:hover { color: var(--accent); }
.degree .seventh { font-size: 13px; }
.degree .dnotes { font-size: 11.5px; color: var(--muted); }
.in-keys a { color: var(--ink); font-weight: 650; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* Keys & progressions */
.h2 { font: 650 24px/1.2 var(--font-display); margin-bottom: 14px; }
.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ccard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--sunken); border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.ccard.extra { background: color-mix(in srgb, var(--sunken) 60%, var(--paper)); border: 1.5px dashed var(--line-strong); }
.ccard.now { border-color: var(--accent); background: var(--accent-soft); }
.ccard-top { display: flex; align-items: center; gap: 8px; }
.ccard .numeral { font: 650 16px/1 var(--font-display); color: var(--accent); min-width: 28px; }
.ccard-sym { font: 650 21px/1 var(--font-display); text-decoration: none; }
.ccard-sym:hover { color: var(--accent); }
.icon-play { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.icon-play svg { width: 12px; height: 12px; }
.icon-play:hover { border-color: var(--accent); color: var(--accent); }
.ccard .diagram { width: 100%; max-width: 150px; margin: 0 auto; display: block; }
.ccard .keys { min-width: 0; display: block; }
.ccard .inv { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.ccards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 22px 0 10px; }
.ccards-head h3 { margin: 0; }

.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.prog-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--sunken); text-decoration: none; border: 1.5px solid transparent; transition: border-color .15s; }
.prog-card:hover { border-color: var(--accent); }
.pc-nick { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pc-name { font: 650 19px/1.2 var(--font-display); color: var(--accent); }
.pc-chords { font-weight: 600; }

.keysig-box { align-items: center; }
.keysig { max-width: 150px; width: 100%; margin: 0 auto 4px; display: block; }
.circle-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 28px; align-items: center; }
.circle { width: 100%; display: block; }
.circle .wedge { fill: var(--sunken); stroke: var(--paper); stroke-width: 2; transition: fill .15s; }
.circle .wedge.minor { fill: color-mix(in srgb, var(--sunken) 55%, var(--line)); }
.circle a:hover .wedge { fill: var(--accent-soft); }
.circle .wedge.near { fill: var(--accent-soft); }
.circle .wedge.relative { fill: color-mix(in srgb, var(--accent) 35%, var(--paper)); }
.circle .wedge.current { fill: var(--accent); }
.circle .wlabel { font: 650 16px var(--font-display); fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.circle .wlabel.minor { font-size: 12.5px; }
.circle .wlabel.current { fill: var(--on-accent); }
.circle .ctext { font-size: 12px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.circle .ctext.big { font: 650 30px var(--font-display); fill: var(--ink); }

.prog-symbols { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 650 22px/1.2 var(--font-display); }
.prog-symbols i { font-style: normal; font-size: 14px; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); border: 1.5px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.bar { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 6px 12px; border-right: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); margin: 0 -1.5px -1.5px 0; transition: background .1s; }
.bar b { font: 650 22px/1 var(--font-display); }
.bar .numeral { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bar-num { position: absolute; top: 5px; left: 8px; font-size: 10px; color: var(--muted); }
.bar.now { background: var(--accent); color: var(--on-accent); }
.bar.now .numeral, .bar.now .bar-num { color: inherit; opacity: .85; }
.tempo { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.tempo input { accent-color: var(--accent); width: 120px; }
.tempo output { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.player .check { margin: 0; }
.strum-hint { margin-top: 12px; }

/* Related */
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.link-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.link-grid a { padding: 4px 10px; border-radius: 8px; background: var(--sunken); text-decoration: none; font-weight: 600; font-size: 13px; }
.link-grid a:hover { background: var(--accent-soft); color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13.5px; }
.site-footer p { margin: 0 0 6px; }
.legend { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.legend::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--role); }

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 980px) {
  .gdetail { grid-template-columns: 180px minmax(0, 1fr); }
  .gdetail-tab { grid-column: 1 / -1; }
  .gdetail-tab .sub { max-width: none; }
}
@media (max-width: 820px) {
  .degree-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .circle-card { grid-template-columns: 1fr; }
  .circle { max-width: 360px; margin: 0 auto; }
  .ccards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .mode-tab { margin-right: 12px; font-size: 17px; }
  .scale-tab { grid-template-columns: minmax(0, 1fr); }
  .scale-pdetail { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .search-hint { position: static; margin-top: 4px; }
  .search { flex-wrap: wrap; }
  .search > svg { top: 11.5px; }
  .search kbd { display: none; }
  .brand { margin-right: auto; }
  .chord-head { grid-template-columns: 1fr; }
  .pdetail { grid-template-columns: 1fr; }
  .staff-box { max-width: 320px; }
  .related { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .inst-tabs { gap: 4px; flex-wrap: nowrap; }
  .inst-tab { padding: 7px 10px; font-size: 13px; gap: 5px; }
  .inst-tab svg { width: 14px; height: 14px; }
  .card { padding: 18px; border-radius: 16px; }
  .sym { font-size: 58px; }
  .gdetail { grid-template-columns: 1fr; }
  .gdetail-diagram { max-width: 220px; }
  .site-header { position: static; }
  .header-inner { column-gap: 6px; }
  .seg.inst { padding: 2px; }
  .seg.inst button { padding: 5px 8px; font-size: 12px; }
  .keys { min-width: 500px; }
  .brand { gap: 7px; font-size: 18px; }
  .logo { width: 28px; height: 28px; }
  .icon-btn { width: 34px; height: 34px; }
  .voicings { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---- Phones: answer first ------------------------------------------------------ */

/* The chord itself right under the heading — hidden on larger screens, where the panel is visible */
.quick-answer { display: none; }
@media (max-width: 820px) {
  .quick-answer { display: flex; align-items: center; gap: 16px; margin: 14px 0 4px; padding: 12px; border-radius: 14px; background: var(--sunken); }
  .quick-pic { flex-shrink: 0; }
  .quick-pic .diagram { width: 128px; display: block; }
  .quick-pic .diagram.ukulele { width: 108px; }
  .quick-answer.piano { flex-direction: column; align-items: stretch; }
  .quick-answer.piano .keys { min-width: 0; width: 100%; }
  .quick-cap p { margin: 0 0 10px; font-size: 14px; }
  .quick-cap code { font: 600 14px var(--font-mono); }
  .quick-cap a { font-weight: 650; text-decoration-color: var(--accent); text-underline-offset: 3px; }

  /* Heading, then the answer (diagram / notes), then the longer description and buttons */
  .chord-head { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .chord-head .head-title { display: contents; }
  .chord-head .eyebrow { order: 1; }
  .chord-head .title-block { order: 2; }
  .chord-head .quick-answer { order: 3; }
  .chord-head .facts { order: 4; margin: 14px 0; }
  .chord-head .feel, .chord-head .in-keys { order: 5; }
  .chord-head .tuning-strings { order: 5; }
  .chord-head .actions { order: 6; }
}

/* A compact picker: one sideways-scrolling row of root keys and one of chord types */
@media (max-width: 640px) {
  .picker { padding-top: 12px; }
  .mode-tabs { margin-bottom: 10px; }
  .mode-tab { padding: 6px 2px 8px; font-size: 16px; }
  .roots { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .roots::-webkit-scrollbar, .qualities::-webkit-scrollbar { display: none; }
  .root-key { flex: 0 0 48px; height: 46px; }
  .root-key b { font-size: 17px; }
  .root-key small { font-size: 10px; }
  .qualities { flex-wrap: nowrap; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .qgroup { flex-direction: row; align-items: center; gap: 6px; flex-shrink: 0; }
  .qlabel { display: none; }
  .qgroup + .qgroup { border-left: 1px solid var(--line-strong); padding-left: 6px; }
  .chips { flex-wrap: nowrap; }
  .chip { padding: 8px 12px; }
  main { gap: 14px; }
  main.wrap { padding-top: 12px; padding-bottom: 36px; }
  .inst-tabs { overflow-x: auto; scrollbar-width: none; }
  .actions .btn[data-print] { display: none; } /* printing from a phone is rare; it's still in the browser menu */
}

/* ---- Print: a clean one-page chord sheet --------------------------------- */

@media print {
  .site-header, .picker, .site-footer, .actions, .controls, .related, .check { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .inst-tabs { display: none !important; }
  #fret-panel, #piano-panel { display: block !important; break-inside: avoid; }
  .neck, .keys { min-width: 0; }
  main { gap: 26px; }

  /* Printable sheets: print only the sheets, one per page, sized to fit US Letter and A4 */
  body[data-view="printable"] .printable-intro { display: none !important; }
  body[data-view="printable"] main { padding: 0; gap: 0; }
  body[data-view="printable"] .sheets { display: block; }
  body[data-view="printable"] .sheet {
    width: 100%; max-width: none; height: 250mm; aspect-ratio: auto; padding: 0;
    box-shadow: none; border-radius: 0; break-after: page;
  }
  body[data-view="printable"] .sheet:last-child { break-after: auto; }
}
@page { margin: 12mm; }

/* ---- Beginner pages -------------------------------------------------------- */
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.stage-head .h2 { margin: 0; }
.stage-num { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 650 19px var(--font-display); }
.stage-body { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 20px 32px; align-items: start; }
.stage-chords { display: flex; flex-wrap: wrap; gap: 12px; }
.path-chord { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px 12px; border-radius: 14px; background: var(--sunken); }
.path-chord .diagram { width: 130px; }
.path-chord .diagram.ukulele { width: 108px; }
.path-chord .keys { width: 240px; min-width: 0; }
.path-sym { font: 650 22px/1 var(--font-display); text-decoration: none; }
.path-sym:hover { color: var(--accent); }
.path-chord figcaption { font-size: 12.5px; color: var(--muted); }
.path-chord code, .easy-item code, .easy-callout code { font: 600 12.5px var(--font-mono); color: var(--ink); }
.stage-text p { margin: 0 0 10px; max-width: 62ch; }
.stage-tip { color: var(--muted); }
.loop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 14px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); }
.loop-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.loop-chord { padding: 3px 10px; border-radius: 8px; background: var(--paper); font: 650 17px var(--font-display); transition: background .1s, color .1s; }
.loop-chord.now { background: var(--accent); color: var(--on-accent); }
.loop i { font-style: normal; color: var(--muted); font-size: 13px; }
.loop .btn { margin-left: auto; }
.stage-text a, .easy-callout a { font-weight: 650; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.easy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.easy-item { padding: 14px 16px; border-radius: 14px; background: var(--sunken); }
.easy-item h3 { margin: 0 0 8px; font-size: 20px; }
.easy-item h3 a { text-decoration: none; }
.easy-item h3 .muted { font: 500 13px var(--font-ui); margin-left: 4px; }
.easy-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.easy-pair figure { margin: 0; display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 10px; }
.easy-pair figure.easy { background: var(--accent-soft); }
.easy-pair .diagram { width: 100%; max-width: 130px; }
.easy-pair figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.easy-item .sub { margin: 8px 0 0; font-size: 13px; }

.easy-callout { display: flex; gap: 18px; align-items: center; margin-top: 18px; padding: 14px 18px; border-radius: 14px; background: var(--accent-soft); }
.easy-callout-pic .diagram { width: 110px; display: block; }
.easy-callout h3 { margin: 0 0 6px; }
.easy-callout p { margin: 0 0 6px; max-width: 62ch; }
@media (max-width: 820px) {
  .stage-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .path-chord .diagram { width: 104px; }
  .path-chord .keys { width: 100%; }
  .easy-callout { flex-direction: column; align-items: flex-start; }
}

/* ---- Printable sheets ---------------------------------------------------- */
/* Sheets always look like white paper (even in dark mode), with light-theme colors */
.sheets { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.sheet {
  --ink: #16140f; --paper: #fff; --bg: #fff; --sunken: #f1efe9; --muted: #5a554c;
  --line: #d8d3c8; --line-strong: #a39c8e; --key-white: #fff; --key-black: #1d1a15; --key-line: #8a8272;
  --c-r: #c8461a; --c-t: #2767c9; --c-f: #2b8a4b; --c-s: #8447d1; --c-x: #b37400; --c-n: #5d574d; --on-role: #fff;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  width: 100%; max-width: 800px; aspect-ratio: 8.5 / 11; padding: 5% 5.5%;
  display: flex; flex-direction: column;
  background: #fff; color: var(--ink); border-radius: 4px; box-shadow: var(--shadow);
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 6px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); font: 650 20px/1.2 var(--font-display); }
.sheet-head span { font: 500 12px var(--font-ui); color: var(--muted); white-space: nowrap; }
.sheet-grid {
  flex: 1; min-height: 0; display: grid; gap: 10px 14px;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
}
.sheet-grid .cell { display: flex; flex-direction: column; align-items: center; min-height: 0; margin: 0; }
.sheet-grid .cell svg { flex: 1 1 0; min-height: 0; width: 100%; max-width: 100%; }
.sheet-grid figcaption { font: 650 17px/1.2 var(--font-display); margin-bottom: 2px; }
.sheet-grid .cell.piano { justify-content: center; }
.sheet-grid .cell.piano svg { flex: 0 1 auto; }
.cell-notes { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sheet-rows { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-around; }
.sheet-rows svg { display: block; width: 100%; }
.sheet-foot { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); text-align: center; }
.blank-box line { stroke: #6b665c; stroke-width: 1.2; }
.blank-box .name-line { stroke: #b5ae9f; }
.blank-box .nut { fill: var(--ink); }
.blank-line line { stroke: #555048; stroke-width: 1; }
.blank-line .tab-string { font: 600 8px var(--font-mono); fill: #8a8375; text-anchor: middle; dominant-baseline: central; }
.blank-line .clef { font-family: 'Noto Music', serif; font-size: 40px; fill: var(--ink); }
.blank-line .brace { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.printable-card .pc-nick { display: flex; align-items: center; gap: 6px; }
.printable-card .pc-nick svg { width: 15px; height: 15px; color: var(--accent); }
.printable-card .pc-chords { font-weight: 400; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) {
  .sheet { padding: 4%; }
  .sheet-head { font-size: 14px; }
  .sheet-grid figcaption { font-size: 12px; }
  .sheet-grid { gap: 4px 6px; }
}

/* ---- Tools ------------------------------------------------------------------ */
.tool-head .scale-sym, .tools-index .scale-sym { font-size: clamp(32px, 5.6vw, 56px); margin: 0; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkish.danger { color: var(--muted); font-size: 12.5px; }
.ss-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ss-input, .ss-text, .ss-select, .mt-num {
  font: 500 15px var(--font-ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 12px; text-transform: none; letter-spacing: 0;
}
.ss-text { font: 14px/1.5 var(--font-mono); resize: vertical; min-height: 220px; width: 100%; }
.ss-input:focus, .ss-text:focus, .ss-select:focus, .mt-num:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ss-control { display: flex; flex-direction: column; gap: 6px; }

/* Song sheet */
.songsheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 28px; }
.ss-editor { display: flex; flex-direction: column; gap: 14px; }
.ss-buttons, .ss-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-direction: row; }
.ss-controls { display: flex; flex-direction: column; gap: 16px; align-self: start; }
.ss-stepper { display: flex; align-items: center; gap: 10px; }
.ss-stepper output { min-width: 34px; text-align: center; font: 650 20px var(--font-display); }
.ss-capo-tip { margin: 0; font-size: 14px; }
.ss-capo-tip:empty { display: none; }
.ss-sheet, .ss-saved { grid-column: 1 / -1; }
.ss-sheet { border-top: 1px solid var(--line); padding-top: 20px; }
.ss-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 16px; }
.ss-title { margin: 0; font: 650 26px/1.2 var(--font-display); }
.ss-meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.ss-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.ss-card { margin: 0; padding: 8px 10px 10px; border-radius: 12px; background: var(--sunken); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ss-card figcaption { display: flex; flex-direction: column; align-items: center; font: 650 17px var(--font-display); }
.ss-card .ss-chord-link { color: var(--ink); text-decoration: none; }
.ss-card .ss-chord-link:hover { color: var(--accent); }
.ss-card .diagram { width: 96px; }
.ss-card .diagram.ukulele { width: 80px; }
.ss-card .keys { width: 170px; min-width: 0; }
.ss-card.unknown { justify-content: center; max-width: 130px; text-align: center; }
.ss-shape { font: 500 11.5px var(--font-ui); color: var(--muted); }
.ss-body { margin: 0; font: 15px/1.45 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.ss-ch { color: var(--accent); font-weight: 700; }
.ss-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--muted); display: none; }
.ss-empty { padding: 20px 0; }
.ss-saved h3 { margin: 0 0 8px; font-size: 15px; }
.ss-saved ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ss-saved li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.ss-saved li .muted { font-size: 12.5px; }
.ss-saved .muted { color: var(--muted); font-weight: 400; }

/* Tuner */
.tuner { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.tuner-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; justify-content: center; }
.tuner-display { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }
.tuner-gauge { width: 100%; }
.tg-arc { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.tg-zone { fill: none; stroke: var(--c-f); stroke-width: 10; stroke-linecap: round; }
.tg-tick { stroke: var(--muted); stroke-width: 2; }
.tg-label { font: 600 12px var(--font-ui); fill: var(--muted); }
.tg-needle { transition: transform .12s ease-out; }
.tg-needle line { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.tg-needle circle { fill: var(--ink); }
.in-tune .tg-needle line { stroke: var(--c-f); }
.tuner-readout { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -6px; text-align: center; }
.tuner-note { font: 650 64px/1 var(--font-display); }
.in-tune .tuner-note { color: var(--c-f); }
.tuner-status { font-size: 15px; font-weight: 600; min-height: 1.4em; }
.tuner-freq { font: 13px var(--font-mono); color: var(--muted); min-height: 1.2em; }
.tuner-strings { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tuner-string { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; }
.tuner-string b { font: 650 22px var(--font-display); }
.tuner-string small { font-size: 11px; color: var(--muted); }
.tuner-string:hover { border-color: var(--accent); }
.tuner-string.now { background: var(--accent-soft); border-color: var(--accent); }
.tuner > .sub { text-align: center; }

/* Metronome */
.metronome { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 32px; }
.mt-main { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.mt-tempo { display: flex; align-items: center; gap: 8px; }
.mt-step { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 650 15px var(--font-ui); cursor: pointer; }
.mt-step:hover { border-color: var(--accent); }
.mt-step:active { transform: scale(.95); }
.mt-bpm { display: flex; flex-direction: column; align-items: center; min-width: 130px; }
.mt-bpm output { font: 650 64px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.mt-bpm span { font-size: 12px; font-weight: 650; letter-spacing: .08em; color: var(--muted); }
.mt-bpm em { font-size: 13px; color: var(--muted); }
.mt-slider { width: 100%; max-width: 380px; accent-color: var(--accent); }
.mt-beats { display: flex; gap: 10px; min-height: 26px; }
.mt-beats i { width: 22px; height: 22px; border-radius: 50%; background: var(--sunken); border: 2px solid var(--line-strong); transition: background .05s; }
.mt-beats i.accent { border-color: var(--accent); }
.mt-beats i.on { background: var(--ink); border-color: var(--ink); }
.mt-beats i.accent.on { background: var(--accent); border-color: var(--accent); }
.mt-buttons { display: flex; gap: 10px; }
.mt-go { min-width: 130px; }
.mt-options { display: flex; flex-direction: column; gap: 16px; }
.mt-options .seg { flex-wrap: wrap; border-radius: 16px; }
.mt-trainer { font-size: 13.5px; line-height: 2.2; }
.mt-num { width: 64px; padding: 4px 8px; font-size: 14px; }

/* Chord trainer */
.trainer { display: flex; flex-direction: column; gap: 22px; }
.tr-setup { display: flex; flex-direction: column; gap: 14px; }
.tr-pairs { flex-wrap: wrap; }
.tr-row { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.trainer:not([data-mode="along"]) .tr-along-only { display: none; }
.tr-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, auto); gap: 20px; align-items: center; }
.tr-chords { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tr-chord { margin: 0; padding: 10px 14px 14px; border-radius: 16px; background: var(--sunken); border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; transition: border-color .1s, transform .1s; }
.tr-chord figcaption { font: 650 28px var(--font-display); }
.tr-chord .diagram { width: 150px; }
.tr-chord .diagram.ukulele { width: 124px; }
.tr-chord .keys { width: 260px; min-width: 0; }
.tr-chord.now { border-color: var(--accent); transform: scale(1.03); }
.tr-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.tr-clock { font: 650 56px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.tr-go { min-width: 140px; }
.tr-tap { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 200px; padding: 16px; border-radius: 18px; border: 0; background: var(--accent); color: var(--on-accent); font: 650 16px var(--font-ui); cursor: pointer; touch-action: manipulation; user-select: none; }
.tr-tap small { font-weight: 500; font-size: 12px; opacity: .85; }
.tr-tap b { font: 650 40px/1.1 var(--font-display); }
.tr-tap:active { transform: scale(.96); }
.tr-tap[hidden], .tr-go[hidden] { display: none; }
.tr-result { margin: 0; font-size: 15px; max-width: 300px; }
.tr-hear { margin: 0; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--sunken); color: var(--muted); }
.tr-hear[data-state="ok"] { background: color-mix(in srgb, var(--c-f) 18%, transparent); color: var(--c-f); }
.tr-hear[data-state="unsure"] { color: var(--c-x); }
.tr-hear[hidden] { display: none; }
.tr-result:empty { display: none; }
.tr-best { color: var(--c-f); font-weight: 700; }
.tr-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-stat { display: flex; flex-direction: column; padding: 10px 16px; border-radius: 12px; background: var(--sunken); }
.tr-stat b { font: 650 26px var(--font-display); }
.tr-stat span { font-size: 12.5px; color: var(--muted); }
.tr-stat.wide { flex: 1; justify-content: center; min-width: 200px; }

@media (max-width: 820px) {
  .songsheet, .metronome, .tr-stage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ss-body { font-size: 13px; }
  .ss-card .diagram { width: 80px; }
  .ss-card .diagram.ukulele { width: 68px; }
  .tr-chords { flex-wrap: nowrap; gap: 10px; }
  .tr-chord { flex: 1 1 0; min-width: 0; padding: 8px 8px 10px; }
  .tr-chord figcaption { font-size: 24px; }
  .tr-chord .diagram { width: 100%; max-width: 124px; }
  .tr-chord .diagram.ukulele { max-width: 104px; }
  .tr-chord .keys { width: 100%; }
  .tuner-note, .mt-bpm output { font-size: 52px; }
  .tr-pairs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -26px; padding: 0 26px; }
  .tr-stage { gap: 14px; }
  .tr-clock { font-size: 44px; }
  .mt-step { width: 40px; height: 40px; }
  .mt-bpm { min-width: 100px; }
}

/* Song sheets print just the sheet */
@media print {
  body[data-view="tool"] main > :not(.songsheet), body[data-view="tool"] .breadcrumbs { display: none !important; }
  body[data-view="tool"] .songsheet { display: block; }
  body[data-view="tool"] .songsheet > :not(.ss-sheet) { display: none !important; }
  body[data-view="tool"] .ss-sheet { border: 0; padding: 0; }
  body[data-view="tool"] .ss-foot { display: block; }
  .ss-card { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Games ------------------------------------------------------------------ */
/* Anything with the hidden attribute stays hidden, whatever its display style. */
[hidden] { display: none !important; }
.ear-setup { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-bottom: 18px; }
.ear-setup .seg { flex-wrap: wrap; border-radius: 16px; }

/* Daily Chord */
.dc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.dc-head b { font: 650 22px var(--font-display); display: block; }
.dc-tier { font-size: 13px; color: var(--muted); font-weight: 600; }
.dc-listen { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-board { display: grid; gap: 6px; margin-bottom: 20px; }
.dc-row { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 8px; border-radius: 10px; background: var(--sunken); }
.dc-row.empty { opacity: .55; min-height: 30px; }
.dc-input[hidden], .dc-end[hidden] { display: none; }
.dc-name { min-width: 64px; font: 650 18px var(--font-display); }
.dc-row.empty .dc-name { font: 600 13px var(--font-ui); color: var(--muted); }
.dc-notes { display: flex; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.dc-tile { display: inline-grid; place-items: center; min-width: 40px; height: 30px; padding: 0 7px; border-radius: 7px; font-size: 13px; font-weight: 700; color: #fff; }
.dc-tile.ok { background: var(--c-f); }
.dc-tile.no { background: var(--line-strong); color: var(--ink); }
.dc-input { display: flex; flex-direction: column; gap: 14px; }
.dc-roots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.dc-roots .chip { justify-content: center; padding: 8px 4px; }
.dc-roots .chip small { font-size: 10.5px; opacity: .75; }
.dc-quals { flex-wrap: wrap; }
.dc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dc-actions .btn { min-width: 150px; }
.dc-end { display: flex; flex-direction: column; gap: 16px; }
.dc-result { margin: 0; font-size: 16px; line-height: 1.5; }
.dc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dc-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 12px; background: var(--sunken); }
.dc-stats b { font: 650 26px var(--font-display); }
.dc-stats span { font-size: 12px; color: var(--muted); }
.dc-dist { display: grid; gap: 4px; max-width: 420px; }
.dc-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dc-bar span { width: 12px; font-weight: 700; }
.dc-bar i { font-style: normal; text-align: right; padding: 2px 8px; border-radius: 5px; background: var(--line-strong); color: var(--ink); font-weight: 700; font-size: 12px; }
.dc-bar.now i { background: var(--c-f); color: #fff; }
.dc-share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.dc-next { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.dc-share-text { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--sunken); font: 14px/1.35 var(--font-mono); width: fit-content; max-width: 100%; overflow-x: auto; }

/* Ear training */
.ear-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.ear-status { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ear-listen { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ear-play { min-width: 160px; height: 48px; font-size: 16px; }
.ear-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; max-width: 720px; }
.ear-answer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 600 15px var(--font-ui); cursor: pointer; touch-action: manipulation; }
.ear-answer small { font-weight: 500; font-size: 12px; color: var(--muted); }
.ear-answer kbd { position: absolute; top: 5px; left: 8px; font: 600 10.5px var(--font-mono); color: var(--muted); }
.ear-answer:hover:not(:disabled) { border-color: var(--accent); }
.ear-answer:disabled { cursor: default; opacity: .6; }
.ear-answer.right { opacity: 1; background: color-mix(in srgb, var(--c-f) 20%, var(--paper)); border-color: var(--c-f); }
.ear-answer.wrong { opacity: 1; background: color-mix(in srgb, var(--c-r) 16%, var(--paper)); border-color: var(--c-r); }
.ear-feedback { min-height: 24px; max-width: 620px; }
.ear-feedback p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.ear-feedback .ok { color: var(--c-f); }
.ear-feedback .ok a, .ear-feedback .bad a { color: inherit; }
.ear-feedback .bad { color: var(--c-r); }
.ear-compare { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 13.5px; }
.ear-summary { color: var(--ink); }
.interval-tunes { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }

/* Note finders */
.nf-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.nf-prompt { flex: 1; font-size: 17px; font-weight: 600; }
.nf-clock { font: 650 22px var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted); }
.nf-score { min-width: 44px; text-align: center; padding: 4px 10px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 650 22px var(--font-display); }
.nf-board { border-radius: 14px; padding: 8px 0; transition: background .2s; }
.notes-game.flash-ok .nf-board { animation: flash-ok .45s; }
.notes-game.flash-bad .nf-board { animation: flash-bad .6s; }
@keyframes flash-ok { from { background: color-mix(in srgb, var(--c-f) 22%, transparent); } }
@keyframes flash-bad { from { background: color-mix(in srgb, var(--c-r) 22%, transparent); } }
.nf-board .keys { min-width: 0; width: 100%; max-width: 640px; margin: 0 auto; }
.nf-board .key.target { fill: var(--accent); }
.nf-board .key.hit { fill: var(--c-f); }
.nf-board .key.miss { fill: var(--c-r); }
.nf-board .key.reveal { fill: color-mix(in srgb, var(--c-f) 55%, var(--key-white)); }
.note-staff { max-width: 360px; margin: 0 auto; }
.neck-game { display: block; width: 100%; }
.nf-guitar, .nf-ukulele { overflow-x: auto; }
.neck-game { max-width: 560px; margin: 0 auto; }
.neck-game.wide { max-width: none; min-width: 640px; }
.ng-board { fill: var(--board); }
.ng-inlay { fill: var(--line-strong); opacity: .6; }
.ng-nut { fill: var(--ink); }
.ng-fret { stroke: var(--line-strong); stroke-width: 2; }
.ng-string { stroke: var(--muted); }
.ng-sname, .ng-fnum { font: 600 12px var(--font-ui); fill: var(--muted); dominant-baseline: central; }
.ng-fnum, .ng-sname { text-anchor: middle; }
.ng-pos circle, .ng-hit { fill: transparent; }
.ng-pos text { font: 700 12px var(--font-ui); fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.notes-game.playing .ng-pos { cursor: pointer; }
.ng-pos.lane circle { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.notes-game.playing .ng-pos:hover circle { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.ng-pos.target circle { fill: var(--accent); }
.ng-pos.hit circle { fill: var(--c-f); }
.ng-pos.miss circle { fill: var(--c-r); }
.ng-pos.reveal circle { fill: var(--c-f); opacity: .85; }
.nf-answers { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.nf-answers:has(> :nth-child(8)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nf-answer { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 650 17px var(--font-ui); cursor: pointer; touch-action: manipulation; }
.nf-answer small { font-size: 11px; font-weight: 500; color: var(--muted); }
.nf-answer:disabled { cursor: default; opacity: .55; }
.nf-answer.right { opacity: 1; background: var(--c-f); border-color: var(--c-f); color: #fff; }
.nf-answer.wrong { opacity: 1; background: var(--c-r); border-color: var(--c-r); color: #fff; }
.nf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.nf-foot .btn { min-width: 140px; }
.nf-result { margin: 0; font-size: 15px; }
.nf-result:empty { display: none; }

@media (max-width: 640px) {
  .dc-roots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dc-row { flex-wrap: wrap; }
  .dc-tile { min-width: 34px; height: 28px; font-size: 12px; }
  .dc-name { min-width: 52px; font-size: 16px; }
  .dc-stats b { font-size: 22px; }
  .ear-answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-prompt { font-size: 15px; }
  .nf-answers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nf-answers:has(> :nth-child(8)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Strumming patterns ------------------------------------------------------------ */
.strum-grid { display: grid; grid-template-columns: repeat(var(--slots), minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 640px; margin: 0 auto; }
.strum-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 12px; border-radius: 12px; background: var(--sunken); transition: background .06s, transform .06s; }
.strum-count { font: 600 13px var(--font-ui); color: var(--muted); }
.strum-slot.beat .strum-count { color: var(--ink); font-weight: 750; }
.strum-sym { font: 700 34px/1 var(--font-ui); min-height: 34px; color: var(--ink); }
.strum-slot.s-u .strum-sym { color: var(--c-t); }
.strum-slot.s-d .strum-sym { color: var(--accent); }
.strum-slot.s-x .strum-sym { color: var(--muted); font-size: 28px; }
.strum-slot.s-b .strum-sym { color: var(--c-f); font: 700 26px var(--font-display); }
.strum-slot.s-miss { background: transparent; border: 1px dashed var(--line-strong); }
.strum-slot.now { background: var(--accent-soft); transform: scale(1.06); }
.strum-slot.s-miss.now { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
.strum-grid.small { gap: 3px; max-width: none; margin: 6px 0; }
.strum-grid.small .strum-slot { padding: 4px 0 6px; border-radius: 7px; gap: 1px; }
.strum-grid.small .strum-count { font-size: 10px; }
.strum-grid.small .strum-sym { font-size: 17px; min-height: 17px; }
.strum-grid.small .s-b .strum-sym { font-size: 14px; }
.strum-player { display: flex; flex-direction: column; gap: 16px; }
.strum-words { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.strum-words b { color: var(--ink); font-family: var(--font-mono); letter-spacing: .04em; }
.strum-now { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.strum-now b { font: 650 40px var(--font-display); min-width: 2ch; text-align: center; }
.strum-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 22px; }
.strum-controls .btn { min-width: 150px; }
.strum-tempo { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.strum-tempo input { accent-color: var(--accent); }
.strum-tempo .ss-label { display: block; }
.strum-tempo output { color: var(--ink); }
.strum-controls .check { margin: 0; }
.strum-setup { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: center; }
.strum-setup .chips { flex-wrap: wrap; }
.strum-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; font-size: 14.5px; }
.strum-legend b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-right: 4px; border-radius: 6px; background: var(--sunken); }
.strum-legend .miss-box { background: transparent; border: 1px dashed var(--line-strong); vertical-align: middle; }
.strum-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.strum-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.strum-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.strum-card .pc-name { font: 650 17px var(--font-display); }
.strum-card .pc-chords { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .strum-grid { gap: 3px; }
  .strum-slot { padding: 6px 0 8px; border-radius: 8px; }
  .strum-sym { font-size: 24px; min-height: 24px; }
  .strum-slot.s-b .strum-sym { font-size: 19px; }
  .strum-now b { font-size: 32px; }
}

/* ---- Capo & transposition charts ------------------------------------------------------ */
.chart-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.chart-table thead th { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: none; }
.chart-table tbody th { font: 650 16px var(--font-display); text-align: left; padding-left: 4px; }
.chart-table tbody tr:hover { background: var(--sunken); }
.chart-table tr.from { background: color-mix(in srgb, var(--c-t) 16%, transparent); }
.chart-table tr.to { background: color-mix(in srgb, var(--c-f) 18%, transparent); }
.capo-finder, .transposer { display: flex; flex-direction: column; gap: 14px; }
.capo-finder .h2, .transposer .h2 { margin: 0; }
.capo-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.capo-results li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); border: 1px solid transparent; }
.capo-results li > b { font: 650 18px var(--font-display); }
.capo-results li.best { border-color: var(--c-f); background: color-mix(in srgb, var(--c-f) 12%, var(--paper)); }
.capo-results em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--c-f); text-transform: uppercase; letter-spacing: .05em; }
.capo-sub { margin: 8px 0 0; font-size: 16px; }
.capo-sounds { margin: 0; align-self: end; padding-bottom: 8px; font-size: 16px; }
.capo-sounds b { font: 650 22px var(--font-display); }
.tp-shift { margin: 0; font-size: 15px; }
.tp-pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-pair { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--sunken); }
.tp-pair b { font: 650 17px var(--font-display); }
.tp-pair i { font-style: normal; color: var(--muted); }
.sheet-table { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sheet-table h3 { margin: 2px 0 0; font: 650 14px var(--font-display); }
.sheet-table { min-height: 0; overflow: hidden; }
.sheet-table .chart-table { font-size: 11.5px; }
.sheet-table .chart-table th, .sheet-table .chart-table td { padding: 3px 4px; border-color: #d8d3c8; }
.sheet-table .chart-table thead th { font-size: 10.5px; }
.sheet-table .chart-table tbody th { font-size: 12.5px; }
.sheet-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ---- Full-width keyboards (phones) ------------------------------------------------ */
.expand-btn { display: none; }
@media (max-width: 640px) {
  .expandable { display: flex; flex-direction: column; align-items: stretch; }
  .expand-btn {
    display: inline-flex; align-self: center; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px;
    border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--muted);
    font: 600 12.5px var(--font-ui); cursor: pointer; touch-action: manipulation;
  }
  .expand-btn svg { width: 14px; height: 14px; }
  .expand-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
  .expandable.expanded { position: relative; }
  .expandable.expanded > .keys-wrap, .expandable.expanded > .nf-board { border-radius: 0; padding-left: 2px; padding-right: 2px; }
  .expandable.expanded .keys { max-width: none; }
}

/* ---- About / Privacy / Contact --------------------------------------------------- */
.prose { max-width: 820px; }
.prose .h2 { margin-top: 0; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.65; }
.prose p { margin: 0 0 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.prose a, .tools-index .feel a { color: var(--accent); text-underline-offset: 2px; }

/* ---- Guitar tunings --------------------------------------------------------------- */
.tuning-strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; max-width: 520px; margin: 16px 0 4px; }
.tuning-string { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 12px; background: var(--sunken); border: 1px solid transparent; }
.tuning-string small { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tuning-string b { font: 650 24px var(--font-display); }
.tuning-string span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tuning-string.changed { border-color: var(--accent); background: var(--accent-soft); }
.tuning-string.changed span { color: var(--accent); font-weight: 700; }
.tuning-notes { font: 600 13px var(--font-mono); color: var(--ink); letter-spacing: .06em; }
.tuning-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 14px; }
.tuning-chord { margin: 0; }
.tuning-hear { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--sunken); color: var(--ink); cursor: pointer; transition: border-color .15s, transform .1s; }
.tuning-hear:hover { border-color: var(--accent); }
.tuning-hear:active { transform: scale(.97); }
.tuning-hear figcaption { font: 650 20px var(--font-display); }
.tuning-hear .diagram { width: 100%; max-width: 130px; }
.tuning-print-note { display: none; }
.tn-chords { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; }
.tn-chords:empty { display: none; }
.tn-chords a { color: var(--accent); }
@media (max-width: 640px) {
  .tuning-strings { gap: 4px; }
  .tuning-string { padding: 6px 2px; }
  .tuning-string b { font-size: 20px; }
  .tuning-string span { font-size: 9.5px; }
  .tuning-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tuning-hear { padding: 6px 4px; }
  .tuning-hear figcaption { font-size: 17px; }
}
@media print {
  body[data-view="tuning"] main > :not(.tuning-chart), body[data-view="tuning"] .tuning-chart .controls { display: none !important; }
  body[data-view="tuning"] .tuning-grid { grid-template-columns: repeat(4, 1fr); }
  body[data-view="tuning"] .tuning-hear { border-color: #d8d3c8; background: none; }
  body[data-view="tuning"] .tuning-print-note { display: block; }
}

/* Name That Chord: root + type picker */
.ear-answers.picker { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ep-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 560px; }
.ep-row.types { display: flex; flex-wrap: wrap; justify-content: center; }
.ep-row .chip { justify-content: center; padding: 8px 4px; }
.ep-row .chip small { font-size: 10.5px; opacity: .75; }
.ep-row .chip:disabled { opacity: .55; cursor: default; }
.ep-row .chip.right { opacity: 1; background: var(--c-f); border-color: var(--c-f); color: #fff; }
.ep-row .chip.wrong { opacity: 1; background: var(--c-r); border-color: var(--c-r); color: #fff; }
.ep-submit { min-width: 180px; }
@media (max-width: 640px) { .ep-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Sight reading trainer -------------------------------------------------------- */
.sight-reading:not([data-mode="rhythm"]) .sr-rhythm-only { display: none; }
.sr-stage { display: flex; flex-direction: column; gap: 14px; }
.sr-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; min-height: 24px; }
.sr-status { font-size: 16px; font-weight: 600; }
.sr-hearing { font: 600 13px var(--font-mono); color: var(--muted); }
.sr-staff-wrap { border-radius: 14px; background: var(--sunken); padding: 6px 8px; }
.sr-staff { display: block; height: 170px; width: auto; min-width: 100%; max-width: none; }
.sr-staff .sr-note { color: var(--ink); transition: color .12s; }
.sr-staff .head, .sr-staff .rest { fill: currentColor; }
.sr-staff .hole { fill: var(--sunken); }
.sr-staff .stem, .sr-staff .ledger { stroke: currentColor; stroke-width: 1.4; }
.sr-staff .beam { stroke: currentColor; stroke-width: 4.5; }
.sr-staff .flag { fill: none; stroke: currentColor; stroke-width: 1.8; }
.sr-staff .timesig { font: 700 22px var(--font-display); fill: var(--ink); dominant-baseline: central; }
.sr-staff .clef-8 { font: 700 11px var(--font-ui); fill: var(--ink); }
.sr-staff .sr-note.current { color: var(--accent); }
.sr-staff .sr-note.right { color: var(--c-f); }
.sr-staff .sr-note.right.late, .sr-staff .sr-note.right.early { color: var(--c-x); }
.sr-staff .sr-note.wrong { color: var(--c-r); }
.sr-staff .sr-note.missed { color: var(--muted); opacity: .45; }
.sr-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-keys .keys { min-width: 0; width: 100%; max-width: 720px; margin: 0 auto; touch-action: manipulation; }
@media (max-width: 640px) { .sr-staff { height: 140px; } }
