/* Shared colours; artwork, game graphics and block textures are never inverted. */
:root[data-theme=light]{color-scheme:light;--site-bg:#f5f3ee;--site-panel:#fffdfa;--site-raised:#ebe9e3;--site-ink:#282b2e;--site-muted:#626973;--site-line:#d4d6d8;--site-canvas:#e9ece3;--bg:var(--site-bg);--paper:var(--site-panel);--panel:var(--site-panel);--sidebar:#f0f0ed;--surface:var(--site-panel);--dim:#edeef0;--raised:var(--site-raised);--ink:var(--site-ink);--text:var(--site-ink);--muted:var(--site-muted);--second:#505965;--line:var(--site-line);--border:var(--site-line)}
:root[data-theme=dark]{color-scheme:dark;--site-bg:#171a1e;--site-panel:#20252a;--site-raised:#2b3239;--site-ink:#e8ebee;--site-muted:#a8b1ba;--site-line:#39424b;--site-canvas:#1b2228;--bg:var(--site-bg);--paper:var(--site-panel);--panel:var(--site-panel);--sidebar:#1b1f24;--surface:var(--site-panel);--dim:#1b1f24;--raised:var(--site-raised);--ink:var(--site-ink);--text:var(--site-ink);--muted:var(--site-muted);--second:#c0c8d0;--line:var(--site-line);--border:var(--site-line);--blue:#8ab5ff;--blue-soft:#25374e;--green:#71c9a7;--shadow:0 14px 40px #0003}
html[data-theme] body{background:var(--site-bg);color:var(--site-ink)}
#site-theme-toggle{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:1100;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;border:1px solid var(--site-line);border-radius:10px;background:var(--site-panel);color:var(--site-ink);font:600 13px/1.2 system-ui,sans-serif;box-shadow:0 2px 10px #0002;cursor:pointer}
html:has([data-hub-return]) #site-theme-toggle{right:calc(166px + env(safe-area-inset-right,0px))}
#site-theme-toggle:hover{background:var(--site-raised)}#site-theme-toggle:focus-visible{outline:2px solid var(--site-ink);outline-offset:4px}
:root[data-theme=dark] :is(.project:hover,.secondary:hover){background:var(--site-raised)}
:root[data-hub-app=login][data-theme=dark] input[type=password],:root:is([data-hub-app=dashboard],[data-hub-app=server])[data-theme=dark] :is(select,input[type=search]){background:var(--site-panel);border-color:var(--site-line);color:var(--site-ink)}
:root[data-theme=dark] :is(.error,.dashboard-error,[data-state=bad],.log-level.error){color:#f2aaa4}
:root:is([data-hub-app=dashboard],[data-hub-app=server])[data-theme=dark] .dashboard-error{background:#3b2829}
:root:is([data-hub-app=dashboard],[data-hub-app=server])[data-theme=dark] :is([data-state=good],.log-level.info){color:#91c9a1}
:root:is([data-hub-app=dashboard],[data-hub-app=server])[data-theme=dark] :is([data-state=warning],.log-level.warning){color:#e1c68b}
:root[data-hub-app=login][data-theme=dark] .primary:hover{background:#c9d0d6;color:#171a1e}
/* Album ratings retain their score colours and artwork. */
:root[data-hub-app=albums][data-theme=dark] :is(.search-row input,.result,.track-row,.track-score,.remove-album){background:var(--site-panel);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=albums][data-theme=dark] .album-hero{background:linear-gradient(120deg,#20252a,#253344)}
:root[data-hub-app=albums][data-theme=dark] .album-foot{border-color:var(--site-line)}
:root[data-hub-app=albums][data-theme=dark] :is(.hero-meta span,.undo-bar,.secondary,.result button){background:var(--site-raised);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=albums][data-theme=dark] .back{color:var(--blue)}
:root[data-hub-app=albums][data-theme=dark] .track-score.has-rating{background:var(--rate-bg);color:var(--rate-ink)}
/* Minecraft chrome uses the same preference; WebGL background is updated by JS. */
:root[data-hub-app=minecraft]{background:var(--site-bg);color:var(--site-ink)}
:root[data-hub-app=minecraft] .preview{background:var(--site-canvas)}
:root[data-hub-app=minecraft][data-theme=dark] :is(.header,.sidebar,.details,.tabs,.library-item,.material,#section-controls){border-color:var(--site-line)}
:root[data-hub-app=minecraft][data-theme=dark] :is(button,input,textarea,select){background:var(--site-panel);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=minecraft][data-theme=dark] :is(.quiet,.tabs button,.example-list button,.export-actions button:not(.primary),.library-open,.library-remove){background:transparent}
:root[data-hub-app=minecraft][data-theme=dark] button:hover:not(:disabled){background:var(--site-raised)}
:root[data-hub-app=minecraft][data-theme=dark] .primary{background:#8fae97;color:#101912;border-color:#8fae97}
:root[data-hub-app=minecraft][data-theme=dark] .primary:hover:not(:disabled){background:#adc9b4}
:root[data-hub-app=minecraft][data-theme=dark] :is(.workflow,.version,.section-name,.panel label,.dimensions legend,.dimensions label,.preview-bar span,.view-controls,.preview-tools label,#section-controls){color:var(--site-muted)}
:root[data-hub-app=minecraft][data-theme=dark] .tabs button[aria-selected=true]{border-color:#9dbba3;color:var(--site-ink)}
:root[data-hub-app=minecraft][data-theme=dark] .preview-actions button[aria-pressed=true]{background:#34483b;border-color:#718c77}
:root[data-hub-app=minecraft][data-theme=dark] :is(#notice,#preview-warning){color:#c1d5ad}
:root[data-hub-app=minecraft][data-theme=dark] #error{color:#f0a59e}
:root[data-hub-app=minecraft][data-theme=dark] .splitter:hover{background:#3e5042}
/* Notes already has a dark palette; these are the corresponding light surfaces. */
:root[data-hub-app=notes][data-theme=light]{--purple:#7250bf}
:root[data-hub-app=notes][data-theme=light] :is(.topbar,.editor-sheet,.rich-editor,.knowledge-header,.canvas-footer,.note-inspector,.mindmap-panel,.tabs-bar,.tab.active){background:var(--site-bg);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=notes][data-theme=light] :is(.ribbon,.file-tree,.file-sidebar,.focus-card,.search-box,.form-label input,.form-label select,.editor-meta select,.editor-toolbar,.view-switch,.map-search,.graph-search,dialog,.toast,.notes-empty,.add-note-card,.restore-btn){background:var(--site-panel);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=notes][data-theme=light] :is(.subject-card,.note-card){background:color-mix(in srgb,var(--subject-color,#7250bf) 5%,var(--site-panel));border-color:var(--site-line)}
:root[data-hub-app=notes][data-theme=light] :is(.nav-item.active,.nav-item:hover,.file-notes button.selected,.view-tabs button.active,.view-switch button.selected,.tab,.sidebar-create,.note-subject,.note-tags>span,kbd,.section-head h2>span,.avatar,.workspace-avatar,.mini-icon:hover,.canvas-zoom,.map-export){background:var(--site-raised);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=notes][data-theme=light] :is(.breadcrumb>span,.note-title,.timer-value,.note-card h3,.subject-card h3,.rich-editor h1,.rich-editor h2,.rich-editor h3,.rich-editor b,.rich-editor strong,.form-label,.inspector-map-callout h4,.note-inspector h3){color:var(--site-ink)}
:root[data-hub-app=notes][data-theme=light] :is(.text-btn,.outline-link,.inspector-link,.tags-input input,.graph-search input,.map-search input,.canvas-zoom button,.canvas-zoom span,.subject-card-bottom,.note-card-footer,.folder-name small){color:var(--site-muted)}
:root[data-hub-app=notes][data-theme=light] :is(.knowledge-canvas,.rich-editor pre,.rich-editor blockquote,.note-inspector code){background:#eaecef;color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=notes][data-theme=light] .primary{color:white;background:#7250bf}
:root[data-hub-app=notes][data-theme=light] .error-banner{color:#8d2837;background:#ffecef;border-color:#e4a9b3}
/* Seedle's world image stays a world image in both themes. */
:root[data-hub-app=games][data-theme=light][data-game=seedle] body{background:var(--site-bg);color:var(--site-ink)}
:root[data-hub-app=games][data-theme=light][data-game=seedle] body:before{filter:saturate(.4) brightness(1.15)}
:root[data-hub-app=games][data-theme=light][data-game=seedle] body:after{background:linear-gradient(135deg,#f5f3eed9,#f5f3eef5)}
:root[data-hub-app=games][data-theme=light][data-game=seedle] :is(dialog,.seed-card,.settings-group,.guess-input){background:var(--site-panel);color:var(--site-ink);border-color:var(--site-line)}
@media print{#site-theme-toggle{display:none}}
:root[data-hub-app=minecraft][data-theme=dark] #material-search{background:var(--site-panel);color:var(--site-ink);border-color:var(--site-line)}
:root[data-hub-app=minecraft] .view-controls{padding-right:max(18px,calc(310px - var(--right-width,210px)))}
:root[data-hub-app=minecraft] #material-empty{font-size:12px;color:var(--site-muted)}
@media(max-width:1000px){:root[data-hub-app=minecraft] .view-controls{padding-right:18px;padding-bottom:76px}}
:root[data-hub-app=notes][data-theme=light] :is(.section-head h2,.section-label,.nav-item,.cloud-status,.breadcrumb,.sidebar-footer small){color:var(--site-muted)}
/* Reserve navigation space under the final row, including dense-view controls. */
:root[data-hub-app=minecraft] #section-controls{padding-right:max(18px,calc(310px - var(--right-width,210px)))}
@media(max-width:1000px){:root[data-hub-app=minecraft] .preview:has(#section-controls:not([hidden])) .view-controls{padding-bottom:18px}:root[data-hub-app=minecraft] #section-controls{padding-right:18px;padding-bottom:76px}}
