:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#dbe7f6;background:#0a101b;color-scheme:dark}*{box-sizing:border-box}body{margin:0}.shell{display:flex;min-height:100vh}.sidebar{width:282px;flex-shrink:0;background:#101827;border-right:1px solid #253247;padding:25px 17px;display:flex;flex-direction:column;gap:10px}.brand{display:flex;align-items:center;gap:12px;padding:0 7px 25px;border-bottom:1px solid #2a3548}.brand-icon{font-size:30px;color:#7caafa}.brand strong{display:block;font-size:17px;letter-spacing:-.3px}.brand small{display:block;color:#8192a9;margin-top:2px}.section-title{font-size:11px;letter-spacing:1.15px;color:#8d9db1;text-transform:uppercase;margin:22px 6px 4px;font-weight:700}.gpus,.workers{display:grid;gap:9px}.gpu,.worker{border:1px solid #2a374c;background:#162134;border-radius:12px;padding:12px}.gpu-head,.worker-head{display:flex;align-items:center;justify-content:space-between;gap:5px}.gpu-head strong,.worker-head strong{font-size:12px}.gpu-head span,.worker-head span{font-size:10px;color:#b8c8e1}.gpu-name{font-size:11px;color:#8b9bb1;margin:7px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar{height:6px;background:#334057;border-radius:20px;overflow:hidden}.bar div{height:100%;border-radius:20px;background:linear-gradient(90deg,#4e8ade,#8b78f3)}.worker-sub{font-size:11px;color:#8d9db1;margin-top:7px}.sidebar-note{font-size:12px;line-height:1.6;color:#8192aa;margin-top:auto;padding:20px 5px 0}.empty-small{font-size:12px;color:#8090a8;padding:8px}.main{flex:1;min-width:0;display:flex;flex-direction:column;max-height:100vh;padding:32px max(30px,calc((100vw - 1080px)/2));padding-left:clamp(20px,5vw,80px);padding-right:clamp(20px,5vw,80px)}header{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:24px}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:800;color:#7a9fe3}h1{font-size:clamp(23px,2.6vw,34px);margin:7px 0 4px;letter-spacing:-1px}.subtitle{color:#8e9fb5;font-size:13px;margin:0}.connection{font-size:12px;white-space:nowrap;background:#172436;border:1px solid #2e4056;padding:9px 13px;border-radius:30px;display:flex;gap:8px;align-items:center}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#e6a552}.dot.online{background:#39bf87;box-shadow:0 0 9px #39bf8790}.timeline{flex:1;min-height:170px;overflow:auto;display:flex;flex-direction:column;gap:18px;padding:10px 4px 22px;scrollbar-color:#38465c transparent}.welcome{text-align:center;margin:auto;max-width:390px;color:#8fa1b9}.welcome-icon{font-size:37px;color:#91b5fa}.welcome h2{color:#d8e7fa;font-size:20px;margin:13px 0 6px}.welcome p{line-height:1.65;font-size:13px}.message{padding:15px 17px;border-radius:16px;max-width:85%;border:1px solid #2a374d}.user{background:#21416b;align-self:flex-end}.result{background:#172237;align-self:flex-start;width:min(590px,95%)}.message-head{display:flex;align-items:center;gap:10px;font-size:12px;margin-bottom:10px}.pill{border:1px solid #41526b;background:#26364a;border-radius:30px;padding:3px 8px;font-size:10px;color:#b7c9de;white-space:nowrap}.pill.done{color:#80e1b1;border-color:#245742;background:#143629}.pill.running{color:#e6c98e;border-color:#69522c;background:#403219}.pill.failed{color:#ff9d9d;border-color:#793e41;background:#471f29}.message-content{white-space:pre-wrap;word-wrap:break-word;font-size:14px;line-height:1.65}.detail{font-size:12px;color:#9bacbf;margin-top:9px}.result img{display:block;width:100%;max-width:480px;border-radius:10px;margin-top:13px}.cancel{background:transparent;border:1px solid #4a596e;color:#bbcadb;border-radius:7px;padding:5px 10px;margin-top:10px;cursor:pointer;font-size:11px}.composer{border:1px solid #364965;background:#141f30;border-radius:17px;padding:15px 17px;box-shadow:0 -12px 55px #08111d80}.composer-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.composer-header label{font-size:12px;color:#9aabc0}.composer select{background:#20314a;color:#e9f1fa;border:1px solid #3c5474;border-radius:8px;padding:7px 12px;font-size:12px;max-width:260px}.workload-info{font-size:11px;color:#8096af}textarea{background:transparent;color:#e6eff9;border:none;outline:none;resize:vertical;max-height:230px;min-height:60px;width:100%;font:14px/1.6 inherit;margin:15px 0 10px}textarea::placeholder{color:#76869a}.composer-footer{display:flex;align-items:center;justify-content:space-between;gap:14px}.composer-footer>span{font-size:11px;color:#75879d}button#send{background:#5790ec;color:#08111f;border:0;border-radius:9px;padding:10px 18px;font-weight:700;cursor:pointer}button#send:hover{background:#83aefa}button#send:disabled{opacity:.5;cursor:wait}@media(max-width:810px){.sidebar{width:215px}.main{padding:25px 22px}}@media(max-width:620px){.shell{display:block}.sidebar{width:auto;border-right:0;border-bottom:1px solid #253247;padding:12px 15px}.brand{padding-bottom:7px}.section-title{margin-top:12px}.gpus{grid-template-columns:repeat(3,minmax(0,1fr))}.gpu{padding:8px}.gpu-name{font-size:9px}.workers,.sidebar-note{display:none}.main{min-height:calc(100vh - 190px);max-height:none;padding:20px 14px}header{align-items:flex-end}header .subtitle{display:none}.timeline{min-height:45vh}.message{max-width:96%}.connection{font-size:10px;padding:6px}.composer-footer>span{font-size:9px}}
/* v0.2 UI: conversation list, media fields, MCP tool tester */
.sidebar{padding-top:19px;gap:4px;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;overflow-y:auto;overscroll-behavior-y:contain}
.brand{padding-bottom:19px}
.primary-side,.mcp-side{cursor:pointer;border:1px solid #3b6594;border-radius:10px;background:#23518b;color:#edf5ff;padding:10px 13px;text-align:left;font-size:12px;font-weight:650}
.primary-side:hover,.mcp-side:hover{background:#3668a7}
.mcp-side{margin-top:13px;background:#1b2b42;display:flex;justify-content:space-between;border-color:#334c69}
.conversation-list{display:grid;gap:3px;max-height:260px;overflow-y:auto;min-height:38px}
.conversation-row{display:flex;align-items:center;border-radius:8px;border:1px solid transparent}
.conversation-row.selected{background:#253b59;border-color:#334d6c}
.conversation-name{color:#cbd9eb;font-size:12px;text-align:left;padding:9px;background:transparent;border:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;flex:1;min-width:0}
.conversation-delete{background:transparent;border:0;color:#8da1ba;cursor:pointer;padding:7px;opacity:.5}
.conversation-delete:hover,.delete-message:hover{color:#ff9d9d;opacity:1}
.hardware-section{margin-top:8px}
.main{max-height:100vh}
.message-head{min-height:23px}
.delete-message{margin-left:auto;color:#8296ae;background:transparent;border:0;cursor:pointer;font-size:13px;opacity:.5}
.thinking{border:1px solid #48596d;background:#111b2b;border-radius:9px;padding:10px;margin-top:12px}
.thinking summary{cursor:pointer;color:#94b1d9;font-size:12px;font-weight:600}
.thinking pre{font-size:12px;color:#bbcadb;white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;line-height:1.55;max-height:280px;overflow:auto}
.extra-fields{display:flex;flex-wrap:wrap;gap:11px;margin-top:10px}
.field{display:flex;flex-direction:column;gap:5px;min-width:140px;max-width:100%;flex:1;font-size:12px;color:#9eb4cc}
.field input{border-radius:8px;background:#1c2c43;border:1px solid #435a78;color:#e3f0ff;padding:8px 9px;min-width:0;width:100%}
.field input[type=file]{font-size:11px}
textarea[hidden]{display:none}
.result-video,.result-image{width:100%;max-width:490px;max-height:400px;border-radius:10px;margin-top:13px;object-fit:contain;background:#101b2b}
.result-audio{width:100%;margin-top:12px}
.artifact-link{display:block}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #6a9fe9;outline-offset:2px}
#mcp-dialog{width:min(670px,calc(100vw - 25px));max-height:90vh;overflow:auto;border:1px solid #3f5d82;border-radius:14px;background:#101a29;color:#dce8fa;padding:25px}
#mcp-dialog::backdrop{background:#030713bd}
.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.dialog-head h2{margin:0;font-size:20px}
.dialog-head button{background:transparent;color:#cedbed;border:none;font-size:18px;cursor:pointer}
.dialog-note{color:#9aacc3;font-size:12px;line-height:1.6}
.mcp-form{display:flex;align-items:end;gap:10px;margin:15px 0}
.mcp-form label,.args-label{display:flex;flex:1;flex-direction:column;font-size:12px;gap:7px;color:#94a9c3}
.mcp-form select,.args-label textarea{background:#172840;border:1px solid #405875;border-radius:7px;color:#d9eaff;padding:8px;font-family:inherit}
.mcp-form button{padding:9px;cursor:pointer;border-radius:7px;background:#254979;border:1px solid #46628a;color:#e8f0fe}
.args-label textarea{resize:vertical;min-height:90px;font-family:ui-monospace,monospace;font-size:12px}
.mcp-result{white-space:pre-wrap;overflow-wrap:anywhere;background:#091424;border:1px solid #30415b;border-radius:9px;padding:13px;max-height:260px;overflow:auto;font-size:11px;color:#c5d9ef}
@media(max-width:620px){.hardware-section{display:none}.conversation-list{max-height:84px}.sidebar .brand{display:none}.sidebar{padding:8px 13px;height:auto;max-height:none;overflow-y:visible}.main{min-height:calc(100dvh - 175px)}.conversation-list{grid-template-columns:repeat(2,minmax(0,1fr))}.mcp-side{margin-top:5px}.composer{margin-top:8px}}

/* v0.3.2: ordered inline reasoning and token streaming */
.message .message-content+.message-content{margin-top:9px}
.message .thinking+.message-content,.message .message-content+.thinking{margin-top:12px}
.message .thinking pre{max-height:480px}

/* v0.5 : task tabs, context gauge, tool approvals and stable scroll */
.workload-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:13px}
.workload-tabs button{background:transparent;color:#9db0c7;border:1px solid #354860;border-radius:9px;padding:8px 14px;cursor:pointer;font-size:12px}
.workload-tabs button.selected{background:#315f99;color:#f7fbff;border-color:#5789cb;font-weight:700}
.context-meter{margin-top:10px;padding:8px 0 1px}
.context-meter[hidden]{display:none}
.context-text{font-size:11px;color:#a7bad1;margin-bottom:5px}
.context-track{height:6px;border-radius:6px;background:#2b3b4f;overflow:hidden}
.context-track>div{height:100%;background:#5d95e5;width:0%;transition:width .25s}
.tool-event{font-size:12px;border:1px solid #395c79;border-radius:8px;background:#142b43;color:#9fc8f4;padding:8px 11px;margin-top:9px;white-space:pre-wrap;overflow-wrap:anywhere}
.tool-approvals{margin-top:12px}
.tool-approval{border:1px solid #ae8241;border-radius:10px;background:#312a20;padding:12px;color:#ffdfac}
.tool-approval strong{font-size:12px;display:block;margin-bottom:7px}
.tool-approval pre{font-size:11px;background:#14191e;padding:8px;border-radius:5px;white-space:pre-wrap;word-break:break-word;max-height:170px;overflow:auto}
.tool-approval-actions{display:flex;gap:8px;flex-wrap:wrap}
.tool-approval-actions button{padding:7px 11px;color:#dbe6f4;background:#244269;border:1px solid #50739b;border-radius:7px;cursor:pointer}
.tool-doc{background:#101d2f;border:1px solid #3b526e;border-radius:8px;padding:11px;color:#b7cee5;white-space:pre-wrap;word-break:break-word;max-height:170px;overflow:auto;font-size:11px;line-height:1.5}
.pill.cancelled{color:#c2bdc9;background:#332c3a;border-color:#52445d}


/* v0.5.1 — compact workspace: navigation above the timeline, title in sidebar */
html, body {height:100%;}
.shell {height:100dvh; min-height:0;}
.main {height:100dvh; max-height:100dvh; min-height:0; padding:12px clamp(18px, 3.2vw, 48px) 14px;}
.workspace-topbar {flex:none; display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:44px; margin-bottom:8px; padding:0 2px 8px; border-bottom:1px solid #27364c;}
.workspace-topbar .workload-tabs {margin:0; min-width:0; flex:1; flex-wrap:wrap; gap:5px;}
.workspace-topbar .workload-tabs button {padding:7px 13px; border-radius:10px;}
.workspace-topbar .connection {font-size:11px; padding:7px 10px; flex:none;}
.timeline {min-height:0; flex:1 1 auto; padding:9px 5px 16px; gap:15px; scroll-padding-bottom:18px;}
.result {width:min(760px,96%);}
.message {max-width:92%;}
.composer {flex:none; padding:10px 14px 9px; border-radius:14px; box-shadow:0 -6px 26px #08111d5c;}
.composer textarea {min-height:40px; margin:6px 0 4px; max-height:160px; line-height:1.5;}
.composer-header {gap:8px;}
.composer-footer {gap:9px;}
.context-meter {margin-top:5px; padding:4px 0;}
.extra-fields {gap:8px; margin-top:6px;}
.active-conversation-title {display:flex;flex-direction:column;gap:5px;padding:8px 10px 11px;margin:0 0 3px;border:1px solid #314765;border-radius:10px;background:#1b2d43;}
.active-conversation-title span {color:#7ea7d9;font-size:9px;letter-spacing:1.1px;font-weight:800;}
.active-conversation-title strong {font-size:12px;color:#e5effb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.conversation-rename, .conversation-action {background:transparent;border:0;color:#a9bfda;padding:6px;cursor:pointer;font-size:13px;flex:none;}
.conversation-rename {opacity:.65;}
.conversation-rename:hover,.conversation-action:hover {opacity:1;color:#fff;}
.conversation-rename-input {flex:1;min-width:0;background:#13233a;color:#eff6ff;border:1px solid #5985bb;border-radius:6px;padding:6px;font-size:12px;font-family:inherit;}
.conversation-row:focus-within {border-color:#5478a9;}
@media(max-width:810px){.main{padding:10px 14px 12px}.workspace-topbar .workload-tabs button{padding:7px 9px}.workspace-topbar .connection{padding:6px 9px}}
@media(max-width:620px){
 .shell {display:flex;flex-direction:column;min-height:100dvh;}
 .sidebar {width:100%;max-height:186px;flex:none;padding:6px 12px;overflow-y:auto;}
 .active-conversation-title {padding:5px 9px;margin-bottom:1px;}
 .conversation-list {max-height:55px;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));}
 .main {height:auto;min-height:0;max-height:none;flex:1;padding:8px 10px 10px;}
 .workspace-topbar {margin-bottom:6px;align-items:center;gap:5px;}
 .workspace-topbar .connection {font-size:0;padding:7px;gap:0;}
 .workspace-topbar .dot {width:10px;height:10px;}
 .workspace-topbar .workload-tabs button {font-size:11px;padding:6px 8px;}
 .timeline {min-height:100px;flex:1;gap:10px;}
 .composer {padding:9px 10px 8px;}
 .composer-footer>span {font-size:9px;}
 .message {max-width:97%;padding:12px;}
}

/* v0.5.2 — conversation-first sidebar; collapsible diagnostics */
.sidebar{height:100dvh;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-color:#435472 transparent;scrollbar-width:thin;gap:9px;padding:17px 14px 13px;}
.sidebar .brand{flex:none;padding:0 7px 16px;margin-bottom:2px;}
.sidebar .primary-side,.active-conversation-title{flex:none;}
.sidebar-conversations{display:flex;flex:1 1 auto;flex-direction:column;gap:4px;min-height:0;overflow:hidden;}
.sidebar-conversations .section-title{flex:none;margin:12px 6px 6px;}
.conversation-list{display:flex;flex-direction:column;flex:1 1 auto;gap:3px;max-height:none;min-height:50px;overflow-y:auto;overscroll-behavior:contain;padding:0 3px 8px 0;scrollbar-color:#435472 transparent;scrollbar-width:thin;}
.conversation-row{flex:none;min-height:38px;}
.conversation-name{font-size:12px;}
.sidebar-bottom{display:flex;flex-direction:column;flex:none;gap:7px;min-height:0;}
.sidebar-bottom .mcp-side{margin-top:0;flex:none;}
.hardware-section{margin-top:0;display:flex;flex-direction:column;gap:6px;}
.sidebar-details{border:1px solid #2c3d52;border-radius:10px;background:#131f30;min-width:0;overflow:hidden;}
.sidebar-details summary{cursor:pointer;list-style:none;display:flex;align-items:center;padding:10px 11px;color:#b9cce4;font-size:12px;font-weight:600;gap:8px;user-select:none;}
.sidebar-details summary::-webkit-details-marker{display:none;}
.sidebar-details summary::before{content:'▸';color:#8ca5c5;font-size:13px;transition:transform .15s;}
.sidebar-details[open] summary::before{transform:rotate(90deg);}
.sidebar-details[open] summary{border-bottom:1px solid #2c3d52;}
.sidebar-details .gpus,.sidebar-details .workers{padding:8px;max-height:min(25vh,215px);overflow-y:auto;overscroll-behavior:contain;display:grid;grid-template-columns:minmax(0,1fr);}
.sidebar-details .gpu,.sidebar-details .worker{padding:9px 10px;}
.side-count{margin-left:auto;color:#8199b5;font-size:10px;font-weight:400;white-space:nowrap;}
.sidebar-note{padding:3px 4px 1px;margin:0;font-size:10px;line-height:1.4;color:#6d819b;}
.mobile-menu,.close-sidebar{display:none;}
.sidebar-backdrop[hidden]{display:none!important;}

/* v0.5.2 — safe Markdown output and media on every screen */
.message-content.md-rendered{white-space:normal;overflow-wrap:anywhere;line-height:1.62;min-width:0;}
.md-rendered>*:first-child{margin-top:0;}
.md-rendered>*:last-child{margin-bottom:0;}
.md-rendered p{margin:.62em 0;}
.md-rendered h1,.md-rendered h2,.md-rendered h3,.md-rendered h4,.md-rendered h5,.md-rendered h6{color:#edf5ff;font-weight:700;letter-spacing:-.02em;line-height:1.3;margin:1.15em 0 .45em;}
.md-rendered h1{font-size:1.56em;}.md-rendered h2{font-size:1.35em;}.md-rendered h3{font-size:1.15em;}.md-rendered h4,.md-rendered h5,.md-rendered h6{font-size:1.04em;}
.md-rendered ul,.md-rendered ol{padding-left:1.6em;margin:.5em 0;}
.md-rendered li{margin:.22em 0;}.md-rendered li>p{margin:.22em 0;}
.md-rendered blockquote{border-left:3px solid #6e9cd4;margin:1em 0;padding:.15em 1em;color:#acc3dc;background:#111e30;border-radius:0 7px 7px 0;}
.md-rendered a{color:#95c5ff;text-decoration:underline;text-underline-offset:2px;}
.md-rendered a:hover{color:#d5e7ff;}
.md-rendered hr{border:0;border-top:1px solid #354962;margin:1em 0;}
.md-rendered :not(pre)>code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;background:#0c1a2a;border:1px solid #304864;border-radius:4px;padding:.09em .32em;color:#c8e5ff;font-size:.9em;word-break:break-word;}
.md-rendered pre{position:relative;display:block;max-width:100%;max-height:500px;overflow:auto;overscroll-behavior:contain;margin:.85em 0;border-radius:9px;border:1px solid #32445e;background:#0a1220!important;padding:35px 12px 13px;scrollbar-color:#4c627e transparent;}
.md-rendered pre code,.md-rendered pre code[class*="language-"]{display:block;white-space:pre;overflow-wrap:normal;word-break:normal;background:transparent!important;padding:0;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.55;color:#d8e6f6;tab-size:4;text-shadow:none;}
.md-rendered .copy-code{position:sticky;top:-35px;float:right;right:0;z-index:2;margin:-28px 0 5px auto;border:1px solid #45607f;background:#233954;color:#dce9ff;padding:4px 9px;font-size:11px;border-radius:6px;cursor:pointer;}
.md-rendered .copy-code:hover{background:#355478;}
.md-rendered .md-table-wrap{overflow-x:auto;max-width:100%;margin:.85em 0;border:1px solid #354963;border-radius:8px;overscroll-behavior-x:contain;}
.md-rendered table{width:100%;border-collapse:collapse;font-size:12px;min-width:max-content;}
.md-rendered th,.md-rendered td{padding:9px 12px;text-align:left;border-bottom:1px solid #33475f;white-space:normal;max-width:360px;}
.md-rendered th{font-weight:700;color:#e2efff;background:#21334b;}
.md-rendered tr:last-child td{border-bottom:0;}
.md-rendered tr:nth-child(2n) td{background:#1a2940;}
.md-rendered img{height:auto;max-width:100%;max-height:450px;object-fit:contain;border-radius:8px;}
.md-rendered .token{background:none;}

/* v0.5.2 — mobile drawer, compact composer and touch-friendly navigation */
@media(max-width:760px){
  .shell{display:flex;flex-direction:row;height:100dvh;min-height:0;}
  .sidebar{position:fixed;inset:0 auto 0 0;z-index:60;width:min(86vw,340px);height:100dvh;max-height:100dvh;padding:17px 14px 14px;transform:translateX(-105%);visibility:hidden;transition:transform .2s ease,visibility .2s ease;border-right:1px solid #374962;border-bottom:0;box-shadow:15px 0 35px #0008;overflow-x:hidden;overflow-y:auto;}
  .shell.sidebar-open .sidebar{transform:translateX(0);visibility:visible;}
  .sidebar .brand{display:flex;}
  .sidebar .conversation-list{max-height:none;min-height:45px;display:flex;flex-direction:column;grid-template-columns:none;}
  .sidebar .hardware-section,.sidebar .workers,.sidebar .sidebar-note{display:flex;}
  .sidebar .brand{padding-bottom:13px;}
  .sidebar .mcp-side{margin-top:0;}
  .sidebar-backdrop:not([hidden]){position:fixed;inset:0;background:#050910b8;z-index:59;display:block;}
  .mobile-menu,.close-sidebar{display:inline-flex;align-items:center;justify-content:center;border:1px solid #364962;border-radius:9px;background:#17273e;color:#e1efff;width:38px;height:36px;min-width:38px;cursor:pointer;font-size:19px;}
  .close-sidebar{margin-left:auto;width:32px;height:32px;min-width:32px;font-size:14px;}
  .main{height:100dvh;max-height:100dvh;min-height:0;flex:1;min-width:0;padding:8px 10px max(8px,env(safe-area-inset-bottom));}
  .workspace-topbar{gap:7px;min-height:40px;flex:none;padding-bottom:6px;margin-bottom:3px;}
  .workspace-topbar .workload-tabs{display:flex;flex:1 1 auto;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;min-width:0;scrollbar-width:none;gap:5px;}
  .workspace-topbar .workload-tabs::-webkit-scrollbar{display:none;}
  .workspace-topbar .workload-tabs button{white-space:nowrap;flex:none;padding:7px 10px;}
  .workspace-topbar .connection{padding:8px;flex:none;font-size:0;gap:0;}
  .workspace-topbar .connection .dot{width:10px;height:10px;}
  .timeline{min-height:0;flex:1 1 auto;gap:12px;padding:7px 3px 12px;overscroll-behavior-y:contain;}
  .message{max-width:98%;padding:12px;}
  .result{width:min(100%,760px);}
  .composer{flex:none;margin:0;border-radius:13px;padding:9px 10px 8px;}
  .composer-header{gap:6px;}
  .composer select{max-width:min(55vw,260px);}
  .composer textarea{font-size:16px;min-height:42px;max-height:26vh;resize:vertical;}
  .composer-footer>span{display:none;}
  .composer-footer{justify-content:flex-end;}
  .extra-fields{max-height:30vh;overflow-y:auto;overscroll-behavior:contain;}
  .tool-approval-actions button,button#send,.primary-side{min-height:40px;}
  #mcp-dialog{padding:16px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px);}
  #mcp-dialog .mcp-form{flex-wrap:wrap;}
  #mcp-dialog .mcp-form label{min-width:160px;}
}
@media(max-width:410px){
 .main{padding-left:6px;padding-right:6px;}
 .message{padding:10px;}
 .workspace-topbar .workload-tabs button{padding:7px 9px;font-size:11px;}
 .composer{padding:8px;}
 .active-conversation-title{margin-bottom:3px;}
}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none;}}
/* Keep the copy control inside the code block at every scroll width. */
.md-rendered pre{padding:10px 12px 13px;}
.md-rendered pre .copy-code{position:sticky;top:0;right:0;float:right;margin:0 0 7px 10px;}
.md-rendered pre code{clear:both;}

/* v0.5.3 — browser-local profiles and recovery UI */
.brand-label{min-width:0;flex:1;}
.account-trigger{width:40px;height:40px;display:grid;place-items:center;flex:none;background:#1c2b40;border:1px solid #3c536e;border-radius:9px;color:#a8c9ed;cursor:pointer;padding:8px;}
.account-trigger svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.account-trigger:hover,.account-trigger:focus-visible{background:#284463;color:#f5faff;}
.settings-trigger{flex:none;background:#1c2b40;border:1px solid #3c536e;border-radius:9px;color:#a8c9ed;padding:6px 9px;font-size:18px;cursor:pointer;line-height:1.2;}
.settings-trigger:hover,.settings-trigger:focus-visible{background:#284463;color:#f5faff;}
.settings-dialog{max-width:min(92vw,490px);width:490px;color:#e6f1ff;background:#101b2b;border:1px solid #435b7a;border-radius:14px;padding:22px;}
.settings-dialog::backdrop{background:#020a18c7;}
.settings-actions{display:flex;flex-wrap:wrap;gap:8px;margin:9px 0;}
.settings-actions button{font:inherit;font-size:12px;cursor:pointer;border:1px solid #52749f;border-radius:8px;padding:10px 12px;background:#213c5e;color:#d5e9ff;}
.auth-dialog{width:min(440px,calc(100vw - 28px));max-width:440px;color:#e6f1ff;background:#101b2b;border:1px solid #435b7a;border-radius:15px;padding:24px;box-shadow:0 20px 80px #0009;}
.auth-dialog[open]:not(:modal){position:fixed;top:50%;left:50%;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%);z-index:1001;}
body.auth-dialog-open::before{content:"";position:fixed;inset:0;z-index:1000;pointer-events:none;background:#080d1760;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);}
.auth-dialog::backdrop{background:transparent;}
.auth-form{display:grid;gap:12px;margin:18px 0 7px;}
.auth-form[hidden],.auth-account-state[hidden]{display:none!important;}
.auth-form label{display:grid;gap:6px;color:#aec4df;font-size:12px;}
.auth-form input{width:100%;min-width:0;border:1px solid #466587;border-radius:8px;background:#15253b;color:#e5f1ff;padding:10px;font:inherit;}
.auth-form .primary-side{width:100%;text-align:center;}
.auth-mode-toggle{border:0;background:transparent;color:#9fc5f0;padding:8px 0;cursor:pointer;font:inherit;font-size:12px;}
.auth-required-note{color:#e6c791;background:#30281c;border:1px solid #705939;border-radius:8px;padding:12px;font-size:12px;line-height:1.5;}
.auth-warning{margin-top:15px;padding:12px;border:1px solid #705939;border-radius:9px;background:#30281c;color:#e6c791;font-size:12px;line-height:1.5;}
.auth-warning p{margin:0 0 10px;}
.auth-never-show{display:flex;align-items:center;gap:7px;margin:0 0 10px;cursor:pointer;}
.auth-never-show[hidden]{display:none!important;}
.auth-never-show input{width:auto;}
.auth-anonymous{border:1px solid #8b724d;border-radius:8px;background:#46351f;color:#fff1d4;padding:8px 11px;cursor:pointer;font:inherit;font-size:12px;}
.auth-account-state{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0;padding:12px;border:1px solid #435b7a;border-radius:9px;}
.auth-account-state p{margin:0;}
.auth-account-state button{font:inherit;font-size:12px;cursor:pointer;border:1px solid #52749f;border-radius:8px;padding:8px 11px;background:#213c5e;color:#d5e9ff;}
.auth-feedback{min-height:18px;margin:8px 0 0;color:#ffb3b3;font-size:12px;}
@media(max-width:760px){.settings-dialog{padding:16px;width:calc(100vw - 28px);}}

/* v0.5.4 — multiline CLI/Comfy text fields, chat/media workspace, job diagnostics */
.field.field-multiline{flex:1 1 100%;max-width:100%;}
.field .workload-text{background:#1c2c43;border:1px solid #435a78;color:#e3f0ff;border-radius:8px;
  width:100%;padding:10px;min-width:0;font:13px/1.55 ui-monospace,Consolas,monospace;}
.field textarea.workload-text{display:block;min-height:100px;max-height:45vh;margin:0;resize:vertical;white-space:pre-wrap;}
.job-diagnostics{margin-top:12px;background:#101a2a;border:1px solid #344966;border-radius:9px;max-width:100%;min-width:0;overflow:hidden;}
.job-diagnostics>summary{padding:10px 12px;cursor:pointer;color:#aacbed;font-size:12px;font-weight:600;}
.job-diagnostics[open]>summary{border-bottom:1px solid #2f445e;}
.diagnostics-body{padding:9px;display:flex;flex-direction:column;gap:8px;min-width:0;}
.diagnostics-status,.diagnostics-empty,.diagnostics-error{color:#a1b4c9;font-size:11px;overflow-wrap:anywhere;}
.diagnostics-error{color:#f1a5a5;}
.diagnostics-log,.tool-result{background:#0b1626;border:1px solid #2d425c;border-radius:7px;min-width:0;}
.diagnostics-log summary,.tool-result summary{cursor:pointer;padding:9px 10px;font-size:11px;color:#b6d3f1;overflow-wrap:anywhere;}
.diagnostics-log pre,.tool-result pre{padding:10px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:330px;overflow:auto;
  font:11px/1.5 ui-monospace,Consolas,monospace;margin:0;color:#bfcee4;border-top:1px solid #273951;}
.tool-result pre+pre{border-top:1px solid #344961;}
.copy-trace{font-size:11px;padding:7px 9px;margin:5px 9px 10px;background:#25426a;color:#dbeeff;border:1px solid #456487;border-radius:6px;cursor:pointer;}
.notification-setting{margin-top:15px;padding:12px;border:1px solid #314865;border-radius:10px;display:flex;align-items:center;flex-wrap:wrap;gap:12px;}
.notification-setting>div{flex:1;min-width:160px;}
.notification-setting strong{display:block;font-size:12px;color:#d8e8fb;}
.notification-setting small{display:block;color:#91abc4;margin-top:5px;font-size:11px;line-height:1.45;}
.notification-setting button{border:1px solid #4a6990;background:#203f64;border-radius:7px;color:#cde6ff;padding:10px;font-size:11px;cursor:pointer;}
.notification-setting button:disabled{opacity:.5;cursor:not-allowed;}
.job-toasts{position:fixed;bottom:20px;right:20px;z-index:90;display:flex;flex-direction:column;gap:8px;pointer-events:none;max-width:min(360px,calc(100vw - 30px));}
.job-toast{padding:11px 14px;border:1px solid #527caa;background:#182f49;box-shadow:0 8px 30px #0008;
  border-radius:10px;color:#ecf6ff;font-size:12px;line-height:1.4;}
@media(max-width:760px){.field textarea.workload-text{min-height:140px;max-height:35vh;}.job-toasts{right:10px;bottom:12px;}}


/* v0.5.5 — compact, optional media editor and exact textarea row counts. */
.field textarea.workload-text,.composer .field textarea.workload-text{
  min-height:0; height:auto; max-height:38vh; line-height:1.5; resize:vertical;
  box-sizing:border-box; overflow-y:auto;
}
.composer .extra-fields{max-height:min(43vh,430px);overflow-y:auto;overscroll-behavior:contain;min-height:0;}
.composer-header{flex-wrap:wrap;}
.composer-tool{flex:none;border:1px solid #415c7c;background:#1c314e;color:#d5e8fd;
  border-radius:7px;padding:6px 9px;font-size:11px;cursor:pointer;white-space:nowrap;}
.composer-tool:hover{background:#2a486b;}
.workload-docs{padding:10px 12px;margin-top:7px;background:#121f32;border:1px solid #3b5474;
  border-radius:9px;color:#d4e6fa;max-height:25vh;overflow:auto;font-size:12px;min-width:0;}
.workload-docs[hidden],.composer-tool[hidden]{display:none!important;}
.composer.collapsed #extra-fields,.composer.collapsed #prompt,.composer.collapsed .composer-footer,
.composer.collapsed #context-meter,.composer.collapsed #workload-docs{display:none!important;}
.composer.collapsed{padding-bottom:10px;}
.composer.collapsed .composer-header{margin:0;}
.tool-call{padding:0;overflow:hidden;white-space:normal;}
.tool-call>summary{cursor:pointer;list-style:none;padding:9px 12px;color:#b8d9ff;font-size:12px;
  overflow-wrap:anywhere;white-space:pre-wrap;}
.tool-call>summary::-webkit-details-marker{display:none;}
.tool-call>summary::before{content:'▸';margin-right:8px;}
.tool-call[open]>summary::before{content:'▾';}
.tool-inline-body{border-top:1px solid #385874;background:#0c1a2c;padding:8px;min-width:0;display:flex;flex-direction:column;gap:5px;}
.tool-inline-caption{color:#a9ccef;font-size:11px;font-weight:600;margin-top:4px;}
.tool-inline-body pre{max-height:250px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;
  color:#bfd2e9;background:#071321;padding:9px;border-radius:6px;border:1px solid #2b4059;font-size:11px;line-height:1.5;margin:0;}
@media(max-width:760px){
 .composer .field textarea.workload-text{min-height:0;max-height:28vh;}
 .composer .extra-fields{max-height:34vh;}
 .composer-tool{padding:7px 8px;}
}

/* v0.5.6 — stable Android paint surface and viewport.
   100dvh resizes when the browser toolbar appears/disappears, causing
   full-height flex layouts to relayout/repaint on some Android tablets.
   100svh is deliberately stable; native desktop keeps its dynamic sizing.
   The @supports guard leaves older browsers on the existing 100dvh rules. */
html,body{background:#0a101b;}
@supports (height:100svh){
  @media (max-width:760px), (hover:none) and (pointer:coarse){
    .shell,.main,.sidebar{height:100svh;max-height:100svh;}
    html{-webkit-text-size-adjust:100%;}
  }
}

/* v0.5.7: browser-local drafts, personal file picker, bounded RAM graph. */
.file-picker{display:grid;gap:7px;min-width:0}
.file-picker select,.file-picker input[type=file]{width:100%;max-width:100%;min-width:0;border:1px solid #405976;border-radius:7px;background:#102137;color:#dbe9fb;padding:8px;font:inherit;font-size:12px}
.file-picker input[type=file]{padding:7px}
.file-source-content{min-width:0}
.file-current{font-size:11px;color:#83add4;overflow-wrap:anywhere}
.file-clear{width:max-content;max-width:100%;font-size:11px;cursor:pointer;color:#adc9e7;border:1px solid #385573;border-radius:6px;background:#192e46;padding:6px 9px}
.ram-visual{padding:11px 10px 7px;border-bottom:1px solid #2f4059;min-width:0}
.ram-heading{color:#d8e8fb;font-size:11px;line-height:1.5;margin-bottom:8px}
.ram-stacked{width:100%;height:14px;display:flex;overflow:hidden;border-radius:6px;background:#26374b;border:1px solid #36516d}
.ram-segment{height:100%;min-width:0;flex:0 0 auto}
.ram-other{background:#64748b}.ram-free{background:#25394f}
.ram-legend{display:flex;flex-wrap:wrap;gap:6px 10px;margin-top:9px}
.ram-legend-item{display:inline-flex;align-items:center;gap:5px;color:#bbcede;font-size:10px;max-width:100%;overflow-wrap:anywhere}
.ram-dot{flex:0 0 9px;width:9px;height:9px;border-radius:3px}
.ram-note{font-size:10px;color:#879caf;line-height:1.4;margin-top:8px}

.library-dialog{width:min(92vw,620px);max-width:620px;max-height:85vh;overflow-y:auto}
.library-management-list{display:grid;gap:8px;max-height:50vh;overflow-y:auto;overscroll-behavior:contain;margin:12px 0}
.library-management-row{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#16263a;border:1px solid #354962;border-radius:9px;padding:10px}
.library-management-name{display:grid;gap:4px;min-width:0;overflow-wrap:anywhere}
.library-management-name strong{font-size:12px;color:#e0edff}
.library-management-name small{font-size:10px;color:#8ea8c4}
.library-management-actions{display:flex;gap:6px;flex-wrap:wrap}
.library-action{display:inline-flex;align-items:center;background:#233b57;border:1px solid #466688;border-radius:7px;color:#d8eafc;padding:7px 9px;font-size:11px;cursor:pointer;text-decoration:none}
.library-action:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:620px){.library-management-row{align-items:flex-start;flex-direction:column}}

/* V0.5.8: RAM belongs to the same set of resource cards as the GPUs. */
.resource-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:9px;padding:8px}
.resource-grid>.gpus{display:contents}
.resource-grid>.ram-visual{padding:12px;border:1px solid #2a374c;border-radius:12px;background:#162134;min-width:0}
.replay-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}
.replay-button,.skip-reasoning{border:1px solid #36516d;background:#192e46;color:#c9def7;border-radius:7px;padding:7px 9px;font-size:11px;cursor:pointer}
.replay-button:hover,.skip-reasoning:hover{background:#254569}
.skip-reasoning{margin-top:8px;border-color:#8d78c7;color:#eadbff;background:#292343}
.skip-reasoning:disabled{opacity:.6;cursor:wait}

/* v0.5.9: temporary media retention and direct download affordance. */
.artifact-media{max-width:100%;min-width:0}
.artifact-download{display:inline-block;margin-top:5px;font-size:.82rem;opacity:.8;text-decoration:underline}
.artifact-expired{margin:9px 0;padding:9px 12px;border:1px dashed #6b7280;border-radius:8px;font-size:.83rem;opacity:.8}

/* v0.6 multimodal chat attachment controls */
.chat-attach-control,.chat-attachments,.chat-message-attachments{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;margin:.35rem 0}
.chat-attachment-chip,.chat-media-link{border:1px solid var(--border,#8885);border-radius:8px;padding:.3rem .55rem;font-size:.85em;overflow-wrap:anywhere}
.chat-attachment-chip button{margin-left:.5rem;cursor:pointer}
.chat-attach-control[hidden],.chat-attachments[hidden]{display:none}
#chat-attach-help{font-size:.76em;opacity:.7}

.chat-image-preview{max-height:180px;max-width:220px;object-fit:contain;border-radius:6px;vertical-align:middle}
.chat-audio-preview{max-width:240px;height:40px}
.voice-status{font-size:11px;color:#9aabc0;min-height:0;margin-top:5px;line-height:1.4}
.voice-status[hidden]{display:none}

/* v0.6.1: shared picker for chat + workloads, visible library and seeds */
.chat-attach-control{align-items:flex-start}
.chat-file-kind{display:flex;flex-direction:column;gap:4px;color:#a6bad2;font-size:11px}
.chat-file-kind select,.seed-control input{background:#102137;border:1px solid #405976;color:#dbe9fb;border-radius:7px;padding:8px;font:inherit}
.chat-attach-picker{flex:1;min-width:min(100%,240px);max-width:520px}
.chat-file-field{min-width:0;width:100%;max-width:100%}
.chat-attach-picker .file-picker{width:100%}
.chat-file-field .file-clear{display:none}
.seed-control{display:flex;align-items:center;gap:8px;margin:6px 0;color:#9eb4cc;font-size:11px;flex-wrap:wrap}
.seed-control[hidden]{display:none}
.seed-control input{width:155px;max-width:100%}
.seed-control span{opacity:.7}
.chat-video-preview{max-height:220px;max-width:min(100%,380px);border-radius:8px}
.library-management-row .library-thumbnail{width:70px;max-height:70px;object-fit:contain;order:-1;border-radius:6px;background:#0b1524}
.library-management-row .library-thumbnail:is(audio,video){max-width:160px;width:160px}
