/* akkord.life — light & dark themes */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede6;
  --fg: #1c1b19;
  --muted: #6f6b63;
  --line: #e3e0d7;
  --line-2: #c9c5ba;
  --accent: #c2410c;
  --accent-fg: #ffffff;
  --accent-soft: rgba(194, 65, 12, 0.1);
  --dot: #1c1b19;
  --dot-fg: #ffffff;
  --fret: #9a958a;
  --string: #6a665e;
  --nut: #1c1b19;
  --key-w: #ffffff;
  --key-b: #2a2826;
  --key-line: #b7b2a6;
  --key-on: var(--accent);
  --key-on-fg: var(--accent-fg);
  --green: 22, 163, 74;
  --easy: #15803d;
  --medium: #b45309;
  --hard: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 22px;
  --sheet-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113; --surface: #1b1b1f; --surface-2: #26262c; --fg: #ececef; --muted: #9b9ba4;
    --line: #2d2d34; --line-2: #45454e; --accent: #fb923c; --accent-fg: #1b1b1f; --accent-soft: rgba(251, 146, 60, 0.14);
    --dot: #ececef; --dot-fg: #111113; --fret: #5c5c66; --string: #8e8e98; --nut: #ececef; --key-w: #e4e1da; --key-b: #0c0c0e; --key-line: #55555e;
    --easy: #4ade80; --medium: #fbbf24; --hard: #f87171;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111113; --surface: #1b1b1f; --surface-2: #26262c; --fg: #ececef; --muted: #9b9ba4;
  --line: #2d2d34; --line-2: #45454e; --accent: #fb923c; --accent-fg: #1b1b1f; --accent-soft: rgba(251, 146, 60, 0.14);
  --dot: #ececef; --dot-fg: #111113; --fret: #5c5c66; --string: #8e8e98; --nut: #ececef; --key-w: #e4e1da; --key-b: #0c0c0e; --key-line: #55555e;
  --easy: #4ade80; --medium: #fbbf24; --hard: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* Accent presets (settings). Light theme: dark shade + white text; dark theme: light shade + dark text. */
:root[data-accent="cyan"] { --accent: #0e7490; --accent-fg: #ffffff; --accent-soft: rgba(14, 116, 144, 0.1); }
:root[data-accent="pink"] { --accent: #be185d; --accent-fg: #ffffff; --accent-soft: rgba(190, 24, 93, 0.1); }
:root[data-accent="green"] { --accent: #4d7c0f; --accent-fg: #ffffff; --accent-soft: rgba(77, 124, 15, 0.1); }
:root[data-accent="purple"] { --accent: #7e22ce; --accent-fg: #ffffff; --accent-soft: rgba(126, 34, 206, 0.1); }
@media (prefers-color-scheme: dark) { :root[data-accent="cyan"]:not([data-theme="light"]) { --accent: #22d3ee; --accent-fg: #06232a; --accent-soft: rgba(34, 211, 238, 0.14); } }
:root[data-theme="dark"][data-accent="cyan"] { --accent: #22d3ee; --accent-fg: #06232a; --accent-soft: rgba(34, 211, 238, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-accent="pink"]:not([data-theme="light"]) { --accent: #f472b6; --accent-fg: #2a0a18; --accent-soft: rgba(244, 114, 182, 0.14); } }
:root[data-theme="dark"][data-accent="pink"] { --accent: #f472b6; --accent-fg: #2a0a18; --accent-soft: rgba(244, 114, 182, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-accent="green"]:not([data-theme="light"]) { --accent: #a3e635; --accent-fg: #14200a; --accent-soft: rgba(163, 230, 53, 0.14); } }
:root[data-theme="dark"][data-accent="green"] { --accent: #a3e635; --accent-fg: #14200a; --accent-soft: rgba(163, 230, 53, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-accent="purple"]:not([data-theme="light"]) { --accent: #c084fc; --accent-fg: #1e0b30; --accent-soft: rgba(192, 132, 252, 0.14); } }
:root[data-theme="dark"][data-accent="purple"] { --accent: #c084fc; --accent-fg: #1e0b30; --accent-soft: rgba(192, 132, 252, 0.14); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 500 15.5px/1.5 "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background-color .2s, color .2s;
}
/* Nunito has no CJK or Thai: fall back to good system fonts for those scripts. */
html:lang(zh) body { font-family: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }
html:lang(ja) body { font-family: "Nunito", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Noto Sans JP", sans-serif; }
html:lang(ko) body { font-family: "Nunito", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", "Noto Sans KR", sans-serif; }
html:lang(th) body { font-family: "Nunito", "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Tahoma", sans-serif; line-height: 1.6; }
html:lang(hi) body { font-family: "Nunito", "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", "Mangal", sans-serif; line-height: 1.6; }
html:lang(ta) body { font-family: "Nunito", "Noto Sans Tamil", "Nirmala UI", "Tamil Sangam MN", "Latha", sans-serif; line-height: 1.6; }
html:lang(my) body { font-family: "Nunito", "Noto Sans Myanmar", "Myanmar Text", "Padauk", "Myanmar Sangam MN", sans-serif; line-height: 1.8; }
html:lang(ur) body { font-family: "Nunito", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; line-height: 1.9; }
html:lang(ps) body { font-family: "Nunito", "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; line-height: 1.7; }
/* Right-to-left pages: diagrams, keyboards, chord tracks, tuners and note rows keep their musical left-to-right order. */
[dir="rtl"] .dia, [dir="rtl"] .strip, [dir="rtl"] .te-row, [dir="rtl"] .tones, [dir="rtl"] .scale, [dir="rtl"] .chips.roots, [dir="rtl"] .shot-chords, [dir="rtl"] .hands, [dir="rtl"] .xp-swatches { direction: ltr; }
[dir="rtl"] .add-btn { right: auto; left: 7px; }
[dir="rtl"] .schip-x { right: auto; left: 3px; }
[dir="rtl"] .hint-n { left: auto; right: -11px; }
[dir="rtl"] .hint::after { left: auto; right: 22px; }
[dir="rtl"] .guide-short { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .ch-name small { margin-left: 0; margin-right: 12px; }
[dir="rtl"] .ci-line { text-align: right; padding: 9px 14px 9px 10px; }
[dir="rtl"] select.input { background-position: left 9px center; padding-right: 12px; padding-left: 30px; }
[dir="rtl"] .lang-sel { padding: 0 10px 0 28px; background-position: left 9px center; }
[dir="rtl"] .split .split-main { border-radius: 0 999px 999px 0; }
[dir="rtl"] .split .split-caret { border-radius: 999px 0 0 999px; border-left: 0; border-right: 1.5px solid color-mix(in srgb, var(--accent-fg) 30%, var(--accent)); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.err { color: var(--hard); }
.hint { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.hint.lead { font-size: 14.5px; margin: -10px 4px 20px; max-width: 640px; }
.empty { color: var(--muted); padding: 20px 0; }
.empty.small { font-size: 12px; padding: 6px 0; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  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);
}
.top-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; text-decoration: none; color: var(--fg); font-weight: 900; font-size: 23px; letter-spacing: -.02em; }
.logo b { color: var(--accent); font-weight: 800; }
.modes { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.modes button { border: 0; background: none; padding: 8px 17px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; }
.modes button:hover { color: var(--fg); }
.modes button.on { background: var(--accent); color: var(--accent-fg); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* Language menu: a native select dressed as a pill. */
.lang-sel { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 28px 0 10px; gap: 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a958a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }
.lang-sel .ic { width: 16px; height: 16px; flex: none; }
.lang-sel select { appearance: none; -webkit-appearance: none; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 800; color: var(--fg); cursor: pointer; padding: 0; outline: none; }
/* Size the menu to the chosen language, not the longest one ("Bahasa Indonesia"). */
.lang-sel select { field-sizing: content; max-width: 160px; text-overflow: ellipsis; }
.lang-sel select option { color: #1c1b19; background: #fff; }
.lang-sel:hover { color: var(--fg); }
.lang-sel:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) { .lang-sel .ic { display: none; } .lang-sel { padding-left: 12px; } .lang-sel select { max-width: 104px; } }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--muted); }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); padding: 0; flex: none; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.on { color: var(--accent); border-color: var(--accent); }
/* Instrument switch: the main choice, in the header. */
.insts { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.insts button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 7px 15px 7px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; }
.insts button .ic { width: 19px; height: 19px; stroke-width: 1.8; }
.insts button:hover { color: var(--fg); }
.insts button.on { background: var(--accent); color: var(--accent-fg); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.insts button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Chord finder / chords in a key: second level, in the toolbar row. */
.toolbar .modes { align-self: flex-end; margin-bottom: 1px; }
.toolbar .modes button { padding: 7px 15px; }
.toolbar .modes button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
@media (max-width: 760px) {
  .insts { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .insts button { flex: 1; justify-content: center; padding: 7px 8px; font-size: 13px; gap: 5px; }
  .insts button .ic { width: 17px; height: 17px; }
  .toolbar .modes { width: 100%; }
  .toolbar .modes button { flex: 1; padding: 7px 8px; font-size: 13px; }
}
@media (max-width: 380px) { .insts button .ic { display: none; } }

/* ---------- layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px calc(var(--sheet-h) + 48px); }
/* Tuning strip: quiet, it is set once. The chord picker below is the card. */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; padding: 4px 4px 0; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.field.right { margin-left: auto; }
.input { padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 38px; }
select.input { padding-right: 30px; appearance: none; -webkit-appearance: none; cursor: pointer; font-weight: 700;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a958a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 16px; }
.input:hover { border-color: var(--line-2); }
.input:focus, .row-name:focus, .song-title:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.tuning-info { font-size: 13.5px; color: var(--muted); padding-bottom: 10px; }
.tuning-info b { color: var(--fg); }
.keys-legend { display: inline-flex; align-items: center; gap: 8px; max-width: 520px; line-height: 1.35; }
.keys-legend i { width: 14px; height: 22px; border-radius: 3px; background: var(--accent); flex: none; box-shadow: inset 0 0 0 1px var(--key-line); }
@media (max-width: 760px) { .field.right { margin-left: 0; } .field { flex: 1 1 100%; } .input { width: 100%; } }

.controls {
  display: flex; flex-direction: column; gap: 16px; margin-bottom: 26px; padding: 18px 20px 20px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 28px; box-shadow: 0 3px 0 var(--line);
}
.ctl-label { font-size: 14px; font-weight: 800; color: var(--muted); margin-bottom: 9px; }
.ctl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); padding: 6px 13px; border-radius: 999px; font-weight: 800; font-size: 15px; min-width: 46px; transition: border-color .12s, background .12s, color .12s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on, .chip.on:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip:focus-visible, .seg button:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .modes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Root notes are drawn like the dots on a chord diagram: the chosen root is the orange root dot. */
.chips.roots { gap: 8px; }
.roots .chip { min-width: 44px; height: 44px; padding: 0 10px; font-size: 16px; background: var(--surface-2); border-color: transparent; }
.roots .chip:hover { background: var(--surface); border-color: var(--accent); }
.roots .chip.on, .roots .chip.on:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 40%, transparent); }
.type-wrap { display: flex; flex-direction: column; gap: 8px; }
.type-grp { display: flex; align-items: center; gap: 10px; }
.grp-label { font-size: 13px; font-weight: 700; color: var(--muted); width: 64px; flex: none; }
@media (max-width: 600px) {
  .controls { padding: 14px; border-radius: 22px; }
  .type-grp { flex-direction: column; align-items: flex-start; gap: 4px; }
  .roots .chip { min-width: 40px; height: 40px; font-size: 15px; }
}

.chord-head, .key-head { margin: 0 4px 22px; }
.chord-head { display: flex; align-items: center; gap: 14px 28px; flex-wrap: wrap; }
.ch-main { display: flex; align-items: center; gap: 14px 28px; flex-wrap: wrap; min-width: 0; }
.chord-head.with-info { align-items: flex-start; justify-content: space-between; }
.chord-head.with-info .ch-info { margin-top: 10px; }
.chord-head.with-info .ch-main { flex: 1 1 360px; padding-top: 6px; }
/* Chord type notes: a small card on the right. */
.ch-info { flex: 0 1 auto; max-width: 380px; align-self: flex-start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; transition: border-radius .15s; }
.ch-info.open { flex-basis: 380px; border-radius: 22px; box-shadow: 0 3px 0 var(--line); }
.ci-line { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 9px 10px 9px 14px; text-align: left; font-weight: 800; font-size: 14.5px; }
.ci-line:hover { color: var(--accent); }
.ci-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.ci-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-sym { font-size: 12.5px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 1px 9px; border-radius: 999px; flex: none; }
.ci-chev { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--muted); flex: none; transition: transform .18s; }
.ci-chev .ic { width: 16px; height: 16px; }
.ch-info.open .ci-chev { transform: rotate(180deg); }
.ci-body { margin: 0; padding: 2px 16px 14px; display: grid; gap: 2px; border-top: 1.5px solid var(--line); padding-top: 10px; }
.ci-body dt { font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 6px; }
.ci-body dt:first-child { margin-top: 0; }
.ci-body dd { margin: 0; font-size: 13.5px; line-height: 1.42; }
@media (max-width: 760px) { .ch-info, .ch-info.open { flex-basis: 100%; max-width: none; } }
.ch-name { font-size: 64px; font-weight: 900; line-height: .95; margin: 0; letter-spacing: -.03em; display: flex; align-items: baseline; flex-wrap: wrap; }
.ch-name small { font-size: 18px; color: var(--muted); font-weight: 700; margin-left: 12px; letter-spacing: 0; }
/* Chord tones as diagram dots: note inside, interval underneath. */
.tones { display: flex; gap: 10px; flex-wrap: wrap; }
.tone { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tone b { min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--dot); color: var(--dot-fg); font-size: 15px; font-weight: 900; }
.tone i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--muted); }
.tone.is-root b { background: var(--accent); color: var(--accent-fg); }
.tone.is-root i { color: var(--accent); }
.tone em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: -3px; }
@media (max-width: 600px) { .ch-name { font-size: 48px; } .tone b { width: 34px; height: 34px; font-size: 13.5px; } }

/* ---------- explorer ---------- */
.sec-head h3 { margin: 0; font-size: 18px; }
.star { color: var(--accent); }
.pop { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); border: 0; border-radius: 28px; padding: 18px 20px 20px; margin-bottom: 26px; }
.pop .card { background: var(--surface); }
.grid { display: grid; gap: 12px; margin-top: 12px; }
.grid-lg { grid-template-columns: repeat(auto-fill, minmax(170px, 210px)); }
.grid-md { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
@media (max-width: 520px) {
  .grid-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-md { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.more-title { font-size: 18px; margin: 8px 0 2px; }
.group { padding: 16px 0 6px; border-top: 1px solid var(--line); margin-top: 10px; }
.group-head h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.show-more { margin-top: 12px; border: 1.5px dashed var(--line-2); background: none; padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 800; color: var(--muted); }
.show-more:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- chord card ---------- */
.card {
  position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: 0 2px 0 var(--line);
  padding: 9px 8px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  transition: border-color .15s, transform .15s, box-shadow .15s; user-select: none; -webkit-user-select: none;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 40%, transparent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.playing { border-color: var(--accent); }
.card.added { box-shadow: 0 0 0 3px rgba(var(--green), .45); }
.card-head { display: flex; align-items: center; justify-content: center; gap: 5px; align-self: stretch; min-height: 22px; }
.card-name { font-weight: 900; font-size: 17px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.card-name small.alt { font-size: 11px; font-weight: 700; color: var(--muted); }
.size-lg .card-name { font-size: 21px; }
.size-sm .card-name { font-size: 14px; }
.card-head .star { font-size: 12px; }
.card .dia { width: 100%; height: auto; display: block; margin: 2px auto 0; }
.size-lg .dia { max-width: 170px; }
.size-md .dia { max-width: 128px; }
.size-sm .dia { max-width: 100px; }
.card-meta { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 12px; margin-top: 4px; }
.kind { font-weight: 600; }
.diff { font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.d-easy { color: var(--easy); background: color-mix(in srgb, var(--easy) 13%, transparent); }
.d-medium { color: var(--medium); background: color-mix(in srgb, var(--medium) 13%, transparent); }
.d-hard { color: var(--hard); background: color-mix(in srgb, var(--hard) 13%, transparent); }
.card-sub { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; padding: 0 22px; }
.size-sm .card-meta { font-size: 11px; }
/* Piano cards are wide: a keyboard needs room. */
.inst-keys .grid-lg { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.inst-keys .grid-md { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card .dia.kbd { max-width: none; margin-top: 8px; }
.size-lg .dia.kbd { max-width: 340px; }
.size-md .dia.kbd { max-width: 300px; }
.kgrid.inst-keys { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
@media (max-width: 520px) {
  .inst-keys .grid-lg, .inst-keys .grid-md, .kgrid.inst-keys { grid-template-columns: minmax(0, 1fr); }
}
.schip.inst-keys .dia { margin-top: 4px; }
/* A keyboard needs room: piano chords take a double-width slot in the song sheet. */
.schip.inst-keys { width: calc(var(--chip-w, 130px) * 2); }
/* 4-string diagrams (bass, ukulele) are narrow: keep them from growing too tall. */
.inst-bass .size-lg .dia, .inst-uke .size-lg .dia { max-width: 132px; }
.inst-bass .size-md .dia, .inst-uke .size-md .dia { max-width: 104px; }
.inst-bass .size-sm .dia, .inst-uke .size-sm .dia { max-width: 88px; }
.schip.inst-bass .dia, .schip.inst-uke .dia { width: 74%; margin: 0 auto; }
.add-btn {
  position: absolute; right: 7px; bottom: 7px; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: rgba(var(--green), .55); color: #fff;
  opacity: 0; transform: scale(.7); transition: opacity .15s, transform .15s, background .15s;
}
.add-btn .ic { width: 16px; height: 16px; stroke-width: 2.8; }
.card:hover .add-btn, .card:focus-within .add-btn { opacity: 1; transform: none; }
.add-btn:hover { background: rgba(var(--green), .92); }
@media (hover: none) { .add-btn { opacity: .85; transform: none; } }

/* ---------- key mode ---------- */
.scale { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; font-size: 14px; }
.scale .muted { font-weight: 700; margin-right: 4px; }
.sn { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; }
.sn.is-root { background: var(--accent); color: var(--accent-fg); }
.sn small.alt { display: block; font-size: 10px; font-weight: 700; opacity: .75; line-height: 1; margin-top: -2px; }
.scale .sn:has(small) { height: 42px; padding: 0 9px; line-height: 1.05; text-align: center; }
.key-head .hint { margin-top: 10px; font-size: 14px; max-width: 700px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .kgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kcol { display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 24px; padding: 12px; }
.kcol.tag-main { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.kcol.tag-rare { background: transparent; border: 1.5px dashed var(--line-2); }
.kcol .card { background: var(--surface); }
.kcol-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px; }
.roman { font-weight: 900; font-size: 20px; }
.ktag { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.tag-main .ktag { color: var(--accent); }
.kcol-note { font-size: 11px; color: var(--muted); margin-top: -6px; padding: 0 2px; }
.more-btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; padding: 6px; margin-top: auto; color: var(--muted); font-weight: 600; font-size: 13px; border-radius: 9px; }
.more-btn:hover { color: var(--fg); background: var(--surface-2); }
.plus-circle { width: 30px; height: 30px; border-radius: 50%; border: 1.6px solid currentColor; display: grid; place-items: center; }
.plus-circle .ic { width: 15px; height: 15px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10, 10, 12, .5); display: flex; justify-content: center; align-items: flex-start; padding: 4vh 16px; overflow: auto; }
.modal-panel { background: var(--bg); border-radius: 28px; width: min(1040px, 100%); box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.modal-top { position: sticky; top: -4vh; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg); border-radius: 28px 28px 0 0; }
.modal-top h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px 18px 26px; }
body.modal-open { overflow: hidden; }

/* ---------- song sheet drawer ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1.5px solid var(--line); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .08); }
.sheet-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sheet-bar .bar-inner { display: flex; align-items: center; gap: 12px; height: 56px; }
.sheet-bar.pulse { animation: pulse .7s ease; }
@keyframes pulse { 0% { background: rgba(var(--green), .25); } 100% { background: transparent; } }
.sheet-toggle { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 4px; min-width: 0; }
.sheet-toggle b { font-size: 15px; white-space: nowrap; }
.sheet-count { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { display: grid; place-items: center; transition: transform .2s; }
.sheet:not(.collapsed) .chev { transform: rotate(180deg); }
.sheet-actions { margin-left: auto; display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: var(--surface); padding: 8px 15px; border-radius: 999px; font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.sheet-body { height: var(--body-h, 340px); overflow: auto; border-top: 1px solid var(--line); padding: 12px 0 18px; overscroll-behavior: contain; }
.sheet.collapsed .sheet-body { display: none; }
@media (max-width: 560px) { .btn span { display: none; } .sheet-count { display: none; } }

.sheet-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.song-title { flex: 1 1 220px; font-size: 18px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 9px; min-width: 0; }
.song-title:hover { border-color: var(--line); }
.inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 600; }
.inline .input { min-height: 32px; padding: 4px 8px; color: var(--fg); }
.inline .tempo { width: 74px; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.link-btn:hover { color: var(--hard); }

.srow { margin-top: 12px; padding: 10px 12px 12px; border: 1.5px solid var(--line); border-radius: 20px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.srow.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.srow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 30px; }
.active-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.srow.active .active-dot { background: var(--accent); }
.spacer { flex: 1; }
.row-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ovr { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.label-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.row-name { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 30px 4px 9px; font-weight: 700; font-size: 14px; width: 190px; max-width: 46vw; }
.caret { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 3px; color: var(--muted); display: grid; place-items: center; }
.caret .ic { width: 15px; height: 15px; }
.tag-menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; gap: 4px; flex-wrap: wrap; width: 240px; }
.label-wrap.open .tag-menu { display: flex; }
.tag { border: 1px solid var(--line-2); background: var(--bg); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.srow-settings { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 8px 10px; margin-bottom: 10px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 10px; }

.strip { display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; border-radius: 12px; }
.strip.drop-end { box-shadow: inset -3px 0 0 var(--accent); }
.strip-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 10px; color: var(--muted); font-size: 13px; }
.schip { width: var(--chip-w, 130px); position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 4px 3px; text-align: center; cursor: pointer; min-width: 0; transition: border-color .12s, transform .12s; }
.schip:hover { border-color: var(--line-2); }
.schip.now { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); transform: translateY(-2px); }
.schip.dragging { opacity: .35; }
.schip.drop-before { box-shadow: -5px 0 0 -1px var(--accent); }
.schip-name { font-weight: 900; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schip .dia { width: 100%; height: auto; display: block; }
.schip-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity .12s; }
.schip-x .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.schip:hover .schip-x { opacity: 1; }
.schip-x:hover { color: var(--hard); }
@media (hover: none) { .schip-x { opacity: .8; } }
.add-row { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; border: 1.5px dashed var(--line-2); background: none; padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: 13.5px; color: var(--muted); }
.add-row:hover:not(:disabled) { color: var(--fg); border-color: var(--fg); }
.add-row small { font-weight: 500; opacity: .7; }

.toast { position: fixed; left: 50%; bottom: calc(var(--sheet-h) + 14px); transform: translate(-50%, 10px); z-index: 70; background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- print fallback (PDF via browser) ---------- */
@media print {
  .top, main, .toast, .modal, .sheet-bar, .sheet-meta .link-btn, .add-row, .icon-btn, .schip-x, .caret, .active-dot, .row-count { display: none !important; }
  body { background: #fff; color: #000; }
  .sheet { position: static; box-shadow: none; border: 0; }
  .sheet.collapsed .sheet-body, .sheet-body { display: block !important; max-height: none; overflow: visible; border: 0; }
  .srow { break-inside: avoid; border-color: #ddd; box-shadow: none !important; background: #fff; }
  .row-name, .song-title, .input { border: 0; background: none; }
}

/* ---------- sheet resize ---------- */
.sheet-grip { position: absolute; left: 0; right: 0; top: -8px; height: 20px; cursor: ns-resize; display: grid; place-items: center; z-index: 2; touch-action: none; }
.sheet-grip span { width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); transition: background .15s, width .15s; }
.sheet-grip:hover span, .sheet-grip:focus-visible span, body.resizing .sheet-grip span { background: var(--accent); width: 64px; }
.sheet-grip:focus-visible { outline: none; }
body.resizing { cursor: ns-resize; user-select: none; -webkit-user-select: none; }
.schip-name { font-size: clamp(12px, calc(var(--chip-w) * .12), 16px); }
/* smallest size: each row is one line, read like a chord chart: | Am | F | C | G || */
.sheet.names .sheet-meta, .sheet.names .srow-settings, .sheet.names .add-row { display: none; }
.sheet.names .sheet-body { padding: 10px 0; }
.sheet.names .srow { display: flex; align-items: center; gap: 8px; margin-top: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.sheet.names .srow + .srow { margin-top: 8px; }
.sheet.names .srow-head { display: contents; }
.sheet.names .srow-head > * { order: 3; }
.sheet.names .srow-head > .active-dot, .sheet.names .srow-head > .label-wrap, .sheet.names .srow-head > .ovr { order: 0; }
.sheet.names .spacer, .sheet.names .row-count { display: none; }
.sheet.names .row-name { width: 120px; }
.sheet.names .strip {
  order: 1; flex: 1; min-width: 0; min-height: 40px; flex-wrap: nowrap; overflow-x: auto; gap: 0; align-items: center;
  padding: 0 6px; margin-right: 6px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .06); scrollbar-width: none;
}
.sheet.names .strip::-webkit-scrollbar { display: none; }
@media (max-width: 600px) {
  .sheet.names .row-set, .sheet.names .row-del { display: none; }
  .sheet.names .row-name { width: 84px; padding-right: 24px; font-size: 13px; }
  .sheet.names .schip { min-width: 46px; padding: 4px 10px; }
}
.sheet.names .srow.active .strip { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.sheet.names .schip {
  width: auto; flex: none; min-width: 58px; padding: 4px 14px; margin: 5px 0; border: 0; border-left: 2px solid var(--line-2);
  border-radius: 0; background: none; box-shadow: none; transform: none;
}
.sheet.names .schip:last-child { border-right: 6px double var(--line-2); margin-right: 4px; }
.sheet.names .schip:hover { background: var(--surface-2); }
.sheet.names .schip.now { background: var(--accent-soft); color: var(--accent); box-shadow: none; transform: none; }
.sheet.names .schip-name { font-size: 16px; overflow: visible; text-align: left; }
.sheet.names .schip-x { display: none; }
.sheet.names .strip-empty { padding: 0 8px; border: 0; justify-content: flex-start; font-size: 13px; }

/* ---------- export split button & popover ---------- */
.split { display: inline-flex; }
.split .split-main { border-radius: 999px 0 0 999px; padding-right: 12px; }
.split .split-caret { border-radius: 0 999px 999px 0; padding: 0 10px 0 8px; border-left: 1.5px solid color-mix(in srgb, var(--accent-fg) 30%, var(--accent)); }
.split-caret .ic { width: 16px; height: 16px; transition: transform .15s; }
.split-caret[aria-expanded="true"] .ic { transform: rotate(180deg); }
.xp-pop {
  position: fixed; z-index: 80; width: min(360px, calc(100vw - 24px)); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  max-height: calc(100vh - 16px); overflow: auto; overscroll-behavior: contain;
  animation: xp-in .14s ease-out;
}
@keyframes xp-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .xp-pop { animation: none; } }
.seg-wide { display: flex; }
.seg-wide button { flex: 1; padding: 7px 10px; font-size: 14px; }
.xp-hint { margin: -2px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.xp-label { font-size: 13px; font-weight: 800; color: var(--muted); margin: 4px 2px -2px; }
.xp-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xp-swatches.two { grid-template-columns: repeat(2, 1fr); }
.xp-swatch { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.xp-tile {
  width: 100%; aspect-ratio: 4 / 5; border-radius: 14px; border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px 2px; transition: border-color .12s, box-shadow .12s;
}
.xp-swatches.two .xp-tile { aspect-ratio: auto; height: 84px; flex-direction: row; gap: 8px; padding: 8px; }
.xp-tile b { font-size: 14px; font-weight: 900; line-height: 1; }
.xp-tile .dia { width: 100%; max-width: 56px; height: auto; }
.xp-swatches.two .xp-tile .dia { width: auto; height: 100%; max-width: none; }
.xp-swatch.clear .xp-tile { background-color: #fff; background-image: conic-gradient(#e6e3dc 25%, #fff 0 50%, #e6e3dc 0 75%, #fff 0); background-size: 12px 12px; }
.xp-swatch.clear.dark .xp-tile { background-color: #2a2a30; background-image: conic-gradient(#3a3a42 25%, #2a2a30 0 50%, #3a3a42 0 75%, #2a2a30 0); }
.xp-name { font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.xp-swatch:hover .xp-tile { border-color: var(--line-2); }
.xp-swatch.on .xp-tile { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.xp-swatch.on .xp-name { color: var(--fg); }
.xp-swatch:focus-visible { outline: none; }
.xp-swatch:focus-visible .xp-tile { outline: 2px solid var(--accent); outline-offset: 2px; }
.xp-go { justify-content: center; margin-top: 4px; padding: 10px 16px; font-size: 14.5px; }
.xp-pop .btn span { display: inline; }

/* Names in "both" / solfège mode: small second line under chips and sheet chords. */
.chip small.alt { display: block; font-size: 10.5px; font-weight: 700; line-height: 1.05; opacity: .72; }
.roots.solf .chip { height: auto; min-height: 44px; padding: 4px 13px; line-height: 1.1; }
.schip-name small.alt { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.1; overflow: hidden; text-overflow: ellipsis; }
.sheet.names .schip-name small.alt { display: inline; margin-left: 6px; font-size: 11.5px; }

/* Bass arpeggio: the marker lights each dot as its note sounds. */
.dia .bd-dot, .dia .bd text { transition: fill .12s, stroke .12s; }
.dia .bd.hit .bd-dot:not(.open) { fill: var(--accent); }
.dia .bd.hit .bd-dot.open { stroke: var(--accent); stroke-width: 2.2; }
.dia .bd.hit text { fill: var(--accent-fg); }
.dia .bd.hit .bd-dot.open + text { fill: var(--accent); }
.dia .bd-ring { transform-box: fill-box; transform-origin: center; }
.dia .bd.hit .bd-ring { animation: arp-ring .55s ease-out forwards; }
.dia .bd-dot { transform-box: fill-box; transform-origin: center; transition: fill .12s, stroke .12s, transform .12s; }
.dia .bd.hit .bd-dot { transform: scale(1.2); }
@keyframes arp-ring { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.9); } }
@media (prefers-reduced-motion: reduce) { .dia .bd.hit .bd-ring { animation: none; opacity: .9; } }

/* Settings popover */
.sp-pop { width: min(340px, calc(100vw - 24px)); }
.sp-title { font-size: 16px; font-weight: 900; margin: 0 2px; }
.sp-accents { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sp-accent { border: 0; background: none; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 5px; border-radius: 14px; }
.sp-accent i { width: 34px; height: 34px; border-radius: 50%; background: var(--sw-l); box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1.5px var(--line); transition: box-shadow .12s; }
:root[data-theme="dark"] .sp-accent i { background: var(--sw-d); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sp-accent i { background: var(--sw-d); } }
.sp-accent span { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.15; text-align: center; }
.sp-accent:hover i { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1.5px var(--line-2); }
.sp-accent.on i { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2.5px var(--sw-l); }
:root[data-theme="dark"] .sp-accent.on i { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2.5px var(--sw-d); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sp-accent.on i { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2.5px var(--sw-d); } }
.sp-accent.on span { color: var(--fg); }
.sp-accent:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-names button { font-size: 13.5px; }
.sp-sample { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--bg); border-radius: 14px; }
.sp-sample span { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; font-weight: 900; font-size: 15px; line-height: 1.15; }
.sp-sample small.alt { font-size: 10.5px; font-weight: 700; color: var(--muted); }

/* Fingers chart button & hand diagram */
#labelsSeg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hand-btn { padding: 6px 13px 6px 10px; }
.hand-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.hand-pop { width: min(380px, calc(100vw - 24px)); }
.hands { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 6px 0; }
.hand { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hand-pic { position: relative; width: 100%; aspect-ratio: 1569 / 2000; }
.hand-pic img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.hand-right .hand-pic img { transform: scaleX(-1); }
:root[data-theme="dark"] .hand-pic img { filter: invert(1) brightness(.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hand-pic img { filter: invert(1) brightness(.92); } }
.hand-pic b { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg); font-size: 13px; font-weight: 900; box-shadow: 0 0 0 2.5px var(--surface); }
.hand figcaption { font-size: 14px; font-weight: 900; }
.hand-legend { margin: 2px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hand-legend b { color: var(--accent); font-weight: 900; margin-right: 1px; }
#labelsSeg .hand-btn span { display: inline; }

/* About */
.sp-about { justify-content: center; margin-top: 2px; }
.about-panel { width: min(560px, 100%); }
.about-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px 22px; }
.about-logo { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -.02em; }
.about-logo b { color: var(--accent); font-weight: 900; }
.about-body { padding: 4px 22px 22px; }
.about-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.55; max-width: 62ch; }
.about-body .about-lead { font-size: 17px; font-weight: 800; line-height: 1.45; }
.about-love { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.about-love .ic { color: var(--accent); width: 20px; height: 20px; fill: var(--accent-soft); }
.about-donate { margin: 18px 0 0; padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; }
.about-donate summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 15.5px; }
.about-donate summary::-webkit-details-marker { display: none; }
.about-donate summary::after { content: ''; margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a958a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat center / 16px; transition: transform .18s; }
.about-donate[open] summary::after { transform: rotate(180deg); }
.about-donate summary:hover { color: var(--accent); }
.about-donate summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.about-donate[open] summary { margin-bottom: 12px; }
.about-donate p { font-size: 14px; }
.about-donate p.small { font-size: 13px; color: var(--muted); }
.about-donate p.warn { color: var(--hard); }
.donate-main { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
.donate-qr { width: 148px; height: 148px; flex: none; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 0 0 1.5px var(--line); image-rendering: pixelated; }
.donate-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.donate-info .xp-label { margin: 0; }
.donate-addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; user-select: all; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1.5px solid var(--line); line-height: 1.45; }
.donate-info .muted.small { margin: 0; font-size: 12.5px; }
.about-sign { margin: 18px 0 0 !important; font-size: 14px; color: var(--muted); text-align: center; }
.about-sign a { color: var(--fg); font-weight: 800; text-decoration: none; border-bottom: 1.5px solid var(--accent); }
.about-sign a:hover { color: var(--accent); }
@media (max-width: 520px) { .about-top { padding: 14px 14px 4px 18px; } .about-body { padding: 4px 18px 18px; } .donate-qr { width: 128px; height: 128px; } }

/* Difficulty (easy / medium / hard) is still computed, but not shown for now. */
.diff { display: none !important; }

/* ---------- top of the page: How to use + hints ---------- */
.page-help { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: -4px 0 10px; }
.guide-btn { padding: 7px 14px 7px 11px; }
.help-btn { font-weight: 900; font-size: 16px; }
.help-btn.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* ---------- tuning: select + Edit ---------- */
.tuning-pick { display: flex; gap: 6px; align-items: stretch; }
.tuning-edit { padding: 6px 12px 6px 10px; border-radius: 12px; }
@media (max-width: 760px) { .tuning-pick select { flex: 1; min-width: 0; } }

/* ---------- tuning editor ---------- */
.tuner { margin: 0 0 18px; padding: 16px 18px 18px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 24px; box-shadow: 0 3px 0 var(--line); }
.te-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.te-title { display: flex; flex-direction: column; gap: 2px; }
.te-title b { font-size: 16px; font-weight: 900; }
.te-title span { font-size: 13px; color: var(--muted); }
.te-acts { display: flex; gap: 8px; }
.te-acts .btn:disabled { opacity: .45; }
.te-row { display: flex; align-items: center; gap: 14px; overflow-x: auto; padding: 2px 2px 4px; }
.te-pm { display: flex; flex-direction: column; gap: 8px; flex: none; }
.te-pm-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface-2); display: grid; place-items: center; padding: 0; color: var(--fg); }
.te-pm-btn .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.te-pm-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.te-pm-btn:disabled { opacity: .35; }
.te-strings { display: flex; gap: 10px; }
.te-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.te-arrow { width: 34px; height: 22px; border: 0; background: none; padding: 0; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.te-arrow svg { width: 13px; height: 9px; fill: currentColor; }
.te-arrow:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.te-arrow:disabled { opacity: .25; }
.te-str { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); padding: 0; display: flex; align-items: baseline; justify-content: center; gap: 1px; line-height: 50px; transition: border-color .12s, background .12s; }
.te-str:hover { border-color: var(--accent); }
.te-str:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.te-str.sel { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.te-str.empty { border-style: dashed; background: var(--surface-2); }
.te-x { font-size: 24px; font-weight: 700; color: var(--muted); }
.te-note { font-size: 19px; font-weight: 900; }
.te-oct { font-size: 12px; font-weight: 800; color: var(--muted); }
.te-no { font-size: 11px; font-weight: 800; color: var(--muted); }
/* The dial: notes (then octaves) around the string like a clock face. */
.te-dial-back { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 35%, transparent); }
.te-dial { position: fixed; width: 220px; height: 220px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .25), inset 0 0 0 26px var(--surface-2); animation: te-pop .14s ease-out; }
@keyframes te-pop { from { transform: scale(.85); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .te-dial { animation: none; } }
.te-dial-item { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: 0 0 0 1.5px var(--line); font-weight: 900; font-size: 14px; padding: 0; color: var(--fg); }
.te-dial-item:hover, .te-dial-item:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent); }
.te-dial-item.on { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
.te-dial-center { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.te-dial-center b { font-size: 26px; font-weight: 900; line-height: 1; }
.te-dial-center small { font-size: 12px; font-weight: 800; color: var(--muted); }
.te-dial-back-btn { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 22px; font-weight: 900; padding: 4px 6px; }
.te-dial-back-btn:hover { color: var(--accent); }

/* ---------- hints ("?") ---------- */
.hint, .hint-legend { position: relative; display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; padding: 9px 12px; max-width: 760px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg)); color: var(--fg); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 14px; font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.hint::after { content: ''; position: absolute; left: 22px; bottom: -7px; width: 11px; height: 11px; background: inherit; border-right: inherit; border-bottom: inherit; transform: rotate(45deg); }
.hint-q { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 12px; font-weight: 900; margin-top: -1px; }
.hint-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 6px 18px; max-width: none; }
.hint-legend div { display: flex; gap: 8px; align-items: flex-start; }
.hint-num, .hint-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 11.5px; font-weight: 900; line-height: 1; }
.help-on .help-target { outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; }
.help-on .help-target:not(.sheet-grip):not(.schip) { position: relative; }
.hint-n { position: absolute; top: -11px; left: -11px; z-index: 6; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.sheet-grip .hint-n { left: calc(50% - 52px); top: -2px; }
.sheet .hint-legend { margin: 10px 16px 2px; padding: 7px 10px; font-size: 12.5px; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (min-width: 1232px) { .sheet .hint-legend { max-width: 1168px; margin-left: auto; margin-right: auto; } }
.srow .hint-legend { margin: 0 0 10px; }

/* ---------- How to use ---------- */
.guide-panel { width: min(760px, 100%); }
.guide-title { margin: 0; font-size: 24px; font-weight: 900; }
.guide-body h3 { margin: 18px 0 8px; font-size: 16px; font-weight: 900; }
.guide-short { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; line-height: 1.75; }
.guide-body p { line-height: 1.75; }
.guide-step { margin: 8px 0 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; }
.guide-step summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 900; font-size: 15px; }
.guide-step summary::-webkit-details-marker { display: none; }
.guide-step summary::after { content: ''; margin-left: auto; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a958a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat center / 16px; transition: transform .18s; }
.guide-step[open] summary::after { transform: rotate(180deg); }
.guide-step summary:hover { color: var(--accent); }
.guide-step summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 16px; }
.gs-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12.5px; flex: none; }
.gs-body { padding: 0 16px 14px; }
.gs-body p { margin: 0 0 10px; font-size: 14.5px; }
/* Inactive copies of real buttons, inline in the text. */
.rb { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; height: 26px; padding: 0 10px; margin: 0 1px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font-size: 12.5px; font-weight: 800; line-height: 1; white-space: nowrap; user-select: none; pointer-events: none; }
.rb .ic { width: 14px; height: 14px; }
.rb-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.rb-icon { padding: 0 6px; }
.rb-add { width: 26px; padding: 0; justify-content: center; border: 0; background: rgba(var(--green), .9); color: #fff; }
.rb-add .ic { stroke-width: 2.8; }
.rb-round { width: 26px; padding: 0; justify-content: center; }
.rb-q { font-weight: 900; font-size: 13px; }
.rb-tab { background: var(--surface-2); border-color: transparent; }
.rb-dashed { border-style: dashed; border-color: var(--line-2); color: var(--muted); }
.rb-arrow { width: 26px; padding: 0; justify-content: center; border-color: transparent; background: var(--surface-2); color: var(--muted); }
.rb-arrow svg { width: 11px; height: 8px; fill: currentColor; }
.rb-grip { width: 48px; padding: 0; justify-content: center; border-color: transparent; background: var(--surface-2); }
.rb-grip i { width: 30px; height: 4px; border-radius: 999px; background: var(--line-2); }
/* Pictures: real components, inert. */
.shot { margin: 4px 0 6px; padding: 14px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.shot .card { width: 210px; cursor: default; }
.shot .card:hover { transform: none; }
.shot .add-btn { opacity: 1; transform: none; }
.shot .shot-keys { width: min(340px, 100%); }
.shot .shot-keys .dia { max-width: 320px; }
.shot-track { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 520px; }
.shot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.shot-dot.off { background: var(--line-2); }
.shot-row { font-size: 12.5px; font-weight: 800; color: var(--muted); width: 74px; flex: none; }
.shot-chords { flex: 1; display: flex; align-items: center; min-height: 38px; padding: 0 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.shot-chords span { padding: 3px 12px; border-left: 2px solid var(--line-2); font-weight: 900; font-size: 15px; display: inline-flex; flex-direction: column; line-height: 1.15; }
.shot-chords span:last-child { border-right: 6px double var(--line-2); }
.shot-chords small.alt { font-size: 10px; color: var(--muted); font-weight: 700; }
.shot-tuner { justify-content: center; overflow: visible; }
@media (max-width: 520px) { .shot-row { width: 52px; } .shot .card { width: 180px; } .te-str { width: 46px; height: 46px; line-height: 42px; } .te-note { font-size: 16px; } .te-strings { gap: 6px; } }
.page-help .guide-btn span { display: inline; }
@media (max-width: 420px) { .tuner { padding: 14px 12px; } .te-row { gap: 10px; } .te-strings { gap: 4px; } .te-str { width: 40px; height: 40px; line-height: 36px; } .te-note { font-size: 15px; } .te-oct { font-size: 10.5px; } .te-pm-btn { width: 30px; height: 30px; } .te-arrow { width: 30px; } }
