:root{font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;color:#e8edf4;background:#090f0c;font-size:15px;color-scheme:dark}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{background:#4ade80;color:#052e16;border:0;border-radius:9px;padding:11px 16px;cursor:pointer;font-weight:600}button:hover{filter:brightness(1.07)}button.quiet,nav button{background:#193526;color:#bbf7d0}input,textarea,select{border:1px solid #31523e;border-radius:8px;background:#101c15;color:#e8edf4;padding:12px;max-width:100%}label{display:grid;gap:9px;margin-bottom:16px;color:#b5c2d2;font-size:13px}h1{font-size:25px;line-height:1.4;font-weight:600;margin:12px 0}h2{font-size:25px;font-weight:500}h3{font-size:12px;letter-spacing:2px;text-transform:uppercase;color:#7c8ea4;margin-top:30px}p{line-height:1.7;color:#a7b5c7}.muted{font-size:12px;line-height:1.7;color:#90a1b7;overflow-wrap:anywhere}.brand{font-size:26px;font-weight:700;color:#4ade80}.brand span{font-size:15px;color:#d2dbe6;font-weight:500}.login{max-width:440px;margin:12vh auto;padding:30px}.login h1{margin-top:50px}.login button{width:100%}.login form{display:grid;gap:8px;margin-top:28px}details{margin-top:25px;color:#9cadbf}header{height:72px;border-bottom:1px solid #263d2e;display:flex;align-items:center;gap:20px;padding:0 28px}header #health{margin-left:auto;font-size:12px;color:#93a6be}.layout{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:calc(100vh - 72px)}aside{padding:24px 18px;border-right:1px solid #263d2e;background:#0e1912}aside>button{width:100%;margin-top:12px}.account{margin-top:35px;padding-top:20px;border-top:1px solid #263d2e;font-size:12px;display:grid;gap:10px}#tasks{display:grid;gap:8px}#tasks button{text-align:left;background:transparent;color:#b1bfd1;font-size:13px;overflow:hidden;text-overflow:ellipsis;padding:12px;border:1px solid #2c4936}#tasks button.selected{border-color:#4ade80;background:#19452b}main{min-width:0}nav{display:flex;gap:8px;border-bottom:1px solid #263d2e;padding:18px 30px}nav button{background:transparent}nav button.active{color:#4ade80;background:#19452b}.panel{max-width:1140px;margin:auto;padding:25px 32px}.heading{display:flex;align-items:center;gap:15px;flex-wrap:wrap}.heading>div:first-child{flex:1}.heading h1{flex:1}.welcome{padding:80px 10px;text-align:center}#messages{min-height:38vh;max-height:58vh;overflow:auto;padding:12px 0}.message{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75;padding:18px 20px;background:#142219;border:1px solid #2c4936;border-radius:12px;margin:15px 0}.message.user{background:#173c26;border-color:#2f6845;margin-left:10%}.message pre,pre{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.7 Consolas,monospace;color:#a1b2c7}.message summary{font-size:12px;color:#a9b9cd;cursor:pointer}#promptForm{display:grid;grid-template-columns:1fr auto;gap:12px;margin-top:20px;align-items:end}#prompt{resize:vertical;min-height:90px}.notice,.approval{border:1px solid #7c6739;background:#2e291e;padding:16px;border-radius:10px;line-height:1.6;margin:20px 0;font-size:13px}.approval button{margin:8px}.file-layout{display:grid;grid-template-columns:220px 1fr;gap:18px;margin-top:20px}#fileList{width:100%;height:58vh;padding:5px;font-size:12px}#editor{width:100%;height:58vh;font:13px/1.6 Consolas,monospace;tab-size:2;margin:8px 0;white-space:pre;resize:vertical}#diffText,#checkResult{padding:20px;background:#101c15;max-height:500px;overflow:auto}#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);max-width:90vw;padding:15px 24px;background:#d8e7e0;color:#152d23;border-radius:10px;box-shadow:0 10px 40px #0008;z-index:10}a{color:#4ade80}[hidden]{display:none!important}@media(max-width:760px){header{padding:0 16px;height:60px}header #health{max-width:100px}.layout{display:block}aside{border-right:0;border-bottom:1px solid #263d2e;padding:16px;display:flex;flex-wrap:wrap;gap:10px}aside label{flex:1;margin:0;min-width:150px}aside>button{width:auto;margin:0}aside h3,aside .account{width:100%;margin-top:8px}#projectPath{display:none}#tasks{display:flex;width:100%;overflow:auto}#tasks button{flex-shrink:0;max-width:170px}.account{padding-top:12px;display:flex;flex-wrap:wrap;align-items:center}.panel{padding:18px 16px}nav{padding:12px;gap:2px}nav button{font-size:13px;padding:10px}#promptForm{grid-template-columns:1fr}#promptForm button{justify-self:end}.file-layout{grid-template-columns:1fr}#fileList{height:120px}#messages{max-height:55vh}h1{font-size:22px}.welcome{padding:30px 4px}}

dialog{max-width:min(92vw,520px);border:1px solid #555;border-radius:12px;padding:24px;background:#101c15;color:#eee}dialog::backdrop{background:#0009}dialog label{display:block;margin:12px 0}dialog input[type=checkbox]{width:auto}#deleteError{color:#ffb4a9}
/* Workbench layout: scoped overrides preserve the existing theme. */
.layout{grid-template-columns:350px minmax(0,1fr)}.layout.sidebar-closed{grid-template-columns:minmax(0,1fr)}
aside{min-width:0;display:block}header{height:auto;min-height:72px;flex-wrap:wrap;padding:12px 20px;gap:12px}header button{white-space:nowrap}main,form,section,.heading>div{min-width:0}nav{flex-wrap:wrap}nav button{white-space:nowrap}
.sidebar-section{margin:0 0 22px}.sidebar-section>summary{display:flex;justify-content:space-between;align-items:center;font-size:14px;font-weight:600;color:#cbd7e5;cursor:pointer;list-style:none;padding:8px 0 15px}.sidebar-section>summary::-webkit-details-marker{display:none}.sidebar-section>summary::after{content:'›';font-size:22px}.sidebar-section[open]>summary::after{content:'⌄'}
.sidebar-section>button{width:100%;margin-top:10px}.sidebar-section label{display:grid;margin:0 0 14px;min-width:0}.sidebar-section .checkbox-label, .checkbox-label{display:flex;align-items:center;gap:10px;margin:16px 0}
input[type=checkbox]{appearance:auto;width:20px;height:20px;padding:0;margin:0;flex:0 0 20px;vertical-align:middle}#project{width:100%;min-width:0}#projectPath{display:block;width:100%;padding:8px 0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:400;overflow-wrap:normal}
#projectActions{display:flex;flex-wrap:wrap;gap:8px}#projectActions button{min-height:40px;padding:9px 12px;white-space:nowrap}#projectDefaults{margin:8px 0 12px}#tasks{display:grid;overflow:visible;width:100%;gap:8px}#tasks button{width:100%;max-width:none;white-space:normal;overflow-wrap:anywhere;line-height:1.6}#quotaStatus{font-size:12px;line-height:1.8;overflow-wrap:anywhere}#quotaWindows progress{display:block;width:100%;height:10px}#quotaWindows small{display:block;font-size:12px;white-space:nowrap;margin:8px 0 18px}#quotaWindows p{font-size:13px;margin:14px 0 8px}.account{display:grid;overflow-wrap:anywhere}.account button{width:100%}
.attachment-tools,#attachmentList{grid-column:1/-1;min-width:0}.attachment-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.attachment-tools small{color:#90a1b7}#attachmentList{display:grid;gap:8px;max-height:210px;overflow:auto}.attachment{display:flex;align-items:center;gap:10px;padding:8px;background:#142219;border-radius:8px;min-width:0}.attachment>div{flex:1;min-width:0}.attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attachment small{font-size:12px;color:#a7b5c7}.attachment img{width:44px;height:44px;object-fit:cover;border-radius:5px}.attachment button{flex:0 0 40px;padding:8px}#prompt{width:100%;min-width:0}button:disabled{opacity:.5;cursor:not-allowed}#notificationList button{margin:4px;white-space:nowrap}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:760px){header{padding:10px 12px;gap:8px}header .brand{font-size:20px}header .brand span{font-size:12px}header #health{max-width:none;margin-left:0}#sidebarToggle{font-size:12px;padding:9px}.layout{display:block;min-height:calc(100dvh - 100px)}aside{width:88vw;max-width:380px;padding:16px;border-right:1px solid #263d2e}.sidebar-closed main{width:100%}.panel{padding:16px 12px}nav{padding:10px;gap:4px}nav button{padding:9px;font-size:12px}.sidebar-section label{min-width:0}#promptForm{grid-template-columns:minmax(0,1fr)}#promptForm .attachment-tools button{justify-self:auto}.heading>div:first-child{flex-basis:65%}.message{padding:14px}#quotaWindows small{font-size:12px}}
@media(max-width:760px){header{position:sticky;top:0;z-index:6;background:#090f0c;min-height:104px}aside{position:fixed;top:104px;bottom:0;left:0;overflow-y:auto;z-index:5;box-shadow:12px 0 30px #0007}#sidebarToggle{flex-shrink:0}}
#notificationList article{position:relative;padding-right:78px}#notificationList .notification-delete{position:absolute;top:10px;right:8px;margin:0;padding:9px 12px}
.notification-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
#notificationList article.batch{padding-right:20px;cursor:pointer}
#notificationList article.batch .notification-check{display:flex;align-items:center;gap:10px;margin:0 0 12px;padding:2px 0;cursor:pointer;color:#bbf7d0}
#notificationList article.batch .notification-check input{flex:0 0 24px;width:24px;height:24px}
@media(max-width:760px){.notification-actions button{flex:1 1 auto}}

#versions button{margin:4px 6px 4px 0}#checkResult:empty,#diffText:empty{display:none}

/* Shared login and workspace theme: keep layout and interactions unchanged. */
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #4ade80;outline-offset:3px}
input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #4ade80;outline-offset:1px}
input[type=checkbox],progress{accent-color:#4ade80}

/* History alone scrolls; titles and row heights never grow with prompt length. */
#historyScroll{height:clamp(160px,32dvh,420px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-anchor:none}
#historyStatus{min-height:24px;margin:6px 0}
#tasks{display:grid;overflow:visible;gap:6px}
.history-row{display:flex;align-items:center;min-width:0;position:relative}
#tasks .history-title{flex:1;min-width:0;width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
.history-menu{flex:none;margin:0;color:#b1bfd1}
.history-menu>summary{cursor:pointer;list-style:none;padding:10px}
.history-menu>summary::-webkit-details-marker{display:none}
#tasks .history-delete{position:absolute;right:0;top:0;width:auto;z-index:2;background:#193526;white-space:nowrap}
#loadMoreHistory{width:100%;margin-top:8px}

/* Final report boxes: a copy button pinned at the box top-right, in flow so it never covers the text. */
.message.report{display:grid;gap:6px}
.message.report .report-head{display:flex;justify-content:flex-end;min-width:0}
.message.report .report-copy{padding:8px 14px;min-height:40px;min-width:64px;font-size:13px;background:#193526;color:#bbf7d0;border:1px solid #2c4936}
@media(max-width:760px){.message.report .report-copy{min-height:44px;min-width:76px;padding:10px 18px;font-size:14px}}

.delivery-files{display:grid;gap:8px;margin-top:12px}.delivery-files span{flex:1;min-width:0;overflow-wrap:anywhere}.delivery-files a{flex:none;padding:12px;min-height:44px}.delivery-files button{min-height:44px}
/* DeepSeek cost readout in the sidebar; shown only while the DeepSeek provider is selected. */
#deepseekCost{display:grid;gap:2px;margin:4px 0 10px}
#deepseekCost p{margin:0}
#deepseekBalance{color:#bbf7d0;font-size:13px}
#deepseekTaskCost{color:#90a1b7}

.message-attachments{display:grid;gap:8px;margin-top:10px;max-width:100%;white-space:normal}.message-attachments .attachment-name{white-space:normal;overflow-wrap:anywhere}

#quotaMonitor .quota-actions{display:flex;align-items:stretch;gap:8px;margin-top:8px}
#quotaMonitor .quota-actions>button{flex:1 1 0;min-width:0;white-space:nowrap;text-align:center;margin:0}
