/* Chat is a self-contained workspace; other account pages keep their own layout. */
/* Work mode tabs: chat / image / video / doc */
.work-mode-tabs { display: flex; gap: 6px; padding: 10px 16px 0; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; }
.work-mode-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: none; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.work-mode-tab:hover { color: var(--text); }
.work-mode-tab.active { color: var(--primary, #2563eb); border-bottom-color: var(--primary, #2563eb); }
.work-mode-tab:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: -2px; border-radius: 6px; }
.work-mode-placeholder { margin: 18px 16px; display: flex; align-items: center; justify-content: center; }
.work-mode-placeholder .chat-start { padding: 32px 20px; }
.work-mode-placeholder .notice { margin: 14px 0; max-width: 520px; text-align: left; }
.work-mode-embedded { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 32px; }
.work-mode-embedded .page-head { margin-top: 0; }
.chat-shell { height: 100vh; height: var(--chat-viewport-height, 100dvh); display: flex; flex-direction: column; background: var(--surface); overflow: hidden; }
.chat-app-header { height: 68px; flex: 0 0 68px; padding: 0 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat-app-header .brand { font-size: 21px; gap: 8px; }
.chat-app-header .brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 4px #0b1e4b26; }
.chat-header-divider { height: 22px; border-left: 1px solid var(--border); margin-inline: 6px; }
.chat-header-label { color: var(--muted); font-size: 13px; }
.chat-header-actions { display: flex; align-items: center; gap: 12px; }
/* Credit balance pill in the workspace header: links to /billing, turns warn
   colored when the balance is zero so "top up to chat" is obvious. */
.credit-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--card); white-space: nowrap; }
.credit-pill:hover { border-color: var(--accent, var(--text)); }
.credit-pill .credit-amount { font-variant-numeric: tabular-nums; }
.credit-pill.low { color: var(--warn, #b45309); border-color: currentColor; }
.credit-pill svg { flex: 0 0 auto; }
.chat-header-actions .btn { font-size: 12px; color: var(--muted); }
.chat-main, .chat-page { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.chat-page > .notice { flex: 0 0 auto; margin: 10px 16px 0; max-height: 24dvh; overflow: auto; }
.chat-workspace { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 0; flex: 1; min-height: 0; min-width: 0; }
.chat-shell [hidden] { display: none !important; }
.chat-workspace :is(button, select, textarea):disabled { cursor: not-allowed; }
.chat-shell :is(button, input, select, textarea, summary, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.chat-shell .icon-button { min-width: 40px; width: 40px; height: 40px; }
.chat-workspace .thread-panel { position: static; display: flex; flex-direction: column; min-height: 0; max-height: none; padding: 24px 12px 12px; background: var(--soft); border-right: 1px solid var(--border); }
.chat-history-heading { display: flex; justify-content: space-between; align-items: center; min-height: 28px; margin: 0 12px 18px; }
.chat-history-heading h2 { font-size: 13px; font-weight: 600; }
.chat-new-button { margin: 0 4px 16px; justify-content: flex-start; min-height: 44px; background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow); }
.chat-new-button:hover { border-color: var(--accent); color: var(--accent); }
.chat-thread-search { position: relative; margin: 0 4px 22px; }
.chat-thread-search > svg { position: absolute; left: 12px; top: 14px; color: var(--muted); pointer-events: none; }
.chat-thread-search input { padding: 11px 12px 11px 36px; min-height: 44px; font-size: 12px; background: transparent; border-color: var(--border); }
.chat-projects { margin: 0 4px 14px; }
.chat-projects-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 6px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.chat-projects-heading .icon-button { min-width: 26px; width: 26px; height: 26px; }
.chat-project-add-empty { width: calc(100% - 8px); margin: 0 4px 16px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; border: 1px dashed var(--border); border-radius: 10px; background: transparent; color: var(--muted); }
.chat-project-add-empty:hover { color: var(--text); border-color: var(--accent); }
.project-item { border-radius: 10px; margin-bottom: 2px; }
.project-item:hover { background: var(--surface); }
.project-item.active { background: var(--accent-soft); }
.project-select { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; color: var(--text); text-align: left; }
.project-select > svg { color: var(--muted); flex-shrink: 0; }
.project-item.active .project-select { color: var(--accent); }
.chat-project-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; border: 0; cursor: pointer; }
.chat-project-badge:hover { filter: brightness(0.97); }
.chat-asset-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; max-width: 200px; }
.chat-asset-chip > svg { color: var(--muted); }
.chat-asset-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--soft); }
.chat-asset-kind-icon { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.chat-asset-kind-icon.kind-audio { background: #fce7f3; color: #be185d; }
.chat-asset-kind-icon.kind-video { background: #ede9fe; color: #6d28d9; }
.chat-asset-kind-icon.kind-pdf, .chat-asset-kind-icon.kind-text { background: #dbeafe; color: #1d4ed8; }
.chat-asset-kind-icon.kind-sheet, .chat-asset-kind-icon.kind-other { background: #fef3c7; color: #b45309; }
:root[data-theme=dark] .chat-asset-kind-icon.kind-audio { background: #4a1d33; color: #f9a8d4; }
:root[data-theme=dark] .chat-asset-kind-icon.kind-video { background: #2e2165; color: #c4b5fd; }
:root[data-theme=dark] .chat-asset-kind-icon.kind-pdf, :root[data-theme=dark] .chat-asset-kind-icon.kind-text { background: #1e3a6e; color: #93c5fd; }
:root[data-theme=dark] .chat-asset-kind-icon.kind-sheet, :root[data-theme=dark] .chat-asset-kind-icon.kind-other { background: #443209; color: #fcd34d; }
.chat-asset-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.asset-picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin: 12px 0; }
.asset-picker-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.asset-picker-filters select { max-width: 220px; width: auto; min-height: 34px; padding: 6px 10px; font-size: 12.5px; }
.asset-picker-filters .library-filter-chips { flex: 1 1 auto; }
.asset-picker-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 9px; font-size: 12.5px; color: var(--text); }
.asset-picker-item:hover { background: var(--surface); }
.asset-picker-item.selected { background: var(--accent-soft); color: var(--accent); }
.asset-picker-item .asset-picker-icon { color: var(--muted); flex-shrink: 0; display: inline-flex; }
.asset-picker-item.selected .asset-picker-icon { color: var(--accent); }
.asset-picker-main { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.asset-picker-main > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-picker-item > small { margin-left: auto; flex-shrink: 0; text-transform: uppercase; font-size: 10.5px; letter-spacing: .4px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.asset-picker-item.selected > small { color: var(--accent); border-color: var(--accent); }
.asset-picker-check { flex-shrink: 0; display: inline-flex; color: var(--accent); }
.asset-picker-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--soft); }
.asset-picker-play { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border); background: var(--soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0 0 0 2px; }
.asset-picker-play:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-workspace .thread-list { display: block; flex: 1; min-height: 0; overflow-y: auto; padding: 0 2px; scrollbar-width: thin; }
.chat-workspace .thread-item { display: flex; min-width: 0; max-width: none; min-height: 64px; border-radius: 10px; margin-bottom: 4px; align-items: center; }
.chat-workspace .thread-item:hover { background: var(--surface); }
.chat-workspace .thread-item.active { background: var(--accent-soft); box-shadow: none; }
.chat-workspace .thread-select { padding: 12px 10px; min-height: 64px; gap: 9px; align-items: flex-start; font-size: 12px; }
.chat-workspace .thread-select > span:first-child { color: var(--muted); padding-top: 2px; }
.chat-workspace .thread-item.active .thread-select { color: var(--accent); }
.chat-workspace .thread-select small { color: var(--muted); font-size: 10px; margin-top: 5px; }
.chat-workspace .thread-item .icon-button { min-width: 36px; width: 36px; height: 40px; margin-right: 2px; }
.chat-workspace .thread-empty { padding: 18px 12px; font-size: 12px; line-height: 1.8; }
.chat-history-footer { margin: 16px 8px 0; padding: 16px 4px 4px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-history-footer a { color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 32px; }
.chat-history-footer a:hover { color: var(--accent); }
.chat-history-toggle, .chat-history-close, .chat-quick-new { display: none !important; }
.chat-workspace .live-chat-panel { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; background: var(--surface); }
.chat-conversation-bar { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 65px; padding: 10px 28px; border-bottom: 1px solid var(--border); }
.chat-conversation-bar h2 { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tools { position: relative; }
.chat-tools > summary { list-style: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.chat-tools > summary::-webkit-details-marker { display: none; }
.chat-tools > summary:hover, .chat-tools[open] > summary { background: var(--soft); color: var(--text); }
.chat-tools-menu { position: absolute; right: 0; top: 48px; z-index: 15; width: min(320px, calc(100vw - 32px)); max-height: calc(100dvh - 160px); overflow: auto; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 48px #08152c1c; }
.chat-tools-menu > strong { display: block; font-size: 14px; margin-bottom: 20px; }
.chat-tools-menu .field { margin-bottom: 16px; }
.chat-tools-menu label { font-size: 12px; color: var(--muted); }
.chat-tools-menu select { font-size: 13px; min-height: 44px; }
.chat-export { border-block: 1px solid var(--border); padding-block: 8px; display: grid; margin-block: 4px 14px; }
.chat-export .btn { justify-content: flex-start; padding-inline: 8px; font-size: 12px; min-height: 44px; }
.chat-tools-menu p { font-size: 11px; line-height: 1.9; }
.chat-workspace .live-messages { min-height: 0; max-height: none; flex: 1 1 0; padding: 32px max(28px, calc((100% - 820px) / 2)); gap: 32px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
.chat-workspace .message { flex: 0 0 auto; min-width: 0; white-space: normal; display: flex; gap: 12px; border: 0; border-radius: 0; }
.chat-workspace .message.user { align-self: flex-end; width: fit-content; max-width: 80%; padding: 12px 18px; background: var(--accent-soft); color: var(--text); border-radius: 18px 18px 5px 18px; }
.chat-workspace .message.assistant { align-self: stretch; width: 100%; max-width: 100%; padding: 0; background: transparent; }
.chat-avatar { flex: 0 0 30px; height: 30px; margin-top: 2px; border: 1px solid var(--border); border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.message-body { flex: 1; min-width: 0; }
.chat-message-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.chat-workspace .author { margin: 0; font-size: 12px; color: var(--text); font-weight: 600; letter-spacing: 0; }
.author-model { margin-left: 10px; color: var(--muted); font-size: 11px; font-weight: 400; overflow-wrap: anywhere; }
.chat-copy { min-height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 8px; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 7px; font-size: 11px; }
.chat-copy:hover { background: var(--soft); color: var(--accent); border-color: var(--border); }
.chat-workspace .chat-markdown { white-space: normal; overflow-wrap: anywhere; font-size: 15px; line-height: 1.85; min-width: 0; }
.chat-workspace .chat-markdown :is(p, li, td, th, blockquote) { color: var(--text); }
.chat-markdown > :first-child { margin-top: 0; }
.chat-markdown > :last-child { margin-bottom: 0; }
.chat-markdown p { margin: 0 0 14px; }
.chat-markdown strong { font-weight: 650; }
.chat-markdown :is(h2, h3, h4, h5, h6) { margin: 24px 0 12px; color: var(--text); line-height: 1.5; font-weight: 650; }
.chat-markdown h2 { font-size: 21px; }
.chat-markdown h3 { font-size: 18px; }
.chat-markdown :is(h4, h5, h6) { font-size: 16px; }
.chat-markdown :is(ul, ol) { margin: 12px 0 18px; padding-left: 24px; }
.chat-markdown li { margin: 6px 0; padding-left: 3px; }
.chat-markdown hr { margin: 24px 0; }
.chat-markdown a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.chat-markdown :not(pre) > code { color: var(--text); background: var(--soft); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; font-family: ui-monospace, Consolas, monospace; font-size: .9em; white-space: break-spaces; }
.chat-code-block { min-width: 0; margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--soft); }
.chat-code-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.chat-code-header > span { min-width: 0; overflow-wrap: anywhere; }
.chat-code-block pre { margin: 0; padding: 16px; max-width: 100%; overflow: auto; white-space: pre; overflow-wrap: normal; color: #e7edf7; background: var(--code); line-height: 1.7; tab-size: 2; }
.chat-code-block pre code { color: inherit; background: transparent; padding: 0; border: 0; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
.chat-workspace .is-empty { justify-content: center; align-items: center; }
.chat-workspace .chat-start { width: 100%; margin: auto; padding: 24px 0; text-align: center; }
.chat-welcome-mark { width: 60px; height: 60px; margin: 0 auto 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.chat-welcome-eyebrow { display: block; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.chat-workspace .chat-greeting { font-size: clamp(28px, 3.3vw, 42px); font-weight: 650; line-height: 1.45; letter-spacing: -.8px; color: var(--text); margin: 0; }
.chat-greeting-accent { color: var(--accent); margin-left: 4px; }
.chat-workspace .chat-start p { color: var(--muted); font-size: 14px; line-height: 1.8; margin-top: 12px; }
.chat-workspace .chat-suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chat-workspace .chat-suggestions button { min-height: 44px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 12px; transition: background .15s, border-color .15s; }
.chat-workspace .chat-suggestions button:hover:not(:disabled) { background: var(--soft); border-color: var(--accent); }
.message.is-pending .typing { display: flex; align-items: center; gap: 5px; padding: 8px 0; }
.message.is-pending .dot { width: 6px; height: 6px; background: var(--accent); animation: typing-pulse 1.2s infinite ease-in-out; }
.message.is-pending .dot:nth-child(2) { animation-delay: .18s; }
.message.is-pending .dot:nth-child(3) { animation-delay: .36s; }
.typing-label { margin-left: 8px; color: var(--muted); font-size: 12px; }
.chat-stream-status { color: var(--muted); font-size: 10px; font-weight: 400; text-align: right; }
.message.is-incomplete .chat-stream-status { color: var(--warn); }
.message.is-pending:not(.is-settling) .message-text:not(:empty)::after { content: ''; display: inline-block; width: 5px; height: 14px; margin-left: 4px; background: var(--accent); border-radius: 2px; animation: typing-pulse 1.2s infinite; }@keyframes typing-pulse { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
.chat-workspace .chat-composer { position: relative; flex: 0 0 auto; z-index: 2; border: 0; padding: 12px max(28px, calc((100% - 820px) / 2)) 16px; background: var(--surface); }
.chat-input-shell { padding: 14px 14px 10px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 4px 24px #08152c07; transition: border-color .15s, box-shadow .15s; }
.chat-input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-workspace .chat-composer textarea { display: block; width: 100%; min-height: 48px; max-height: 160px; padding: 3px 5px 12px; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); line-height: 1.7; font-size: 16px; resize: none; box-shadow: none; }
.chat-workspace .chat-composer textarea:focus-visible { outline: 0; }
.chat-composer textarea::placeholder { color: var(--muted); opacity: .9; }
.chat-composer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-composer-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Attach-image button matches the model pill's quiet style. */
.chat-attach-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: color .12s, border-color .12s, box-shadow .12s; }
.chat-attach-button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
/* Attached-image previews above the input. */
.chat-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 10px; }
.chat-attachment { position: relative; margin: 0; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--soft); }
.chat-attachment img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-attachment-remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(13, 20, 33, .72); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-attachment-remove:hover { background: rgba(13, 20, 33, .9); }
/* Images inside sent user messages. */
.chat-workspace .message.user .message-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-workspace .message.user .message-images img { max-width: 180px; max-height: 140px; border-radius: 10px; display: block; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
/* Vision badge in the model menu. */
.chat-vision-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.chat-model-switch { min-width: 0; }
.chat-model-pill { display: flex; align-items: center; gap: 7px; min-height: 40px; max-width: 360px; padding: 8px 10px; border: 0; border-radius: 9px; background: var(--soft); color: var(--text); font-size: 12px; font-weight: 500; }
.chat-model-pill > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-model-pill > svg { flex-shrink: 0; color: var(--muted); }
.chat-model-pill:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.chat-send-circle { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: #2563eb; color: #fff; transition: background .15s; }
.chat-send-circle > svg { transform: rotate(-90deg); }
.chat-composer[aria-busy="true"] .chat-send-circle > svg { transform: none; }
.chat-send-circle:hover:not(:disabled) { background: #1e55d2; }
.chat-send-circle:disabled { background: var(--soft); color: var(--muted); opacity: 1; }
.chat-composer-meta { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 4px 0; color: var(--muted); }
.chat-composer-meta .chat-price, .chat-composer-meta small { font-size: 10px; }
#chat-send-notice { display: block; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.7; margin: 8px 0 0; }
.chat-composer #chat-error { max-height: 100px; overflow: auto; font-size: 12px; line-height: 1.8; }
.chat-composer #chat-error:empty { display: none; }
.chat-model-menu { position: fixed; z-index: 40; width: min(360px, calc(100vw - 32px)); max-height: 430px; display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 16px 48px #08152c26; }
.chat-model-menu input { flex: 0 0 auto; min-width: 0; min-height: 44px; background: var(--soft); font-size: 16px; margin-bottom: 8px; }
#chat-model-search-status { color: var(--muted); font-size: 11px; padding: 0 8px; }
.chat-model-filters { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 8px 9px; }
.chat-model-filter { border: 1px solid var(--border); background: var(--soft); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; min-height: 27px; }
.chat-model-filter:hover { border-color: var(--accent); color: var(--text); }
.chat-model-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-model-list .chat-model-filters { position: sticky; top: -2px; z-index: 1; background: var(--surface); padding-top: 2px; margin: 0; }
.chat-model-list { overflow-y: auto; display: grid; gap: 2px; min-height: 0; padding: 2px; }
.chat-model-group { display: grid; gap: 2px; }
.chat-model-group + .chat-model-group { margin-top: 12px; }
.chat-model-group-label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; color: var(--muted); font-size: 11px; }
.chat-badge { font-weight: 600; color: var(--text); }
.chat-model-group-count { font-size: 10px; }
.chat-model-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 9px 12px; background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--text); text-align: left; font-size: 13px; }
.chat-model-option:hover { background: var(--soft); }
.chat-model-option.active { background: var(--accent-soft); border-color: var(--border); }
.chat-model-option > svg { flex-shrink: 0; color: var(--accent); }
.chat-model-option-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.chat-model-option-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-model-option small { color: var(--muted); font-size: 11px; }
.chat-model-empty { padding: 18px 12px; color: var(--muted); text-align: center; font-size: 12px; }
/* Status messages stay away from the input and send button. */
body:has(.chat-shell) #toast { top: 76px; bottom: auto; right: 16px; max-width: min(380px, calc(100vw - 32px)); }
@media (hover: hover) and (pointer: fine) {
  .thread-item:not(:hover):not(:focus-within):not(.active) [data-chat-action="delete"], .thread-item:not(:hover):not(:focus-within):not(.active) [data-chat-action="archive-chat"] { opacity: 0; }
  .thread-item:not(:hover):not(:focus-within):not(.active) .chat-pin:not(.pinned) { opacity: 0; }
}
.chat-pin { color: var(--muted); }
.chat-pin:hover { color: var(--text); }
.chat-pin.pinned { color: var(--accent); opacity: 1; }
@media (max-width: 1000px) {
  .chat-workspace { grid-template-columns: minmax(0, 1fr); }
  .chat-history-toggle, .chat-history-close, .chat-quick-new { display: grid !important; }
  .chat-workspace .thread-panel { position: fixed; inset: 0 auto 0 0; width: min(300px, calc(100vw - 48px)); height: 100dvh; z-index: 60; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; background: var(--surface); padding-top: 20px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .chat-workspace .thread-panel.is-open { transform: translateX(0); visibility: visible; }
  .chat-history-backdrop { display: block; position: fixed; inset: 0; background: #08152c66; z-index: 55; }
  .chat-history-heading { margin-bottom: 20px; }
  .chat-conversation-bar { padding-inline: 20px; }
}
@media (max-width: 600px) {
  .chat-app-header { height: 60px; flex-basis: 60px; padding-inline: 16px; }
  .chat-app-header .brand { font-size: 20px; }
  .chat-header-label, .chat-header-divider { display: none; }
  .chat-header-actions { gap: 4px; }
  .chat-header-actions .btn { width: 40px; min-height: 40px; padding: 0; }
  .chat-header-actions .btn span { display: none; }
  .chat-header-actions .profile-trigger { padding: 4px; }
  .credit-pill { padding: 8px 10px; min-height: 40px; gap: 4px; font-size: 12px; }
  .chat-conversation-bar { min-height: 56px; padding: 6px 12px; gap: 4px; }
  .chat-conversation-bar h2 { padding-inline: 6px; font-size: 12px; }
  .chat-workspace .live-messages { padding: 24px 16px; gap: 26px; }
  .chat-workspace .message { gap: 8px; }
  .chat-workspace .message.user { max-width: 88%; padding: 10px 14px; }
  .chat-avatar { flex-basis: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
  .chat-workspace .chat-markdown { font-size: 14px; }
  .chat-workspace .author { font-size: 11px; }
  .author-model { display: block; margin-left: 0; margin-top: 2px; font-size: 10px; }
  .chat-copy { min-height: 40px; }
  .chat-message-header { align-items: flex-start; gap: 6px; }
  .chat-workspace .chat-composer { padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
  .chat-input-shell { border-radius: 18px; padding: 12px 10px 8px; }
  .chat-model-pill { max-width: calc(100vw - 116px); min-height: 40px; font-size: 11px; }
  .chat-send-circle { width: 44px; height: 44px; flex-basis: 44px; }
  .chat-workspace .chat-greeting { font-size: clamp(25px, 6vw, 34px); }
  .chat-workspace .chat-start p { font-size: 12px; }
  .chat-workspace .chat-suggestions { gap: 8px; margin-top: 22px; }
  .chat-workspace .chat-suggestions button { font-size: 11px; padding-inline: 12px; }
  .chat-welcome-mark { width: 48px; height: 48px; border-radius: 16px; margin-bottom: 18px; }
  .chat-tools-menu { right: -4px; }
  .chat-composer-meta { padding-top: 8px; }
  #chat-keyboard-hint { display: none; }
  #chat-send-notice { font-size: 9px; text-wrap: pretty; }
}
@media (pointer: coarse) { #chat-keyboard-hint { display: none; } }
/* Phones: tighten the embedded design tabs' (image/video/audio) outer padding —
   must live here because chat.css loads after styles.css and would win the tie. */
@media (max-width: 480px) { .work-mode-embedded { padding: 12px 10px 24px; } }
@media (max-height: 500px) {
  .chat-app-header { height: 48px; flex-basis: 48px; }
  .chat-conversation-bar { min-height: 44px; padding-block: 2px; }
  .chat-welcome-mark, .chat-welcome-eyebrow { display: none; }
  .chat-workspace .chat-composer { padding-top: 4px; padding-bottom: 6px; }
  .chat-workspace .chat-composer textarea { max-height: 72px; }
  #chat-send-notice { display: none; }
  .chat-tools-menu { max-height: calc(100dvh - 110px); }
}
/* Calm, task-first workspace. Tokens remain shared with the account theme. */
.chat-shell { --work-sidebar: #f7f8fb; --work-line: #e8ecf3; --work-blue: #285deb; --work-canvas: #fff; --work-shadow: 0 8px 32px #162a4d08; }
:root[data-theme=dark] .chat-shell { --work-sidebar: #111b2b; --work-line: #28354a; --work-blue: #9bb9ff; --work-canvas: #151f30; --work-shadow: 0 8px 32px #0002; }
.chat-shell { background: var(--work-canvas); }
.chat-shell .chat-app-header { height: 68px; flex-basis: 68px; padding: 0 25px; background: var(--work-canvas); border-color: var(--work-line); }
.chat-app-header .brand { gap: 0; font-size: 23px; letter-spacing: -.8px; }
.chat-app-header .brand img { width: 35px; height: 35px; margin-right: 8px; box-shadow: none; }
.chat-header-label { font-size: 12px; }
.chat-header-actions { gap: 10px; }
.chat-header-actions .credit-pill { font-size: 12px; padding: 7px 11px; border-radius: 9px; background: var(--soft); border-color: var(--work-line); }
.chat-header-actions .credit-pill.low { color: var(--warn); }
.chat-header-actions .avatar { width: 32px; height: 32px; font-size: 12px; }
.work-mode-tabs { flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; min-height: 65px; padding: 9px 25px; overflow: visible; border-color: var(--work-line); background: var(--work-canvas); }
.work-mode-caption { width: 220px; flex-shrink: 0; font-size: 11px; color: var(--muted); letter-spacing: .2px; }
.work-mode-options { display: flex; align-items: center; gap: 5px; margin-inline: auto; padding: 4px; border: 1px solid var(--work-line); border-radius: 12px; background: var(--soft); }
.work-mode-tab { gap: 8px; min-height: 38px; padding: 8px 20px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 550; line-height: 1.5; }
.work-mode-tab.active { color: var(--work-blue); background: var(--surface); border-color: var(--work-line); box-shadow: 0 2px 5px #162a4d04; }
.work-mode-tab:hover:not(.active) { color: var(--work-blue); background: var(--accent-soft); }
.work-mode-tab:focus-visible { outline-color: var(--work-blue); outline-offset: 2px; }
.work-connection-notice { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; font-size: 12px; color: var(--warn); background: var(--warn-bg); border-bottom: 1px solid var(--work-line); }
.work-connection-notice svg { flex-shrink: 0; }
.chat-page-conversation .chat-workspace { grid-template-columns: 264px minmax(0, 1fr); }
.chat-workspace .thread-panel { background: var(--work-sidebar); border-color: var(--work-line); padding: 23px 12px 12px; }
.chat-history-heading { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0 12px 17px; }
.chat-sidebar-label { display: block; width: 100%; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1.6px; }
.chat-history-heading h2 { font-size: 15px; font-weight: 650; }
.chat-history-heading .chat-history-close { position: absolute; right: -6px; top: 0; }
.chat-workspace .chat-new-button { background: var(--surface); border: 1px solid var(--work-line); box-shadow: 0 2px 4px #162a4d03; color: var(--text); font-size: 13px; border-radius: 10px; margin-bottom: 12px; min-height: 44px; }
.chat-new-button svg { color: var(--work-blue); }
.chat-thread-search { margin-bottom: 21px; }
.chat-thread-search input { background: var(--surface); border-color: var(--work-line); border-radius: 9px; font-size: 12px; }
.chat-projects { max-height: min(26dvh, 240px); flex-shrink: 1; overflow: auto; scrollbar-width: thin; margin-bottom: 12px; }
.chat-projects-heading { font-size: 11px; letter-spacing: 0; padding-bottom: 6px; }
.chat-projects-heading .icon-button { min-width: 34px; width: 34px; height: 34px; }
.project-select { min-height: 40px; font-size: 12px; background: transparent; border-radius: 8px; }
.project-select span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-project-add-empty { min-height: 40px; font-size: 11px; margin-block: 7px 3px; }
.chat-recent-label { margin: 0 12px 9px; font-size: 10px; color: var(--muted); }
.chat-workspace .thread-item { min-height: 59px; border-radius: 8px; align-items: flex-start; }
.chat-workspace .thread-select { min-height: 59px; padding: 10px 8px; align-items: flex-start; font-size: 12px; line-height: 1.6; }
.chat-workspace .thread-select > span:last-child { flex: 1; }
.chat-workspace .thread-select small { font-size: 9px; margin-top: 3px; }
/* Account-page details styles must not add padding to workspace controls. */
.chat-shell .chat-tools, .chat-shell .chat-thread-menu { border: 0; padding: 0; margin: 0; background: transparent; }
.chat-shell .chat-thread-menu { flex-shrink: 0; margin-top: 8px; }
.chat-thread-menu > summary { display: grid; place-items: center; list-style: none; width: 40px; height: 40px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.chat-thread-menu > summary::-webkit-details-marker { display: none; }
.chat-thread-menu > summary:hover, .chat-thread-menu[open] > summary { background: var(--surface); color: var(--work-blue); }
.chat-workspace .thread-item:has(.chat-thread-menu[open]) { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--work-line); }
.chat-thread-menu[open] { display: contents; }
.chat-thread-menu[open] > summary { margin-top: 8px; margin-right: 1px; }
.chat-thread-actions { display: grid; width: 100%; padding: 5px; gap: 2px; border-top: 1px solid var(--work-line); }
.chat-thread-action { display: flex; align-items: center; gap: 9px; min-height: 40px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; padding: 8px 10px; text-align: left; }
.chat-thread-action:hover { background: var(--soft); color: var(--text); }
.chat-thread-action.chat-thread-danger { color: #b84350; }
:root[data-theme=dark] .chat-thread-action.chat-thread-danger { color: #f59ba4; }
.chat-workspace .thread-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 27px 12px; text-align: center; }
.thread-empty > svg { color: var(--muted); opacity: .65; margin-bottom: 3px; }
.thread-empty strong { font-size: 12px; font-weight: 550; color: var(--text); }
.thread-empty span { font-size: 11px; line-height: 1.8; color: var(--muted); }
.chat-history-footer { margin-top: 12px; padding-top: 11px; }
.chat-history-footer a { font-size: 11px; min-height: 40px; }
.chat-workspace .live-chat-panel { background: var(--work-canvas); }
.chat-conversation-bar { min-height: 57px; padding: 7px 28px; border-bottom-color: transparent; gap: 9px; }
.chat-conversation-bar h2 { font-size: 12px; font-weight: 500; color: var(--text); }
.chat-tools > summary { border-radius: 9px; }
.chat-workspace .live-messages { padding: 20px max(28px, calc((100% - 800px) / 2)) 28px; gap: 28px; }
.chat-workspace .live-messages.is-empty { padding-top: 8px; padding-bottom: 8px; justify-content: flex-start; }
.chat-workspace .chat-start { max-width: 720px; padding: 22px 0 18px; flex: 0 0 auto; }
.chat-welcome-mark { width: 53px; height: 53px; border: 1px solid var(--work-line); border-radius: 17px; background: var(--surface); color: var(--work-blue); box-shadow: var(--work-shadow); margin-bottom: 18px; }
.chat-welcome-eyebrow { font-size: 11px; margin-bottom: 10px; }
.chat-workspace .chat-greeting { font-size: clamp(28px, 3.3vw, 43px); font-weight: 650; letter-spacing: -1px; line-height: 1.5; }
.chat-greeting-accent { color: var(--work-blue); }
.chat-workspace .chat-start > p { font-size: 13px; margin-top: 9px; }
.chat-workspace .chat-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 570px; margin: 27px auto 0; }
.chat-workspace .chat-suggestions button { display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; min-height: 79px; padding: 15px; background: var(--surface); border: 1px solid var(--work-line); border-radius: 12px; transition: background .15s, border-color .15s, box-shadow .15s; }
.chat-workspace .chat-suggestions button:hover:not(:disabled) { background: var(--soft); border-color: var(--work-blue); box-shadow: var(--work-shadow); }
.chat-suggestion-icon { width: 35px; height: 35px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; color: var(--work-blue); background: var(--accent-soft); }
.chat-suggestions button > span:nth-child(2) { min-width: 0; flex: 1; }
.chat-suggestions strong { display: block; font-size: 12px; font-weight: 550; }
.chat-suggestions small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.chat-suggestions button > svg { color: var(--muted); flex-shrink: 0; }
.chat-start-hint { display: block; font-size: 10px; color: var(--muted); margin-top: 16px; }
.chat-workspace .message.user { background: var(--soft); border: 1px solid var(--work-line); padding: 12px 17px; border-radius: 16px 16px 5px 16px; flex-direction: column; gap: 6px; }
.chat-workspace .chat-markdown { font-size: 15px; line-height: 1.95; }
.chat-avatar { background: var(--surface); color: var(--work-blue); border-color: var(--work-line); }
.chat-message-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chat-workspace .chat-composer { padding: 12px max(28px, calc((100% - 800px) / 2)) 15px; background: var(--work-canvas); }
.chat-input-shell { border: 1px solid #d9e1ef; border-radius: 17px; padding: 15px 14px 12px; box-shadow: var(--work-shadow); background: var(--surface); }
:root[data-theme=dark] .chat-input-shell { border-color: var(--work-line); }
.chat-input-shell:focus-within { border-color: var(--work-blue); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-workspace .chat-composer textarea { min-height: 53px; max-height: min(160px, 25dvh); padding: 2px 4px 13px; font-size: 16px; }
.chat-composer-toolbar { gap: 10px; align-items: flex-end; }
.chat-composer-left { flex: 1; min-width: 0; gap: 6px; }
.chat-attach-button { width: 38px; height: 40px; flex: 0 0 38px; border: 0; border-radius: 9px; background: transparent; }
.chat-attach-button:hover:not(:disabled) { background: var(--soft); box-shadow: none; }
.chat-model-switch { min-width: 0; max-width: min(360px, 100%); }
.chat-model-pill { max-width: 100%; min-height: 40px; padding: 8px 9px; font-size: 12px; gap: 6px; background: var(--soft); border: 1px solid var(--work-line); border-radius: 9px; }
.chat-send-circle { background: #285deb; border-radius: 10px; width: 42px; height: 42px; flex-basis: 42px; }
.chat-composer-meta { align-items: flex-start; gap: 4px 12px; padding: 9px 3px 0; }
.chat-composer-meta .chat-price { max-width: 100%; font-size: 10px; line-height: 1.8; overflow-wrap: anywhere; }
.chat-composer-meta small { font-size: 10px; line-height: 1.8; }
#chat-send-notice { font-size: 10px; line-height: 1.8; margin-top: 6px; }
.chat-scroll-latest { position: absolute; z-index: 3; left: 50%; bottom: calc(var(--composer-height, 195px) + 12px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 38px; background: var(--surface); color: var(--text); border: 1px solid var(--work-line); border-radius: 999px; box-shadow: 0 3px 15px #162a4d12; padding: 7px 13px; font-size: 11px; white-space: nowrap; }
.chat-scroll-latest:hover { border-color: var(--work-blue); color: var(--work-blue); }
.chat-model-menu { width: min(390px, calc(100vw - 24px)); border-radius: 14px; border-color: var(--work-line); }
.chat-model-filter { min-height: 34px; padding: 6px 12px; font-size: 11px; }
.chat-model-filter.active { background: var(--accent-soft); border-color: var(--work-blue); color: var(--work-blue); }
.chat-model-list .chat-model-filters { gap: 5px; padding-inline: 3px; }
.chat-model-option { min-height: 62px; padding: 10px; border-radius: 9px; }
.chat-model-option small { font-size: 10px; }
.chat-vision-badge { font-size: 9px; }
.chat-model-option-name { white-space: normal; overflow-wrap: anywhere; }
.work-mode-embedded { padding: 28px clamp(16px, 3vw, 48px) max(26px, env(safe-area-inset-bottom)); overscroll-behavior: contain; scrollbar-width: thin; }
.work-mode-embedded > :is(form, .design-stage, .library-page) { max-width: 1080px; margin-inline: auto; width: 100%; }
.work-mode-embedded .page-heading { max-width: 1080px; margin-inline: auto; margin-bottom: 22px; }
.work-mode-embedded .page-heading h1 { font-size: 26px; }
.work-mode-embedded .page-heading p { font-size: 12px; line-height: 1.8; }
.work-mode-embedded .design-stage { background: var(--soft); border-color: var(--work-line); border-radius: 17px; }
.work-mode-embedded .design-composer { border-color: var(--work-line); box-shadow: var(--work-shadow); }
@media (hover: hover) and (pointer: fine) {
  .chat-thread-actions .chat-pin, .chat-thread-actions [data-chat-action="archive-chat"], .chat-thread-actions [data-chat-action="delete"] { opacity: 1 !important; }
}
@media (max-width: 1100px) {
  .work-mode-caption { width: 210px; }
  .work-mode-tab { padding-inline: 15px; }
  .chat-workspace .chat-suggestions { gap: 9px; }
  .chat-workspace .chat-suggestions button { padding: 12px; gap: 9px; }
}
@media (max-width: 1000px) {
  .chat-page-conversation .chat-workspace { grid-template-columns: minmax(0, 1fr); }
  .work-mode-caption { width: auto; }
  .work-mode-options { margin-inline: 0; }
  .chat-workspace .thread-panel { padding-top: max(23px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--work-sidebar); }
  .chat-history-toggle, .chat-quick-new { border: 1px solid var(--work-line); border-radius: 8px; }
  .chat-history-toggle:hover, .chat-quick-new:hover { border-color: var(--work-blue); }
}
@media (max-width: 650px) {
  .chat-shell .chat-app-header { height: 59px; flex-basis: 59px; padding-inline: 16px; gap: 10px; }
  .chat-app-header .brand { font-size: 22px; }
  .chat-app-header .brand img { width: 31px; height: 31px; margin-right: 6px; }
  .chat-header-actions { gap: 3px; }
  .chat-header-actions .credit-pill { min-height: 36px; font-size: 11px; padding: 6px 8px; gap: 4px; }
  .chat-header-actions .btn { display: none; }
  .chat-header-actions .profile-trigger { min-width: 37px; min-height: 40px; display: grid; place-items: center; }
  .chat-header-actions .avatar { width: 29px; height: 29px; font-size: 11px; }
  .chat-header-divider, .chat-header-label { display: none; }
  .work-mode-tabs { min-height: 61px; justify-content: center; padding: 7px 12px; gap: 0; }
  .work-mode-caption { display: none; }
  .work-mode-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; gap: 3px; padding: 3px; border-radius: 10px; }
  .work-mode-tab { min-width: 0; min-height: 39px; padding: 7px 4px; gap: 5px; justify-content: center; font-size: 11px; border-radius: 7px; }
  .work-mode-tab svg { width: 15px; height: 15px; }
  .chat-conversation-bar { min-height: 53px; padding: 6px 13px; gap: 7px; }
  .chat-conversation-bar h2 { padding-inline: 2px; font-size: 12px; }
  .chat-shell .chat-conversation-bar .icon-button { min-width: 36px; width: 36px; height: 36px; }
  .chat-tools > summary { width: 36px; height: 36px; }
  .chat-project-badge { max-width: 34%; font-size: 10px; padding: 5px 7px; }
  .chat-workspace .live-messages { padding: 18px 16px 23px; gap: 25px; }
  .chat-workspace .chat-start { padding: 16px 0; }
  .chat-welcome-mark { width: 45px; height: 45px; margin-bottom: 15px; border-radius: 14px; }
  .chat-welcome-mark svg { width: 25px; }
  .chat-welcome-eyebrow { font-size: 10px; margin-bottom: 8px; }
  .chat-workspace .chat-greeting { font-size: clamp(26px, 6vw, 34px); letter-spacing: -.8px; }
  .chat-workspace .chat-start > p { font-size: 12px; line-height: 1.9; max-width: 320px; margin-inline: auto; }
  .chat-workspace .chat-suggestions { gap: 8px; margin-top: 23px; }
  .chat-workspace .chat-suggestions button { padding: 12px 10px; min-height: 74px; gap: 8px; }
  .chat-suggestion-icon { width: 29px; height: 29px; border-radius: 8px; }
  .chat-suggestion-icon svg { width: 16px; height: 16px; }
  .chat-suggestions strong { font-size: 11px; }
  .chat-suggestions small { font-size: 9px; line-height: 1.7; }
  .chat-suggestions button > svg { display: none; }
  .chat-start-hint { font-size: 9px; margin-top: 13px; }
  .chat-workspace .chat-composer { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
  .chat-input-shell { border-radius: 14px; padding: 12px 10px 9px; }
  .chat-workspace .chat-composer textarea { min-height: 49px; padding-bottom: 10px; }
  .chat-composer-toolbar { gap: 7px; }
  .chat-composer-left { gap: 3px; }
  .chat-attach-button { flex-basis: 34px; width: 34px; height: 42px; }
  .chat-model-switch { flex: 1; }
  .chat-model-pill { font-size: 11px; gap: 4px; padding: 8px 7px; min-height: 42px; }
  .chat-model-pill > svg:first-child { display: none; }
  .chat-send-circle { min-width: 42px; height: 42px; flex-basis: 42px; }
  .chat-composer-meta { padding-top: 7px; }
  .chat-composer-meta .chat-price { font-size: 10px; }
  #chat-send-notice { font-size: 9px; margin-top: 5px; line-height: 1.7; }
  .chat-workspace .chat-markdown { font-size: 14px; }
  .chat-message-header { flex-wrap: wrap; }
  .chat-message-actions { gap: 3px; }
  .chat-copy { font-size: 10px; min-height: 36px; }
  .chat-tools-menu { max-height: calc(var(--chat-viewport-height, 100dvh) - 190px); }
  .work-connection-notice { font-size: 10px; padding-block: 7px; align-items: flex-start; }
  .work-mode-embedded { padding: 20px 16px max(24px, env(safe-area-inset-bottom)); }
  .work-mode-embedded .page-heading h1 { font-size: 23px; }
  .work-mode-embedded .page-heading p { max-width: none; font-size: 11px; }
  .work-mode-embedded .design-stage { padding: 23px 13px; border-radius: 13px; }
  .work-mode-embedded .design-hero { font-size: 24px; }
}
@media (max-width: 380px) {
  .chat-shell .chat-app-header { padding-inline: 12px; gap: 6px; }
  .chat-app-header .brand { font-size: 20px; }
  .chat-app-header .brand img { width: 28px; height: 28px; margin-right: 4px; }
  .chat-header-actions .credit-pill { font-size: 10px; padding-inline: 6px; }
  .chat-header-actions .credit-pill > svg { width: 13px; }
  .chat-header-actions .icon-button { width: 34px; min-width: 34px; }
  .work-mode-tab { font-size: 10px; gap: 4px; }
  .work-mode-tab svg { width: 13px; }
  .chat-workspace .chat-suggestions button { padding-inline: 9px; }
  .chat-suggestion-icon { display: none; }
  .chat-workspace .chat-suggestions { gap: 7px; }
  .chat-suggestions strong { font-size: 11px; }
  .chat-suggestions small { font-size: 9px; }
}
@media (max-height: 740px) and (min-width: 651px) {
  .chat-workspace .chat-start { padding-block: 10px; }
  .chat-welcome-mark { margin-bottom: 12px; width: 43px; height: 43px; border-radius: 13px; }
  .chat-workspace .chat-greeting { font-size: 31px; }
  .chat-workspace .chat-suggestions { margin-top: 19px; }
  .chat-workspace .chat-suggestions button { min-height: 67px; padding: 11px; }
}
@media (max-height: 520px) {
  .chat-shell .chat-app-header { height: 47px; flex-basis: 47px; }
  .work-mode-tabs { min-height: 49px; padding-block: 4px; }
  .work-mode-tab { min-height: 31px; padding-block: 5px; }
  .chat-conversation-bar { min-height: 43px; padding-block: 2px; }
  .chat-workspace .live-messages { padding-block: 10px; }
  .chat-welcome-mark, .chat-welcome-eyebrow { display: none; }
  .chat-workspace .chat-greeting { font-size: 27px; }
  .chat-workspace .chat-start { padding-block: 8px; }
  .chat-workspace .chat-suggestions { margin-top: 15px; }
  .chat-workspace .chat-composer { padding-block: 5px; }
  .chat-workspace .chat-composer textarea { min-height: 37px; max-height: 60px; padding-bottom: 5px; }
  .chat-input-shell { padding-block: 8px; }
  .chat-composer-meta { padding-top: 5px; }
  .chat-tools-menu { max-height: calc(var(--chat-viewport-height, 100dvh) - 155px); }
  #chat-send-notice { display: none; }
}
@media (prefers-reduced-motion: reduce) { .chat-shell *, .chat-shell *::before { scroll-behavior: auto; transition: none; animation: none; } }
