@font-face{font-family:Yekan;src:url('fonts/Yekan.woff2') format('woff2');font-weight:400;font-display:swap}@font-face{font-family:Yekan;src:url('fonts/Yekan.woff') format('woff');font-weight:700;font-display:swap}*{box-sizing:border-box}:root{--bg:#f7f5fb;--text:#20202a;--muted:#777487;--line:#e9e5f0;--purple:#6d28d9;--purple2:#7c3aed;--lav:#eee7ff;--navy:#20233f;--side:#fbfaff}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:Yekan,Tahoma,sans-serif;background:var(--bg);color:var(--text)}button,textarea,input{font:inherit}.app-bg{position:fixed;inset:0;background:radial-gradient(circle at 75% 0,#eee7ff,transparent 35%),var(--bg);pointer-events:none}.app-shell{position:relative;width:min(1200px,calc(100vw - 36px));height:calc(100dvh - 36px);margin:18px auto;display:flex;background:#fff;border:1px solid var(--line);border-radius:25px;box-shadow:0 22px 70px rgba(49,31,84,.1);overflow:hidden}.sidebar{width:270px;flex:0 0 270px;background:var(--side);border-left:1px solid var(--line);display:flex;flex-direction:column;padding:16px;z-index:50}.sidebar-head{display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:10px}.rotbe-logo{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;color:#fff;font-size:21px;font-weight:700;background:linear-gradient(135deg,var(--purple),var(--purple2));box-shadow:0 8px 18px #6d28d93b}.brand-title{font-weight:700;font-size:16px;letter-spacing:.5px}.brand-subtitle{margin-top:2px;color:var(--muted);font-size:10px}.new-chat{margin:18px 0 14px;border:1px solid #ddd5f0;background:#fff;color:var(--purple);border-radius:13px;padding:11px;cursor:pointer;font-weight:700}.side-label{font-size:10px;color:#9892a6;margin:0 5px 8px}.project-label{margin-top:10px}.chat-list,.project-list{min-height:0;overflow:auto}.chat-list{flex:1}.chat-item{width:100%;border:0;background:transparent;text-align:right;border-radius:11px;padding:9px 10px;margin-bottom:3px;color:#4b4657;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-item:hover{background:#f0ebfa}.chat-item.active{background:var(--lav);color:#402076;font-weight:700}.chat-item small{display:block;font-size:8px;color:#aaa2b6;margin-top:3px}.project-list{max-height:110px}.project-item{display:flex;align-items:center;gap:6px;padding:7px 9px;border-radius:9px;font-size:10px;color:#595263;cursor:pointer}.project-item:hover{background:#f0ebfa}.side-link{border:0;background:transparent;text-align:right;color:var(--purple);font-size:10px;padding:7px 8px;cursor:pointer}.sidebar-foot{margin-top:8px;padding-top:12px;border-top:1px solid var(--line);font-size:9px;color:#96909e}.status{display:flex;align-items:center;gap:7px}.status i{width:7px;height:7px;border-radius:50%;background:#31a56d}.side-note{margin-top:6px}.chat-shell{min-width:0;flex:1;display:flex;flex-direction:column;background:#fff}.topbar{min-height:70px;padding:12px 17px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}.desktop-brand{margin-left:auto}.top-actions{display:flex;gap:6px}.ghost-btn,.icon-btn,.model-btn{border:1px solid #e2ddec;background:#fff;color:#686273;border-radius:10px;padding:8px 10px;cursor:pointer;font-size:10px}.danger:hover{color:#b42318}.icon-btn{font-size:19px;line-height:1}.model-wrap{position:relative}.model-btn span{margin-right:4px}.model-menu{display:none;position:absolute;top:calc(100% + 6px);right:0;width:190px;background:#fff;border:1px solid var(--line);border-radius:13px;padding:6px;box-shadow:0 16px 35px #2613421c;z-index:80}.model-menu.show{display:block}.model-menu button{width:100%;border:0;background:#fff;text-align:right;border-radius:9px;padding:8px;cursor:pointer;color:#443d50}.model-menu button:hover{background:var(--lav)}.model-menu small{display:block;color:#9992a2;font-size:8px;margin-top:2px}.mobile-brand,.mobile-only{display:none}.messages{flex:1;min-height:0;overflow-y:auto;padding:25px 22px;scroll-behavior:smooth}.welcome-card{max-width:700px;margin:clamp(18px,6vh,55px) auto;text-align:center;padding:18px}.welcome-icon{width:58px;height:58px;margin:auto auto 14px;border-radius:18px;display:grid;place-items:center;background:var(--lav);color:var(--purple);font-size:27px}.welcome-card h1{margin:0 0 8px;color:var(--navy);font-size:27px}.welcome-card p{margin:0 auto 18px;color:var(--muted);line-height:1.9;font-size:12px}.suggestions{display:grid;grid-template-columns:1fr 1fr;gap:8px;text-align:right}.suggestions button{border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px;color:#514b5e;cursor:pointer;font-size:10px}.suggestions button:hover{border-color:#cdbbea;color:var(--purple)}.message-row{display:flex;margin:0 auto 17px;max-width:850px}.message-row.user{justify-content:flex-start}.message-row.bot{justify-content:flex-end}.bubble{max-width:min(82%,760px);padding:12px 15px;border-radius:17px;line-height:1.95;overflow-wrap:anywhere;font-size:12px}.user .bubble{background:var(--lav);color:#35205f;border-bottom-left-radius:5px}.bot .bubble{background:var(--purple);color:#fff;border-bottom-right-radius:5px}.bubble p{margin:0 0 11px}.bubble p:last-child{margin-bottom:0}.bubble h1,.bubble h2,.bubble h3{line-height:1.5;margin:15px 0 7px}.bubble ul,.bubble ol{margin:7px 0 13px;padding-right:22px}.inline-code{direction:ltr;unicode-bidi:plaintext;background:#0002;padding:1px 5px;border-radius:5px;font-family:Consolas,monospace}.code-block{direction:ltr;text-align:left;margin:12px 0;border-radius:11px;overflow:hidden;background:#17151d}.code-toolbar{padding:5px 7px;display:flex;justify-content:space-between;background:#fff1}.copy-code{border:0;border-radius:6px;background:#fff2;color:#fff;padding:4px 7px;cursor:pointer;font-size:9px}.code-block pre{margin:0;padding:12px;overflow:auto;color:#f5f5f6;font:12px/1.7 Consolas,monospace}.bubble-tools{display:flex;gap:5px;margin-top:8px}.bubble-tools button{border:1px solid #d8c8ef;background:#fff;color:#4b237d;border-radius:7px;padding:5px 9px;font-size:9px;font-weight:700;cursor:pointer;box-shadow:0 1px 2px rgba(30,15,55,.08)}.bubble-tools button:hover{background:#f5efff;border-color:#bda5df;color:#32135f}.attachments{display:flex;gap:7px;overflow:auto;margin-bottom:7px}.attachment{display:flex;align-items:center;gap:6px;background:#f5f1fb;border:1px solid #e4dcef;border-radius:9px;padding:5px 8px;font-size:9px;white-space:nowrap}.attachment button{border:0;background:transparent;cursor:pointer;color:#8c8297}.composer{padding:10px 15px 7px;border-top:1px solid var(--line);background:#fff}.composer-row{display:flex;align-items:flex-end;gap:7px}.input-wrap{flex:1;min-width:0;border:1px solid #ddd8e8;border-radius:16px;padding:8px 11px 6px;background:#fff}.input-wrap:focus-within{border-color:#bda7df;box-shadow:0 0 0 3px #6d28d90d}.input-wrap textarea{width:100%;resize:none;border:0;outline:0;display:block;min-height:24px;max-height:140px;line-height:1.7;font-size:13px;color:var(--text);background:transparent}.input-meta{display:flex;justify-content:space-between;color:#aaa2b1;font-size:8px;margin-top:4px}.tool-btn,.send-btn,.stop-btn{width:39px;height:39px;border-radius:12px;border:1px solid #e1dbea;background:#fff;color:#6d6475;cursor:pointer;display:grid;place-items:center;flex:0 0 39px}.tool-btn:hover{color:var(--purple);border-color:#cbb9e8}.send-btn{border:0;color:#fff;background:linear-gradient(135deg,var(--purple),var(--purple2));font-size:20px}.stop-btn{display:none;color:#b42318}.busy .send-btn{display:none}.busy .stop-btn{display:grid}.disclaimer{text-align:center;color:#aaa3af;font-size:8px;padding:0 10px 7px}.sidebar-overlay{display:none}.typing{display:inline-flex;gap:4px}.typing span{width:6px;height:6px;border-radius:50%;background:currentColor;animation:b 1s infinite}.typing span:nth-child(2){animation-delay:.15s}.typing span:nth-child(3){animation-delay:.3s}@keyframes b{0%,80%,100%{opacity:.3}40%{opacity:1;transform:translateY(-3px)}}
@media(max-width:700px){html,body{height:100%;overflow:hidden}.app-shell{position:fixed;inset:0;width:100%;height:var(--app-height,100dvh);max-height:var(--app-height,100dvh);margin:0;border:0;border-radius:0;overflow:hidden}.sidebar{position:fixed;top:0;right:0;bottom:0;width:min(86vw,300px);transform:translateX(105%);transition:transform .22s ease;box-shadow:-20px 0 45px #24143b26}.sidebar.open{transform:translateX(0)}.sidebar-overlay{position:fixed;inset:0;background:#17121f55;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);opacity:0;visibility:hidden;pointer-events:none;z-index:90;transition:.2s}.sidebar-overlay.show{opacity:1;visibility:visible;pointer-events:auto}.mobile-only,.mobile-brand{display:block}.desktop-brand{display:none}.topbar{min-height:62px;padding:9px 10px}.mobile-brand{margin-left:auto}.top-actions{margin-right:auto}.top-actions .ghost-btn{font-size:9px;padding:7px 8px}.model-wrap{order:2}.messages{padding:16px 11px}.bubble{max-width:91%;font-size:12px}.suggestions{grid-template-columns:1fr}.welcome-card h1{font-size:22px}.composer{padding:8px 9px max(7px,env(safe-area-inset-bottom))}.input-meta span:last-child{display:none}.input-wrap textarea{font-size:16px}.tool-btn,.send-btn,.stop-btn{width:36px;height:36px;flex-basis:36px}.disclaimer{display:none}.model-menu{position:fixed;top:58px;right:10px}.project-list{max-height:100px}}

@media(max-width:700px){.sidebar{z-index:100}.sidebar-overlay.show{pointer-events:auto;cursor:pointer}.sidebar .icon-btn{position:relative;z-index:101}.bubble-tools button{min-width:48px}}
.project-item{width:100%;display:flex;flex-direction:column;gap:3px;text-align:right;background:transparent;border:0;border-radius:12px;padding:10px 12px;color:inherit;cursor:pointer;font-family:inherit}
.project-item:hover,.project-item.active{background:rgba(109,40,217,.09)}
.project-item small{opacity:.58;font-size:11px;padding-right:20px}
.project-status{margin:8px 12px 0;padding:8px 10px;border-radius:10px;background:rgba(109,40,217,.06);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Phase 5.2 — Project workspace + nested conversations */
.project-list{flex:1;max-height:none;overflow:auto;padding:0 2px 6px}
.project-group{margin-bottom:8px;border:1px solid transparent;border-radius:14px}
.project-group.active{background:#fcfaff;border-color:#eee7f8}
.project-head{display:flex;align-items:center;gap:4px}
.project-head .project-item{flex:1;min-width:0}
.project-preview{width:31px;height:31px;flex:0 0 31px;border:1px solid #e2d8f1;background:#fff;color:var(--purple);border-radius:9px;cursor:pointer;font-size:11px;display:grid;place-items:center}
.project-preview:hover{background:var(--lav);border-color:#cdbbea}
.project-chats{padding:0 7px 7px 7px}
.nested-chat{padding:7px 9px 7px 10px;margin:1px 0;border-radius:9px;font-size:10px;position:relative}
.nested-chat:before{content:"";position:absolute;right:4px;top:8px;bottom:8px;width:2px;border-radius:2px;background:#e6ddf4}
.nested-chat span,.nested-chat small{display:block;padding-right:9px}
.nested-chat.active{background:var(--lav);color:#402076}
.nested-chat.active:before{background:var(--purple)}
.project-empty{padding:5px 17px 7px;color:#aaa2b1;font-size:9px}
.unassigned-label{margin-top:2px}
.unassigned-chats{flex:0 0 auto;max-height:120px;padding-bottom:2px}

/* Phase 5.2 — Preview button polish */
@media(max-width:700px){.project-preview{width:34px;height:34px;flex-basis:34px}.unassigned-chats{max-height:105px}}

.bubble{min-width:0}.bubble pre{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}.response-status{white-space:pre-wrap;border-top:1px solid #ffffff55;margin-top:12px;padding-top:8px;font-size:11px}.preview-dialog{width:95vw;max-width:1400px;height:90vh;border:0;border-radius:16px;padding:12px}.preview-dialog[open]{display:flex;flex-direction:column;gap:10px}.preview-dialog iframe{width:100%;flex:1;border:1px solid #ddd;background:white}.preview-dialog::backdrop{background:#0008}@media(max-width:700px){.sidebar{z-index:100}}
