/* Accessibility overrides occupy the first layer: important rules must beat
   legacy ID-specific full-motion declarations even before matchMedia fires. */
@layer pongy-accessibility {
  @media (prefers-reduced-motion: reduce) {
    html:not([data-motion-explicit="true"]) *,
    html:not([data-motion-explicit="true"]) *::before,
    html:not([data-motion-explicit="true"]) *::after {
      animation:none!important;transition:none!important;scroll-behavior:auto!important;
    }
    html:not([data-motion-explicit="true"]) .thinking-label,
    html:not([data-motion-explicit="true"]) .progress-title {
      background:none!important;color:var(--fg2)!important;-webkit-text-fill-color:currentColor!important;
    }
  }
  html[data-motion="reduced"] *,html[data-motion="reduced"] *::before,html[data-motion="reduced"] *::after {
    animation:none!important;transition:none!important;scroll-behavior:auto!important;
  }
  /* Owner request (0.22.3): core interactive feedback — switches, checkboxes,
     windows, the workspace switch, section changes and press states — must stay
     animated even when the OS asks for reduced motion. An explicit
     "Reduce motion" choice in settings still disables everything above. */
  @media (prefers-reduced-motion: reduce) {
    html:not([data-motion-explicit="true"]) input.display-switch[type=checkbox],
    html:not([data-motion-explicit="true"]) input.display-switch[type=checkbox]::before {
      transition:background-color .24s ease,border-color .24s ease,box-shadow .24s ease,width .18s ease,transform .32s cubic-bezier(.34,1.56,.64,1)!important;
      animation:none!important;
    }
    html:not([data-motion-explicit="true"]) input[type=checkbox]:not(.display-switch),
    html:not([data-motion-explicit="true"]) input[type=checkbox]:not(.display-switch)::before {
      transition:background-color .22s ease,border-color .22s ease,clip-path .25s cubic-bezier(.2,.8,.2,1),transform .3s cubic-bezier(.2,.9,.3,1.3)!important;
      animation:none!important;
    }
    html:not([data-motion-explicit="true"]) input[type=checkbox]:not(.display-switch):checked::before{animation:check-draw .3s cubic-bezier(.2,.8,.2,1)!important}
    html:not([data-motion-explicit="true"]) button:not(:disabled),
    html:not([data-motion-explicit="true"]) a {
      transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .3s ease,opacity .3s ease,transform .18s ease!important;
    }
    html:not([data-motion-explicit="true"]) .overlay {animation:overlayIn .18s ease both!important}
    html:not([data-motion-explicit="true"]) .overlay .modal-box {animation:panelIn .23s cubic-bezier(.2,.8,.2,1) both!important}
    html:not([data-motion-explicit="true"]) .confirm-modal.open .confirm-box {animation:panelIn .23s cubic-bezier(.2,.8,.2,1) both!important}
    html:not([data-motion-explicit="true"]) .notification-popover.open,
    html:not([data-motion-explicit="true"]) #notificationFilter {animation:popover-slide .22s ease-out both!important}
    html:not([data-motion-explicit="true"]) #agentPopup {animation:panelIn .18s ease both!important}
    html:not([data-motion-explicit="true"]) .composer-menu,
    html:not([data-motion-explicit="true"]) #authLanguageMenu {animation:quiet-surface-in .3s var(--motion-ease) both!important}
    html:not([data-motion-explicit="true"]) #noteAIPanel {animation:panel-switch-in .2s cubic-bezier(.22,.8,.2,1) both!important}
    html:not([data-motion-explicit="true"]) body.workspace-changing #chatViewport,
    html:not([data-motion-explicit="true"]) body.workspace-changing #notesEditor {animation:panel-switch-in .32s cubic-bezier(.22,.8,.2,1) both!important}
    html:not([data-motion-explicit="true"]) #workspaceSwitch button {transition:color .3s ease,transform .4s cubic-bezier(.22,.8,.2,1)!important}
    html:not([data-motion-explicit="true"]) .workspace-slider {transition:transform .55s cubic-bezier(.22,.85,.25,1.08)!important}
    html:not([data-motion-explicit="true"]) #workspaceSwitch[data-section=chats] .workspace-slider::after {animation:slider-sheen-a .62s cubic-bezier(.35,.55,.3,1)!important}
    html:not([data-motion-explicit="true"]) #workspaceSwitch[data-section=notes] .workspace-slider::after {animation:slider-sheen-b .62s cubic-bezier(.35,.55,.3,1)!important}
    html:not([data-motion-explicit="true"]) #workspaceSwitch[data-section=chats] {animation:switch-bounce-a .5s cubic-bezier(.22,.8,.2,1)!important}
    html:not([data-motion-explicit="true"]) #workspaceSwitch[data-section=notes] {animation:switch-bounce-b .5s cubic-bezier(.22,.8,.2,1)!important}
    html:not([data-motion-explicit="true"]) .settings-tab-indicator {transition:transform .58s cubic-bezier(.22,.85,.25,1.12),width .45s cubic-bezier(.22,.85,.25,1.12)!important}
    html:not([data-motion-explicit="true"]) .settings-section:not([hidden]) {animation:settings-enter .22s ease-out!important}
    html:not([data-motion-explicit="true"]) .api-key-eye .api-eye-slash,
    html:not([data-motion-explicit="true"]) .api-key-eye .api-eye-pupil,
    html:not([data-motion-explicit="true"]) .api-key-eye svg {transition:stroke-dashoffset .28s cubic-bezier(.2,.8,.2,1),opacity .22s ease,transform .28s cubic-bezier(.2,.8,.2,1)!important}
  }
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;margin:0;padding:0}
html,body{height:100%;overflow:hidden;font-family:var(--pongy-font,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif)}
:root{--bg:#fff;--bg2:#f7f7f9;--bg3:#f0f0f3;--fg:#000;--fg2:#666;--border:#e3e3e8;--accent:#6366f1;--accent-h:#4f46e5;--danger:#ef4444;--success:#10b981;--hover:rgba(0,0,0,.05);--hover2:rgba(0,0,0,.08)}
body.dark{--bg:#0d0d10;--bg2:#15151a;--bg3:#1c1c22;--fg:#e8e8ee;--fg2:#8a8a95;--border:#2a2a32;--accent:#7c7ff5;--accent-h:#9999ff;--hover:rgba(255,255,255,.05);--hover2:rgba(255,255,255,.09)}
body{background:var(--bg);color:var(--fg);display:flex;overflow:hidden}
button{font:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,textarea,select{font:inherit;color:inherit;outline:none}
#sidebar{width:calc(290px * var(--ui-scale,1));height:100vh;background:var(--bg2);border-right:calc(1px * var(--ui-scale,1)) solid var(--border);display:flex;flex-direction:column;flex-shrink:0;transition:width .25s;position:relative}
body.collapsed #sidebar{width:calc(64px * var(--ui-scale,1))}
body.hidden #sidebar{width:0;border:none;overflow:hidden}
body.hidden #collapseBtn{display:none}
body.collapsed .sb-title,body.collapsed .sb-search,body.collapsed .sb-label,body.collapsed .chat-body,body.collapsed .sb-btn span,body.collapsed .upgrade-btn span{display:none}
body.collapsed .sb-head{justify-content:center}
body.collapsed .sb-bottom{flex-direction:column}
body.collapsed .sb-row{flex-direction:column}
.sb-head{display:flex;align-items:center;justify-content:space-between;padding:calc(12px * var(--ui-scale,1));height:calc(56px * var(--ui-scale,1));flex-shrink:0}
.logo{width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));overflow:hidden;flex-shrink:0}
.app-logo{display:block;width:100%;height:100%;object-fit:contain}
.sb-title{font-weight:700;font-size:calc(15px * var(--ui-scale,1));margin-left:calc(10px * var(--ui-scale,1));flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.icon-btn{width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;color:var(--fg2)}
.icon-btn:hover{background:var(--hover);color:var(--fg)}
.sb-search{padding:0 calc(10px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}
.sb-search-inner{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1))}
.sb-search-inner svg{color:var(--fg2);flex-shrink:0}
#sbSearchInput{flex:1;background:transparent;border:none;font-size:calc(13px * var(--ui-scale,1));min-width:0}
.sb-list{flex:1;overflow-y:auto;padding:calc(6px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}
body.collapsed .sb-list{padding:calc(6px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1))}
.sb-label{font-size:calc(11px * var(--ui-scale,1));text-transform:uppercase;letter-spacing:.06em;color:var(--fg2);padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1));font-weight:600}
.chat-item{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1)) calc(11px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));cursor:pointer;position:relative;margin-bottom:calc(2px * var(--ui-scale,1))}
body.collapsed .chat-item{padding:calc(9px * var(--ui-scale,1));justify-content:center}
.chat-item:hover{background:var(--hover)}
.chat-item.active{background:var(--hover2)}
.chat-ico{flex-shrink:0;opacity:.6;margin-top:calc(2px * var(--ui-scale,1));color:var(--fg2)}
.chat-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:calc(2px * var(--ui-scale,1))}
.chat-title{font-size:calc(13.5px * var(--ui-scale,1));font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-time{font-size:calc(11px * var(--ui-scale,1));color:var(--fg2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-item.active .chat-time{color:var(--accent)}
.chat-actions{display:none;align-items:center;flex-shrink:0;gap:calc(2px * var(--ui-scale,1));background:transparent}
.chat-item:hover .chat-actions,.chat-item:focus-within .chat-actions{display:flex}
.chat-item.renaming .chat-actions,body.collapsed .chat-actions{display:none}
.chat-item:focus-visible,.chat-act:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}
.chat-act{width:calc(24px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));flex-shrink:0;background:transparent;border-radius:calc(6px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;color:var(--fg2)}
.chat-act:hover{background:transparent;color:var(--fg)}
.chat-act.pin-icon.on{color:var(--accent)}
.chat-act.danger:hover{background:transparent;color:var(--danger)}
.rename-input{width:100%;background:var(--bg);border:calc(1px * var(--ui-scale,1)) solid var(--accent);border-radius:calc(6px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));color:var(--fg)}
.chat-empty{text-align:center;padding:calc(20px * var(--ui-scale,1));font-size:calc(12.5px * var(--ui-scale,1));color:var(--fg2)}
/* Owner request (0.22.3): the notes-empty hint must not sit inside the icon-only rail. */
body.collapsed .chat-empty{display:none}
.sb-bottom{padding:calc(8px * var(--ui-scale,1));border-top:calc(1px * var(--ui-scale,1)) solid var(--border);display:flex;flex-direction:column;gap:calc(6px * var(--ui-scale,1));flex-shrink:0}
.sb-row{display:flex;gap:calc(6px * var(--ui-scale,1))}
.sb-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:calc(6px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));min-width:0}
.sb-btn:hover{background:var(--hover);color:var(--fg)}.archive-nav{width:100%;justify-content:flex-start;margin:0 0 6px;padding-inline:14px;min-height:36px}.archive-nav[aria-pressed="true"]{background:var(--hover);color:var(--fg)}
.upgrade-btn{display:flex;align-items:center;justify-content:center;gap:calc(6px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));background:transparent;border:calc(1.5px * var(--ui-scale,1)) solid var(--danger);color:var(--danger);font-weight:600;font-size:calc(12.5px * var(--ui-scale,1));width:100%}
.upgrade-btn:hover{background:rgba(239,68,68,.08)}
.upgrade-btn.active{border-color:var(--success);color:var(--success);pointer-events:none;background:rgba(16,185,129,.06)}
#collapseBtn{position:absolute;top:50%;right:calc(-14px * var(--ui-scale,1));transform:translateY(-50%);width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));border-radius:50%;background:var(--bg);border:calc(1px * var(--ui-scale,1)) solid var(--border);display:flex;align-items:center;justify-content:center;color:var(--fg2);z-index:50}
#collapseBtn:hover{transform:translateY(-50%) scale(1.1)}
#main{flex:1;display:flex;flex-direction:column;min-width:0;height:100vh}
#topbar{height:calc(52px * var(--ui-scale,1));display:flex;align-items:center;justify-content:space-between;padding:0 calc(12px * var(--ui-scale,1));border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);flex-shrink:0}
.tb-left{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));min-width:0;flex:1}
.tb-menu{width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));display:none;align-items:center;justify-content:center;color:var(--fg2)}
:where(html[data-layout="mobile"]) .tb-menu{display:flex}
.tb-title{font-size:calc(13.5px * var(--ui-scale,1));color:var(--fg2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.tb-actions{display:flex;gap:calc(4px * var(--ui-scale,1))}
.tb-btn{width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;color:var(--fg2)}
.tb-btn:hover{background:var(--hover);color:var(--fg)}
#messages{flex:1;overflow-y:auto;padding:calc(16px * var(--ui-scale,1)) 0;min-height:0}
.msg-wrap{max-width:calc(1024px * var(--ui-scale,1));margin:0 auto;padding:0 calc(16px * var(--ui-scale,1))}
.welcome{height:100%;display:flex;align-items:center;justify-content:center;padding:0 calc(24px * var(--ui-scale,1));text-align:center}
.welcome-inner{max-width:calc(520px * var(--ui-scale,1))}
.big-logo{width:calc(88px * var(--ui-scale,1));height:calc(88px * var(--ui-scale,1));background:transparent;border:0;border-radius:0;padding:0;overflow:visible;margin:0 auto calc(24px * var(--ui-scale,1));box-shadow:none;outline:none}
.welcome p{font-size:calc(17px * var(--ui-scale,1));line-height:1.6;color:var(--fg2)}
.msg{display:flex;gap:calc(12px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) 0}
.msg.user{flex-direction:row-reverse}
.avatar{width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:calc(13px * var(--ui-scale,1))}
.avatar.ai{background:linear-gradient(135deg,var(--accent),var(--accent-h));color:var(--bg)}
.avatar.user{background:var(--bg3);color:var(--fg);border:calc(1px * var(--ui-scale,1)) solid var(--border)}
.msg-content{display:flex;flex-direction:column;max-width:78%;min-width:0}
.msg.user .msg-content{align-items:flex-end}
.bubble{padding:calc(11px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1));border-radius:calc(20px * var(--ui-scale,1));font-size:calc(15px * var(--ui-scale,1));line-height:1.55;word-wrap:break-word;overflow-wrap:break-word;white-space:pre-wrap;max-width:100%}
.msg.user .bubble{background:var(--accent);color:#fff;border-bottom-right-radius:calc(6px * var(--ui-scale,1))}
.msg.ai .bubble{background:var(--bg3);color:var(--fg);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-bottom-left-radius:calc(6px * var(--ui-scale,1))}
.bubble code{background:rgba(127,127,127,.15);padding:calc(2px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1));border-radius:calc(5px * var(--ui-scale,1));font-family:Consolas,monospace;font-size:calc(13px * var(--ui-scale,1))}
.bubble pre{background:#111;color:#f0f0f3;padding:calc(12px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));overflow-x:auto;margin:calc(8px * var(--ui-scale,1)) 0;font-family:Consolas,monospace;font-size:calc(12.5px * var(--ui-scale,1))}
.bubble a{color:var(--accent);text-decoration:none;word-break:break-all}
.bubble ul,.bubble ol{margin:calc(6px * var(--ui-scale,1)) 0;padding-left:calc(20px * var(--ui-scale,1))}
.msg-actions{display:flex;gap:calc(4px * var(--ui-scale,1));margin-top:calc(6px * var(--ui-scale,1));opacity:0;transition:opacity .15s;flex-wrap:wrap}
.msg:hover .msg-actions,.msg:focus-within .msg-actions{opacity:1}
.msg-act{display:inline-flex;align-items:center;gap:calc(4px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));font-size:calc(11.5px * var(--ui-scale,1));color:var(--fg2)}
.msg-act:hover{background:var(--hover);color:var(--fg)}
.msg-act.danger:hover{background:rgba(239,68,68,.12);color:var(--danger)}
.thinking{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1))}
.thinking .dots{display:flex;gap:calc(3px * var(--ui-scale,1))}
.thinking .dots span{width:calc(6px * var(--ui-scale,1));height:calc(6px * var(--ui-scale,1));border-radius:50%;background:var(--fg2);animation:pulse 1.2s infinite}
.thinking .dots span:nth-child(2){animation-delay:.2s}
.thinking .dots span:nth-child(3){animation-delay:.4s}
@keyframes pulse{0%,60%,100%{opacity:.3}30%{opacity:1}}
.retry-badge{align-self:flex-start;width:fit-content;max-width:100%;display:inline-flex;align-items:center;gap:calc(6px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));background:rgba(245,158,11,.12);border:calc(1px * var(--ui-scale,1)) solid rgba(245,158,11,.3);color:#f59e0b;font-size:calc(11.5px * var(--ui-scale,1));font-weight:500;margin-bottom:calc(6px * var(--ui-scale,1));animation:pulse2 1.5s infinite}
@keyframes pulse2{0%,100%{opacity:1}50%{opacity:.6}}
.msg-meta{display:flex;gap:calc(6px * var(--ui-scale,1));margin-top:calc(6px * var(--ui-scale,1));flex-wrap:wrap}
.meta-badge{padding:calc(3px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);font-size:calc(11px * var(--ui-scale,1));color:var(--fg2)}
.meta-badge.accent{background:rgba(var(--accent-rgb,99,102,241),.1);border-color:rgba(var(--accent-rgb,99,102,241),.3);color:var(--accent)}
#inputArea{flex-shrink:0;padding:calc(8px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border-top:calc(1px * var(--ui-scale,1)) solid var(--border)}
#inputInner{max-width:calc(1024px * var(--ui-scale,1));margin:0 auto}
.modes{display:flex;gap:calc(8px * var(--ui-scale,1));margin-bottom:calc(8px * var(--ui-scale,1));flex-wrap:wrap;position:relative}
.mode-btn{display:flex;align-items:center;gap:calc(6px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg3);color:var(--fg2)}
.mode-btn:hover{color:var(--fg)}
.mode-btn.active{background:rgba(var(--accent-rgb,99,102,241),.12);border-color:rgba(var(--accent-rgb,99,102,241),.5);color:var(--accent)}
.input-box{background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(20px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1));display:flex;align-items:flex-end;gap:calc(4px * var(--ui-scale,1))}
.input-box:focus-within{border-color:var(--accent)}
.input-box>button{width:calc(40px * var(--ui-scale,1));height:calc(40px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;color:var(--fg2);flex-shrink:0}
.input-box>button:hover{background:var(--hover)}
#userInput{flex:1;background:transparent;border:none;resize:none;padding:calc(10px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1));font-size:calc(15px * var(--ui-scale,1));max-height:calc(160px * var(--ui-scale,1));min-height:calc(20px * var(--ui-scale,1));line-height:1.4;color:var(--fg);min-width:0}
#userInput::placeholder{color:var(--fg2)}
#sendBtn{background:var(--hover2);color:var(--fg2);cursor:not-allowed}
#sendBtn.ready{background:var(--accent);color:#fff;cursor:pointer}
 #stopBtn{background:var(--accent)!important;color:#fff!important;border:1px solid color-mix(in srgb,var(--accent) 72%,var(--fg))!important;box-shadow:0 2px 10px color-mix(in srgb,var(--accent) 24%,transparent)!important}body.dark #stopBtn{background:var(--accent)!important;color:#101014!important}
#micBtn.recording{background:var(--danger)!important;color:#fff!important}
.footer-text{text-align:center;font-size:calc(10.5px * var(--ui-scale,1));color:var(--fg2);margin-top:calc(4px * var(--ui-scale,1))}
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);backdrop-filter:blur(calc(4px * var(--ui-scale,1)));display:none;align-items:center;justify-content:center;padding:calc(16px * var(--ui-scale,1));z-index:100}
.overlay.open{display:flex}
.modal-box{width:100%;max-width:calc(520px * var(--ui-scale,1));max-height:92vh;background:var(--bg);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(18px * var(--ui-scale,1));overflow:hidden;display:flex;flex-direction:column}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:calc(16px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg2);flex-shrink:0}
.modal-head h2{font-size:calc(16px * var(--ui-scale,1));font-weight:700}
.modal-body{padding:calc(20px * var(--ui-scale,1));overflow-y:auto;flex:1;min-height:0}
.field-label{font-size:calc(13.5px * var(--ui-scale,1));font-weight:600;margin-bottom:calc(10px * var(--ui-scale,1))}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:calc(8px * var(--ui-scale,1))}
.opt{padding:calc(11px * var(--ui-scale,1)) calc(13px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg3);color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));cursor:pointer;width:100%}
.opt.active{border-color:var(--accent);background:rgba(var(--accent-rgb,99,102,241),.1);color:var(--accent)}
.inp{width:100%;padding:calc(11px * var(--ui-scale,1)) calc(15px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg3);font-size:calc(14px * var(--ui-scale,1));color:var(--fg)}
.inp:focus{border-color:var(--accent)}
.support-link{display:flex;align-items:center;gap:calc(12px * var(--ui-scale,1));padding:calc(14px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);text-decoration:none;color:var(--fg);margin-top:calc(16px * var(--ui-scale,1))}
.support-icon{width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.support-title{font-weight:600;font-size:calc(14px * var(--ui-scale,1))}
.support-email{font-size:calc(12.5px * var(--ui-scale,1));color:var(--accent);margin-top:calc(2px * var(--ui-scale,1))}
.confirm-modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:center;justify-content:center;padding:calc(16px * var(--ui-scale,1));z-index:300}
.confirm-modal.open{display:flex}
#adminGuestModal{z-index:1100}
.confirm-box{width:100%;max-width:calc(380px * var(--ui-scale,1));background:var(--bg);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(18px * var(--ui-scale,1));padding:calc(24px * var(--ui-scale,1))}
.confirm-title{font-size:calc(17px * var(--ui-scale,1));font-weight:700;margin-bottom:calc(10px * var(--ui-scale,1))}
.confirm-text{font-size:calc(14px * var(--ui-scale,1));color:var(--fg2);line-height:1.5;margin-bottom:calc(20px * var(--ui-scale,1))}
.confirm-actions{display:flex;gap:calc(10px * var(--ui-scale,1));justify-content:flex-end}
.confirm-btn{padding:calc(10px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1));font-weight:600;cursor:pointer}
.confirm-btn.primary{background:var(--accent);color:#fff}
.confirm-btn.secondary{background:transparent;border:calc(1px * var(--ui-scale,1)) solid var(--border);color:var(--fg2)}
#authScreen{position:fixed;inset:0;background:var(--bg);display:none;align-items:center;justify-content:center;z-index:1000;padding:calc(16px * var(--ui-scale,1))}
#authScreen.show{display:flex}
.auth-box{width:100%;max-width:calc(400px * var(--ui-scale,1));padding:calc(32px * var(--ui-scale,1));background:var(--bg2);border-radius:calc(20px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);box-shadow:0 calc(20px * var(--ui-scale,1)) calc(60px * var(--ui-scale,1)) rgba(0,0,0,.15)}
.eye{position:absolute;right:calc(8px * var(--ui-scale,1));top:50%;transform:translateY(-50%);width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;color:var(--fg2);background:transparent;border:none;cursor:pointer}
.eye:hover{background:var(--hover)}
.plan-card{padding:calc(20px * var(--ui-scale,1));border-radius:calc(16px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg3)}
.plan-card.plus{background:linear-gradient(135deg,rgba(var(--accent-rgb,99,102,241),.1),rgba(139,92,246,.05));border-color:rgba(var(--accent-rgb,99,102,241),.4)}
.plan-title{font-size:calc(16px * var(--ui-scale,1));font-weight:700;color:var(--accent);margin-bottom:calc(10px * var(--ui-scale,1))}
.plan-features{font-size:calc(13px * var(--ui-scale,1));color:var(--fg2);line-height:2;margin-bottom:calc(14px * var(--ui-scale,1));list-style:none}
.plan-features li::before{content:'✓';color:#10b981;font-weight:700;margin-right:calc(8px * var(--ui-scale,1))}
.plan-price{font-size:calc(28px * var(--ui-scale,1));font-weight:800;margin:calc(12px * var(--ui-scale,1)) 0}
.plan-btn{width:100%;padding:calc(14px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;font-weight:700;font-size:calc(14px * var(--ui-scale,1));border:none;cursor:pointer}
.plan-btn:hover{opacity:.9}
.pay-methods{display:grid;grid-template-columns:repeat(3,1fr);gap:calc(10px * var(--ui-scale,1))}
.pay-method{padding:calc(16px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));border-radius:calc(14px * var(--ui-scale,1));border:calc(2px * var(--ui-scale,1)) solid var(--border);background:var(--bg3);color:var(--fg);display:flex;flex-direction:column;align-items:center;gap:calc(6px * var(--ui-scale,1));cursor:pointer;font-size:calc(12px * var(--ui-scale,1));font-weight:500;text-align:center}
.pay-method.selected{border-color:var(--accent);background:rgba(var(--accent-rgb,99,102,241),.1)}
.pay-method svg{width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1))}
.pay-icon-sbp{color:#10b981}.pay-icon-card{color:#6366f1}.pay-icon-ru{color:#ef4444}
.card-form{display:flex;flex-direction:column;gap:calc(10px * var(--ui-scale,1));margin-top:calc(14px * var(--ui-scale,1))}
.card-form .row{display:grid;grid-template-columns:2fr 1fr;gap:calc(10px * var(--ui-scale,1))}
.pay-back{width:100%;padding:calc(12px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));background:transparent;border:calc(1px * var(--ui-scale,1)) solid var(--border);color:var(--fg2);font-weight:600;font-size:calc(13px * var(--ui-scale,1));cursor:pointer;margin-top:calc(10px * var(--ui-scale,1))}
.qr-wrap{margin:calc(12px * var(--ui-scale,1)) auto;width:calc(220px * var(--ui-scale,1));height:calc(220px * var(--ui-scale,1));background:#fff;border-radius:calc(12px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;padding:calc(10px * var(--ui-scale,1));box-shadow:0 calc(4px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1)) rgba(0,0,0,.1)}
.qr-wrap img{width:100%;height:100%;display:block;border-radius:calc(6px * var(--ui-scale,1))}
.qr-hint{text-align:center;font-size:calc(13px * var(--ui-scale,1));color:var(--fg2);line-height:1.5}
.overlay-bd{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;z-index:30}
.overlay-bd.show{display:block}

:where(html[data-layout="mobile"]) #sidebar{position:fixed;z-index:40;transform:translateX(-100%);width:calc(280px * var(--ui-scale,1))}
:where(html[data-layout="mobile"]) #sidebar.open{transform:translateX(0)}
:where(html[data-layout="mobile"]) body.collapsed #sidebar{width:calc(280px * var(--ui-scale,1));transform:translateX(-100%)}
:where(html[data-layout="mobile"]) body.collapsed #sidebar.open{transform:translateX(0)}
:where(html[data-layout="mobile"]) #collapseBtn{display:none}
:where(html[data-layout="mobile"]) .msg-content{max-width:88%}
:where(html[data-layout="mobile"]) .msg-actions{opacity:1}
:where(html[data-layout="mobile"]) .chat-actions{display:flex}
:where(html[data-layout="mobile"]) .chat-item.renaming .chat-actions{display:none}
:where(html[data-layout="mobile"]) body.collapsed .chat-actions{display:flex}
:where(html[data-layout="mobile"]) body.collapsed .chat-body{display:flex}
:where(html[data-layout="mobile"]) body.collapsed .sb-title,:where(html[data-layout="mobile"]) body.collapsed .sb-search,:where(html[data-layout="mobile"]) body.collapsed .sb-label,:where(html[data-layout="mobile"]) body.collapsed .sb-btn span,:where(html[data-layout="mobile"]) body.collapsed .upgrade-btn span{display:initial}
/* Mobile collapse only slides the drawer away — keep the hint inside it. */
:where(html[data-layout="mobile"]) body.collapsed .chat-empty{display:block}
:where(html[data-layout="mobile"]) .chat-act{width:calc(28px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1))}
:where(html[data-layout="mobile"]) .grid2{grid-template-columns:1fr}


/* Keep every authentication field reachable with a short viewport or mobile keyboard. */
#authScreen{overflow-y:auto;align-items:flex-start}
.auth-box{margin:auto;flex-shrink:0}
#googleBtn:disabled{opacity:.5;cursor:not-allowed}

/* Recovery must be above the login screen, not hidden behind it. */
#resetModal{z-index:1100}

@media(hover:none){.chat-actions{display:flex}.chat-item.renaming .chat-actions,body.collapsed .chat-actions{display:none}}
@media (hover:none){:where(html[data-layout="mobile"]) body.collapsed .chat-actions{display:flex}:where(html[data-layout="mobile"]) .chat-item.renaming .chat-actions{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
:where(html[data-layout="desktop"]) body.collapsed .chat-item .chat-actions{display:none}
/* Keep the compact desktop rail usable; mobile drawers always use the full layout. */

:where(html[data-layout="desktop"]) body.collapsed .sb-head{flex-direction:column;height:auto;padding:calc(12px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1));gap:calc(8px * var(--ui-scale,1))}
:where(html[data-layout="desktop"]) body.collapsed .sb-head .icon-btn{width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));flex-shrink:0}


:where(html[data-layout="mobile"]) body.collapsed .sb-head{justify-content:space-between}
:where(html[data-layout="mobile"]) body.collapsed .sb-row{flex-direction:row}
:where(html[data-layout="mobile"]) body.collapsed .chat-item{padding:calc(9px * var(--ui-scale,1)) calc(11px * var(--ui-scale,1));justify-content:flex-start}


/* Firebase uses hosted email links; no code inputs or email-provider DNS setup. */
.auth-notice{margin-top:calc(16px * var(--ui-scale,1));padding:calc(14px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg3);color:var(--fg);font-size:calc(14px * var(--ui-scale,1));line-height:1.5;overflow-wrap:anywhere}
.auth-notice[hidden]{display:none}
.auth-notice button{width:100%;min-height:calc(44px * var(--ui-scale,1));margin-top:calc(12px * var(--ui-scale,1));background:transparent;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(8px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1));color:var(--accent)}
.auth-notice button:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}
button:disabled{cursor:not-allowed}
/* Stable geometry and lightweight motion: no transparent text or layout animation. */
.msg-content{min-width:0;max-width:90%}.msg.user .msg-content{max-width:90%}.bubble{overflow-wrap:anywhere;word-break:break-word}.msg-meta{display:flex;align-items:center;flex-wrap:wrap;gap:calc(6px * var(--ui-scale,1))}.meta-badge,.msg-act,.mode-btn{display:inline-flex;align-items:center;justify-content:center;gap:calc(4px * var(--ui-scale,1));line-height:1.25}.meta-badge svg,.msg-act svg,.mode-btn svg{display:block;flex-shrink:0}.meta-badge span{white-space:nowrap}
.attachment-list,.source-list{display:flex;flex-wrap:wrap;gap:calc(6px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) 0}.attachment-chip{display:inline-flex;align-items:center;gap:calc(8px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));max-width:100%;font-size:calc(12px * var(--ui-scale,1));color:var(--fg);background:var(--bg2);overflow-wrap:anywhere;text-decoration:none}.attachment-chip img{width:calc(64px * var(--ui-scale,1));height:calc(48px * var(--ui-scale,1));object-fit:cover;border-radius:calc(6px * var(--ui-scale,1))}.attachment-chip button,#replyPreview button{border:0;background:transparent;color:inherit;font-size:calc(20px * var(--ui-scale,1));cursor:pointer;flex-shrink:0}.source-list a{font-size:calc(12px * var(--ui-scale,1));color:var(--accent);padding:calc(5px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(8px * var(--ui-scale,1));overflow-wrap:anywhere}
#replyPreview{border-left:calc(3px * var(--ui-scale,1)) solid var(--accent);background:var(--bg2);border-radius:calc(8px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin-bottom:calc(8px * var(--ui-scale,1));display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1))}#replyPreview[hidden]{display:none}#replyPreview span{flex:1;max-height:calc(55px * var(--ui-scale,1));overflow:auto;overflow-wrap:anywhere}.message-reference{border-left:calc(3px * var(--ui-scale,1)) solid var(--accent);margin:0 0 calc(6px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));color:var(--fg2);max-height:calc(80px * var(--ui-scale,1));overflow:auto;font-size:calc(12px * var(--ui-scale,1))}
.memory-setting{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) 0 calc(18px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1))}.pay-methods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(8px * var(--ui-scale,1))}.pay-method{padding:calc(16px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);cursor:pointer}.pay-method.active{border-color:var(--accent);color:var(--accent)}.payment-notice{font-size:calc(13px * var(--ui-scale,1));line-height:1.5;margin:calc(12px * var(--ui-scale,1)) 0;color:var(--fg2)}
button{transition:background-color .18s ease,color .18s ease,box-shadow .18s ease,transform .15s ease}button:active:not(:disabled){transform:scale(.96)}.chat-actions,.chat-act,.msg-actions,.msg-act{background:transparent!important}.chat-item{transition:background-color .18s ease}.modal-overlay.open,.modal.open{animation:overlayIn .2s ease both}.open .modal-box{animation:panelIn .23s cubic-bezier(.2,.8,.2,1) both}.msg.incoming{animation:messageIn .18s ease both}.mode-btn.active svg{animation:iconIn .3s ease}.busy svg{animation:pulse 1s ease-in-out infinite}.thinking svg{animation:pulse 1.4s ease-in-out infinite}
@keyframes overlayIn{from{opacity:0}to{opacity:1}}@keyframes panelIn{from{opacity:0;transform:translateY(calc(10px * var(--ui-scale,1))) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes messageIn{from{opacity:0;transform:translateY(calc(5px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}@keyframes iconIn{50%{transform:scale(1.15)}}@keyframes pulse{50%{opacity:.45;transform:scale(.92)}}
@supports(height:100dvh){body{height:100dvh}}:where(html[data-layout="mobile"]) .msg-content,:where(html[data-layout="mobile"]) .msg.user .msg-content{max-width:100%}:where(html[data-layout="mobile"]) .pay-methods{grid-template-columns:1fr}:where(html[data-layout="mobile"]) .modal-box{max-height:92vh;max-height:92dvh}:where(html[data-layout="mobile"]) .msg-actions{flex-wrap:wrap}:where(html[data-layout="mobile"]) .input-box textarea{min-width:0}:where(html[data-layout="mobile"]) .modes{flex-wrap:wrap}:where(html[data-layout="mobile"]) #agentPopup{min-width:0!important;width:min(calc(320px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))))}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.overlay.open{animation:overlayIn .2s ease both;-webkit-backdrop-filter:blur(calc(4px * var(--ui-scale,1)))}.overlay.closing{animation:overlayOut .16s ease both}.overlay.closing .modal-box{animation:panelOut .16s ease both}.confirm-modal.open .confirm-box{animation:panelIn .23s ease both}#agentPopup{animation:panelIn .18s ease both}.thinking{animation:pulse 1.6s ease-in-out infinite}@keyframes overlayOut{to{opacity:0}}@keyframes panelOut{to{opacity:0;transform:translateY(calc(8px * var(--ui-scale,1))) scale(.97)}}
.msg-act{font-size:calc(12.5px * var(--ui-scale,1));min-height:calc(32px * var(--ui-scale,1))}.msg-act svg,.mode-btn svg,.tb-btn svg{transition:transform .18s ease}.msg-act:hover svg,.mode-btn:hover svg,.tb-btn:hover svg{transform:scale(1.08)}:where(html[data-layout="mobile"]) .msg-actions{opacity:1!important;transition:none}:where(html[data-layout="mobile"]) .msg-act{min-height:calc(44px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .attachment-chip{min-height:calc(44px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .icon-btn,:where(html[data-layout="mobile"]) .tb-btn,:where(html[data-layout="mobile"]) #menuBtn{min-width:calc(44px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1))}
.sources-panel{margin-top:calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));max-width:100%;overflow:hidden}.source-toggle{display:flex;align-items:center;justify-content:space-between;gap:calc(16px * var(--ui-scale,1));width:100%;min-height:calc(44px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1));color:var(--fg2);background:transparent}.source-toggle:hover{background:var(--hover)}.source-toggle svg{flex-shrink:0;transition:transform .2s ease}.source-toggle[aria-expanded=true] svg{transform:rotate(180deg)}.source-list{display:flex;flex-direction:column;padding:0 calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));gap:calc(8px * var(--ui-scale,1))}.source-list[hidden]{display:none}.source-list a{font-size:calc(14px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1));line-height:1.4}.wiki-pages{display:grid;gap:calc(8px * var(--ui-scale,1));margin-top:calc(10px * var(--ui-scale,1))}.wiki-card{display:flex;flex-direction:column;gap:calc(6px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));text-decoration:none;color:var(--fg);background:var(--bg2);font-size:calc(14px * var(--ui-scale,1))}.wiki-card span{color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));line-height:1.4;overflow-wrap:anywhere}.research-images{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(160px * var(--ui-scale,1)),1fr));gap:calc(12px * var(--ui-scale,1));margin-top:calc(12px * var(--ui-scale,1));max-width:calc(600px * var(--ui-scale,1))}.research-image{border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));overflow:hidden;background:var(--bg2)}.research-image a{color:var(--fg);text-decoration:none;display:flex;flex-direction:column}.research-image img{width:100%;height:calc(180px * var(--ui-scale,1));object-fit:cover;background:var(--bg3)}.research-image span{padding:calc(8px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));overflow-wrap:anywhere}.research-image small{display:block;padding:0 calc(10px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));color:var(--fg2);font-size:calc(12px * var(--ui-scale,1));line-height:1.4;overflow-wrap:anywhere}.attachment-chip.generated-image{display:flex;flex-direction:column;align-items:flex-start;max-width:calc(420px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1))}.attachment-chip.generated-image img{width:100%;height:auto;max-height:calc(420px * var(--ui-scale,1));object-fit:contain}.research-image img[hidden]{display:none}.research-image .image-unavailable{padding:calc(18px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));color:var(--fg2)}
#toast{position:fixed;bottom:calc(24px * var(--ui-scale,1));left:50%;transform:translate(-50%,calc(12px * var(--ui-scale,1)));max-width:calc(100vw - calc(32px * var(--ui-scale,1)));width:max-content;padding:calc(12px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);box-shadow:0 calc(4px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) rgba(0,0,0,.16);font-size:calc(14px * var(--ui-scale,1));line-height:1.5;z-index:600;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,transform .18s ease,visibility .18s}#toast.visible{opacity:1;visibility:visible;transform:translate(-50%,0)}#toast.leaving{opacity:0;transform:translate(-50%,calc(10px * var(--ui-scale,1)))}@media(max-width:480px){.research-images{grid-template-columns:1fr}.source-list a{min-height:calc(44px * var(--ui-scale,1))}.research-image img{height:calc(200px * var(--ui-scale,1))}#toast{bottom:calc(18px * var(--ui-scale,1));width:calc(100vw - calc(32px * var(--ui-scale,1)));text-align:center}}

#settingsModal #langGrid,#settingsModal #themeGrid{grid-template-columns:repeat(2,minmax(0,1fr))}#settingsModal .opt{min-height:calc(44px * var(--ui-scale,1))}#guideSections p{font-size:calc(14px * var(--ui-scale,1));line-height:1.6}#guideSections h4{font-size:calc(16px * var(--ui-scale,1));margin:calc(20px * var(--ui-scale,1)) 0 calc(8px * var(--ui-scale,1))}#guideSections ul{padding-left:calc(22px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0}#guideSections li{font-size:calc(14px * var(--ui-scale,1));line-height:1.6;margin:calc(6px * var(--ui-scale,1)) 0}
/* Verified-session gate: never flash the login form while checking a saved cookie. */
#sessionGate{display:none;position:fixed;inset:0;z-index:1200;background:var(--bg);color:var(--fg2);align-items:center;justify-content:center;flex-direction:column;gap:calc(18px * var(--ui-scale,1));padding:calc(24px * var(--ui-scale,1));text-align:center;font-size:calc(15px * var(--ui-scale,1));line-height:1.5}
body.booting #sessionGate{display:flex}body.booting #sidebar,body.booting #main,body.booting #authScreen{visibility:hidden;pointer-events:none}
.gate-logo{width:calc(64px * var(--ui-scale,1));height:calc(64px * var(--ui-scale,1));border-radius:calc(18px * var(--ui-scale,1))}.gate-spinner{width:calc(22px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1));border:calc(2px * var(--ui-scale,1)) solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:gateSpin .8s linear infinite}
#sessionRetry{border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));background:var(--bg3);color:var(--accent)}#sessionRetry[hidden],#historyRetry[hidden]{display:none}
#historyRetry{position:fixed;right:calc(20px * var(--ui-scale,1));bottom:calc(110px * var(--ui-scale,1));z-index:80;max-width:calc(100vw - calc(40px * var(--ui-scale,1)));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg2);color:var(--accent);padding:calc(10px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));box-shadow:0 calc(4px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) rgba(0,0,0,.12)}
@keyframes gateSpin{to{transform:rotate(360deg)}}
/* Transition colors, never dimensions or streamed paragraphs. */
body,#sidebar,#main,.topbar,.input-area,.input-box,.sb-search-inner,.modal-box,.auth-box,.bubble,.opt,.attachment-chip,.sources-panel,.support-card,.auth-notice{transition:background-color .24s ease,color .24s ease,border-color .24s ease,box-shadow .2s ease}
button,a,.chat-item,input,textarea{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .15s ease}
button:focus-visible,a:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
.welcome-icon{pointer-events:none!important;user-select:none;-webkit-user-drag:none;touch-action:none}
@media(hover:hover){.opt:hover,.pay-method:hover,.agent-item:hover{background:var(--hover2)}.attachment-chip:hover{border-color:var(--accent);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) rgba(var(--accent-rgb,99,102,241),.1)}.icon-btn:hover svg,.chat-act:hover svg{transform:scale(1.1)}button:not(:disabled):hover{filter:brightness(1.025)}}
.icon-btn svg,.chat-act svg{transition:transform .18s ease}.language-transition{animation:languageShift .22s ease both}#authScreen.show .auth-box{animation:panelIn .22s ease both}.source-list:not([hidden]),#replyPreview:not([hidden]),.attachment-list{animation:subtleReveal .18s ease both}
@keyframes languageShift{from{opacity:.75;transform:translateY(calc(2px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}@keyframes subtleReveal{from{opacity:.75;transform:translateY(calc(3px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
#sidebar{transition:width .25s ease,background-color .24s ease,color .24s ease,border-color .24s ease}
@media(prefers-reduced-motion:reduce){#sidebar{transition:none!important}}

.local-history-card{margin-top:calc(16px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2)}
.local-history-card summary{cursor:pointer;font-size:calc(14px * var(--ui-scale,1));font-weight:600;min-height:calc(44px * var(--ui-scale,1));line-height:calc(44px * var(--ui-scale,1))}
.local-history-card p{font-size:calc(14px * var(--ui-scale,1));line-height:1.5;color:var(--fg2);margin:calc(12px * var(--ui-scale,1)) 0}
.local-history-action{min-height:calc(44px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:transparent;color:var(--fg);font:inherit;font-size:calc(14px * var(--ui-scale,1));cursor:pointer;transition:background .18s,transform .18s}
.local-history-action:hover{background:var(--bg3)}.local-history-action:active{transform:scale(.98)}
#persistHistory{width:auto;margin-top:0}
.local-history-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(10px * var(--ui-scale,1));align-items:stretch}
.local-history-actions .local-history-action{width:100%;min-width:0;min-height:calc(46px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.3;font-weight:600}
@media(max-width:560px){.local-history-actions{grid-template-columns:1fr}}#localHistoryStatus:empty{display:none}
@media(prefers-reduced-motion:reduce){.local-history-action{transition:none}.local-history-action:active{transform:none}}

 :where(html[data-layout="mobile"]) #settingsModal .modal-body{padding:calc(16px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #settingsModal .modal-body>div[style*="margin-bottom"]{margin-bottom:calc(14px * var(--ui-scale,1))!important}
 :where(html[data-layout="mobile"]) #settingsModal .field-label{margin-bottom:calc(8px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #settingsModal .local-history-card:not([open]){padding-top:calc(6px * var(--ui-scale,1));padding-bottom:calc(6px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #settingsModal .support-link{margin-top:calc(12px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #logoutBtnSettings{margin-top:calc(12px * var(--ui-scale,1))!important}

/* Balanced dark palette and browser autofill integration. */
body{color-scheme:light}body.dark{color-scheme:dark;--bg:#171b25;--bg2:#1e2431;--bg3:#282f3f;--fg:#eef1f8;--fg2:#b1bbcf;--border:#3a4458;--accent:#9aa8ff;--accent-h:#bdc7ff;--hover:rgba(173,188,235,.08);--hover2:rgba(173,188,235,.13)}
html[data-theme=dark] body{color-scheme:dark;--bg:#171b25;--bg2:#1e2431;--bg3:#282f3f;--fg:#eef1f8;--fg2:#b1bbcf;--border:#3a4458;--accent:#9aa8ff;--accent-h:#bdc7ff;--hover:rgba(173,188,235,.08);--hover2:rgba(173,188,235,.13)}
.inp,textarea{caret-color:var(--accent);transition:background-color .24s ease,color .24s ease,border-color .2s ease,box-shadow .2s ease}
.inp:-webkit-autofill,.inp:-webkit-autofill:hover,.inp:-webkit-autofill:focus{background-color:var(--bg3)!important;-webkit-text-fill-color:var(--fg)!important;caret-color:var(--fg);-webkit-box-shadow:0 0 0 calc(1000px * var(--ui-scale,1)) var(--bg3) inset!important;box-shadow:0 0 0 calc(1000px * var(--ui-scale,1)) var(--bg3) inset!important}
.inp:autofill{background-color:var(--bg3)!important;color:var(--fg)!important;box-shadow:0 0 0 calc(1000px * var(--ui-scale,1)) var(--bg3) inset!important}
.eye,.eye:hover,.eye:active:not(:disabled){transform:translateY(-50%);touch-action:manipulation}
.eye svg{display:block;flex-shrink:0;overflow:visible;pointer-events:none}.eye path,.eye circle{vector-effect:non-scaling-stroke}
.eye-slash{stroke-dasharray:1;stroke-dashoffset:1;opacity:0;transition:stroke-dashoffset .25s ease,opacity .2s ease}.password-visible .eye-slash{stroke-dashoffset:0;opacity:1}.eye-pupil{opacity:1;transition:opacity .22s ease}.password-visible .eye-pupil{opacity:.2}
.inp:focus-visible,textarea:focus-visible{box-shadow:0 0 0 calc(3px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 18%,transparent)}
@media(hover:hover){.mode-btn:hover,.opt:hover{box-shadow:0 calc(3px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) rgba(62,76,140,.12);transform:none}.eye:hover svg{filter:drop-shadow(0 0 calc(3px * var(--ui-scale,1)) rgba(130,140,240,.2))}}
.progress-panel{width:100%;margin-bottom:calc(9px * var(--ui-scale,1));border:0;border-radius:0;background:transparent;overflow:visible;animation:subtleReveal .2s ease both}
.progress-toggle{width:100%;min-height:calc(36px * var(--ui-scale,1));padding:calc(5px * var(--ui-scale,1)) 0;display:flex;align-items:center;justify-content:space-between;gap:calc(12px * var(--ui-scale,1));color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));text-align:left}.progress-toggle>span{display:flex;align-items:center;gap:calc(7px * var(--ui-scale,1))}.progress-toggle svg{flex-shrink:0;transition:transform .22s ease}.progress-toggle[aria-expanded=true]>svg{transform:rotate(180deg)}
.progress-body{padding:0 0 calc(9px * var(--ui-scale,1));color:var(--fg2);font-size:calc(12px * var(--ui-scale,1));line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.progress-body[hidden]{display:none}.progress-body p{margin:calc(5px * var(--ui-scale,1)) 0}.progress-body p:last-child{animation:subtleReveal .2s ease both}.progress-note{font-size:calc(11px * var(--ui-scale,1));opacity:.85}.progress-live>span:after{content:'';width:calc(6px * var(--ui-scale,1));height:calc(6px * var(--ui-scale,1));background:var(--accent);border-radius:50%;animation:pulse 1.2s infinite}
@media(prefers-reduced-motion:reduce){.eye-slash,.eye-pupil,.progress-toggle svg,.progress-panel,.progress-body p{animation:none!important;transition:none!important}.progress-live>span:after{animation:none!important}.mode-btn:hover,.opt:hover{transform:none}}
/* Keep text anchored while the small activity dots animate. */
.thinking{animation:none}
.auth-transition{animation:subtleReveal .2s ease both}
@media(prefers-reduced-motion:reduce){.auth-transition{animation:none!important}}
body.dark .confirm-btn.primary,body.dark .msg.user .bubble,body.dark #sendBtn.ready{color:#171b25}
.msg.ai .msg-content:has(.progress-panel){width:min(100%,calc(560px * var(--ui-scale,1)))}
.progress-toggle{font-size:calc(14px * var(--ui-scale,1))}.progress-body{font-size:calc(14px * var(--ui-scale,1))}.progress-note{font-size:calc(13px * var(--ui-scale,1))}

/* Authentication language control: theme-aware and keyboard accessible. */
.auth-language{position:fixed;top:max(calc(16px * var(--ui-scale,1)),env(safe-area-inset-top));right:max(calc(16px * var(--ui-scale,1)),env(safe-area-inset-right));z-index:5}
.auth-language>button{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);font-size:calc(13px * var(--ui-scale,1));font-weight:600;cursor:pointer;transition:background .2s,box-shadow .2s,transform .2s}
.auth-language>button:hover{box-shadow:0 calc(4px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) #0002}.auth-language svg{transition:transform .2s}.auth-language [aria-expanded=true] svg{transform:rotate(180deg)}
#authLanguageMenu{position:absolute;right:0;top:calc(100% + calc(8px * var(--ui-scale,1)));min-width:calc(148px * var(--ui-scale,1));padding:calc(5px * var(--ui-scale,1));background:var(--bg2);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));box-shadow:0 calc(8px * var(--ui-scale,1)) calc(26px * var(--ui-scale,1)) #0002;animation:auth-menu-in .18s ease-out}
#authLanguageMenu[hidden]{display:none}#authLanguageMenu button{display:block;width:100%;padding:calc(10px * var(--ui-scale,1));border:0;border-radius:calc(8px * var(--ui-scale,1));text-align:left;background:transparent;color:var(--fg);cursor:pointer}#authLanguageMenu button:hover,#authLanguageMenu [aria-pressed=true]{background:var(--bg3);color:var(--accent)}
@keyframes auth-menu-in{from{opacity:0;transform:translateY(calc(-5px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.auth-language *{animation:none!important;transition:none!important}}

/* Quiet streaming motion: no cursor, no repaint animation on existing text. */
.stream-text,.stream-fragment{white-space:inherit;font:inherit;color:inherit}
.stream-fragment{animation:answer-fragment-in .24s cubic-bezier(.2,.7,.2,1) both}
@keyframes answer-fragment-in{from{opacity:.28}to{opacity:1}}
.thinking{animation:none;gap:calc(8px * var(--ui-scale,1))}
.thinking .dots{display:inline-flex;align-items:center;gap:calc(3px * var(--ui-scale,1));min-height:calc(18px * var(--ui-scale,1))}
.thinking .dots span{width:calc(4px * var(--ui-scale,1));height:calc(4px * var(--ui-scale,1));animation:thinking-dot-hop 1.25s ease-in-out infinite;transform:translateY(0);opacity:.55}
.thinking .dots span:nth-child(2){animation-delay:.14s}.thinking .dots span:nth-child(3){animation-delay:.28s}
@keyframes thinking-dot-hop{0%,60%,100%{transform:translateY(0);opacity:.5}28%{transform:translateY(calc(-4px * var(--ui-scale,1)));opacity:1}}
@supports ((background-clip:text) or (-webkit-background-clip:text)){
 .thinking-label,.progress-live .progress-title{background:linear-gradient(105deg,var(--fg2) 25%,var(--fg2) 39%,var(--accent) 47%,var(--fg) 51%,var(--fg2) 61%,var(--fg2) 75%);background-size:240% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:thinking-light-wave 2.6s ease-in-out infinite}
}
@keyframes thinking-light-wave{0%{background-position:150% 0}100%{background-position:-50% 0}}
.progress-panel{border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;width:100%;margin:0 0 calc(7px * var(--ui-scale,1));padding:0;animation:none}
.msg.ai .msg-content:has(.progress-panel){width:auto}
.progress-toggle{width:max-content;max-width:100%;min-height:calc(30px * var(--ui-scale,1));padding:calc(2px * var(--ui-scale,1)) 0;display:inline-flex;align-items:center;justify-content:flex-start;gap:calc(3px * var(--ui-scale,1));background:transparent!important;border:0;box-shadow:none;color:var(--fg2);font-size:calc(14px * var(--ui-scale,1));line-height:1.5;transform:none!important}
.progress-toggle>span{display:inline;gap:0}.progress-toggle>svg{width:calc(14px * var(--ui-scale,1));height:calc(14px * var(--ui-scale,1));transition:transform .2s ease}
.progress-toggle:hover{color:var(--fg)}.progress-toggle:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1));border-radius:calc(3px * var(--ui-scale,1))}
.progress-live>span:after{content:none}
.progress-body{padding:calc(2px * var(--ui-scale,1)) 0 calc(6px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1));line-height:1.65;max-width:calc(560px * var(--ui-scale,1))}
.progress-body:not([hidden]){animation:progress-text-in .18s ease-out both}
.progress-body p:last-child{animation:none}.progress-note{font-size:calc(12px * var(--ui-scale,1))}
@keyframes progress-text-in{from{opacity:.4;transform:translateY(calc(-2px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.stream-fragment,.thinking-label,.thinking .dots span,.progress-live .progress-title,.progress-body:not([hidden]){animation:none!important}.thinking-label,.progress-live .progress-title{background:none;color:var(--fg2);-webkit-text-fill-color:currentColor}.progress-toggle>svg{transition:none}}

/* 0.7: readable answers and an optional, isolated workspace. */
.msg-wrap,#inputInner{max-width:calc(1100px * var(--ui-scale,1))}.msg.ai .msg-content,.msg.ai .msg-content:has(.progress-panel){width:100%;max-width:100%}.msg.user .msg-content{max-width:85%}
.bubble{font-size:calc(14px * var(--ui-scale,1));line-height:1.7}.msg.ai .bubble{background:transparent;border:0;border-radius:0;padding:0;box-shadow:none;width:100%;white-space:normal}.msg.ai .bubble:has(.thinking){width:max-content;padding:calc(5px * var(--ui-scale,1)) 0}
.answer-body.answer-collapsed{max-height:18em;overflow:hidden}.answer-expand{align-self:flex-end;color:var(--accent);font-size:calc(12px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) 0 calc(5px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));min-height:calc(32px * var(--ui-scale,1))}.answer-expand[hidden]{display:none}.answer-expand:hover{text-decoration:underline}
.code-card{border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);overflow:hidden;margin:calc(12px * var(--ui-scale,1)) 0;white-space:normal}.code-card header{display:flex;gap:calc(8px * var(--ui-scale,1));align-items:center;justify-content:space-between;padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border)}.code-card header>span{overflow:hidden;text-overflow:ellipsis;min-width:0}.code-card header>div{display:flex;flex-shrink:0;gap:calc(4px * var(--ui-scale,1))}.code-card button{padding:calc(5px * var(--ui-scale,1));border-radius:calc(5px * var(--ui-scale,1))}.code-card button:hover{background:var(--hover);color:var(--fg)}.bubble .code-card pre{background:transparent;color:var(--fg);border-radius:0;margin:0;padding:calc(14px * var(--ui-scale,1));white-space:pre;line-height:1.6;font-size:calc(13px * var(--ui-scale,1))}.bubble .code-card pre code{padding:0;background:transparent;color:inherit;font-size:inherit;white-space:pre}.answer-heading{display:block;margin:calc(12px * var(--ui-scale,1)) 0 calc(4px * var(--ui-scale,1))}.math-display{display:block;max-width:100%;overflow-x:auto;padding:calc(3px * var(--ui-scale,1)) 0}.katex-display{margin:.7em 0}.katex{font-size:1.12em}.answer-color-accent{color:var(--accent)}.answer-color-blue{color:#2563eb}.answer-color-green{color:#15803d}.answer-color-amber{color:#a16207}.answer-color-red{color:#b91c1c}.answer-color-muted{color:var(--fg2)}body.dark .answer-color-blue{color:#93b4ff}body.dark .answer-color-green{color:#86dbad}body.dark .answer-color-amber{color:#f5ce78}body.dark .answer-color-red{color:#ff9c9c}
.msg-act.selected{color:var(--accent);background:var(--hover)}.attachment-open{align-self:center;color:var(--accent);padding:calc(6px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1))}
#pinnedMessages{border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);padding:calc(6px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));flex-shrink:0;background:var(--bg2)}#pinnedMessages[hidden],.pinned-list[hidden]{display:none}.pinned-toggle{padding:calc(5px * var(--ui-scale,1));color:var(--accent)}.pinned-list{max-height:calc(120px * var(--ui-scale,1));overflow:auto;display:flex;flex-direction:column}.pinned-list button{text-align:left;padding:calc(7px * var(--ui-scale,1));border-radius:calc(6px * var(--ui-scale,1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-list button:hover{background:var(--hover)}
.site-proposal{display:flex;align-items:center;justify-content:space-between;gap:calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0;border-radius:calc(10px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1))}.site-proposal button{color:var(--accent);padding:calc(6px * var(--ui-scale,1))}.site-proposal button:disabled{opacity:.6;cursor:default}
#voiceMeter,#musicBar{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0;background:var(--bg2);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));color:var(--fg2)}#voiceMeter[hidden],#musicBar[hidden]{display:none}#voiceBars{height:calc(28px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;gap:calc(3px * var(--ui-scale,1));flex:1}#voiceBars i{height:calc(3px * var(--ui-scale,1));width:calc(3px * var(--ui-scale,1));border-radius:calc(3px * var(--ui-scale,1));background:var(--accent);transition:height .1s linear}#voiceStop,#musicStop{padding:calc(6px * var(--ui-scale,1));color:var(--accent)}
#workspacePreview{width:clamp(calc(330px * var(--ui-scale,1)),39vw,calc(580px * var(--ui-scale,1)));height:100dvh;flex-shrink:0;display:flex;flex-direction:column;border-left:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg2);animation:workspace-in .4s cubic-bezier(.2,.7,.2,1)}#workspacePreview[hidden]{display:none}#workspacePreview>header{padding:calc(12px * var(--ui-scale,1));display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);min-height:calc(54px * var(--ui-scale,1))}#previewTitle{font-size:calc(13px * var(--ui-scale,1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:calc(20px * var(--ui-scale,1))}#workspacePreview header>div{display:flex;gap:calc(4px * var(--ui-scale,1))}#workspacePreview button{font-size:calc(12px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1));border-radius:calc(6px * var(--ui-scale,1))}#workspacePreview button:hover{background:var(--hover)}#workspacePreview button[hidden]{display:none}#previewNote{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);padding:calc(12px * var(--ui-scale,1));line-height:1.5}#previewBody{flex:1;min-height:0;overflow:auto;padding:0 calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1))}.preview-source{font:calc(12px * var(--ui-scale,1))/1.7 Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--fg)}.preview-frame{width:100%;height:100%;min-height:calc(300px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(8px * var(--ui-scale,1));background:#fff}.preview-image{display:block;max-width:100%;height:auto;border-radius:calc(8px * var(--ui-scale,1))}
.stage-icon{display:inline-flex;color:var(--accent);animation:stage-breathe 2.6s ease-in-out infinite}.stage-icon svg{width:calc(17px * var(--ui-scale,1));height:calc(17px * var(--ui-scale,1))}.thinking-label,.progress-live .progress-title{animation-duration:3.4s}.thinking .dots span{animation-duration:1.6s}.stream-fragment{animation-duration:.38s}.progress-body:not([hidden]){animation-duration:.3s}button,a{transition:color .25s,background-color .25s,opacity .25s,box-shadow .3s}button:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}
@keyframes workspace-in{from{opacity:0;transform:translateX(calc(12px * var(--ui-scale,1)))}to{opacity:1;transform:none}}@keyframes stage-breathe{0%,100%{opacity:.45}50%{opacity:1}}
@media(max-width:1000px){#workspacePreview{position:fixed;right:0;top:0;z-index:45;width:min(calc(580px * var(--ui-scale,1)),100vw);box-shadow:calc(-12px * var(--ui-scale,1)) 0 calc(45px * var(--ui-scale,1)) #0003}.preview-open #main{pointer-events:none}}
@media(max-width:600px){.msg-wrap{padding:0 calc(16px * var(--ui-scale,1))}.msg.user .msg-content{max-width:94%}.code-card header{padding:calc(8px * var(--ui-scale,1));gap:calc(4px * var(--ui-scale,1))}.code-card button{font-size:calc(11px * var(--ui-scale,1))}.code-card header>div{gap:calc(1px * var(--ui-scale,1))}#workspacePreview{width:100vw}.bubble{font-size:calc(14px * var(--ui-scale,1))}#voiceStatus{max-width:calc(110px * var(--ui-scale,1))}#voiceBars{gap:calc(2px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:reduce){#workspacePreview,.stage-icon{animation:none}.stream-fragment{animation:none!important}#voiceBars i,button,a{transition:none}}

/* 0.7.1: stable reading position, visible task motion and quiet controls. */
#messages{overflow-anchor:none;scrollbar-gutter:stable;scroll-behavior:auto}
#userInput,#userInput:focus,#userInput:focus-visible{outline:0!important;box-shadow:none!important;border:0!important;resize:none}
.msg.incoming{animation:quiet-message-in .65s ease-out both}.task-indicator{min-height:calc(30px * var(--ui-scale,1));margin:calc(2px * var(--ui-scale,1)) 0 calc(8px * var(--ui-scale,1));flex-shrink:0}.task-glyph{display:inline-flex;align-items:center;gap:calc(8px * var(--ui-scale,1));min-width:calc(24px * var(--ui-scale,1))}.task-indicator .thinking-label{display:inline-block;animation:thinking-light-wave 3.8s linear infinite;background:linear-gradient(105deg,var(--fg2) 25%,var(--fg2) 38%,var(--accent) 48%,var(--fg) 52%,var(--fg2) 64%);background-size:240% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.task-indicator .dots{display:inline-flex;gap:calc(4px * var(--ui-scale,1));align-items:center;height:calc(20px * var(--ui-scale,1))}.task-indicator .dots span{display:inline-block;width:calc(4px * var(--ui-scale,1));height:calc(4px * var(--ui-scale,1));border-radius:50%;background:var(--fg2);animation:thinking-dot-hop 1.8s ease-in-out infinite}.task-indicator .dots span:nth-child(2){animation-delay:.2s}.task-indicator .dots span:nth-child(3){animation-delay:.4s}.stage-icon{animation:stage-breathe 3s ease-in-out infinite!important}.answer-body:empty{display:none}.progress-body:not([hidden]){animation:none}
button:active:not(:disabled){transform:none}.msg.incoming,.language-transition{transform:none}.overlay.open,.modal-overlay.open,.modal.open{animation-duration:.4s}.open .modal-box,.confirm-modal.open .confirm-box{animation-duration:.45s}.overlay.closing,.overlay.closing .modal-box{animation-duration:.3s}.stream-fragment{animation-duration:.55s}body,#sidebar,#main,.input-box,.modal-box,.auth-box{transition:background-color .45s ease,color .4s ease,border-color .4s ease,box-shadow .4s ease}
.code-card header button,#workspacePreview header button{width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));display:inline-flex;align-items:center;justify-content:center;padding:calc(7px * var(--ui-scale,1));flex-shrink:0}.code-card header button svg{display:block}#previewClose{margin-left:calc(5px * var(--ui-scale,1))}#workspacePreview header>div{align-items:center}
.attachment-chip{gap:calc(9px * var(--ui-scale,1));align-items:center;flex-wrap:wrap}.attachment-preview-open{display:flex;gap:calc(8px * var(--ui-scale,1));align-items:center;flex-wrap:wrap;max-width:100%;text-align:left}.file-visual{display:inline-flex;align-items:center;justify-content:center;gap:calc(4px * var(--ui-scale,1));color:var(--fg2);flex-shrink:0}.attachment-chip .file-visual img,.attachment-chip .file-visual video{display:block!important;width:calc(48px * var(--ui-scale,1))!important;height:calc(42px * var(--ui-scale,1))!important;object-fit:cover;border-radius:calc(6px * var(--ui-scale,1));margin:0}.attachment-chip.generated-image .file-visual img{width:calc(130px * var(--ui-scale,1))!important;height:calc(96px * var(--ui-scale,1))!important}.file-visual small{font-size:calc(10px * var(--ui-scale,1));font-weight:600}.file-excerpt{flex-basis:100%;display:block;max-width:calc(330px * var(--ui-scale,1));color:var(--fg2);font-size:calc(11px * var(--ui-scale,1));line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attachment-chip>button:not(.attachment-preview-open){padding:calc(5px * var(--ui-scale,1))}.pinned-list-toggle{padding:calc(6px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));color:var(--accent)}.pinned-toggle:hover{text-decoration:underline}.preview-image:is(video){width:100%;max-height:65vh}
@keyframes quiet-message-in{from{opacity:.3}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.task-indicator .thinking-label,.task-indicator .dots span,.stage-icon,.msg.incoming{animation:none!important}.task-indicator .thinking-label{background:none;color:var(--fg2);-webkit-text-fill-color:currentColor}}
.language-transition{animation:language-fade .55s ease-out both}#authScreen.show .auth-box{animation-duration:.5s}.source-list:not([hidden]),#replyPreview:not([hidden]),.attachment-list{animation:quiet-message-in .5s ease-out both}
@keyframes language-fade{from{opacity:.5}to{opacity:1}}
#pinnedMessages{position:relative}.pinned-toggle{display:inline-block;max-width:calc(100% - calc(40px * var(--ui-scale,1)));vertical-align:middle;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-list-toggle{vertical-align:middle}
#attachmentPreview{max-height:calc(150px * var(--ui-scale,1));overflow:auto;align-items:flex-start}#attachmentPreview .attachment-chip{position:relative;display:block;width:calc(50% - calc(3px * var(--ui-scale,1)));max-width:calc(240px * var(--ui-scale,1));min-width:0;padding:calc(8px * var(--ui-scale,1)) calc(25px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}#attachmentPreview .attachment-preview-open{width:100%;min-width:0;font-size:calc(12px * var(--ui-scale,1));line-height:1.4;gap:calc(6px * var(--ui-scale,1))}#attachmentPreview .attachment-preview-open>span:not(.file-visual){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - calc(54px * var(--ui-scale,1)))}#attachmentPreview .file-excerpt{max-width:100%}#attachmentPreview .attachment-chip>button:last-child:not(.attachment-preview-open){position:absolute;top:calc(3px * var(--ui-scale,1));right:calc(3px * var(--ui-scale,1));width:calc(22px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));padding:0;font-size:calc(18px * var(--ui-scale,1))}.file-visual:has(video){position:relative}.video-badge{position:absolute;right:0;bottom:0;background:var(--bg2);border-radius:calc(3px * var(--ui-scale,1));display:flex}.video-badge svg{width:calc(12px * var(--ui-scale,1));height:calc(12px * var(--ui-scale,1))}.pinned-list-toggle svg{display:block;width:calc(14px * var(--ui-scale,1));height:calc(14px * var(--ui-scale,1))}

/* Dynamic viewport and stable mobile controls. */
:root{--app-height:100vh}@supports(height:100dvh){:root{--app-height:100dvh}}
body,#main,#sidebar,#workspacePreview{height:var(--app-height);min-height:0}
#messages,.sb-list{min-height:0;overscroll-behavior:contain;overflow-anchor:none}
.sb-bottom,.topbar,#inputArea{flex-shrink:0}
#inputArea{padding-bottom:max(calc(10px * var(--ui-scale,1)),env(safe-area-inset-bottom))}
#authScreen{height:var(--app-height);bottom:auto;padding:calc(76px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1)) max(calc(20px * var(--ui-scale,1)),env(safe-area-inset-bottom));scroll-padding-top:calc(76px * var(--ui-scale,1));overscroll-behavior:contain}
.auth-language{position:absolute;top:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-top));right:max(calc(16px * var(--ui-scale,1)),env(safe-area-inset-right))}
#authScreen.show .auth-box{animation:auth-steady-in .65s ease-out both;transform:none}
@keyframes auth-steady-in{from{opacity:.75}to{opacity:1}}
.session-offline #sessionRetry{position:fixed;display:block;right:calc(16px * var(--ui-scale,1));top:calc(64px * var(--ui-scale,1));z-index:120;background:var(--bg2)}
body.session-offline #sessionGate{display:contents}body.session-offline #sessionGate>:not(#sessionRetry){display:none}
button,a,.chat-item,input,textarea{transition-duration:.3s}
#sidebar{transition:transform .4s cubic-bezier(.2,.7,.2,1),background-color .4s,color .4s,border-color .4s}
.attachment-list{animation:none}.language-transition{animation:language-fade .65s ease-out both}
.stream-fragment{animation-duration:.35s}

 :where(html[data-layout="mobile"]) #sidebar,:where(html[data-layout="mobile"]) body.hidden #sidebar,:where(html[data-layout="mobile"]) body.collapsed #sidebar{position:fixed;top:0;left:0;width:min(calc(290px * var(--ui-scale,1)),88vw);height:var(--app-height);border-right:calc(1px * var(--ui-scale,1)) solid var(--border);overflow:hidden;transform:translateX(-100%);padding-top:env(safe-area-inset-top)}
 :where(html[data-layout="mobile"]) #sidebar.open,:where(html[data-layout="mobile"]) body.hidden #sidebar.open,:where(html[data-layout="mobile"]) body.collapsed #sidebar.open{transform:translateX(0)}
 :where(html[data-layout="mobile"]) body.collapsed .sb-bottom{flex-direction:column}:where(html[data-layout="mobile"]) body.collapsed .sb-row{flex-direction:row}
 :where(html[data-layout="mobile"]) .sb-bottom{padding-bottom:max(calc(10px * var(--ui-scale,1)),env(safe-area-inset-bottom))}
 :where(html[data-layout="mobile"]) #main{width:100%;max-width:100vw}:where(html[data-layout="mobile"]) .topbar{padding-top:env(safe-area-inset-top);min-height:calc(52px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #inputArea{padding-left:calc(12px * var(--ui-scale,1));padding-right:calc(12px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .modes{gap:calc(6px * var(--ui-scale,1));margin-bottom:calc(6px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .mode-btn{padding:calc(6px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #userInput,:where(html[data-layout="mobile"]) .auth-box .inp{font-size:calc(16px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) #userInput{max-height:calc(110px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) .auth-box{width:100%;max-width:calc(400px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .auth-language>button{min-height:calc(40px * var(--ui-scale,1))}
 :where(html[data-layout="mobile"]) #workspacePreview{height:var(--app-height);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
 :where(html[data-layout="mobile"]) .modal-box{max-height:calc(var(--app-height) - calc(32px * var(--ui-scale,1)))}:where(html[data-layout="mobile"]) #attachmentPreview{max-height:min(calc(120px * var(--ui-scale,1)),22vh)}

@media (max-height:500px){:where(html[data-layout="mobile"]) #inputArea{padding-top:calc(4px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .footer{padding-top:calc(3px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .modes{margin-bottom:calc(4px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .auth-box{padding:calc(22px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .sb-head{height:calc(48px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) .sb-bottom{padding-top:calc(6px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Composer tools, compact media picker and accessible arrow-only expansion. */
#inputInner{position:relative}.input-box{position:relative}
.composer-menu{position:absolute;left:0;bottom:calc(100% + calc(10px * var(--ui-scale,1)));z-index:90;width:min(calc(290px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));padding:calc(7px * var(--ui-scale,1));background:var(--bg2);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(16px * var(--ui-scale,1));box-shadow:0 calc(12px * var(--ui-scale,1)) calc(35px * var(--ui-scale,1)) #0002;animation:auth-steady-in .35s ease-out}
.composer-menu[hidden],#mobileFileChoices[hidden],#composerMode[hidden]{display:none!important}
.composer-menu>button{display:flex;width:100%;align-items:center;gap:calc(12px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));text-align:left;padding:calc(10px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1))}.composer-menu button:hover{background:var(--hover)}.composer-menu i{display:flex;align-items:center;color:var(--fg2)}#memoryComposerToggle[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 13%,var(--bg2));color:var(--accent)}#memoryComposerToggle[aria-pressed=true] i{color:var(--accent)}
#mobileFileChoices{display:grid;grid-template-columns:repeat(3,1fr);gap:calc(4px * var(--ui-scale,1));margin:calc(4px * var(--ui-scale,1)) 0 calc(8px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));background:var(--bg3)}#mobileFileChoices button{display:flex;flex-direction:column;align-items:center;gap:calc(8px * var(--ui-scale,1));min-height:calc(66px * var(--ui-scale,1));font-size:calc(11px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1));border-radius:calc(9px * var(--ui-scale,1))}
#composerMode{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));width:fit-content;color:var(--accent);background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));margin:calc(4px * var(--ui-scale,1)) 0 calc(7px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1))}#composerMode button{min-width:calc(30px * var(--ui-scale,1));min-height:calc(30px * var(--ui-scale,1));font-size:calc(20px * var(--ui-scale,1))}
.answer-expand{min-width:calc(36px * var(--ui-scale,1));min-height:calc(36px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;margin-left:auto}.answer-expand svg{transition:transform .4s}.answer-expand[aria-expanded=true] svg{transform:rotate(180deg)}
#workspacePreview>header{position:sticky;top:0;background:var(--bg2);z-index:2;flex-shrink:0}#previewTitle{font-weight:600}
#supportModal{z-index:1300}#supportModal .modal-box{max-width:calc(520px * var(--ui-scale,1))}#supportNote{line-height:1.6;font-size:calc(13px * var(--ui-scale,1));color:var(--fg2);margin-bottom:calc(16px * var(--ui-scale,1))}#supportAddresses{display:flex;flex-direction:column;gap:calc(8px * var(--ui-scale,1))}#supportAddresses a{color:var(--accent);padding:calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.composer-menu,.answer-expand svg{animation:none!important;transition:none!important}}

#developerBadge{padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--accent);border-radius:calc(10px * var(--ui-scale,1));color:var(--accent);font-size:calc(13px * var(--ui-scale,1));margin-bottom:calc(15px * var(--ui-scale,1))}#developerBadge[hidden]{display:none}

.composer-menu{max-height:calc(var(--app-height) - calc(120px * var(--ui-scale,1)));overflow-y:auto;overscroll-behavior:contain}

/* Chat policy and workspace mode */
#composerMode{width:auto;margin:0;border-radius:0;padding:calc(9px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1));border:0;background:color-mix(in srgb,var(--accent) 16%,var(--bg));color:var(--accent);flex-shrink:0;justify-content:space-between;font-size:calc(13px * var(--ui-scale,1))}#composerMode button{margin-left:auto}
#chatLimitNotice{padding:calc(18px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));color:var(--fg2);text-align:center;font-size:calc(14px * var(--ui-scale,1))}#chatLimitNotice[hidden],.input-box[hidden]{display:none!important}
.delivery-failed{display:flex;align-items:center;gap:calc(6px * var(--ui-scale,1));color:#e34850;font-size:calc(12px * var(--ui-scale,1));margin-top:calc(7px * var(--ui-scale,1))}.delivery-failed>span{display:inline-flex;align-items:center;justify-content:center;width:calc(15px * var(--ui-scale,1));height:calc(15px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid currentColor;border-radius:50%;font-weight:700}
/* Inline skill prefixes are controls, not prompt text. */
.composer-editor{display:flex;align-items:center;flex:1;flex-wrap:wrap;gap:calc(4px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1));min-width:0;align-self:center;padding:calc(2px * var(--ui-scale,1)) 0}
.composer-editor #userInput{flex:1 1 calc(120px * var(--ui-scale,1));width:0;min-width:calc(90px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1))}
#composerMode.skill-chip,#uploadSkill.skill-chip{display:inline-flex;align-items:center;justify-content:flex-start;gap:calc(5px * var(--ui-scale,1));flex:0 1 auto;max-width:100%;width:auto;padding:calc(4px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));margin:0;border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 25%,transparent);border-radius:calc(8px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 11%,var(--bg3));color:var(--accent);font-size:calc(12px * var(--ui-scale,1));line-height:calc(18px * var(--ui-scale,1));animation:skill-appear .35s ease-out}
.skill-chip i{display:inline-flex;flex-shrink:0;font-style:normal}.skill-chip span{min-width:0;overflow-wrap:anywhere}.skill-chip button,#composerMode.skill-chip button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin:0;min-width:calc(24px * var(--ui-scale,1));min-height:calc(24px * var(--ui-scale,1));width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));border-radius:calc(5px * var(--ui-scale,1));color:inherit;font-size:calc(18px * var(--ui-scale,1));opacity:0;transition:opacity .25s ease,background-color .25s ease}
.skill-chip:hover button,.skill-chip:focus-within button{opacity:1}.skill-chip button:hover{background:color-mix(in srgb,var(--accent) 15%,transparent)}#uploadSkill[hidden]{display:none!important}
@media(hover:none),(pointer:coarse){.skill-chip button,#composerMode.skill-chip button{opacity:1;min-width:calc(30px * var(--ui-scale,1));min-height:calc(30px * var(--ui-scale,1))}}
@keyframes skill-appear{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){#composerMode.skill-chip,#uploadSkill.skill-chip{animation:none}.skill-chip button{transition:none}}
#composerMode.skill-chip:hover button,#composerMode.skill-chip:focus-within button{opacity:1}

/* Slow, anchored feedback: no button displacement and no text layout animation. */
@media(prefers-reduced-motion:no-preference){
 button,a,[role="button"]{transition:background-color .38s ease,color .38s ease,border-color .38s ease,box-shadow .45s ease,opacity .35s ease;}
 button:hover:not(:disabled){box-shadow:inset 0 0 0 calc(999px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 7%,transparent);}
 button:active:not(:disabled){transform:none;box-shadow:inset 0 0 0 calc(999px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 15%,transparent);}
 .task-indicator .thinking-label{animation:thinking-light-wave 3.6s linear infinite;background-image:linear-gradient(105deg,var(--fg2) 24%,var(--fg2) 36%,var(--accent) 47%,var(--fg) 52%,var(--fg2) 65%);background-size:260% 100%;}
 .task-indicator .dots span{animation:thinking-dot-hop 1.9s ease-in-out infinite;will-change:transform;}
 .task-indicator .dots span:nth-child(2){animation-delay:.22s}.task-indicator .dots span:nth-child(3){animation-delay:.44s}
 .stream-fragment{animation-duration:.7s}
}
#composerMode.skill-chip{flex-wrap:nowrap;align-items:center;gap:calc(6px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1));min-height:calc(32px * var(--ui-scale,1));}
#composerMode.skill-chip>i{align-items:center;justify-content:center;line-height:1}
#composerMode.skill-chip>span{line-height:calc(20px * var(--ui-scale,1))}
#composerMode.skill-chip #clearComposerMode{display:inline-flex;align-items:center;justify-content:center;align-self:center;flex:0 0 calc(26px * var(--ui-scale,1));width:calc(26px * var(--ui-scale,1));height:calc(26px * var(--ui-scale,1));min-width:calc(26px * var(--ui-scale,1));min-height:calc(26px * var(--ui-scale,1));margin:0;padding:0;line-height:1;position:static;}
#clearComposerMode svg{display:block;flex:none;width:calc(14px * var(--ui-scale,1));height:calc(14px * var(--ui-scale,1));pointer-events:none;}
#uploadSkill{display:none!important}
.checkout-security{font-size:calc(13px * var(--ui-scale,1));color:var(--fg2);line-height:1.7;margin:calc(12px * var(--ui-scale,1)) 0 calc(18px * var(--ui-scale,1))}.checkout-summary{font-size:calc(16px * var(--ui-scale,1));line-height:1.6}
@media(hover:none),(pointer:coarse){#composerMode.skill-chip #clearComposerMode{opacity:1;flex-basis:calc(32px * var(--ui-scale,1));width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));min-width:calc(32px * var(--ui-scale,1));min-height:calc(32px * var(--ui-scale,1))}}

:root{--pongy-build:"0.29.4"}
#chatViewport{position:relative;display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
#chatViewport>#messages{width:100%;min-height:0}
#scrollToEnd{position:absolute;right:calc(22px * var(--ui-scale,1));bottom:calc(16px * var(--ui-scale,1));width:calc(42px * var(--ui-scale,1));height:calc(42px * var(--ui-scale,1));min-width:calc(42px * var(--ui-scale,1));min-height:calc(42px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:50%;background:var(--bg2);color:var(--fg);box-shadow:0 calc(4px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) #0002;z-index:8;}
#scrollToEnd svg{display:block}#scrollToEnd[hidden],#voiceHelp[hidden],#voiceInstall[hidden],#voiceRetry[hidden],#buildNotice[hidden]{display:none!important}
#voiceHelp,#buildNotice{margin:calc(6px * var(--ui-scale,1)) 0 calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg2);font-size:calc(12px * var(--ui-scale,1));line-height:1.6}
#voiceHelp>div{display:flex;align-items:center;flex-wrap:wrap;gap:calc(8px * var(--ui-scale,1));margin-top:calc(6px * var(--ui-scale,1))}#voiceHelp button,#buildNotice button{padding:calc(6px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1));border-radius:calc(7px * var(--ui-scale,1));color:var(--accent);min-height:calc(32px * var(--ui-scale,1))}#voiceHelpClose{margin-left:auto}#buildNotice{margin-bottom:calc(3px * var(--ui-scale,1))}.motion-setting{margin-bottom:calc(18px * var(--ui-scale,1))}.motion-setting select{width:100%}#motionHint{font-size:calc(12px * var(--ui-scale,1));line-height:1.6;color:var(--fg2);margin-top:calc(8px * var(--ui-scale,1))}
:root[data-motion="reduced"] *,:root[data-motion="reduced"] *::before,:root[data-motion="reduced"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
:root[data-motion="reduced"] .thinking-label,:root[data-motion="reduced"] .progress-title{background:none!important;color:var(--fg2)!important;-webkit-text-fill-color:currentColor!important}
/* Full motion is an explicit device preference, never a silent override of accessibility settings. */
:root[data-motion="full"] .task-indicator .thinking-label,:root[data-motion="full"] .progress-live .progress-title{background-image:linear-gradient(105deg,var(--fg2) 24%,var(--fg2) 36%,var(--accent) 47%,var(--fg) 52%,var(--fg2) 65%)!important;background-size:260% 100%!important;background-clip:text!important;-webkit-background-clip:text!important;color:transparent!important;-webkit-text-fill-color:transparent!important;animation:thinking-light-wave 3.6s linear infinite!important}
:root[data-motion="full"] .task-indicator .dots span{animation:thinking-dot-hop 1.9s ease-in-out infinite!important;transform:translateY(0);will-change:transform}
:root[data-motion="full"] .task-indicator .dots span:nth-child(2){animation-delay:.22s!important}:root[data-motion="full"] .task-indicator .dots span:nth-child(3){animation-delay:.44s!important}
:root[data-motion="full"] .stage-icon{animation:stage-breathe 3s ease-in-out infinite!important}:root[data-motion="full"] .stream-fragment{animation:answer-fragment-in .7s ease-out both!important}
:root[data-motion="full"] button,:root[data-motion="full"] a{transition:background-color .38s ease,color .38s ease,border-color .38s ease,box-shadow .45s ease,opacity .35s ease!important}
:root[data-motion="full"] button:hover:not(:disabled){box-shadow:inset 0 0 0 calc(999px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 7%,transparent)}
:root[data-motion="full"] button:active:not(:disabled){box-shadow:inset 0 0 0 calc(999px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 15%,transparent)}
:where(html[data-layout="mobile"]) #scrollToEnd{right:calc(16px * var(--ui-scale,1));bottom:calc(12px * var(--ui-scale,1));width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1))}:where(html[data-layout="mobile"]) #voiceHelp button{min-height:calc(40px * var(--ui-scale,1))}
:root[data-motion="full"] .overlay.open,:root[data-motion="full"] .modal-overlay.open,:root[data-motion="full"] .modal.open{animation:overlayIn .4s ease both!important}
:root[data-motion="full"] .open .modal-box,:root[data-motion="full"] .confirm-modal.open .confirm-box{animation:glass-panel-in .45s cubic-bezier(.22,.8,.25,1) both!important}
:root[data-motion="full"] body,:root[data-motion="full"] #sidebar,:root[data-motion="full"] #main,:root[data-motion="full"] .input-box,:root[data-motion="full"] .modal-box,:root[data-motion="full"] .auth-box{transition:background-color .45s ease,color .4s ease,border-color .4s ease,box-shadow .4s ease!important}
:root[data-motion="full"] .language-transition{animation:language-fade .55s ease-out both!important}

/* Stable, theme-aware stop action and input-driven microphone levels. */
#stopBtn{padding:0;align-items:center;justify-content:center;border:0;border-radius:50%;line-height:0;box-shadow:none!important;transform:none!important}
#stopBtn svg{display:block;flex:none;width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));margin:0;pointer-events:none}
#stopBtn:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
#stopBtn:hover{opacity:.86}#stopBtn:active{opacity:.72}
#voiceMeter{flex-wrap:wrap}#voiceBars i{animation:none!important;transition:none!important;will-change:height}
#voiceLevelStatus{flex:1 0 100%;font-size:calc(11px * var(--ui-scale,1));line-height:1.5}#voiceLevelStatus[hidden]{display:none}
/* Keep the animation phase across source/tool/fallback re-renders. */
.task-indicator{overflow:visible;animation:none!important;opacity:1}
.task-indicator .task-glyph{flex-shrink:0;overflow:visible}
.task-indicator .dots{gap:calc(5px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));overflow:visible}
@keyframes thinking-dot-hop{0%,62%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(calc(-5px * var(--ui-scale,1)));opacity:1}}
@media(prefers-reduced-motion:no-preference){:root:not([data-motion="reduced"]) .task-indicator .thinking-label{background-image:linear-gradient(105deg,var(--fg2) 25%,var(--fg2) 40%,var(--accent) 47%,var(--fg) 51%,var(--accent) 55%,var(--fg2) 64%)!important;background-size:260% 100%!important;background-clip:text!important;-webkit-background-clip:text!important;color:transparent!important;-webkit-text-fill-color:transparent!important;animation:thinking-light-wave 3.2s linear infinite!important;animation-delay:var(--task-phase,0s)!important}
:root:not([data-motion="reduced"]) .task-indicator .dots span{width:calc(5px * var(--ui-scale,1));height:calc(5px * var(--ui-scale,1));animation:thinking-dot-hop 1.8s ease-in-out infinite!important;animation-delay:var(--task-phase,0s)!important}
:root:not([data-motion="reduced"]) .task-indicator .dots span:nth-child(2){animation-delay:calc(var(--task-phase,0s) + .2s)!important}:root:not([data-motion="reduced"]) .task-indicator .dots span:nth-child(3){animation-delay:calc(var(--task-phase,0s) + .4s)!important}
}
:root[data-motion="full"] .task-indicator .thinking-label{background-image:linear-gradient(105deg,var(--fg2) 25%,var(--fg2) 40%,var(--accent) 47%,var(--fg) 51%,var(--accent) 55%,var(--fg2) 64%)!important;background-size:260% 100%!important;background-clip:text!important;-webkit-background-clip:text!important;color:transparent!important;-webkit-text-fill-color:transparent!important;animation:thinking-light-wave 3.2s linear infinite!important;animation-delay:var(--task-phase,0s)!important}
:root[data-motion="full"] .task-indicator .dots span{width:calc(5px * var(--ui-scale,1));height:calc(5px * var(--ui-scale,1));animation:thinking-dot-hop 1.8s ease-in-out infinite!important;animation-delay:var(--task-phase,0s)!important}
:root[data-motion="full"] .task-indicator .dots span:nth-child(2){animation-delay:calc(var(--task-phase,0s) + .2s)!important}:root[data-motion="full"] .task-indicator .dots span:nth-child(3){animation-delay:calc(var(--task-phase,0s) + .4s)!important}

.task-indicator .stage-icon{animation-delay:var(--task-phase,0s)!important}

/* Unified controls: stable geometry, quiet depth, no hover translation. */
:root{--control-radius:calc(12px * var(--ui-scale,1));--panel-radius:calc(20px * var(--ui-scale,1));--control-ease:cubic-bezier(.22,.61,.36,1);--panel-shadow:0 calc(12px * var(--ui-scale,1)) calc(34px * var(--ui-scale,1)) rgba(17,24,39,.07)}
body.dark{--panel-shadow:0 calc(12px * var(--ui-scale,1)) calc(34px * var(--ui-scale,1)) rgba(0,0,0,.19)}
.icon-btn,.chat-act,.preview-head button,.modal-head button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:1;border-radius:var(--control-radius)}
.icon-btn svg,.chat-act svg,.preview-head button svg,.modal-head button svg{display:block;flex-shrink:0}
button:focus-visible,a:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
.site-proposal{border-radius:calc(14px * var(--ui-scale,1));background:var(--bg2);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) rgba(17,24,39,.025);gap:calc(14px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));align-items:center}
.site-proposal>span{min-width:0;overflow-wrap:anywhere;line-height:1.5}
.site-proposal button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-height:calc(34px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 24%,var(--border));border-radius:calc(10px * var(--ui-scale,1));line-height:1.2;font-weight:500;background:color-mix(in srgb,var(--accent) 6%,var(--bg))}
.site-proposal button:disabled{color:var(--fg2);border-color:var(--border);background:transparent;opacity:.8;cursor:default}
.composer-menu,.auth-lang-menu{border-radius:calc(16px * var(--ui-scale,1));box-shadow:var(--panel-shadow)}
.composer-menu>button{border-radius:calc(11px * var(--ui-scale,1));gap:calc(12px * var(--ui-scale,1));line-height:1.4}
.skill-chip{border-radius:calc(10px * var(--ui-scale,1))}.skill-chip>button{display:inline-flex;align-items:center;justify-content:center;line-height:1}
.code-card{border-radius:calc(14px * var(--ui-scale,1));overflow:hidden}.code-card header{align-items:center;min-height:calc(42px * var(--ui-scale,1));gap:calc(12px * var(--ui-scale,1))}.code-card header>div{display:flex;align-items:center;gap:calc(4px * var(--ui-scale,1))}.code-card header button{display:inline-flex;align-items:center;justify-content:center;width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));line-height:1;border-radius:calc(8px * var(--ui-scale,1))}
.msg-actions button{display:inline-flex;align-items:center;justify-content:center;gap:calc(5px * var(--ui-scale,1));line-height:1.35;border-radius:calc(8px * var(--ui-scale,1));min-height:calc(30px * var(--ui-scale,1))}
@media(prefers-reduced-motion:no-preference){.icon-btn,.chat-act,.site-proposal button,.code-card header button,.msg-actions button,.composer-menu>button,.skill-chip{transition:background-color .42s var(--control-ease),color .42s var(--control-ease),border-color .42s var(--control-ease),box-shadow .48s var(--control-ease),opacity .35s ease}}
:root[data-motion="full"] .icon-btn,:root[data-motion="full"] .site-proposal button,:root[data-motion="full"] .code-card header button,:root[data-motion="full"] .msg-actions button,:root[data-motion="full"] .composer-menu>button{transition:background-color .42s var(--control-ease),color .42s var(--control-ease),border-color .42s var(--control-ease),box-shadow .48s var(--control-ease),opacity .35s ease}
:root[data-motion="reduced"] .icon-btn,:root[data-motion="reduced"] .site-proposal button,:root[data-motion="reduced"] .code-card header button,:root[data-motion="reduced"] .msg-actions button,:root[data-motion="reduced"] .composer-menu>button{transition:none}

/* 0.18.0: shared, layout-stable motion and synchronous settings commits. */
:root{--motion-ease:cubic-bezier(.22,.7,.25,1);--motion-enter:.42s;--motion-exit:.3s}
.sb-title{font-family:"Trebuchet MS","Segoe UI",sans-serif;font-weight:700;letter-spacing:calc(-.4px * var(--ui-scale,1));font-size:calc(16px * var(--ui-scale,1));overflow:visible}
.brand-letter{display:inline-block}#logoTop{padding:0;display:block;cursor:pointer}#logoTop:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
.message-time{font-size:calc(11px * var(--ui-scale,1));line-height:1.6;color:var(--fg2);white-space:nowrap;align-self:center;flex:none;opacity:0;transition:opacity .35s ease;padding:0 calc(6px * var(--ui-scale,1));font-variant-numeric:tabular-nums}
.msg:hover .message-time,.msg:focus-within .message-time{opacity:1}.msg.user .message-time{margin-right:calc(4px * var(--ui-scale,1))}.msg.ai .message-time{margin-left:calc(4px * var(--ui-scale,1))}
@media(hover:none),(pointer:coarse){.message-time{opacity:1}}
/* One frame updates ALL palette and translated UI, without staggered old colors. */
@layer pongy-settings-sync{html body.settings-commit,html body.settings-commit *,html body.settings-commit *::before,html body.settings-commit *::after{transition:none!important}}
html body.settings-commit .language-transition{animation:none!important}
@media(prefers-reduced-motion:no-preference){
 :root:not([data-motion="reduced"]) button,:root:not([data-motion="reduced"]) a{transition:background-color .32s var(--motion-ease),color .32s var(--motion-ease),border-color .32s var(--motion-ease),box-shadow .36s var(--motion-ease),opacity .3s ease}
 :root:not([data-motion="reduced"]) button:hover:not(:disabled){box-shadow:inset 0 0 0 calc(999px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 6%,transparent)}
 :root:not([data-motion="reduced"]) button:active:not(:disabled){box-shadow:inset 0 0 0 calc(999px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 13%,transparent)}
 :root:not([data-motion="reduced"]) .composer-menu,:root:not([data-motion="reduced"]) #authLanguageMenu,:root:not([data-motion="reduced"]) #agentPopup{animation:quiet-surface-in .42s var(--motion-ease) both}
 :root:not([data-motion="reduced"]) .progress-body:not([hidden]),:root:not([data-motion="reduced"]) .pinned-list:not([hidden]),:root:not([data-motion="reduced"]) details[open]>*:not(summary){animation:quiet-surface-in .42s var(--motion-ease) both}
}
:root[data-motion="full"] .composer-menu,:root[data-motion="full"] #authLanguageMenu,:root[data-motion="full"] #agentPopup,:root[data-motion="full"] .progress-body:not([hidden]),:root[data-motion="full"] .pinned-list:not([hidden]){animation:quiet-surface-in .42s var(--motion-ease) both!important}
html .overlay.open.closing,html .confirm-modal.open.closing,html .modal.open.closing{animation:overlayOut .3s ease both!important;pointer-events:none}
html .overlay.open.closing .modal-box,html .confirm-modal.open.closing .confirm-box,html .modal.open.closing .modal-box{animation:quiet-surface-out .3s var(--motion-ease) both!important}
@keyframes quiet-surface-in{from{opacity:0;transform:translateY(calc(4px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}
@keyframes quiet-surface-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(calc(4px * var(--ui-scale,1)))}}
:root[data-motion="reduced"] .message-time{transition:none}
:root[data-motion="reduced"] .overlay.open.closing,:root[data-motion="reduced"] .overlay.open.closing .modal-box{animation:none!important}
@media(prefers-reduced-motion:reduce){:root:not([data-motion="full"]) .overlay.open.closing,:root:not([data-motion="full"]) .overlay.open.closing .modal-box{animation:none!important}}

:root[data-motion="full"] .overlay.open.closing,:root[data-motion="full"] .confirm-modal.open.closing,:root[data-motion="full"] .modal.open.closing{animation:overlayOut .3s ease both!important;pointer-events:none}
:root[data-motion="full"] .overlay.open.closing .modal-box,:root[data-motion="full"] .confirm-modal.open.closing .confirm-box,:root[data-motion="full"] .modal.open.closing .modal-box{animation:quiet-surface-out .3s var(--motion-ease) both!important}
/* Notes workspace and restrained tactile motion. */
#logoTop{overflow:visible;border-radius:0}#logoTop img{border-radius:0}.sb-head{overflow:visible}.sb-title{overflow:visible}
#workspaceSwitch{position:relative;display:grid;grid-template-columns:1fr 1fr;margin:0 calc(10px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(15px * var(--ui-scale,1));background:var(--bg3);isolation:isolate;flex-shrink:0}
#workspaceSwitch button{z-index:1;display:flex;align-items:center;justify-content:center;gap:calc(7px * var(--ui-scale,1));min-height:calc(34px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));border-radius:calc(11px * var(--ui-scale,1));color:var(--fg2);transition:color .3s ease,transform .4s cubic-bezier(.22,.8,.2,1)}#workspaceSwitch button[aria-selected=true]{color:var(--fg)}
.workspace-slider{position:absolute;inset:calc(4px * var(--ui-scale,1)) auto calc(4px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1));width:calc(50% - calc(4px * var(--ui-scale,1)));border-radius:calc(11px * var(--ui-scale,1));background:var(--bg);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) #0000000d;border:calc(1px * var(--ui-scale,1)) solid var(--border);transition:transform .55s cubic-bezier(.22,.85,.25,1.08)}#workspaceSwitch[data-section=notes] .workspace-slider{transform:translateX(100%)}
body.collapsed #workspaceSwitch{margin:0 calc(5px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));display:flex;flex-direction:column;padding:calc(3px * var(--ui-scale,1))}body.collapsed #workspaceSwitch span:not(.workspace-slider){display:none}body.collapsed .workspace-slider{display:none}body.collapsed #workspaceSwitch button[aria-selected=true]{background:var(--bg)}
#notesEditor{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;background:var(--bg);overflow:hidden}#notesEditor[hidden]{display:none!important}
body.notes-active #chatViewport,body.notes-active #inputArea,body.notes-active #pinnedMessages{display:none!important}
.note-scroll{flex:1;min-height:0;overflow:auto;padding:calc(32px * var(--ui-scale,1)) clamp(calc(16px * var(--ui-scale,1)),5vw,calc(72px * var(--ui-scale,1)));scrollbar-gutter:stable;overscroll-behavior:contain}#noteTitle{display:block;width:100%;background:none;border:0;font-size:calc(30px * var(--ui-scale,1));font-weight:750;line-height:1.3;margin-bottom:calc(22px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) 0}#noteBody{font-size:calc(14px * var(--ui-scale,1));line-height:1.7;min-height:50vh;outline:0;overflow-wrap:anywhere;white-space:pre-wrap}#noteBody:empty:before{content:attr(data-placeholder);color:var(--fg2);pointer-events:none}#noteBody blockquote{border-left:calc(3px * var(--ui-scale,1)) solid var(--accent);padding:calc(6px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin:calc(6px * var(--ui-scale,1)) 0}#noteBody [data-spoiler=true]{filter:blur(calc(4px * var(--ui-scale,1)));transition:filter .4s}#noteBody [data-spoiler=true]:hover{filter:none}#noteBody p,#noteBody div{min-height:1em}
#noteToolbar{display:flex;align-items:center;gap:calc(3px * var(--ui-scale,1));flex-wrap:wrap;border-top:calc(1px * var(--ui-scale,1)) solid var(--border);padding:calc(9px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));background:var(--bg2)}.note-tool{display:inline-flex;align-items:center;justify-content:center;width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));flex-shrink:0;color:var(--fg2)}.note-tool:hover{background:var(--hover);color:var(--fg)}.note-tool:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent)}.note-toolbar-divider{width:calc(1px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1));background:var(--border);margin:0 calc(5px * var(--ui-scale,1))}#noteFontSize{background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(9px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1))}
.note-save-row{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));padding:calc(5px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1)) max(calc(8px * var(--ui-scale,1)),env(safe-area-inset-bottom));font-size:calc(11px * var(--ui-scale,1));color:var(--fg2)}#noteStatus{flex:1}#noteSave,#noteCopy{padding:calc(3px * var(--ui-scale,1)) calc(7px * var(--ui-scale,1));min-width:calc(28px * var(--ui-scale,1));min-height:calc(24px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1))}.note-error,.response-interrupted{color:var(--danger)}.response-interrupted{font-size:calc(13px * var(--ui-scale,1));display:flex;align-items:center;gap:calc(6px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) 0}.response-interrupted span{font-size:calc(17px * var(--ui-scale,1))}
.note-files{display:flex;gap:calc(10px * var(--ui-scale,1));flex-wrap:wrap;margin:calc(10px * var(--ui-scale,1)) 0}.note-file{display:flex;align-items:center;gap:calc(9px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);padding:calc(8px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));max-width:calc(260px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));background:var(--bg2)}.note-file.selected{border-color:var(--accent)}.note-file img{width:calc(72px * var(--ui-scale,1));height:calc(54px * var(--ui-scale,1));object-fit:cover;border-radius:calc(6px * var(--ui-scale,1))}.note-file span{overflow:hidden;text-overflow:ellipsis}#noteFileActions{display:flex;align-items:center;gap:calc(5px * var(--ui-scale,1));padding:0 calc(12px * var(--ui-scale,1));min-height:0;background:var(--bg2)}#noteFileActions:not(:empty){padding-top:calc(5px * var(--ui-scale,1));padding-bottom:calc(5px * var(--ui-scale,1));border-top:calc(1px * var(--ui-scale,1)) solid var(--border)}#noteFileActions a{font-size:calc(12px * var(--ui-scale,1));color:var(--accent)}.note-proposal{flex-direction:column;align-items:stretch;gap:calc(10px * var(--ui-scale,1))}.note-proposal-preview{max-height:calc(180px * var(--ui-scale,1));overflow:auto;white-space:pre-wrap;font-size:calc(13px * var(--ui-scale,1))}.sent-skill{display:inline-flex;align-items:center;gap:calc(6px * var(--ui-scale,1));align-self:flex-end;border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 35%,transparent);border-radius:calc(9px * var(--ui-scale,1));padding:calc(5px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));font-size:calc(11px * var(--ui-scale,1));color:var(--accent);margin-bottom:calc(5px * var(--ui-scale,1))}.answer-body.answer-collapsed{max-height:var(--answer-clamp-height,none);overflow:hidden;-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 78%,rgba(0,0,0,.78) 88%,rgba(0,0,0,.3) 97%,transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 78%,rgba(0,0,0,.78) 88%,rgba(0,0,0,.3) 97%,transparent 100%)}
button:not(:disabled){transition:background-color .3s ease,color .3s ease,box-shadow .3s ease,transform .42s cubic-bezier(.2,.85,.25,1),border-radius .4s ease}button:not(:disabled):active{transform:scale(.96)}#sendBtn{transform-origin:50% 60%;transition:background-color .3s,transform .5s cubic-bezier(.2,.85,.25,1.25),border-radius .5s}#sendBtn:not(:disabled):active{transform:scale(.88,.94);border-radius:45% 55% 48% 52%}#sendBtn.send-pop{animation:sendBubble .6s cubic-bezier(.22,.7,.25,1)}@keyframes sendBubble{0%,100%{transform:scale(1)}25%{transform:scale(.87,.94);border-radius:45% 55% 48% 52%}58%{transform:scale(1.05,.96)}80%{transform:scale(.98,1.02)}}
@media(max-width:600px){.note-scroll{padding:calc(18px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1))}#noteTitle{font-size:calc(26px * var(--ui-scale,1))}#noteToolbar{gap:calc(1px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}.note-tool{width:calc(32px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1))}.note-save-row{padding-bottom:max(calc(8px * var(--ui-scale,1)),env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) #workspaceSwitch *,html:not([data-motion=full]) #sendBtn{animation:none!important;transition:none!important}}html[data-motion=reduced] #workspaceSwitch *,html[data-motion=reduced] #sendBtn{animation:none!important;transition:none!important}
#chatList [data-note-id] .chat-actions .note-tool{width:calc(24px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));border-radius:calc(6px * var(--ui-scale,1))}#chatList [data-note-id] .chat-actions svg{width:calc(13px * var(--ui-scale,1));height:calc(13px * var(--ui-scale,1))}
@media(hover:none){#chatList [data-note-id] .chat-actions{display:flex}}
body.notes-active #shareBtn{display:inline-flex}#noteSave,#noteCopy{display:inline-flex;align-items:center;justify-content:center}
/* Public work journal; real actions, never a simulated private monologue. */
.work-entry{padding:calc(8px * var(--ui-scale,1)) 0;border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);font-size:calc(13px * var(--ui-scale,1));line-height:1.65}.work-entry:last-child{border:0}.work-plan ol{padding-left:calc(22px * var(--ui-scale,1));margin:calc(7px * var(--ui-scale,1)) 0}.work-plan li{padding:calc(3px * var(--ui-scale,1)) 0}.code-check{white-space:pre-wrap;overflow-wrap:anywhere}.check-passed{color:var(--success)}.check-failed{color:var(--danger)}.code-check pre{max-height:calc(180px * var(--ui-scale,1));overflow:auto;font-size:calc(11px * var(--ui-scale,1));background:var(--bg3);border-radius:calc(8px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1));color:var(--fg2)}
#developerBadge{display:flex;justify-content:center;align-items:center;padding:calc(15px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border-radius:calc(15px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 45%,var(--border));background:linear-gradient(115deg,color-mix(in srgb,var(--accent) 12%,var(--bg2)),var(--bg2));box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 #ffffff12}.developer-identity{display:inline-flex;align-items:center;justify-content:center;gap:calc(9px * var(--ui-scale,1));font-weight:750;text-align:center}.dev-symbol{display:inline-flex;align-items:center;justify-content:center;width:calc(32px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 15%,transparent);border-radius:calc(8px * var(--ui-scale,1));font-family:ui-monospace,monospace;font-weight:800;font-size:calc(14px * var(--ui-scale,1))}.developer-identity strong{font-weight:750}
.progress-toggle svg,.source-toggle svg,.pinned-toggle svg{transition:transform .48s cubic-bezier(.22,.75,.2,1)}.progress-toggle[aria-expanded=true] svg,.source-toggle[aria-expanded=true] svg{transform:rotate(180deg)}.note-tool svg,.icon-btn svg,.tb-btn svg,.mode-btn svg,.chat-act svg{transition:transform .45s cubic-bezier(.22,.8,.25,1),opacity .35s ease}
@media(hover:hover){.note-tool:hover svg,.icon-btn:hover svg,.tb-btn:hover svg,.mode-btn:hover svg{transform:none}.chat-act:hover svg{transform:scale(1.08)}}
body.notes-active #notesEditor .note-scroll{animation:quiet-surface-in .55s var(--motion-ease) both}.progress-body,.source-list{transform-origin:top}.answer-body{transition:max-height .48s cubic-bezier(.22,.75,.2,1)}
:root[data-motion=reduced] .note-tool svg,:root[data-motion=reduced] .icon-btn svg,:root[data-motion=reduced] .tb-btn svg,:root[data-motion=reduced] .mode-btn svg,:root[data-motion=reduced] .chat-act svg,:root[data-motion=reduced] .answer-body{transition:none!important;transform:none!important}
@media(prefers-reduced-motion:reduce){:root:not([data-motion=full]) .note-tool svg,:root:not([data-motion=full]) .icon-btn svg,:root:not([data-motion=full]) .tb-btn svg,:root:not([data-motion=full]) .mode-btn svg,:root:not([data-motion=full]) .chat-act svg,:root:not([data-motion=full]) .answer-body{transition:none!important;transform:none!important}:root:not([data-motion=full]) #notesEditor .note-scroll{animation:none!important}}
.code-card .syntax-keyword{color:#c9a7ff}.code-card .syntax-string{color:#9bd3af}.code-card .syntax-number{color:#f3c899}.code-card .syntax-comment{color:#929ba9;font-style:italic}.code-card .syntax-tag{color:#8ecdf2}.code-card pre{tab-size:2;line-height:1.65}.code-card header{min-height:calc(40px * var(--ui-scale,1));gap:calc(10px * var(--ui-scale,1))}.code-card header>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Readable syntax colours in both palettes, committed with the theme. */
body:not(.dark) .code-card .syntax-keyword{color:#7139a8}body:not(.dark) .code-card .syntax-string{color:#23643d}body:not(.dark) .code-card .syntax-number{color:#94501a}body:not(.dark) .code-card .syntax-comment{color:#626b78}body:not(.dark) .code-card .syntax-tag{color:#155e88}
/* Native client downloads; no account data or credentials are cached here. */
#downloadAppModal{z-index:1400}#downloadAppModal .modal-box{max-width:calc(470px * var(--ui-scale,1))}#downloadAppDescription{line-height:1.7;font-size:calc(14px * var(--ui-scale,1))}#downloadAppTrust{font-size:calc(12px * var(--ui-scale,1));line-height:1.6;color:var(--fg2);margin:calc(14px * var(--ui-scale,1)) 0 calc(20px * var(--ui-scale,1))}#downloadAppActions{display:flex;flex-direction:column;gap:calc(10px * var(--ui-scale,1))}.download-primary{display:block;width:100%;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--accent);color:#fff;padding:calc(13px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1));text-align:center;font-size:calc(13px * var(--ui-scale,1));text-decoration:none;cursor:pointer;transition:transform .3s ease,filter .3s ease,box-shadow .3s ease}.download-primary:hover{filter:brightness(1.07);box-shadow:0 calc(5px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) rgba(105,96,230,.17)}.download-primary:active{transform:scale(.98)}#downloadAppStatus{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);line-height:1.6;margin-top:calc(14px * var(--ui-scale,1))}.app-settings-button{display:block;width:100%;margin:0 0 calc(18px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg2);color:var(--accent);font-weight:600}.settings-app-version{text-align:center;font-size:calc(11px * var(--ui-scale,1));color:var(--fg2);margin:calc(14px * var(--ui-scale,1)) 0 0}.app-download-link{font-size:calc(12px * var(--ui-scale,1))!important;white-space:nowrap;color:var(--accent)!important;padding:calc(7px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1))!important;width:auto!important}#topbar .tb-left{min-width:0}#topbar .tb-title{min-width:0;overflow:hidden;text-overflow:ellipsis}#topbar .tb-actions{flex-shrink:0}#nativeUpdateNotice{flex-shrink:0;align-self:center;text-align:center;max-width:calc(100% - calc(24px * var(--ui-scale,1)));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);padding:calc(10px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));margin:calc(10px * var(--ui-scale,1)) auto 0;font-size:calc(12px * var(--ui-scale,1));line-height:1.6}#nativeUpdateNotice button{color:var(--accent);text-decoration:underline;background:transparent;border:0;cursor:pointer}@media(max-width:480px){.app-download-link{font-size:calc(10px * var(--ui-scale,1))!important;padding:calc(7px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1))!important}#topbar .tb-actions{gap:calc(2px * var(--ui-scale,1))}}
#downloadAppTop[hidden],#downloadAppSettings[hidden],#nativeUpdateNotice[hidden]{display:none!important}

/* Calm, transform-only interaction feedback; no reflow or input-text flashing. */
#downloadAppTitle{font-size:calc(22px * var(--ui-scale,1));font-weight:750;line-height:1.3}
#downloadAppDescription{color:var(--fg2);font-size:calc(14px * var(--ui-scale,1));line-height:1.65}
.dev-symbol{width:calc(34px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 25%,transparent);color:var(--accent);box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 #ffffff18}
.dev-symbol svg{width:calc(23px * var(--ui-scale,1));height:calc(23px * var(--ui-scale,1));stroke-width:1.7}
@media(hover:hover){html:not([data-motion=reduced]) .icon-btn:hover svg,html:not([data-motion=reduced]) .note-tool:hover svg{transform:none}}

html:not([data-motion=reduced]) .download-primary{transition:transform .5s cubic-bezier(.22,.8,.25,1),box-shadow .5s ease,filter .45s ease,background-color .45s ease}
html:not([data-motion=reduced]) #downloadAppActions>*{animation:download-choice-in .48s cubic-bezier(.22,.8,.25,1) both}
html:not([data-motion=reduced]) #downloadAppActions>*:nth-child(2){animation-delay:.07s}
@keyframes download-choice-in{from{opacity:0;transform:translateY(calc(5px * var(--ui-scale,1)))}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) #downloadAppActions>*{animation:none!important}html:not([data-motion=full]) .icon-btn svg,html:not([data-motion=full]) .note-tool svg{transform:none!important;transition:none!important}}

#downloadAppDescription{margin:0 0 calc(22px * var(--ui-scale,1))}.download-details{margin-top:calc(16px * var(--ui-scale,1));color:var(--fg2);font-size:calc(12px * var(--ui-scale,1));line-height:1.6}.download-details summary{cursor:pointer;list-style-position:inside}.download-details #downloadAppTrust{margin:calc(10px * var(--ui-scale,1)) 0 0}

/* Stable upload previews and a centered, accessible recovery close control. */
#voiceHelp{position:relative;padding-right:calc(60px * var(--ui-scale,1))}#voiceHelp #voiceHelpClose{position:absolute;right:calc(10px * var(--ui-scale,1));top:50%;margin:0;transform:translateY(-50%);display:grid;place-items:center;width:calc(38px * var(--ui-scale,1));height:calc(38px * var(--ui-scale,1));min-height:calc(38px * var(--ui-scale,1));padding:0;border:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg3);border-radius:calc(11px * var(--ui-scale,1));font-size:calc(26px * var(--ui-scale,1));line-height:1;color:var(--fg2)}#voiceHelp #voiceHelpClose:active{transform:translateY(-50%) scale(.94)}
.file-visual{position:relative;overflow:hidden;flex-shrink:0;background:var(--bg3)}.file-visual.media-loading img,.file-visual.media-loading video{opacity:.35;filter:blur(calc(3px * var(--ui-scale,1)))}.file-visual img,.file-visual video{transition:opacity .45s ease,filter .45s ease}.upload-ring{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--bg3) 60%,transparent);pointer-events:none}.upload-ring svg{width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));transform:rotate(-90deg)}.upload-ring circle{fill:none;stroke-width:3}.upload-ring .ring-track{stroke:var(--border)}.upload-ring .ring-value{stroke:var(--accent);stroke-linecap:round;stroke-dasharray:76;stroke-dashoffset:38;transform-origin:center;animation:upload-orbit 1.5s linear infinite}.upload-ring[data-progress] .ring-value{animation:none;transition:stroke-dashoffset .2s ease}.attachment-upload-status{display:block;font-size:calc(11px * var(--ui-scale,1));color:var(--fg2);line-height:1.5}.attachment-chip.upload-failed{border-color:var(--danger)}.attachment-chip.upload-failed .attachment-upload-status{color:var(--danger)}
@keyframes upload-orbit{to{transform:rotate(360deg)}}
html:not([data-motion=reduced]) .stream-fragment{animation:answer-fragment-in .85s ease-out both}#messages .stream-fragment{display:inline;transform:none}@keyframes answer-fragment-in{from{opacity:.12}to{opacity:1}}
html[data-motion=reduced] .upload-ring .ring-value{animation:none}@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) .upload-ring .ring-value{animation:none}}

/* 0.18.0: stable actions, compact file cards and readable answer structure. */
.msg .msg-actions{opacity:1;visibility:visible;row-gap:calc(3px * var(--ui-scale,1));column-gap:calc(4px * var(--ui-scale,1))}
.msg-actions .msg-act{min-height:calc(32px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));transition:background-color .3s ease,color .3s ease,transform .3s ease}
.msg-actions .msg-act:disabled{opacity:.4}.msg-actions [data-act="like"] svg{transform-origin:50% 80%;overflow:visible}
.msg-actions [data-act="like"][aria-pressed="true"] svg{fill:color-mix(in srgb,var(--accent) 17%,transparent);stroke:var(--accent)}
.message-file-card{display:flex;align-items:center;gap:calc(5px * var(--ui-scale,1));width:min(100%,calc(430px * var(--ui-scale,1)));min-width:0;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));background:var(--bg2);padding:calc(8px * var(--ui-scale,1));transition:background-color .3s ease,border-color .3s ease,box-shadow .3s ease}
.message-file-card:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--border));box-shadow:0 calc(3px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1)) #00000008}
.message-file-card .attachment-chip{flex:1;min-width:0;min-height:calc(42px * var(--ui-scale,1));display:flex;justify-content:center;border:0;background:transparent;padding:calc(5px * var(--ui-scale,1));text-decoration:none;color:var(--fg)}
.message-file-name{font-size:calc(13px * var(--ui-scale,1));line-height:1.5;font-weight:650;text-align:center;overflow-wrap:anywhere}
.message-file-card button{display:grid;place-items:center;flex:none;width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));padding:0;color:var(--fg2);background:transparent;border:0;cursor:pointer;transition:background-color .3s ease,color .3s ease,transform .3s ease}
.message-file-card button:hover{background:var(--hover);color:var(--accent)}.message-file-card button:active{transform:scale(.92)}.message-file-card button svg{display:block;width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}
.message-file-card [aria-busy="true"]{opacity:.6;cursor:progress}
#previewBody[aria-busy="true"]::before{content:"";display:block;width:calc(26px * var(--ui-scale,1));height:calc(26px * var(--ui-scale,1));border:calc(3px * var(--ui-scale,1)) solid var(--border);border-top-color:var(--accent);border-radius:50%;margin:calc(28px * var(--ui-scale,1)) auto;animation:upload-orbit 1.1s linear infinite}
.msg.ai .answer-body{font-size:calc(14px * var(--ui-scale,1));line-height:1.8;letter-spacing:.005em;text-wrap:pretty}
.answer-body .answer-heading{font-size:1.16em;line-height:1.45;margin:1.15em 0 .45em;font-weight:700;color:var(--fg)}
.answer-body .answer-heading.level-1{font-size:1.35em}.answer-body .answer-heading.level-2{font-size:1.22em}
.answer-body a{text-decoration:underline;text-decoration-thickness:calc(1px * var(--ui-scale,1));text-underline-offset:calc(3px * var(--ui-scale,1));word-break:normal;overflow-wrap:anywhere}
.answer-body ul,.answer-body ol{margin:.5em 0 .8em;padding-left:1.65em}.answer-body li{padding-left:.2em;margin:.2em 0}.answer-body li::marker{color:var(--fg2)}
.answer-body blockquote{margin:.7em 0;padding:.3em 1em;border-left:calc(3px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 50%,var(--border));background:color-mix(in srgb,var(--bg2) 65%,transparent);border-radius:0 calc(9px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) 0;color:var(--fg2)}
.answer-body .answer-table{overflow-x:auto;max-width:100%;margin:.8em 0;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1))}
.answer-body table{border-collapse:collapse;width:100%;font-size:.95em}.answer-body th,.answer-body td{padding:calc(9px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));text-align:left;vertical-align:top;border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);border-right:calc(1px * var(--ui-scale,1)) solid var(--border);min-width:calc(90px * var(--ui-scale,1))}.answer-body th{font-weight:650;background:var(--bg2)}.answer-body tr:last-child td{border-bottom:0}.answer-body th:last-child,.answer-body td:last-child{border-right:0}.answer-body .align-center{text-align:center}.answer-body .align-right{text-align:right}
.answer-body hr{border:0;border-top:calc(1px * var(--ui-scale,1)) solid var(--border);margin:1em 0}
@media(max-width:600px){.message-file-card{width:100%}.message-file-card button{width:calc(40px * var(--ui-scale,1));height:calc(40px * var(--ui-scale,1))}.msg-actions .msg-act{min-height:calc(40px * var(--ui-scale,1))}.answer-body th,.answer-body td{padding:calc(8px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:reduce){.message-file-card,.message-file-card button,.msg-actions .msg-act{transition:none}#previewBody[aria-busy="true"]::before{animation:none}}
:root[data-motion="reduced"] .message-file-card,:root[data-motion="reduced"] .message-file-card button,:root[data-motion="reduced"] .msg-actions .msg-act{transition:none}
:root[data-motion="reduced"] #previewBody[aria-busy="true"]::before{animation:none}
/* Private reminder settings, matching the workspace palette. */
.reminder-box{position:relative;padding:calc(26px * var(--ui-scale,1)) calc(24px * var(--ui-scale,1));max-height:calc(100dvh - calc(32px * var(--ui-scale,1)));overflow:auto;width:min(calc(440px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))))}.reminder-box h2{text-align:center;font-size:calc(21px * var(--ui-scale,1));padding:0 calc(20px * var(--ui-scale,1))}#reminderHint{text-align:center;color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));margin:calc(10px * var(--ui-scale,1)) 0 calc(18px * var(--ui-scale,1))}#reminderClose{position:absolute;right:calc(8px * var(--ui-scale,1));top:calc(8px * var(--ui-scale,1));width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));display:grid;place-items:center;font-size:calc(24px * var(--ui-scale,1))}#reminderMode{display:flex;position:relative;background:var(--bg3);padding:calc(4px * var(--ui-scale,1));border-radius:calc(14px * var(--ui-scale,1));margin-bottom:calc(18px * var(--ui-scale,1))}#reminderMode>span{position:absolute;inset:calc(4px * var(--ui-scale,1)) auto calc(4px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1));width:calc(50% - calc(4px * var(--ui-scale,1)));background:var(--bg);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) #0001;border-radius:calc(10px * var(--ui-scale,1));transition:transform .5s cubic-bezier(.2,.8,.2,1)}#reminderMode[data-mode=daily]>span{transform:translateX(100%)}#reminderMode button{position:relative;flex:1;padding:calc(10px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1))}#reminderModal label{display:block;color:var(--fg2);font-size:calc(12px * var(--ui-scale,1))}#reminderModal textarea,#reminderModal input:not([type=checkbox]){display:block;width:100%;background:var(--bg3);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));margin:calc(6px * var(--ui-scale,1)) 0 calc(14px * var(--ui-scale,1));color:var(--fg);min-width:0}#reminderModal textarea{resize:vertical}.reminder-fields{display:flex;gap:calc(12px * var(--ui-scale,1))}.reminder-fields>label{flex:1;min-width:0}.reminder-fields>[hidden]{display:none!important}#reminderZone{display:block;color:var(--fg2);margin-bottom:calc(14px * var(--ui-scale,1))}#reminderNotifyLabel{display:flex!important;align-items:center;gap:calc(6px * var(--ui-scale,1))}#reminderDelivery{font-size:calc(11px * var(--ui-scale,1));line-height:1.55;color:var(--fg2);margin:calc(12px * var(--ui-scale,1)) 0}#reminderStatus{font-size:calc(12px * var(--ui-scale,1));min-height:calc(16px * var(--ui-scale,1));margin-bottom:calc(8px * var(--ui-scale,1))}#reminderSave{display:block;margin:auto}#reminderList{margin-top:calc(18px * var(--ui-scale,1));border-top:calc(1px * var(--ui-scale,1)) solid var(--border)}.reminder-row{display:flex;align-items:center;gap:calc(6px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) 0;border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border)}.reminder-row button{border-radius:calc(8px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1))}.reminder-edit{flex:1;min-width:0;text-align:left}.reminder-edit strong,.reminder-edit span{display:block;overflow-wrap:anywhere}.reminder-edit strong{font-size:calc(12px * var(--ui-scale,1));font-weight:600}.reminder-edit span{color:var(--fg2);font-size:calc(10px * var(--ui-scale,1));margin-top:calc(4px * var(--ui-scale,1))}.note-reminder.ringing svg{animation:reminder-ring .8s ease-in-out}@keyframes reminder-ring{0%,100%{transform:rotate(0)}20%{transform:rotate(18deg)}40%{transform:rotate(-15deg)}60%{transform:rotate(10deg)}80%{transform:rotate(-5deg)}}html[data-motion=reduced] #reminderMode>span{transition:none}html[data-motion=reduced] .note-reminder.ringing svg{animation:none}

/* Smooth is the default; only an explicit Full choice overrides OS accessibility. */
@media(prefers-reduced-motion:reduce){html:root[data-motion=full][data-motion-explicit=false] *,html:root[data-motion=full][data-motion-explicit=false] *::before,html:root[data-motion=full][data-motion-explicit=false] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}html:root[data-motion=full][data-motion-explicit=false] .thinking-label,html:root[data-motion=full][data-motion-explicit=false] .progress-title{background:none!important;color:var(--fg2)!important;-webkit-text-fill-color:currentColor!important}}

.note-reminder.ringing .reminder-rays{transform-origin:center;animation:reminder-sound-wave .8s ease-out}@keyframes reminder-sound-wave{0%,100%{opacity:.4}30%,60%{opacity:1;stroke-width:2.2}}html[data-motion=reduced] .note-reminder.ringing .reminder-rays{animation:none}

/* Network and service-state warning styles. */
#serviceWarning{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin:0 0 calc(9px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,#d89b28 35%,var(--border));border-radius:calc(12px * var(--ui-scale,1));background:color-mix(in srgb,#d89b28 8%,var(--bg2));color:var(--fg);font-size:calc(12px * var(--ui-scale,1));line-height:1.45;animation:service-notice-in .4s ease-out}#serviceWarning[hidden]{display:none!important}#serviceWarning svg{flex:0 0 calc(17px * var(--ui-scale,1));color:#b47a13}#serviceWarning[data-kind=offline] svg,#serviceWarning[data-kind=ai] svg{color:var(--danger)}#serviceWarning span{min-width:0;overflow-wrap:anywhere}@keyframes service-notice-in{from{opacity:0;transform:translateY(calc(3px * var(--ui-scale,1)))}to{opacity:1;transform:none}}:root[data-motion=reduced] #serviceWarning{animation:none}@media(prefers-reduced-motion:reduce){:root:not([data-motion=full]) #serviceWarning{animation:none}}

/* System reduced motion takes precedence before the media change listener runs.
   An explicitly chosen Smooth animations setting remains an intentional override. */
@media(prefers-reduced-motion:reduce){
 html:root[data-motion-explicit="false"] .task-indicator .thinking-label,
 html:root[data-motion-explicit="false"] .task-indicator .dots span,
 html:root[data-motion-explicit="false"] .progress-live .progress-title{animation:none!important;transition:none!important}
 html:root[data-motion-explicit="false"] .task-indicator .thinking-label,
 html:root[data-motion-explicit="false"] .progress-live .progress-title{background:none!important;color:var(--fg2)!important;-webkit-text-fill-color:currentColor!important}
}

/* Mobile and keyboard-safe controls; keep action rows in flow to avoid scroll jumps. */
.msg .msg-actions{opacity:0!important;pointer-events:none;transition:opacity .24s ease}
.msg:last-child .msg-actions,.msg:hover .msg-actions,.msg:focus-within .msg-actions,.msg.actions-revealed .msg-actions{opacity:1!important;pointer-events:auto}
#topbar .tb-actions{display:flex;align-items:center;gap:calc(4px * var(--ui-scale,1));min-height:calc(40px * var(--ui-scale,1))}
#topbar .tb-actions>button{display:inline-flex;align-items:center;justify-content:center;height:calc(40px * var(--ui-scale,1));min-height:calc(40px * var(--ui-scale,1));min-width:calc(40px * var(--ui-scale,1));padding:0 calc(9px * var(--ui-scale,1));line-height:1;vertical-align:middle;flex-shrink:0}
#topbar .tb-actions>button[hidden]{display:none!important}#topbar .tb-actions>button svg{display:block;flex-shrink:0}
:is(.input-box,.auth-box,.inp,.modal-box,.confirm-box,.opt,.attachment-chip,.message-file-card,.code-card,.site-proposal,.sb-search-inner,.skill-chip,.mode-btn,.app-settings-button,.note-file,.support-card,.support-link,.plan-card,.pay-method,.auth-notice){border-width:calc(2px * var(--ui-scale,1))}
#reminderModal.closing{pointer-events:none!important}#reminderModal.open,#reminderModal.open .reminder-box{animation:none!important}#reminderModal{--reminder-top:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-top));--reminder-bottom:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-bottom));box-sizing:border-box;height:100%;height:100dvh;max-height:var(--app-height,100dvh);bottom:auto;padding:var(--reminder-top) calc(12px * var(--ui-scale,1)) var(--reminder-bottom);align-items:center;justify-content:center;overflow:hidden}
#reminderModal .reminder-box{box-sizing:border-box;width:min(calc(440px * var(--ui-scale,1)),100%);min-width:0;max-width:100%;min-height:0;flex:0 1 auto;max-height:100%;max-height:min(100%,calc(100dvh - var(--reminder-top) - var(--reminder-bottom)));padding:calc(28px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));border:calc(2px * var(--ui-scale,1)) solid var(--border);border-radius:calc(22px * var(--ui-scale,1));overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#reminderTitle{font-size:calc(22px * var(--ui-scale,1));line-height:1.3;font-weight:750;text-align:center;margin:calc(8px * var(--ui-scale,1)) calc(24px * var(--ui-scale,1)) 0;padding:0!important}
#reminderHint{font-size:calc(13px * var(--ui-scale,1));line-height:1.5;margin:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));color:var(--fg2)}
#reminderClose{right:calc(8px * var(--ui-scale,1));top:calc(8px * var(--ui-scale,1));width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));padding:0;line-height:1;min-width:calc(36px * var(--ui-scale,1));min-height:calc(36px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1))}
#reminderMode{border:calc(2px * var(--ui-scale,1)) solid var(--border);min-height:calc(46px * var(--ui-scale,1));flex-shrink:0;isolation:isolate}
#reminderMode button{min-width:0;min-height:calc(36px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1));line-height:1.3;font-size:calc(13px * var(--ui-scale,1));border-radius:calc(9px * var(--ui-scale,1))}
#reminderMode button[aria-selected=true]{color:var(--accent);font-weight:650}
#reminderModal label{font-size:calc(12px * var(--ui-scale,1));line-height:1.45;min-width:0}
#reminderModal textarea,#reminderModal input:not([type=checkbox]){box-sizing:border-box;max-width:100%;width:100%;min-width:0;min-height:calc(44px * var(--ui-scale,1));font-size:calc(16px * var(--ui-scale,1));line-height:1.4;border:calc(2px * var(--ui-scale,1)) solid var(--border);border-radius:calc(11px * var(--ui-scale,1));appearance:none;-webkit-appearance:none}
#reminderModal input::-webkit-date-and-time-value{text-align:left;min-height:1.4em}
#reminderModal .reminder-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(12px * var(--ui-scale,1))}
#reminderNotifyLabel{gap:calc(10px * var(--ui-scale,1));align-items:center;min-height:calc(44px * var(--ui-scale,1));margin-bottom:calc(12px * var(--ui-scale,1))}
input[type=checkbox]{appearance:none;-webkit-appearance:none;display:inline-grid;place-content:center;width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));min-width:calc(20px * var(--ui-scale,1));margin:0;border:calc(2px * var(--ui-scale,1)) solid var(--border);border-radius:calc(6px * var(--ui-scale,1));background:var(--bg3);vertical-align:middle;cursor:pointer;transition:background-color .28s,border-color .28s}
input[type=checkbox]::before{content:"";width:calc(9px * var(--ui-scale,1));height:calc(5px * var(--ui-scale,1));border-left:calc(2px * var(--ui-scale,1)) solid #fff;border-bottom:calc(2px * var(--ui-scale,1)) solid #fff;transform:rotate(-45deg) scale(0);transition:transform .32s cubic-bezier(.2,.9,.3,1.3);margin-top:calc(-2px * var(--ui-scale,1))}
input[type=checkbox]:checked{background:var(--accent);border-color:var(--accent)}input[type=checkbox]:checked::before{transform:rotate(-45deg) scale(1)}input[type=checkbox]:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}input[type=checkbox]:disabled{opacity:.5;cursor:default}
#reminderSave{display:block;margin:auto;width:100%;min-height:calc(46px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1));line-height:1.4;border-radius:calc(12px * var(--ui-scale,1))}
#reminderZone{font-size:calc(11px * var(--ui-scale,1));overflow-wrap:anywhere}#reminderList:empty{display:none}
@media(max-width:600px),(hover:none){.msg-actions .msg-act>span{display:none}.msg-actions .msg-act{padding:calc(8px * var(--ui-scale,1));width:calc(40px * var(--ui-scale,1));min-width:calc(40px * var(--ui-scale,1));min-height:calc(40px * var(--ui-scale,1))}.msg-actions .msg-act svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}.msg-actions{gap:calc(2px * var(--ui-scale,1))!important}.msg .message-time{font-size:calc(10px * var(--ui-scale,1))}.msg:not(:last-child):not(.actions-revealed):not(:focus-within) .msg-actions{opacity:0!important;pointer-events:none}.msg:last-child .msg-actions,.msg.actions-revealed .msg-actions,.msg:focus-within .msg-actions{opacity:1!important;pointer-events:auto}}
@media(max-width:360px){#reminderModal .reminder-box{padding:calc(28px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1))}#reminderModal .reminder-fields{grid-template-columns:minmax(0,1fr);gap:0}#reminderTitle{font-size:calc(20px * var(--ui-scale,1))}#topbar{padding:0 calc(8px * var(--ui-scale,1))}#topbar .tb-actions{gap:0}#topbar .tb-actions>button{padding:0 calc(5px * var(--ui-scale,1));min-width:calc(36px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:reduce){:root:not([data-motion=full]) input[type=checkbox],:root:not([data-motion=full]) input[type=checkbox]::before{transition:none}}:root[data-motion=reduced] input[type=checkbox],:root[data-motion=reduced] input[type=checkbox]::before{transition:none}
/* Pointer users reveal actions as the pointer enters their reserved row. Touch requires an explicit message tap. */
@media(hover:hover){.msg .msg-actions{pointer-events:auto}.msg:hover .msg-actions{opacity:1!important}}
@media(forced-colors:active){input[type=checkbox]{appearance:auto;-webkit-appearance:auto}input[type=checkbox]::before{content:none}}

/* Keep scrollable reminder content intact while the dialog shrinks on rotation or keyboard resize. */
#reminderModal .reminder-box>*{flex-shrink:0}

.notification-channels{font-size:calc(12px * var(--ui-scale,1));line-height:1.55;color:var(--fg2);margin:calc(4px * var(--ui-scale,1)) 0 calc(14px * var(--ui-scale,1))}

/* Smooth must include geometry, not overwrite drawer transforms with color-only transitions. */
:root[data-motion="full"] #sidebar{transition:transform .55s cubic-bezier(.22,.8,.25,1),width .5s cubic-bezier(.22,.8,.25,1),background-color .45s ease,color .4s ease,border-color .4s ease,box-shadow .4s ease!important}
:root[data-motion="full"] .auth-box{animation:panelIn .65s cubic-bezier(.22,.8,.25,1) both}

/* 0.18.0: compact consistent controls, respecting all reduced-motion overrides. */
input::-ms-reveal,input::-ms-clear{display:none}
.answer-expand{box-sizing:border-box;width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));min-height:calc(36px * var(--ui-scale,1));padding:0;border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:50%;background:var(--bg2);color:var(--accent);margin-top:calc(8px * var(--ui-scale,1));flex-shrink:0;text-decoration:none}
.answer-expand:hover{background:var(--hover);text-decoration:none}.answer-expand svg{width:calc(21px * var(--ui-scale,1));height:calc(21px * var(--ui-scale,1))}
#noteAI{display:flex;gap:calc(6px * var(--ui-scale,1));flex-wrap:wrap;padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));background:var(--bg2);border-top:calc(1.5px * var(--ui-scale,1)) solid var(--border)}
#noteAI .note-tool{width:auto;height:calc(34px * var(--ui-scale,1));gap:calc(7px * var(--ui-scale,1));padding:0 calc(10px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);font-size:calc(12px * var(--ui-scale,1))}
@media(max-width:600px){#noteAI{gap:calc(5px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}#noteAI .note-tool{font-size:calc(11px * var(--ui-scale,1));padding:0 calc(7px * var(--ui-scale,1))}}


:root[data-motion=reduced] button svg{animation:none!important}
@keyframes pongyIconPress{0%{scale:1}45%{scale:.82}75%{scale:1.08}100%{scale:1}}
#appBack{width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;border:calc(1.5px * var(--ui-scale,1)) solid var(--border);background:var(--bg2);color:var(--fg)}
#appBack{position:fixed;left:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-left));top:max(calc(9px * var(--ui-scale,1)),env(safe-area-inset-top));z-index:10000;box-shadow:0 calc(2px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1)) #0001}body:has(#appBack:not([hidden])) .sb-head{padding-left:calc(54px * var(--ui-scale,1))}body:has(#appBack:not([hidden])) #topbar{padding-left:calc(54px * var(--ui-scale,1))}
:where(html[data-layout="mobile"]) body:has(#appBack:not([hidden])) #topbar{padding-left:calc(54px * var(--ui-scale,1))}
#deviceAccessBanner{display:flex;align-items:center;gap:calc(12px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0;padding:calc(12px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));background:var(--bg2);border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));line-height:1.5}#deviceAccessBanner[hidden],#deviceAccessSettings[hidden]{display:none!important}#deviceAccessBanner span{flex:1;min-width:0}#deviceAccessBanner button,#deviceAccessSettings button{padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg);color:var(--accent);font-weight:600;cursor:pointer}#deviceAccessBanner .device-access-close{display:grid;place-items:center;padding:0;flex:none;width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));font-size:calc(23px * var(--ui-scale,1));line-height:1}#deviceAccessSettings{padding:calc(14px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));margin:calc(12px * var(--ui-scale,1)) 0}#deviceAccessSettings p{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);line-height:1.5}@media(max-width:540px){#deviceAccessBanner{gap:calc(8px * var(--ui-scale,1));flex-wrap:wrap}#deviceAccessBanner span{flex-basis:calc(100% - calc(44px * var(--ui-scale,1)))}#deviceAccessBanner .device-access-close{order:-1}#deviceAccessBanner button:not(.device-access-close){margin-left:calc(40px * var(--ui-scale,1))}}

/* 0.18.8: restrained reading hierarchy; no geometry changes during streaming. */
.answer-body strong{font-weight:700}.answer-body em{font-style:italic}
.answer-body .answer-heading:first-child{margin-top:.15em}
.answer-body .answer-table th{letter-spacing:.01em;line-height:1.45}
.answer-body .answer-table tbody tr:nth-child(even){background:color-mix(in srgb,var(--bg2) 40%,transparent)}
.answer-body blockquote{line-height:1.65;padding:.65em 1em}
.answer-body li+li{margin-top:.35em}.answer-body .code-card{margin-block:.9em}

/* Image generation reserves a stable square; no clipping of the generated subject. */
.image-generation-pending,.generated-image-figure{width:min(100%,calc(512px * var(--ui-scale,1)));aspect-ratio:1;box-sizing:border-box;margin:calc(12px * var(--ui-scale,1)) 0;overflow:hidden;border-radius:calc(22px * var(--ui-scale,1));background:var(--bg3);position:relative;flex:none}
.image-generation-pending{display:grid;grid-template-columns:repeat(10,1fr);grid-template-rows:repeat(10,1fr);place-items:center;padding:calc(24px * var(--ui-scale,1));background:linear-gradient(135deg,var(--bg2),var(--bg3))}
.image-generation-pending>span{display:block;width:calc(5px * var(--ui-scale,1));height:calc(5px * var(--ui-scale,1));border-radius:50%;background:var(--fg2);opacity:.16;animation:image-dot-wave 2.8s ease-in-out var(--dot-delay,0s) infinite}
@keyframes image-dot-wave{0%,100%{opacity:.13;transform:scale(.75)}50%{opacity:.52;transform:scale(1.25)}}
.generated-image-figure .generated-image-open{width:100%;height:100%;padding:0;margin:0;border:0;border-radius:inherit;display:block;background:transparent;cursor:zoom-in;position:relative;overflow:hidden}
.generated-image-figure img{display:block!important;width:100%!important;height:100%!important;max-height:none!important;object-fit:contain;border-radius:inherit;opacity:1;transition:opacity .6s ease,filter .6s ease}
.generated-image-figure.media-loading img{opacity:0;filter:blur(calc(6px * var(--ui-scale,1)))}.generated-image-figure.media-loading::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(110deg,transparent 25%,color-mix(in srgb,var(--fg2) 10%,transparent) 48%,transparent 72%);background-size:250% 100%;animation:image-load-glow 2.8s ease-in-out infinite}
@keyframes image-load-glow{from{background-position:150% 0}to{background-position:-100% 0}}
.generated-image-toolbar{position:absolute;right:calc(12px * var(--ui-scale,1));top:calc(12px * var(--ui-scale,1));display:flex;gap:calc(6px * var(--ui-scale,1))}.generated-image-toolbar button{display:grid;place-items:center;width:calc(40px * var(--ui-scale,1));height:calc(40px * var(--ui-scale,1));padding:0;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(13px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);box-shadow:0 calc(3px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1)) #0002;cursor:pointer;transition:transform .3s ease,background-color .3s ease}.generated-image-toolbar button:hover{transform:translateY(calc(-2px * var(--ui-scale,1)))}.generated-image-toolbar button:active{transform:scale(.92)}.generated-image-toolbar svg{width:calc(19px * var(--ui-scale,1));height:calc(19px * var(--ui-scale,1))}.image-load-error{position:absolute;inset:0;display:grid;place-items:center;padding:calc(28px * var(--ui-scale,1));text-align:center;font-size:calc(14px * var(--ui-scale,1));color:var(--fg2)}.media-failed img{opacity:0}
:root[data-motion="reduced"] .image-generation-pending>span,:root[data-motion="reduced"] .generated-image-figure::after{animation:none}:root[data-motion="reduced"] .generated-image-figure img,:root[data-motion="reduced"] .generated-image-toolbar button{transition:none}
@media(prefers-reduced-motion:reduce){:root:not([data-motion="full"]) .image-generation-pending>span,:root:not([data-motion="full"]) .generated-image-figure::after{animation:none}:root:not([data-motion="full"]) .generated-image-figure img,:root:not([data-motion="full"]) .generated-image-toolbar button{transition:none}}

/* 0.18.8: isolate work surfaces; low-resource rendering keeps transform/opacity motion. */
.msg.ai .bubble,.progress-panel,.image-generation-pending{contain:style}
html[data-render-budget=compact] .overlay{backdrop-filter:none;-webkit-backdrop-filter:none}
html[data-render-budget=compact] .stream-fragment{animation-duration:.5s!important}
html[data-render-budget=compact] .generated-image-figure img{filter:none!important}
html[data-render-budget=compact] .image-generation-pending>span{animation-name:image-dot-light}
@keyframes image-dot-light{0%,100%{opacity:.18}50%{opacity:.6}}
html[data-render-budget=compact] .modal-box,html[data-render-budget=compact] .confirm-box{box-shadow:0 calc(6px * var(--ui-scale,1)) calc(22px * var(--ui-scale,1)) #0002}
/* 0.18.8: compact attachment cards and readable public work summaries. */
.message-file-card{width:min(100%,calc(336px * var(--ui-scale,1)));min-height:calc(62px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));border-radius:calc(15px * var(--ui-scale,1));gap:calc(3px * var(--ui-scale,1));box-sizing:border-box}
.message-file-card .attachment-chip{justify-content:flex-start;gap:calc(10px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));padding:0 calc(3px * var(--ui-scale,1));overflow:hidden}
.message-file-card .file-visual{flex:0 0 calc(38px * var(--ui-scale,1));width:calc(38px * var(--ui-scale,1));height:calc(42px * var(--ui-scale,1));border-radius:calc(9px * var(--ui-scale,1));background:var(--bg3,var(--bg));display:flex;align-items:center;justify-content:center;overflow:hidden}
.message-file-card .file-visual img,.message-file-card .file-visual video{width:100%;height:100%;object-fit:cover}
.message-file-card .file-visual small{font-size:calc(8px * var(--ui-scale,1));max-width:calc(36px * var(--ui-scale,1));overflow:hidden}
.message-file-label{display:flex;flex:1;min-width:0;flex-direction:column;gap:calc(2px * var(--ui-scale,1));align-items:center}
.message-file-name{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;font-size:calc(13px * var(--ui-scale,1));line-height:1.4;font-weight:700}
.message-file-details{font-size:calc(10px * var(--ui-scale,1));line-height:1.3;color:var(--fg3,var(--fg2));white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.message-file-card button{width:calc(30px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));border-radius:calc(9px * var(--ui-scale,1))}.message-file-card button svg{width:calc(16px * var(--ui-scale,1));height:calc(16px * var(--ui-scale,1))}
.answer-expand{width:calc(26px * var(--ui-scale,1));height:calc(26px * var(--ui-scale,1));min-width:calc(26px * var(--ui-scale,1));min-height:calc(26px * var(--ui-scale,1));border-width:calc(1.5px * var(--ui-scale,1));margin-top:calc(7px * var(--ui-scale,1));padding:0}.answer-expand svg{width:calc(19px * var(--ui-scale,1));height:calc(19px * var(--ui-scale,1))}
.sb-label{font-size:calc(10px * var(--ui-scale,1));font-weight:700;letter-spacing:.045em;line-height:1.5;padding-top:calc(16px * var(--ui-scale,1));padding-bottom:calc(6px * var(--ui-scale,1));color:var(--fg2)}
.progress-note{font-size:calc(12px * var(--ui-scale,1));line-height:1.6;margin:0 0 calc(12px * var(--ui-scale,1));color:var(--fg2)}.progress-body .work-entry{font-size:calc(12px * var(--ui-scale,1));line-height:1.65;padding:calc(8px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border-inline-start:calc(2px * var(--ui-scale,1)) solid var(--border);margin:calc(5px * var(--ui-scale,1)) 0;border-radius:0 calc(8px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) 0;background:color-mix(in srgb,var(--bg2) 70%,transparent)}
.progress-body .work-plan{border-inline-start-color:var(--accent)}.progress-body .work-checks{overflow-wrap:anywhere}.progress-body>p:not(.progress-note){font-size:calc(12px * var(--ui-scale,1));line-height:1.7;margin:calc(5px * var(--ui-scale,1)) 0;color:var(--fg2)}
@media(max-width:600px){.message-file-card{width:min(100%,calc(320px * var(--ui-scale,1)))}.message-file-card button{width:calc(34px * var(--ui-scale,1));height:calc(38px * var(--ui-scale,1))}.message-file-card .file-visual{flex-basis:calc(34px * var(--ui-scale,1));width:calc(34px * var(--ui-scale,1));height:calc(38px * var(--ui-scale,1))}}
@media(pointer:coarse){.answer-expand{position:relative}.answer-expand::after{content:"";position:absolute;inset:calc(-9px * var(--ui-scale,1));border-radius:50%}}

/* 0.19.3: recoverable sidebar and compact dismissible status. */
#toast{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));max-width:min(calc(430px * var(--ui-scale,1)),calc(100vw - calc(24px * var(--ui-scale,1))));padding:calc(9px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) calc(13px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));line-height:1.45;text-align:left;pointer-events:none}
#toast.visible{pointer-events:auto}#toast>span{min-width:0;overflow-wrap:anywhere}.toast-close{flex:0 0 calc(28px * var(--ui-scale,1));width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--fg2);font:calc(22px * var(--ui-scale,1))/1 Arial;cursor:pointer}.toast-close:hover{background:var(--bg3);color:var(--fg)}
:where(html[data-layout="desktop"]) body.hidden #menuBtn{display:flex}:where(html[data-layout="desktop"]) body.hidden #sidebar{pointer-events:none}:where(html[data-layout="desktop"]) body.hidden #sidebar~#main #menuBtn{pointer-events:auto}
.msg .code-card{max-width:100%;min-width:0}.msg .code-card pre{overflow:auto;tab-size:2;line-height:1.6}.msg .answer-heading{display:block;margin:calc(18px * var(--ui-scale,1)) 0 calc(8px * var(--ui-scale,1))}.msg blockquote{margin:calc(12px * var(--ui-scale,1)) 0;padding:calc(8px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border-left:calc(3px * var(--ui-scale,1)) solid var(--accent);background:var(--bg2);border-radius:0 calc(8px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) 0}.msg .answer-table{max-width:100%;overflow-x:auto}

/* Low-cost motion retains transform/opacity, without backdrop repainting. */
html[data-render-budget="compact"] .overlay,html[data-render-budget="compact"] .modal-overlay,html[data-render-budget="compact"] #overlay{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html[data-render-budget="compact"] .file-visual img,html[data-render-budget="compact"] .file-visual video{filter:none!important;transition:opacity .2s ease!important}
html[data-render-budget="compact"] button,html[data-render-budget="compact"] a{transition:transform .18s ease,opacity .18s ease,color .18s ease,background-color .18s ease}
/* 0.19: constrained mobile surfaces, readable notifications and restrained controls. */
#appBack[hidden]{display:none!important}
#notificationsBtn{position:relative}#notificationsBtn svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1))}
#notificationsBtn.has-unread:after{content:"";position:absolute;width:calc(6px * var(--ui-scale,1));height:calc(6px * var(--ui-scale,1));border-radius:50%;right:calc(7px * var(--ui-scale,1));top:calc(6px * var(--ui-scale,1));background:var(--accent)}
#notificationsModal{z-index:1450}.notifications-box{width:min(calc(460px * var(--ui-scale,1)),100%);padding:calc(20px * var(--ui-scale,1));max-height:calc(var(--app-height,100dvh) - calc(40px * var(--ui-scale,1)));overflow-y:auto;overscroll-behavior:contain}
.notice-head{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));margin-bottom:calc(16px * var(--ui-scale,1))}.notice-head h2{flex:1;margin:0;font-size:calc(21px * var(--ui-scale,1))}.notice-head .icon-btn{width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));display:grid;place-items:center}.notice-head svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1))}
.notification-row{position:relative;display:grid;grid-template-columns:calc(22px * var(--ui-scale,1)) minmax(0,1fr) auto;align-items:center;gap:calc(10px * var(--ui-scale,1));width:100%;min-height:calc(66px * var(--ui-scale,1));text-align:left;padding:calc(12px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));margin-bottom:calc(8px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);cursor:pointer}
.notice-icon svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1))}.notice-copy{min-width:0}.notice-copy strong{display:block;font-size:calc(13px * var(--ui-scale,1));font-weight:600;overflow-wrap:anywhere}.notice-full{display:block;font-size:calc(12px * var(--ui-scale,1));line-height:1.55;margin-top:calc(6px * var(--ui-scale,1));white-space:pre-wrap;overflow-wrap:anywhere}.notice-full[hidden]{display:none}.notification-row time{font-size:calc(10px * var(--ui-scale,1));color:var(--fg2);white-space:nowrap}.notice-unread{position:absolute;right:calc(6px * var(--ui-scale,1));top:50%;transform:translateY(-50%);width:calc(6px * var(--ui-scale,1));height:calc(6px * var(--ui-scale,1));border-radius:50%;background:var(--accent)}
#notificationFilter{padding:calc(14px * var(--ui-scale,1));background:var(--bg2);border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));margin-bottom:calc(14px * var(--ui-scale,1))}#notificationFilter h3{margin:0 0 calc(6px * var(--ui-scale,1));font-size:calc(17px * var(--ui-scale,1))}#notificationFilter p,#notificationPermissionStatus{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);line-height:1.5}#notificationFilter h4{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);margin:calc(16px * var(--ui-scale,1)) 0 calc(7px * var(--ui-scale,1))}#notificationFilter button{display:flex;align-items:center;gap:calc(9px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid transparent;border-radius:calc(9px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1));width:100%;background:transparent;color:var(--fg);text-align:left;cursor:pointer}#notificationFilter button[aria-pressed=true]{border-color:var(--accent);background:var(--bg)}#notificationFilter button svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}.notice-empty{padding:calc(24px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));text-align:center;color:var(--fg2);font-size:calc(13px * var(--ui-scale,1))}
#backgroundAccessBanner{position:relative;display:flex;flex-wrap:wrap;gap:calc(8px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(38px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin-bottom:calc(8px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);font-size:calc(12px * var(--ui-scale,1));line-height:1.5;color:var(--fg2)}#backgroundAccessBanner[hidden]{display:none}#backgroundAccessBanner>span{flex:1 1 100%}#backgroundAccessBanner button{background:none;color:var(--accent);border:0;font:inherit;cursor:pointer;padding:calc(4px * var(--ui-scale,1))}#backgroundAccessBanner .device-access-close{position:absolute;right:calc(5px * var(--ui-scale,1));top:calc(5px * var(--ui-scale,1));width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));display:grid;place-items:center}#deviceAccessSettings p{line-height:1.6;font-size:calc(12px * var(--ui-scale,1));color:var(--fg2)}#deviceAccessSettings button{padding:calc(10px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg2);color:var(--accent)}
.upgrade-btn{border:calc(1.5px * var(--ui-scale,1)) solid var(--border)!important;background:var(--bg2)!important;color:var(--accent)!important;border-radius:calc(12px * var(--ui-scale,1))!important;font-weight:600;box-shadow:0 calc(2px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1)) #00000008}.upgrade-btn:hover{border-color:var(--accent)!important}
.overlay{padding-top:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-top));padding-bottom:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-bottom));padding-left:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-left));padding-right:max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-right));overscroll-behavior:contain}.overlay .modal-box{min-width:0;max-width:100%;max-height:calc(var(--app-height,100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - calc(24px * var(--ui-scale,1)));overflow-y:auto;overscroll-behavior:contain}.overlay input,.overlay textarea,.overlay select{min-width:0;max-width:100%}
#downloadAppActions .update-link{background:transparent;color:var(--accent);border:0;font-weight:600}#serviceWarning{flex-shrink:0;border-width:calc(1.5px * var(--ui-scale,1))}
/* Avoid repainting the whole viewport during theme changes; commit colors together. */
body,#sidebar,#main,.topbar,.input-area{transition:none}
:root[data-motion=full] .notification-row,:root[data-motion=full] #notificationFilter button,:root[data-motion=full] #backgroundAccessBanner button{transition:transform .18s ease,background-color .18s ease}:root[data-motion=full] .notification-row:active,:root[data-motion=full] #backgroundAccessBanner button:active{transform:scale(.98)}
@media(max-width:600px){
 #main{max-width:100%;min-width:0}#topbar{padding-left:max(calc(8px * var(--ui-scale,1)),env(safe-area-inset-left));padding-right:max(calc(8px * var(--ui-scale,1)),env(safe-area-inset-right));height:auto;min-height:calc(52px * var(--ui-scale,1))}#topbar .tb-actions{gap:0}#topbar .tb-actions>button{width:calc(34px * var(--ui-scale,1));min-width:calc(34px * var(--ui-scale,1));padding:0;flex-shrink:0}
 #downloadAppTop{font-size:0!important;width:calc(34px * var(--ui-scale,1))!important;min-width:calc(34px * var(--ui-scale,1))!important}#downloadAppTop:before{content:"";width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));display:block;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5'/%3E%3C/svg%3E") center/contain no-repeat}
 .overlay .modal-box{width:100%;padding:calc(24px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1));border-width:calc(1.5px * var(--ui-scale,1));border-radius:calc(18px * var(--ui-scale,1))}.overlay h2{font-size:calc(21px * var(--ui-scale,1))}.overlay input,.overlay textarea,.overlay select{font-size:calc(16px * var(--ui-scale,1))}.report-panel{box-sizing:border-box;max-width:100%;width:100%}.report-panel textarea{width:100%;max-width:100%;font-size:calc(16px * var(--ui-scale,1))}.report-panel>*{min-width:0}
 #inputArea{padding-bottom:max(calc(5px * var(--ui-scale,1)),env(safe-area-inset-bottom))}.input-area{min-width:0}#sidebar{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.opt,.input-box,.sb-search-inner,.attachment-chip,.report-panel,.reminder-box input,.reminder-box textarea{border-width:calc(1.5px * var(--ui-scale,1))}
 .notification-row{gap:calc(7px * var(--ui-scale,1));grid-template-columns:calc(20px * var(--ui-scale,1)) minmax(0,1fr) auto}.notification-row time{font-size:calc(9px * var(--ui-scale,1))}.notification-row strong{font-size:calc(12px * var(--ui-scale,1))}
}

/* Sidebar actions remain aligned in expanded and collapsed layouts. */
.sb-head>#notificationsBtn,.sb-head>#newChatBtn{flex:0 0 calc(34px * var(--ui-scale,1));width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));display:inline-flex;align-items:center;justify-content:center;padding:calc(7px * var(--ui-scale,1))}
.sb-head>#notificationsBtn[hidden]{display:none}.sb-head>#notificationsBtn{margin-left:calc(4px * var(--ui-scale,1))}.sb-head .sb-title{min-width:0}
/* Transform-only hover feedback; layout and pointer hit areas remain fixed. */
@media(hover:hover) and (pointer:fine){html:not([data-motion="reduced"]) :is(button,a,[role="button"]):not(:disabled):not([aria-disabled="true"]):hover svg{scale:1.08;translate:0 0}}
:is(button,a,[role="button"]) svg{transform-box:view-box;transform-origin:50% 50%;transition:scale .22s cubic-bezier(.2,.8,.2,1)}
html[data-motion="reduced"] :is(button,a,[role="button"]) svg{transition:none;scale:1;translate:0 0}
@media(prefers-reduced-motion:reduce){html:not([data-motion-explicit="true"][data-motion="full"]) :is(button,a,[role="button"]) svg{transition:none;scale:1;translate:0 0}}
/* The stop glyph stays geometrically centered while hovered or pressed. */
#stopBtn svg,#stopBtn:hover svg{translate:0 0}

/* Device layout preferences: stable hit areas, no page zoom or translated icons. */
#settingsModal>.modal-box{width:calc(420px * var(--ui-scale,1));max-width:100%;padding:0;max-height:min(88dvh,calc(820px * var(--ui-scale,1)));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(18px * var(--ui-scale,1));overflow:hidden}
#settingsModal .modal-head{padding:calc(16px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));min-height:calc(60px * var(--ui-scale,1))}
#settingsModal .modal-body{padding:calc(18px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.display-preferences{display:grid;gap:calc(2px * var(--ui-scale,1));margin:calc(4px * var(--ui-scale,1)) 0 calc(18px * var(--ui-scale,1));padding:calc(4px * var(--ui-scale,1)) 0;border-block:calc(1px * var(--ui-scale,1)) solid var(--border)}
.display-option{display:flex;align-items:center;justify-content:space-between;gap:calc(16px * var(--ui-scale,1));min-height:calc(48px * var(--ui-scale,1));font-size:calc(13.5px * var(--ui-scale,1));line-height:1.4;cursor:pointer}
input.display-switch[type=checkbox]{position:relative;display:block;flex:0 0 calc(42px * var(--ui-scale,1));width:calc(42px * var(--ui-scale,1));min-width:calc(42px * var(--ui-scale,1));height:calc(25px * var(--ui-scale,1));padding:0;border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(30px * var(--ui-scale,1));background:var(--bg3);margin:0;transition:background-color .22s ease,border-color .22s ease}
input.display-switch[type=checkbox]::before{content:"";position:absolute;inset:auto;left:calc(3px * var(--ui-scale,1));top:calc(3px * var(--ui-scale,1));display:block;width:calc(16px * var(--ui-scale,1));height:calc(16px * var(--ui-scale,1));margin:0;border:0;border-radius:50%;background:var(--fg2);mask:none;clip-path:none;transform:translateX(0);transition:transform .26s cubic-bezier(.2,.8,.2,1),background-color .22s;animation:none}
input.display-switch[type=checkbox]:checked{background:var(--accent);border-color:var(--accent)}input.display-switch[type=checkbox]:checked::before{background:var(--bg);transform:translateX(calc(17px * var(--ui-scale,1)));clip-path:none;animation:none}
input[type=checkbox]:not(.display-switch){position:relative;display:inline-block;flex:0 0 calc(20px * var(--ui-scale,1));vertical-align:middle;padding:0;box-sizing:border-box}
input[type=checkbox]:not(.display-switch)::before{content:"";position:absolute;inset:calc(2px * var(--ui-scale,1));width:calc(12px * var(--ui-scale,1));height:calc(12px * var(--ui-scale,1));margin:0;border:0;background:#fff;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round' d='m3 10 4.5 4.5L17 5'/%3E%3C/svg%3E") center/contain no-repeat;transform:none;clip-path:inset(0 100% 0 0);transition:clip-path .25s cubic-bezier(.2,.8,.2,1)}
input[type=checkbox]:not(.display-switch):checked::before{transform:none;clip-path:inset(0);animation:check-draw .3s cubic-bezier(.2,.8,.2,1)}
body.dark input[type=checkbox]:not(.display-switch)::before{background:#171b26}
@keyframes check-draw{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
html[data-layout=mobile] #sidebar{width:min(calc(300px * var(--ui-scale,1)),calc(100vw - calc(40px * var(--ui-scale,1))));max-width:100vw}
html[data-layout=mobile] .msg-act>span{display:none!important}
html[data-layout=mobile] .msg-act{min-width:calc(38px * var(--ui-scale,1));min-height:calc(40px * var(--ui-scale,1));justify-content:center}
html[data-layout=mobile] .msg-actions{gap:calc(2px * var(--ui-scale,1));flex-wrap:wrap}
html[data-layout=mobile] #topbar .tb-actions{gap:calc(2px * var(--ui-scale,1));align-items:center}
html[data-layout=mobile] :is(input,textarea,select):not([type=checkbox]){font-size:max(calc(16px * var(--ui-scale,1)),1em)}
html[data-layout=mobile] .modal-box{max-width:calc(100vw - calc(24px * var(--ui-scale,1)))}
html[data-layout=mobile] #settingsModal>.modal-box{width:calc(420px * var(--ui-scale,1));max-width:100%;max-height:min(90dvh,calc(820px * var(--ui-scale,1)))}













/* Only scale about the SVG view box, never shift its center on hover. */
@media(hover:hover) and (pointer:fine){html:not([data-motion=reduced]) :is(button,a,[role=button]):not(:disabled):hover svg{scale:1.08;translate:0 0;transform-box:view-box;transform-origin:50% 50%}}
#enableNotifications{display:inline-flex;align-items:center;justify-content:center;gap:calc(8px * var(--ui-scale,1));width:auto;max-width:100%;min-height:calc(40px * var(--ui-scale,1));margin:calc(10px * var(--ui-scale,1)) 0 0;padding:calc(9px * var(--ui-scale,1)) calc(13px * var(--ui-scale,1));border-radius:calc(11px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);background:var(--bg2);color:var(--accent);font-size:calc(13px * var(--ui-scale,1));font-weight:600;cursor:pointer}
#enableNotifications[hidden]{display:none}#enableNotifications:disabled{cursor:default;opacity:.65}#enableNotifications svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));flex-shrink:0}
#notificationPermissionStatus:empty,#notificationChannels:empty{display:none}
#displayApplying{position:fixed;inset:0;overflow:hidden;z-index:10000;display:grid;place-items:center;padding:calc(24px * var(--ui-scale,1));background:var(--bg,#fff);color:var(--fg,#171b26);outline:none}
.display-loading-content{width:min(calc(390px * var(--ui-scale,1)),100%);display:flex;flex-direction:column;align-items:center;text-align:center;gap:calc(20px * var(--ui-scale,1))}
.display-loading-logo{display:block;object-fit:contain;overflow:visible;animation:display-logo-spin 3s cubic-bezier(.32,.05,.2,1) infinite;will-change:transform}
#displayApplyingTitle{font-size:calc(26px * var(--ui-scale,1));font-weight:750;margin:0;line-height:1.3;overflow:visible}
#displayApplyingTitle span span{display:inline-block;animation:display-title-wave 3s ease-in-out infinite;animation-delay:calc(var(--letter)*45ms)}
#displayApplyingText{position:relative;margin:0;font-size:calc(14px * var(--ui-scale,1));line-height:1.6;color:var(--fg2,#666);max-width:calc(330px * var(--ui-scale,1))}
#displayApplyingText::after{content:"";position:absolute;inset:0;background:linear-gradient(110deg,transparent 25%,var(--bg,#fff) 49%,transparent 73%);opacity:.55;transform:translateX(-110%);animation:display-shimmer 2.4s ease-in-out infinite;pointer-events:none}
.display-progress{width:100%;height:calc(5px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));overflow:hidden;background:var(--bg3,#eee)}.display-progress>span{display:block;width:100%;height:100%;border-radius:inherit;background:var(--accent,#675fff);transform:scaleX(0);transform-origin:left;transition:transform .15s ease-out}
@keyframes display-logo-spin{0%,8%{transform:rotate(0)}65%,100%{transform:rotate(1080deg)}}
@keyframes display-title-wave{0%,65%,100%{transform:translateY(0)}75%{transform:translateY(calc(-5px * var(--ui-scale,1)))}85%{transform:translateY(0)}}
@keyframes display-shimmer{to{transform:translateX(110%)}}
html[data-motion=reduced] #displayApplying :is(img,span),html[data-motion=reduced] #displayApplyingText::after{animation:none!important;transition:none!important}html[data-motion=reduced] #displayApplyingText::after{display:none}
html[data-motion=reduced] input[type=checkbox],html[data-motion=reduced] input[type=checkbox]::before{animation:none!important;transition:none!important}
@media(forced-colors:active){input[type=checkbox]:not(.display-switch){appearance:auto;-webkit-appearance:auto}input[type=checkbox]:not(.display-switch)::before{content:none}input.display-switch[type=checkbox]{border-color:ButtonText}input.display-switch[type=checkbox]::before{background:ButtonText}}

/* Avoid stacking multiple scale transforms on the same glyph. */
:is(.icon-btn,.chat-act,.msg-act,.mode-btn,.tb-btn):hover svg{transform:none}
:root[data-render-budget=compact] .overlay{backdrop-filter:none}
@media(max-width:600px){.display-option{min-height:calc(50px * var(--ui-scale,1))}#settingsModal .modal-body{padding:calc(16px * var(--ui-scale,1))}}

/* Mobile drawers animate a composited transform, not their width or a viewport blur. */
html[data-layout=mobile][data-motion=full] #sidebar{transition:transform .34s cubic-bezier(.2,.8,.2,1)!important}
html[data-layout=mobile] .overlay{backdrop-filter:none}
/* Keep content density familiar while the modal itself remains compact. */
#settingsModal .modal-body{padding:calc(20px * var(--ui-scale,1))}
html[data-layout=mobile] #settingsModal .modal-body{padding:calc(16px * var(--ui-scale,1))}






/* Settings and anchored notification centre */
#settingsModal .modal-box{width:min(calc(660px * var(--ui-scale,1)),calc(100vw - calc(24px * var(--ui-scale,1))));max-width:calc(660px * var(--ui-scale,1));max-height:calc(100dvh - calc(32px * var(--ui-scale,1)))}
.settings-tabs{position:relative;display:flex;gap:calc(3px * var(--ui-scale,1));overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none;padding:calc(8px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border-bottom:calc(1.5px * var(--ui-scale,1)) solid var(--border);flex-shrink:0}
.settings-tabs::-webkit-scrollbar{display:none}.settings-tabs button[role=tab]{position:relative;z-index:1;flex:0 0 auto;margin:0;white-space:nowrap;border:0;border-radius:calc(10px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1)) calc(13px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));background:transparent;color:var(--fg2);cursor:pointer}
.settings-tabs button[aria-selected=true]{color:var(--accent);font-weight:700}.settings-tabs button:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(-2px * var(--ui-scale,1))}.settings-tab-indicator{position:absolute;z-index:0;left:0;top:calc(7px * var(--ui-scale,1));bottom:calc(7px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));background:var(--input-bg,var(--bg2));box-shadow:inset 0 0 0 calc(1px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 12%,transparent);transition:transform .24s cubic-bezier(.2,.8,.2,1),width .24s cubic-bezier(.2,.8,.2,1);pointer-events:none}
.settings-section[hidden]{display:none!important}.settings-section{min-width:0;animation:settings-enter .22s ease-out}.settings-section>h3{margin:calc(18px * var(--ui-scale,1)) 0 calc(10px * var(--ui-scale,1))}.settings-hint{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);line-height:1.55;margin:calc(10px * var(--ui-scale,1)) 0 calc(16px * var(--ui-scale,1))}.settings-field{display:grid;gap:calc(8px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));font-weight:600;margin:calc(14px * var(--ui-scale,1)) 0}.settings-field input{width:100%;min-width:0}.settings-action{border:calc(1.5px * var(--ui-scale,1)) solid var(--border);background:var(--input-bg,var(--bg2));color:var(--fg);border-radius:calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin:calc(5px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1)) 0;cursor:pointer}.settings-action.api-key-primary{background:var(--accent);color:var(--bg);border-color:var(--accent);font-weight:700}.settings-action.api-key-primary:hover{background:var(--accent-h);border-color:var(--accent-h)}.settings-section pre{position:relative;max-width:100%;overflow:auto;background:var(--input-bg,var(--bg2));padding:calc(14px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));white-space:pre-wrap;overflow-wrap:anywhere}.settings-section pre button{display:block;margin-left:auto;font-size:calc(11px * var(--ui-scale,1))}.settings-section progress{width:100%;height:calc(16px * var(--ui-scale,1));accent-color:var(--accent)}#usagePercent{text-align:right;font-weight:700}#settings-panel-usage[data-state=exhausted]{color:#ef5363}#settings-panel-usage[data-state=exhausted] progress{accent-color:#ef5363}#settings-panel-usage[data-state=unavailable]{color:#e5a144}#settings-panel-usage[data-state=unavailable] progress{accent-color:#e5a144}#settings-panel-usage[data-state=exhausted] p,#settings-panel-usage[data-state=unavailable] p{color:inherit}.admin-block-row{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));justify-content:space-between;font-size:calc(12px * var(--ui-scale,1));overflow-wrap:anywhere}#adminReports summary{padding:calc(12px * var(--ui-scale,1)) 0;font-size:calc(12px * var(--ui-scale,1))}#adminReports pre{font-size:calc(11px * var(--ui-scale,1));max-height:calc(260px * var(--ui-scale,1))}#settingsModal[data-scanning=true] .settings-tabs{pointer-events:none;opacity:.6}
.plus-action,.plan-btn,#upgradeBtn,[class*=upgrade]{color:#e0ae27!important;border-color:#cda634!important;background:color-mix(in srgb,#f8ce55 10%,transparent)!important}.plus-action:hover,.plan-btn:hover{background:color-mix(in srgb,#f8ce55 18%,transparent)!important}#logoutBtnSettings{background:color-mix(in srgb,var(--danger) 8%,transparent)!important;border-width:calc(1.5px * var(--ui-scale,1))!important}
#notificationsBtn{position:relative;flex-shrink:0}#notificationsBtn.has-unread:after{right:calc(6px * var(--ui-scale,1));top:calc(5px * var(--ui-scale,1));width:calc(6px * var(--ui-scale,1));height:calc(6px * var(--ui-scale,1));transform:none;box-shadow:0 0 0 calc(2px * var(--ui-scale,1)) var(--bg)}
.notification-popover{display:none;position:fixed;z-index:1200;box-sizing:border-box;overflow:auto;background:var(--bg);border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(16px * var(--ui-scale,1));box-shadow:0 calc(10px * var(--ui-scale,1)) calc(36px * var(--ui-scale,1)) #0003;padding:0;backdrop-filter:none}
.notification-popover.open{display:block;animation:popover-slide .35s cubic-bezier(.18,.85,.25,1.1);transform-origin:top left}.notification-popover .notifications-box{display:block;width:100%;max-width:none;max-height:none;margin:0;padding:calc(14px * var(--ui-scale,1));border:none;border-radius:0;box-shadow:none;background:transparent;overflow:visible}.notice-head{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1))}.notice-head h2{font-size:calc(16px * var(--ui-scale,1));margin-right:auto}.notification-popover .notification-row{display:grid;grid-template-columns:calc(20px * var(--ui-scale,1)) minmax(0,1fr) calc(83px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1));gap:calc(8px * var(--ui-scale,1));position:relative;align-items:center;width:100%;border:0;border-bottom:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:0;background:transparent;margin:0;padding:calc(13px * var(--ui-scale,1)) calc(2px * var(--ui-scale,1));color:var(--fg);text-align:left;min-height:calc(58px * var(--ui-scale,1))}.notification-row time{font-size:calc(12px * var(--ui-scale,1))!important;font-weight:700;color:var(--fg2);line-height:1.5}.notice-copy{min-width:0;overflow-wrap:anywhere}.notice-copy strong{font-size:calc(12px * var(--ui-scale,1))}.notice-full{font-size:calc(12px * var(--ui-scale,1));line-height:1.5;margin-top:calc(6px * var(--ui-scale,1));display:block}.notice-full[hidden]{display:none}.notice-chevron{display:flex;align-items:center;justify-content:center;transition:transform .3s ease}.notification-row[aria-expanded=true] .notice-chevron{transform:rotate(180deg)}.notice-unread{position:absolute;right:calc(16px * var(--ui-scale,1));top:50%;transform:translateY(-50%);width:calc(5px * var(--ui-scale,1));height:calc(5px * var(--ui-scale,1));border-radius:50%;background:var(--accent)}.notice-icon svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1))}#notificationFilter{position:fixed;z-index:1460;width:min(calc(260px * var(--ui-scale,1)),calc(100vw - calc(16px * var(--ui-scale,1))));max-height:calc(100dvh - calc(16px * var(--ui-scale,1)));overflow:auto;box-sizing:border-box;background:var(--bg);color:var(--fg);padding:calc(16px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));box-shadow:0 calc(8px * var(--ui-scale,1)) calc(32px * var(--ui-scale,1)) #0003;animation:popover-slide .28s ease-out}#notificationFilter[hidden]{display:none}#notificationFilter button{display:flex;align-items:center;gap:calc(8px * var(--ui-scale,1));width:100%;padding:calc(10px * var(--ui-scale,1));border:0;border-radius:calc(9px * var(--ui-scale,1));background:transparent;color:inherit;text-align:left;cursor:pointer}#notificationFilter button[aria-pressed=true]{background:var(--input-bg,var(--bg2));color:var(--accent)}#notificationFilter h3{font-size:calc(16px * var(--ui-scale,1))}#notificationFilter h4,#notificationFilter p{font-size:calc(12px * var(--ui-scale,1));margin:calc(10px * var(--ui-scale,1)) 0}#enableNotifications{font-size:calc(12px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));min-height:calc(40px * var(--ui-scale,1));display:flex;gap:calc(8px * var(--ui-scale,1));align-items:center;justify-content:center}#enableNotifications[hidden]{display:none}#enableNotifications svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}
.tb-actions{display:flex;align-items:center;gap:calc(6px * var(--ui-scale,1))}.tb-actions>:is(.icon-btn,.tb-btn){width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.tb-actions>:is(.icon-btn,.tb-btn) svg{width:calc(19px * var(--ui-scale,1));height:calc(19px * var(--ui-scale,1));transform-origin:50% 50%}#downloadAppTop{display:inline-flex;align-items:center;gap:calc(6px * var(--ui-scale,1))}#downloadAppTop svg{width:calc(17px * var(--ui-scale,1));height:calc(17px * var(--ui-scale,1));flex-shrink:0}.progress-panel:not(.expanded),.task-indicator{max-width:100%;width:fit-content}.progress-panel:has(.progress-body:not([hidden])){width:100%}
#serviceWarning{margin:0!important;border-radius:calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) 0 0!important;border:calc(1.5px * var(--ui-scale,1)) solid var(--border);border-bottom:0;padding:calc(9px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));gap:calc(8px * var(--ui-scale,1))}#serviceWarning:not([hidden])+.input-box{border-top-left-radius:0;border-top-right-radius:0}#serviceWarning svg{flex-shrink:0}.icon-btn svg{transform-origin:center}.display-option{align-items:center}input[type=checkbox]{vertical-align:middle;flex-shrink:0}
[data-beta-only][hidden]{display:none!important}[data-user-api=true] #agentBtn,[data-user-api=true] #smartBtn{opacity:.45;cursor:not-allowed}
@keyframes settings-enter{from{opacity:.6;transform:translateY(calc(3px * var(--ui-scale,1)))}to{opacity:1;transform:none}}@keyframes popover-slide{from{opacity:0;transform:translateY(calc(-8px * var(--ui-scale,1))) scale(.97,.94)}to{opacity:1;transform:none}}
@media(max-width:600px){#settingsModal .modal-box{width:calc(100vw - calc(24px * var(--ui-scale,1)));max-height:calc(100dvh - calc(24px * var(--ui-scale,1)))}.settings-tabs{padding:calc(7px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1));gap:calc(2px * var(--ui-scale,1))}.settings-tabs button[role=tab]{padding:calc(8px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));font-size:calc(11px * var(--ui-scale,1))}.settings-tab-indicator{top:calc(6px * var(--ui-scale,1));bottom:calc(6px * var(--ui-scale,1))}.settings-section{padding:0}.notification-popover .notifications-box{padding:calc(12px * var(--ui-scale,1))}.tb-actions{gap:calc(2px * var(--ui-scale,1))}.tb-actions>:is(.icon-btn,.tb-btn){width:calc(30px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1))}.notification-row time{font-size:calc(11px * var(--ui-scale,1))!important}}
html[data-motion=reduced] .settings-section,html[data-motion=reduced] .notification-popover.open,html[data-motion=reduced] #notificationFilter,html[data-motion=reduced] .settings-tab-indicator{animation:none!important;transition:none!important}html[data-motion=reduced] .notice-chevron{transition:none}

#siteControlScreen{position:fixed;inset:0;z-index:9999;background:var(--bg);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(24px * var(--ui-scale,1));text-align:center;padding:calc(32px * var(--ui-scale,1))}#siteControlScreen[hidden]{display:none}#siteControlScreen svg{width:calc(80px * var(--ui-scale,1));height:calc(80px * var(--ui-scale,1));color:var(--danger)}#siteControlScreen h1{font-size:clamp(calc(20px * var(--ui-scale,1)),4vw,calc(30px * var(--ui-scale,1)));max-width:calc(700px * var(--ui-scale,1));line-height:1.5}#siteControlScreen button{color:var(--accent);padding:calc(12px * var(--ui-scale,1))}.tb-btn{display:inline-flex;align-items:center;justify-content:center;width:calc(34px * var(--ui-scale,1));height:calc(34px * var(--ui-scale,1));flex-shrink:0}#pinChatBtn[aria-pressed=true]{color:var(--accent)}

/* Attached header never translates independently over the input. */
@keyframes service-notice-in{from{opacity:0}to{opacity:1}}
.scan-status{display:inline-flex;align-items:center;vertical-align:middle;margin-right:calc(7px * var(--ui-scale,1))}.scan-status svg{width:calc(17px * var(--ui-scale,1));height:calc(17px * var(--ui-scale,1))}#settings-panel-subscription .plus-action{display:block;border-radius:calc(10px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));font-weight:700}#subStatusBox .free-label,#subStatusBox .plus-active{color:#e0ae27}
.auth-providers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(10px * var(--ui-scale,1));margin:calc(14px * var(--ui-scale,1)) 0 0}.auth-provider{min-width:0;display:flex;align-items:center;justify-content:center;gap:calc(8px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg);color:var(--fg);font:inherit;font-size:calc(13px * var(--ui-scale,1));font-weight:600;cursor:pointer}.auth-provider:disabled{opacity:.45;cursor:not-allowed}.auth-provider-mark{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));flex:none}.msg-act.speaking{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,transparent)}.plus-benefits{padding-left:calc(22px * var(--ui-scale,1));color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));line-height:1.6}.plus-benefits li{margin:calc(6px * var(--ui-scale,1)) 0}#adminCheckDialog{width:min(calc(420px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(16px * var(--ui-scale,1));background:var(--bg);color:var(--fg);padding:calc(20px * var(--ui-scale,1));box-shadow:0 calc(16px * var(--ui-scale,1)) calc(48px * var(--ui-scale,1)) #0004}#adminCheckDialog::backdrop{background:#0005;backdrop-filter:blur(calc(3px * var(--ui-scale,1)))}#adminCheckDialog h2{font-size:calc(18px * var(--ui-scale,1));margin:0 0 calc(8px * var(--ui-scale,1))}#adminCheckDialog .settings-hint{margin-bottom:calc(14px * var(--ui-scale,1))}#adminCheckDialog .settings-action{margin:calc(4px * var(--ui-scale,1))}
.update-spinner{display:block;width:calc(64px * var(--ui-scale,1));height:calc(64px * var(--ui-scale,1));object-fit:contain;margin:calc(8px * var(--ui-scale,1)) auto calc(18px * var(--ui-scale,1));animation:update-spin 5s linear infinite}.update-heading{display:block;text-align:center;font-size:calc(20px * var(--ui-scale,1));font-weight:800;margin:0 0 calc(12px * var(--ui-scale,1))}.update-stage{text-align:center;color:var(--fg2);font-size:calc(14px * var(--ui-scale,1))}.update-stage:after{content:"";animation:update-dots 1.2s steps(4,end) infinite}
@keyframes update-spin{0%{transform:rotate(0)}60%{transform:rotate(360deg)}100%{transform:rotate(360deg)}}@keyframes update-dots{0%,20%{content:""}40%{content:"."}60%{content:".."}80%,100%{content:"..."}}
.service-warning-close{margin-left:auto;flex:0 0 calc(30px * var(--ui-scale,1));width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));display:grid;place-items:center;border:0;border-radius:calc(8px * var(--ui-scale,1));background:transparent;color:inherit;cursor:pointer}.service-warning-close:hover{background:color-mix(in srgb,var(--fg) 9%,transparent)}.service-warning-close:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent)}
.beta-setting-option{margin:0 0 calc(18px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1))}.beta-setting-option .display-option{margin:0;padding:0;border:0}.beta-empty-state{display:grid;place-items:center;min-height:calc(220px * var(--ui-scale,1));margin:0;padding:calc(24px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));text-align:center;color:var(--fg2)}

/* --- Personal API key field: masked value with a 3-second eye reveal --- */
.api-key-field{position:relative;display:block}
.api-key-field .inp{width:100%;padding-right:calc(46px * var(--ui-scale,1));font-family:Consolas,monospace;letter-spacing:.06em}
.api-key-eye{position:absolute;top:0;bottom:0;right:calc(8px * var(--ui-scale,1));margin-block:auto;z-index:3;width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));display:grid;place-items:center;border:0;border-radius:calc(9px * var(--ui-scale,1));background:transparent;color:var(--fg2);cursor:pointer}
.api-key-eye:hover,.api-key-eye:focus-visible{color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);outline:none}
.api-key-eye.revealed{color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,transparent)}
.api-key-eye svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}

/* --- Usage bar (0.22.3): slim scale in a row with an inline percent --- */
#settings-panel-usage{padding:0;border:0;background:transparent}
#settings-panel-usage>p:first-of-type{margin-top:0}
.usage-row{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));margin:calc(10px * var(--ui-scale,1)) 0 calc(8px * var(--ui-scale,1))}
#settings-panel-usage progress{display:block;flex:1 1 auto;width:auto;min-width:0;height:calc(8px * var(--ui-scale,1));margin:0;border:0;border-radius:calc(999px * var(--ui-scale,1));background:color-mix(in srgb,var(--fg) 9%,transparent);accent-color:var(--accent);appearance:none;-webkit-appearance:none;overflow:hidden;pointer-events:none;cursor:default;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) calc(2px * var(--ui-scale,1)) rgba(0,0,0,.07);outline:none;filter:none;transform:none;transition:none}
#settings-panel-usage progress::-webkit-progress-bar{background:transparent;border:0;border-radius:calc(999px * var(--ui-scale,1));box-shadow:none}
#settings-panel-usage progress::-webkit-progress-value{background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 62%,#60a5fa));border-radius:calc(999px * var(--ui-scale,1));box-shadow:0 0 calc(8px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 28%,transparent);transition:width .5s cubic-bezier(.22,.75,.2,1)}
#settings-panel-usage progress::-moz-progress-bar{background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 62%,#60a5fa));border-radius:calc(999px * var(--ui-scale,1));box-shadow:none}
#settings-panel-usage progress:hover,#settings-panel-usage progress:active,#settings-panel-usage progress:focus,#settings-panel-usage progress:focus-visible{border:0;outline:none;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) calc(2px * var(--ui-scale,1)) rgba(0,0,0,.07);filter:none;transform:none;cursor:default}
#settings-panel-usage[data-state=exhausted] progress::-webkit-progress-value{background:linear-gradient(90deg,#ef5363,#f97316);box-shadow:0 0 calc(8px * var(--ui-scale,1)) color-mix(in srgb,#ef5363 26%,transparent)}
#settings-panel-usage[data-state=exhausted] progress::-moz-progress-bar{background:linear-gradient(90deg,#ef5363,#f97316)}
#settings-panel-usage[data-state=unavailable] progress::-webkit-progress-value{background:linear-gradient(90deg,#e5a144,#f97316);box-shadow:0 0 calc(8px * var(--ui-scale,1)) color-mix(in srgb,#e5a144 26%,transparent)}
#settings-panel-usage[data-state=unavailable] progress::-moz-progress-bar{background:linear-gradient(90deg,#e5a144,#f97316)}
#usagePercent{flex:0 0 auto;min-width:calc(40px * var(--ui-scale,1));text-align:right;font-size:calc(12.5px * var(--ui-scale,1));font-weight:700;color:var(--fg2);margin:0;font-variant-numeric:tabular-nums}
#usageHint{margin-bottom:0}
@media(max-width:600px){#settings-panel-usage progress{height:calc(7px * var(--ui-scale,1))}.usage-row{gap:calc(8px * var(--ui-scale,1))}}

/* --- Notifications: five rows before expanding --- */
.notice-expand{display:flex;align-items:center;justify-content:center;gap:calc(6px * var(--ui-scale,1));width:100%;margin:calc(8px * var(--ui-scale,1)) 0 calc(2px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:transparent;color:var(--fg2);font:inherit;font-size:calc(12.5px * var(--ui-scale,1));font-weight:600;cursor:pointer}
.notice-expand:hover{color:var(--fg);border-color:var(--accent)}
.notice-expand[aria-expanded="true"] svg{transform:rotate(180deg)}
.notice-expand svg{transition:transform .25s ease}

/* --- Plus checkout window --- */
#subModal .modal-box{max-width:calc(520px * var(--ui-scale,1))}
.sub-note{margin:0 0 calc(10px * var(--ui-scale,1));color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));line-height:1.55}
#subBody h3{margin:0 0 calc(6px * var(--ui-scale,1));font-size:calc(19px * var(--ui-scale,1));font-weight:800}
.pay-amount{display:flex;align-items:baseline;justify-content:space-between;gap:calc(12px * var(--ui-scale,1));margin:calc(14px * var(--ui-scale,1)) 0 calc(12px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg3);font-size:calc(13px * var(--ui-scale,1));color:var(--fg2)}
.pay-amount strong{font-size:calc(20px * var(--ui-scale,1));font-weight:800;color:var(--fg)}
.pay-stage{margin-top:calc(14px * var(--ui-scale,1));display:flex;flex-direction:column;gap:calc(10px * var(--ui-scale,1))}
.pay-stage-head{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1))}
.pay-method-back{width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));display:grid;place-items:center;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(9px * var(--ui-scale,1));background:transparent;color:var(--fg2);cursor:pointer}
.pay-method-back:hover{color:var(--accent);border-color:var(--accent)}
.pay-field{display:grid;gap:calc(6px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1));font-weight:600;color:var(--fg2)}
.pay-field .inp{width:100%}
.qr-placeholder{background:#fff}
.pay-submit{width:100%;padding:calc(13px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1));font-weight:700;font-size:calc(14px * var(--ui-scale,1))}
.pay-submit.unavailable{opacity:.7;cursor:default}
#subBody .pay-methods{grid-template-columns:repeat(3,minmax(0,1fr))}@media(max-width:520px){#subBody .pay-methods{grid-template-columns:1fr}}

/* --- Consistent controls: faded disabled state, unified select arrows --- */
.mode-btn:disabled,.mode-btn[aria-disabled="true"]{opacity:.45;filter:grayscale(.25);cursor:not-allowed;background:var(--bg3)!important;border-color:var(--border)!important;color:var(--fg2)!important}
.mode-btn:disabled:hover,.mode-btn[aria-disabled="true"]:hover{color:var(--fg2)!important}
.mode-btn:disabled svg,.mode-btn[aria-disabled="true"] svg{opacity:.85}
.modes .mode-btn{min-height:calc(34px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));font-size:calc(12.5px * var(--ui-scale,1));gap:calc(6px * var(--ui-scale,1));line-height:1.2}
.modes .mode-btn svg{width:calc(15px * var(--ui-scale,1));height:calc(15px * var(--ui-scale,1));flex:0 0 calc(15px * var(--ui-scale,1))}
#agentBtn{max-width:min(calc(320px * var(--ui-scale,1)),100%)}
#agentBtn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
select.inp{appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%238b8b95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right calc(12px * var(--ui-scale,1)) center;background-size:calc(14px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));padding-right:calc(38px * var(--ui-scale,1));cursor:pointer;text-overflow:ellipsis}
select.inp:disabled{opacity:.5;cursor:not-allowed;color:var(--fg2);background-color:var(--bg3)}
select.inp option{background:var(--bg);color:var(--fg)}
.rename-row{display:flex;align-items:center;gap:calc(4px * var(--ui-scale,1));width:100%;min-width:0}
.rename-input{flex:1;min-width:0}
.rename-save{flex:0 0 calc(24px * var(--ui-scale,1));width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));display:grid;place-items:center;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(8px * var(--ui-scale,1));background:var(--bg);color:var(--accent);cursor:pointer}
.rename-save:hover{background:color-mix(in srgb,var(--accent) 12%,transparent);border-color:var(--accent)}
.field-save-row{display:flex;gap:calc(8px * var(--ui-scale,1));align-items:center}
.field-save{flex:0 0 calc(44px * var(--ui-scale,1));width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));display:grid;place-items:center;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg3);color:var(--accent);cursor:pointer;transition:background-color .2s ease,border-color .2s ease,transform .2s ease}
.field-save:hover{background:color-mix(in srgb,var(--accent) 12%,transparent);border-color:var(--accent)}
.field-save:active{transform:scale(.94)}
.notification-popover{scrollbar-gutter:stable}
.notification-row{transition:background-color .2s ease}
.notification-row:hover{background:color-mix(in srgb,var(--fg) 5%,transparent)}

/* --- Softer, consistent transitions between sections and tabs --- */
@keyframes panel-switch-in{from{opacity:0;transform:translateY(calc(6px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
@keyframes row-in{from{opacity:0;transform:translateY(calc(-4px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
.settings-section:not([hidden]){animation:panel-switch-in .26s cubic-bezier(.22,.8,.2,1) both}
#notesEditor:not([hidden]){animation:panel-switch-in .28s cubic-bezier(.22,.8,.2,1) both}
body.workspace-changing #chatViewport,body.workspace-changing #notesEditor{animation:panel-switch-in .3s cubic-bezier(.22,.8,.2,1) both}
.chat-item.chat-new{animation:row-in .34s cubic-bezier(.22,.8,.2,1) both}
.answer-skill{align-self:flex-start;margin:calc(2px * var(--ui-scale,1)) 0 calc(6px * var(--ui-scale,1))}
@media(prefers-reduced-motion:reduce){.settings-section:not([hidden]),#notesEditor:not([hidden]),body.workspace-changing #chatViewport,body.workspace-changing #notesEditor,.chat-item.chat-new{animation:none!important}}

/* --- Notes: compact AI actions and the side answer panel --- */
#notesEditor{position:relative}
#noteAI{display:flex;flex-wrap:wrap;gap:calc(6px * var(--ui-scale,1));padding:0 calc(18px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}
#noteAI .note-tool{display:inline-flex;align-items:center;gap:calc(6px * var(--ui-scale,1));width:auto;height:calc(34px * var(--ui-scale,1));padding:0 calc(11px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(11px * var(--ui-scale,1));background:var(--bg2);color:var(--fg2);font-size:calc(12.5px * var(--ui-scale,1));font-weight:600;transition:color .2s ease,border-color .2s ease,background-color .2s ease,transform .2s ease}
#noteAI .note-tool:hover{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 45%,transparent);background:color-mix(in srgb,var(--accent) 8%,transparent)}
#noteAI .note-tool:active{transform:scale(.97)}
#noteAI .note-tool span{white-space:nowrap}
#noteAIPanel{position:absolute;inset:0 0 0 auto;width:min(calc(390px * var(--ui-scale,1)),100%);display:flex;flex-direction:column;background:var(--bg);border-left:calc(1px * var(--ui-scale,1)) solid var(--border);box-shadow:calc(-14px * var(--ui-scale,1)) 0 calc(34px * var(--ui-scale,1)) #00000012;z-index:5;animation:panel-switch-in .26s cubic-bezier(.22,.8,.2,1) both}
#noteAIPanel[hidden]{display:none!important}
#noteAIPanel header{display:flex;align-items:center;justify-content:space-between;gap:calc(10px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);font-size:calc(14px * var(--ui-scale,1))}
#noteAIClose{width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));border:0;border-radius:calc(9px * var(--ui-scale,1));background:transparent;color:var(--fg2);font-size:calc(20px * var(--ui-scale,1));line-height:1;cursor:pointer}
#noteAIClose:hover{background:var(--hover);color:var(--fg)}
#noteAIBody{flex:1;min-height:0;overflow:auto;padding:calc(14px * var(--ui-scale,1));display:flex;flex-direction:column;gap:calc(10px * var(--ui-scale,1));scrollbar-gutter:stable;overscroll-behavior:contain}
.note-ai-msg{max-width:100%;padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border-radius:calc(13px * var(--ui-scale,1));font-size:calc(13.5px * var(--ui-scale,1));line-height:1.55;overflow-wrap:anywhere;white-space:pre-wrap}
.note-ai-msg.user{align-self:flex-end;max-width:88%;background:color-mix(in srgb,var(--accent) 12%,transparent);border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 28%,transparent);color:var(--fg)}
.note-ai-msg.ai{align-self:flex-start;background:var(--bg2);border:calc(1px * var(--ui-scale,1)) solid var(--border);color:var(--fg)}
.note-ai-error{margin:0;color:var(--danger);font-size:calc(12.5px * var(--ui-scale,1))}
#noteAIForm{display:flex;align-items:flex-end;gap:calc(8px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border-top:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg)}
#noteAIInput{flex:1;min-height:calc(38px * var(--ui-scale,1));max-height:calc(120px * var(--ui-scale,1));resize:none;padding:calc(9px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg3);color:var(--fg);font:inherit;font-size:calc(13.5px * var(--ui-scale,1));line-height:1.4}
#noteAIInput:focus{outline:none;border-color:var(--accent)}
#noteAISend{flex:0 0 calc(38px * var(--ui-scale,1));width:calc(38px * var(--ui-scale,1));height:calc(38px * var(--ui-scale,1));display:grid;place-items:center;border:0;border-radius:calc(11px * var(--ui-scale,1));background:var(--accent);color:#fff;cursor:pointer;transition:filter .2s ease,transform .2s ease}
#noteAISend:hover{filter:brightness(1.08)}
#noteAISend:active{transform:scale(.95)}
.note-proposal{max-width:100%;margin:calc(2px * var(--ui-scale,1)) 0}
@media(max-width:760px){#noteAIPanel{width:100%}#noteAI{padding:0 calc(12px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:reduce){#noteAIPanel{animation:none!important}}

/* --- Soft removal animation for chat rows --- */
@keyframes chat-out{to{opacity:0;transform:translateX(calc(-10px * var(--ui-scale,1)))}}
.chat-item.chat-removing{animation:chat-out .18s ease both;pointer-events:none}
@media(prefers-reduced-motion:reduce){.chat-item.chat-removing{animation:none!important}}

/* --- Note font size uses the same chevron as every other select --- */
#noteFontSize{appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='12' height='12' fill='none' stroke='%238b8b95' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right calc(5px * var(--ui-scale,1)) center;background-size:calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));padding-right:calc(20px * var(--ui-scale,1));cursor:pointer}

/* --- Soft confirmation pulse when a note is saved --- */
@keyframes note-status-pop{from{opacity:.35;transform:translateY(calc(2px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
#noteStatus.note-status-pop{animation:note-status-pop .28s ease both}
@media(prefers-reduced-motion:reduce){#noteStatus.note-status-pop{animation:none!important}}
.answer-body.answer-animating{pointer-events:none}

/* --- 0.22.0: Liquid Glass for the section switch panels --- */
:root{--glass-bg:rgba(255,255,255,.55);--glass-border:rgba(255,255,255,.6);--glass-shadow:0 calc(10px * var(--ui-scale,1)) calc(30px * var(--ui-scale,1)) rgba(15,23,42,.08)}
body.dark{--glass-bg:rgba(30,30,40,.55);--glass-border:rgba(255,255,255,.1);--glass-shadow:0 calc(10px * var(--ui-scale,1)) calc(30px * var(--ui-scale,1)) rgba(0,0,0,.38)}
#workspaceSwitch{background:var(--glass-bg);border-color:var(--glass-border);box-shadow:var(--glass-shadow),inset 0 calc(1px * var(--ui-scale,1)) 0 var(--glass-border);-webkit-backdrop-filter:blur(calc(18px * var(--ui-scale,1))) saturate(160%);backdrop-filter:blur(calc(18px * var(--ui-scale,1))) saturate(160%);transition:background-color .3s ease,border-color .3s ease,box-shadow .3s ease}
.workspace-slider{background:color-mix(in srgb,var(--bg) 74%,transparent);border-color:var(--glass-border);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1)) #00000012,inset 0 calc(1px * var(--ui-scale,1)) 0 var(--glass-border);-webkit-backdrop-filter:blur(calc(10px * var(--ui-scale,1))) saturate(150%);backdrop-filter:blur(calc(10px * var(--ui-scale,1))) saturate(150%)}
.settings-tabs{background:var(--glass-bg);-webkit-backdrop-filter:blur(calc(18px * var(--ui-scale,1))) saturate(160%);backdrop-filter:blur(calc(18px * var(--ui-scale,1))) saturate(160%)}
.settings-tab-indicator{background:color-mix(in srgb,var(--bg) 72%,transparent);box-shadow:inset 0 0 0 calc(1px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 14%,transparent),0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) #00000010;-webkit-backdrop-filter:blur(calc(10px * var(--ui-scale,1)));backdrop-filter:blur(calc(10px * var(--ui-scale,1)))}
/* Low-power devices, mobile layouts and missing backdrop support keep a solid surface. */
html[data-render-budget=compact] #workspaceSwitch,html[data-render-budget=compact] .settings-tabs,html[data-render-budget=compact] .workspace-slider,html[data-render-budget=compact] .settings-tab-indicator{backdrop-filter:none;-webkit-backdrop-filter:none;background:color-mix(in srgb,var(--bg) 78%,transparent);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) #0000000d,inset 0 calc(1px * var(--ui-scale,1)) 0 var(--glass-border)}
html[data-layout=mobile] #workspaceSwitch,html[data-layout=mobile] .settings-tabs{backdrop-filter:none;-webkit-backdrop-filter:none;background:color-mix(in srgb,var(--bg) 80%,transparent);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) #0000000d,inset 0 calc(1px * var(--ui-scale,1)) 0 var(--glass-border)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#workspaceSwitch,.settings-tabs,.workspace-slider,.settings-tab-indicator{background:var(--bg3);box-shadow:0 calc(2px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) #0000000d}}

/* --- 0.22.0: smoother window opening and workspace switching --- */
@keyframes glass-panel-in{from{opacity:0;transform:translateY(calc(12px * var(--ui-scale,1))) scale(.977)}to{opacity:1;transform:none}}
.overlay.open .modal-box{animation:glass-panel-in .34s cubic-bezier(.22,.8,.2,1) both}
.confirm-modal.open .confirm-box{animation:glass-panel-in .34s cubic-bezier(.22,.8,.2,1) both}
#authScreen.show{animation:overlayIn .3s ease both}
/* The sign-in box fades in without scaling: system text rendering must stay neutral during the entrance. */
@keyframes glass-fade-in{from{opacity:0}to{opacity:1}}
#authScreen.show .auth-box{animation:glass-fade-in .4s ease both}
#agentPopup{animation:glass-panel-in .22s cubic-bezier(.22,.8,.2,1) both}
body.workspace-changing #chatViewport,body.workspace-changing #notesEditor{animation:panel-switch-in .32s cubic-bezier(.22,.8,.2,1) both}

/* --- 0.22.0: the eye now draws the slash over the pupil, like the sign-in eye --- */
.api-key-eye .api-eye-slash{stroke-dasharray:1;stroke-dashoffset:1;opacity:0;transition:stroke-dashoffset .28s cubic-bezier(.2,.8,.2,1),opacity .22s ease}
.api-key-eye.revealed .api-eye-slash{stroke-dashoffset:0;opacity:1}
.api-key-eye .api-eye-pupil{opacity:1;transition:opacity .22s ease}
.api-key-eye.revealed .api-eye-pupil{opacity:.15}
.api-key-eye svg{transition:transform .28s cubic-bezier(.2,.8,.2,1)}
.api-key-eye.revealed svg{transform:scale(1.05)}

/* --- 0.22.0: Plus reads as a soft premium badge instead of a flat outline --- */
.plus-action,.plan-btn,#upgradeBtn,[class*=upgrade]{color:#9a7b16!important;border-color:#dcb64f!important;background:linear-gradient(150deg,color-mix(in srgb,#f8ce55 26%,transparent),color-mix(in srgb,#f8ce55 10%,transparent))!important;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 rgba(255,255,255,.4),0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) rgba(217,182,74,.16)!important}
.plus-action:hover,.plan-btn:hover,#upgradeBtn:not(.active):hover{background:linear-gradient(150deg,color-mix(in srgb,#f8ce55 36%,transparent),color-mix(in srgb,#f8ce55 16%,transparent))!important;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 rgba(255,255,255,.45),0 calc(3px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) rgba(217,182,74,.24)!important}
body.dark .plus-action,body.dark .plan-btn,body.dark #upgradeBtn,body.dark [class*=upgrade]{color:#f2cd60!important;border-color:#9c8034!important;background:linear-gradient(150deg,color-mix(in srgb,#f8ce55 16%,transparent),color-mix(in srgb,#f8ce55 6%,transparent))!important;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 rgba(255,255,255,.12),0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) rgba(0,0,0,.3)!important}
#settings-panel-subscription .plus-action{border-radius:calc(12px * var(--ui-scale,1))}

/* --- 0.22.0: round name-confirm buttons keep the checkmark optically centered --- */
.rename-save{border-radius:50%}
.field-save{border-radius:50%}
.rename-save svg,.field-save svg{display:block}

/* --- 0.22.1: liquid glass motion for panels, tabs and the workspace switch ---
   Attribute toggles restart an animation only when the animation-name value
   itself changes, so chats/notes use paired keyframe aliases. */
@keyframes slider-sheen-a{from{transform:translateX(-140%) skewX(-18deg)}to{transform:translateX(240%) skewX(-18deg)}}
@keyframes slider-sheen-b{from{transform:translateX(-140%) skewX(-18deg)}to{transform:translateX(240%) skewX(-18deg)}}
@keyframes switch-bounce-a{0%{transform:scale(1)}35%{transform:scale(.984,1.012)}72%{transform:scale(1.007,.996)}100%{transform:scale(1)}}
@keyframes switch-bounce-b{0%{transform:scale(1)}35%{transform:scale(.984,1.012)}72%{transform:scale(1.007,.996)}100%{transform:scale(1)}}
@keyframes workspace-in-left{from{opacity:0;transform:translateX(calc(-14px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
@keyframes workspace-in-right{from{opacity:0;transform:translateX(calc(14px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
.workspace-slider{overflow:hidden}
.workspace-slider::after{content:"";position:absolute;inset:calc(1px * var(--ui-scale,1));border-radius:inherit;background:linear-gradient(105deg,transparent 34%,rgba(255,255,255,.55) 50%,transparent 66%);opacity:0;pointer-events:none}
#workspaceSwitch[data-section=chats] .workspace-slider::after{opacity:1;animation:slider-sheen-a .62s cubic-bezier(.35,.55,.3,1)}
#workspaceSwitch[data-section=notes] .workspace-slider::after{opacity:1;animation:slider-sheen-b .62s cubic-bezier(.35,.55,.3,1)}
#workspaceSwitch[data-section=chats]{animation:switch-bounce-a .5s cubic-bezier(.22,.8,.2,1)}
#workspaceSwitch[data-section=notes]{animation:switch-bounce-b .5s cubic-bezier(.22,.8,.2,1)}
body.workspace-changing.notes-active #notesEditor{animation:workspace-in-right .4s cubic-bezier(.22,.8,.2,1) both}
body.workspace-changing:not(.notes-active) #chatViewport{animation:workspace-in-left .4s cubic-bezier(.22,.8,.2,1) both}
.settings-section:not([hidden]){animation:glass-panel-in .34s cubic-bezier(.22,.8,.2,1) both}
.settings-tab-indicator::after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(180deg,rgba(255,255,255,.42),rgba(255,255,255,0) 58%);pointer-events:none}
html[data-motion=reduced] #workspaceSwitch,html[data-motion=reduced] .workspace-slider::after,html[data-motion=reduced] .settings-section:not([hidden]){animation:none!important}
@media(prefers-reduced-motion:reduce){#workspaceSwitch[data-section=chats],#workspaceSwitch[data-section=notes],#workspaceSwitch .workspace-slider::after{animation:none!important}}
@media(prefers-reduced-motion:reduce){.overlay.open .modal-box,.confirm-modal.open .confirm-box,#authScreen.show,#authScreen.show .auth-box,#agentPopup,body.workspace-changing #chatViewport,body.workspace-changing #notesEditor,.api-key-eye svg,.api-key-eye .api-eye-slash,.api-key-eye .api-eye-pupil{animation:none!important;transition:none!important}}


/* --- 0.22.1: service rating dialog (once, after 5 minutes of usage) --- */
.rating-box{width:min(calc(340px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));max-width:calc(340px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1))}
.rating-box .modal-head h2{font-size:calc(16px * var(--ui-scale,1));line-height:1.4;margin-right:calc(6px * var(--ui-scale,1))}
.rating-stars{display:flex;justify-content:center;gap:calc(6px * var(--ui-scale,1));margin:calc(14px * var(--ui-scale,1)) 0 calc(16px * var(--ui-scale,1))}
.rating-stars button{width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;border-radius:calc(12px * var(--ui-scale,1));background:transparent;color:var(--fg2);cursor:pointer;transition:transform .18s cubic-bezier(.22,.8,.2,1),color .18s ease,background .18s ease}
.rating-stars button:hover{background:var(--input-bg,var(--bg2));transform:scale(1.12)}
.rating-stars button:active{transform:scale(.94)}
.rating-stars button svg{width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;transition:fill .18s ease,color .18s ease,transform .18s ease}
.rating-stars button.on{color:#f5b301}
.rating-stars button.on svg{fill:#f5b301;stroke:#f5b301}
.rating-stars button:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}
#ratingSend{width:100%;padding:calc(12px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1))}
#ratingSend:disabled{opacity:.5;cursor:not-allowed}
.rating-note{font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);text-align:center;margin:calc(10px * var(--ui-scale,1)) 0 0}
.rating-stars button:hover ~ button svg{fill:none}
html[data-motion=reduced] .rating-stars button,html[data-motion=reduced] .rating-stars button svg{transition:none!important}
@media(prefers-reduced-motion:reduce){.rating-stars button,.rating-stars button svg{transition:none!important}}

/* --- 0.22.1: liquid glass response for the bottom sidebar buttons (Guide/Settings) --- */
#sidebar .sb-row .sb-btn{position:relative;overflow:hidden;transition:transform .18s cubic-bezier(.22,.8,.2,1),background .18s ease,color .18s ease}
:root[data-motion="full"] #sidebar .sb-row .sb-btn{transition:transform .18s cubic-bezier(.22,.8,.2,1),background-color .38s ease,color .38s ease,border-color .38s ease,box-shadow .45s ease,opacity .35s ease!important}
:root[data-motion="full"] #sidebar .sb-row .sb-btn:active:not(:disabled){transform:scale(.955)!important}
:root[data-motion="full"] #sidebar .sb-row .sb-btn::after{transition:transform .62s cubic-bezier(.35,.55,.3,1),opacity .2s ease}
#sidebar .sb-row .sb-btn::after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(105deg,transparent 36%,rgba(255,255,255,.45) 50%,transparent 64%);opacity:0;transform:translateX(-140%) skewX(-18deg);pointer-events:none}
#sidebar .sb-row .sb-btn:hover::after{opacity:1;transform:translateX(240%) skewX(-18deg);transition:transform .62s cubic-bezier(.35,.55,.3,1),opacity .2s ease}
#sidebar .sb-row .sb-btn:active{transform:scale(.955)}
#sidebar .sb-row .sb-btn:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}
html[data-motion=reduced] #sidebar .sb-row .sb-btn,html[data-motion=reduced] #sidebar .sb-row .sb-btn::after{transition:none!important}
html[data-motion=reduced] #sidebar .sb-row .sb-btn:active{transform:none}
@media(prefers-reduced-motion:reduce){#sidebar .sb-row .sb-btn,#sidebar .sb-row .sb-btn::after{transition:none!important}#sidebar .sb-row .sb-btn:active{transform:none}}

/* --- 0.26.1: top-bar icons share one optical size --- */
#topbar .tb-actions :is(.icon-btn,.tb-btn) svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}

/* --- 0.26.1: toast is a fixed-width block; the close cross lives on its right edge --- */

/* --- 0.26.1: "История" card with the standard chevron instead of the OS marker --- */
.local-history-card{margin-top:calc(16px * var(--ui-scale,1));padding:calc(2px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2)}
.local-history-card summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:calc(10px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1));font-weight:600;min-height:calc(46px * var(--ui-scale,1));line-height:1.35;padding:0 calc(2px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));user-select:none}
.local-history-card summary::-webkit-details-marker{display:none}
.local-history-card summary::after{content:"";width:calc(16px * var(--ui-scale,1));height:calc(16px * var(--ui-scale,1));flex-shrink:0;color:var(--fg2);background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;transition:transform .32s cubic-bezier(.22,.8,.2,1)}
.local-history-card[open] summary::after{transform:rotate(180deg)}
.local-history-card summary:hover::after{color:var(--fg)}
html[data-motion=reduced] .local-history-card summary::after{transition:none}
@media(prefers-reduced-motion:reduce){.local-history-card summary::after{transition:none}}

/* --- 0.26.1: notes empty state --- */
.note-empty{padding:calc(72px * var(--ui-scale,1)) calc(28px * var(--ui-scale,1));text-align:center;font-size:calc(17px * var(--ui-scale,1));line-height:1.65;font-weight:500;color:var(--fg2)}

/* --- 0.26.1: "Умный редактор" — AI strip under the editing tools --- */
#smartEditor{border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);background:color-mix(in srgb,var(--bg2) 55%,transparent)}
#smartEditorBar{display:flex;align-items:center;justify-content:space-between;gap:calc(10px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));padding:calc(5px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1))}
#smartEditorTitle{font-size:calc(12.5px * var(--ui-scale,1));font-weight:600;letter-spacing:.01em;color:var(--fg)}
#smartEditorToggle{width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));border:0;border-radius:calc(9px * var(--ui-scale,1));display:grid;place-items:center;background:transparent;color:var(--fg2);cursor:pointer;transition:background .18s ease,color .18s ease}
#smartEditorToggle:hover{background:var(--hover);color:var(--fg)}
#smartEditorToggle:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}
#smartEditorToggle svg{transition:transform .32s cubic-bezier(.22,.8,.2,1)}
#smartEditorToggle[aria-expanded="false"] svg{transform:rotate(180deg)}
#smartEditorBody{padding:0 0 calc(4px * var(--ui-scale,1))}
#smartEditorBody #noteAI{border-top:0;background:transparent;padding:calc(2px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1))}
#smartEditorBody[hidden]{display:none}
html[data-motion=reduced] #smartEditorToggle svg{transition:none}
@media(prefers-reduced-motion:reduce){#smartEditorToggle svg{transition:none}}

/* --- 0.26.1: smoother workspace crossfade (fixes the 360ms cut-off) --- */
body.workspace-changing.notes-active #notesEditor{animation:workspace-in-right .42s cubic-bezier(.25,.75,.2,1) both}
body.workspace-changing:not(.notes-active) #chatViewport{animation:workspace-in-left .42s cubic-bezier(.25,.75,.2,1) both}

/* --- 0.22.3: notes empty state — before the first note only the centered label stays --- */
#notesEditor.no-note #noteTitle,#notesEditor.no-note #noteBody,#notesEditor.no-note .note-files,
#notesEditor.no-note #noteFileActions,#notesEditor.no-note #noteToolbar,#notesEditor.no-note #smartEditor,
#notesEditor.no-note .note-save-row,#notesEditor.no-note #noteAIPanel{display:none!important}
#notesEditor.no-note .note-scroll{display:flex;overflow:hidden;padding:0}
#notesEditor.no-note #noteEmpty{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;
 padding:calc(32px * var(--ui-scale,1));font-size:calc(17px * var(--ui-scale,1));font-weight:600;color:var(--fg2);position:relative;z-index:6;pointer-events:none}
#notesEditor.no-note #noteEmpty[hidden]{display:none}

/* --- 0.22.3: feature switches — smooth springy on/off --- */
input.display-switch[type=checkbox]{transition:background-color .24s ease,border-color .24s ease,box-shadow .24s ease}
input.display-switch[type=checkbox]::before{width:calc(17px * var(--ui-scale,1));height:calc(17px * var(--ui-scale,1));
 transition:transform .32s cubic-bezier(.34,1.56,.64,1),background-color .24s ease,width .18s ease,height .18s ease}
input.display-switch[type=checkbox]:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--border))}
input.display-switch[type=checkbox]:active::before{width:calc(21px * var(--ui-scale,1))}
input.display-switch[type=checkbox]:checked{box-shadow:0 0 0 calc(3.5px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 20%,transparent)}
input.display-switch[type=checkbox]:checked:active::before{transform:translateX(calc(13px * var(--ui-scale,1)))}
input.display-switch[type=checkbox]:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(2px * var(--ui-scale,1))}

/* --- 0.22.3: liquid glass — ambient depth + frosted floating surfaces --- */
body{background:
 radial-gradient(calc(1100px * var(--ui-scale,1)) calc(760px * var(--ui-scale,1)) at 82% -12%,color-mix(in srgb,var(--accent) 8%,transparent),transparent 62%),
 radial-gradient(calc(900px * var(--ui-scale,1)) calc(680px * var(--ui-scale,1)) at -12% 112%,color-mix(in srgb,var(--accent) 6%,transparent),transparent 58%),
 var(--bg)}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 /* Owner request (0.22.3): windows themselves stay opaque like before — the
    translucent box read as a gray surface inside settings. Glass remains on
    panels, popovers and the app chrome. */
 #noteAIPanel{background:color-mix(in srgb,var(--bg) 78%,transparent);
  -webkit-backdrop-filter:blur(calc(22px * var(--ui-scale,1))) saturate(1.5);backdrop-filter:blur(calc(22px * var(--ui-scale,1))) saturate(1.5)}
 .notification-popover,#notificationFilter,#agentPopup,#voiceHelp{
  background:color-mix(in srgb,var(--bg) 80%,transparent);
  -webkit-backdrop-filter:blur(calc(20px * var(--ui-scale,1))) saturate(1.5);backdrop-filter:blur(calc(20px * var(--ui-scale,1))) saturate(1.5)}
 #smartEditor{background:color-mix(in srgb,var(--bg2) 42%,transparent);
  -webkit-backdrop-filter:blur(calc(14px * var(--ui-scale,1))) saturate(1.4);backdrop-filter:blur(calc(14px * var(--ui-scale,1))) saturate(1.4)}
 #noteToolbar{background:color-mix(in srgb,var(--bg2) 55%,transparent);
  -webkit-backdrop-filter:blur(calc(12px * var(--ui-scale,1))) saturate(1.3);backdrop-filter:blur(calc(12px * var(--ui-scale,1))) saturate(1.3)}
 #sidebar,#topbar{background:color-mix(in srgb,var(--bg2) 72%,transparent);
  -webkit-backdrop-filter:blur(calc(16px * var(--ui-scale,1))) saturate(1.4);backdrop-filter:blur(calc(16px * var(--ui-scale,1))) saturate(1.4)}
 html[data-render-budget=compact] #noteAIPanel,
 html[data-render-budget=compact] .notification-popover,html[data-render-budget=compact] #notificationFilter,
 html[data-render-budget=compact] #agentPopup,html[data-render-budget=compact] #voiceHelp,
 html[data-render-budget=compact] #smartEditor,html[data-render-budget=compact] #noteToolbar,
 html[data-render-budget=compact] #sidebar,html[data-render-budget=compact] #topbar{
  -webkit-backdrop-filter:none;backdrop-filter:none;background:var(--bg)}
 html[data-render-budget=compact] #sidebar,html[data-render-budget=compact] #topbar{background:var(--bg2)}
 html[data-render-budget=compact] #smartEditor,html[data-render-budget=compact] #noteToolbar{background:var(--bg2)}
}

/* Model chooser in the composer: compact, themed and keyboard accessible. */
.agent-menu-heading{padding:7px 10px 6px;color:var(--fg2);font-size:10px;font-weight:750;letter-spacing:.07em;text-transform:uppercase}
.agent-model-opt{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:10px 11px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--fg);font:inherit;text-align:left;cursor:pointer;transition:background .16s ease,border-color .16s ease}
.agent-model-opt small{font-size:10.5px;color:var(--fg2)}
.agent-model-opt:hover,.agent-model-opt.active{background:color-mix(in srgb,var(--accent) 10%,var(--bg));border-color:color-mix(in srgb,var(--accent) 35%,transparent)}
.agent-model-opt:disabled{opacity:.45;cursor:not-allowed}
.agent-thinking-heading{margin-top:7px;border-top:1px solid var(--border);padding-top:12px}
.agent-model-opt:focus-visible,.chat-model-option:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* 0.26.1 — unified spacing, accent palettes and soft, liquid motion. */
html[data-accent=yellow] body{--accent:#8a6200;--accent-h:#735100;--accent-rgb:138,98,0}
html[data-accent=red] body{--accent:#bc383e;--accent-h:#9e2830;--accent-rgb:188,56,62}
html[data-accent=green] body{--accent:#23794f;--accent-h:#1a613d;--accent-rgb:35,121,79}
html[data-accent=blue] body{--accent:#266dbe;--accent-h:#1e57a0;--accent-rgb:38,109,190}
html[data-accent=gray] body{--accent:#616570;--accent-h:#4b4f59;--accent-rgb:97,101,112}
html[data-accent=yellow] body.dark{--accent:#efc467;--accent-h:#f5d38c;--accent-rgb:239,196,103}
html[data-accent=red] body.dark{--accent:#f18188;--accent-h:#f99ba1;--accent-rgb:241,129,136}
html[data-accent=green] body.dark{--accent:#71c69a;--accent-h:#93d5b2;--accent-rgb:113,198,154}
html[data-accent=blue] body.dark{--accent:#79aff0;--accent-h:#9dc5f5;--accent-rgb:121,175,240}
html[data-accent=gray] body.dark{--accent:#b1b4bf;--accent-h:#c7cad3;--accent-rgb:177,180,191}
html:not([data-accent=default]) body.dark :is(.msg.user .bubble,.confirm-btn.primary,#sendBtn.ready){color:#151519}
.colour-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:calc(12px * var(--ui-scale,1));padding:calc(16px * var(--ui-scale,1)) 0}.colour-choice{display:flex;flex-direction:column;align-items:center;gap:calc(8px * var(--ui-scale,1));min-width:0;min-height:calc(72px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1));border:0;border-radius:calc(10px * var(--ui-scale,1));background:transparent;color:var(--fg);font:inherit;font-size:calc(12px * var(--ui-scale,1));cursor:pointer}.colour-choice:hover{background:var(--hover)}.colour-choice i{display:block;width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));border-radius:50%;border:calc(3px * var(--ui-scale,1)) solid var(--bg);outline:calc(2px * var(--ui-scale,1)) solid transparent;transition:transform .3s,outline-color .25s}.colour-choice[aria-pressed=true] i{outline-color:var(--accent);transform:scale(1.1)}.colour-choice:disabled{cursor:wait}.colour-choice span{text-align:center}.rating-later{display:block;width:100%;min-height:calc(44px * var(--ui-scale,1));background:none;border:0;color:var(--fg2);font:inherit;font-size:calc(14px * var(--ui-scale,1));cursor:pointer;margin:calc(8px * var(--ui-scale,1)) 0}.rating-later:hover{color:var(--fg)}
#composerVersion{display:block;color:var(--fg2);font-size:calc(11px * var(--ui-scale,1));text-align:center;margin-top:calc(8px * var(--ui-scale,1));line-height:1.4}.sidebar-plus{width:100%;justify-content:center;margin:calc(8px * var(--ui-scale,1)) 0 0;border:calc(1px * var(--ui-scale,1)) solid var(--border);font-weight:650}.sidebar-plus svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}.tb-btn svg,.sb-btn svg{width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));flex-shrink:0;display:block}.tb-btn,.sb-btn{align-items:center;justify-content:center}.release-dialog{position:fixed;inset:0;margin:auto;width:min(calc(560px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));max-height:85dvh;overflow:auto;padding:calc(24px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(16px * var(--ui-scale,1));background:var(--bg);color:var(--fg);box-shadow:0 calc(24px * var(--ui-scale,1)) calc(80px * var(--ui-scale,1)) #0003}.release-dialog::backdrop{background:#080c1859;backdrop-filter:blur(calc(5px * var(--ui-scale,1)))}.release-dialog[open]{animation:settings-enter .3s ease}.release-dialog h2{font-size:calc(20px * var(--ui-scale,1));margin:0}.release-dialog ul{padding-left:calc(20px * var(--ui-scale,1));line-height:1.6;font-size:calc(14px * var(--ui-scale,1))}.release-dialog li+li{margin-top:calc(10px * var(--ui-scale,1))}#changelogVersion{color:var(--fg2);font-size:calc(13px * var(--ui-scale,1))}.admin-check-dialog{position:fixed;inset:calc(16px * var(--ui-scale,1)) auto auto calc(16px * var(--ui-scale,1));margin:0;width:min(calc(440px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));max-height:calc(100dvh - calc(32px * var(--ui-scale,1)));overflow:auto;background:var(--bg);color:var(--fg);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));padding:calc(20px * var(--ui-scale,1))}.admin-check-dialog::backdrop{background:#0003}#adminScanProgress[hidden],#adminScanCount[hidden]{display:none!important}
.liquid-nav{position:relative;isolation:isolate}.liquid-nav .sb-btn{position:relative;z-index:1;background:transparent}.liquid-indicator{position:absolute;top:0;left:0;z-index:0;background:rgba(var(--accent-rgb,99,102,241),.13);border:calc(1px * var(--ui-scale,1)) solid rgba(var(--accent-rgb,99,102,241),.2);border-radius:calc(12px * var(--ui-scale,1));pointer-events:none;transition:transform .58s cubic-bezier(.22,.85,.25,1.12),width .45s,height .45s}.liquid-selected{color:var(--accent)!important}.workspace-slider,.settings-tab-indicator{background:rgba(var(--accent-rgb,99,102,241),.14)!important;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 #ffffff55,0 calc(2px * var(--ui-scale,1)) calc(8px * var(--ui-scale,1)) #00000008;transition:transform .58s cubic-bezier(.22,.85,.25,1.12),width .45s cubic-bezier(.22,.85,.25,1.12)!important}.settings-tab-indicator{border-radius:calc(10px * var(--ui-scale,1))}.settings-tabs [role=tab]{position:relative;z-index:1}.settings-section:not([hidden]){animation:settings-enter .3s cubic-bezier(.2,.8,.2,1)}
details>summary{list-style:none;position:relative;cursor:pointer;padding-right:calc(30px * var(--ui-scale,1));min-height:calc(32px * var(--ui-scale,1));display:flex;align-items:center}details>summary::-webkit-details-marker{display:none}details>summary::after{content:'';position:absolute;right:calc(8px * var(--ui-scale,1));top:50%;width:calc(7px * var(--ui-scale,1));height:calc(7px * var(--ui-scale,1));border-right:calc(1.8px * var(--ui-scale,1)) solid currentColor;border-bottom:calc(1.8px * var(--ui-scale,1)) solid currentColor;transform:translateY(-65%) rotate(45deg);transition:transform .3s}details[open]>summary::after{transform:translateY(-25%) rotate(225deg)}
.file-dragging::after{content:'Drop files here';position:fixed;inset:calc(16px * var(--ui-scale,1));z-index:9999;display:grid;place-items:center;background:color-mix(in srgb,var(--bg) 92%,transparent);color:var(--accent);border:calc(2px * var(--ui-scale,1)) dashed var(--accent);border-radius:calc(20px * var(--ui-scale,1));font-size:clamp(calc(18px * var(--ui-scale,1)),4vw,calc(28px * var(--ui-scale,1)));font-weight:650;pointer-events:none}
.msg.ai .msg-content{align-items:stretch;min-width:0}.msg.ai :is(.attachment-list,.source-list,.site-proposal){width:100%;min-width:0;align-self:stretch}.message-file-card{min-width:0;max-width:100%}.message-file-card .attachment-chip{min-width:0;flex:1}.bubble pre{max-width:100%;overflow-x:auto}.bubble table{max-width:100%}.attachment-list{align-items:stretch}.message-file-card a{overflow-wrap:anywhere}.settings-field input,.settings-field select{min-height:calc(44px * var(--ui-scale,1))}input[type=checkbox]:checked:not(.display-switch)::before{animation:check-pop .25s ease-out}@keyframes check-pop{from{transform:scale(.45)}to{transform:scale(1)}}
html[data-motion=reduced] :is(.liquid-indicator,.workspace-slider,.settings-tab-indicator,details>summary::after,.colour-choice i){transition:none!important}html[data-motion=reduced] :is(.release-dialog,.settings-section,input[type=checkbox]::before){animation:none!important}
@media(max-width:500px){.colour-palette{gap:calc(8px * var(--ui-scale,1))}.release-dialog{padding:calc(20px * var(--ui-scale,1))}#changelogBtn{min-width:calc(36px * var(--ui-scale,1))}#topbar .tb-actions{gap:calc(2px * var(--ui-scale,1))}}

/* 0.26.1 — quiet chrome, shared accent actions and a consistent settings rhythm. */
#sidebar,body.dark #sidebar,html[data-render-budget=compact] #sidebar{background:var(--bg);border-right:0;backdrop-filter:none;-webkit-backdrop-filter:none}
#sidebar :is(.sb-head,.sb-bottom,.sb-search){border:0}
#sidebar .sb-bottom{padding-top:calc(12px * var(--ui-scale,1))}
#topbar .tb-actions{display:flex;align-items:center;gap:calc(4px * var(--ui-scale,1))}
#topbar .tb-actions :is(button,.tb-btn,.icon-btn){box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));border-radius:calc(10px * var(--ui-scale,1));line-height:1;vertical-align:middle}
#topbar .tb-actions :is(button,.tb-btn,.icon-btn) svg{display:block;width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));min-width:calc(20px * var(--ui-scale,1));flex:none;stroke-width:1.8;transform:none}
#topbar .tb-actions #downloadAppTop{gap:calc(8px * var(--ui-scale,1))}
#topbar .tb-actions #downloadAppTop>span{display:inline-flex;align-items:center;justify-content:center}

/* Both entry points share the same label, icon, geometry and selected accent. */
body #sidebarPlus.plus-action,body #settings-panel-subscription .plus-action,body.dark #sidebarPlus.plus-action,body.dark #settings-panel-subscription .plus-action{display:flex;align-items:center;justify-content:center;gap:calc(10px * var(--ui-scale,1));width:100%;min-height:calc(46px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0 0;padding:calc(12px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 32%,transparent)!important;border-radius:calc(12px * var(--ui-scale,1));background:linear-gradient(125deg,color-mix(in srgb,var(--accent) 14%,var(--bg)),color-mix(in srgb,var(--accent) 6%,var(--bg)))!important;color:var(--accent-h)!important;font:600 15px/1.4 var(--font, -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 color-mix(in srgb,var(--bg) 75%,transparent)!important;transition:background .25s,transform .25s,border-color .25s}
body #sidebarPlus.plus-action::before,body #settings-panel-subscription .plus-action::before{content:'';width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));flex:none;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 3 2.4 6.6L21 12l-6.6 2.4L12 21l-2.4-6.6L3 12l6.6-2.4z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
body #sidebarPlus.plus-action:hover,body #settings-panel-subscription .plus-action:hover{background:color-mix(in srgb,var(--accent) 18%,var(--bg))!important;transform:translateY(calc(-1px * var(--ui-scale,1)));box-shadow:none!important}
body #sidebarPlus.plus-action:active,body #settings-panel-subscription .plus-action:active{transform:scale(.98)}
body :is(.field-save,.rename-save){display:grid;place-items:center;flex:0 0 calc(44px * var(--ui-scale,1));width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--accent)}
body :is(.field-save,.rename-save):hover{background:transparent;border:0;box-shadow:none;color:var(--accent-h);transform:scale(1.08)}
body :is(.field-save,.rename-save) svg{display:block;width:calc(22px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1));stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
body :is(.field-save,.rename-save):focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:0;border-radius:calc(6px * var(--ui-scale,1))}
/* Only the Appearance panel is normalized: don't disturb unrelated form layouts. */
#settings-panel-interface:not([hidden]){display:flex;flex-direction:column;gap:calc(24px * var(--ui-scale,1));font-family:inherit;font-size:calc(14px * var(--ui-scale,1));line-height:1.5}
#settings-panel-interface>*{margin:0!important;min-width:0}
#settings-panel-interface :is(.appearance-field,.motion-setting){display:flex;flex-direction:column;gap:calc(8px * var(--ui-scale,1));padding:0;border:0}
#settings-panel-interface :is(.field-label,label.field-label){font-family:inherit;font-size:calc(14px * var(--ui-scale,1));font-weight:600;line-height:1.5;margin:0}
#settings-panel-interface :is(.settings-hint,#motionHint,#voiceGenderHint,#wakeWordHint){font-family:inherit;font-size:calc(14px * var(--ui-scale,1));font-weight:400;line-height:1.5;color:var(--fg2);margin:0;padding:0}
#settings-panel-interface :is(.grid2,.display-preferences){margin:0;padding:0;gap:calc(12px * var(--ui-scale,1))}
#settings-panel-interface :is(select.inp,.inp){font-family:inherit;font-size:calc(15px * var(--ui-scale,1));line-height:1.5;min-height:calc(46px * var(--ui-scale,1));margin:0}
#settings-panel-interface .display-option{display:flex;align-items:center;justify-content:space-between;gap:calc(16px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));padding:0;margin:0;font-size:calc(14px * var(--ui-scale,1));font-weight:500;line-height:1.5}
#settings-panel-interface .display-option>span{min-width:0;flex:1}
#settings-panel-interface .display-switch{flex-shrink:0;margin:0 calc(4px * var(--ui-scale,1))}
#settings-panel-interface #displayPreferences{display:flex;flex-direction:column;gap:calc(16px * var(--ui-scale,1));border:0}
#settings-panel-interface #interfaceColour>summary{min-height:calc(44px * var(--ui-scale,1));font-family:inherit;font-size:calc(14px * var(--ui-scale,1));font-weight:600;line-height:1.5;padding:0 calc(32px * var(--ui-scale,1)) 0 0}
#settings-panel-interface .colour-palette{gap:calc(12px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) 0 0}
#settings-panel-interface .colour-choice{font-size:calc(14px * var(--ui-scale,1));min-height:calc(84px * var(--ui-scale,1));gap:calc(10px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1))}
#settings-panel-interface .opt{font-family:inherit;font-size:calc(15px * var(--ui-scale,1));line-height:1.5;min-height:calc(46px * var(--ui-scale,1))}
.admin-control-status{margin:calc(12px * var(--ui-scale,1)) 0;font-size:calc(14px * var(--ui-scale,1));line-height:1.5;color:var(--accent);overflow-wrap:anywhere}
.admin-control-status:empty{display:none}.admin-control-status[data-error=true]{color:var(--danger)}
#adminBlacklist .admin-block-row{gap:calc(12px * var(--ui-scale,1));align-items:center}#adminBlacklist .admin-block-row>span{min-width:0;overflow-wrap:anywhere}
#adminControlHint{font-size:calc(14px * var(--ui-scale,1));line-height:1.5}
@keyframes preference-arrive{from{opacity:0;transform:translateY(calc(5px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) #settings-panel-interface:not([hidden])>*,html:not([data-motion=reduced]) #adminBlacklist .admin-block-row{animation:preference-arrive .3s ease both}html:not([data-motion=reduced]) #settings-panel-interface>:nth-child(2){animation-delay:25ms}html:not([data-motion=reduced]) #settings-panel-interface>:nth-child(3){animation-delay:50ms}}
@media(max-width:600px){#settings-panel-interface .inp{font-size:calc(16px * var(--ui-scale,1))}#topbar .tb-actions{gap:0}#topbar .tb-actions :is(button,.tb-btn,.icon-btn){padding:calc(10px * var(--ui-scale,1));min-width:calc(40px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1))}#settingsModal .modal-body{padding:calc(20px * var(--ui-scale,1))}#settings-panel-interface:not([hidden]){gap:calc(24px * var(--ui-scale,1))}#topbar .tb-actions #downloadAppTop{font-size:0;gap:0}}
@media(prefers-reduced-motion:reduce){#settings-panel-interface *,#sidebarPlus,.plus-action{animation:none!important;transition:none!important}}
html[data-motion=reduced] :is(#settings-panel-interface *,#sidebarPlus,.plus-action,.field-save,.rename-save){animation:none!important;transition:none!important}
#topbar .tb-actions [hidden],#settings-panel-interface [hidden]{display:none!important}
@media(max-width:600px){#topbar .tb-actions :is(button,.tb-btn,.icon-btn){min-width:calc(44px * var(--ui-scale,1))}}

@media(max-width:600px){#settings-panel-interface .opt{font-size:calc(16px * var(--ui-scale,1))}}

/* Stronger foregrounds keep accent actions readable on their soft surfaces. */
#settings-panel-interface .opt.active{color:var(--accent-h)}
.admin-control-status{color:var(--accent-h)}
.admin-control-status[data-error=true]{color:#b4232c}body.dark .admin-control-status[data-error=true]{color:#ff8c8c}

/* 0.26.1 CI hotfix: explicit top-layer centering works for intrinsic-height
   dialogs in WebKit as well as Chromium/Firefox. Individual translate leaves
   entry/exit transform animations independent of viewport positioning. */
.release-dialog{inset:50% auto auto 50%;margin:0;translate:-50% -50%;box-sizing:border-box;max-height:85dvh}

/* Settings navigation: visible affordances for mouse, native touch scrolling,
   and a bounded flex item that never expands beyond the settings window. */
#settingsModal .settings-tabs-shell{display:flex;align-items:stretch;flex:0 0 auto;width:100%;max-width:100%;min-width:0;border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border);background:var(--bg)}
#settingsModal .settings-tabs{flex:1 1 0%;width:0;min-width:0;max-width:100%;min-height:calc(52px * var(--ui-scale,1));overflow-x:auto;overflow-y:hidden;border-bottom:0;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--accent) 42%,var(--border)) transparent;touch-action:pan-x;-webkit-overflow-scrolling:touch}
#settingsModal .settings-tabs::-webkit-scrollbar{display:block;height:calc(5px * var(--ui-scale,1))}#settingsModal .settings-tabs::-webkit-scrollbar-thumb{border-radius:calc(4px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 42%,var(--border))}
#settingsModal .settings-tabs-arrow{display:grid;place-items:center;flex:0 0 calc(44px * var(--ui-scale,1));width:calc(44px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));align-self:stretch;padding:calc(10px * var(--ui-scale,1));margin:0;border:0;border-radius:0;background:var(--bg);color:var(--fg);cursor:pointer}
#settingsModal .settings-tabs-arrow svg{display:block;width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));flex:none}#settingsModal .settings-tabs-arrow:disabled{opacity:.35;cursor:default}#settingsModal .settings-tabs-arrow:not(:disabled):hover{background:var(--hover);color:var(--accent)}
#settingsModal .settings-tabs-arrow:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(-3px * var(--ui-scale,1))}#settingsModal .settings-tabs-arrow[hidden]{display:none!important}
#settingsModal .modal-body{min-height:0;overflow-y:auto;overscroll-behavior:contain}
/* A native modal in the top layer, detached from scrolling/animated panels. */
.admin-check-dialog{position:fixed;inset:50% auto auto 50%;translate:-50% -50%;margin:0;box-sizing:border-box;width:min(calc(440px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));max-height:calc(100dvh - calc(32px * var(--ui-scale,1)));overflow-y:auto;overscroll-behavior:contain;box-shadow:0 calc(20px * var(--ui-scale,1)) calc(70px * var(--ui-scale,1)) #0004}
.admin-check-dialog::backdrop{background:#080c1859;backdrop-filter:blur(calc(4px * var(--ui-scale,1)))}

/* A finished sheen animation used to return to an opaque stripe at rest. */
#workspaceSwitch .workspace-slider::after{content:none!important;display:none!important;animation:none!important}
#workspaceSwitch .workspace-slider{box-shadow:0 calc(1px * var(--ui-scale,1)) calc(3px * var(--ui-scale,1)) #0000000a;backdrop-filter:none;-webkit-backdrop-filter:none}
/* Both Plus entry points keep the same restrained, accent-aware treatment. */
body #sidebarPlus.plus-action,body #settings-panel-subscription .plus-action,body.dark #sidebarPlus.plus-action,body.dark #settings-panel-subscription .plus-action{background:linear-gradient(115deg,color-mix(in srgb,var(--accent) 25%,var(--bg)),color-mix(in srgb,var(--accent) 12%,var(--bg)) 58%,color-mix(in srgb,var(--accent) 20%,var(--bg)))!important;border-color:color-mix(in srgb,var(--accent) 42%,var(--bg))!important;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 color-mix(in srgb,var(--bg) 65%,transparent),0 calc(3px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 9%,transparent)!important;color:var(--fg)!important}
body #sidebarPlus.plus-action::before,body #settings-panel-subscription .plus-action::before{color:var(--accent-h)}
body #sidebarPlus.plus-action:hover,body #settings-panel-subscription .plus-action:hover{background:linear-gradient(115deg,color-mix(in srgb,var(--accent) 32%,var(--bg)),color-mix(in srgb,var(--accent) 17%,var(--bg)) 58%,color-mix(in srgb,var(--accent) 26%,var(--bg)))!important;box-shadow:inset 0 calc(1px * var(--ui-scale,1)) 0 color-mix(in srgb,var(--bg) 65%,transparent),0 calc(4px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 12%,transparent)!important}
body #sidebarPlus.plus-action:focus-visible,body #settings-panel-subscription .plus-action:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}

/* Private service connections: one top-layer sheet, bounded on phones. */
#composerMenu #addConnections{border-top:calc(1px * var(--ui-scale,1)) solid var(--border);margin-top:calc(4px * var(--ui-scale,1));padding-top:calc(12px * var(--ui-scale,1))}
#addConnections i{display:inline-grid;place-items:center;width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid currentColor;border-radius:calc(6px * var(--ui-scale,1))}
#addConnections i::after{content:'+';font-style:normal;font-size:calc(16px * var(--ui-scale,1));line-height:1}
/* Intrinsic-height top-layer dialogs: auto margins center the final box without percentage translation. */
.connections-dialog{position:fixed;inset:calc(16px * var(--ui-scale,1));translate:none;margin:auto;height:fit-content;box-sizing:border-box;width:min(calc(540px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));max-height:calc(100dvh - calc(32px * var(--ui-scale,1)));overflow:auto;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(22px * var(--ui-scale,1));padding:calc(24px * var(--ui-scale,1));background:var(--bg);color:var(--fg);box-shadow:0 calc(18px * var(--ui-scale,1)) calc(70px * var(--ui-scale,1)) #0003;font:calc(16px * var(--ui-scale,1))/1.5 Arial,sans-serif}
.connections-dialog::backdrop{background:#10152566;backdrop-filter:blur(calc(5px * var(--ui-scale,1)))}
.connections-dialog header{display:flex;justify-content:space-between;align-items:center;gap:calc(16px * var(--ui-scale,1))}.connections-dialog header .icon-btn{width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));flex:0 0 calc(44px * var(--ui-scale,1));color:var(--fg2)}
.connection-eyebrow{font-size:calc(11px * var(--ui-scale,1));letter-spacing:.15em;color:var(--accent-h);font-weight:700}.connections-dialog h2{font-size:calc(26px * var(--ui-scale,1));letter-spacing:calc(-.7px * var(--ui-scale,1));line-height:1.25;margin:calc(4px * var(--ui-scale,1)) 0 0}.connections-dialog p{font-size:calc(14px * var(--ui-scale,1));line-height:1.6;color:var(--fg2);margin:calc(14px * var(--ui-scale,1)) 0}.connections-dialog h3{font-size:calc(12px * var(--ui-scale,1));text-transform:uppercase;letter-spacing:.07em;color:var(--fg2);margin:calc(24px * var(--ui-scale,1)) 0 calc(6px * var(--ui-scale,1))}.connections-dialog footer{font-size:calc(12px * var(--ui-scale,1));line-height:1.65;color:var(--fg2);border-top:calc(1px * var(--ui-scale,1)) solid var(--border);padding-top:calc(16px * var(--ui-scale,1));margin-top:calc(20px * var(--ui-scale,1))}
.connection-row{display:flex;align-items:center;gap:calc(14px * var(--ui-scale,1));min-height:calc(74px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) 0;border-bottom:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--border) 65%,transparent)}.connection-row:last-child{border-bottom:0}.connection-icon{display:grid;place-items:center;width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));border-radius:calc(13px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 9%,var(--bg));color:var(--accent-h);flex-shrink:0}.connection-copy{flex:1;min-width:0}.connection-copy strong{display:block;font-size:calc(15px * var(--ui-scale,1));font-weight:600}.connection-copy small{display:block;font-size:calc(12px * var(--ui-scale,1));color:var(--fg2);overflow-wrap:anywhere;margin-top:calc(3px * var(--ui-scale,1))}
.connection-add{display:grid;place-items:center;flex:0 0 calc(44px * var(--ui-scale,1));width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));background:var(--bg2);color:var(--accent-h);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(13px * var(--ui-scale,1));font-size:calc(24px * var(--ui-scale,1));cursor:pointer}.connection-add:hover{background:color-mix(in srgb,var(--accent) 15%,var(--bg));transform:translateY(calc(-1px * var(--ui-scale,1)))}.connections-dialog button:focus-visible,.connections-dialog input:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}.connections-dialog button{cursor:pointer}.connections-dialog button:disabled{opacity:.5;cursor:wait}
#connectionsStatus{font-size:calc(14px * var(--ui-scale,1));line-height:1.5;color:var(--accent-h);overflow-wrap:anywhere}#connectionsStatus:empty{display:none}#connectionsStatus.error{color:#b4232c}body.dark #connectionsStatus.error{color:#ff9b9b}
#connectionDetails[hidden],#connectionsCatalog[hidden]{display:none!important}#connectionDetails h3{font-size:calc(20px * var(--ui-scale,1));text-transform:none;letter-spacing:0;color:var(--fg)}.connection-back{border:0;background:none;color:var(--accent-h);min-height:calc(44px * var(--ui-scale,1));padding:0;font:inherit;font-size:calc(14px * var(--ui-scale,1))}.connection-primary,.connection-secondary{width:100%;min-height:calc(46px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1));margin:calc(10px * var(--ui-scale,1)) 0;border-radius:calc(12px * var(--ui-scale,1));font-size:calc(15px * var(--ui-scale,1));font-weight:600}.connection-primary{background:var(--accent);color:var(--bg);border:calc(1px * var(--ui-scale,1)) solid var(--accent)}.connection-secondary{background:var(--bg2);color:var(--fg);border:calc(1px * var(--ui-scale,1)) solid var(--border)}#connectionDetails form{display:flex;flex-direction:column;gap:calc(8px * var(--ui-scale,1))}#connectionDetails label{font-size:calc(14px * var(--ui-scale,1));font-weight:600}#connectionToken{box-sizing:border-box;width:100%;min-height:calc(46px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);font-size:calc(16px * var(--ui-scale,1))}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) .connections-dialog[open]{animation:connection-enter .22s ease-out both}@keyframes connection-enter{from{opacity:0;transform:translateY(calc(8px * var(--ui-scale,1))) scale(.985)}to{opacity:1;transform:none}}}
@media(max-width:600px){.connections-dialog{padding:calc(20px * var(--ui-scale,1));border-radius:calc(20px * var(--ui-scale,1))}.connections-dialog h2{font-size:calc(24px * var(--ui-scale,1))}.connection-row{gap:calc(12px * var(--ui-scale,1))}.connection-copy small{font-size:calc(12px * var(--ui-scale,1))}.connections-dialog h3{margin-top:calc(20px * var(--ui-scale,1))}}
.wake-sample{padding:calc(18px * var(--ui-scale,1));border-radius:calc(14px * var(--ui-scale,1));background:var(--bg2);border:calc(1px * var(--ui-scale,1)) solid var(--border);font-size:calc(20px * var(--ui-scale,1));line-height:1.5;overflow-wrap:anywhere;min-height:calc(68px * var(--ui-scale,1));box-sizing:border-box}#wakeCalibrate{align-self:flex-start;font-size:calc(14px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1))}#wakeCalibrationStatus{color:var(--fg2);font-size:calc(14px * var(--ui-scale,1));line-height:1.6}

/* 0.26.1: public activity cards, ordered by actual events; no invented reasoning. */
#scrollToEnd,:where(html[data-layout="mobile"]) #scrollToEnd{left:50%;right:auto;transform:translateX(-50%);width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1))}
#scrollToEnd:hover{transform:translateX(-50%);background:var(--bg3)}
.progress-body{width:min(100%,calc(640px * var(--ui-scale,1)));max-width:calc(640px * var(--ui-scale,1));white-space:normal;padding:calc(8px * var(--ui-scale,1)) 0 calc(12px * var(--ui-scale,1))}
.progress-note{font-size:calc(14px * var(--ui-scale,1));line-height:1.5;margin:0 0 calc(12px * var(--ui-scale,1))!important}
.activity-timeline{list-style:none;padding:0;margin:0;display:grid;gap:calc(8px * var(--ui-scale,1))}
.activity-card.work-entry{display:flex;align-items:flex-start;gap:calc(12px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1));margin:0;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);min-width:0;animation:activity-arrive .22s ease-out}
.activity-icon{display:grid;place-items:center;width:calc(32px * var(--ui-scale,1));height:calc(32px * var(--ui-scale,1));flex:0 0 calc(32px * var(--ui-scale,1));border-radius:calc(9px * var(--ui-scale,1));background:var(--accent-bg);color:var(--accent)}
.activity-icon svg{display:block}.activity-copy{min-width:0;flex:1}.activity-heading{display:flex;align-items:center;flex-wrap:wrap;gap:calc(4px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));justify-content:space-between;min-height:calc(32px * var(--ui-scale,1))}.activity-heading strong{font-size:calc(14px * var(--ui-scale,1));line-height:1.45;font-weight:600}.activity-status{font-size:calc(14px * var(--ui-scale,1));line-height:1.5;color:var(--fg2);flex-shrink:0}.activity-detail,.activity-card .code-check{font-size:calc(14px * var(--ui-scale,1));line-height:1.55;color:var(--fg2);margin:calc(6px * var(--ui-scale,1)) 0 0!important;overflow-wrap:anywhere}.activity-card .code-check pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:calc(180px * var(--ui-scale,1));overflow:auto;margin:calc(8px * var(--ui-scale,1)) 0 0;font-size:calc(13px * var(--ui-scale,1))}.activity-plan{padding-left:calc(20px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0 0;color:var(--fg2);font-size:calc(14px * var(--ui-scale,1));line-height:1.6}.activity-plan li+li{margin-top:calc(6px * var(--ui-scale,1))}.activity-card[data-state="running"]{border-color:var(--accent);border-color:color-mix(in srgb,var(--accent) 40%,var(--border))}.activity-card[data-state="running"] .activity-status{color:var(--accent)}.activity-card[data-state="failed"] .activity-status{color:#c83c43}body.dark .activity-card[data-state="failed"] .activity-status{color:#ff999e}
#wakeCalibrationMeter{display:block;width:100%;height:calc(10px * var(--ui-scale,1));margin:calc(12px * var(--ui-scale,1)) 0;accent-color:var(--accent)}
@keyframes activity-arrive{from{opacity:.45;transform:translateY(calc(4px * var(--ui-scale,1)))}to{opacity:1;transform:none}}
@media(max-width:480px){.activity-card.work-entry{padding:calc(12px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));gap:calc(8px * var(--ui-scale,1))}.activity-icon{width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));flex-basis:calc(28px * var(--ui-scale,1))}.activity-status{font-size:calc(12px * var(--ui-scale,1))}.progress-body{max-width:100%}}
@media(prefers-reduced-motion:reduce){.activity-card.work-entry{animation:none}}
html[data-motion="reduced"] .activity-card.work-entry{animation:none}

.activity-card.activity-existing{animation:none}

/* Destructive conversational actions stay proposals until this explicit confirmation. */
#reminderCancelConfirm{display:none}
.reminder-cancel .reminder-box> :not(#reminderClose):not(#reminderTitle):not(#reminderHint):not(#reminderTextLabel):not(#reminderStatus):not(#reminderCancelConfirm){display:none!important}
.reminder-cancel #reminderCancelConfirm{display:block;min-height:calc(44px * var(--ui-scale,1));background:var(--bg2,#f5f3f3);color:#c43243;border:calc(1px * var(--ui-scale,1)) solid #c4324350}
.reminder-cancel #reminderText{resize:none}

body.dark .reminder-cancel #reminderCancelConfirm{color:#ff9ba5;border-color:#ff9ba560}
/* Voice mode: one composer, round controls, layered reactive orb (no logo). */
#voiceModeStage[hidden]{display:none!important}
#voiceModeStage{--voice-level:0;position:fixed;inset:0;z-index:80;display:flex;flex-direction:column;background:var(--bg);color:var(--fg);height:100vh;height:100dvh;overflow:hidden}
.voice-mode-head{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:calc(20px * var(--ui-scale,1)) calc(28px * var(--ui-scale,1));padding-top:max(calc(20px * var(--ui-scale,1)),env(safe-area-inset-top));gap:calc(16px * var(--ui-scale,1))}
.voice-mode-head>div{display:flex;align-items:center;gap:calc(16px * var(--ui-scale,1))}.voice-mode-head strong{font-size:calc(18px * var(--ui-scale,1))}.voice-mode-head span{font-size:calc(14px * var(--ui-scale,1));color:var(--fg2)}
#voiceModeClose{width:calc(44px * var(--ui-scale,1));height:calc(44px * var(--ui-scale,1));display:grid;place-items:center;padding:0;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:50%;background:var(--bg2);color:var(--fg);flex-shrink:0}
#voiceModeClose svg{width:calc(22px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1));display:block;pointer-events:none}
.voice-mode-center{flex:1;min-height:0;overflow:auto;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:calc(36px * var(--ui-scale,1)) calc(24px * var(--ui-scale,1));gap:calc(20px * var(--ui-scale,1));text-align:center}
.voice-mode-orb{width:clamp(calc(110px * var(--ui-scale,1)),25vh,calc(224px * var(--ui-scale,1)));height:clamp(calc(110px * var(--ui-scale,1)),25vh,calc(224px * var(--ui-scale,1)));flex-shrink:0;border-radius:50%;position:relative;isolation:isolate;margin:calc(20px * var(--ui-scale,1));transform:scale(calc(1 + var(--voice-level)*.075));transition:transform .12s ease-out}
.voice-orb-surface{position:absolute;inset:0;border-radius:inherit;overflow:hidden;background:radial-gradient(ellipse at 28% 20%,#c4f1f4 0%,#97a4f1 32%,#8b68d7 68%,#444d9c 100%);box-shadow:inset 0 0 calc(30px * var(--ui-scale,1)) #fff5,0 calc(12px * var(--ui-scale,1)) calc(48px * var(--ui-scale,1)) #7872cf30}
.voice-orb-surface::before,.voice-orb-surface::after{content:"";position:absolute;inset:-20%;border-radius:44%;background:radial-gradient(ellipse at 30% 30%,#b6f4ff90,transparent 58%);animation:voice-orb-flow 9s linear infinite}
.voice-orb-surface::after{background:radial-gradient(ellipse at 70% 65%,#5a3fc190,transparent 56%);animation-direction:reverse;animation-duration:13s}
.voice-orb-wave{position:absolute;inset:-8%;border:calc(1px * var(--ui-scale,1)) solid #8d83e950;border-radius:50%;opacity:0;pointer-events:none}
#voiceModeStage:is([data-state=listening],[data-state=speaking]) .voice-orb-wave{animation:voice-orb-wave 2.8s ease-out infinite}
#voiceModeStage .voice-orb-wave:nth-of-type(2){animation-delay:.9s}#voiceModeStage .voice-orb-wave:nth-of-type(3){animation-delay:1.8s}
#voiceModeStage[data-state=speaking] .voice-orb-surface{animation:voice-orb-talk 1.1s ease-in-out infinite alternate}
#voiceModeStage[data-state=thinking] .voice-orb-surface::before{animation-duration:3s}
#voiceModeStage[data-state=paused] .voice-orb-surface{filter:saturate(.6)}
#voiceModeStatus{font-size:clamp(calc(20px * var(--ui-scale,1)),3vw,calc(28px * var(--ui-scale,1)));font-weight:600;line-height:1.3;margin:0;max-width:calc(720px * var(--ui-scale,1))}
#voiceModeCaption,#voiceModeHeard{font-size:calc(16px * var(--ui-scale,1));line-height:1.55;max-width:calc(680px * var(--ui-scale,1));max-height:18vh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:var(--fg2)}
#voiceModeHeard{color:var(--fg);font-size:calc(17px * var(--ui-scale,1))}#voiceModeCaption:empty,#voiceModeHeard:empty{display:none}
#voiceModePause{min-height:calc(44px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(24px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));background:var(--bg2);color:var(--fg)}
#voiceModeStage #inputArea{flex-shrink:0;width:100%;margin:0;border-top:calc(1px * var(--ui-scale,1)) solid var(--border);padding:calc(12px * var(--ui-scale,1)) max(calc(16px * var(--ui-scale,1)),env(safe-area-inset-right)) max(calc(12px * var(--ui-scale,1)),env(safe-area-inset-bottom));background:var(--bg);max-height:48dvh;overflow:auto;min-height:0}
#voiceModeStage #inputInner{max-width:calc(900px * var(--ui-scale,1));width:100%;margin:auto}.voice-mode #micBtn,.voice-mode #voiceMeter{display:none!important}
.input-box>#voiceModeBtn{width:calc(40px * var(--ui-scale,1));height:calc(40px * var(--ui-scale,1));min-width:calc(40px * var(--ui-scale,1));padding:0;border:0;border-radius:calc(12px * var(--ui-scale,1));display:grid;place-items:center;align-self:flex-end;background:transparent;position:relative;line-height:1}
.voice-mode-dot{width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));border-radius:50%;display:grid;place-items:center;position:relative;background:radial-gradient(circle at 28% 20%,#b7eef2,#9289ef 48%,#9c6ed4 80%);box-shadow:inset 0 0 0 calc(1px * var(--ui-scale,1)) #ffffff60,0 calc(2px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1)) #6859c526;pointer-events:none}
.voice-mode-exit{display:none;width:100%;height:100%;place-items:center;color:#fff}.voice-mode-exit svg{display:block;width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));flex:none}
.voice-mode #voiceModeBtn .voice-mode-exit{display:grid}

#voiceModeStage button:focus-visible,#voiceModeBtn:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
/* The menu is portaled outside scrolling/inert composer ancestors before measuring. */
#composerMenu{position:fixed;bottom:auto;z-index:90;max-width:calc(100vw - calc(16px * var(--ui-scale,1)));overflow:auto;overscroll-behavior:contain;transform:none!important}
@keyframes composer-reveal{from{opacity:0;clip-path:inset(calc(12px * var(--ui-scale,1)) 0 0 round calc(16px * var(--ui-scale,1)))}to{opacity:1;clip-path:inset(0 round calc(16px * var(--ui-scale,1)))}}
html:not([data-motion=reduced]) #composerMenu:not([hidden]){animation:composer-reveal .2s ease-out both!important}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) #composerMenu:not([hidden]){animation:none!important}}
html[data-motion=reduced] #composerMenu:not([hidden]){animation:none!important}
#voiceModeStage #attachmentPreview{max-height:16dvh;overflow:auto}#voiceModeStage #replyPreview{max-height:12dvh;overflow:auto}
@keyframes voice-orb-flow{to{transform:rotate(360deg)}}
@keyframes voice-orb-wave{0%{transform:scale(.94);opacity:0}18%{opacity:.45}100%{transform:scale(1.3);opacity:0}}
@keyframes voice-orb-talk{from{transform:scale(.985) rotate(-2deg)}to{transform:scale(1.025) rotate(2deg)}}
@media(max-width:600px){.voice-mode-head{padding:calc(12px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1))}.voice-mode-head>div{align-items:flex-start;flex-direction:column;gap:calc(4px * var(--ui-scale,1))}.voice-mode-head span{font-size:calc(12px * var(--ui-scale,1))}.voice-mode-center{padding:calc(24px * var(--ui-scale,1)) calc(20px * var(--ui-scale,1));gap:calc(16px * var(--ui-scale,1))}#voiceModeStatus{font-size:calc(22px * var(--ui-scale,1))}#voiceModeStage #inputArea{padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) max(calc(8px * var(--ui-scale,1)),env(safe-area-inset-bottom))}}
@media(max-height:500px){.voice-mode-head{padding:calc(8px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1))}.voice-mode-center{flex-direction:row;flex-wrap:wrap;align-content:center;gap:calc(8px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) calc(16px * var(--ui-scale,1))}.voice-mode-orb{width:calc(66px * var(--ui-scale,1));height:calc(66px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1))}#voiceModeStatus{font-size:calc(18px * var(--ui-scale,1));max-width:50%}#voiceModeCaption,#voiceModeHeard{max-height:calc(44px * var(--ui-scale,1));font-size:calc(14px * var(--ui-scale,1));flex-basis:100%}#voiceModeStage #inputArea{max-height:52dvh}.voice-mode-head span{display:none}}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) .voice-mode-orb,html:not([data-motion=full]) .voice-mode-orb *{animation:none!important;transition:none!important;transform:none!important}}
html[data-motion=reduced] .voice-mode-orb,html[data-motion=reduced] .voice-mode-orb *{animation:none!important;transition:none!important;transform:none!important}

/* Optional background-wake companion: local download beside voice activation. */
.wake-focus-setup{display:flex;flex-direction:column;gap:calc(12px * var(--ui-scale,1));padding:calc(16px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(14px * var(--ui-scale,1));background:var(--bg2);min-width:0}
.wake-focus-setup strong{font-size:calc(14px * var(--ui-scale,1));line-height:1.5}
.wake-focus-download{display:inline-flex;align-items:center;justify-content:center;min-height:calc(44px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));box-sizing:border-box;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));color:var(--accent);background:var(--bg);font-size:calc(14px * var(--ui-scale,1));line-height:1.5;text-decoration:none;text-align:center;overflow-wrap:anywhere}
.wake-focus-download:hover{border-color:var(--accent)}
.wake-focus-download:focus-visible,.wake-focus-setup summary:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
.wake-focus-setup summary{cursor:pointer;min-height:calc(36px * var(--ui-scale,1));line-height:1.5;font-size:calc(14px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(28px * var(--ui-scale,1)) calc(6px * var(--ui-scale,1)) 0;box-sizing:border-box}
.wake-focus-setup ol{padding-left:calc(22px * var(--ui-scale,1));margin:calc(8px * var(--ui-scale,1)) 0 0;color:var(--fg2);font-size:calc(14px * var(--ui-scale,1));line-height:1.6;overflow-wrap:anywhere}
.wake-focus-setup li+li{margin-top:calc(8px * var(--ui-scale,1))}
.wake-focus-setup code{font-size:calc(12px * var(--ui-scale,1));letter-spacing:0;overflow-wrap:anywhere;white-space:normal}

/* Orb interaction and breathing: decorative state animation, not a fabricated audio meter. */
#voiceModeOrb{--orb-a:#c4f6f4;--orb-b:#9585ee;--orb-c:#5840a9;display:block;appearance:none;border:0;padding:0;background:none;cursor:pointer;overflow:visible;touch-action:manipulation;box-shadow:none;line-height:1;transform-origin:center;animation:orb-breathe 3s ease-in-out infinite!important}
#voiceModeOrb .voice-orb-surface{pointer-events:none;background:radial-gradient(ellipse at 26% 18%,var(--orb-a),var(--orb-b) 43%,var(--orb-c) 78%,#292653 100%);box-shadow:inset calc(6px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) #ffffff65,inset calc(-12px * var(--ui-scale,1)) calc(-16px * var(--ui-scale,1)) calc(30px * var(--ui-scale,1)) #24214a65,0 calc(18px * var(--ui-scale,1)) calc(38px * var(--ui-scale,1)) #6154b83d;transition:filter .3s,box-shadow .3s}
#voiceModeOrb .voice-orb-surface::before{background:conic-gradient(from 40deg,transparent 0 12%,#c9ffff99 24%,transparent 40% 58%,#b977fa99 75%,transparent 90%);inset:-35%;border-radius:43%;animation:voice-orb-flow 5s linear infinite}
#voiceModeOrb .voice-orb-surface::after{background:radial-gradient(ellipse at 32% 23%,#ffffffaa,transparent 35%),radial-gradient(ellipse at 75% 75%,#bf7eed77,transparent 55%);inset:-10%;animation:orb-drift 4s ease-in-out infinite alternate}
.voice-orb-halo{position:absolute;inset:-24%;border-radius:50%;background:radial-gradient(circle,#8c76de35,transparent 68%);filter:blur(calc(9px * var(--ui-scale,1)));pointer-events:none;z-index:-1;animation:orb-halo 3s ease-in-out infinite}
#voiceModeStage:is([data-state=listening],[data-state=speaking]) #voiceModeOrb .voice-orb-wave{inset:-6%;border:calc(2px * var(--ui-scale,1)) solid #9c8aee;animation:orb-ripple 2.2s ease-out infinite;opacity:0;pointer-events:none}
#voiceModeOrb .voice-orb-wave:nth-of-type(2){animation-delay:.72s!important}#voiceModeOrb .voice-orb-wave:nth-of-type(3){animation-delay:1.44s!important}
#voiceModeStage[data-state=speaking] #voiceModeOrb{animation:orb-speak .85s ease-in-out infinite alternate!important}
#voiceModeStage[data-state=speaking] #voiceModeOrb .voice-orb-surface{animation:none}
#voiceModeStage[data-state=paused] #voiceModeOrb{--orb-a:#ffd6cd;--orb-b:#ed7385;--orb-c:#a52855;animation:orb-breathe 4s ease-in-out infinite!important}
#voiceModeStage[data-state=paused] #voiceModeOrb .voice-orb-surface{filter:none;box-shadow:inset calc(6px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) #ffffff65,inset calc(-12px * var(--ui-scale,1)) calc(-16px * var(--ui-scale,1)) calc(30px * var(--ui-scale,1)) #65193365,0 calc(18px * var(--ui-scale,1)) calc(38px * var(--ui-scale,1)) #b54d6a35}
#voiceModeStage[data-state=paused] #voiceModeOrb .voice-orb-surface::before{background:conic-gradient(transparent,#ffd1b499,transparent,#ff718a99,transparent)}
#voiceModeStage[data-state=paused] #voiceModeOrb .voice-orb-halo{background:radial-gradient(circle,#e76c8335,transparent 68%)}
@media(hover:hover){#voiceModeOrb:hover .voice-orb-surface{filter:brightness(1.13);box-shadow:inset calc(6px * var(--ui-scale,1)) calc(9px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1)) #ffffff88,inset calc(-12px * var(--ui-scale,1)) calc(-16px * var(--ui-scale,1)) calc(30px * var(--ui-scale,1)) #24214a55,0 0 calc(36px * var(--ui-scale,1)) #ac9bf280}#voiceModeOrb:hover .voice-orb-surface::after{animation:orb-shimmer 1.3s ease-in-out infinite alternate}}
#voiceModeHint{font-size:calc(13px * var(--ui-scale,1));line-height:1.5;color:var(--fg2);margin:0;max-width:100%}
@keyframes orb-breathe{0%,100%{transform:scale(calc(.97 + var(--voice-level)*.09))}50%{transform:scale(calc(1.035 + var(--voice-level)*.09))}}
@keyframes orb-speak{0%{transform:scale(.97) rotate(-1.5deg)}100%{transform:scale(1.075) rotate(1.5deg)}}
@keyframes orb-ripple{0%{transform:scale(.93);opacity:.05}18%{opacity:.6}100%{transform:scale(1.42);opacity:0}}
@keyframes orb-drift{from{transform:translate(-3%,-3%) rotate(-10deg)}to{transform:translate(4%,4%) rotate(14deg)}}
@keyframes orb-halo{50%{opacity:.6;transform:scale(1.12)}}@keyframes orb-shimmer{from{opacity:.65;transform:translate(-2%,-2%)}to{opacity:1;transform:translate(3%,3%)}}
#clearComposerMode,#clearUploadSkill,.attachment-chip>button:not(.attachment-preview-open){padding:0;line-height:1;display:inline-grid;place-items:center;align-self:center;flex-shrink:0}
#clearUploadSkill svg,#clearComposerMode svg,.attachment-chip>button:not(.attachment-preview-open) svg{display:block;flex:none;pointer-events:none}
html[data-motion=reduced] #voiceModeOrb,html[data-motion=reduced] #voiceModeOrb *,html[data-motion=reduced] #voiceModeOrb *::before,html[data-motion=reduced] #voiceModeOrb *::after{animation:none!important;transition:none!important;transform:none!important}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) #voiceModeOrb,html:not([data-motion=full]) #voiceModeOrb *,html:not([data-motion=full]) #voiceModeOrb *::before,html:not([data-motion=full]) #voiceModeOrb *::after{animation:none!important;transition:none!important;transform:none!important}}
.connections-dialog header{align-items:center}.connections-dialog h2{margin:0;font-size:calc(24px * var(--ui-scale,1))}#connectionsClose{display:grid;place-items:center;flex:0 0 calc(36px * var(--ui-scale,1));width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));padding:0;line-height:1}#connectionsClose svg{display:block;pointer-events:none}
#connectionsStatus:empty,#settingsConnectionsStatus:empty{display:none}.connections-dialog footer{padding-top:calc(12px * var(--ui-scale,1));margin-top:calc(12px * var(--ui-scale,1));font-size:calc(12px * var(--ui-scale,1))}.connections-dialog .connection-row{min-height:calc(66px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1)) 0}.connection-add{line-height:1;padding:0}.connection-eyebrow{display:none}
#settingsConnectionsCatalog .connection-row{min-height:calc(64px * var(--ui-scale,1))}#settingsConnectionsHint{font-size:calc(14px * var(--ui-scale,1));line-height:1.5;color:var(--fg2)}
html[data-motion=reduced] #voiceModeStage button#voiceModeOrb,html[data-motion=reduced] #voiceModeStage #voiceModeOrb :is(.voice-orb-surface,.voice-orb-wave,.voice-orb-halo),html[data-motion=reduced] #voiceModeStage #voiceModeOrb .voice-orb-surface::before,html[data-motion=reduced] #voiceModeStage #voiceModeOrb .voice-orb-surface::after{animation:none!important;transition:none!important;transform:none!important}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) #voiceModeStage button#voiceModeOrb,html:not([data-motion=full]) #voiceModeStage #voiceModeOrb :is(.voice-orb-surface,.voice-orb-wave,.voice-orb-halo),html:not([data-motion=full]) #voiceModeStage #voiceModeOrb .voice-orb-surface::before,html:not([data-motion=full]) #voiceModeStage #voiceModeOrb .voice-orb-surface::after{animation:none!important;transition:none!important;transform:none!important}}

.voice-choice{display:flex;flex-direction:column;gap:calc(10px * var(--ui-scale,1));margin-top:calc(14px * var(--ui-scale,1));min-width:0}.voice-choice label{font-size:calc(13px * var(--ui-scale,1));font-weight:600}.voice-choice select{width:100%;min-width:0;text-overflow:ellipsis}.voice-choice p{font-size:calc(12px * var(--ui-scale,1));line-height:1.5;color:var(--fg2);margin:0}.voice-preview{padding:calc(10px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);align-self:flex-start}

#replyPreview>button{padding:0;display:grid;place-items:center;flex:0 0 calc(28px * var(--ui-scale,1));width:calc(28px * var(--ui-scale,1));height:calc(28px * var(--ui-scale,1));line-height:1;align-self:center}#replyPreview>button svg{display:block;pointer-events:none}#attachmentPreview .attachment-chip>button:last-child:not(.attachment-preview-open){display:grid;place-items:center;width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));line-height:1}
/* Keep the click target still; animate its visible surface instead of moving the hitbox. */
#voiceModeStage button#voiceModeOrb{animation:none!important;transform:none;transition:none}
#voiceModeStage #voiceModeOrb>.voice-orb-surface{animation:orb-breathe 3s ease-in-out infinite!important}
#voiceModeStage[data-state=speaking] #voiceModeOrb>.voice-orb-surface{animation:orb-speak .85s ease-in-out infinite alternate!important}
#voiceModeStage[data-state=paused] #voiceModeOrb>.voice-orb-surface{animation:orb-breathe 4s ease-in-out infinite!important}
html[data-motion=reduced] #voiceModeStage button#voiceModeOrb>.voice-orb-surface{animation:none!important;transform:none!important}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) #voiceModeStage button#voiceModeOrb>.voice-orb-surface{animation:none!important;transform:none!important}}
#voiceModeStage[data-state] button#voiceModeOrb{animation:none!important;transform:none!important;transition:none!important}

/* Stable click geometry; animate paint layers, not hit targets. */
html[lang^=ru] .file-dragging::after{content:'Перетащите файлы сюда'}
body.voice-mode #voiceModeStage #inputArea .modes, #voiceModeHint{display:none!important}
#topbar .tb-actions :is(button,.tb-btn,.icon-btn){min-width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1))}
#topbar .tb-actions :is(button,.tb-btn,.icon-btn) svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));min-width:calc(20px * var(--ui-scale,1))}

.input-box>:is(#attachBtn,#micBtn,#sendBtn,#voiceModeBtn){box-sizing:border-box;width:calc(38px * var(--ui-scale,1));height:calc(38px * var(--ui-scale,1));min-width:calc(38px * var(--ui-scale,1));flex:0 0 calc(38px * var(--ui-scale,1));display:grid;place-items:center;padding:0;line-height:1}

.input-box>:is(#attachBtn,#micBtn,#sendBtn,#voiceModeBtn) svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));display:block;flex:none;margin:0;transform:none}

#composerMenu button>i{display:grid;place-items:center;width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));flex:0 0 calc(24px * var(--ui-scale,1));line-height:1;overflow:visible}
#composerMenu button>i svg{display:block;width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));margin:0;transform:none}
.connection-add{display:grid!important;place-items:center!important;padding:0!important;line-height:1!important;flex-shrink:0}
.connection-add svg{display:block;width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1));margin:0;transform:none}
#serviceWarning>svg{flex:0 0 calc(18px * var(--ui-scale,1));display:block;width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));overflow:visible;align-self:center}
.file-visual{position:relative;box-sizing:border-box;flex-shrink:0;overflow:hidden}
.file-visual>svg{display:block;width:calc(24px * var(--ui-scale,1))!important;height:calc(28px * var(--ui-scale,1))!important;max-width:100%;max-height:100%;flex:none;margin:auto;stroke-width:1.6}
.upload-ring{display:grid;place-items:center;flex:0 0 calc(24px * var(--ui-scale,1));width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));padding:calc(2px * var(--ui-scale,1));box-sizing:border-box}
.upload-ring svg{display:block;width:calc(20px * var(--ui-scale,1))!important;height:calc(20px * var(--ui-scale,1))!important;overflow:visible}
.extensions-dialog{box-sizing:border-box;width:min(calc(780px * var(--ui-scale,1)),calc(100vw - calc(32px * var(--ui-scale,1))));max-height:calc(100dvh - calc(32px * var(--ui-scale,1)));margin:auto;padding:calc(24px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(22px * var(--ui-scale,1));background:var(--bg);color:var(--fg);overflow:auto;box-shadow:0 calc(24px * var(--ui-scale,1)) calc(70px * var(--ui-scale,1)) #0003}
.extensions-dialog::backdrop{background:#17182766;backdrop-filter:blur(calc(6px * var(--ui-scale,1)))}
.extensions-dialog header,.extensions-settings-head{display:flex;align-items:center;gap:calc(12px * var(--ui-scale,1));flex-wrap:wrap}
.extensions-dialog header h2{margin:0 auto 0 0;font-size:calc(24px * var(--ui-scale,1))}
.extensions-dialog button,.extensions-settings-head button{font:inherit;color:var(--fg);background:var(--bg2);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));cursor:pointer}
.extensions-dialog button:focus-visible{outline:calc(2px * var(--ui-scale,1)) solid var(--accent);outline-offset:calc(3px * var(--ui-scale,1))}
.extensions-dialog #extensionsClose{display:grid;place-items:center;padding:0;flex:0 0 calc(36px * var(--ui-scale,1));width:calc(36px * var(--ui-scale,1));height:calc(36px * var(--ui-scale,1))}
.extensions-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:calc(20px * var(--ui-scale,1))}
.extensions-layout:has(#skillBuilder:not([hidden])){grid-template-columns:minmax(calc(200px * var(--ui-scale,1)),1fr) minmax(calc(250px * var(--ui-scale,1)),1fr)}
.extension-card{display:grid;grid-template-columns:minmax(0,1fr) calc(40px * var(--ui-scale,1));align-items:center;gap:calc(10px * var(--ui-scale,1));padding:calc(14px * var(--ui-scale,1)) 0;border-bottom:calc(1px * var(--ui-scale,1)) solid var(--border)}
.extension-card .extension-description{display:flex;align-items:center;gap:calc(12px * var(--ui-scale,1));text-align:left;border:0;background:transparent;padding:0;min-width:0;box-shadow:none;color:var(--fg)}
.extension-icon{display:grid;place-items:center;width:calc(42px * var(--ui-scale,1));height:calc(42px * var(--ui-scale,1));flex:0 0 calc(42px * var(--ui-scale,1));border-radius:calc(13px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 9%,var(--bg));color:var(--accent)}
.extension-toggle{display:grid!important;place-items:center;width:calc(40px * var(--ui-scale,1));height:calc(40px * var(--ui-scale,1));padding:0!important;color:var(--accent)!important}
.extension-toggle[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 12%,var(--bg))}
.extension-detail{grid-column:1/-1;color:var(--fg2);font-size:calc(13px * var(--ui-scale,1));line-height:1.6;padding:0 calc(4px * var(--ui-scale,1)) 0 calc(54px * var(--ui-scale,1))}
.extension-detail[hidden],#skillBuilder[hidden]{display:none!important}
#skillBuilder{min-width:0;border-left:calc(1px * var(--ui-scale,1)) solid var(--border);padding-left:calc(18px * var(--ui-scale,1))}
#skillBuilder h3{margin-top:0}#skillBuilder form{display:grid;gap:calc(12px * var(--ui-scale,1))}#skillBuilder label{display:grid;gap:calc(6px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1))}
#skillBuilder :is(input,textarea){box-sizing:border-box;width:100%;min-width:0;padding:calc(10px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);font:inherit}#skillBuilder textarea{min-height:calc(80px * var(--ui-scale,1));resize:vertical}
.skill-builder-log{max-height:35dvh;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap;font-size:calc(13px * var(--ui-scale,1));line-height:1.6}.builder-user{background:color-mix(in srgb,var(--accent) 10%,var(--bg));padding:calc(10px * var(--ui-scale,1));border-radius:calc(12px * var(--ui-scale,1))}.builder-assistant{padding:calc(8px * var(--ui-scale,1)) 0}
#extensionsStatus{font-size:calc(13px * var(--ui-scale,1));color:var(--fg2)}.extensions-settings-head h3{margin-right:auto}
#usageHint button{border:0;background:transparent;color:var(--accent);text-align:left;font:inherit;line-height:1.6;cursor:pointer}
@keyframes surface-reveal{from{opacity:0;clip-path:inset(calc(4px * var(--ui-scale,1)) 0 0 round calc(18px * var(--ui-scale,1)))}to{opacity:1;clip-path:inset(0 round calc(18px * var(--ui-scale,1)))}}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) :is(dialog[open],.overlay.open .modal-box,.overlay.open .confirm-box,.composer-menu:not([hidden])){animation:surface-reveal .24s cubic-bezier(.2,.7,.2,1)}html:not([data-motion=reduced]) :is(.extension-detail:not([hidden]),#skillBuilder:not([hidden])){animation:surface-reveal .2s ease-out}}
html[data-motion=reduced] :is(dialog,.extensions-dialog,.extension-detail,#skillBuilder,.composer-menu){animation:none!important;transition:none!important}
@media(max-width:600px){.extensions-dialog{padding:calc(18px * var(--ui-scale,1));width:calc(100vw - calc(24px * var(--ui-scale,1)));max-height:calc(100dvh - calc(24px * var(--ui-scale,1)))}.extensions-dialog header{gap:calc(8px * var(--ui-scale,1))}.extensions-dialog header h2{font-size:calc(22px * var(--ui-scale,1))}.extensions-dialog #extensionCreate{font-size:calc(12px * var(--ui-scale,1))}.extensions-layout:has(#skillBuilder:not([hidden])){grid-template-columns:1fr}#skillBuilder{border-left:0;border-top:calc(1px * var(--ui-scale,1)) solid var(--border);padding:calc(16px * var(--ui-scale,1)) 0 0}.extension-detail{padding-left:0}}

.file-visual .upload-ring{width:100%;height:100%;padding:calc(4px * var(--ui-scale,1))}.message-file-card .file-visual>small{position:absolute;bottom:calc(2px * var(--ui-scale,1));right:calc(2px * var(--ui-scale,1));max-width:calc(32px * var(--ui-scale,1));font-size:calc(7px * var(--ui-scale,1));line-height:1.1;background:var(--bg2);border-radius:calc(3px * var(--ui-scale,1));padding:calc(1px * var(--ui-scale,1))}.attachment-preview-open .file-visual>small{font-size:calc(8px * var(--ui-scale,1))}

/* 0.29.2 composer/editor hotfix: stable control centres, no moving hit targets. */
.input-box{align-items:center}
.input-box>button{align-self:center;margin-block:0;padding:0;line-height:1}
.input-box>button>svg{display:block;flex-shrink:0;margin:auto}
.composer-editor{padding-block:0;align-items:center;min-height:calc(40px * var(--ui-scale,1))}
.composer-editor #userInput{box-sizing:border-box;min-height:calc(40px * var(--ui-scale,1));line-height:calc(22px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1));margin:0;vertical-align:middle}
#addConnections i{display:grid;place-items:center;background:none!important;mask:none!important;width:calc(22px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1))}
#addConnections i:before,#addConnections i:after{content:none!important}
#addConnections i svg{display:block;width:calc(22px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1))}
#voiceGenderHint{display:none}
.extensions-dialog.skill-editor{inset:calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) auto;margin:0;width:min(calc(480px * var(--ui-scale,1)),calc(100vw - calc(24px * var(--ui-scale,1))));height:calc(100dvh - calc(24px * var(--ui-scale,1)));max-height:calc(100dvh - calc(24px * var(--ui-scale,1)));border-radius:calc(20px * var(--ui-scale,1));overflow:auto}
.extensions-dialog.skill-editor #extensionsList,.extensions-dialog.skill-editor #extensionCreate{display:none}
.extensions-dialog.skill-editor .extensions-layout{display:block}
.extensions-dialog.skill-editor #skillBuilder{display:flex;flex-direction:column;border:0;padding:0;min-width:0}
.skill-metadata label{display:block;margin-bottom:calc(12px * var(--ui-scale,1))}
.skill-metadata input,.skill-metadata textarea{display:block;box-sizing:border-box;width:100%;margin-top:calc(6px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg3);color:var(--fg)}
.skill-metadata textarea{min-height:calc(72px * var(--ui-scale,1));resize:vertical}
.skill-builder-log{min-height:calc(100px * var(--ui-scale,1));max-height:36dvh;overflow:auto;overscroll-behavior:contain}
button.speaking,button[aria-busy=true],button[data-busy=true]{box-shadow:0 0 0 calc(3px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 20%,transparent)}
@keyframes control-breathe{50%{box-shadow:0 0 0 calc(5px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 9%,transparent);opacity:.78}}
@keyframes surface-soft-open{from{opacity:0;clip-path:inset(calc(8px * var(--ui-scale,1)) 0 0 round calc(16px * var(--ui-scale,1)))}to{opacity:1;clip-path:inset(0 round calc(16px * var(--ui-scale,1)))}}
@media(prefers-reduced-motion:no-preference){
 html:not([data-motion=reduced]) :is(button.speaking,button[aria-busy=true],button[data-busy=true]){animation:control-breathe 1.3s ease-in-out infinite}
 html:not([data-motion=reduced]) :is(dialog[open],.modal.open .modal-box,.overlay.open .modal-box,.extension-detail:not([hidden]),#skillBuilder:not([hidden]),#workspacePreview:not([hidden])){animation:surface-soft-open .28s ease-out both}
}
html[data-motion=full] :is(button.speaking,button[aria-busy=true]){animation:control-breathe 1.3s ease-in-out infinite}
html[data-motion=reduced] :is(dialog[open],#skillBuilder,button.speaking,button[aria-busy=true]){animation:none!important}
.input-box>:is(#attachBtn,#micBtn,#sendBtn,#voiceModeBtn){align-self:center}

/* Comfort hotfix: compact consistent surfaces and touch-safe alignment. */
.field-save-row:has(#nickInput){position:relative;display:block}
#nickInput{padding-right:calc(48px * var(--ui-scale,1))}
#nickSave{position:absolute;inset:50% calc(8px * var(--ui-scale,1)) auto auto;transform:translateY(-50%)!important;margin:0;width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));min-width:calc(30px * var(--ui-scale,1));min-height:calc(30px * var(--ui-scale,1));border-radius:calc(9px * var(--ui-scale,1));display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 12%,var(--bg));color:var(--accent)}
#nickSave[hidden]{display:none!important}
#reminderTitle:focus,#reminderTitle:focus-visible{outline:none!important;box-shadow:none!important;border:0!important}
#reminderStatus[data-error=true]{display:flex;gap:calc(8px * var(--ui-scale,1));align-items:center;color:var(--danger)}
#reminderStatus[data-error=true]::before{content:'!';display:grid;place-items:center;flex:0 0 calc(17px * var(--ui-scale,1));width:calc(17px * var(--ui-scale,1));height:calc(17px * var(--ui-scale,1));border:calc(1.5px * var(--ui-scale,1)) solid currentColor;border-radius:50%;font:600 calc(12px * var(--ui-scale,1))/1 Arial,sans-serif}
.extension-card{grid-template-columns:minmax(0,1fr) calc(34px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) 0}
.extension-toggle,.connection-add{width:calc(34px * var(--ui-scale,1))!important;height:calc(34px * var(--ui-scale,1))!important;min-width:calc(34px * var(--ui-scale,1))!important;min-height:calc(34px * var(--ui-scale,1))!important;border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 18%,var(--border))!important;border-radius:calc(11px * var(--ui-scale,1))!important;background:color-mix(in srgb,var(--accent) 7%,var(--bg))!important;color:var(--accent)!important;box-shadow:0 calc(2px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1)) #00000005}
.extension-toggle svg,.connection-add svg{width:calc(18px * var(--ui-scale,1))!important;height:calc(18px * var(--ui-scale,1))!important}
.extension-toggle:hover:not(:disabled),.connection-add:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 15%,var(--bg))!important;box-shadow:0 calc(3px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1)) color-mix(in srgb,var(--accent) 10%,transparent)}
.extension-toggle:disabled,.quick-skill-row button:disabled{opacity:.35;cursor:not-allowed}
#settings-panel-interface .colour-palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:calc(3px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1)) 0}
#settings-panel-interface .colour-choice{min-height:calc(44px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(1px * var(--ui-scale,1));font-size:calc(10px * var(--ui-scale,1));gap:calc(6px * var(--ui-scale,1))}
#settings-panel-interface .colour-choice i{width:calc(22px * var(--ui-scale,1));height:calc(22px * var(--ui-scale,1));border-width:calc(2px * var(--ui-scale,1))}
#settings-panel-interface .colour-choice span{font-size:calc(9px * var(--ui-scale,1));max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#siteControlScreen{background:radial-gradient(ellipse at 50% 25%,color-mix(in srgb,var(--accent) 9%,var(--bg)),var(--bg) 65%);gap:calc(20px * var(--ui-scale,1));padding:calc(24px * var(--ui-scale,1))}
#siteControlScreen>span{width:calc(86px * var(--ui-scale,1));height:calc(86px * var(--ui-scale,1));display:grid;place-items:center;border-radius:calc(27px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 10%,var(--bg));border:calc(1px * var(--ui-scale,1)) solid var(--border)}
#siteControlScreen svg{width:calc(40px * var(--ui-scale,1));height:calc(40px * var(--ui-scale,1));color:var(--accent)}
#siteControlScreen h1{font-size:clamp(calc(20px * var(--ui-scale,1)),3vw,calc(28px * var(--ui-scale,1)));line-height:1.45;max-width:calc(560px * var(--ui-scale,1));font-weight:650;text-wrap:balance}
#siteControlScreen button{border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2);font:inherit;padding:calc(12px * var(--ui-scale,1)) calc(18px * var(--ui-scale,1))}
.auth-notice{border-radius:calc(16px * var(--ui-scale,1));padding:calc(18px * var(--ui-scale,1));line-height:1.65;background:color-mix(in srgb,var(--accent) 5%,var(--bg));border-color:color-mix(in srgb,var(--accent) 20%,var(--border))}
#composer-skills .skills-submenu-arrow{display:grid;place-items:center;margin-left:auto;width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));border-radius:calc(8px * var(--ui-scale,1));flex:0 0 calc(30px * var(--ui-scale,1));cursor:pointer}
.skills-submenu-arrow svg{display:block;width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1))}
.skills-submenu-arrow:hover{background:var(--hover)}
.quick-skills{position:fixed;z-index:20000;max-height:calc(100dvh - calc(24px * var(--ui-scale,1)));overflow:auto;padding:calc(8px * var(--ui-scale,1));background:var(--bg);color:var(--fg);border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(16px * var(--ui-scale,1));box-shadow:0 calc(14px * var(--ui-scale,1)) calc(40px * var(--ui-scale,1)) #0002}
.quick-skills[hidden]{display:none}
.quick-skill-row{display:flex;align-items:center;gap:calc(10px * var(--ui-scale,1));padding:calc(8px * var(--ui-scale,1))}
.quick-skill-row i{display:grid;place-items:center;color:var(--accent)}
.quick-skill-row i svg{width:calc(20px * var(--ui-scale,1));height:calc(20px * var(--ui-scale,1))}
.quick-skill-row>span{flex:1;font-size:calc(13px * var(--ui-scale,1))}
.quick-skill-row button{display:grid;place-items:center;width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));padding:0;border:calc(1px * var(--ui-scale,1)) solid var(--border);border-radius:calc(9px * var(--ui-scale,1));background:var(--bg2);color:var(--accent)}
.quick-skill-row button svg{width:calc(17px * var(--ui-scale,1));height:calc(17px * var(--ui-scale,1))}
.selected-skill-chip{max-width:100%;margin:0!important}
.selected-skill-chip button{opacity:1;width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));min-width:calc(24px * var(--ui-scale,1));min-height:calc(24px * var(--ui-scale,1))}
.selected-skill-chip svg{display:block;width:calc(16px * var(--ui-scale,1));height:calc(16px * var(--ui-scale,1))}
#voiceModeOrb{--orb-a:color-mix(in srgb,var(--accent) 18%,#ddf9fc);--orb-b:color-mix(in srgb,var(--accent) 64%,#c7abef);--orb-c:color-mix(in srgb,var(--accent) 60%,#303155)}
#voiceModeOrb .voice-orb-surface{transition:filter .65s ease,box-shadow .75s ease;background:radial-gradient(ellipse at 28% 22%,#ffffffa0,transparent 36%),radial-gradient(ellipse at 75% 80%,#00000025,transparent 55%),linear-gradient(135deg,var(--orb-a),var(--orb-b) 50%,var(--orb-c))}
#voiceModeOrb .voice-orb-surface::before,#voiceModeOrb .voice-orb-surface::after{transition:opacity .65s ease,filter .75s ease}
#voiceModeOrb .voice-orb-wave{border-color:color-mix(in srgb,var(--accent) 60%,#d0c7fa)!important}
#voiceModeOrb .voice-orb-halo{background:radial-gradient(circle,color-mix(in srgb,var(--accent) 22%,transparent),transparent 68%)}
@media(max-width:480px){.input-area{padding-inline:calc(12px * var(--ui-scale,1))}.modal-box{max-width:calc(100vw - calc(24px * var(--ui-scale,1)))}.msg-content{max-width:100%}.quick-skill-row{min-height:calc(40px * var(--ui-scale,1))}.extensions-dialog{padding:calc(18px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) .quick-skills:not([hidden]){animation:surface-soft-open .22s ease-out both}}

:root{--ui-scale:1}
@media(max-width:600px){html[data-ui-size=small] :is(input,textarea,select){font-size:16px}}

#nickSave{background:transparent;border:0}
.rename-input,.rename-input:focus,.rename-input:focus-visible{box-sizing:border-box;border:1px solid color-mix(in srgb,var(--accent) 58%,var(--border));outline:0!important;box-shadow:none!important;border-radius:8px;background:var(--bg2)}
#noteTitle,#noteTitle:focus,#noteTitle:focus-visible{border:0!important;outline:0!important;box-shadow:none!important;border-radius:0;background:transparent;padding-inline:0}
.progress-panel{border:1px solid color-mix(in srgb,var(--accent) 18%,var(--border));border-radius:11px;background:color-mix(in srgb,var(--accent) 3%,var(--bg2));padding:2px 10px}
.progress-toggle{min-height:34px;padding:5px 2px;font-size:12px;color:var(--fg2)}
.progress-body{font-size:12px;line-height:1.5}
.support-icon{background:color-mix(in srgb,var(--accent) 12%,var(--bg2));color:var(--accent)}.support-icon svg{stroke:currentColor}
#confirmModal .confirm-box{text-align:center}#confirmModal .confirm-actions{justify-content:center;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,360px);margin:16px auto 0}#confirmModal .confirm-actions button{width:100%;min-width:0}

#authError[data-kind=restricted]{padding:calc(18px * var(--ui-scale,1));border:1px solid var(--border);border-radius:calc(16px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 6%,var(--bg));color:var(--fg)!important;line-height:1.6}
#authError[data-kind=restricted]::before{content:'!';display:grid;place-items:center;margin:0 auto 10px;width:30px;height:30px;border:1.5px solid var(--accent);border-radius:50%;color:var(--accent);font-weight:650}

/* Shared, aligned composer blocks and an independently focusable skill submenu. */
:is(#composerMode,#selectedSkillChip).skill-chip{display:inline-flex;box-sizing:border-box;flex:0 1 auto;align-items:center;justify-content:flex-start;flex-wrap:nowrap;gap:calc(7px * var(--ui-scale,1));min-height:calc(36px * var(--ui-scale,1));max-width:100%;width:auto;margin:0;padding:calc(4px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border:calc(1px * var(--ui-scale,1)) solid color-mix(in srgb,var(--accent) 28%,var(--border));border-radius:calc(9px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 10%,var(--bg2));color:var(--accent);font-size:calc(12px * var(--ui-scale,1));line-height:1.4;box-shadow:inset 0 1px 0 #ffffff12}
:is(#composerMode,#selectedSkillChip).skill-chip>i{display:grid;place-items:center;flex:0 0 calc(18px * var(--ui-scale,1));width:calc(18px * var(--ui-scale,1));height:calc(18px * var(--ui-scale,1));line-height:1}
:is(#composerMode,#selectedSkillChip).skill-chip>i svg{display:block;width:100%;height:100%}
:is(#composerMode,#selectedSkillChip).skill-chip>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:calc(20px * var(--ui-scale,1))}
:is(#composerMode,#selectedSkillChip).skill-chip>button{display:grid;place-items:center;position:static;align-self:center;flex:0 0 calc(26px * var(--ui-scale,1));box-sizing:border-box;width:calc(26px * var(--ui-scale,1));height:calc(26px * var(--ui-scale,1));min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:calc(6px * var(--ui-scale,1));background:transparent;color:inherit;line-height:1;opacity:1}
:is(#composerMode,#selectedSkillChip).skill-chip>button svg{display:block;width:calc(15px * var(--ui-scale,1));height:calc(15px * var(--ui-scale,1));pointer-events:none}
.composer-skills-row{display:flex;align-items:stretch;width:100%;border-radius:calc(10px * var(--ui-scale,1));min-height:calc(44px * var(--ui-scale,1))}
.composer-skills-row:hover,.composer-skills-row:focus-within{background:var(--hover)}
.composer-skills-row>#composer-skills{display:flex;align-items:center;gap:calc(12px * var(--ui-scale,1));flex:1;min-width:0;padding:calc(10px * var(--ui-scale,1));text-align:left;border-radius:calc(10px * var(--ui-scale,1));font-size:calc(13px * var(--ui-scale,1));line-height:1.4}
.composer-skills-row>.skills-submenu-arrow{display:grid;place-items:center;flex:0 0 calc(40px * var(--ui-scale,1));width:calc(40px * var(--ui-scale,1));min-width:0;margin:0;padding:0;border:0;border-radius:calc(9px * var(--ui-scale,1));color:var(--fg2);background:transparent;cursor:pointer;pointer-events:auto}
.skills-submenu-arrow svg{pointer-events:none;transition:transform .2s ease}
.skills-submenu-arrow[aria-expanded=true] svg{transform:translateX(2px);color:var(--accent)}
.quick-skills{box-sizing:border-box;max-width:calc(100vw - 24px);transform-origin:top left;animation:none}
.quick-skills[data-side=left]{transform-origin:top right}.quick-skills[data-side=above]{transform-origin:bottom left}
.quick-skills-status{margin:0;padding:12px;font-size:13px;color:var(--fg2)}
.quick-skill-row{border-radius:calc(10px * var(--ui-scale,1));transition:background-color .2s ease}.quick-skill-row:hover{background:var(--hover)}
.quick-skill-row>span{min-width:0;overflow-wrap:anywhere}.quick-skill-row>button{flex-shrink:0}
@keyframes skill-menu-enter{from{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes skill-menu-exit{from{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(4px) scale(.98)}}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) .quick-skills:not([hidden]){animation:skill-menu-enter .24s cubic-bezier(.2,.8,.2,1) both}html:not([data-motion=reduced]) .quick-skills.is-closing:not([hidden]){animation:skill-menu-exit .16s ease-in both}}
html[data-motion=reduced] .quick-skills{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){.quick-skills,.skills-submenu-arrow svg{animation:none!important;transition:none!important}}
@media(pointer:coarse){:is(#composerMode,#selectedSkillChip).skill-chip{min-height:calc(40px * var(--ui-scale,1))}:is(#composerMode,#selectedSkillChip).skill-chip>button{flex-basis:calc(30px * var(--ui-scale,1));width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1))}}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) #selectedSkillChip{animation:skill-appear .24s ease-out both}}
html[data-motion=reduced] #selectedSkillChip{animation:none!important}

/* Consistent, layout-stable motion; avoid animating geometry or streamed text. */
:root{--ui-ease:cubic-bezier(.2,.75,.25,1);--ui-fast:180ms;--ui-control:280ms;--ui-surface:320ms}
@keyframes ui-surface-in{from{opacity:0;clip-path:inset(6px 0 0 round 14px)}to{opacity:1;clip-path:none}}
@keyframes ui-item-in{from{opacity:0}to{opacity:1}}
@keyframes ui-work-breathe{0%,100%{opacity:1}50%{opacity:.65}}
@media all{
 html:not([data-motion=reduced]) :is(button,a,[role=button],[role=tab],summary){transition:background-color var(--ui-control) var(--ui-ease),color var(--ui-control) var(--ui-ease),border-color var(--ui-control) var(--ui-ease),box-shadow var(--ui-surface) var(--ui-ease),opacity var(--ui-fast) ease}
 html:not([data-motion=reduced]) :is(input:not([type=checkbox]):not([type=radio]),textarea,select){transition:background-color var(--ui-control) var(--ui-ease),color var(--ui-control) var(--ui-ease),border-color var(--ui-fast) ease,box-shadow var(--ui-control) var(--ui-ease)}
 html:not([data-motion=reduced]) :is(.extension-card,.connection-row,.quick-skill-row,.note-card,.attachment-chip,.message-file-card,.plan-card,.support-card,.site-proposal,.activity-card){transition:background-color var(--ui-control) var(--ui-ease),border-color var(--ui-control) var(--ui-ease),box-shadow var(--ui-surface) var(--ui-ease),opacity var(--ui-control) ease}
 html:not([data-motion=reduced]) :is(.extension-card,.connection-row,.quick-skill-row):hover{background-color:color-mix(in srgb,var(--accent) 5%,var(--bg))}
 html:not([data-motion=reduced]) :is(dialog[open],.overlay.open .modal-box,.overlay.open .confirm-box,.modal.open .modal-box,.notification-popover.open,#workspacePreview:not([hidden])){animation:ui-surface-in var(--ui-surface) var(--ui-ease) both}
 html:not([data-motion=reduced]) #composerMenu:not([hidden]){animation:ui-surface-in 260ms var(--ui-ease) both!important}
 html:not([data-motion=reduced]) :is(.settings-section:not([hidden]),.extension-detail:not([hidden]),#skillBuilder:not([hidden]),.progress-body:not([hidden]),.pinned-list:not([hidden])){animation:ui-item-in 260ms var(--ui-ease) both}
 html:not([data-motion=reduced]) :is(#extensionsList,#settings-panel-skills,#settings-panel-plugins,#quickSkills) .extension-card,html:not([data-motion=reduced]) #quickSkills .quick-skill-row{animation:ui-item-in 240ms ease both}
 html:not([data-motion=reduced]) #quickSkills .quick-skill-row:nth-child(2){animation-delay:25ms}
 html:not([data-motion=reduced]) #quickSkills .quick-skill-row:nth-child(3){animation-delay:45ms}
 html:not([data-motion=reduced]) #quickSkills .quick-skill-row:nth-child(4){animation-delay:65ms}
 html:not([data-motion=reduced]) #quickSkills .quick-skill-row:nth-child(n+5){animation-delay:85ms}
 html:not([data-motion=reduced]) :is(button[aria-busy=true],button.busy){cursor:progress;animation:ui-work-breathe 1.4s ease-in-out infinite}
 html:not([data-motion=reduced]) :is(.skill-chip>i,.palette-option,.color-swatch,.chat-act,.msg-actions button){transition:background-color var(--ui-control) var(--ui-ease),color var(--ui-control) var(--ui-ease),box-shadow var(--ui-surface) var(--ui-ease),opacity var(--ui-control) ease}
 html:not([data-motion=reduced]) input.display-switch[type=checkbox]::before{transition:transform 320ms var(--ui-ease),background-color var(--ui-control) ease}
}
/* A low-power device keeps feedback but skips repeated activity effects. */
html[data-render-budget=compact] :is(button[aria-busy=true],button.busy){animation:none!important}
html[data-motion=reduced] :is(#composerMenu,.quick-skills,dialog,.extension-card,.quick-skill-row,.settings-section,button[aria-busy=true]){animation:none!important;transition:none!important}

/* Compact action summaries: all steps and results stay readable. */
.activity-card.work-entry{padding:calc(9px * var(--ui-scale,1));gap:calc(8px * var(--ui-scale,1))}
.activity-card .activity-heading{min-height:calc(22px * var(--ui-scale,1))}
.activity-card .activity-heading strong,.activity-card .activity-status{font-size:calc(12px * var(--ui-scale,1))}
.activity-card .activity-detail{font-size:calc(13px * var(--ui-scale,1));line-height:1.45;margin-top:calc(4px * var(--ui-scale,1))}
input:not([type=checkbox]):not([type=radio]),textarea,[contenteditable=true]{caret-color:var(--fg);cursor:text}
html[data-motion=full][data-motion-explicit=true] :is(.overlay.open .modal-box,.confirm-modal.open .confirm-box,dialog[open]){animation:ui-surface-in var(--ui-surface) var(--ui-ease) both!important}
html[data-motion=full][data-motion-explicit=true] :is(button,a,input,textarea,select){transition:background-color var(--ui-control) var(--ui-ease),color var(--ui-control) var(--ui-ease),border-color var(--ui-control) var(--ui-ease),box-shadow var(--ui-surface) var(--ui-ease),opacity var(--ui-fast) ease!important}
.activity-card .activity-detail,.activity-card .code-check{font-size:calc(13px * var(--ui-scale,1));line-height:1.45;margin-top:calc(4px * var(--ui-scale,1))!important}
.activity-card .activity-icon{width:calc(26px * var(--ui-scale,1));height:calc(26px * var(--ui-scale,1));flex-basis:calc(26px * var(--ui-scale,1))}
.activity-card .activity-plan{font-size:calc(13px * var(--ui-scale,1));line-height:1.45;margin-top:calc(5px * var(--ui-scale,1))}
.activity-card .activity-plan li+li{margin-top:calc(4px * var(--ui-scale,1))}

.message-extension-badges{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;margin-bottom:7px;max-width:100%}.message-extension-badge{display:inline-flex;align-items:center;max-width:100%;overflow-wrap:anywhere;padding:5px 9px;border:1px solid var(--border);border-radius:9px;background:var(--accent-bg);color:var(--fg2);font-size:12px;line-height:1.3}.message-extension-badge[data-kind=skills]{color:var(--accent)}

.message-extension-badge i{display:inline-flex;align-items:center;flex:none}.message-extension-badge svg{width:14px;height:14px}.message-extension-badge{display:inline-flex;align-items:center;gap:6px}

/* Motion polish: shared geometry and tactile feedback, without layout shifts. */
:root{--control-radius:calc(11px * var(--ui-scale,1));--control-hit:calc(32px * var(--ui-scale,1));--surface-shadow:0 12px 36px #00000012}
:is(.extension-toggle,.connection-add,.quick-skill-row button){box-sizing:border-box;display:grid;place-items:center;flex-shrink:0;width:var(--control-hit);height:var(--control-hit);min-width:var(--control-hit);padding:0;line-height:1;border-radius:var(--control-radius);border:1px solid var(--border);background:var(--bg2);color:var(--accent);vertical-align:middle}
:is(.extension-toggle,.connection-add,.quick-skill-row button) svg{display:block;width:18px;height:18px;flex-shrink:0;margin:0;pointer-events:none}
:is(.extension-card,.connection-row,.quick-skill-row){box-sizing:border-box;align-items:center;gap:calc(12px * var(--ui-scale,1))}
:is(.extension-card,.connection-row,.quick-skill-row)>:is(i,.extension-icon,.connection-icon){display:grid;place-items:center;flex-shrink:0;line-height:1}
:is(.extension-card,.connection-row,.quick-skill-row) :is(strong,.extension-title){min-width:0;overflow-wrap:anywhere}
:is(.selected-plugin-chip,.skill-chip){align-items:center;box-sizing:border-box;line-height:1.35}
:is(.selected-plugin-chip,.skill-chip)>button{display:grid;place-items:center;padding:0;align-self:center;line-height:1;flex-shrink:0}
:is(.selected-plugin-chip,.skill-chip)>button svg{display:block;width:16px;height:16px;margin:0}
:is(#attachBtn,#micBtn,#voiceModeBtn,#sendBtn){box-sizing:border-box;align-self:center;line-height:1;flex-shrink:0}
:is(#attachBtn,#micBtn,#voiceModeBtn,#sendBtn)>svg{display:block;margin:auto;flex-shrink:0}
:is(.extension-toggle,.connection-add,.quick-skill-row button,.skill-chip>button,.selected-plugin-chip>button):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(hover:hover){:is(.extension-toggle,.connection-add,.quick-skill-row button):hover{background:color-mix(in srgb,var(--accent) 12%,var(--bg2));border-color:color-mix(in srgb,var(--accent) 45%,var(--border));box-shadow:0 3px 10px color-mix(in srgb,var(--accent) 12%,transparent)}}
@media(prefers-reduced-motion:no-preference){
 html:not([data-motion=reduced]) :is(.extension-toggle,.connection-add,.quick-skill-row button,.skill-chip>button,.selected-plugin-chip>button){transition:background-color 240ms var(--ui-ease),border-color 240ms var(--ui-ease),box-shadow 280ms var(--ui-ease),transform 180ms var(--ui-ease)}
 html:not([data-motion=reduced]) :is(.extension-toggle,.connection-add,.quick-skill-row button,.skill-chip>button,.selected-plugin-chip>button):active{transform:scale(.94)}
 html:not([data-motion=reduced]) :is(.selected-plugin-chip,.message-extension-badge){animation:ui-item-in 260ms var(--ui-ease) both}
 html:not([data-motion=reduced]) :is(dialog[open],.modal-box,.confirm-box){box-shadow:var(--surface-shadow)}
}
@media(pointer:coarse){:is(.extension-toggle,.connection-add,.quick-skill-row button){width:calc(38px * var(--ui-scale,1));height:calc(38px * var(--ui-scale,1));min-width:calc(38px * var(--ui-scale,1))}}
/* Plugin chips use the same complete block geometry as selected skills. */
#inputArea .selected-plugin-chip{display:inline-flex;flex:0 1 auto;align-items:center;justify-content:flex-start;flex-wrap:nowrap;gap:calc(7px * var(--ui-scale,1));min-height:calc(36px * var(--ui-scale,1));max-width:100%;width:auto;margin:0;padding:calc(4px * var(--ui-scale,1)) calc(5px * var(--ui-scale,1)) calc(4px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border:1px solid color-mix(in srgb,var(--accent) 28%,var(--border));border-radius:calc(9px * var(--ui-scale,1));background:color-mix(in srgb,var(--accent) 10%,var(--bg2));color:var(--accent);font-size:calc(12px * var(--ui-scale,1));box-shadow:inset 0 1px 0 #ffffff12}
#inputArea .selected-plugin-chip>i{display:grid;place-items:center;flex-shrink:0;width:18px;height:18px;font-style:normal}
#inputArea .selected-plugin-chip>i svg{display:block;width:18px;height:18px}
#inputArea .selected-plugin-chip>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#inputArea .selected-plugin-chip>button{position:static;flex:0 0 calc(26px * var(--ui-scale,1));width:calc(26px * var(--ui-scale,1));height:calc(26px * var(--ui-scale,1));min-width:0;min-height:0;margin:0;border:0;border-radius:calc(6px * var(--ui-scale,1));background:transparent;color:inherit}
html[data-motion=reduced] :is(.extension-toggle,.connection-add,.quick-skill-row button,.selected-plugin-chip,.message-extension-badge){animation:none!important;transition:none!important;transform:none!important}
@media(prefers-reduced-motion:reduce){html:not([data-motion=full]) :is(.extension-toggle,.connection-add,.quick-skill-row button,.selected-plugin-chip,.message-extension-badge){animation:none!important;transition:none!important;transform:none!important}}
@media(pointer:coarse){#inputArea .selected-plugin-chip{min-height:calc(40px * var(--ui-scale,1))}#inputArea .selected-plugin-chip>button{flex-basis:calc(30px * var(--ui-scale,1));width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1))}}

/* Smart PC / time-limited product grants. Native host presence is checked in JS. */
.smart-pc-top{display:inline-flex;align-items:center;gap:6px;width:auto;padding:8px 10px;white-space:nowrap;font-size:12px}.smart-pc-top[hidden]{display:none!important}.smart-pc-top svg{width:28px;height:24px;flex:none}.product-dialog{color:var(--fg,#171724);background:var(--bg2,#fff);border:1px solid var(--border,#dddde7);border-radius:22px;padding:24px;width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;box-shadow:0 24px 80px #0003}.product-dialog::backdrop{background:#11162d66;backdrop-filter:blur(5px)}.product-dialog[open]{animation:skill-menu-enter .25s ease-out}.product-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px}.product-dialog h2{margin:0 0 16px}.product-dialog p{line-height:1.5}.product-dialog .settings-action{width:100%;margin-top:10px}.product-dialog input,.product-dialog select{width:100%;padding:10px 12px;border:1px solid var(--border,#dddde7);border-radius:12px;background:var(--bg,#fff);color:inherit;margin:6px 0 14px}.product-dialog .settings-field{display:block}.product-dialog [hidden]{display:none!important}

@media(max-width:600px){.smart-pc-top span{display:none}.smart-pc-top{padding:6px}}

/* Settings polish: fixed top-layer geometry, shared theme and restrained motion. */
.product-dialog{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:24px;isolation:isolate;overscroll-behavior:contain;scrollbar-width:thin}
.product-dialog header{margin-bottom:20px}.product-dialog header h2{margin:0;font-size:22px;line-height:1.25;letter-spacing:-.025em}.product-dialog header .icon-btn{flex:0 0 32px;width:32px;height:32px;border-radius:10px}
#productGrantDialog form{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px}#productGrantDialog .settings-field,#grantResult{grid-column:1/-1;margin:0}#productGrantDialog .settings-field{font-size:13px;font-weight:500;line-height:1.5;color:var(--fg2)}#productGrantDialog input,#productGrantDialog select{box-sizing:border-box;min-height:42px;margin:6px 0 4px;font:inherit;color:var(--fg);background:var(--bg);outline-offset:3px}#productGrantDialog .settings-action{margin:0;min-height:40px;border-radius:12px;font-size:13px}#grantResult{min-height:22px;font-size:13px;color:var(--fg2);overflow-wrap:anywhere}#productGrantDialog .primary{background:var(--accent);border-color:var(--accent);color:#fff}#productGrantDialog .danger{color:var(--danger,#e34a57);background:transparent}
#settings-panel-tools>.settings-field{margin-top:14px}#personalApiProvider,#personalApiModel{min-height:42px}#personalApiStatus,#personalApiModelOwner{font-size:12px;line-height:1.5;overflow-wrap:anywhere}#personalApiSave,#personalApiRemove,#personalApiLoadModels{border-radius:12px;min-height:40px}#personalApiSave{background:var(--accent);color:#fff;border-color:var(--accent)}
.product-dialog input:focus-visible,.product-dialog select:focus-visible,.product-dialog button:focus-visible,#settings-panel-tools .inp:focus-visible{outline:2px solid var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 13%,transparent)}
@media(prefers-reduced-motion:no-preference){.product-dialog::backdrop{animation:product-backdrop-in 240ms ease-out}.product-dialog input,.product-dialog select{transition:border-color 180ms var(--ui-ease),box-shadow 220ms var(--ui-ease),background-color 220ms var(--ui-ease)}.product-dialog .settings-action:hover:not(:disabled){box-shadow:0 4px 14px #00000012}.product-dialog .settings-action:active:not(:disabled){transform:scale(.98)}@keyframes product-backdrop-in{from{opacity:0}to{opacity:1}}}
@media(max-width:480px){.product-dialog{padding:20px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:20px}#productGrantDialog form{gap:10px}.product-dialog header{margin-bottom:16px}}
/* Keep primary-action text readable in both palettes. */
#productGrantDialog .primary,#personalApiSave{background:var(--accent-h);border-color:var(--accent-h)}
body.dark .product-dialog .primary,body.dark #personalApiSave{color:var(--bg)}

/* Explicit recovery actions: bounded motion, keyboard focus and narrow screens. */
.response-recovery{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;padding:12px 14px;margin:10px 0;border:1px solid var(--border);border-radius:14px;background:var(--bg2);color:var(--fg2);font-size:13px;line-height:1.5}
.response-recovery-action{font:inherit;min-height:36px;padding:7px 14px;border:1px solid var(--border);border-radius:10px;color:var(--accent);background:transparent;cursor:pointer;transition:background-color .18s ease,transform .18s ease}
.response-recovery-action:hover:not(:disabled){background:var(--bg3);transform:none}.response-recovery-action{transition:background-color .18s ease}.response-recovery-action:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.response-recovery-action:disabled{opacity:.5;cursor:default}@media(prefers-reduced-motion:reduce){.response-recovery-action{transition:none;transform:none!important}}

/* 0.28: bounded layout, one icon, shared colour and accessible motion. */
#downloadAppTop::before{content:none!important;display:none!important}
#downloadAppTop>span{display:inline-flex;flex:0 0 auto;color:inherit}
#downloadAppTop svg{display:block;fill:none;width:19px;height:19px;color:inherit}
:where(.settings-section,.connections-dialog,.product-dialog,.message-content){line-height:1.55;text-wrap:pretty}
:where(.settings-section,dialog) :is(h2,h3){line-height:1.25;letter-spacing:-.015em;text-wrap:balance}
:where(.settings-field,.connection-copy,.message-file-label){min-width:0}
.api-key-card{padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--bg2);display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.api-key-card>h3,.api-key-card>#apiKeyStatus,.api-key-details{flex:1 1 100%;margin:0}
.api-key-details{padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;min-width:0;max-width:100%;box-sizing:border-box;background:var(--bg);border-radius:10px;font-size:12px;line-height:1.7;user-select:text}
.api-key-card button{flex:1 1 auto;min-height:40px}
#accountEmail{color:var(--fg2);cursor:text}
.renewal-price{display:flex;flex-wrap:wrap;align-items:center;gap:10px;justify-content:center}
.renewal-price del{color:var(--fg2);font-size:15px;text-decoration-thickness:2px;opacity:.7}
.renewal-price strong{color:var(--accent);font-size:28px;letter-spacing:-.03em}
.renewal-badge{font-size:12px;padding:5px 10px;border-radius:999px;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent);font-weight:600}
.response-recovery{width:fit-content;max-width:100%;box-sizing:border-box;align-items:center;padding:6px 9px;gap:7px;font-size:11.5px;margin:7px 0;border:1px solid color-mix(in srgb,var(--danger) 20%,var(--border));background:color-mix(in srgb,var(--danger) 4%,var(--bg2));border-radius:9px;line-height:1.35;min-height:0!important}
.response-recovery>span{flex:1 1 140px;min-width:0}.response-recovery-action{min-height:28px;padding:4px 9px;flex:0 0 auto;font-size:11.5px;border-radius:8px}
.attachment-list,.message-file-card,.attachment-chip,#attachmentPreview{box-sizing:border-box;min-width:0;max-width:100%}
#attachmentPreview{display:flex;flex-wrap:wrap;gap:5px;margin:0 0 5px;max-height:88px;overflow:auto;align-items:flex-start}
#attachmentPreview>.attachment-chip{flex:0 1 190px;max-width:min(190px,100%);min-height:38px;padding:5px 7px;border-radius:9px;gap:6px}
#attachmentPreview .attachment-preview-open{min-width:0;gap:5px;font-size:11px}
#attachmentPreview .attachment-preview-open>svg{width:18px;height:18px;flex:0 0 18px}
#attachmentPreview .attachment-chip>button:last-child{width:22px;height:22px;flex:0 0 22px}
.message-file-card{width:100%;overflow:hidden}.message-file-card>.attachment-chip{min-width:0;flex:1 1 0;overflow:hidden}.message-file-label{overflow:hidden}.message-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.message-file-card>:is(.attachment-open,.attachment-download){flex:0 0 32px;width:32px;min-width:32px}.attachment-preview-open{min-width:0;max-width:100%}.attachment-preview-open>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
#voiceModeStage #voiceModeOrb{--orb-a:color-mix(in srgb,var(--accent) 22%,white);--orb-b:var(--accent);--orb-c:color-mix(in srgb,var(--accent) 65%,black)}
#voiceModeStage #voiceModeOrb .voice-orb-surface::before{background:conic-gradient(transparent,color-mix(in srgb,var(--accent) 60%,white),transparent,var(--accent),transparent)}
#voiceModeStage #voiceModeOrb .voice-orb-surface::after{background:radial-gradient(ellipse at 30% 20%,#ffffff80,transparent 40%),radial-gradient(ellipse at 75% 75%,var(--accent),transparent 55%)}
#voiceModeStage #voiceModeOrb .voice-orb-halo{background:radial-gradient(circle,color-mix(in srgb,var(--accent) 25%,transparent),transparent 68%)}
#voiceModeStage #voiceModeOrb .voice-orb-wave{border-color:var(--accent)}
@media(max-width:600px){
 .message{min-width:0;max-width:100%}.message-content{min-width:0;overflow-wrap:anywhere}.attachment-list{width:100%;gap:6px}.message-file-card{border-radius:11px}.message-file-card .attachment-chip{padding:8px;gap:7px}.message-file-name{font-size:12px}.message-file-details{font-size:10px}
 #attachmentPreview{gap:6px}#attachmentPreview>.attachment-chip{max-width:100%;min-width:0}#attachmentPreview .file-excerpt{display:none}
 .response-recovery{max-width:100%;padding:7px 9px;font-size:12px}.response-recovery-action{min-height:34px}
 .smart-pc-top span{display:none}.smart-pc-top{padding:7px!important;min-width:36px!important;width:36px!important}.smart-pc-top svg{width:26px!important}
 #topbar{padding-top:max(8px,env(safe-area-inset-top));padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
 #composer{padding-bottom:max(8px,env(safe-area-inset-bottom))}#main{min-height:0;height:100dvh;max-height:100dvh}
}
@media(prefers-reduced-motion:no-preference){html:not([data-motion=reduced]) :is(.api-key-card,.response-recovery,.connection-row,.message-file-card){animation:ui-item-in 220ms var(--ui-ease) both}html:not([data-motion=reduced]) :is(.api-key-card button,.connection-row button,.settings-field input,.settings-field select){transition:background-color 180ms ease,border-color 180ms ease,box-shadow 220ms ease}html:not([data-motion=reduced]) .activity-card[data-state=running] .activity-icon{animation:ui-work-breathe 1.8s ease-in-out infinite}}
html[data-motion=reduced] :is(.api-key-card,.response-recovery,.connection-row,.message-file-card,.activity-icon){animation:none!important;transition:none!important}

/* Entitlement controls must remain hidden even when their component sets display:flex. */
#sidebarPlus[hidden],.plus-action[hidden],#upgradeBtn[hidden]{display:none!important}

.legal-links{display:flex;flex-wrap:wrap;justify-content:center;gap:3px 10px;padding:2px 6px;font-size:10.5px;line-height:1.3;flex-shrink:0}.legal-links a{color:var(--fg2);text-decoration:underline;text-underline-offset:3px}.legal-links a:hover,.legal-links a:focus-visible{color:var(--accent)}

/* 0.29.2 — consistent accent controls and calmer utility surfaces. */
#usageProgress{pointer-events:none}
#notificationsBtn.has-unread:after{background:var(--accent)}
.admin-check-dialog>button:last-child{display:block;width:100%;min-height:calc(42px * var(--ui-scale,1));margin:calc(14px * var(--ui-scale,1)) 0 0}
#guideSections a{color:var(--accent);text-decoration-color:color-mix(in srgb,var(--accent) 45%,transparent);text-underline-offset:2px}
.extensions-dialog #skillBuilder input[type=file]{display:block;width:100%;max-width:100%;margin:calc(8px * var(--ui-scale,1)) 0;padding:calc(10px * var(--ui-scale,1));border:1px dashed var(--border);border-radius:calc(10px * var(--ui-scale,1));background:var(--bg2);color:var(--fg);font:inherit;font-size:calc(12px * var(--ui-scale,1))}
.extensions-dialog #skillBuilder input[type=file]::file-selector-button{margin-right:calc(8px * var(--ui-scale,1));padding:calc(7px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border:1px solid var(--border);border-radius:calc(8px * var(--ui-scale,1));background:var(--bg3);color:var(--fg);font:inherit;cursor:pointer}
.extensions-dialog .skill-upload-status{min-height:1.4em;color:var(--fg2);font-size:calc(12px * var(--ui-scale,1));overflow-wrap:anywhere}

/* 0.29.2 — compact, consistent personal API controls. */
#settings-panel-tools{display:flex;flex-direction:column;gap:calc(12px * var(--ui-scale,1));min-width:0}
#settings-panel-tools>h3{margin:calc(8px * var(--ui-scale,1)) 0 0;font-size:calc(16px * var(--ui-scale,1));font-weight:700;letter-spacing:-.01em}
#settings-panel-tools>.settings-field{display:flex;flex-direction:column;gap:calc(7px * var(--ui-scale,1));margin:0;min-width:0}
#settings-panel-tools .inp{width:100%;min-width:0;min-height:calc(44px * var(--ui-scale,1));box-sizing:border-box;border-radius:calc(11px * var(--ui-scale,1))}
#personalApiKey{padding-right:calc(48px * var(--ui-scale,1));letter-spacing:.025em}
#personalApiLoadModels,#personalApiSave,#personalApiRemove{min-height:calc(42px * var(--ui-scale,1));border-radius:calc(11px * var(--ui-scale,1));font-weight:600}
#personalApiSave{background:var(--accent);color:var(--bg);border-color:var(--accent)}
#personalApiSave:hover{background:var(--accent-h);border-color:var(--accent-h)}
#personalApiRemove{background:color-mix(in srgb,#d44b59 9%,var(--bg2));border-color:color-mix(in srgb,#d44b59 34%,var(--border));color:var(--fg)}
#personalApiStatus,#personalApiModelOwner,#personalApiKeyHint{margin:0;line-height:1.5;overflow-wrap:anywhere}
.api-key-card{width:100%;box-sizing:border-box;padding:calc(16px * var(--ui-scale,1));border-radius:calc(16px * var(--ui-scale,1));background:var(--bg2);border-color:var(--border);gap:calc(10px * var(--ui-scale,1))}
.api-key-card>h3{margin:0;font-size:calc(16px * var(--ui-scale,1));font-weight:700;flex-basis:100%}
.api-key-details{display:grid;grid-template-columns:minmax(0,1fr);gap:calc(6px * var(--ui-scale,1));padding:calc(10px * var(--ui-scale,1));border:1px solid var(--border);border-radius:calc(11px * var(--ui-scale,1));background:var(--bg);min-width:0}
.api-key-details .credential-value{display:block;width:100%;min-width:0;box-sizing:border-box;overflow-wrap:anywhere;word-break:break-word;user-select:all;font-family:ui-monospace,Consolas,monospace;font-size:calc(12px * var(--ui-scale,1));line-height:1.55}
.api-key-details .credential-divider{height:1px;background:var(--border);margin:calc(4px * var(--ui-scale,1)) 0}
#apiKeyCreate{background:var(--accent);color:var(--bg);border-color:var(--accent);font-weight:700}
#apiKeyCreate:hover{background:var(--accent-h);border-color:var(--accent-h)}
#apiKeyEndpointCopy{background:var(--bg3);color:var(--fg);border:1px solid var(--border)}
#apiKeyEndpointCopy:hover{border-color:var(--accent);color:var(--accent)}
#apiKeyCopy{background:var(--bg3);color:var(--fg);border:1px solid var(--border)}
#apiKeyRevoke{background:color-mix(in srgb,#d44b59 9%,var(--bg2));border:1px solid color-mix(in srgb,#d44b59 34%,var(--border));color:var(--fg)}
@media(max-width:600px){.api-key-card{padding:calc(12px * var(--ui-scale,1))}.api-key-card button{flex:1 1 100%;width:100%}#personalApiSave,#personalApiRemove,#personalApiLoadModels{width:100%}}

/* Guest access: visually de-emphasize account-only controls without disabling the route to Account. */
.auth-guest-actions{display:flex;flex-direction:column;align-items:center;gap:7px;margin:18px 0 2px;padding-top:14px;border-top:1px solid var(--border)}
.auth-guest-button{border:1px solid var(--border);background:var(--surface);color:var(--fg);border-radius:11px;padding:11px 18px;width:100%;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background .18s,border-color .18s,transform .18s}
.auth-guest-button:hover{background:var(--hover);border-color:var(--accent)}
.guest-account-status{display:flex;flex-direction:column;gap:10px;padding:15px;margin:0 0 14px;border:1px solid var(--border);border-radius:14px;background:var(--surface)}
.guest-account-status p{margin:0;color:var(--fg2);font-size:12.5px;line-height:1.5}
.guest-account-status a,.guest-import-warning{color:var(--accent);font-size:13px;text-decoration:underline;cursor:pointer;width:max-content}
.guest-import-warning{display:block;margin:12px auto 0;text-align:center}
body.guest-mode #guideBtn,body.guest-mode #shareBtn,body.guest-mode #attachBtn,body.guest-mode #fileBtn,body.guest-mode #micBtn,body.guest-mode #smartBtn,body.guest-mode #searchBtn,body.guest-mode #agentBtn,body.guest-mode #voiceBtn,body.guest-mode #downloadAppBtn{opacity:.34;filter:grayscale(1);cursor:not-allowed}
body.guest-mode #chatLimitNotice{display:block}

/* Extended appearance preferences */
.accent-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;padding:8px 2px 4px}
#settingsModal .accent-grid{width:100%;max-width:none;box-sizing:border-box;grid-template-columns:repeat(5,minmax(0,1fr));justify-items:center;align-items:center;gap:10px 8px;margin:8px 0 14px;padding:8px 4px}
#settingsModal .accent-swatch{width:40px;height:40px;justify-self:center;margin:0}
#nickSave.field-save{flex:0 0 30px;width:30px;height:30px;min-width:30px;padding:0;border-radius:9px}
#nickSave svg{width:14px;height:14px;stroke-width:2.7}
#settingsModal .sound-settings>summary::after{width:18px;height:18px;flex-basis:18px;margin-left:auto}
.chat-actions{display:flex;align-items:center;flex:0 0 auto;gap:3px;opacity:0;pointer-events:none;transition:opacity .16s ease}
.chat-item:hover .chat-actions,.chat-item:focus-within .chat-actions{opacity:1;pointer-events:auto}
.chat-item.renaming .chat-actions,body.collapsed .chat-actions{display:none}
.chat-act{display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid transparent;border-radius:8px;background:var(--bg2);color:var(--fg2);cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
.chat-act:hover{background:var(--hover);border-color:var(--border);color:var(--fg)}
.chat-act.pin-icon.on{background:color-mix(in srgb,var(--accent) 10%,var(--bg2));color:var(--accent)}
.chat-act.danger:hover{background:color-mix(in srgb,var(--danger) 9%,var(--bg2));border-color:color-mix(in srgb,var(--danger) 25%,var(--border));color:var(--danger)}
.chat-act svg{display:block;width:14px;height:14px}
body.guest-mode #chatList .chat-act,body.guest-mode #pinChatBtn{opacity:1!important;filter:none!important;cursor:pointer!important}
@media(hover:none){.chat-actions{opacity:1;pointer-events:auto}}
#settingsModal .accent-grid{width:100%;max-width:none;grid-template-columns:repeat(auto-fit,minmax(54px,1fr));justify-items:center;align-items:center;gap:10px 8px}
#settingsModal .accent-swatch{width:42px;height:42px;justify-self:center;margin:0}
#settings-panel-interface .beta-setting-option{display:grid;gap:7px}
#settings-panel-interface .beta-setting-option small{display:block;padding-left:2px;color:var(--fg2);font-size:11.5px;line-height:1.45}
#settings-panel-interface .colour-palette{width:100%;grid-template-columns:repeat(auto-fit,minmax(54px,1fr));justify-items:center;align-items:center;gap:8px;padding:10px 0}
#settings-panel-interface .colour-choice{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:66px;gap:8px;padding:8px 2px;text-align:center}
#settings-panel-interface .colour-choice i{display:block;width:28px;height:28px;flex:0 0 28px;margin:0}
#settings-panel-interface .colour-choice span{width:100%;max-width:100%;text-align:center}
#settingsModal .sound-settings>summary{position:relative;padding-right:32px}
#settingsModal .sound-settings>summary::after{top:50%;right:5px;width:18px;height:18px;flex:0 0 18px;transform:translateY(-50%);transition:transform .2s ease}
#settingsModal .sound-settings[open]>summary::after{transform:translateY(-50%) rotate(180deg)}
body :not(svg):not(path):not(i):not(code):not(pre):not(.katex):not(.katex *){font-family:var(--pongy-font,inherit)!important}
.accent-swatch{width:34px;height:34px;border-radius:50%;border:3px solid var(--bg);outline:2px solid transparent;justify-self:center;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.16);transition:transform .16s,outline-color .16s}
.accent-swatch[aria-pressed=true]{outline-color:var(--fg);transform:scale(1.08)}
.accent-swatch:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.beta-feature-option{align-items:flex-start;gap:14px;padding:13px 0;border-bottom:1px solid var(--border)}
.beta-feature-copy{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.beta-feature-copy strong{font-size:13px;font-weight:650;color:var(--fg)}
.beta-feature-copy small{font-size:11.5px;line-height:1.45;color:var(--fg2)}
html[data-accent=pink] body{--accent:#c13c82;--accent-h:#a52f6d;--accent-rgb:193,60,130}
html[data-accent=orange] body{--accent:#c66b24;--accent-h:#a95519;--accent-rgb:198,107,36}
html[data-accent=teal] body{--accent:#168b88;--accent-h:#11716e;--accent-rgb:22,139,136}
html[data-accent=cyan] body{--accent:#1689a8;--accent-h:#116d88;--accent-rgb:22,137,168}
html[data-accent=pink] body.dark{--accent:#ed8cbd;--accent-h:#f4acd0;--accent-rgb:237,140,189}
html[data-accent=orange] body.dark{--accent:#f0a365;--accent-h:#f6bd8e;--accent-rgb:240,163,101}
html[data-accent=teal] body.dark{--accent:#69c9c5;--accent-h:#8bd8d4;--accent-rgb:105,201,197}
html[data-accent=cyan] body.dark{--accent:#72c6df;--accent-h:#98d8eb;--accent-rgb:114,198,223}
body,button,input,textarea,select{font-family:var(--pongy-font,inherit)}
body.guest-mode #sidebar button:not(#settingsBtn):not(#newChatBtn):not(#logoTop):not(#chatList .chat-act),body.guest-mode .tb-actions button,body.guest-mode .modes button,body.guest-mode #attachBtn,body.guest-mode #micBtn{opacity:.34;filter:grayscale(1);cursor:not-allowed}
body.guest-mode #logoTop,body.guest-mode #chatList .chat-act{opacity:1!important;filter:none!important;cursor:pointer!important}
body,button,input,textarea,select{font-family:var(--pongy-font,Inter,system-ui,-apple-system,"Segoe UI",sans-serif)}

.guest-account-status{display:grid;gap:8px;padding:12px 13px;margin:0 0 14px;border:1px solid var(--border);border-radius:12px;background:var(--bg2);font-size:13px}
.guest-account-status>strong{font-weight:650;color:var(--fg)}
.guest-account-status p{margin:0;color:var(--fg2);font-size:11.5px}
.guest-account-actions{display:flex;align-items:center;justify-content:center;gap:9px}
.guest-account-actions>*{flex:1 1 0;min-width:0}
.guest-history-link{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:6px 10px;border:1px solid var(--border);border-radius:9px;background:transparent;color:var(--accent);font:inherit;font-size:12px;cursor:pointer}
#guestHistoryFromWarning{display:flex;width:min(100%,260px);margin:10px auto 0}
body.guest-mode #settings-panel-account> :not(#guestAccountStatus):not(:has(#nickLabel)):not(:has(#accountEmail)):not(#logoutBtnSettings),
body.admin-guest-mode #settings-panel-account> :not(#guestAccountStatus):not(:has(#nickLabel)):not(:has(#accountEmail)):not(#logoutBtnSettings){display:none!important}

.sound-settings{margin:14px 0;padding:0 12px;border:1px solid var(--border);border-radius:12px;background:var(--bg2)}
.sound-settings>summary{display:flex;align-items:center;justify-content:space-between;min-height:46px;font-size:13px;font-weight:650;cursor:pointer;list-style:none}
.sound-settings>summary::-webkit-details-marker{display:none}
.sound-settings>summary::after{content:"";width:16px;height:16px;flex:0 0 16px;background:currentColor;color:var(--fg2);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;transition:transform .24s ease}
.sound-settings[open]>summary::after{transform:rotate(180deg)}
.sound-settings>.display-option{padding:8px 0;border-bottom:1px solid var(--border);font-size:13px}
.sound-settings #voicePreferenceSetting,.sound-settings .settings-field{margin:10px 0}
.sound-settings #wakeWordSetting{margin:10px 0 14px}
.appearance-select-host{position:relative;min-width:0}
.appearance-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:9px 12px;border:1px solid var(--border);border-radius:11px;background:var(--bg2);color:var(--fg);font:inherit;font-size:13px;text-align:left;cursor:pointer}
.appearance-select-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.appearance-select-trigger svg{flex:0 0 17px;color:var(--fg2);transition:transform .22s ease}
.appearance-select-trigger[aria-expanded=true] svg{transform:rotate(180deg)}
.appearance-select-menu{position:absolute;z-index:300;top:calc(100% + 6px);left:0;right:0;max-height:min(320px,45dvh);overflow:auto;padding:5px;border:1px solid var(--border);border-radius:12px;background:var(--bg);box-shadow:0 12px 34px #0002;animation:ui-item-in 160ms ease both}
.appearance-select-menu[hidden]{display:none}
.appearance-select-option{display:block;width:100%;min-height:38px;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:var(--fg);font:inherit;font-size:13px;text-align:left;cursor:pointer}
.appearance-select-option:hover,.appearance-select-option.active{background:color-mix(in srgb,var(--accent) 10%,var(--bg2));color:var(--accent)}
.appearance-select-option[aria-selected=true]::after{content:'✓';float:right;color:var(--accent)}
.admin-users{margin:14px 0;padding:0 12px;border:1px solid var(--border);border-radius:12px;background:var(--bg2)}
.admin-users>summary{display:flex;align-items:center;justify-content:space-between;min-height:46px;font-size:13px;font-weight:650;cursor:pointer}
.admin-users-wrap{max-width:100%;overflow:auto;overscroll-behavior:contain}
.admin-users-table{width:100%;min-width:780px;border-collapse:collapse;font-size:11.5px;line-height:1.45}
.admin-users-table th,.admin-users-table td{padding:9px 8px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border)}
.admin-users-table th{position:sticky;top:0;background:var(--bg2);color:var(--fg2);font-weight:650;white-space:nowrap}
.admin-users-table td{overflow-wrap:anywhere;max-width:210px}
.admin-users-actions{display:flex;justify-content:center;padding:10px 0}
.admin-users-actions button{min-height:34px;padding:6px 14px;font-size:12px}
.sound-settings{margin:14px 0;padding:0 12px;border:1px solid var(--border);border-radius:12px;background:var(--bg2)}
.sound-settings>summary{display:flex;align-items:center;justify-content:space-between;min-height:46px;font-size:13px;font-weight:650;cursor:pointer;list-style:none}
.sound-settings>summary::-webkit-details-marker{display:none}
.sound-settings>summary::after{content:'';width:16px;height:16px;flex:0 0 16px;background:currentColor;color:var(--fg2);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;transition:transform .24s ease}
.sound-settings[open]>summary::after{transform:rotate(180deg)}
.sound-settings>.display-option{padding:8px 0;border-bottom:1px solid var(--border);font-size:13px}
.sound-settings #voicePreferenceSetting,.sound-settings .settings-field{margin:10px 0}
.sound-settings #wakeWordSetting{margin:10px 0 14px}
#messages.has-more-below{-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 38px),rgba(0,0,0,.82) calc(100% - 24px),rgba(0,0,0,.38) calc(100% - 9px),transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 38px),rgba(0,0,0,.82) calc(100% - 24px),rgba(0,0,0,.38) calc(100% - 9px),transparent 100%)}
#messages{transition:mask-image .18s ease,-webkit-mask-image .18s ease}
@media(prefers-reduced-motion:reduce){#messages{transition:none}}.appearance-select-host:has(.appearance-select-trigger[aria-expanded=true]){z-index:420}
.appearance-select-menu{z-index:421}
.appearance-select-host:has(.appearance-select-trigger[aria-expanded=true]) .appearance-select-menu{pointer-events:auto}
/* Master audio control and readable compact sound settings. */
.sound-volume-row{display:grid;grid-template-columns:minmax(90px,1fr) minmax(110px,1.5fr) 42px;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border);font-size:13px;color:var(--fg)}
.sound-volume-row input[type=range]{width:100%;min-width:0;accent-color:var(--accent)}
.sound-volume-row output{font-variant-numeric:tabular-nums;text-align:right;color:var(--fg2);font-size:12px}
.sound-volume-row input:disabled{opacity:.45}
@media(max-width:420px){.sound-volume-row{grid-template-columns:minmax(78px,1fr) minmax(80px,1.2fr) 38px;gap:8px}}


/* Compact message recovery and progressive fade at the collapsed answer edge. */
.answer-body{position:relative}
.answer-body.answer-collapsed{max-height:18em;overflow:hidden;isolation:isolate}
.answer-body.answer-collapsed::after{content:"";position:absolute;z-index:1;left:0;right:0;bottom:0;height:3.25em;pointer-events:none;background:linear-gradient(to bottom,transparent 0%,color-mix(in srgb,var(--bg) 34%,transparent) 42%,var(--bg) 100%)}
.answer-body.answer-collapsed .code-card:last-child,.answer-body.answer-collapsed pre:last-child{mask-image:linear-gradient(to bottom,#000 0%,#000 35%,transparent 100%)}
.response-recovery{align-items:center;gap:8px 12px;padding:9px 11px;margin:8px 0;border-radius:11px;background:color-mix(in srgb,var(--bg2) 88%,var(--danger) 4%);border-color:color-mix(in srgb,var(--danger) 22%,var(--border));font-size:12px;line-height:1.4}
.response-recovery>span{min-width:0;flex:1 1 180px}
.response-recovery-action{flex:0 0 auto;min-height:30px;padding:5px 10px;border-radius:8px;font-size:12px}
#noteTitle{outline:0!important;box-shadow:none!important;border:0!important;background:transparent!important}
#noteTitle:focus,#noteTitle:focus-visible{outline:0!important;box-shadow:none!important;border:0!important}
.rename-input{outline:0;box-shadow:none!important;border:1px solid var(--accent)!important}
.rename-input:focus,.rename-input:focus-visible{outline:0!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 13%,transparent)!important}
.support-icon{color:var(--accent)}.support-icon svg{stroke:currentColor}
@media(prefers-reduced-motion:reduce){.answer-body.answer-collapsed::after{transition:none}}

/* Center confirmation actions in a balanced two-column layout. */
#confirmModal .confirm-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;justify-content:center;max-width:360px;margin:0 auto}
#confirmModal .confirm-btn{width:100%;min-width:0}
#nickInput:focus,#nickInput:focus-visible{outline:0!important;box-shadow:none!important;border-color:var(--accent)!important}
#nickInput{outline:0}

/* Fade only when additional message content continues below the visible chat viewport. */
#messages.has-below-content{-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 2.35em),transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 2.35em),transparent 100%)}
@media(prefers-reduced-motion:reduce){#messages.has-below-content{-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 2.35em),transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 calc(100% - 2.35em),transparent 100%)}}

/* The reasoning/progress disclosure is inline content, not a card. */
.progress-panel{border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;overflow:visible!important}

.answer-body.answer-collapsed{position:relative}
.answer-body.answer-collapsed::after{content:"";position:absolute;z-index:1;left:0;right:0;bottom:0;height:1.8em;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--bg) 92%)}

#settingsModal .sound-settings{box-sizing:border-box;width:100%;margin:16px 0 8px;padding:0 16px;border:1px solid var(--border);border-radius:14px;background:var(--bg2);overflow:visible}
#settingsModal .sound-settings>summary{min-height:54px;padding:0 34px 0 0;font-size:14px;font-weight:700;letter-spacing:-.01em}
#settingsModal .sound-settings>summary::after{right:7px;width:12px;height:12px;transform:translateY(-60%) rotate(45deg)}
#settingsModal .sound-settings[open]>summary::after{transform:translateY(-35%) rotate(225deg)}
#settingsModal .sound-settings>.display-option{min-height:48px;padding:9px 0;border-bottom:1px solid var(--border)}
#settingsModal .sound-settings .settings-field{margin:12px 0}
#settingsModal .sound-settings #voicePreferenceSetting{margin:14px 0}
#settingsModal .sound-settings #wakeWordSetting{margin:12px 0}
#settingsModal .sound-settings #wakeFocusSetup{margin:14px 0 10px;padding-top:12px;border-top:1px solid var(--border)}
#settingsModal .sound-subtitle{display:block;margin:8px 0 6px;color:var(--fg);font-size:12.5px;font-weight:700}
#settingsModal .sound-settings .voice-choice{margin-top:8px}
#settingsModal .accent-grid{grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:52px;gap:8px 12px;max-width:390px;margin:8px 0 14px}
#settingsModal .accent-swatch{width:42px;height:42px;border-radius:50%;border:3px solid var(--bg);outline:2px solid transparent;box-shadow:0 2px 8px #0002;transition:transform .2s cubic-bezier(.2,.8,.2,1),outline-color .2s}
#settingsModal .accent-swatch:hover{transform:scale(1.09)}
#settingsModal .accent-swatch[aria-pressed=true]{outline-color:var(--accent);transform:scale(1.08)}
#settingsModal .accent-swatch:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media(max-width:520px){#settingsModal .sound-settings{padding:0 12px}#settingsModal .accent-grid{max-width:100%;gap:6px 8px}}

.appearance-loading-dialog{width:min(340px,calc(100vw - 32px));padding:24px;border:1px solid var(--border);border-radius:20px;background:var(--bg);color:var(--fg);box-shadow:0 24px 80px #0003}
.appearance-loading-dialog::backdrop{background:#080c1859;backdrop-filter:blur(5px)}
.appearance-loading-content{display:grid;justify-items:center;gap:12px;text-align:center}
.appearance-loading-mark{width:34px;height:34px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:appearance-spin .8s linear infinite}
.appearance-loading-content h2{margin:0;font-size:16px}
.appearance-loading-content p{margin:0;color:var(--fg2);font-size:12px;overflow-wrap:anywhere}
.appearance-loading-bar{display:block;width:100%;height:4px;border-radius:99px;background:linear-gradient(90deg,transparent,var(--accent),transparent);background-size:200% 100%;animation:appearance-progress 1.15s ease-in-out infinite}
@keyframes appearance-spin{to{transform:rotate(360deg)}}@keyframes appearance-progress{from{background-position:100% 0}to{background-position:-100% 0}}
@media(prefers-reduced-motion:reduce){.appearance-loading-mark,.appearance-loading-bar{animation:none!important}}

.appearance-loading-dialog[hidden]{display:none!important}
.appearance-loading-dialog:not([hidden]){position:fixed;inset:0;z-index:10000;display:grid;place-items:center;box-sizing:border-box;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:16px;border:0;border-radius:0;background:#080c1859;color:var(--fg);backdrop-filter:blur(5px)}
.appearance-loading-content{box-sizing:border-box;width:min(340px,100%);padding:24px;border:1px solid var(--border);border-radius:20px;background:var(--bg);box-shadow:0 24px 80px #0003}

/* Complete, consistent accent palette for every selectable colour. */
html[data-accent=yellow] body{--accent:#b98513;--accent-h:#93670b;--accent-rgb:185,133,19}
html[data-accent=red] body{--accent:#b8323b;--accent-h:#982630;--accent-rgb:184,50,59}
html[data-accent=green] body{--accent:#23794f;--accent-h:#195f3d;--accent-rgb:35,121,79}
html[data-accent=blue] body{--accent:#266dbe;--accent-h:#1d5798;--accent-rgb:38,109,190}
html[data-accent=gray] body{--accent:#616570;--accent-h:#4b4e58;--accent-rgb:97,101,112}
html[data-accent=yellow] body.dark{--accent:#f0c35b;--accent-h:#f6d58d;--accent-rgb:240,195,91}
html[data-accent=red] body.dark{--accent:#f08087;--accent-h:#f5a0a5;--accent-rgb:240,128,135}
html[data-accent=green] body.dark{--accent:#6fc99b;--accent-h:#91ddb4;--accent-rgb:111,201,155}
html[data-accent=blue] body.dark{--accent:#78b7f4;--accent-h:#9bcbfa;--accent-rgb:120,183,244}
html[data-accent=gray] body.dark{--accent:#b3b6c0;--accent-h:#d0d2d9;--accent-rgb:179,182,192}
.accent-grid{grid-template-columns:repeat(5,minmax(0,1fr));column-gap:14px;row-gap:14px}
.accent-swatch{width:40px;height:40px;border-width:3px}
#settings-panel-usage[data-state=unavailable]{color:var(--fg)}
#settings-panel-usage[data-state=unavailable] p{color:var(--fg2)}
#settings-panel-usage[data-state=unavailable] #usagePercent{color:var(--fg)}
#settings-panel-usage[data-state=unavailable] progress{accent-color:var(--accent)}
#settings-panel-usage[data-state=unavailable] progress::-webkit-progress-value{background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 62%,#60a5fa));box-shadow:0 0 8px color-mix(in srgb,var(--accent) 22%,transparent)}
#settings-panel-usage[data-state=unavailable] progress::-moz-progress-bar{background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 62%,#60a5fa))}
#settingsModal .settings-tabs-shell{border-bottom:0;box-shadow:none}
#settingsModal .settings-tabs{border-bottom:0}
.settings-section :is(button,.inp,select){font-family:inherit}
.settings-section .settings-action{min-height:40px;border-radius:11px;font-family:inherit;font-size:13px;font-weight:600;line-height:1.4}
.settings-section .settings-hint{color:var(--fg2)}
#settings-panel-tools{border:0!important;box-shadow:none!important}
#settings-panel-tools::before,#settings-panel-tools::after{content:none!important;display:none!important}
#settings-panel-tools .api-key-card{border:1px solid var(--border);box-shadow:none}

/* The tab strip has arrow controls; a native scrollbar only adds a stray curved line. */
#settingsModal .settings-tabs{scrollbar-width:none!important;scrollbar-color:transparent transparent!important}
#settingsModal .settings-tabs::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}

/* Developer moderation workspace */
.admin-user-row{cursor:pointer;transition:background .16s ease}
.admin-user-row:hover,.admin-user-row.selected{background:var(--hover)}
.admin-user-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.admin-user-expanded td{padding:0!important;background:var(--bg2)}
.admin-user-action-bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px 14px;border-top:1px solid var(--border)}
.admin-user-action-bar .settings-action{width:100%;min-height:40px;justify-content:center;border-radius:11px}
.admin-user-dialog{width:min(620px,calc(100vw - 28px));max-width:620px;max-height:min(82dvh,760px);overflow:auto;margin:auto;padding:22px;border:1px solid var(--border);border-radius:18px;background:var(--bg);color:var(--fg);box-shadow:0 24px 80px rgba(0,0,0,.28)}
.admin-user-dialog::backdrop{background:rgba(8,12,22,.55);backdrop-filter:blur(3px)}
.admin-user-dialog h2{font-size:18px;margin:0 0 16px}
.admin-dialog-close{display:block;margin:18px 0 0 auto}
.admin-user-details-content{display:grid;gap:8px}
.admin-detail-line{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr);gap:12px;padding:9px 11px;border:1px solid var(--border);border-radius:10px;background:var(--bg2);font-size:13px;overflow-wrap:anywhere}
.admin-detail-line strong{color:var(--fg2);font-weight:600}
.admin-user-details-content h3{font-size:14px;margin:14px 0 4px}
.admin-detail-action{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);font-size:12.5px}
.admin-action-identity{display:flex;flex-wrap:wrap;gap:8px 14px;margin-bottom:14px;font-size:13px}
.admin-action-identity span{color:var(--fg2)}
.admin-report-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-bottom:14px;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--bg2)}
.admin-report-head{grid-column:1/-1;font-size:13px;font-weight:600}
.admin-report-readonly{grid-column:1/-1;min-height:110px;resize:vertical;opacity:.9}
.admin-report-status{min-width:0}
.admin-report-panel .settings-action{white-space:nowrap}
.admin-action-reason{display:block;margin:10px 0 14px}
.admin-action-reason input{width:100%;min-height:44px;margin-top:6px}
.admin-moderation-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.admin-moderation-actions .settings-action{min-height:44px;justify-content:center;white-space:normal;text-align:center}
.admin-action-ban{background:#b93845!important;color:white!important}
.admin-action-restrict{background:#b7791f!important;color:white!important}
.admin-action-warning{background:var(--accent)!important;color:white!important}
.admin-user-dialog .inp{width:100%;min-height:42px}
@media(max-width:620px){.admin-user-dialog{padding:16px;border-radius:16px}.admin-detail-line{grid-template-columns:1fr;gap:3px}.admin-moderation-actions{grid-template-columns:1fr}.admin-report-panel{grid-template-columns:1fr}.admin-report-status{grid-column:1}.admin-user-action-bar{padding:10px}.admin-user-dialog h2{font-size:16px}}

.moderation-account{display:grid;gap:10px;margin:14px 0;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--bg2)}
.moderation-account h3{font-size:14px;margin:0}
.moderation-account-list{display:grid;gap:8px}
.moderation-account-card{display:grid;gap:7px;padding:11px;border:1px solid var(--border);border-radius:11px;background:var(--bg)}
.moderation-account-card p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.moderation-account-card .settings-action{justify-self:start}
.moderation-revoked{font-size:12px;color:var(--fg2)}
.moderation-appeal-dialog textarea{min-height:120px;resize:vertical}
@media(max-width:620px){.moderation-account{padding:11px}.moderation-account-card{padding:10px}}

.admin-report-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.admin-report-status-menu{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:8px;border:1px solid var(--border);border-radius:11px;background:var(--bg)}
.admin-report-status-menu[hidden]{display:none}
.admin-report-status-menu .settings-action{justify-content:center;min-height:38px;white-space:normal}
.admin-report-head .settings-action{font-size:12px;white-space:nowrap}
@media(max-width:620px){.admin-report-status-menu{grid-template-columns:1fr}.admin-report-head{align-items:flex-start;flex-direction:column}}

#deviceAccessModeBtn{display:none;align-items:center;justify-content:center;gap:6px;min-width:0;max-width:196px;height:38px;padding:0 10px;border:1px solid var(--border);border-radius:12px;background:var(--bg2);color:var(--fg);font-size:11.5px;font-weight:600;white-space:nowrap}
#deviceAccessModeBtn:not([hidden]){display:inline-flex}
#deviceAccessModeBtn svg{flex:0 0 auto}
#deviceAccessModeBtn .device-access-chevron{opacity:.65}
#deviceAccessModeBtn:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 7%,var(--bg2))}
#deviceAccessModeMenu{position:absolute;z-index:90;left:48px;bottom:calc(100% + 9px);width:min(310px,calc(100vw - 38px));padding:7px;border:1px solid var(--border);border-radius:14px;background:var(--bg);box-shadow:0 16px 48px rgba(0,0,0,.2)}
#deviceAccessModeMenu[hidden]{display:none}
#deviceAccessModeMenu button{display:grid;gap:3px;width:100%;padding:10px 11px;border:0;border-radius:9px;background:transparent;color:var(--fg);text-align:left;cursor:pointer}
#deviceAccessModeMenu button:hover,#deviceAccessModeMenu button[aria-checked=true]{background:var(--hover)}
#deviceAccessModeMenu strong{font-size:12.5px;font-weight:650}
#deviceAccessModeMenu small{font-size:11px;color:var(--fg2);line-height:1.4}
@media(max-width:600px){#deviceAccessModeBtn{max-width:46px;width:40px;padding:0}#deviceAccessModeBtn span,#deviceAccessModeBtn .device-access-chevron{display:none}#deviceAccessModeMenu{left:42px}}

 .moderation-notice{display:flex;align-items:center;gap:10px;margin:0 0 9px;padding:10px 12px;border:1px solid color-mix(in srgb,#d97706 40%,var(--border));border-radius:12px;background:color-mix(in srgb,#d97706 9%,var(--bg));color:var(--fg);font-size:12px;line-height:1.4}.moderation-notice[hidden]{display:none}.moderation-notice-icon{display:grid;place-items:center;flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:#d97706;color:white;font-weight:800}.moderation-notice button{margin-left:auto;flex:0 0 auto;border:0;border-radius:8px;padding:7px 10px;background:var(--accent);color:white;font-size:11px;font-weight:650;cursor:pointer}
@keyframes brand-logo-fallback{0%{opacity:1;transform:scale(1)}45%{opacity:.62;transform:scale(.96)}100%{opacity:1;transform:scale(1)}}
#logoTop .brand-mark.brand-logo-fallback{animation:brand-logo-fallback .24s ease-out}
@media(prefers-reduced-motion:reduce){#logoTop .brand-mark.brand-logo-fallback{animation:brand-logo-fallback .18s ease-out}}

.direct-support{position:fixed;right:22px;bottom:20px;z-index:1500;font:inherit;color:var(--fg)}
.direct-support-launcher{display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid color-mix(in srgb,var(--accent) 52%,var(--border));border-radius:50%;background:var(--bg);color:var(--accent);box-shadow:0 8px 30px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.12);cursor:pointer;transition:transform .2s,box-shadow .2s,border-color .2s}
.direct-support-launcher:hover{transform:translateY(-1px) scale(1.025);border-color:var(--accent);box-shadow:0 10px 28px rgba(0,0,0,.2)}
.direct-support-launcher:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 45%,transparent);outline-offset:3px}
.direct-support-launcher svg{color:var(--accent)}
.direct-support-panel{position:absolute;right:0;bottom:58px;width:min(380px,calc(100vw - 28px));height:min(540px,calc(100dvh - 110px));min-height:320px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:var(--bg);box-shadow:0 18px 60px rgba(0,0,0,.24);animation:support-rise .2s ease-out}
.direct-support-panel[hidden]{display:none}
@keyframes support-rise{from{opacity:0;transform:translateY(9px) scale(.985)}to{opacity:1;transform:none}}
.direct-support-head{display:flex;align-items:center;justify-content:space-between;padding:14px 15px;border-bottom:1px solid var(--border);background:var(--bg2)}
.direct-support-head div{display:grid;gap:3px}.direct-support-head strong{font-size:14px}.direct-support-head small{font-size:11px;color:var(--fg2)}
.direct-support-head>button{border:0;background:transparent;color:var(--fg2);font-size:23px;cursor:pointer}.direct-support-head>#directSupportBack{font-size:19px;color:var(--accent);padding:3px 7px}.direct-support-head>#directSupportBack[hidden]{display:none}
 .direct-support-modes{touch-action:none;cursor:grab;display:flex;flex-direction:column;gap:7px;position:absolute;left:8px;top:50%;transform:translateY(-50%);z-index:3;padding:6px;border:1px solid var(--border);border-radius:15px;background:var(--bg2);box-shadow:0 5px 22px rgba(0,0,0,.13)}
.direct-support-modes[hidden]{display:none}.direct-support-modes button{width:35px;height:35px;border:0;border-radius:10px;background:transparent;color:var(--fg2);font-size:14px;font-weight:700;cursor:pointer}.direct-support-modes button[aria-pressed=true]{background:var(--accent);color:white}
.direct-support-list{overflow:auto;padding:9px;display:grid;align-content:start;gap:7px}.direct-support-list[hidden]{display:none}.direct-support-thread{display:grid;gap:4px;text-align:left;padding:11px;border:1px solid var(--border);border-radius:12px;background:var(--bg2);color:var(--fg);cursor:pointer}.direct-support-thread strong{font-size:12px}.direct-support-thread small{font-size:11px;color:var(--fg2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.direct-support-chat{display:flex;flex:1;min-height:0;flex-direction:column}.direct-support-messages{flex:1;overflow:auto;padding:14px 12px;display:flex;flex-direction:column;gap:11px}.direct-support-message{max-width:90%;display:grid;gap:4px;align-self:flex-start}.direct-support-message.mine{align-self:flex-end}.direct-support-bubble{white-space:pre-wrap;overflow-wrap:anywhere;padding:10px 12px;border-radius:13px;background:var(--bg2);font-size:12.5px;line-height:1.5}.direct-support-message.mine .direct-support-bubble{background:color-mix(in srgb,var(--accent) 14%,var(--bg2))}.direct-support-meta{display:flex;align-items:center;gap:7px;font-size:10px;color:var(--fg2)}.direct-support-meta button{border:0;padding:0;background:none;color:var(--accent);cursor:pointer;font-size:10px}
.direct-support-attach{display:flex;gap:6px;padding:7px 10px;border-top:1px solid var(--border)}.direct-support-attach[hidden]{display:none}.direct-support-attach select{flex:1;min-width:0;background:var(--bg2);color:var(--fg);border:1px solid var(--border);border-radius:8px;padding:6px;font-size:11px}
.direct-support-form{display:flex;align-items:center;gap:7px;padding:9px;border-top:1px solid var(--border);background:var(--bg2)}.direct-support-form textarea{flex:1;min-width:0;max-height:100px;resize:none;border:0;outline:0;background:transparent;color:var(--fg);font:inherit;font-size:12.5px;padding:8px 2px}.direct-support-form button{flex:0 0 34px;width:34px;height:34px;border:0;border-radius:10px;background:transparent;color:var(--fg2);font-size:19px;cursor:pointer}.direct-support-form button:last-child{background:var(--accent);color:white}
.direct-support-empty{margin:auto;text-align:center;color:var(--fg2);font-size:12px;padding:20px}
@media(max-width:600px){.direct-support{right:12px;bottom:12px}.direct-support-launcher{width:44px;height:44px;padding:0}.direct-support-panel{right:-2px;bottom:54px;width:min(380px,calc(100vw - 20px));height:min(570px,calc(100dvh - 92px))}}

.chat-model-bar{position:relative;z-index:5;display:flex;align-items:center;min-height:34px;padding:3px 20px 5px 24px;pointer-events:none}
#chatModelName{pointer-events:auto}
.chat-model-popup{pointer-events:auto}
#chatModelName{display:inline-flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:4px 0;border:0;background:transparent;color:var(--fg);font-size:17px;font-weight:780;letter-spacing:-.03em;cursor:pointer}
#chatModelName .model-chevron{display:grid;place-items:center;flex:0 0 24px;width:24px;height:24px;margin-left:auto;color:var(--fg2);transition:transform .18s ease}
#chatModelName .model-chevron svg{display:block;width:16px;height:16px}
#chatModelName[aria-expanded=true] .model-chevron{transform:rotate(180deg)}
.chat-model-popup{position:absolute;top:calc(100% + 3px);left:22px;width:min(290px,calc(100vw - 42px));padding:7px;border:1px solid var(--border);border-radius:14px;background:var(--bg);box-shadow:0 14px 42px rgba(0,0,0,.2)}
.chat-model-popup[hidden]{display:none}
.chat-model-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:10px 11px;border:0;border-radius:9px;background:transparent;color:var(--fg);text-align:left;cursor:pointer}
.chat-model-option:hover,.chat-model-option.active{background:var(--hover)}
.chat-model-option strong{font-size:13px;font-weight:650}.chat-model-option small{font-size:10.5px;color:var(--fg2)}
/* Recolor the transparent brand mark from the active accent, without hue-shifting its original bitmap. */
#logoTop{position:relative;isolation:isolate}
#logoTop img{display:block;opacity:0!important;filter:none!important}
#logoTop .brand-mark{position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 82%,white),var(--accent) 56%,color-mix(in srgb,var(--accent) 78%,black));-webkit-mask:url('/welcome-logo.png') center/contain no-repeat;mask:url('/welcome-logo.png') center/contain no-repeat}
#logoTop .brand-mark.brand-logo-fallback{animation:brand-logo-fallback .24s ease-out}
.sidebar-brand img,.welcome-icon{transition:opacity .22s ease;filter:none!important}
img,svg{-webkit-user-drag:none;user-select:none}
@media(max-width:600px){.chat-model-bar{padding:2px 13px 4px;min-height:31px}#chatModelName{font-size:15px}.chat-model-popup{left:12px}}

.direct-support-modes{transition:top .24s cubic-bezier(.2,.8,.2,1),transform .24s cubic-bezier(.2,.8,.2,1),box-shadow .2s}
.direct-support-modes:not(.dragging){animation:support-rail-breathe 4s ease-in-out infinite}
.direct-support-modes.dragging{cursor:grabbing;transition:none;animation:none;box-shadow:0 9px 28px rgba(0,0,0,.22)}
.support-rail-handle{display:block;width:17px;height:3px;margin:1px auto 3px;border-radius:99px;background:var(--fg2);opacity:.45;cursor:grab}
@keyframes support-rail-breathe{0%,100%{box-shadow:0 5px 22px rgba(0,0,0,.13)}50%{box-shadow:0 7px 27px rgba(0,0,0,.18)}}
@media(prefers-reduced-motion:reduce){.direct-support-modes{animation:none!important;transition:none!important}}

.direct-support-message:not(.mine){position:relative;padding-left:30px}
.direct-support-message:not(.mine)::before{content:'P';position:absolute;left:0;top:1px;width:23px;height:23px;display:grid;place-items:center;border-radius:8px;background:linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent) 45%,#a78bfa));color:#fff;font-size:11px;font-weight:800;box-shadow:0 2px 7px color-mix(in srgb,var(--accent) 25%,transparent)}
.direct-support-head{gap:8px}

.chat-model-option:disabled{opacity:.42;cursor:not-allowed;background:transparent!important}
/* Keep the settings dialog above the sticky chat model header and its stacking context. */
#settingsModal{z-index:1400}
.direct-support-panel{min-height:min(320px,calc(100dvh - 110px))}

/* Persistent service-capacity notice: shown by default, dismissed for this visit only. */
#slowdownNotice{display:flex;align-items:center;gap:calc(9px * var(--ui-scale,1));min-width:0;padding:calc(8px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));margin:0;border:0;border-bottom:1px solid color-mix(in srgb,#d49b35 34%,var(--border));border-radius:0;background:color-mix(in srgb,#d49b35 7%,var(--bg));color:var(--fg);font-size:calc(12.5px * var(--ui-scale,1));line-height:1.4;box-shadow:none}#slowdownNotice[hidden]{display:none!important}#slowdownNotice>svg{flex:0 0 calc(18px * var(--ui-scale,1));color:#b47a13}#slowdownNotice>span{min-width:0;flex:1;overflow-wrap:anywhere}#slowdownNoticeClose{width:calc(30px * var(--ui-scale,1));height:calc(30px * var(--ui-scale,1));flex:0 0 calc(30px * var(--ui-scale,1));display:grid;place-items:center;padding:0;border:0;border-radius:calc(8px * var(--ui-scale,1));background:transparent;color:inherit;cursor:pointer}#slowdownNoticeClose:hover{background:color-mix(in srgb,var(--fg) 9%,transparent)}#slowdownNoticeClose:focus-visible{outline:2px solid var(--accent);outline-offset:1px}#slowdownNotice:not([hidden])+#serviceWarning:not([hidden]){margin:0!important;border-radius:0!important;border-top:0!important;border-bottom:0!important}#slowdownNotice:not([hidden])+#serviceWarning:not([hidden])+.input-box{border-top-left-radius:0;border-top-right-radius:0}@media(max-width:600px){#slowdownNotice{font-size:calc(12px * var(--ui-scale,1));gap:calc(7px * var(--ui-scale,1));padding:calc(9px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1))}}

@media(max-width:600px) and (max-height:500px){#slowdownNotice{gap:6px;padding:4px 8px;margin-bottom:4px;font-size:10px;line-height:1.25}#slowdownNotice>svg{width:14px;height:14px;flex-basis:14px}#slowdownNoticeClose{width:24px;height:24px;flex-basis:24px}#serviceWarning{gap:6px!important;padding:4px 8px!important;margin:0 0 4px!important;font-size:10px!important;line-height:1.25!important}#serviceWarning svg{width:14px;height:14px;flex-basis:14px}#serviceWarning .service-warning-close{width:24px;height:24px;flex-basis:24px}}

/* Confirm actions must read as enabled controls, not faint decorative glyphs. */
#nickSave:not(:disabled),.rename-save:not(:disabled){
  display:grid!important;place-items:center!important;
  width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;
  flex:0 0 28px!important;padding:0!important;
  border:1px solid color-mix(in srgb,var(--accent) 42%,var(--border))!important;
  border-radius:50%!important;
  background:color-mix(in srgb,var(--accent) 16%,var(--bg))!important;
  color:var(--accent)!important;opacity:1!important;filter:none!important;
  box-shadow:0 1px 3px color-mix(in srgb,var(--accent) 15%,transparent)!important;
  cursor:pointer!important;pointer-events:auto!important;
}
#nickSave:not(:disabled):hover,.rename-save:not(:disabled):hover{
  background:color-mix(in srgb,var(--accent) 25%,var(--bg))!important;
  border-color:var(--accent)!important;transform:scale(1.06)!important;
}
#nickSave:disabled,.rename-save:disabled{opacity:.42!important;cursor:not-allowed!important;pointer-events:none!important}
#nickSave svg,.rename-save svg{width:14px!important;height:14px!important;display:block;stroke:currentColor!important;stroke-width:2.7!important}

/* Final interaction and appearance refinements */
body,body button,body input,body textarea,body select{font-family:var(--pongy-font,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif)}
img,svg{-webkit-user-drag:none;user-select:none}
#logoTop,.guest-mode #logoTop{pointer-events:auto!important;opacity:1!important;filter:none!important;-webkit-user-drag:none;user-select:none}
#logoTop img{pointer-events:none;-webkit-user-drag:none;user-select:none}
#logoTop .brand-mark{background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 82%,white),var(--accent) 56%,color-mix(in srgb,var(--accent) 78%,black))!important}
#settingsModal .accent-grid{width:100%;max-width:none;grid-template-columns:repeat(5,minmax(0,1fr));justify-items:center;align-items:center;gap:10px 8px;padding-inline:0}
#settingsModal .accent-swatch{width:38px;height:38px;justify-self:center;margin:0}
#nickSave{right:9px!important;width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;border-radius:8px!important;display:grid!important;place-items:center!important;padding:0!important}
#nickSave svg{width:13px!important;height:13px!important}
#attachmentPreview>.attachment-chip{flex:0 1 168px;max-width:min(168px,100%);min-height:34px;padding:4px 6px;gap:5px}
#attachmentPreview .attachment-preview-open{font-size:11px;gap:5px}
#attachmentPreview .file-visual img,#attachmentPreview .file-visual video{width:34px!important;height:30px!important}
#attachmentPreview .attachment-chip>button:last-child{width:21px;height:21px}
body.guest-mode #chatList .chat-act,body.guest-mode #pinChatBtn{opacity:1!important;filter:none!important;pointer-events:auto!important;cursor:pointer!important}

/* Support launcher alignment */
.direct-support-launcher{width:44px;height:44px;border-radius:50%;padding:0}
.direct-support-launcher svg{width:20px;height:20px;display:block}
@media(max-width:600px){.direct-support-launcher{width:44px;height:44px}}
#soundSettings>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px}
#soundSettings>summary::after{content:"";width:9px;height:9px;flex:0 0 9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:0 4px 4px auto;transition:transform .18s ease}
#soundSettings[open]>summary::after{transform:rotate(225deg);margin-bottom:0}

/* Mobile drawer remains expanded when the desktop compact preference is set */
:where(html[data-layout="mobile"]) body.collapsed .chat-body{display:flex!important}
:where(html[data-layout="mobile"]) body.collapsed .chat-actions{display:flex!important}

/* Preserve the hidden state after the shared compact confirmation styling. */
#nickSave[hidden]{display:none!important}
#nickSave:not([hidden]):not(:disabled),.rename-save:not(:disabled){
  opacity:1!important;filter:none!important;pointer-events:auto!important;
  display:grid!important;place-items:center!important;
  color:var(--accent)!important;
  background:color-mix(in srgb,var(--accent) 16%,var(--bg))!important;
  border:1px solid color-mix(in srgb,var(--accent) 42%,var(--border))!important;
  border-radius:50%!important;cursor:pointer!important;
  box-shadow:0 1px 3px color-mix(in srgb,var(--accent) 15%,transparent)!important;
}
#nickSave:not([hidden]):not(:disabled):hover,.rename-save:not(:disabled):hover{
  background:color-mix(in srgb,var(--accent) 26%,var(--bg))!important;
  border-color:var(--accent)!important;transform:scale(1.08)!important;
}
#nickSave:disabled,.rename-save:disabled{opacity:.42!important;cursor:not-allowed!important;pointer-events:none!important}
#nickSave svg,.rename-save svg{stroke:currentColor!important;display:block!important}

/* Nickname confirmation is a compact check glyph; chat rename keeps its circular action. */
#nickSave:not(:disabled){background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:var(--accent)!important;}
#nickSave:not(:disabled):hover{background:transparent!important;border:0!important;box-shadow:none!important;transform:scale(1.06)!important;}

.sb-workspace-nav{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:8px 10px;border-bottom:1px solid var(--border)}.sb-workspace-nav .sb-btn{justify-content:flex-start;min-width:0}.workspace-box{width:min(720px,calc(100vw - 28px));max-height:min(84vh,820px);overflow:hidden;display:flex;flex-direction:column}.workspace-tabs{display:flex;gap:8px;padding:0 18px 12px}.workspace-tabs button{border:1px solid var(--border);background:transparent;color:var(--fg2);border-radius:10px;padding:8px 13px;cursor:pointer}.workspace-tabs button[aria-pressed=true]{background:var(--hover);color:var(--fg);border-color:var(--accent)}#workspaceStatus{min-height:18px;margin:0 18px 8px;color:var(--fg2);font-size:12px}#workspaceStatus[data-error=true]{color:var(--danger)}.workspace-content{overflow:auto;padding:0 18px 18px}.workspace-create{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px;border:1px solid var(--border);border-radius:14px;margin-bottom:14px}.workspace-create textarea{grid-column:1/-1;resize:vertical}.workspace-create button{grid-column:1/-1}.workspace-card-list{display:grid;gap:10px}.workspace-card{display:grid;gap:8px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--bg2)}.workspace-card.active{border-color:var(--accent);box-shadow:inset 3px 0 var(--accent)}.workspace-card p{margin:0;color:var(--fg2);font-size:13px;overflow-wrap:anywhere}.workspace-card small{color:var(--fg2)}.workspace-card .inp{width:100%;min-width:0}.workspace-action{border:1px solid var(--border);background:var(--bg3);color:var(--fg);border-radius:9px;padding:8px 11px;cursor:pointer}.workspace-action.primary{background:var(--accent);border-color:var(--accent);color:white}.workspace-action.danger{color:var(--danger)}.workspace-action:disabled{opacity:.55;cursor:wait}.workspace-memory{resize:vertical}.workspace-download{color:var(--accent);font-size:13px;text-decoration:none}.workspace-empty{padding:22px;text-align:center;color:var(--fg2);font-size:13px}.active-project-badge{margin-left:10px;font-size:11px;color:var(--accent);white-space:nowrap}@media(max-width:560px){.workspace-create{grid-template-columns:1fr}.workspace-create textarea,.workspace-create button{grid-column:1}.workspace-box{max-height:90vh}.active-project-badge{display:none}}
.workspace-library-tools{display:grid;grid-template-columns:minmax(180px,1fr) minmax(130px,.6fr) minmax(130px,.6fr);gap:8px;margin:0 0 8px}.workspace-library-count{display:block;margin:0 2px 8px;color:var(--fg2)}.workspace-library-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.workspace-library-actions .workspace-download{margin-right:auto}@media(max-width:560px){.workspace-library-tools{grid-template-columns:1fr}.workspace-library-actions{display:grid;grid-template-columns:1fr 1fr}.workspace-library-actions .workspace-download{grid-column:1/-1}}

.workspace-cleanup{display:grid;gap:8px;padding:12px;border:1px solid var(--border);border-radius:14px;margin:0 0 14px;background:var(--bg2)}.workspace-cleanup>small{color:var(--fg2);line-height:1.45}.workspace-cleanup-results{display:grid;gap:7px}.workspace-cleanup-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px;border:1px solid var(--border);border-radius:10px}.workspace-cleanup-info{display:grid;gap:3px;min-width:0}.workspace-cleanup-info strong{overflow-wrap:anywhere}.workspace-cleanup-info small{color:var(--fg2)}@media(max-width:560px){.workspace-cleanup-item{align-items:stretch;flex-direction:column}}

/* Общие размеры и аккуратное оформление элементов */
:root{--control-radius:12px;--control-height:40px;--ui-gap:8px}
button,input,textarea,select{font-family:inherit}
.settings-section h3,.settings-subsection h3,.settings-field,.display-option,.beta-feature-option{font-size:13.5px;line-height:1.45}
.settings-hint,.settings-section small{font-size:12px;line-height:1.5}
.accent-swatch{background-image:linear-gradient(135deg,rgba(255,255,255,.38),rgba(0,0,0,.16))!important;box-shadow:inset 0 1px 1px rgba(255,255,255,.35),0 2px 7px rgba(0,0,0,.1)}
.avatar.ai{background-image:linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent) 48%,#b18cff))}
.chat-model-bar{min-height:38px;padding:4px 22px 6px}
#chatModelName{display:inline-flex;align-items:center;gap:9px;min-height:30px;padding:4px 9px 4px 11px;border:1px solid transparent;border-radius:10px;font-size:13px;font-weight:600;line-height:1.25;transition:background .18s ease,border-color .18s ease}
#chatModelName:hover,#chatModelName[aria-expanded=true]{background:var(--bg2);border-color:var(--border)}
#chatModelName .model-chevron{width:20px;height:20px;flex-basis:20px}
.chat-model-popup{padding:6px;border-radius:13px;box-shadow:0 12px 34px rgba(0,0,0,.16)}
.chat-model-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:42px;padding:8px 10px;border-radius:9px;text-align:left}
.chat-model-option strong{font-size:13px;font-weight:600}
.chat-model-option small{font-size:11px;font-weight:500;color:var(--fg2);padding:3px 7px;border-radius:99px;background:var(--bg3)}
.chat-model-option.active{background:color-mix(in srgb,var(--accent) 9%,var(--bg))}
.chat-model-option.active small{background:color-mix(in srgb,var(--accent) 15%,var(--bg));color:var(--accent)}
#soundSettings>summary::after{display:none!important}
#settingsModal .sound-settings>summary{padding-right:0!important}
#settingsModal .sound-settings>summary .settings-section-chevron{margin-left:auto;flex:0 0 18px;color:var(--fg2);transition:transform .2s ease}
#settingsModal .sound-settings[open]>summary .settings-section-chevron{transform:rotate(180deg)}
.composer-editor{position:relative;align-self:stretch;align-items:center;padding:0 30px 0 0}
.composer-expand{position:absolute;right:1px;top:2px;width:26px;height:26px;display:grid;place-items:center;border-radius:8px;color:var(--fg2);opacity:.8;z-index:2}
.composer-expand:hover{background:var(--hover);color:var(--fg);opacity:1}
.composer-editor #userInput{padding-right:4px;max-height:160px;overflow-y:auto}
body.composer-expanded .input-box{align-items:flex-end}
body.composer-expanded .composer-editor{align-items:flex-end}
body.composer-expanded .composer-editor #userInput{max-height:min(62vh,560px);min-height:180px}
body.composer-expanded .input-box>button{align-self:flex-end}
body.composer-expanded #composerExpand{top:5px}
@media(max-width:600px){body.composer-expanded .composer-editor #userInput{max-height:min(58vh,440px);min-height:150px}.chat-model-bar{min-height:36px}}

/* Новогодняя тема */
html[data-theme="holiday"]{--bg:#f5f8ff;--bg2:#eaf0fb;--bg3:#e0e9f7;--fg:#17263d;--fg2:#62748e;--border:#cfdaeb;--accent:#1768bd;--accent-h:#a52e54;--hover:rgba(23,104,189,.07);--hover2:rgba(23,104,189,.12)}
html[data-theme="holiday"] body{background-image:radial-gradient(circle at 12% 10%,rgba(255,255,255,.9) 0 1px,transparent 2px),radial-gradient(circle at 82% 22%,rgba(255,255,255,.85) 0 1px,transparent 2px),linear-gradient(135deg,rgba(23,104,189,.035),rgba(165,46,84,.035))}
html[data-theme="holiday"] .avatar.ai,html[data-theme="holiday"] #sendBtn.ready{background-image:linear-gradient(135deg,#1768bd,#a52e54)}
html[data-theme="holiday"] .sb-title::after{content:" ✦";color:#a52e54;font-size:.78em}
.workspace-tabs{gap:6px;padding:0 16px 12px}
.workspace-tabs button{min-height:36px;flex:1;border:1px solid var(--border);background:var(--bg2);border-radius:10px;padding:7px 11px;font-size:12.5px;font-weight:600;transition:background .18s,border-color .18s,color .18s}
.workspace-tabs button[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 12%,var(--bg));border-color:color-mix(in srgb,var(--accent) 38%,var(--border));color:var(--accent)}
.workspace-content{padding:0 16px 16px}
.workspace-create{gap:8px;padding:10px;border-radius:12px;margin-bottom:10px}
.workspace-card-list{gap:8px}
.workspace-card{gap:7px;padding:12px;border-radius:12px}
.workspace-action{min-height:34px;padding:7px 10px;border-radius:9px;font-size:12.5px}
.workspace-library-tools{gap:7px}
.workspace-library-actions{gap:6px}
.workspace-library-count{font-size:11.5px}

/* Единные компактные переключатели разделов */
.sb-workspace-nav{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:7px 10px 8px;border:0}
.sb-workspace-nav .sb-btn{min-height:34px;padding:7px 9px;border:1px solid transparent;border-radius:10px;justify-content:flex-start;font-size:12.5px;font-weight:600;background:var(--bg2);color:var(--fg2);transition:background .18s,border-color .18s,color .18s}
.sb-workspace-nav .sb-btn[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 11%,var(--bg));border-color:color-mix(in srgb,var(--accent) 32%,var(--border));color:var(--accent)}
.archive-nav{min-height:34px;margin:0 10px 7px;width:calc(100% - 20px);border:1px solid transparent;border-radius:10px;font-size:12.5px;font-weight:600}
.archive-nav[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 10%,var(--bg));border-color:color-mix(in srgb,var(--accent) 30%,var(--border));color:var(--accent)}
#workspaceSwitch{margin-bottom:8px;min-height:40px}
#workspaceSwitch button{font-weight:600}
.workspace-tabs{gap:5px}
.workspace-tabs button{min-height:36px;padding:7px 12px;font-size:12.5px;font-weight:600}
.workspace-tabs button[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 11%,var(--bg));border-color:color-mix(in srgb,var(--accent) 34%,var(--border));color:var(--accent)}
/* Акцентные элементы получают мягкий фирменный градиент */
.accent-swatch{background-image:linear-gradient(135deg,rgba(255,255,255,.4),rgba(0,0,0,.17))!important}
#sendBtn.ready,.mode-btn.active,.icon-btn.active,.skill-chip.active{background-image:linear-gradient(135deg,color-mix(in srgb,var(--accent) 88%,#fff),color-mix(in srgb,var(--accent) 70%,#172033));border-color:color-mix(in srgb,var(--accent) 68%,transparent)}
#sendBtn.ready{color:#fff}
.chat-model-option.active{background-image:linear-gradient(115deg,color-mix(in srgb,var(--accent) 14%,var(--bg)),color-mix(in srgb,var(--accent) 5%,var(--bg)))}
.model-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--fg2);margin-left:3px;transition:transform .2s ease}
#chatModelName[aria-expanded=true] .model-chevron{transform:rotate(180deg)}

/* Ответы, вложения и поля ввода используют общую типографику */
.message-content{font-size:14px;line-height:1.68;overflow-wrap:anywhere}
.message-content :is(h1,h2,h3,h4){font-size:1.06em;font-weight:650;line-height:1.35;letter-spacing:-.012em;margin:1.15em 0 .55em}
.message-content p{margin:.45em 0 .8em}
.message-content :is(ul,ol){padding-left:1.45em;margin:.55em 0 .85em}
.message-content li{padding:.12em 0}
.message-content blockquote{margin:.8em 0;padding:8px 13px;border-left:3px solid var(--accent);border-radius:0 10px 10px 0;background:var(--bg2);color:var(--fg2)}
.message-content pre{max-width:100%;overflow:auto;padding:13px 14px;border:1px solid var(--border);border-radius:12px;background:var(--bg3);line-height:1.55}
.message-content :not(pre)>code{padding:2px 5px;border-radius:5px;background:var(--bg3);font-size:.92em}
.message-content table{width:100%;border-collapse:collapse;display:block;max-width:100%;overflow:auto;margin:10px 0 14px;font-size:.94em}
.message-content th,.message-content td{padding:8px 10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
.message-content th{font-weight:650;background:var(--bg2)}
.settings-section :is(input,textarea,select),.workspace-box :is(input,textarea,select){box-sizing:border-box;min-width:0;font:inherit;line-height:1.4;border-radius:10px}
.settings-section :is(input,select),.workspace-box :is(input,select){min-height:40px}
.settings-section textarea,.workspace-box textarea{min-height:76px;padding:10px 12px;resize:vertical}
#composerExpand{touch-action:manipulation}
.composer-editor #userInput{line-height:1.5;overflow-wrap:anywhere}
#inputArea .input-box{align-items:flex-end}
#inputArea .input-box>button{flex:0 0 auto}
#inputArea .composer-editor{min-width:0;flex:1}
@media(max-width:600px){.message-content{font-size:14px}.message-content pre{padding:10px 11px}.message-content th,.message-content td{padding:7px 8px}}

.chat-model-popup[hidden]{display:none!important}
.chat-model-popup:not([hidden]){animation:chatModelMenuIn .16s cubic-bezier(.2,.8,.2,1) both;transform-origin:top center}
@keyframes chatModelMenuIn{from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.chat-model-popup:not([hidden]){animation:none}}

#workspaceSwitch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;border:1px solid var(--border);border-radius:12px;background:var(--bg2)}
#workspaceSwitch button{min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:9px;background:transparent;color:var(--fg2);font-size:12.5px;font-weight:600;transition:background .16s,color .16s,box-shadow .16s}
#workspaceSwitch button[aria-pressed=true]{background:var(--bg);color:var(--fg);box-shadow:0 1px 2px rgba(0,0,0,.08)}

/* Единое оформление ответов и вложений */
.bubble{line-height:1.64;overflow-wrap:anywhere}
.bubble>:first-child{margin-top:0}
.bubble>:last-child{margin-bottom:0}
.bubble :is(h1,h2,h3){line-height:1.3;letter-spacing:-.018em;font-weight:650;margin:1.05em 0 .48em}
.bubble h1{font-size:1.32em}
.bubble h2{font-size:1.18em}
.bubble h3{font-size:1.08em}
.bubble p{margin:.55em 0}
.bubble li+li{margin-top:.24em}
.bubble blockquote{margin:.8em 0;padding:9px 13px;border-left:3px solid var(--accent);border-radius:0 10px 10px 0;background:color-mix(in srgb,var(--accent) 5%,var(--bg2))}
.bubble pre{max-width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:var(--bg2);line-height:1.55}
.bubble :not(pre)>code{padding:.12em .36em;border:1px solid var(--border);border-radius:5px;background:var(--bg2);font-size:.92em}
.bubble table{display:block;width:100%;max-width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0}
.bubble th,.bubble td{padding:8px 10px;border:1px solid var(--border);text-align:left;vertical-align:top}
.bubble th{background:var(--bg2);font-weight:650}
.message-file-card .file-visual{background-image:linear-gradient(145deg,color-mix(in srgb,var(--accent) 15%,var(--bg2)),var(--bg2))}
.message-file-card .message-file-label{gap:3px}
.message-file-card .message-file-details{color:var(--fg2);line-height:1.35}
#attachmentPreview .attachment-chip{border-radius:11px;background:var(--bg2)}
@media(max-width:600px){.bubble pre{padding:10px;border-radius:10px}.bubble th,.bubble td{padding:7px 8px}}
/* Встроенные шрифты с латиницей и кириллицей; работают без внешних запросов. */
@font-face{font-family:"Pongy Inter";src:url("/fonts/inter-cyrillic-ext.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Pongy Inter";src:url("/fonts/inter-cyrillic.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Pongy Inter";src:url("/fonts/inter-latin-ext.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Pongy Inter";src:url("/fonts/inter-latin.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Pongy Roboto Flex";src:url("/fonts/roboto-flex-cyrillic-ext.woff2") format("woff2");font-style:normal;font-weight:100 1000;font-display:swap;unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Pongy Roboto Flex";src:url("/fonts/roboto-flex-cyrillic.woff2") format("woff2");font-style:normal;font-weight:100 1000;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Pongy Roboto Flex";src:url("/fonts/roboto-flex-latin-ext.woff2") format("woff2");font-style:normal;font-weight:100 1000;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Pongy Roboto Flex";src:url("/fonts/roboto-flex-latin.woff2") format("woff2");font-style:normal;font-weight:100 1000;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Pongy Noto Sans";src:url("/fonts/noto-sans-cyrillic-ext.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Pongy Noto Sans";src:url("/fonts/noto-sans-cyrillic.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Pongy Noto Sans";src:url("/fonts/noto-sans-latin-ext.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Pongy Noto Sans";src:url("/fonts/noto-sans-latin.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Pongy Montserrat";src:url("/fonts/montserrat-cyrillic-ext.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Pongy Montserrat";src:url("/fonts/montserrat-cyrillic.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Pongy Montserrat";src:url("/fonts/montserrat-latin-ext.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Pongy Montserrat";src:url("/fonts/montserrat-latin.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}


/* Refined code workspace and connected-tool activity states. */
.code-card{position:relative;border-color:color-mix(in srgb,var(--accent) 22%,var(--border));background:linear-gradient(145deg,color-mix(in srgb,var(--accent) 3%,var(--bg2)),var(--bg2) 55%);box-shadow:0 5px 18px color-mix(in srgb,var(--fg) 4%,transparent);transition:border-color .25s ease,box-shadow .25s ease}
.code-card:focus-within,.code-card:hover{border-color:color-mix(in srgb,var(--accent) 46%,var(--border));box-shadow:0 8px 24px color-mix(in srgb,var(--accent) 8%,transparent)}
.code-card header{background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 7%,var(--bg2)),var(--bg2));}
.code-card header>span{font-weight:600;letter-spacing:.015em}
.code-card pre{background:linear-gradient(180deg,color-mix(in srgb,var(--bg) 48%,transparent),transparent 72%)}
.code-card button{position:relative}
.code-card button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.activity-card[data-state="running"] .activity-icon{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 10%,transparent),0 0 18px color-mix(in srgb,var(--accent) 15%,transparent)}
.activity-card.work-skill .activity-icon,.activity-card.work-plugin .activity-icon{background:color-mix(in srgb,var(--accent) 12%,var(--bg2));}
.activity-card.work-skill .activity-icon{color:var(--accent)}
.activity-card.work-plugin .activity-icon{color:color-mix(in srgb,var(--accent) 72%,#38a6a0)}
.image-generation-pending{background:radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--accent) 12%,var(--bg2)),var(--bg3) 72%);border:1px solid color-mix(in srgb,var(--accent) 20%,var(--border));}
@media(prefers-reduced-motion:reduce){.code-card,.code-card button{transition:none!important}}

/* Pongy settings refresh: reference-led navigation, spacing and readable controls */
#settingsModal>.modal-box{
  width:min(980px,calc(100vw - 40px));max-width:980px;height:min(760px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);
  display:grid;grid-template-columns:252px minmax(0,1fr);grid-template-rows:64px minmax(0,1fr);
  border-radius:20px;overflow:hidden
}
#settingsModal>.modal-box>.modal-head{grid-column:1/-1;grid-row:1;min-height:64px;padding:0 24px;border-bottom:1px solid var(--border);background:var(--bg)}
#settingsModal>.modal-box>.modal-head h2{font-size:19px;font-weight:700;letter-spacing:-.02em}
#settingsModal>.modal-box>.settings-tabs-shell{grid-column:1;grid-row:2;display:flex;flex-direction:column;align-items:stretch;gap:10px;min-width:0;min-height:0;padding:18px 12px;background:var(--bg2);border-right:1px solid var(--border);overflow:hidden}
#settingsModal .settings-nav-search{flex:0 0 40px;width:100%;min-width:0;box-sizing:border-box;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--fg);font:inherit;font-size:13px;outline:none}
#settingsModal .settings-nav-search:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}
#settingsModal .settings-tabs{position:relative;display:flex;flex:1 1 auto;flex-direction:column;align-items:stretch;gap:3px;width:100%;min-width:0;min-height:0;padding:0;margin:0;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--fg) 20%,transparent) transparent;border:0;background:transparent}
#settingsModal .settings-tabs [role=tab]{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;gap:11px;width:100%;min-height:40px;padding:9px 11px;border:0;border-radius:9px;background:transparent;color:var(--fg2);font-size:13px;font-weight:550;line-height:1.3;text-align:left;white-space:normal;transition:background-color .16s ease,color .16s ease}
#settingsModal .settings-tabs [role=tab]:hover{background:color-mix(in srgb,var(--fg) 6%,transparent);color:var(--fg)}
#settingsModal .settings-tabs [role=tab][aria-selected=true]{background:color-mix(in srgb,var(--accent) 13%,var(--bg));color:var(--accent);font-weight:700}
#settingsModal .settings-tabs [role=tab]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#settingsModal .settings-nav-icon{width:17px;height:17px;flex:0 0 17px;opacity:.9}
#settingsModal .settings-tab-indicator,#settingsModal .settings-tabs-arrow{display:none!important}
#settingsModal>.modal-box>.modal-body{grid-column:2;grid-row:2;min-width:0;min-height:0;max-height:none;height:auto;padding:26px 32px 30px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;background:var(--bg)}
#settingsModal .settings-section{animation:settings-panel-enter .18s ease-out both}
#settingsModal .settings-section>h3{margin:0 0 8px;font-size:21px;font-weight:750;letter-spacing:-.025em;color:var(--fg)}
#settingsModal .settings-section .settings-hint{max-width:680px;font-size:13px;line-height:1.6}

#settingsModal .settings-section .display-option,#settingsModal .settings-section .memory-setting{min-height:54px;padding:12px 14px;margin:8px 0;border:1px solid var(--border);border-radius:11px;background:color-mix(in srgb,var(--bg2) 42%,transparent);transition:border-color .16s ease,background-color .16s ease}
#settingsModal .settings-section .display-option:hover,#settingsModal .settings-section .memory-setting:hover{border-color:color-mix(in srgb,var(--accent) 42%,var(--border));background:var(--bg2)}
#settingsModal .settings-section input:not([type=checkbox]),#settingsModal .settings-section select,#settingsModal .settings-section textarea{border-radius:10px}
#settingsModal .settings-section button{transition:background-color .16s ease,color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease}
#settingsModal .settings-section button:active:not(:disabled){transform:translateY(1px)}
#settingsModal .settings-section button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#settingsModal .settings-section .field-save-row{display:flex;align-items:center;gap:8px}
#settingsModal .settings-section .field-save{width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--border);border-radius:10px;background:var(--bg2);color:var(--accent)}
#settingsModal .settings-section .field-save:hover{background:color-mix(in srgb,var(--accent) 12%,var(--bg2));border-color:var(--accent)}
/* High-contrast foregrounds on filled action controls, across themes */
#sendBtn.ready,.confirm-btn.primary,.download-primary,.settings-action.api-key-primary,#personalApiSave,#apiKeyCreate,.connection-primary,#noteAISend,.workspace-action.primary,.moderation-notice button,.direct-support-form button:last-child,.admin-action-warning{
  color:#fff!important;text-shadow:0 1px 1px #0002
}
#sendBtn.ready:disabled,.confirm-btn.primary:disabled,.settings-action:disabled{opacity:.58}
button{transition-property:background-color,color,border-color,box-shadow,transform;transition-duration:.16s;transition-timing-function:cubic-bezier(.2,.7,.2,1)}
button:active:not(:disabled){transform:translateY(1px)}
@keyframes settings-panel-enter{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px){
  #settingsModal>.modal-box{width:calc(100vw - 20px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);grid-template-columns:minmax(0,1fr);grid-template-rows:58px auto minmax(0,1fr);border-radius:16px}
  #settingsModal>.modal-box>.modal-head{grid-column:1;grid-row:1;min-height:58px;padding:0 16px}
  #settingsModal>.modal-box>.settings-tabs-shell{grid-column:1;grid-row:2;display:flex;flex-direction:column;gap:8px;padding:10px 12px 8px;border-right:0;border-bottom:1px solid var(--border);overflow:hidden}
  #settingsModal .settings-nav-search{flex-basis:36px}
  #settingsModal .settings-tabs{flex:0 0 auto;flex-direction:row;gap:5px;overflow-x:auto;overflow-y:hidden;padding:0 0 4px;scrollbar-width:none}
  #settingsModal .settings-tabs [role=tab]{width:auto;min-width:max-content;min-height:36px;padding:8px 11px;font-size:12px}
  #settingsModal .settings-nav-icon{width:15px;height:15px;flex-basis:15px}
  #settingsModal>.modal-box>.modal-body{grid-column:1;grid-row:3;padding:18px 16px 24px}
}
@media(prefers-reduced-motion:reduce){
  #settingsModal .settings-section{animation:none!important}
  #settingsModal .settings-tabs [role=tab],#settingsModal .settings-section .display-option{transition:none!important}
}

#settingsModal .settings-tabs [role=tab]::before{display:grid;place-items:center;flex:0 0 18px;width:18px;height:18px;font-size:16px;line-height:1;color:currentColor;opacity:.86}
#settings-tab-main::before{content:"⌂"}#settings-tab-account::before{content:"◉"}#settings-tab-interface::before{content:"◈"}#settings-tab-tools::before{content:"⌘"}#settings-tab-connections::before{content:"↔"}#settings-tab-plugins::before{content:"✣"}#settings-tab-skills::before{content:"✓"}#settings-tab-usage::before{content:"◴"}#settings-tab-subscription::before{content:"☆"}#settings-tab-beta::before{content:"✧"}#settings-tab-developer::before{content:"〈〉"}
@media(max-width:700px){#settingsModal .settings-tabs [role=tab]::before{flex-basis:16px;width:16px;font-size:14px}}

#settingsModal .settings-tabs [role=tab][hidden]{display:none!important}

#settingsModal .settings-page-title{margin:0 0 6px;font-size:23px;font-weight:760;letter-spacing:-.035em;line-height:1.2;color:var(--fg)}
#settingsModal .settings-page-description{margin:0 0 24px;max-width:680px;font-size:13px;line-height:1.55;color:var(--fg2)}
@media(max-width:700px){#settingsModal .settings-page-title{font-size:20px}#settingsModal .settings-page-description{margin-bottom:18px}}

#settingsModal .settings-section button.primary,#settingsModal .settings-section .primary,#settingsModal .settings-section [data-variant=primary]{color:#fff!important}
#settingsModal .settings-section .field-save::before{content:"✓";font-size:17px;font-weight:800;line-height:1}
#settingsModal .settings-section .field-save svg{display:none}
#settingsModal #nickLabel::after{content:"✎";display:inline-block;margin-left:7px;color:var(--fg2);font-size:13px;font-weight:500}

/* Keep the redesigned settings dialog proportional on tablet landscape breakpoints. */
html[data-layout=mobile] #settingsModal>.modal-box{width:min(980px,calc(100vw - 40px));max-width:980px;height:min(760px,calc(100dvh - 48px));max-height:calc(100dvh - 48px)}
@media(max-width:700px){html[data-layout=mobile] #settingsModal>.modal-box{width:calc(100vw - 20px);max-width:980px;height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}}

/* Main surface refinement: consistent gradient brand marks, calm controls and stable hover states. */
#logoTop{position:relative;isolation:isolate;overflow:hidden}
#logoTop::before,.big-logo::before,#authLogo::before{content:"";position:absolute;inset:0;display:block;pointer-events:none;z-index:2;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 74%,#72e4ff),color-mix(in srgb,var(--accent) 88%,#8175ff) 52%,color-mix(in srgb,var(--accent) 68%,#f0a0ff));-webkit-mask:url('/welcome-logo.png') center/contain no-repeat;mask:url('/welcome-logo.png') center/contain no-repeat}
#logoTop img,.big-logo .welcome-icon,#authLogo img{opacity:0!important}
.big-logo{position:relative;isolation:isolate}
.big-logo::before{inset:2px}
#logoTop:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@supports not ((mask:url('/welcome-logo.png')) or (-webkit-mask:url('/welcome-logo.png'))){#logoTop img,.big-logo .welcome-icon,#authLogo img{opacity:1!important}#logoTop::before,.big-logo::before,#authLogo::before{display:none}}
/* The model chevron belongs immediately beside the model label. */
.chat-model-bar{justify-content:flex-start}
#chatModelName{width:auto;max-width:100%;justify-content:flex-start;gap:7px}
#chatModelName .model-chevron{flex:0 0 18px;width:18px;height:18px;margin:0;color:var(--fg2)}
#chatModelName .model-chevron svg{width:14px;height:14px}
/* Compact squared toggles: no oversized circular thumb, bounce or glow. */
input.display-switch[type=checkbox]{appearance:none!important;-webkit-appearance:none!important;width:40px!important;height:22px!important;min-width:40px!important;min-height:22px!important;flex:0 0 40px!important;border:1px solid var(--border)!important;border-radius:7px!important;background:var(--bg3)!important;box-shadow:none!important;cursor:pointer!important;transition:background-color .18s ease,border-color .18s ease!important}
input.display-switch[type=checkbox]::before{content:""!important;position:absolute!important;left:3px!important;top:3px!important;width:14px!important;height:14px!important;border-radius:4px!important;background:var(--fg2)!important;box-shadow:none!important;transform:translateX(0)!important;transition:transform .18s ease,background-color .18s ease!important}
input.display-switch[type=checkbox]:checked{background:var(--accent)!important;border-color:var(--accent)!important;box-shadow:none!important}
input.display-switch[type=checkbox]:checked::before{transform:translateX(18px)!important;background:#fff!important}
input.display-switch[type=checkbox]:active::before,input.display-switch[type=checkbox]:checked:active::before{width:14px!important;transform:translateX(18px)!important}
input.display-switch[type=checkbox]:not(:checked):active::before{transform:translateX(0)!important}
input.display-switch[type=checkbox]:focus-visible{outline:2px solid var(--accent)!important;outline-offset:3px!important}
/* Hover feedback must not move controls away from the pointer or change hitboxes. */
:where(.sb-btn,.icon-btn,.tb-btn,.chat-act,.chat-item,.chat-model-option,.appearance-select-trigger,.appearance-select-option,.settings-nav-item,.direct-support-launcher):hover{transform:none!important;translate:none!important}
:where(.sb-btn,.icon-btn,.tb-btn,.chat-act,.chat-item,.chat-model-option,.appearance-select-trigger,.appearance-select-option,.settings-nav-item){transition:background-color .16s ease,color .16s ease,border-color .16s ease,box-shadow .16s ease,opacity .16s ease!important}
@media(prefers-reduced-motion:reduce){#logoTop::before,.big-logo::before,#authLogo::before,input.display-switch[type=checkbox],input.display-switch[type=checkbox]::before{transition:none!important;animation:none!important}}

.connection-token-label{display:block;margin:10px 0 6px;color:var(--fg2);font-size:12px;font-weight:650}
.connection-token-input{display:block;width:100%;min-height:42px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg2);color:var(--fg);font:inherit;font-size:13px;letter-spacing:.01em;outline:none}
.connection-token-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}
.connection-token-note{margin:8px 0 0;color:var(--fg2);font-size:11px;line-height:1.5}

/* AI activity: clear status glyphs and a restrained progress indicator. */
.activity-status{display:inline-flex;align-items:center;gap:6px}
.activity-status::before{content:"";display:inline-grid;place-items:center;width:15px;height:15px;flex:0 0 15px;border:1.4px solid var(--border);border-radius:5px;color:var(--fg2);font-size:11px;font-weight:800;line-height:1}
.activity-card[data-state="completed"] .activity-status::before{content:"✓";border-color:var(--success);background:color-mix(in srgb,var(--success) 12%,var(--bg));color:var(--success)}
.activity-card[data-state="running"] .activity-status::before{border:2px solid color-mix(in srgb,var(--accent) 22%,transparent);border-top-color:var(--accent);border-radius:50%;animation:activity-status-spin .9s linear infinite}
.activity-card[data-state="failed"] .activity-status::before{content:"!";border-color:#c83c43;background:color-mix(in srgb,#c83c43 10%,var(--bg));color:#c83c43}
.activity-card[data-state="interrupted"] .activity-status::before,.activity-card[data-state="not_checked"] .activity-status::before{content:"–"}
@keyframes activity-status-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.activity-card[data-state="running"] .activity-status::before{animation:none;border-top-color:var(--accent)}}
html[data-motion="reduced"] .activity-card[data-state="running"] .activity-status::before{animation:none}
/* Seasonal theme: a complete winter palette with restrained festive accents. */
html[data-theme="holiday"]{
  color-scheme:light;
  --bg:#f4f8ff;--bg2:#eaf1fb;--bg3:#dfe9f7;--fg:#17263d;--fg2:#5f718b;
  --border:#cbd9eb;--accent:#1768bd;--accent-h:#a52e54;
  --hover:rgba(23,104,189,.075);--hover2:rgba(23,104,189,.13);
  --holiday-red:#b83250;--holiday-green:#26785a;--holiday-gold:#c09238;
}
html[data-theme="holiday"] body{
  background-color:var(--bg);
  background-image:
    radial-gradient(1.5px 1.5px at 8% 13%,rgba(255,255,255,.95) 50%,transparent 100%),
    radial-gradient(2px 2px at 78% 18%,rgba(255,255,255,.9) 50%,transparent 100%),
    radial-gradient(1px 1px at 42% 72%,rgba(255,255,255,.8) 50%,transparent 100%),
    radial-gradient(2px 2px at 91% 83%,rgba(255,255,255,.85) 50%,transparent 100%),
    linear-gradient(145deg,rgba(23,104,189,.045),rgba(38,120,90,.035) 48%,rgba(184,50,80,.035));
  background-attachment:fixed;
}
html[data-theme="holiday"] #sidebar{border-right-color:color-mix(in srgb,var(--holiday-green) 22%,var(--border));}
html[data-theme="holiday"] .sb-head{background:linear-gradient(110deg,rgba(38,120,90,.055),transparent 58%,rgba(184,50,80,.045));}
html[data-theme="holiday"] .sb-title::after{content:" ✦";color:var(--holiday-red);font-size:.78em;}
html[data-theme="holiday"] .logo{box-shadow:0 0 0 1px rgba(192,146,56,.24),0 3px 12px rgba(23,104,189,.12);}
html[data-theme="holiday"] .avatar.ai,html[data-theme="holiday"] #sendBtn.ready{background-image:linear-gradient(135deg,#1768bd 0%,#26785a 54%,#b83250 100%);}
html[data-theme="holiday"] .mode-btn.active{border-color:color-mix(in srgb,var(--holiday-green) 42%,var(--border));background:linear-gradient(110deg,rgba(38,120,90,.11),rgba(23,104,189,.08));}
html[data-theme="holiday"] #inputInner{border-color:color-mix(in srgb,var(--holiday-green) 22%,var(--border));box-shadow:0 8px 28px rgba(23,65,105,.07),inset 0 1px rgba(255,255,255,.75);}
html[data-theme="holiday"] .modal-box,html[data-theme="holiday"] .workspace-box{border-color:color-mix(in srgb,var(--holiday-gold) 25%,var(--border));}
html[data-theme="holiday"] .chat-model-bar{background:linear-gradient(90deg,rgba(38,120,90,.045),transparent 55%,rgba(184,50,80,.035));}
html[data-theme="holiday"] .accent-swatch[aria-pressed="true"]{outline-color:var(--holiday-gold);}
@media(prefers-reduced-motion:reduce){html[data-theme="holiday"] *{scroll-behavior:auto;}}


/* Main workspace refinement — balanced density, readable controls and responsive welcome layout */
#main{background:var(--bg);isolation:isolate}
#chatViewport{width:100%;max-width:100%;margin-inline:auto}
#messages{scroll-padding-block:24px}
.welcome{min-height:100%;padding:clamp(24px,5vh,64px) clamp(18px,4vw,48px)}
.welcome-inner{width:min(100%,600px);padding:clamp(18px,3vw,32px);border:1px solid color-mix(in srgb,var(--border) 70%,transparent);border-radius:24px;background:color-mix(in srgb,var(--bg2) 52%,transparent);box-shadow:0 18px 55px #00000008}
.welcome p{max-width:48ch;margin-inline:auto}
#chatList{scrollbar-gutter:stable;overscroll-behavior:contain}
.chat-item{min-height:48px;transition:background-color .16s ease,transform .16s ease}
.chat-item:active{transform:scale(.992)}
.chat-title{overflow:hidden;text-overflow:ellipsis}
#chatModelName{display:inline-flex;align-items:center;gap:8px}
#chatModelName span{margin-left:2px;opacity:.72}
@media(max-width:720px){.welcome{padding:18px 12px}.welcome-inner{padding:22px 16px;border-radius:18px;box-shadow:none}#messages{padding-block:10px}.chat-item{min-height:46px}}
@media(prefers-reduced-motion:reduce){.chat-item{transition:none}}

/* Beta-only custom accent sliders */
.accent-custom-controls{display:grid;gap:calc(13px * var(--ui-scale,1));padding:calc(12px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1)) calc(14px * var(--ui-scale,1));margin:calc(6px * var(--ui-scale,1)) 0 calc(12px * var(--ui-scale,1));border:1px solid var(--border);border-radius:calc(12px * var(--ui-scale,1));background:var(--bg2)}
#accentCustomControls[hidden]{display:none!important}
.accent-slider-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:calc(7px * var(--ui-scale,1)) calc(12px * var(--ui-scale,1));min-width:0}
.accent-slider-row label{font-size:calc(12px * var(--ui-scale,1));font-weight:600;color:var(--fg2)}
.accent-slider-row output{font-size:calc(12px * var(--ui-scale,1));font-variant-numeric:tabular-nums;color:var(--fg);min-width:calc(38px * var(--ui-scale,1));text-align:right}
.accent-slider-row input[type=range]{grid-column:1/-1;width:100%;height:calc(26px * var(--ui-scale,1));margin:0;accent-color:var(--accent);cursor:pointer;touch-action:pan-y}
.accent-slider-row input[type=range]:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}
#accentHue{background:linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);border-radius:999px}
#accentCustomPreview{display:inline-block;width:calc(24px * var(--ui-scale,1));height:calc(24px * var(--ui-scale,1));border:2px solid var(--bg);outline:1px solid var(--border);border-radius:50%;flex-shrink:0}
.accent-custom-preview-row{display:flex;align-items:center;gap:calc(9px * var(--ui-scale,1));min-width:0;font-size:calc(12px * var(--ui-scale,1));color:var(--fg2)}
.accent-reset{margin-left:auto;min-height:calc(34px * var(--ui-scale,1));padding:calc(6px * var(--ui-scale,1)) calc(10px * var(--ui-scale,1));border:1px solid var(--border);border-radius:calc(8px * var(--ui-scale,1));color:var(--accent);font-size:calc(12px * var(--ui-scale,1));white-space:nowrap}
.accent-reset:hover{background:var(--hover)}
@media(max-width:420px){.accent-custom-controls{padding:10px}.accent-custom-preview-row{flex-wrap:wrap}}
