/* 1.4: persistent themes, balanced branding and aligned controls. */
:root{color-scheme:light;--muted:#607065;--gold:#856421}
.nav-label{color:#657269}.app-footer{color:var(--muted)}th{color:#5f6d62}.tag.draft{color:#56616f}.tag.cancelled{color:#625f58}.quiet-note strong{color:#52664d}
.empty-icon{color:#5b7451}.quiet-note>span{color:#62745a}.skip-link{background:var(--paper);color:var(--green);border:1px solid var(--line)}.button:disabled,.pdf-tool:disabled{opacity:.65}
html[data-theme=dark]{color-scheme:dark;--ink:#e7eee9;--muted:#adbbb2;--green:#a6dfbc;--green-hover:#c2efd1;--gold:#e0bd77;--line:#42574a;--paper:#1d2b23;--bg:#111b16;--red:#ffb8ad}
.brand{gap:12px}.brand-cat{display:block;width:56px;height:56px;flex:0 0 auto;fill:#47d45a}
.brand>span{font-size:32px}.brand small{font-size:11px;letter-spacing:3px}
.sidebar{width:280px}.workspace{margin-left:280px}.sidebar .brand{margin-bottom:45px;padding-inline:0}
.auth-main{flex-basis:550px;max-width:550px}.auth-toolbar{display:flex;justify-content:flex-end;margin-bottom:24px}
.auth-main .brand{width:100%;gap:18px;margin:0 0 32px;justify-content:center}
.auth-main .brand-cat{width:86px;height:86px}.auth-main .brand>span{font-size:64px;line-height:1.05}.auth-main .brand small{font-size:14px;letter-spacing:5px;margin-top:12px}
.auth-card .auth-help{text-align:center;margin-top:26px;margin-bottom:0;padding-top:4px;line-height:1.65;font-size:15px}.auth-note{margin-top:22px;line-height:1.6}
.topbar{gap:14px;flex-wrap:wrap}.topbar-actions{display:flex;align-items:center;gap:18px;flex-wrap:wrap;min-width:0}
.theme-form{margin:0;display:flex;gap:8px;align-items:center}.theme-toggle{min-height:40px;padding:7px 11px;white-space:nowrap;font-size:14px;gap:7px}
.theme-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;flex-shrink:0}.theme-status{font-size:12px;max-width:200px}
.online-account{min-width:0}.online-account>span{max-width:160px;overflow-wrap:anywhere}
.check{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:12px;line-height:1.5}
.check input[type=checkbox]{width:22px;height:22px;min-height:22px;margin:0;padding:0;align-self:center;flex-shrink:0;accent-color:#294d3e}
.check span{min-width:0}.switch-row{grid-template-columns:44px minmax(0,1fr);margin-bottom:18px}
.switch-row input[role=switch]{appearance:none;-webkit-appearance:none;width:44px;height:26px;min-height:26px;border:1px solid #7b8d80;border-radius:20px;background:#aebbb2;position:relative;cursor:pointer}
.switch-row input[role=switch]::before{content:'';position:absolute;width:20px;height:20px;top:2px;left:2px;border-radius:50%;background:white;box-shadow:0 1px 2px #0003}
.switch-row input[role=switch]:checked{background:#294d3e;border-color:#294d3e}.switch-row input[role=switch]:checked::before{transform:translateX(18px)}
.field input:disabled,.field select:disabled{opacity:.75}.pdf-tool svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2}
.invitation-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:18px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}.invitation-row small{display:block;margin-top:4px}
html[data-theme=dark] .sidebar,html[data-theme=dark] .topbar{background:#18251e}
html[data-theme=dark] .nav-label{color:#b1c1b6}html[data-theme=dark] .quiet-note strong{color:#c0d8c7}html[data-theme=dark] .quiet-note>span{color:#b3c7b9}html[data-theme=dark] .rule-strip{color:#d6eadc}html[data-theme=dark] .empty-icon{background:#293e2e;color:#b3cfbc}
html[data-theme=dark] nav a{color:#c3d2c8}html[data-theme=dark] nav a:hover,html[data-theme=dark] nav a[aria-current]{background:#314938;color:#d4f2de}
html[data-theme=dark] .brand>span{color:#d3eadb}html[data-theme=dark] .brand small{color:#e0bd77}
html[data-theme=dark] .primary{background:#a6dfbc;color:#12291b;box-shadow:none}html[data-theme=dark] .primary:hover{background:#c2efd1}
html[data-theme=dark] .secondary{background:#253b2e;border-color:#6b8673;color:#e1f1e7}html[data-theme=dark] .secondary:hover{background:#34543e}
html[data-theme=dark] .text-button{color:#b5e9c8}html[data-theme=dark] .danger{background:#442a27;border-color:#a97064;color:#ffd0c5}
html[data-theme=dark] .field input,html[data-theme=dark] .field select,html[data-theme=dark] .field textarea,html[data-theme=dark] textarea[readonly],html[data-theme=dark] .subtle-box input[readonly]{background-color:#122018;color:#e7eee9;border-color:#6d8775}
html[data-theme=dark] .field input::placeholder,html[data-theme=dark] .field textarea::placeholder{color:#a8b8ae;opacity:1}
html[data-theme=dark] .field select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23c2d3c7' stroke-width='1.7'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E")}
html[data-theme=dark] input[readonly]{background:#2a4030!important;color:#d1edda!important}
html[data-theme=dark] .field input:-webkit-autofill{-webkit-text-fill-color:#e7eee9;box-shadow:inset 0 0 0 1000px #122018}
html[data-theme=dark] .check input[type=checkbox]{accent-color:#a6dfbc}html[data-theme=dark] .switch-row input[role=switch]{background:#465b4d;border-color:#8da895}
html[data-theme=dark] .switch-row input[role=switch]:checked{background:#a6dfbc;border-color:#a6dfbc}html[data-theme=dark] .switch-row input[role=switch]:checked::before{background:#14291b}
html[data-theme=dark] .stat{background:#1d2b23}html[data-theme=dark] .total-card,html[data-theme=dark] .subtle-box,html[data-theme=dark] .rule-strip,html[data-theme=dark] .switch-row{background:#293e2e;border-color:#526e59}
html[data-theme=dark] .total-card h2,html[data-theme=dark] .total-card .eyebrow{color:#e4f4e9}
html[data-theme=dark] th,html[data-theme=dark] .filters{background:#25372c;color:#c2d3c7}html[data-theme=dark] .clickable-row:hover,html[data-theme=dark] .clickable-row:focus-within{background:#2c4533}
html[data-theme=dark] .tag,html[data-theme=dark] .local-badge,html[data-theme=dark] .file-type{background:#314b38;color:#dbefdf}
html[data-theme=dark] .tag.paid{background:#2a5139;color:#ceffdc}html[data-theme=dark] .tag.cancelled{background:#54332c;color:#ffdbcd}html[data-theme=dark] .tag:not(.paid):not(.cancelled):not(.draft){background:#4e4127;color:#ffe2a9}
html[data-theme=dark] .notice{background:#254635;color:#d1f2dc;border-color:#527b60}html[data-theme=dark] .warning,html[data-theme=dark] .setup-banner{background:#413520;color:#ffe1a8;border-color:#927746}
html[data-theme=dark] .error-summary{background:#442a27;border-color:#a66a5c;color:#ffd0c5}html[data-theme=dark] .field-error{color:#ffb8ad}
html[data-theme=dark] .upload-zone{background:#213628;border-color:#7e9e86}html[data-theme=dark] .upload-zone.drag-active{background:#35583f}
html[data-theme=dark] .document-excerpt,html[data-theme=dark] .secret-code,html[data-theme=dark] .recovery-codes li{background:#122018;color:#dcebe1;border-color:#526e59}
html[data-theme=dark] .auth-qr{background:white;padding:8px}html[data-theme=dark] .step{background:#3c4e36;color:#f1d89c}
html[data-theme=dark] .pdf-viewer,html[data-theme=dark] .pdf-stage{background:#132018;border-color:#59745e}html[data-theme=dark] .pdf-toolbar{background:#273c2e}
html[data-theme=dark] .pdf-tool{background:#203428;color:#d5efde;border-color:#78967e}html[data-theme=dark] .pdf-status,html[data-theme=dark] .pdf-fallback{color:#d0e8d8}
html[data-theme=dark] .pdf-paper{background:#fff}html[data-theme=dark] .quiet-note{color:#b3c7b9}html[data-theme=dark] :focus-visible{outline-color:#f1cd80}
html[data-theme=dark] .icon-button{background:#2a3e30;color:#e4efe6;border-color:#6f8975}
@media(max-width:1150px){.sidebar{width:260px}.workspace{margin-left:260px}.sidebar .brand>span{font-size:30px}.sidebar .brand-cat{width:50px;height:50px}}
@media(max-width:850px){.sidebar{width:100%}.workspace{margin-left:0}.sidebar .brand{margin-bottom:20px}.sidebar .brand>span{font-size:34px}.sidebar .brand-cat{width:58px;height:58px}.topbar{padding:10px 20px}.topbar>span:first-child{max-width:none}.topbar-actions{gap:12px}}
@media(max-width:550px){.auth-main .brand>span{font-size:clamp(38px,11vw,60px)}.auth-main .brand-cat{width:clamp(54px,16vw,78px);height:clamp(54px,16vw,78px)}.auth-main .brand{gap:14px}.auth-main .brand small{font-size:12px;letter-spacing:3.5px}.auth-toolbar{margin-bottom:22px}.auth-card .auth-help{font-size:14px}.topbar>span:first-child{display:none}.topbar-actions{width:100%;justify-content:space-between}.online-account{flex:1;justify-content:flex-end;gap:8px}.online-account>span{font-size:12px;max-width:105px}.theme-toggle{font-size:13px;padding:8px;min-height:40px}.theme-toggle svg{width:18px;height:18px}.theme-status{max-width:100px}.invitation-row .button{width:100%}}
@media(forced-colors:active){.switch-row input[role=switch]{appearance:auto;-webkit-appearance:auto}.switch-row input[role=switch]::before{display:none}}
