:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#e9f0fb;background:#0b1324}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer}
#app{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.topbar{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#101c30;border-bottom:1px solid #26364d;min-height:64px;flex-shrink:0}
.brand{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.brandMark{width:35px;height:35px;border-radius:11px;background:linear-gradient(145deg,#52dfb2,#367bc8);display:grid;place-items:center;color:#061523;font-size:21px;font-weight:900}.brand strong,.brand small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand strong{font-size:15px}.brand small{font-size:11px;color:#90a4bf}
.connection{font-size:11px;color:#ffbd80;white-space:nowrap}.connection.online{color:#65dfae}.iconButton{border:0;background:transparent;color:#d8e6f8;font-size:26px;line-height:1;padding:4px 8px}
.updateBanner{background:#1d4f67;padding:8px 12px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;flex-shrink:0}.updateBanner button{border:0;border-radius:8px;padding:7px 11px;background:#7ce8c5;color:#10283c;font-weight:700}.view{flex:1;min-height:0}#projectsView{overflow-y:auto}
.sectionHead{display:flex;justify-content:space-between;align-items:center;padding:22px 18px 10px}.sectionHead h1{font-size:25px;margin:0 0 4px}.sectionHead p{font-size:12px;color:#91a4bc;margin:0}.softButton,.threadButton{border:1px solid #35516b;color:#d9e7fa;border-radius:10px;background:#162741;padding:8px 11px}
.search{display:block;width:calc(100% - 36px);margin:10px 18px 16px;border:1px solid #30455e;border-radius:12px;background:#101d32;color:#fff;padding:11px 13px;outline:none}.search:focus,textarea:focus,input:focus{border-color:#5dcda8}
.projectsList{padding:0 13px 30px}.projectCard{width:100%;display:flex;text-align:left;gap:13px;align-items:center;background:#122139;color:#e9f0fb;border:1px solid #283e58;border-radius:16px;padding:15px;margin:0 0 10px}.projectCard:active{background:#1d3453}.projectIcon{width:42px;height:42px;flex:0 0 42px;border-radius:12px;background:#1b4d5b;color:#85e9c8;display:grid;place-items:center;font-size:22px}.projectMeta{min-width:0;flex:1}.projectName{font-size:16px;font-weight:700}.projectPath,.projectPreview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:#91a4bc;margin-top:3px}.projectCount{font-size:11px;color:#7bd5b7}.chevron{font-size:22px;color:#7793ad}.emptyState{padding:48px 20px;text-align:center;color:#90a4bf;line-height:1.7}
.chatView{display:flex;flex-direction:column;min-height:0;overflow:hidden}.chatToolbar{display:flex;align-items:center;gap:7px;padding:9px 11px;border-bottom:1px solid #26364d;background:#0f1a2b;flex-shrink:0}.threadButton{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.threadButton span{float:right}.chatArea{flex:1;min-height:0;overflow-y:auto;padding:12px 12px 20px}.olderButton{display:block;margin:2px auto 14px;border:0;background:transparent;color:#82dabb;padding:8px}.messages{display:flex;flex-direction:column;gap:14px}
.message{max-width:93%;padding:11px 13px;border-radius:14px;line-height:1.55;white-space:pre-wrap;word-break:break-word;font-size:14px}.message.user{align-self:flex-end;background:#255d68;color:#f7fffc;border-bottom-right-radius:5px}.message.assistant{align-self:flex-start;background:#172941;border:1px solid #2b415d;border-bottom-left-radius:5px}.message.plan,.message.tool{align-self:flex-start;background:#101e32;border:1px solid #263a52;color:#afc1d5;font-size:12px}.messageHeader{font-size:10px;font-weight:700;color:#82dabb;letter-spacing:.03em;margin-bottom:4px}.messageText{white-space:pre-wrap}.message.live{margin-top:14px}
.composer{padding:8px 10px calc(10px + env(safe-area-inset-bottom));border-top:1px solid #2a3e58;background:#101b2e;flex-shrink:0}.turnState{font-size:11px;color:#92aac1;margin:0 2px 6px}.composeRow{display:flex;gap:8px;align-items:flex-end}.composeRow textarea{flex:1;min-width:0;resize:none;max-height:130px;background:#0e1a2d;border:1px solid #37516b;border-radius:13px;color:#fff;padding:10px 12px;outline:none}.primaryButton{background:#59dcb0;color:#082435;border:0;border-radius:11px;padding:10px 15px;font-weight:800}.primaryButton:disabled{opacity:.5}.full{width:100%}.stopButton{border:0;background:transparent;color:#e9a8a8;padding:7px 3px 0;font-size:12px}
.modal{position:fixed;inset:0;background:rgba(4,10,20,.8);z-index:10;display:flex;align-items:center;justify-content:center;padding:18px}.card{width:min(480px,100%);max-height:88dvh;overflow:auto;background:#14243b;border:1px solid #35506d;border-radius:18px;padding:21px}.card h2{font-size:21px;margin:5px 0 10px}.card p{font-size:13px;line-height:1.55;color:#afc1d4}.card input{width:100%;background:#0c182a;color:#fff;border:1px solid #36506a;border-radius:10px;padding:11px;margin:6px 0 13px}.card label{display:block;font-size:12px;color:#a4bad0;margin:12px 0 2px}.eyebrow{font-size:11px;color:#69dcb7;text-transform:uppercase;letter-spacing:.1em}.modalHead{display:flex;align-items:center;justify-content:space-between}.modalHead h2{margin:0}.accountCode{border:1px solid #344c66;border-radius:10px;padding:10px;background:#0f1d31;color:#bfd0e1}.note{font-size:11px!important}.error{color:#f4a4a4;font-size:12px;min-height:19px}
.threadCard{padding-bottom:10px}.threadsList{margin-top:15px;max-height:65dvh;overflow:auto}.threadRow{width:100%;background:#102038;border:1px solid #2a405c;color:#e6f0fa;border-radius:11px;padding:12px;text-align:left;margin-bottom:8px}.threadRow.active{border-color:#61d5b0;background:#1b3d4b}.threadRow strong,.threadRow small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.threadRow small{color:#8fa8be;margin-top:4px}
.approvalBody{max-height:45dvh;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:13px;color:#d1deec}.approvalBody input,.approvalBody select{margin:5px 0 12px}.approvalActions{display:flex;gap:7px;flex-wrap:wrap;margin-top:14px}.approvalActions button{border-radius:9px;padding:9px 11px;border:1px solid #37516b;background:#192c45;color:#fff}.approvalActions .approve{background:#3f9e81;color:#071d1c;border:0}.toast{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);background:#33516a;color:#fff;border-radius:12px;padding:10px 15px;z-index:20;max-width:90%;text-align:center}
.desktopView{display:flex;flex-direction:column;min-height:0;overflow:hidden}.desktopToolbar{display:flex;gap:8px;padding:8px;background:#111e31}.desktopToolbar button:first-child{flex:1;text-align:left}#screenWrap{position:relative;flex:1;min-height:0;background:#050a11;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}#screen{max-width:100%;max-height:100%;object-fit:contain;touch-action:none;user-select:none;-webkit-user-drag:none}#screenEmpty{position:absolute;color:#89a1b8;pointer-events:none}.desktopControls{display:flex;gap:5px;flex-wrap:wrap;padding:8px;background:#111e31}.desktopControls input{flex:1 0 60%;min-width:0;background:#0d1829;color:#fff;border:1px solid #344b64;border-radius:8px;padding:7px}.desktopControls button{flex:1;border:1px solid #344b64;border-radius:8px;background:#1a2e48;color:#fff;padding:7px}
.projectName,.projectCount{display:block}.projectCount{margin-top:2px}
.message.tool{width:93%;padding:8px 12px}.message.tool summary{cursor:pointer;color:#83a8bb}.message.tool .messageText{margin-top:9px;border-top:1px solid #263a52;padding-top:9px}
.chatView{position:relative}.jumpLatest{position:absolute;right:16px;bottom:calc(108px + env(safe-area-inset-bottom));z-index:2;border:1px solid #70d6bb;background:#173e48;color:#eafff8;border-radius:999px;padding:9px 14px;box-shadow:0 8px 24px #07111dbb;font-size:12px;font-weight:700}
.message.queued{align-self:flex-end;background:#25415a}.message.failed{border:1px solid #e7a2a2}.queueStatus{display:block;font-size:11px;color:#9fd7cc;margin-top:7px}.retryButton{border:1px solid #e7a2a2;background:#5b3038;color:#fff;border-radius:8px;padding:5px 9px;margin-top:7px}
