/* Free tools: the shell every tool sits in, the hub, the written page under each tool. Uses the site's tokens. */

/* ---- page frame */
.tool-page, .tools-page { gap: var(--sp-5); }
.crumbs { display: flex; gap: var(--sp-2); align-items: center; }
.crumbs a { color: var(--ink-2); }
.tools-hub h1, .tool-name { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.02em; margin: 0; }
.tools-hub .lead { color: var(--ink-2); max-width: 60ch; margin: 0 0 var(--sp-4); }
.tools-hub h2 { font-size: var(--fs-lg); margin: var(--sp-6) 0 var(--sp-3); display: flex; gap: var(--sp-3); align-items: baseline; flex-wrap: wrap; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); }
.tool-card { flex-direction: row; align-items: flex-start; gap: var(--sp-3); color: inherit; text-decoration: none; padding: var(--sp-4); }
.tool-card:hover { background: var(--card-2); }
.tool-card .tool-ic { flex: none; }

/* ---- shell */
.tool-shell { display: flex; flex-direction: column; gap: var(--sp-4); min-height: 420px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.tool-head-actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.tool-body { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); align-items: start; }
.tool-main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.tool-stage { display: flex; flex-direction: column; gap: var(--sp-4); }
.tool-adv { display: none; background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: var(--sp-4); flex-direction: column; gap: var(--sp-4); }
.tool-adv-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.tool-adv-section { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.tool-adv-section:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 900px) {
  .tool-shell.advanced .tool-body { grid-template-columns: minmax(0, 1fr) 320px; }
  .tool-shell.advanced .tool-adv { display: flex; position: sticky; top: var(--sp-4); }
}
.stage-bar { display: none; }

/* controls: every number can be dragged and typed */
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; }
.ctl-num { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.ctl-num .ctl-label { grid-column: 1 / -1; }
.ctl-num input[type=range] { width: 100%; min-width: 0; accent-color: var(--accent); }
.ctl-val { display: inline-flex; align-items: center; gap: 4px; }
.num-exact { width: 5.5ch; min-height: 32px; padding: 0 6px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card-2); color: var(--ink); }
.ctl-val .unit { font-size: var(--fs-xs); color: var(--ink-3); }
.ctl-toggle { flex-direction: row; align-items: center; gap: 10px; }
.ctl-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.ctl-toggle .ctl-label { color: var(--ink); font-weight: 500; }
.ctl-toggle .ctl-label .small { color: var(--ink-3); }
.ctl select { min-height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card-2); color: var(--ink); padding: 0 10px; }
.ctl input[type=text] { min-height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card-2); color: var(--ink); padding: 0 10px; }
.chip.on:disabled, .chip:disabled { opacity: .45; cursor: default; }
kbd { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 4px 7px; color: var(--ink); }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border-radius: var(--r-md); font-weight: 600; text-align: left; background: none; color: var(--ink); }
.menu-item:hover { background: var(--card-2); }

/* analysis strip (hidden until the mic features ship) */
.analysis-strip { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 12px; border-radius: var(--r-md); background: var(--card-2); }
.analysis-strip[hidden] { display: none; }
.analysis-strip .meter { flex: 1; height: 6px; background: var(--card-3); border-radius: 3px; overflow: hidden; }
.analysis-strip .meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
.analysis-pitch { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4ch; }

/* stage mode: full screen, big, nothing else */
.tool-shell.stage { position: fixed; inset: 0; z-index: 900; background: var(--bg); padding: calc(var(--sp-4) + var(--safe-t)) var(--sp-4) calc(var(--sp-4) + var(--safe-b)); overflow: auto; font-size: 1.2rem; }
.tool-shell.stage .tool-head, .tool-shell.stage .tool-adv { display: none; }
.tool-shell.stage .tool-body { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; width: 100%; flex: 1; align-content: center; }
.tool-shell.stage .stage-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 700; max-width: 900px; margin: 0 auto; width: 100%; }
body.tool-stage-on .nav, body.tool-stage-on .wa-float { display: none !important; }

/* display preferences */
body.large .tool-shell { font-size: 1.18rem; }
body.large .tool-shell .chip { min-height: 44px; font-size: 1em; }
body.large .tool-shell .btn { font-size: 1.05em; }
body.large .tool-shell .small { font-size: .95em; }
body.cb { --green: #0072B2; --green-soft: rgba(0,114,178,.16); --red: #E69F00; --red-soft: rgba(230,159,0,.18); --accent: #D55E00; }
.tool-ic.lg { width: 72px; height: 72px; border-radius: 20px; }
.tool-ic.ok { background: var(--green-soft); color: var(--green); }
.tool-ic.no { background: var(--red-soft); color: var(--red); }

/* ---- fretboard picture */
.fretboard { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.fb-wood { fill: var(--card-3); }
.fb-fret { stroke: var(--ink-3); stroke-width: 1.5; }
.fb-nut { stroke: var(--ink); stroke-width: 4; }
.fb-string { stroke: var(--ink-2); }
.fb-inlay { fill: var(--ink-3); opacity: .5; }
.fb-dot { fill: var(--accent); }
.fb-dot.root { fill: var(--ink); }
.fb-label { font: 700 9px Inter, system-ui, sans-serif; fill: var(--bg); }
.fb-x { font: 700 14px Inter, system-ui, sans-serif; fill: var(--ink-3); }
.fb-num { font: 600 10px Inter, system-ui, sans-serif; fill: var(--ink-3); }

/* ---- ear trainer */
.ear { display: flex; flex-direction: column; gap: var(--sp-4); }
.ear-stage { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: var(--sp-6); min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); text-align: center; }
.ear-stage h2 { margin: 0; }
.ear-big { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ear-answers { justify-content: center; gap: var(--sp-2); min-height: 38px; }
.ear-answers .chips { justify-content: center; width: 100%; }
.ear-answers p { width: 100%; text-align: center; margin: 0; }
.ear-reveal { display: flex; flex-direction: column; gap: var(--sp-2); }
.ear-list div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.row.center { justify-content: center; }
@media (min-width: 900px) { .ear-stage { min-height: 300px; } }

/* ---- the written page */
.tool-article { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 72ch; }
.tool-article h2 { font-size: var(--fs-lg); margin: var(--sp-4) 0 0; }
.tool-article p { margin: 0; color: var(--ink-2); line-height: 1.65; }
.tool-article-text { display: flex; flex-direction: column; gap: var(--sp-3); }
.tool-steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--sp-2); color: var(--ink-2); line-height: 1.55; }
.tool-faq details { border-bottom: 1px solid var(--line-2); padding: var(--sp-3) 0; }
.tool-faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--sp-3); }
.tool-faq summary::-webkit-details-marker { display: none; }
.tool-faq summary::after { content: '+'; color: var(--ink-3); font-weight: 700; }
.tool-faq details[open] summary::after { content: '−'; }
.tool-faq details p { margin-top: var(--sp-2); }
.tool-cta { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-3); }
.tool-cta .btn { flex: none; }
@media (min-width: 1120px) {
  .tool-article { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: var(--sp-8); }
  .tool-article > * { grid-column: 1; }
  .tool-article .tool-cta { grid-column: 2; grid-row: 1 / span 3; align-self: start; flex-direction: column; align-items: flex-start; position: sticky; top: var(--sp-4); margin-top: 0; }
}

.ctl[hidden], .tool-shell [hidden] { display: none !important; }
.tool-adv-section .tool-adv-section { padding-top: var(--sp-2); }

/* ---- tuner */
.tuner { display: flex; flex-direction: column; gap: var(--sp-4); }
.tuner-stage { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: var(--sp-5) var(--sp-4) var(--sp-4); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); position: relative; }
.tuner-dial { width: 100%; max-width: 420px; height: auto; display: block; }
.td-track { fill: none; stroke: var(--card-3); stroke-width: 14; stroke-linecap: round; }
.td-zone { fill: none; stroke: var(--green); stroke-width: 14; opacity: .35; }
.td-tick { stroke: var(--ink-3); stroke-width: 1.5; }
.td-tick.zero { stroke: var(--ink); stroke-width: 3; }
.td-num { font: 600 11px Inter, system-ui, sans-serif; fill: var(--ink-3); }
.td-needle { transform-origin: 150px 150px; transition: transform .09s linear; }
.td-needle line { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.td-needle circle { fill: var(--accent); }
.tuner-stage.in-tune .td-needle line, .tuner-stage.in-tune .td-needle circle { stroke: var(--green); fill: var(--green); }
.tuner-stage.in-tune .td-zone { opacity: .8; }
.td-needle.idle { opacity: .35; }
.tuner-readout { margin-top: -6px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 120px; }
.tuner-note { font-size: 72px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tuner-oct { font-size: 22px; font-weight: 700; color: var(--ink-3); align-self: flex-end; margin-bottom: 8px; }
.tuner-cents { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 26px; }
.tuner-stage.flat .tuner-cents, .tuner-stage.sharp .tuner-cents { color: var(--accent); }
.tuner-stage.in-tune .tuner-cents { color: var(--green); }
.tuner-hint { font-size: var(--fs-sm); color: var(--ink-2); text-align: center; min-height: 20px; }
.tuner-hint.ok { color: var(--green); font-weight: 700; }
.tuner-hint.ok::before { content: '✓ '; }
.tuner-hint.err { color: var(--red); }
.tuner-strings { display: flex; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; }
.tuner-string { width: 54px; height: 62px; border-radius: var(--r-md); background: var(--card-2); border: 2px solid transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: 20px; }
.tuner-string small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.tuner-string.on { border-color: var(--accent); }
.tuner-string.locked { background: var(--accent); color: var(--on-accent, #141210); }
.tuner-string.locked small { color: inherit; opacity: .7; }
.tuner-start { min-width: 220px; }
.tuner-quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); align-items: end; }
body.lefty .tuner-strings { flex-direction: row-reverse; }
@media (max-width: 420px) { .tuner-string { width: 46px; height: 56px; } .tuner-note { font-size: 60px; } .tuner-quick { grid-template-columns: 1fr; } }

/* ---- metronome */
.metro { display: flex; flex-direction: column; gap: var(--sp-4); }
.metro-top { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.metro-step { width: 56px; height: 56px; border-radius: 50%; font-size: 28px; font-weight: 600; background: var(--card-2); color: var(--ink); border: 1px solid var(--edge); }
.metro-step:hover { background: var(--card-3); }
.metro-dial { position: relative; width: 220px; height: 220px; border-radius: 50%; background: var(--card); border: 1px solid var(--edge); display: grid; place-items: center; }
.metro-dial-in { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.metro-bpm { font-size: 72px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.metro-unit { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); }
.metro-name { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.metro-pulse { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; }
.metro-pulse.go { animation: metro-pulse .32s ease-out; }
.metro-pulse.go.accent { border-width: 6px; animation-duration: .4s; }
.metro-pulse.go.muted { border-color: var(--ink-3); border-style: dashed; }
@keyframes metro-pulse { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
.metro-beats { display: flex; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; }
.metro-beat { width: 44px; height: 54px; border-radius: var(--r-md); background: var(--card-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.metro-beat i { width: 14px; height: 14px; border-radius: 50%; background: var(--ink-3); transition: transform .06s; }
.metro-beat.accent i { width: 20px; height: 20px; background: var(--accent); }
.metro-beat.mute i { background: transparent; border: 2px dashed var(--ink-3); }
.metro-beat.on { background: var(--card-3); color: var(--ink); }
.metro-beat.on i { transform: scale(1.25); }
.metro-tap.hit { background: var(--card-3); }
.metro-start { min-width: 180px; }
.metro-time { font-variant-numeric: tabular-nums; }
.metro-status { text-align: center; }
.metro-quick { display: flex; flex-direction: column; gap: var(--sp-3); }
.tool-shell.stage .metro-dial { width: min(70vw, 360px); height: min(70vw, 360px); }
.tool-shell.stage .metro-bpm { font-size: clamp(72px, 14vw, 120px); }
@media (max-width: 420px) { .metro-dial { width: 190px; height: 190px; } .metro-bpm { font-size: 62px; } .metro-step { width: 48px; height: 48px; } }

/* ---- randomizer */
.rnd { display: flex; flex-direction: column; gap: var(--sp-3); }
.rnd-card { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: var(--sp-5) var(--sp-4); min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); text-align: center; transition: box-shadow .2s; }
.rnd-card.flash { box-shadow: 0 0 0 3px var(--green) inset; }
.rnd-card .col.center { align-items: center; }
.rnd-item { display: flex; justify-content: center; width: 100%; }
.rnd-big { font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.rnd-big.md { font-size: 56px; }
.rnd-board { width: 100%; max-width: 520px; overflow-x: auto; }
.rnd-board svg { width: 100%; height: auto; }
.rnd-strum { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; font-size: 34px; font-weight: 800; width: 100%; max-width: 420px; }
.rnd-strum span { padding: 6px 0; border-radius: var(--r-sm); background: var(--card-2); }
.rnd-strum .down, .rnd-strum .up { color: var(--accent); }
.rnd-strum .rest { color: var(--ink-3); }
.rnd-count-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; width: 100%; max-width: 420px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.rnd-heard { min-height: 20px; color: var(--ink-2); }
.rnd-heard.ok { color: var(--green); font-weight: 700; }
.rnd-progress { height: 4px; border-radius: 2px; background: var(--card-2); overflow: hidden; }
.rnd-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.rnd-beats { display: flex; justify-content: center; gap: 8px; min-height: 12px; }
.rnd-beats i { width: 10px; height: 10px; border-radius: 50%; background: var(--card-3); }
.rnd-beats i:first-child { background: var(--ink-3); }
.rnd-beats i.on { background: var(--accent); transform: scale(1.3); }
.rnd-count { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rnd-quick { display: flex; flex-direction: column; gap: var(--sp-3); }
.rnd-start { min-width: 160px; }
.btn.on { background: var(--card-3); }
body.lefty .rnd-item svg { transform: scaleX(-1); }
body.lefty .rnd-item svg text { transform-box: fill-box; transform-origin: center; transform: scaleX(-1); }
.tool-shell.stage .rnd-card { min-height: 60vh; }
.tool-shell.stage .rnd-big { font-size: clamp(96px, 18vw, 180px); }
@media (max-width: 420px) { .rnd-big { font-size: 80px; } .rnd-strum { font-size: 26px; } }
.tool-skel { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: var(--sp-6); min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); text-align: center; }
/* tool pages are served as finished HTML: show them at once (the site's page fade-in would hide them until the app loads) */
.page.tool-page, .page.tools-page { animation: none; }

/* sound check */
.tool-nosound { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); background: none; padding: 6px 10px; border-radius: var(--r-pill); }
.tool-nosound:hover { color: var(--ink-2); background: var(--card-2); }
.tool-shell.stage .tool-nosound { display: none; }
.sc-meter { height: 6px; border-radius: 3px; background: var(--card-3); overflow: hidden; }
.sc-meter i { display: block; height: 100%; width: 0; background: var(--green); }
.sc-rows > div { display: flex; justify-content: space-between; gap: var(--sp-3); }
.sc-ok { color: var(--green); }
.sc-bad { color: var(--red); }
.sc-tips { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.sc-details { white-space: pre-wrap; word-break: break-word; font-size: 11px; line-height: 1.4; background: var(--card-2); padding: 10px; border-radius: var(--r-sm); color: var(--ink-2); max-height: 220px; overflow: auto; }

/* tuner displays: needle, strobe or both */
.tuner-strobe-wrap { width: 100%; max-width: 420px; height: 54px; border-radius: var(--r-md); overflow: hidden; background: var(--card-2); }
.tuner-strobe { width: 100%; height: 100%; display: block; }
.tuner-stage[data-display="needle"] .tuner-strobe-wrap { display: none; }
.tuner-stage[data-display="strobe"] .tuner-dial { display: none; }
.tuner-stage[data-display="strobe"] .tuner-readout { margin-top: 0; }
.tuner-stage[data-display="strobe"] .tuner-strobe-wrap { height: 96px; }

/* reference tones */
.ref { display: flex; flex-direction: column; gap: var(--sp-4); }
.ref-stage { background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: var(--sp-5) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); align-items: center; }
.ref-strings { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); width: 100%; max-width: 640px; }
.ref-string { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--card-2); color: var(--ink); padding: 14px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; }
.ref-string b { font-size: 30px; line-height: 1; }
.ref-string small { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.ref-num { position: absolute; top: 6px; left: 8px; font-size: 10px; color: var(--ink-3); font-weight: 700; }
.ref-hz { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ref-string.on { border-color: var(--accent); background: var(--card-3); }
.ref-ring { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }
.ref-string.on .ref-ring { animation: ref-ring linear infinite; }
@keyframes ref-ring { from { width: 0; } to { width: 100%; } }
.ref-status { min-height: 18px; text-align: center; }
body.lefty .ref-strings { direction: rtl; }
@media (max-width: 520px) { .ref-strings { grid-template-columns: repeat(3, 1fr); } .ref-string b { font-size: 26px; } }
.ref-strings:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
.ref-strings:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); }

/* alternate tunings */
.alt-head { display: flex; flex-direction: column; gap: var(--sp-2); }
.alt-title { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.alt-title h2 { margin: 0; font-size: var(--fs-xl); }
.alt-letters { display: flex; gap: 6px; flex-wrap: wrap; }
.alt-letters span { min-width: 44px; padding: 6px 8px; border-radius: var(--r-md); background: var(--card-2); font-size: 24px; font-weight: 800; text-align: center; }
.alt-letters small { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
body.lefty .alt-letters { flex-direction: row-reverse; justify-content: flex-end; }
.alt-changes { display: flex; flex-direction: column; gap: var(--sp-2); }
.alt-steps > div { display: grid; grid-template-columns: 7em 1fr auto; gap: var(--sp-2); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: var(--fs-sm); }
.alt-steps > div:not(.moved) { color: var(--ink-3); }
.alt-move.up { color: var(--accent); } .alt-move.down { color: var(--green); }
.alt-warn { color: var(--accent); display: flex; gap: 6px; align-items: center; }
.alt-browse { display: flex; flex-direction: column; gap: var(--sp-3); }
.alt-browse h3 { margin: var(--sp-3) 0 0; }
.alt-search { min-height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card-2); color: var(--ink); padding: 0 16px; }
.alt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-2); max-height: 420px; overflow: auto; padding-right: 4px; }
.alt-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: var(--r-md); background: var(--card-2); color: var(--ink); border: 1px solid transparent; width: 100%; }
.alt-item span { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: .04em; }
.alt-item.on { border-color: var(--accent); }
.alt-build summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; padding: 8px 0; }
.alt-builder { display: flex; flex-direction: column; gap: 6px; }
.alt-brow { display: grid; grid-template-columns: 7em 40px 1fr 40px; gap: 8px; align-items: center; max-width: 360px; }
.alt-bnote { min-height: 40px; border-radius: var(--r-md); background: var(--card-2); color: var(--ink); font-weight: 800; font-size: 18px; }
.alt-bnote small { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
.alt-saved { display: flex; gap: 6px; align-items: center; }
.alt-build input[type=text] { min-height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card-2); color: var(--ink); padding: 0 10px; }

/* chromatic */
.chrom-recent { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 28px; }
.chrom-keys { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.chrom-key { min-height: 56px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13px; padding: 0; }
.chrom-key.black { background: var(--card-3); color: var(--ink); }
.chrom-key:active { transform: translateY(1px); background: var(--accent); color: #141210; }
@media (max-width: 520px) { .chrom-keys { grid-template-columns: repeat(6, 1fr); } }

/* variation pages (e.g. a tuning page) */
.var-article h3 { font-size: var(--fs-md); margin: var(--sp-2) 0 0; }
.var-strings { width: 100%; max-width: 560px; height: auto; display: block; }
.var-strings .vs-str { stroke: var(--ink-3); }
.var-strings .vs-num { font: 600 12px Inter, system-ui, sans-serif; fill: var(--ink-3); }
.var-strings .vs-note { font: 800 18px Inter, system-ui, sans-serif; fill: var(--ink); }
.var-strings .vs-oct { font-size: 11px; font-weight: 600; fill: var(--ink-3); }
.var-strings .vs-chg { font: 700 13px Inter, system-ui, sans-serif; fill: var(--ink-3); }
.var-strings .vs-chg.up { fill: var(--accent); } .var-strings .vs-chg.down { fill: var(--green); }
.var-table-wrap { overflow-x: auto; }
.var-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.var-table th, .var-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.var-table th { color: var(--ink-3); font-weight: 600; }
.var-table td.up { color: var(--accent); } .var-table td.down { color: var(--green); } .var-table td.same { color: var(--ink-3); }
.var-links { display: flex; flex-wrap: wrap; gap: 8px; }
.var-links .chip { text-decoration: none; }
.var-links .muted { font-weight: 500; font-size: .85em; }
.tuner-quick > *, .ctl { min-width: 0; }
.ctl select { width: 100%; max-width: 100%; text-overflow: ellipsis; }
.tuner-note.idle { color: var(--card-3); }

/* ---------- Wave 1 checkpoint B: shared */
.tuner-string.done { border-color: var(--green); }
.tuner-string.done small { color: var(--green); }
.tuner-string.locked.done small { color: inherit; }
.ok-text { color: var(--green); font-weight: 600; }
@keyframes pair-beat { 0%, 100% { transform: scale(.55); opacity: .35; } 50% { transform: scale(1); opacity: 1; } }

/* pair checker (12-string, mandolin) */
.pair { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--card); }
.pair .chips { flex-wrap: wrap; }
.pair-stage { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); min-height: 64px; }
.pair-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); transform: scale(.55); opacity: .35; flex: none; }
.pair-rate { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.pair-rate.ok { color: var(--green); }
.pair-stage:has(.pair-rate.ok) .pair-dot { background: var(--green); }

/* 12-string */
.twelve-guide { padding: var(--sp-3) var(--sp-4); background: var(--card-2); border-radius: var(--r-md); }
.twelve-guide p { margin: var(--sp-2) 0; }
.twelve-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); }
.twelve-course { display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: center; min-width: 0; }
.twelve-str { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: var(--r-md); background: var(--card-2); border: 2px solid transparent; color: var(--ink); font-size: 18px; line-height: 1.1; }
.twelve-str small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.twelve-str .xs { font-size: 10px; color: var(--ink-3); }
.twelve-str.on { border-color: var(--accent); background: var(--accent-soft); }
.twelve-str.done { border-color: var(--green); }
.twelve-str.done.on { border-color: var(--accent); }
body.lefty .twelve-grid { direction: rtl; }
body.lefty .twelve-course { direction: ltr; }
@media (max-width: 420px) { .twelve-grid { gap: 4px; } .twelve-str { font-size: 16px; } .twelve-str .xs { font-size: 9px; } }

/* intonation */
.into-card { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--card); }
.into-card p { margin: 0; }
.into-bar { height: 6px; border-radius: 3px; background: var(--card-3); overflow: hidden; }
.into-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.into-result { display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; text-align: center; }
.into-cents { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.into-result.good .into-cents { color: var(--green); }
.into-result.back .into-cents, .into-result.forward .into-cents { color: var(--amber); }
.into-svg { width: 100%; max-width: 320px; }
.into-neck { fill: var(--card-3); }
.into-saddle { fill: var(--accent); }
.into-arrow { stroke: var(--amber); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.into-lbl { fill: var(--ink-3); font-size: 11px; }
.into-table .list > * { padding: var(--sp-3) var(--sp-4); }
.into-table .list > * > span:nth-child(2) { font-variant-numeric: tabular-nums; }
.into-table .list > .good > span:last-child { color: var(--green); }
.into-table .list > .back > span:last-child, .into-table .list > .forward > span:last-child { color: var(--amber); }
.into-table { display: flex; flex-direction: column; gap: var(--sp-2); }

/* tuning stability */
.stab-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; counter-reset: st; }
.stab-steps li { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--ink-3); padding: 6px 2px; border-bottom: 3px solid var(--card-3); counter-increment: st; }
.stab-steps li::before { content: counter(st) ". "; }
.stab-steps li.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.stab-steps li.done { color: var(--green); border-color: var(--green); }
.stab-body { display: flex; flex-direction: column; gap: var(--sp-4); align-items: stretch; }
.stab-body > p { margin: 0; }
.stab-timer { font-family: var(--font-display); font-size: var(--fs-4xl); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.stab-chart { width: 100%; height: auto; background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-lg); }
.sc-zero { stroke: var(--line); stroke-dasharray: 4 4; }
.sc-lbl { fill: var(--ink-3); font-size: 13px; }
.sc-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.sc-end { font-size: 13px; font-weight: 700; }
.sc-line.s0 { stroke: #e4572e; } .sc-end.s0 { fill: #e4572e; }
.sc-line.s1 { stroke: #f3a712; } .sc-end.s1 { fill: #f3a712; }
.sc-line.s2 { stroke: #29a36a; } .sc-end.s2 { fill: #29a36a; }
.sc-line.s3 { stroke: #2e86de; } .sc-end.s3 { fill: #2e86de; }
.sc-line.s4 { stroke: #8e5bd1; } .sc-end.s4 { fill: #8e5bd1; }
.sc-line.s5 { stroke: #d1478f; } .sc-end.s5 { fill: #d1478f; }
.sc-line.s6 { stroke: #7a8b99; } .sc-end.s6 { fill: #7a8b99; }
.stab-table-wrap tr.slipsFlat td:first-child, .stab-table-wrap tr.nutBinding td:first-child, .stab-table-wrap tr.settlingFlat td:first-child, .stab-table-wrap tr.settlingSharp td:first-child { color: var(--amber); font-weight: 600; }
.stab-table-wrap tr.stable td:first-child { color: var(--green); }
.stab-table-wrap td { font-variant-numeric: tabular-nums; }
.stab-notes { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); }
.stab-ok { color: var(--green); font-weight: 600; margin: 0; }

/* string tension */
.ten { display: flex; flex-direction: column; gap: var(--sp-4); }
.ten-gauges { width: 100%; font-variant-numeric: tabular-nums; }
.ten-table { display: flex; flex-direction: column; border: 1px solid var(--edge); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.ten-row { display: grid; grid-template-columns: 44px 62px 1fr 76px 44px; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-3); border: 0; border-top: 1px solid var(--line-2); background: none; color: var(--ink); text-align: left; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.ten-row:first-child { border-top: 0; }
.ten-row:hover { background: var(--card-2); }
.ten-row small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.ten-str { font-weight: 700; }
.ten-g { font-variant-numeric: tabular-nums; }
.ten-bar { position: relative; height: 10px; border-radius: 5px; background: var(--card-3); overflow: hidden; }
.ten-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 5px; z-index: 1; opacity: .9; }
.ten-bar em { position: absolute; top: 0; bottom: 0; background: var(--green-soft); }
.ten-row.low .ten-bar i { background: var(--blue); }
.ten-row.high .ten-bar i { background: var(--red); }
.ten-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ten-d { text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ten-d.down { color: var(--blue); } .ten-d.up { color: var(--amber); }
.ten-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); }
.ten-total b { font-family: var(--font-display); font-size: var(--fs-xl); }
.ten-warn { display: flex; gap: 6px; align-items: flex-start; color: var(--amber); margin: 0; }
.ten-recs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.ten-recs h3 { grid-column: 1 / -1; margin: 0; font-size: var(--fs-md); }
.ten-rec { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: var(--sp-4); }
.ten-rec .btn { margin-top: var(--sp-2); }
@media (max-width: 520px) { .ten-recs { grid-template-columns: 1fr; } .ten-row { grid-template-columns: 38px 54px 1fr 66px 38px; gap: 6px; padding: 10px; } }
.stab, .into { display: flex; flex-direction: column; gap: var(--sp-4); }
.twelve { gap: var(--sp-4); }
