/* Fretwork: one stylesheet, no build step. Light and dark themes via custom properties. */

:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface-2: #f2ece2;
  --text: #231d16;
  --muted: #6f6457;
  --border: #e4dacb;
  --accent: #c8691c;
  --accent-strong: #a6520f;
  --accent-soft: #f8e5d1;
  --on-accent: #ffffff;
  --tone: #2c7a6b;
  --tone-soft: #d9eee9;
  --good: #2f8a4f;
  --good-soft: #def2e4;
  --bad: #c0392f;
  --bad-soft: #f9e0dc;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgb(40 25 10 / 6%), 0 6px 20px rgb(40 25 10 / 6%);

  /* The fretboard looks like wood in both themes. */
  --wood: #5a3923;
  --wood-edge: #3f2716;
  --wire: #cfc8bd;
  --string: #ece4d4;
  --inlay: #ecdfc9;
  --nut: #f3ead8;

  --radius: 14px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110e; --surface: #1d1915; --surface-2: #27211b; --text: #f2ebe1; --muted: #a99b8b; --border: #352d25;
    --accent: #f0943f; --accent-strong: #ffad5c; --accent-soft: #3b2715; --on-accent: #1b120a;
    --tone: #4fb8a3; --tone-soft: #16342f; --good: #55c47d; --good-soft: #15301f; --bad: #f2695f; --bad-soft: #3b1a17;
    --focus: #7aa7ff; --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14110e; --surface: #1d1915; --surface-2: #27211b; --text: #f2ebe1; --muted: #a99b8b; --border: #352d25;
  --accent: #f0943f; --accent-strong: #ffad5c; --accent-soft: #3b2715; --on-accent: #1b120a;
  --tone: #4fb8a3; --tone-soft: #16342f; --good: #55c47d; --good-soft: #15301f; --bad: #f2695f; --bad-soft: #3b1a17;
  --focus: #7aa7ff; --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 20px 56px; outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
a { color: var(--accent-strong); }
a:hover { color: var(--accent); }
kbd { font: 0.85em var(--mono); padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; justify-content: center; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.noscript { padding: 20px; text-align: center; }

/* ---------- Layout helpers ---------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row h2 { margin: 0; }
.grow { flex: 1; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 0 18px;
}
.page-head { margin-bottom: 22px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--accent-strong); margin-bottom: 8px; }
.section-title { margin-top: 8px; }
.empty { text-align: center; padding: 60px 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; fill: var(--accent); }
.site-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a, .icon-link {
  display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.93rem; white-space: nowrap;
}
.site-nav a:hover, .icon-link:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active, .icon-link.active { color: var(--accent-strong); background: var(--accent-soft); }
.icon-link { padding: 9px; }
.icon-link .icon { width: 1.3em; height: 1.3em; }
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; gap: 6px 12px; }
  .site-nav { order: 3; flex-basis: 100%; margin: 0 -8px; }
  .icon-link { margin-left: auto; }
}

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; text-align: center; padding: 18px 20px 26px; }
.site-footer p { margin: 0; }

/* ---------- Buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 650; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn.big { padding: 12px 22px; font-size: 1.02rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent-strong); font: inherit; cursor: pointer; text-decoration: underline; }
.file-btn { position: relative; }

.seg { display: inline-flex; flex-wrap: nowrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-wrap { flex-wrap: wrap; border-radius: var(--radius-sm); }
.seg-btn {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 650; font-size: 0.9rem;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; min-width: 2.4em; white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--accent-strong); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 0.88rem;
  cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip small { color: var(--muted); font-weight: 700; }
.chip.active small { color: inherit; opacity: .8; }
.chip-arrow { color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.78rem; font-weight: 700; }
.badge.good { background: var(--good-soft); color: var(--good); }

select, input[type="text"], input[type="number"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px; min-height: 38px;
}
select { padding-right: 28px; }
input[type="text"] { min-width: 0; flex: 1; }
input[type="number"].num { width: 4.6em; }
input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; }

.toolbar { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { flex-basis: 100%; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.label { font-size: 0.75rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.search p { margin: 0; }

.progress { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.progress-bar { width: 220px; max-width: 100%; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center; margin: 8px 0 40px; }
.hero h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.3rem); letter-spacing: -0.03em; }
.hero .row { margin-top: 22px; }
.hero-art { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); gap: 12px; justify-content: center; }
.hero-art .chord-card { min-width: 0; padding: 12px 8px 10px; }
.hero-art .chord-actions .btn.ghost { display: none; }
.hero-art .chord-card:nth-child(2) { transform: translateY(-14px); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero-art .chord-card:nth-child(2) { transform: none; } }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tool-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.tool-card span:last-child { color: var(--muted); font-size: 0.92rem; }
.tool-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 4px; }
.tool-icon .icon { width: 24px; height: 24px; }
.routine ol { margin: 0; padding-left: 1.3em; }
.routine li { margin: 6px 0; }

/* ---------- Lessons ---------- */
.unit { margin-bottom: 30px; }
.unit h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.unit-num { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); }
.lesson-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.lesson-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.lesson-item:hover { border-color: var(--accent); color: var(--text); }
.lesson-num {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-weight: 800;
}
.lesson-item.is-done .lesson-num { background: var(--good); color: #fff; }
.lesson-item.is-started .lesson-num { background: var(--accent-soft); color: var(--accent-strong); }
.lesson-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lesson-text span { color: var(--muted); font-size: 0.92rem; }
.lesson-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 560px) { .lesson-meta .badge { display: none; } }

.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; flex-wrap: wrap; }
.lesson-head { margin-bottom: 22px; }
.lesson-body { max-width: 780px; }
.prose { font-size: 1.04rem; line-height: 1.68; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 5px 0; }
.prose h3:first-child { margin-top: 0.4em; }
.block { margin: 22px 0 26px; }
figure.block { margin-left: 0; margin-right: 0; }
.caption { color: var(--muted); font-size: 0.92rem; margin: 10px 0 0; }
.tip {
  display: flex; gap: 12px; align-items: baseline; margin: 20px 0; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 4px solid var(--accent);
}
.tip p { margin: 0; }
.tip-label { flex: none; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); }
.tool-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; padding: 14px 18px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.tool-link > span { display: flex; flex-direction: column; }
.tool-link:hover { border-color: var(--accent); color: var(--text); }
.tool-link .icon { color: var(--accent); }
.lesson-section { max-width: 780px; margin-top: 30px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 3px; flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

.quiz-q { padding: 14px 0; }
.quiz-q + .quiz-q { border-top: 1px solid var(--border); }
.quiz-question { font-weight: 650; display: flex; gap: 10px; margin-bottom: 10px; }
.quiz-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 0.8rem; }
.quiz-options { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 34px; }
.quiz-opt {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt:disabled { cursor: default; opacity: .7; }
.quiz-opt.is-correct { background: var(--good-soft); border-color: var(--good); opacity: 1; font-weight: 650; }
.quiz-opt.is-wrong { background: var(--bad-soft); border-color: var(--bad); opacity: 1; }
.quiz-feedback { margin: 10px 0 0 34px; font-size: 0.93rem; }

.lesson-complete { max-width: 780px; margin: 26px 0; }
.done-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--good-soft); border: 1px solid var(--good); flex-wrap: wrap; }
.done-banner > .icon { width: 28px; height: 28px; color: var(--good); }
.done-banner > div { flex: 1; min-width: 200px; }
.lesson-nav { max-width: 780px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 20px; }

/* ---------- Open strings ---------- */
.open-strings, .string-buttons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.string-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.string-btn:hover { border-color: var(--accent); }
.string-num { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.string-note { font-size: 1.15rem; font-weight: 750; }
.string-btn.is-near { border-color: var(--tone); background: var(--tone-soft); }
.string-btn.is-target { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Fretboard ---------- */
.fb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.fretboard { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.fb-wood { fill: var(--wood); stroke: var(--wood-edge); stroke-width: 1; }
.fb-window { fill: rgb(255 200 120 / 22%); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.fb-inlay { fill: var(--inlay); opacity: .55; }
.fb-wire { stroke: var(--wire); stroke-width: 2.2; }
.fb-nut { fill: var(--nut); }
.fb-string { stroke: var(--string); }
.fb-string.is-dim { opacity: .3; }
.fb-strname { fill: var(--muted); font-size: 12px; font-weight: 700; text-anchor: middle; }
.fb-fretnum { fill: var(--muted); font-size: 11px; text-anchor: middle; opacity: .7; }
.fb-fretnum.is-inlay { font-weight: 800; opacity: 1; }
.fb-cell { fill: transparent; cursor: pointer; }
.fb-cell:hover { fill: rgb(255 255 255 / 9%); }
.fb-marker { pointer-events: none; }
.fb-marker circle { stroke-width: 1.5; }
.fb-marker text { font-size: 11.5px; font-weight: 800; text-anchor: middle; }
.fb-marker.is-long text { font-size: 9.5px; }
.fb-marker.is-root circle { fill: var(--accent); stroke: #fff6; }
.fb-marker.is-root text { fill: #fff; }
.fb-marker.is-tone circle { fill: #2f8f7c; stroke: #fff4; }
.fb-marker.is-tone text { fill: #fff; }
.fb-marker.is-note circle { fill: #f3ead9; stroke: transparent; }
.fb-marker.is-note text { fill: #3a2a1c; }
.fb-marker.is-ghost circle { fill: rgb(243 234 217 / 22%); stroke: rgb(243 234 217 / 35%); }
.fb-marker.is-ghost text { fill: #f3ead9; }
.fb-marker.is-target circle { fill: #ffd166; stroke: #fff; stroke-width: 2.5; animation: pulse 1.4s ease-in-out infinite; }
.fb-marker.is-target text { fill: #3a2a1c; }
.fb-marker.is-correct circle { fill: #3fae66; stroke: #fff; stroke-width: 2; }
.fb-marker.is-correct text, .fb-marker.is-wrong text { fill: #fff; }
.fb-marker.is-wrong circle { fill: #d9463b; stroke: #fff; stroke-width: 2; }
.fb-marker.is-dim { opacity: .28; }
@keyframes pulse { 50% { stroke-width: 6; stroke-opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .fb-marker.is-target circle { animation: none; } }
.board-card { padding: 14px 14px 10px; }
.board-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 6px 2px; font-size: 0.92rem; }

.tone-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.tone {
  display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--tone-soft); border: 1px solid transparent; color: var(--text); font: inherit; cursor: default;
}
button.tone { cursor: pointer; }
button.tone:hover { border-color: var(--tone); }
.tone b { font-size: 1.1rem; }
.tone small { color: var(--muted); font-weight: 700; font-size: 0.75rem; }
.tone.is-root { background: var(--accent-soft); }
.link-chip { text-decoration: none; }

/* ---------- Chords ---------- */
.chord-row { display: flex; flex-wrap: wrap; gap: 14px; }
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 14px; }
.chord-card {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 150px;
}
.chord-card figcaption { text-align: center; display: flex; flex-direction: column; }
.chord-name { font-size: 1.25rem; font-weight: 800; }
.chord-shape { font-size: 0.78rem; color: var(--muted); }
.chord-actions { display: flex; gap: 6px; }
.chord-actions .btn { padding: 6px 11px; }
.chord-diagram { width: 130px; height: auto; }
.cd-nut { fill: var(--text); }
.cd-fret { stroke: var(--muted); stroke-width: 1; }
.cd-string { stroke: var(--text); opacity: .75; }
.cd-open { fill: none; stroke: var(--text); stroke-width: 1.5; }
.cd-mute { stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.cd-dot, .cd-barre { fill: var(--text); }
.cd-finger { fill: var(--surface); font-size: 10px; font-weight: 800; text-anchor: middle; }
.cd-basefret { fill: var(--muted); font-size: 10px; font-weight: 700; text-anchor: end; }
.cd-label { fill: var(--muted); font-size: 9.5px; font-weight: 650; text-anchor: middle; }
.chord-summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.chord-title { font-size: 1.9rem; margin: 0; }
.chord-title .muted { font-size: 1rem; font-weight: 600; margin-left: 6px; }

/* ---------- Tab ---------- */
.tab-block .row { align-items: flex-start; flex-wrap: nowrap; }
.tab-block .caption { margin: 6px 0 0; }
.tab {
  font: 15px/1.45 var(--mono); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; margin: 0 0 12px; white-space: pre;
}
@media (max-width: 560px) { .tab-block .row { flex-wrap: wrap; } }

/* ---------- Strum player ---------- */
.strum-player { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.strum-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.strum-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 78px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 2px solid transparent; transition: background .05s;
}
.strum-slot.is-and { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.strum-arrow { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--accent-strong); min-height: 1em; }
.strum-slot.is-rest .strum-arrow::after { content: "·"; color: var(--muted); }
.strum-count { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.strum-slot.is-now { border-color: var(--accent); background: var(--accent-soft); }
.strum-chords { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.strum-chords .chip { cursor: default; }
.strum-chords.is-chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.strum-chords.is-chart .chip { border-radius: var(--radius-sm); justify-content: flex-start; padding: 8px 10px; font-size: 0.95rem; }
.strum-chords.is-chart .chip small { font-size: 0.7rem; min-width: 1.5em; }
.strum-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tempo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.tempo output { min-width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
.strum-status { margin: -6px 0 0; min-height: 1.2em; }
.strum-player .caption { margin: 0; }
.strum-player .seg { justify-self: start; max-width: 100%; overflow-x: auto; }

/* ---------- Trainer ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stats > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.prompt { font-size: 1.25rem; text-align: center; margin: 6px 0 12px; min-height: 1.5em; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 8px; }
.answer-btn {
  min-width: 58px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1.1rem; font-weight: 750; cursor: pointer;
}
.answer-btn:hover { border-color: var(--accent); }
.answer-btn.is-correct { background: var(--good); border-color: var(--good); color: #fff; }
.answer-btn.is-wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
.feedback { text-align: center; min-height: 1.5em; font-weight: 650; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Tuner ---------- */
.tuner { text-align: center; }
.tuner-display { max-width: 460px; margin: 0 auto 10px; }
.gauge { width: 100%; height: auto; display: block; }
.g-tick { stroke: var(--muted); stroke-width: 1.5; }
.g-tick.is-major { stroke: var(--text); stroke-width: 2.5; }
.g-label { fill: var(--muted); font-size: 11px; font-weight: 700; text-anchor: middle; }
.g-side { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.g-zone { fill: none; stroke: var(--good); stroke-width: 10; opacity: .35; }
.needle { transform-origin: 160px 160px; transition: transform .12s ease-out; }
.needle line { stroke: var(--muted); stroke-width: 3.5; stroke-linecap: round; }
.needle circle { fill: var(--muted); }
[data-state="off"] .needle line, [data-state="off"] .needle circle { stroke: var(--accent); fill: var(--accent); }
[data-state="far"] .needle line, [data-state="far"] .needle circle { stroke: var(--bad); fill: var(--bad); }
[data-state="good"] .needle line, [data-state="good"] .needle circle { stroke: var(--good); fill: var(--good); }
.tuner-readout { margin-top: -6px; }
.tuner-note { font-size: 3.4rem; font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums; }
[data-state="good"] .tuner-note, [data-state="good"] .tuner-status { color: var(--good); }
.tuner-status { font-size: 1.1rem; font-weight: 650; min-height: 1.6em; }
.tuner-detail { min-height: 1.4em; margin-bottom: 14px; }
.notice { margin: 16px auto 0; max-width: 560px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font-size: 0.93rem; }

/* ---------- Metronome ---------- */
.metro { text-align: center; display: grid; gap: 18px; }
.metro-bpm { display: flex; align-items: center; justify-content: center; gap: 18px; }
.round-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1.6rem; font-weight: 600; cursor: pointer; line-height: 1;
}
.round-btn:hover { border-color: var(--accent); }
.bpm-box { display: flex; flex-direction: column; align-items: center; }
input.bpm-input {
  width: 2.6em; text-align: center; font-size: 3.6rem; font-weight: 850; line-height: 1.1; border: 0;
  background: transparent; padding: 0; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.bpm-input::-webkit-outer-spin-button, .bpm-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bpm-unit { color: var(--muted); font-weight: 650; margin-top: -4px; }
.bpm-slider { width: min(520px, 100%); justify-self: center; }
.beat-dots { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 34px; }
.beat-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); transition: background .04s, transform .04s; }
.beat-dot.is-accent { width: 30px; height: 30px; }
.beat-dot.is-group { width: 26px; height: 26px; }
.beat-dot.is-on { background: var(--accent); border-color: var(--accent); transform: scale(1.12); }
.metro-options { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; text-align: left; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .lesson-nav, .lesson-complete, .strum-controls { display: none; }
  .card, .strum-player, .chord-card { box-shadow: none; }
}
