:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --ink: #0f1430;
  --ink-2: #3e4566;
  --muted: #646b8a;
  --line: #dfe3ef;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #e5e4ff;
  --link: #4338ca;
  --studio: #0d1230;
  --studio-2: #182046;
  --studio-ink: #f2f4ff;
  --studio-muted: #aab2d6;
  --glow: #2ee6b6;
  --range: #9fa8ff;
  --range-dark: #3b3f8a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 20, 48, .06), 0 12px 32px -12px rgba(15, 20, 48, .18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d1f; --surface: #12172e; --surface-2: #1a2040; --ink: #eef1ff; --ink-2: #cdd3ee; --muted: #9aa3c7;
    --line: #262d52; --accent: #8b85ff; --accent-ink: #0a0d1f; --accent-soft: #23255a; --link: #a5a0ff;
    --studio: #060818; --studio-2: #141a3a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d1f; --surface: #12172e; --surface-2: #1a2040; --ink: #eef1ff; --ink-2: #cdd3ee; --muted: #9aa3c7;
  --line: #262d52; --accent: #8b85ff; --accent-ink: #0a0d1f; --accent-soft: #23255a; --link: #a5a0ff;
  --studio: #060818; --studio-2: #141a3a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.65; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 850; margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 800; margin: 2.2em 0 .6em; }
h3 { font-size: 1.2rem; font-weight: 750; margin: 1.6em 0 .4em; }
p, ul, ol { margin: 0 0 1.1em; }
li { margin-bottom: .35em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 720px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--link); font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { white-space: nowrap; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 10px; border-radius: 10px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; margin-left: 4px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* hero */
.hero { padding: 40px 0 8px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--link); margin-bottom: .8em; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 640px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 16px 0 0; list-style: none; color: var(--muted); font-size: .92rem; font-weight: 600; }
.trust li { display: flex; align-items: center; gap: 6px; margin: 0; }
.trust li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* tool */
.tool { background: radial-gradient(1200px 400px at 80% -10%, #24308a 0%, transparent 60%), var(--studio); color: var(--studio-ink); border-radius: 26px; padding: 22px; margin: 26px 0 10px; box-shadow: var(--shadow); scroll-margin-top: 76px; position: relative; overflow: hidden; }
.tool h2, .tool h3 { color: var(--studio-ink); }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.steps li { margin: 0; font-size: .82rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--studio-muted); display: flex; align-items: center; gap: 6px; }
.steps li .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); font-size: .72rem; }
.steps li.current { background: var(--glow); color: #0f1430; }
.steps li.current .n { background: rgba(0,0,0,.15); }
.steps li.complete { color: var(--studio-ink); }
.steps li.complete .n { background: #3ccf91; color: #0b2a1e; }

.stage { display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; align-items: center; }
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; gap: 14px; } }
.readout { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 18px 18px 16px; text-align: center; }
.note-big { font-size: clamp(4.2rem, 13vw, 6.2rem); font-weight: 850; line-height: 1; letter-spacing: -0.04em; color: rgba(255,255,255,.25); font-variant-numeric: tabular-nums; transition: color .15s; min-height: 1em; }
.note-big.live { color: #fff; text-shadow: 0 0 34px rgba(46,230,182,.5); }
.note-meta { display: flex; justify-content: center; gap: 14px; font-family: var(--mono); font-size: .85rem; color: var(--studio-muted); margin: 8px 0 12px; min-height: 1.4em; }
.tuner { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(60,207,145,.5) 45%, rgba(60,207,145,.5) 55%, rgba(255,255,255,.08)); }
.tuner::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: rgba(255,255,255,.35); }
.needle { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 12px var(--glow); transition: left .08s linear; }
.level { margin-top: 14px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.level > div { height: 100%; width: 0; background: linear-gradient(90deg, #3ccf91, #ffd166, var(--glow)); transition: width .06s; }
.level-label { font-size: .72rem; color: var(--studio-muted); margin-top: 6px; letter-spacing: .04em; }
.stage:not(.listening) .level-label::after { content: " · mic off"; }

.prompt h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 0 0 .35em; }
.prompt p { color: var(--studio-muted); margin: 0 0 1em; font-size: 1rem; }
.prompt p b { color: var(--studio-ink); }
.captured { display: flex; gap: 10px; margin: 0 0 16px; }
.captured div { flex: 1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 10px 14px; }
.captured span { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--studio-muted); }
.captured b { font-size: 1.7rem; font-weight: 850; letter-spacing: -0.02em; }
.flash { animation: flash .6s ease; }
@keyframes flash { 0% { color: var(--glow); transform: scale(1.12); } 100% { color: inherit; transform: none; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { appearance: none; border: 0; font: inherit; font-weight: 750; font-size: 1rem; padding: 13px 22px; border-radius: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }
.btn-primary { background: var(--glow); color: #0f1430; box-shadow: 0 8px 22px -8px rgba(46,230,182,.55); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--studio-ink); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.privacy-note { font-size: .82rem; color: var(--studio-muted); margin: 14px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.tool-error { background: #4a1d26; border: 1px solid #a0404f; color: #ffd9de; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: .95rem; }
.last-result { font-size: .85rem; color: var(--studio-muted); margin: 10px 0 0; }

/* keyboard */
.kb-wrap { margin: 20px -22px 0; padding: 0 22px 8px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.keyboard { --wk: 32px; --bk: 24px; position: relative; height: 118px; width: calc(var(--whites) * var(--wk)); display: flex; user-select: none; -webkit-user-select: none; }
@media (max-width: 560px) { .keyboard { --wk: 30px; --bk: 24px; height: 108px; } }
.key { appearance: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.key.white { flex: none; width: var(--wk); height: 100%; background: #f6f3fb; border-right: 1px solid #cfc7de; border-radius: 0 0 7px 7px; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.key.white span { font-size: .62rem; font-weight: 700; color: #5f5878; margin-bottom: 6px; }
.key.black { position: absolute; top: 0; width: var(--bk); height: 62%; background: #15111f; border-radius: 0 0 5px 5px; z-index: 2; box-shadow: inset 0 -3px 0 rgba(255,255,255,.08); }
.key.white.in-range { background: var(--range); }
.key.white.in-range span { color: #4a2030; }
.key.black.in-range { background: var(--range-dark); }
.key.mark-low, .key.mark-high { background: var(--glow) !important; }
.key.white.mark-low span, .key.white.mark-high span { color: #0f1430; }
.key.active { background: #3ccf91 !important; box-shadow: 0 0 18px #3ccf91; }
.key.white:active { background: #e3dcef; }
.kb-hint { font-size: .78rem; color: var(--studio-muted); margin: 6px 0 0; }

.manual-bar { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border-radius: 14px; padding: 10px 12px; }
.manual-bar .tapped { font-weight: 700; margin-right: auto; }
.manual-bar .tapped b { color: var(--glow); font-size: 1.2rem; }
.manual-bar .btn { min-height: 40px; padding: 8px 14px; font-size: .92rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--studio-muted); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-top: 14px; }
.linkish:hover { color: var(--studio-ink); }

/* result */
.result { outline: none; }
.result-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .result-top { grid-template-columns: 1fr; } }
.result .label { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--glow); margin: 0 0 4px; }
.result-range { font-size: clamp(2.8rem, 10vw, 4.6rem); font-weight: 850; letter-spacing: -0.04em; line-height: 1; margin: 0 0 10px; }
.result-span { color: var(--studio-ink); font-weight: 600; margin: 0 0 2px; }
.result-freq { color: var(--studio-muted); font-family: var(--mono); font-size: .85rem; margin: 0 0 14px; }
.type-card { align-self: start; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 16px 18px; }
.type-card h3 { margin: 0 0 6px; font-size: 1.6rem; color: #fff; }
.type-card p { color: var(--studio-muted); font-size: .95rem; margin: 0 0 .6em; }
.type-card p:last-child { margin-bottom: 0; }
.adjust { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.adjust > div { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.05); border-radius: 12px; padding: 6px 8px 6px 12px; font-size: .88rem; color: var(--studio-muted); }
.adjust button { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 1rem; cursor: pointer; }
.adjust button:hover { background: rgba(255,255,255,.18); }
.share-msg { font-size: .85rem; color: #3ccf91; margin: 8px 0 0; min-height: 1.2em; }
.result-note { font-size: .82rem; color: var(--studio-muted); margin: 14px 0 0; }

/* content */
main { padding-bottom: 40px; }
.section { margin-top: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); display: block; transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 .35em; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .more { display: inline-block; margin-top: 10px; color: var(--link); font-weight: 700; font-size: .92rem; }
.table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:last-child { white-space: normal; min-width: 220px; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.callout { background: var(--accent-soft); border-radius: 14px; padding: 14px 18px; margin: 0 0 1.3em; color: var(--ink); }
.callout p:last-child { margin: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 28px 12px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 8px; font-size: 1.4rem; color: var(--accent); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 0 0 14px; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin: 26px 0 0; }
.breadcrumb a { color: var(--muted); }
.article-meta { color: var(--muted); font-size: .92rem; margin-top: -0.4em; }
.cta { background: var(--studio); color: var(--studio-ink); border-radius: var(--radius); padding: 22px; margin: 2em 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.cta p { margin: 0; font-weight: 700; font-size: 1.1rem; }
.cta .btn { text-decoration: none; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 0 0 1.5em; }
.toc p { font-weight: 800; margin: 0 0 .4em; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.2em; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 40px; color: var(--muted); font-size: .92rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.copyright { margin-top: 24px; font-size: .85rem; }

/* 404 */
.notfound { text-align: center; padding: 70px 0 30px; }
.notfound .big { font-size: clamp(5rem, 20vw, 9rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; color: var(--accent); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* v2: comfort zone, history, examples */
.key.mark-comfort { box-shadow: inset 0 -6px 0 #3ccf91; }
.comfort-box { margin: 0 0 16px; background: rgba(60,207,145,.08); border: 1px solid rgba(60,207,145,.25); border-radius: 14px; padding: 10px 14px; }
.comfort-box span { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--studio-muted); }
.comfort-box b { font-size: 1.5rem; font-weight: 850; }
.comfort-prog { height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.comfort-prog > div { height: 100%; width: 0; background: #3ccf91; transition: width .15s; }
.result-comfort { color: #3ccf91; font-weight: 700; font-size: .95rem; margin: -6px 0 14px; }
.examples { color: var(--studio-ink) !important; }
.examples b { color: #fff; }
.history { margin-top: 22px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px 18px; }
.history-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.history h3 { margin: 0; font-size: 1.05rem; }
.history ol { list-style: none; padding: 0; margin: 12px 0 8px; }
.history li { display: grid; grid-template-columns: 56px 1fr 78px; align-items: center; gap: 10px; margin: 0 0 6px; font-size: .85rem; color: var(--studio-muted); }
.history li.latest { color: var(--studio-ink); font-weight: 700; }
.h-bar { position: relative; height: 10px; border-radius: 999px; background: rgba(255,255,255,.07); }
.h-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--range-dark); }
.history li.latest .h-bar i { background: var(--glow); }
.h-notes { text-align: right; font-family: var(--mono); font-size: .8rem; }
.history-note { font-size: .88rem; color: var(--studio-muted); margin: 0; }
.history .linkish { margin: 0; font-size: .8rem; }

/* note finder */
.nf-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; align-items: stretch; }
@media (max-width: 760px) { .nf-grid { grid-template-columns: 1fr; } }
.tune-label { font-weight: 800; font-size: .95rem; margin-top: 10px; color: var(--studio-muted); min-height: 1.4em; }
.tune-label.good { color: #3ccf91; } .tune-label.ok { color: #ffd166; } .tune-label.off { color: var(--glow); }
.trail-wrap { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; overflow: hidden; min-height: 240px; position: relative; }
.trail-wrap canvas { display: block; width: 100%; height: 100%; min-height: 240px; }
.trail-cap { position: absolute; right: 12px; top: 10px; font-size: .72rem; color: var(--studio-muted); letter-spacing: .04em; }
.nf-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0; }
.held { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.held li { margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); font-family: var(--mono); font-size: .82rem; }
.held li.new { background: var(--glow); color: #0f1430; font-weight: 700; }
.held-wrap { margin-top: 14px; font-size: .8rem; color: var(--studio-muted); }
.held-wrap > span { display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: .72rem; }
.target-panel { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: rgba(60,207,145,.08); border: 1px solid rgba(60,207,145,.25); border-radius: 14px; padding: 10px 14px; }
.target-panel .t-note { font-weight: 850; font-size: 1.5rem; color: #3ccf91; }
.target-panel #targetMsg { flex: 1; min-width: 180px; font-weight: 600; }
.target-panel #targetMsg.good { color: #3ccf91; } .target-panel #targetMsg.ok { color: #ffd166; } .target-panel #targetMsg.off { color: var(--glow); }
.target-panel .count { font-size: .8rem; color: var(--studio-muted); }
.target-panel button { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
@media (max-width: 760px) { .tools-row { grid-template-columns: 1fr; } }
.card.tool-card { border-left: 4px solid var(--accent); }
.trouble dt { font-weight: 750; margin-top: 1em; }
.trouble dd { margin: .25em 0 0; color: var(--ink-2); }


/* key finder */
.kf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .kf-grid { grid-template-columns: 1fr; } }
.kf-panel { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px; }
.kf-panel h2 { font-size: 1.05rem; margin: 0 0 10px; color: var(--studio-ink); }
.kf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kf-field label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--studio-muted); }
.kf-inline { display: flex; gap: 6px; align-items: center; }
.tool select { font: inherit; font-size: 1rem; font-weight: 700; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 9px 10px; min-width: 0; width: 100%; color-scheme: dark; }
.tool select:focus-visible { outline: 3px solid var(--glow); }
.kf-sing { flex: none; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: .82rem; font-weight: 700; padding: 10px 10px; cursor: pointer; white-space: nowrap; min-height: 42px; }
.kf-sing:hover { background: rgba(255,255,255,.18); }
.kf-note { font-size: .82rem; color: var(--studio-muted); margin: 10px 0 0; }
.kf-note a { color: var(--studio-ink); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.presets button { border: 1px solid rgba(255,255,255,.14); background: transparent; color: var(--studio-ink); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .8rem; cursor: pointer; min-height: 32px; }
.presets button:hover { background: rgba(255,255,255,.08); }
.kf-live { font-size: .85rem; color: #3ccf91; min-height: 1.3em; margin: 8px 0 0; font-weight: 600; }
.kf-result { margin-top: 16px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; background: linear-gradient(135deg, rgba(46,230,182,.12), rgba(60,207,145,.08)); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 18px; }
@media (max-width: 760px) { .kf-result { grid-template-columns: 1fr; } }
.kf-result h2 { font-size: clamp(1.4rem, 3.6vw, 1.9rem); margin: 0 0 8px; color: #fff; }
.kf-result p { color: var(--studio-muted); margin: 0 0 8px; }
.kf-result .label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--glow); margin: 0 0 6px; }
.capo-list, .alt-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.capo-list li, .alt-list li { margin: 0; background: rgba(255,255,255,.06); border-radius: 10px; padding: 7px 10px; font-size: .92rem; color: var(--studio-ink); }
.kf-result .small { font-size: .88rem; }
.key.song { box-shadow: inset 0 -12px 0 #3ccf91; }
.key.song-out { box-shadow: inset 0 -12px 0 #ff5a6e; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--studio-muted); margin: 8px 0 0; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
select.flash { animation: flash .6s ease; }

/* range chart */
.chart-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin: 18px 0 10px; }
.chart-wrap svg { display: block; min-width: 720px; width: 100%; height: auto; }
.vr-label { font: 700 13px var(--font); fill: var(--ink); }
.vr-range { font: 600 11px var(--mono); fill: #fff; }
.vr-tick { font: 600 10px var(--mono); fill: var(--muted); }
.vr-bar-f { fill: #e8462a; } .vr-bar-f2 { fill: #c2361c; } .vr-bar-f3 { fill: #9e2b16; }
.vr-bar-m { fill: #5b46c9; } .vr-bar-m2 { fill: #3f2fa3; } .vr-bar-m3 { fill: #2a1f78; }
.vr-you { fill: #1f8a55; }
.vr-white { fill: #ffffff; stroke: #cfc7de; }
.vr-black { fill: #0f1430; }
.vr-mid { fill: #ffe4dc; stroke: #e8462a; }
.vr-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-note { font-size: .88rem; color: var(--muted); }
.chart-you { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--accent-soft); border-radius: 14px; padding: 12px 16px; margin: 0 0 10px; }
.chart-you p { margin: 0; }
/* small screens (kept last so it wins) */
@media (max-width: 760px) { .nav-links a.hide-md { display: none; } }
@media (max-width: 560px) {
  .brand span.long { display: none; }
  .nav { gap: 6px; }
  .brand { font-size: .98rem; gap: 8px; }
  .brand svg { width: 28px; height: 28px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 6px; font-size: .88rem; }
  .theme-toggle { margin-left: 2px; width: 36px; height: 36px; }
  .steps { flex-wrap: nowrap; gap: 5px; }
  .steps li { padding: 5px 10px; font-size: .74rem; white-space: nowrap; }
  .steps li .n { display: none; }
  .steps li { padding: 5px 9px; }
  .history li { grid-template-columns: 46px 1fr 70px; gap: 8px; }
  .tool { padding: 18px 16px; border-radius: 22px; }
  .kb-wrap { margin: 18px -16px 0; padding: 0 16px 8px; }
  .nav-links a.hide-sm { display: none; }
  .kf-song-notes { grid-template-columns: 1fr; }
  .steps li.complete .n, .steps li.current .n { display: none; }
}

/* ===== FreeBPMFinder tool ===== */
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: rgba(255,255,255,.06); padding: 5px; border-radius: 14px; margin-bottom: 18px; }
.mode-tabs button { font: inherit; font-weight: 750; font-size: .95rem; border: 0; border-radius: 10px; padding: 11px 8px; background: transparent; color: var(--studio-muted); cursor: pointer; min-height: 44px; }
.mode-tabs button[aria-selected="true"] { background: #fff; color: #0f1430; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.mode-tabs button:hover:not([aria-selected="true"]) { color: #fff; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; border: 2px dashed rgba(255,255,255,.22); border-radius: 20px; padding: 34px 18px; cursor: pointer; transition: border-color .15s, background .15s; min-height: 210px; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--glow); background: rgba(46,230,182,.06); }
.drop svg { width: 46px; height: 46px; color: var(--glow); }
.drop b { font-size: 1.2rem; color: #fff; }
.drop span { color: var(--studio-muted); font-size: .92rem; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .btn { margin-top: 6px; pointer-events: none; }
.file-status { margin: 12px 0 0; color: var(--studio-muted); font-size: .92rem; text-align: center; }
.tool.busy .file-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--glow); border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; font-size: .88rem; color: var(--studio-muted); }
.tool .linkish { color: var(--glow); background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }
.listen-idle { text-align: center; padding: 18px 6px; }
.listen-idle p { color: var(--studio-muted); max-width: 520px; margin: 0 auto 16px; }
.listen-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.listen-live { text-align: center; padding: 6px 0; }
.live-src { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--glow); }
.live-src::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff4d6d; margin-right: 8px; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.live-grid div { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 14px 8px; }
.live-grid b { display: block; font-size: clamp(2.2rem, 9vw, 3.4rem); line-height: 1.05; font-weight: 850; color: #fff; font-variant-numeric: tabular-nums; }
.live-grid span { font-size: .78rem; color: var(--studio-muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.live-msg { color: var(--studio-muted); font-size: .92rem; min-height: 1.5em; }
.live-prog { height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 8px auto 14px; max-width: 360px; }
.live-prog > div { height: 100%; width: 0; background: var(--glow); transition: width .4s; }
.tap-area { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.tap-pad { width: 100%; aspect-ratio: 1.6; max-height: 240px; border-radius: 22px; border: 0; cursor: pointer; font: inherit; font-size: 1.4rem; font-weight: 850; letter-spacing: .04em; color: #0f1430; background: linear-gradient(160deg, #6ff5d2, var(--glow)); box-shadow: 0 10px 30px -10px rgba(46,230,182,.6), inset 0 -6px 0 rgba(0,0,0,.12); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.tap-pad.hit { animation: hit .14s ease-out; }
@keyframes hit { 0% { transform: scale(.96); filter: brightness(1.15); } 100% { transform: scale(1); } }
.tap-pad small { display: block; font-size: .75rem; font-weight: 700; opacity: .7; letter-spacing: .02em; margin-top: 4px; }
.tap-read { text-align: center; }
.tap-read b { display: block; font-size: clamp(4rem, 14vw, 6rem); font-weight: 850; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.tap-read .unit { font-size: .85rem; font-weight: 800; letter-spacing: .14em; color: var(--glow); }
.tap-read p { color: var(--studio-muted); font-size: .9rem; margin: 10px 0 12px; }
.tap-read .actions { justify-content: center; }
.bpm-result { margin-top: 20px; background: #fff; color: #0f1430; border-radius: 20px; padding: 20px; outline: none; }
:root[data-theme="dark"] .bpm-result { background: #151b3b; color: #eef1ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bpm-result { background: #151b3b; color: #eef1ff; } }
.bpm-result .src { font-size: .85rem; color: var(--muted); margin: 0 0 12px; overflow-wrap: anywhere; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.res-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.res-card .label { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.res-big { font-size: clamp(3rem, 10vw, 4.4rem); font-weight: 850; line-height: 1.05; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.res-big.key { font-size: clamp(2rem, 7vw, 2.8rem); padding: 8px 0 6px; }
.res-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .9rem; color: var(--ink-2); margin: 4px 0 8px; }
.pill { display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--link); }
.res-hint { font-size: .88rem; color: var(--muted); margin: 8px 0 0; }
.mult { display: flex; gap: 8px; margin-top: 6px; }
.mult button { font: inherit; font-weight: 800; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.mult button:hover { border-color: var(--accent); }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.res-actions .btn-ghost { color: var(--ink); border-color: var(--line); }
.timeline-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: .9rem; }
.tool .last-result { text-align: center; margin: 12px 0 0; color: var(--studio-muted); font-size: .85rem; }
.tool .tool-error { background: rgba(255,77,109,.14); color: #ffd1da; border: 1px solid rgba(255,77,109,.4); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
/* tap tempo page */
.tt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.tt-panel { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 18px; }
.tt-panel h2 { font-size: 1.05rem; margin: 0 0 12px; color: #fff; }
.tt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tt-row input[type=number] { width: 92px; font: inherit; font-size: 1.3rem; font-weight: 800; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; }
.tt-row select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: #182046; color: #fff; }
.tt-row button.sm { font: inherit; font-weight: 800; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
.tt-panel input[type=range] { width: 100%; margin: 14px 0; accent-color: var(--glow); }
.dots { display: flex; gap: 10px; justify-content: center; margin: 16px 0 6px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.12); transition: background .05s; }
.dots i.on { background: var(--glow); box-shadow: 0 0 16px var(--glow); }
.dots i:first-child.on { background: #fff; }
.tt-panel .btn { width: 100%; justify-content: center; }
.tt-delays { width: 100%; font-size: .9rem; }
.tt-delays td { color: var(--studio-ink); border-color: rgba(255,255,255,.08); padding: 7px 6px; }
.tt-delays td:nth-child(2) { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.tt-delays td:last-child { color: var(--studio-muted); text-align: right; }
@media (max-width: 720px) {
  .tap-area, .tt-grid, .res-grid { grid-template-columns: 1fr; }
  .tap-pad { aspect-ratio: 2.2; }
  .mode-tabs button { font-size: .85rem; padding: 10px 4px; }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.drop span.btn { color: #0f1430; font-size: 1rem; }
.tool-sub .linkish { margin: 0; color: var(--glow); font-size: inherit; font-weight: 700; }
.res-actions .btn-ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.res-actions .btn-ghost:hover { border-color: var(--accent); background: var(--surface-2); }
.tt-grid > *, .tap-area > *, .res-grid > * { min-width: 0; }
.tt-row input[type=number] { flex: 0 0 84px; }
@media (max-width: 720px) { .tt-panel { padding: 14px; } .tt-row { gap: 6px; } }
.tt-delays { min-width: 0 !important; margin: 0; }
.tt-delays td:last-child { min-width: 0; white-space: nowrap; }
@media (max-width: 389px) { .nav-links a.hide-xs { display: none; } }
