html[data-theme=dark]{color-scheme:dark;--bg:#10141b;--surface:#1b222c;--ink:#edf1f7;--muted:#a6b2c3;--line:#35404e;--warm:#2c281f;--gold:#d9ae69;--gold-dark:#d9ae69;--shadow:0 14px 35px #0003}
html[data-theme=light]{color-scheme:light;--bg:#f2f0eb;--surface:#fff;--ink:#202833;--muted:#626e7d;--line:#dcdfe3;--warm:#f7f2e9;--gold:#bc8b42;--gold-dark:#8f682c}
html[data-theme] body{background:var(--bg);color:var(--ink)}
html[data-theme] :is(.panel,.topbar,.hymnal-panel,.visitor-card,.users-panel,.share-users,.setlist-card,.song-card,.slide-deck-card){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea,select){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.hymnal-banner,.bible-studio-head){background:linear-gradient(110deg,var(--surface),var(--warm));color:var(--ink)}
html[data-theme] :is(.hymnal-row,.setlist-row,.user-row){border-color:var(--line);color:var(--ink)}html[data-theme] .hymnal-row:hover{background:var(--warm)}
html[data-theme] .btn.ghost{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] .share-users{padding:24px;border:1px solid var(--line);border-radius:14px}.share-users summary{font-weight:800;cursor:pointer}.share-users summary span{margin-left:10px;font-size:11px;color:var(--gold-dark);background:var(--warm);padding:5px 9px;border-radius:20px}.share-users>p{color:var(--muted);font-size:13px;line-height:1.6}.share-search{display:block;max-width:480px;font-size:12px;font-weight:700}.share-search input{margin-top:8px}.share-user-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin:20px 0;max-height:380px;overflow:auto}.share-user-row{display:flex!important;align-items:center;gap:12px;padding:12px!important;border:1px solid var(--line);border-radius:10px;cursor:pointer;overflow-wrap:anywhere}.share-user-row[hidden]{display:none!important}.share-user-row:has(input:checked){border-color:var(--gold);background:var(--warm)}.share-user-row input[type=checkbox]{width:18px!important;height:18px;margin:0;accent-color:var(--gold)}.share-avatar{display:grid;place-items:center;width:34px;height:34px;flex-shrink:0;background:var(--warm);color:var(--gold-dark);border-radius:50%;font-weight:800}.share-users footer{display:flex;align-items:center;justify-content:space-between;gap:14px}.share-users footer small{color:var(--muted)}
html[data-theme] #padsPanel{position:fixed;inset:auto 24px 24px auto;margin:0;z-index:2000;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:0 18px 65px #0006;padding:20px}#padsPanel .pads-console-head{cursor:move;touch-action:none}#padsPanel .pad-manual-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}#padsPanel .pad-manual-controls label{font-size:12px}#padsPanel .pad-manual-controls select{width:100%}#padsPanel small,#padsPanel #padSongHint{color:var(--muted)}
html[data-theme=light] .presentation-workspace :is(.console-page,.console-inline-head,.console-service-controls,.operator-preview,.cue-panel,.cue-song-group,.cue-song-head,.video-queue-dock,.console-notices-column,.stage-note-editor,.public-notice-editor,.video-queue-list,.quick-song-panel,.quick-video-panel,.video-transport-shell,.video-transport){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=light] .presentation-workspace :is(.console-section-title h2,.console-song,.console-song strong,.cue-song-title,.chord-chart){color:var(--ink)}
html[data-theme=light] .presentation-workspace :is(.console-empty,.cue-card,.cue-button){background:var(--bg);color:var(--ink);border-color:var(--line)}
html[data-theme=light] .presentation-workspace :is(.console-section-title,.preview-head,.console-song small,.console-song span,.screen-status,.console-empty,.cue-song-meta){color:var(--muted)}
html[data-theme=light] #preparedContentDialog{background:var(--surface);color:var(--ink);border-color:var(--line)}html[data-theme=light] #preparedContentDialog :is(.prepared-options button,.prepared-list-choice,.prepared-close){background:var(--bg);color:var(--ink);border-color:var(--line)}html[data-theme=light] #preparedContentDialog :is(small,#preparedContentHelp,.prepared-dialog-foot){color:var(--muted)}
html[data-theme=dark] :is(.bible-reader,.bible-navigator,.bible-preview-panel,.bible-background-library,.bible-queue-panel,.bible-command-bar){background:var(--surface);color:var(--ink)}html[data-theme=dark] :is(.bible-verse,.bible-book-list button,.bible-chapter-grid button){color:var(--ink);border-color:var(--line)}
html[data-theme] #themeToggle{white-space:nowrap;min-width:85px}html[data-theme] button:focus-visible{outline:2px solid var(--gold);outline-offset:3px}@media(max-width:600px){.share-user-grid{grid-template-columns:1fr}.share-users footer{align-items:stretch;flex-direction:column}html[data-theme] #padsPanel{right:12px;bottom:12px}.share-users{padding:16px!important}}
html[data-theme=light] .presentation-workspace .topbar{background:var(--surface);border-color:var(--line);color:var(--ink)}html[data-theme=light] .presentation-workspace .topbar h1{color:var(--ink)}html[data-theme=light] .presentation-workspace .top-actions .btn.ghost{background:var(--bg);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.login-panel,.login-stage,body>header,body>footer){background:var(--surface);color:var(--ink);border-color:var(--line)}html[data-theme=dark] :is(.login-panel h2,.login-panel label){color:var(--ink)}
html[data-theme=light] :is(.bible-verse-list,.bible-reader){color:var(--ink)}html[data-theme=light] .presentation-workspace .console-layout{background:var(--bg)}html[data-theme=light] .presentation-workspace .console-notices-column textarea{background:var(--surface);color:var(--ink)}
/* Service order, song picker and musician notes follow the selected theme. */
html[data-theme] .setlist-section{background:var(--surface);border-color:var(--line)}
html[data-theme] .setlist-section>header{background:var(--warm);border-color:var(--line)}
html[data-theme] .setlist-section>header h3{color:var(--gold-dark)}
html[data-theme] .setlist-section>header span{color:var(--muted)}
html[data-theme] :is(.setlist-section-items,.setlist-item){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] .setlist-item strong{color:var(--ink)}
html[data-theme] .setlist-item :is(small,label,.setlist-medley-unavailable){color:var(--muted)}
html[data-theme] .setlist-item .order{background:var(--warm);color:var(--gold-dark)}
html[data-theme] .setlist-grid :is(.mini-btn,.icon-btn){background:var(--bg);color:var(--ink);border:1px solid var(--line)}
html[data-theme] .setlist-grid :is(.mini-btn,.icon-btn):hover{background:var(--warm);border-color:var(--gold);color:var(--gold-dark)}
html[data-theme] .setlist-cue-note{border-color:var(--line);color:var(--muted)}
html[data-theme] .setlist-cue-note summary{color:var(--gold-dark)}
html[data-theme] .setlist-grid :is(.setlist-medley-panel,.setlist-medley-group,.note-box,.setlist-share,.selected-song){background:var(--warm);border-color:var(--line);color:var(--ink)}
html[data-theme] .setlist-grid :is(.song-picker-option,.search-field){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .setlist-grid .song-picker-option:hover{background:var(--warm)}
html[data-theme] .setlist-grid :is(.song-picker-option small,.setlist-section-empty,.setlist-medley-panel p,.setlist-medley-panel small){color:var(--muted)}
html[data-theme] .setlist-item.is-medley{background:var(--warm);border-color:var(--gold)}
/* Account and maintenance controls share the sidebar's spacing and icon rhythm. */
.sidebar #sidebarAccount{padding:16px 0 0;border-top:1px solid #303744;display:flex;flex-direction:column;gap:6px}.sidebar #sidebarAccount .sidebar-account-links{display:flex;flex-direction:column;gap:4px;margin:0}.sidebar #sidebarAccount .sidebar-account-links a{display:flex;align-items:center;gap:12px;min-height:40px;padding:10px 12px;margin:0;border-radius:9px;color:#c9d2df;font-size:12px;line-height:1.3;text-decoration:none;box-sizing:border-box}.sidebar #sidebarAccount .sidebar-account-links a:hover,.sidebar #sidebarAccount .sidebar-account-links a.active{background:#c49a5517;color:#edc685}.sidebar #sidebarAccount .account-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex:0 0 20px;color:#d6b170}.sidebar #sidebarAccount .account-icon svg{width:19px;height:19px}.sidebar #sidebarAccount .sidebar-logout{margin:10px 0 0;padding-top:12px;border-top:1px solid #303744}.sidebar #sidebarAccount .sidebar-logout button{display:flex;align-items:center;justify-content:flex-start;gap:12px;width:100%;min-height:42px;padding:10px 12px;border:1px solid #5a393c;border-radius:9px;background:#36242a;color:#efbec1;font-size:12px;font-weight:700;cursor:pointer}.sidebar #sidebarAccount .sidebar-logout button .account-icon{color:inherit}.sidebar #sidebarAccount .sidebar-logout button:hover{background:#4a2a31;border-color:#a55f69}.sidebar #sidebarAccount .sidebar-system-status{display:flex;align-items:center;gap:8px;padding:12px;font-size:10px;color:#93a699}.sidebar #sidebarAccount .status-dot{flex-shrink:0;margin:0}.sidebar #sidebarAccount a:focus-visible,.sidebar #sidebarAccount button:focus-visible{outline:2px solid #d6b170;outline-offset:2px}@media(min-width:1001px){body.sidebar-collapsed .sidebar #sidebarAccount .account-label{display:none}body.sidebar-collapsed .sidebar #sidebarAccount .sidebar-account-links a,body.sidebar-collapsed .sidebar #sidebarAccount .sidebar-logout button,body.sidebar-collapsed .sidebar #sidebarAccount .sidebar-system-status{justify-content:center;padding-left:8px;padding-right:8px;gap:0}}
/* Shared palette for every operator surface. Projection previews keep their own colors. */
html[data-theme=dark]{--control:#252e3a;--hover:#303b49;--accent-soft:#302a20;--success-bg:#163c2b;--success-ink:#a9e9c3;--warning-bg:#3a2d18;--warning-ink:#efd09a;--error-bg:#47262c;--error-ink:#f4bfc5}
html[data-theme=light]{--control:#f3f5f7;--hover:#e9edf2;--accent-soft:#f5ead8;--success-bg:#e0f3e8;--success-ink:#17633b;--warning-bg:#fff0d5;--warning-ink:#785210;--error-bg:#fbe6e9;--error-ink:#932e40}
html[data-theme] :is(.video-playlist-dock,.video-standby,.quick-background-settings,.quick-video-queue,.quick-video-card,.quick-song-result,.cue-lyric-editor,.cue-preset-form,.multitrack-console,.multitrack-output-settings,.multitrack-stem-row,.multitrack-cue-row,.multitrack-next>div,.sequence-editor-card,.sequence-part-row,.sequence-playback-options .sequence-playback-menu,.sequence-timeline-toolbar,.sequence-timeline-visuals,.sequence-timeline-visuals-grid,.pad-slot,.preflight-result,.obs-output-card,.slide-player,.song-add-dialog,.app-dialog,.audio-output-dialog,.bible-queue-card,.bible-background-presets button,.bible-media-backgrounds button,.bible-verse,.bible-book-tabs,.bible-queue-list,.bible-reader>footer,.bible-queue-panel>footer,.syntax-help pre,.medley-candidates button,.medley-order li){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.video-playlist-dock,.video-standby,.quick-background-settings,.quick-video-queue,.quick-video-card,.quick-song-result,.multitrack-console,.sequence-editor-card,.pad-slot,.preflight-result,.obs-output-card,.slide-player,.app-dialog,.audio-output-dialog) :is(h2,h3,strong,label){color:var(--ink)}
html[data-theme] :is(.video-playlist-dock,.video-standby,.quick-background-settings,.quick-video-queue,.quick-video-card,.quick-song-result,.multitrack-console,.sequence-editor-card,.pad-slot,.preflight-result,.obs-output-card,.slide-player,.app-dialog,.audio-output-dialog) :is(small,p){color:var(--muted)}
html[data-theme] :is(.video-dock-empty,.video-dock-list li:not(.active),.quick-video-queue li,.quick-video-search,.quick-song-search,.cue-key-picker,.cue-lyric-editor textarea,.sequence-mark-time,.sequence-playback-options label,.file-drop,.media-drop,.phone-share-row,.obs-url-row,.screen-status,.preflight-intro,.preflight-intro select,.sequence-bulk-upload,.sequence-generated-click,.bible-jump-field>div,.bible-word-search label>div,.bible-square-button,.bible-book-list button,.bible-chapter-grid button){background:var(--control);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.mini-btn,.video-transport button,.video-standby-actions button,.video-dock-list button,.quick-video-queue li button,.quick-video-card-actions button,.quick-video-panel>header>button,.quick-song-panel>header>button,.multitrack-close,.multitrack-stem-row button,.multitrack-cue-row button,.multitrack-next button,.cue-lyric-actions button,.cue-preset-form button,.song-add-close,.song-add-modes button,.sequence-timeline-toolbar button,.sequence-remove-row,.medley-order button,.phone-share-row button,.obs-url-row button){background:var(--control);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.mini-btn,.quick-video-card,.quick-song-result,.bible-verse,.bible-book-list button,.bible-chapter-grid button,.medley-candidates button):hover{background:var(--hover);color:var(--ink)}
html[data-theme] :is(.cue-card.active,.cue-song-group.current,.multitrack-cue-row.is-current,.bible-verse.active,.bible-verse.selected,.bible-book-list button.active,.bible-chapter-grid button.active,.bible-book-tabs button.active,.rehearsal-song.active,.quick-video-card.selected,.video-dock-list li.active,.sequence-timeline-ready .sequence-part-row.is-selected,.medley-candidates button.selected){background:var(--accent-soft);color:var(--ink);border-color:var(--gold-dark)}
html[data-theme] :is(.video-dock-add,.cue-key-save,.cue-preset-form button,.cue-song-toolbar .cue-edit-lyrics,.quick-song-actions .quick-song-add,.stage-note-actions button,.cue-lyric-actions .cue-lyric-save,.app-dialog-symbol){background:var(--accent-soft);color:var(--gold-dark);border-color:var(--gold-dark)}
html[data-theme] :is(.public-notice-actions button,.screen-status.success,.preflight-status.good,.bible-air-state.on-air){background:var(--success-bg);color:var(--success-ink);border-color:var(--success-ink)}
html[data-theme] :is(.screen-status.warning,.preflight-status.warn){background:var(--warning-bg);color:var(--warning-ink);border-color:var(--warning-ink)}
html[data-theme] :is(.preflight-status.bad,.login-alert){background:var(--error-bg);color:var(--error-ink);border-color:var(--error-ink)}
html[data-theme] :is(.stage-note-actions button+button,.public-notice-actions button+button,.app-dialog-actions #appDialogCancel){background:var(--control);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.bible-panel-heading strong,.bible-verse-text,.bible-queue-card strong,.bible-search-results button,.song-picker-option strong){color:var(--ink)}
html[data-theme] :is(.bible-air-state,.bible-panel-heading em,.bible-translation-picker select,.cue-song-number,.video-queue-count){background:var(--control);color:var(--muted);border-color:var(--line)}
html[data-theme] :is(.cue-card,.video-dock-list,.quick-video-queue,.cue-song-group,.operator-preview,.console-layout,.multitrack-stem-row,.sequence-part-row,.bible-verse,.bible-reader header){border-color:var(--line)}
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--muted);opacity:1}
html[data-theme] .theme-controls input[type=color]{background:var(--control);border:1px solid var(--line);padding:4px}
html[data-theme] .preview-screen{color:#fff}html[data-theme] .preview-screen :is(p,strong,h2,h3){color:inherit}
html[data-theme] .bible-screen-preview{color:#fff}html[data-theme] .bible-screen-preview :is(p,small){color:inherit}
html[data-theme] .sequence-visual-preview,html[data-theme] .sequence-animation-preview{color:#fff}
.sidebar #themeToggle{display:flex;align-items:center;gap:12px;width:100%;min-height:40px;margin:0 0 6px;padding:10px 12px;border:1px solid #394353;border-radius:9px;background:#202936;color:#e6d3af;text-align:left;font-size:12px;cursor:pointer}.sidebar #themeToggle .theme-icon{display:grid;place-items:center;width:20px;flex:0 0 20px;font-size:19px}.sidebar #themeToggle:hover{background:#2c3645}.sidebar{overflow-y:auto;scrollbar-width:thin}html[data-theme] .sidebar #themeToggle{min-width:0}@media(min-width:1001px){body.sidebar-collapsed .sidebar #themeToggle{justify-content:center;padding:10px;gap:0}}
@media(max-width:650px){.top-actions{flex-wrap:wrap}.topbar{gap:16px}.users-panel{overflow-x:auto}.sequence-editor-card{min-width:0}}
/* Contrast corrections identified in the full-page audit. */
html[data-theme] .main-shell :is(form label,.topbar-back,.compact-search){color:var(--ink)}
html[data-theme] .compact-search{background:var(--control);border-color:var(--line)}
html[data-theme] :is(.stat small,.song-row small,.service-row small,.sequence-library-note,.empty,.pads-intro p,.preflight-intro p,.preflight-intro label,.preflight-panel a,.setlist-medley-panel>small,.phone-qr strong,.phone-share-row a,.obs-output-card a){color:var(--muted)}
html[data-theme] .hero-card{background:var(--surface);color:var(--ink);border-color:var(--line)}html[data-theme] .hero-card :is(h2,p){color:var(--ink)}
html[data-theme=dark] .text-danger{color:#f2a7af}
html[data-theme] .pad-bank-toolbar{background:var(--control);border-color:var(--line);color:var(--ink)}html[data-theme] .pad-bank-toolbar label{color:var(--ink)}
html[data-theme] :is(.sequence-waveform-panel,.sequence-waveform-controls,.sequence-timeline-markers,.sequence-timeline-marker,.sequence-timeline-segment,.sequence-timeline-segment:nth-of-type(even),.sequence-mark-player){background:var(--control);color:var(--ink);border-color:var(--line)}
html[data-theme] :is(.sequence-waveform-panel,.sequence-waveform-controls,.sequence-timeline-marker) :is(strong,small,label){color:var(--ink)}
html[data-theme] :is(.sequence-waveform-panel,.sequence-waveform-controls) p{color:var(--muted)}
html[data-theme] .sequence-click-toggle{background:var(--accent-soft);color:var(--gold-dark);border-color:var(--gold-dark)}
html[data-theme] .sequence-timeline-marker.is-selected{background:var(--accent-soft);border-color:var(--gold-dark)}
html[data-theme] .presentation-workspace :is(.topbar-back,.console-service-config,.console-service-controls>div:first-child small,.console-notices-column>.eyebrow,.public-notice-editor>.eyebrow){color:var(--gold-dark)}
html[data-theme] .presentation-workspace :is(.video-queue-dock>p,.stage-note-editor>small,.public-notice-editor>small){color:var(--muted)}
html[data-theme] .screen-assignment label,html[data-theme] .preflight-intro label{color:var(--ink)}
html[data-theme] .pad-tile{background:var(--surface);border-color:var(--line)}html[data-theme] .pad-tile :is(.pad-file-name,.pad-empty-label){color:var(--muted)}html[data-theme] .pad-trigger{color:#f3e7cc}html[data-theme] .pad-trigger strong{color:inherit}
html[data-theme] .empty-pad .pad-trigger{background:var(--control);color:var(--muted);border-color:var(--line)}html[data-theme] .empty-pad .pad-action,html[data-theme] .pad-filename,html[data-theme] #padBankStatus{color:var(--muted)}html[data-theme] .pad-trigger.is-playing{color:#17211a}html[data-theme] .pad-delete{color:var(--error-ink)}
html[data-theme] .main-shell :is(.stat small,.stat small b,.sequence-library p,.setlist-medley-panel small,.kiosk-panel label,.preflight-panel a,.preflight-result a){color:var(--muted)}
html[data-theme] .sequence-waveform-panel :is(button,summary){background:var(--control);color:var(--ink);border-color:var(--line)}html[data-theme] .sequence-waveform-panel .sequence-click-toggle{background:var(--accent-soft);color:var(--gold-dark)}html[data-theme] #sequenceSelectedPart{color:var(--ink)}
html[data-theme] #sequenceLyricPreviewContext{color:var(--muted)}
html[data-theme] .bible-verse>span{color:var(--ink)}html[data-theme] :is(#bibleQuickFeedback,#clearBibleQueue){color:var(--muted)}html[data-theme] #padCurrentTone{color:var(--gold-dark)}
html[data-theme] :is(.bible-chapter-title span,.bible-background-presets button span,.bible-media-backgrounds button span){color:var(--ink)}html[data-theme] .rehearsal-cue{background:var(--control);color:var(--ink);border-color:var(--line)}html[data-theme] .rehearsal-cue p{color:var(--ink)}html[data-theme] .search-field{background:var(--surface);color:var(--muted);border-color:var(--line)}html[data-theme] .search-field>span{color:var(--muted)}html[data-theme] .key-badge{background:var(--accent-soft);color:var(--gold-dark)}html[data-theme=dark] .delete-account :is(summary,button){color:var(--error-ink)}html[data-theme=light] .prepared-option-icon{color:var(--gold-dark);background:var(--accent-soft)}
html[data-theme] :is(.login-panel,.card.narrow){background:var(--surface);color:var(--ink);border-color:var(--line)}html[data-theme] .login-stage{background:transparent}html[data-theme] .login-page :is(.brand,header nav a,header nav a:last-child,.login-panel h2,.login-panel label){color:var(--ink);border-color:var(--line)}html[data-theme] .login-page :is(.login-story>p,.story-note,.login-intro,.register-note,.login-access-note,.password-toggle){color:var(--muted)}html[data-theme] .login-page :is(.login-kicker,.login-story h1 em,.register-note a,.login-icon){color:var(--gold-dark)}html[data-theme] .login-panel .login-divider{background:var(--line)}html[data-theme] body>header{color:var(--ink);border-color:var(--line)}html[data-theme] .card.narrow :is(label,p){color:var(--ink)}html[data-theme] .card.narrow small{color:var(--muted)}
@media(max-width:1000px){.sidebar:not(.mobile-nav-open) #sidebarAccount{display:none}.sidebar.mobile-nav-open #sidebarAccount{align-items:stretch;flex-direction:column}.sidebar{overflow-y:visible}.sidebar #themeToggle{width:100%}}

/* Compact, labelled navigation groups; keep full page names visible. */
.sidebar .nav-group-label{color:#929baa;font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;padding:14px 12px 6px;line-height:1.4}
.sidebar #sidebarAccount>.nav-group-label{padding-top:0;padding-bottom:6px}
@media(min-width:1001px){
.sidebar{padding-top:22px;padding-bottom:16px;gap:0}
.sidebar .brand{margin-bottom:20px;flex-shrink:0}
.sidebar #sidebarNav{gap:3px;flex-shrink:0}
.sidebar #sidebarNav>a{height:40px;min-height:40px}
.sidebar #sidebarNav>a .nav-label{font-size:13px!important;right:18px}
.sidebar #sidebarNav .presentation-stop{height:32px;min-height:32px;margin:2px 0 5px}
.sidebar .sidebar-toggle,body.sidebar-collapsed .sidebar .sidebar-toggle{margin:12px 0 6px;flex-shrink:0;height:28px;min-height:28px}
.sidebar #sidebarAccount{margin-top:0;padding-top:14px;gap:3px;flex-shrink:0}
.sidebar #sidebarAccount .sidebar-account-links{gap:2px}
.sidebar #sidebarAccount .sidebar-account-links a{min-height:36px;padding:8px 12px}
.sidebar #themeToggle{min-height:36px;padding:8px 12px;margin-bottom:4px}
.sidebar #sidebarAccount .sidebar-logout{margin-top:6px;padding-top:10px}
.sidebar #sidebarAccount .sidebar-logout button{min-height:36px;padding:8px 12px}
.sidebar #sidebarAccount .sidebar-system-status{padding:10px 12px 0}
body.sidebar-collapsed .sidebar .nav-group-label{font-size:0;padding:0;height:1px;background:#303744;margin:10px 8px 6px}
}
@media(max-width:1000px){.sidebar #sidebarNav>.nav-group-label{grid-column:1/-1;padding:10px 8px 2px}.sidebar #sidebarAccount>.nav-group-label{width:100%}}

/* Folded rail: one shared centre line for every icon and control. */
@media(min-width:1001px){
body.sidebar-collapsed .sidebar .brand{justify-content:center;margin-left:0;margin-right:0}
body.sidebar-collapsed .sidebar .brand>span:last-child{display:none}
body.sidebar-collapsed .sidebar #sidebarNav>a .nav-icon,
body.sidebar-collapsed .sidebar #sidebarNav .presentation-stop span{left:calc(50% - 11px)}
body.sidebar-collapsed .sidebar .nav-group-label{display:none}
body.sidebar-collapsed .sidebar #sidebarAccount{padding-top:10px}
body.sidebar-collapsed .sidebar #themeToggle,
body.sidebar-collapsed .sidebar #sidebarAccount .sidebar-account-links a,
body.sidebar-collapsed .sidebar #sidebarAccount .sidebar-logout button{display:flex;justify-content:center;align-items:center;padding:8px 0;gap:0;min-height:40px}
body.sidebar-collapsed .sidebar #sidebarAccount .sidebar-system-status{justify-content:center;padding:12px 0 4px;gap:0}
body.sidebar-collapsed .sidebar #sidebarNav>a .nav-label{display:none}
}

/* Navigation utilities: unobtrusive theme control and top corner fold button. */
@media(min-width:1001px){
.sidebar .sidebar-toggle,body.sidebar-collapsed .sidebar .sidebar-toggle{position:absolute;top:8px;right:8px;align-self:auto;margin:0;width:26px;height:26px;min-height:26px;padding:0;z-index:1}
.sidebar .sidebar-toggle svg{width:15px;height:15px}
.sidebar .brand{margin-top:16px}
body.sidebar-collapsed .sidebar .brand{margin-top:16px}
.sidebar #sidebarAccount{margin-top:auto}
.sidebar #sidebarNav{margin-bottom:20px}
}
.sidebar #themeToggle{background:transparent;border:1px solid transparent;border-radius:7px;min-height:34px;padding:7px 12px;color:#b9c2cf;font-weight:500}
.sidebar #themeToggle .theme-icon{font-size:16px;color:#d6b170}
.sidebar #themeToggle:hover{background:#ffffff09;color:#f0d3a0}
body.sidebar-collapsed .sidebar #themeToggle{background:transparent;border-color:transparent}

/* Centre the expand control above the brand in the narrow rail. */
@media(min-width:1001px){
body.sidebar-collapsed .sidebar .sidebar-toggle{left:50%;right:auto;top:10px;transform:translateX(-50%);width:34px;height:32px;min-height:32px;border:1px solid #303744;background:#191e27;border-radius:8px;color:#cbd3df}
body.sidebar-collapsed .sidebar .sidebar-toggle:hover{background:#293241;border-color:#b99254;color:#efd2a2}
body.sidebar-collapsed .sidebar .sidebar-toggle svg{width:18px;height:18px}
body.sidebar-collapsed .sidebar .brand{margin-top:32px;margin-bottom:20px}
}

/* Keep the folded navigation and workspace offset at the same compact width. */
@media(min-width:1001px){
body.sidebar-collapsed .sidebar{width:64px;min-width:64px;max-width:64px;box-sizing:border-box;padding-left:7px;padding-right:7px;overflow-x:hidden}
body.sidebar-collapsed .main-shell{margin-left:64px}
body.sidebar-collapsed .sidebar #sidebarNav,body.sidebar-collapsed .sidebar #sidebarAccount{width:100%;min-width:0}
}

@media(min-width:1001px){.sidebar .sidebar-toggle,body.sidebar-collapsed .sidebar .sidebar-toggle{left:8px;right:auto;transform:none}.sidebar .brand{margin-top:32px}}
.pad-navigation-frame{position:fixed;inset:0;width:100%;height:100%;border:0;background:var(--surface);z-index:10000}
.persistent-pad-dock{position:fixed;right:18px;bottom:18px;z-index:10001;display:flex;align-items:center;flex-wrap:wrap;gap:10px;width:360px;max-width:calc(100vw - 36px);padding:14px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 8px 35px #0005}
.persistent-pad-dock select,.persistent-pad-dock button{background:var(--control);color:var(--ink);border:1px solid var(--line);border-radius:7px;padding:8px}.persistent-pad-dock input{width:100px;min-width:0}.persistent-pad-dock small{width:100%;color:var(--muted)}

.persistent-pad-dock .mini-pad-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;width:100%}
.persistent-pad-dock .mini-pad{aspect-ratio:1;min-width:0;padding:0;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;transition:background .15s,border-color .15s}
.persistent-pad-dock .mini-pad:hover:not(:disabled){border-color:var(--gold-dark)}
.persistent-pad-dock .mini-pad[aria-pressed=true]{background:#b88b45;color:#fff;border-color:#e5bd7b;box-shadow:0 0 0 1px #e5bd7b}
.persistent-pad-dock .mini-pad:disabled{opacity:.35;cursor:default}
.persistent-pad-dock .mini-pad:focus-visible{outline:2px solid var(--gold-dark);outline-offset:2px}
.persistent-pad-dock .mini-pad.is-loading{opacity:.65}

.persistent-pad-dock[hidden],.persistent-pad-dock .mini-pad[hidden]{display:none}.persistent-pad-dock .mini-pad-mode{margin-left:auto;font-size:12px;padding:6px 10px}

/* Native ranges: remove form padding and align track ends with thumb centres. */
html[data-theme] input[type=range]:not(.edge-range input){appearance:none;-webkit-appearance:none;height:22px;padding:0;border:0;margin:0;box-shadow:none;background:linear-gradient(to right,var(--gold-dark) 0 var(--slider-fill,0%),#657080 var(--slider-fill,0%) 100%) center / calc(100% - 14px) 5px no-repeat;cursor:pointer}
html[data-theme] input[type=range]:not(.edge-range input)::-webkit-slider-runnable-track{height:5px;border:0;border-radius:8px;background:transparent;margin:0}
html[data-theme] input[type=range]:not(.edge-range input)::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:14px;height:14px;border:0;border-radius:50%;background:var(--gold-dark);margin-top:-4.5px}
html[data-theme] input[type=range]:not(.edge-range input)::-moz-range-track{height:5px;border:0;border-radius:8px;background:#657080}
html[data-theme] input[type=range]:not(.edge-range input)::-moz-range-progress{height:5px;background:var(--gold-dark)}
html[data-theme] input[type=range]:not(.edge-range input)::-moz-range-thumb{width:14px;height:14px;border:0;border-radius:50%;background:var(--gold-dark)}
.range-volume-value{font-size:12px;min-width:34px;font-variant-numeric:tabular-nums;color:var(--ink)}

.persistent-pad-dock .mini-pad-handle{flex:1;align-self:stretch;display:flex;align-items:center;cursor:grab;touch-action:none;user-select:none;min-height:32px}
.persistent-pad-dock .mini-pad-handle:active{cursor:grabbing}
.persistent-pad-dock .mini-pad-close{width:30px;height:30px;padding:0;font-size:23px;background:transparent;border-color:transparent;color:var(--muted)}
.persistent-pad-dock .mini-pad-close:hover{background:var(--control);color:var(--ink)}
.mini-pad-reopen{position:fixed;right:18px;bottom:18px;z-index:10001;padding:10px 15px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--ink);box-shadow:0 4px 18px #0004;cursor:pointer}
.mini-pad-reopen[hidden]{display:none}

.sidebar #presentationNav:not(.on-air){color:#ffd3d3;background:#6f292940;box-shadow:inset 3px 0 #df7373}
.sidebar #presentationNav:not(.on-air) i{background:#ec7575;box-shadow:0 0 0 3px #ec757525}
.sidebar #presentationNav.on-air{color:#dffbea;background:#329e5b33;box-shadow:inset 3px 0 #55d687}
.sidebar #presentationNav.on-air i{background:#55d687;box-shadow:0 0 0 3px #55d68730}

/* Compact, accessible theme switch; the thumb indicates the current theme. */
#themeToggle{display:inline-flex;align-items:center;gap:10px;cursor:pointer;border:0;background:transparent;color:inherit;padding:8px;font:inherit}
#themeToggle .theme-track{position:relative;display:block;flex:0 0 44px;width:44px;height:26px;border-radius:99px;background:#d9d1c1;border:1px solid #b7a88c;box-sizing:border-box}
#themeToggle .theme-thumb{position:absolute;display:grid;place-items:center;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#fffaf0;color:#805b25;font-size:14px;line-height:1;box-shadow:0 1px 3px #0003;transition:transform .2s ease,background .2s ease}
#themeToggle[aria-checked="true"] .theme-track{background:#52432b;border-color:#a98449}
#themeToggle[aria-checked="true"] .theme-thumb{transform:translateX(18px);background:#e6bd78;color:#27211a}
.sidebar #themeToggle{gap:10px;padding:7px 8px;min-height:42px}
@media(min-width:1001px){body.sidebar-collapsed .sidebar #themeToggle{padding:7px 0}}
@media(prefers-reduced-motion:reduce){#themeToggle .theme-thumb{transition:none}}

/* Give the theme switch a stable touch target in both navigation layouts. */
.sidebar #themeToggle{box-sizing:border-box;flex-shrink:0;min-width:0;max-width:100%;min-height:44px}
.sidebar #themeToggle .theme-label{line-height:1.3;white-space:nowrap}
@media(min-width:1001px){
 body.sidebar-collapsed .sidebar #themeToggle{width:100%;min-width:0;min-height:44px;justify-content:center;gap:0;padding:9px 0;margin:2px 0 8px}
 body.sidebar-collapsed .sidebar #themeToggle .theme-label{display:none}
 body.sidebar-collapsed .sidebar #themeToggle .theme-track{flex-basis:40px;width:40px}
 body.sidebar-collapsed .sidebar #themeToggle[aria-checked="true"] .theme-thumb{transform:translateX(14px)}
}
@media(max-width:1000px){
 .sidebar.mobile-nav-open #sidebarAccount{gap:10px;padding-top:16px}
 .sidebar.mobile-nav-open #themeToggle{display:flex;width:100%;min-height:48px;justify-content:flex-start;gap:12px;padding:10px 12px;margin:0 0 4px}
 body.sidebar-collapsed .sidebar.mobile-nav-open #themeToggle .theme-label,.sidebar.mobile-nav-open #themeToggle .theme-label{display:inline}
 .sidebar.mobile-nav-open #themeToggle .theme-track{flex-basis:44px;width:44px}
 .sidebar.mobile-nav-open #themeToggle[aria-checked="true"] .theme-thumb{transform:translateX(18px)}
}

/* Native file selection, styled consistently without hiding its filename or focus. */
html[data-theme] input[type="file"]{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--muted);font:inherit;font-size:13px;line-height:1.5;cursor:pointer;overflow:hidden;text-overflow:ellipsis;transition:border-color .15s ease}
html[data-theme] input[type="file"]::file-selector-button{margin:0 12px 0 0;padding:10px 14px;border:1px solid var(--gold);border-radius:7px;background:var(--warm);color:var(--gold-dark);font:inherit;font-weight:700;cursor:pointer;transition:background .15s ease}
html[data-theme] input[type="file"]:hover{border-color:var(--gold)}
html[data-theme] input[type="file"]:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
html[data-theme] input[type="file"]:disabled{opacity:.5;cursor:default}
@media(max-width:480px){html[data-theme] input[type="file"]{font-size:12px;padding:6px}html[data-theme] input[type="file"]::file-selector-button{padding:10px;margin-right:8px}}

.audio-file-drop{position:relative;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:26px 18px;margin:12px 0 18px;border:1px dashed var(--gold);border-radius:12px;background:var(--warm);text-align:center;cursor:pointer;min-width:0}
.audio-file-drop .audio-drop-icon{font-size:28px;color:var(--gold-dark)}
.audio-file-drop>span:not(.audio-drop-icon){color:var(--muted);font-size:13px}
.audio-file-drop small{max-width:100%;overflow-wrap:anywhere;color:var(--gold-dark);font-size:13px}
html[data-theme] .audio-file-drop input[type="file"]{position:absolute;inset:0;width:100%;height:100%;opacity:0;margin:0;cursor:pointer}
.audio-file-drop:focus-within,.audio-file-drop.is-over{outline:2px solid var(--gold);outline-offset:3px;background:var(--surface)}
.audio-file-drop.has-file{border-style:solid}

.upload-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;max-width:100%;box-sizing:border-box;padding:20px 14px;margin:6px 0 12px;border:1px dashed var(--gold);border-radius:12px;background:var(--warm);color:var(--ink);text-align:center;cursor:pointer;line-height:1.4}
.upload-drop-icon{font-size:26px;color:var(--gold-dark)}
.upload-drop>span:not(.upload-drop-icon){font-size:12px;color:var(--muted)}
.upload-drop strong{font-size:13px}.upload-drop small{max-width:100%;overflow-wrap:anywhere;font-size:12px;color:var(--gold-dark)}
html[data-theme] .upload-drop input[type="file"]{position:absolute;inset:0;width:100%;height:100%;padding:0;margin:0;opacity:0;cursor:pointer}
.upload-drop:focus-within,.upload-drop.is-over{outline:2px solid var(--gold);outline-offset:3px;background:var(--surface)}
.upload-drop.has-file{border-style:solid}.upload-drop:has(input:disabled){opacity:.5;cursor:default}
.file-drop:has(.upload-drop),.media-drop:has(.upload-drop){display:block;padding:0;border:0;background:transparent}
.file-drop:has(.upload-drop)>:not(.upload-drop){display:none}
.sequence-stem-row>.upload-drop{margin:0;padding:12px 8px}

/* Long filenames must wrap within the available grid column, including on phones. */
.upload-drop,.audio-file-drop{width:100%;box-sizing:border-box;min-width:0}
.upload-drop small,.audio-file-drop small{display:block;width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;word-break:break-word;line-height:1.5}
.file-drop>.upload-drop{font-size:13px;color:var(--ink)}
.sequence-bulk-upload>label,.sequence-stem-row>*{min-width:0;max-width:100%;box-sizing:border-box}
@media(max-width:480px){.upload-drop,.audio-file-drop{padding:18px 10px}.upload-drop strong,.audio-file-drop strong{font-size:13px;overflow-wrap:anywhere}.upload-drop small,.audio-file-drop small{font-size:12px}}
