:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--canvas);
  --text: #171c26;
  --muted: #5c687c;
  --border: #e1e7f0;
  --surface: #edf2f8;
  --accent: #2456bf;
  --accent-fill: #305fc9;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--panel));
  --action: var(--accent-fill);
  --on-action: #fff;
  --content: 760px;
  --sidebar: 250px;
  --canvas: #fcfdff;
  --sidebar-panel: #f4f7fb;
  --panel: #fff;
  --composer-border: #d8e1ee;
  --user-message: #ebf2fd;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
button, select, textarea, input { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled, select:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sidebar { height: 100dvh; padding: 14px 12px 8px; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; color: var(--text); background: var(--sidebar-panel); }
.brand { display: flex; align-items: center; gap: .55rem; font-size: 1.38rem; font-weight: 650; letter-spacing: -.045em; }
.brand-mark { display: block; flex: none; width: 1.75rem; height: 1.75rem; border-radius: .53rem; object-fit: contain; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 18px; padding: 0 4px; }
.wordmark { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 21px; font-weight: 680; }
.sidebar-new-chat { display: flex; align-self: flex-start; align-items: center; gap: 8px; min-height: 40px; margin: 0 3px 13px; padding: 0 15px; border: 1px solid transparent; border-radius: 100px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.sidebar-new-chat:hover { border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.workspace-nav button:hover { background: var(--surface); }
.history-search { display: flex; align-items: center; gap: 9px; margin: 0 3px 18px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; background: var(--surface); }
.history-search:focus-within { border-color: var(--accent); }
.history-search input { min-width: 0; width: 100%; height: 35px; padding: 0; border: 0; outline: none; background: transparent; color: inherit; font-size: 13px; }
.history-search input::placeholder { color: var(--muted); }
.history-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.history-section h2 { margin: 0 10px 6px; color: var(--muted); font-size: 12px; font-weight: 550; }
#history { overflow: auto; }
.workspace-nav button { width: 100%; border: 0; border-radius: .58rem; padding: .56rem .48rem; background: none; color: var(--text); text-align: left; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) 29px 29px; min-height: 41px; margin-block: 2px; align-items: center; padding-inline-end: 3px; border-radius: 8px; }
.history-row:hover, .history-row:focus-within { background: var(--surface); }
.history-row[data-selected="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent); }
.history-row button { border: 0; background: transparent; color: inherit; border-radius: 8px; }
.history-row button:focus-visible { outline-offset: -2px; }
.history-chat { min-height: 41px; width: 100%; padding: 0 10px; text-align: start; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-row .history-pin, .history-row .history-more { display: grid; place-items: center; width: 29px; height: 35px; padding: 0; color: var(--muted); }
.history-row .history-more { font-size: 19px; line-height: 1; }
.history-row .history-pin:hover, .history-row .history-more:hover, .history-row .history-more[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.history-row .history-pin[aria-pressed="true"] { color: var(--accent); }
.history-pin .control-icon { width: 17px; height: 17px; }
.history-row-menu { position: fixed; z-index: 12; display: grid; width: 130px; max-width: calc(100vw - 16px); padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: 0 8px 24px #10142021; }
.history-row-menu button { min-height: 37px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: .88rem; text-align: start; }
.history-row-menu button:hover, .history-row-menu button:focus-visible { background: var(--surface); }
#history-delete-chat { color: #bd3943; }
:root[data-theme="dark"] #history-delete-chat { color: #ff9ba4; }
#history p { font-size: .83rem; color: var(--muted); padding: 0 .45rem; }
.workspace-nav { margin-top: .7rem; padding: .35rem 0; border-bottom: 1px solid var(--border); overflow-y: auto; }
.workspace-nav button { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.workspace-nav button::before { content: ""; width: 9px; height: 9px; margin: 0 3px; border: 1px solid currentColor; border-radius: 3px; opacity: .65; }
#open-preferences::before { border-radius: 50%; }
#open-usage::before { border-width: 0 0 1px 1px; border-radius: 0; }
.workspace-nav [data-install-app]::before { height: 11px; width: 8px; }
.account-actions { min-height: 48px; padding: 5px 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.account-actions #account-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#workspace-menu { position: relative; }
#workspace-menu > summary { list-style: none; }
#workspace-menu > summary::-webkit-details-marker { display: none; }
.menu-lines { width: 16px; height: 12px; border-block: 1.4px solid currentColor; display: grid; align-items: center; }
.menu-lines::after { content: ""; border-top: 1.4px solid currentColor; }
.workspace-popover { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 6; width: 216px; border-radius: 12px; padding: 4px; color: var(--text); background: var(--panel); box-shadow: 0 0 1px #0003, 0 0 4px #0001, 0 12px 32px #0002; }
.workspace-popover button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; width: 100%; padding: 6px 10px; border: 0; border-radius: 8px; text-align: start; background: transparent; color: inherit; font-size: 14px; }
.workspace-popover button:hover { background: var(--surface); }
#wallet-balance { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.profile-avatar { flex: none; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 100%; background: var(--accent-soft); color: var(--accent); }

main { min-width: 0; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 9px 20px; background: transparent; }
.model-control { position: relative; min-width: 0; }
.model-control > summary { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; white-space: nowrap; }
#model-menu > summary { min-height: 38px; padding-inline: 12px 14px; border-color: transparent; border-radius: 10px; font-size: 14px; font-weight: 600; }
.model-control[open] > summary, .model-control > summary:hover { background: var(--surface); }
#selected-model { overflow: hidden; text-overflow: ellipsis; }
.model-cost-badge { flex: none; padding: 2px 6px; border-radius: 999px; background: #fff0d8; color: #814600; font-size: 11px; font-weight: 650; line-height: 1.35; }
:root[data-theme="dark"] .model-cost-badge { background: #453427; color: #ffcf91; }
.chevron { flex: none; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg) translateY(-2px); }
.model-options, .composer-panel { position: absolute; z-index: 3; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 34px #1718301c; animation: pop-in .14s ease-out; }
.model-options { top: calc(100% + 7px); left: 0; min-width: 200px; }
.model-options button { display: block; width: 100%; min-height: 41px; padding: 0 12px; border: 0; border-radius: 9px; color: inherit; background: none; text-align: left; font-size: 13px; }
.model-options button:not(:disabled):hover, .model-options button[aria-pressed="true"] { background: var(--accent-soft); }
#model-options button { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
select { appearance: none; max-width: 100%; min-width: 7rem; padding: .45rem 1.6rem .45rem .7rem; border: 1px solid var(--border); border-radius: .65rem; color: var(--text); background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, #777783 50%), linear-gradient(135deg, #777783 50%, transparent 50%); background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%; background-size: 4px 4px; background-repeat: no-repeat; font-size: .88rem; }
#toggle-history { display: none; }
#history-backdrop { display: none; }
body[data-history-collapsed="true"] { grid-template-columns: minmax(0, 1fr); }
body[data-history-collapsed="true"] .sidebar { display: none; }
body[data-history-collapsed="true"] #toggle-history { display: grid; }
.chat-title { flex: 1; min-width: 0; margin: 0 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; color: var(--muted); font-size: 14px; font-weight: 550; }
.message-pane { position: relative; min-height: 0; }
.messages { height: 100%; overflow: auto; overscroll-behavior-y: contain; overflow-anchor: none; padding: 14px 36px 24px; scrollbar-gutter: stable both-edges; }
.messages:focus-visible { outline-offset: -2px; }
#message-list { display: flow-root; min-width: 0; }
.message-pane .jump-latest { position: absolute; z-index: 2; bottom: 8px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; background: var(--panel); border: 1px solid var(--border); color: var(--text); box-shadow: 0 2px 10px #1718301a; }
.empty { display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.empty-mark.brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.empty h2 { margin: 0; font-size: clamp(1.25rem, 2.7vw, 1.65rem); font-weight: 650; }
.starter-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px auto 0; }
.starter-actions button { min-height: 29px; color: var(--muted); padding: 4px 10px; font-size: 12px; }
.starter-actions button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.messages article { max-width: var(--content); margin: 0 auto 30px; }
.messages article:first-child { margin-top: 14px; }
.messages article[data-role="user"] { display: flex; justify-content: flex-end; margin-bottom: 44px; }
.messages article[data-role="user"] .message-content { max-width: min(85%, 36rem); padding: 11px 16px; border-radius: 16px 16px 5px 16px; background: var(--user-message); }
.messages article h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.messages article p { margin: 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.messages article[data-role="assistant"] .message-content { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.messages article[data-role="assistant"] .markdown-content { white-space: normal; }
.messages article .markdown-content :is(h1, h2, h3, h4, h5, h6) { position: static; width: auto; height: auto; clip-path: none; margin: 1.25em 0 .45em; font-weight: 650; line-height: 1.35; letter-spacing: -.025em; }
.markdown-content h1 { font-size: 1.52em; }
.markdown-content h2 { font-size: 1.28em; }
.markdown-content h3 { font-size: 1.1em; }
.messages article .markdown-content > *:first-child { margin-top: 0; }
.messages article .markdown-content p { margin: .5em 0; white-space: normal; line-height: inherit; }
.markdown-content ul, .markdown-content ol { padding-inline-start: 1.6em; }
.markdown-content a { color: var(--accent); }
.markdown-content blockquote { margin-inline: 0; padding-inline: 15px; border-inline-start: 3px solid var(--border); color: var(--muted); }
.markdown-content :not(pre) > code { padding: 2px 5px; border-radius: 4px; background: var(--surface); }
.markdown-content pre { overflow: auto; margin: .9em 0; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.markdown-content pre code { font-size: .88em; overflow-wrap: normal; }
.markdown-code { margin: .9em 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.markdown-code pre { border: 0; border-radius: 0; margin: 0; }
.markdown-code .token.comment, .markdown-code .token.prolog { color: #677483; }
.markdown-code .token.keyword, .markdown-code .token.boolean, .markdown-code .token.atrule { color: #8742a0; }
.markdown-code .token.string, .markdown-code .token.attr-value, .markdown-code .token.inserted { color: #1b775f; }
.markdown-code .token.function, .markdown-code .token.class-name { color: #285cb2; }
.markdown-code .token.number, .markdown-code .token.constant, .markdown-code .token.tag { color: #a75a25; }
:root[data-theme="dark"] .markdown-code .token.keyword, :root[data-theme="dark"] .markdown-code .token.boolean { color: #cf9ce5; }
:root[data-theme="dark"] .markdown-code .token.string, :root[data-theme="dark"] .markdown-code .token.attr-value { color: #89d6a9; }
:root[data-theme="dark"] .markdown-code .token.function, :root[data-theme="dark"] .markdown-code .token.class-name { color: #a9c5ff; }
:root[data-theme="dark"] .markdown-code .token.number, :root[data-theme="dark"] .markdown-code .token.tag { color: #ffc090; }
.markdown-math-display { display: block; overflow-x: auto; }
.markdown-diagram { border: 1px solid var(--border); border-radius: 14px; margin: 1em 0; padding: 10px; }
.markdown-diagram iframe { display: block; border: 0; width: 100%; }
.markdown-diagram summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.code-tools { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 4px 14px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.code-tools .plain-button { border: 0; padding: 4px 8px; font-size: 12px; }
.markdown-table { overflow-x: auto; margin: .75em 0; border: 1px solid var(--border); border-radius: 10px; }
.markdown-table table { width: max-content; min-width: 100%; border-collapse: collapse; }
.markdown-table :is(td, th) { min-width: 5em; padding: 7px 11px; border-bottom: 1px solid var(--border); text-align: left; }
.markdown-table th { background: var(--surface); }
.markdown-table tr:last-child td { border-bottom: 0; }
.message-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; overflow-wrap: anywhere; }
.message-sources a { color: var(--accent); }
.message-actions { display: flex; gap: .35rem; margin-top: .5rem; }
.messages article .provider-issue { margin-top: .6rem; color: var(--muted); font-size: .875rem; }
.message-actions button { padding: .22rem .5rem; font-size: .78rem; color: var(--muted); }
.message-actions .top-up-link { display: inline-flex; align-items: center; padding: .28rem .75rem; color: var(--accent); text-decoration: none; }
.message-actions .message-icon { width: 30px; height: 30px; padding: 0; }
.message-versions { display: inline-flex; align-items: center; align-self: center; gap: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.message-versions button { border: 0; min-width: 24px; padding: 2px 4px; font-size: 18px; line-height: 24px; }
.message-editor { width: 100%; display: grid; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.message-editor textarea { width: 100%; display: block; resize: vertical; border: 0; border-radius: 10px; color: var(--text); background: var(--surface); padding: 10px; }
.message-editor > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.messages article[data-role="user"] { flex-direction: column; align-items: flex-end; position: relative; }
.messages article[data-role="user"] .message-actions { position: absolute; top: 100%; right: 0; }
@media (hover: hover) {
  .messages article[data-role="user"]:not(:hover):not(:focus-within) .message-actions { opacity: 0; }
}
.message-reasoning { margin: 0 0 17px; color: var(--muted); font-size: 14px; }
.message-reasoning > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 33px; padding: 4px 8px; margin-inline-start: -8px; border-radius: 8px; list-style: none; font-weight: 550; }
.message-reasoning > summary::-webkit-details-marker { display: none; }
.message-reasoning > summary:hover { background: var(--surface); }
.message-reasoning > summary .chevron { margin-inline: 2px 4px; transform: rotate(-45deg); }
.message-reasoning[open] > summary .chevron { transform: rotate(45deg) translateY(-2px); }
.message-reasoning[data-pending="true"] > summary .control-icon { color: var(--accent); }
.reasoning-body { margin: 4px 0 0 7px; padding: 2px 12px; border-inline-start: 2px solid var(--border); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.reasoning-body:empty { display: none; }
.reasoning-body.markdown-content { white-space: normal; }
.web-activity { list-style: none; margin: 8px 0 0 7px; padding: 0 0 0 12px; border-inline-start: 2px solid var(--border); }
.web-activity li { padding-block: 5px; font-size: 13px; overflow-wrap: anywhere; }
.web-activity-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.web-activity-heading strong { font-weight: 620; }
.web-activity-query { color: var(--muted); }
.web-activity a { color: var(--accent); text-underline-offset: 2px; }
.web-activity li details { margin: 3px 0 0 22px; }
.web-activity li details a { display: block; margin-block: 4px; }
.markdown-content .inline-citation { display: inline-block; margin-inline: 2px; padding: 0 4px; border-radius: 4px; background: var(--accent-soft); font-size: .72em; line-height: 1.4; text-decoration: none; vertical-align: super; }
.markdown-content .inline-citation:hover { text-decoration: underline; }
.chat-menu > summary { min-width: 36px; padding: 0 9px; border-color: transparent; justify-content: center; font-size: 17px; }
.chat-menu .model-options { left: auto; right: 0; }
#chat-versions:not(:empty) { border-top: 1px solid var(--border); }
#chat-versions p { margin: 6px 12px 2px; font-size: 12px; color: var(--muted); }
#chat-versions button { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: min(72vw, 260px); }
#chat-versions button[aria-current="true"] { font-weight: 700; }
.composer { position: relative; padding: 0 24px max(20px, env(safe-area-inset-bottom)); }
.composer-inner { display: flex; flex-direction: column; justify-content: space-between; gap: 5px; max-width: var(--content); min-height: 105px; margin: 0 auto; padding: 12px 12px 9px; border: 1px solid var(--composer-border); border-radius: 24px; background: var(--panel); box-shadow: 0 3px 14px #19377a0c; }
.composer-inner:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--composer-border)); }
.composer[data-dragging="true"] .composer-inner { border-color: var(--accent); background: var(--accent-soft); }
.composer textarea { display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent; color: inherit; padding: 4px 4px; min-height: 32px; max-height: 27vh; line-height: 24px; }
.composer textarea::placeholder { color: var(--muted); }
.composer-toolbar { display: flex; align-items: center; gap: 8px; container-type: inline-size; }
.composer-toolbar :is(button, summary, label, input), .workspace-popover button { -webkit-tap-highlight-color: transparent; }
.composer-pro { flex: none; min-height: 35px; padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: transparent; font-size: 13px; font-weight: 650; }
.composer-pro:hover { background: var(--surface); }
.composer-pro[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); background: var(--accent-soft); }
.model-switch-note { margin: 2px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
#composer-menu { position: relative; }
#composer-menu > summary { width: 36px; height: 36px; }
#composer-menu > summary .control-icon { width: 19px; height: 19px; }
#composer-menu > summary, .model-control > summary { list-style: none; }
#composer-menu > summary::-webkit-details-marker, .model-control > summary::-webkit-details-marker { display: none; }
#composer-menu[open] > summary { color: var(--accent); }
.composer-panel { bottom: calc(100% + 8px); inset-inline-end: 0; width: max-content; min-width: 144px; border-radius: 12px; }
.composer-panel button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 41px; text-align: start; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 14px; }
#deepseek-tools { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
#deepseek-tools label { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 530; color: var(--text); white-space: nowrap; cursor: pointer; }
#deepseek-tools .control-icon { width: 15px; height: 15px; }
#deepseek-tools input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
#deepseek-tools:not(:disabled) label:hover { background: var(--surface); }
#deepseek-tools label:has(input:checked) { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); background: var(--accent-soft); }
#deepseek-tools:not(:disabled) label:has(input:checked):hover { background: color-mix(in srgb, var(--accent) 15%, var(--panel)); }
#deepseek-tools label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#deepseek-tools:disabled label { opacity: .58; cursor: default; }
.send-actions { flex: none; display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
#voice-record { width: 36px; height: 36px; }
#voice-record[aria-pressed="true"] { background: #f8e6e7; color: #a12633; }
.file-draft { display: flex; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.message-files { margin-bottom: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.primary { border: 0; border-radius: 999px; padding: .48rem .82rem; background: var(--accent-fill); color: #fff; font-size: .88rem; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.icon-button:not(:disabled):hover, #composer-menu[open] > summary { background: var(--surface); }
#send, #stop { width: 36px; height: 36px; background: var(--accent-fill); color: #fff; }
#send:not(:disabled):hover, #stop:hover { opacity: .83; }
#send:disabled { opacity: 1; background: var(--surface); color: var(--muted); }
.search-icon { flex: none; position: relative; width: 11px; height: 11px; margin: 0 4px 3px 2px; border: 1.4px solid #777782; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 5px; height: 1px; left: 7px; top: 8px; transform: rotate(45deg); background: #777782; }
@container (max-width: 380px) {
  #deepseek-tools label { min-width: 38px; padding-inline: 9px; }
  #deepseek-tools label > span { display: none; }
}
#status { margin: 6px auto 0; max-width: var(--content); color: var(--muted); font-size: .75rem; }
#status:empty { display: none; }
#status[data-error="true"] { color: #9a3020; }
:root[data-theme="dark"] #status[data-error="true"] { color: #ffaaa4; }

.plain-button { background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: .39rem .65rem; font-size: .84rem; }
.plain-button:hover { background: var(--surface); }
.account-gate { grid-column: 1 / -1; align-self: center; justify-self: center; width: min(100% - 2.5rem, 380px); margin: 24px 0; }
.account-gate form, dialog form { display: grid; gap: .62rem; }
.auth-credentials, .auth-field { display: grid; gap: 7px; }
.auth-field + .auth-field { margin-top: 4px; }
.field-hint, .field-error { font-size: 12px; line-height: 1.45; }
.field-hint { color: var(--muted); }
.field-error { color: #b32d43; }
:root[data-theme="dark"] .field-error { color: #ff9eac; }
:is(.account-gate, #email-bind-form) input[aria-invalid="true"] { border-color: #ce3f54; }
:is(.account-gate, #email-bind-form) input[aria-invalid="true"]:focus { outline: 2px solid #ce3f54; outline-offset: 1px; }
dialog textarea { width: 100%; resize: vertical; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--panel); }
#chat-context-form small { color: var(--muted); padding-inline-start: 22px; line-height: 1.55; }
#chat-summary-editor { padding: 12px 0; border-block: 1px solid var(--border); }
#chat-summary-editor summary { cursor: pointer; }
#chat-summary-fields label { display: grid; gap: 6px; margin-top: 12px; }
#account-memories li { display: flex; gap: 6px; align-items: center; }
#account-memories p { flex: 1; min-width: 0; font-size: 14px; }
.verify-code-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.verify-code-field input { width: 100%; }
.account-gate form, dialog { border: 1px solid var(--border); background: #fff; border-radius: 1rem; padding: 1.25rem; }
.account-gate form { gap: 14px; padding: 0; border: 0; box-shadow: none; background: transparent; }
.auth-header { display: grid; justify-items: center; gap: 10px; margin-bottom: 6px; text-align: center; }
.auth-header .brand { gap: 12px; }
.auth-header .brand-mark { width: 26px; height: 26px; border-radius: 7px; }
.auth-header h1 { margin: 0; font-size: 24px; font-weight: 640; }
.auth-header p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; min-height: 40px; padding: 3px; margin: 0 0 8px; border-radius: 12px; background: var(--surface); }
.auth-tabs button { padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; }
.auth-tabs button[aria-pressed="true"] { color: var(--text); background: #fff; box-shadow: 0 1px 4px #181c2412; }
.account-gate #account-submit { min-height: 42px; margin-top: 1px; border-radius: 22px; background: var(--action); color: var(--on-action); font-size: 14px; }
.auth-credentials label { color: var(--text); font-size: 14px; }
.auth-credentials > label:not(:first-child) { margin-top: 4px; }
.auth-credentials input { min-height: 40px; padding: 8px 13px; background: transparent; }
.auth-credentials input::placeholder { color: #9da4af; }
.code-input { font-size: 17px; letter-spacing: .34em; font-variant-numeric: tabular-nums; font-weight: 620; }
.verify-code-field button { min-width: 86px; color: var(--accent); font-size: 13px; }
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-links .plain-button { padding: 2px 0; border: 0; color: var(--accent); font-size: 14px; }
.auth-links [data-install-app] { margin-inline-start: auto; }
.account-gate h1, dialog h2 { margin: .2rem 0 .4rem; font-size: 1.16rem; letter-spacing: -.023em; }
.account-gate label, dialog label { color: var(--muted); font-size: .87rem; }
.account-gate input, dialog input { min-width: 0; border: 1px solid var(--border); border-radius: .62rem; padding: .56rem; color: inherit; }
#account-submit, #redeem-submit { border: 0; padding: .58rem; background: var(--accent-fill); color: white; border-radius: .65rem; }
dialog { width: min(100% - 1.5rem, 29rem); color: inherit; max-height: calc(100dvh - 1.5rem); overflow: auto; }
dialog.workspace-dialog { width: min(100% - 1.5rem, 39rem); }
dialog::backdrop { background: #14131e43; }
.dialog-header, .field-pair { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .75rem; }
.field-pair label { min-width: 0; display: grid; gap: .38rem; }
.field-pair label:last-child { flex: 1; }
.dialog-actions, .row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.dialog-status, #auth-status, #redeem-status { min-height: .9rem; color: var(--muted); font-size: .84rem; margin: .25rem 0; }
#auth-status { color: var(--muted); }
#auth-status:empty { display: none; }
.workspace-list, #ledger { list-style: none; padding: 0; margin: .6rem 0; max-height: 42vh; overflow: auto; }
.workspace-list li, #ledger li { padding: .6rem .05rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.workspace-list small, #ledger small, .proposal-card small { display: block; color: var(--muted); margin-top: .22rem; line-height: 1.5; }
.schedule-row, .proposal-card { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.proposal-card { margin: .4rem 0; padding: .7rem .85rem; border-radius: .8rem; border: 1px solid var(--border); background: var(--surface); }
.empty-list { color: var(--muted); font-size: .87rem; }
.import-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.usage-period { display: flex; align-items: center; gap: .65rem; }
.usage-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.usage-totals div { border-radius: .65rem; padding: .55rem; background: var(--surface); }
.usage-totals dt { color: var(--muted); font-size: .78rem; }
.usage-totals dd { margin: .2rem 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.install-instructions { margin: .75rem 0; padding-inline-start: 1.45rem; font-size: .9rem; line-height: 1.7; }
.usage-views { display: inline-flex; gap: 3px; background: var(--surface); padding: 3px; border-radius: 12px; }
.usage-views button { background: transparent; border: 0; border-radius: 9px; color: var(--muted); padding: 6px 16px; min-height: 34px; font-size: 14px; }
.usage-views button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px #0001; }
.usage-rates { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.usage-rates summary { font-size: 14px; font-weight: 550; }
.usage-chat-link { border: 0; padding: 0; color: var(--accent); background: none; text-align: start; }
.control-icon { flex: none; width: 16px; height: 16px; display: inline-block; vertical-align: middle; }
#new-chat .control-icon, .sidebar-new-chat .control-icon { width: 20px; height: 20px; }
#preferences-dialog { width: min(774px, calc(100% - 32px)); height: min(530px, calc(100dvh - 40px)); padding: 0; border: 1px solid var(--border); border-radius: 24px; background: var(--panel); box-shadow: 0 20px 55px #0002; overflow: hidden; }
#preferences-dialog[open] { display: flex; flex-direction: column; }
#preferences-dialog::backdrop { background: #141b2e4d; }
.preferences-header { flex: none; margin: 0; padding: 14px 16px 9px 23px; min-height: 59px; }
.preferences-header h2 { font-weight: 650; font-size: 18px; margin: 0; }
.preferences-layout { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; flex: 1; min-height: 0; padding: 3px 22px 20px 14px; }
.preferences-nav { display: flex; flex-direction: column; gap: 4px; }
.preferences-nav button { flex: none; display: flex; align-items: center; gap: 8px; min-height: 41px; padding: 8px 10px; border: 0; border-radius: 10px; font-size: 14px; background: transparent; color: var(--muted); text-align: start; white-space: nowrap; }
.preferences-nav button:hover { background: var(--surface); }
.preferences-nav button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.preferences-content { min-width: 0; min-height: 0; overflow: auto; padding: 0 5px 4px 14px; border-inline-start: 1px solid var(--border); }
.preference-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 59px; padding: 10px 0; margin: 0; text-align: start; }
.preference-row > div { min-width: 0; overflow-wrap: anywhere; }
.preference-row h3, #preferences-dialog label.preference-row > span, .theme-section legend { margin: 0; color: var(--text); font-size: 14px; font-weight: 570; }
.preference-row p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.preference-row.with-rule { border-bottom: 1px solid var(--border); }
.preference-row .plain-button { flex: none; min-height: 36px; padding: 5px 12px; font-size: 13px; }
.preference-row select, .preference-value { min-height: 36px; border: 0; border-radius: 12px; padding: 8px 12px; color: var(--text); background-color: var(--surface); font-size: 13px; }
.preference-row select { padding-inline-end: 30px; }
.theme-section { min-width: 0; margin: 15px 0 12px; border: 0; padding: 0; }
.theme-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 10px; }
.theme-cards button { min-height: 76px; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 8px 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); font-size: 14px; }
.theme-cards button:hover { background: var(--surface); }
.theme-cards button[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); color: var(--accent); }
.theme-cards .control-icon { width: 19px; height: 19px; }
.default-prompt { color: var(--muted); background: var(--surface); padding: 12px; border-radius: 12px; font-size: 14px; }
.wallet-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.wallet-links a { text-decoration: none; }
.wallet-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 17px 0; gap: 14px; min-width: 0; }
.wallet-summary dt { color: var(--muted); font-size: .8rem; }
.wallet-summary dd { margin: .3rem 0 0; font-size: clamp(1.25rem, 4vw, 1.8rem); font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-links { display: grid; }
.wallet-links .primary, .wallet-redeem { text-align: center; }
.wallet-redeem { padding: .65rem; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); }
.wallet-transactions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.wallet-transactions summary { cursor: pointer; color: var(--muted); font-size: .86rem; }
.file-dropzone { display: grid; justify-items: center; gap: 8px; padding: 18px 12px; border: 1px dashed var(--border); border-radius: 15px; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.file-dropzone:hover, .file-dropzone[data-dragging="true"], .file-dropzone:focus-within { background: var(--surface); border-color: var(--action); }
.file-dropzone .control-icon { width: 23px; height: 23px; color: var(--action); }
.file-dropzone small { color: var(--muted); }
.appearance-colors p { color: var(--muted); margin: 8px 0 16px; font-size: .88rem; }
.appearance-colors .theme-cards button { min-height: 88px; }
.accent-swatch { width: 24px; height: 24px; border-radius: 50%; background: #4262ff; }
[data-accent-mode="blue"] .accent-swatch { background: #2476dc; }
[data-accent-mode="green"] .accent-swatch { background: #16866e; }
.email-manager-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.email-manager-row p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.email-manager-row button { min-width: max-content; }
#email-bind-form { margin-top: 16px; }
.chat-has-art { background: linear-gradient(color-mix(in srgb, var(--panel) 69%, transparent), color-mix(in srgb, var(--panel) 84%, transparent)), var(--chat-art) center / cover; }
.background-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.background-gallery > div { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.background-gallery img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.background-gallery > div > div { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; }
.archive-originals { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 5px 10px; }
.archive-originals > div { display: grid; gap: 6px; justify-items: start; }
.archive-originals img { display: block; width: 120px; height: 86px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.automation-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; margin: 14px 0; }
.automation-heading p { color: var(--muted); font-size: .86rem; margin: 0; max-width: 38ch; line-height: 1.5; }
.workspace-list .automation-row { display: grid; align-items: start; gap: 6px; padding-block: 12px; }
.automation-row small { display: block; color: var(--muted); }
.automation-row small:empty { display: none; }
.automation-instruction { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; }
.automation-row summary { color: var(--muted); font-size: .86rem; padding: 5px 0; }
.automation-runs { padding-inline-start: 12px; }
.automation-output { margin-block: 8px; }
#background-source { display: flex; align-items: center; gap: 10px; }
#background-source-image { width: 92px; border-radius: 8px; }
:root[data-accent="blue"] { --accent: #2268cb; --accent-fill: #2268cb; }
:root[data-accent="green"] { --accent: #237a5b; --accent-fill: #237a5b; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #ecf0f7;
  --muted: #aeb9cc;
  --border: #384354;
  --surface: #263141;
  --accent: #a3bcff;
  --canvas: #171b23;
  --sidebar-panel: #141922;
  --panel: #1e2531;
  --composer-border: #42516a;
  --user-message: #26344b;
}
:root[data-theme="dark"][data-accent="blue"] { --accent: #91c3ff; }
:root[data-theme="dark"][data-accent="green"] { --accent: #8bd8b4; }
:root[data-theme="dark"] :is(dialog, select, .auth-tabs button[aria-pressed="true"]) { background-color: var(--panel); }
#chat[data-welcome="true"] { grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1.18fr); }
#chat[data-welcome="true"] .messages { display: grid; align-items: end; padding-bottom: 16px; }
#chat[data-welcome="true"] .chat-title { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .history-row:not(:hover):not(:focus-within) .history-pin[aria-pressed="false"],
  .history-row:not(:hover):not(:focus-within) .history-more[aria-expanded="false"] { opacity: 0; }
}
@media (max-width: 650px), (max-width: 1024px) and (pointer: coarse) {
  body { grid-template-columns: minmax(0, 1fr); }
  .sidebar, body[data-history-collapsed="true"] .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 5; width: min(84vw, 340px); padding: max(18px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); box-shadow: 12px 0 28px #22213a18; visibility: hidden; transform: translateX(-101%); transition: transform .23s ease, visibility 0s .23s; }
  .sidebar[data-open="true"] { visibility: visible; transform: translateX(0); transition-delay: 0s; }
  #history-backdrop { display: block; position: fixed; inset: 0; z-index: 4; border: 0; background: #11132532; }
  #toggle-history { display: grid; }
  .topbar { gap: 5px; min-height: 56px; padding: 7px 10px; }
  .topbar > .icon-button { flex: none; width: 36px; }
  #model-menu > summary { max-width: 45vw; gap: 6px; padding-inline: 8px; font-size: 13px; }
  .chat-title { font-size: 13px; }
  .messages { padding-inline: 20px; scrollbar-gutter: auto; }
  #chat[data-welcome="true"] { grid-template-rows: auto minmax(0, 1fr) auto; }
  #chat[data-welcome="true"] .messages { align-items: center; padding-bottom: 24px; }
  .composer { padding-inline: 12px; }
  .composer-inner { gap: 5px; padding-inline: 9px; }
  .starter-actions { gap: 6px; margin-top: 9px; }
  .usage-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #preferences-dialog { inset: auto 0 0; margin: 0; width: 100%; max-width: none; height: min(650px, calc(100dvh - 38px)); border-radius: 23px 23px 0 0; border-block-end: 0; }
  .preferences-header { min-height: 55px; padding: 10px 12px 6px 17px; }
  .preferences-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 0 14px max(14px, env(safe-area-inset-bottom)); }
  .preferences-nav { flex-direction: row; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
  .preferences-nav button { min-height: 40px; font-size: 13px; padding: 5px 10px; gap: 6px; }
  .preferences-content { border-inline-start: 0; border-block-start: 1px solid var(--border); padding: 4px 3px 0; }
  .preference-row .plain-button { min-height: 40px; }
  .theme-cards { gap: 7px; }
  .theme-cards button { min-height: 74px; font-size: 13px; }
}
@media (max-height: 470px) {
  #chat[data-welcome="true"] { grid-template-rows: auto minmax(0, 1fr) auto; }
  .starter-actions { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none !important; }
  .model-options, .composer-panel { animation: none; }
}
