/* Shared neutral palette; model art and user media retain their own colors. */
body{--ui-bg:#101010;--ui-panel:#202020;--ui-field:#2a2a2a;--ui-hover:#383838;--ui-line:#3b3b3b;--ui-text:#efefef;--ui-muted:#a0a0a0}
body[data-account-theme=light]{--ui-bg:#f5f5f5;--ui-panel:#fff;--ui-field:#f0f0f0;--ui-hover:#e4e4e4;--ui-line:#d5d5d5;--ui-text:#242424;--ui-muted:#737373}
body:is(.studio-home,.studio-chat){--studio-bg:var(--ui-bg);--studio-panel:var(--ui-panel);--studio-raised:var(--ui-field);--studio-line:var(--ui-line);--studio-text:var(--ui-text);--studio-muted:var(--ui-muted);--studio-accent:var(--ui-text)}
body.composer-refined :is(.custom-preferences,.conversation-popover,.composer-mode-menu,.reference-menu,.composer-media-preview){background:var(--ui-panel);border-color:var(--ui-line);color:var(--ui-text)}
body.composer-refined :is(.custom-media-tabs,.custom-preferences .studio-param-choices.studio-ratios,.reference-picker-thumb,.custom-inline-dimensions .dimension-input){background:var(--ui-field);border-color:var(--ui-line);color:var(--ui-text)}
body.composer-refined :is(.custom-media-tabs button,.custom-preferences .studio-param-choice,.reference-option,.composer-mode-button,.conversation-tool,.custom-preferences input,.custom-preferences select){color:var(--ui-text);border-color:var(--ui-line)}
body.composer-refined :is(.custom-media-tabs button[aria-selected=true],.custom-preferences .studio-param-choice[aria-pressed=true],.reference-option:hover,.composer-mode-choice:hover){background:var(--ui-hover);color:var(--ui-text)}
body.composer-refined :is(.custom-model-field,.custom-way-field,.custom-agent-model,.custom-preferences legend,.custom-note,.custom-preferences p){color:var(--ui-muted)}
body.composer-refined .custom-preferences select{background:var(--ui-field)}
body.composer-refined :is(.conversation-model-option,.conversation-model-option strong,.conversation-way-option,.studio-param-choice){color:var(--ui-text)}
body.composer-refined :is(.conversation-model-option[aria-checked=true],.conversation-model-option:hover,.conversation-way-option[aria-checked=true]){background:var(--ui-hover)}
body.composer-refined :is(.conversation-model-copy small,.conversation-popover-title,.conversation-empty){color:var(--ui-muted)}
body.composer-refined .custom-preferences .studio-ratio-shape{border-color:var(--ui-muted)!important}
body.home-refined.studio-home #mode-trigger{color:var(--ui-text)!important}
body.home-refined :is(.home-tool-popover,#home-tool-popover){overflow:auto;z-index:140}
body .downward-native{display:none!important}
body .downward-select{display:block;width:100%;min-width:0;min-height:35px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 10px;background:var(--ui-field);color:var(--ui-text);border:1px solid var(--ui-line);border-radius:7px;font:12px/1.5 inherit;cursor:pointer}
.downward-options{z-index:1450;margin:0;padding:6px;background:var(--ui-panel);color:var(--ui-text);border:1px solid var(--ui-line);border-radius:10px;box-shadow:0 16px 45px #0006;box-sizing:border-box}
.downward-options button{width:100%;display:block;padding:10px 12px;text-align:left;background:none;border:0;color:inherit;border-radius:6px;font:12px/1.5 inherit;cursor:pointer}
.downward-options button:hover,.downward-options button[aria-selected=true]{background:var(--ui-hover)}
.downward-options button:disabled{opacity:.4;cursor:not-allowed}
.downward-options button:focus-visible,.downward-select:focus-visible{outline:2px solid var(--ui-muted);outline-offset:-2px}
.home-refined .poster-showcase{padding-top:34px}
.home-refined .poster-showcase .model-section-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:22px}
.home-refined .poster-showcase h2{font-size:24px;letter-spacing:.02em;margin:9px 0 0;color:var(--ui-text)}
.home-refined .poster-showcase .model-posters{display:grid;grid-template-columns:minmax(0,1fr);gap:28px;align-items:stretch}
.home-refined .poster-showcase .model-poster{display:flex;flex-direction:column;position:relative;width:100%;max-width:none;align-self:stretch;min-height:0;margin:0!important;transform:none!important;overflow:hidden;border:1px solid var(--ui-line);border-radius:16px;background:var(--ui-panel);box-shadow:none}
.home-refined .poster-showcase .model-poster-art{display:block;width:100%;height:auto;aspect-ratio:1672/941;object-fit:contain;position:static;filter:none;opacity:1}
.home-refined .poster-showcase .poster-copy{position:static;inset:auto;display:flex;flex:1;flex-direction:row;align-items:center;justify-content:space-between;padding:16px 22px;gap:16px;background:none;color:var(--ui-text);text-shadow:none}
.home-refined .poster-showcase .poster-copy small{font-size:10px;letter-spacing:.12em;color:var(--ui-muted)}
.home-refined .poster-showcase .poster-copy h3{font-size:23px;line-height:1.3;margin:0;font-weight:600;color:var(--ui-text)}
.home-refined .poster-showcase .poster-copy p{font-size:12px;line-height:1.7;margin:0;color:var(--ui-muted)}
.home-refined .poster-showcase .poster-action{align-self:flex-start;margin:10px 0 0;padding:6px 0;background:none;border:0;color:var(--ui-text);font:12px/1.5 inherit;cursor:pointer}
.home-refined .poster-showcase .model-poster::before,.home-refined .poster-showcase .model-poster::after{display:none}
.invitation-content{padding:8px 0 6px}.invitation-code{display:block;width:100%;padding:18px 10px;margin:20px 0;font:600 27px/1.5 monospace;letter-spacing:.12em;text-align:center;color:var(--account-text);background:var(--account-card);border:1px solid var(--account-line);border-radius:12px;box-sizing:border-box}
.invitation-actions{display:flex;gap:10px;flex-wrap:wrap}.invitation-summary{padding:18px 0 0;margin-top:22px;border-top:1px solid var(--account-line);font-size:13px}.invitation-dialog{max-width:500px}.invite-login-label{margin-top:10px}.invite-login-label small{font-size:11px;font-weight:400;color:#929292}#login-invitation{text-transform:uppercase}
/* Canvas uses the account preference, including the initial server-rendered theme. */
body.canvas-workspace{color-scheme:dark;--canvas-bg:var(--ui-bg);--canvas-panel:var(--ui-panel);--canvas-border:var(--ui-line);--canvas-muted:var(--ui-muted);--canvas-teal:var(--ui-text);background:var(--ui-bg);color:var(--ui-text)}
body.canvas-workspace[data-account-theme=light]{color-scheme:light}
body.canvas-workspace .canvas-app{background:var(--ui-bg)}
body.canvas-workspace #canvas-viewport{background-color:var(--ui-bg)!important;background-image:radial-gradient(var(--ui-line) .7px,transparent .7px)!important;background-size:22px 22px!important}
body.canvas-workspace .account-actions{display:flex;align-items:center;gap:7px;pointer-events:auto}
body.canvas-workspace :is(.account-header-button,.account-profile-trigger){height:34px;padding:0 10px;font-size:12px}
body.canvas-workspace .account-profile-trigger{width:34px;padding:3px;gap:0}.canvas-workspace .account-profile-trigger .account-avatar{width:26px;height:26px}.canvas-workspace .account-trigger-name,.canvas-workspace .account-profile-trigger>svg{display:none}
body.canvas-workspace .canvas-brandline{max-width:55%;border-color:var(--ui-line)}
body.canvas-workspace .canvas-topbar{z-index:50}
body.canvas-workspace .connection-flow{stroke:var(--ui-text);filter:none}
.canvas-history-trigger svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;display:block}
.account-surface .canvas-history-dialog{width:min(1500px,calc(100vw - 40px));max-width:calc(100vw - 40px);height:min(900px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);padding:0;border-radius:22px;overflow:hidden;box-sizing:border-box}
.canvas-history-dialog[open]{display:flex;flex-direction:column}.canvas-history-dialog .account-dialog-heading{flex-shrink:0;margin:0;padding:22px 24px;border-bottom:1px solid var(--account-line)}
.canvas-history-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:18px 24px;flex-shrink:0}.history-segments{display:flex;gap:3px;background:var(--account-card);border-radius:9px;padding:3px}
.history-segments button{background:none;border:0;color:var(--account-muted);font:12px/1.5 inherit;padding:7px 11px;border-radius:7px;cursor:pointer}.history-segments button[aria-pressed=true]{background:var(--account-hover);color:var(--account-text)}
.canvas-history-toolbar select{margin-left:auto;background:var(--account-card);color:var(--account-text);border:1px solid var(--account-line);padding:8px;border-radius:8px}.canvas-history-toolbar input{width:100px;accent-color:#999}
.canvas-history-body{flex:1;min-height:0;overflow:auto;padding:0 24px 24px}.history-date{margin:0 0 28px}.history-date h3{font-size:13px;font-weight:600;margin:8px 0 14px}.history-thumbnails{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--history-size,170px)),1fr));gap:12px}
.history-thumbnail{display:block;min-width:0;position:relative;aspect-ratio:1;background:var(--account-card);border:1px solid var(--account-line);border-radius:10px;padding:0;overflow:hidden;color:var(--account-text);cursor:pointer}
.history-thumbnail>img,.history-thumbnail>video{width:100%;height:100%;object-fit:cover}.history-thumbnail small{position:absolute;bottom:0;left:0;right:0;padding:25px 10px 9px;background:linear-gradient(transparent,#000c);color:#fff;text-align:left;font-size:11px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.history-text-preview{display:block;padding:20px;font-size:13px;text-align:left;line-height:1.8}
.history-empty{padding:70px 20px;text-align:center;color:var(--account-muted);font-size:13px}.canvas-history-dialog>.account-secondary{margin:0 24px 16px;align-self:center}.history-preview{max-width:min(1000px,90vw)}.history-preview-media{display:grid;place-items:center;min-height:160px;margin:12px 0 20px}.history-preview-media :is(img,video){max-width:100%;max-height:65vh;object-fit:contain}.history-preview-media pre{white-space:pre-wrap;word-break:break-word;max-height:65vh;overflow:auto;color:var(--account-text)}
@media(max-width:1000px){.home-refined .poster-showcase .model-posters{grid-template-columns:minmax(0,1fr)}.canvas-history-toolbar{gap:8px;padding:12px}.canvas-history-body{padding:0 12px 12px}}
@media(max-width:600px){.home-refined .poster-showcase .model-posters{grid-template-columns:1fr}.home-refined .poster-showcase .model-section-head{align-items:start;flex-direction:column;gap:8px}.home-refined .poster-showcase .poster-copy h3{font-size:21px}.canvas-workspace .account-member-entry svg{display:none}.canvas-workspace .account-header-button{padding:0 7px!important}.canvas-workspace .canvas-brandline{max-width:42%!important}.canvas-workspace .project-name-input{max-width:18vw}.account-surface .canvas-history-dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}.canvas-history-toolbar input{display:none}.history-segments button{font-size:11px;padding:6px 8px}.history-thumbnails{grid-template-columns:repeat(2,minmax(0,1fr))}}

body.canvas-workspace:not([data-account-theme=light]){--cw-f4f4f4:#101010;--cw-ffffff:#202020;--cw-e5e5e5:#2a2a2a;--cw-8c8c8c:#808080;--cw-353535:#e4e4e4;--cw-333333:#e4e4e4;--cw-444444:#b9b9b9;--cw-eeeeee:#2a2a2a;--cw-666666:#9b9b9b;--cw-dddddd:#2a2a2a;--cw-ededed:#2a2a2a;--cw-656565:#9b9b9b;--cw-999999:#808080;--cw-748c80:#808080;--cw-555555:#b9b9b9;--cw-f3f3f3:#101010;--cw-e9e9e9:#2a2a2a;--cw-a8a8a8:#808080;--cw-7c7c7c:#9b9b9b;--cw-777777:#9b9b9b;--cw-cccccc:#3c3c3c;--cw-e7e7e7:#2a2a2a;--cw-888888:#808080;--cw-a6a6a6:#808080;--cw-7d7d7d:#9b9b9b;--cw-bac5cc:#3c3c3c;--cw-f0f0f0:#101010;--cw-fafafa:#202020;--cw-e4e4e4:#2a2a2a;--cw-f5f5f5:#101010;--cw-f7f7f7:#101010;--cw-f3f4f4:#101010;--cw-aaaaaa:#808080;--cw-f8f8f8:#101010;--cw-e8e8e8:#2a2a2a;--cw-e0e0e0:#2a2a2a;--cw-f1f1f1:#101010;--cw-eaf4f6:#101010;--cw-292929:#e4e4e4;--cw-eaeaea:#2a2a2a;--cw-b5b5b5:#3c3c3c;--cw-f6f6f6:#101010;--cw-c8c8c8:#3c3c3c;--cw-f2f2f2:#101010;--cw-222222:#e4e4e4;--cw-252525:#e4e4e4;--cw-e1e1e1:#2a2a2a;--cw-686868:#9b9b9b;--cw-bcbcbc:#3c3c3c;--cw-b0b0b0:#808080;--cw-d8d8d8:#3c3c3c;--cw-efefef:#2a2a2a;--cw-151515:#e4e4e4;--cw-d9d9d9:#3c3c3c;--cw-aeb9c0:#3c3c3c;--cw-bbc0c3:#3c3c3c;--cw-d3d8dc:#3c3c3c;--cw-92999f:#808080;--cw-f0f2f4:#101010;--cw-535960:#b9b9b9;--cw-7d858e:#808080;--cw-454d55:#b9b9b9;}

body.canvas-workspace:not([data-account-theme=light]) :is(input,textarea,select){color-scheme:dark}
body.canvas-workspace:not([data-account-theme=light]) .brand-mark img{filter:none}

body.composer-refined :is(.custom-preferences,.conversation-popover) :is(select,input:not([type=range]),.downward-select){background:var(--ui-field)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important;color-scheme:dark}
body.composer-refined[data-account-theme=light] :is(.custom-preferences,.conversation-popover) :is(select,input:not([type=range]),.downward-select){color-scheme:light}
body.composer-refined :is(.custom-preferences,.conversation-popover) select option{background:var(--ui-field);color:var(--ui-text)}
.home-refined .poster-showcase .poster-copy h3{font-size:16px}
.home-refined .poster-showcase .poster-action{flex:none;align-self:center;margin:0;padding:8px 14px;border:1px solid var(--ui-line);border-radius:8px;white-space:nowrap}
.home-refined .poster-showcase .poster-action:hover{background:var(--ui-hover)}
.legacy-audio-notice{font-size:13px;line-height:1.8;color:var(--ui-muted)}.legacy-audio-notice a{margin-left:12px;color:var(--ui-text)}
@media(max-width:600px){.home-refined .poster-showcase .poster-copy{padding:12px;gap:8px}.home-refined .poster-showcase .poster-copy h3{font-size:14px}.home-refined .poster-showcase .poster-action{font-size:11px;padding:7px 10px}}

/* v46: shared composer states override legacy fixed colors, including hover. */
body.composer-refined{--ui-disabled:#a0a0a0}
body.composer-refined[data-account-theme=light]{--ui-muted:#616161;--ui-disabled:#686868}
body.composer-refined :is(.conversation-tool,#composer-mode-button,#mode-trigger,.conversation-chevron,.conversation-check,.composer-mode-choice>i,.conversation-mode-icon){color:var(--ui-text)!important}
body.composer-refined :is(.conversation-tool,#composer-mode-button,#mode-trigger):is(:hover,[aria-expanded=true]){background:var(--ui-hover)!important}
body.composer-refined .conversation-ratio-icon{border-color:currentColor}
body.composer-refined :is(.conversation-popover,.custom-preferences,.composer-mode-menu,.reference-menu,.downward-options){background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
body.composer-refined :is(.composer-mode-choice,.conversation-model-option,.conversation-way-option,.reference-option,.downward-options button){background:transparent!important;color:var(--ui-text)!important}
body.composer-refined :is(.composer-mode-choice,.conversation-model-option,.conversation-way-option,.reference-option,.downward-options button):is([aria-checked=true],[aria-selected=true],:hover:not(:disabled),:focus-visible){background:var(--ui-hover)!important;color:var(--ui-text)!important}
body.composer-refined :is(.conversation-model-option,.conversation-way-option,.downward-options button):disabled{opacity:1;color:var(--ui-disabled)!important}
body.composer-refined :is(.conversation-model-option,.conversation-way-option):disabled :is(strong,small,.conversation-mode-icon){color:var(--ui-disabled)!important}
body.composer-refined :is(.conversation-way-option small,.conversation-basic-title,.conversation-popover-title,.conversation-model-copy small,.mode-menu-title,.custom-note,.custom-empty,.custom-model-field,.custom-way-field,.custom-agent-model,.custom-preferences legend,.conversation-popover legend,.conversation-duration-limits,.conversation-duration small){color:var(--ui-muted)!important;border-color:var(--ui-line)}
body.composer-refined :is(.conversation-model-option>.conversation-mode-icon,.conversation-popover .studio-param-choices,.custom-preferences .studio-param-choices,.custom-media-tabs){background:var(--ui-field)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
body.composer-refined :is(.conversation-popover,.custom-preferences) .studio-param-choice{background:transparent!important;color:var(--ui-text)!important;border-color:transparent!important}
body.composer-refined :is(.conversation-popover,.custom-preferences) .studio-param-choice:is([aria-pressed=true],:hover:not(:disabled)){background:var(--ui-hover)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
body.composer-refined .studio-ratio-shape{border-color:var(--ui-muted)!important}
body.composer-refined :is(.conversation-popover,.custom-preferences) :is(select,input:not([type=range]),.downward-select){color:var(--ui-text)!important;background:var(--ui-field)!important;border-color:var(--ui-line)!important;accent-color:var(--ui-muted)}
body.composer-refined :is(.conversation-popover,.custom-preferences) input::placeholder{color:var(--ui-muted);opacity:1}
body.composer-refined :is(.conversation-search-toggle,.studio-close){color:var(--ui-muted);background:transparent;border-color:var(--ui-line)}
body.composer-refined .conversation-search-toggle:hover{background:var(--ui-hover);color:var(--ui-text)}
body.composer-refined .conversation-duration input[type=range]{background:linear-gradient(to right,var(--ui-muted) var(--duration-fill),var(--ui-line) var(--duration-fill))}
body.composer-refined .conversation-duration input[type=range]::-webkit-slider-thumb{background:var(--ui-text)}
body.composer-refined .conversation-duration output{background:var(--ui-field);color:var(--ui-text)}
body.composer-refined :is(.conversation-tool,.conversation-popover button,.conversation-popover input,.custom-preferences button,.custom-preferences input):focus-visible{outline-color:var(--ui-muted)}
body.composer-refined .custom-preferences[data-media-tab=video] .custom-video-resolution{order:1;grid-column:1}
body.composer-refined .custom-preferences[data-media-tab=video] .custom-model-field{order:1;grid-column:2}
body.composer-refined .custom-video-audio{display:flex;align-items:center;justify-content:flex-end;gap:9px;margin:14px 0 0;padding:0;color:var(--ui-text);font-size:12px}
body.composer-refined .custom-video-audio label{color:inherit;margin:0;cursor:pointer}
body.composer-refined .custom-video-audio input[type=checkbox]{appearance:auto;width:16px;height:16px;margin:0;flex:none;cursor:pointer}
body.composer-refined .custom-agent-model{border-color:var(--ui-line)}
.conversation-header-actions{display:flex;justify-self:end;align-items:center;gap:18px;min-width:0}
.conversation-balance{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--ui-line);border-radius:9px;background:var(--ui-panel);color:var(--ui-text);font-size:12px;text-decoration:none;white-space:nowrap;font-variant-numeric:tabular-nums}
.conversation-balance:hover{background:var(--ui-hover)}.conversation-balance small{font-size:11px;color:var(--ui-muted)}
@media(max-width:640px){.conversation-header-actions{gap:10px}.conversation-balance{padding:7px 9px;gap:5px}.conversation-balance small{display:none}.agent-page .agent-brand img.site-full-brand{width:110px!important}.agent-page .agent-topbar{padding:0 12px}}
