/* Current visual layer: owner-approved cream / warm orange, 2026-10-11.
   Browser storage and existing demo business flows are retained. */
/* Owner-provided, unmodified MiSans originals. Copyright Xiaomi Inc.
   Attribution and bundled license: fonts/NOTICE.txt and MiSans-LICENSE.pdf. */
@font-face {
  font-family:"MiSans";
  src:url("fonts/MiSans-Medium.woff2") format("woff2");
  font-style:normal;
  font-weight:500;
  font-display:swap;
}
@font-face {
  font-family:"MiSans";
  src:url("fonts/MiSans-Semibold.woff2") format("woff2");
  font-style:normal;
  font-weight:600;
  font-display:swap;
}
@font-face {
  font-family:"MiSans";
  src:url("fonts/MiSans-Bold.woff2") format("woff2");
  font-style:normal;
  font-weight:700;
  font-display:swap;
}
:root {
  --font-ui:"MiSans",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
html,body { font-family:var(--font-ui); font-synthesis:none; }
:root :is(h1,h2,h3,h4,button,input,select,textarea) { font-family:var(--font-ui); }
.font-credit { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.7; color:var(--muted); margin:16px 0; }
.font-credit a { color:var(--accent); text-underline-offset:3px; }
:root {
  color-scheme: light;
  --canvas:#F7F4ED; --surface:#FFFCF6; --soft:#F7F4ED; --subtle:#EEE8DE;
  --ink:#292720; --body:#625B50; --muted:#70675B;
  --hair:#DDD5C8; --line:#8B7F6F;
  --accent:#B9471C; --accent-hover:#A94018; --accent-pressed:#923712; --on-accent:#FFF8F1;
  --brand:#D06A37; --focus:#A63C16; --selected:#F5E2D3; --selected-text:#843414;
  --success:#286147; --error:#AE3434; --warn:#89500F; --info:#375E83;
  --success-bg:#E6EEE7; --error-bg:#F8E4DF; --warn-bg:#F8EACD; --info-bg:#E4EDF4;
  --hover:#E7DED1; --glass:rgba(247,244,237,.94); --glass-edge:#DDD5C8;
  --glass-shadow:0 5px 22px rgba(53,38,22,.04);
  --glass-shadow-raised:0 18px 56px rgba(53,38,22,.14);
}
:root[data-theme=dark] {
  color-scheme:dark;
  --canvas:#1D1B18; --surface:#27231F; --soft:#221F1B; --subtle:#221F1B;
  --ink:#F5EEE4; --body:#C8BBAC; --muted:#B2A391;
  --hair:#494035; --line:#8E7D6A;
  --accent:#E8915B; --accent-hover:#F0A36F; --accent-pressed:#DC8149; --on-accent:#24180F;
  --brand:#E88B55; --focus:#F2A56F; --selected:#483024; --selected-text:#FFD5B5;
  --success:#A0CFB0; --error:#F0A29C; --warn:#F2C17C; --info:#A4C5E2;
  --success-bg:#223B2D; --error-bg:#482925; --warn-bg:#45341D; --info-bg:#273847;
  --hover:#342D26; --glass:rgba(34,31,27,.96); --glass-edge:#494035;
  --glass-shadow:0 5px 22px rgba(0,0,0,.13);
  --glass-shadow-raised:0 18px 56px rgba(0,0,0,.35);
}
html, body { background:var(--canvas); color:var(--ink); }
body { background-image:none; }
h1,h2,h3,h4,strong,.page-title,.sectionbar h2 { color:var(--ink); }
.muted,.eyebrow,.hint,.page-foot { color:var(--muted); }
.navigation-rail,[data-theme=dark] .navigation-rail,
.studio-shell .chat-history,[data-theme=dark] .studio-shell .chat-history,
.mobile-nav,[data-theme=dark] .mobile-nav { background:var(--glass); border-color:var(--hair); }
.studio-shell .chat-history>.btn,[data-theme=dark] .studio-shell .chat-history>.btn { background:var(--surface); }
.panel,.card,.modal,.chat-composer,.preview-panel,.wm-manager,.cv-inspector { border-color:var(--hair); }
.modal,.cv-inspector,.wm-manager { background:var(--surface); }
.rail-action:hover,[data-theme=dark] .rail-action:hover,
.edge-buttons .icon-btn:hover,.icon-btn:hover,.btn:not(.primary):hover { background:var(--hover); color:var(--ink); }
.rail-action.active,[data-theme=dark] .rail-action.active,
.mobile-nav button.active,.nav-item.active,.settings-nav button.active,
.creation-view-toggle button.active,.segmented button.active,.theme-card.active { background:var(--selected); color:var(--selected-text); border-color:var(--hair); box-shadow:none; }
.rail-action.active:after { background:var(--accent); height:16px; top:13px; }
.btn.primary,[data-theme=dark] .btn.primary { background:var(--accent); border-color:var(--accent); color:var(--on-accent); box-shadow:none; }
.btn.primary:hover,[data-theme=dark] .btn.primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); color:var(--on-accent); box-shadow:none; }
.btn.primary:active,[data-theme=dark] .btn.primary:active { background:var(--accent-pressed); border-color:var(--accent-pressed); }
.btn.primary .icon { color:inherit; }
.toggle.on,[data-theme=dark] .toggle.on { background:var(--accent); }
.toggle.on:before { background:var(--on-accent); }
.btn,.select,input,textarea,select { color:var(--ink); }
input,textarea,select,.select { background:var(--surface); border-color:var(--line); }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,
.rail-action:focus-visible,.rail-brand:focus-visible,.rail-project:focus-visible,.panel-resize-handle:focus-visible {
  outline:2px solid var(--focus); outline-offset:3px;
}
.interaction-spec-link:hover,.text-link { color:var(--focus); }
.rail-tooltip,.edge-buttons .icon-btn:after { background:var(--surface); color:var(--ink); border-color:var(--line); }
.info-box { background:var(--subtle); border-color:var(--hair); color:var(--body); }
.dot { background:var(--success); }
.dot.offline { background:var(--error); }
.theme-mini { background:#F7F4ED; border-color:#DDD5C8; }
.theme-mini:after { background:#FFFCF6; border-color:#DDD5C8; }
.theme-mini.dark { background:#1D1B18; border-color:#494035; }
.theme-mini.dark:after { background:#27231F; border-color:#494035; }
.theme-mini.system { background:linear-gradient(90deg,#F7F4ED 50%,#1D1B18 50%); }
.theme-mini.system:after { background:linear-gradient(90deg,#FFFCF6 43%,#27231F 43%); }
/* The supplied montage is retained byte-for-byte. SVG viewports display its exact
   existing variants. Dark-theme SVG masks remove the image backdrop and recolor only the original wordmark to white. */
.rail-brand,[data-theme=dark] .rail-brand { padding:2px; gap:0; justify-content:center; background:transparent; }
.rail-brand .brand-lockup { display:none; width:100%; height:38px; max-width:190px; background:#F7F4ED; border-radius:6px; }
.rail-brand .rail-mark { width:36px; height:36px; flex:none; border-radius:9px; }
.rail-brand .mark-dark { display:none; }
[data-theme=dark] .rail-brand .mark-light { display:none; }
[data-theme=dark] .rail-brand .mark-dark { display:block; }
.nav-expanded .rail-brand .rail-mark { display:none; }
.nav-expanded .rail-brand .brand-lockup { display:block; }
.rail-brand svg image { image-rendering:auto; }
.rail-brand .brand-fallback { display:none; font-weight:600; letter-spacing:.08em; font-size:calc(14px + var(--ui-font-offset, 0px)); color:var(--ink); }
.rail-brand.brand-image-failed svg { display:none!important; }
.rail-brand.brand-image-failed .brand-fallback { display:block; font-size:calc(14px + var(--ui-font-offset, 0px)); letter-spacing:0; }
.nav-expanded .rail-brand.brand-image-failed .brand-fallback { font-size:calc(14px + var(--ui-font-offset, 0px)); letter-spacing:.08em; }
@media(max-width:740px) {
  .rail-brand .rail-mark { display:none!important; }
  .rail-brand .brand-lockup { display:block; max-width:195px; height:42px; }
  .navigation-rail,[data-theme=dark] .navigation-rail,
  .studio-shell .chat-history,[data-theme=dark] .studio-shell .chat-history { background:var(--surface); }
  .studio-shell .page-actions .btn { min-height:40px; }
}
@media(pointer:coarse) {
  .edge-buttons .icon-btn,.history-panel-heading .icon-btn,.studio-shell .chat-mobile-tools .icon-btn,
  .studio-shell .chat-top>.history-toggle,.icon-btn,.btn { min-height:44px; min-width:44px; }
}
@supports not (backdrop-filter:blur(1px)) {
  .navigation-rail,[data-theme=dark] .navigation-rail,.studio-shell .chat-history,
  [data-theme=dark] .studio-shell .chat-history,.mobile-nav { background:var(--surface); }
}
@media(prefers-reduced-transparency:reduce) {
  .navigation-rail,.studio-shell .chat-history,.mobile-nav { background:var(--surface)!important; backdrop-filter:none!important; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
@media(forced-colors:active) {
  .rail-action.active { outline:2px solid Highlight; }
  .rail-brand .brand-lockup { forced-color-adjust:none; background:#F7F4ED; }
}

/* Conversation empty state and About use the same current brand variants. */
.brand-inline { display:inline-block; vertical-align:middle; background:transparent!important; border:0!important; padding:0!important; border-radius:10px; overflow:hidden; }
.brand-inline svg { width:100%; height:100%; display:block; }
.brand-inline .brand-dark { display:none; }
[data-theme=dark] .brand-inline .brand-light { display:none; }
[data-theme=dark] .brand-inline .brand-dark { display:block; }
.brand-wordmark { width:135px; height:28px; background:#F7F4ED; border-radius:3px; }
/* Remove residual neutral-green/white glass colors from all four page surfaces. */
:root :is(.chat-composer,.starter-card,.panel,.setting-block,.route-card,.device-card,.collection-card,.theme-card,.search-box) {
  background:var(--surface); border-color:var(--hair); box-shadow:var(--glass-shadow);
}
:root :is(.starter-card,.collection-card):hover { background:var(--hover); border-color:var(--line); }
:root .chat-composer { border-color:var(--line); }
:root .chat-composer:focus-within { border-color:var(--focus); }
:root :is(.message.user,.agent-plan,.workflow-node,.avatar) { background:var(--subtle); border-color:var(--hair); }
:root .btn[data-action=send-chat] { color:var(--on-accent); background:var(--accent); border-color:var(--accent); }
:root .btn[data-action=send-chat]:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
:root .btn[data-action=send-chat]:active { background:var(--accent-pressed); }

/* Latest owner clarification: dark brand must be transparent, with WHITE VEMIQO.
   SVG color/alpha masks use original pixel contours; no redrawn logo or typeface. */
.rail-brand .brand-dark-lockup,.brand-dark-type { display:none!important; }
[data-theme=dark] .rail-brand .brand-light-lockup,[data-theme=dark] .brand-light-type { display:none!important; }
[data-theme=dark] .nav-expanded .rail-brand .brand-dark-lockup { display:block!important; }
[data-theme=dark] .rail-brand .brand-lockup,[data-theme=dark] .brand-wordmark { background:transparent!important; border:0; border-radius:0; }
[data-theme=dark] .brand-dark-type { display:inline-block!important; }
@media(max-width:740px) { [data-theme=dark] .rail-brand .brand-dark-lockup { display:block!important; } }
@media(forced-colors:active) { [data-theme=dark] .rail-brand .brand-dark-lockup { background:transparent!important; forced-color-adjust:none; } }

/* Approved final brand rule: transparent in both themes and every app location. */
.rail-brand .brand-lockup,.brand-wordmark,.brand-inline { background:transparent!important; border:0!important; border-radius:0; box-shadow:none!important; }
@media(forced-colors:active) { .rail-brand .brand-lockup { background:transparent!important; } }

/* v8: content stays solid; browser-native backdrop filtering belongs to chrome.
   This web fallback is not Apple's native Liquid Glass. No refraction shaders,
   animated gradients, duplicated glass layers or raster glass textures. */
:root {
  --chrome-tint:rgba(255,252,246,.80);
  --chrome-edge:rgba(120,96,71,.16);
  --chrome-highlight:rgba(255,255,255,.7);
  --elevation:0 8px 28px rgba(70,45,25,.06);
  --elevation-floating:0 16px 48px rgba(70,45,25,.12);
  --separator:rgba(120,96,71,.14);
  --motion-fast:140ms;
  --motion-standard:200ms;
  --ease-settle:cubic-bezier(.2,.75,.25,1);
}
:root[data-theme=dark] {
  --chrome-tint:rgba(39,35,31,.82);
  --chrome-edge:rgba(255,238,213,.12);
  --chrome-highlight:rgba(255,247,231,.07);
  --elevation:0 8px 28px rgba(0,0,0,.14);
  --elevation-floating:0 16px 48px rgba(0,0,0,.28);
  --separator:rgba(255,238,213,.10);
}
body { font-size:calc(16px + var(--ui-font-offset, 0px)); font-weight:500; line-height:1.65; }
button,input,select,textarea { font-family:inherit; }
button { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.icon { width:20px; height:20px; stroke-width:1.7; flex-shrink:0; }
.icon.sm { width:18px; height:18px; }
.rail-action>.icon { width:21px; height:21px; }
.studio-shell>.main { padding:20px 32px 28px; }
.navigation-rail,[data-theme=dark] .navigation-rail {
  background:var(--surface); border-right:1px solid var(--chrome-edge);
  box-shadow:inset -1px 0 0 var(--chrome-highlight); padding-top:20px;
}
.workspace-edge {
  position:sticky; top:12px; z-index:35; min-height:48px; margin:0 0 24px;
  padding:6px 12px; border:1px solid var(--chrome-edge); border-radius:18px;
  background:var(--surface); box-shadow:0 1px 0 var(--chrome-highlight) inset,var(--elevation);
}
.edge-buttons { gap:6px; }
.edge-buttons .icon-btn { width:36px; height:36px; border-radius:50%; }
.interaction-spec-link { font-size:calc(14px + var(--ui-font-offset, 0px)); padding:7px 8px; }
.rail-label,.rail-project,.history-item,.settings-nav button { font-size:calc(15px + var(--ui-font-offset, 0px)); }
.rail-label,.rail-action.active { font-weight:600; }
.rail-project { padding:11px 9px; line-height:1.4; }
.rail-projects>.eyebrow,.rail-demo { font-size:calc(14px + var(--ui-font-offset, 0px)); letter-spacing:.02em; }
.rail-pages { gap:8px; }
.rail-action { min-height:46px; border-radius:14px; }
.rail-action.active:after { top:14px; height:18px; width:3px; }
.rail-divider { background:var(--separator); margin:16px 8px; }
.studio-shell .chat-history,[data-theme=dark] .studio-shell .chat-history {
  background:var(--surface); border-color:var(--chrome-edge); border-radius:22px;
  box-shadow:0 1px 0 var(--chrome-highlight) inset,var(--elevation); padding:20px 16px;
}
.history-panel-heading { font-size:calc(16px + var(--ui-font-offset, 0px)); margin-bottom:20px; }
.history-panel-heading strong { font-weight:600; }
.history-label { margin-top:22px; margin-bottom:10px; }
.chat-history .history-item { padding:12px 10px; border-radius:12px; }
.studio-shell .chat-center { max-width:1120px; margin:0 auto; }
.studio-shell .chat-top { min-height:44px; gap:10px; margin-bottom:28px; }
.studio-shell .chat-top>.select { width:210px; font-size:calc(15px + var(--ui-font-offset, 0px)); }
.studio-shell .chat-mobile-tools .select { font-size:calc(14px + var(--ui-font-offset, 0px)); max-width:104px; }
.studio-shell .chat-empty { max-width:880px; padding:20px 0 36px; }
.studio-shell .chat-empty h1 { font-size:calc(34px + var(--ui-font-offset, 0px)); line-height:1.35; font-weight:700; letter-spacing:-.025em; margin:22px 0 16px; }
.studio-shell .chat-empty>p { font-size:calc(16px + var(--ui-font-offset, 0px)); line-height:1.75; max-width:640px; margin:0 auto; color:var(--body); }
.studio-shell .chat-empty .brand-inline { width:56px!important; height:56px!important; }
.starter-grid { gap:14px; margin-top:32px; }
:root .starter-card { border:1px solid var(--separator); border-radius:20px; padding:22px; min-height:158px; box-shadow:none; text-align:left; }
.starter-card>.icon { color:var(--brand); width:24px; height:24px; margin-bottom:18px; }
.starter-card strong { display:block; font-size:calc(16px + var(--ui-font-offset, 0px)); font-weight:600; margin-bottom:8px; }
.starter-card p { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.7; color:var(--body); }
.studio-shell .chat-composer { position:relative; bottom:auto; width:min(100%,900px); border-radius:24px; padding:20px 22px 16px; box-shadow:var(--elevation); backdrop-filter:none; -webkit-backdrop-filter:none; }
.chat-composer textarea { font-size:calc(16px + var(--ui-font-offset, 0px)); line-height:1.7; min-height:84px; }
.composer-bottom { gap:12px; padding-top:12px; flex-wrap:wrap; }
.composer-bottom .segmented button { font-size:calc(15px + var(--ui-font-offset, 0px))!important; }
.chat-disclaimer { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.65; max-width:900px; padding:0 12px; margin:12px auto 0; }
.chat-extra-tools { gap:8px; margin-top:14px; }
.chat-extra-tools .btn { font-size:calc(14px + var(--ui-font-offset, 0px)); }
.message { font-size:calc(16px + var(--ui-font-offset, 0px)); line-height:1.8; }
.message-head { font-size:calc(14px + var(--ui-font-offset, 0px)); }
.message.user { border-radius:22px 22px 6px 22px; }
.btn { min-height:42px; border-radius:12px; font-size:calc(15px + var(--ui-font-offset, 0px)); padding:9px 15px; font-weight:600; line-height:1.4; }
.btn.small { font-size:calc(14px + var(--ui-font-offset, 0px)); min-height:36px; }
.icon-btn { width:40px; height:40px; min-width:40px; border-radius:12px; }
.btn.primary { border-radius:14px; }
.segmented,.creation-view-toggle { border-radius:14px; padding:4px; background:var(--subtle); border:1px solid var(--separator); gap:3px; }
.segmented button,.creation-view-toggle button { border-radius:10px; min-height:38px; font-size:calc(15px + var(--ui-font-offset, 0px)); padding:8px 14px; font-weight:600; }
.segmented button.active,.creation-view-toggle button.active { box-shadow:0 1px 4px rgba(53,38,22,.07); }
.panel,.setting-block,.route-card,.device-card,.collection-card,.preview-panel { border-radius:22px; }
:root .panel,:root .setting-block,:root .route-card { box-shadow:none; border-color:var(--separator); }
:root :is(.panel,.setting-block,.route-card,.device-card,.collection-card,.starter-card,.theme-card,.search-box,.modal) { backdrop-filter:none; -webkit-backdrop-filter:none; }
.panel-head { font-size:calc(16px + var(--ui-font-offset, 0px)); padding:20px 24px; font-weight:600; border-color:var(--separator); }
.panel-body { padding:24px; }
.field { margin-bottom:22px; }
.field>label,.field-label,.cv-field>label { font-size:calc(14px + var(--ui-font-offset, 0px)); font-weight:600; margin-bottom:9px; }
.field input,.field select,.field textarea,.select,.input,.prompt-wrap textarea,.cv-field textarea,.cv-field select {
  font-size:calc(15px + var(--ui-font-offset, 0px)); border-radius:12px; min-height:44px; padding:11px 13px; line-height:1.6;
}
.prompt-wrap textarea { font-size:calc(16px + var(--ui-font-offset, 0px)); min-height:168px; }
.prompt-foot { padding-top:12px; }
.page-head h1,.canvas-page-head h1 { font-size:calc(28px + var(--ui-font-offset, 0px)); font-weight:700; letter-spacing:-.02em; }
.settings-content h2,.wm-intro h2,.wm-step-title h2,.wm-settings-intro h2 { font-size:calc(24px + var(--ui-font-offset, 0px)); line-height:1.4; font-weight:700; }
.settings-content>.muted { font-size:calc(15px + var(--ui-font-offset, 0px)); max-width:640px; margin:12px 0 26px; }
.setting-row { padding:22px 0; border-color:var(--separator); gap:24px; }
.setting-row h3 { font-size:calc(16px + var(--ui-font-offset, 0px)); font-weight:600; margin-bottom:5px; }
.setting-row p { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.7; }
.settings-nav { padding:8px; background:var(--subtle); border-radius:18px; align-self:start; }
.settings-nav button { min-height:44px; padding:10px 14px; border-radius:11px; }
.theme-card { border-radius:18px; padding:14px; transition:border-color var(--motion-fast),background-color var(--motion-fast); }
.theme-card.active { outline:2px solid var(--accent); outline-offset:2px; }
.theme-card span { font-size:calc(15px + var(--ui-font-offset, 0px)); font-weight:600; }
.theme-mini { border-radius:12px; }
.asset-card { border-radius:20px; overflow:hidden; border-color:var(--separator); }
.asset-meta { padding:18px; }
.asset-meta h3 { font-size:calc(16px + var(--ui-font-offset, 0px)); font-weight:600; line-height:1.5; }
.asset-meta p { font-size:calc(14px + var(--ui-font-offset, 0px)); margin-top:6px; }
.asset-media { overflow:hidden; }
.search-box { border-radius:14px; min-height:44px; }
.search-box input { font-size:calc(15px + var(--ui-font-offset, 0px)); }
.filter-pills button,.folder-chip { min-height:40px; border-radius:12px; font-size:calc(14px + var(--ui-font-offset, 0px)); }
.page-foot { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.65; gap:14px; flex-wrap:wrap; }
.modal { border-radius:26px; box-shadow:var(--elevation-floating); }
.modal-head { padding:22px 26px; border-color:var(--separator); }
.modal-head h2 { font-size:calc(20px + var(--ui-font-offset, 0px)); font-weight:700; }
.modal-body { padding:26px; }
#toast { font-size:calc(15px + var(--ui-font-offset, 0px)); border-radius:16px; padding:13px 20px; background:var(--surface); color:var(--ink); border:1px solid var(--chrome-edge); box-shadow:var(--elevation-floating); }
.cv-shell { border-radius:24px; border-color:var(--separator); }
.cv-inspector { border-left-color:var(--separator); }
.cv-board-title strong,.cv-field textarea,.cv-field select,.cv-generate,.cv-prompt-go { font-size:calc(15px + var(--ui-font-offset, 0px)); }
.cv-inspector-top h3 { font-size:calc(18px + var(--ui-font-offset, 0px)); font-weight:600; }
.cv-field { margin-bottom:22px; }
.cv-board-prompt { font-size:calc(15px + var(--ui-font-offset, 0px)); }
.cv-zoom-control,.cv-toolbar,.mobile-nav { background:var(--surface); border:1px solid var(--chrome-edge); }
.mobile-nav { border-radius:24px; box-shadow:var(--elevation-floating); }
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .navigation-rail,[data-theme=dark] .navigation-rail,.workspace-edge,
  .studio-shell .chat-history,[data-theme=dark] .studio-shell .chat-history,
  .studio-shell .mobile-nav,.cv-toolbar,.cv-zoom-control {
    background:var(--chrome-tint);
    backdrop-filter:blur(20px) saturate(115%);
    -webkit-backdrop-filter:blur(20px) saturate(115%);
  }
}
:is(.btn,.icon-btn,.rail-action,.starter-card,.filter-pills button,.settings-nav button,.segmented button,.creation-view-toggle button,.rail-project,.asset-card) {
  transition:background-color var(--motion-fast) ease,border-color var(--motion-fast) ease,color var(--motion-fast) ease,box-shadow var(--motion-standard) ease,transform var(--motion-standard) var(--ease-settle);
}
@media(hover:hover) and (pointer:fine) {
  :is(.btn,.icon-btn):hover:not(:disabled) { transform:translateY(-1px); }
  :root .starter-card:hover { background:var(--surface); border-color:var(--line); box-shadow:var(--elevation); transform:translateY(-3px); }
  .asset-card:hover { box-shadow:var(--elevation); transform:translateY(-2px); }
  .rail-action:hover:not(.active) { background:var(--hover); }
}
:is(.btn,.icon-btn,.rail-action,.starter-card,.filter-pills button,.settings-nav button,.segmented button,.creation-view-toggle button):active:not(:disabled) { transform:scale(.98); transition-duration:80ms; }
button:disabled,[aria-disabled=true] { transform:none!important; box-shadow:none!important; cursor:not-allowed; }
:is(input,textarea,select):focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.chat-composer:focus-within { box-shadow:0 0 0 3px var(--selected),var(--elevation); }
.setting-row:last-child { border-bottom:0; }
.toggle { width:51px; height:31px; padding:3px; background:var(--line); }
.toggle:before { width:25px; height:25px; }
.toggle.on:before { transform:translateX(20px); }
* { scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.rail-projects { padding-top:14px; }
.rail-bottom { padding-top:14px; }
.chat-empty { flex-shrink:0; }
.studio-shell .chat-empty h1 { font-weight:600; }
@media(max-width:1100px) {
  .studio-shell>.main { padding:18px 22px 28px; }
  .studio-shell .chat-empty h1 { font-size:calc(30px + var(--ui-font-offset, 0px)); }
  .starter-grid { gap:10px; }
  :root .starter-card { padding:18px; }
  .studio-shell.chat-panel-open .starter-grid { grid-template-columns:1fr; }
  .studio-shell .chat-top>.select { width:180px; }
}
@media(max-width:740px) {
  .studio-shell>.main { padding:12px 16px 116px; }
  .workspace-edge { min-height:48px; margin:0 0 20px; padding:5px 8px; border-radius:16px; }
  .studio-shell .chat-empty { padding-top:16px; padding-bottom:26px; }
  .studio-shell .chat-empty h1 { font-size:calc(28px + var(--ui-font-offset, 0px)); line-height:1.4; margin:18px 0 12px; }
  .studio-shell .chat-empty>p { font-size:calc(16px + var(--ui-font-offset, 0px)); }
  .studio-shell .chat-top { gap:8px; margin-bottom:16px; }
  .studio-shell .chat-top>.select { width:100%; margin-top:6px; font-size:calc(15px + var(--ui-font-offset, 0px)); order:2; }
  .studio-shell .chat-mobile-tools .select { font-size:calc(14px + var(--ui-font-offset, 0px)); width:90px; }
  .starter-grid { grid-template-columns:1fr; margin-top:24px; gap:12px; }
  :root .starter-card { min-height:0; padding:18px; }
  .starter-card>.icon { margin-bottom:12px; }
  .studio-shell .chat-composer { position:relative; bottom:auto; padding:18px; border-radius:22px; }
  .chat-composer textarea { font-size:calc(16px + var(--ui-font-offset, 0px)); }
  .studio-shell .mobile-nav { height:76px; left:12px; right:12px; gap:2px; padding:5px; }
  .studio-shell .mobile-nav button { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.35; border-radius:18px; padding:8px 2px; min-height:56px; }
  .studio-shell .mobile-nav .icon { width:22px; height:22px; }
  .navigation-rail .rail-label { font-size:calc(15px + var(--ui-font-offset, 0px)); }
  .studio-shell .page-actions .btn { font-size:calc(14px + var(--ui-font-offset, 0px)); min-height:44px; }
  .sectionbar { flex-wrap:wrap; gap:14px; }
  .sectionbar .segmented { flex-wrap:wrap; }
  .sectionbar .segmented button,.canvas-modebar .segmented button { font-size:calc(14px + var(--ui-font-offset, 0px)); }
  .canvas-modebar .select { font-size:calc(14px + var(--ui-font-offset, 0px))!important; }
  .panel-head,.panel-body { padding:18px; }
  .setting-row { flex-wrap:wrap; gap:14px; }
  .setting-row>.select { max-width:100%; }
  .theme-grid { gap:10px; }
  .theme-card { padding:10px; }
  .settings-content h2 { font-size:calc(24px + var(--ui-font-offset, 0px)); }
  .modal { width:calc(100% - 24px); border-radius:22px; }
  .modal-head,.modal-body { padding:20px; }
}
@media(prefers-reduced-transparency:reduce) {
  .navigation-rail,.workspace-edge,.studio-shell .chat-history,.studio-shell .mobile-nav,.cv-toolbar,.cv-zoom-control { background:var(--surface)!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; }
  :is(.btn,.icon-btn,.rail-action,.starter-card,.asset-card):hover,:is(.btn,.icon-btn,.rail-action,.starter-card):active { transform:none!important; }
}
html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; }
html[data-motion=off] :is(.btn,.icon-btn,.rail-action,.starter-card,.asset-card) { transform:none!important; }
@media(forced-colors:active) {
  .navigation-rail,.workspace-edge,.studio-shell .chat-history,.studio-shell .mobile-nav,.cv-toolbar,.cv-zoom-control { background:Canvas!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; box-shadow:none; border-color:CanvasText; }
  .btn.primary,.rail-action.active,.segmented button.active { outline:1px solid Highlight; }
}

/* Dark interaction audit: legacy white hover/focus rules must never leak through.
   Background and foreground always move together; selection is a muted tint. */
::selection { background:var(--selected); color:var(--ink); }
:root .settings-nav button { background:transparent; color:var(--body); border-color:transparent; }
:root .settings-nav button:hover:not(.active),
:root .settings-detail summary:hover,
:root .command-item:hover,:root .workflow-node:hover {
  background:var(--hover); color:var(--ink); border-color:var(--separator);
}
:root .settings-nav button.active,:root .settings-nav button.active:hover,
:root .filter-pills button.active,:root .folder-chip.active,
:root .history-item.active,:root .channel-select button.active {
  background:var(--selected); color:var(--selected-text); border-color:var(--separator);
}
:root .settings-detail summary { color:var(--ink); border-radius:12px; padding:16px 10px; }
:root .settings-detail { border-color:var(--separator); }
:root .settings-detail summary .mono { color:var(--muted); }
:root .settings-detail summary:hover .mono { color:var(--body); }
:root[data-theme] :is(.field input,.field select,.field textarea,select,.select,.input,.cv-field textarea,.cv-field select) {
  background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:14px;
}
:root[data-theme] :is(.field input,.field select,.field textarea,select,.select,.input,.cv-field textarea,.cv-field select):focus {
  background:var(--surface); color:var(--ink); border-color:var(--focus); box-shadow:0 0 0 3px var(--selected);
}
:root[data-theme] :is(select,.select):hover:not(:disabled) { background:var(--hover); color:var(--ink); border-color:var(--line); }
:root[data-theme] :is(select,.select):focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
:root[data-theme] :is(input,select,textarea):disabled { background:var(--subtle); color:var(--muted); opacity:1; border-color:var(--hair); }
:root[data-theme] :is(input,textarea)[readonly] { background:var(--subtle); color:var(--body); }
:root[data-theme] .prompt-wrap,:root[data-theme] .prompt-wrap:focus-within { background:var(--surface); border-color:var(--line); }
:root[data-theme] select option,:root[data-theme] select optgroup { background:var(--surface); color:var(--ink); }
:root[data-theme] select option:checked { background:var(--selected); color:var(--selected-text); }
/* Use the browser's real select picker, preserving native values, keyboard and
   accessibility. Unsupported browsers and coarse pointers keep the OS picker. */
@supports (appearance:base-select) {
  @media(hover:hover) and (pointer:fine) {
    select,select::picker(select) { appearance:base-select; }
    select { align-items:center; gap:12px; cursor:pointer; }
    select::picker-icon { color:var(--body); margin-inline-start:auto; }
    select::picker(select) {
      background:var(--surface); color:var(--ink); border:1px solid var(--line);
      border-radius:16px; padding:6px; box-shadow:var(--elevation-floating);
      margin-block:6px; max-height:min(360px,65dvh); overflow:auto;
      font-family:inherit; font-size:calc(15px + var(--ui-font-offset, 0px));
    }
    select option { border-radius:10px; padding:11px 12px; min-height:44px; gap:12px; }
    :root[data-theme] select option:hover,:root[data-theme] select option:focus { background:var(--hover); color:var(--ink); outline:none; }
    :root[data-theme] select option:checked,:root[data-theme] select option:checked:hover { background:var(--selected); color:var(--selected-text); }
    select option::checkmark { color:var(--accent); }
  }
}
@media(forced-colors:active) {
  :root[data-theme] :is(input,select,textarea),:root[data-theme] select::picker(select),:root[data-theme] select option { background:Canvas; color:CanvasText; border-color:CanvasText; box-shadow:none; }
  :root[data-theme] select option:checked { background:Highlight; color:HighlightText; }
  ::selection { background:Highlight; color:HighlightText; }
}

/* v9: slightly denser typography; keep readable 14px captions and touch targets. */
:root { --type-body:16px; --type-control:15px; --type-caption:14px; }
@media(max-width:740px), (pointer:coarse) {
  :root .studio-shell :is(input,textarea,select),
  :root .studio-shell .chat-top>.select,
  :root .studio-shell .chat-mobile-tools .select,
  :root .studio-shell .canvas-modebar .select { font-size:calc(16px + var(--ui-font-offset, 0px))!important; }
}

/* Device-local typography preference; adjust text without zooming images, icons or targets. */
:root { --ui-font-offset:0px; }
.font-size-setting { margin:28px 0; padding:24px; border:1px solid var(--hair); border-radius:20px; background:var(--surface); min-width:0; }
.font-size-heading { display:flex; align-items:start; justify-content:space-between; gap:16px; }
.font-size-heading h3 { font-size:calc(16px + var(--ui-font-offset, 0px)); font-weight:600; }
.font-size-heading p,.font-size-meta,.font-size-slider { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.65; color:var(--muted); }
.font-size-heading p { margin:7px 0 0; max-width:480px; }
#ui-font-step-output { font-size:calc(15px + var(--ui-font-offset, 0px)); font-weight:600; color:var(--ink); background:var(--subtle); border-radius:10px; padding:5px 10px; font-variant-numeric:tabular-nums; }
.font-size-slider { display:flex; align-items:center; gap:16px; margin:16px 0 8px; }
.font-size-slider input { width:100%; min-width:60px; min-height:44px; margin:0; accent-color:var(--accent); cursor:pointer; }
.font-size-slider span { flex-shrink:0; }
.font-size-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; }
.font-size-meta strong { color:var(--ink); font-weight:500; font-variant-numeric:tabular-nums; }
.font-size-preview { margin-top:18px; padding:20px; border-radius:14px; background:var(--subtle); border:1px solid var(--hair); overflow-wrap:anywhere; }
.font-preview-body { font-size:calc(16px + var(--ui-font-offset, 0px)); font-weight:500; line-height:1.75; margin:0 0 12px; color:var(--ink); }
.font-preview-control { font-size:calc(15px + var(--ui-font-offset, 0px)); font-weight:600; color:var(--ink); }
.font-preview-help { font-size:calc(14px + var(--ui-font-offset, 0px)); line-height:1.7; margin:10px 0 0; color:var(--muted); }
@media(max-width:600px) { .font-size-setting { padding:18px; } .font-size-preview { padding:16px; } }

.font-size-save-status { font-size:calc(14px + var(--ui-font-offset,0px)); line-height:1.65; margin:10px 0 0; color:var(--muted); }
.font-size-save-status[data-state=failed] { color:var(--error); }

/* V13 default type scale: body 14px, controls 13px, supporting copy 12px. */
body{font-size:calc(16px + var(--ui-font-offset,0px))}
.studio-shell button,.studio-shell input,.studio-shell select,.studio-shell textarea{font-size:calc(15px + var(--ui-font-offset,0px))!important}
.studio-shell p.small,.studio-shell span.small,.studio-shell small,.studio-shell .muted:not(button):not(.btn),.studio-shell .eyebrow,.studio-shell .tag,.studio-shell .mono,.studio-shell .rail-demo,.studio-shell .rail-projects>.eyebrow{font-size:calc(14px + var(--ui-font-offset,0px))!important}

.studio-shell .official-preview-bar{font-size:calc(14px + var(--ui-font-offset,0px))!important}
.studio-shell .official-demo-label,.studio-shell .official-preview-hint,.studio-shell .official-feature span,.studio-shell .official-guide-intro,.studio-shell .official-demo-boundary{font-size:calc(14px + var(--ui-font-offset,0px))!important}

/* Prevent mobile browser zoom on text entry; compact navigation controls stay 13px. */
@media(max-width:740px){.studio-shell input:not([type=range]):not([type=checkbox]):not([type=radio]),.studio-shell textarea,.studio-shell select{font-size:max(16px,calc(13px + var(--ui-font-step,0px)))!important}}

@media(max-width:740px){:root .studio-shell #main input:not([type=range]):not([type=checkbox]):not([type=radio]),:root .studio-shell #main textarea,:root .studio-shell #main select,:root .studio-shell #main .canvas-modebar .select{font-size:max(16px,calc(13px + var(--ui-font-step,0px)))!important}}
