/* Shared visual tokens. Night keeps the original studio's colors. */
:root {
  --plot-bg:#151a12; --plot-row-dark:#14190f; --plot-row-light:#1b2116;
  --plot-octave:#53623b55; --plot-line:#8193670f; --plot-label:#7f8e6b; --plot-octave-label:#d7e4bd;
  --plot-time:#879775; --plot-tick:#9aaf7419; --plot-pitch:#80cbb5a0; --plot-preview:#a8f1d8;
  --scope-grid:#8094640d; --scope-wave:#dceebc48; --scope-pitch:#81c7b87a;
  --scope-corrected:#d9f97ebb; --scope-idle:#71825520; --scope-spectrum-end:#70baaa;
  --automation-grid:#72825c25; --automation-label:#8d997c; --automation-cursor:#f0f2e985;
}
.theme-button {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:6px 9px;border:1px solid var(--line);border-radius:8px;font:11px var(--mono);color:var(--muted);white-space:nowrap}
.theme-button:hover {background:var(--panel-raised);color:var(--text);border-color:var(--accent)}
.theme-swatch {width:13px;height:13px;border:1px solid currentColor;border-radius:50%;background:linear-gradient(90deg,var(--accent) 50%,transparent 50%);transform:rotate(-35deg)}

/* Sand: linen surfaces, olive ink, sea glass and muted terracotta. */
:root[data-theme="sand"] {
  color-scheme:light;
  --bg:#e8ddc7; --panel:#f1e7d5; --panel-raised:#e5d8bf; --panel-dark:#e2d5bc;
  --line:#b8aa8e; --line-soft:#d2c4a9;
  --text:#39362d; --muted:#625d50; --subtle:#605849;
  --accent:#53602c; --accent-dim:#dce0c4; --cyan:#2b6259; --orange:#8d482a; --pink:#874861;
  --plot-bg:#e5d9c2; --plot-row-dark:#ded2b9; --plot-row-light:#ede3cf;
  --plot-octave:#94886b77; --plot-line:#8d816b24; --plot-label:#6c6252; --plot-octave-label:#39362d;
  --plot-time:#625d50; --plot-tick:#8d816b45; --plot-pitch:#2f685fb8; --plot-preview:#2f685f;
  --scope-grid:#887b601a; --scope-wave:#59643170; --scope-pitch:#2f685fb3;
  --scope-corrected:#596431ee; --scope-idle:#887b6060; --scope-spectrum-end:#2f685f;
  --automation-grid:#887b6045; --automation-label:#625d50; --automation-cursor:#39362da6;
}
[data-theme="sand"] .theme-swatch {background:#b9a274;border-color:#766543;box-shadow:inset 0 0 0 3px var(--panel)}
[data-theme="sand"] .app-header {background:#e8ddc7f5}
[data-theme="sand"] .scene-dot {box-shadow:0 0 11px #59643125}
[data-theme="sand"] .scene-picker:hover,
[data-theme="sand"] .button.outlined:hover {border-color:var(--accent)}
[data-theme="sand"] .voice-field {background:radial-gradient(ellipse at 45% 110%,#c5c29670,transparent 65%),var(--panel-dark)}
[data-theme="sand"] .demo-button {border-color:#8b9266!important}
[data-theme="sand"] .pitch-note {text-shadow:0 3px 30px #f1e7d580}
[data-theme="sand"] .target-chip {border-color:#b7b68e;background:#f1e7d5d9}
[data-theme="sand"] .button.primary {color:#f8f0df}
[data-theme="sand"] .button.primary:hover {background:#485429}
[data-theme="sand"] .button.subtle {background:var(--panel-raised)}
[data-theme="sand"] .mic-emblem.connected {border-color:var(--accent)}
[data-theme="sand"] .mic-connect.disconnect {background:var(--accent-dim);border-color:#8b9266}
[data-theme="sand"] input[type="range"]::-webkit-slider-runnable-track {background:linear-gradient(to right,var(--range-color,var(--accent)) var(--fill),#c6b99d var(--fill))}
[data-theme="sand"] input[type="range"]::-moz-range-track {background:#c6b99d}
[data-theme="sand"] .level-meter {background:#ccbea1}
[data-theme="sand"] .level-meter>div {background:linear-gradient(90deg,#839052,var(--accent) 65%,#b57540 85%,#aa443b)}
[data-theme="sand"] .meter-labels .clipping {color:#a1322b}
[data-theme="sand"] .switch-visual {border-color:#a29478;background:#d6c9ad}
[data-theme="sand"] .switch-row input:checked+.switch-visual:after {background:#f1e7d5}
[data-theme="sand"] .module-mark,
[data-theme="sand"] .power-button.is-on,
[data-theme="sand"] .transport-source-icon {background:var(--accent-dim);border-color:#adb78a}
[data-theme="sand"] .piano-key {background:#d4c7ad;border-color:#ab9e81;color:#625b4a}
[data-theme="sand"] .piano-key.black {background:#655f50;border-color:#4a483b;color:#e5dbc4;box-shadow:0 4px 5px #44392325}
[data-theme="sand"] .piano-key.selected {background:#f3ecd8;border-color:#b5aa89;color:#444735}
[data-theme="sand"] .piano-key.black.selected {background:#7a8450;border-color:#535f30;color:#fff4dc}
[data-theme="sand"] .piano-key.held {background:var(--accent);border-color:var(--accent);color:#f8f0df;box-shadow:0 0 20px #59643130}
[data-theme="sand"] .amount-dial {background:conic-gradient(from 225deg,var(--accent) calc(var(--value)*2.7deg),#c5b99e 0deg 270deg,transparent 270deg)}
[data-theme="sand"] .amount-dial:after {border-color:#b8b48d}
[data-theme="sand"] .amount-dial>div {background:radial-gradient(ellipse at 35% 20%,#f3ecd8,#ded4b9 70%);box-shadow:inset 0 -3px 8px #89764a12,0 7px 15px #89764a12}
[data-theme="sand"] .intention-panel {background:radial-gradient(ellipse at 85% 100%,#c3c59450,transparent 70%),var(--panel)}
[data-theme="sand"] .intention-pad {border-color:#b5ad88;background:repeating-linear-gradient(90deg,transparent,transparent calc(20% - 1px),#8d816b16 calc(20% - 1px),#8d816b16 20%),repeating-linear-gradient(0deg,transparent,transparent calc(25% - 1px),#8d816b16 calc(25% - 1px),#8d816b16 25%),#e4dcc3}
[data-theme="sand"] .pad-label {color:var(--muted)}
[data-theme="sand"] .pad-axis {background:#7a845030}
[data-theme="sand"] .intention-dot {border-color:#59643170;box-shadow:0 0 0 9px #5964310c,0 0 0 20px #59643106}
[data-theme="sand"] .intention-dot>span {box-shadow:0 0 15px #59643145}
[data-theme="sand"] .intention-glow {background:radial-gradient(circle,#7a845026,transparent 70%)}
[data-theme="sand"] .intention-panel.automated .intention-dot {box-shadow:0 0 25px #59643140}
[data-theme="sand"] .route-tune {border-color:#adb78a}
[data-theme="sand"] .transport {background:#e8decafc;border-color:#b8aa8e;box-shadow:0 -12px 50px #73654814}
[data-theme="sand"] .record-button {border-color:#b58a75;background:#e7cdbc}
[data-theme="sand"] .record-dot {background:#a84c3e}
[data-theme="sand"] .record-button.recording {border-color:#9f4437;background:#d8b2a0;box-shadow:0 0 0 4px #a84c3e16}
[data-theme="sand"] .play-button {background:#cbd1ad;color:#354020}
[data-theme="sand"] .seek-label input {--range-color:#738246}
[data-theme="sand"] .ab-switch {background:#ded2b8}
[data-theme="sand"] .ab-switch button.active {background:#c9cfaa}
[data-theme="sand"] .engine-footer {background:#e2d6be;border-color:#cfc0a3;color:#625d50}
[data-theme="sand"] .version {color:#6c6252}
[data-theme="sand"] .editor-empty {background:radial-gradient(ellipse at 50% 80%,#c5c29655,transparent 60%),var(--panel-dark)}
[data-theme="sand"] .editor-empty-icon {background:#d4d7b5;border-color:#adb78a}
[data-theme="sand"] .editor-scroll {scrollbar-color:#a89d80 #e5d9c2}
[data-theme="sand"] .note-blob {background:linear-gradient(180deg,#a8b178,#8d9c60);border-color:#687849;color:#202b16;box-shadow:0 3px 8px #69583b15}
[data-theme="sand"] .note-blob.edited {background:linear-gradient(180deg,#d6a27d,#c58864);border-color:#a36747;color:#3a2118}
[data-theme="sand"] .editor-playhead,
[data-theme="sand"] .editor-playhead:before {background:#51493b;box-shadow:none}
[data-theme="sand"] .dialog {background:var(--panel);border-color:#b2a286;box-shadow:0 30px 130px #3c332a45;scrollbar-color:#a89d80 var(--panel)}
[data-theme="sand"] .dialog::backdrop {background:#3c332a70}
[data-theme="sand"] .module-option,
[data-theme="sand"] .shortcuts {background:var(--panel-raised)}
[data-theme="sand"] .export-options label:has(input:checked) {border-color:var(--accent);background:var(--accent-dim)}
[data-theme="sand"] kbd {background:#eee3cd;border-color:#b5a78b}
[data-theme="sand"] .toast {background:#e5e3c9;border-color:#919967;box-shadow:0 12px 40px #3c332a25}
[data-theme="sand"] .toast.error {background:#edd2c3;border-color:#a96850}
[data-theme="sand"] .toast.error>span:first-child {color:#8b402e}
[data-theme="sand"] .busy-banner {background:#e1dec4;border-color:#919967;box-shadow:0 9px 30px #3c332a20}
[data-theme="sand"] .spinner {border-color:#a3ad7c;border-top-color:var(--accent)}
[data-theme="sand"] .busy-banner progress::-webkit-progress-bar {background:#c3c69f}
[data-theme="sand"] .drop-overlay {background:#e8ddc7f2}
[data-theme="sand"] .analysis-alert {background:#eedabc;border-color:#b68c59;color:#694622}
[data-theme="sand"] .recovery-banner {border-color:#a5ab7d;background:linear-gradient(105deg,#dce0c4,var(--panel))}
[data-theme="sand"] .intention-panel.automated .gesture-arm {border-color:#a5ab7d}
[data-theme="sand"] .automation-panel {background:linear-gradient(130deg,#eee3cd,#e6ddc7)}
[data-theme="sand"] .choir-panel {background:radial-gradient(ellipse at 10% 80%,#9dbab02c,transparent 60%),var(--panel)}
[data-theme="sand"] .choir-stage {border-color:#9eae93;background:radial-gradient(ellipse at 50% 106%,#8ab2a638,transparent 70%),repeating-radial-gradient(ellipse at 50% 106%,transparent 0 49px,#50746612 50px 51px),#e0dfc8}
[data-theme="sand"] .choir-threads line {stroke:#2f685f99}
[data-theme="sand"] .choir-threads line:last-child {stroke:#775e8c99}
[data-theme="sand"] .choir-grid-path {stroke:#52736650}
[data-theme="sand"] .choir-point {background:#eee7d3;box-shadow:0 0 0 7px #52736609,0 0 32px #52736615}
[data-theme="sand"] .voice-a {--voice-color:#2f685f}
[data-theme="sand"] .voice-b {--voice-color:#775e8c}
[data-theme="sand"] .choir-presets button {background:#f1e7d560}
[data-theme="sand"] .compass-panel {background:linear-gradient(120deg,#b8c7ac38,transparent 70%),var(--panel)}
[data-theme="sand"] .compass-emblem {border-color:#a4b095}
[data-theme="sand"] .compass-card {background:#e2dac330}
[data-theme="sand"] .compass-card:not(:disabled):hover,
[data-theme="sand"] .compass-card.selected {border-color:#618576;background:#cdd9bc55}
[data-theme="sand"] .studio-about {background:linear-gradient(120deg,#c5c29630,transparent 70%),var(--panel)}
[data-theme="sand"] .preset-card {--scene-ink:color-mix(in srgb,var(--scene-color) 38%,#343c29)}
@media(max-width:1250px) {.theme-button {padding:6px 7px;gap:5px}}
@media(max-width:420px) {.app-header {column-gap:8px}.brand {font-size:22px;gap:9px}.nav-button {font-size:11px;gap:5px}.theme-button {width:31px;min-height:32px;padding:6px}.theme-button .theme-name {display:none}}
@media(max-width:360px) {.main-nav .icon {display:none}.nav-button {padding-left:5px;padding-right:5px}}
