/* Platform-owned surfaces only. The control console remains the recovery entry. */
body:where([data-design-page]) {
 --design-bg-default:#f6f7f9;--design-panel-default:#fff;--design-text-default:#24262b;--design-muted-default:#7b8491;--design-accent-default:#232427;--design-border-default:#e1e5eb;
 font-family:var(--design-font,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif);
 font-size:var(--design-font-size,14px);
 color:var(--design-text,var(--design-text-default));
 background:var(--design-image,none) center/cover fixed,var(--design-background,var(--design-bg-default));
}
:where(:root[data-theme="dark"] body[data-design-page]){--design-bg-default:#161a22;--design-panel-default:#202630;--design-text-default:#e6ebf3;--design-muted-default:#a8b2c2;--design-accent-default:#45546b;--design-border-default:#343d4b}
:where(body[data-design-page]) :is(button,input,textarea,select,label){font-family:inherit;font-size:inherit}
:where(body[data-design-page]) :is(p,.help,.platform-note){color:var(--design-muted,var(--design-muted-default))}
:where(body[data-design-page]) :is(.card,.auth-card,.auth-panel,.glass-card,.app-card){background:var(--design-panel,var(--design-panel-default));border-color:var(--design-border,var(--design-border-default));border-radius:var(--design-radius,16px)}
:where(body[data-design-page]) :is(button,input,textarea,select,.button){border-radius:var(--design-radius,10px)}
:where(body[data-design-page]) :is(button.primary,.button.primary,.button.dark,.auth-card button[type=submit],.auth-panel button[type=submit]){background:var(--design-accent,var(--design-accent-default));border-color:var(--design-accent,var(--design-accent-default));color:#fff}
:where(body[data-design-page]) :is(.sidebar,.application-rail,.account-topbar,.assistant,.settings-tabs){background:var(--design-panel,var(--design-panel-default));border-color:var(--design-border,var(--design-border-default))}
:where(body[data-design-page]) :is(.grid,.application-grid,.platform-grid){gap:var(--design-gap,20px);grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--design-card-width,220px)),1fr))}
:where(body[data-design-page]) .app-icon{width:var(--design-icon,43px);height:var(--design-icon,43px)}
:where(body[data-design-page]) .app-icon img{width:100%;height:100%;object-fit:contain}
:where(body[data-design-page="home"]) .wrap{max-width:var(--design-width,1220px)}
:where(body[data-design-page="home"]) .hero{max-width:var(--design-width,1220px);margin-inline:auto}
:where(body[data-design-page="home"][data-design-layout="wide"]) .hero{max-width:none}
:where(body[data-design-page="home"][data-design-layout="wide"]) .hero-stage{max-width:95vw}
:where(body[data-design-page="login"]) .auth-wrap{max-width:var(--design-width,1160px);gap:var(--design-gap,48px);margin-inline:auto}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-wrap{display:flex;flex-direction:column;align-items:center;justify-content:safe center;width:100%;max-width:var(--design-width,600px);min-height:100dvh;padding:32px 24px;gap:var(--design-gap,24px)}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-story{width:100%;max-width:560px;min-width:0;text-align:center;overflow-wrap:anywhere}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-story h1{font-size:clamp(28px,3vw,36px);line-height:1.3;margin:20px 0 12px;letter-spacing:-.8px}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-story p{max-width:100%;margin:0 auto}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-tags{justify-content:center;margin-top:18px}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-card{flex:none;width:100%;max-width:440px;min-width:0;margin:0;padding:28px;text-align:start;overflow-wrap:anywhere}
:where(body[data-design-page="login"][data-design-layout="center"]) .auth-bottom{gap:12px;flex-wrap:wrap}
:where(body[data-design-page="login"][data-design-layout="reverse"]) .auth-story{order:2}
:where(body[data-design-page="portal"]) .shell{grid-template-columns:var(--design-sidebar,248px) minmax(0,1fr)}
:where(body[data-design-page="portal"]) .main{width:100%;max-width:var(--design-width,1600px);margin-inline:auto}
:where(body[data-design-page="portal"][data-design-layout="right"]) .shell{grid-template-columns:minmax(0,1fr) var(--design-sidebar,248px)}
:where(body[data-design-page="portal"][data-design-layout="right"]) .sidebar{order:2}
:where(body[data-design-page="portal"][data-design-layout="top"]) .shell{display:flex;flex-direction:column}
:where(body[data-design-page="portal"][data-design-layout="top"]) .sidebar{width:100%;height:auto;position:static;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:20px}
:where(body[data-design-page="portal"][data-design-layout="top"]) .sidebar nav{display:flex;flex-wrap:wrap}
:where(body[data-design-page="portal"][data-design-layout="top"]) .sidebar-footer{margin-top:0}
:where(body[data-design-page="desktopLogin"]) .auth-gate{background:transparent;gap:var(--design-gap,24px)}
:where(body[data-design-page="desktopLogin"]) .auth-panel{max-width:var(--design-width,520px)}
:where(body[data-design-page="desktopLogin"][data-design-layout="center"]) .auth-intro{text-align:center}
:where(body[data-design-page="desktopLogin"][data-design-layout="split"]) .auth-gate{display:grid;grid-template-columns:1fr minmax(280px,1fr);align-content:center;align-items:center}
:where(body[data-design-page="desktop"]) .application-workspace{grid-template-columns:var(--design-sidebar,64px) minmax(0,1fr);background:var(--design-background,var(--design-bg-default))}
:where(body[data-design-page="desktop"]) .application-workspace:before{background:var(--design-panel,var(--design-panel-default));border-color:var(--design-border,var(--design-border-default))}
:where(body[data-design-page="desktop"]) .workspace{min-width:0}
:where(body[data-design-page="desktop"][data-design-layout="right"]) .application-workspace{grid-template-columns:minmax(0,1fr) var(--design-sidebar,64px)}
:where(body[data-design-page="desktop"][data-design-layout="right"]) .application-rail{grid-column:2;grid-row:2}
:where(body[data-design-page="desktop"][data-design-layout="right"]) .workspace{grid-column:1;grid-row:2}
:where(body[data-design-page="desktop"][data-design-layout="compact"]) .app-launch{padding:14px}
:where(body[data-design-page="desktop"]) .rail-app .app-icon{width:var(--design-icon,30px);height:var(--design-icon,30px)}
@media(max-width:760px){
 :where(body[data-design-page="portal"]) .shell,:where(body[data-design-page="portal"][data-design-layout="right"]) .shell{grid-template-columns:1fr}
 :where(body[data-design-page="portal"][data-design-layout="right"]) .sidebar{order:0}
 :where(body[data-design-page="desktopLogin"][data-design-layout="split"]) .auth-gate{display:flex}
 :where(body[data-design-page="login"]) .auth-wrap{grid-template-columns:1fr}
}
:where(body[data-design-page]) [hidden]{display:none!important}
:where(body[data-design-page]) :is(h1,h2,h3,strong){color:var(--design-text,var(--design-text-default))}
:where(body[data-design-page="desktop"]) .app-center{max-width:var(--design-width,1920px);margin-inline:auto;width:100%}
.ui-preview-brand{display:inline-block;width:32px;height:32px;object-fit:contain;border-radius:22%}
.ui-layout-preview :is(a,button){pointer-events:none}
:where(body[data-design-page="desktop"]) .application-workspace{background:var(--design-image,none) center/cover,var(--design-background,var(--design-bg-default))}
:where(body[data-design-page="home"]) .logo-row img{width:var(--design-icon,25px);height:var(--design-icon,25px);object-fit:contain}

/* Keep icon slots proportionate even when a theme applies broad image rules.
   This stylesheet is shared by desktop clients and the browser preview. */
html[data-ui-surface="desktop"] body .app-icon {
 --app-icon-limit:48px;
 max-inline-size:var(--app-icon-limit)!important;
 max-block-size:var(--app-icon-limit)!important;
 min-inline-size:0!important;
 min-block-size:0!important;
 overflow:hidden;
}
html[data-ui-surface="desktop"] body .rail-app .app-icon { --app-icon-limit:30px }
html[data-ui-surface="desktop"] body .landing-icon .app-icon { --app-icon-limit:48px }
html[data-ui-surface="desktop"] body .app-icon > :is(img,svg) {
 inline-size:100%!important;
 block-size:100%!important;
 min-inline-size:0!important;
 min-block-size:0!important;
 max-inline-size:100%!important;
 max-block-size:100%!important;
 object-fit:contain!important;
}
html[data-ui-surface="desktop"] body :is(.desktop-brand-symbol,.ui-preview-brand) {
 max-inline-size:32px!important;
 max-block-size:32px!important;
 object-fit:contain!important;
}
html[data-ui-surface="home"] body .logo-row img {
 max-inline-size:28px!important;
 max-block-size:28px!important;
 object-fit:contain!important;
}

/* Only the editor adds this attribute; published pages remain non-editable. */
.ui-layout-preview [data-ui-editable], [data-ui-editable]{pointer-events:auto!important;cursor:text;white-space:pre-wrap;outline:1px dashed transparent;outline-offset:4px}
[data-ui-editable]:hover{outline-color:#80858c}
[data-ui-editable]:focus{outline:2px solid #80858c;outline-offset:4px}

/* Stable vocabulary for generated themes; values follow the active palette. */
body:where([data-design-page]){--background:var(--design-background,var(--design-bg-default));--panel:var(--design-panel,var(--design-panel-default));--text:var(--design-text,var(--design-text-default));--muted:var(--design-muted,var(--design-muted-default));--accent:var(--design-accent,var(--design-accent-default));--border:var(--design-border,var(--design-border-default));--width:var(--design-width,1280px)}

/* Custom compositions must not inherit the fixed-height navigation column. */
:where(body[data-design-page="portal"][data-design-custom]) .shell{align-content:start}
:where(body[data-design-page="portal"][data-design-custom]) .sidebar{height:auto;min-height:0;position:static}
:where(body[data-design-page="portal"][data-design-custom]) .sidebar nav{margin-top:0}
:where(body[data-design-page="portal"][data-design-custom]) .main{min-width:0}

/* Native workspace controls must remain usable under broad generated theme rules.
   Keep colors and placement customizable, but do not treat webview hosts as cards. */
body[data-design-page="desktop"] .workspace{padding:0!important;min-height:0;overflow:hidden}
body[data-design-page="desktop"] .workspace>.browser-shell,
body[data-design-page="desktop"] .workspace>.assistant,
body[data-design-page="desktop"] .assistant-tool-content{padding:0!important;min-width:0;min-height:0;box-shadow:none}
body[data-design-page="desktop"] .assistant-tool-layout{grid-template-columns:max(76px,calc(76px * var(--ui-scale,1))) minmax(0,1fr)}
body[data-design-page="desktop"] .assistant-tool-nav>button{width:100%!important;height:auto!important;min-height:64px;padding:9px 2px!important;letter-spacing:normal;white-space:nowrap;flex-shrink:0;font-size:calc(10px * var(--ui-scale,1))}
body[data-design-page="desktop"] .account-topbar .app-center-tab,
body[data-design-page="desktop"] .account-topbar .account-tab-actions>button{width:auto!important;min-width:max-content;height:max(33px,calc(33px * var(--ui-scale,1)))!important;white-space:nowrap;flex-shrink:0;padding:0 10px!important;letter-spacing:normal}
body[data-design-page="desktop"] .account-topbar{min-height:48px;gap:8px;padding:7px 12px!important}
body[data-design-page="desktop"] .application-workspace{grid-template-columns:clamp(64px,var(--design-sidebar,64px),96px) minmax(0,1fr)!important}
body[data-design-page="desktop"][data-design-layout="right"] .application-workspace{grid-template-columns:minmax(0,1fr) clamp(64px,var(--design-sidebar,64px),96px)!important}
body[data-design-page="desktop"] .application-rail{padding:10px 6px!important;min-width:0}
body[data-design-page="desktop"] .application-rail button{padding:0!important;text-align:center;letter-spacing:normal}

.ui-editor-preview :is(button,a,[tabindex]):focus:not(:focus-visible):not([contenteditable]){outline:none}
.ui-editor-preview :is(button,a,[tabindex]):focus-visible,
.ui-editor-preview :is(input,select,textarea,[contenteditable]):focus{outline:2px solid #80858c;box-shadow:none}
