/* Semantic bridge loaded after legacy tools. Artwork/export palettes are deliberately untouched. */
:root[data-theme]{--paper:var(--sc-canvas);--ink:var(--sc-text);--muted:var(--sc-secondary);--line:var(--sc-border);--white:var(--sc-panel);--lime:var(--sc-inverse-accent);--dark:#14201b;--green:var(--sc-accent-text);--sc-words:#193d22;--sc-words-soft:#ddebdc;--sc-rhythm:#55300b;--sc-rhythm-soft:#f5e4d2;--sc-voice:#40265f;--sc-voice-soft:#e8dffa;--sc-warning:#593800;--sc-warning-soft:#fff0ce;--sc-danger:#9b2532;--sc-danger-soft:#fce3e5}
:root[data-theme=dark]{--sc-words:#d1f5cb;--sc-words-soft:#223d2c;--sc-rhythm:#ffe3bf;--sc-rhythm-soft:#443421;--sc-voice:#e9daff;--sc-voice-soft:#342b48;--sc-warning:#ffe4a8;--sc-warning-soft:#402d12;--sc-danger:#ffcece;--sc-danger-soft:#4a2424}
[data-theme] body{background:var(--sc-canvas);color:var(--sc-text)}
[data-theme] :is(button,input,select,textarea,summary,a):focus-visible{outline:3px solid var(--sc-focus);outline-offset:3px}
[data-theme] :is(input,textarea,select){accent-color:var(--sc-solid)}
[data-theme] :is(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]),textarea,select){background:var(--sc-panel);color:var(--sc-text);border-color:var(--sc-border)}
[data-theme] :is(input,textarea)::placeholder{color:var(--sc-secondary);opacity:1}
[data-theme] :is(.topbar,.panel,.song-brief,.compose-desk,.compose-expanded,.clip-editor,.sound-card){background:var(--sc-panel);border-color:var(--sc-border);color:var(--sc-text)}
[data-theme] :is(.panel-head,.editor-foot,.map-intro,.map-footer,.clip-section-title,.assignment-table th,.assignment-table td,.prompter-controls,.drum-details,.reference-details,.block-arrange,.example-choice){border-color:var(--sc-border)}
[data-theme] :is(.panel-head h3,.sound-card strong,.import-zone h4,.mix-channel h4,.clip-editor strong,.clip-empty strong,.inline-tool-heading h3,.song-brief>summary strong){color:var(--sc-text);font-weight:700}
[data-theme] :is(.eyebrow,.field,.small-label,.small-copy,.panel-head span,.lyric-meta,.editor-foot,.map-intro,.map-footer,.map-index,.bars-unit,.sound-card small,.import-zone p,.mix-channel>span,.mix-channel small,.check-item,.reference-details,.record-stage p,.clip-editor summary small,.clip-saved,.clip-section-title,.clip-section-title span,.clip-editor-body>.small-copy,.voice-confidence,.vocal-desk .panel-head>div>span,.assignment-table small,.drum-region small,.drum-region span,.compose-guidance,.compose-footnote,.compose-lane-empty,.compose-bed,.block-local-note,.block-topline,.block-status,.block-bottom,.block-next-row p,.empty-map-label,.scope-note,.song-anchor-note){color:var(--sc-secondary);opacity:1}
[data-theme] :is(.eyebrow,.small-label){font-weight:750;letter-spacing:.12em}
[data-theme] :is(.small-copy,.block-local-note,.compose-footnote,.clip-editor summary small,.assignment-table small){font-size:11px}
[data-theme] :is(.title-line h1,.workspace-heading h2,.inline-tool-heading h3,.section-module-header strong,.ingredient-block>strong){font-family:Manrope,Arial,sans-serif;font-weight:800;letter-spacing:-.035em}
[data-theme] .title-line h1{letter-spacing:-.045em}
[data-theme] :is(.button.primary,.button.dark,.play-button){background:var(--sc-solid);border-color:var(--sc-solid);color:var(--sc-on-solid);font-weight:750}
[data-theme] .button.primary:hover:not(:disabled),[data-theme] .button.dark:hover:not(:disabled){background:var(--sc-solid-hover);filter:none}
[data-theme] :is(.button.secondary,.tool-choice,.pattern-card,.draft-item){background:var(--sc-panel);border-color:var(--sc-border);color:var(--sc-text);font-weight:650}
[data-theme] :is(.text-button,.subtle-button,.icon-button,.edit-title,.map-select,.move-controls button,.block-breadcrumbs button,.map-quick-actions>button,.lyric-entry-options button){color:var(--sc-accent-text);font-weight:650}
[data-theme] :is(.text-button,.subtle-button){min-height:36px}
[data-theme] main a,[data-theme] dialog a{color:var(--sc-accent-text)}
[data-theme] :is(.idea-note,.note-box,.lesson-example,.import-zone,.voice-fallback,.voice-beat-progress,.scope-note,.song-anchor-note,.compose-inspector,.mix-channel,.prompter-shell,.drum-region,.clip-timeline){background:var(--sc-inset);border-color:var(--sc-border);color:var(--sc-text)}
[data-theme] :is(.idea-note strong,.idea-note p,.lesson-example p,.lesson-practice,.lesson-body h3,.voice-hit-list li){color:var(--sc-text)}
[data-theme] .voice-hit-list li{background:var(--sc-inset)}
[data-theme] :is(.mood-pill,.planned,.draft-pill,.tag){background:var(--sc-inset);color:var(--sc-secondary);border-color:var(--sc-border)}
[data-theme] :is(.lyrics-textarea,.prompter-words){color:var(--sc-text);background:var(--sc-panel)}
[data-theme] .lyrics-textarea{border:0}
[data-theme] .section-tab{background:var(--sc-inset);color:var(--sc-secondary)}
[data-theme] :is(.section-tab.active,.lesson-nav button.active,.pattern-card.selected,.map-item.selected,.journey-step.active){background:var(--sc-soft);border-color:var(--sc-solid);color:var(--sc-on-soft);box-shadow:none}
[data-theme] .map-item{background:var(--sc-inset);border-color:var(--sc-border);color:var(--sc-text)}
[data-theme] .map-item[data-type=Chorus],[data-theme] .map-item[data-type='Final chorus']{background:var(--sc-words-soft)}
[data-theme] .map-item[data-type=Bridge]{background:var(--sc-rhythm-soft)}
[data-theme] .map-item.selected{outline:2px solid var(--sc-focus);outline-offset:-2px}
[data-theme] :is(.add-section,.add-building-block){background:var(--sc-panel);border-color:var(--sc-border);color:var(--sc-accent-text)}
[data-theme] .section-tag{background:var(--sc-voice-soft);color:var(--sc-voice)}
[data-theme] .pattern-card :is(span,small){color:var(--sc-secondary)}
[data-theme] .pattern-card.selected :is(span,small){color:var(--sc-on-soft)}
[data-theme] .beat-step{background:var(--sc-inset);border:1px solid var(--sc-border)}
[data-theme] .beat-step.on{background:var(--sc-solid);border-color:var(--sc-solid)}
[data-theme] .beat-step.snare.on{background:var(--sc-voice);border-color:var(--sc-voice)}
[data-theme] .beat-step.hat.on{background:var(--sc-rhythm);border-color:var(--sc-rhythm)}
[data-theme] :is(.clip-kind,.sound-icon,.voice-activity,.compose-layer-chips>span){background:var(--sc-voice-soft);border-color:var(--sc-voice);color:var(--sc-voice)}
[data-theme] :is(.clip-warning,.arrangement-warnings){background:var(--sc-warning-soft);border-color:var(--sc-warning);color:var(--sc-warning)}
[data-theme] .arrangement-warnings p{color:var(--sc-warning)}
[data-theme] .clip-editor>summary{background:var(--sc-inset);color:var(--sc-text)}
[data-theme] .clip-editor>summary:after{color:var(--sc-accent-text)}
[data-theme] .clip-form-grid .field,[data-theme] .clip-form-grid .field :is(input,select){color:var(--sc-text)}
[data-theme] .clip-timeline-row>span{color:var(--sc-secondary)}
[data-theme] .clip-timeline-row>div{border-color:var(--sc-border);background:repeating-linear-gradient(90deg,transparent,transparent calc(12.5% - 1px),var(--sc-border) calc(12.5% - 1px),var(--sc-border) 12.5%)}
[data-theme] .timeline-clip{background:var(--sc-words-soft);color:var(--sc-words)}
[data-theme] .timeline-clip.vocal{background:var(--sc-voice-soft);color:var(--sc-voice)}
[data-theme] :is(.clip-form-grid input[type=range],.mix-channel input,.assignment-table input,.check-item input){accent-color:var(--sc-solid)}
[data-theme] .record-options{border-color:var(--sc-border)}
[data-theme] .record-options legend,[data-theme] .record-options .small-copy{color:var(--sc-secondary)}
[data-theme] .record-art{background:var(--sc-inset);border-color:var(--sc-panel);box-shadow:0 0 0 2px var(--sc-border)}
[data-theme] .record-art svg{color:var(--sc-accent-text)}
[data-theme] .record-art.recording{background:var(--sc-danger-soft);border-color:var(--sc-panel);box-shadow:0 0 0 3px var(--sc-danger)}
[data-theme] .record-art.recording svg,[data-theme] .count-in-display{color:var(--sc-danger)}
[data-theme] .record-stage .button{background:var(--sc-solid);color:var(--sc-on-solid)}
[data-theme] .prompter-words{background:transparent}
[data-theme] .lyric-prompter{scrollbar-color:var(--sc-solid) var(--sc-inset)}
[data-theme] .prompter-section .eyebrow{color:var(--sc-accent-text)}
[data-theme] .prompter-empty{color:var(--sc-secondary)}
[data-theme] :is(.compose-scroll,.compose-ruler>span,.compose-lane-name){background:var(--sc-inset);border-color:var(--sc-border);color:var(--sc-secondary);scrollbar-color:var(--sc-solid) var(--sc-inset)}
[data-theme] .compose-ruler{color:var(--sc-secondary)}
[data-theme] .compose-lane-track{background:repeating-linear-gradient(90deg,transparent 0,transparent 24px,var(--sc-border) 24px,var(--sc-border) 25px)}
[data-theme] .compose-section{background:var(--sc-words-soft);border-color:var(--sc-words);color:var(--sc-words)}
[data-theme] .compose-section:nth-child(3n+2){background:var(--sc-rhythm-soft);border-color:var(--sc-rhythm);color:var(--sc-rhythm)}
[data-theme] .compose-section:nth-child(3n){background:var(--sc-voice-soft);border-color:var(--sc-voice);color:var(--sc-voice)}
[data-theme] :is(.compose-section-name,.compose-section-name small,.compose-section-handle){color:inherit}
[data-theme] .compose-expand{background:var(--sc-panel);color:var(--sc-text)}
[data-theme] .compose-item{background:var(--sc-words-soft);border-color:var(--sc-words);color:var(--sc-words)}
[data-theme] .compose-item.clip{background:var(--sc-voice-soft);border-color:var(--sc-voice);color:var(--sc-voice)}
[data-theme] .compose-item.region{background:var(--sc-rhythm-soft);border-color:var(--sc-rhythm);color:var(--sc-rhythm)}
[data-theme] .compose-item.resolved{background:var(--sc-words-soft);border-color:var(--sc-words);color:var(--sc-words)}
[data-theme] :is(.compose-section.selected,.compose-item.selected){outline:3px solid var(--sc-focus);outline-offset:1px;box-shadow:none}
[data-theme] .compose-item small{opacity:1}
[data-theme] .compose-expanded p{color:var(--sc-secondary)}
[data-theme] .compose-lyric-preview{color:var(--sc-text)!important}
[data-theme] .compose-empty-expand{color:var(--sc-secondary);border-color:var(--sc-border)}
[data-theme] dialog,[data-theme] #voiceDialog{background:var(--sc-panel);color:var(--sc-text);border:1px solid var(--sc-border)}
[data-theme] dialog::backdrop{background:#07120dcc;backdrop-filter:blur(3px)}
[data-theme] :is(dialog p,dialog ul,#voiceDialog p){color:var(--sc-secondary)}
[data-theme] :is(dialog h2,#voiceDialog h2){font-family:Manrope,Arial,sans-serif;font-weight:800;color:var(--sc-text);letter-spacing:-.03em}
[data-theme] #voiceDialog a{color:var(--sc-accent-text)}
[data-theme] .dictation-interim{opacity:1;color:var(--sc-secondary)}
[data-theme] .toast{background:var(--sc-text);color:var(--sc-canvas);border:1px solid var(--sc-border)}
/* The main map: stronger edges and clear editing-versus-playing states. */
[data-theme] .anchored-song-view .block-navigation{background:var(--sc-canvas);border-color:var(--sc-border);backdrop-filter:none;box-shadow:0 5px 0 var(--sc-canvas)}
[data-theme] .block-breadcrumbs{color:var(--sc-secondary)}
[data-theme] .block-breadcrumbs [aria-current=page]{color:var(--sc-text);font-weight:800}
[data-theme] .anchored-map-top>.text-button,[data-theme] .anchored-map-top .block-breadcrumbs button,[data-theme] .map-quick-actions>button{color:var(--sc-accent-text)}
[data-theme] .anchored-map-strip>button{background:var(--sc-inset);border:1px solid var(--sc-border);color:var(--sc-text)}
[data-theme] .anchored-map-strip>button small{color:var(--sc-secondary)}
[data-theme] .anchored-map-strip>button[aria-pressed=true]{outline:3px solid var(--sc-focus);outline-offset:-3px}
[data-theme] .anchored-map-strip>button.is-playing{background:var(--sc-solid);border-color:var(--sc-solid);color:var(--sc-on-solid)}
[data-theme] .anchored-map-strip>button.is-playing small{color:var(--sc-on-solid)}
[data-theme] .anchored-map-strip>button.is-playing[aria-pressed=true]{outline-color:var(--sc-on-solid);box-shadow:inset 0 0 0 5px var(--sc-solid)}
[data-theme] .map-clock-row,[data-theme] .map-clock-row #mapClock{color:var(--sc-secondary);font-size:10px}
[data-theme] .song-brief>summary{color:var(--sc-secondary)}
[data-theme] .song-brief>.small-copy{color:var(--sc-secondary)}
[data-theme] .section-module{background:var(--sc-panel);border:1px solid var(--sc-border)}
[data-theme] .section-module.is-open{border:2px solid var(--sc-focus);box-shadow:none}
[data-theme] .section-module-header.song-building-block{background:var(--sc-words-soft);color:var(--sc-words);border-radius:0}
[data-theme] .section-module.tone-1>.section-module-header{background:var(--sc-rhythm-soft);color:var(--sc-rhythm)}
[data-theme] .section-module.tone-2>.section-module-header{background:var(--sc-voice-soft);color:var(--sc-voice)}
[data-theme] .section-module-header .block-number{background:var(--sc-panel);color:var(--sc-text);border:1px solid currentColor;padding:7px;border-radius:6px;opacity:1;font-weight:800;letter-spacing:0}
[data-theme] .section-module-header small,[data-theme] .section-range{color:inherit;opacity:1}
[data-theme] .section-module-header:focus-visible{outline:3px solid currentColor;outline-offset:-4px}
[data-theme] .section-module .ingredient-block{background:var(--sc-panel);border:1px solid var(--sc-border);border-top:4px solid var(--sc-words);box-shadow:none;color:var(--sc-text)}
[data-theme] .section-module .ingredient-block.beat{border-top-color:var(--sc-rhythm)}
[data-theme] .section-module .ingredient-block.voice{border-top-color:var(--sc-voice)}
[data-theme] .ingredient-block .block-glyph{background:var(--sc-inset);color:var(--sc-text)}
[data-theme] .ingredient-block .eyebrow,[data-theme] .section-module .ingredient-block>p{color:var(--sc-secondary);opacity:1}
[data-theme] .block-open{color:var(--sc-accent-text);font-weight:750}
[data-theme] .block-arrange summary{color:var(--sc-text);font-weight:700}
[data-theme] .section-module-list>.add-building-block{background:var(--sc-panel);border:2px dashed var(--sc-border);color:var(--sc-accent-text);box-shadow:none}
[data-theme] .structure-preview li{color:var(--sc-text);border-color:var(--sc-border)}
[data-theme] .structure-preview li span{color:var(--sc-secondary)}
[data-theme] .tool-choice:hover{border-color:var(--sc-solid);filter:none}
/* Fixed inverse surfaces remain useful in either theme. */
[data-theme] :is(.sidebar,.session,.prompter-toolbar,.clip-waveform){background:#14201b;color:#f3f8f1;border-color:#607666}
[data-theme] .brand{font-weight:800;color:#fff;letter-spacing:-1.2px}
[data-theme] :is(.brandmark,.tiny-wave){color:var(--sc-inverse-accent)}
[data-theme] .brand-sub{color:#c3d2c4;font-weight:650}
[data-theme] :is(.sidebar-label,.project-link small,.sidebar-note p,.account small,.nav-count,.session-label,.session-footer,.master-control label,.mini-track label,.transport small,.prompter-toolbar span){color:#c3d2c4;opacity:1}
[data-theme] :is(.nav-item,.new-project,.account,.project-link,.sidebar-note h3){color:#f3f8f1;border-color:#607666;opacity:1}
[data-theme] .nav-item.active{background:#293a2e;color:var(--sc-inverse-accent);font-weight:750;border-left:3px solid var(--sc-inverse-accent)}
[data-theme] .project-dot{background:var(--sc-inverse-accent)}
[data-theme] .simple-block-view .sidebar-note{opacity:1}
[data-theme] .session :is(.text-button,.stop-button){color:var(--sc-inverse-accent)}
[data-theme] .session .master-control input{accent-color:var(--sc-inverse-accent)}
[data-theme] .prompter-toolbar .button{background:var(--sc-panel);color:var(--sc-text);border-color:var(--sc-border)}
[data-theme] .breadcrumb,[data-theme] .breadcrumb strong,[data-theme] .save-status{color:var(--sc-secondary)}
[data-theme] .save-status>span{background:var(--sc-solid)}
[data-theme] .round-avatar{background:var(--sc-solid);color:var(--sc-on-solid);font-weight:800}
/* Appearance is intentionally compact and separate from project editors. */
.appearance-launch{margin:0 0 16px;min-height:44px}
.appearance-settings fieldset{margin:20px 0;padding:0;border:0;min-width:0}
.appearance-settings legend{font-size:13px;font-weight:750;margin-bottom:12px;color:var(--sc-text)}
.appearance-mode>div{display:flex;gap:8px;flex-wrap:wrap}
.appearance-mode label{display:flex;align-items:center;gap:8px;min-height:44px;padding:10px 12px;background:var(--sc-inset);color:var(--sc-text);border:1px solid var(--sc-border);border-radius:8px;font-size:12px;cursor:pointer;flex:1;white-space:nowrap}
.appearance-mode input{accent-color:var(--sc-solid);margin:0}
.appearance-swatches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.appearance-swatches button{display:flex;align-items:center;gap:10px;min-height:46px;padding:10px 12px;border:1px solid var(--sc-border);background:var(--sc-panel);color:var(--sc-text);border-radius:8px;font-size:12px;font-weight:650}
.appearance-swatches button[aria-pressed=true]{outline:2px solid var(--sc-focus);outline-offset:-2px;background:var(--sc-soft);color:var(--sc-on-soft)}
.appearance-swatches button[aria-pressed=true]:after{content:'';display:inline-block;width:1.2em;height:1.2em;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m5%2012%204%204L19%206%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;margin-left:auto}
.appearance-swatch{width:20px;height:20px;flex-shrink:0;border:1px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #14201b}
.appearance-custom{display:grid;grid-template-columns:90px minmax(0,1fr);align-items:end;gap:12px;margin-top:20px}
.appearance-custom label{font-size:11px;font-weight:650;color:var(--sc-secondary);display:flex;gap:8px;flex-direction:column;min-width:0}
.appearance-custom input{height:44px;min-width:0;width:100%;border:1px solid var(--sc-border);border-radius:6px;padding:9px;background:var(--sc-panel);color:var(--sc-text)}
.appearance-custom input[type=color]{cursor:pointer;padding:4px}
.appearance-custom .button{grid-column:1/-1;min-height:44px}
.appearance-status{padding:12px;background:var(--sc-inset);border:1px solid var(--sc-border);border-radius:8px;font-size:11px}
.appearance-settings #resetAppearance{min-height:44px}
@media(max-width:640px){[data-theme] .map-clock-row{font-size:9px}.appearance-mode label{font-size:11px;padding:10px 8px}.appearance-settings .small-copy{font-size:12px}[data-theme] .section-module-header .block-number{padding:6px}}
@media(prefers-reduced-motion:reduce){[data-theme] *,[data-theme] *:before,[data-theme] *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){.appearance-swatches button[aria-pressed=true],[data-theme] .anchored-map-strip>button[aria-pressed=true]{outline:3px solid Highlight}.appearance-swatch{border:2px solid CanvasText}}
[data-theme] .nav-item.active{color:#f3f8f1}
[data-theme] :is(.sidebar,.session,.prompter-toolbar,.clip-waveform) :is(button,a,input):focus-visible{outline-color:var(--sc-inverse-accent)}
[data-theme] .mute-button{color:var(--sc-secondary);border-color:var(--sc-border)}
[data-theme] .mute-button.muted{background:var(--sc-warning-soft);color:var(--sc-warning);border-color:var(--sc-warning)}
[data-theme] :is(.large-quote,.prompt-card p,.guide-list,.reference-details p,.integration-card p,.example-choice,.gentle-options){color:var(--sc-secondary)}
[data-theme] .large-quote{color:var(--sc-text)}
[data-theme] :is(.prompt-card,.integration-card,.harmony-note,.journey){background:var(--sc-inset);color:var(--sc-text);border-color:var(--sc-border)}
[data-theme] :is(.integration-card strong,.guide-list strong){color:var(--sc-text);font-weight:700}
[data-theme] :is(.harmony-note p,.harmony-note .check-item,.integration-card p,.guide-list li,.guide-list p,.journey-step){color:var(--sc-secondary)}
[data-theme] .guide-list .num{background:var(--sc-soft);color:var(--sc-on-soft);border-color:var(--sc-border)}
[data-theme] :is(.mood-pill.active,.workspace-mode .button[aria-pressed=true]){background:var(--sc-soft);color:var(--sc-on-soft);border-color:var(--sc-solid)}

/* Restrained neon accents; no animation or glow on reading text. */
:root[data-purple-glow="true"] .button.primary:not(:disabled),
:root[data-purple-glow="true"] [role="tab"][aria-selected="true"]{box-shadow:0 0 0 1px #b994f0,0 0 12px #a274e04d}
:root[data-purple-glow="true"] .record-audio-control{box-shadow:none!important}
:root[data-purple-glow="true"] :focus-visible{outline:3px solid var(--sc-focus);outline-offset:3px}
:root .record-audio-control .record-glyph{color:#ff6878!important;font-size:22px!important;line-height:1;display:inline-block;letter-spacing:0}
@media(max-width:600px){.vocal-record-toolbar .record-audio-control{width:100%;min-height:56px;flex:1 0 100%;font-size:16px}}
