:root{--bg: #0a0e27;--surface: #121735;--surface-2: #1a2048;--border: #262d5a;--grid: #222a52;--text: #e6eaff;--text-2: #b4bbe6;--muted: #8189bb;--accent: #818cf8;--accent-strong: #6366f1;--accent-soft: rgba(129, 140, 248, .14);--good: #34d399;--warn: #fbbf24;--bad: #f87171;--radius: 16px;color-scheme:dark}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background:radial-gradient(1200px 600px at 20% -10%,#1b2160 0%,transparent 60%),var(--bg);color:var(--text);min-height:100vh}button,input,select{font:inherit;color:inherit}kbd{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.8em;padding:1px 6px;border:1px solid var(--border);border-bottom-width:2px;border-radius:6px;background:var(--surface-2)}.app{max-width:1180px;margin:0 auto;padding:16px 20px 32px}.topbar{display:flex;align-items:center;gap:16px 24px;flex-wrap:wrap;padding:8px 0 16px}.brand{display:flex;align-items:center;gap:10px}.brand h1{font-size:1.25rem;font-weight:700;letter-spacing:.01em}.controls{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}.level{display:flex;align-items:center;gap:8px;flex:1 1 160px;max-width:280px}.level-track{position:relative;flex:1;height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden}.level-fill{height:100%;background:var(--muted);border-radius:4px;transition:width 60ms linear}.level-fill.active{background:var(--good)}.level-gate{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--text-2)}.btn{border:1px solid var(--border);background:var(--surface-2);border-radius:10px;padding:8px 14px;cursor:pointer;font-weight:600;transition:background .12s,border-color .12s,transform 80ms}.btn:hover:not(:disabled){border-color:var(--accent)}.btn:active:not(:disabled){transform:translateY(1px)}.btn:disabled{opacity:.45;cursor:default}.btn:focus-visible,.segmented button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.btn-primary{background:var(--accent-strong);border-color:var(--accent-strong);color:#fff}.btn-stop{background:#3a1d33;border-color:var(--bad)}.btn-ghost{background:transparent}.btn-icon{width:36px;height:36px;padding:0;display:inline-grid;place-items:center;background:transparent}.btn-small{padding:4px 10px;font-size:.85rem}.btn-tap{min-width:96px;padding:14px 20px;font-size:1.05rem;background:var(--accent-soft);border-color:var(--accent)}.alert{border:1px solid var(--bad);background:#f871711a;border-radius:12px;padding:12px 16px;margin-bottom:16px}.intro{color:var(--text-2);margin-bottom:16px}.media-slot:empty{display:none}.media-player{width:100%;margin-bottom:16px}.grid{display:grid;gap:16px;grid-template-columns:minmax(0,1fr)}@media(min-width:920px){.grid{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-areas:"tempo chords" "tempo tuner" "history history"}.tempo{grid-area:tempo}.chords{grid-area:chords}.tuner{grid-area:tuner}.history{grid-area:history}}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;min-width:0}.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.card-head h2{font-size:.95rem;font-weight:600;color:var(--text-2);letter-spacing:.02em}.chip{font-size:.8rem;color:var(--text-2);border:1px solid var(--border);border-radius:999px;padding:3px 10px;white-space:nowrap}.chip-good{border-color:var(--good)}.chip-good:before{content:"● ";color:var(--good)}.label,.muted{color:var(--muted)}.label{font-size:.85rem}.tempo{display:flex;flex-direction:column;gap:18px}.tempo[data-holding=true] .bpm-value{opacity:.5}.beat{display:flex;flex-direction:column;align-items:center;gap:14px;padding:8px 0}.beat-ring{--pulse: 0;width:min(260px,70vw);aspect-ratio:1;border-radius:50%;display:grid;place-items:center;border:3px solid var(--border);background:radial-gradient(circle,var(--surface-2) 0%,var(--surface) 70%);transform:scale(calc(1 + var(--pulse) * .04));box-shadow:0 0 calc(var(--pulse) * 48px) calc(var(--pulse) * 6px) rgba(129,140,248,calc(var(--pulse) * .55));will-change:transform,box-shadow}.beat-ring[data-active=true]{border-color:color-mix(in srgb,var(--accent) calc(30% + var(--pulse) * 70%),var(--border))}.beat-dots{display:flex;gap:12px}.beat-dots span{width:10px;height:10px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border)}.beat-dots span.on{background:var(--accent);border-color:var(--accent)}.bpm-readout{display:flex;flex-direction:column;align-items:center}.bpm-value{font-size:clamp(4rem,13vw,6.5rem);font-weight:700;line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}.bpm-decimal{font-size:.4em;color:var(--text-2);letter-spacing:0}.bpm-unit{color:var(--muted);font-weight:600;letter-spacing:.2em;font-size:.85rem;margin-top:4px}.confidence{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px}.confidence .value{font-variant-numeric:tabular-nums;color:var(--text-2);font-size:.85rem;min-width:3ch;text-align:right}.meter{height:8px;background:var(--accent-soft);border-radius:4px;overflow:hidden}.meter-fill{height:100%;background:var(--accent);border-radius:4px;transition:width .2s ease-out}.segmented{display:inline-flex;align-self:center;border:1px solid var(--border);border-radius:10px;overflow:hidden}.segmented button{border:0;background:transparent;padding:8px 18px;cursor:pointer;font-weight:600;color:var(--text-2)}.segmented button+button{border-left:1px solid var(--border)}.segmented button[aria-pressed=true]{background:var(--accent-soft);color:var(--text)}.target{display:flex;flex-direction:column;align-items:center;gap:10px}.target-row{display:flex;align-items:center;gap:8px}.target-value{font-size:1.4rem;font-variant-numeric:tabular-nums;min-width:3ch;text-align:center}.deviation{display:flex;align-items:center;gap:8px;padding:6px 14px;border-radius:999px;border:1px solid;font-variant-numeric:tabular-nums}.deviation-on{border-color:var(--good);background:#34d3991a}.deviation-on>span:first-child{color:var(--good)}.deviation-close{border-color:var(--warn);background:#fbbf241a}.deviation-close>span:first-child{color:var(--warn)}.deviation-off{border-color:var(--bad);background:#f871711f}.deviation-off>span:first-child{color:var(--bad)}.tap{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}.tap-readout{color:var(--text-2);font-variant-numeric:tabular-nums}.chord-body{display:flex;align-items:center;justify-content:space-between;gap:16px}.chord-main{min-width:0}.chord-name{display:block;font-size:clamp(3rem,9vw,4.5rem);font-weight:700;line-height:1.05;letter-spacing:-.02em}.chord-meta{display:flex;gap:10px;align-items:baseline;margin-top:6px}.roman{font-family:Times New Roman,Georgia,serif;font-size:1.3rem;font-weight:700;color:var(--accent)}.tuning-note{margin-top:10px;font-size:.85rem;color:var(--muted)}.tuning-note.tuning-off{color:var(--warn)}.chroma-wheel{width:168px;flex-shrink:0}.chroma-track{fill:var(--surface-2)}.chroma-fill{fill:var(--accent);transition:opacity .12s linear}.chroma-seg.in-chord .chroma-track{stroke:var(--text);stroke-width:2}.chroma-label{font-size:11px;font-weight:600;fill:var(--text);pointer-events:none}.chroma-seg.is-root .chroma-label{font-size:13px}.progression{display:flex;flex-wrap:wrap;gap:6px;list-style:none;margin-top:14px}.progression li{padding:4px 10px;border-radius:8px;background:var(--surface-2);color:var(--text-2);font-weight:600;font-size:.9rem}.progression li.current{background:var(--accent-soft);color:var(--text);outline:1px solid var(--accent)}.progression li.placeholder{background:transparent;color:var(--muted);font-weight:400;padding-left:0}.tuner-body{display:flex;align-items:center;gap:16px}.gauge{width:180px;flex-shrink:0}.gauge-arc{fill:none;stroke:var(--surface-2);stroke-width:10;stroke-linecap:round}.gauge-zone{fill:none;stroke:var(--good);stroke-width:10;opacity:.6}.gauge-tick{stroke:var(--muted);stroke-width:1.5}.needle{transform-box:view-box;transform-origin:100px 100px;transition:transform .12s ease-out,opacity .2s}.needle line{stroke:var(--text);stroke-width:3;stroke-linecap:round}.needle circle{fill:var(--text)}.tuner[data-state=good] .needle line,.tuner[data-state=good] .needle circle{stroke:var(--good);fill:var(--good)}.tuner[data-state=close] .needle line,.tuner[data-state=close] .needle circle{stroke:var(--warn);fill:var(--warn)}.tuner[data-state=off] .needle line,.tuner[data-state=off] .needle circle{stroke:var(--bad);fill:var(--bad)}.note-name{display:block;font-size:3.4rem;font-weight:700;line-height:1}.note-name sub{font-size:.45em;color:var(--text-2);vertical-align:baseline;margin-left:2px}.note-detail{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:8px;align-items:baseline;font-variant-numeric:tabular-nums}.a4-control{display:flex;align-items:center;gap:6px;margin-top:12px;font-size:.9rem}.a4-control label{color:var(--muted);margin-right:4px}.a4-control input{width:4.5em;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:4px 6px;text-align:center}.chart-wrap{position:relative}.chart{width:100%;height:auto;display:block;touch-action:pan-y}.chart .grid{stroke:var(--grid);stroke-width:1}.chart .axis{fill:var(--muted);font-size:11px}.chart .series{fill:none;stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.chart .series-end{fill:var(--accent);stroke:var(--surface);stroke-width:2}.chart .end-label{fill:var(--text);font-size:12px;font-weight:600}.chart .target-line line{stroke:var(--good);stroke-width:1.5}.chart .crosshair line{stroke:var(--text-2);stroke-width:1}.chart .crosshair circle{fill:var(--text);stroke:var(--surface);stroke-width:2}.tooltip{position:absolute;top:0;transform:translate(-50%);background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:4px 10px;font-size:.8rem;display:flex;gap:8px;white-space:nowrap;pointer-events:none}.chart-empty{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;color:var(--muted);font-size:.9rem}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#050714b3;display:grid;place-items:center;padding:16px;z-index:10}.dialog{width:min(520px,100%);max-height:calc(100vh - 32px);overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;display:flex;flex-direction:column;gap:18px}fieldset{border:0}legend,.field>span:first-child{font-weight:600;margin-bottom:6px;display:block}.hint{color:var(--muted);font-size:.85rem;margin-bottom:8px}.radio-row{display:flex;flex-wrap:wrap;gap:8px}.radio{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:8px;padding:6px 10px;cursor:pointer}.radio:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}.field{display:flex;flex-direction:column}.field input[type=range]{accent-color:var(--accent)}.field select{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:6px 8px}.toggle{display:flex;gap:10px;align-items:center}.toggle input{accent-color:var(--accent);width:18px;height:18px}.shortcuts h3{font-size:.9rem;margin-bottom:6px}.shortcuts dl{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;font-size:.9rem;color:var(--text-2)}.shortcuts dt{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.footer{margin-top:24px;text-align:center;color:var(--muted);font-size:.85rem;line-height:1.8}@media(max-width:560px){.app{padding:12px}.chord-body,.tuner-body{flex-direction:column;align-items:stretch}.chroma-wheel,.gauge{align-self:center}.controls{margin-left:0}}@media(prefers-reduced-motion:reduce){.beat-ring{transform:none}.needle,.meter-fill,.level-fill{transition:none}}
