:root{color-scheme:light;--surface:#fff;--field-surface:#fff;--surface-hover:#e9f8ff}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex-shrink:0;min-width:44px;height:44px;padding:0 12px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--navy);font-size:12px;font-weight:600;cursor:pointer}
.theme-toggle:hover{background:var(--brand-soft);border-color:var(--cyan)}
.theme-toggle:focus-visible{outline:2px solid var(--navy);outline-offset:3px}
.theme-toggle[hidden],.theme-toggle [hidden]{display:none!important}
.auth-theme-toolbar{display:flex;justify-content:flex-end;margin:0 0 20px}
.auth-panel{position:relative}
.guest-document-notice{background:var(--brand-soft);border:1px solid var(--brand-border)}
.guest-document-notice p{margin:8px 0}
.guest-entry-links{padding-top:6px}
.guest-entry-links .btn{white-space:normal;text-align:center}
html[data-theme=dark]{color-scheme:dark;--navy:#deebff;--blue:#7cdaff;--ink:#ecf3fc;--muted:#afc0d5;--line:#30445b;--bg:#0b1524;--green:#5cddb0;--brand-soft:#12354a;--brand-border:#24627d;--surface:#132238;--field-surface:#0e1b2d;--surface-hover:#193b51}
html[data-theme=dark] :is(.sidebar,.topbar,.card,.stat-card,.auth-panel,.quick-document-tools,.document-colour-card,.payment-progress,.guest-header){background:var(--surface)}
html[data-theme=dark] :is(.auth-body,.guest-document-body){background:var(--bg)}
html[data-theme=dark] :is(input,select,textarea){background:var(--field-surface);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:var(--muted);opacity:.8}
html[data-theme=dark] :is(input,select,textarea):focus{outline-color:var(--cyan)}
html[data-theme=dark] :is(.field,.field small,.stat-value small,.quick-link strong,.quick-link small,.sidebar-footer small,.sidebar-footer,.workspace-footer,.auth-panel>footer,.auth-google-note,.auth-divider,.auth-note,.auth-password-toggle){color:var(--muted)}
html[data-theme=dark] :is(.btn,.sidebar-collapse-toggle){background:var(--surface);border-color:var(--line);color:var(--navy)}
html[data-theme=dark] :is(.btn,.sidebar-collapse-toggle):hover{background:var(--brand-soft);border-color:var(--cyan)}
html[data-theme=dark] .btn-primary{background:var(--cyan);border-color:var(--cyan);color:#10234b}
html[data-theme=dark] .btn-primary:hover{background:#78dcff;border-color:#78dcff;color:#10234b}
html[data-theme=dark] .btn-danger{background:#421f30;border-color:#78404f;color:#ffb2bf}
html[data-theme=dark] .btn-danger:hover{background:#572639;border-color:#e58499;color:#ffdce3}
html[data-theme=dark] thead{background:var(--brand-soft)}
html[data-theme=dark] td{border-bottom-color:var(--line)}
html[data-theme=dark] :is(.alert-success,.badge-success){background:#123b32;color:#90e9c3;border-color:#286653}
html[data-theme=dark] :is(.alert-error,.alert-danger,.badge-danger){background:#402131;color:#ffb3bf;border-color:#704251}
html[data-theme=dark] .badge-warning{background:#3e321c;color:#f3cf86;border-color:#796237}
html[data-theme=dark] .amber{color:#f3cf86!important}
html[data-theme=dark] .red{color:#ffacb8!important}
html[data-theme=dark] :is(.impersonation-banner){background:#3d321c;color:#f3d998;border-color:#71603c}
html[data-theme=dark] .auth-google{background:var(--surface);color:var(--ink);border-color:#718399}
html[data-theme=dark] .auth-google:hover{background:var(--brand-soft)}
html[data-theme=dark] .auth-google:disabled{color:var(--muted);background:var(--bg);border-color:var(--line)}
html[data-theme=dark] .auth-divider::before,html[data-theme=dark] .auth-divider::after{background:var(--line)}
html[data-theme=dark] .auth-password-toggle:hover{background:var(--brand-soft);color:var(--ink)}
html[data-theme=dark] :is(.brand .app-logo,.sidebar-brand-icon){background:white;border-radius:5px}
html[data-theme=dark] .brand .app-logo{padding:5px}
html[data-theme=dark] .preview-pages{background:#07111f;border-color:var(--line)}
html[data-theme=dark] .preview-empty{background:var(--field-surface);border-color:var(--line)}
html[data-theme=dark] :is(.preview-size-controls,.document-style){background:var(--field-surface);border-color:var(--line);color:var(--muted)}
html[data-theme=dark] :is(.document-style:hover,.document-style[aria-pressed=true],.document-colour-option:hover .document-colour-card,.document-colour-option>input:checked+.document-colour-card){background:var(--brand-soft);border-color:var(--cyan)}
html[data-theme=dark] :is(.document-colour-error,.quick-logo-error){color:#ffb3bf}
html[data-theme=dark] .document-custom-controls input[aria-invalid=true]{border-color:#ff8ba1}
html[data-theme=dark] .payment-progress[data-phase=confirmed] .payment-indicator{background:#123b32;color:#90e9c3}
html[data-theme=dark] .payment-progress:is([data-phase=pending],[data-phase=failed],[data-phase=error]) .payment-indicator{background:#3e321c;color:#f3cf86}
html[data-theme=dark] :is(.document-preview-resizer:hover,.document-preview-resizer:focus-visible,.document-preview-resizer.is-dragging,.quick-link:hover>span,.quick-link:focus-visible>span,.page-item.active .page-link){background:var(--cyan);color:#10234b}
html[data-theme=dark] .guest-document-links a[aria-current=page]{background:var(--brand-soft);color:var(--navy);border-color:var(--cyan)}
/* Documents remain white paper with their own branding in either application theme. */
html[data-theme=dark] :is(.quick-page,.document-sheet,.style-sheet,.auth-sheet,.shared-document-paper){color-scheme:light;--navy:#13296b;--blue:#13296b;--ink:#182b4c;--muted:#53657e;--line:#dfe9f2;--bg:#f5faff;--green:#0d9871;--brand-soft:#e9f8ff;--brand-border:#b9e9fc;--surface:#fff;--field-surface:#fff;--surface-hover:#e9f8ff;color:var(--ink)}
html[data-theme=dark] :is(.document-sheet,.quick-page,.shared-document-paper){background:#fff}
html[data-theme=dark] .quick-page :is(input,textarea,select){background:transparent}
html[data-theme=dark] .quick-page :is(input,textarea,select):is(:hover,:focus){background:var(--brand-soft)}
html[data-theme=dark] .quick-page .quick-logo-error{color:#a52222}
@media(max-width:760px){.theme-toggle{padding:0;width:44px}.topbar .theme-toggle [data-theme-label]{display:none}.topbar .account{gap:7px}.topbar .account .avatar{display:none}.topbar .account strong{max-width:110px}.auth-theme-toolbar{margin-bottom:15px}.auth-theme-toolbar .theme-toggle,.guest-header .theme-toggle{width:auto;padding:0 10px}}
@media print{.theme-toggle,.auth-theme-toolbar{display:none!important}html[data-theme=dark]{color-scheme:light;--navy:#13296b;--blue:#13296b;--ink:#182b4c;--muted:#53657e;--line:#dfe9f2;--bg:#fff;--brand-soft:#e9f8ff;--brand-border:#b9e9fc;--surface:#fff;--field-surface:#fff}html[data-theme=dark] body{background:#fff;color:var(--ink)}}
