:root {
  color-scheme: light;
  --p-bg:#eeeee8; --p-surface:#dcded5; --p-ink:#292b27;
  --p-accent:#ffb762; --tuned:#83ee9b; --zero-mark:#fafff0; --glow:var(--p-accent);
  --panel:#222320; --label:#babbb1; --case-line:#b7b8ae;
  --font-display: "Geist", system-ui, sans-serif;
  --font-text: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500;
  --display-tracking: -0.035em;
  --display-tracking-xl: -0.045em;
}
*{box-sizing:border-box}
body{margin:0;background:var(--p-bg);color:var(--p-ink);font-family:var(--font-text)}
button,select{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
button:focus-visible,select:focus-visible{outline:3px solid #ab672c;outline-offset:3px}
header,main{width:min(950px,calc(100% - 64px));margin:auto}
header,.brand,.cal,.page-title,.screen-top,.plate,.decision,.controls,.audio,.demo,.demo>div{display:flex;align-items:center}
header{justify-content:space-between;padding:22px 0;border-bottom:1px solid var(--case-line)}
.brand{font-size:20px;font-weight:720;gap:8px}.brand svg{width:25px;height:30px;color:#68513b}.brand span{font:600 10px var(--font-mono);letter-spacing:.12em;margin-left:8px}.cal{gap:10px;font-size:13px;color:#53564e}.cal select{font:13px var(--font-mono);background:transparent;border:1px solid #92968a;padding:0 10px;min-height:42px;border-radius:6px}
.page-title{align-items:baseline;justify-content:space-between;margin:clamp(28px,5vw,68px) 0 22px;gap:12px}.page-title h1{font-size:clamp(34px,4.3vw,60px);font-weight:640;letter-spacing:-.06em;line-height:1.1;margin:0}.page-title>span,.demo{font-size:13px;color:#55594e}
.device{background:var(--p-surface);border:1px solid var(--case-line);border-radius:18px;padding:14px;box-shadow:0 6px 20px -12px #34362d40;margin-bottom:42px}
.panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.screen,.strings{min-width:0;border-radius:9px}.screen{background:#1a1c19;color:#f4f3e9;padding:clamp(16px,2.6vw,35px);display:flex;flex-direction:column}.screen-top,.plate,.decision,.controls{justify-content:space-between}.screen-top,.plate>span,.read>div,.decision>span{font:12px var(--font-mono)}.screen-top{color:var(--label)}.screen-top>span:first-child:before{content:"";display:inline-block;margin-right:7px;width:6px;height:6px;background:var(--label);border-radius:50%}.read{display:flex;align-items:end;gap:28px;margin:24px 0 20px}.read strong{font:550 clamp(84px,8.4vw,130px)/.9 var(--font-mono);letter-spacing:normal;white-space:nowrap}.read sub{font-size:.36em;vertical-align:baseline;margin-inline-start:.22em}.read>div{padding-bottom:5px;font-size:18px}.read small{display:block;font:12px var(--font-text);color:var(--label);margin-bottom:6px}
.screen{justify-content:space-between;aspect-ratio:4/5;container-type:inline-size}
.meter{position:relative;width:min(100%,250px);margin:auto;aspect-ratio:220/244}
/* Anchor the expanded dial to the original pivot at 225 / 244 of the meter height. */
.meter svg{position:absolute;left:50%;bottom:calc(100% * 19 / 244);transform:translateX(-50%);width:100cqw;height:calc(100% * 225 / 244);overflow:visible}
.center-guide{stroke:#92968a;stroke-width:1;stroke-dasharray:2 5}
#dialScale .minor{stroke:#787c70;stroke-width:1}
#dialScale .major{stroke:#e0e4d5;stroke-width:1.5}
#dialScale text{fill:#d4d6ca;font:500 16px var(--font-mono)}
#dialScale .zero-label{fill:var(--zero-mark);font-size:23px;font-weight:700}
#dialScale .zero-tick{stroke:var(--zero-mark);stroke-width:2.8;stroke-linecap:round}
#needle{transform-box:view-box;transform-origin:110px 225px;transition:transform 95ms ease-out;fill:var(--glow);stroke:var(--glow);stroke-width:.5;filter:drop-shadow(0 0 2px var(--glow))}
.pivot{fill:#22241f;stroke:var(--glow);stroke-width:1.4}
.pivot-core{fill:var(--glow)}
.decision{border-top:1px solid #44473e;padding-top:15px;gap:10px}.decision b{font-size:clamp(18px,2.15vw,29px);font-weight:600}.decision>span{color:#e0e1d6;white-space:nowrap}
.strings{color:#f4f3e9;display:flex;flex-direction:column;padding:18px;background:var(--panel);border:1px solid #44463f}.plate h2{margin:0;font-size:17px;letter-spacing:-.04em}.plate>span{color:var(--label)}.plate>span:before{content:"";display:inline-block;width:15px;height:3px;vertical-align:middle;background:var(--glow);margin-right:7px}
#headstock{width:100%;height:clamp(255px,29vw,335px);display:block;margin:auto;color:#bdbfb2}
.guitar-nut{fill:#777b6d;stroke-width:1.1}.post-collar{fill:var(--panel);stroke-width:1.1}
.outline,.nut{stroke-width:1.7;filter:drop-shadow(0 0 3px #eeedd11c)}
.carving{stroke-width:1.4}.box-opening{fill:#151714;stroke-width:1.3}.shaft{stroke-width:4}.peg-grip{fill:var(--panel)}
.wire{stroke:#9a9c8e;stroke-width:1.4}.wire.active{stroke:var(--glow);stroke-width:2.7;filter:drop-shadow(0 0 3px var(--glow))}
.peg{stroke:#a9ab9c;stroke-width:1.5;cursor:pointer}.peg ellipse,.peg rect,.peg circle{fill:var(--panel)}.peg text{stroke:none;fill:#c6c6b9;font:12px var(--font-mono)}.peg.active,.peg.active rect,.peg.active circle{stroke:var(--glow)}.peg.active{filter:drop-shadow(0 0 2px var(--glow))}.peg.active text{fill:var(--glow)}
.hit{fill:none;stroke:transparent;stroke-width:6;pointer-events:stroke;cursor:pointer}
.in-tune{--glow:var(--tuned);--zero-mark:var(--tuned)}
.decision b,.plate>span{color:var(--glow)}.read strong{color:#f5f4e9;text-shadow:0 0 18px #fffad012}
.screen{border:1px solid #30332c}.strings{background-image:radial-gradient(#bbb9a429 .8px,transparent .8px);background-size:14px 14px}
.auto-mode{display:inline-flex;align-items:center;align-self:flex-start;gap:8px;min-height:44px;font-size:14px;cursor:pointer}.auto-mode input{width:18px;height:18px;margin:0;accent-color:var(--p-accent)}
#keys{display:grid;grid-template-columns:repeat(var(--string-count,6),minmax(0,1fr));gap:5px}
.key,.controls button{border:1px solid #686b60;border-radius:6px;background:var(--panel);transition:background .14s,transform .14s}.key{padding:9px 0;font:600 17px var(--font-mono);box-shadow:none}.key small{display:block;font:11px var(--font-text);margin-bottom:4px}.key[aria-pressed=true]{background:#352e24;color:white;box-shadow:inset 0 -2px var(--glow);border-color:var(--glow)}
.controls{padding:15px 4px 2px;gap:12px}.audio,.demo{gap:8px}.controls button{background:#f1f2ea;color:#33362f}.controls button{min-height:44px;padding:0 14px;font-weight:580}.controls button.primary{background:#30322d;color:#fcfcf7;border-color:#30322d}.controls button:disabled{opacity:.55}.controls button:not(:disabled):hover,.key:hover{transform:translateY(-1px)}.controls button:not(:disabled):active,.key:active{transform:translateY(1px)}.demo>div{gap:3px}.demo button{padding:0 11px;font-size:12px}.demo button[aria-pressed=true]{background:#53564b;color:white;border-color:#53564b}.demo[hidden]{display:none}#message{font-size:14px;margin:14px 4px 2px}
@media(max-width:760px){header,main{width:min(460px,calc(100% - 24px))}header{padding:11px 0}.brand span{display:none}.panels{grid-template-columns:1fr}.page-title{margin-top:25px}.device{padding:8px}.controls{flex-wrap:wrap}.audio,.demo{width:100%}.audio button{flex:1}.demo{justify-content:space-between}.screen,.strings{padding:16px}.read{margin:18px 0}.key small{font-size:11px}.controls{padding:10px 0 2px}.decision b{font-size:19px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

@media(max-width:760px){.meter{width:min(100%,210px)}}

.instrument-picker{display:inline-flex;align-self:center;padding:3px;gap:2px;border:1px solid var(--case-line);border-radius:8px}
.instrument-picker button{min-height:44px;padding:0 14px;background:transparent;border:0;border-radius:5px;font-size:14px}
.instrument-picker button[aria-pressed=true]{background:var(--p-ink);color:var(--p-bg)}
.page-title{flex-wrap:wrap}
