:root{
  --ease-out:cubic-bezier(.2,.75,.2,1); --ease-in:cubic-bezier(.45,0,.85,.35);
  --sp-pop:cubic-bezier(.2,1.2,.3,1); --sp-pop-d:.5s; --sp-bouncy:cubic-bezier(.2,1.35,.3,1); --sp-bouncy-d:.65s;
  --sp-page:var(--ease-out); --sp-page-d:.5s; --sp-snap:var(--ease-out); --sp-snap-d:.35s; --sp-drawer:var(--ease-out); --sp-drawer-d:.4s;
  --bg:#0d0d0c; --bg2:#121210; --surf:#181816; --surf2:#201f1c; --line:#2a2925; --line2:#383631;
  --text:#ece8df; --text2:#bdb8ad; --muted:#857f74; --brand:#3a57f1; --accent:#3a57f1; --on-accent:#fff;
  --sage:#7891fc; --warn:#d9a35b; --red:#d97a6c; --code:#151513;
  --side:280px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Noto Sans Arabic", "Geeza Pro", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
}
[data-theme=light]{
  --bg:#f6f4ef; --bg2:#efece5; --surf:#ffffff; --surf2:#ebe8e0; --line:#e2ded4; --line2:#d3cec2;
  --text:#1b1a17; --text2:#4a4740; --muted:#8a857a; --brand:#3a57f1; --accent:#3a57f1; --on-accent:#fff;
  --sage:#3a57f1; --code:#f0ede6; color-scheme: light;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font:15px/1.6 var(--font);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
body{overflow:hidden;overscroll-behavior:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0}
input,textarea{font:inherit;color:inherit}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}
.muted{color:var(--muted)} .small{font-size:12.5px}
.err{color:var(--red);font-size:13px;margin:0}
::selection{background:color-mix(in srgb,var(--text) 22%,transparent)}
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--line);border-radius:10px;border:3px solid transparent;background-clip:padding-box}

/* grain */
body::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;opacity:.035;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}

.zenmark{display:block;height:22px;width:52px;stroke:none;--zm0:#fff;--zm1:#7891fc;--zm2:#3a57f1}
[data-theme=light] .zenmark{--zm0:var(--brand);--zm1:#b4c0ff;--zm2:#dfe5ff}
.zenmark.huge{height:56px;width:133px;opacity:.9}
[data-theme=light] .zenmark.huge{opacity:1}
.logo-tile{width:96px;height:96px;border-radius:24px;box-shadow:0 18px 60px -10px color-mix(in srgb,var(--brand) 70%,transparent),0 0 0 1px rgba(255,255,255,.06) inset;animation:float 6s ease-in-out infinite;margin-bottom:10px}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}

/* buttons */
.icon-btn{width:36px;height:36px;display:inline-grid;place-items:center;border-radius:10px;color:var(--text2);transition:background .15s,color .15s}
.icon-btn:hover{background:var(--surf2);color:var(--text)}
.icon-btn.on{color:var(--text);background:var(--surf2)}
.primary,.ghost,.danger{border-radius:11px;padding:10px 16px;font-weight:550;transition:opacity .15s,background .15s}
.primary{background:var(--accent);color:var(--on-accent)} .primary:hover{opacity:.88}
.ghost{border:1px solid var(--line2);color:var(--text)} .ghost:hover{background:var(--surf2)}
.danger{border:1px solid color-mix(in srgb,var(--red) 50%,transparent);color:var(--red)}
.sm{padding:7px 12px;font-size:13.5px}
.wide{width:100%}

/* login */
.login{position:fixed;inset:0;display:grid;place-items:center;padding:24px;
  background:radial-gradient(55% 45% at 50% 32%,color-mix(in srgb,var(--brand) 16%,transparent),transparent 70%),var(--bg)}
.login-card{width:min(340px,100%);display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center}
.login-card p{margin:0 0 14px}
.login-card input{width:100%;padding:13px 15px;border-radius:12px;border:1px solid var(--line2);background:var(--surf);outline:none;text-align:center;letter-spacing:.05em}
.login-card input:focus{border-color:var(--text2)}

/* layout */
.app{position:fixed;inset:0;display:flex}
.side{width:var(--side);flex:none;display:flex;flex-direction:column;background:var(--bg2);border-inline-end:1px solid var(--line);padding-top:env(safe-area-inset-top)}
.side-head{display:flex;align-items:center;justify-content:space-between;padding:14px 12px 8px 16px}
.brand{display:flex;align-items:center;padding:4px 0}
.search{display:flex;align-items:center;gap:8px;margin:4px 12px 8px;padding:0 10px;height:38px;border-radius:11px;background:var(--surf);border:1px solid var(--line);color:var(--muted)}
.search:focus-within{border-color:var(--line2)}
.search svg{width:16px;height:16px}
.search input{flex:1;min-width:0;border:0;outline:0;background:none;color:var(--text);font-size:14px}
.search input::-webkit-search-cancel-button{display:none}
kbd{font:11px var(--mono);color:var(--muted);border:1px solid var(--line2);border-radius:5px;padding:1px 5px}
.side-scroll{flex:1;overflow-y:auto;padding:4px 8px 12px}
.group{font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:14px 10px 6px}
.chat{position:relative;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border-radius:10px;color:var(--text2);text-align:start;font-size:14px}
.chat:hover{background:var(--surf2)} .chat.cur{background:var(--surf2);color:var(--text)}
.chat+.chat{margin-top:3px}
.chat .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat .more{opacity:0;width:26px;height:26px;border-radius:7px;display:grid;place-items:center;color:var(--muted)}
.chat .more svg{width:16px;height:16px}
.chat:hover .more,.chat.cur .more{opacity:1} .chat .more:hover{background:var(--line);color:var(--text)}
.chat .run{width:7px;height:7px;border-radius:50%;background:var(--sage);animation:pulse 1.4s ease-in-out infinite;flex:none}
.chat .pin{width:13px;height:13px;color:var(--muted)}
.hits .hit{display:block;width:100%;text-align:start;padding:9px 10px;border-radius:10px}
.hits .hit:hover{background:var(--surf2)}
.hit b{display:block;font-weight:550;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hit span{display:block;font-size:12.5px;color:var(--muted);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.hit mark{background:color-mix(in srgb,var(--sage) 35%,transparent);color:var(--text);border-radius:3px}
.side-foot{display:flex;align-items:center;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom)) 16px;border-top:1px solid var(--line)}
.side-foot .muted{flex:1}
.dot{width:8px;height:8px;border-radius:50%;background:var(--muted)}
.dot.ok{background:var(--sage)} .dot.bad{background:var(--red)}

.main{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}
.head{display:flex;align-items:center;gap:6px;padding:calc(10px + env(safe-area-inset-top)) 14px 10px;border-bottom:1px solid transparent;transition:border-color .2s}
.head.lined{border-color:var(--line)}
.head-title{flex:1;min-width:0;padding:0 6px}
.title{max-width:100%;font-weight:600;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;text-align:start}
.sub{height:16px;line-height:16px;display:flex;align-items:center;gap:6px}
.sub .live{width:6px;height:6px;border-radius:50%;background:var(--sage);animation:pulse 1.4s infinite}

.only-mobile{display:none}

.scroller{flex:1;overflow-y:auto;overflow-x:hidden;scroll-behavior:auto;overscroll-behavior:contain}
.list{max-width:780px;margin:0 auto;padding:12px 22px 40px}
.empty{position:absolute;inset:60px 0 140px;display:grid;place-content:center;justify-items:center;gap:14px;pointer-events:none}
.empty-t{font:400 26px/1.2 var(--serif);color:var(--text2);margin:0}
.to-bottom{position:absolute;inset-inline-end:24px;bottom:130px;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--surf);border:1px solid var(--line2);box-shadow:0 6px 20px rgba(0,0,0,.25)}

/* messages */
.msg{margin:22px 0;animation:msgT var(--sp-bouncy-d) var(--sp-bouncy) both,msgF .28s var(--ease-out) both}
@keyframes rise{from{opacity:0;transform:translateY(6px)}}
.msg.user{display:flex;flex-direction:column;align-items:flex-end}
.bubble{max-width:85%;background:var(--surf2);border-radius:18px 18px 6px 18px;padding:10px 15px;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere}
[dir=rtl] .bubble{border-radius:18px 18px 18px 6px}
.msg.user.steer .bubble{border:1px dashed var(--line2);background:transparent}
.tag{font-size:11.5px;color:var(--muted);margin:4px 6px 0}
.voice-badge{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12.5px;margin-bottom:4px}
.voice-badge svg{width:14px;height:14px}
.atts{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-bottom:6px;max-width:85%}
.att{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surf);font-size:13px;max-width:260px;color:var(--text2);text-decoration:none}
.att span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.att svg{width:16px;height:16px}
.att-img{display:block;border-radius:12px;max-width:240px;max-height:240px;border:1px solid var(--line);object-fit:cover;background:var(--surf)}
audio{height:36px;max-width:100%}

.msg.bot{color:var(--text)}
.prose{overflow-wrap:anywhere}
.prose>*:first-child{margin-top:0} .prose>*:last-child{margin-bottom:0}
.prose p{margin:.6em 0}
.prose h1,.prose h2,.prose h3,.prose h4{line-height:1.3;margin:1.2em 0 .5em;font-weight:650}
.prose h1{font-size:1.35em} .prose h2{font-size:1.2em} .prose h3{font-size:1.05em}
.prose a{color:var(--text);text-decoration:underline;text-decoration-color:var(--muted);text-underline-offset:3px}
.prose ul,.prose ol{padding-inline-start:1.4em;margin:.5em 0} .prose li{margin:.2em 0}
.prose blockquote{margin:.8em 0;padding:.1em 1em;border-inline-start:3px solid var(--line2);color:var(--text2)}
.prose code{font:.88em var(--mono);background:var(--code);border:1px solid var(--line);border-radius:6px;padding:.1em .35em}
.prose pre{position:relative;background:var(--code);border:1px solid var(--line);border-radius:12px;padding:14px 16px;overflow-x:auto;margin:.8em 0;direction:ltr;text-align:left}
.prose pre code{background:none;border:0;padding:0;font-size:13px;line-height:1.55}
.prose pre .copy{position:absolute;top:8px;right:8px;font-size:12px;padding:3px 8px;border-radius:7px;border:1px solid var(--line2);background:var(--surf);color:var(--muted);opacity:0;transition:opacity .15s}
.prose pre:hover .copy{opacity:1}
.prose table{border-collapse:collapse;margin:.8em 0;display:block;overflow-x:auto;font-size:14px}
.prose th,.prose td{border:1px solid var(--line);padding:6px 10px;text-align:start}
.prose th{background:var(--surf2);font-weight:600}
.prose hr{border:0;border-top:1px solid var(--line);margin:1.4em 0}
.prose img{max-width:100%;border-radius:10px}
.media{margin:.7em 0}
.media img,.media video{display:block;max-width:min(100%,520px);max-height:520px;border-radius:12px;border:1px solid var(--line)}

.tools{display:flex;flex-direction:column;gap:4px;margin:6px 0 10px}
.tool{border:1px solid var(--line);border-radius:10px;background:var(--bg2);font-size:13px;overflow:hidden;max-width:100%}
.tool>button{display:flex;align-items:center;gap:8px;width:100%;padding:6px 10px;text-align:start;color:var(--text2)}
.tool .nm{font-family:var(--mono);font-size:12.5px;color:var(--text)}
.tool .pv{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-family:var(--mono);font-size:12px;direction:ltr;text-align:left}
.tool .st{width:14px;height:14px;flex:none;display:inline-grid;place-items:center}
.tool .spin{display:block;width:12px;height:12px;border:1.6px solid var(--line2);border-top-color:var(--text);border-radius:50%;animation:spin .8s linear infinite}
.tool.fail .nm{color:var(--red)}
.tool pre{margin:0;padding:8px 10px;border-top:1px solid var(--line);font:12px/1.5 var(--mono);white-space:pre-wrap;word-break:break-all;max-height:280px;overflow:auto;color:var(--text2);direction:ltr;text-align:left}
@keyframes spin{to{transform:rotate(360deg)}}
.typing{display:inline-flex;gap:5px;padding:6px 0}
.typing i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.caret>:last-child::after,.caret:empty::after{content:"";display:inline-block;width:.55em;height:.55em;border-radius:50%;margin-inline-start:.35em;vertical-align:.05em;background:var(--brand);box-shadow:0 0 12px 2px color-mix(in srgb,var(--brand) 60%,transparent);animation:orb 1.4s ease-in-out infinite}
@keyframes orb{0%,100%{transform:scale(.7);opacity:.55;filter:blur(.5px)}50%{transform:scale(1);opacity:1;filter:blur(0)}}
.acts{display:flex;gap:2px;margin-top:6px;opacity:0;transition:opacity .15s}
.msg:hover .acts,.acts.show{opacity:1}
.acts .icon-btn{width:30px;height:30px} .acts svg{width:16px;height:16px}
.note{font-size:13px;color:var(--muted);border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:8px 0}
.note.err{color:var(--red);border-color:color-mix(in srgb,var(--red) 40%,transparent)}
.approval{border:1px solid color-mix(in srgb,var(--warn) 55%,transparent);background:color-mix(in srgb,var(--warn) 8%,transparent);border-radius:12px;padding:12px 14px;margin:10px 0}
.approval b{display:block;margin-bottom:6px}
.approval pre{font:12.5px var(--mono);white-space:pre-wrap;word-break:break-all;margin:0 0 10px;color:var(--text2);direction:ltr;text-align:left}
.approval .btns{display:flex;gap:8px;flex-wrap:wrap}
.flash{animation:flash 2s ease-out}
@keyframes flash{0%,30%{background:color-mix(in srgb,var(--sage) 22%,transparent)}100%{background:transparent}}

/* composer */
.composer{padding:6px 16px calc(8px + env(safe-area-inset-bottom));max-width:812px;width:100%;margin:0 auto}
.box{display:flex;align-items:flex-end;gap:4px;padding:6px;border-radius:22px;background:var(--surf);border:1px solid var(--line2);box-shadow:0 8px 30px rgba(0,0,0,.12);transition:border-color .15s}
.box:focus-within{border-color:color-mix(in srgb,var(--brand) 60%,var(--line2));box-shadow:0 8px 30px rgba(0,0,0,.12),0 0 0 3px color-mix(in srgb,var(--brand) 14%,transparent)}
.box textarea{flex:1;min-width:0;resize:none;border:0;outline:0;background:none;padding:7px 4px;max-height:220px;line-height:1.5;font-size:15.5px}
.send{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--on-accent);transition:opacity .15s,transform .1s;flex:none}
.send:disabled{opacity:.25;cursor:default}
.send:active{transform:scale(.94)}
.send svg{stroke-width:2.2}
.hint{text-align:center;padding-top:6px;height:22px}
.tray{display:flex;gap:8px;overflow-x:auto;padding:0 4px 8px}
.chip{position:relative;flex:none;display:flex;align-items:center;gap:8px;padding:6px 30px 6px 8px;border:1px solid var(--line2);border-radius:12px;background:var(--surf);font-size:13px;max-width:220px}
.chip img{width:36px;height:36px;object-fit:cover;border-radius:8px}
.chip .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip .x{position:absolute;top:50%;right:4px;transform:translateY(-50%);width:22px;height:22px;border-radius:6px;display:grid;place-items:center;color:var(--muted)}
.chip .x svg{width:14px;height:14px}
.chip.busy{opacity:.55}
.recording #micBtn{display:none}
.recording #langBtn{display:none}
.lang-btn{width:30px;margin-inline-end:-6px;font-size:11.5px;font-weight:650;letter-spacing:.03em;color:var(--text3,var(--text2))}
.lang-btn.ar{font-size:16px;font-weight:600;letter-spacing:0;line-height:1}
.lang-btn.auto{width:38px;font-size:9.5px;letter-spacing:.06em}
.drop{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--bg) 80%,transparent);backdrop-filter:blur(6px);z-index:20}
.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;padding:34px 46px;border:1.5px dashed var(--line2);border-radius:20px}
.drop-card svg{width:30px;height:30px}

/* sheets & menus */
dialog.sheet{border:1px solid var(--line2);border-radius:18px;background:var(--surf);color:var(--text);padding:0;width:min(480px,calc(100vw - 24px));box-shadow:0 30px 80px rgba(0,0,0,.45)}
dialog.narrow{width:min(380px,calc(100vw - 24px))}
dialog::backdrop{background:rgba(0,0,0,.45);backdrop-filter:blur(3px)}
.sheet-in{padding:18px 20px 16px}
.sheet h2{font-size:17px;margin:0 0 10px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.sheet-head h2{margin:0}
.row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.stack{display:flex;flex-direction:column;gap:2px}
.btns{display:flex;gap:6px}
.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px;flex-wrap:wrap}
#cInput{width:100%;margin-top:6px;padding:10px 12px;border-radius:10px;border:1px solid var(--line2);background:var(--bg2);outline:none}
.menu{z-index:60;min-width:170px;outline:none;padding:5px;border-radius:12px;background:var(--surf);border:1px solid var(--line2);box-shadow:0 14px 40px rgba(0,0,0,.35)}
.menu :is(button,ui-menu-item){display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:8px;font-size:14px;text-align:start;cursor:pointer;outline:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
/* hover, or keyboard focus only: ui-sdk also highlights the first row when a menu opens by tap/click */
.menu ui-menu-item:hover,.menu ui-menu-item[data-highlighted]:focus-visible{background:var(--surf2)}
.menu ui-menu-item.on:hover{background:color-mix(in srgb,var(--brand) 20%,transparent)}
.menu :is(button,ui-menu-item)+:is(button,ui-menu-item){margin-top:3px}
.menu ui-menu-separator{display:block;height:1px;margin:4px 6px;background:var(--line)}
.menu button:hover{background:var(--surf2)} .menu :is(button,ui-menu-item).red{color:var(--red)}
.menu svg{width:16px;height:16px}
.toast{background:var(--text);color:var(--bg);padding:9px 16px;border-radius:12px;font-size:13.5px;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.scrim{display:none}

@media (max-width:820px){
  .only-mobile{display:inline-grid}
  .side{position:fixed;inset:0 auto 0 0;z-index:40;width:min(86vw,320px);transform:translateX(-102%);transition:transform var(--sp-drawer-d) var(--sp-drawer);box-shadow:20px 0 60px rgba(0,0,0,.35)}
  [dir=rtl] .side{inset:0 0 0 auto;transform:translateX(102%)}
  .app.open .side{transform:none}
  .scrim{display:block;position:fixed;inset:0;z-index:39;background:rgba(0,0,0,.4);opacity:0;pointer-events:none;transition:opacity .32s var(--ease-out)}
  .app.open .scrim{opacity:1;pointer-events:auto}
  .list{padding:8px 16px 30px}
  .composer{padding-left:10px;padding-right:10px}
  .hint{display:none}
  .bubble,.atts{max-width:92%}
  .chat .more{opacity:1}
  .acts{opacity:1}
  .head{padding-left:8px;padding-right:8px}
  kbd{display:none}
}

/* ---------- hugeicons ---------- */
svg.i{width:20px;height:20px;fill:none;stroke:none;flex:none}
.icon-btn svg.i{width:20px;height:20px}
.acts svg.i,.menu svg.i,.att svg.i,.chip svg.i{width:16px;height:16px}
.search svg.i{width:17px;height:17px}
.send svg.i{width:19px;height:19px}
.tool .st svg.i{width:14px;height:14px}

/* ---------- sidebar tabs ---------- */
.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;margin:2px 12px 6px;padding:3px;border-radius:12px;background:var(--surf);border:1px solid var(--line)}
.tab{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;height:32px;border-radius:9px;font-size:13.5px;font-weight:550;color:var(--muted);transition:background .15s,color .15s}
.tab svg.i{width:16px;height:16px}
.tab:hover{color:var(--text)}
.tab.on{background:var(--surf2);color:var(--text);box-shadow:0 1px 0 rgba(255,255,255,.04) inset,0 1px 3px rgba(0,0,0,.18)}
.tab .live-dot{position:absolute;top:7px;inset-inline-end:10px}
.live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#3ccf7a;box-shadow:0 0 0 3px color-mix(in srgb,#3ccf7a 22%,transparent);animation:pulse 1.6s ease-in-out infinite;flex:none}

/* ---------- avatars ---------- */
.av{--h:220;display:inline-grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;overflow:hidden;font-size:13px;font-weight:650;letter-spacing:.02em;color:#fff;
  background:linear-gradient(140deg,hsl(var(--h) 70% 58%),hsl(calc(var(--h) + 35) 65% 45%))}
.av{position:relative}
.av img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.av svg.i{width:18px;height:18px}
.av.md{width:38px;height:38px}
.av.sm{width:34px;height:34px;margin-inline-start:4px}
.av.xs{width:18px;height:18px;font-size:8.5px}

/* ---------- telegram tree ---------- */
.tg{padding-top:2px}
.tg-chat{margin:0 0 6px;border-radius:14px;transition:background .2s}
.tg-chat.open{background:color-mix(in srgb,var(--surf) 55%,transparent)}
.tg-head{display:flex;align-items:center;gap:11px;width:100%;padding:9px 10px;border-radius:14px;text-align:start}
.tg-head:hover{background:var(--surf2)}
.tg-meta{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.tg-meta b{font-weight:600;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tg-meta small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chev{color:var(--muted);display:grid;place-items:center;transition:transform .2s}
.chev svg.i{width:16px;height:16px}
.tg-chat:not(.open) .chev{transform:rotate(-90deg)}
[dir=rtl] .tg-chat:not(.open) .chev{transform:rotate(90deg)}
.tg-topics{display:none;padding:0 6px 8px;position:relative}
.tg-chat.open .tg-topics{display:block}
.topic{position:relative;display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;border-radius:10px;text-align:start;color:var(--text2)}
.topic:hover{background:var(--surf2)}
.topic.cur{background:color-mix(in srgb,var(--brand) 16%,var(--surf2));color:var(--text)}
.topic.cur .tp-ico{background:var(--brand);color:#fff;border-color:transparent}
.tp-ico{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex:none;background:var(--bg2);border:1px solid var(--line);color:var(--muted)}
.tp-ico svg.i{width:15px;height:15px}
.tp-tx{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.tp-name{font-size:13.5px;font-weight:550;color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-name.auto{color:var(--muted);font-weight:500}
.tp-hint{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-side{flex:none;display:flex;align-items:center}
.tp-time{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}

/* ---------- telegram view ---------- */
.crumb{display:inline-flex;align-items:center;gap:5px;color:var(--text2)}
.crumb svg.i{width:13px;height:13px;color:#2aabee}
.sub .dim{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.sub{overflow:hidden;white-space:nowrap}
.pill{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border-radius:999px;border:1px solid var(--line2);color:var(--text2);font-size:12.5px;font-variant-numeric:tabular-nums}
.pill:hover{background:var(--surf2);color:var(--text)}
.pill svg.i{width:15px;height:15px}
#tgOpen{color:#2aabee}
.sender{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin:0 6px 4px;font-weight:550}
.tgview .msg.user .bubble{background:color-mix(in srgb,var(--brand) 14%,var(--surf2))}
.robar{display:flex;align-items:center;justify-content:center;gap:9px;margin:6px auto calc(10px + env(safe-area-inset-bottom));padding:10px 16px;max-width:780px;width:calc(100% - 32px);
  border-radius:16px;border:1px dashed var(--line2);color:var(--muted);font-size:13px}
.robar svg.i{width:17px;height:17px}
.ro-live{display:inline-flex;align-items:center;gap:6px;color:#3ccf7a;font-weight:600;padding-inline-start:9px;border-inline-start:1px solid var(--line2)}
.ro-live i{width:7px;height:7px;border-radius:50%;background:currentColor;animation:pulse 1.6s infinite}
.menu :is(button,ui-menu-item).on{background:var(--surf2)}
.menu .stack small{font-size:11.5px}
.menu{max-width:min(360px,calc(100vw - 16px))}
.menu .stack span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:290px}

.fold{display:flex;align-items:center;gap:8px;width:100%;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:var(--bg2);color:var(--text2);font-size:13px;text-align:start}
.fold:hover{border-color:var(--line2)}
.fold svg.i{width:15px;height:15px;color:var(--muted)}
.fold .nm{font-weight:600;color:var(--text)}
.fold .pv{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-family:var(--mono);font-size:12px}
.fold .chev{transition:transform .2s}
.fold.open .chev{transform:rotate(180deg)}
.more-row{display:block;width:100%;padding:6px 8px 4px 46px;text-align:start;font-size:12.5px;color:var(--muted);font-weight:550}
[dir=rtl] .more-row{padding:6px 46px 4px 8px}
.more-row:hover{color:var(--text)}
.tab .live-dot{position:static;width:6px;height:6px;box-shadow:none}

/* iOS Safari zooms into any focused field under 16px: keep every editable field at >=16px on touch devices */
@media (pointer: coarse), (hover: none) {
  input, textarea, select, [contenteditable] { font-size: 16px !important; }
  .box textarea { line-height: 1.45; }
  .search input { font-size: 16px !important; }
}
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px !important; }
}

/* ---------- messages from Hermes (gateway/system) ---------- */
.sys-head{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:12.5px;color:var(--muted);min-width:0}
.sys-head b{color:var(--text);font-weight:600;font-size:13px}
.hermes-badge{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:var(--brand);color:#fff;flex:none}
.hermes-badge svg.i{width:14px;height:14px}
.sys-title{display:inline-flex;align-items:center;gap:5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sys-title svg.i{width:14px;height:14px;flex:none}
.msg.sys{margin:16px 0}
.sys-card{position:relative;border:1px solid var(--line);border-inline-start:3px solid var(--brand);border-radius:12px;background:var(--bg2);padding:10px 14px;font-size:14px}
.sys-card.clamp{max-height:132px;overflow:hidden}
.sys-card.clamp::after{content:"";position:absolute;inset:auto 0 0 0;height:48px;background:linear-gradient(transparent,var(--bg2))}
.sys-more{margin-top:6px;font-size:12.5px;font-weight:600;color:var(--brand)}
.quote{max-width:85%;margin:0 0 6px;padding:6px 10px;border-inline-start:3px solid var(--line2);border-radius:6px;background:var(--surf);font-size:12.5px;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}
video.att-img{max-width:260px}

/* ---------- streaming reveal ---------- */
.tk{animation:tkIn 560ms cubic-bezier(.2,.65,.25,1) both}
@keyframes tkIn{0%{opacity:0;filter:blur(7px)}35%{opacity:.55;filter:blur(3px)}100%{opacity:1;filter:blur(0)}}
@media (prefers-reduced-motion: reduce){.tk{animation:none}.caret>:last-child::after{animation:none}}

/* ---------- background process card ---------- */
.proc{border:1px solid var(--line);border-radius:14px;background:var(--bg2);overflow:hidden;max-width:100%}
.proc-top{display:flex;align-items:center;gap:8px;padding:10px 14px 0}
.proc-st{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,#3ccf7a 18%,transparent);color:#3ccf7a;flex:none}
.proc.bad .proc-st{background:color-mix(in srgb,var(--red) 18%,transparent);color:var(--red)}
.proc-st svg.i{width:12px;height:12px}
.proc-t{font-weight:600;font-size:13.5px}
.proc-pill{font:500 11px/1 var(--mono);padding:4px 7px;border-radius:999px;background:var(--surf2);color:var(--muted)}
.proc.bad .proc-pill{color:var(--red)}
.proc-id{margin-inline-start:auto;font:11px var(--mono);color:var(--muted);opacity:.7}
.proc-cmd{display:flex;gap:8px;margin:10px 14px 0;padding:9px 12px;border-radius:10px;background:var(--code);border:1px solid var(--line);font:12.5px/1.55 var(--mono);text-align:left}
.proc-cmd code{white-space:pre-wrap;word-break:break-all;color:var(--text)}
.proc-cmd.clip{cursor:pointer}
.proc-cmd.clip code{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.proc-prompt{color:var(--brand);font-weight:700;flex:none;user-select:none}
.proc-cwd{display:flex;align-items:center;gap:6px;margin:7px 16px 0;font:11.5px var(--mono);color:var(--muted);direction:ltr}
.proc-cwd svg.i{width:13px;height:13px}
.proc-out{position:relative;margin:10px 0 0;padding:10px 16px 12px;border-top:1px solid var(--line);font:12px/1.6 var(--mono);color:var(--text2);white-space:pre-wrap;word-break:break-word;text-align:left;max-height:420px;overflow:auto}
.proc-out.clamp{max-height:9.6em;overflow:hidden}
.proc-out.clamp::after{content:"";position:absolute;inset:auto 0 0 0;height:3.2em;background:linear-gradient(transparent,var(--bg2))}
.proc-more{display:flex;align-items:center;gap:6px;width:100%;padding:8px 16px 10px;font-size:12.5px;font-weight:600;color:var(--text2);border-top:1px solid var(--line)}
.proc-more:hover{color:var(--text);background:var(--surf)}
.proc-more svg.i{width:14px;height:14px;transition:transform .2s}
.proc-more.open svg.i{transform:rotate(180deg)}
.proc-empty{padding:8px 16px 12px;font-size:12.5px;color:var(--muted)}
/* generic system cards: no nested boxes for code */
.sys-card .prose pre{background:transparent;border:0;padding:0;margin:.4em 0}

/* ---------- inline video tiles ---------- */
.vwrap{position:relative;display:inline-block;max-width:min(100%,420px);border-radius:14px;overflow:hidden;border:1px solid var(--line);background:#000;line-height:0}
.vwrap video{display:block;width:100%;max-height:360px;object-fit:cover;background:#000}
.vwrap.att-vid{max-width:260px}
.vplay{position:absolute;inset:0;display:grid;place-items:center;background:linear-gradient(transparent 55%,rgba(0,0,0,.45));color:#fff;transition:background .2s}
.vplay svg.i{width:46px;height:46px;filter:drop-shadow(0 4px 14px rgba(0,0,0,.5));transition:transform .2s}
.vplay:hover svg.i{transform:scale(1.08)}
.vexp{position:absolute;top:8px;right:8px;width:30px;height:30px;border-radius:9px;display:grid;place-items:center;color:#fff;background:rgba(0,0,0,.45);backdrop-filter:blur(8px);opacity:0;transition:opacity .2s}
.vwrap:hover .vexp{opacity:1}
.vexp svg.i{width:16px;height:16px}
.vdur{position:absolute;left:10px;bottom:9px;font:600 11.5px/1 var(--font);color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.6);pointer-events:none}
.att-img,.media img,.prose img{cursor:zoom-in;transition:transform .2s,filter .2s}
.att-img:hover,.media img:hover{filter:brightness(1.06)}

/* ---------- viewer ---------- */
.viewer{position:fixed;inset:0;z-index:90;display:grid;grid-template-rows:auto minmax(0,1fr) auto;opacity:0;transition:opacity .2s}
.viewer.in{opacity:1}
.vw-bg{position:absolute;inset:0;background:rgba(6,6,8,calc(.86 * var(--fade,1)));backdrop-filter:blur(22px) saturate(1.2);-webkit-backdrop-filter:blur(22px) saturate(1.2)}
.vw-top{position:relative;z-index:2;display:flex;align-items:center;gap:6px;padding:calc(10px + env(safe-area-inset-top)) 14px 10px 20px;color:#fff}
.vw-top .icon-btn{color:#e8e8e8}
.vw-top .icon-btn:hover{background:rgba(255,255,255,.1);color:#fff}
.vw-meta{flex:1;min-width:0;display:flex;align-items:baseline;gap:10px}
.vw-meta b{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vw-meta span{font-size:12.5px;color:rgba(255,255,255,.55);font-variant-numeric:tabular-nums;flex:none}
.vw-stage{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;padding:4px 64px;min-height:0;height:100%;box-sizing:border-box}
.vw-media{display:block;width:auto;height:auto;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;flex:0 1 auto;border-radius:6px;box-shadow:0 30px 90px rgba(0,0,0,.55);user-select:none;-webkit-user-select:none;will-change:transform;cursor:zoom-in}
.viewer.zoomed .vw-media{cursor:grab;border-radius:0}
video.vw-media{cursor:default;background:#000;width:auto;max-height:100%}
.vw-nav{position:absolute;z-index:3;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:#fff;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);backdrop-filter:blur(10px);transition:background .15s}
.vw-nav:hover{background:rgba(255,255,255,.18)}
.vw-nav.prev{left:14px} .vw-nav.next{right:14px}
[dir=rtl] .vw-nav.prev{left:auto;right:14px;transform:translateY(-50%) scaleX(-1)} [dir=rtl] .vw-nav.next{right:auto;left:14px;transform:translateY(-50%) scaleX(-1)}
.vw-strip{position:relative;z-index:2;display:flex;gap:6px;justify-content:center;overflow-x:auto;padding:10px 14px calc(14px + env(safe-area-inset-bottom));scrollbar-width:none}
.vw-strip::-webkit-scrollbar{display:none}
.vw-strip button{flex:none;width:46px;height:46px;border-radius:9px;overflow:hidden;opacity:.45;border:2px solid transparent;transition:opacity .15s,border-color .15s;display:grid;place-items:center;background:rgba(255,255,255,.08);color:#fff}
.vw-strip button img{width:100%;height:100%;object-fit:cover}
.vw-strip button.on{opacity:1;border-color:var(--brand)}
.vw-strip button:hover{opacity:.85}
body.vw-open{overflow:hidden}
@media (max-width:820px){.vw-stage{padding:4px 0}.vw-nav{display:none}.vexp{opacity:1}}

.gone{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border:1px dashed var(--line2);border-radius:12px;color:var(--muted);font-size:13px;max-width:260px}
.gone svg.i{width:18px;height:18px;flex:none}
.gone .stack span{color:var(--text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px}
.gone small{font-size:11.5px}
.vw-strip button.miss{opacity:.25}
.vw-gone{color:rgba(255,255,255,.7);border-color:rgba(255,255,255,.25)}
.vw-gone .stack span{color:#fff}

/* ---------- recorder ---------- */
.rec{flex:1;min-width:0;display:flex;align-items:center;gap:10px;height:36px;padding:0 2px}
.rec-x{width:36px;height:36px;flex:none;border-radius:50%;display:grid;place-items:center;color:var(--muted);transition:background .15s,color .15s}
.rec-x:hover{background:color-mix(in srgb,var(--red) 14%,transparent);color:var(--red)}
.rec-x svg.i{width:19px;height:19px}
.rec-pill{flex:none;display:inline-flex;align-items:center;gap:8px;height:28px;padding:0 11px 0 9px;border-radius:999px;background:color-mix(in srgb,var(--red) 13%,transparent);color:var(--text);font:600 13.5px/1 var(--font);font-variant-numeric:tabular-nums}
.rec-dot{width:8px;height:8px;border-radius:50%;background:#ff4d4f;box-shadow:0 0 0 0 rgba(255,77,79,.6);animation:recpulse 1.4s ease-out infinite}
@keyframes recpulse{0%{box-shadow:0 0 0 0 rgba(255,77,79,.55)}70%{box-shadow:0 0 0 7px rgba(255,77,79,0)}100%{box-shadow:0 0 0 0 rgba(255,77,79,0)}}
#recWave{flex:1;min-width:0;width:100%;height:28px;display:block;-webkit-mask-image:linear-gradient(90deg,transparent,#000 14%);mask-image:linear-gradient(90deg,transparent,#000 14%)}
[dir=rtl] #recWave{transform:scaleX(-1)}
.box.recording{border-color:color-mix(in srgb,var(--red) 35%,var(--line2))}
.box.recording .send{background:var(--brand)}

/* ---------- voice note bubble ---------- */
.voice{--vn-on:var(--text);--vn-off:color-mix(in srgb,var(--text) 28%,transparent);width:min(300px,85vw);padding:9px 12px 9px 9px;border-radius:20px 20px 6px 20px;background:var(--surf2)}
[dir=rtl] .voice{border-radius:20px 20px 20px 6px;padding:9px 9px 9px 12px}
.tgview .voice{background:color-mix(in srgb,var(--brand) 14%,var(--surf2))}
.vn{display:flex;align-items:center;gap:11px}
.vn-btn{width:38px;height:38px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--brand);color:#fff;transition:transform .12s,filter .15s}
.vn-btn:hover{filter:brightness(1.1)} .vn-btn:active{transform:scale(.93)}
.vn-btn svg.i{width:17px;height:17px}
.vn-wave{flex:1;min-width:0;height:28px;display:block;cursor:pointer;touch-action:none}
.vn-time{flex:none;min-width:30px;text-align:end;font:500 12px/1 var(--font);color:var(--muted);font-variant-numeric:tabular-nums}
.voice.playing .vn-time{color:var(--text)}
.vn-tx{margin:9px 2px 1px;padding-top:8px;border-top:1px solid color-mix(in srgb,var(--text) 9%,transparent);font-size:14.5px;line-height:1.5;color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere}
.vn-tx.pending{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px}
.vn-tx.pending .spin{width:12px;height:12px;border:1.6px solid var(--line2);border-top-color:var(--text);border-radius:50%;animation:spin .8s linear infinite}
.vn-tx.err{color:var(--red);font-size:13px}
.msg.user.has-voice{align-items:flex-end}

/* ---------- replies ---------- */
.reply-bar{display:flex;align-items:center;gap:10px;margin:0 6px 8px;padding:6px 6px 6px 12px;border-radius:14px;background:var(--surf);border:1px solid var(--line);animation:rise .18s ease-out}
.rb-ico{color:var(--brand);display:grid;place-items:center;flex:none}
.rb-ico svg.i{width:18px;height:18px}
.rb-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;text-align:start;padding:2px 0 2px 10px;border-inline-start:2.5px solid var(--brand)}
[dir=rtl] .rb-body{padding:2px 10px 2px 0}
.rb-body b{font-size:12.5px;font-weight:650;color:var(--brand)}
.rb-body span{font-size:13px;color:var(--text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reply-bar .icon-btn{width:30px;height:30px}
.reply-bar .icon-btn svg.i{width:16px;height:16px}
.quote{display:flex;flex-direction:column;gap:1px;width:100%;margin:0 0 7px;padding:5px 10px;text-align:start;border-radius:8px;border-inline-start:2.5px solid var(--brand);background:color-mix(in srgb,var(--brand) 10%,transparent);font-size:12.5px;line-height:1.4;color:var(--text2);white-space:normal;cursor:pointer;max-width:none}
.quote b{font-size:12px;font-weight:650;color:var(--brand)}
.quote span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.quote:hover{background:color-mix(in srgb,var(--brand) 16%,transparent)}
.msg.user>.quote{max-width:85%;width:auto}
.voice .quote{margin-bottom:9px}
.msg.user .acts{justify-content:flex-end}
.msg.swiping{transition:none}
.msg.user,.msg.bot{position:relative;transition:transform var(--sp-snap-d) var(--sp-snap)}
.msg.swiping::before{content:"";position:absolute;top:50%;inset-inline-end:-34px;width:26px;height:26px;margin-top:-13px;border-radius:50%;opacity:var(--sw,0);transform:scale(calc(.6 + var(--sw,0) * .4));
  background:var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center/15px no-repeat}

/* ---------- gateway control ---------- */
.gw-line{display:inline-flex;align-items:center;gap:6px;font-size:12px}
.gw-dot{width:7px;height:7px;border-radius:50%;background:var(--muted);flex:none}
.gw-dot.ok{background:#3ccf7a}
.gw-dot.busy{background:var(--warn);animation:pulse 1s infinite}
.gw-dot.bad{background:var(--red)}
.gw-btn{display:inline-flex;align-items:center;gap:6px}
.gw-btn svg.i{width:16px;height:16px}
.gw-btn.spinning svg.i{animation:spin 1s linear infinite}
.gw-btn:disabled{opacity:.6;cursor:default}
#list .msg.user,#list .msg.bot{touch-action:pan-y pinch-zoom}
/* phones: your messages keep a compact, quiet action row (edit / reply / copy) */
@media (max-width:820px){.msg.user>.acts{margin-top:2px;gap:0;color:var(--muted)}.msg.user>.acts .icon-btn{width:28px;height:28px}}
/* the grain lives BEHIND the UI: on 3x iPhone screens a full-screen noise layer above text read as blur */
.app,.login{z-index:0}
@media (-webkit-min-device-pixel-ratio:2){body::before{opacity:.025}}
.head{-webkit-font-smoothing:antialiased}

/* ---------- slash commands ---------- */
.slash{margin:0 4px 8px;padding:5px;border-radius:16px;background:var(--surf);border:1px solid var(--line2);box-shadow:0 14px 40px rgba(0,0,0,.28);max-height:320px;overflow:auto;animation:rise .15s ease-out}
.sl-item{display:flex;align-items:center;gap:11px;width:100%;padding:7px 9px;border-radius:11px;text-align:start}
.sl-item.on,.sl-item:hover{background:var(--surf2)}
.sl-ico{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none;background:var(--bg2);border:1px solid var(--line);color:var(--text2)}
.sl-item.on .sl-ico{background:var(--brand);border-color:transparent;color:#fff}
.sl-ico svg.i{width:16px;height:16px}
.sl-tx{display:flex;align-items:baseline;gap:10px;min-width:0}
.sl-tx b{font:600 13.5px var(--mono);color:var(--text)}
.sl-tx span{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* ---------- command result cards ---------- */
.ops-card{border:1px solid var(--line);border-radius:14px;background:var(--bg2);padding:6px 14px;max-width:560px}
.ops-row{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid var(--line);font-size:13.5px}
.ops-row:last-child{border-bottom:0}
.ops-row .k{color:var(--muted)}
.ops-row .v{color:var(--text);font-variant-numeric:tabular-nums;text-align:end}
.ops-st{display:inline-flex;align-items:center;gap:7px}
.ops-line{display:flex;align-items:center;gap:9px;padding:8px 0;font-size:13.5px;color:var(--text2)}
.ops-line.ok{color:#3ccf7a}.ops-line.err{color:var(--red)}.ops-line.info{color:var(--text);font-weight:600}
.ops-line .spin{width:13px;height:13px;border:1.6px solid var(--line2);border-top-color:var(--text);border-radius:50%;animation:spin .8s linear infinite;flex:none}
.ops-log{margin:4px 0 8px;padding:10px 12px;border-radius:10px;background:var(--code);border:1px solid var(--line);font:12px/1.55 var(--mono);color:var(--text2);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto;direction:ltr;text-align:left}
.ops-btns{display:flex;gap:8px;padding:6px 0 8px}
.ops-cmd{display:flex;align-items:center;gap:10px;width:100%;padding:8px 2px;border-bottom:1px solid var(--line);text-align:start;font-size:13.5px}
.ops-cmd:last-child{border-bottom:0}
.ops-cmd svg.i{width:16px;height:16px;color:var(--muted)}
.ops-cmd b{font-family:var(--mono);font-weight:600;min-width:72px}
.ops-cmd span{color:var(--muted)}
.ops-cmd:hover b{color:var(--brand)}
.upd-btn,#keysBtn{display:inline-flex;align-items:center;gap:6px}.upd-btn svg.i,#keysBtn svg.i{width:16px;height:16px;flex:none}
/* iOS / touch: no grain layer at all — a full-screen fixed SVG-noise layer makes WebKit rasterize the page
   at a lower scale in standalone mode, which reads as soft text and icons */
@media (pointer: coarse), (display-mode: standalone) { body::before { content: none; display: none; } }
@supports (-webkit-touch-callout: none) { body::before { content: none; display: none; } }
.head-title .title:empty{display:none}
/* off-canvas sidebar: its shadow leaked a soft haze down the left edge while closed */
@media (max-width:820px){
  .side{box-shadow:none;visibility:hidden;transition:transform var(--sp-drawer-d) var(--sp-drawer),visibility 0s linear var(--sp-drawer-d)}
  .app.open .side{box-shadow:20px 0 60px rgba(0,0,0,.35);visibility:visible;transition:transform var(--sp-drawer-d) var(--sp-drawer),visibility 0s}
}

/* ---------- iPhone safe areas: sheets + full-height background ---------- */
html{background:var(--bg)}
/* centered sheets: always fit the screen, scroll inside if tall */
dialog.sheet{max-height:calc(100dvh - 32px);overflow:hidden}
dialog.sheet[open]{display:flex;flex-direction:column}
dialog.sheet .sheet-in{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
/* backdrop must cover the home-indicator strip too; blur on iOS softens text inside the sheet */
dialog::backdrop{inset:-50vh 0 -50vh 0}
@media (pointer:coarse){ dialog::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none;background:rgba(0,0,0,.55)} }
@media (display-mode: standalone){ .row.install-row{display:none} }

/* ---------- skills ---------- */
.tab{gap:5px;font-size:12.5px}
.sk-nav{padding-top:2px}
.sk-cat{display:flex;align-items:center;gap:10px;width:100%;padding:6px 8px;border-radius:10px;text-align:start;color:var(--text2)}
.sk-cat:hover{background:var(--surf2)}
.sk-cat.on{background:color-mix(in srgb,var(--brand) 16%,var(--surf2));color:var(--text)}
.sk-cat.on .tp-ico{background:var(--brand);color:#fff;border-color:transparent}
.sk-cat .tp-name{flex:1;min-width:0;font-size:13.5px;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:none}
.skview .list{max-width:1080px}
.sk-page{padding:4px 0 40px;animation:pageT var(--sp-page-d) var(--sp-page) both,pageF .26s var(--ease-out) both}
.sk-bar{position:sticky;top:0;z-index:2;display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:8px 0 12px;background:var(--bg)}
.sk-search{flex:1 1 260px;margin:0;height:40px}
.sk-search input{font-size:14.5px}
.sk-chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;margin:0 6px 10px 0;border-radius:999px;border:1px solid var(--line2);background:var(--surf);font-size:12.5px;color:var(--text2)}
.sk-chip svg.i{width:14px;height:14px}
.sk-chip:hover{color:var(--text);border-color:var(--brand)}
.sk-sec{margin:14px 0 22px}
.sk-h{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:13px;font-weight:650;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.sk-h svg.i{width:15px;height:15px}
.sk-h span{font-weight:500;color:var(--muted);opacity:.7;letter-spacing:0}
.sk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.sk-card{display:flex;flex-direction:column;gap:8px;min-width:0;padding:13px 14px 11px;border-radius:14px;border:1px solid var(--line);background:var(--surf);text-align:start;transition:border-color .15s,transform .15s,background .15s}
.sk-card:hover{border-color:color-mix(in srgb,var(--brand) 55%,var(--line2));transform:translateY(-1px)}
.sk-top{display:flex;align-items:center;gap:10px;min-width:0}
.sk-ico{--h:220;width:32px;height:32px;border-radius:10px;display:grid;place-items:center;flex:none;color:hsl(var(--h) 80% 72%);background:hsl(var(--h) 60% 50% / .14);border:1px solid hsl(var(--h) 60% 60% / .22)}
[data-theme=light] .sk-ico{color:hsl(var(--h) 60% 38%)}
.sk-ico svg.i{width:17px;height:17px}
.sk-ico.lg{width:52px;height:52px;border-radius:15px}.sk-ico.lg svg.i{width:26px;height:26px}
.sk-name{flex:1;min-width:0;font:600 13.5px var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sk-badge{flex:none;font-size:10.5px;font-weight:650;letter-spacing:.03em;padding:3px 7px;border-radius:999px}
.sk-badge.custom{background:color-mix(in srgb,var(--brand) 18%,transparent);color:var(--brand)}
[data-theme=dark] .sk-badge.custom{color:#9fb0ff}
.sk-desc{margin:0;font-size:13px;line-height:1.45;color:var(--text2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.9em}
.sk-foot{display:flex;align-items:center;gap:12px;font-size:11.5px;color:var(--muted)}
.sk-foot span{display:inline-flex;align-items:center;gap:4px}
.sk-foot svg.i{width:13px;height:13px}
.sk-when{margin-inline-start:auto}
.sk-empty{padding:40px 0;text-align:center;color:var(--muted)}
.sk-detail{max-width:820px;margin:0 auto}
.sk-back{display:inline-flex;align-items:center;gap:6px;margin:6px 0 14px;font-size:13px;color:var(--muted)}
.sk-back:hover{color:var(--text)} .sk-back svg.i{width:16px;height:16px}
[dir=rtl] .sk-back svg.i{transform:scaleX(-1)}
.sk-hero{display:flex;gap:16px;align-items:flex-start}
.sk-ht h1{margin:2px 0 6px;font:650 22px/1.2 var(--mono);overflow-wrap:anywhere}
.sk-ht p{margin:0;color:var(--text2);font-size:15px}
.sk-acts{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
.sk-acts button{display:inline-flex;align-items:center;gap:7px}.sk-acts svg.i{width:16px;height:16px}
.sk-meta{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:1px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--line)}
.sk-meta>div{display:flex;flex-direction:column;gap:2px;padding:10px 13px;background:var(--bg2)}
.sk-meta .k{font-size:11.5px;color:var(--muted)} .sk-meta .v{font-size:13.5px;color:var(--text)}
.sk-tags{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0 0}
.sk-tags span{font-size:12px;padding:3px 9px;border-radius:999px;background:var(--surf2);color:var(--text2)}
.sk-rel{display:flex;flex-wrap:wrap;align-items:center;gap:0;margin:14px 0 0}
.sk-rel .k{font-size:12px;color:var(--muted);margin-inline-end:10px;margin-bottom:10px}
.sk-rel .sk-chip{font-family:var(--mono)}
.sk-files{display:flex;gap:6px;overflow-x:auto;margin:20px 0 0;padding-bottom:2px;scrollbar-width:none}
.sk-file{flex:none;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 11px;border-radius:10px;border:1px solid var(--line);font:12.5px var(--mono);color:var(--text2)}
.sk-file svg.i{width:14px;height:14px}
.sk-file.on{background:var(--surf2);color:var(--text);border-color:var(--line2)}
.sk-doc{margin-top:14px;padding:20px 24px;border:1px solid var(--line);border-radius:16px;background:var(--surf)}
.sk-code{margin:0;font:12.5px/1.6 var(--mono);white-space:pre-wrap;word-break:break-word;color:var(--text2);direction:ltr;text-align:left}
@media (max-width:820px){.sk-grid{grid-template-columns:1fr}.sk-doc{padding:14px 15px}}
.sk-name{font-size:13px;letter-spacing:-.01em}
.sk-foot .sk-badge{padding:2px 7px;font-size:10.5px}
.sk-meta{display:flex;flex-wrap:wrap;gap:0;background:var(--bg2)}
.sk-meta>div{flex:1 1 150px;border-inline-end:1px solid var(--line);border-bottom:1px solid var(--line);margin:0 -1px -1px 0}
@media (max-width:820px){.sk-grid{gap:8px}.sk-card{padding:11px 12px 9px;gap:6px}.sk-desc{min-height:0;font-size:13px}.sk-ico{width:28px;height:28px;border-radius:9px}.sk-ico svg.i{width:15px;height:15px}}

/* voice draft chip */
.chip.vchip{padding:5px 30px 5px 5px;gap:8px}
.vcplay{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--brand);color:#fff;flex:none}
.vcplay:disabled{background:var(--surf2);color:var(--muted);animation:pulse 1.2s ease-in-out infinite}
.vcplay svg.i{width:14px;height:14px}
.chip.vchip.busy{opacity:1}
.chip.vchip .nm{font-variant-numeric:tabular-nums}
@keyframes pulse{50%{opacity:.45}}
#input.vfresh{animation:vfresh .9s ease-out}
@keyframes vfresh{from{background:color-mix(in srgb,var(--brand) 14%,transparent)}to{background:transparent}}
/* ---------- richer markdown ---------- */
.prose{line-height:1.62}
.prose strong{font-weight:650;color:var(--text)}
.prose h1,.prose h2,.prose h3{letter-spacing:-.01em}
.prose h2{font-size:1.14em;margin:1.4em 0 .5em}
.prose h3{font-size:1em;margin:1.2em 0 .4em;color:var(--text)}
.prose h4{font-size:.8em;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.prose>h2:first-child,.prose>h3:first-child{margin-top:.1em}
.prose li::marker{color:var(--muted)}
.prose ol>li::marker{font-variant-numeric:tabular-nums;font-weight:600}
.prose li>p{margin:.25em 0}
.prose ul ul,.prose ol ul,.prose ul ol{margin:.15em 0}
.prose blockquote{border-inline-start-color:var(--brand);background:color-mix(in srgb,var(--brand) 7%,transparent);border-radius:0 10px 10px 0;padding:.5em 1em}
.prose blockquote p{margin:.3em 0}
.prose table{border:1px solid var(--line);border-radius:12px;border-collapse:separate;border-spacing:0;width:max-content;max-width:100%}
.prose th,.prose td{border:0;border-bottom:1px solid var(--line);padding:8px 12px;vertical-align:top}
.prose th{font-size:12.5px;letter-spacing:.02em;color:var(--text2)}
.prose tr:last-child td{border-bottom:0}
.prose td+td,.prose th+th{border-inline-start:1px solid var(--line)}
.prose hr{margin:1.2em 0}
.prose p code,.prose li code,.prose td code{white-space:normal;word-break:break-word}
.prose th,.prose td{overflow-wrap:normal;word-break:normal;hyphens:manual}
.prose td{min-width:7.5em}
/* first column = row label: wraps (long labels used to stay on one line and squeeze every other column to a word per line on phones) */
.prose tr>:first-child{min-width:min(8.5em,34vw);font-weight:600}
@media (max-width:820px){.prose table{font-size:13.5px}.prose th,.prose td{padding:7px 10px}}
/* iOS keyboard: iOS ignores interactive-widget, so the app is sized to the visual viewport from JS (--vvh/--vvt) */
.app{bottom:auto;height:var(--vvh,100%);transform:translateY(var(--vvt,0px))}
html{overflow:hidden;overscroll-behavior:none}
html.kb,html.kb body{height:var(--vvh);}
/* login: same visual-viewport sizing, so the card centres in the space above the keyboard (the page itself never scrolls) */
.login{bottom:auto;height:var(--vvh,100%);transform:translateY(var(--vvt,0px));overflow-y:auto;overscroll-behavior:contain}
html.kb .login{place-items:center;padding-block:12px}
html.kb .login .logo-tile{width:64px;height:64px;border-radius:17px;animation:none}
html.kb .login-card{gap:10px}
html.kb .login-card p{margin-bottom:4px}
html.kb .composer{padding-bottom:8px}
html.kb .hint{display:none}
/* slash menu must sit above the empty-state logo (absolute → painted on top of the static menu) */
.slash{position:relative;z-index:5}
.main:has(#slash:not([hidden])) .empty{opacity:0;transition:opacity .12s}
html.kb .empty{inset:56px 0 96px}
@media (max-height:560px){.empty{gap:8px}.empty-t{font-size:21px}.empty svg,.empty .zenmark{max-height:44px}}

/* toasts: above the composer/keyboard, springy in, blur out */
/* stack (ui-sdk vars): newest in front, older ones peek out above it, all fan out on hover/focus */
ui-toast-region.toasts{position:fixed;left:50%;bottom:110px;translate:-50% 0;z-index:80;width:min(360px,calc(100vw - 32px));
  height:var(--toast-front-height,0px);transition:bottom var(--sp-snap-d) var(--sp-snap),height .3s var(--ease-out);pointer-events:none}
ui-toast-region.toasts[data-expanded]{height:calc(var(--toast-stack-height) + (var(--toast-count) - 1) * 8px)}
ui-toast.toast{--y:calc(var(--toast-index) * -7px);position:absolute;inset-inline:0;bottom:0;margin-inline:auto;width:max-content;max-width:100%;box-sizing:border-box;
  z-index:calc(100 - var(--toast-index));pointer-events:auto;overflow:hidden;text-align:center;cursor:pointer;user-select:none;-webkit-user-select:none;
  height:var(--toast-height);translate:var(--toast-swipe-x,0px) calc(var(--y) + var(--toast-swipe-y,0px));scale:calc(1 - var(--toast-index) * .05);
  background:color-mix(in srgb,var(--text) 92%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  transition:translate var(--sp-bouncy-d) var(--sp-bouncy),scale .4s var(--ease-out),opacity .26s var(--ease-out),filter .26s,height .3s var(--ease-out)}
ui-toast.toast:not([data-front]):not([data-expanded]){height:var(--toast-front-height)}
ui-toast.toast[data-expanded]{--y:calc(-1 * (var(--toast-offset) + var(--toast-index) * 8px));scale:1}
ui-toast.toast[data-starting-style]{transition:none;opacity:0;filter:blur(6px);--y:14px;scale:.92}
ui-toast.toast[data-ending-style]{opacity:0;filter:blur(4px);scale:.96;transition:opacity .2s var(--ease-in),filter .2s,scale .2s var(--ease-in),translate .2s var(--ease-in)}
ui-toast.toast[data-swiping]{transition:none}
ui-toast.toast ui-toast-title{display:block;white-space:normal}
@media (prefers-reduced-motion:reduce){ui-toast.toast{transition-property:opacity}}
.to-bottom{transition:bottom var(--sp-snap-d) var(--sp-snap),opacity .2s,transform var(--sp-bouncy-d) var(--sp-bouncy)}

/* ---------- bots ---------- */
.tab{padding-inline:4px;min-width:0}.tab span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bot-av.main{background:var(--surf2);border:1px solid var(--line2)}
.bot-av.main .zenmark{width:58%;height:58%}
.av.lg{width:46px;height:46px;font-size:16px}
.av.xl{width:72px;height:72px;font-size:24px;border-radius:22px}
.av.lg.bot-av,.av.md.bot-av{border-radius:14px}
.av.md.bot-av{border-radius:11px}
.av.xs.bot-av{border-radius:5px}
.add-av{background:transparent;border:1.5px dashed var(--line2);color:var(--muted)}
.add-av svg.i{width:18px;height:18px}
.bot-nav{padding-top:2px}
.bot-row{display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;border-radius:12px;text-align:start;color:var(--text2)}
.bot-row:hover{background:var(--surf2)}
.bot-row.on{background:color-mix(in srgb,var(--brand) 15%,var(--surf2));color:var(--text)}
.bot-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.bot-tx b{font-size:13.5px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bot-tx small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bot-row.add .bot-tx{font-size:13.5px;color:var(--muted)}
.bot-row.add:hover .bot-tx{color:var(--text)}
.bots-intro{max-width:640px;margin:6px 0 18px;color:var(--text2);font-size:14px;line-height:1.55}
.bot-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:12px}
.bot-card{display:flex;flex-direction:column;gap:10px;padding:16px;border-radius:18px;border:1px solid var(--line);background:var(--surf);text-align:start;cursor:pointer;transition:border-color .15s,transform .15s}
.bot-card:hover{border-color:color-mix(in srgb,var(--brand) 55%,var(--line2));transform:translateY(-1px)}
.bot-card.main{background:linear-gradient(160deg,color-mix(in srgb,var(--brand) 10%,var(--surf)),var(--surf) 60%)}
.bot-card.add{align-items:center;justify-content:center;gap:8px;border-style:dashed;background:transparent;min-height:190px;text-align:center}
.bot-card.add b{font-size:14.5px}
.bot-top{display:flex;align-items:center;gap:12px;min-width:0}
.bot-tt{display:flex;flex-direction:column;gap:2px;min-width:0}
.bot-tt b{font-size:16px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bot-handle{display:inline-flex;align-items:center;gap:5px;font-size:12.5px;color:var(--muted);flex-wrap:wrap}
.bot-handle svg.i{width:13px;height:13px;color:#2AABEE}
.bot-handle.lg{font-size:13.5px;gap:8px;margin:2px 0 8px}
.bot-handle a{display:inline-flex;align-items:center;gap:5px;color:var(--text2);text-decoration:none}
.bot-handle a:hover{color:var(--text)}
.bot-handle code{font:12px var(--mono);padding:1px 7px;border-radius:6px;background:var(--surf2);color:var(--text2)}
.bot-desc{margin:0;font-size:13.5px;line-height:1.5;color:var(--text2);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:3em}
.bot-stats{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12px;color:var(--muted)}
.bot-stats span{display:inline-flex;align-items:center;gap:4px}
.bot-stats svg.i{width:13px;height:13px}
.bot-acts{display:flex;gap:8px;margin-top:2px}
.bot-acts button,.sk-acts button{display:inline-flex;align-items:center;gap:7px}
.bot-acts svg.i{width:15px;height:15px}
.bot-hero{display:flex;gap:18px;align-items:flex-start}
.bot-hero .sk-ht h1{font-family:var(--font);font-size:24px}
.danger-t{color:#ef6b6b !important}
.bot-sec{margin:24px 0 8px}
.bot-none{margin:0}
.bot-chatlist{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surf)}
.bot-chatlist:empty{display:none}
.bot-chat{display:flex;align-items:center;gap:10px;padding:10px 14px;text-align:start;border-bottom:1px solid var(--line)}
.bot-chat:last-child{border-bottom:0}
.bot-chat:hover{background:var(--surf2)}
.bot-soul{margin-top:18px;border:1px solid var(--line);border-radius:14px;background:var(--surf)}
.bot-soul summary{display:flex;align-items:center;gap:8px;padding:12px 14px;cursor:pointer;font-size:13.5px;font-weight:600;list-style:none}
.bot-soul summary::-webkit-details-marker{display:none}
.bot-soul summary svg.i{width:16px;height:16px;color:var(--muted)}
.bot-soul .prose{padding:0 16px 14px;font-size:14px}
.bot-chip{display:inline-flex;align-items:center;gap:5px;margin-inline-end:6px;padding:1px 7px 1px 2px;border-radius:999px;background:var(--surf2);color:var(--text2);font-size:12px}
.bot-chip .av.xs{width:16px;height:16px;font-size:8px}
.bot-form{max-width:520px}
.bd-hero{display:flex;gap:14px;align-items:center;margin:2px 0 14px}
.bd-hero p{margin:0}
.fld{display:flex;flex-direction:column;gap:6px;margin:0 0 14px}
.fld>span{font-size:13px;font-weight:600;color:var(--text2)}
.fld input,.fld textarea{width:100%;box-sizing:border-box;padding:10px 12px;border-radius:12px;border:1px solid var(--line2);background:var(--bg2);color:var(--text);font:14px/1.45 var(--font);resize:vertical}
.fld textarea{min-height:110px}
.fld input:focus,.fld textarea:focus{outline:0;border-color:var(--brand)}
.fld small{font-size:12px}
@media (pointer:coarse){.fld input,.fld textarea{font-size:16px}}
.bd-err{margin:0 0 12px;padding:9px 12px;border-radius:10px;background:rgba(239,107,107,.12);color:#ef8b8b;font-size:13px}
.bd-acts{display:flex;align-items:center;gap:8px}.bd-acts .sp{flex:1}
@media (max-width:820px){.bot-grid{grid-template-columns:1fr}.bot-hero{gap:14px}.av.xl{width:60px;height:60px}}

.tabs{display:flex}
.tab{flex:1 1 0;transition:flex-grow var(--sp-pop-d) var(--sp-pop),transform var(--sp-snap-d) var(--sp-snap),background .2s,color .2s}
.tab.on{flex-grow:2.6}
.tab:not(.on) span{display:none}
.bot-page .sk-meta>div{flex-basis:30%}

/* bot switcher */
.bot-switch{display:flex;align-items:center;gap:10px;width:100%;margin:0 0 8px;padding:8px 10px 8px 8px;border-radius:14px;border:1px solid var(--line);background:var(--surf);text-align:start}
.bot-switch:hover{border-color:var(--line2);background:var(--surf2)}
.bot-switch .bot-tx small{font-size:11px;letter-spacing:.03em;text-transform:uppercase}
.bot-switch .cv svg.i{width:16px;height:16px;color:var(--muted)}
.bs-item{display:flex !important;align-items:center;gap:10px;width:100%;padding:7px 8px !important}
.bs-item .av.sm{width:30px;height:30px;margin:0;padding:0;font-size:11.5px}
.bs-item .bot-tx{min-width:0;flex:1}
.bs-item .bot-tx small{max-width:200px}
.bs-item.on{background:color-mix(in srgb,var(--brand) 14%,transparent)}
.bs-item .ck svg.i{width:16px;height:16px;color:var(--brand)}
.bs-manage{color:var(--muted)}
.main-badge{display:inline-flex;align-items:center;gap:5px;margin-inline-start:8px;padding:2px 8px;border-radius:999px;font-size:10.5px;font-weight:650;vertical-align:middle;background:color-mix(in srgb,var(--brand) 18%,transparent);color:#9fb0ff}
[data-theme=light] .main-badge{color:var(--brand)}
.main-badge.lg{margin:0;padding:6px 12px;font-size:12.5px}.main-badge svg.i{width:14px;height:14px}
.bs-item .bot-av.main .zenmark,.bot-switch .bot-av.main .zenmark{width:62%;height:62%;flex:none}
.menu .bot-av svg.zenmark{width:62% !important;height:62% !important}

/* ---------------- stats page ---------------- */
.st-page.noanim{animation:none}
.skview .to-bottom{display:none!important}
.st-top{gap:8px;flex-wrap:nowrap}
.sk-bar.st-top .z-seg{width:auto;flex:0 1 auto;display:inline-flex}
@media (max-width:820px){.sk-bar.st-top .z-seg{flex:1 1 auto}}
.st-top .st-upd{margin-inline-start:auto;font-variant-numeric:tabular-nums}
.st-rf.spin svg{animation:spin .7s linear infinite}
.st-ctl{display:flex;margin:4px 0 12px}
.st-seg{max-width:100%;overflow-x:auto;scrollbar-width:none}
.st-seg::-webkit-scrollbar{display:none}
.st-loading{padding:40px 0;text-align:center}
/* view loader (chat / Telegram / Skills / Bots / Stats) */
.vload{display:flex;justify-content:center;align-items:center;padding:72px 0;animation:vloadIn .3s var(--ease-out) .12s both}
.vload.big{min-height:46vh;padding:0}
.list>.vload:not(:only-child){display:none}
.vload>i{width:22px;height:22px;border-radius:50%;border:2.5px solid color-mix(in srgb,var(--brand) 20%,transparent);border-top-color:var(--brand);animation:spin .7s linear infinite}
@keyframes vloadIn{from{opacity:0}}
/* segmented-control thumb that glides between options */
.st-seg{position:relative}
.st-card{border:1px solid var(--line);background:var(--surf);border-radius:16px;padding:14px 16px;min-width:0}
.st-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.st-gauge{display:flex;flex-direction:column;gap:6px;padding:13px 14px 12px}
.st-lab{display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:600;color:var(--muted)}
.st-lab svg.i{width:15px;height:15px}
.st-big{font-size:26px;line-height:1.1;font-weight:650;letter-spacing:-.02em;font-variant-numeric:tabular-nums;text-align:start}
[dir=rtl] .st-big{text-align:end}
.st-sub{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.st-meter{height:6px;border-radius:99px;background:var(--bg2);overflow:hidden}
.st-meter.thin{height:4px;margin-top:6px}
.st-meter i{display:block;height:100%;border-radius:inherit;background:var(--brand);transition:width var(--sp-page-d) var(--sp-page)}
.st-meter.warn i{background:var(--warn)}
.st-meter.bad i{background:var(--red)}
.st-delta{margin-inline-start:auto;padding:1px 7px;border-radius:99px;font-size:11px;font-weight:650;font-variant-numeric:tabular-nums}
.st-delta.up{background:color-mix(in srgb,var(--red) 18%,transparent);color:var(--red)}
.st-delta.down{background:color-mix(in srgb,#5ec4a8 18%,transparent);color:#5ec4a8}
.st-sec{margin-bottom:12px}
.st-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.st-head h3,.st-sec>h3{margin:0;font-size:13px;font-weight:650;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);flex:1;min-width:0}
.st-head .z-seg [data-slot="segmented-control-item"]{padding:3px 9px;font-size:12px;min-height:26px}
.st-head .z-seg{display:inline-flex;flex:none}
.st-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}
.st-stack{display:flex;flex-direction:column;gap:12px}
.st-stack .st-sec,.st-cols>.st-sec{margin:0}
.st-row{padding:9px 0;border-top:1px solid var(--line)}
.st-head+.st-row{border-top:0;padding-top:2px}
.st-rt{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:10px;min-width:0}
.st-rt .st-meta{grid-row:2;grid-column:1;margin-top:1px}
.st-rt .st-val{grid-row:1;grid-column:2}
.st-rt .st-avs{grid-row:1/3;grid-column:2;align-self:center}
.st-rt:has(.st-avs){grid-template-columns:minmax(0,1fr) auto auto}
.st-rt:has(.st-avs) .st-val{grid-column:3}
.st-name{flex:1;min-width:0;font-size:14px;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.st-meta{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.st-val{font-size:13.5px;font-weight:650;font-variant-numeric:tabular-nums;white-space:nowrap}
.st-svc{display:inline-flex;align-items:center;gap:8px;min-width:0;max-width:100%}
.st-svc b{font-weight:600;overflow:hidden;text-overflow:ellipsis}
.st-desc{margin-top:2px;padding-inline-start:16px;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.st-dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--muted)}
.st-dot.ok{background:#5ec4a8;box-shadow:0 0 0 3px color-mix(in srgb,#5ec4a8 20%,transparent)}
.st-dot.bad{background:var(--red);box-shadow:0 0 0 3px color-mix(in srgb,var(--red) 22%,transparent)}
.st-dot.off{background:var(--line2)}
.st-empty{padding:18px 4px;text-align:center;color:var(--muted);font-size:13px}
.st-note{margin:12px 2px 0;font-size:12px;line-height:1.5;color:var(--muted)}
/* charts */
.st-chart{position:relative}
.st-legend{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;min-height:20px;margin-bottom:8px;font-size:12.5px;font-weight:600;font-variant-numeric:tabular-nums}
.st-legend .cpu::before,.st-legend .mem::before{content:"";display:inline-block;width:8px;height:8px;border-radius:2px;margin-inline-end:6px;background:var(--brand)}
.st-legend .mem::before{background:var(--warn)}
.st-legend .when{min-width:44px;font-weight:550}
.st-legend .net{font-weight:500;margin-inline-start:auto}
.st-plot{display:flex;gap:6px;height:150px;touch-action:pan-y;cursor:crosshair}
.st-pin{position:relative;flex:1;min-width:0}
svg.st-svg{display:block;width:100%;height:100%;overflow:visible;stroke:none;fill:none}
.st-gl{stroke:var(--line);stroke-width:1;vector-effect:non-scaling-stroke;stroke-dasharray:3 4}
.st-ln{fill:none;stroke-width:2;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}
.st-ln.cpu{stroke:var(--brand)}
.st-ln.mem{stroke:var(--warn)}
.st-area.cpu{fill:color-mix(in srgb,var(--brand) 18%,transparent)}
.st-cursor{position:absolute;top:0;bottom:0;width:1px;background:var(--text2);pointer-events:none;transform:translateX(-.5px)}
.st-yax{width:30px;flex:none;display:flex;flex-direction:column;justify-content:space-between;font-size:10px;color:var(--muted);text-align:end;pointer-events:none}
.st-yax span{line-height:1}.st-yax span:first-child{transform:translateY(-50%)}.st-yax span:last-child{transform:translateY(50%)}
.st-xax{display:flex;justify-content:space-between;margin-top:6px;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.st-plot~.st-xax{padding-inline-start:36px}
.st-bars{display:flex;align-items:flex-end;gap:3px;height:130px}
.st-bcol{flex:1 1 0;min-width:0;height:100%;display:flex;align-items:flex-end;border-radius:4px;padding:0}
.st-bstack{width:100%;display:flex;flex-direction:column-reverse;border-radius:4px 4px 2px 2px;overflow:hidden;opacity:.9;transition:opacity .15s,height var(--sp-page-d) var(--sp-page)}
.st-bstack i{display:block;flex-basis:0;min-height:1px}
.st-bars:hover .st-bstack,.st-bars:has(.on) .st-bstack{opacity:.45}
.st-bcol.on .st-bstack,.st-bcol:hover .st-bstack{opacity:1}
.st-ulegend{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:10px;font-size:12.5px;color:var(--text2)}
.st-ulegend span{display:inline-flex;align-items:center;gap:6px}
.st-sw{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none}
/* telegram entities */
.st-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:10px}
.st-ent{display:flex;flex-direction:column;gap:8px}
.st-ehead{display:flex;align-items:center;gap:11px;min-width:0}
.st-etx{flex:1;min-width:0;display:flex;flex-direction:column}
.st-etx b{font-size:15px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.st-eval{display:flex;flex-direction:column;align-items:flex-end;text-align:end}
.st-eval b{font-size:17px;font-weight:700;font-variant-numeric:tabular-nums}
.st-av{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;flex:none;color:#fff;font-size:12px;font-weight:700;letter-spacing:.02em}
.st-avs{display:inline-flex;flex:none}
.st-avs .st-av{border:2px solid var(--surf);margin-inline-start:-6px}
.st-avs .st-av:first-child{margin-inline-start:0}
.st-k{margin-top:4px;font-size:11px;font-weight:650;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.st-stackbar{display:flex;gap:2px;height:8px;border-radius:99px;overflow:hidden}
.st-stackbar i{display:block;flex-basis:0;min-width:3px}
.st-kv{display:flex;flex-direction:column;gap:3px;font-size:13px}
.st-kv>div{display:flex;align-items:center;gap:8px;min-width:0}
.st-kv span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text2)}
.st-kv em{font-style:normal;font-weight:600;font-variant-numeric:tabular-nums}
.st-chips{display:flex;flex-wrap:wrap;gap:6px}
.st-chips span{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 8px;border-radius:99px;background:var(--bg2);border:1px solid var(--line);font-size:12.5px;color:var(--text2)}
.st-chips svg.i{width:14px;height:14px}
.st-chips b{font-weight:650;color:var(--text);font-variant-numeric:tabular-nums}
.st-wi{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:8px;background:var(--bg2);border:1px solid var(--line);color:var(--muted)}
.st-wi svg.i{width:14px;height:14px}
.st-topic{border-top:1px solid var(--line);padding:9px 0 2px}
.st-topic summary{list-style:none;cursor:pointer}
.st-topic summary::-webkit-details-marker{display:none}
.st-topic[open] summary .st-name{color:var(--brand)}
[data-theme=dark] .st-topic[open] summary .st-name{color:var(--sage)}
.st-dgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin:10px 0 6px;padding:10px 12px;border-radius:12px;background:var(--bg2);font-size:12.5px}
.st-dgrid>div{display:flex;flex-direction:column;min-width:0}
.st-dgrid .wide{grid-column:1/-1}
.st-dgrid span{color:var(--muted);font-size:11.5px}
.st-dgrid b{font-weight:600;overflow-wrap:break-word}
.st-nav .tp-time{font-weight:600}
@media (max-width:980px){.st-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.st-cols{grid-template-columns:minmax(0,1fr)}}
@media (max-width:820px){
  .st-card{padding:12px 13px;border-radius:14px}
  .st-gauge{padding:11px 12px}
  .st-big{font-size:22px}
  .st-list{grid-template-columns:minmax(0,1fr)}
  .st-plot{height:130px}
  .st-bars{height:110px;gap:2px}
  .st-top .st-upd{display:none}
  .st-top .st-rf{margin-inline-start:auto}
  .st-ctl .z-seg{width:100%}
}

/* ---------------- model picker ---------------- */
.model-pill{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:100%;padding:0 2px;margin-inline-start:-2px;border-radius:6px;color:var(--muted);font-size:12.5px;line-height:16px;transition:color .15s}
.model-pill:hover,.model-pill:active{color:var(--text)}
.model-pill .mp-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.model-pill .mp-tag{display:inline-flex;align-items:center;padding:0 6px;border-radius:99px;background:var(--surf2);font-size:10.5px;font-weight:600;line-height:15px;color:var(--text2)}
.model-pill .mp-tag.fast{padding:0 4px;color:var(--warn)}
.model-pill .mp-tag svg{width:11px;height:11px}
.model-pill .mp-chev{display:inline-flex}.model-pill .mp-chev svg{width:12px;height:12px}
.menu.mp-menu{width:min(340px,calc(100vw - 16px));max-width:none;max-height:min(72vh,620px);overflow-y:auto;overscroll-behavior:contain;padding-bottom:0}
.mp-h{padding:12px 10px 4px;font-size:11px;font-weight:650;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.menu .mp-row{padding:7px 10px}
.mp-row .stack{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.mp-row .stack small{font-size:11px}
.mp-row .ck{display:inline-flex;color:var(--brand)}
[data-theme=dark] .mp-row .ck{color:var(--sage)}
.menu .mp-more{padding:6px 10px;font-size:13px;color:var(--brand)}
[data-theme=dark] .menu .mp-more{color:var(--sage)}
.mp-opts{position:sticky;bottom:0;margin:6px -5px 0;padding:10px 12px 12px;border-top:1px solid var(--line);background:var(--surf);display:flex;flex-direction:column;gap:10px}
.mp-opt{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13.5px;cursor:pointer}
.mp-opt .stack{display:flex;flex-direction:column;line-height:1.3}.mp-opt .stack small{font-size:11px}
.mp-note{margin:0;font-size:11.5px;line-height:1.4;color:var(--muted)}

/* ================= motion (see static/motion.js) ================= */
@keyframes msgT{from{transform:translateY(16px) scale(.97)}}
@keyframes msgF{from{opacity:0;filter:blur(8px)}}
@keyframes pageT{from{transform:translateY(18px) scale(.985)}}
@keyframes pageF{from{opacity:0}}
@keyframes cardT{from{transform:translateY(14px) scale(.95)}}
@keyframes cardF{from{opacity:0;filter:blur(5px)}}
@keyframes popT{from{transform:scale(.6)}}
@keyframes popF{from{opacity:0}}
.msg.user{transform-origin:100% 100%}[dir=rtl] .msg.user{transform-origin:0 100%}
.msg.bot{transform-origin:0 0}[dir=rtl] .msg.bot{transform-origin:100% 0}
/* live additions inside a turn: tool cards, system cards, attachments */
.tool,.sys,.proc,.appr{animation:cardT var(--sp-bouncy-d) var(--sp-bouncy) both,cardF .24s var(--ease-out) both}
/* rendering a whole history (or a refresh) must not replay every entrance */
.list.hist .msg,.list.hist .tool,.list.hist .sys,.list.hist .proc,.list.hist .appr,.st-page.noanim *:not(.vload,.vload>i){animation:none!important}
/* cards arrive one after another on Skills / Bots / Stats */
.sk-grid>*,.bot-grid>*,.st-grid>*,.st-list>*,.st-cols>*,.st-sec{animation:cardT var(--sp-bouncy-d) var(--sp-bouncy) both,cardF .3s var(--ease-out) both}
.sk-grid>:nth-child(2),.bot-grid>:nth-child(2),.st-grid>:nth-child(2),.st-list>:nth-child(2){animation-delay:30ms}
.sk-grid>:nth-child(3),.bot-grid>:nth-child(3),.st-grid>:nth-child(3),.st-list>:nth-child(3){animation-delay:60ms}
.sk-grid>:nth-child(4),.bot-grid>:nth-child(4),.st-grid>:nth-child(4),.st-list>:nth-child(4){animation-delay:90ms}
.sk-grid>:nth-child(5),.bot-grid>:nth-child(5),.st-list>:nth-child(5){animation-delay:120ms}
.sk-grid>:nth-child(6),.bot-grid>:nth-child(6),.st-list>:nth-child(6){animation-delay:150ms}
.sk-grid>:nth-child(7),.st-list>:nth-child(7){animation-delay:175ms}
.sk-grid>:nth-child(8),.st-list>:nth-child(8){animation-delay:200ms}
.sk-grid>:nth-child(n+9){animation-delay:220ms}
.st-cols>:nth-child(2){animation-delay:80ms}
.sk-sec+.sk-sec .sk-grid>*{animation-delay:120ms}
/* only what's on screen first gets an entrance: off-screen cards animating blur just costs frames */
.sk-grid>:nth-child(n+9),.sk-sec:nth-of-type(n+3) .sk-grid>*,.st-list>:nth-child(n+9),.bot-grid>:nth-child(n+9){animation:none}
/* touch feedback: things you press give a little and spring back */
.icon-btn,.send,.primary,.ghost,.danger,.pill,.model-pill,.seg button,.sk-card,.bot-card,.sk-cat,.bot-row,.chat,.sl-item,.menu button,.menu ui-menu-item,.chip,.st-bcol,.vplay,.vcplay,.sk-back,.sk-chip,.bot-switch,.mp-more{
  transition:transform var(--sp-snap-d) var(--sp-snap),background-color .15s,color .15s,border-color .15s,opacity .15s,box-shadow .2s}
.icon-btn:active,.send:active,.pill:active,.model-pill:active,.vplay:active,.vcplay:active,.to-bottom:active,.sl-item:active,.menu button:active,.menu ui-menu-item:active,.chip:active,.sk-back:active,.sk-chip:active,.mp-more:active{transform:scale(.92);transition-duration:.08s}
.primary:active,.ghost:active,.danger:active,.tab:active,.seg button:active,.sk-cat:active,.bot-row:active,.chat:active,.bot-switch:active{transform:scale(.97);transition-duration:.08s}
.sk-card:active,.bot-card:active{transform:scale(.98);transition-duration:.1s}
.send:not(:disabled){animation:popT var(--sp-bouncy-d) var(--sp-bouncy),popF .15s var(--ease-out)}
/* backdrop of every dialog fades in (motion.js also fades it out) */
dialog[open]::backdrop{transition:opacity .25s var(--ease-out)}
@starting-style{dialog[open]::backdrop{opacity:0}}
/* dialog handing over to another (Settings -> Keys): the new backdrop starts fully dark, the old one is dropped (motion.js) */
dialog.zhand-in[open]::backdrop{transition:none}
@starting-style{dialog.zhand-in[open]::backdrop{opacity:1}}
/* bars + chart reveal on Stats */
.st-plot .st-pin{animation:chartIn .9s var(--ease-out) both}
@keyframes chartIn{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@starting-style{.st-meter i{width:0!important}}
/* drawer being dragged follows the finger exactly */
.side.dragging,.scrim.dragging{transition:none!important}
@media (prefers-reduced-motion: reduce){
  .msg,.tool,.sys,.proc,.appr,.sk-page,.sk-grid>*,.bot-grid>*,.st-grid>*,.st-list>*,.st-cols>*,.st-sec,.send,.st-plot .st-pin{animation:popF .15s linear both!important}
  .icon-btn:active,.send:active,.primary:active,.ghost:active,.tab:active,.chat:active,.sk-card:active,.bot-card:active{transform:none}
}
.q{animation:none!important}
.st-page.noanim .st-meter i,.st-page.noanim .st-bstack{transition:none}
@starting-style{.st-bstack{height:0!important}}
/* horizontal swipes belong to the drawer gesture; vertical scroll + pinch stay native. Must sit on the
   scroll containers themselves: touch-action does not inherit past a scroll container. */
@media (max-width:820px){.main,.scroller,.side,.side-scroll,.scrim{touch-action:pan-y pinch-zoom}}
.mp-chev svg,.bot-switch .cv svg{transition:transform var(--sp-pop-d) var(--sp-pop)}
.menu-open .mp-chev svg,.bot-switch.menu-open .cv svg{transform:rotate(180deg)}
.model-pill.menu-open{color:var(--text)}

/* ---------------- artifacts (HTML side panel) ---------------- */
.art-card{display:flex;align-items:center;gap:12px;max-width:min(100%,460px);margin:.7em 0;padding:10px 12px 10px 10px;border:1px solid var(--line2);border-radius:14px;background:var(--surf);cursor:pointer;transition:border-color .15s,background .15s,transform .15s;text-align:start}
.art-card:hover{background:var(--surf2);border-color:color-mix(in srgb,var(--text) 22%,var(--line2))}
.art-card:active{transform:scale(.99)}
.art-card:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.art-card.on{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 9%,var(--surf))}
.art-ic{width:40px;height:40px;flex:none;display:grid;place-items:center;border-radius:10px;background:var(--surf2);border:1px solid var(--line);color:var(--text2)}
.art-card.on .art-ic{color:var(--brand)}
.art-meta{display:flex;flex-direction:column;min-width:0;flex:1;line-height:1.3}
.art-meta b{font-weight:600;font-size:14px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.art-meta span{font-size:12px;color:var(--muted)}
.art-open{flex:none;font-size:12.5px;font-weight:600;padding:6px 12px;border-radius:9px;border:1px solid var(--line2);color:var(--text)}
.art-card.on .art-open{border-color:transparent;background:var(--brand);color:#fff}
li > .art-card{margin:.45em 0 .2em}

.app{--artw:min(50vw,820px)}
.art{position:relative;flex:none;width:var(--artw);min-width:360px;max-width:calc(100vw - var(--side) - 360px);display:flex;flex-direction:column;background:var(--bg2);border-inline-start:1px solid var(--line);padding-top:env(safe-area-inset-top)}
.art-head{display:flex;align-items:center;gap:6px;padding:10px 10px 10px 14px;border-bottom:1px solid var(--line);min-height:56px}
.art-hic{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:8px;background:var(--surf2);color:var(--text2)}
.art-hic svg{width:17px;height:17px}
.art-ht{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25;margin-inline-start:4px}
.art-ht b{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.art-body{flex:1;min-height:0;position:relative;background:#fff}
.art-body iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#fff}
.art-grip{position:absolute;inset-block:0;inset-inline-start:-4px;width:8px;cursor:col-resize;z-index:2}
.art-grip:hover,.art-drag .art-grip{background:color-mix(in srgb,var(--brand) 45%,transparent)}
.art-drag,.art-drag *{user-select:none;cursor:col-resize}
.art-drag .art-body iframe{pointer-events:none}
.art:fullscreen{padding-top:0;width:100vw;max-width:none}
@media (max-width:1100px){.art{min-width:320px;max-width:calc(100vw - var(--side) - 300px)}}
@media (max-width:820px){
  .art{position:fixed;inset:0;z-index:60;width:auto;min-width:0;max-width:none;border:0;padding-top:env(safe-area-inset-top)}
  .art-head{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  .art-body{padding-bottom:env(safe-area-inset-bottom);background:#fff}
  .art-grip,.art-fs{display:none}
  .art-head .icon-btn{width:44px;height:44px}
}

/* ---------------- v83: sidebar toggle, artifact maximize, voice-send ---------------- */
.only-desk{display:inline-grid}
@media (max-width:820px){.only-desk{display:none!important}}
@media (min-width:821px){
  .side{transition:margin .32s var(--ease-out),visibility 0s}
  .app.side-off .side{margin-inline-start:calc(-1 * var(--side));visibility:hidden;transition:margin .32s var(--ease-out),visibility 0s .32s}
  .app.side-off .art{max-width:calc(100vw - 360px)}
  .app.art-max .art{position:fixed;inset:0;z-index:55;width:auto;max-width:none;min-width:0;border:0}
  .app.art-max .art-grip{display:none}
  #sideBtn{margin-inline-end:2px}
}
.send.vsend{width:36px;height:36px;background:var(--brand);color:#fff}
.send.vsend svg.i{width:19px;height:19px;stroke-width:2}
.send.vsend:hover{opacity:.9}

/* keys store */
.keys-form{max-width:520px}
.ky-intro{margin:0 0 12px}
.ky-list{display:flex;flex-direction:column;gap:8px;margin:0 0 18px}
.ky-row{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line2);border-radius:14px;background:var(--bg2)}
.ky-ic{flex:none;width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:color-mix(in srgb,var(--brand) 16%,transparent);color:var(--brand)}
.ky-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.ky-top{display:flex;align-items:center;gap:8px;min-width:0}
.ky-top b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ky-st{flex:none;font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:99px;background:var(--surf2);color:var(--text2)}
.ky-st.ok{background:rgba(94,196,168,.14);color:#4fb898}
.ky-st.expired,.ky-st.invalid{background:rgba(239,107,107,.12);color:#ef8b8b}
.ky-st.unknown{background:rgba(217,163,91,.14);color:#d9a35b}
.ky-meta,.ky-arn{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ky-arn{opacity:.8}
.ky-acts{display:flex;gap:2px;flex:none}
.ky-empty{padding:14px;border:1px dashed var(--line2);border-radius:14px;font-size:13px;text-align:center}
.ky-h{margin:0 0 10px;font-size:15px}
.ky-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#kyPaste{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;min-height:118px;-webkit-text-security:none}
.ky-detect.ky-found{color:var(--text2)}
@media (pointer:coarse){#kyPaste{font-size:16px}}
#kyPaste{word-break:break-all}

/* ---------- tool rows: service logos (AWS, GitHub, Gmail…) ---------- */
.tool .svc.i{width:15px;height:15px;flex:none}
.svct{width:20px;height:20px;flex:none;display:inline-grid;place-items:center;border-radius:6px;
  background:color-mix(in srgb,var(--c,var(--text)) 15%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--c,var(--text)) 22%,transparent)}
.svct .svc{width:13px;height:13px}
.svct.aws{background:#232F3E;box-shadow:none}.svct.aws .svc{width:19px;height:19px;color:#fff}
.svc.svb{fill:var(--c,currentColor);stroke:none;color:var(--text)}
.fold .svcs .svct{width:18px;height:18px;border-radius:5px}.fold .svcs .svct .svc{width:12px;height:12px}.fold .svcs .svct.aws .svc{width:17px;height:17px}
.svc.i{color:var(--text2)}
.tool .nm.lbl{font-family:var(--font);font-weight:600;font-size:13px;white-space:nowrap}
.tool[data-svc]:not([data-svc=""]) .nm.lbl{color:var(--text)}
.tool.fail .nm.lbl{color:var(--red)}
.fold .svcs{display:inline-flex;gap:3px;align-items:center;flex:none}

/* ---------- Apps ---------- */
.ap-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.ap-card{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--surf);text-align:start;transition:border-color .15s,background .15s}
.ap-card:hover{border-color:var(--line2);background:var(--surf2)}
.ap-ico{width:46px;height:46px;flex:none;display:grid;place-items:center;border-radius:13px;background:var(--brand);color:#fff}
.ap-ico svg.i{width:24px;height:24px}
.ap-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;line-height:1.3}.ap-tx b{font-size:15px;font-weight:650}
.ap-go svg.i{width:18px;height:18px;color:var(--muted)}
[dir=rtl] .ap-go svg.i{transform:scaleX(-1)}
/* Split */
.ap-page{max-width:720px}
.sp-drop{width:100%;display:flex;flex-direction:column;align-items:center;gap:4px;margin:0 0 12px;padding:34px 16px;border:1.5px dashed var(--line2);border-radius:18px;background:var(--surf);color:var(--text);text-align:center;transition:border-color .15s,background .15s}
.sp-drop:hover,.sp-drop.over{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 7%,var(--surf))}
.sp-drop b{font-size:15px}
.sp-plus{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--brand);color:#fff;margin-bottom:6px}
.sp-plus svg.i{width:24px;height:24px}
.sp-drop.small{flex-direction:row;gap:12px;padding:10px 12px;border-style:solid;border-width:1px;border-color:var(--line);text-align:start}
.sp-thumb{width:44px;height:44px;flex:none;border-radius:9px;object-fit:cover;background:#000}
.sp-dtx{display:flex;flex-direction:column;min-width:0;line-height:1.3}.sp-dtx b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sp-card{margin-bottom:12px}
.sp-prev{position:relative;max-width:100%;margin:0 auto;border-radius:10px;overflow:hidden;background:#000}
.sp-prev img{position:absolute;inset:0;width:100%;height:100%;display:block}
.sp-grid{position:absolute;inset:0;display:grid}
.sp-grid i{position:relative;border:1px solid color-mix(in srgb,var(--brand) 85%,#fff);box-shadow:inset 0 0 0 1px rgba(0,0,0,.35)}
.sp-grid em,.sp-tile em{position:absolute;top:5px;inset-inline-start:5px;font-style:normal;font-size:10.5px;font-weight:700;background:rgba(0,0,0,.62);color:#fff;border-radius:8px;padding:1px 6px}
.sp-info{margin-top:8px;text-align:center}
.sp-lab{display:block;margin:12px 0 6px;font-size:11px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.sp-ctl>.sp-lab:first-child{margin-top:0}
.sp-steps{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sp-step{padding:8px 10px;border-radius:12px;background:var(--bg2);border:1px solid var(--line)}
.sp-step .sp-lab{margin:0 0 4px}
.sp-srow{display:flex;align-items:center;justify-content:space-between}
.sp-srow .icon-btn{width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:var(--surf2)}
.sp-val{font-size:19px;font-variant-numeric:tabular-nums}
.sp-bgrow{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
.sp-bgrow[hidden]{display:none}
.sp-colors{display:flex;align-items:center;gap:7px}
.sp-sw{width:26px;height:26px;border-radius:50%;border:1px solid var(--line2)}
.sp-sw.on{box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--brand)}
.sp-pickc{width:30px;height:30px;padding:0;border:0;background:none;cursor:pointer}
.sp-go{width:100%;padding:13px 0;border-radius:14px;font-weight:650;font-size:15px}
.ghost.sp-go{border:1px solid var(--line2)}
.sp-status{margin:10px 0;text-align:center;font-family:var(--mono)}
.sp-tiles{display:flex;gap:8px;overflow-x:auto;padding:2px 0 12px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.sp-tile{flex:none;width:min(38%,170px);position:relative;scroll-snap-align:start;padding:0;border-radius:10px}
.sp-tile img{width:100%;display:block;border-radius:10px;border:1px solid var(--line)}
.sp-acts{display:flex;flex-direction:column;gap:8px}
.sp-tip{margin-top:8px;text-align:center}
@media (min-width:821px){.sp-acts{flex-direction:row}.sp-tile{width:150px}}

/* reply-to-selection floating button */
.sel-reply{position:fixed;z-index:70;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 13px 0 10px;border-radius:999px;
  background:var(--brand);color:#fff;font-size:13.5px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.08) inset;
  -webkit-user-select:none;user-select:none;touch-action:manipulation}
.sel-reply[hidden]{display:none}
.sel-reply svg.i{width:16px;height:16px}
.sel-reply:active{transform:scale(.95)}
@media (pointer:coarse){.sel-reply{height:38px;font-size:14.5px}}

/* Passport photos */
.pp-note{margin-top:8px;line-height:1.45}
.pp-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.pp-head .sp-lab{margin:0}
.pp-guide{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text2);cursor:pointer}
.pp-slots{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:10px}
.pp-slot{display:block;min-width:0}.pp-slot>*+*{margin-top:6px}
.pp-stop{display:flex;align-items:baseline;justify-content:space-between;gap:6px}.pp-stop b{font-size:13.5px}
/* height from padding, not aspect-ratio: Safari mis-sized aspect-ratio frames inside the grid */
.pp-frame{position:relative;height:0;padding-top:128.5714%;border-radius:8px;overflow:hidden;background:#fff;border:1px solid var(--line2);touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
.pp-frame:active{cursor:grabbing}
.pp-frame.pp-empty{background:var(--bg2);border-style:dashed;cursor:default;touch-action:auto}
.pp-frame.over{border-color:var(--brand)}
.pp-crop{position:absolute;inset:0;width:100%;height:100%;display:block}
.pp-add{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--text2);font-size:13px;font-weight:600;cursor:pointer}
.pp-plus{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:var(--brand);color:#fff}.pp-plus svg.i{width:22px;height:22px}
.pp-guideov{position:absolute;inset:0;pointer-events:none}
.noguide .pp-guideov{display:none}
.pp-oval{position:absolute;left:18%;right:18%;top:8.9%;bottom:15.6%;border:1.5px dashed rgba(58,87,241,.9);border-radius:50%}
.pp-l{position:absolute;left:0;right:0;height:0;border-top:1.5px solid rgba(239,80,80,.85)}
.pp-l.top{top:8.9%}.pp-l.chin{top:84.4%}
.pp-zoom{display:flex;align-items:center;gap:6px}.pp-zoom .z-slider{flex:1;min-width:0}
.pp-zoom .icon-btn{width:30px;height:30px}.pp-zoom .icon-btn svg.i{width:15px;height:15px}
.pp-sacts{display:flex;gap:6px}.pp-btn{flex:1;display:block;text-align:center;padding:6px 0;border:1px solid var(--line2);border-radius:9px;font-size:12.5px;color:var(--text);cursor:pointer;background:none}
.pp-btn:hover{background:var(--surf2)}
.pp-hint{margin-top:10px;line-height:1.45}
.pp-pv{display:flex;justify-content:center;background:var(--bg2)}
.pp-sheet{display:block;border-radius:3px;box-shadow:0 6px 24px rgba(0,0,0,.35)}
.sp-go:disabled{opacity:.45}
@media (max-width:820px){.pp-slots{grid-template-columns:1fr 1fr}}

/* visually hidden but still clickable through its <label> (display:none inputs break the picker in Safari) */
.vh{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important;opacity:0}
.sp-drop{cursor:pointer;position:relative}

/* ---------------- file cards + PDF viewer ---------------- */
.fcard{display:flex;align-items:center;gap:2px;max-width:min(100%,380px);margin:.6em 0;padding:5px;border:1px solid var(--line2);border-radius:14px;background:var(--surf)}
.atts .fcard{margin:0}
.fc-main{display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:4px 6px 4px 4px;border:0;border-radius:10px;background:none;color:inherit;font:inherit;text-align:start;text-decoration:none;cursor:pointer;transition:background .15s}
.fc-main:hover{background:var(--surf2)}
.fc-main:active{transform:scale(.99)}
.fc-ic{width:40px;height:40px;flex:none;display:grid;place-items:center;border-radius:10px;background:var(--surf2);border:1px solid var(--line);color:var(--text2)}
.fc-pdf .fc-ic,.art.pdf .art-hic{background:#E5484D;border-color:transparent;color:#fff}
.fc-ic b,.art-hic b{font-size:10.5px;font-weight:700;letter-spacing:.03em}
.fc-meta{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.fc-meta b{font-weight:600;font-size:14px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fc-sub{font-size:12px;color:var(--muted)}
.fc-act{flex:none}
.art-pdf{display:none}
.art.pdf .art-body{background:color-mix(in srgb,var(--bg2) 70%,#808080)}
.art.pdf .art-body iframe{display:none}
.art.pdf .art-pdf{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:12px 12px calc(16px + env(safe-area-inset-bottom))}
.pdf-pg{flex:none;width:100%;max-width:900px;background:#fff;border-radius:2px;box-shadow:0 1px 4px rgba(0,0,0,.28)}
.pdf-pg canvas{display:block;width:100%;height:100%}
.pdf-msg{margin:auto;color:var(--text2);font-size:14px}
@media (pointer:coarse){.fc-act{width:42px;height:42px}}

/* menus + popovers (ui-sdk): pop from the anchor like before (spring in, quick out) */
:is(ui-menu-content,ui-popover-content).menu{transform-origin:var(--transform-origin);transition:opacity .17s var(--ease-out),scale var(--sp-pop-d) var(--sp-pop),translate var(--sp-pop-d) var(--sp-pop)}
:is(ui-menu-content,ui-popover-content).menu:is([data-starting-style],[data-ending-style]){opacity:0;scale:.86;translate:0 -6px}
:is(ui-menu-content,ui-popover-content).menu[data-side=top]:is([data-starting-style],[data-ending-style]){translate:0 6px}
:is(ui-menu-content,ui-popover-content).menu[data-ending-style]{transition:opacity .15s var(--ease-in),scale .15s var(--ease-in),translate .15s var(--ease-in)}
.menu.mp-menu .z-seg [data-slot="segmented-control-item"]{padding:4px 7px;font-size:12px;min-height:26px;flex:none}
@media (prefers-reduced-motion:reduce){:is(ui-menu-content,ui-popover-content).menu{transition:opacity .12s}:is(ui-menu-content,ui-popover-content).menu:is([data-starting-style],[data-ending-style]){scale:none;translate:none}}
.sk-bar>.z-seg{display:inline-flex;flex:none}
@media (max-width:820px){.sk-bar>.z-seg{width:100%;box-sizing:border-box}}
@media (hover:none){.menu ui-menu-item:hover:not(:focus-visible){background:none}.menu ui-menu-item.on:hover{background:color-mix(in srgb,var(--brand) 14%,transparent)}}

/* editing a sent message: the bubble being replaced is marked, the bar reads "Editing message" */
.msg.user.editing .bubble{outline:2px solid var(--brand);outline-offset:2px}
.reply-bar.is-edit .rb-body{cursor:default}

/* ---------- Print Studio (passport + scanner) ---------- */
.pr-tabs{margin:0 0 12px}
.pr-seg{display:flex}
.sc-addrow{display:flex;gap:8px}
.sc-addbtn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:13px 0;border-radius:14px;font-weight:650;font-size:15px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.sc-addbtn.ghost{border:1px solid var(--line2)}
.sc-addico{display:inline-grid;place-items:center}.sc-addico svg.i{width:19px;height:19px}
.sc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px;margin-top:10px}
@media (max-width:820px){.sc-grid{grid-template-columns:1fr 1fr}}
.sc-none{grid-column:1/-1;padding:18px 0;text-align:center}
.sc-page{min-width:0}
.sc-thumb{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:3/4;border-radius:10px;background:var(--bg2);border:1px solid var(--line);overflow:hidden;padding:6px}
.sc-thumb .sc-tcv{max-width:100%;max-height:100%;width:auto;height:auto;display:block;box-shadow:0 2px 10px rgba(0,0,0,.25);background:#fff}
.sc-no{position:absolute;left:6px;top:6px;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:rgba(0,0,0,.55);color:#fff;font-size:11.5px;font-weight:650;display:grid;place-items:center}
.sc-warn{position:absolute;right:6px;top:6px;width:24px;height:24px;border-radius:50%;background:var(--warn);color:#000;display:grid;place-items:center}.sc-warn svg.i{width:14px;height:14px}
.sc-spin{width:22px;height:22px;border-radius:50%;border:2.5px solid var(--line2);border-top-color:var(--brand);animation:spin .8s linear infinite}
.sc-pacts{display:flex;justify-content:space-between;margin-top:4px}
.sc-pacts .icon-btn{width:30px;height:30px}.sc-pacts .icon-btn svg.i{width:16px;height:16px}.sc-pacts .icon-btn:disabled{opacity:.3}
[dir=rtl] .sc-dir svg.i{transform:scaleX(-1)}
.sc-opts .z-seg{display:flex}
.sc-opts .z-seg.inline{display:inline-flex}
.sc-seg [data-slot="segmented-control-item"]{padding-inline:6px;font-size:12.5px}
.sc-pv{background:var(--bg2)}
.sc-sheets{display:flex;gap:12px;overflow-x:auto;padding:4px 2px 8px;scrollbar-width:thin}
.sc-sheet{flex:none;display:block;border-radius:2px;box-shadow:0 4px 16px rgba(0,0,0,.3)}
.sc-pvinfo{margin-top:6px}
/* corner editor */
.sc-msg{margin:2px 0 10px}
.sc-stage{position:relative;display:flex;justify-content:center;touch-action:none;user-select:none;-webkit-user-select:none}
.sc-box{position:relative}
.sc-img{display:block;width:100%;height:100%;border-radius:4px}
.sc-ov{position:absolute;inset:0;width:100%;height:100%;overflow:visible;stroke:none;fill:none}
.sc-shade{fill:rgba(0,0,0,.45)}
.sc-poly{fill:rgba(58,87,241,.12);stroke:#3a57f1;stroke-width:2;stroke-linejoin:round}
.sc-h{fill:rgba(58,87,241,.25);stroke:#fff;stroke-width:2.5;cursor:grab}
.sc-hd{fill:#fff;pointer-events:none}
.sc-loupe{position:absolute;border-radius:50%;border:3px solid #fff;box-shadow:0 4px 18px rgba(0,0,0,.45);pointer-events:none;z-index:2}
.sc-tools{display:flex;gap:8px;margin-top:12px}
.sc-tools .pp-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.sc-tico{display:inline-grid}.sc-tico svg.i{width:15px;height:15px}
.sc-edacts{margin-top:12px}

/* ================= SteamX ================= */
/* brand: navy (#081631 / #0f2a5c / #1d4f9c) + cyan #25d0f0, from the SteamX booklet covers */
:root{
  --bg:#071226; --bg2:#0a1830; --surf:#0e1f3b; --surf2:#142949; --line:#1d3459; --line2:#28446f;
  --text:#e9eff9; --text2:#b8c6dc; --muted:#7f91ae; --brand:#1f74e0; --accent:#1f74e0; --on-accent:#fff;
  --sage:#25d0f0; --code:#0a162b; --cyan:#25d0f0;
}
[data-theme=light]{
  --bg:#f3f6fb; --bg2:#eaf0f8; --surf:#ffffff; --surf2:#e3eaf5; --line:#d7e0ee; --line2:#c4d1e5;
  --text:#0c1a33; --text2:#33445f; --muted:#6c7c95; --brand:#1a62c4; --accent:#1a62c4; --on-accent:#fff;
  --sage:#0d9fc0; --code:#eef2f8; --cyan:#0d9fc0;
}
.stx-logo{display:block;height:30px;width:auto}
.stx-logo.light,[data-theme=light] .stx-logo.dark{display:none}
[data-theme=light] .stx-logo.light{display:block}
.login input#nm{margin-bottom:0}
.stx-empty-mark{width:64px;height:64px;opacity:.85}
[data-theme=light] .stx-empty-mark{filter:brightness(0) saturate(100%) invert(14%) sepia(52%) saturate(2190%) hue-rotate(204deg)}

/* topics (Telegram-style) with their sessions */
.stx-topic{margin:0 0 4px;border-radius:14px;transition:background .2s}
.stx-topic.open{background:color-mix(in srgb,var(--surf) 55%,transparent)}
.stx-th{display:flex;align-items:center;gap:10px;width:100%;padding:8px 6px 8px 8px;border-radius:14px;cursor:pointer;user-select:none;-webkit-user-select:none}
.stx-th:hover{background:var(--surf2)}
.stx-th:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
.stx-tico{--tc:#6fb9f0;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;flex:none;
  background:color-mix(in srgb,var(--tc) 22%,transparent);color:var(--tc)}
.stx-tico svg.i{width:16px;height:16px;stroke-width:2.2}
.stx-ttx{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.stx-ttx b{font-weight:600;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stx-ttx small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px}
.stx-add,.stx-more{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;color:var(--muted);flex:none}
.stx-add svg,.stx-more svg{width:16px;height:16px}
.stx-add:hover,.stx-more:hover{background:var(--line);color:var(--text)}
.stx-more{opacity:0}
.stx-th:hover .stx-more,.stx-more.menu-open{opacity:1}
@media (pointer:coarse){.stx-more{opacity:1}}
.stx-th .chev{width:18px;display:grid;place-items:center;color:var(--muted);transition:transform .25s var(--ease-out)}
.stx-th .chev svg{width:15px;height:15px}
.stx-topic:not(.open) .chev{transform:rotate(-90deg)}
[dir=rtl] .stx-topic:not(.open) .chev{transform:rotate(90deg)}
.stx-sess{display:none;padding:0 6px 8px 14px;position:relative}
.stx-topic.open .stx-sess{display:block}
.stx-sess::before{content:"";position:absolute;inset-block:0 12px;inset-inline-start:23px;width:1.5px;background:var(--line);border-radius:2px}
.stx-sess .chat{padding:6px 8px 6px 22px}
.stx-sess .chat .run{position:absolute;inset-inline-start:6px;top:50%;margin-top:-3.5px}
.stx-ct{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.stx-ct .t{font-size:13.5px}
.stx-cs{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stx-sess .more-row{padding-inline-start:22px}
.stx-start{display:flex;align-items:center;gap:7px;width:100%;padding:6px 8px 6px 22px;border-radius:10px;font-size:13px;color:var(--muted)}
.stx-start svg{width:15px;height:15px}
.stx-start:hover{background:var(--surf2);color:var(--text)}
.stx-newtopic{display:flex;align-items:center;gap:10px;width:100%;margin:6px 0 10px;padding:9px 8px;border-radius:14px;
  border:1.5px dashed var(--line2);color:var(--text2);font-size:14px;font-weight:550}
.stx-newtopic svg{width:18px;height:18px;margin-inline-start:7px}
.stx-newtopic:hover{border-color:var(--brand);color:var(--text);background:color-mix(in srgb,var(--brand) 8%,transparent)}

/* header topic chip */
.stx-chip{display:inline-flex;align-items:center;gap:3px;font-size:12px;font-weight:600;color:var(--text2);margin-inline-end:8px;max-width:45vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stx-hash{font-weight:800}

/* other people's messages */
.msg.user.other .bubble{background:color-mix(in srgb,var(--cyan) 12%,var(--surf2))}
.msg.user.other .sender{margin-inline-end:6px}

/* notification preferences */
.np-box .row{gap:12px}
.np-topics{padding:4px 0 12px}
.np-head{margin:4px 0 8px}
.np-chips{display:flex;flex-wrap:wrap;gap:6px}
.np-chip{display:inline-flex;align-items:center;gap:4px;padding:6px 11px;border-radius:99px;border:1px solid var(--line2);font-size:13px;color:var(--text2)}
.np-chip.on{background:color-mix(in srgb,var(--brand) 22%,transparent);border-color:var(--brand);color:var(--text)}
[data-theme=light] .stx-tico{color:color-mix(in srgb,var(--tc) 62%,#000)}
[data-theme=light] .stx-hash{filter:brightness(.62)}
