@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{color-scheme:dark;--bg:#050b19;--panel:#071226;--panel2:#0a1930;--line:rgba(124,177,255,.14);--text:#f4f7ff;--muted:#8f9db8;--cyan:#31dcff;--blue:#3d7cff;--purple:#b34dff;--green:#47e6b1}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:'DM Sans',sans-serif;min-height:100vh}button,textarea{font:inherit}button{cursor:pointer}.app-shell{display:flex;height:100dvh;min-height:560px;overflow:hidden;background:radial-gradient(ellipse at 65% -15%,rgba(15,85,183,.22),transparent 45%),var(--bg)}
.sidebar{width:276px;flex-shrink:0;background:rgba(5,13,29,.96);border-right:1px solid var(--line);padding:24px 16px 16px;display:flex;flex-direction:column;z-index:5}.brand{display:flex;align-items:center;gap:11px;padding:0 5px 25px}.brand-mark{width:42px;height:42px;border-radius:13px;background:linear-gradient(145deg,#20e4ff 0%,#176dff 48%,#bc35ff 100%);display:grid;place-items:center;box-shadow:0 0 24px #167dff42;transform:skew(-5deg)}.brand-mark span{font:700 31px 'Space Grotesk';color:#061126}.brand-copy{display:flex;flex-direction:column;min-width:0}.brand-copy strong{font:700 19px 'Space Grotesk';letter-spacing:-.8px;white-space:nowrap}.brand-copy em,.mobile-brand em{font-style:normal;color:#9a67ff}.brand-copy small{font-size:8px;color:#93a8c9;letter-spacing:.7px;margin-top:3px;white-space:nowrap}.new-chat{height:46px;border:1px solid rgba(58,190,255,.36);background:linear-gradient(110deg,rgba(21,115,220,.17),rgba(143,56,255,.1));border-radius:12px;color:#f5f8ff;text-align:left;padding:0 14px;font-weight:600;box-shadow:inset 0 0 18px rgba(37,138,255,.05);transition:.2s}.new-chat:hover{border-color:var(--cyan);background:#10264a}.new-chat span{font-size:22px;color:var(--cyan);vertical-align:-2px;margin-right:8px}.side-label{font-size:10px;font-weight:700;letter-spacing:1.3px;color:#657797;margin:27px 9px 12px}.history-list{overflow:auto;flex:1}.empty-history{font-size:12px;color:#647491;padding:12px 9px;line-height:1.6}.history-item{display:flex;align-items:center;gap:9px;width:100%;padding:11px 10px;border:1px solid transparent;border-radius:9px;background:transparent;color:#aebbd2;text-align:left;font-size:12px;margin-bottom:4px}.history-item:hover,.history-item.active{background:#0b1b34;border-color:#18365c;color:#fff}.history-item .history-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}.history-item .delete-history{opacity:.45;border:0;background:transparent;color:#aab8d0;font-size:17px;padding:0 2px}.history-item .delete-history:hover{opacity:1;color:#ff8d9b}.sidebar-bottom{border-top:1px solid var(--line);padding:16px 8px 2px;display:flex;align-items:center;gap:8px;font-size:11px;color:#9babc6}.status-dot,.online-dot{width:7px;height:7px;border-radius:50%;background:#42e5a5;box-shadow:0 0 9px #42e5a577}.status-pill{margin-left:auto;color:#69cfff;border:1px solid #1d5374;border-radius:5px;padding:3px 6px;font-size:9px}.sidebar-bottom p{position:absolute;bottom:6px;margin:0;color:#50617d;font-size:10px}
.main-panel{min-width:0;flex:1;display:flex;flex-direction:column;position:relative}.topbar{height:66px;flex-shrink:0;border-bottom:1px solid rgba(124,177,255,.09);display:flex;align-items:center;justify-content:space-between;padding:0 28px;background:rgba(5,11,25,.72);backdrop-filter:blur(14px)}.topbar-right{display:flex;align-items:center;gap:9px;color:#9aa9c2;font-size:11px}.icon-btn{border:1px solid transparent;background:transparent;color:#a9bad6;border-radius:9px;width:34px;height:34px;font-size:19px;display:grid;place-items:center}.icon-btn:hover{background:#11213b;border-color:#233c60;color:#fff}.menu-btn,.mobile-brand,.close-sidebar{display:none}.chat-scroll{flex:1;overflow-y:auto;scroll-behavior:smooth;padding:20px 24px 24px}.welcome{max-width:800px;margin:12px auto 22px;text-align:center;animation:rise .6s ease both}.welcome-orb{height:106px;width:106px;position:relative;margin:0 auto 18px;display:grid;place-items:center}.orb-core{width:67px;height:67px;border-radius:22px;display:grid;place-items:center;font:700 44px 'Space Grotesk';color:#d9fbff;background:linear-gradient(140deg,#0b2b56,#09152b);border:1px solid #26dfff;box-shadow:0 0 24px #00cfff4d,inset 0 0 20px #007dff3a;z-index:1}.orb-ring{position:absolute;inset:3px;border:1px solid #21cfff8a;border-radius:34%;transform:rotate(35deg);box-shadow:0 0 22px #168bff2c}.ring-two{inset:13px;border-color:#a34aff99;transform:rotate(-30deg)}.eyebrow{font-size:10px;letter-spacing:2.1px;font-weight:700;color:#6fdcff;display:flex;align-items:center;justify-content:center;gap:10px}.eyebrow span{width:23px;height:1px;background:linear-gradient(90deg,transparent,#28cfff)}.eyebrow span:last-child{transform:rotate(180deg)}h1{font:600 clamp(32px,4.5vw,47px)/1.12 'Space Grotesk';letter-spacing:-1.8px;margin:17px 0 13px}h1 span{background:linear-gradient(90deg,#eafaff,#66dfff 42%,#a889ff);-webkit-background-clip:text;background-clip:text;color:transparent}.welcome>p{max-width:470px;margin:0 auto;color:#8fa0bd;font-size:13px;line-height:1.75}.suggestions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:620px;margin:28px auto 0;text-align:left}.suggestion{display:flex;align-items:center;gap:12px;min-height:69px;padding:12px;border:1px solid rgba(107,164,235,.17);border-radius:13px;background:linear-gradient(125deg,rgba(14,31,59,.9),rgba(7,19,39,.8));color:#fff;text-align:left;transition:transform .18s,border-color .18s,background .18s}.suggestion:hover{transform:translateY(-2px);border-color:#268bc4;background:#0d2341}.suggestion-icon{width:35px;height:35px;border-radius:10px;display:grid;place-items:center;font-size:19px;flex-shrink:0}.suggestion-icon.blue{background:#0d4c9b;color:#7de9ff}.suggestion-icon.purple{background:#48217c;color:#d9a7ff}.suggestion-icon.cyan{background:#07566a;color:#7ff0ff}.suggestion-icon.green{background:#075b50;color:#79ffd3}.suggestion b{display:block;font-size:12px;font-weight:600}.suggestion small{display:block;font-size:10px;color:#8598b6;margin-top:4px}.suggestion .arrow{margin-left:auto;color:#5f83ae;font-size:15px}.messages{max-width:800px;margin:0 auto;display:flex;flex-direction:column;gap:24px;padding:0 0 20px}.message{display:flex;gap:12px;align-items:flex-start;animation:rise .25s ease both}.message.user{flex-direction:row-reverse}.avatar{width:30px;height:30px;flex-shrink:0;border-radius:10px;display:grid;place-items:center;font:700 16px 'Space Grotesk';background:#10294a;border:1px solid #1c5279;color:#4fe3ff}.user .avatar{background:linear-gradient(145deg,#4e2b99,#1763a9);color:white;border:0}.message-body{min-width:0;max-width:calc(100% - 44px);font-size:14px;line-height:1.75;color:#d9e3f4;overflow-wrap:anywhere}.user .message-body{background:#0d1e36;border:1px solid #1b3555;border-radius:15px 4px 15px 15px;padding:10px 14px;color:#f4f7ff;max-width:80%}.assistant .message-body{padding-top:1px;flex:1}.message-body p{margin:0 0 12px}.message-body p:last-child{margin-bottom:0}.message-body h1,.message-body h2,.message-body h3{font-size:19px;letter-spacing:-.3px;margin:18px 0 8px}.message-body ul,.message-body ol{padding-left:22px;margin:8px 0 13px}.message-body li{padding:2px 0}.message-body code{font-family:ui-monospace,monospace;background:#10233f;padding:2px 5px;border-radius:5px;color:#81eaff;font-size:.9em}.message-body pre{background:#030916;border:1px solid #1b3454;border-radius:10px;padding:14px;overflow:auto;white-space:pre-wrap}.message-body pre code{padding:0;background:none}.message-body a{color:#69ddff}.typing{display:flex;gap:5px;padding:8px 0}.typing span{width:6px;height:6px;border-radius:50%;background:#54dfff;animation:bounce 1s infinite}.typing span:nth-child(2){animation-delay:.15s}.typing span:nth-child(3){animation-delay:.3s}
.composer-wrap{padding:12px 24px 13px;background:linear-gradient(180deg,transparent,rgba(5,11,25,.96) 23%);flex-shrink:0}.composer{max-width:800px;margin:0 auto;border:1px solid rgba(104,171,243,.28);border-radius:17px;background:rgba(9,23,44,.97);padding:12px 12px 8px;box-shadow:0 8px 32px #0003,inset 0 0 20px #0e2a4c24;transition:border-color .2s}.composer:focus-within{border-color:#25bfe9;box-shadow:0 0 0 3px #16a9e50d,0 8px 32px #0003}.composer textarea{width:100%;resize:none;max-height:180px;min-height:28px;background:transparent;border:0;outline:0;color:#f7faff;padding:3px 4px;font-size:14px;line-height:1.5}.composer textarea::placeholder{color:#6f82a2}.composer-tools{display:flex;align-items:center;justify-content:space-between;padding-top:6px}.composer-hint{font-size:10px;color:#657c9e}.spark{color:#6bdfff;font-size:14px;margin-right:4px}.send-btn{height:34px;width:36px;border:0;border-radius:10px;background:linear-gradient(135deg,#25c8ee,#3d7dff 70%,#8757ff);display:grid;place-items:center;color:#041126;box-shadow:0 0 18px #218bff30;transition:transform .15s,opacity .15s}.send-btn:hover{transform:translateY(-1px)}.send-btn:disabled{opacity:.35;cursor:not-allowed;transform:none}.send-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.disclaimer{text-align:center;font-size:9px;color:#536581;margin:10px auto 0;line-height:1.5}.disclaimer span{color:#657fa1}.toast{position:fixed;bottom:100px;left:50%;transform:translate(-50%,12px);opacity:0;pointer-events:none;padding:11px 16px;border:1px solid #285078;background:#0c1c34;color:#dceaff;border-radius:10px;font-size:12px;z-index:20;transition:.25s;box-shadow:0 8px 30px #0005}.toast.show{opacity:1;transform:translate(-50%,0)}.mobile-scrim{display:none}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes bounce{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}
@media(min-width:1100px){.welcome{margin-top:20px}.chat-scroll{padding-top:24px}.welcome-orb{margin-bottom:20px}}
@media(max-width:760px){.app-shell{min-height:500px}.sidebar{position:fixed;top:0;bottom:0;left:0;width:min(290px,85vw);transform:translateX(-102%);transition:transform .25s;box-shadow:15px 0 50px #0007}.sidebar.open{transform:translateX(0)}.close-sidebar{display:grid;margin-left:auto}.mobile-scrim.show{display:block;position:fixed;inset:0;background:#020714a8;z-index:4}.topbar{height:58px;padding:0 14px}.menu-btn{display:grid}.mobile-brand{display:block;font:700 15px 'Space Grotesk';margin-right:auto;margin-left:9px}.mini-mark{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:7px;background:linear-gradient(135deg,#25e0ff,#8c3cff);color:#061126;margin-right:5px}.topbar-right{font-size:10px;gap:6px}.topbar-right .online-dot{width:6px;height:6px}.chat-scroll{padding:12px 14px 18px}.welcome{margin:8px auto 20px}.welcome-orb{height:82px;width:82px;margin-bottom:14px}.orb-core{width:55px;height:55px;font-size:35px;border-radius:18px}.eyebrow{font-size:8px;letter-spacing:1.5px}h1{font-size:35px;letter-spacing:-1.2px;margin:14px 0 10px}.welcome>p{font-size:12px;max-width:330px}.suggestions{gap:8px;margin-top:22px}.suggestion{padding:10px;gap:8px;min-height:67px}.suggestion-icon{width:29px;height:29px;font-size:16px}.suggestion b{font-size:10px}.suggestion small{font-size:9px}.suggestion .arrow{display:none}.composer-wrap{padding:8px 12px 10px}.composer{border-radius:14px;padding:10px 10px 7px}.composer textarea{font-size:13px}.disclaimer{font-size:8px;margin-top:8px}.message-body{font-size:13px}.messages{gap:19px}.avatar{width:28px;height:28px}.sidebar-bottom p{bottom:8px}}
@media(max-width:380px){.suggestions{grid-template-columns:1fr}.suggestion{min-height:58px}.welcome-orb{height:70px;width:70px}h1{font-size:31px}.topbar-right>span:not(.online-dot){display:none}}

/* Optional Google account sign-in */
.account-button{display:flex;align-items:center;gap:7px;border:1px solid #25466b;background:#0b1b33;color:#e6f3ff;border-radius:10px;padding:5px 10px 5px 6px;font:600 11px system-ui,sans-serif;white-space:nowrap;max-width:190px}
.account-button:hover{border-color:#35bfe9;background:#102642}
.account-avatar{width:23px;height:23px;flex:0 0 23px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#2bc9e8,#7957e8);color:#061126;font-weight:800;font-size:11px}
.account-avatar.large{width:42px;height:42px;flex-basis:42px;font-size:17px}
.account-modal{position:fixed;inset:0;z-index:40;display:none;align-items:center;justify-content:center;padding:18px}
.account-modal.open{display:flex}
.account-modal-backdrop{position:absolute;inset:0;background:rgba(1,7,18,.78);backdrop-filter:blur(8px)}
.account-dialog{position:relative;width:min(100%,390px);padding:30px 26px 22px;border:1px solid #24466c;border-radius:22px;background:linear-gradient(155deg,#10223d,#071225 72%);box-shadow:0 24px 90px #0009;text-align:center;color:#eef6ff;animation:rise .2s ease both}
.account-close{position:absolute;right:13px;top:10px;border:0;background:transparent;color:#a7b9d4;font-size:25px;width:32px;height:32px;border-radius:8px}
.account-close:hover{background:#1b3150;color:white}
.account-logo{width:53px;height:53px;margin:0 auto 12px;display:grid;place-items:center;border-radius:17px;background:linear-gradient(145deg,#0b315b,#101a3b);border:1px solid #31d7f1;box-shadow:0 0 25px #12c8e933;color:#dffaff;font:700 32px 'Space Grotesk'}
.account-eyebrow{font-size:9px;letter-spacing:1.8px;color:#6bdcf5;font-weight:700;margin:0 0 9px}
.account-dialog h2{font:600 23px 'Space Grotesk';margin:0 0 9px;letter-spacing:-.5px}
.account-description{font-size:12px;line-height:1.65;color:#a8bad3;margin:0 auto 20px;max-width:300px}
.google-signin,.guest-continue,.signout-button{width:100%;min-height:44px;border-radius:11px;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:10px}
.google-signin{border:1px solid #dce6f3;background:#fff;color:#243449}
.google-signin:hover{background:#edf5ff}
.google-g{font:bold 18px Arial;color:#4285f4}
.guest-continue{margin-top:9px;border:1px solid #29486b;background:#0c1d35;color:#d9eaff}
.guest-continue:hover{background:#142b49}
.account-divider{display:flex;align-items:center;gap:10px;margin:19px 0 12px;color:#627997;font-size:8px;letter-spacing:1.4px}
.account-divider:before,.account-divider:after{content:'';height:1px;flex:1;background:#203753}
.account-note{font-size:10px;line-height:1.6;color:#8296b4;margin:0}
.account-powered{font-size:8px;color:#526987;margin:18px 0 0}
.account-error{font-size:11px;line-height:1.5;color:#ff9aa8;margin:10px 0 0;min-height:0}
.account-error:empty{display:none}
.signed-in-panel{margin-top:16px;padding-top:15px;border-top:1px solid #203753}
.signed-in-user{display:flex;align-items:center;gap:11px;text-align:left;margin-bottom:14px;min-width:0}
.signed-in-user>span:last-child{min-width:0;display:flex;flex-direction:column;gap:3px}
.signed-in-user strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.signed-in-user small{font-size:10px;color:#90a5c3;overflow-wrap:anywhere}
.signout-button{border:1px solid #70404c;background:#291923;color:#ffdbe1}
.signout-button:hover{background:#3a202c}
@media(max-width:760px){.account-button{padding:4px 7px 4px 4px;font-size:10px;max-width:125px;gap:5px}.account-avatar{width:21px;height:21px;flex-basis:21px}.topbar-right{gap:5px}.online-label{display:none}.account-dialog{padding:28px 20px 19px}}

.studio-open{border:1px solid #285078;background:#102744;color:#aeeeff;border-radius:9px;padding:7px 10px;font-size:11px;white-space:nowrap}
.image-studio{display:none;position:fixed;inset:0;z-index:50;align-items:center;justify-content:center;padding:16px}
.image-studio.show{display:flex}.image-studio-backdrop{position:absolute;inset:0;background:#020714d9;backdrop-filter:blur(5px)}
.image-studio-dialog{position:relative;width:min(540px,100%);max-height:92vh;overflow:auto;background:#08172c;border:1px solid #285078;border-radius:18px;padding:25px;color:#eaf4ff;box-shadow:0 20px 70px #0009}
.image-studio-dialog h2{font:600 25px 'Space Grotesk';margin:5px 0 8px}.studio-description,.studio-note{font-size:12px;color:#91a6c4;line-height:1.6}.studio-label{display:block;font-size:12px;color:#c6d9f2;margin:16px 0 7px}.image-studio-dialog textarea,.image-studio-dialog input[type=file]{width:100%;box-sizing:border-box;background:#061126;border:1px solid #284463;border-radius:10px;padding:11px;color:#eaf4ff;font:13px inherit}.image-studio-dialog textarea{resize:vertical}.image-studio-dialog .google-signin{margin-top:15px}.studio-status{font-size:12px;color:#8eeaff;min-height:18px}.studio-result img{display:block;width:100%;height:auto;border-radius:12px;border:1px solid #294968;margin:10px 0}.studio-result .guest-continue{display:block;text-align:center;text-decoration:none}.studio-result[hidden]{display:none}
@media(max-width:420px){.composer-hint{font-size:0}.studio-open{font-size:10px;padding:7px}.image-studio-dialog{padding:20px}}

/* Stable composer action grouping: Image Studio stays beside the left tool icon. */
.composer-actions{display:flex;align-items:center;gap:10px;min-width:0;}
.composer-actions .composer-hint{white-space:nowrap;}
.studio-open{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 12px;font-size:12px;line-height:1.2;}
@media(max-width:420px){.composer-actions{gap:9px}.studio-open{font-size:11px;padding:7px 10px;min-height:34px}}

/* ROTCOD AI v14: Image Studio homepage card and polished generation progress. */
.image-studio-card .suggestion-icon{font-size:20px;background:linear-gradient(145deg,#07566a,#123d78);color:#8defff;box-shadow:0 0 18px #12bde51c}
.studio-progress{margin:16px 0 12px;padding:16px;border:1px solid #28547b;border-radius:14px;background:linear-gradient(145deg,#0d2340,#08172b);box-shadow:inset 0 1px 0 #ffffff08,0 12px 28px #0003}
.studio-progress[hidden]{display:none}
.studio-progress-heading{display:flex;align-items:center;gap:11px;min-width:0}
.studio-progress-heading>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
.studio-progress-heading strong{font-size:11px;line-height:1.4;color:#eaf7ff}
.studio-progress-heading small{font-size:11px;color:#8fa9c9}
.studio-progress-heading>b{font:600 19px 'Space Grotesk';color:#78e8ff;font-variant-numeric:tabular-nums}
.studio-spinner{width:25px;height:25px;flex:0 0 25px;border:2px solid #244c70;border-top-color:#54e4ff;border-right-color:#9b79ff;border-radius:50%;animation:studioSpin .9s linear infinite}
.studio-progress-track{height:8px;margin-top:15px;border-radius:99px;background:#142d4a;overflow:hidden;box-shadow:inset 0 1px 3px #0007}
.studio-progress-fill{height:100%;width:0;border-radius:99px;background:linear-gradient(90deg,#27c9ec,#4389ff 65%,#a06cff);box-shadow:0 0 14px #39c9ff7a;transition:width .65s cubic-bezier(.2,.75,.25,1)}
.studio-progress-caption{font-size:10px;color:#7189a9;margin:10px 0 0;line-height:1.5}
@keyframes studioSpin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.studio-spinner{animation:none}.studio-progress-fill{transition:none}}

/* ROTCOD AI v15: clear completion state for image generation. */
.studio-progress.is-complete .studio-spinner{animation:none;border:0;background:linear-gradient(145deg,#20c997,#12a875);box-shadow:0 0 16px #20c99755;position:relative}
.studio-progress.is-complete .studio-spinner::after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;color:#041b17;font-size:17px;font-weight:800;line-height:1}
.studio-progress.is-complete .studio-progress-heading>b{color:#65e6ad}
.studio-progress.is-complete .studio-progress-fill{background:linear-gradient(90deg,#20c997,#43d69b);box-shadow:0 0 14px #20c99755}
