/* Softer day and night surfaces. Real images, PDFs, canvases and document pages keep their original colors. */
:root,:root[data-theme="dark"]{color-scheme:dark;--bg:#172125;--surface:#202e34;--surface-raised:#26363c;--surface-subtle:#1b282e;--input-bg:#1b282d;--text:#d7e2e3;--muted:#a2b5b9;--border:#36474c;--accent:#79c0b6;--accent-soft:#29453f;--accent-hover:#33554d;--button-bg:#286c67;--button-hover:#347d75;--button-text:#ecf5f2;--panel:#202e34;--navy:#21363b;--navy2:#1b282e;--blue:#79c0b6;--blue2:#92d0c6;--blue3:#a2c9c1;--green:#a7d5b4;--green-bg:#28473b;--danger:#efb0b7;--danger-bg:#4a3036;--warning:#e1c485;--warning-bg:#463e2d;--shadow:0 10px 28px #00000012;--shadow-sm:0 3px 12px #0000000d}
:root[data-theme="light"]{color-scheme:light;--bg:#f0f4fa;--surface:#fbfcff;--surface-raised:#ffffff;--surface-subtle:#eaf0f8;--input-bg:#f5f8fd;--text:#22344c;--muted:#546780;--border:#d3deec;--accent:#285da6;--accent-soft:#e0ebfa;--accent-hover:#cfdff5;--button-bg:#315f9f;--button-hover:#264c83;--button-text:#f7fbff;--panel:#fbfcff;--navy:#24466f;--navy2:#eaf0f8;--blue:#285da6;--blue2:#204b87;--blue3:#789dcc;--green:#2e6043;--green-bg:#e2efe7;--danger:#963e4b;--danger-bg:#f7e6e9;--warning:#785e2d;--warning-bg:#f5eedc;--shadow:0 10px 28px #243f6610;--shadow-sm:0 3px 12px #243f660a}
html[data-theme],html[data-theme] body{background:var(--bg);background-image:none;color:var(--text)}
html[data-theme] :is(h1,h2,h3,h4,.page-head h1,.data-page-head h1,.data-list-heading h2,.stat .value,.workspace-summary strong,.name-main,.name-main a,.file-title,.account-copy b,.user-chip b){color:var(--text)}
html[data-theme] :is(.muted,.small.muted,.field small,.field>small,.workspace-summary div div>span,.logo-copy small,.account-copy small,.account-identity small,.file-table td:not(:first-child):not(:last-child),.restore-guide li span,.restore-limit,.login-footer){color:var(--muted)}
html[data-theme] :is(.card,.panel,.settings-nav,.account-panel,.modal-card,.auth-card,.storage-card,.workspace-summary>div,.data-summary>div,.file-table tbody tr,.restore-upload-card,.restore-guide){background:var(--surface);background-image:none;border-color:var(--border);box-shadow:var(--shadow)}
html[data-theme] :is(.sidebar,.topbar,.mobile-bottom-nav){background:var(--surface-subtle);color:var(--text);border-color:var(--border);box-shadow:none}
html[data-theme] .sidebar::before{display:none}html[data-theme] .logo{color:var(--text);border-color:var(--border)}
html[data-theme] :is(.management-toggle){background:var(--surface-raised)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-theme] :is(.management-toggle .nav-icon,.side-nav .nav-icon,.summary-icon,.avatar,.panel-icon){background:var(--accent-soft);color:var(--accent);box-shadow:none}
html[data-theme] .side-nav a{color:var(--muted)}html[data-theme] :is(.side-nav a.active,.side-nav a:hover,.settings-nav a.active,.settings-nav a:hover,.account-panel a:hover){background:var(--accent-soft);color:var(--accent);box-shadow:none;border-color:transparent}
html[data-theme] .side-nav a.active .nav-icon{color:var(--accent)}html[data-theme] .account-panel{color:var(--text)}html[data-theme] :is(.account-identity,.account-panel a){border-color:var(--border)}
html[data-theme] :is(.user-chip,.searchbar,.list-options>summary,.item-actions>summary){background:var(--surface-subtle);color:var(--text);border-color:var(--border)}
html[data-theme] .eyebrow{color:var(--accent)}html[data-theme] .theme-shortcut{display:inline-flex;align-items:center;gap:8px;margin-left:auto;min-height:38px;padding:8px 12px;font-size:12px;flex-shrink:0}html[data-theme] .theme-shortcut+ .account-menu{margin-left:0}
html[data-theme] .theme-shortcut>span:first-child{font-size:18px;line-height:1}
html[data-theme] .btn:not(.ghost):not(.secondary):not(.danger):not(.green),html[data-theme] .login-submit{background:var(--button-bg)!important;border-color:var(--button-bg)!important;color:var(--button-text)!important;box-shadow:none}
html[data-theme] .btn:not(.ghost):not(.secondary):not(.danger):not(.green):hover{background:var(--button-hover)!important;border-color:var(--button-hover)!important}
html[data-theme] :is(.btn.ghost,.back-link){background:var(--surface-raised);color:var(--text);border-color:var(--border)}
html[data-theme] :is(.btn.secondary,.btn.green){background:var(--accent-soft);color:var(--accent);border-color:var(--border)}
html[data-theme] :is(.btn.ghost:hover,.btn.secondary:hover){background:var(--accent-hover);color:var(--text)}
html[data-theme] .btn.danger{background:var(--danger-bg);color:var(--danger);border-color:color-mix(in srgb,var(--danger) 25%,var(--surface))}
html[data-theme] :is(input:not([type=checkbox]):not([type=radio]),select,textarea,.input){background:var(--input-bg);color:var(--text);border-color:var(--border)}
html[data-theme] :is(input,textarea)::placeholder{color:var(--muted);opacity:.8}html[data-theme] input:disabled{opacity:.7}
html[data-theme] :is(input,select,textarea):focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent)}
html[data-theme] :is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
html[data-theme] input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--input-bg) inset;-webkit-text-fill-color:var(--text)}
html[data-theme] :is(.field label,.field>label,.toggle-list b,.permission-list b,.storage-line strong,.restore-limit b){color:var(--text)}
html[data-theme] input:is([type=checkbox],[type=radio]){accent-color:var(--button-bg)}
html[data-theme] :is(.table th,.file-table thead th,.universal-table th,.native-sheet th){background:var(--surface-subtle);color:var(--muted);border-color:var(--border)}
html[data-theme] :is(.table td,.file-table td,.permission-list>div,.toggle-list>label,.settings-facts>div,.device-row,.data-workspace .admin-data-table .row-menu){border-color:var(--border);color:var(--text)}
html[data-theme] :is(.table tbody tr:hover,.file-table tbody tr:hover){background:var(--surface-raised)}
html[data-theme] :is(.file-icon,.data-workspace .file-icon,.restore-limit,.archive-entry,.universal-text,.universal-hex,.data-backup-note,.restore-file-field,.upload-zone,.upload-zone:hover,.upload-zone.dragover){background:var(--surface-subtle);background-image:none;border-color:var(--border);color:var(--text)}
html[data-theme] :is(.file-icon svg,.data-workspace .file-icon svg,.upload-zone strong,.data-backup-note summary,.login-signup a,.auth-link a){color:var(--accent)}
html[data-theme] :is(.data-backup-note summary>.small,.data-delete-note summary,.file-table td[data-label]::before){color:var(--muted)}
html[data-theme] :is(.badge,.role-user,.role-admin,.role-administrator,.badge.viewer){background:var(--accent-soft);color:var(--accent);border-color:var(--border)}
html[data-theme] :is(.data-status.is-active,.alert.success){background:var(--green-bg);color:var(--green);border-color:var(--border)}
html[data-theme] :is(.data-status.is-retained,.restore-caution){background:var(--warning-bg);color:var(--warning);border-color:var(--border)}
html[data-theme] .alert.info{background:var(--accent-soft);color:var(--text);border-color:var(--border)}
html[data-theme] :is(.alert.error,.account-logout){color:var(--danger)}html[data-theme] .alert.error{background:var(--danger-bg);border-color:var(--border)}
html[data-theme] :is(.progress,.native-pdf-wrap,.universal-pdf-wrap,.preview-box){background:var(--surface-subtle)}html[data-theme] .progress>div{background:var(--accent)}
html[data-theme] .mobile-bottom-nav a{color:var(--muted)}html[data-theme] .mobile-bottom-nav a.active{background:var(--accent-soft);color:var(--accent)}
html[data-theme] .mobile-nav-icon{background:transparent;color:inherit}html[data-theme] .login-page{background:var(--bg);color:var(--text)}
html[data-theme] .login-page::before{filter:none;opacity:1}
html[data-theme] .login-brand{width:fit-content;max-width:100%;box-sizing:border-box;padding:7px 12px;border:1px solid var(--border);border-radius:14px;background:var(--surface);text-shadow:none;box-shadow:var(--shadow-sm)}
html[data-theme] .login-footer{align-self:center;max-width:100%;box-sizing:border-box;padding:7px 12px;border-radius:10px;background:var(--surface);color:var(--muted);text-shadow:none}
html[data-theme] :is(.login-panel,.auth-shell,.auth-layout){background:var(--bg);background-image:none;color:var(--text)}
html[data-theme] :is(.login-panel,.auth-card){background:var(--surface);border-color:var(--border);box-shadow:var(--shadow)}
html[data-theme] :is(.login-brand,.panel-intro h2,.auth-brand,.auth-card h1,.auth-story h2){color:var(--text)}
html[data-theme] :is(.panel-description,.panel-description.panel-description,.panel-intro .panel-description){color:var(--muted)!important}
html[data-theme] .login-input{background:var(--input-bg)!important;border-color:var(--border)!important}
html[data-theme] .login-input input{color:var(--text)!important}html[data-theme] .login-input>span{color:var(--muted)}
html[data-theme] :is(.password-toggle,.restore-file-field input::file-selector-button){background:var(--surface-raised);color:var(--accent);border-color:var(--border)}
html[data-theme] .login-panel::before{display:none}html[data-theme] :is(.universal-table td,.native-editor [readonly]){background:var(--input-bg);color:var(--text);border-color:var(--border)}
.appearance-panel{max-width:1040px}.appearance-panel h2{font-size:26px;letter-spacing:-.03em;margin:4px 0 10px}.appearance-panel>p{max-width:720px;line-height:1.7}.theme-options{border:0;padding:0;margin:28px 0 0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.theme-options legend{font-size:13px;font-weight:650;margin-bottom:12px;color:var(--text)}
.theme-option{position:relative;display:flex;flex-direction:column;padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface-subtle);cursor:pointer;gap:8px}.theme-option:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 25%,transparent);background:var(--surface-raised)}
.theme-option>input{position:absolute;top:16px;right:16px;width:17px;height:17px}.theme-option>strong{font-size:14px;margin-top:7px}.theme-option>small{font-size:12px;line-height:1.7;color:var(--muted)}
.theme-sample{display:flex;gap:8px;height:94px;width:100%;padding:12px;border-radius:10px;border:1px solid #60767455;overflow:hidden}.sample-light{background:#f0f4fa}.sample-dark{background:#172125}.sample-system{background:linear-gradient(90deg,#f0f4fa 50%,#172125 50%)}.sample-side{width:23%;border-radius:5px;background:#7a999371}.sample-body{flex:1;display:grid;gap:6px;align-content:center}.sample-body i,.sample-body b,.sample-body em{height:12px;border-radius:4px;display:block;background:#7caaa280}.sample-body i{width:62%}.sample-body b{width:82%}.sample-body em{height:26px;background:#6a8f8755}
@media(max-width:800px){.theme-options{grid-template-columns:1fr}.theme-option{padding:16px 18px 16px 130px;min-height:116px;justify-content:center}.theme-sample{position:absolute;left:16px;top:16px;width:96px;height:83px}.theme-option>input{top:18px;right:16px}.theme-option>strong{padding-right:20px}.appearance-panel h2{font-size:23px}}
@media(max-width:650px){html[data-theme] .theme-shortcut-label{display:none}html[data-theme] .theme-shortcut{min-height:36px;padding:7px 10px;margin-left:auto}html[data-theme] .topbar{gap:9px}.theme-option>small{font-size:11px}.appearance-panel .actions{gap:9px}.appearance-panel .actions>.btn{flex:1;font-size:12px}}
html[data-theme] :is(.item-actions-panel,.list-options-panel,.toast){background:var(--surface-raised);color:var(--text);border-color:var(--border)}
html[data-theme] .settings-nav a{color:var(--muted)}html[data-theme] .settings-nav a.active{color:var(--accent)}
html[data-theme] .workspace-summary>div:nth-child(n) .summary-icon,html[data-theme] .file-table .file-icon{background:var(--accent-soft);color:var(--accent)}
html[data-theme] .password-toggle,html[data-theme] .restore-file-field input::file-selector-button{background:var(--surface-raised);color:var(--accent);border-color:var(--border)}
html[data-theme] .mobile-app-name{color:var(--text)}html[data-theme] .icon-btn{background:var(--surface-raised);color:var(--text);border-color:var(--border)}html[data-theme] :is(.user-chip,.avatar){border-color:var(--border)}html[data-theme] select option{background:var(--input-bg);color:var(--text)}
/* Direct sun/moon controls: no navigation and no Save button. */
.theme-quick{position:relative;margin:0;display:inline-flex;align-items:center;flex-shrink:0}.theme-quick--toolbar{margin-left:auto}.theme-quick+.account-menu{margin-left:0}.theme-icon-group{display:inline-flex;gap:4px;padding:4px;border:1px solid var(--border);background:var(--surface-subtle);border-radius:14px}.theme-icon-button{display:grid;place-items:center;width:38px;height:38px;min-height:38px;padding:8px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);cursor:pointer;box-shadow:none}.theme-icon-button svg{width:21px;height:21px}.theme-icon-button:hover{background:var(--surface-raised);color:var(--text)}.theme-icon-button[aria-pressed=true]{background:var(--accent-soft);color:var(--accent);border-color:var(--border)}.theme-quick--settings{margin-top:18px}.theme-quick--settings .theme-icon-button{width:64px;height:60px;padding:16px}.theme-quick--settings .theme-icon-button svg{width:29px;height:29px}.theme-quick-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.theme-quick--toolbar .theme-quick-status[data-error=true]{position:fixed;top:84px;right:20px;width:min(340px,calc(100vw - 40px));height:auto;overflow:visible;clip-path:none;white-space:normal;background:var(--danger-bg);color:var(--danger);border:1px solid var(--border);border-radius:12px;padding:14px;font-size:12px;line-height:1.6;z-index:100}.theme-quick--settings .theme-quick-status[data-error=true]{position:static;width:auto;height:auto;clip-path:none;white-space:normal;color:var(--danger);margin-left:14px;font-size:12px;max-width:320px}.theme-quick[aria-busy=true] .theme-icon-group{border-color:var(--accent)}
@media(max-width:650px){.theme-icon-group{padding:3px;gap:2px;border-radius:12px}.theme-icon-button{width:36px;height:36px;padding:7px}.theme-icon-button svg{width:20px;height:20px}.theme-quick--toolbar .theme-quick-status[data-error=true]{top:66px}.theme-quick--settings{flex-wrap:wrap;gap:12px}.theme-quick--settings .theme-quick-status[data-error=true]{margin-left:0}}
