/* Personal workspace surfaces share the embedded conversation's type, colours and controls. */
:root { color-scheme:dark; --line:var(--stroke); --ink:var(--txt); --muted:var(--txt2); }
[hidden] { display:none !important; }
#app { height:100dvh; }
button, input, select, textarea { font-family:inherit; }
button { cursor:pointer; }
h1,h2,h3,p { margin-top:0; }
h2 { font-size:19px; }
a { color:var(--blue); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline:2px solid var(--blue); outline-offset:2px;
}
.auth, .sheet, dialog { font-size:14px; line-height:1.45; }
.auth { width:min(26rem,94vw); align-self:center; margin:auto; }
.auth, dialog, .tile { background:#1c1c27; border:1px solid var(--stroke); border-radius:16px; padding:20px; }
:is(.auth,.sheet,dialog) :is(input:not([type=checkbox]),select,textarea) {
  min-width:0; max-width:100%; color:var(--txt); border:1px solid var(--stroke); background:#14141d;
  border-radius:9px; padding:9px 11px; font:inherit;
}
:is(.auth,.sheet,dialog) textarea { width:100%; min-height:4.2rem; resize:vertical; }
:is(.auth,.sheet,dialog) button,.att-chip,.reply-quote,.speak {
  color:var(--txt); background:rgba(255,255,255,.065); border:1px solid var(--stroke);
  padding:7px 12px; border-radius:9px; font-size:13px;
}
:is(.auth,.sheet,dialog) button:hover,.speak:hover { background:rgba(255,255,255,.12); }
:is(.auth,.sheet,dialog) :is(.primary,.active) { background:#0769c9; color:white; }
.stack,.tile { display:flex; flex-direction:column; gap:10px; }
.row,.formbar,.identity { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.grid,.menu-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); gap:10px; }
.menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.identity { justify-content:space-between; border-top:1px solid var(--stroke); margin-top:14px; padding-top:12px; }
.sheet { margin:0 auto; padding:12px; width:min(100%,80rem); }
.sheet > * { margin-bottom:12px; }
label { display:flex; flex-direction:column; gap:5px; }
.inline { flex-direction:row; align-items:center; }
.muted,small,.sc-txt small,#wmInfo { color:var(--txt2); }
#panel { min-width:0; }
#chatFilesTitle { margin:0; font-weight:400; }
#chips .chip { font:inherit; font-size:13px; }
.chip .pav,.sc-ava { background:linear-gradient(135deg,#8ed029,#2ba546); color:white; }
#panelBody .sc-item { border:0; text-align:left; background:transparent; color:var(--txt); width:100%; }
#panelBody .sc-item.on { background:rgba(255,255,255,.07); }
#chat { align-items:stretch; }
.msg .stamp { display:flex; align-items:center; gap:6px; font:11px/1.4 inherit; font-size:11px; color:var(--txt3); margin:3px 6px 0; }
.msg-more { opacity:0; padding:0 5px; color:var(--txt2); background:transparent; border:0; min-height:16px; }
.msg:hover .msg-more,.msg:focus-within .msg-more { opacity:1; }
.speak { display:block; width:fit-content; border-radius:20px; font-weight:600; font-size:12px; margin-top:15px; }
.speak::before { content:'▶'; font-size:9px; margin-right:7px; }
.reply-quote { display:block; border-left:3px solid var(--blue); text-align:left; margin-bottom:6px; }
#turn-progress:empty { display:none; }
#turn-progress { white-space:pre-wrap; padding:6px 0; }
#status:not(:empty) { position:fixed; z-index:100; bottom:16px; left:50%; transform:translateX(-50%); background:#323241; color:var(--txt); padding:9px 14px; border-radius:9px; }
dialog { color:var(--txt); width:min(46rem,95vw); max-height:92dvh; box-shadow:0 24px 80px #0008; }
dialog::backdrop { background:#05050999; backdrop-filter:blur(4px); }
#dismiss { margin-top:12px; }
dialog pre,.sheet pre { white-space:pre-wrap; overflow:auto; background:#101017; padding:10px; max-height:40vh; }
.preview { width:100%; height:55vh; border:0; object-fit:contain; } .model { height:65vh; }
.memory-map { display:block; width:100%; height:auto; background:#141420; border:1px solid var(--stroke); touch-action:none; cursor:grab; }
.source-list { display:flex; flex-wrap:wrap; gap:6px; max-height:12rem; overflow:auto; }
.visually-hidden { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
dialog:has(.work-map) { width:96vw; max-width:100rem; }
.work-map { display:flex; flex-direction:column; gap:.5rem; height:75dvh; }
.work-map h2 { margin:0; }
.work-map .wm-stage { flex:1; background:#13131b; min-height:0; }
.work-map canvas { width:100%; height:100%; }
.terminal-output { min-height:16rem; font-family:ui-monospace,monospace; }
.terminal fieldset { border:0; padding:0; } .terminal .row { margin:6px 0; }
#chat.content { display:block; }
@media(max-width:700px) {
  .sheet { padding:4px; }
  dialog { padding:12px; }
  .msg-more { opacity:.7; }
  #composer:has(#brainBtn:not(.hidden)) .box { flex-basis:100%; order:-1; }
  #composer:has(#brainBtn:not(.hidden)) { flex-wrap:wrap; }
  #composer:has(#brainBtn:not(.hidden)) #micWrap { margin-left:auto; }
}


.workspace-overlay .sheet { width:auto; margin:0; }
#sheet .sbody .fgroup>.field,#sheet .sbody .fgroup>input,#sheet .sbody .fgroup>textarea { width:100%; }
.task-overlay { position:fixed; inset:0; z-index:55; display:grid; place-items:center; padding:12px; background:#08081066; }
.task-sheet { display:flex; flex-direction:column; width:min(1280px,98vw); height:min(86dvh,950px); overflow:hidden; border:1px solid var(--stroke); border-radius:18px; background:var(--glass-strong); backdrop-filter:blur(28px); }
.task-sheet .shead { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; font-size:17px; font-weight:650; }
.task-sheet .sbody,.workspace-overlay .cf-scroll { overflow:auto; min-height:0; flex:1; }
.msg-more .ico { width:13px; height:13px; }

#pop.chat-picker { position:fixed; z-index:65; width:min(340px,calc(100vw - 16px)); max-height:65dvh; overflow:auto;
  padding:10px; border:1px solid var(--stroke); border-radius:16px; color:var(--txt); background:var(--glass-strong);
  backdrop-filter:blur(24px); box-shadow:0 14px 55px #0007; }
.chat-picker strong,.chat-picker small { display:block; margin:4px 6px 8px; }
.choice-list { display:flex; flex-wrap:wrap; gap:4px; margin:6px 0; }
.chat-picker button,.choice-list button { color:var(--txt2); background:transparent; border:1px solid transparent;
  border-radius:8px; padding:6px 9px; font:inherit; cursor:pointer; }
.chat-picker button:hover,.choice-list button:hover { background:rgba(255,255,255,.09); }
.choice-list button[aria-pressed=true] { color:var(--blue); border-color:var(--blue); }
.picker-models { border-top:1px solid var(--stroke); padding:6px 0; }
#sheet .fgroup input:not([type=checkbox]),#sheet .fgroup textarea,#sheet .fgroup .field {
  width:100%; border-radius:12px; padding:11px 13px; background:rgba(255,255,255,.065); border:1px solid var(--stroke); color:var(--txt);
}
#sheet .fgroup .hint { margin:6px 2px 0; color:var(--txt3); font-size:11px; line-height:1.5; }
#sheet .fgroup button.opt { width:auto; border-radius:20px; }
#sheet .fgroup button.opt.on { background:#f2f2f4;color:#15151b; }

#pop.paint {max-height:min(70dvh,560px);overflow-y:auto;min-width:min(350px,calc(100vw - 16px));}
#pop .trow[aria-pressed=true]::after {content:"✓";color:var(--blue);margin-inline-start:auto;}
#omList .om-row {display:flex;align-items:center;justify-content:space-between;gap:8px;}
#omList .om-main {min-width:0;overflow-wrap:anywhere;}
#omList .om-name {text-align:left;background:none;border:0;color:var(--txt);font:inherit;cursor:pointer;}
#omBox {max-width:calc(100vw - 12px);}

.file-controls,.pn-attachments,.pn-files {display:flex;align-items:center;flex-wrap:wrap;gap:5px;}
.file-field {display:grid;gap:5px;min-width:0;}
.file-choose,.pn-attach {display:inline-flex;align-items:center;gap:6px;}
.file-choose .ico,.pn-attach .ico {width:15px;height:15px;}
.picked-files {font-size:12px;color:var(--txt2);overflow-wrap:anywhere;}
:is(.workspace-overlay,dialog,#pop) select:not([multiple]) {
  appearance:none;padding-right:30px;color-scheme:dark;
  background-color:#20202a;color:var(--txt);border:1px solid var(--stroke);border-radius:9px;
  background-image:linear-gradient(45deg,transparent 50%,var(--txt3) 50%),linear-gradient(135deg,var(--txt3) 50%,transparent 50%);
  background-position:calc(100% - 14px) 52%,calc(100% - 10px) 52%;background-size:4px 4px;background-repeat:no-repeat;
}
#pop.paint {box-sizing:border-box;width:360px;min-width:0;max-width:calc(100vw - 16px);padding:12px;max-height:min(80dvh,620px);}
#pop.paint [hidden],.workspace-overlay [hidden] {display:none!important;}
#pop.paint .pn-note {font-size:11px;color:var(--txt3);line-height:1.4;margin:3px 2px 6px;}
#pop.paint .pn-attachments {margin:4px 2px 0;}
#pop.paint .pn-attach,#pop.paint .pn-size {width:auto;padding:4px 8px;border:1px solid var(--stroke-soft);
 background:rgba(255,255,255,.04);border-radius:7px;color:var(--txt2);font-size:11px;line-height:1.3;}
#pop.paint .pn-size.on {border-color:rgba(160,110,255,.65);background:rgba(160,110,255,.16);color:#e6d9ff;}
.pn-file {display:inline-flex;align-items:center;max-width:100%;min-width:0;gap:3px;color:var(--txt2);font-size:11px;}
.pn-file span {overflow-wrap:anywhere;}
#pop.paint .pn-remove {width:23px;height:23px;padding:0;justify-content:center;}
.pn-sizes {display:flex;flex-wrap:wrap;gap:5px;}
#pop.paint :focus-visible {outline:2px solid #b89aff;outline-offset:1px;}
#pop.paint .pn-models button {display:flex;width:100%;}


#pop.paint .pn-foot > button {display:flex;align-items:center;box-sizing:border-box;margin:0;line-height:15px;}
#pop.paint .pn-foot .pn-go {flex:0 0 112px;width:112px;height:31px;font-size:13.5px;padding:8px 16px;}
#pop.paint .pn-foot .pn-en {height:30px;font-size:12px;padding:7px 8px;gap:6px;}
#pop.paint .pn-models button {height:28px;box-sizing:border-box;margin:0;line-height:14px;}
#pop.paint .pn-asp .a {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 3px; cursor: pointer; width: 36px; height: 44px; box-sizing: border-box;
  padding: 4px 3px 3px; border-radius: 9px; border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, .04); font-size: 9.5px; color: var(--txt3);
  transition: background .15s, border-color .15s, color .15s;
}
#pop.paint .pn-asp .a:hover { background: rgba(255, 255, 255, .09); color: var(--txt2); }
#pop.paint .pn-asp .a.on { border-color: rgba(160, 110, 255, .6); background: rgba(160, 110, 255, .16);
  color: #e6d9ff; }
#pop.paint .pn-asp .a i { display: block; border: 1.5px solid currentColor; border-radius: 2px; opacity: .8; }
