/* VAIM appearance. Only service UI is themed; published pages and the editor canvas keep their own design. */
:root{
 --ui-bg:#f5f5f7;--ui-surface:#ffffff;--ui-surface-alt:#f7f8fb;--ui-on-accent:#ffffff;--ui-surface-raised:#fafbfe;--ui-ink:#1d1d1f;
 --ui-muted:#777d89;--ui-border:#e2e5ec;--ui-accent:#007aff;--ui-soft:#edf5ff;
 --ui-shadow:0 18px 60px #17203b0d;--ui-success:#237c4f;--ui-danger:#b53737;--ui-overlay:#ffffffed;
}
html[data-theme=light]{color-scheme:light}
html[data-theme=dark]{
 color-scheme:dark;--ui-bg:#101217;--ui-surface:#181c24;--ui-surface-alt:#202632;--ui-on-accent:#102036;--ui-surface-raised:#202632;--ui-ink:#edf1f8;
 --ui-muted:#a5afc0;--ui-border:#323b4b;--ui-accent:#6aaeff;--ui-soft:#1b304b;
 --ui-shadow:0 22px 70px #00000033;--ui-success:#86d5a5;--ui-danger:#ffa3a3;--ui-overlay:#151a23ed;
}
/* Controls are shared by the account, welcome flow, homepage and Studio. */
.appearance-control{display:inline-flex;align-items:center;gap:8px;max-width:100%;font:500 11px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ui-muted)}
.appearance-control>span{white-space:nowrap}
.appearance-control .appearance-select,.appearance-select{
 appearance:auto;display:block;min-width:118px;max-width:100%;width:auto;min-height:36px;height:36px;
 margin:0;padding:7px 8px 7px 11px;border:1px solid var(--ui-border);border-radius:9px;
 background:var(--ui-surface);color:var(--ui-ink);font:500 11px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:none;cursor:pointer;
}
.appearance-control .appearance-select:focus-visible,.appearance-select:focus-visible{outline:3px solid #6aaeff88;outline-offset:3px}
.appearance-dock{position:fixed;right:18px;bottom:18px;z-index:120;padding:5px;background:var(--ui-overlay);border:1px solid var(--ui-border);border-radius:13px;box-shadow:var(--ui-shadow);backdrop-filter:blur(16px)}
.appearance-dock .appearance-control>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.appearance-dock .appearance-select{min-width:118px;min-height:34px;height:34px;border:0;background:transparent}
body:not(:has(.m8)):not(:has(#onboarding)):not(:has(.ob9))>.appearance-dock{display:none}
html[data-theme=dark] body:not(.vb-public){background:var(--ui-bg)!important;color:var(--ui-ink)!important}
html[data-theme=dark] body:not(.vb-public) ::selection{background:#395b86;color:#fff}
html[data-theme=dark] body:not(.studio):not(.vb-public) :is(.shell,.top,body>footer) :is(h1,h2,h3,h4,strong,label,summary){color:var(--ui-ink)}
html[data-theme=dark] body:not(.studio):not(.vb-public) :is(.shell,.top,body>footer) p{color:var(--ui-muted)}
html[data-theme=dark] body:not(.studio):not(.vb-public) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea,select):not(.learn-practice *):not(.m8-mini-page *){
 background:var(--ui-surface-raised)!important;border-color:var(--ui-border)!important;color:var(--ui-ink)!important;box-shadow:none;
}
html[data-theme=dark] body:not(.vb-public) :is(input,textarea)::placeholder{color:#919caf}
html[data-theme=dark] body:not(.vb-public) :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--ui-accent)}
html[data-theme=dark] body:not(.vb-public) :is(input,textarea,select):focus-visible{outline-color:#75b4ff;outline-offset:3px}
html[data-theme=dark] body:not(.studio):not(.vb-public) :is(.btn.primary,button.primary,.learn-primary,.learn-next,.ob-primary){background:#237fe9!important;border-color:#237fe9!important;color:#fff!important}
html[data-theme=dark] body:not(.studio):not(.vb-public) :is(.btn.secondary,.btn.ghost,button.secondary,.learn-secondary,.ob-secondary){background:var(--ui-surface-raised)!important;border-color:var(--ui-border)!important;color:var(--ui-ink)!important}
html[data-theme=dark] body:not(.studio):not(.vb-public) :is(.top,.sidebar,.card,.workspace-card,.project-card,.page-row,.tablewrap,.journey-space,.journey-stats>div,.journey-step,.journey-plan,.journey-note,.account-layout,.auth,.empty-project,.template-choice,.theme-tile){background:var(--ui-surface)!important;border-color:var(--ui-border)!important;box-shadow:none;color:var(--ui-ink)}
html[data-theme=dark] :is(.top .logo,.top nav a,.sidebar h3,.sidebar a,.card h2,.card h3,.page-info strong,.theme-tile h3){color:var(--ui-ink)!important}
html[data-theme=dark] :is(.top nav a:hover,.sidebar a:hover){background:var(--ui-soft);color:#b8d8ff!important}
html[data-theme=dark] :is(.sidebar .eyebrow,.page-info span,.field-grid small,.crm-search small,.table-empty,.muted,.account-kicker,.password-help,.account-switch,.account-privacy,.theme-tile p,.theme-crm){color:var(--ui-muted)!important}
html[data-theme=dark] .top{border-bottom-color:var(--ui-border)}
html[data-theme=dark] :is(.sidebar hr,.page-row,.template-choice,.theme-select,.theme-crm,.theme-tile-body,.tablewrap th,.tablewrap td){border-color:var(--ui-border)!important}
html[data-theme=dark] :is(.page-symbol,.workspace-icon,.theme-select,.tag,.state-pill.draft){background:#263247!important;color:#c5d9f4!important}
html[data-theme=dark] .state-pill.live{background:#183d30;color:#9ce6ba}
html[data-theme=dark] :is(.tablewrap,table){color:var(--ui-ink)}
html[data-theme=dark] :is(th,table thead){background:var(--ui-surface-raised)!important;color:var(--ui-ink)!important}
html[data-theme=dark] .tablewrap tbody tr:hover{background:#222b39}
html[data-theme=dark] :is(.feedback.error,.error.feedback){background:#3a2028;color:#ffb7b7;border-color:#71434f}
html[data-theme=dark] .feedback.success{background:#18372a;color:#a7e4ba;border-color:#365c46}
html[data-theme=dark] .password-wrap button{color:#b9d0ed}
html[data-theme=dark] .password-wrap button:hover{background:var(--ui-soft)}
html[data-theme=dark] :is(.account-switch a,.account-privacy a){color:#a9ccff}
html[data-theme=dark] .site-guide{background:linear-gradient(135deg,#181c24,#1c2b3d)!important}
html[data-theme=dark] .project-art{background:linear-gradient(145deg,#243248,#344667)}
html[data-theme=dark] .project-window{background:#1d2737;border-color:#4d5b73}
html[data-theme=dark] .project-window i{background:#344864}
html[data-theme=dark] .project-window i:nth-child(2){background:#6281ad}
html[data-theme=dark] .template-choice:has(input:checked){background:#21334d!important;border-color:#72a8eb!important}
html[data-theme=dark] .theme-select:has(input:checked){background:var(--ui-soft)!important}
/* Overview, project hub and legacy welcome. New V9 surfaces consume the same variables. */
html[data-theme=dark] :is(.journey-next,.journey-tier,.launch-card,.launch-steps span){background:linear-gradient(135deg,#19212e,#202d43)!important;border-color:var(--ui-border)!important}
html[data-theme=dark] :is(.journey-greeting p,.journey-section-head>span,.journey-step small,.journey-space p,.journey-tier p,.journey-plan p,.journey-note p,.journey-plan ul,.journey-tier-limits span){color:var(--ui-muted)!important}
html[data-theme=dark] :is(.journey-space-icon,.journey-step>span,.journey-welcome-art i){background:var(--ui-soft);color:#b7d5fb;border-color:#425471}
html[data-theme=dark] .journey-step.is-done>span{background:#1d3d2e;color:#a6e6bb;border-color:#335b42}
html[data-theme=dark] :is(.journey-stats b,.journey-tier-limits b){color:var(--ui-ink)}
html[data-theme=dark] .journey-plan.plan-business{background:linear-gradient(#1c2635,#22334d)!important;border-color:#6b89b3!important}
html[data-theme=dark] .journey-project-art>div{background:linear-gradient(145deg,#33415e,#4a4470 70%,#314b73);border-color:#283247;outline-color:#495974;color:#f1f1ff}
html[data-theme=dark] .journey-project-art>div span{color:#d4dcf0}
html[data-theme=dark] #onboarding{color:var(--ui-ink)}
html[data-theme=dark] :is(.ob-header,.ob-lead,.ob-note,.ob-welcome small,.ob-footer a,.ob-progress){color:var(--ui-muted)}
html[data-theme=dark] :is(.ob-header .ob-brand,.ob-step h1,.ob-step h2,.ob-template>strong){color:var(--ui-ink)!important}
html[data-theme=dark] :is(.ob-business,.ob-template,.ob-crm-list li){background:var(--ui-surface);border-color:var(--ui-border);color:var(--ui-ink)}
html[data-theme=dark] .ob-loading{background:#101217f7}
html[data-theme=dark] .ob-error{background:#3a2028;border-color:#71434f;color:#ffb7b7}
/* Beginner academy: lessons follow UI theme; the editable example keeps a light website. */
html[data-theme=dark] .vaim-learning{--learn-ink:var(--ui-ink);--learn-muted:var(--ui-muted);--learn-line:var(--ui-border);--learn-blue:#8abaff}
html[data-theme=dark] :is(.learn-course,.learn-check){background:var(--ui-surface);border-color:var(--ui-border)}
html[data-theme=dark] :is(.learn-tabs,.learn-glossary,.learn-bottom){background:var(--ui-surface-raised);border-color:var(--ui-border)}
html[data-theme=dark] .vaim-learning .learn-tab{color:var(--ui-muted)}
html[data-theme=dark] .vaim-learning .learn-tab[aria-selected=true]{background:#2a3b55;color:#b9d9ff;box-shadow:none}
html[data-theme=dark] .learn-task{background:#2c2944}
html[data-theme=dark] .learn-task>span{color:#cfbdf9}
html[data-theme=dark] .learn-task p{color:#d7d0e9!important}
html[data-theme=dark] .learn-glossary dl>div{border-color:var(--ui-border)}
html[data-theme=dark] .learn-check:has(input:checked){background:#20344d;border-color:#45648b}
html[data-theme=dark] .learn-check:has(input:checked)>span{color:#cee2fa}
html[data-theme=dark] .vaim-learning .learn-reset{color:#bdcce0;border-color:#677b98}
html[data-theme=dark] .learn-steps li:before{background:#20344d;color:#b9d9ff}
html[data-theme=dark] .learn-practice{color:#1d1d1f;border-color:#4a5b72}
html[data-theme=dark] .learn-practice h3{color:#1d1d1f!important}
html[data-theme=dark] .learn-practice article>p{color:#777982!important}
/* Marketing homepage UI. The sample site/editor page remains intentionally light. */
html[data-theme=dark] .m8{--m8-bg:var(--ui-bg);--m8-paper:var(--ui-surface);--m8-ink:var(--ui-ink);--m8-muted:var(--ui-muted);--m8-line:var(--ui-border);--m8-accent:#6aaeff;background:var(--ui-bg)!important;color:var(--ui-ink)}
html[data-theme=dark] .m8-nav{background:var(--ui-overlay)!important;border-color:var(--ui-border)!important;box-shadow:0 1px 0 #0004}
html[data-theme=dark] :is(.m8-brand,.m8-brand b,.m8-mark,.m8-nav-links a,.m8-nav-actions a){color:var(--ui-ink)!important}
html[data-theme=dark] .m8-hero{background:radial-gradient(ellipse at 50% 70%,#1d2c4b 0,#141b29 50%,#101217 85%)!important}
html[data-theme=dark] .m8-hero h1{color:var(--ui-ink)!important}
html[data-theme=dark] .m8-gradient{background:linear-gradient(90deg,#9cbaff,#c3d4fc);background-clip:text;-webkit-background-clip:text;color:transparent}
html[data-theme=dark] :is(.m8-hero-copy,.m8-section-heading>p,.m8-benefits-strip p,.m8-trust-strip,.m8-scroll-cue,.m8-pricing-note,.m8-data-note,.m8-demo-status,.m8-experience-footnote>span,.m8-feature-grid>article p,.m8-feature-grid>article small,.m8-plan-tagline,.m8-plan-highlight,.m8-faq-grid p,.m8-learning-banner p,.m8-footer p,.m8-footer small){color:var(--ui-muted)!important}
html[data-theme=dark] .m8-kicker{background:#1c273c;border-color:#385171;color:#c0d4ee}
html[data-theme=dark] .m8-section{background:var(--ui-bg)!important}
html[data-theme=dark] :is(.m8-business-picker button,.m8-lab,.m8-feature-grid>article,.m8-plan-card,.m8-faq-grid details,.m8-value-calculator,.m8-compare,.m8-crm-table,.m8-crm-card){background:var(--ui-surface)!important;border-color:var(--ui-border)!important;box-shadow:none}
html[data-theme=dark] .m8-business-picker button{color:var(--ui-muted)!important}
html[data-theme=dark] .m8-business-picker button.is-active{background:#d4e5ff!important;border-color:#d4e5ff!important;color:#19334d!important}
html[data-theme=dark] :is(.m8-lab-chrome,.m8-lab-sidebar,.m8-lab-stage,.m8-editor-heading,.m8-crm-header,.m8-mini-inspector,.m8-compare-table thead,.m8-compare-table th,.m8-crm-table-head){background:var(--ui-surface-raised)!important;border-color:var(--ui-border)!important}
html[data-theme=dark] .m8-lab-tabs{background:#111722!important;border-color:var(--ui-border)!important}
html[data-theme=dark] .m8-lab-tabs button{color:var(--ui-muted)!important}
html[data-theme=dark] .m8-lab-tabs button.is-active{background:#34445e!important;color:#edf4ff!important;box-shadow:none}
html[data-theme=dark] :is(.m8-business-badge h3,.m8-crm-header h3,.m8-editor-heading h3,.m8-mini-inspector label,.m8-mini-inspector legend,.m8-calculator-intro h3,.m8-calculator-result h4,.m8-plan-card h3,.m8-plan-price strong,.m8-feature-grid h3,.m8-faq-grid summary,.m8-compare summary){color:var(--ui-ink)!important}
html[data-theme=dark] :is(.m8-business-badge p,.m8-path-step b,.m8-path-step small,.m8-lab-note,.m8-crm-header p,.m8-crm-footnote,.m8-editor-heading p,.m8-mini-inspector small,.m8-calculator-intro p,.m8-calculator-result p,.m8-calculator-result small,.m8-compare-table td,.m8-compare-table th,.m8-footer a){color:var(--ui-muted)!important}
html[data-theme=dark] .m8-path-step.is-active b{color:#b7d7ff!important}
html[data-theme=dark] :is(.m8-path-step>span:first-child,.m8-avatar){background:#293b55;border-color:#47658b;color:#c6defe}
html[data-theme=dark] :is(.m8-site-preview,.m8-mini-page){color:#1d1d1f!important;background:#fff!important}
html[data-theme=dark] .m8-site-preview :is(h3,b,strong){color:#29394e!important}
html[data-theme=dark] .m8-site-copy>p{color:#697b94!important}
html[data-theme=dark] .m8-mini-page :is(h3,b){color:#29394e!important}
html[data-theme=dark] .m8-mini-page p{color:#697b94!important}
html[data-theme=dark] .m8-mini-page .m8-mini-cta{color:#fff!important}
html[data-theme=dark] .m8-mini-block{background:#f5f7fa;border-color:#e1e7f0}
html[data-theme=dark] .m8-mini-inspector fieldset{border-color:var(--ui-border)}
html[data-theme=dark] .m8-crm-table-head{color:var(--ui-muted)!important}
html[data-theme=dark] .m8-crm-card :is(b,p){color:var(--ui-ink)!important}
html[data-theme=dark] .m8-crm-card small{color:var(--ui-muted)!important}
html[data-theme=dark] :is(.m8-status-pill,.m8-crm-entity-nav>span.is-active,.m8-lesson-chips>span){background:#233e35!important;color:#b2e3c4!important;border-color:#385a48}
html[data-theme=dark] .m8-crm-entity-nav>span{border-color:var(--ui-border);color:var(--ui-muted)}
html[data-theme=dark] .m8-lead-toast{background:#1d334b!important;border-color:#5b82b2!important;color:var(--ui-ink)}
html[data-theme=dark] .m8-lead-toast :is(b,small){color:#d5e8ff!important}
html[data-theme=dark] :is(.m8-secondary,.m8-button.m8-secondary,.m8-reset-link){background:var(--ui-surface-raised)!important;border-color:#47536a!important;color:#dbe6f5!important}
html[data-theme=dark] :is(.m8-primary,.m8-button.m8-primary){background:#2784ef!important;border-color:#2784ef!important;color:#fff!important}
html[data-theme=dark] .m8-story{background:linear-gradient(140deg,#0a101c,#15233d)!important}
html[data-theme=dark] :is(.m8-story h2,.m8-story h3,.m8-story-node b){color:#f0f5ff!important}
html[data-theme=dark] :is(.m8-story-grid p,.m8-story-node small,.m8-story .m8-section-heading>p){color:#afbdd3!important}
html[data-theme=dark] .m8-story-node{background:#1b2b44;border-color:#3b5276}
html[data-theme=dark] :is(.m8-learning-banner,.m8-final-cta,.m8-footer){background:var(--ui-surface-raised)!important;border-color:var(--ui-border)!important}
html[data-theme=dark] .m8-learning-banner :is(h2,.m8-lesson-timeline b){color:var(--ui-ink)!important}
html[data-theme=dark] .m8-lesson-timeline>div{border-color:var(--ui-border)}
html[data-theme=dark] :is(.m8-lesson-timeline small,.m8-final-cta p,.m8-final-cta>small){color:var(--ui-muted)!important}
html[data-theme=dark] .m8-final-cta h2{color:var(--ui-ink)!important}
html[data-theme=dark] .m8-final-cta h2>span{color:#a9bddd!important}
html[data-theme=dark] .m8-plan-card.is-featured{background:linear-gradient(150deg,#202c41,#1b2331)!important;border-color:#698dbb!important}
html[data-theme=dark] .m8-plan-card.is-recommended{border-color:#9dc9ff!important;box-shadow:0 0 0 2px #80b7ff25}
html[data-theme=dark] .m8-plan-card ul{color:#becadd}
html[data-theme=dark] .m8-plan-best{background:#294568;color:#cae3ff}
html[data-theme=dark] :is(.m8-calculator-result,.m8-seo-art){background:#202e42!important;border-color:#405a7e!important}
html[data-theme=dark] :is(.m8-recommend-price,.m8-seo-art b){color:#c3ddff!important}
html[data-theme=dark] .m8-calculator-fields input[type=range]{background:#435473}
html[data-theme=dark] .m8-compare-table :is(th,td){border-color:var(--ui-border)!important}
html[data-theme=dark] .m8-compare-table caption{color:var(--ui-muted)}
html[data-theme=dark] .m8-save-art span{background:#293a55;border-color:#4f698e;color:#bdd8ff}
html[data-theme=dark] .m8-editor-art{background:#1e2b40;border-color:#435a7c}
html[data-theme=dark] .m8-editor-art>div{background:#25344d;border-color:#405575;color:#c4d8f4}
html[data-theme=dark] .m8-editor-art>div b{color:#eef5ff!important}
/* Studio chrome uses its own variables. Never target #canvas descendants here. */
html[data-theme=dark] body.studio{--st-bg:#10151e;--st-paper:#171e29;--st-ink:#ecf1fa;--st-muted:#a0adc0;--st-line:#303c50;--st-blue:#74b3ff;--st-blue-soft:#223a5b;color:var(--st-ink)!important}
html[data-theme=dark] .studio :is(.studio-top,.studio-left,.studio-right,.left-tabs,.studio-commandbar,.studio-statusbar,.canvas-toolbar,.canvas-bottom,.sidebar-footer,.mobile-toolstrip){background:#171e29!important;border-color:#303c50!important;color:#c7d3e6}
html[data-theme=dark] .studio :is(.studio-canvas,.studio-workspace){background:#101720!important}
html[data-theme=dark] .studio .studio-canvas{background-image:radial-gradient(#41516a48 1px,transparent 1px)!important}
html[data-theme=dark] .studio :is(.studio-project b,.studio-wordmark,.panel-intro h2,.panel-heading h2,.st-section h3,.library-intro h1,.library-card-copy b,.inspector-header,.st-group>summary,#inspector-empty h3,.tour-card h2){color:#e8effa!important}
html[data-theme=dark] .studio :is(.studio-project small,.studio-statusbar #save-status,.studio-status-hint,.commandbar-intro,.canvas-breadcrumb,.canvas-label,.panel-intro p,.panel-heading p,.library-intro p,.library-footnote,.st-hint,.st-check,.st-field,.st-color-row label,.st-range output,.st-section label,.sidebar-footer,.shortcut-list span,.tour-card p){color:#a6b4c9!important}
html[data-theme=dark] .studio :is(.studio-devices,.category-tabs button,.st-button,.st-mini,.st-upload,.st-button-row button,.st-command,.element-actions button,.zoom-controls,.zoom-controls button,.dialog-head button,.st-color-row button){background:#253248!important;border-color:#40516c!important;color:#dce7f7!important}
html[data-theme=dark] .studio :is(.studio-devices button.active,.category-tabs button.active,.st-primary,.studio-actions>.st-primary){background:#2d83e9!important;border-color:#2d83e9!important;color:#fff!important}
html[data-theme=dark] .studio :is(.left-tabs button,.studio-devices button,.layer,.element-layer,.studio-page-link,.manage-pages,.insert-tools button,.grid-toggle,.mobile-toolstrip button,.help-start){color:#a9bedc!important}
html[data-theme=dark] .studio :is(.left-tabs button.active,.layer.active,.element-layer.active,.studio-page-link.active){background:#213956!important;color:#c8e2ff!important}
html[data-theme=dark] .studio .left-tabs button.active:after{background:#a8ccff}
html[data-theme=dark] .studio :is(.layer:hover,.element-layer:hover,.studio-page-link:hover){background:#21314a!important}
html[data-theme=dark] .studio :is(.library-card,.blank-block,.st-media-item,.reusable-row){background:#1d293c!important;border-color:#3a4f6c!important}
html[data-theme=dark] .studio .library-card-copy small{color:#aabbd2}
html[data-theme=dark] .studio .blank-block{background:#1c304d!important;border-style:dashed}
html[data-theme=dark] .studio .blank-plus{background:#2a4c76;color:#c4e0ff}
html[data-theme=dark] .studio .blank-block small{color:#adc6e8}
html[data-theme=dark] .studio :is(.card-plus,.version-pill,.editor-plan,.left-tabs #block-count,.keyboard-key){background:#283750!important;border-color:#435573!important;color:#c4d6ef!important}
html[data-theme=dark] .studio :is(.st-group,.panel-intro,.inspector-header,.st-section,.tool-dialog-actions,.shortcut-row){border-color:#303c50!important}
html[data-theme=dark] .studio :is(.studio-left,.studio-right,.studio-top,.studio-commandbar,.studio-tool-dialog,dialog) :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea){background:#222e42!important;border-color:#40516d!important;color:#e0eaf8!important}
html[data-theme=dark] .studio :is(.studio-left,.studio-right,dialog) input[type=color]{background:#26364f;border-color:#4a5e7c}
html[data-theme=dark] .studio :is(dialog,.tour-card){background:#1b2638!important;border-color:#465d80!important;color:#e5eefc!important;box-shadow:0 30px 100px #0007}
html[data-theme=dark] .studio dialog :is(h2,h3){color:#edf4ff!important}
html[data-theme=dark] .studio dialog :is(p,label,small){color:#bdcbe1!important}
html[data-theme=dark] .studio dialog::backdrop{background:#050a13aa}
html[data-theme=dark] .studio :is(.assistant-output,.adapt-summary,.adapt-device-cards>div,.adapt-issue){background:#24354f!important;border-color:#425b80!important;color:#d0e2f8!important}
html[data-theme=dark] .studio .recovery-bar{background:#3e3220;color:#f6d49c;border-color:#756043}
html[data-theme=dark] .studio .recovery-bar button{background:#5a4526;color:#ffe0ad;border-color:#997740}
html[data-theme=dark] .studio .tour-skip{color:#b5cbe9}
html[data-theme=dark] .studio .appearance-select{min-width:105px;background:#253248!important;border-color:#40516c!important;color:#e0eaf8!important}
/* With scripting disabled, at least the shell and native controls follow the device theme. */
@media(prefers-color-scheme:dark){
 html:not([data-theme]){color-scheme:dark;--ui-bg:#101217;--ui-surface:#181c24;--ui-surface-alt:#202632;--ui-on-accent:#102036;--ui-surface-raised:#202632;--ui-ink:#edf1f8;--ui-muted:#a5afc0;--ui-border:#323b4b;--ui-accent:#6aaeff;--ui-soft:#1b304b}
 html:not([data-theme]) body:not(.vb-public){background:var(--ui-bg)!important;color:var(--ui-ink)!important}
 html:not([data-theme]) body:not(.vb-public)>:is(.top,.appearance-dock){background:var(--ui-surface)!important;border-color:var(--ui-border)!important;color:var(--ui-ink)}
 html:not([data-theme]) body:not(.vb-public) :is(input,textarea,select){background:var(--ui-surface-raised);color:var(--ui-ink);border-color:var(--ui-border)}
}
@media(max-width:850px){.appearance-control>span{display:none}.studio .appearance-control .appearance-select{min-width:103px;font-size:10px;height:31px;min-height:31px}.appearance-dock{right:12px;bottom:12px}.appearance-dock .appearance-select{min-width:110px}}
@media(max-width:450px){.top .appearance-select{min-width:102px!important;font-size:10px!important}.appearance-dock{right:10px;bottom:10px;padding:4px;border-radius:11px}.appearance-dock .appearance-select{min-width:110px;font-size:10px}.studio .appearance-control .appearance-select{min-width:96px;font-size:9px}.appearance-control{gap:4px}}
@media(prefers-reduced-motion:reduce){.appearance-control,.appearance-dock,.appearance-select{transition:none!important;animation:none!important}}
/* Native inputs inside a site's preview follow that site's light baseline, not editor chrome. */
.studio #canvas{color-scheme:light}
.appearance-dock[hidden]{display:none!important}
label.appearance-dock>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-theme=dark] .studio .canvas-toolbar>.grid-toggle.active{background:#263f61;border-color:#4c6e98;color:#d6e9ff!important}
/* Theme choice adds one compact row on phones instead of pushing Publish offscreen. */
@media(max-width:850px){
 .studio .studio-top .studio-actions{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));width:100%;gap:7px;align-items:center}
 .studio .studio-top .studio-actions>.appearance-control{grid-column:1/4;justify-self:start;min-width:0}
 .studio .studio-top .studio-actions>.history-buttons{grid-column:4/7;justify-self:end;margin:0}
 .studio .studio-top .studio-actions>#preview-toggle{grid-column:1/3}
 .studio .studio-top .studio-actions>#save{grid-column:3/5}
 .studio .studio-top .studio-actions>#publish{grid-column:5/7}
 .studio .studio-top .studio-actions>:is(#preview-toggle,#save,#publish){width:100%;min-width:0;min-height:37px;white-space:nowrap;padding:7px 5px;font-size:10px}
}

/* Muted surfaces must follow the same theme as their text. */
.p9 .p9-btn.p9-primary{color:var(--ui-on-accent,#fff)}
/* Authentication remains usable on narrow screens in all three modes. */
@media(max-width:450px){
 .account-layout,.account-panel{min-width:0;max-width:100%;box-sizing:border-box}
 .account-panel{padding-inline:20px}
 .account-panel h1{font-size:clamp(30px,8vw,44px);overflow-wrap:anywhere}
 .account-kicker{min-width:0;max-width:100%;align-items:center}
 .account-kicker>span{white-space:normal;overflow-wrap:anywhere;min-width:0}
 .account-panel form,.account-panel input,.account-panel label,.password-wrap{min-width:0;max-width:100%;box-sizing:border-box}
 .account-panel .auth-submit{white-space:normal}
}
