/* Shared enterprise shell. Author documents and published artifacts keep their own styles. */
@font-face {
  font-family: "Aira Inter";
  src: url("./assets/fonts/inter/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aira Inter";
  src: url("./assets/fonts/inter/InterVariable-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
:root {
  --font-ui: "Aira Inter", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --appearance-scheme: dark;
  --workspace-color-scheme: dark;
  --surface-rgb: 24 24 24;
  --text-rgb: 236 236 236;
  --shadow-rgb: 0 0 0;
  --surface-floating: var(--bg-dropdown);
  --surface-elevated: var(--bg-code);
  --surface-hover: var(--btn-secondary-hover);
  --surface-selected: var(--bg-active);
  --focus-ring: var(--text-primary);
  --control-border: var(--text-muted);
  --overlay-bg: rgb(var(--shadow-rgb) / 55%);
  --popover-shadow: 0 12px 36px rgb(var(--shadow-rgb) / 24%);
  --composer-shadow: 0 0 0 1px var(--border-subtle);
  --rail-bg: #101010;
  --rail-text: #ededed;
  --rail-muted: #bcbcbc;
  --rail-hover: #292929;
  --rail-avatar-bg: #415a62;
}
:root[data-theme="light"] {
  --appearance-scheme: light;
  --workspace-color-scheme: light;
  --bg-primary: #fcfcfc;
  --bg-chat: #fcfcfc;
  --bg-workspace: #fcfcfc;
  --bg-workspace-sidebar: #fcfcfc;
  --bg-workspace-input: #ffffff;
  --bg-sidebar: #fcfcfc;
  --bg-sidebar-btn: #fcfcfc;
  --bg-header: #fcfcfc;
  --bg-input-bar: #fcfcfc;
  --bg-login: #fcfcfc;
  --bg-bubble-user: #f1f1f1;
  --bg-bubble-ai: #fcfcfc;
  --bg-dropdown: #ffffff;
  --bg-code: #f7f7f8;
  --bg-code-inline: #f0f0f0;
  --bg-code-header: #ececec;
  --bg-input-login: #ffffff;
  --input-bg: #ffffff;
  --input-border: #dedede;
  --input-border-focus: #707070;
  --text-primary: #0d0d0d;
  --text-heading: #0d0d0d;
  --text-muted: #707070;
  --text-link: #195bbd;
  --text-code: #a11d45;
  --text-primary-btn: #ffffff;
  --action-primary: #0d0d0d;
  --action-primary-hover: #2b2b2b;
  --action-primary-text: #ffffff;
  --btn-primary-bg: #0d0d0d;
  --btn-primary-hover: #2b2b2b;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: transparent;
  --btn-secondary-hover: #f1f1f1;
  --btn-disabled-bg: #ededed;
  --btn-danger-text: #b42318;
  --border-subtle: #dedede;
  --border-sidebar: #e4e4e4;
  --border-header: #e4e4e4;
  --border-table: #dedede;
  --border-input-login: #dedede;
  --accent: #0d0d0d;
  --bg-active: #ebebeb;
  --color-success: #146c43;
  --bg-success: #eaf6ee;
  --color-error: #b42318;
  --bg-error: #fef0ee;
  --bg-warning: #fff7e6;
  --bg-info: #edf4ff;
  --status-warning: #8a5d00;
  --status-danger: #b42318;
  --status-unread: #195bbd;
  --tool-web-search-accent: #196c78;
  --project-neutral: #555555;
  --project-red: #b42318;
  --project-orange: #a44808;
  --project-yellow: #7c6500;
  --project-green: #146c43;
  --project-blue: #195bbd;
  --project-purple: #7542a8;
  --project-pink: #a22f73;
  --surface-rgb: 252 252 252;
  --text-rgb: 13 13 13;
  --surface-floating: #ffffff;
  --surface-hover: #f1f1f1;
  --surface-selected: #ebebeb;
  --surface: var(--surface-floating);
  --surface-color: var(--bg-primary);
  --card-bg: var(--bg-code);
  --hover-bg: var(--surface-hover);
  --border-color: var(--border-subtle);
  --danger-text: var(--status-danger);
  --focus-ring: #0d0d0d;
  --control-border: #707070;
  --overlay-bg: rgb(var(--shadow-rgb) / 35%);
  --popover-shadow: 0 8px 28px rgb(var(--shadow-rgb) / 12%);
  --composer-shadow: 0 0 0 1px rgb(var(--shadow-rgb) / 4%), 0 2px 8px rgb(var(--shadow-rgb) / 4%), 0 4px 80px 8px rgb(var(--shadow-rgb) / 2.4%);
}
html[data-theme] { background: var(--bg-primary); color-scheme: var(--appearance-scheme); }
html.appearance-changing *, html.appearance-changing *::before, html.appearance-changing *::after { transition: none !important; }
html[data-theme].auth-session-pending { background: var(--bg-primary); }
body:is(.workspace-redesign, .admin-redesign, .agent-lab-page) {
  font-family: var(--font-ui); color-scheme: var(--appearance-scheme);
  --workspace-reading-width: 768px;
  --admin-hover: var(--surface-hover);
  --admin-selected: var(--surface-selected);
  --admin-overlay: var(--overlay-bg);
}
body:is(.workspace-redesign, .admin-redesign, .agent-lab-page) :is(button, input, textarea, select) { font-family: inherit; }
body:is(.workspace-redesign, .admin-redesign, .agent-lab-page) :is(button, a, input, textarea, select):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* A narrow, stable global rail; the existing contextual sidebar and profile retain their owners. */
.enterprise-rail { display: flex; flex: 0 0 52px; width: 52px; min-height: 0; flex-direction: column; justify-content: space-between; align-items: center; padding: 8px 0; background: var(--rail-bg); color: var(--rail-text); z-index: 110; }
.enterprise-rail-top, .enterprise-rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.enterprise-rail-top { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px; scrollbar-width: none; }
.enterprise-rail-bottom { flex-shrink: 0; }
.enterprise-rail-library { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; flex-shrink: 0; }
.enterprise-rail-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; background: transparent; border: 0; border-radius: 10px; color: var(--rail-muted); text-decoration: none; cursor: pointer; }
.enterprise-rail-button, .enterprise-rail-divider { flex-shrink: 0; }
.enterprise-rail-button svg { width: 20px; height: 20px; }
.enterprise-rail-button:hover, .enterprise-rail-button.active { background: var(--rail-hover); color: var(--rail-text); }
.enterprise-rail-button:active { opacity: .8; }
.enterprise-relocated-icon { display: none; }
body.enterprise-shell .enterprise-rail .sidebar-btn { --workspace-hover: var(--rail-hover); display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--rail-muted); }
body.enterprise-shell .enterprise-rail .sidebar-btn:is(:hover, .publications-sidebar-active, [aria-current="page"]) { background: var(--rail-hover); color: var(--rail-text); }
.enterprise-rail .sidebar-btn > :is(img, svg) { display: none; }
.enterprise-rail .sidebar-btn > span:not(.enterprise-relocated-icon) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.enterprise-rail .enterprise-relocated-icon { display: flex; width: 20px; height: 20px; }
.enterprise-relocated-icon svg { fill: none; stroke: currentColor; }
body .enterprise-rail :is(button, a):focus-visible { outline-color: var(--rail-text); outline-offset: 2px; }
.enterprise-rail-divider { width: 24px; border-top: 1px solid var(--rail-hover); margin: 0 0 2px; }
body.enterprise-shell .enterprise-rail .user-menu-area { position: relative; width: 100%; margin: 0; padding: 0; border: 0; }
body.enterprise-shell .enterprise-rail .user-menu-trigger { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 36px; margin: auto; padding: 4px; background: transparent; border: 0; color: var(--rail-text); border-radius: 50%; }
.enterprise-profile-avatar { display: none; }
.enterprise-rail .enterprise-profile-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rail-avatar-bg); color: var(--rail-text); font: 500 11px/1 var(--font-ui); }
.enterprise-rail .user-menu-trigger-content { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.enterprise-rail .user-menu-trigger-arrow { display: none; }
body.enterprise-shell .enterprise-rail .user-menu-dropdown { left: calc(100% + 8px); right: auto; bottom: 0; width: 280px; max-width: calc(100vw - 68px); color: var(--text); background: var(--surface-floating); box-shadow: var(--popover-shadow); border: 1px solid var(--border-subtle); }
body.enterprise-shell .enterprise-rail .user-menu-action { color: var(--text); }
body.enterprise-shell .enterprise-rail .user-menu-action svg { fill: currentColor; }
body.enterprise-shell .enterprise-rail .user-menu-action.danger { color: var(--status-danger); }
body.enterprise-shell .enterprise-rail .user-menu-dropdown :is(button, a):focus-visible { outline-color: var(--focus-ring); }

/* Appearance is one shared selector in every desktop menu and mobile sheet. */
.appearance-selector { padding: 10px 12px; color: var(--text); }
.appearance-selector-label { display: block; margin-bottom: 8px; font: 400 13px/18px var(--font-ui); color: var(--muted); }
.appearance-options { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg-code); }
.appearance-options button { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 400 14px/20px var(--font-ui); cursor: pointer; }
.appearance-options button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.appearance-options button:hover { background: var(--surface-hover); color: var(--text); }
.appearance-options button[aria-checked="true"] { background: var(--surface-floating); color: var(--text); box-shadow: 0 1px 4px rgb(var(--shadow-rgb) / 10%); }
.appearance-options button:active { opacity: .8; }
.appearance-options button:disabled { opacity: .5; cursor: not-allowed; }

body.enterprise-shell .sidebar { border-right: 1px solid var(--border-sidebar); }
.enterprise-sidebar-scroll { display: contents; }
body.enterprise-shell .sidebar-header { flex-wrap: wrap; gap: 4px; }
body.enterprise-shell .sidebar-header > .sidebar-search { flex: 1 1 0; min-width: 0; }
body.enterprise-shell .sidebar-header > .sidebar-mode-switch { flex-basis: 100%; }
body.enterprise-shell .header { position: relative; }
body.enterprise-shell .header .enterprise-mode-switch { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; width: 224px; padding: 2px; border-radius: 9999px; background: var(--bg-code); }
body.enterprise-shell .header .enterprise-mode-switch .sidebar-mode-option { border-radius: 9999px; min-height: 32px; height: 32px; flex: 1; }
body.enterprise-shell .header .enterprise-mode-switch .sidebar-mode-option.active { background: var(--surface-floating); box-shadow: 0 0 0 1px var(--border-subtle), 0 1px 4px rgb(var(--shadow-rgb) / 6%); }
body.enterprise-shell .header .enterprise-mode-switch svg { display: none; }
body.enterprise-shell.admin-redesign #adminSidebar { width: 288px; flex-basis: 288px; }
body.enterprise-shell.admin-redesign #adminSidebar.collapsed { width: 0; flex-basis: 0; }
body.enterprise-shell .sidebar-mode-switch { gap: 4px; }
body.enterprise-shell .sidebar-mode-option { font-size: 14px; font-weight: 400; min-height: 35px; }
body.enterprise-shell .sidebar-mode-option svg, body.enterprise-shell .sidebar-mode-option.active svg { fill: none; stroke: currentColor; }
body.enterprise-shell .sidebar-btn > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; filter: none; }
body.enterprise-shell .sidebar-section-toggle-icon, body.enterprise-shell .user-menu-trigger-arrow { fill: none; stroke: currentColor; }
body.enterprise-shell .sidebar-search svg { fill: none; stroke: currentColor; color: var(--muted); }
/* Filled 960-unit glyphs and 24-unit stroke icons have distinct paint contracts. */
body.enterprise-shell :is(button, a, .sidebar-search, .agent-runtime-section-icon, .model-modality-icon) svg[viewBox="0 -960 960 960"] { fill: currentColor; stroke: none; }
html[data-theme] body.enterprise-shell svg[data-aira-icon] { fill: none; stroke: currentColor; filter: none; }
body.enterprise-shell.admin-redesign .assistant-icon-btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
html[data-theme="light"] body.enterprise-shell img:is([src$="/visibility.svg"], [src$="/visibility_off.svg"], [src$="/electric.svg"]) { filter: brightness(0); }
.enterprise-nav-icon { display: inline-flex; }
.enterprise-nav-icon > svg { width: 100%; height: 100%; fill: none; }
body.enterprise-shell .visual-identity-toolbar { flex-wrap: wrap; }
body.enterprise-shell .visual-identity-toolbar > div:first-child { flex: 1 1 320px; min-width: 0; }
body.enterprise-shell .visual-identity-master-toggle { min-width: 0; max-width: 100%; }
body.enterprise-shell .sidebar-btn { min-height: 35px; padding: 6px 10px; font-size: 14px; line-height: 20px; border-radius: 8px; }
body.enterprise-shell .sidebar-section-toggle { min-height: 36px; font-size: 14px; line-height: 18px; }
body.enterprise-shell .folder-group-title, body.enterprise-shell .history-item-title { font-size: 14px; line-height: 20px; }
body.enterprise-shell .sidebar-search input { font-size: 14px; height: 36px; }
body.enterprise-shell .header { border-bottom-color: transparent; }
body.enterprise-shell .welcome-title { font-size: 24px; font-weight: 400; letter-spacing: 0; line-height: 1.2; margin-bottom: 32px; }
body.enterprise-shell :is(.welcome-input-container, .input-container) { max-width: 768px; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) { min-height: 52px; border: 0; border-radius: 26px; padding: 8px; gap: 8px; background: var(--bg-workspace-input); box-shadow: var(--composer-shadow); align-items: center; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell):focus-within { outline: none; box-shadow: var(--composer-shadow), 0 0 0 1px rgb(var(--text-rgb) / 12%); }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) textarea:focus-visible { outline: none; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) > .add-btn-wrapper { order: 0; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) > :is(textarea, .connector-rich-composer) { order: 1; flex: 1 1 180px; width: auto; min-width: 0; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) textarea { flex: 1 1 auto; min-height: 36px; padding: 5px 0; font-size: 16px; line-height: 26px; max-height: 200px; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) > .reasoning-mode-wrapper { order: 2; margin-left: 0; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) > .mic-btn { order: 3; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) > .send-btn { order: 4; }
body.enterprise-shell .enterprise-composer-expanded > :is(textarea, .connector-rich-composer) { order: -1; flex-basis: 100%; }
body.enterprise-shell .enterprise-composer-expanded > .add-btn-wrapper { order: 0; }
body.enterprise-shell .enterprise-composer-expanded > .reasoning-mode-wrapper { margin-left: auto; }
body.enterprise-shell :is(.input-shell, .welcome-input-shell) > :is(.web-search-tag, .research-tag, .image-studio-tag, .attachment-limit-tag) { order: -1; max-width: 100%; }
body.enterprise-shell :is(.add-btn, .mic-btn, .send-btn) { flex-shrink: 0; width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
body.enterprise-shell .send-btn { background: var(--action-primary); color: var(--action-primary-text); transition: background-color .15s ease, color .15s ease; }
body.enterprise-shell .send-btn svg { fill: currentColor; }
body.enterprise-shell .send-btn:disabled { background: var(--btn-disabled-bg); color: var(--muted); }
body.enterprise-shell .send-btn .stop-icon { background: currentColor; }
body.enterprise-shell .send-btn.streaming:disabled { background: var(--action-primary); color: var(--action-primary-text); opacity: 1; }
body.enterprise-shell .send-btn.streaming.cancelling .stop-icon { background: transparent; border-color: color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; }
body.enterprise-shell .reasoning-mode-btn { min-width: 0; height: 36px; min-height: 36px; border-radius: 9999px; padding: 0 12px 0 16px; gap: 6px; background: transparent; color: var(--muted); font-size: 16px; font-weight: 400; line-height: 26px; }
body.enterprise-shell .reasoning-mode-btn:hover, body.enterprise-shell .reasoning-mode-btn.open { background: var(--surface-hover); color: var(--text); }
body.enterprise-shell .reasoning-mode-btn:disabled { cursor: not-allowed; opacity: .55; }
body.enterprise-shell .reasoning-mode-menu { position: fixed; margin: 0; inset: auto; width: 254px; min-width: 0; max-width: calc(100vw - 16px); padding: 12px; border-radius: 16px; background: var(--surface-floating); color: var(--text); border: 1px solid var(--border-subtle); box-shadow: var(--popover-shadow); }
.reasoning-slider-heading { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; font-size: 16px; line-height: 24px; }
.reasoning-effort-slider { display: block; width: 100%; height: 28px; padding: 0; accent-color: var(--text); cursor: pointer; }
.reasoning-effort-slider:disabled { cursor: not-allowed; opacity: .5; }
.reasoning-slider-labels { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 16px; }
.reasoning-model-link { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-top: 1px solid var(--border-subtle); margin-top: 10px; padding: 10px 4px 0; color: var(--muted); background: transparent; font: 400 13px/20px var(--font-ui); cursor: pointer; }
.reasoning-model-link:hover { color: var(--text); }
.reasoning-model-link:active { opacity: .8; }
body.enterprise-shell .messages { font-size: 16px; line-height: 1.625; }
body.enterprise-shell :is(.ai-response, .ai-text-content, .bubble.user) { font-size: 16px; line-height: 1.625; }
body.enterprise-shell .agent-workspace-conversation-state { font-size: 12px; line-height: 1.4; }

/* Shell-owned overlays use roles in both themes, including elements outside .app. */
html[data-theme] :is(.user-menu-dropdown, .user-menu-sheet, .add-menu, .assistant-selector-list, .folder-group-menu, .folder-conversation-menu, .conversation-folder-menu, .history-item-menu, .model-dropdown) { color: var(--text); background: var(--surface-floating); border-color: var(--border-subtle); box-shadow: var(--popover-shadow); }
html[data-theme="light"] :is(.user-menu-action, .add-menu-option, .assistant-option, .folder-group-menu-item, .folder-conversation-menu-item, .conversation-folder-menu-item, .history-item-menu-action):hover { background: var(--surface-hover); }
html[data-theme="light"] :is(.sidebar-btn-icon, .user-menu-action > img, .admin-back-link > img, .mic-icon) { filter: brightness(0); }
html[data-theme="light"] .access-redesign .logo img.brand-logo-aira { filter: brightness(0); }
html[data-theme="light"] .access-redesign .toggle-password img { filter: brightness(0); }
html[data-theme="light"] .agent-workspace-conversation-surface { --conversation-complete: var(--color-success); --conversation-waiting: var(--status-warning); }
html[data-theme="light"] :is(.connector-composer-mention, .connector-message-mention) { color: var(--text-link); }
html[data-theme="light"] :is(.settings-modal, .settings-section-sticky-header, .research-modal, .image-studio-bar, .file-viewer-panel, .file-viewer-header, .artifact-preview-code) { background: var(--bg); color: var(--text); border-color: var(--border-subtle); }
html[data-theme="light"] :is(.settings-section-title, .settings-modal-title, .archive-thread-link, .agent-runtime-section-icon, .agent-progress-active-copy strong, .agent-task-item > span:last-child, .agent-empty-state strong, .agent-service-row strong, .agent-service-card strong, .agent-file-tree-row.folder, .agent-file-tree-action, .agent-workspace-project-toolbar button, .agent-workspace-project-retry, .routine-pill-list span, .admin-select option) { color: var(--text); }
html[data-theme="light"] :is(.agent-progress-active-copy span, .agent-progress-count, .agent-file-tree-meta, .agent-context-hint, .agent-service-bundle-description) { color: var(--muted); }
html[data-theme="light"] :is(.agent-task-item.failed > span:last-child, .agent-task-failed, .settings-error, .admin-inline-note.error) { color: var(--status-danger); }
html[data-theme="light"] :is(.agent-task-waiting, .admin-pill.warn, .research-tag, .research-model-btn, .research-mode-select) { color: var(--status-warning); }
html[data-theme="light"] :is(.research-mode-select, .model-catalog, .model-catalog-filter) { color-scheme: light; }
html[data-theme="light"] :is(.research-mode-select option, .agent-progress-overview, .agent-workspace-project-card, .agent-workspace-project-toolbar, .agent-api-service-copy-row input, .agent-api-service-dialog-body pre, .calculator-summary-shell, .calculator-component-card, .calculator-input, .calculator-select, .agent-file-tree-row.file.selected) { background: var(--bg-code); color: var(--text); border-color: var(--border-subtle); }
html[data-theme="light"] :is(.assistant-dropdown-btn, .assistant-option.selected, .folder-group-menu-trigger:hover, .folder-conversation-menu-trigger:hover, .agent-file-tree-action:hover) { background: var(--surface-hover); color: var(--text); }
html[data-theme="light"] :is(.admin-nav-group-title, .assistant-help-trigger, .user-menu-role) { color: var(--muted); }
html[data-theme="light"] :is(.sidebar-backdrop, .settings-modal-overlay, .research-modal-overlay, .assistant-modal-overlay) { background-color: var(--overlay-bg); }
html[data-theme="light"] .hljs { color: var(--text); background: var(--bg-code); }
html[data-theme="light"] .hljs :is(.hljs-comment, .hljs-quote) { color: var(--text-muted); }
html[data-theme="light"] .hljs :is(.hljs-keyword, .hljs-selector-tag, .hljs-deletion) { color: var(--text-code); }
html[data-theme="light"] .hljs :is(.hljs-string, .hljs-regexp, .hljs-addition) { color: var(--color-success); }
html[data-theme="light"] .hljs :is(.hljs-title, .hljs-number, .hljs-literal, .hljs-attr, .hljs-built_in, .hljs-type) { color: var(--text-link); }
html[data-theme="light"] .tabulator { background: var(--bg); color: var(--text); border-color: var(--border-table); }
html[data-theme="light"] :is(.tabulator .tabulator-header, .tabulator .tabulator-header .tabulator-col, .tabulator-row, .tabulator-row.tabulator-row-even, .tabulator .tabulator-footer) { color: var(--text); background: var(--bg); border-color: var(--border-table); }
html[data-theme="light"] .tabulator-row .tabulator-cell { border-color: var(--border-table); }
html[data-theme="light"] .tabulator-row:hover { background: var(--surface-hover); }
html[data-theme="light"] .tabulator-row.tabulator-selected { background: var(--surface-selected); }

/* Rendered conversations have their own legacy dark rules, beyond the shell. */
html[data-theme="light"] .ai-response :is(h1, h2, h3, h4, h5, h6, strong) { color: inherit; }
html[data-theme="light"] .ai-response code:not(pre code) { color: var(--text-code); }
html[data-theme="light"] .ai-response blockquote { background: var(--bg-code); color: var(--text); }
html[data-theme="light"] .ai-response th { background: var(--bg-code-header); color: var(--text); }
html[data-theme="light"] .ai-response tr:nth-child(even) { background: var(--bg-code); }
html[data-theme="light"] .ai-response tr:hover { background: var(--surface-hover); }
/* Tool activity is readable throughout the operation, including its pulse. */
body.enterprise-shell :is(.function-call-indicator, .mcp-call-indicator, .web-search-indicator) { color: var(--text-link); background: var(--bg-info); border-color: var(--text-link); }
body.enterprise-shell :is(.function-call-indicator, .web-search-indicator, .research-indicator):not(.completed) { animation: none; }
body.enterprise-shell :is(.function-call-indicator-text, .mcp-call-indicator-text, .web-search-indicator span) { color: inherit; }
body.enterprise-shell :is(.function-call-indicator, .web-search-indicator) svg { fill: currentColor; }
body.enterprise-shell .function-call-dots span { background: currentColor; }
body.enterprise-shell :is(.code-interpreter-output, .image-generation-output) { background: var(--bg-code); }
body.enterprise-shell :is(.code-interpreter-loading, .image-generation-loading) { color: var(--text); }
body.enterprise-shell :is(.code-interpreter-header, .image-generation-header) { color: var(--text-link); background: var(--bg-info); }
body.enterprise-shell :is(.code-interpreter-header, .image-generation-header) span { color: inherit; }
body.enterprise-shell :is(.code-interpreter-header, .image-generation-header) svg { fill: currentColor; }
html[data-theme="light"] .preset-btn.active { color: var(--action-primary-text); background: var(--action-primary); border-color: var(--action-primary); }
html[data-theme="light"] :is(.preset-status, .preset-btn.is-unsupported.active) { color: var(--status-warning); background: var(--bg-warning); }
html[data-theme="light"] :is(.studio-control select option, .research-mode-select option, .research-mode-select option:checked) { color: var(--text); background: var(--surface-floating); }
html[data-theme="light"] :is(.research-tag, .research-progress, .research-model-info) { color: var(--status-warning); background: var(--bg-warning); border-color: var(--status-warning); }
html[data-theme="light"] :is(.research-tag span, .research-progress-time, .research-btn-view) { color: var(--status-warning); }
html[data-theme="light"] :is(.research-tag, .research-progress-time, .research-progress-icon) svg { fill: currentColor; }
html[data-theme="light"] .research-progress-status { color: var(--text); }
html[data-theme="light"] .research-progress-time { background: var(--bg-warning); }
html[data-theme="light"] .research-indicator { color: var(--status-warning); background: var(--bg-warning); border-color: var(--status-warning); }
html[data-theme="light"] .research-indicator span { color: inherit; }
html[data-theme="light"] .research-indicator .research-dots span { background: currentColor; }
html[data-theme="light"] :is(.research-model-info-text strong, .research-estimate span) { color: var(--status-warning); }
html[data-theme="light"] .research-model-info svg { fill: var(--status-warning); }
html[data-theme="light"] .research-modal :is(.research-query-label, .research-mode-details, .research-question-hint, .research-estimate) { color: var(--text); }
body.enterprise-shell :is(.studio-error, .research-error-card) { color: var(--status-danger); background: var(--bg-error); border-color: var(--status-danger); }
body.enterprise-shell .research-error-title { color: var(--status-danger); }
body.enterprise-shell .research-error-message { color: var(--text); }
body.enterprise-shell .research-error-icon { fill: var(--status-danger); }
html[data-theme="light"] :is(.research-modal-title svg, .research-toast-icon, .research-progress-card-icon) { fill: var(--status-warning); }
html[data-theme="light"] :is(.web-search-toast, .research-toast) { color: var(--text); background: var(--surface-floating); border-color: var(--status-warning); }
html[data-theme="light"] :is(.web-search-toast-title, .web-search-toast-model) { color: var(--status-warning); }
html[data-theme="light"] .web-search-toast-icon { fill: var(--status-warning); }
html[data-theme="light"] .web-search-toast-message { color: var(--text); }
html[data-theme="light"] :is(.web-search-toast-close, .research-toast-close) svg { fill: var(--text); }
html[data-theme="light"] .research-progress-card { background: var(--bg-warning); border-color: var(--status-warning); }
html[data-theme="light"] .research-progress-card-status { background: var(--bg-warning); }
html[data-theme="light"] .research-progress-text { color: var(--status-warning); }
html[data-theme="light"] .research-progress-dots span { background: var(--status-warning); }
html[data-theme="light"] :is(.research-progress-timer, .research-progress-info) { color: var(--text); }
html[data-theme="light"] .research-progress-timer svg { fill: currentColor; }
html[data-theme="light"] .research-cancel-btn { color: var(--status-danger); border-color: var(--status-danger); }
html[data-theme="light"] .research-cancel-btn svg { fill: currentColor; }
body.enterprise-shell .research-query-label { color: var(--text); }
body.enterprise-shell :is(.research-btn-start, .research-retry-btn) { background: var(--action-primary); color: var(--action-primary-text); }
body.enterprise-shell :is(.research-btn-start, .research-retry-btn):hover { background: var(--action-primary-hover); }
body.enterprise-shell :is(.research-btn-start, .research-retry-btn) svg { fill: currentColor; }
html[data-theme="light"] .settings-child-dialog { background: var(--surface-floating); color: var(--text); border-color: var(--border-subtle); }
html[data-theme="light"] .settings-child-dialog-overlay { background: var(--overlay-bg); }
html[data-theme="light"] .settings-child-dialog .settings-input { border-color: var(--control-border); }
html[data-theme="light"] .settings-mcp-trust-note { background: var(--bg-info); color: var(--text-link); border-color: var(--text-link); }
html[data-theme="light"] .agent-run-preview-user .bubble.user { background: var(--bubble-user); color: var(--text); border-color: transparent; }
html[data-theme="light"] .agent-run-preview-ai .ai-response { color: var(--text); }
html[data-theme="light"] :is(.agent-run-duration-toggle, .agent-run-duration-title, .agent-run-activity-summary, .agent-run-activity-toggle, .agent-run-activity-row, .agent-run-activity-status, .agent-run-activity-title, .agent-run-activity-pill, .agent-run-command-label) { color: var(--muted); }
html[data-theme="dark"] .agent-run-duration-toggle { color: var(--muted); }
html[data-theme="light"] .agent-run-duration-toggle:hover { background: var(--surface-hover); color: var(--text); }
html[data-theme="light"] .agent-run-duration-toggle:hover .agent-run-duration-title { color: inherit; }
html[data-theme="light"] .agent-run-activity-toggle:hover { color: var(--text); }
html[data-theme="light"] .agent-run-activity-meta span:not(.agent-run-activity-pill) { color: var(--muted); }
html[data-theme="light"] .agent-run-activity-item::before { background: var(--border-subtle); }
html[data-theme="light"] .agent-run-activity-item:is(.running, .failed, .waiting, .recovered, .queued, .skipped) .agent-run-activity-title { color: var(--text); }
html[data-theme="light"] .agent-run-activity-item:is(.complete, .recovered) :is(.agent-run-activity-status, .agent-run-activity-pill) { color: var(--color-success); }
html[data-theme="light"] .agent-run-activity-item.running :is(.agent-run-activity-status, .agent-run-activity-pill) { color: var(--text-link); }
html[data-theme="light"] .agent-run-activity-item.failed :is(.agent-run-activity-status, .agent-run-activity-pill) { color: var(--status-danger); }
html[data-theme="light"] .agent-run-activity-item.waiting :is(.agent-run-activity-status, .agent-run-activity-pill) { color: var(--status-warning); }
html[data-theme="light"] .agent-run-activity-item:is(.queued, .skipped) .agent-run-activity-status { color: var(--muted); }
html[data-theme="light"] .agent-run-activity-spinner { border-color: var(--muted); }
html[data-theme="light"] .agent-run-activity-spinner::before { background: var(--text-link); box-shadow: none; }
html[data-theme="light"] .agent-live-update { background: var(--bg-success); }
html[data-theme="light"] .agent-live-update.is-final { background: transparent; }
html[data-theme="light"] .agent-live-update-label { color: var(--color-success); }
html[data-theme="light"] .agent-live-update-content { color: var(--text); }
html[data-theme="light"] :is(.agent-skill-summary strong, .agent-skill-main strong) { color: var(--text); }
html[data-theme="light"] :is(.agent-skill-summary span, .agent-skill-main span, .agent-skill-meta) { color: var(--muted); }
html[data-theme="light"] .agent-skill-meta.connector { color: var(--color-success); }
html[data-theme="light"] .agent-skill-meta.mcp { color: var(--text-link); }
html[data-theme="light"] .agent-skill-meta.waiting { color: var(--status-warning); }
html[data-theme="light"] .agent-skill-item:hover { background: var(--surface-hover); }
html[data-theme="light"] .agent-skill-dot { background: var(--muted); }
html[data-theme="light"] .agent-skill-item.used .agent-skill-dot { background: var(--color-success); }
html[data-theme="light"] .agent-skill-item.pending .agent-skill-dot { background: var(--status-warning); }
html[data-theme="light"] .agent-skill-item.failed .agent-skill-dot { background: var(--status-danger); }
html[data-theme="light"] .agent-skill-item.file .agent-skill-dot { background: var(--text-link); }
html[data-theme="light"] .agent-user-message-tag { background: var(--bg-code-header); color: var(--muted); }
html[data-theme="light"] .agent-user-message-tag:is(:hover, :focus-visible, .redacted) { background: var(--bg-info); color: var(--text-link); }
html[data-theme="light"] .agent-run-log-block { background: var(--bg-code); color: var(--text); }
html[data-theme="light"] .agent-run-log-block:is(.stdout, .file) { background: var(--bg-code); }
html[data-theme="light"] .agent-run-log-block.stderr { background: var(--bg-warning); color: var(--status-warning); }
html[data-theme="light"] .agent-run-log-block.error { background: var(--bg-error); color: var(--status-danger); }
html[data-theme="light"] .agent-run-log-block.diff { background: var(--bg-success); }
html[data-theme="light"] body.agent-page .agent-run-log-block pre { color: inherit; }
html[data-theme="light"] body.agent-page .agent-run-log-block code span.is-add { color: var(--color-success); }
html[data-theme="light"] body.agent-page .agent-run-log-block code span.is-remove { color: var(--status-danger); }
html[data-theme="light"] body.agent-page .agent-run-log-block code span.is-muted { color: var(--muted); }
html[data-theme="light"] :is(.agent-run-deliverable, .agent-run-artifact-badge) { background: var(--bg-code); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-subtle); }
html[data-theme="light"] .agent-run-deliverable-primary { background: var(--bg-info); }
html[data-theme="light"] :is(.agent-run-deliverable-label, .agent-run-deliverable-status, .agent-run-deliverable p, .agent-run-deliverable-meta span, .agent-run-artifact-badge .agent-run-deliverable-label) { color: var(--muted); }
html[data-theme="light"] :is(.agent-run-deliverable strong, .agent-run-deliverable-icon, .agent-run-artifact-badge .agent-run-deliverable-icon) { color: var(--text); }
html[data-theme="light"] :is(.agent-run-deliverable-launch, .agent-run-deliverable-actions button) { background: var(--bg-code-header); color: var(--text); }
html[data-theme="light"] :is(.agent-run-deliverable-launch:hover, .agent-run-deliverable-actions button:hover) { background: var(--surface-selected); }
html[data-theme="light"] .agent-run-deliverable-actions :is(.agent-run-deliverable-save, .agent-run-outbound-confirm),
html[data-theme="light"] .agent-run-service-bundle-actions button:first-child { background: var(--bg-info); color: var(--text-link); }
html[data-theme="light"] .agent-run-deliverable-actions .agent-service-action-danger { background: var(--bg-error); color: var(--status-danger); }

/* Alerts and portal menus need the same semantic palette as their owners. */
html[data-theme="light"] :is(.conversation-model-continuity-banner, .chat-tab-conflict-banner, .agent-platform-notice) { background: var(--bg-warning); border-color: var(--status-warning); color: var(--status-warning); }
html[data-theme="light"] :is(.conversation-model-continuity-banner-text, .chat-tab-conflict-banner-text, .agent-platform-notice > strong) { color: var(--status-warning); }
html[data-theme="light"] .conversation-model-continuity-banner.blocked { background: var(--bg-error); border-color: var(--status-danger); }
html[data-theme="light"] .conversation-model-continuity-banner.blocked .conversation-model-continuity-banner-text { color: var(--status-danger); }
html[data-theme="light"] .shared-readonly-banner { background: var(--bg-info); border-color: var(--text-link); }
html[data-theme="light"] .shared-readonly-banner-text { color: var(--text-link); }
html[data-theme="light"] .error-message { background: var(--bg-error); border-color: var(--status-danger); }
html[data-theme="light"] :is(.error-message-title, .error-message-text, .agent-run-failure-help, .agent-message-delivery.failed, .agent-runtime-note-error, .studio-error) { color: var(--status-danger); }
html[data-theme="light"] .error-message-icon svg { fill: var(--status-danger); }
html[data-theme="light"] .recoverable-notice-message { background: var(--bg-info); color: var(--text); }
html[data-theme="light"] .recoverable-notice-title { color: var(--text-link); }
html[data-theme="light"] .recoverable-notice-text { color: var(--text); }
html[data-theme="light"] .recoverable-notice-icon svg { fill: var(--text-link); }
html[data-theme="light"] .recoverable-notice-btn.primary { background: var(--bg-info); color: var(--text-link); }
html[data-theme="light"] .recoverable-notice-btn.secondary { background: var(--bg-code-header); color: var(--text); }
html[data-theme="light"] .recoverable-notice-btn:hover { background: var(--surface-selected); }
html[data-theme="light"] .toast-notification { background: var(--surface-floating); color: var(--text); border-color: var(--border-subtle); box-shadow: var(--popover-shadow); }
html[data-theme="light"] .toast-notification.toast-success::before { background: var(--bg-success); color: var(--color-success); }
html[data-theme="light"] .toast-notification.toast-error::before { background: var(--bg-error); color: var(--status-danger); }
html[data-theme="light"] .web-search-toast { background: var(--bg-warning); border-color: var(--status-warning); }
html[data-theme="light"] :is(.web-search-toast-title, .web-search-toast-message, .web-search-toast-model) { color: var(--status-warning); }
html[data-theme="light"] .web-search-toast-icon { fill: var(--status-warning); }
html[data-theme="light"] .web-search-toast-tip { background: var(--bg-info); color: var(--text-link); }
html[data-theme="light"] .web-search-toast-tip svg { fill: currentColor; }
html[data-theme="light"] .research-toast { background: var(--bg-info); border-color: var(--text-link); }
html[data-theme="light"] :is(.web-search-toast-close, .research-toast-close) svg { fill: var(--muted); }
html[data-theme="light"] :is(.web-search-toast-close, .research-toast-close):hover { background: var(--surface-hover); }
html[data-theme="light"] .connector-picker { background: var(--surface-floating); color: var(--text); box-shadow: var(--popover-shadow); }
html[data-theme="light"] :is(.connector-picker-option:hover, .connector-picker-option.is-active, .connector-picker-option:focus-visible, .connector-picker-connect:hover, .connector-picker-connect:focus-visible) { background: var(--surface-hover); }
html[data-theme="light"] .connector-picker-led { color: var(--color-success); }
html[data-theme="light"] .connector-picker-led::before { background: var(--color-success); box-shadow: none; }
html[data-theme="light"] :is(.dock-btn, .agent-board-toggle) { color: var(--muted); }
html[data-theme="light"] :is(.dock-btn, .agent-board-toggle) svg { fill: currentColor; }
html[data-theme="light"] body.agent-page .agent-board-toggle[aria-expanded] svg { fill: currentColor; }

/* Inventory, generated output and administration use the same semantic roles. */
html[data-theme="light"] :is(.assistant-status-led.active, .publication-status-led.active, .publication-status-led.completed, .publication-status-led.succeeded, .publication-status-led.connected, .publication-status-led.available, .publication-status-led.stored, .agent-credential-status.connected, .agent-credential-status.saved, .status-pill.success, .runtime-parameters-badge.success, .function-json-status.valid, .usage-status-recorded, .settings-personalization-status.is-success, .settings-connector-status.is-connected, .onedrive-picker-status.is-success, .routine-history-outcome.success) { color: var(--color-success); }
html[data-theme="light"] :is(.assistant-status-led.inactive, .publication-status-led.failed, .publication-status-led.error, .function-json-status.invalid, .settings-personalization-status.is-error, .settings-connector-status.is-error, .settings-connector-status.is-reauth_required, .settings-connector-error, .settings-personal-connector-copy em, .onedrive-picker-status.is-error, .routine-history-outcome.has-error) { color: var(--status-danger); }
html[data-theme="light"] :is(.assistant-status-led.processing, .publication-status-led.requires_action, .publication-status-led.missing_value, .publication-status-led.reauth_required, .agent-credential-status.pending, .agent-credential-status.reauth, .agent-credential-request-action, .agent-credential-request-icon, .status-pill.warning, .usage-status-recorded_zero_cost, .usage-status-not_recorded, .preset-status) { color: var(--status-warning); }
html[data-theme="light"] :is(.publication-status-led.running, .publication-status-led.candidate_ready, .publication-status-led.starting, .publication-status-led.queued, .conversation-file-import-status) { color: var(--text-link); }
html[data-theme="light"] :is(.assistant-status-led, .publication-status-led)::before { background: currentColor; box-shadow: none; }
html[data-theme="light"] :is(.agent-credential-request-main span, .agent-credential-fields, .agent-credential-context, .agent-artifact-rail-header, .agent-service-badge, .agent-capacity-badge-copy > span, .settings-connector-status, .settings-connector-privacy-notice) { color: var(--muted); }
html[data-theme="light"] .agent-artifact-rail-header strong { color: var(--text-link); background: var(--bg-info); }
html[data-theme="light"] :is(.agent-credential-field label, .agent-capacity-badge-copy strong) { color: var(--text); }
html[data-theme="light"] .agent-credential-actions button { color: var(--text); background: var(--bg-code-header); }
html[data-theme="light"] .agent-credential-actions .agent-credential-delete { color: var(--status-danger); opacity: 1; background: transparent; }
html[data-theme="light"] :is(.agent-credential-card:hover, .agent-credential-card:focus-visible) { background: var(--surface-hover); }
html[data-theme="light"] :is(.agent-credential-card.reauth, .agent-credential-card.needs-value, .agent-credential-request, .agent-credential-request:hover, .agent-credential-request:focus-visible, .agent-credential-request-icon, .agent-capacity-badge) { background: var(--bg-warning); }
html[data-theme="light"] .agent-capacity-badge-position { color: var(--status-warning); }
html[data-theme="light"] .agent-service-card.healthy .agent-service-badge { color: var(--color-success); }
html[data-theme="light"] .agent-service-card.starting .agent-service-badge { color: var(--status-warning); }
html[data-theme="light"] .agent-service-card.unhealthy .agent-service-badge { color: var(--status-danger); }
body.enterprise-shell .agent-service-card:is(.stopped, .expired) { opacity: 1; }
html[data-theme="light"] :is(.agent-service-card.stopped, .agent-service-card.expired) .agent-service-badge { color: var(--muted); }
html[data-theme="light"] .agent-service-card .agent-service-metrics span { background: var(--bg-code); color: var(--text); }
body.enterprise-shell .agent-service-card .agent-service-metrics small { color: var(--muted); }
html[data-theme="light"] .agent-service-card .agent-service-actions button { background: var(--bg-code-header); color: var(--text); }
html[data-theme="light"] .agent-service-card .agent-service-actions button:hover:not(:disabled) { background: var(--surface-selected); }
html[data-theme="light"] .agent-service-card .agent-service-actions .agent-service-action-danger { background: var(--bg-error); border-color: color-mix(in srgb, var(--status-danger) 30%, transparent); color: var(--status-danger); }
html[data-theme="light"] .agent-service-card .agent-service-actions .agent-service-action-danger:hover:not(:disabled) { background: var(--bg-error); border-color: var(--status-danger); }
html[data-theme="light"] .agent-service-card .agent-service-actions button:disabled { background: var(--bg-code); color: var(--muted); opacity: 1; }
html[data-theme="light"] .agent-service-publication-card { --publication-accent: var(--text-link); --publication-bg: var(--bg-info); background: var(--publication-bg); border-color: color-mix(in srgb, var(--publication-accent) 30%, transparent); }
html[data-theme="light"] .agent-service-publication-card.completed { --publication-accent: var(--color-success); --publication-bg: var(--bg-success); }
html[data-theme="light"] .agent-service-publication-card.failed { --publication-accent: var(--status-danger); --publication-bg: var(--bg-error); }
html[data-theme="light"] .agent-service-publication-head strong, html[data-theme="light"] .agent-service-publication-card p { color: var(--text); }
html[data-theme="light"] .agent-service-publication-head > div > span, html[data-theme="light"] .agent-service-publication-head b { color: var(--publication-accent); }
html[data-theme="light"] .agent-service-publication-icon { color: var(--publication-accent); background: color-mix(in srgb, var(--publication-accent) 10%, transparent); }
html[data-theme="light"] .agent-service-publication-card progress { appearance: none; accent-color: var(--publication-accent); background: color-mix(in srgb, var(--publication-accent) 15%, transparent); }
html[data-theme="light"] .agent-service-publication-card progress::-webkit-progress-bar { background: color-mix(in srgb, var(--publication-accent) 15%, transparent); border-radius: inherit; }
html[data-theme="light"] .agent-service-publication-card progress::-webkit-progress-value { background: var(--publication-accent); border-radius: inherit; }
html[data-theme="light"] .agent-service-publication-card progress::-moz-progress-bar { background: var(--publication-accent); border-radius: inherit; }
html[data-theme="light"] .agent-service-publication-actions button { color: var(--publication-accent); background: var(--surface-floating); border-color: color-mix(in srgb, var(--publication-accent) 40%, transparent); }
html[data-theme="light"] .agent-service-publication-actions button:hover { background: var(--publication-bg); border-color: var(--publication-accent); }
html[data-theme="light"] .settings-status-led.is-connected { color: var(--color-success) !important; }
html[data-theme="light"] :is(.settings-status-led.is-pending, .settings-status-led.is-authorizing) { color: var(--text-link) !important; }
html[data-theme="light"] :is(.settings-status-led.is-reauth_required, .settings-status-led.is-error) { color: var(--status-danger) !important; }
html[data-theme="light"] .settings-connector-privacy-notice a { color: var(--text-link); }
html[data-theme] body.admin-redesign :is(.assistant-runtime-panel, .assistant-access-grid.disabled, .assistant-access-select-all:has(input:disabled), .billing-provider-budget-disabled) { opacity: 1; }
html[data-theme] .models-access-tab-count { color: var(--text); }
html[data-theme] .agent-run-artifact-badge .agent-run-deliverable-label { color: var(--muted); }
html[data-theme="light"] img.agent-file-tree-icon { filter: brightness(.7); }

/* Brand marks sit on a neutral plate, never a theme-inverted black tile. */
body.enterprise-shell .model-publisher-logo { width: 26px; height: 26px; flex-basis: 26px; padding: 2px; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; }
body.enterprise-shell .model-publisher-logo img { display: block; width: 100%; height: 100%; object-fit: contain; filter: none; }
body.enterprise-shell .model-publisher-logo.is-monogram { background: var(--bg-code); color: var(--text); font: 600 10px/1 var(--font-ui); }
body.enterprise-shell.admin-redesign :is(.models-access-model-icon, .models-access-provider-logo) { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 2px; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; object-fit: contain; vertical-align: middle; }
body.enterprise-shell.admin-redesign .models-access-provider-logo { margin: 0 8px 0 0; }
body.enterprise-shell.admin-redesign .models-access-monogram { background: var(--bg-code); color: var(--text); font: 600 10px/1 var(--font-ui); }

@media (min-width: 768px) {
  body.enterprise-shell .welcome-state { padding: 0 24px 110px; }
}
@media (max-width: 767px) {
  .enterprise-rail { display: none; }
  body.enterprise-shell .sidebar > :is(.sidebar-header, .sidebar-search) { flex-shrink: 0; }
  body.enterprise-shell .enterprise-sidebar-scroll { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.enterprise-shell .enterprise-sidebar-scroll .sidebar-section { flex: 0 0 auto; min-height: auto; }
  body.enterprise-shell .enterprise-sidebar-scroll .sidebar-history { flex: none; max-height: none; overflow-y: visible; }
  body.enterprise-shell.admin-redesign #adminSidebar { width: min(288px, 86vw); }
  body.enterprise-shell :is(.input-shell, .welcome-input-shell) > :is(textarea, .connector-rich-composer) { order: -1; flex-basis: 100%; }
  body.enterprise-shell :is(.add-btn, .mic-btn, .send-btn, .reasoning-mode-btn) { min-height: 44px; }
  body.enterprise-shell :is(.add-btn, .mic-btn, .send-btn) { width: 44px; min-width: 44px; }
  body.enterprise-shell .reasoning-mode-btn { margin-left: auto; font-size: 14px; padding-inline: 10px; }
  body.enterprise-shell :is(.input-shell, .welcome-input-shell) > .reasoning-mode-wrapper { margin-left: auto; }
  body.enterprise-shell .welcome-title { font-size: 24px; }
  body.enterprise-shell .sidebar-btn, .appearance-options button { min-height: 44px; }
  body.enterprise-shell .sidebar-header > .sidebar-search input { height: 44px; }
  .reasoning-effort-slider { height: 44px; }
  .reasoning-model-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .enterprise-rail *, .appearance-selector *, .reasoning-mode-menu { transition: none !important; animation: none !important; }
}

/* Composer-owned layout. Attachment cards retain their existing stylesheet. */
.has-composer-dock .header .model-selector { display: none; }
.composer-dock-owner { position: relative; isolation: isolate; container-type: inline-size; }
body.enterprise-shell .composer-dock-owner :is(.input-shell, .welcome-input-shell) {
  position: relative; z-index: 2; flex-wrap: wrap; padding: 30px 12px 10px; border-radius: 28px; gap: 4px;
}
body.enterprise-shell .composer-dock-owner :is(.input-shell, .welcome-input-shell) > :is(textarea, .connector-rich-composer) {
  order: 0; flex: 1 0 100%; width: 100%; min-width: 0; min-height: 64px; padding: 6px 6px 12px; font: 400 16px/26px var(--font-ui);
}
body.enterprise-shell .composer-dock-owner .add-btn-wrapper { order: 1; }
body.enterprise-shell .composer-dock-owner .reasoning-mode-wrapper { order: 2; margin-left: auto; }
body.enterprise-shell .composer-dock-owner :is(.mic-btn, .realtime-camera-btn) { order: 3; }
body.enterprise-shell .composer-dock-owner .send-btn { order: 4; }
.composer-dock-owner .image-studio-tag { display: none !important; }
.composer-tool-panel { display: flex; flex: 0 0 auto; flex-direction: column; gap: 8px; min-width: 0; max-height: min(40dvh, 360px); margin-bottom: 8px; overflow: auto; }
.composer-tool-panel[hidden], .composer-tool-panel > [hidden] { display: none !important; }
.composer-tool-panel > .image-studio-bar { display: flex; margin: 0; padding: 12px; flex-shrink: 0; }
.composer-inline-tools { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.composer-inline-tools[hidden], .composer-inline-tools > [hidden] { display: none !important; }
body.enterprise-shell .composer-dock-owner .composer-inline-tools { order: 1; }
.composer-inline-tools > :is(.web-search-tag, .research-tag) { margin: 0; max-width: 100%; flex-shrink: 0; white-space: nowrap; }
.composer-inline-tools .research-mode-select { max-width: 112px; }
.composer-inline-tools :is(.web-search-close, .research-tag-close) { min-width: 24px; min-height: 24px; }
@container (max-width: 520px) {
  body.enterprise-shell .composer-dock-owner .composer-inline-tools:has(.research-tag:not([hidden])) { flex-basis: calc(100% - 52px); }
  .composer-inline-tools .research-tag { gap: 4px; padding-inline: 8px; }
  .composer-inline-tools .research-tag > span { display: none; }
  body.enterprise-shell .composer-dock-owner .send-btn:is(.voice-starting, .voice-active, .voice-ending) { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
}
body.enterprise-shell .send-btn:is(.voice-starting, .voice-active, .voice-ending) {
  width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%;
  background: var(--action-primary); color: var(--action-primary-text); transform: none;
}
body.enterprise-shell .send-btn:is(.voice-starting, .voice-active, .voice-ending):hover { background: var(--action-primary-hover); transform: none; }
body.enterprise-shell .send-btn .realtime-text { justify-content: center; color: inherit; gap: 0; }
body.enterprise-shell .send-btn .spinner-small { width: 18px; height: 18px; border-color: color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: none; }
body.enterprise-shell .send-btn .voice-dots { gap: 2px; height: 20px; }
body.enterprise-shell .send-btn .voice-dots .dot { width: 3px; height: 12px; border-radius: 2px; background: currentColor; opacity: 1; animation: none; }
body.enterprise-shell .send-btn .voice-dots .dot:nth-child(2n) { height: 20px; }
@media (pointer: coarse) {
  .composer-inline-tools :is(.web-search-close, .research-tag-close, .research-mode-select) { min-width: 44px; min-height: 44px; }
  body.enterprise-shell .send-btn:is(.voice-starting, .voice-active, .voice-ending) { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  body.enterprise-shell .send-btn:is(.voice-starting, .voice-ending) .spinner-small { animation: spin 1.2s linear infinite; }
  body.enterprise-shell .send-btn.voice-active .voice-dots .dot { animation: realtimeVoiceWave 1.2s ease-in-out infinite; }
  body.enterprise-shell .send-btn.voice-active .voice-dots .dot:nth-child(2) { animation-delay: -0.3s; }
  body.enterprise-shell .send-btn.voice-active .voice-dots .dot:nth-child(3) { animation-delay: -0.6s; }
  body.enterprise-shell .send-btn.voice-active .voice-dots .dot:nth-child(4) { animation-delay: -0.9s; }
}
@keyframes realtimeVoiceWave { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.composer-dock-owner .add-menu-option:is([data-action="web-search"], [data-action="image-studio"], [data-action="deep-research"]) { display: none; }
.composer-dock-band {
  position: relative; z-index: 1; display: flex; flex-wrap: nowrap; align-items: center; gap: 2px;
  margin: -18px 14px 0; padding: 24px 6px 6px; border-radius: 0 0 16px 16px; background: var(--bg-code); color: var(--text); min-width: 0;
}
.composer-assistant-slot, .composer-model-slot { display: flex; min-width: 0; flex: 1 1 auto; }
.composer-assistant-slot { flex: 0 1 auto; max-width: 34%; }
.composer-project-slot { display: flex; min-width: 0; flex: 0 1 auto; }
.composer-tools-slot { display: flex; flex: 0 0 auto; }
body.enterprise-shell .composer-dock-control {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  min-height: 36px; height: auto; max-width: 100%; padding: 6px 8px; border: 0; border-radius: 8px;
  color: var(--text); background: transparent; font: 400 14px/20px var(--font-ui); cursor: pointer;
}
body.enterprise-shell .composer-dock-control:hover:not(:disabled),
body.enterprise-shell .composer-dock-control:is([aria-pressed="true"], [aria-expanded="true"]) { background: var(--surface-hover); }
body.enterprise-shell .composer-dock-control:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
body.enterprise-shell .composer-dock-control:disabled { color: var(--muted); cursor: not-allowed; }
.composer-dock-control :is(.model-selector-summary, .assistant-dropdown-text), .composer-project-button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-dock-control :is(#selectedAssistantMeta, #selectedAssistantCaption) { display: none; }
.composer-dock-control .assistant-selector-current { font: inherit; }
.composer-control-icon { display: inline-flex; flex: 0 0 auto; }
.composer-control-icon svg, .composer-dock-control > svg { width: 18px; height: 18px; flex: 0 0 auto; }
body.enterprise-shell .composer-dock-band .composer-control-icon:has(svg) { display: inline-flex; }
body.enterprise-shell .composer-dock-band .composer-model-button > .composer-control-icon { display: none; }
body.enterprise-shell .composer-tool-button { width: 36px; flex: 0 0 36px; padding: 8px; }
body.enterprise-shell .composer-tool-button[data-composer-tool="web"][aria-pressed="true"]:not(:disabled) {
  color: var(--tool-web-search-accent, #196c78);
  background: color-mix(in srgb, var(--tool-web-search-accent, #196c78) 17%, transparent);
}
body.enterprise-shell .composer-expand-button {
  position: absolute; top: 6px; right: 12px; z-index: 1; width: 30px; min-height: 30px; padding: 6px; color: var(--muted);
}
body.enterprise-shell .composer-expand-button svg { width: 16px; height: 16px; }
body.enterprise-shell .composer-tools-more { display: none; }

/* Menus live in the top layer, immediately above the pressed selector. */
html[data-theme] .aira-anchored-popover:popover-open {
  position: fixed; display: flex; flex-direction: column; gap: 4px; margin: 0; box-sizing: border-box;
  min-width: 0; max-width: calc(100vw - 16px); padding: 8px; overflow: auto;
  border: 1px solid var(--border-subtle); border-radius: 14px; color: var(--text); background: var(--surface-floating); box-shadow: var(--popover-shadow);
  font-family: var(--font-ui);
}
html[data-theme] .aira-anchored-popover[hidden] { display: none; }
.composer-dock-menu-row, .model-catalog-back {
  display: block; flex-shrink: 0; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
  color: var(--text); background: transparent; font: 400 14px/20px var(--font-ui); text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.composer-dock-menu-row:hover, .composer-dock-menu-row[aria-pressed="true"], .model-catalog-back:hover { background: var(--surface-hover); }
.composer-dock-menu-row:disabled { color: var(--muted); cursor: default; }
.aira-anchored-popover .model-catalog { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.aira-anchored-popover .model-catalog-results { min-height: 0; max-height: none; overflow: auto; flex: 1; }
.aira-anchored-popover .model-catalog-filters { display: block; flex-shrink: 0; }
.aira-anchored-popover .model-catalog-filter-field:not(.model-catalog-search-field),
.aira-anchored-popover #assistantSelectorBar { display: none; }
.aira-anchored-popover .model-publisher-heading { position: static; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 8px; }
.aira-anchored-popover .model-publisher-heading:hover { background: var(--surface-hover); }
.model-publisher-models[hidden] { display: none; }
.aira-anchored-popover .model-option-main { display: grid; grid-template-columns: minmax(0, 1fr) 20px 42px; align-items: center; gap: 8px; }
.aira-anchored-popover .model-option-modalities { flex-wrap: wrap; margin-left: 0; }
.model-option-route { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.model-option-route > svg { width: 16px; height: 16px; }
.model-option-route > img { width: 18px; height: 18px; object-fit: contain; }
html[data-theme="dark"] .model-route-logo { filter: invert(1); }
.aira-anchored-popover.image-studio-bar { margin: 0; }
.aira-anchored-popover .studio-controls { flex-wrap: wrap; }
.aira-anchored-popover.research-tag { align-items: stretch; }

.composer-expanded-dialog {
  position: fixed; top: calc(var(--composer-viewport-top, 0px) + 16px); left: 0; right: 0; bottom: auto;
  width: min(960px, calc(100vw - 32px)); height: calc(var(--composer-viewport-height, 100dvh) - 32px); max-width: none; max-height: none;
  margin: 0 auto; padding: 14px; border: 1px solid var(--border-subtle); border-radius: 24px;
  color: var(--text); background: var(--bg); box-shadow: var(--popover-shadow); font-family: var(--font-ui); overflow: auto;
}
.composer-expanded-dialog::backdrop { background: var(--overlay-bg); }
body.enterprise-shell .composer-expanded-dialog .composer-dock-owner { display: flex; flex-direction: column; width: 100%; height: 100%; max-width: none; min-height: 0; margin: 0; }
.composer-expanded-dialog .attachments-preview { flex-shrink: 0; }
body.enterprise-shell .composer-expanded-dialog :is(.input-shell, .welcome-input-shell) {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto; grid-template-rows: minmax(80px, 1fr) auto;
  flex: 1; min-height: 150px; align-items: end;
}
body.enterprise-shell .composer-expanded-dialog :is(.input-shell, .welcome-input-shell) > :is(textarea, .connector-rich-composer) {
  grid-column: 1 / -1; grid-row: 1; height: 100% !important; max-height: none !important; min-height: 0; overflow: auto; align-self: stretch;
}
body.enterprise-shell .composer-expanded-dialog .connector-rich-composer textarea.connector-rich-source { height: 100% !important; max-height: none !important; min-height: 0; align-self: stretch; }
.composer-expanded-dialog .add-btn-wrapper { grid-column: 1; grid-row: 2; }
.composer-expanded-dialog .composer-inline-tools { grid-column: 2; grid-row: 2; }
.composer-expanded-dialog .reasoning-mode-wrapper { grid-column: 3; grid-row: 2; justify-self: end; }
.composer-expanded-dialog .realtime-camera-btn { grid-column: 4; grid-row: 2; }
.composer-expanded-dialog .mic-btn { grid-column: 5; grid-row: 2; }
.composer-expanded-dialog .mic-btn[data-cowork-live-voice] { grid-column: 4; }
.cowork-live-presence:not([hidden]) {
  --cowork-live-level: 0;
  --cowork-live-size: clamp(48px, 7vw, 64px);
  position: relative;
  display: grid;
  place-items: center;
  inline-size: var(--cowork-live-size);
  block-size: var(--cowork-live-size);
  margin: 4px auto 18px;
  flex-shrink: 0;
}
.cowork-live-sphere {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}
.cowork-live-sphere:not([data-rendered]) {
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 24% 66%, #52c4fb, transparent 50%),
    radial-gradient(ellipse at 67% 22%, #876fff, transparent 58%),
    #18245e;
}
.cowork-live-presence[data-state="starting"] .cowork-live-sphere { opacity: .68; }
.cowork-live-presence:is([data-state="muted"], [data-state="ending"]) .cowork-live-sphere {
  opacity: .75;
  filter: saturate(.2);
}
.cowork-live-status {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .cowork-live-sphere { transform: scale(calc(1 + var(--cowork-live-level) * .08)); }
}
.mic-btn[data-cowork-live-voice] {
  background: var(--action-primary);
  color: var(--action-primary-text);
}
.mic-btn[data-cowork-live-mic] img.mic-icon { filter: none; }
html[data-theme="light"] .mic-btn[data-cowork-live-mic] img.mic-icon { filter: brightness(0); }
.mic-btn[data-cowork-live-mic][data-voice-state="active"]:not(.muted) { background: var(--surface-hover); }
.mic-btn[data-cowork-live-voice]:hover {
  background: var(--action-primary-hover);
}
.mic-btn[data-cowork-live-voice] .cowork-live-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mic-btn[data-cowork-live-voice] .cowork-live-hangup {
  display: none;
}
html[data-theme="light"] [data-cowork-live-voice] {
  --cowork-hangup-bg: #a02c46;
  --cowork-hangup-hover: #85213a;
  --cowork-hangup-ink: #ffffff;
}
.mic-btn[data-cowork-live-voice][data-voice-state="active"] {
  position: relative;
  background: var(--cowork-hangup-bg, #f3a3ae);
  color: var(--cowork-hangup-ink, #35121c);
}
.mic-btn[data-cowork-live-voice][data-voice-state="active"]:hover {
  background: var(--cowork-hangup-hover, #f8b9c4);
}
[data-cowork-live-voice]:is([data-voice-state="starting"], [data-voice-state="active"], [data-voice-state="ending"]) .cowork-live-icon {
  display: none;
}
[data-cowork-live-voice][data-voice-state="active"] .cowork-live-hangup {
  display: block;
}
[data-cowork-live-voice]:is([data-voice-state="starting"], [data-voice-state="ending"])::before {
  content: "";
  inline-size: 14px;
  block-size: 14px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  [data-cowork-live-voice]:is([data-voice-state="starting"], [data-voice-state="ending"])::before {
    animation: spin .8s linear infinite;
  }
  [data-cowork-live-voice][data-voice-state="active"]::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 1px solid var(--cowork-hangup-bg, #f3a3ae);
    border-radius: 50%;
    pointer-events: none;
    animation: cowork-live-call-pulse 2.8s ease-out infinite;
  }
}
@keyframes cowork-live-call-pulse {
  0% { opacity: .38; transform: scale(.97); }
  75%, 100% { opacity: 0; transform: scale(1.10); }
}
.composer-expanded-dialog .send-btn { grid-column: 6; grid-row: 2; }
.composer-expanded-dialog .composer-dock-band { flex-shrink: 0; }
body.composer-dialog-open { overflow: hidden; }
@container (max-width: 520px) {
  body.enterprise-shell .composer-expanded-dialog :is(.input-shell, .welcome-input-shell):has(.composer-inline-tools:not([hidden])) { grid-template-rows: minmax(80px, 1fr) auto auto; }
  .composer-expanded-dialog .composer-inline-tools { grid-column: 2 / -1; }
  .composer-expanded-dialog :is(.input-shell, .welcome-input-shell):has(.composer-inline-tools:not([hidden])) > :is(.reasoning-mode-wrapper, .realtime-camera-btn, .mic-btn, .send-btn) { grid-row: 3; }
  .composer-expanded-dialog :is(.input-shell, .welcome-input-shell):has(.composer-inline-tools:not([hidden])) > .reasoning-mode-wrapper { grid-column: 2 / 4; }
}

@media (max-width: 600px) {
  .composer-dock-band { margin-inline: 8px; padding-inline: 0; justify-content: space-around; gap: 0; }
  .composer-assistant-slot, .composer-project-slot, .composer-model-slot { flex: 1 1 44px; justify-content: center; }
  body.enterprise-shell .composer-dock-band .composer-dock-control { width: 44px; min-height: 44px; height: 44px; padding: 10px; }
  .composer-dock-band :is(.model-selector-summary, .assistant-dropdown-text, .assistant-dropdown-chevron, .composer-project-button > span),
  .composer-dock-band .composer-model-button > svg { display: none; }
  body.enterprise-shell .composer-dock-band .composer-model-button > .composer-control-icon { display: inline-flex; }
  .composer-tools-slot { flex: 3 1 132px; justify-content: space-around; }
  .composer-dock-owner .reasoning-mode-btn { font-size: 14px; padding-inline: 8px; }
  .composer-expanded-dialog { top: var(--composer-viewport-top, 0px); width: 100%; height: var(--composer-viewport-height, 100dvh); border-radius: 0; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
  .composer-dock-menu-row, .aira-anchored-popover .model-option, .aira-anchored-popover .model-publisher-heading { min-height: 44px; }
  body.enterprise-shell .sidebar-mode-option { font-size: 0; gap: 0; }
  body.enterprise-shell .sidebar-mode-option svg { display: block; width: 20px; height: 20px; }
}
@container (max-width: 290px) {
  .composer-tools-slot { flex: 1 0 44px; justify-content: center; }
  body.enterprise-shell .composer-tools-slot .composer-tool-button:not([data-composer-tool="web"]) { display: none; }
  body.enterprise-shell .composer-tools-more { display: inline-flex; flex: 1 0 44px; }
}
@media (pointer: coarse) {
  body.enterprise-shell .composer-dock-control { min-height: 44px; }
  body.enterprise-shell .composer-tool-button { width: 44px; flex-basis: 44px; }
  body.enterprise-shell .composer-expand-button { width: 44px; height: 44px; top: 0; right: 6px; }
  body.enterprise-shell .composer-dock-owner :is(.input-shell, .welcome-input-shell) { padding-top: 44px; }
}
.monthly-budget-button { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; }
.monthly-budget-button:hover { background: var(--surface-hover); }
.monthly-budget-ring { grid-area: 1 / 1; display: block; width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(currentColor var(--monthly-remaining, 0%), color-mix(in srgb, currentColor 20%, transparent) 0); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 2px)); }
.monthly-budget-diamond { grid-area: 1 / 1; width: 8px; height: 8px; border-radius: 1px; background: currentColor; opacity: .65; transform: rotate(45deg); }
.monthly-budget-button:is([data-state="loading"], [data-state="unavailable"], [data-state="unlimited"]) .monthly-budget-ring { background: color-mix(in srgb, currentColor 25%, transparent); }
.monthly-budget-button[data-state="exhausted"] { color: var(--status-warning); }
.enterprise-rail-bottom .monthly-budget-button { color: var(--rail-text); }
.enterprise-rail-bottom .monthly-budget-button:hover { background: var(--rail-hover); }
.monthly-budget-panel :is(p, small) { margin: 4px 0; color: var(--muted); font: 400 13px/20px var(--font-ui); }
