/* =========================================================================
   Formação no Violão — estilo editorial (papel, tinta, vermelho tijolo)
   ========================================================================= */
:root {
  --paper: #f6f4ee;
  --card: #fffdf8;
  --card-2: #f9f7f1;
  --ink: #161513;
  --ink-2: #3a3833;
  --muted: #706c63;
  --faint: #a29d91;
  --rule: #e2ded3;
  --rule-2: #d3cec1;
  --soft: #eeebe3;
  --accent: #a8332a;
  --accent-ink: #fff;
  --accent-soft: rgba(168, 51, 42, .09);
  --accent-line: rgba(168, 51, 42, .35);
  --good: #2c7a4b;
  --good-soft: rgba(44, 122, 75, .11);
  --bad: #c0392b;
  --bad-soft: rgba(192, 57, 43, .1);
  --warn: #b7791f;
  --f-T: #2f6f5e;
  --f-SD: #b7791f;
  --f-D: #a8332a;
  --fb-wood-1: #eadcc2;
  --fb-wood-2: #dfcda9;
  --fb-fret: #b9ab90;
  --fb-string: #8a7d66;
  --fb-nut: #f9f4e8;
  --fb-inlay: rgba(255, 255, 255, .7);
  --shadow: 0 1px 2px rgba(22, 21, 19, .05), 0 8px 24px -12px rgba(22, 21, 19, .14);
  --shadow-lg: 0 2px 6px rgba(22, 21, 19, .06), 0 24px 60px -20px rgba(22, 21, 19, .28);
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Instrument Sans', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --music: 'Noto Music', 'Bravura Text', 'Segoe UI Symbol', 'Apple Symbols', serif;
  --r: 14px;
  --r-sm: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121110; --card: #1a1917; --card-2: #201e1b; --ink: #eeeae1; --ink-2: #cfcabe; --muted: #9b958a; --faint: #6d685f;
    --rule: #2b2925; --rule-2: #3a3731; --soft: #24221f; --accent: #e06a58; --accent-ink: #1a0f0d; --accent-soft: rgba(224, 106, 88, .12); --accent-line: rgba(224, 106, 88, .4);
    --good: #5cbf85; --good-soft: rgba(92, 191, 133, .13); --bad: #ee7a68; --bad-soft: rgba(238, 122, 104, .13); --warn: #e0a84a;
    --f-T: #5fb79c; --f-SD: #e0a84a; --f-D: #e06a58;
    --fb-wood-1: #3b2c22; --fb-wood-2: #2d2119; --fb-fret: #8f8574; --fb-string: #c9bfae; --fb-nut: #d9d0bd; --fb-inlay: rgba(255, 255, 255, .22);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121110; --card: #1a1917; --card-2: #201e1b; --ink: #eeeae1; --ink-2: #cfcabe; --muted: #9b958a; --faint: #6d685f;
  --rule: #2b2925; --rule-2: #3a3731; --soft: #24221f; --accent: #e06a58; --accent-ink: #1a0f0d; --accent-soft: rgba(224, 106, 88, .12); --accent-line: rgba(224, 106, 88, .4);
  --good: #5cbf85; --good-soft: rgba(92, 191, 133, .13); --bad: #ee7a68; --bad-soft: rgba(238, 122, 104, .13); --warn: #e0a84a;
  --f-T: #5fb79c; --f-SD: #e0a84a; --f-D: #e06a58;
  --fb-wood-1: #3b2c22; --fb-wood-2: #2d2119; --fb-fret: #8f8574; --fb-string: #c9bfae; --fb-nut: #d9d0bd; --fb-inlay: rgba(255, 255, 255, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; line-height: 1.15; margin: 0; }
p { margin: 0 0 .7em; }
b, strong { font-weight: 600; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--card); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.chord { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; font-feature-settings: "lnum"; }
.roman { font-family: var(--serif); font-style: italic; font-weight: 600; }
.bad-t { color: var(--bad); }
.center { text-align: center; justify-content: center; }
.eyebrow { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-family: var(--serif); font-style: italic; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px 18px; border-right: 1px solid var(--rule);
  background: var(--paper); display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin;
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 4px 10px 18px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.brand-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: .02em;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.brand-txt span { font-size: 12px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.nav-title { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); padding: 10px 10px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav-link.on .nav-ic { color: var(--accent); }
.nav-ic { display: inline-flex; color: var(--muted); }
.nav-label { flex: 1; min-width: 0; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--rule-2); }
.nav-dot.some { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 35%, transparent); }
.nav-dot.full { border-color: var(--good); background: var(--good); }
.nav-foot { margin-top: auto; padding: 14px 10px 0; font-size: 11.5px; color: var(--faint); font-style: italic; font-family: var(--serif); }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 28px; justify-content: flex-end; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar-actions { display: flex; gap: 4px; background: color-mix(in srgb, var(--paper) 80%, transparent); backdrop-filter: blur(8px); border-radius: 12px; padding: 3px; }
.menu-btn, .brand-mini { display: none !important; }
.brand-mini { align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 16px; }
.brand-mini .brand-mark { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.main { outline: none; padding: 0 44px 80px; max-width: 1120px; width: 100%; margin: 0 auto; }
.scrim { display: none; }

/* ---------- Página ---------- */
.page { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { padding: 6px 0 18px; max-width: 760px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 8px 0 10px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 680px; }
.section-title { font-size: 21px; margin: 30px 0 14px; }
.section-title.big { font-size: 28px; margin-top: 46px; }

.theory { border: 1px solid var(--rule); border-radius: var(--r); background: var(--card-2); margin-bottom: 22px; }
.theory summary { list-style: none; cursor: pointer; display: flex; gap: 9px; align-items: center; padding: 12px 18px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.theory summary::-webkit-details-marker { display: none; }
.theory summary .chev { margin-left: auto; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.theory[open] summary .chev { transform: rotate(-135deg); }
.theory-body { padding: 0 18px 14px 43px; color: var(--ink-2); font-size: 15px; }
.theory-body p:last-child { margin-bottom: 0; }
table.mini { border-collapse: collapse; margin: 4px 0 12px; font-size: 13px; display: block; overflow-x: auto; }
table.mini th, table.mini td { padding: 5px 9px; border: 1px solid var(--rule); text-align: center; white-space: nowrap; }
table.mini th { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted); text-align: left; background: var(--soft); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; text-decoration: none; padding: 10px 14px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; flex-direction: column; gap: 6px; min-width: 150px; color: var(--muted); }
.tab span:first-child { font-weight: 600; font-size: 14.5px; }
.tab:hover { color: var(--ink); }
.tab.on { border-bottom-color: var(--accent); color: var(--ink); }

.mbar { display: flex; align-items: center; gap: 8px; }
.mbar-track { flex: 1; height: 4px; background: var(--soft); border-radius: 4px; overflow: hidden; min-width: 40px; }
.mbar-fill { height: 100%; background: var(--warn); border-radius: 4px; transition: width .4s; }
.mbar.done .mbar-fill { background: var(--good); }
.mbar-txt { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.mbar.done .mbar-txt { color: var(--good); }

/* ---------- Controles ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; background: var(--soft); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink-2); transition: background .15s, color .15s; }
.seg-sm .seg-btn { padding: 5px 11px; font-size: 13px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--rule); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule-2); background: transparent; border-radius: 99px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--muted); transition: all .15s; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.select { appearance: none; border: 1px solid var(--rule-2); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center; border-radius: 9px; padding: 7px 32px 7px 12px; font-size: 14px; cursor: pointer; min-width: 120px; }
.range { accent-color: var(--accent); width: 180px; }
.range-wrap { display: flex; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.icon-only { padding: 8px; }
.btn.round { border-radius: 99px; }
.btn.big { padding: 13px 26px; font-size: 16px; }
.btn.danger { color: var(--bad); }
.btn .ic { display: inline-flex; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; font-size: inherit; }

/* ---------- Quiz ---------- */
.quiz-bar { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.quiz-progress { flex: 1; height: 3px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.quiz-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.quiz-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.qs { display: inline-flex; gap: 5px; align-items: center; font-family: var(--mono); }
.qs b { color: var(--ink); font-weight: 600; }
.qs.hot, .qs.hot b { color: var(--accent); }
.quiz-card { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 30px 26px; min-height: 280px; }
.q-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 16px; margin-bottom: 18px; }
.q-prompt { font-family: var(--serif); font-size: clamp(21px, 2.6vw, 27px); font-weight: 500; line-height: 1.25; flex: 1 1 420px; letter-spacing: -.01em; }
.q-prompt .hl { font-weight: 650; color: var(--accent); }
.q-sub { order: 3; flex-basis: 100%; color: var(--muted); font-size: 14.5px; }
.play-btn { order: 2; }
.q-visual { display: flex; justify-content: safe center; margin: 4px 0 18px; overflow-x: auto; }
@media (max-width: 640px) { .q-visual .fretboard, .q-area .fretboard { min-width: 560px; } }
.q-area.locked .opt, .q-area.locked .pk { cursor: default; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.options.cols-2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.options.cols-4 { grid-template-columns: repeat(4, 1fr); }
.options.cols-5 { grid-template-columns: repeat(5, 1fr); }
.options.cols-6 { grid-template-columns: repeat(6, 1fr); }
.options.cols-7 { grid-template-columns: repeat(7, 1fr); }
.opt {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 14px 10px; min-height: 58px;
  border: 1px solid var(--rule-2); background: var(--card); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, transform .08s, box-shadow .15s; text-align: center;
}
.opt:hover:not(:disabled) { border-color: var(--ink-2); box-shadow: var(--shadow); }
.opt:active { transform: translateY(1px); }
.opt kbd { position: absolute; top: 6px; left: 7px; font-size: 9.5px; padding: 0 4px; opacity: .7; border-bottom-width: 1px; }
.opt-label { font-size: 16.5px; font-weight: 600; line-height: 1.2; }
.opt-sub { font-size: 12px; color: var(--muted); }
.opt.right { border-color: var(--good); background: var(--good-soft); box-shadow: 0 0 0 1px var(--good) inset; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 0 0 1px var(--bad) inset; animation: shake .3s; }
.opt.off, .opt:disabled { opacity: .35; cursor: not-allowed; }
.options.locked .opt:not(.right):not(.wrong) { opacity: .5; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.q-feedback { display: none; }
.q-feedback.show { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; margin-top: 20px; padding: 16px 18px; border-radius: 14px; animation: rise .25s ease both; }
.q-feedback.ok { background: var(--good-soft); }
.q-feedback.bad { background: var(--bad-soft); }
.fb-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.q-feedback.ok .fb-mark { background: var(--good); }
.q-feedback.bad .fb-mark { background: var(--bad); }
.fb-title { font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.fb-title span { font-weight: 400; }
.fb-explain { color: var(--ink-2); font-size: 14.5px; }
.fb-note { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); padding-left: 10px; border-left: 2px solid var(--rule-2); }
.fb-actions { align-self: center; }

.summary { text-align: center; padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.summary h3 { font-size: 24px; max-width: 520px; }
.summary p { max-width: 520px; }
.summary-ring {
  --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--soft) 0);
}
.summary-ring > div { width: 112px; height: 112px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.summary-ring b { font-family: var(--serif); font-size: 32px; }
.summary-ring span { font-size: 12px; color: var(--muted); }
.misses { width: 100%; max-width: 520px; text-align: left; margin: 6px 0 10px; }
.miss { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: 14px; }
.miss .hl { color: var(--ink); }

/* ---------- Seletor de notas ---------- */
.picker { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 620px; margin: 0 auto; }
.picker-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pk { border: 1px solid var(--rule); background: var(--card-2); border-radius: 10px; padding: 8px 0; cursor: pointer; font-size: 15px; color: var(--ink-2); transition: all .12s; }
.picker-row.nat .pk { background: var(--card); border-color: var(--rule-2); padding: 12px 0; font-weight: 600; font-size: 17px; color: var(--ink); }
.pk:hover { border-color: var(--ink-2); color: var(--ink); }
.pk.right { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.pk.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.tray { display: flex; flex-direction: column; gap: 14px; }
.tray-slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 4px; }
.slot {
  min-width: 56px; height: 52px; padding: 0 8px; display: grid; place-items: center; border: 1.5px dashed var(--rule-2); border-radius: 11px; font-family: var(--mono); font-size: 12px; color: var(--faint);
}
.slot.filled { border-style: solid; border-color: var(--ink-2); font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); background: var(--card); }
.slot.cur { border-color: var(--accent); color: var(--accent); }
.slot.right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.slot.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.tray-actions { display: flex; justify-content: center; gap: 8px; }
.tray.locked .pk { pointer-events: none; opacity: .55; }

/* ---------- Braço ---------- */
.fretboard { width: 100%; max-width: 1000px; height: auto; display: block; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.q-visual .fretboard, .q-area .fretboard { min-width: 640px; }
.q-area { overflow-x: auto; }
.fb-fret { stroke: var(--fb-fret); stroke-width: 2.2; }
.fb-nut { fill: var(--fb-nut); stroke: var(--fb-fret); stroke-width: .6; }
.fb-string { stroke: var(--fb-string); }
.fb-string.dim { opacity: .22; }
.fb-inlay { fill: var(--fb-inlay); }
.fb-num { font-family: var(--mono); font-size: 11px; fill: var(--faint); text-anchor: middle; }
.fb-num.strong { fill: var(--muted); font-weight: 600; }
.fb-sname { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.fb-shade { fill: var(--accent); opacity: .08; pointer-events: none; }
.fb-hit { fill: transparent; }
.fretboard.interactive .fb-hit { cursor: pointer; }
.fretboard.interactive .fb-hit:hover { fill: var(--accent); fill-opacity: .14; }
.fb-mark { pointer-events: none; }
.fb-mark circle { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.fb-mark text { fill: var(--paper); font-family: var(--sans); font-weight: 700; font-size: 12.5px; text-anchor: middle; }
.fb-mark text.small { font-size: 10.5px; }
.fb-mark.root circle { fill: var(--accent); }
.fb-mark.root text { fill: #fff; }
.fb-mark.tone circle { fill: var(--card); stroke: var(--ink-2); stroke-width: 1.6; }
.fb-mark.tone text { fill: var(--ink); }
.fb-mark.guide circle { fill: var(--f-T); stroke: var(--card); }
.fb-mark.guide text { fill: #fff; }
.fb-mark.ask circle { fill: var(--accent); }
.fb-mark.ask text { fill: #fff; font-size: 14px; }
.fb-mark.good circle { fill: var(--good); }
.fb-mark.good text { fill: #fff; }
.fb-mark.bad circle { fill: var(--bad); }
.fb-mark.bad text { fill: #fff; }
.fb-mark.missed circle { fill: transparent; stroke: var(--good); stroke-width: 2.2; stroke-dasharray: 4 3; }
.fb-mark.missed text { fill: var(--good); }
.fb-mark.pulse circle { animation: pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fb-mark.flash { animation: fade .65s forwards; }
@keyframes pulse { 50% { transform: scale(1.14); } }
@keyframes fade { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.find-counter { font-size: 14px; color: var(--muted); }
.find-counter b { color: var(--ink); font-size: 16px; }

/* ---------- Pauta ---------- */
.staff { width: 100%; height: auto; display: block; }
.st-line, .st-ledger { stroke: var(--ink-2); stroke-width: 1.1; }
.st-clef { font-family: var(--music); fill: var(--ink); }
.st-head { fill: var(--ink); }
.st-stem { stroke: var(--ink); stroke-width: 1.4; }
.st-acc { font-family: var(--music), var(--serif); font-size: 27px; fill: var(--ink); text-anchor: middle; }
.st-label { font-family: var(--mono); font-size: 11px; fill: var(--muted); text-anchor: middle; }
.st-note.done .st-head, .st-note.done .st-stem { fill: var(--good); stroke: var(--good); }
.st-note.done .st-acc { fill: var(--good); }
.st-note.cur .st-head { fill: var(--accent); }
.st-note.cur .st-stem { stroke: var(--accent); }
.st-note.cur .st-acc { fill: var(--accent); }

/* ---------- Ciclo de quintas ---------- */
.split { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 34px; align-items: start; }
.circle5 { width: 100%; height: auto; }
.c5-seg { cursor: pointer; outline: none; }
.c5-maj { fill: var(--card); stroke: var(--rule-2); stroke-width: 1; transition: fill .15s; }
.c5-min { fill: var(--card-2); stroke: var(--rule-2); stroke-width: 1; transition: fill .15s; }
.c5-seg:hover .c5-maj, .c5-seg:focus-visible .c5-maj { fill: var(--soft); }
.c5-seg.on .c5-maj { fill: var(--accent); }
.c5-seg.on .c5-min { fill: var(--accent-soft); }
.c5-t-maj { font-family: var(--serif); font-weight: 600; font-size: 20px; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.c5-seg.on .c5-t-maj { fill: #fff; }
.c5-t-min { font-family: var(--serif); font-size: 14px; text-anchor: middle; fill: var(--ink-2); pointer-events: none; }
.c5-t-sig { font-family: var(--mono); font-size: 11px; text-anchor: middle; fill: var(--muted); pointer-events: none; }
.c5-core { fill: var(--paper); }
.c5-core-t { font-family: var(--serif); font-style: italic; font-size: 16px; text-anchor: middle; fill: var(--muted); }
.big-key { font-size: 30px; margin: 6px 0 10px; }
.big-key .muted { font-size: 18px; font-weight: 400; }
.field-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 10px 0 16px; }
.fchord { border: 1px solid var(--rule); border-top: 3px solid var(--rule-2); border-radius: 10px; background: var(--card); padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s, box-shadow .15s; }
.fchord:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.fchord.f-T { border-top-color: var(--f-T); }
.fchord.f-SD { border-top-color: var(--f-SD); }
.fchord.f-D { border-top-color: var(--f-D); }
.fc-roman { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 13px; }
.fc-name { font-family: var(--serif); font-weight: 600; font-size: 15px; }
.fc-func { font-family: var(--mono); font-size: 10px; color: var(--faint); }

/* ---------- Tabelas ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
table.data th { text-align: left; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 400; padding: 11px 14px; border-bottom: 1px solid var(--rule); background: var(--card-2); }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--rule); }
table.data tr:last-child td { border-bottom: 0; }
table.data .linkish.chord { font-size: 16px; text-decoration: none; color: var(--ink); }
table.data .linkish.chord:hover { color: var(--accent); }
.tag { display: inline-block; font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: var(--soft); color: var(--ink-2); font-weight: 600; letter-spacing: .04em; }
.tag.f-T { background: color-mix(in srgb, var(--f-T) 16%, transparent); color: var(--f-T); }
.tag.f-SD { background: color-mix(in srgb, var(--f-SD) 18%, transparent); color: var(--f-SD); }
.tag.f-D { background: color-mix(in srgb, var(--f-D) 15%, transparent); color: var(--f-D); }
.tag.accent { background: var(--accent); color: var(--accent-ink); margin-left: 8px; vertical-align: 2px; }
.tables { display: grid; grid-template-columns: 1fr; gap: 10px; overflow-x: auto; }

/* ---------- Análise ---------- */
.prog-lane { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.prog-cell { flex: 1 1 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--card-2); cursor: pointer; transition: all .15s; }
.prog-cell.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.prog-cell.right { border-color: var(--good); background: var(--good-soft); }
.prog-cell.wrong { border-color: var(--bad); background: var(--bad-soft); }
.pc-name { font-size: 22px; }
.pc-label { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); }
.prog-chooser .eyebrow { margin-bottom: 10px; }
.prog-chooser .eyebrow b { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.prog-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.prog-note { font-size: 14px; padding: 8px 12px; border-radius: 10px; background: var(--card-2); border-left: 3px solid var(--good); }
.prog-note.bad { border-left-color: var(--bad); }

/* ---------- Ritmo ---------- */
.rhythm-wrap { position: relative; overflow-x: auto; margin-bottom: 12px; }
.rhythm { width: 100%; min-width: 620px; height: auto; display: block; }
.rh-line { stroke: var(--ink-2); stroke-width: 1.2; }
.rh-bar { stroke: var(--ink-2); stroke-width: 1.4; }
.rh-bar.end { stroke-width: 3; }
.rh-ts { font-family: var(--serif); font-weight: 700; font-size: 24px; text-anchor: middle; fill: var(--ink); }
.rh-beat { fill: transparent; transition: fill .08s; }
.rh-beat.on { fill: var(--accent-soft); }
.rh-count { font-family: var(--mono); font-size: 11px; fill: var(--faint); }
.rh-head { fill: var(--ink); }
.rh-head.open { fill: var(--card); stroke: var(--ink); stroke-width: 1.8; }
.rh-stem { stroke: var(--ink); stroke-width: 1.6; }
.rh-beam { stroke: var(--ink); stroke-width: 5; stroke-linecap: butt; }
.rh-flag { stroke: var(--ink); stroke-width: 2; fill: none; }
.rh-dot, .rh-rest-dot { fill: var(--ink); }
.rh-rest { font-family: var(--music); fill: var(--ink); text-anchor: middle; }
.rh-tri { font-family: var(--serif); font-style: italic; font-size: 14px; text-anchor: middle; fill: var(--ink-2); }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 64px; font-weight: 700; color: var(--accent); opacity: 0; pointer-events: none; transition: opacity .1s; }
.countdown.show { opacity: .9; }
.tap-pad {
  width: 100%; margin-top: 14px; min-height: 120px; border-radius: 16px; border: 1.5px dashed var(--rule-2); background: var(--card-2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tap-pad span { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.tap-pad small { color: var(--muted); }
.tap-pad.hit { animation: tap .18s ease; }
@keyframes tap { 0% { background: var(--accent-soft); border-color: var(--accent); transform: scale(.995); } 100% { background: var(--card-2); } }
.tap-result { margin-top: 14px; }
.timeline { width: 100%; height: auto; display: block; }
.tl-bar { stroke: var(--ink-2); stroke-width: 1.4; }
.tl-beat { stroke: var(--rule-2); stroke-width: 1; }
.tl-exp { fill: var(--ink); }
.tl-miss { fill: none; stroke: var(--bad); stroke-width: 2; }
.tl-hit { fill: var(--good); }
.tl-extra { fill: var(--bad); }
.tl-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.lg::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lg.exp::before { background: var(--ink); }
.lg.hit::before { background: var(--good); border-radius: 2px; }
.lg.miss::before { border: 2px solid var(--bad); width: 7px; height: 7px; }
.lg.extra::before { background: var(--bad); border-radius: 2px; }
.figs { display: flex; align-items: center; gap: 12px; }
.fig { width: 46px; height: 74px; }
.figs .eq { font-family: var(--serif); font-size: 28px; color: var(--muted); }

/* ---------- Metrônomo / afinador ---------- */
.metro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; align-items: start; }
.metro-main { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; box-shadow: var(--shadow); padding: 30px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.metro-bpm { font-family: var(--serif); font-size: 84px; font-weight: 600; line-height: 1; min-width: 170px; text-align: center; font-feature-settings: "tnum", "lnum"; }
.metro-unit { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: -10px; }
.metro-main .range { width: 100%; max-width: 380px; }
.metro-dots { display: flex; gap: 12px; }
.mdot { width: 16px; height: 16px; border-radius: 50%; background: var(--soft); border: 1px solid var(--rule-2); transition: background .06s, transform .06s; }
.mdot.first { width: 20px; height: 20px; }
.mdot.on { background: var(--ink); transform: scale(1.15); }
.mdot.first.on { background: var(--accent); border-color: var(--accent); }
.metro-side { display: flex; flex-direction: column; gap: 18px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.callout .ic { color: var(--accent); margin-top: 2px; }
.callout.soft { background: var(--card-2); border: 1px solid var(--rule); }
.tuner { max-width: 560px; margin: 0 auto; background: var(--card); border: 1px solid var(--rule); border-radius: 20px; box-shadow: var(--shadow); padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tuner-note { font-family: var(--serif); font-size: 76px; font-weight: 600; line-height: 1; }
.tuner-cents { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tuner-strip { position: relative; width: 100%; height: 44px; border-radius: 10px; background: linear-gradient(90deg, var(--bad-soft), var(--soft) 40%, var(--good-soft) 50%, var(--soft) 60%, var(--bad-soft)); }
.tuner-center { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; background: var(--ink-2); }
.tuner-needle { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--accent); transition: left .12s ease-out; }
.tuner-strip.ok .tuner-needle { background: var(--good); }
.mic-status { font-size: 13.5px; color: var(--muted); }
.mic-status.on { color: var(--good); }
.mic-status.err { color: var(--bad); }

/* ---------- Visualizador ---------- */
.viewer-board { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 18px 14px 10px; box-shadow: var(--shadow); overflow-x: auto; }
.viewer-board .fretboard { min-width: 700px; }
.viewer-info { margin-top: 20px; }
.viewer-title { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.viewer-title h3 { font-size: 26px; }
.viewer-notes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vn { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); }
.vn b { font-family: var(--serif); font-size: 19px; }
.vn span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.vn.root { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Rotinas ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; max-width: 560px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 10px; background: var(--card-2); border: 1px solid var(--rule); }
.wk span { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; }
.wk b { font-family: var(--serif); font-size: 19px; }
.wk.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.wk.on span { color: var(--paper); opacity: .7; }
.routines { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.routine { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 18px 18px 12px; box-shadow: var(--shadow); }
.routine.today { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.routine-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.routine-head > div:nth-child(2) { flex: 1; }
.routine-id { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-family: var(--serif); font-size: 21px; font-weight: 700; background: var(--soft); flex: none; }
.routine-id.inline { display: inline-grid; width: 34px; height: 34px; font-size: 18px; margin-right: 10px; vertical-align: 3px; background: var(--accent); color: var(--accent-ink); }
.routine.today .routine-id { background: var(--accent); color: var(--accent-ink); }
.routine-name { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.routine-blocks { list-style: none; padding: 0; margin: 0; }
.routine-blocks li { display: grid; grid-template-columns: 30px 1fr auto; grid-template-areas: "min ex link" "min goal link"; column-gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.rb-min { grid-area: min; font-family: var(--mono); color: var(--accent); font-size: 13px; padding-top: 1px; }
.rb-ex { grid-area: ex; }
.rb-goal { grid-area: goal; font-size: 12px; color: var(--muted); }
.rb-base { color: var(--accent); }
.routine-blocks .linkish, .rb-guitar { grid-area: link; align-self: center; font-size: 12.5px; }
.rb-guitar { font-family: var(--mono); color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.dock {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(720px, calc(100% - 24px));
  display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); animation: rise .3s ease;
}
.dock .btn.ghost { color: var(--paper); }
.dock .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .dock .btn.ghost:hover { background: rgba(0, 0, 0, .1); }
.dock-ring { --p: 0; width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), rgba(127, 127, 127, .3) 0); }
.dock-time { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600; }
.dock.paused .dock-time { opacity: .55; }
.dock-body { flex: 1; min-width: 0; }
.dock-meta { font-size: 11.5px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.dock-actions { display: flex; gap: 2px; flex: none; }
body.has-dock .main { padding-bottom: 140px; }

/* ---------- Início ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 34px; align-items: end; padding: 8px 0 30px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); margin: 12px 0 14px; letter-spacing: -.02em; }
.hero h1 em { font-weight: 400; color: var(--accent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px; }
.stat-label { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; margin-top: 4px; font-feature-settings: "lnum", "tnum"; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 20px 20px 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 24px; margin: 10px 0 4px; }
.today-card { background: linear-gradient(160deg, var(--card), var(--card-2)); }
.mini-blocks { list-style: none; margin: 10px 0 16px; padding: 0; font-size: 14px; }
.mini-blocks li { display: flex; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--rule); }
.mini-blocks li span { font-family: var(--mono); font-size: 12px; color: var(--accent); width: 22px; flex: none; padding-top: 1px; }
.pillars { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.pillar-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.pillar-top span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pillar .mbar-fill { background: var(--accent); }
.pillar .muted { margin-top: 3px; font-size: 12px; }
.heat { display: grid; grid-template-columns: repeat(21, 1fr); gap: 3px; margin-top: 8px; }
.heat-cell { aspect-ratio: 1; border-radius: 3px; background: var(--soft); }
.heat-cell.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--soft)); }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent) 62%, var(--soft)); }
.heat-cell.l3 { background: var(--accent); }
.weak { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.weak-item { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.weak-item:hover { background: var(--soft); }
.weak-item b { font-family: var(--mono); font-size: 13px; color: var(--warn); }
.weak-item b.bad-t { color: var(--bad); }
.mod-section { margin-bottom: 22px; }
.mod-group-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.mod-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 16px 18px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.mod-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--rule-2); }
.mod-top { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.mod-top .eyebrow { font-size: 10px; }
.mod-card h3 { font-size: 19px; }
.mod-card p { font-size: 13.5px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-bars { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.mod-bar { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }

/* ---------- Modal e toasts ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 9, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border-radius: 20px; padding: 22px 24px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 18px; animation: rise .25s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 26px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: rise .25s ease; transition: opacity .4s, transform .4s; }
.toast.ok { background: var(--good); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
  .today-card { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; z-index: 80; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); background: var(--paper); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(10, 10, 9, .4); }
  .topbar { justify-content: space-between; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); padding: 8px 12px; pointer-events: auto; }
  .topbar-actions { background: none; backdrop-filter: none; }
  .menu-btn { display: inline-flex !important; }
  .brand-mini { display: inline-flex !important; margin-right: auto; }
  .main { padding: 18px 16px 70px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .split, .metro { grid-template-columns: 1fr; }
  .quiz-card { padding: 20px 16px 18px; border-radius: 16px; }
  .q-feedback.show { grid-template-columns: auto 1fr; }
  .fb-actions { grid-column: 1 / -1; justify-self: stretch; }
  .fb-actions .btn { width: 100%; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .home-grid { grid-template-columns: 1fr; }
  .options.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .options.cols-5, .options.cols-6 { grid-template-columns: repeat(3, 1fr); }
  .options.cols-7 { grid-template-columns: repeat(4, 1fr); }
  .options { grid-template-columns: repeat(2, 1fr); }
  .options.cols-2 { grid-template-columns: 1fr; }
  .opt { padding: 12px 6px; min-height: 52px; }
  .opt kbd { display: none; }
  .field-grid { grid-template-columns: repeat(4, 1fr); }
  .routines { grid-template-columns: 1fr; }
  .stat-value { font-size: 28px; }
  .tab { min-width: 130px; padding: 8px 10px 10px; }
  .controls { gap: 12px; }
  .seg { max-width: 100%; }
  .quiz-stats { gap: 10px; }
  .mod-bar { grid-template-columns: 110px 1fr; }
  .dock { flex-wrap: wrap; bottom: 10px; }
  .dock-actions { width: 100%; justify-content: flex-end; }
  .metro-bpm { font-size: 64px; min-width: 120px; }
  .range { width: 140px; }
  .picker-row.nat .pk { font-size: 15px; padding: 10px 0; }
  .slot { min-width: 44px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
