/* Shared component colors. Load after legacy component styles. */
[data-theme]{--selected-bg:color-mix(in srgb,var(--accent) 14%,var(--surface));--selected-border:color-mix(in srgb,var(--accent) 65%,var(--border));--code-string:#7bbf88;--code-number:#c4a7e7;--code-keyword:#83b7f3}
[data-theme="light"]{color-scheme:light;--code-string:#28723c;--code-number:#8152a9;--code-keyword:#285d9c}
[data-theme="dark"],[data-theme="oled"],[data-theme="emerald"]{color-scheme:dark}
[data-theme] *{scrollbar-width:thin;scrollbar-color:var(--border) transparent}
[data-theme] ::-webkit-scrollbar{width:7px;height:7px}
[data-theme] ::-webkit-scrollbar-track{background:transparent}
[data-theme] ::-webkit-scrollbar-thumb{background:var(--border);border-radius:8px}
[data-theme] :is(.fine-print,.muted,.profile-controls label,.model-status-note,#model-status-note,.model-list-labels,.memory-templates-title,.memory-hint-row){color:var(--muted)!important}
[data-theme] .models-dialog .model-option-wrapper{background:var(--surface)!important;border-color:var(--border)!important;border-left:3px solid transparent!important;padding-left:0}
[data-theme] .models-dialog .model-option-wrapper:hover{background:var(--surface-2)!important}
[data-theme] .models-dialog .model-option-wrapper.is-selected{background:var(--selected-bg)!important;border-left-color:var(--accent)!important}
[data-theme] .models-dialog .model-option-wrapper .model-option{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--text)!important}
[data-theme] .models-dialog .model-option-wrapper .model-option strong{color:var(--text)!important}
[data-theme] .models-dialog :is(.model-token-prices,.model-price-divider,.model-health,.model-meta-line,.model-default-tag){color:var(--muted)!important}
[data-theme] .models-dialog .model-default-tag{background:transparent!important}
[data-theme] .models-dialog .model-latency{background:var(--surface-2)!important;color:var(--muted)!important;border:1px solid var(--border)!important}
[data-theme] .models-dialog .model-check{color:var(--accent)!important}
[data-theme] .models-dialog .model-initial{background:transparent!important;border:0!important}
[data-theme]:not([data-theme="light"]) img[src$="openai.svg"]{filter:brightness(0) invert(.92)}
[data-theme] .models-dialog .model-channel-controls{background:var(--surface-2)!important;border-color:var(--border)!important}
[data-theme] .models-dialog .model-channel-controls button{background:transparent!important;color:var(--muted)!important;border:0!important;box-shadow:none!important}
[data-theme] .models-dialog .model-channel-controls button[aria-pressed="true"]{background:var(--surface-3)!important;color:var(--text)!important;box-shadow:0 1px 3px #0002!important}
[data-theme] :is(.model-sort-chip,.model-sort-pills button){background:var(--surface-2)!important;color:var(--muted)!important;border-color:var(--border)!important;box-shadow:none!important}
[data-theme] :is(.model-sort-chip.active,.model-sort-pills button.active){background:var(--selected-bg)!important;color:var(--text)!important;border-color:var(--selected-border)!important}
[data-theme] :is(.model-pricing,.model-pricing summary,.model-price-details){border-color:var(--border)!important;color:var(--muted)!important}
[data-theme] .profile-dialog :is(button.primary,.profile-footer button[type="submit"]){background:var(--accent)!important;color:var(--accent-text)!important;border:1px solid var(--accent)!important;border-radius:9px;box-shadow:none!important}
[data-theme] .profile-dialog :is(button.secondary,.voice-preview-btn,.memory-chip,.account-billing-links a){background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--border)!important;border-radius:9px;box-shadow:none!important}
[data-theme] .profile-dialog :is(button.secondary,.voice-preview-btn,.memory-chip,.account-billing-links a):hover{background:var(--surface-3)!important;border-color:var(--selected-border)!important}
[data-theme] .profile-dialog .profile-tabs{gap:4px;border-color:var(--border)!important}
[data-theme] .profile-dialog .profile-tabs button{background:transparent!important;color:var(--muted)!important;border:1px solid transparent!important;border-radius:8px;padding:10px 14px;box-shadow:none!important}
[data-theme] .profile-dialog .profile-tabs button[aria-selected="true"]{background:var(--selected-bg)!important;color:var(--text)!important;border:1px solid var(--selected-border)!important}
[data-theme] .profile-dialog :is(label,.memory-toggle-text,.memory-group-title){color:var(--text)!important}
[data-theme] :is(.tool-log,.tool-diagram-card,.tool-code-card,.chat-code-output,.tool-wiki-card,.tool-rate-card,.chat-file-card,.compact-card,.storage-summary,.document-preview){background:var(--surface)!important;color:var(--text)!important;border-color:var(--border)!important;box-shadow:none!important}
[data-theme] :is(.tool-log summary,.tool-diagram-header,.tool-code-header,.chat-code-output-header,.text-block-header){background:var(--surface-2)!important;color:var(--text)!important;border-color:var(--border)!important}
[data-theme] :is(.tool-log pre,.tool-code-pre,.chat-code-output-pre,.terminal-output,.text-block,.markdown .text-block pre,.markdown .text-block code){background:var(--code-bg)!important;color:var(--text)!important;border-color:var(--border)!important}
[data-theme] :is(.tool-outcome,.tool-status,.tool-diagram-type,.file-type-icon,.tool-copy-btn,.text-block-header button){background:var(--surface-2)!important;color:var(--muted)!important;border-color:var(--border)!important}
[data-theme] :is(.tool-diagram-download,.tool-wiki-title,.chat-file-actions a,.chat-file-actions button){color:var(--accent)!important;background:transparent!important;border-color:var(--border)!important}
[data-theme] .tool-diagram-body svg .node :is(rect,circle,ellipse,polygon,path){fill:var(--surface-2)!important;stroke:var(--accent)!important}
[data-theme] .tool-diagram-body svg :is(text,.node .label,.nodeLabel,.edgeLabel){fill:var(--text)!important;color:var(--text)!important}
[data-theme] .tool-diagram-body svg :is(.edgeLabel rect,.edgeLabel p){fill:var(--surface)!important;background:var(--surface)!important}
[data-theme] .tool-diagram-body svg :is(path.flowchart-link,.edgePaths path,.edgePath path,marker path){stroke:var(--muted)!important}
[data-theme] .hljs :is(.hljs-keyword,.hljs-selector-tag,.hljs-built_in){color:var(--code-keyword)!important}
[data-theme] .hljs :is(.hljs-string,.hljs-attr){color:var(--code-string)!important}
[data-theme] .hljs :is(.hljs-number,.hljs-literal,.hljs-type){color:var(--code-number)!important}
[data-theme] .hljs-comment{color:var(--muted)!important}
.memory-list-header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:24px 0 12px}.memory-list-header h4{margin:0;font-size:14px}
.memory-add-row{display:flex;gap:8px;margin-bottom:14px}.memory-add-row input{flex:1;min-width:0;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--input-bg);color:var(--text)}
.memory-item-card{display:flex;align-items:flex-start;gap:10px;padding:12px;margin:8px 0;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.memory-item-content{flex:1;min-width:0}.memory-item-content p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text)}.memory-item-content small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.memory-item-actions{display:flex;gap:4px}.memory-item-actions button{background:transparent;color:var(--muted);border:0;padding:5px;min-width:30px;min-height:30px}.memory-item-actions button:hover{color:var(--text);background:var(--surface-3);border-radius:6px}.memory-item-content textarea{width:100%;min-height:80px}.memory-toggle-note{margin:8px 0;color:var(--muted);font-size:12px}
@media(max-width:600px){.profile-dialog .profile-tabs button{padding:9px 10px;font-size:12px}.memory-add-row{flex-wrap:wrap}.memory-add-row input{min-width:100%}.memory-item-card{gap:6px}.memory-item-actions{flex-direction:column}}

[data-theme] .models-dialog .model-sort-chip.active{background:var(--selected-bg)!important;color:var(--text)!important;border-color:var(--selected-border)!important}
[data-theme] dialog .dialog-heading :is(h2,h3),[data-theme] .profile-dialog .dialog-heading h2{color:var(--text)!important}
[data-theme] .dialog-eyebrow,[data-theme] .profile-dialog :is(.fine-print,.profile-identity small,.profile-email,.profile-logout){color:var(--muted)!important}
[data-theme] .tool-state{background:var(--surface-2)!important;color:var(--muted)!important}
[data-theme] .tool-diagram-body svg marker path{fill:var(--muted)!important;stroke:var(--muted)!important}
[data-theme] .tool-block-card:has(input:checked){background:var(--selected-bg)!important;border-color:var(--selected-border)!important}

[data-theme] .models-dialog .model-search{background:var(--input-bg)!important;color:var(--text)!important;border-color:var(--border)!important}
[data-theme] .chat-code-output :is(.chat-code-output-title,.chat-code-output-title svg,.chat-code-output-title span){color:var(--text)!important}
[data-theme] .tool-diagram-body svg .edgeLabel{background-color:var(--surface)!important;color:var(--text)!important;fill:var(--text)!important}
[data-theme] :is(.header-budget,.context-status button,.scroll-to-bottom){background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--border)!important}
[data-theme] .composer #send-button{background:var(--accent)!important;color:var(--accent-text)!important;border-color:var(--accent)!important}

[data-theme] :is(.tools-popup-dialog,.profile-dialog) .tool-block-card .tool-option-icon{background:var(--surface-3)!important;color:var(--accent)!important;border:1px solid var(--border)!important}
[data-theme] .tool-block-card input[type="checkbox"]{accent-color:var(--accent)!important}
[data-theme] .tool-block-card .tool-block-badges{border-top:1px solid var(--border)!important;border-bottom:0!important;color:var(--muted)!important}
[data-theme] .tool-block-card .tool-block-badges span{background:var(--surface-2)!important;color:var(--muted)!important;border:1px solid var(--border)!important}
[data-theme] .message-header .message-mark{background:var(--surface-2)!important;border-color:var(--border)!important;color:var(--text)!important}
[data-theme] .message-header strong{color:var(--text)!important}
[data-theme] .profile-dialog :is(.api-panel-header,.api-keys-header,.api-example-snippet) :is(h3,h4,summary,strong){color:var(--text)!important}
[data-theme] .profile-dialog :is(.api-endpoint-box,.api-examples-box,.api-key-item,.api-guest-notice,.api-new-key-box){background:var(--surface-2)!important;color:var(--text)!important;border-color:var(--border)!important}
[data-theme] .profile-dialog .api-field label{color:var(--muted)!important}
[data-theme] .profile-dialog .api-quota-notice{background:var(--selected-bg)!important;color:var(--text)!important;border-color:var(--selected-border)!important}
[data-theme] .profile-dialog .api-quota-notice :is(p,strong,code){color:var(--text)!important;background:transparent!important}
[data-theme] .profile-dialog .api-examples-box summary{color:var(--text)!important}
.image-preference{margin:8px 0 12px;border:1px solid var(--border);border-radius:10px;padding:10px 12px;color:var(--text)}.image-preference summary{cursor:pointer;font-size:12px}.image-model-options{display:grid;gap:8px;margin-top:12px}.image-model-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:10px 12px;background:var(--surface-2);color:var(--text);border:1px solid var(--border);border-radius:9px;font-size:12px}.image-model-choice span{color:var(--muted);white-space:nowrap}.image-model-choice.is-selected{border-color:var(--accent);background:var(--selected-bg)}.image-generation-status{padding:14px;color:var(--muted);border:1px solid var(--border);border-radius:12px;background:var(--surface)}.memory-upsell{padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--selected-bg)}.memory-upsell a{color:var(--text)}
@media(max-width:600px){.image-model-choice{align-items:start;flex-direction:column;gap:5px}.image-preference{padding:8px}.image-model-options{gap:6px}}

/* Model categories and command suggestions share the current theme. */
.model-kind-tabs{display:flex;gap:4px;margin:0 0 18px;padding:4px;border:1px solid var(--border);border-radius:11px;background:var(--surface-2)}
.model-kind-tabs button{flex:1;padding:10px 12px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);font:inherit;font-size:13px;cursor:pointer}
.model-kind-tabs button[aria-selected=true]{background:var(--selected-bg);border-color:var(--accent);color:var(--text)}
#model-text-panel[hidden],#model-image-panel[hidden]{display:none}
#model-image-panel{border:0;padding:0;margin:0}.model-kind-tabs button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.composer{position:relative}
.command-menu{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:40;max-height:min(340px,45dvh);overflow:auto;padding:8px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:14px;box-shadow:0 12px 30px #0003}
.command-menu[hidden]{display:none}.command-menu-heading{display:flex;justify-content:space-between;gap:12px;padding:6px 10px 10px;font-size:12px;color:var(--muted)}.command-menu-heading small{font-size:11px}
#command-options,#command-help-list{display:grid;gap:4px}
#command-options button,#command-help-list button{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:start;gap:12px;width:100%;padding:10px 12px;text-align:left;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--text);font:inherit;cursor:pointer}
#command-options button[aria-selected=true],#command-options button:hover,#command-help-list button:hover{background:var(--selected-bg);border-color:var(--border)}
#command-options code,#command-help-list code{background:transparent;color:var(--text);font-size:12px;padding:0;overflow-wrap:anywhere}
#command-options span,#command-help-list span{display:grid;gap:3px}#command-options strong,#command-help-list strong{font-size:12px;font-weight:600}#command-options small,#command-help-list small{font-size:11px;line-height:1.45;color:var(--muted)}
.command-help-dialog{width:min(640px,calc(100vw - 24px));max-height:85dvh;overflow:auto}.command-empty{padding:10px;color:var(--muted);font-size:12px}
@media(max-width:600px){#command-options button,#command-help-list button{grid-template-columns:1fr;gap:4px;padding:9px 10px}.command-menu-heading{flex-wrap:wrap}.model-kind-tabs button{font-size:12px;padding:9px 6px}}

.models-dialog #model-text-panel:not([hidden]){display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.models-dialog:has(#model-image-tab[aria-selected=true]){height:fit-content!important}.models-dialog .model-kind-tabs{flex-shrink:0}

.inject-message-dialog{width:min(560px,calc(100vw - 24px));max-height:85dvh;overflow:auto}.inject-message-dialog textarea{resize:vertical;min-height:120px}.injected-message{padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);color:var(--text)}.injected-message-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px;color:var(--muted);font-size:12px}.injected-message-heading strong{font-weight:500}.injected-message-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.6}.injected-system{border-left:3px solid var(--accent)}
@media(max-width:700px){#inject-message-btn span{display:none}#inject-message-btn{padding:8px}}

/* Consistent form controls in every dialog, including dynamically added fields. */
[data-theme] dialog :is(textarea,select,input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file],[type=hidden],[type=button],[type=submit],[type=reset])){box-sizing:border-box;max-width:100%;min-height:42px;padding:10px 12px!important;border:1px solid var(--border)!important;border-radius:10px!important;background-color:var(--input-bg)!important;color:var(--text)!important;font:inherit;font-size:14px;line-height:1.5;box-shadow:none;transition:border-color .15s,background-color .15s,box-shadow .15s}
[data-theme] dialog :is(textarea,select,input):focus-visible{outline:2px solid var(--selected-border)!important;outline-offset:2px;border-color:var(--accent)!important}
[data-theme] dialog :is(textarea,input)::placeholder{color:var(--muted);opacity:.85}
[data-theme] dialog textarea{display:block;width:100%;resize:vertical;min-height:110px}
[data-theme] dialog select{appearance:none;-webkit-appearance:none;padding-right:36px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238b95a5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;background-size:16px!important;cursor:pointer}
[data-theme] dialog select option{background:var(--surface);color:var(--text)}
[data-theme] dialog .stack>label{display:grid;gap:8px;min-width:0;color:var(--text);font-size:13px}
[data-theme] dialog .stack>label :is(select,input:not([type=checkbox],[type=radio])){width:100%}
[data-theme] dialog :is(textarea,select,input):disabled{opacity:.55;cursor:not-allowed}
@media(max-width:600px){[data-theme] dialog :is(textarea,select,input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file],[type=hidden],[type=button],[type=submit],[type=reset])){font-size:16px}}
/* Gift redemption lives in the profile; the card is shared with exported gifts. */
.profile-gift-entry{display:flex;gap:10px;align-items:center}.profile-gift-entry input{flex:1;min-width:0}.profile-gift-entry button{white-space:nowrap}.profile-gift-card{margin:18px 0}.profile-gift-card .gift-card{position:relative;overflow:hidden;padding:25px;border-radius:20px;border:1px solid #ffffff35;display:flex;flex-direction:column;align-items:start;color:#fff;box-shadow:0 16px 40px #0002;min-height:245px}.profile-gift-card .gift-card:before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 92% 5%,#ffffff35,transparent 40%);pointer-events:none}.profile-gift-card .gift-card>*{position:relative}.profile-gift-card .card-label{font-size:10px;letter-spacing:2px;color:#ffffffd9}.profile-gift-card .card-icon{font-size:34px;margin:16px 0 5px}.profile-gift-card .gift-card h3{font-size:32px;letter-spacing:-1px;color:#fff!important;margin:4px 0}.profile-gift-card .card-period{font-size:12px;color:#ffffffd9}.profile-gift-card .card-comment{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.6;margin:17px 0 0;color:#fff!important}.profile-gift-card .card-code{font:13px ui-monospace,monospace;color:#fff;background:#ffffff18;border:1px dashed #ffffff66;border-radius:9px;padding:9px 11px;margin-top:18px;overflow-wrap:anywhere;max-width:100%}.profile-gift-card .theme-1{background:linear-gradient(130deg,#5845ed,#c950d9 55%,#f492c9)}.profile-gift-card .theme-2{background:linear-gradient(135deg,#095bd4,#00a9b6 60%,#53e6ba)}.profile-gift-card .theme-3{background:linear-gradient(135deg,#d23b69,#ff7446 50%,#f5bb55)}.profile-gift-card .theme-4{background:linear-gradient(135deg,#740d41,#d92269 60%,#f77b92)}.profile-gift-card .theme-5{background:linear-gradient(135deg,#087d99,#8060e8 45%,#e85eb5 75%,#f8ad81)}.profile-gift-card .theme-6{background:linear-gradient(135deg,#151e70,#5839ab 50%,#358cc7)}
.gift-celebration-dialog{width:min(560px,calc(100vw - 24px));max-height:90dvh;overflow:auto;position:fixed;text-align:center;padding:26px}.gift-celebration-dialog .dialog-heading{position:relative;z-index:4}.gift-celebration-dialog .primary{width:100%}#gift-celebration-result{font-size:16px;font-weight:600;color:var(--text);position:relative;z-index:2}#profile-gift-redeem{width:100%;background:linear-gradient(105deg,#8655ed,#c357d6);color:#fff;border:0}.gift-celebration-dialog::backdrop{background:#0008;backdrop-filter:blur(9px)}#gift-confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden;border-radius:inherit;z-index:3}#gift-confetti i{position:absolute;top:-25px;left:var(--x);width:8px;height:15px;border-radius:2px;opacity:0}.gift-opened #gift-confetti i{animation:giftConfetti 2.2s var(--delay) ease-in both}.gift-opened .gift-card{animation:giftReveal 1s cubic-bezier(.16,1,.3,1) both}.profile-dialog .profile-tabs{flex-wrap:wrap}@keyframes giftReveal{0%{opacity:0;transform:perspective(700px) rotateY(-22deg) scale(.65) translateY(25px)}70%{opacity:1;transform:perspective(700px) rotateY(3deg) scale(1.025)}100%{opacity:1;transform:none}}@keyframes giftConfetti{0%{opacity:0;transform:translateY(-20px) rotate(0)}10%{opacity:1}90%{opacity:1}100%{opacity:0;transform:translateY(650px) rotate(var(--spin))}}@media(prefers-reduced-motion:reduce){.gift-opened #gift-confetti i,.gift-opened .gift-card{animation:none}.gift-opened #gift-confetti{display:none}}@media(max-width:600px){.profile-gift-entry{flex-direction:column;align-items:stretch}.profile-gift-card .gift-card{padding:20px}.profile-gift-card .card-code{font-size:12px}.gift-celebration-dialog{padding:20px}}

.profile-gift-card .gift-card h3{display:block!important}
#admin-promos-panel .admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;margin:18px 0 30px}#admin-promos-panel label{display:grid;gap:7px;color:var(--text);font-size:12px}#admin-promos-panel .wide{grid-column:1/-1}#admin-promos-panel input,#admin-promos-panel select,#admin-promos-panel textarea{width:100%}#admin-promos-panel .inline{display:flex;align-items:center;gap:10px;margin:14px 0}#admin-promos-panel .inline input{flex:1;min-width:0}#admin-promos-panel .admin-entry{padding:18px 0;border-bottom:1px solid var(--border)}#admin-promos-panel .admin-entry h3{font-size:14px;font-family:ui-monospace,monospace;overflow-wrap:anywhere;margin:0 0 7px;color:var(--text)}#admin-promos-panel .admin-entry p{font-size:12px;color:var(--muted);margin:6px 0}#admin-promos-panel .gift-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}#admin-promos-panel .admin-entry details{margin-top:10px;font-size:12px}#admin-promos-panel h2{font-size:19px}#admin-promos-panel .primary{margin-top:8px}@media(max-width:600px){#admin-promos-panel .admin-grid{grid-template-columns:1fr}#admin-promos-panel .wide{grid-column:auto}#admin-promos-panel .inline{flex-wrap:wrap}}
#admin-promos-panel [hidden]{display:none!important}[data-theme] .admin-tabs button[aria-selected=true]{background:var(--selected-bg)!important;border-color:var(--selected-border)!important;color:var(--text)!important}#profile-gift-preview{background:linear-gradient(105deg,#8655ed,#c357d6)!important;color:#fff!important;border:0!important}

.models-dialog .has-channel{grid-template-columns:minmax(0,1fr) 234px}.models-dialog .model-channel-controls{min-width:0}.models-dialog .model-channel-controls button{white-space:nowrap}@media(max-width:600px){.models-dialog .has-channel{grid-template-columns:minmax(0,1fr)}.models-dialog .has-channel .model-channel-controls{width:216px}}

[data-theme] #model-expensive-warning{background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--border)!important;border-left:3px solid var(--accent)!important;padding:10px 12px;border-radius:9px}

.chat-search-row{display:flex;align-items:center;gap:6px}.chat-search-row .chat-search{min-width:0;flex:1}.chat-search-row .icon-button{flex-shrink:0;font-size:23px}
[data-theme] .experience-dialog{background:var(--surface)!important;color:var(--text)!important;border:1px solid var(--border)!important;width:min(860px,calc(100vw - 30px));max-height:90dvh;overflow:auto;padding:24px;border-radius:20px}
.token-composition{margin-top:12px;width:100%;font-size:12px}.token-composition summary{cursor:pointer;color:var(--muted)}.token-composition-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}.token-composition-grid>div{display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid var(--border);padding:7px 0}.token-composition-grid strong{white-space:nowrap}.context-status{flex-wrap:wrap}.context-status .token-composition{flex-basis:100%}
.recovery-card{margin:15px 0;padding:16px;background:var(--surface-2);border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:12px;font-size:13px}.recovery-card p{color:var(--muted);line-height:1.5}.resume-price{padding:12px;background:var(--surface-2);border-radius:10px}
#chat-files-list{display:block}.project-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0 20px}.project-folder h3{font-size:14px;color:var(--muted);margin:18px 0 9px}.project-entry{display:flex;gap:10px;align-items:center;margin:9px 0}.project-entry>input{width:18px;height:18px;flex-shrink:0;accent-color:var(--accent)}.project-file{flex:1;min-width:0}.project-file .chat-file-card{margin:0}.project-file>.text-button{margin:3px 0;font-size:11px}.project-workspace{margin:16px 0;padding:12px;background:var(--surface-2);border-radius:10px}.project-workspace>div{font-family:monospace;font-size:12px;word-break:break-all;margin:7px 0}
.search-controls{display:flex;gap:9px;flex-wrap:wrap;margin:16px 0}.search-controls input{flex:1;min-width:160px}.search-hit{display:flex;flex-direction:column;align-items:start;gap:7px;width:100%;text-align:left;padding:14px;margin:8px 0;background:var(--surface-2);color:var(--text);border:1px solid var(--border);border-radius:12px;cursor:pointer}.search-hit small{color:var(--muted)}.search-hit span{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.5}.search-highlight{outline:2px solid var(--accent);outline-offset:5px;border-radius:8px}.version-change{padding:10px;border:1px solid var(--border);border-radius:10px;margin:10px 0}.version-change pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:250px;overflow:auto;background:var(--surface-2);padding:12px}
@media(max-width:600px){.token-composition-grid{grid-template-columns:1fr}.experience-dialog{padding:17px}.project-toolbar button{flex:1}.project-entry .chat-file-actions{flex-wrap:wrap}}

[data-theme] .experience-dialog .secondary,[data-theme] #chat-files-dialog .project-toolbar .secondary,[data-theme] #chat-files-dialog #chat-files-list>button.secondary{background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--border)!important;box-shadow:none!important}.file-folder{font-size:14px!important}

[data-theme] .usage-breakdown{background:var(--surface-2)!important;color:var(--text)!important;border:1px solid var(--border)!important}[data-theme] .usage-breakdown .usage-totals strong{color:var(--text)!important}[data-theme] .usage-breakdown summary,[data-theme] .usage-breakdown p,[data-theme] .usage-breakdown li,[data-theme] .usage-breakdown .usage-totals span{color:var(--muted)!important}

.version-preview-image{display:block;width:100%;max-height:60dvh;object-fit:contain;background:var(--surface-2);border-radius:10px}.version-row{flex-wrap:wrap;gap:8px}

@media(max-width:600px){.project-file .chat-file-card{display:grid!important;grid-template-columns:34px minmax(0,1fr);gap:9px}.project-file .file-type-icon{width:34px;height:34px}.project-file .chat-file-actions{grid-column:1/-1;justify-content:flex-end}.project-file .chat-file-info strong{max-width:100%}#chat-files-dialog .project-toolbar{display:grid;grid-template-columns:1fr 1fr}#chat-files-dialog .project-toolbar>span{grid-column:1/-1}}

.tool-loading-setting{margin:0 0 20px;padding:16px 18px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2)}
.tool-loading-setting label{display:flex;align-items:center;justify-content:space-between;gap:16px;font-weight:600;color:var(--text)}
.tool-loading-setting select{width:auto;min-width:210px;max-width:100%;padding:10px 34px 10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--input-bg,var(--surface));color:var(--text);font:inherit;font-weight:400}
.tool-loading-setting .fine-print{margin:10px 0 0;line-height:1.5}
@media(max-width:600px){.tool-loading-setting label{align-items:stretch;flex-direction:column;gap:10px}.tool-loading-setting select{width:100%;min-width:0}}
