:root{color-scheme:dark;--bg:#000000;--surface:#191919;--surface-raised:#242424;--text:#eff2ff;--soft:#a5abc7;--muted:#777f9f;--line:rgba(162,167,220,.13);--violet:#a194ff;--blue:#6aabff;--mint:#67d7d7;--danger:#ff98ab;--ribbon-height:42px;font-family:"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-width:320px;color:var(--text);background:var(--bg);font-size:14px;line-height:1.6}button,input,textarea{font:inherit}button{cursor:pointer}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button:disabled{cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--violet);outline-offset:4px}a{color:inherit}[hidden]{display:none!important}.icon{display:inline-block;flex:0 0 auto;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip-link{position:fixed;left:20px;top:-70px;z-index:100;padding:10px 16px;background:var(--surface-raised);border:1px solid var(--violet);border-radius:10px;text-decoration:none}.skip-link:focus{top:8px}.noscript-notice{padding:15px;text-align:center;background:#3a1830}
#ambient-canvas,.scene-glow{position:fixed;inset:0;pointer-events:none;z-index:0}#ambient-canvas{width:100%;height:100%;opacity:.36}.scene-glow{inset:auto;filter:blur(90px);border-radius:50%;opacity:.13}.scene-glow-violet{width:450px;height:450px;background:#693eee;top:8%;left:25%}.scene-glow-blue{width:380px;height:380px;background:#3f67cc;right:5%;bottom:1%}
.development-ribbon{position:relative;z-index:20;min-height:var(--ribbon-height);display:flex;align-items:center;justify-content:center;gap:20px;padding:8px 20px;background:rgba(39,28,67,.95);border-bottom:1px solid rgba(175,143,255,.22);color:#c4b4e4;font-size:11px;letter-spacing:.01em}.development-ribbon>span{display:flex;align-items:center;gap:10px}.development-ribbon i{width:3px;height:3px;border-radius:50%;background:#8f78b8}.development-badge{font-weight:600;color:#e1d3ff}.development-badge>span{width:5px;height:5px;border-radius:50%;background:#bd95ff;box-shadow:0 0 10px #be99ff}.ribbon-extra{padding-left:18px;border-left:1px solid rgba(195,166,255,.19)}
.workbench{position:relative;z-index:1;display:grid;grid-template-columns:238px minmax(0,1fr) 278px;height:calc(100dvh - var(--ribbon-height));min-height:620px;max-width:1920px;margin:auto}.sidebar{position:relative;display:flex;flex-direction:column;min-width:0;padding:30px 18px 18px;border-right:1px solid var(--line);background:rgba(10,11,24,.86)}.brand{display:flex;align-items:center;gap:12px;padding:0 8px;text-decoration:none}.brand-mark{position:relative;display:grid;place-items:center;width:45px;height:45px;flex:0 0 auto;border:1px solid rgba(165,137,255,.36);border-radius:14px;color:#d5c7ff;background:linear-gradient(140deg,rgba(137,98,255,.28),rgba(76,70,130,.08));box-shadow:inset 0 0 12px rgba(148,107,255,.13),0 0 23px rgba(125,77,236,.12)}.brand-mark .icon{width:26px;height:26px}.brand strong{display:block;font-size:24px;font-weight:700;line-height:1.2;letter-spacing:.03em}.brand small{display:block;margin-top:5px;color:var(--muted);font-size:8px;letter-spacing:.15em}.workspace-label{display:flex;align-items:center;justify-content:space-between;padding:0 9px;margin:33px 0 11px;color:var(--muted);font-size:11px}.local-label{font-size:8px;letter-spacing:.16em;padding:2px 6px;border:1px solid var(--line);border-radius:4px}.new-chat-button{display:flex;align-items:center;gap:11px;min-height:49px;padding:11px 14px;color:#ddd6ff;background:linear-gradient(105deg,rgba(111,81,204,.25),rgba(111,81,204,.08));border:1px solid rgba(155,131,245,.34);border-radius:12px;font-weight:600;text-align:left;transition:border-color .2s,background .2s}.new-chat-button:hover:not(:disabled){border-color:rgba(184,164,255,.6);background:rgba(132,99,219,.25)}.new-chat-button:disabled{opacity:.55}.new-chat-button .icon{width:19px;height:19px}.shortcut-key{margin-left:auto;border:1px solid var(--line);border-radius:4px;padding:0 5px;color:var(--muted);font-size:10px}.history-section{flex:1;min-height:0;margin-top:28px;display:flex;flex-direction:column}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}.section-heading h2,.section-heading h3{margin:0;font-size:12px;font-weight:600;letter-spacing:.01em;color:var(--soft)}.section-heading>span{color:var(--muted);font-size:10px;padding-right:5px}.conversation-list{overflow:auto;min-height:0;padding:2px 0;scrollbar-width:thin;scrollbar-color:#303253 transparent}.empty-copy{padding:13px 5px;margin:0;color:var(--muted);font-size:11px;line-height:1.9}.history-item{display:flex;align-items:center;border:1px solid transparent;border-radius:10px;margin:4px 0;padding:3px;gap:3px;transition:background .2s}.history-item:hover{background:rgba(161,147,244,.06)}.history-item.is-active{background:rgba(123,105,190,.13);border-color:rgba(158,140,244,.19)}.history-open{display:flex;flex:1;gap:10px;align-items:center;min-width:0;padding:10px 5px;border:0;background:transparent;text-align:left;color:var(--soft)}.history-open>.icon{width:17px;height:17px;color:#8184aa}.history-open>span{min-width:0}.history-open strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;color:var(--text)}.history-open small{display:block;font-size:9px;color:var(--muted);margin-top:3px}.history-open:disabled{opacity:.5}.history-delete{width:28px;height:32px;padding:4px;border:0;border-radius:7px;color:var(--muted);background:transparent;opacity:.55}.history-delete .icon{width:15px;height:15px}.history-delete:hover:not(:disabled){opacity:1;color:var(--danger);background:rgba(255,115,145,.09)}.history-delete:disabled{opacity:.3}.sidebar-bottom{margin-top:18px}.local-card{display:flex;gap:11px;align-items:center;padding:13px 10px;border:1px solid var(--line);border-radius:12px;background:rgba(130,138,196,.025)}.local-card>.icon{width:19px;height:19px;color:#8b86b5}.local-card strong{font-size:11px;font-weight:500;color:#b0b3ce}.local-card p{font-size:9px;margin:3px 0 0;color:var(--muted)}.account-card{display:flex;align-items:center;gap:10px;width:100%;margin-top:15px;padding:11px 8px;border:0;background:transparent;color:var(--text);text-align:left;border-radius:10px}.account-card:hover{background:rgba(130,138,196,.06)}.user-avatar{overflow:hidden;display:grid;place-items:center;width:33px;height:33px;flex:0 0 auto;border:1px solid rgba(137,151,229,.22);border-radius:10px;color:#cbc7ee;background:linear-gradient(145deg,#232644,#181b31);font-size:12px}.account-card>span:nth-child(2){flex:1;min-width:0}.account-card strong{display:block;overflow:hidden;text-overflow:ellipsis;font-size:12px;white-space:nowrap;font-weight:600}.account-card small{display:block;font-size:9px;color:var(--muted);margin-top:3px}.account-card>.icon{width:15px;height:15px;color:var(--muted)}
.workspace{min-width:0;min-height:0;display:flex;flex-direction:column;background:linear-gradient(165deg,rgba(42,40,78,.05),rgba(15,17,34,.12))}.topbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:23px 30px;border-bottom:1px solid var(--line);min-height:94px;flex-shrink:0}.topbar-title{display:flex;align-items:center;gap:12px;min-width:0}.overline{margin:0 0 4px;color:var(--muted);font-size:8px;font-weight:600;letter-spacing:.17em}.topbar h1{margin:0;font-size:19px;letter-spacing:-.01em;font-weight:600;white-space:nowrap}.topbar h1>span{display:inline-block;margin-left:9px;padding:1px 6px;border:1px solid rgba(161,145,233,.2);border-radius:5px;color:#9d96bd;font-size:9px;font-weight:400;vertical-align:middle}.topbar-actions{display:flex;align-items:center;gap:16px}.service-indicator{color:var(--muted);font-size:10px;white-space:nowrap}.service-indicator.is-ready{color:#9bafc6}.service-indicator.is-error{color:var(--danger)}.login-button{border:1px solid rgba(174,156,237,.23);border-radius:9px;padding:8px 13px;background:rgba(143,113,225,.07);color:#d0c8ee;font-size:11px;white-space:nowrap}.login-button:hover{border-color:rgba(174,156,237,.55)}.icon-button{display:grid;place-items:center;flex:0 0 auto;width:32px;height:32px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);padding:5px}.icon-button .icon{width:18px;height:18px}.icon-button:hover:not(:disabled){border-color:var(--line);background:rgba(141,139,197,.06);color:var(--text)}.icon-button:disabled{opacity:.4}.menu-button,.sidebar-close{display:none}.notice{display:flex;gap:10px;align-items:center;flex-shrink:0;margin:12px 25px 0;padding:10px 12px;border:1px solid rgba(139,132,238,.3);background:#1c1c36;border-radius:10px;color:#c6c4e3;font-size:11px;overflow-wrap:anywhere}.notice>.icon{width:16px;height:16px}.notice>span{flex:1;min-width:0}.notice.is-error{border-color:rgba(245,127,157,.3);background:#281928;color:#f2b8c8}.notice .icon-button{width:25px;height:25px}.text-button{border:0;padding:5px 0;color:#c5b7ff;background:transparent;font-size:11px;white-space:nowrap}.text-button:hover{color:var(--text)}.text-button:disabled{opacity:.45}.text-button.subtle{color:var(--muted)}
.conversation{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}.message-stream{flex:1;min-height:0;overflow:auto;padding:25px 32px 24px;scrollbar-width:thin;scrollbar-color:#303253 transparent;scroll-behavior:smooth}.welcome-state{max-width:720px;margin:0 auto;padding:10px 0 12px;text-align:center}.hero-overline{display:flex;justify-content:center;align-items:center;gap:10px;font-size:8px;letter-spacing:.23em;color:#8c80b3}.hero-overline>span{width:3px;height:3px;background:#bca5ff;box-shadow:0 0 12px #ac8cef;border-radius:50%}.hero-core{position:relative;width:210px;height:183px;margin:8px auto 17px}.core-halo{position:absolute;inset:22px;background:radial-gradient(circle,rgba(133,95,255,.2),rgba(75,109,240,.03) 56%,transparent 70%);filter:blur(14px);transform:scale(1.5)}.core-sphere{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);display:grid;place-items:center;width:81px;height:81px;border-radius:50%;border:1px solid rgba(188,165,255,.4);background:radial-gradient(ellipse at 32% 25%,#dbbaff 0,#9171d0 12%,#4e378f 35%,#292455 66%,#0d1430 90%);box-shadow:inset -13px -12px 25px rgba(3,7,26,.5),inset 9px 7px 21px rgba(188,163,255,.25),0 0 35px rgba(131,84,236,.28),0 0 80px rgba(91,84,232,.13);color:#ede2ff}.core-sphere .icon{width:36px;height:36px;filter:drop-shadow(0 0 9px rgba(223,205,255,.6))}.core-orbit{position:absolute;left:50%;top:45%;width:160px;height:160px;transform:translate(-50%,-50%);border:1px solid rgba(170,138,247,.18);border-radius:50%}.orbit-one{border-color:rgba(137,129,221,.18)}.orbit-two{width:206px;height:87px;transform:translate(-50%,-50%) rotate(-26deg);border-color:rgba(154,118,246,.48);box-shadow:0 0 12px rgba(107,76,210,.06)}.orbit-three{width:192px;height:80px;transform:translate(-50%,-50%) rotate(35deg);border-color:rgba(83,154,228,.32)}.core-caption{position:absolute;bottom:-2px;left:0;right:0;text-align:center;font-size:7px;letter-spacing:.23em;color:#84749f}.core-point{position:absolute;width:5px;height:5px;border-radius:50%;background:#bba0ff;box-shadow:0 0 15px #a78be1}.point-one{top:105px;left:20px}.point-two{top:25px;right:28px;width:3px;height:3px;background:#9edcff}.welcome-greeting{margin:0 0 12px;color:#a5a1c0;font-size:12px}.welcome-state h2{margin:0;font-size:clamp(30px,3.4vw,51px);line-height:1.33;font-weight:700;letter-spacing:-.035em}.welcome-state h2>span{color:#c4b5fd;background:linear-gradient(105deg,#dbceff 10%,#a293ed 55%,#80b5ea);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}.welcome-subtitle{margin:19px 0 26px;color:var(--soft);font-size:12px;line-height:1.95}.welcome-subtitle>span{color:#85809e;font-size:10px}.quick-prompts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-width:640px;margin:0 auto}.prompt-card{position:relative;min-width:0;padding:15px 13px 16px;border:1px solid var(--line);border-radius:13px;background:linear-gradient(140deg,rgba(126,111,204,.085),rgba(21,25,47,.3));color:var(--text);text-align:left;transition:transform .2s,border-color .2s,background .2s}.prompt-card:hover{transform:translateY(-3px);border-color:rgba(164,140,244,.46);background:rgba(109,87,180,.15)}.prompt-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;margin-bottom:11px;border:1px solid rgba(174,142,243,.16);color:#b5a3e9;background:rgba(133,96,211,.08)}.prompt-icon .icon{width:18px;height:18px}.prompt-icon.blue{color:#8bb6ea;border-color:rgba(119,165,226,.18);background:rgba(83,132,209,.09)}.prompt-icon.mint{color:#81c5c4;border-color:rgba(91,183,182,.16);background:rgba(60,168,164,.07)}.prompt-card strong{display:block;font-size:12px;font-weight:500;margin-bottom:5px}.prompt-card small{display:block;color:var(--muted);font-size:9px;line-height:1.8}.prompt-arrow{position:absolute;right:12px;top:22px;width:15px;height:15px;color:#737192}.messages{max-width:780px;margin:auto}.message{margin:0 0 22px;display:flex;align-items:flex-start;gap:12px}.message-avatar{display:grid;place-items:center;width:29px;height:29px;flex:0 0 auto;border:1px solid var(--line);border-radius:9px;background:#1b1c35;color:#c4b3ee;font-size:10px}.message-avatar .icon{width:16px;height:16px}.message-body{max-width:calc(100% - 41px);min-width:0}.message-meta{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:7px;color:var(--muted);font-size:10px}.message-name{color:#aaa8c5;font-weight:500}.message-content{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;font-size:13px;color:#dddff1;margin:0;background:rgba(25,28,50,.6);padding:13px 16px;border:1px solid var(--line);border-radius:0 13px 13px 13px}.message-user{flex-direction:row-reverse}.message-user .message-meta{justify-content:flex-end}.message-user .message-content{background:rgba(111,81,176,.17);border-color:rgba(153,125,225,.19);border-radius:13px 0 13px 13px}.demo-reply-badge{display:inline-block;border:1px solid rgba(167,137,224,.18);border-radius:4px;padding:1px 6px;color:#9e90b7;font-size:8px}.pending-message .message-content{opacity:.65}.pending-status{font-size:9px;color:#aba0bf}.stream-loading{padding:45px 0;text-align:center;color:var(--muted);font-size:12px}.loading-dots{display:inline-flex;gap:4px;margin-right:8px}.loading-dots i{width:4px;height:4px;background:#a594db;border-radius:50%;animation:loading-pulse 1.4s infinite}.loading-dots i:nth-child(2){animation-delay:.15s}.loading-dots i:nth-child(3){animation-delay:.3s}
.composer-zone{flex-shrink:0;width:100%;max-width:850px;margin:0 auto;padding:0 30px 20px}.composer{border:1px solid rgba(159,147,220,.27);border-radius:16px;background:linear-gradient(120deg,rgba(27,29,53,.98),rgba(18,22,40,.98));box-shadow:0 15px 50px rgba(0,0,0,.15),inset 0 1px 0 rgba(234,220,255,.03);transition:border-color .2s,box-shadow .2s}.composer:focus-within{border-color:rgba(176,149,250,.61);box-shadow:0 0 0 3px rgba(148,102,224,.05),0 15px 45px rgba(0,0,0,.15)}.composer textarea{display:block;width:100%;resize:none;min-height:70px;max-height:170px;padding:20px 19px 10px;border:0;background:transparent;color:var(--text);outline:none;font-size:13px;line-height:1.7;scrollbar-width:thin}.composer textarea:focus-visible{outline:none}.composer textarea::placeholder{color:#8288a7}.composer-toolbar{display:flex;align-items:center;justify-content:space-between;padding:0 12px 12px;gap:10px}.composer-mode{display:flex;align-items:center;gap:6px;color:#b1a6d3;font-size:10px}.composer-mode>.icon{width:15px;height:15px}.composer-mode>span{border-left:1px solid var(--line);padding-left:8px;margin-left:3px;color:#787593;font-size:9px}.composer-controls{display:flex;align-items:center;gap:11px}.voice-button{display:flex;align-items:center;gap:4px;color:#646a86;background:transparent;border:0;font-size:8px}.voice-button .icon{width:19px;height:19px}.send-button{display:grid;place-items:center;width:36px;height:36px;border:1px solid rgba(199,178,255,.35);border-radius:10px;color:#f4edff;background:linear-gradient(140deg,#9670e3,#6154b9);box-shadow:0 3px 16px rgba(117,80,200,.17);transition:filter .2s,transform .2s}.send-button .icon{width:18px;height:18px}.send-button:hover:not(:disabled){filter:brightness(1.17);transform:translateY(-1px)}.send-button:disabled{opacity:.35;box-shadow:none}.send-button.is-busy .icon{animation:send-breathe 1.3s ease-in-out infinite}.composer-footnote{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-top:9px;color:#676c8a;font-size:9px;line-height:1.6}.composer-footnote>span:last-child{flex:0 0 auto}.pending-request{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px;padding:11px 13px;border:1px solid rgba(231,173,126,.23);border-radius:11px;background:rgba(127,85,51,.09);color:#d7b8a7;font-size:11px}.pending-request strong{font-weight:500}.pending-request p{font-size:9px;margin:3px 0 0;color:#a294a2}.pending-request>div:last-child{display:flex;gap:14px;flex:0 0 auto}
.account-panel{padding:28px 21px;border-left:1px solid var(--line);background:rgba(12,14,29,.64);overflow:auto;scrollbar-width:thin;scrollbar-color:#303253 transparent}.panel-heading h2{margin:0;color:#e1e3f2;font-size:18px;font-weight:600}.panel-heading>p:last-child{margin:9px 0 24px;color:var(--muted);font-size:11px;overflow-wrap:anywhere}.credits-card{position:relative;padding:20px 18px;border:1px solid rgba(156,131,226,.23);border-radius:15px;background:radial-gradient(ellipse at 100% 0,rgba(117,81,219,.15),transparent 70%),linear-gradient(150deg,#1d1b35,#14172b)}.credits-topline{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#b3aacd;font-size:11px}.credits-topline .icon{width:19px;height:19px;color:#aa92db}.credits-value{display:flex;align-items:baseline;gap:9px;margin-top:15px}.credits-value strong{font-size:42px;line-height:1.2;letter-spacing:-.06em;color:#e5dafa;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0}.credits-value>span{font-size:10px;color:#9286af;flex:0 0 auto}.credits-card>p{margin:10px 0 19px;font-size:9px;color:#91849f}.payment-button{width:100%;padding:10px 8px;border:1px solid rgba(168,146,218,.16);border-radius:8px;color:#8a7fa0;background:rgba(130,102,185,.08);font-size:11px}.credits-disclaimer{display:block;text-align:center;margin-top:9px;color:#766d88;font-size:9px}.ledger-section{margin-top:29px}.ledger-section .section-heading{margin-bottom:5px}.ledger-section .section-heading .icon-button{width:26px;height:26px}.ledger-list{list-style:none;margin:0;padding:0}.ledger-entry{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 1px;border-bottom:1px solid var(--line)}.ledger-entry>div{min-width:0}.ledger-entry strong{display:block;color:#a6a5c1;font-size:10px;font-weight:500;overflow-wrap:anywhere}.ledger-entry small{display:block;font-size:9px;color:#696f91;margin-top:3px}.ledger-delta{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:4px}.ledger-delta>span{font-size:12px;color:#a398bf;font-variant-numeric:tabular-nums}.ledger-delta.is-positive>span{color:#84bdb5}.ledger-delta small{color:#6f7494;font-size:8px}.development-card{margin-top:28px;padding:15px 14px;border:1px solid var(--line);border-radius:13px;background:rgba(33,35,62,.23)}.development-card-label{font-size:7px;letter-spacing:.17em;color:#80739d}.development-card h3{margin:7px 0 9px;font-size:12px;color:#ada6c4;font-weight:500}.development-card p{margin:0;color:#747995;font-size:10px;line-height:1.9}.development-card>div{display:flex;align-items:center;gap:7px;margin-top:13px;font-size:8px;color:#837b9a;flex-wrap:wrap}.development-card strong{font-size:9px;font-weight:500;color:#ada0c8;letter-spacing:.03em}.unavailable-dot{display:inline-block;flex:0 0 auto;width:4px;height:4px;border-radius:50%;background:#8d71b2}.sidebar-backdrop{position:fixed;z-index:39;inset:var(--ribbon-height) 0 0;background:rgba(3,3,13,.68);backdrop-filter:blur(4px);border:0}
.auth-dialog{position:relative;max-width:440px;width:calc(100% - 32px);max-height:calc(100dvh - 36px);padding:32px;border:1px solid rgba(167,146,223,.31);border-radius:22px;background:radial-gradient(ellipse at 100% 0,rgba(116,76,204,.14),transparent 60%),#141527;color:var(--text);box-shadow:0 35px 120px rgba(0,0,0,.45);overflow:auto}.auth-dialog::backdrop{background:rgba(4,4,16,.74);backdrop-filter:blur(9px)}.dialog-close{position:absolute;top:15px;right:15px}.auth-brand{display:flex;gap:10px;align-items:center;margin-bottom:25px;font-size:11px;color:#a49abf}.auth-brand .brand-mark{width:33px;height:33px;border-radius:10px}.auth-brand .brand-mark .icon{width:20px;height:20px}.auth-dialog h2{margin:0 0 10px;font-size:26px;letter-spacing:-.03em;font-weight:600}.auth-dialog>p{margin:0 0 22px;font-size:11px;color:#8987a7;line-height:1.9}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;margin:0 0 17px;padding:4px;border:1px solid var(--line);border-radius:10px;background:#101122}.auth-tabs button{padding:8px 4px;border:0;border-radius:7px;color:#88869f;background:transparent;font-size:11px}.auth-tabs button[aria-selected="true"]{background:#26223f;color:#d5c8f4;box-shadow:0 1px 5px rgba(0,0,0,.1)}.auth-tabs button:disabled{opacity:.5}.auth-dialog label{display:block;margin-top:15px;margin-bottom:6px;font-size:11px;color:#b8b4ce}.auth-dialog input{display:block;width:100%;border:1px solid rgba(164,151,210,.2);border-radius:9px;color:var(--text);background:rgba(10,12,26,.7);padding:12px;font-size:13px;outline:none}.auth-dialog input:focus{border-color:#a58acc}.field-hint{color:#706d89;font-size:9px;margin:5px 0 0;line-height:1.7}.auth-submit{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;margin-top:23px;padding:12px 10px;border:1px solid rgba(186,153,252,.2);border-radius:10px;background:linear-gradient(110deg,#956cdb,#6354b8);color:#f5efff;font-size:12px;box-shadow:0 7px 28px rgba(93,67,166,.16)}.auth-submit .icon{width:17px;height:17px}.auth-submit:hover:not(:disabled){filter:brightness(1.1)}.auth-submit:disabled{opacity:.55}.auth-dialog>.auth-footer{display:flex;justify-content:center;gap:7px;align-items:center;margin:20px 0 0;font-size:9px;color:#756f8b}.auth-footer .icon{width:13px;height:13px}.auth-error{padding:9px 11px;margin:15px 0 0;color:#f4b5c5;border:1px solid rgba(231,143,160,.25);border-radius:8px;background:rgba(142,53,87,.1);font-size:11px;overflow-wrap:anywhere}
@keyframes loading-pulse{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}@keyframes send-breathe{50%{opacity:.35}}
@media(min-height:900px) and (min-width:1000px){.welcome-state{padding-top:45px}.hero-core{height:214px;margin-bottom:23px}.welcome-subtitle{margin-bottom:34px}.quick-prompts{gap:15px}.prompt-card{padding:18px 16px}}
@media(max-width:1320px){.workbench{grid-template-columns:218px minmax(0,1fr) 242px}.sidebar{padding-inline:14px}.account-panel{padding-inline:17px}.topbar{padding:21px 23px}.topbar-actions{gap:12px}.service-indicator{max-width:105px;overflow:hidden;text-overflow:ellipsis}.message-stream{padding-inline:24px}.composer-zone{padding-inline:24px}.prompt-card{padding-inline:10px}.prompt-card small{font-size:8px}.credits-card{padding:18px 15px}.welcome-state h2{font-size:38px}}
@media(max-width:1120px){.workbench{grid-template-columns:214px minmax(0,1fr)}.account-panel{display:none}.welcome-state{max-width:660px}.message-stream{padding:28px 28px}.service-indicator{max-width:none}.topbar{padding:20px 28px}.composer-zone{padding-inline:28px}.prompt-card small{font-size:9px}.welcome-state h2{font-size:43px}.welcome-subtitle{margin-bottom:28px}}
@media(max-width:760px){:root{--ribbon-height:63px}.development-ribbon{flex-wrap:wrap;gap:2px 11px;padding:8px 14px;align-content:center;font-size:9px;min-height:63px}.development-ribbon>span{gap:6px}.ribbon-extra{width:100%;justify-content:center;border-left:0;padding-left:0;font-size:8px;opacity:.72}.workbench{display:block;height:calc(100dvh - var(--ribbon-height));min-height:550px}.workspace{height:100%}.sidebar{position:fixed;z-index:40;top:var(--ribbon-height);left:0;bottom:0;width:260px;padding:27px 19px 18px;transform:translateX(-105%);transition:transform .22s;background:#0c0d1b;box-shadow:18px 0 60px rgba(0,0,0,.3)}body.sidebar-is-open .sidebar{transform:translateX(0)}.sidebar-close{position:absolute;right:9px;top:11px;display:grid}.menu-button{display:grid;width:31px;height:34px}.topbar{min-height:78px;padding:17px 16px}.topbar h1{font-size:16px}.topbar h1>span{font-size:8px;margin-left:4px;padding-inline:4px}.topbar .overline{font-size:6px;letter-spacing:.12em}.topbar-title{gap:9px}.topbar-actions{gap:7px}.service-indicator{display:none}.login-button{padding:7px 9px;font-size:10px}.message-stream{padding:19px 18px 20px}.welcome-state{padding-top:2px}.hero-core{width:196px;height:165px;margin:3px auto 20px;transform:scale(.9)}.hero-overline{font-size:7px;letter-spacing:.17em}.welcome-greeting{font-size:11px;margin-bottom:10px}.welcome-state h2{font-size:36px}.welcome-subtitle{font-size:10px;margin:15px 0 20px}.welcome-subtitle>span{font-size:9px}.quick-prompts{gap:8px}.prompt-card{padding:12px 8px 13px;border-radius:11px}.prompt-card strong{font-size:10px}.prompt-card small{font-size:8px}.prompt-icon{width:28px;height:28px;margin-bottom:9px;border-radius:8px}.prompt-icon .icon{width:15px;height:15px}.prompt-arrow{width:12px;height:12px;right:9px;top:20px}.composer-zone{padding:0 16px 14px}.composer textarea{font-size:12px;min-height:66px;padding:16px 14px 9px}.composer-toolbar{padding-inline:11px;padding-bottom:10px}.composer-mode{font-size:9px}.composer-mode>span{font-size:8px;margin-left:1px;padding-left:6px}.voice-button span{display:none}.composer-controls{gap:8px}.send-button{width:34px;height:34px}.composer-footnote{font-size:8px;gap:10px}.composer-footnote>span:last-child{display:none}.pending-request{align-items:flex-start;flex-direction:column;gap:6px;padding:10px 11px}.pending-request>div:last-child{gap:18px}.notice{margin:10px 16px 0;font-size:10px;padding:9px 10px;gap:7px;flex-wrap:wrap}.notice>span{min-width:170px}.notice .text-button{margin-left:23px}.notice>.icon-button{margin-left:auto}.message{gap:9px}.message-body{max-width:calc(100% - 38px)}.message-content{padding:11px 13px;font-size:12px}.demo-reply-badge{font-size:7px}.auth-dialog{padding:28px 25px}.scene-glow-violet{width:270px;height:330px;left:10%;top:20%}.scene-glow-blue{display:none}}
@media(max-width:380px){.topbar h1>span{display:none}.welcome-state h2{font-size:32px}.message-stream{padding-inline:14px}.prompt-card small{display:none}.prompt-card{padding:12px 10px}.prompt-arrow{display:none}.prompt-card strong{font-size:9px}.welcome-subtitle br{display:none}.welcome-subtitle>span{display:block;margin-top:5px}.composer-mode>span{display:none}.composer textarea{font-size:11px}.composer-zone{padding-inline:12px}.auth-dialog{padding-inline:21px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.prompt-card:hover,.send-button:hover:not(:disabled){transform:none}}
.balance-shortcut{display:none;align-items:center;gap:7px;padding:7px 9px;border:1px solid var(--line);border-radius:9px;background:rgba(122,101,170,.06);color:#b9a5da;font-size:11px}.balance-shortcut .icon{width:16px;height:16px}.balance-shortcut strong{font-weight:500;font-variant-numeric:tabular-nums}.account-panel-close{display:none}body.account-is-open .account-panel{transform:translateX(0);visibility:visible}
@media(max-width:1120px){.balance-shortcut{display:flex}.account-panel{display:block;position:fixed;z-index:40;top:var(--ribbon-height);right:0;bottom:0;width:290px;padding-top:35px;background:#0e1021;border-left:1px solid var(--line);transform:translateX(105%);visibility:hidden;transition:transform .22s,visibility .22s;box-shadow:-18px 0 60px rgba(0,0,0,.3)}.account-panel-close{display:grid;position:absolute;right:9px;top:10px}.topbar-actions{gap:10px}.service-indicator{max-width:100px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:760px){.balance-shortcut{font-size:10px;padding:6px 7px;gap:4px}.balance-shortcut .icon{width:15px;height:15px}.topbar-actions{gap:6px}.topbar h1>span{display:none}.account-panel{width:min(290px,90vw)}}
.admin-entry-link{display:flex;align-items:center;justify-content:space-between;margin:3px 9px 0;color:#76718e;font-size:9px;text-decoration:none}.admin-entry-link:hover{color:#c7b6ee}.composer-mode>.mode-main{border-left:0;padding-left:0;margin-left:0;color:#b1a6d3;font-size:10px}.model-reply-badge{display:inline-block;border:1px solid rgba(106,171,255,.27);border-radius:4px;padding:1px 6px;color:#92b5de;font-size:8px}.message-usage{display:block;margin-top:7px;color:#74799a;font-size:9px}.request-status-section{margin-top:24px}.request-status-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line);padding:10px 1px}.request-status-row>div{flex:1;min-width:0}.request-status-row strong{display:block;font-size:10px;font-weight:500;color:#aaa0c3}.request-status-row small{display:block;margin-top:3px;font-size:8px;color:#74738c;overflow-wrap:anywhere}.request-status-row .text-button{font-size:9px}.cloud-service-summary{display:flex;flex-direction:column;gap:5px;padding:14px 16px;margin:18px 0;border:1px solid rgba(132,152,229,.25);border-radius:12px;background:rgba(75,100,164,.08)}.cloud-service-summary strong{font-size:14px;color:#b5c7ee}.cloud-service-summary span{font-size:11px;color:#8b98ba;overflow-wrap:anywhere}.cloud-consent-check{display:flex!important;align-items:flex-start;gap:10px;font-size:11px!important;color:#bcb4d0!important;line-height:1.9}.cloud-consent-check input{width:16px!important;height:16px;margin:3px 0 0;flex:0 0 auto;accent-color:#a389df}.cloud-consent-actions{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:20px}.cloud-consent-actions .auth-submit{margin:0;width:auto;padding:11px 19px}.cloud-consent-dialog>.auth-footer{line-height:1.8;display:block;text-align:left}.development-ribbon #mode-disclosure{display:inline}.credits-card>p{line-height:1.8}
@media(max-width:760px){.development-ribbon{font-size:8px;gap:2px 8px}.development-ribbon>span{gap:5px}.composer-mode>.mode-main{font-size:9px}.composer-mode>span:last-child{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cloud-consent-dialog{padding:27px 23px}}
.stop-button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:8px 10px;border:1px solid rgba(238,152,180,.38);border-radius:10px;background:rgba(141,58,89,.13);color:#edb7ca;font-size:10px;white-space:nowrap}.stop-button .icon{width:14px;height:14px;fill:currentColor;stroke-width:1}.stop-button:hover:not(:disabled){border-color:rgba(245,164,189,.7);background:rgba(172,73,111,.22)}.stop-button:disabled{opacity:.5}.delivery-status{padding:1px 6px;border:1px solid rgba(231,173,126,.23);border-radius:4px;color:#c5aa92;font-size:8px}.incomplete-message .message-content{border-color:rgba(231,173,126,.19)}.message-incomplete-note{display:block;margin-top:7px;color:#b4a08f;font-size:9px;line-height:1.8;overflow-wrap:anywhere}.streaming-message .message-content::after{content:"";display:inline-block;width:5px;height:13px;margin-left:4px;vertical-align:-2px;background:#bba6ed;border-radius:1px;animation:stream-caret 1s step-end infinite}.awaiting-first-delta{color:#9294b1;font-size:11px}.request-status-row .request-partial-copy{color:#9c91af}@keyframes stream-caret{50%{opacity:0}}@media(max-width:760px){.stop-button{min-height:34px;font-size:9px;padding:7px 8px;gap:4px}.stop-button .icon{width:12px;height:12px}.delivery-status{font-size:7px}.message-incomplete-note{font-size:8px}}@media(max-width:430px){.composer-mode>span:last-child{display:none}.composer-controls{gap:6px}.stop-button{padding:7px 6px}}@media(prefers-reduced-motion:reduce){.streaming-message .message-content::after{animation:none}}
.message-actions{display:flex;justify-content:flex-end;margin-top:6px}.message-edit-button{padding:4px 8px;min-height:28px;border:1px solid transparent;border-radius:6px;background:transparent;color:#9d91bd;font:inherit;font-size:10px}.message-edit-button:hover:not(:disabled){border-color:rgba(163,137,220,.25);background:rgba(116,87,166,.12);color:#d3c4f2}.message-edit-button:disabled{opacity:.35;cursor:not-allowed}.message-editor{width:min(560px,100%);min-width:min(320px,100%);padding:14px;border:1px solid rgba(169,140,244,.35);border-radius:13px;background:linear-gradient(140deg,rgba(97,66,150,.16),rgba(23,27,47,.85));box-shadow:0 10px 30px rgba(0,0,0,.12)}.message-edit-input{display:block;box-sizing:border-box;width:100%;min-height:106px;max-height:280px;resize:vertical;padding:12px 13px;border:1px solid rgba(176,153,227,.28);border-radius:9px;background:rgba(9,12,26,.65);color:var(--text);font:inherit;font-size:13px;line-height:1.9;outline-offset:3px}.message-edit-input:focus{border-color:rgba(190,166,255,.65);box-shadow:0 0 0 3px rgba(163,129,244,.08)}.message-edit-hint{margin:9px 0 12px;color:#a19ab6;font-size:10px;line-height:1.8;overflow-wrap:anywhere}.message-edit-actions{display:flex;justify-content:flex-end;gap:9px}.message-edit-cancel,.message-edit-confirm{min-width:62px;min-height:34px;padding:7px 14px;border:1px solid rgba(153,142,185,.3);border-radius:8px;background:rgba(56,47,80,.2);color:#bcb4d3;font:inherit;font-size:11px}.message-edit-confirm{border-color:rgba(171,148,234,.5);background:linear-gradient(120deg,#9b7ed5,#8172c3);color:#fff}.message-edit-cancel:hover:not(:disabled){background:rgba(91,71,127,.3)}.message-edit-confirm:hover:not(:disabled){filter:brightness(1.12)}.message-edit-cancel:disabled,.message-edit-confirm:disabled{opacity:.45;cursor:not-allowed}@media(max-width:760px){.message-editor{padding:11px;min-width:0}.message-edit-input{font-size:12px;min-height:115px;padding:10px}.message-edit-hint{font-size:9px}.message-edit-actions{gap:8px}.message-edit-cancel,.message-edit-confirm{min-height:38px;min-width:64px}.message-edit-button{min-height:32px;font-size:10px}.message-user:has(.message-editor) .message-body{width:calc(100% - 38px)}}
.message-actions{align-items:center;gap:3px;flex-wrap:wrap}.message-tool-button{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:30px;height:30px;padding:6px;border:1px solid transparent;border-radius:7px;background:transparent;color:#9d91bd;font:inherit}.message-tool-button .icon{width:16px;height:16px}.message-tool-button:hover:not(:disabled){border-color:rgba(163,137,220,.25);background:rgba(116,87,166,.12);color:#d3c4f2}.message-tool-button[data-copy-success="true"]{color:#84bdb5}.message-tool-button:disabled{opacity:.28;cursor:not-allowed}.message-version-nav{display:inline-flex;align-items:center;gap:1px;margin-left:5px}.message-version-counter{min-width:38px;text-align:center;color:#a49aba;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}.message-version-button{width:25px}.message-version-button .icon{width:14px;height:14px}.message-copy-fallback{display:block;box-sizing:border-box;width:100%;margin-top:8px;max-height:150px;resize:vertical;padding:8px;border:1px solid rgba(176,153,227,.28);border-radius:8px;background:rgba(9,12,26,.65);color:var(--text);font:inherit;font-size:11px;line-height:1.6}.message-user .message-content{user-select:text}@media(max-width:760px){.message-tool-button{width:34px;height:34px}.message-version-button{width:28px}.message-version-counter{font-size:10px}.message-actions{gap:2px}}
.history-more{display:grid;place-items:center;flex:0 0 auto;width:29px;height:32px;padding:5px;border:0;border-radius:8px;background:transparent;color:#8d82aa}.history-more .icon{width:17px;height:17px;stroke-width:2.4}.history-more:hover:not(:disabled),.history-more[aria-expanded="true"]{color:#d7c8f6;background:rgba(157,127,217,.16)}.history-more:disabled{opacity:.28}.history-group-heading{margin:12px 8px 6px;color:#8f83ac;font-size:10px;letter-spacing:.05em}.history-select-checkbox{flex:0 0 auto;width:16px;height:16px;margin:0 2px 0 5px;accent-color:#a58adc;cursor:pointer}.history-item.is-selected{background:rgba(142,104,210,.17);border-color:rgba(158,128,220,.3)}.history-selection-toolbar{flex:0 0 auto;padding:10px 9px;margin:0 0 7px;border:1px solid rgba(158,128,220,.25);border-radius:10px;background:rgba(106,74,158,.1)}.history-selection-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#c4b4df;font-size:10px}.history-selection-heading .text-button{font-size:10px;padding:0}.history-selection-actions{display:flex;align-items:center;gap:6px;margin-top:8px}.history-selection-actions button{flex:1;min-height:29px;padding:4px 6px;border:1px solid rgba(164,143,205,.2);border-radius:6px;background:rgba(124,103,163,.1);color:#c6b4e1;font:inherit;font-size:10px}.history-selection-actions button:disabled{opacity:.35}.history-selection-actions .is-danger{color:#ed95b0}.history-feedback{flex:0 0 auto;min-height:18px;max-height:50px;margin:5px 4px 0;overflow:auto;color:#aca0c5;font-size:9px;line-height:1.7;overflow-wrap:anywhere}.history-feedback.is-error{color:#ed9eb6}.history-menu{position:fixed;z-index:70;width:156px;padding:6px;border:1px solid rgba(175,149,225,.26);border-radius:12px;background:linear-gradient(145deg,#222039,#141526);box-shadow:0 14px 40px rgba(0,0,0,.35);color:#d2c4e7}.history-menu-action{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:8px 10px;border:0;border-radius:7px;background:transparent;color:inherit;font:inherit;font-size:12px;text-align:left}.history-menu-action .icon{width:16px;height:16px;flex:0 0 auto}.history-menu-action:hover,.history-menu-action:focus-visible{background:rgba(164,134,221,.13)}.history-menu-action.is-danger{color:#f19ab5}.history-menu-action.is-danger:hover{background:rgba(220,88,130,.1)}.history-rename-dialog{max-width:410px}.history-rename-dialog h2{margin:0 0 9px}.history-rename-dialog>p{font-size:11px;color:var(--muted);line-height:1.8}.history-rename-actions{display:flex;justify-content:flex-end;align-items:center;gap:24px;margin-top:18px}.history-rename-actions .auth-submit{width:auto;margin:0;padding:10px 23px}@media(max-width:760px){.history-more{width:34px;height:36px}.history-select-checkbox{width:18px;height:18px}.history-selection-actions button{min-height:34px}.history-menu-action{min-height:40px}.history-rename-dialog{padding:27px 23px}}
.composer-toolbar .composer-mode{min-width:0;overflow:hidden;white-space:nowrap}.composer-mode #composer-source-label{overflow:hidden;text-overflow:ellipsis}.composer-controls{min-width:0;max-width:100%;flex:0 1 auto}.composer-controls>button{flex-shrink:0}.chat-model-choice{display:flex;align-items:center;flex:0 1 170px;min-width:75px}.chat-model-choice select{width:170px;max-width:100%;min-width:0;min-height:34px;padding:6px 23px 6px 10px;border:1px solid rgba(171,148,234,.24);border-radius:8px;background:#17192d;color:#d6c7ef;font:inherit;font-size:11px;text-overflow:ellipsis;cursor:pointer;outline-offset:3px}.chat-model-choice select:hover:not(:disabled){border-color:rgba(183,158,242,.58);background:#201e36}.chat-model-choice select:focus-visible{outline:2px solid #ab94ea}.chat-model-choice select:disabled{opacity:.6;cursor:not-allowed}.chat-model-status:not(.sr-only){display:block;margin-top:7px;color:#c5b2e3;font-size:10px;line-height:1.6}@media(max-width:760px){.composer-toolbar:has(.chat-model-choice:not([hidden])) .composer-mode{display:none}.composer-controls{margin-left:auto}.chat-model-choice{flex-basis:148px}.chat-model-choice select{width:148px;min-height:36px;font-size:11px}}

/* The personal edition's neural globe, isolated from the workspace palette.
   Its existing hero box keeps the welcome copy/cards/composer in place. */
.hero-core.personal-core {
  --core-primary: 129, 140, 248; --core-secondary: 192, 132, 252;
  --core-accent: 120, 96, 255; --core-highlight: 237, 229, 255;
  isolation: isolate; pointer-events: none;
}
html[data-theme="light"] .hero-core.personal-core {
  --core-primary: 14, 165, 233; --core-secondary: 147, 51, 234;
  --core-accent: 99, 102, 241; --core-highlight: 165, 148, 239;
}
html[data-theme="cyan"] .hero-core.personal-core {
  --core-primary: 34, 211, 238; --core-secondary: 45, 212, 191;
  --core-accent: 56, 189, 248; --core-highlight: 207, 250, 254;
}
.personal-core #ai-core-canvas {
  position: absolute; z-index: 2; inset: -30% -32%; width: 164%; height: 160%;
  display: block; visibility: hidden; pointer-events: none;
  background: transparent;
  mask-image: radial-gradient(ellipse closest-side at center, #000 76%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse closest-side at center, #000 76%, transparent 100%);
}
.personal-core.has-personal-core #ai-core-canvas { visibility: visible; }
.personal-core.has-personal-core .personal-core-fallback { visibility: hidden; }
.personal-core-fallback { position: absolute; inset: 0; }
.personal-core-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(var(--core-primary),.18), rgba(var(--core-secondary),.06) 40%, transparent 68%);
}
.personal-core-sphere {
  position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%,-50%);
  display: grid; place-items: center; width: 160px; height: 160px; overflow: hidden;
  border: 1px solid rgba(var(--core-highlight),.56); border-radius: 50%;
  background: radial-gradient(ellipse at 30% 17%, rgba(var(--core-highlight),.9), rgba(var(--core-primary),.6) 12%, transparent 39%),
    radial-gradient(ellipse at 78% 84%, rgba(var(--core-secondary),.8), transparent 54%),
    radial-gradient(circle at 38% 31%, rgba(var(--core-primary),.8), rgba(var(--core-accent),.4) 49%, transparent 85%);
  box-shadow: 0 0 34px rgba(var(--core-primary),.24), 0 0 65px rgba(var(--core-secondary),.13),
    inset -10px -12px 22px rgba(14,29,83,.6);
}
.personal-core-sphere span { width: 4px; height: 4px; border-radius: 50%; background: rgb(var(--core-highlight)); box-shadow: 0 0 18px rgb(var(--core-primary)); }
.personal-core-orbit {
  position: absolute; top: 50%; left: 50%; z-index: 2; border: 1px solid rgba(var(--core-primary),.38); border-radius: 50%;
}
.personal-orbit-one { width: 310px; height: 122px; transform: translate(-50%,-50%) rotate(-8deg); border-top-color: rgb(var(--core-highlight)); }
.personal-orbit-two { width: 252px; height: 168px; transform: translate(-50%,-50%) rotate(24deg); border-color: rgba(var(--core-secondary),.4); }
.personal-orbit-three { width: 210px; height: 126px; transform: translate(-50%,-50%) rotate(-36deg); border-color: rgba(var(--core-accent),.36); }
.personal-core-reticle {
  position: absolute; z-index: 1; top: 50%; left: 50%; width: 248px; height: 248px;
  border: 1px solid rgba(var(--core-primary),.14); border-radius: 50%; transform: translate(-50%,-50%);
  background: repeating-conic-gradient(from 0deg, rgba(var(--core-primary),.4) 0deg .35deg, transparent .35deg 6deg);
  mask-image: radial-gradient(transparent 66%, #000 66.5%, #000 67.5%, transparent 68%);
}
.personal-core .core-caption { z-index: 3; }
html[data-theme="light"] .personal-core-glow { opacity: .65; }
html[data-theme="light"] .personal-core-sphere { box-shadow: 0 0 30px rgba(var(--core-accent),.16), inset -10px -12px 22px rgba(var(--core-secondary),.12); }
@media (max-width: 760px) {
  .personal-core-reticle { width: 198px; height: 198px; }
  .personal-core-sphere { width: 132px; height: 132px; }
  .personal-orbit-one { width: 250px; height: 98px; }
  .personal-orbit-two { width: 210px; height: 140px; }
  .personal-orbit-three { width: 174px; height: 104px; }
}

/* Light appearance is scoped so the original dark palette remains the default. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f5f5f6;
  --text: #202124;
  --soft: #51545a;
  --muted: #6a6e75;
  --line: #e3e4e7;
  --violet: #7048b8;
  --blue: #326ba0;
  --mint: #267b72;
  --danger: #b63155;
  --light-purple-surface: #f5f1fc;
  --light-purple-hover: #eee7f9;
  --light-purple-border: #d8c9ee;
  --light-purple-text: #6847a0;
  --light-blue-surface: #f2f6fa;
  --light-error-surface: #fff5f7;
  --light-error-border: #edc7d2;
  --light-warning-surface: #fffaf2;
  --light-warning-border: #e7d4b9;
  --light-warning-text: #865726;
  --light-shadow: 0 4px 20px rgba(24, 27, 33, .045);
}

html[data-theme="light"] :is(#ambient-canvas, .scene-glow) { opacity: 0; }
html[data-theme="light"] .noscript-notice { color: var(--danger); background: var(--light-error-surface); }
html[data-theme="light"] .development-ribbon { color: var(--soft); background: #f6f6f7; border-color: var(--line); }
html[data-theme="light"] .development-ribbon i { background: #a2a5ac; }
html[data-theme="light"] .development-badge { color: var(--light-purple-text); }
html[data-theme="light"] .development-badge>span { background: #8054be; box-shadow: none; }
html[data-theme="light"] .ribbon-extra { border-color: var(--line); }
html[data-theme="light"] .sidebar { background: #f7f7f8; }
html[data-theme="light"] .brand-mark { color: var(--violet); border-color: var(--line); background: #ffffff; box-shadow: 0 2px 6px rgba(24, 27, 33, .03); }
html[data-theme="light"] .new-chat-button { color: var(--light-purple-text); border-color: var(--light-purple-border); background: #ffffff; }
html[data-theme="light"] .new-chat-button:hover:not(:disabled) { border-color: #b39aca; background: var(--light-purple-surface); }
html[data-theme="light"] :is(.conversation-list, .message-stream, .account-panel) { scrollbar-color: #c9ccd1 transparent; }
html[data-theme="light"] .history-item:hover { background: #ededf0; }
html[data-theme="light"] .history-item.is-active { background: var(--light-purple-surface); border-color: #e4d8f2; }
html[data-theme="light"] .history-item.is-selected { background: var(--light-purple-hover); border-color: #cbb6e4; }
html[data-theme="light"] :is(.history-open>.icon, .local-card>.icon) { color: #787d85; }
html[data-theme="light"] .local-card { background: #ffffff; }
html[data-theme="light"] .local-card strong { color: var(--soft); }
html[data-theme="light"] .account-card:hover { background: #ededf0; }
html[data-theme="light"] .user-avatar { color: var(--soft); border-color: #dfe1e5; background: #eff0f2; }

html[data-theme="light"] .workspace { background: #ffffff; }
html[data-theme="light"] .topbar h1>span { color: var(--muted); border-color: var(--line); background: #f8f8f9; }
html[data-theme="light"] .service-indicator.is-ready { color: #477367; }
html[data-theme="light"] .login-button { color: var(--light-purple-text); border-color: var(--light-purple-border); background: #ffffff; }
html[data-theme="light"] .login-button:hover { border-color: #b39aca; background: var(--light-purple-surface); }
html[data-theme="light"] .icon-button:hover:not(:disabled) { background: #f0f0f2; }
html[data-theme="light"] .notice { color: var(--soft); border-color: var(--line); background: #f7f8f9; }
html[data-theme="light"] .notice.is-error { color: #9b2c4b; border-color: var(--light-error-border); background: var(--light-error-surface); }
html[data-theme="light"] .text-button { color: var(--violet); }
html[data-theme="light"] .text-button:hover { color: #492b77; }
html[data-theme="light"] .text-button.subtle { color: var(--muted); }

html[data-theme="light"] :is(.hero-overline, .core-caption, .welcome-greeting) { color: var(--muted); }
html[data-theme="light"] .hero-overline>span { background: #9362c9; box-shadow: none; }
html[data-theme="light"] .core-halo { background: none; }
html[data-theme="light"] .core-sphere { box-shadow: inset -13px -12px 25px rgba(3, 7, 26, .5), inset 9px 7px 21px rgba(188, 163, 255, .25), 0 6px 20px rgba(38, 31, 51, .12); }
html[data-theme="light"] .core-orbit { border-color: rgba(118, 83, 178, .17); }
html[data-theme="light"] .orbit-two { border-color: rgba(128, 82, 194, .3); box-shadow: none; }
html[data-theme="light"] .orbit-three { border-color: rgba(90, 111, 142, .22); }
html[data-theme="light"] .core-point { background: #9160ce; box-shadow: none; }
html[data-theme="light"] .point-two { background: #758caa; }
html[data-theme="light"] .welcome-state h2>span { color: #7650ac; background-image: linear-gradient(105deg, #7954b3, #6651a4); }
html[data-theme="light"] .welcome-subtitle>span { color: var(--muted); }
html[data-theme="light"] .prompt-card { background: #ffffff; box-shadow: 0 2px 8px rgba(24, 27, 33, .025); }
html[data-theme="light"] .prompt-card:hover { border-color: #c4c7ce; background: #fafafa; }
html[data-theme="light"] .prompt-icon { color: #8054b0; border-color: var(--line); background: #f6f6f7; }
html[data-theme="light"] .prompt-icon.blue { color: #3c72a8; border-color: var(--line); background: #f6f6f7; }
html[data-theme="light"] .prompt-icon.mint { color: #2d7d77; border-color: var(--line); background: #f6f6f7; }
html[data-theme="light"] .prompt-arrow { color: #8a8e95; }

html[data-theme="light"] .message-avatar { color: var(--violet); background: #f7f7f8; }
html[data-theme="light"] .message-name { color: var(--soft); }
html[data-theme="light"] .message-content { color: var(--text); background: #ffffff; }
html[data-theme="light"] .message-user .message-content { background: #f3f4f5; border-color: #e3e5e8; }
html[data-theme="light"] .demo-reply-badge { color: var(--muted); border-color: var(--line); background: #f8f8f9; }
html[data-theme="light"] .model-reply-badge { color: #486989; border-color: #d0dce8; background: var(--light-blue-surface); }
html[data-theme="light"] :is(.pending-status, .message-usage, .awaiting-first-delta) { color: var(--muted); }
html[data-theme="light"] .loading-dots i { background: #8055b3; }
html[data-theme="light"] .delivery-status { color: var(--light-warning-text); border-color: var(--light-warning-border); background: var(--light-warning-surface); }
html[data-theme="light"] .incomplete-message .message-content { border-color: var(--light-warning-border); }
html[data-theme="light"] .message-incomplete-note { color: var(--light-warning-text); }
html[data-theme="light"] .streaming-message .message-content::after { background: var(--violet); }

html[data-theme="light"] .composer { border-color: #d8dade; background: #ffffff; box-shadow: var(--light-shadow); }
html[data-theme="light"] .composer:focus-within { border-color: #ac91cf; box-shadow: 0 0 0 3px rgba(129, 85, 189, .06), var(--light-shadow); }
html[data-theme="light"] .composer textarea::placeholder { color: #7b8088; }
html[data-theme="light"] .composer-mode { color: var(--soft); }
html[data-theme="light"] .composer-mode>span { color: var(--muted); }
html[data-theme="light"] .composer-mode>.mode-main { color: var(--soft); }
html[data-theme="light"] .voice-button { color: #969aa1; }
html[data-theme="light"] :is(.send-button, .auth-submit, .message-edit-confirm) { color: #ffffff; border-color: #7047ab; background: linear-gradient(120deg, #8051bc, #6550aa); box-shadow: 0 3px 10px rgba(105, 67, 167, .12); }
html[data-theme="light"] :is(.send-button, .auth-submit, .message-edit-confirm):hover:not(:disabled) { filter: brightness(1.05); }
html[data-theme="light"] .send-button:disabled { box-shadow: none; }
html[data-theme="light"] .composer-footnote { color: var(--muted); }
html[data-theme="light"] .pending-request { color: var(--light-warning-text); border-color: var(--light-warning-border); background: var(--light-warning-surface); }
html[data-theme="light"] .pending-request p { color: #78634f; }
html[data-theme="light"] .stop-button { color: #a43d60; border-color: #e4bdcb; background: #fff8fa; }
html[data-theme="light"] .stop-button:hover:not(:disabled) { border-color: #cc8ba3; background: #fceef3; }
html[data-theme="light"] .chat-model-choice select { color: #42464d; border-color: #dfe1e5; background: #f7f7f8; }
html[data-theme="light"] .chat-model-choice select:hover:not(:disabled) { border-color: #bfc3cb; background: #f0f1f3; }
html[data-theme="light"] .chat-model-choice select:focus-visible { outline-color: var(--violet); }
html[data-theme="light"] .chat-model-choice option { color: var(--text); background: var(--surface); }
html[data-theme="light"] .chat-model-status:not(.sr-only) { color: var(--muted); }

html[data-theme="light"] .account-panel { background: #f7f7f8; }
html[data-theme="light"] .panel-heading h2 { color: var(--text); }
html[data-theme="light"] .credits-card { border-color: var(--line); background: #ffffff; }
html[data-theme="light"] .credits-topline { color: var(--soft); }
html[data-theme="light"] .credits-topline .icon { color: #8565ad; }
html[data-theme="light"] .credits-value strong { color: var(--text); }
html[data-theme="light"] :is(.credits-value>span, .credits-card>p, .credits-disclaimer) { color: var(--muted); }
html[data-theme="light"] .payment-button { color: #878b93; border-color: var(--line); background: #f5f5f6; }
html[data-theme="light"] .ledger-entry strong { color: var(--soft); }
html[data-theme="light"] :is(.ledger-entry small, .ledger-delta small) { color: var(--muted); }
html[data-theme="light"] .ledger-delta>span { color: var(--soft); }
html[data-theme="light"] .ledger-delta.is-positive>span { color: #2b7b6f; }
html[data-theme="light"] .development-card { background: #ffffff; }
html[data-theme="light"] :is(.development-card-label, .development-card>div, .development-card p) { color: var(--muted); }
html[data-theme="light"] :is(.development-card h3, .development-card strong, .request-status-row strong) { color: var(--soft); }
html[data-theme="light"] :is(.request-status-row small, .request-status-row .request-partial-copy) { color: var(--muted); }
html[data-theme="light"] .balance-shortcut { color: var(--soft); background: #f7f7f8; }
html[data-theme="light"] .admin-entry-link { color: var(--muted); }
html[data-theme="light"] .admin-entry-link:hover { color: var(--violet); }
html[data-theme="light"] .sidebar-backdrop { background: rgba(25, 28, 34, .25); }

html[data-theme="light"] .auth-dialog { border-color: #dedfe3; background: #ffffff; box-shadow: 0 24px 80px rgba(24, 27, 33, .17); }
html[data-theme="light"] .auth-dialog::backdrop { background: rgba(25, 28, 34, .32); }
html[data-theme="light"] .auth-brand { color: var(--muted); }
html[data-theme="light"] .auth-dialog>p { color: var(--muted); }
html[data-theme="light"] .auth-tabs { background: #f2f3f4; }
html[data-theme="light"] .auth-tabs button { color: var(--muted); }
html[data-theme="light"] .auth-tabs button[aria-selected="true"] { color: var(--light-purple-text); background: #ffffff; box-shadow: 0 1px 4px rgba(24, 27, 33, .09); }
html[data-theme="light"] .auth-dialog label { color: var(--soft); }
html[data-theme="light"] .auth-dialog input { border-color: #d8dade; background: #ffffff; }
html[data-theme="light"] .auth-dialog input:focus { border-color: #a88acb; box-shadow: 0 0 0 3px rgba(129, 85, 189, .06); }
html[data-theme="light"] .auth-dialog input::placeholder { color: #81868e; }
html[data-theme="light"] :is(.field-hint, .auth-dialog>.auth-footer) { color: var(--muted); }
html[data-theme="light"] .auth-error { color: #a22e4e; border-color: var(--light-error-border); background: var(--light-error-surface); }
html[data-theme="light"] .cloud-service-summary { border-color: var(--line); background: #f8f9fa; }
html[data-theme="light"] .cloud-service-summary strong { color: var(--text); }
html[data-theme="light"] .cloud-service-summary span { color: var(--muted); }
html[data-theme="light"] .cloud-consent-check { color: var(--soft) !important; }
html[data-theme="light"] :is(.cloud-consent-check input, .history-select-checkbox) { accent-color: var(--violet); }

html[data-theme="light"] :is(.message-edit-button, .message-tool-button) { color: #777c85; }
html[data-theme="light"] :is(.message-edit-button, .message-tool-button):hover:not(:disabled) { color: var(--violet); border-color: #dfe1e5; background: #f4f4f6; }
html[data-theme="light"] .message-tool-button[data-copy-success="true"] { color: #2b7b6f; }
html[data-theme="light"] .message-editor { border-color: #d8dade; background: #fafafb; box-shadow: var(--light-shadow); }
html[data-theme="light"] :is(.message-edit-input, .message-copy-fallback) { border-color: #d8dade; background: #ffffff; }
html[data-theme="light"] .message-edit-input:focus { border-color: #ac91cf; box-shadow: 0 0 0 3px rgba(129, 85, 189, .06); }
html[data-theme="light"] :is(.message-edit-hint, .message-version-counter) { color: var(--muted); }
html[data-theme="light"] .message-edit-cancel { color: var(--soft); border-color: #dfe1e5; background: #ffffff; }
html[data-theme="light"] .message-edit-cancel:hover:not(:disabled) { background: #f0f1f3; }

html[data-theme="light"] .history-more { color: #777c85; }
html[data-theme="light"] :is(.history-more:hover:not(:disabled), .history-more[aria-expanded="true"]) { color: var(--violet); background: #eee9f6; }
html[data-theme="light"] .history-group-heading { color: var(--muted); }
html[data-theme="light"] .history-selection-toolbar { border-color: #d8c9ee; background: #ffffff; }
html[data-theme="light"] .history-selection-heading { color: var(--light-purple-text); }
html[data-theme="light"] .history-selection-actions button { color: var(--soft); border-color: #dfe1e5; background: #f8f8f9; }
html[data-theme="light"] .history-selection-actions .is-danger { color: #ae3559; }
html[data-theme="light"] .history-feedback { color: var(--muted); }
html[data-theme="light"] .history-feedback.is-error { color: #ad3458; }
html[data-theme="light"] .history-menu { color: var(--text); border-color: #dfe1e5; background: #ffffff; box-shadow: 0 8px 28px rgba(24, 27, 33, .12); }
html[data-theme="light"] :is(.history-menu-action:hover, .history-menu-action:focus-visible) { background: #f1f2f4; }
html[data-theme="light"] .history-menu-action.is-danger { color: #b3355a; }
html[data-theme="light"] .history-menu-action.is-danger:hover { background: #fff0f4; }

@media (max-width: 1120px) {
  html[data-theme="light"] .account-panel { background: #f7f7f8; box-shadow: -18px 0 60px rgba(24, 27, 33, .11); }
}
@media (max-width: 760px) {
  html[data-theme="light"] .sidebar { background: #f7f7f8; box-shadow: 18px 0 60px rgba(24, 27, 33, .11); }
}

/* Workspace categories reuse the existing brand, icons, and theme tokens. */
.workspace-nav { display: grid; gap: 7px; margin: 4px 0 24px; }
.workspace-nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--soft); text-align: left; font-size: 13px; transition: background .15s, border-color .15s; }
.workspace-nav-item .icon { width: 20px; height: 20px; }
.workspace-nav-item:hover:not(:disabled) { background: rgba(150, 128, 224, .07); color: var(--text); }
.workspace-nav-item.is-active { color: #ded4ff; border-color: rgba(165, 137, 255, .24); background: linear-gradient(110deg, rgba(125, 96, 212, .21), rgba(125, 96, 212, .05)); }
.workspace-nav-item.is-active::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 4px; background: var(--violet); }
.workspace-nav-item small { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; font-size: 8px; white-space: nowrap; color: var(--muted); }
.workspace-nav-item:disabled { color: var(--muted); opacity: .68; }
.sidebar .sidebar-bottom { margin-top: auto; padding-top: 24px; }
.topbar h1 b { font: inherit; }
.workspace-page { flex: 1; min-height: 0; min-width: 0; overflow: auto; padding: 36px clamp(22px, 4vw, 64px); scrollbar-width: thin; scrollbar-color: #303253 transparent; }
.workspace-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.workspace-page-heading h2 { margin: 7px 0 8px; font-size: 27px; letter-spacing: -.03em; }
.workspace-page-heading p:not(.overline) { margin: 0; color: var(--muted); font-size: 12px; }
.workspace-return { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--soft); font-size: 11px; white-space: nowrap; }
.workspace-return:hover { border-color: var(--violet); color: var(--text); }
.workspace-return span { margin-left: 10px; color: var(--violet); }
.workspace-history-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 21px; }
.workspace-history-tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 43px; padding: 6px 0 13px; background: transparent; border: 0; color: var(--muted); font-size: 13px; }
.workspace-history-tabs button[aria-selected="true"] { color: var(--text); }
.workspace-history-tabs button[aria-selected="true"]::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--violet); border-radius: 2px; }
.workspace-history-tabs button span { min-width: 22px; padding: 0 6px; border-radius: 6px; background: rgba(150, 128, 224, .1); color: var(--violet); font-size: 10px; }
.workspace-history-hint { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.history-workspace .history-section { margin: 0; }
.history-workspace .conversation-list { overflow: visible; padding: 0; }
.history-workspace .history-item { gap: 10px; padding: 9px 13px; margin: 9px 0; border-color: var(--line); background: rgba(130, 138, 196, .025); border-radius: 12px; }
.history-workspace .history-item.is-active { background: rgba(123, 105, 190, .13); border-color: rgba(158, 140, 244, .25); }
.history-workspace .history-open { gap: 13px; padding: 6px 0; }
.history-workspace .history-open strong { font-size: 13px; }
.history-workspace .history-open small { font-size: 10px; }
.history-workspace .history-more { width: 34px; height: 36px; }
.history-workspace .history-feedback { margin-top: 13px; font-size: 11px; max-height: none; }
.history-workspace .empty-copy { padding: 38px 16px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; font-size: 12px; }
.history-workspace .history-selection-toolbar { padding: 14px; margin-bottom: 18px; }
.history-workspace .history-selection-actions { max-width: 390px; gap: 10px; }
.history-workspace .history-selection-actions button { min-height: 34px; }
html[data-theme="light"] .workspace-nav-item.is-active { color: var(--light-purple-text); border-color: var(--light-purple-border); background: var(--light-purple-surface); }
html[data-theme="light"] .workspace-nav-item:hover:not(:disabled) { background: #ededf0; }
html[data-theme="light"] .history-workspace .history-item { background: #fff; }
html[data-theme="light"] .history-workspace .history-item:hover { background: #fafafa; }
html[data-theme="light"] .history-workspace .history-item.is-active { background: var(--light-purple-surface); border-color: var(--light-purple-border); }
html[data-theme="light"] .history-workspace .history-item.is-selected { background: var(--light-purple-hover); border-color: #cbb6e4; }
html[data-theme="light"] .workspace-page { scrollbar-color: #c9ccd1 transparent; }
@media (max-width: 760px) {
  .workspace-nav { margin-bottom: 20px; }
  .workspace-nav-item { min-height: 48px; }
  .workspace-page { padding: 25px 18px; }
  .workspace-page-heading { align-items: flex-start; gap: 12px; margin-bottom: 22px; }
  .workspace-page-heading h2 { font-size: 24px; }
  .workspace-page-heading p:not(.overline) { font-size: 11px; }
  .workspace-return { font-size: 10px; padding: 8px; }
  .workspace-return span { display: none; }
  .history-workspace .history-item { padding: 8px 10px; gap: 6px; }
  .history-workspace .history-open { gap: 10px; }
  .history-workspace .history-open strong { font-size: 12px; }
}

/* BEGIN SHARED THEME CSS */
/* Shared appearance menu, bundled into both existing stylesheets. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
/* Dark is a neutral black/gray appearance; accents remain semantic controls. */
html[data-theme="dark"] {
  --bg: #000000;
  --surface: #191919;
  --surface-raised: #242424;
  --surface-2: #2c2c2c;
  --text: #f5f5f5;
  --soft: #b8b8b8;
  --muted: #8c8c8c;
  --line: #373737;
  --workspace-card: var(--surface);
  --workspace-card-hover: #2c2c2c;
  --workspace-prompt-bg: #1a1a1a;
  --workspace-prompt-border: var(--line);
  --workspace-prompt-title: var(--text);
  --workspace-subtitle: var(--soft);
  --workspace-badge-bg: #303030;
  --workspace-badge-text: var(--soft);
  --command-bg: #000000;
  --command-dot: rgba(180, 180, 180, .18);
  --command-glass: #191919;
  --command-card: #191919;
  --command-card-hover: #242424;
  --command-border: #373737;
  --command-card-border: #373737;
  --command-hover-border: #666666;
  --command-focus: var(--violet);
  --command-ring: rgba(180, 180, 180, .1);
  --command-shadow: 0 20px 50px -10px #0006, 0 8px 20px -4px #0005;
  --command-icon-bg: #292929;
  --command-icon: var(--soft);
  --dock-bg: rgba(25, 25, 25, .96);
  --dock-border: #373737;
  --dock-hover: #2c2c2c;
}
html[data-theme="dark"] :is(body, .workbench, .workspace) { background: var(--bg); }
html[data-theme="dark"] .cv-workspace { --cv-panel: #191919; }
html[data-theme="dark"] .cv-node > .cv-node-surface { background: #191919; }
html[data-theme="dark"] :is(.sidebar, .account-panel, .message-content) { background: var(--surface); }
html[data-theme="dark"] .history-workspace .history-item { background: var(--surface); }
html[data-theme="dark"] .scene-glow { opacity: 0; }
html[data-theme="dark"] .xz-image-preview { background: var(--surface); }
html[data-theme="dark"] :is(.creation-video-result, .creation-video-viewer .creation-viewer-stage video) { background: #000000; }
html[data-theme="dark"] :is(.composer, .credits-card, .local-card, .development-card, .prompt-card, .model-catalog, .model-catalog-row, .provider-note, .xz-image-service) { background: var(--surface-raised); border-color: var(--line); }
html[data-theme="dark"] :is(.theme-picker .theme-menu, .history-menu, .auth-dialog, .message-editor, .card) { color: var(--text); border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] :is(.theme-picker .theme-option, .cv-theme-option):is(:hover, :focus-visible, [aria-checked="true"]) { color: var(--text); background: #333333; }
html[data-theme="dark"] :is(.user-avatar, .message-avatar, .balance-shortcut, .notice:not(.is-error), .feedback:not(.is-error)) { color: var(--soft); background: var(--surface-raised); border-color: var(--line); }
html[data-theme="dark"] .message-user .message-content { background: #2a2a2a; border-color: #393939; }
html[data-theme="dark"] :is(.card, .auth-dialog, .message-editor) :is(input:not([type="checkbox"]), select, textarea) { color: var(--text); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="dark"] :is(.card, .auth-dialog, .message-editor) :is(input, textarea)::placeholder { color: var(--muted); }
html[data-theme="dark"] :is(.conversation-list, .message-stream, .account-panel, .workspace-page, .xz-image-workspace) { scrollbar-color: #525252 transparent; }
body { min-width: min(320px, 100%); }
.theme-picker { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; z-index: 90; }
.theme-picker .theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--soft); cursor: pointer; }
.theme-picker .theme-toggle:hover:not(:disabled), .theme-picker .theme-toggle[aria-expanded="true"] { color: var(--text); background: rgba(140, 126, 186, .1); border-color: var(--line); }
.theme-picker .theme-toggle:disabled { opacity: .4; cursor: wait; }
.theme-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.theme-toggle .theme-icon { display: none; }
.theme-toggle .theme-icon-system { display: block; }
html[data-theme-preference="light"] .theme-toggle .theme-icon-system,
html[data-theme-preference="dark"] .theme-toggle .theme-icon-system { display: none; }
html[data-theme-preference="light"] .theme-toggle .theme-icon-light,
html[data-theme-preference="dark"] .theme-toggle .theme-icon-dark { display: block; }
.theme-picker .theme-menu { position: absolute; top: calc(100% + 9px); right: 0; width: 174px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #18192b; box-shadow: 0 10px 35px rgba(0, 0, 0, .25); }
.theme-picker .theme-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--soft); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.theme-picker .theme-option:hover, .theme-picker .theme-option:focus-visible { color: var(--text); background: rgba(140, 126, 186, .12); }
.theme-picker .theme-option[aria-checked="true"] { color: #c9b4f4; background: rgba(144, 111, 210, .13); }
.theme-option .theme-check { width: 15px; height: 15px; margin-left: auto; opacity: 0; }
.theme-option[aria-checked="true"] .theme-check { opacity: 1; }
.theme-picker button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
html[data-theme="light"] .theme-picker .theme-menu { background: #fff; border-color: #e3e4e7; box-shadow: 0 8px 28px rgba(24, 27, 33, .12); }
html[data-theme="light"] .theme-picker .theme-toggle:hover:not(:disabled),
html[data-theme="light"] .theme-picker .theme-toggle[aria-expanded="true"],
html[data-theme="light"] .theme-picker .theme-option:hover,
html[data-theme="light"] .theme-picker .theme-option:focus-visible { background: #f2f3f5; color: #202124; }
html[data-theme="light"] .theme-picker .theme-option[aria-checked="true"] { color: #7048b8; background: #f5f1fc; }
.topbar-actions, .header-actions { align-items: center; }
@media (max-width: 1320px) and (min-width: 761px) {
  .topbar-actions { gap: 10px; }
  .topbar-actions .service-indicator { display: none; }
}
@media (max-width: 760px) {
  .topbar-actions { gap: 7px; }
  .theme-picker .theme-toggle { width: 34px; height: 34px; }
}
@media (max-width: 430px) {
  .topbar { column-gap: 8px; padding-inline: 12px; }
  .topbar-title { gap: 6px; flex: 1; min-width: 0; }
  .topbar-title>div { min-width: 0; }
  .topbar h1 { overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
  .topbar .overline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 4px; flex-shrink: 0; }
  .topbar .balance-shortcut { padding-inline: 7px; }
  .topbar .login-button { padding: 7px 8px; font-size: 10px; }
}
@media (max-width: 620px) { .header-actions .theme-menu { left: 0; right: auto; } }

/* Optional cyan reference palette, independent of the neutral dark appearance. */
.theme-color-swatch { flex: 0 0 auto; width: 19px; height: 19px; border: 1px solid #4ce0f5; border-radius: 6px; background: linear-gradient(135deg, #1dd8f3 0 50%, #14191f 50%); }
html[data-theme-preference="cyan"] .theme-toggle .theme-icon-system { display: none; }
html[data-theme-preference="cyan"] .theme-toggle .theme-icon-dark { display: block; }
html[data-theme="cyan"] {
  color-scheme: dark;
  --bg: #101114;
  --surface: #14191f;
  --surface-raised: #1c222b;
  --text: #eef6fa;
  --soft: #afbbc8;
  --muted: #92a2b2;
  --line: #2d3942;
  --violet: #1dd8f3;
  --blue: #5cbbeb;
  --mint: #48d8c4;
  --danger: #ff94a6;
  --cyan-ink: #081115;
  --cyan-soft: rgba(29, 216, 243, .1);
  --cyan-border: rgba(29, 216, 243, .34);
}
html[data-theme="cyan"] body { background: var(--bg); }
html[data-theme="cyan"] :is(.workbench, .workspace) { background: var(--bg); }
html[data-theme="cyan"] :is(.sidebar, .account-panel) { background: var(--surface); }
html[data-theme="cyan"] .scene-glow { opacity: 0; }
html[data-theme="cyan"] #ambient-canvas { opacity: .12; }
html[data-theme="cyan"] :is(.development-ribbon, .test-banner) { color: var(--muted); border-color: var(--line); background: #151b22; }
html[data-theme="cyan"] :is(.development-badge, .test-banner>span) { color: var(--violet); }
html[data-theme="cyan"] .development-badge>span { background: var(--violet); box-shadow: 0 0 8px var(--cyan-border); }
html[data-theme="cyan"] .development-ribbon i { background: var(--muted); }
html[data-theme="cyan"] .ribbon-extra { border-color: var(--line); }
html[data-theme="cyan"] :is(.brand-mark, .brand-core) { color: var(--violet); border-color: var(--cyan-border); background: linear-gradient(145deg, #17333e, #15212b); box-shadow: none; }
html[data-theme="cyan"] .workspace-nav-item.is-active { color: var(--violet); border-color: var(--cyan-border); background: var(--cyan-soft); }
html[data-theme="cyan"] :is(.workspace-nav-item, .account-card, .history-item):hover:not(:disabled) { color: var(--text); background: rgba(175, 187, 200, .06); }
html[data-theme="cyan"] .workspace-nav-item.is-active:hover { background: rgba(29, 216, 243, .14); }
html[data-theme="cyan"] :is(.new-chat-button, .send-button, .auth-submit, .message-edit-confirm, .primary-button, .xz-image-primary) { color: var(--cyan-ink); border-color: var(--violet); background: var(--violet); box-shadow: none; }
html[data-theme="cyan"] :is(.new-chat-button, .auth-submit, .message-edit-confirm, .primary-button):hover:not(:disabled) { color: var(--cyan-ink); background: #4ce0f5; border-color: #4ce0f5; }
html[data-theme="cyan"] .new-chat-button .shortcut-key { color: #16424b; border-color: rgba(8, 17, 21, .2); }
html[data-theme="cyan"] :is(.local-card, .development-card, .credits-card, .prompt-card, .payment-button, .cloud-service-summary, .provider-note, .model-catalog, .model-catalog-row, .xz-image-service) { background: var(--surface-raised); border-color: var(--line); box-shadow: none; }
html[data-theme="cyan"] :is(.local-card strong, .development-card h3, .credits-topline, .credits-value>span, .quota-card h3, .provider-note strong, .model-catalog-heading h3, .quota-summary dd, .request-table td, label) { color: var(--soft); }
html[data-theme="cyan"] :is(.development-card p, .credits-card>p, .credits-disclaimer, .ledger-list small, .ledger-list time, .request-status-row p, .brand small, .admin-brand small, .save-note, .quota-user small, .provider-note p, .request-table th, footer, .small-tag, .empty-copy) { color: var(--muted); }
html[data-theme="cyan"] :is(.credits-value>strong, .status-card strong) { color: var(--text); }
html[data-theme="cyan"] .credits-topline>.icon { color: var(--violet); }
html[data-theme="cyan"] :is(.voice-button, .payment-button) { color: var(--muted); }
html[data-theme="cyan"] .balance-shortcut { color: var(--soft); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="cyan"] :is(.status-card>p:last-child, .quota-summary dt, .quota-user>span, .quota-user>strong, .cloud-service-summary span) { color: var(--soft); }
html[data-theme="cyan"] :is(.user-avatar, .message-avatar) { color: var(--soft); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="cyan"] :is(.hero-overline, .core-caption, .welcome-greeting, .welcome-subtitle>span, .message-meta, .message-name, .composer-footnote, .composer-mode, .composer-mode>span, .chat-model-status, .pending-status) { color: var(--muted); }
html[data-theme="cyan"] .hero-overline>span { background: var(--violet); box-shadow: 0 0 8px var(--cyan-border); }
html[data-theme="cyan"] .welcome-state h2>span { color: var(--violet); background-image: linear-gradient(105deg, #79eaff, #1dd8f3 60%, #5cbbeb); }
html[data-theme="cyan"] .prompt-icon { color: var(--violet); border-color: var(--cyan-border); background: var(--cyan-soft); }
html[data-theme="cyan"] .prompt-icon.blue { color: var(--blue); }
html[data-theme="cyan"] .prompt-icon.mint { color: var(--mint); }
html[data-theme="cyan"] :is(.prompt-arrow, .local-card>.icon, .history-open>.icon, .history-more, .message-tool-button, .message-version-counter, .message-edit-button) { color: var(--muted); }
html[data-theme="cyan"] :is(.prompt-card, .quiet-button, .xz-image-quiet):hover:not(:disabled) { color: var(--text); border-color: var(--cyan-border); background: var(--cyan-soft); }
html[data-theme="cyan"] .text-button:hover { color: #79eaff; }
html[data-theme="cyan"] .text-button.subtle { color: var(--muted); }
html[data-theme="cyan"] :is(.icon-button, .message-tool-button, .message-edit-button, .history-more):hover:not(:disabled),
html[data-theme="cyan"] .history-more[aria-expanded="true"] { color: var(--violet); border-color: var(--cyan-border); background: var(--cyan-soft); }
html[data-theme="cyan"] .history-workspace .history-item { background: var(--surface); border-color: var(--line); }
html[data-theme="cyan"] .history-item.is-active,
html[data-theme="cyan"] .history-item.is-selected,
html[data-theme="cyan"] .history-workspace .history-item.is-active,
html[data-theme="cyan"] .history-workspace .history-item.is-selected { background: var(--cyan-soft); border-color: var(--cyan-border); }
html[data-theme="cyan"] :is(.history-menu, .theme-picker .theme-menu, .auth-dialog, .message-editor, .card) { color: var(--text); border-color: var(--line); background: var(--surface); }
html[data-theme="cyan"] :is(.history-group-heading, .history-selection-heading, .history-feedback, .message-edit-hint) { color: var(--soft); }
html[data-theme="cyan"] .history-selection-toolbar { border-color: var(--cyan-border); background: var(--cyan-soft); }
html[data-theme="cyan"] .history-selection-actions button { color: var(--soft); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="cyan"] :is(.history-menu-action, .theme-picker .theme-option):hover,
html[data-theme="cyan"] :is(.history-menu-action, .theme-picker .theme-option):focus-visible { background: var(--cyan-soft); }
html[data-theme="cyan"] .theme-picker .theme-option[aria-checked="true"] { color: var(--violet); background: var(--cyan-soft); }
html[data-theme="cyan"] :is(.history-select-checkbox, .cloud-consent-check input, .check-label input, .xz-image-consent input) { accent-color: var(--violet); }
html[data-theme="cyan"] .notice:not(.is-error),
html[data-theme="cyan"] .feedback:not(.is-error) { color: var(--soft); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="cyan"] .message-content { color: var(--text); border-color: var(--line); background: var(--surface); }
html[data-theme="cyan"] .message-user .message-content { background: #1b2c35; border-color: #31515d; }
html[data-theme="cyan"] :is(.demo-reply-badge, .model-reply-badge) { color: var(--soft); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="cyan"] .composer { border-color: #617582; background: var(--surface-raised); box-shadow: none; }
html[data-theme="cyan"] .composer:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px var(--cyan-soft); }
html[data-theme="cyan"] :is(input:not([type="checkbox"]), select, textarea, .message-copy-fallback) { color: var(--text); border-color: #617582; background: var(--surface-raised); }
html[data-theme="cyan"] .composer textarea { background: transparent; }
html[data-theme="cyan"] :is(input, textarea)::placeholder { color: var(--muted); }
html[data-theme="cyan"] :is(input, select, .message-edit-input):focus { border-color: var(--violet); }
html[data-theme="cyan"] :is(.chat-model-choice select, .message-edit-cancel) { color: var(--soft); border-color: var(--line); background: var(--surface-raised); }
html[data-theme="cyan"] .chat-model-choice select:hover:not(:disabled) { border-color: var(--cyan-border); background: var(--surface-raised); }
html[data-theme="cyan"] :is(.auth-dialog>p, .auth-footer, .auth-tabs button, .cloud-consent-dialog>p, .cloud-consent-check, .check-label) { color: var(--soft); }
html[data-theme="cyan"] .auth-tabs button.is-active { color: var(--violet); border-color: var(--cyan-border); background: var(--cyan-soft); }
html[data-theme="cyan"] :is(.loading-dots i, .streaming-message .message-content::after) { background: var(--violet); }
html[data-theme="cyan"] :is(.conversation-list, .message-stream, .account-panel, .workspace-page, .xz-image-workspace) { scrollbar-color: #617582 transparent; }
html[data-theme="cyan"] .xz-image-preview { background: radial-gradient(circle at 40% 30%, rgba(29, 216, 243, .08), transparent 65%), var(--surface); }
html[data-theme="cyan"] .xz-image-history-item.is-selected { border-color: var(--violet); background: var(--cyan-soft); }
/* Semantic red and amber states are kept distinct from navigation accents. */
html[data-theme="cyan"] :is(.history-menu-action.is-danger, .history-selection-actions .is-danger, .model-remove-button, .history-feedback.is-error) { color: var(--danger); }
html[data-theme="cyan"] .overline { color: var(--muted); }
/* END SHARED THEME CSS */

/* Private workspace: keep mode-status bindings without a repeated top banner.
   Zero the shared offset after all responsive rules so no empty strip remains. */
:root { --ribbon-height: 0px; }

/* Two-column personal workspace: give the former account rail to conversation. */
.workbench { grid-template-columns: 238px minmax(0, 1fr); max-width: none; }
.workbench > #account-panel, #open-account-panel { display: none; }
.workbench .composer-zone, .workbench .creation-workspace .creation-composer-zone { max-width: 1120px; }
.workbench .messages { max-width: 1050px; }
.workbench .creation-workspace .creation-message-list { max-width: 1280px; }
.composer-zone .request-status-section { margin: 0 0 12px; max-height: 180px; overflow: auto; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.composer-zone .request-status-section .section-heading { margin-bottom: 0; }
.account-card:disabled { cursor: default; }
.account-card:disabled:hover { background: transparent; }
@media (max-width: 1320px) { .workbench { grid-template-columns: 218px minmax(0, 1fr); } }
@media (max-width: 1120px) { .workbench { grid-template-columns: 214px minmax(0, 1fr); } }

/* Chat references stay local until an explicit, capability-checked send. */
.chat-reference-composer { display: grid; grid-template-columns: 94px minmax(0, 1fr); grid-template-areas: "add prompt" "feedback feedback" "toolbar toolbar"; }
.chat-reference-composer > textarea { grid-area: prompt; min-width: 0; min-height: 108px; padding: 20px 19px 10px 8px; }
.chat-reference-composer > .composer-toolbar { grid-area: toolbar; min-width: 0; justify-content: flex-end; }
.chat-reference-composer .composer-controls { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.chat-reference-composer.is-drag-over { border-color: var(--violet); outline: 2px solid var(--violet); outline-offset: 3px; }
.chat-material-add { grid-area: add; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 64px; height: 82px; margin: 16px 10px 10px 20px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font: inherit; font-size: 10px; transform: rotate(-6deg); cursor: pointer; transition: color .15s, border-color .15s, transform .15s; }
.chat-material-add:hover:not(:disabled) { color: var(--violet); border-color: var(--violet); transform: rotate(0); }
.chat-material-add:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }
.chat-material-add:disabled { opacity: .45; cursor: not-allowed; }
.chat-material-plus { font-size: 27px; font-weight: 300; line-height: 1.1; }
.chat-material-list { grid-area: materials; display: flex; flex-wrap: wrap; gap: 9px; padding: 16px 18px 0; min-width: 0; }
.chat-material-item { position: relative; width: 90px; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.chat-material-thumb { display: block; width: 78px; height: 70px; object-fit: contain; border-radius: 6px; background: var(--bg); }
.chat-material-name { display: block; overflow: hidden; margin-top: 4px; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; color: var(--muted); }
.chat-material-remove { position: absolute; top: -7px; right: -6px; display: grid; place-items: center; width: 23px; height: 23px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text); font: inherit; cursor: pointer; }
.chat-material-remove:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.chat-material-feedback { grid-area: feedback; margin: 0 17px 9px; color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.chat-material-feedback.is-error { color: var(--danger); }
.message-references { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; min-width: 0; }
.message-reference { position: relative; display: grid; place-items: center; width: 112px; height: 112px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--soft); font: inherit; cursor: pointer; }
.message-reference-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.message-reference:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.message-reference-index { position: absolute; bottom: 4px; right: 4px; min-width: 20px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--soft); font-size: 9px; }
.message-reference-error { padding: 8px; color: var(--muted); font-size: 10px; }
.chat-reference-viewer { width: min(1100px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 20px; overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); }
.chat-reference-viewer::backdrop { background: rgba(5, 7, 16, .78); backdrop-filter: blur(6px); }
.chat-reference-viewer header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chat-reference-viewer header > button { flex-shrink: 0; }
.chat-reference-viewer h3 { flex: 1; min-width: 0; margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.chat-reference-viewer-image { display: block; width: 100%; max-height: calc(100dvh - 175px); object-fit: contain; border-radius: 8px; background: var(--bg); }
.chat-reference-viewer-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.chat-reference-viewer button, .chat-reference-viewer-actions a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--soft); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
@media (max-width: 760px) {
  .chat-reference-composer { grid-template-columns: 82px minmax(0, 1fr); }
  .chat-reference-composer > textarea { min-height: 100px; padding: 17px 13px 9px 6px; }
  .chat-material-add { width: 56px; height: 74px; margin: 14px 8px 10px 15px; }
  .chat-material-list { padding: 13px 14px 0; gap: 8px; }
  .message-reference { width: 88px; height: 88px; }
  .chat-reference-viewer { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .chat-material-add { transition: none; } }

/* Mouse hover and explicit keyboard navigation share the deck without sticky restored focus. */
.reference-deck { position: relative; grid-area: add; align-self: start; width: 94px; height: 108px; min-width: 0; overflow: visible; z-index: 3; }
.reference-deck .reference-deck-open { display: block; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 4px; background: var(--bg); color: inherit; appearance: none; cursor: zoom-in; }
.reference-deck .reference-deck-open:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.reference-deck[data-count="1"] { --deck-count: 1; }
.reference-deck[data-count="2"] { --deck-count: 2; }
.reference-deck[data-count="3"] { --deck-count: 3; }
.reference-deck[data-count="4"] { --deck-count: 4; }
.reference-deck[data-count="5"] { --deck-count: 5; }
.reference-deck.has-materials { --deck-step: 72px; }
.reference-deck.has-materials > :is(.chat-material-list, .creation-material-list) { position: absolute; inset: 16px auto auto 18px; display: block; width: 72px; height: 86px; max-width: none; margin: 0; padding: 0; overflow: visible; }
.reference-deck.has-materials :is(.chat-material-item, .creation-material-card) { position: absolute; inset: 0 auto auto 0; display: block; width: 64px; height: 80px; max-width: none; min-width: 0; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 2px 7px rgba(0, 0, 0, .12); transform-origin: 50% 85%; transition: left 180ms ease, transform 180ms ease; }
.reference-deck.has-materials [data-index="0"] { --deck-index: 0; z-index: 5; transform: rotate(-11deg); }
.reference-deck.has-materials [data-index="1"] { --deck-index: 1; z-index: 4; transform: translate(5px, -3px) rotate(9deg); }
.reference-deck.has-materials [data-index="2"] { --deck-index: 2; z-index: 3; transform: translate(-4px, -5px) rotate(-3deg); }
.reference-deck.has-materials [data-index="3"] { --deck-index: 3; z-index: 2; transform: translate(7px, -5px) rotate(15deg); }
.reference-deck.has-materials [data-index="4"] { --deck-index: 4; z-index: 1; transform: translate(-6px, -6px) rotate(-16deg); }
.reference-deck.has-materials :is(.chat-material-thumb, .creation-material-preview) { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; background: var(--bg); }
.reference-deck.has-materials :is(.chat-material-name, .creation-material-name, .creation-material-meta) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.reference-deck.has-materials > :is(.chat-material-add, .creation-reference-add) { position: absolute; inset: 65px auto auto 65px; z-index: 7; width: 30px; height: 30px; min-height: 30px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text); transform: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease, border-radius 180ms ease; }
.reference-deck.has-materials > .creation-reference-add::before { content: none; }
.reference-deck.has-materials > :is(.chat-material-add, .creation-reference-add) > span:last-child { display: none; }
.reference-deck.has-materials :is(.chat-material-plus, .creation-reference-plus) { font-size: 23px; line-height: 1; }
.reference-deck.has-materials :is(.chat-material-remove, .creation-material-remove) { top: -9px; right: -8px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text); font: inherit; font-size: 18px; line-height: 1; opacity: 0; pointer-events: none; }
.reference-deck.has-materials :is(.chat-material-remove, .creation-material-remove):hover { color: var(--danger); border-color: var(--danger); }
.reference-deck.has-materials :is(.chat-material-remove, .creation-material-remove):focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.reference-deck:is(:hover, .is-keyboard-focused) { z-index: 20; }
.reference-deck.has-materials:is(:hover, .is-keyboard-focused)::before { content: ""; position: absolute; left: 8px; top: 6px; width: calc(76px + var(--deck-count) * var(--deck-step)); height: 98px; border-radius: 9px; background: var(--surface-raised); }
.reference-deck.has-materials:is(:hover, .is-keyboard-focused) > :is(.chat-material-list, .creation-material-list) { width: calc(var(--deck-count) * var(--deck-step)); }
.reference-deck.has-materials:is(:hover, .is-keyboard-focused) :is(.chat-material-item, .creation-material-card) { left: calc(var(--deck-index) * var(--deck-step)); transform: rotate(0); }
.reference-deck.has-materials:is(:hover, .is-keyboard-focused) > :is(.chat-material-add, .creation-reference-add) { top: 16px; left: calc(18px + var(--deck-count) * var(--deck-step)); width: 56px; height: 80px; min-height: 80px; border-style: dashed; border-radius: 7px; transform: rotate(5deg); }
.reference-deck.has-materials:is(:hover, .is-keyboard-focused) :is(.chat-material-remove, .creation-material-remove) { opacity: 1; pointer-events: auto; }
.reference-deck .reference-deck-preview, .reference-deck .reference-deck-caption { position: absolute; left: -3px; z-index: 12; display: block; width: 240px; max-width: none; margin: 0; visibility: hidden; opacity: 0; pointer-events: none; }
.reference-deck .reference-deck-preview { bottom: 108px; height: 156px; padding: 5px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--surface); box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); }
.reference-deck .reference-deck-caption { bottom: 82px; height: 26px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: var(--surface); color: var(--soft); font-size: 10px; }
.reference-deck [data-index="3"] > :is(.reference-deck-preview, .reference-deck-caption), .reference-deck [data-index="4"] > :is(.reference-deck-preview, .reference-deck-caption) { left: auto; right: -3px; }
.reference-deck.has-materials:hover :is(.chat-material-item, .creation-material-card):hover,
.reference-deck.has-materials.is-keyboard-focused :is(.chat-material-item, .creation-material-card):focus-within { z-index: 10; }
.reference-deck.has-materials:hover :is(.chat-material-item, .creation-material-card):hover > :is(.reference-deck-preview, .reference-deck-caption),
.reference-deck.has-materials.is-keyboard-focused :is(.chat-material-item, .creation-material-card):focus-within > :is(.reference-deck-preview, .reference-deck-caption) { visibility: visible; opacity: 1; }
@media (max-width: 1120px), (hover: none) {
  .reference-deck.has-materials { grid-column: 1 / -1; width: 100%; height: auto; min-height: 98px; padding: 14px 14px 8px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .reference-deck.has-materials:is(:hover, .is-keyboard-focused)::before { content: none; }
  .chat-reference-composer:has(> .reference-deck.has-materials), .creation-workspace .creation-reference-composer:has(> .reference-deck.has-materials) { grid-template-areas: "add add" "prompt prompt" "feedback feedback" "toolbar toolbar"; }
  .reference-deck.has-materials > :is(.chat-material-list, .creation-material-list), .reference-deck.has-materials:is(:hover, .is-keyboard-focused) > :is(.chat-material-list, .creation-material-list) { position: static; display: contents; width: auto; height: auto; }
  .reference-deck.has-materials :is(.chat-material-item, .creation-material-card), .reference-deck.has-materials:is(:hover, .is-keyboard-focused) :is(.chat-material-item, .creation-material-card) { position: relative; inset: auto; flex: 0 0 54px; width: 54px; height: 68px; transform: none; }
  .reference-deck.has-materials > :is(.chat-material-add, .creation-reference-add), .reference-deck.has-materials:is(:hover, .is-keyboard-focused) > :is(.chat-material-add, .creation-reference-add) { position: relative; inset: auto; flex: 0 0 48px; width: 48px; height: 68px; min-height: 68px; border-style: dashed; border-radius: 7px; transform: none; }
  .reference-deck.has-materials :is(.chat-material-remove, .creation-material-remove) { width: 24px; height: 24px; opacity: 1; pointer-events: auto; }
  .reference-deck .reference-deck-preview, .reference-deck .reference-deck-caption { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reference-deck.has-materials :is(.chat-material-item, .creation-material-card), .reference-deck.has-materials > :is(.chat-material-add, .creation-reference-add) { transition: none; }
}

/* Conversation archive beside chat, backed by the same saved histories. */
.chat-history-rail { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: var(--surface); }
.workspace:has(> #chat-workspace:not([hidden])) { display: grid; grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
.workspace:has(> #chat-workspace:not([hidden])) > .chat-history-rail { grid-column: 1; grid-row: 1 / -1; }
.workspace:has(> #chat-workspace:not([hidden])) > .topbar { grid-column: 2; grid-row: 1; min-height: 66px; padding: 12px 24px; }
.workspace:has(> #chat-workspace:not([hidden])) > .topbar .topbar-title > div { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.workspace:has(> #chat-workspace:not([hidden])) > .topbar .topbar-actions { margin-left: auto; }
.workspace:has(> #chat-workspace:not([hidden])) > .notice { grid-column: 2; grid-row: 2; }
.workspace > #chat-workspace { grid-column: 2; grid-row: 3; }
.workspace:has(> #chat-workspace[hidden]) > .chat-history-rail { display: none; }
.chat-history-rail-header { display: flex; align-items: center; gap: 8px; padding: 12px; min-height: 66px; border-bottom: 1px solid var(--line); }
.chat-history-rail-header, .chat-history-rail-actions, .chat-history-rail-search, .chat-history-rail-summary { flex-shrink: 0; }
.chat-history-rail-actions { display: flex; padding: 12px 12px 0; }
.chat-history-rail-actions .new-chat-button { flex: 1; min-width: 0; justify-content: center; min-height: 42px; padding: 9px 12px; font-size: 12px; border-radius: 10px; }
.chat-history-rail-actions .shortcut-key { font-size: 9px; }
.chat-history-rail-search { display: flex; align-items: center; gap: 8px; margin: 14px 12px 9px; padding: 0 10px; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); }
.chat-history-rail-search .icon { width: 16px; height: 16px; color: var(--muted); }
.chat-history-rail-search input { flex: 1; width: 0; min-width: 0; min-height: 36px; padding: 7px 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 12px; }
.chat-history-rail-search input::placeholder { color: var(--muted); }
.chat-history-rail-search:focus-within { border-color: var(--violet); outline: 1px solid var(--violet); }
.chat-history-rail-summary { display: flex; justify-content: space-between; align-items: center; padding: 8px 17px 6px; color: var(--muted); font-size: 10px; }
.chat-history-list { flex: 1; min-height: 0; padding: 0 8px 12px; overscroll-behavior: contain; }
.chat-history-list .history-open { padding: 11px 7px; }
.chat-history-list .history-open strong { font-size: 12px; }
.chat-history-list .history-open small { font-size: 9px; }
.chat-history-list .empty-copy { text-align: center; padding: 23px 8px; }
.chat-history-rail > .history-selection-toolbar { margin: 4px 12px 8px; }
.chat-history-rail > .history-feedback { margin: 0 14px 8px; }
.chat-history-list .history-more { margin-right: 3px; }
.chat-history-list .history-select-checkbox { margin-left: 8px; }
.chat-history-toggle, .chat-history-close { display: none; }
@media (max-width: 1320px) {
  .workspace:has(> #chat-workspace:not([hidden])) { grid-template-columns: 238px minmax(0, 1fr); }
  .workspace:has(> #chat-workspace:not([hidden])) > .topbar { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .workspace:has(> #chat-workspace:not([hidden])) { display: flex; }
  .workspace:has(> #chat-workspace:not([hidden])) > .topbar { min-height: 56px; padding: 8px 12px; gap: 8px; }
  .chat-history-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--soft); font: inherit; font-size: 11px; }
  .chat-history-toggle .icon { width: 16px; height: 16px; }
  .chat-history-rail { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(320px, 90vw); transform: translateX(-105%); visibility: hidden; transition: transform .2s, visibility .2s; box-shadow: 18px 0 60px rgba(0,0,0,.25); }
  body.chat-history-is-open .chat-history-rail { transform: translateX(0); visibility: visible; }
  body.chat-history-is-open { overflow: hidden; }
  body.chat-history-is-open .topbar { isolation: isolate; }
  .chat-history-close { display: grid; margin-left: auto; }
  .chat-history-rail-header { min-height: 56px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .chat-history-rail { transition: none; } }

/* Workspace component refinements. Keep these outside the shared theme block. */
:root {
  --workspace-primary: #8b5cf6;
  --workspace-primary-hover: #9b72f8;
  --workspace-primary-ink: #ffffff;
  --workspace-card: var(--surface);
  --workspace-card-hover: var(--surface-raised);
  --workspace-soft: rgba(161, 148, 255, .09);
  --workspace-new-bg: rgba(168, 85, 247, .1);
  --workspace-new-hover: rgba(168, 85, 247, .18);
  --workspace-new-border: rgba(168, 85, 247, .22);
  --workspace-new-text: #d8b4fe;
  --workspace-prompt-bg: rgba(23, 26, 50, .6);
  --workspace-prompt-border: var(--line);
  --workspace-prompt-title: var(--text);
  --workspace-subtitle: var(--soft);
  --workspace-badge-bg: #252837;
  --workspace-badge-text: #a5abc7;
  --workspace-popup-shadow: 0 16px 40px rgba(0, 0, 0, .24);
}
html[data-theme="light"] {
  --workspace-primary: #8052e6;
  --workspace-primary-hover: #7144d4;
  --workspace-card: #ffffff;
  --workspace-card-hover: #faf9fc;
  --workspace-soft: #f1edf9;
  --workspace-new-bg: #faf5ff;
  --workspace-new-hover: #f3e8ff;
  --workspace-new-border: #f3e8ff;
  --workspace-new-text: #7e22ce;
  --workspace-prompt-bg: rgba(248, 250, 252, .7);
  --workspace-prompt-border: rgba(226, 232, 240, .6);
  --workspace-prompt-title: #1e293b;
  --workspace-subtitle: #64748b;
  --workspace-badge-bg: #f1f5f9;
  --workspace-badge-text: #64748b;
  --workspace-popup-shadow: 0 12px 36px rgba(39, 31, 62, .12);
}
html[data-theme="cyan"] {
  --workspace-primary: var(--violet);
  --workspace-primary-hover: #4ce0f5;
  --workspace-primary-ink: var(--cyan-ink);
  --workspace-soft: var(--cyan-soft);
  --workspace-new-bg: var(--cyan-soft);
  --workspace-new-hover: rgba(29, 216, 243, .16);
  --workspace-new-border: var(--cyan-border);
  --workspace-new-text: var(--violet);
  --workspace-prompt-bg: var(--surface-raised);
  --workspace-badge-bg: #26313b;
  --workspace-badge-text: var(--soft);
}

html .chat-history-rail .new-chat-button {
  min-height: 44px;
  border: 1px solid var(--workspace-new-border);
  border-radius: 12px;
  background: var(--workspace-new-bg);
  color: var(--workspace-new-text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease;
}
html .chat-history-rail .new-chat-button:hover:not(:disabled) {
  background: var(--workspace-new-hover);
  border-color: var(--workspace-new-border);
  color: var(--workspace-new-text);
}
html .chat-history-rail .new-chat-button .shortcut-key {
  border-color: currentColor;
  color: inherit;
  opacity: .7;
}
.workspace-nav-item small, .creation-subnav button small {
  padding: 3px 7px;
  border: 0;
  border-radius: 999px;
  color: var(--workspace-badge-text);
  background: var(--workspace-badge-bg);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}

.welcome-state {
  max-width: 720px;
  padding: clamp(12px, 2.2vh, 26px) 0 18px;
}
.welcome-state .hero-core { isolation: isolate; margin-bottom: 18px; }
.welcome-state .hero-core::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 256px;
  height: 256px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(192, 132, 252, .1);
  filter: blur(64px);
  pointer-events: none;
}
.welcome-state .welcome-greeting { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.welcome-state h2 { font-size: clamp(32px, 3.5vw, 48px); line-height: 1.28; letter-spacing: -.035em; }
html[data-theme="light"] .welcome-state h2 > span { color: transparent; background-image: linear-gradient(to right, #9333ea, #4f46e5 50%, #5b21b6); background-clip: text; -webkit-background-clip: text; font-weight: 700; }
html:not([data-theme="light"]):not([data-theme="cyan"]) .welcome-state h2 > span { background-image: linear-gradient(105deg, #d8b4fe, #a5b4fc 52%, #c084fc); background-clip: text; -webkit-background-clip: text; }
.welcome-state .welcome-subtitle {
  max-width: 448px;
  margin: 8px auto 24px;
  color: var(--workspace-subtitle);
  font-size: 14px;
  line-height: 1.8;
  text-wrap: balance;
}
.welcome-state .quick-prompts { max-width: 680px; gap: 12px; }
html .welcome-state .prompt-card {
  min-height: 122px;
  padding: 16px;
  border-color: var(--workspace-prompt-border);
  border-radius: 12px;
  background: var(--workspace-prompt-bg);
  box-shadow: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
html .welcome-state .prompt-card:hover {
  transform: translateY(-2px);
  border-color: var(--violet);
  background: var(--workspace-card-hover);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.welcome-state .prompt-card:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.welcome-state .prompt-icon { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 13px; }
.welcome-state .prompt-card strong { margin-bottom: 6px; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--workspace-prompt-title); }
.welcome-state .prompt-card small { display: block; min-width: 0; overflow: hidden; font-size: 12px; font-weight: 400; line-height: 1.6; color: var(--workspace-subtitle); white-space: nowrap; text-overflow: ellipsis; }
.welcome-state .prompt-arrow { top: 23px; right: 16px; width: 15px; height: 15px; transform: rotate(-45deg); transition: transform .18s ease; }
.welcome-state .prompt-card:hover .prompt-arrow { transform: translate(2px, -2px) rotate(-45deg); }
.chat-history-rail-header h2 { margin: 0; color: var(--soft); font-size: 13px; font-weight: 500; line-height: 1.5; }

.sidebar .sidebar-bottom { position: relative; padding-top: 18px; }
html .sidebar .account-card {
  gap: 10px;
  min-height: 68px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--workspace-card);
  color: var(--text);
  transition: background .18s ease, border-color .18s ease;
}
html .sidebar .account-card:hover:not(:disabled), html .sidebar .account-card[aria-expanded="true"] {
  border-color: var(--violet);
  background: var(--workspace-card-hover);
  color: var(--text);
}
.sidebar .account-card:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.sidebar .account-card .user-avatar { width: 36px; height: 36px; border-radius: 11px; }
.sidebar .account-card strong { font-size: 13px; line-height: 1.4; }
.sidebar .account-card small { margin-top: 4px; font-size: 10px; line-height: 1.4; }
.sidebar .account-card > .icon { width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar .admin-entry-link { margin: 10px 4px 0; font-size: 10px; }
.account-menu {
  position: absolute;
  z-index: 80;
  right: 0;
  bottom: calc(100% - 8px);
  left: 0;
  max-height: calc(100dvh - 150px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--workspace-card);
  color: var(--text);
  box-shadow: var(--workspace-popup-shadow);
  overscroll-behavior: contain;
}
.account-menu :is([role="menuitem"], [role="menuitemradio"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 12px;
  text-align: left;
}
.account-menu :is([role="menuitem"], [role="menuitemradio"]):hover,
.account-menu :is([role="menuitem"], [role="menuitemradio"]):focus-visible {
  background: var(--workspace-soft);
  color: var(--text);
}
.account-menu :is([role="menuitem"], [role="menuitemradio"]):focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.account-menu .icon { width: 17px; height: 17px; flex: 0 0 auto; }
.account-menu #logout-button { color: var(--danger); }
.account-menu #account-theme[aria-expanded="true"] { color: var(--violet); background: var(--workspace-soft); }
.account-menu #account-theme-options { margin: 4px 0; padding: 5px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-menu [role="menuitemradio"] { min-height: 36px; padding: 8px 10px 8px 37px; }
.account-menu [role="menuitemradio"][aria-checked="true"] { color: var(--violet); background: var(--workspace-soft); }
.account-menu [role="menuitemradio"]::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: currentColor; opacity: 0; }
.account-menu [role="menuitemradio"][aria-checked="true"]::after { opacity: 1; }

@media (min-width: 761px) {
  .workspace { --chat-history-width: 270px; }
  .workspace:has(> #chat-workspace:not([hidden])) {
    grid-template-columns: var(--chat-history-width) minmax(0, 1fr);
    transition: grid-template-columns .24s ease;
  }
  .workspace > .chat-history-rail {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity .18s ease, transform .24s ease, visibility 0s linear;
  }
  .chat-history-rail .chat-history-close { display: grid; margin-left: auto; width: 34px; height: 34px; border-radius: 10px; }
  body.chat-history-is-collapsed .workspace:has(> #chat-workspace:not([hidden])) { grid-template-columns: 0 minmax(0, 1fr); }
  body.chat-history-is-collapsed .workspace > .chat-history-rail {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-12px);
    transition: opacity .18s ease, transform .24s ease, visibility 0s linear .24s;
  }
  body.chat-history-is-collapsed .workspace:has(> #chat-workspace:not([hidden])) #open-chat-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--workspace-card);
    color: var(--soft);
  }
  #open-chat-history > .icon { width: 18px; height: 18px; }
  #open-chat-history > span { display: none; }
  #open-chat-history:hover, .chat-history-close:hover { color: var(--text); background: var(--workspace-soft); }
}
@media (min-width: 761px) and (max-width: 1320px) { .workspace { --chat-history-width: 238px; } }
@media (min-width: 761px) and (max-height: 820px) {
  .welcome-state { padding: 0 0 8px; }
  .welcome-state .hero-core { height: 150px; margin: 0 auto 8px; }
  .welcome-state .welcome-greeting { margin-bottom: 8px; line-height: 18px; }
  .welcome-state h2 { font-size: clamp(30px, 3.3vw, 42px); line-height: 1.2; }
  .welcome-state .welcome-subtitle { margin: 8px auto 20px; line-height: 1.7; }
  html .welcome-state .prompt-card { min-height: 110px; }
  .welcome-state .prompt-icon { width: 26px; height: 26px; margin-bottom: 6px; border-radius: 8px; }
  .welcome-state .prompt-icon .icon { width: 16px; height: 16px; }
  .welcome-state .prompt-card strong { margin-bottom: 3px; }
  .welcome-state .prompt-card small { line-height: 1.5; }
  .welcome-state .prompt-arrow { top: 22px; }
}
@media (max-width: 760px) {
  .welcome-state { padding-top: 6px; }
  .welcome-state .hero-core { margin-bottom: 12px; }
  .welcome-state h2 { font-size: clamp(30px, 7vw, 38px); }
  .welcome-state .welcome-subtitle { margin: 8px auto 24px; white-space: normal; }
  .welcome-state .quick-prompts { gap: 10px; }
  html .welcome-state .prompt-card { padding: 16px; }
}
@media (max-width: 560px) {
  .welcome-state .quick-prompts { grid-template-columns: 1fr; }
  html .welcome-state .prompt-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) 15px; column-gap: 12px; align-items: center; min-height: 80px; padding: 16px; }
  .welcome-state .prompt-icon { grid-column: 1; grid-row: 1 / 3; margin: 0; }
  .welcome-state .prompt-card strong { grid-column: 2; grid-row: 1; margin-bottom: 3px; font-size: 14px; }
  .welcome-state .prompt-card small { grid-column: 2; grid-row: 2; font-size: 12px; }
  .welcome-state .prompt-arrow { display: block; position: static; grid-column: 3; grid-row: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace:has(> #chat-workspace:not([hidden])), .workspace > .chat-history-rail { transition: none; }
  html .welcome-state .prompt-card:hover { transform: none; }
  .welcome-state .prompt-card:hover .prompt-arrow { transform: rotate(-45deg); }
}

/* Command center: the empty home groups its content; an active chat owns
   a bounded message scroller and the same, persistent composer below it. */
:root {
  --command-bg: linear-gradient(145deg, #101225, #121127 48%, #0b101e);
  --command-dot: rgba(148, 163, 184, .2);
  --command-glass: rgba(23, 25, 46, .82);
  --command-card: rgba(28, 30, 53, .6);
  --command-card-hover: rgba(36, 37, 65, .9);
  --command-border: rgba(192, 160, 255, .24);
  --command-card-border: rgba(148, 163, 184, .2);
  --command-hover-border: #a78bfa;
  --command-focus: #a78bfa;
  --command-ring: rgba(168, 85, 247, .1);
  --command-shadow: 0 20px 50px -10px rgba(99, 102, 241, .16), 0 8px 20px -4px rgba(0, 0, 0, .2);
  --command-icon-bg: rgba(168, 85, 247, .12);
  --command-icon: #d8b4fe;
  --command-title: linear-gradient(to right, #d8b4fe, #a5b4fc 50%, #7dd3fc);
}
html[data-theme="light"] {
  --command-bg: linear-gradient(145deg, #f8fafc, rgba(250, 245, 255, .36) 48%, #fff);
  --command-dot: #cbd5e1;
  --command-glass: rgba(255, 255, 255, .8);
  --command-card: rgba(255, 255, 255, .6);
  --command-card-hover: rgba(255, 255, 255, .9);
  --command-border: rgba(233, 213, 255, .6);
  --command-card-border: rgba(226, 232, 240, .6);
  --command-hover-border: #d8b4fe;
  --command-focus: #a855f7;
  --command-shadow: 0 20px 50px -10px rgba(99, 102, 241, .12), 0 8px 20px -4px rgba(0, 0, 0, .04);
  --command-icon-bg: #faf5ff;
  --command-icon: #9333ea;
  --command-title: linear-gradient(to right, #9333ea, #4f46e5 50%, #0ea5e9);
}
html[data-theme="cyan"] {
  --command-bg: linear-gradient(145deg, #151c24, #12212b 48%, #111820);
  --command-dot: rgba(125, 211, 252, .2);
  --command-glass: rgba(20, 30, 39, .82);
  --command-card: rgba(25, 39, 49, .6);
  --command-card-hover: rgba(30, 48, 59, .9);
  --command-border: rgba(34, 211, 238, .24);
  --command-hover-border: #22d3ee;
  --command-focus: #22d3ee;
  --command-ring: rgba(34, 211, 238, .1);
  --command-icon-bg: rgba(34, 211, 238, .1);
  --command-icon: #67e8f9;
  --command-title: linear-gradient(to right, #a5b4fc, #67e8f9 50%, #38bdf8);
}
#chat-workspace.command-workspace {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--command-bg);
}
#chat-workspace > .command-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.command-atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--command-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .5;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
  transition: opacity .4s ease;
}
#chat-workspace[data-chat-layout="conversation"] .command-atmosphere::before { opacity: .2; }
#chat-command-center {
  container: command-main / inline-size;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#chat-command-center > .chat-welcome-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 32px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--command-card-border) transparent;
}
#chat-workspace[data-chat-layout="conversation"] .chat-welcome-stage { display: none; }
#chat-command-center #welcome-state {
  flex: none;
  width: 100%;
  max-width: 768px;
  margin: auto auto 0;
  padding: 0;
  text-align: center;
}
#chat-command-center .hero-core {
  width: 360px;
  height: 248px;
  margin: 0 auto 18px;
  isolation: isolate;
}
#chat-command-center .hero-core::before {
  top: 50%;
  left: 50%;
  width: 600px;
  height: 420px;
  background: radial-gradient(ellipse at 38% 48%, rgba(var(--core-secondary),.14), transparent 65%), radial-gradient(ellipse at 62% 52%, rgba(var(--core-primary),.12), transparent 65%);
  filter: blur(55px);
  transform: translate(-50%, -50%);
  animation: command-aurora-breathe 9s ease-in-out infinite alternate;
}
#chat-command-center .welcome-greeting { margin: 0 0 10px; font-size: 12px; line-height: 1.6; }
#chat-command-center .welcome-state h2 {
  margin: 0;
  font-size: clamp(36px, 3.6vw, 48px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.045em;
}
#chat-command-center .welcome-state h2 > span {
  color: transparent;
  background-image: var(--command-title);
  background-clip: text;
  -webkit-background-clip: text;
  font-weight: 900;
}
#chat-command-center .welcome-subtitle {
  max-width: 448px;
  margin: 12px auto 0;
  color: var(--workspace-subtitle);
  font-size: 14px;
  line-height: 1.75;
  white-space: normal;
  text-wrap: balance;
}
#chat-command-center > .message-stream { width: 100%; flex: 1; min-height: 0; }
#chat-command-center > .composer-zone {
  position: relative;
  z-index: 3;
  flex: none;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 20px;
}
#chat-workspace[data-chat-layout="empty"] .composer-zone {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 30px 20px;
}
#chat-command-center #chat-form {
  min-height: 152px;
  border: 1px solid var(--command-border);
  background: var(--command-glass);
  box-shadow: var(--command-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: border-color .2s ease, box-shadow .2s ease;
}
#chat-command-center #chat-form > textarea { min-height: 108px; }
#chat-command-center #chat-form:hover { border-color: var(--command-hover-border); }
#chat-command-center #chat-form:is(:focus-within, .is-drag-over) {
  border-color: var(--command-focus);
  box-shadow: 0 0 0 4px var(--command-ring), var(--command-shadow);
}
#chat-command-center .send-button {
  background: linear-gradient(to right, #9333ea, #4f46e5);
  box-shadow: 0 4px 10px rgba(168, 85, 247, .25);
  transition: filter .2s ease, opacity .2s ease, box-shadow .2s ease;
}
#chat-command-center .send-button:hover:not(:disabled) {
  background: linear-gradient(to right, #9333ea, #4f46e5);
  filter: brightness(1.1);
}
#chat-command-center .send-button:disabled { box-shadow: none; }
#command-prompts {
  display: grid;
  flex: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 672px;
  margin: 20px auto auto;
}
#command-prompts .prompt-card {
  display: block;
  position: relative;
  min-width: 0;
  min-height: 116px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--command-card-border);
  border-radius: 12px;
  background: var(--command-card);
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#command-prompts .prompt-card:hover {
  transform: translateY(-4px);
  background: var(--command-card-hover);
  border-color: var(--command-hover-border);
  box-shadow: 0 10px 15px -3px rgba(168, 85, 247, .05), 0 4px 6px -4px rgba(168, 85, 247, .05);
}
#command-prompts .prompt-card:focus-visible { outline: 2px solid var(--command-focus); outline-offset: 3px; }
#command-prompts .prompt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--command-icon-bg);
  color: var(--command-icon);
}
#command-prompts .prompt-icon .icon { width: 18px; height: 18px; }
#command-prompts .prompt-card strong { display: block; margin: 0 0 4px; color: var(--workspace-prompt-title); font-size: 13px; font-weight: 500; line-height: 1.4; }
#command-prompts .prompt-card small { display: block; overflow: hidden; color: var(--workspace-subtitle); font-size: 11px; line-height: 1.6; white-space: nowrap; text-overflow: ellipsis; }
#command-prompts .prompt-arrow { display: block; position: absolute; top: 21px; right: 14px; width: 14px; height: 14px; transform: rotate(-45deg); transition: transform .2s ease; }
#command-prompts .prompt-card:hover .prompt-arrow { transform: translate(2px, -2px) rotate(-45deg); }
@keyframes command-aurora-breathe {
  from { opacity: .65; transform: translate(-50%, -50%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@media (min-width: 761px) and (max-height: 740px) {
  #chat-command-center > .chat-welcome-stage { padding-block: 24px; }
  #chat-command-center .hero-core { width: 310px; height: 204px; margin-bottom: 10px; }
}
@media (max-width: 760px) {
  #chat-command-center > .chat-welcome-stage { padding: 24px 18px; }
  #chat-command-center .hero-core { width: 280px; height: 204px; }
  #chat-command-center .welcome-state h2 { font-size: 36px; }
  #chat-command-center .welcome-subtitle { font-size: 13px; }
  #chat-command-center > .composer-zone { padding: 0 14px 14px; }
  #chat-workspace[data-chat-layout="empty"] .composer-zone { margin: 0 auto; padding: 0 14px 14px; }
  #chat-command-center #chat-form { min-height: 144px; }
  #chat-command-center #chat-form > textarea { min-height: 100px; }
}
@container command-main (max-width: 560px) {
  #command-prompts { grid-template-columns: 1fr; gap: 10px; }
  #command-prompts .prompt-card { display: grid; grid-template-columns: 32px minmax(0, 1fr) 14px; column-gap: 12px; align-items: center; min-height: 72px; }
  #command-prompts .prompt-icon { grid-column: 1; grid-row: 1 / 3; margin: 0; }
  #command-prompts .prompt-card strong { grid-column: 2; grid-row: 1; }
  #command-prompts .prompt-card small { grid-column: 2; grid-row: 2; }
  #command-prompts .prompt-arrow { position: static; grid-column: 3; grid-row: 1 / 3; }
  #chat-command-center .composer-controls:has(.stop-button:not([hidden])) { flex-wrap: wrap; }
  #chat-command-center .chat-model-choice { flex-basis: 132px; }
  #chat-command-center .chat-model-choice select { width: 132px; }
}
@container command-main (max-width: 360px) {
  #chat-command-center .welcome-state h2 { font-size: 32px; }
  #chat-command-center .hero-core { width: 250px; height: 186px; }
}
@media (prefers-reduced-motion: reduce) {
  #chat-command-center .hero-core::before { animation: none; }
  #chat-command-center #chat-form, #chat-command-center .send-button,
  #command-prompts .prompt-card, #command-prompts .prompt-arrow, .command-atmosphere::before { transition: none; }
  #command-prompts .prompt-card:hover { transform: none; }
  #command-prompts .prompt-card:hover .prompt-arrow { transform: rotate(-45deg); }
}

/* Signed-out visitors can browse models; the primary action opens sign-in. */
.workbench .floating-dock .send-button.is-login-required,
.command-workspace .send-button.is-login-required {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  gap: 6px;
  padding-inline: 12px;
  font-size: 12px;
  white-space: nowrap;
}


/* BEGIN SIDEBAR PEEK CSS */
/* The desktop icon rail blends into the page; hover reveals a glass overlay. */
@media (min-width: 761px) {
  body:not(.canvas-editor-active) .workbench {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .workbench > .sidebar.sidebar-peek {
    position: relative;
    z-index: 36;
    width: 72px;
    min-height: 0;
    padding: 24px 12px 16px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    transition: width .23s cubic-bezier(.22, .8, .22, 1), background-color .23s ease, box-shadow .23s ease;
  }

  .workbench > .sidebar.sidebar-peek.is-peek-open {
    width: 238px;
    background: color-mix(in srgb, var(--surface) 65%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    backdrop-filter: blur(18px) saturate(125%);
    box-shadow: 14px 0 32px color-mix(in srgb, var(--bg) 16%, transparent);
  }

  .workbench > .sidebar.sidebar-peek .brand {
    position: relative;
    flex-shrink: 0;
    min-height: 44px;
    gap: 0;
    padding: 0 3px;
    margin-bottom: 25px;
    white-space: nowrap;
  }

  .workbench > .sidebar.sidebar-peek .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .workbench > .sidebar.sidebar-peek .brand-mark .icon { width: 24px; height: 24px; }

  .workbench > .sidebar.sidebar-peek .brand > span:last-child {
    position: absolute;
    left: 56px;
    width: 158px;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-7px);
    pointer-events: none;
    transition: opacity .13s ease, transform .19s ease;
  }

  .workbench > .sidebar.sidebar-peek .brand strong { font-size: 23px; }
  .workbench > .sidebar.sidebar-peek .brand small { font-size: 7px; letter-spacing: .14em; }

  .workbench > .sidebar.sidebar-peek .workspace-nav {
    flex: 0 1 auto;
    min-height: 0;
    gap: 6px;
    margin: 4px 0 18px;
    padding: 2px 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }

  .workbench > .sidebar.sidebar-peek .workspace-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 13px;
    gap: 0;
    border-radius: 12px;
    border-color: transparent;
    white-space: nowrap;
  }

  .workbench > .sidebar.sidebar-peek .workspace-nav-item.is-active::before { display: none; }

  .workbench > .sidebar.sidebar-peek .workspace-nav-item > .icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  .workbench > .sidebar.sidebar-peek .workspace-nav-item > span:not(.creation-nav-caret),
  .workbench > .sidebar.sidebar-peek .creation-subnav-item > span {
    position: absolute;
    left: 48px;
    right: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateX(-7px);
    pointer-events: none;
    transition: opacity .13s ease, transform .19s ease;
  }

  .workbench > .sidebar.sidebar-peek .creation-nav-caret {
    position: absolute;
    right: 14px;
    opacity: 0;
    transition: opacity .13s ease, transform .19s ease;
  }

  .workbench > .sidebar.sidebar-peek .creation-subnav {
    gap: 2px;
    margin: 0 0 4px;
    padding: 0;
    border: 0;
  }

  .workbench > .sidebar.sidebar-peek .creation-subnav-item {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    gap: 0;
    border-radius: 10px;
    white-space: nowrap;
  }

  .workbench > .sidebar.sidebar-peek .creation-subnav-item > .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }

  .workbench > .sidebar.sidebar-peek .sidebar-bottom {
    flex: 0 0 auto;
    min-width: 0;
    margin-top: auto;
    padding-top: 14px;
    border: 0;
  }

  html .workbench > .sidebar.sidebar-peek .account-card {
    position: relative;
    gap: 0;
    min-height: 50px;
    padding: 6px 5px;
    border-color: transparent;
    border-radius: 12px;
    background: transparent;
    white-space: nowrap;
  }

  html .workbench > .sidebar.sidebar-peek .account-card:hover:not(:disabled),
  html .workbench > .sidebar.sidebar-peek .account-card[aria-expanded="true"] {
    background: var(--workspace-card-hover);
    border-color: transparent;
  }

  .workbench > .sidebar.sidebar-peek .account-card .user-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  .workbench > .sidebar.sidebar-peek .account-card > span:nth-child(2) {
    position: absolute;
    left: 51px;
    right: 27px;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-7px);
    pointer-events: none;
    transition: opacity .13s ease, transform .19s ease;
  }

  .workbench > .sidebar.sidebar-peek .account-card > span:nth-child(2) :is(strong, small) {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .workbench > .sidebar.sidebar-peek .account-card > .icon {
    position: absolute;
    right: 8px;
    opacity: 0;
    transition: opacity .13s ease;
  }

  .workbench > .sidebar.sidebar-peek .account-menu { min-width: 214px; }

  .workbench > .sidebar.sidebar-peek.is-peek-open .brand > span:last-child,
  .workbench > .sidebar.sidebar-peek.is-peek-open .workspace-nav-item > span:not(.creation-nav-caret),
  .workbench > .sidebar.sidebar-peek.is-peek-open .creation-subnav-item > span,
  .workbench > .sidebar.sidebar-peek.is-peek-open .account-card > span:nth-child(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: .045s;
  }

  .workbench > .sidebar.sidebar-peek.is-peek-open .creation-nav-caret,
  .workbench > .sidebar.sidebar-peek.is-peek-open .account-card > .icon { opacity: 1; transition-delay: .045s; }
}

/* Each icon reacts locally, without moving the rail or its hit targets. */
.sidebar.sidebar-peek :is(.workspace-nav-item, .creation-subnav-item, .account-menu button) > .icon,
.sidebar.sidebar-peek .brand-mark > .icon,
.sidebar.sidebar-peek .account-card > .user-avatar {
  transform-origin: center;
  transform-box: fill-box;
  will-change: auto;
}

.sidebar.sidebar-peek .workspace-nav-item:is(:hover, :focus-visible):not(:disabled) > .icon {
  animation: sidebar-icon-rise .52s cubic-bezier(.2, .8, .3, 1);
}

.sidebar.sidebar-peek #workspace-nav-creation:is(:hover, :focus-visible):not(:disabled) > .icon {
  animation-name: sidebar-icon-shutter;
}

.sidebar.sidebar-peek #workspace-nav-canvas:is(:hover, :focus-visible):not(:disabled) > .icon {
  animation-name: sidebar-icon-orbit;
}

.sidebar.sidebar-peek #workspace-nav-history:is(:hover, :focus-visible):not(:disabled) > .icon {
  animation-name: sidebar-icon-page;
}

.sidebar.sidebar-peek .creation-subnav-item:is(:hover, :focus-visible):not(:disabled) > .icon,
.sidebar.sidebar-peek .account-menu button:is(:hover, :focus-visible):not(:disabled) > .icon {
  animation: sidebar-icon-rise .52s cubic-bezier(.2, .8, .3, 1);
}

.sidebar.sidebar-peek .creation-subnav-item[data-creation-type="video"]:is(:hover, :focus-visible) > .icon {
  animation-name: sidebar-icon-play;
}

.sidebar.sidebar-peek .creation-subnav-item[data-creation-type="audio"]:is(:hover, :focus-visible) > .icon {
  animation-name: sidebar-icon-voice;
}

.sidebar.sidebar-peek .brand:is(:hover, :focus-visible) .brand-mark > .icon {
  animation: sidebar-icon-orbit .64s cubic-bezier(.2, .8, .3, 1);
}

.sidebar.sidebar-peek .account-card:is(:hover, :focus-visible) > .user-avatar {
  animation: sidebar-icon-rise .52s cubic-bezier(.2, .8, .3, 1);
}

@keyframes sidebar-icon-rise {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-3px) scale(1.1); }
  65% { transform: translateY(1px) scale(.98); }
}
@keyframes sidebar-icon-shutter {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(.88) rotate(-7deg); }
  65% { transform: scale(1.12) rotate(4deg); }
}
@keyframes sidebar-icon-orbit {
  0%, 100% { transform: rotate(0) scale(1); }
  35% { transform: rotate(-14deg) scale(1.08); }
  68% { transform: rotate(7deg) scale(1.02); }
}
@keyframes sidebar-icon-page {
  0%, 100% { transform: perspective(80px) rotateY(0) translateY(0); }
  40% { transform: perspective(80px) rotateY(-24deg) translateY(-2px); }
  72% { transform: perspective(80px) rotateY(8deg) translateY(0); }
}
@keyframes sidebar-icon-play {
  0%, 100% { transform: translateX(0) scale(1); }
  35% { transform: translateX(3px) scale(1.08); }
  68% { transform: translateX(-1px) scale(.98); }
}
@keyframes sidebar-icon-voice {
  0%, 100% { transform: scaleY(1); }
  25% { transform: scaleY(1.2); }
  50% { transform: scaleY(.82); }
  75% { transform: scaleY(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .workbench > .sidebar.sidebar-peek,
  .workbench > .sidebar.sidebar-peek .brand > span:last-child,
  .workbench > .sidebar.sidebar-peek .workspace-nav-item > span,
  .workbench > .sidebar.sidebar-peek .creation-subnav-item > span,
  .workbench > .sidebar.sidebar-peek .account-card > span:nth-child(2),
  .workbench > .sidebar.sidebar-peek .account-card > .icon {
    transition: none;
  }
  .sidebar.sidebar-peek :is(.workspace-nav-item, .creation-subnav-item, .account-menu button) > .icon,
  .sidebar.sidebar-peek .brand-mark > .icon,
  .sidebar.sidebar-peek .account-card > .user-avatar { animation: none !important; }
}
/* END SIDEBAR PEEK CSS */
