/* Account preference is rendered on <html> before styles load, including embedded editors. */
html[data-theme="dark"]{color-scheme:dark;--ink:#f1f1f1;--muted:#b0b0b0;--line:#393939;--green:#e2e2e2;--lime:#f2f2f2;--paper:#101010;--surface:#1b1b1b;--raised:#252525;--selected:#333333;background:var(--paper);color:var(--ink)}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] :is(.card,.sidebar,dialog,.modal-content,.standalone,.login-form-panel,.identity-topic-card,.gear-embedded,.gear-dialog,.gear-device-card,.gear-signal-node){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){background:#151515;color:var(--ink);border-color:#555555}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#a6a6a6;opacity:1}
html[data-theme="dark"] :is(th,.pill,.avatar,.area-symbol,.notice,.board-filters,.repertoire-filters,.planning-filters,.assignment-members,.analysis-feedback-card,.tab-editor-toolbar,.tab-grid,.gear-signal-canvas,.gear-signal-board){background:var(--raised);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(a,.text-button,.board-text-button,.text-link){color:#e2e2e2}
html[data-theme="dark"] :is(p,small,.muted,.compact-note,.file-meta){color:var(--muted)}
html[data-theme="dark"] .button{background:#e4e4e4;color:#141414;border-color:#e4e4e4}
html[data-theme="dark"] .button:hover{background:#ffffff;color:#141414}
html[data-theme="dark"] :is(.button.secondary,button.icon-button,.media-icon-button){background:var(--raised);color:var(--ink);border-color:#555555}
html[data-theme="dark"] :is(.button.secondary:hover,.identity-tabs a:hover,.sidebar nav a:hover,.sidebar nav a[aria-current="page"],.sidebar-group-toggle:hover){background:var(--selected);color:#ffffff}
html[data-theme="dark"] .identity-tabs a span{background:var(--raised);color:var(--ink)}
html[data-theme="dark"] :is(.identity-tabs,.topbar,.check-row,.sidebar-footer,.table-scroll,td,th){border-color:var(--line)}
html[data-theme="dark"] .validation:has(ul){background:#452b26;color:#ffd3c8;border-color:#a76f60}
html[data-theme="dark"] .validation{color:#ffc6b9}
html[data-theme="dark"] .welcome-banner{background:#242424;color:#f4f4f4}
html[data-theme="dark"] .welcome-banner p{color:#cecece}
html[data-theme="dark"] :is(.pill.active,.pill.inactive){background:var(--selected);color:#e5e5e5}
html[data-theme="dark"] .sidebar nav a{color:#c4c4c4}
html[data-theme="dark"] :is(.tab-workspace,.tab-workspace:fullscreen,.tab-editor-shell,.gear-workspace:fullscreen){background:var(--paper);color:var(--ink)}
html[data-theme="dark"] audio{color-scheme:dark}
html[data-theme="dark"] ::backdrop{background:#000a}
.band-export-form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.band-export-form .field{margin:0;min-width:220px}.band-export-form+p{margin:12px 0 0}

html[data-theme="dark"]{--theme-surface:#1b1b1b;--theme-raised:#252525;--theme-border:#393939;--theme-ink:#e5e5e5}
html[data-theme="dark"] :is(.identity-help-trigger,.context-shortcut[aria-current=page]){background:#353535;color:#f0f0f0;border-color:#666666}
html[data-theme="dark"] :is(.identity-help-trigger:hover,.context-shortcut:hover){background:#454545;color:#f4f4f4}
html[data-theme="dark"] :is(.gear-svg-name,.gear-svg-control-value){fill:#eeeeee}
html[data-theme="dark"] :is(.gear-svg-category,.gear-svg-port,.gear-svg-control,.gear-svg-port-direction){fill:#c8c8c8}
html[data-theme="dark"] :is(.gear-diagram-view:fullscreen,.gear-diagram-dialog .gear-diagram-view){background:var(--paper)}

html[data-theme="dark"] .bma-surface{fill:#202020}
.profile-language label.check-label{display:flex;align-items:center;gap:8px}.profile-language label.check-label input[type=checkbox]{width:16px;height:16px;min-height:0;margin:0;flex:0 0 16px}

/* Neutral branding and interaction accents in dark mode only. */
html[data-theme="dark"] .bma-lettering{fill:#f2f2f2}
html[data-theme="dark"] :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:#d4d4d4}
html[data-theme="dark"] :focus-visible{outline-color:#bdbdbd}

/* Fullscreen/fixed editors use --bg as well as --paper. */
html[data-theme="dark"]{--bg:var(--paper)}
html[data-theme="dark"] :fullscreen{background-color:var(--paper);color:var(--ink)}
html[data-theme="dark"] :is(.tab-expanded,.video-expanded,.video-fallback-fullscreen,.tab-fullscreen-dialog,.video-fullscreen-dialog,.gear-diagram-fullscreen){background:var(--paper);color:var(--ink)}
html[data-theme="dark"] :is(.identity-savebar,.gear-performance-nav){background:#1b1b1bf2;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .topic-filters a[aria-current="true"]{background:var(--selected);color:#ffffff;border-color:#777777}
html[data-theme="dark"] .analysis-controls :is(.analysis-positive,.analysis-negative){background:var(--raised);color:var(--ink);border-color:#555555}
html[data-theme="dark"] .analysis-controls :is(.analysis-positive,.analysis-negative):hover{background:var(--selected);color:#ffffff;border-color:#777777}

/* Subtle help affordances with an accessible keyboard focus state. */
:is(.identity-help-trigger,.area-help-trigger,.media-info){width:24px;height:24px;min-width:24px;min-height:24px;flex:0 0 24px;padding:2px;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;transition:background-color .15s,color .15s}
:is(.identity-help-trigger,.area-help-trigger,.media-info):hover{background:var(--theme-raised,#edf2e8);color:var(--ink)}
:is(.identity-help-trigger,.area-help-trigger,.media-info):focus-visible{outline:2px solid var(--muted);outline-offset:2px;background:var(--theme-raised,#edf2e8);color:var(--ink)}
html[data-theme="dark"] :is(.identity-help-trigger,.area-help-trigger,.media-info){background:transparent;color:#999999;border-color:transparent}
html[data-theme="dark"] :is(.identity-help-trigger,.area-help-trigger,.media-info):is(:hover,:focus-visible){background:#292929;color:#eeeeee}

/* Keep the Imageboard shortlist badge legible over photographs. */
html[data-theme="dark"] .board-shortlisted{background:#e0e0e0;color:#171717;border:1px solid #bdbdbd;text-shadow:none}

/* The signed-out login uses the same neutral dark palette as the workspace. */
html[data-theme="dark"] .login-story{background:#141414;color:#f1f1f1}
html[data-theme="dark"] .login-form-panel{background:#1b1b1b;color:#f1f1f1}
html[data-theme="dark"] .login-story :is(.eyebrow,footer){color:#bdbdbd}
html[data-theme="dark"] .sound-art{opacity:.2}
html[data-theme="dark"] .sound-art i{background:#b8b8b8}
.migration-status-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin-bottom:16px}.migration-status-grid a{display:block;padding:12px;border:1px solid var(--line);border-radius:8px}.migration-status-grid a[aria-current=page]{background:var(--theme-raised,#edf2e8);border-color:var(--green)}.migration-status-grid small{display:block;margin-top:4px}.migration-release{padding:12px 0;border-bottom:1px solid var(--line)}.migration-release:last-child{border:0}.migration-release ul{padding-left:20px;margin:8px 0}.migration-release h3{margin:0}.migration-history td{vertical-align:top}.migration-history .migration-checksum{font:10px monospace;overflow-wrap:anywhere}
