.pitch-workspace {
    flex: 1; min-height: 0; overflow: auto; padding: 6px;
    background: radial-gradient(ellipse at 20% 0%, #182331 0%, transparent 60%), #0c1119;
    --pitch-teal: #66dfca; --pitch-voice: #b9a7ff; --pitch-amber: #f4bb77;
    --pitch-muted: #8593a8; --pitch-line: rgba(162,182,213,.12);
}
.pitch-panel {
    box-sizing: border-box; display: flex; flex-direction: column;
    min-height: 320px; height: 100%; width: 100%;
    overflow: hidden;
}
.pitch-content { display: grid; grid-template-columns: minmax(0,1fr) 172px; gap: 6px; flex: 1; min-height: 0; }
.pitch-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tuner { display: flex; flex-direction: column; min-height: 0; text-align: center; padding: 10px 9px 8px; border: 1px solid #354258; border-radius: 8px; background: linear-gradient(160deg,#1c2738,#141d2b); }
.meter-heading { color: #b3c1d5; font-size: 12px; margin-bottom: 6px; }
.deviation { display: flex; gap: 5px; align-items: baseline; justify-content: center; padding-bottom: 8px; }
.deviation strong { color: #f0f3fb; font-size: 34px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.05em; line-height: 1; }
.deviation span { font-size: 11px; color: var(--pitch-muted); }
.meter-direction { display: flex; justify-content: space-between; color: #798ba5; font-size: 10px; padding: 6px 2px 5px; }
.meter-direction:last-child { padding: 5px 2px 0; }
.gauge { flex: 1; min-height: 130px; position: relative; border: 1px solid #41516b; border-radius: 5px; background: #0d1623; }
.gauge-zone { position: absolute; left: 0; right: 0; box-sizing: border-box; }
.gauge-zone.in-tune { background: #40cf8b38; border-block: 1px solid #65e9a87a; }
.gauge-zone.near { background: #eea34a30; border-block: 1px solid #eea34a38; }
.gauge-zone.off { background: #d8787810; }
.pitch-panel[data-accuracy="in-tune"] .deviation strong { color: #66dfca; }
.pitch-panel[data-accuracy="near"] .deviation strong { color: #f4bb77; }
.pitch-panel[data-accuracy="off"] .deviation strong { color: #e99696; }
.gauge-center { position: absolute; left: -1px; right: -1px; top: 50%; height: 2px; background: #66dfca; box-shadow: 0 0 14px #66dfca28; }
.gauge-center span { position: absolute; left: 9px; bottom: 7px; color: #7ce7d1; font-size: 11px; }
.gauge-center b { position: absolute; right: 9px; bottom: 7px; color: #7ce7d1; font-size: 11px; font-weight: 500; }
.meter-tick { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #8ca2c518; color: #657895; font-size: 9px; font-variant-numeric: tabular-nums; }
.meter-tick span { position: absolute; right: 7px; transform: translateY(-50%); background: #0d1623c9; padding-left: 3px; line-height: 1; }
.meter-tick:first-of-type span { transform: translateY(3px); }
.meter-tick:last-of-type span { transform: translateY(calc(-100% - 3px)); }
.gauge-needle { position: absolute; left: 6px; right: 6px; top: 50%; height: 4px; border-radius: 3px; background: #d3c7ff; box-shadow: 0 0 12px #b9a7ff55; transform: translateY(-50%); transition: top 70ms linear, opacity 120ms; }
.gauge-needle[hidden] { display: none; }
.note-pair { display: grid; gap: 4px; border-top: 1px solid var(--pitch-line); border-bottom: 1px solid var(--pitch-line); padding: 6px 0; }
.note-card { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 5px; text-align: left; min-width: 0; }
.note-card-label { display: flex; gap: 4px; align-items: center; color: #a1afc3; font-size: 10px; white-space: nowrap; }
.pitch-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pitch-teal); flex: 0 0 auto; }
.pitch-dot.voice { background: var(--pitch-voice); }
.note-value { color: var(--pitch-teal); font-size: 17px; font-weight: 550; letter-spacing: -.04em; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.note-card.voice .note-value { color: var(--pitch-voice); }
.note-frequency { color: #7e8ba1; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pitch-chart { display: flex; flex-direction: column; flex: 1; min-height: 0; border: 1px solid var(--pitch-line); border-radius: 8px; background: #0c131e75; overflow: hidden; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 5px 9px; gap: 6px; flex-wrap: wrap; }
.chart-title { display: flex; align-items: center; }
.chart-legend { display: flex; gap: 12px; font-size: 11px; color: #8c9bb0; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.legend-line { width: 15px; height: 3px; border-radius: 3px; background: var(--pitch-voice); }
.legend-band { width: 15px; height: 7px; border-radius: 2px; background: #66dfca3b; border: 1px solid #66dfca77; box-sizing: border-box; }
.chart-options { display: flex; align-items: center; gap: 6px; }
.key-control { display: flex; align-items: center; gap: 7px; color: #8594aa; font-size: 11px; }
.key-control select { font: inherit; color: #cbd7e8; background: #182131; border: 1px solid #344056; border-radius: 6px; padding: 5px 7px; }
.chart-stage { position: relative; flex: 1; min-height: 0; }
.chart-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.debug-panel { position: absolute; z-index: 3; top: 6px; right: 8px; box-sizing: border-box; width: min(300px, calc(100% - 16px)); max-height: calc(100% - 12px); overflow: auto; background: #0c1119ed; padding: 12px; border-radius: 8px; border: 1px solid #3a475c; color: #cbd5e1; font: 11px/1.45 ui-monospace,monospace; }
.debug-panel #debug-text { white-space: pre; }
.debug-panel.hidden { display: none; }
.debug-panel label { display: grid; gap: 4px; margin-bottom: 8px; color: #8c9bb0; }
.debug-panel select { font: inherit; padding: 5px 7px; }
.pitch-workspace select:focus-visible { outline: 2px solid #b9a7ff; outline-offset: 3px; }
@media (max-width: 600px) {
    .pitch-workspace { padding: 4px; }
    .pitch-content { grid-template-columns: minmax(0,1fr) 112px; gap: 4px; }
    .tuner { padding: 8px 6px 6px; }
    .meter-heading { font-size: 11px; }
    .deviation strong { font-size: 29px; }
    .deviation { gap: 3px; }
    .deviation span { font-size: 10px; }
    .note-card { grid-template-columns: 1fr auto; gap: 2px; }
    .note-frequency { grid-column: 1 / -1; text-align: right; font-size: 9px; }
    .note-value { font-size: 16px; }
    .note-card-label { gap: 3px; font-size: 9px; }
    .chart-toolbar { padding: 5px 6px; }
    .chart-legend { gap: 8px; font-size: 10px; }
    .chart-options { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .gauge-needle { transition: none; } }
