.theme-toggle{position:fixed;top:calc(12px + env(safe-area-inset-top,0px));right:14px;z-index:90;width:38px;height:38px;border-radius:50%;border:1px solid var(--line,#ddd);background:#fff;color:#111;display:grid;place-items:center;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.08);transition:transform .2s,background .2s}
.theme-toggle:hover{transform:rotate(18deg)}.theme-toggle:active{transform:scale(.9)}
.theme-toggle .tt-moon{display:block}.theme-toggle .tt-sun{display:none}
html[data-theme=dark] .theme-toggle{background:#1a1d1b;color:#b8ff5a;border-color:#2c312d;box-shadow:none}
html[data-theme=dark] .theme-toggle .tt-moon{display:none}html[data-theme=dark] .theme-toggle .tt-sun{display:block}
@media(min-width:701px){.theme-toggle{top:16px;right:16px}}
html{color-scheme:light}html[data-theme=dark]{color-scheme:dark}
body,.app-header{transition:background-color .25s,color .25s}
/* ---------- dark ---------- */
html[data-theme=dark]{--ink:#f2f2ee;--paper:#0d0f0e;--white:#151816;--soft:#171a18;--muted:#9a9e98;--line:#2a2e2b;--green2:#b8ff5a;--green-dark:#b8ff5a;
 --ui-bg:#0d0f0e;--ui-surface:#151816;--ui-ink:#f2f2ee;--ui-muted:#9a9e98;--ui-border:#2a2e2b;--ui-soft:#171a18;--ui-green-dark:#b8ff5a;--ui-shadow:0 10px 30px rgba(0,0,0,.4)}
html[data-theme=dark] body{background:#0d0f0e;color:#f2f2ee}
html[data-theme=dark] header,html[data-theme=dark] .app-header,html[data-theme=dark] .folio-nav{background:rgba(13,15,14,.88)!important;border-color:#2a2e2b!important}
html[data-theme=dark] a{color:inherit}
html[data-theme=dark] input,html[data-theme=dark] textarea,html[data-theme=dark] select{background:#151816!important;color:#f2f2ee!important;border-color:#2f3430!important}
html[data-theme=dark] ::placeholder{color:#7d817c!important}
html[data-theme=dark] img:not(.brand-img){filter:none}
html[data-theme=dark] .wordmark img,html[data-theme=dark] .brand-img{filter:invert(1) hue-rotate(180deg)}
/* surfaces */
html[data-theme=dark] :is(.device-card,.help-grid article,.map-shell,.map-bar,.map-scroll,.map-detail,.map-shell.full,.proof-promise,.mobile-progress,.files-card,.rec-card,.card,.login-card,.feed-metrics div,.welcome-line,.client-dialog-card,.gallery-more button,.btn.line,.links-del,.project-switcher select,.login-password,.node-dot,.node.locked .node-dot,.ew-steps li:before,.auth-page .login-card,.auth-page #googleLogin,.auth-page .login-card label input,.auth-page .login-password){background:#151816!important;color:#f2f2ee;border-color:#2a2e2b!important}
html[data-theme=dark] :is(.map-scroll){background:#121513!important}
html[data-theme=dark] :is(.project-image,.files-ico,.message,.security-note,.auth-tabs,.login-password button,.request-status.reviewing,.stage:before){background:#1d211e!important;color:#d4d7d2;border-color:#2a2e2b!important}
html[data-theme=dark] :is(.approval,.mode,.form-status,.request-status.resolved){background:#1a2412!important;color:#b8ff5a!important;border-color:#33461f!important}
html[data-theme=dark] :is(.form-error,.wizard-error){background:#2a1613!important;color:#ff9d8f!important;border-color:#5a2b24!important}
html[data-theme=dark] :is(.pd-list div,.links-list li,.ew-steps li,.info-list div,.file,.request-row,.timeline,.legal-footer,.auth-page .divider:before,.auth-page .divider:after){border-color:#2a2e2b!important}
html[data-theme=dark] .auth-page .divider:before,html[data-theme=dark] .auth-page .divider:after{background:#2a2e2b!important}
html[data-theme=dark] body.auth-page,html[data-theme=dark] .auth-page .login-wrap{background:#0d0f0e}
html[data-theme=dark] .notice{background:#1a2412;border-color:#33461f;color:#d4d7d2}
html[data-theme=dark] :is(.policy p,.policy li,.policy-hero p){color:#a8aca6}
html[data-theme=dark] .auth-page #googleLogin{color:#f2f2ee}
html[data-theme=dark] :is(.map-detail,.proof-promise,.map-shell){color:#f2f2ee}
html[data-theme=dark] :is(.node-dot){color:#8b8f89}
html[data-theme=dark] :is(.btn:not(.line):not(.green),.cta.dark,.auth-page .primary,.auth-page button[type=submit]){}
/* black buttons flip to light pill in dark */
html[data-theme=dark] .auth-page #authForm button[type=submit],html[data-theme=dark] .auth-page .login-card .btn:not(.line){background:#f2f2ee!important;color:#0d0f0e!important}
html[data-theme=dark] .template{background:#1d211e}
html[data-theme=dark] .folio-controls{background:rgba(13,15,14,.94)!important}
html[data-theme=dark] :is(#filters button,.filters button,.folio-controls button){background:#151816;color:#d4d7d2;border-color:#2a2e2b}
html[data-theme=dark] :is(#filters button.active,.filters button.active,.folio-controls button.on,.folio-controls button[aria-pressed=true]){background:#b8ff5a!important;color:#0d0f0e!important;border-color:#b8ff5a!important}
html[data-theme=dark] :is(.wizard-progress,.inside,.wizard-actions){background:#0d0f0e!important}
html[data-theme=dark] button.choice{background:#151816!important;color:#f2f2ee!important;border-color:#2a2e2b!important}
html[data-theme=dark] button.choice:hover,html[data-theme=dark] button.choice.on,html[data-theme=dark] button.choice[aria-pressed=true]{border-color:#b8ff5a!important}
html[data-theme=dark] :is(.lead,p.overline,.story p,.journal p,.entry p){color:#b4b8b2}
html[data-theme=dark] :is(.wizard-progress b){color:#f2f2ee}
html[data-theme=dark] .tabbar{background:rgba(18,21,19,.94)!important;border-top-color:#2a2e2b!important}
html[data-theme=dark] .tabbar a,html[data-theme=dark] .tabbar button{color:#8d918b}
html[data-theme=dark] .tabbar [aria-current=page],html[data-theme=dark] .tabbar .on,html[data-theme=dark] .tabbar .active{color:#b8ff5a}
html[data-theme=dark] :is(.wizard,.wizard-actions,.psheet,.sheet,.ah-sheet){background:#151816!important;color:#f2f2ee;box-shadow:none}
html[data-theme=dark] .wizard-actions{border-color:#2a2e2b!important}
html[data-theme=dark] .wizard :is(h1,h2,h3,b,strong,span,label){color:inherit}
html[data-theme=dark] .auth-switch{color:#9a9e98}
html[data-theme=dark] .auth-switch button{color:#f2f2ee}
html[data-theme=dark] .auth-page .login-card :is(h1,h2,label,.login-sub){color:#f2f2ee}
@media(max-width:700px){.theme-toggle{top:auto;bottom:calc(var(--tab-h,58px) + var(--sab,0px) + 12px);right:12px;width:40px;height:40px;opacity:.92}
 html.app-home .theme-toggle{top:calc(10px + env(safe-area-inset-top,0px));bottom:auto}}
/* admin */
html[data-theme=dark] .sidebar{background:#070908}
html[data-theme=dark] :is(.metric-card,.panel,.project-card,.funnel,.modal,dialog,.table-wrap,.view-head+.filters){background:#151816;color:#f2f2ee;border-color:#2a2e2b}
html[data-theme=dark] :is(table,th,td,tr){border-color:#2a2e2b!important;color:#e6e8e4}
html[data-theme=dark] :is(.pipe,.action-item){background:#1b1e1c;color:#f2f2ee;border-color:#2a2e2b}
html[data-theme=dark] .fn-svg .fb{fill:#2a2e2b}html[data-theme=dark] .fn-svg .fn{fill:#f2f2ee}html[data-theme=dark] .fn-svg .fl{fill:#9a9e98}
html[data-theme=dark] :is(.btn.line,.btn:not(.primary):not(.line)){background:#1b1e1c;color:#f2f2ee;border-color:#2f3430}
html[data-theme=dark] .tag{background:#1d211e;color:#d4d7d2}
html[data-theme=dark] .warning{background:#1a2412!important;border-color:#33461f!important;color:#d4d7d2!important}
html[data-theme=dark] .action-item b,html[data-theme=dark] .action-item span{color:#d4d7d2}
html[data-theme=dark] :is(.admin-brand,.admin-top h1,.admin-top .eyebrow){color:#f2f2ee}
html[data-theme=dark] .admin-top .brand-img,html[data-theme=dark] .admin-brand img{filter:invert(1)}
html[data-theme=dark] .lb-link .lb-arrow{color:#f2f2ee}
html[data-theme=dark] .lb-link .lb-word{filter:invert(1) brightness(1.1)}
html[data-theme=dark] .psheet-card{background:#151816;color:#f2f2ee}
html[data-theme=dark] .psheet-slide h2{color:#f2f2ee}
html[data-theme=dark] .psheet-tag{color:#9a9e98}
html[data-theme=dark] .psheet-slide p{color:#c4c8c2}
html[data-theme=dark] .psheet-grab:after{background:#3a3f3b}
html[data-theme=dark] .psheet-slide img{background:#1d211e}
html[data-theme=dark] .psheet-card :is(a,.psheet-cta,.psheet-open,button.cta){background:#b8ff5a!important;color:#0d0f0e!important}
html[data-theme=dark] .psheet-count{color:#9a9e98}
html[data-theme=dark] :is(.project-card .open,.project-image .pill,.project-image a,.project-image span,.view-pill){color:#0d0f0e}
html[data-theme=dark] .project-meta h2{color:#f2f2ee}

/* admin modals + dialogs, dark */
html[data-theme="dark"] .modal .modal-card,html[data-theme="dark"] .modal>div,html[data-theme="dark"] .secure-dialog,html[data-theme="dark"] .workspace-dialog{background:#141414;color:#f2f2ee;border:1px solid #2a2a2a}
html[data-theme="dark"] .modal h2,html[data-theme="dark"] .modal h3,html[data-theme="dark"] .secure-dialog h2,html[data-theme="dark"] .secure-dialog h3,html[data-theme="dark"] .workspace-dialog h2,html[data-theme="dark"] .workspace-dialog h3{color:#f2f2ee}
html[data-theme="dark"] .modal label,html[data-theme="dark"] .modal p,html[data-theme="dark"] .modal small,html[data-theme="dark"] .secure-dialog label,html[data-theme="dark"] .secure-dialog p,html[data-theme="dark"] .workspace-dialog label,html[data-theme="dark"] .workspace-dialog p{color:#c9c9c2}
html[data-theme="dark"] .modal input,html[data-theme="dark"] .modal select,html[data-theme="dark"] .modal textarea,html[data-theme="dark"] .secure-dialog input,html[data-theme="dark"] .secure-dialog select,html[data-theme="dark"] .secure-dialog textarea,html[data-theme="dark"] .workspace-dialog input,html[data-theme="dark"] .workspace-dialog select,html[data-theme="dark"] .workspace-dialog textarea{background:#1f1f1f;color:#f2f2ee;border:1px solid #3a3a3a}
html[data-theme="dark"] .modal input::placeholder,html[data-theme="dark"] .modal textarea::placeholder,html[data-theme="dark"] .secure-dialog input::placeholder{color:#777}
html[data-theme="dark"] .modal [data-close],html[data-theme="dark"] .secure-dialog .btn:not(.primary){background:#1f1f1f;color:#f2f2ee;border:1px solid #3a3a3a}
html[data-theme="dark"] .secure-dialog::backdrop,html[data-theme="dark"] .workspace-dialog::backdrop{background:rgba(0,0,0,.7)}
html[data-theme] .ah-primary,html[data-theme] .ah-primary b{color:#0b0b0b}
@media(max-width:700px){.theme-toggle{position:absolute;top:calc(14px + env(safe-area-inset-top,0px));bottom:auto;right:14px;width:36px;height:36px;opacity:1}html.app-home .theme-toggle{position:absolute}}
@media(max-width:700px){.app-top nav a.btn,.app-top nav .account-access,.app-top nav>a:not(.btn):not(.account-access){display:none!important}}

/* Theme choice lives in Account, never in the navigation. */
.account-appearance{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:20px;padding:14px 0;border-top:1px solid var(--line,#ddd)}
.account-appearance .theme-toggle{position:static;inset:auto;flex:none;transform:none;margin:0}

.account-appearance .theme-toggle{display:grid!important;position:static!important;width:44px;height:44px;visibility:visible}
