/* 云工作台在材质稿之上补的样式。材质稿本身（布局、玻璃面片、无 WebGL 时的静态光学回退）在
   liquid.css，原样未动；这里只有设计稿没有、或承载真实数据必须调整的部分：
   侧栏对话列表与账户栏、工具条随文案自适应、会话页（消息列 + 底部输入卡座位）、
   全球数据目录、弹层（菜单 / 登录 / 邀请 / 删除确认，均 CSS 自绘）、运营页。 */

/* 挤不进着色器的面片退回 liquid.css 里的静态面 */
.gpu .material.css-fallback::before{display:block}
:root:not(.gpu) #optics{display:none}

/* ---- 品牌色阶：黑白灰体系，控件只在强调处用近黑；背景保持纯白到浅灰 ---- */
:root{
  --brand:#1a1c1f;--brand-2:#3c4045;--brand-deep:#0c0e10;--brand-soft:#eceef0;--brand-wash:#f5f6f7;
}
[data-appearance="dark"]{
  --brand:#f2f3f4;--brand-2:#d6d8db;--brand-deep:#ffffff;--brand-soft:#26292d;--brand-wash:#15171a;
}

/* ---- 整幅侧栏：贴边通高，不再是浮起的圆角卡片 ---- */
.sidebar{left:0;top:0;bottom:0;width:var(--sidebar-width);padding:0 14px;border-radius:0}
.sidebar::before{border:0;border-right:1px solid var(--edge);border-radius:0}
:root:not([data-appearance="dark"]) .sidebar::before{background:#fff;box-shadow:none;border-right-color:#e1e4e7}
[data-appearance="dark"] .sidebar::before{border-right-color:#2c2f35}
[dir="rtl"] .sidebar::before{border-right:0;border-left:1px solid var(--edge)}

/* ---- 字号整体收紧一号 ---- */
.brand{height:58px;gap:8px;padding:11px 0 0 4px}
.brand img{width:26px;height:24px}
.brand b{font-size:17px;letter-spacing:-.7px}
.brand button{width:28px;height:28px;border-radius:9px;top:-1px}
.new{height:38px;border-radius:11px;margin:11px 0 18px;font-size:13.5px;line-height:20px}
.new svg{width:15px;height:15px}
.nav-label{height:26px;margin:0 2px;padding:0 5px;font-size:11px;line-height:16px}
.nav-label small{font-size:11px;line-height:16px;margin-left:5px}
.nav-label .down{width:11px;height:11px}
.nav-chat{height:34px;font-size:13.5px;line-height:20px;gap:9px;padding-left:20px;border-radius:9px}
.nav-chat svg{width:14px;height:14px}
.utilities{gap:2px;margin:auto -2px 14px}
.utilities button{height:34px;font-size:13px;line-height:20px;gap:9px;padding-left:11px;border-radius:9px}
.utilities hr{width:calc(100% - 22px);margin:6px auto}
.location{top:23px;left:22px;gap:11px;font-size:11.5px;line-height:16px}
.workspace{width:auto;height:30px;padding:0 12px;border-radius:15px;font-size:12.5px;line-height:18px;gap:6px}
.workspace svg{width:15px;height:15px}
.stage{top:max(100px,calc(50% - 158px))}
.emblem{width:52px;height:52px}
.emblem img{width:35px;height:32px}
h1{margin:14px 0 22px;font-size:30px;line-height:42px;letter-spacing:-.6px}
.composer{height:148px;padding:16px 18px}
.composer textarea{height:60px;font-size:15px;line-height:24px}
.toolbar{height:34px;gap:6px}
.toolbar button{height:34px;border-radius:17px;font-size:12.5px;line-height:18px;gap:6px}
.attachment,.send{width:34px}
.attachment .plus{width:15px;height:15px}
.permission{width:auto;margin-left:0}
.toolbar .permission{height:34px;gap:5px;font-size:12.5px;line-height:18px}
.permission svg.shield{width:15px;height:15px}
.model{width:auto;min-width:96px;margin-right:4px;font-size:12.5px;line-height:18px}

/* ---- 侧栏：任务列表（设计稿的侧栏不滚动，这里要装真实任务） ---- */
.tasks{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:2px;margin:8px 0 6px;padding:2px 1px 6px;
    scrollbar-width:thin;scrollbar-color:rgb(var(--ink) / 14%) transparent}
.nav-chat{display:flex;align-items:center;width:100%;cursor:pointer;text-align:left}
.nav-chat .title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}
.nav-chat .dot{flex:none;width:6px;height:6px;border-radius:50%;margin:0 6px}
.nav-chat .dot.running{background:var(--secondary);animation:pulse 1.3s ease-in-out infinite}
.nav-chat .dot.bad{background:#e5484d}
.list-hint{margin:4px 10px;font-size:12px;line-height:18px;color:var(--faint)}
.utilities button small{margin-left:auto;font-size:11px;line-height:16px;color:var(--faint)}
.utilities button.is-login svg{transform:scaleX(-1)}
.sidebar.is-compact :is(.list-hint,.nav-chat .dot,.utilities small){display:none}
.nav-label[aria-expanded="false"] .down{transform:rotate(-90deg)}
@keyframes pulse{50%{opacity:.2}}

/* ---- 工具条：档位随语言变化，定宽改为最小宽 ---- */
#attachment-name{display:inline-flex;align-items:center;gap:4px;max-width:calc(100% - 24px);top:63px;left:20px;font-size:11.5px}
#attachment-name:empty,#attachment-name:has(#attachment-text:empty){display:none}
#attachment-text{overflow:hidden;text-overflow:ellipsis}
#attachment-clear{width:18px;height:18px;flex:none;color:var(--faint)}
#attachment-clear:hover{color:var(--text)}
#attachment-clear svg{width:12px;height:12px}

/* ---- 会话页：消息列居中定宽，同一张输入卡吸附在底部座位 ---- */
:root{--canvas:#fff}                   /* 工作台统一白色底面 */
[data-appearance="dark"]{--canvas:#17191d}
.thread{position:absolute;inset:62px 0 0;display:flex;flex-direction:column;min-height:0}
.thread-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;
    background:var(--canvas);isolation:isolate;contain:paint}
.thread-scroll::-webkit-scrollbar{display:none}
.thread-inner{width:min(800px,calc(100% - 84px));margin:0 auto;padding:4px 0 16px;display:flex;flex-direction:column;gap:14px}
.turn{display:flex;flex-direction:column;gap:14px;flex-shrink:0;min-width:0}
.turn-user{display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.bubble{max-width:78%;padding:9px 13px;border-radius:18px 18px 6px 18px;background:rgb(var(--ink) / 6%);
    font-size:13.5px;line-height:22px;white-space:pre-wrap;word-break:break-word}
.turn-meta{padding-right:4px;font-size:11px;line-height:16px;color:var(--faint)}
.turn-agent{display:grid;grid-template-columns:minmax(0,1fr);align-items:start}
.turn-agent .avatar{width:30px;height:27px;object-fit:contain;filter:url(#bird-ink);margin-top:2px;user-select:none;-webkit-user-drag:none}
[data-appearance="dark"] .turn-agent .avatar{filter:invert(1)}
.agent-body{display:flex;flex-direction:column;gap:9px;min-width:0}
.process{height:30px;width:100%;justify-content:flex-start;gap:6px;border-bottom:.5px solid var(--edge);
    color:var(--secondary);font-size:12.5px;font-weight:500;line-height:20px;text-align:left}
.process svg{width:13px;height:13px;flex:none;transform:rotate(-90deg);transition:transform .15s}
.process[aria-expanded="true"] svg{transform:rotate(0)}
.process .pdot{display:none;width:7px;height:7px;border-radius:50%;background:#646a73;flex:none}
.process.live .pdot{display:block;animation:pulse 1.3s ease-in-out infinite}
.steps{border-radius:14px;padding:10px 12px;background:#25262a;color:#fff;max-height:400px;overflow:auto;
    font:12px/1.6 ui-monospace,"SF Mono",Consolas,"Courier New",monospace;white-space:pre-wrap;word-break:break-all}
[data-appearance="dark"] .steps{background:#0d0f12}
.step+.step{margin-top:9px;padding-top:9px;border-top:1px solid rgb(255 255 255 / 9%)}
.step .rc{color:rgb(255 255 255 / 46%)}
.step.deny .cmd{color:#ffb3b5}
.step.web .tag{color:rgb(255 255 255 / 62%)}
.step.web .cmd{color:rgb(255 255 255 / 88%);word-break:break-all}
.step pre{margin:3px 0 0;font:inherit;color:rgb(255 255 255 / 74%);white-space:pre-wrap;word-break:break-all}
.answer{font-size:13.5px;line-height:22px;white-space:pre-wrap;word-break:break-word}
.status{display:flex;align-items:center;gap:8px;font-size:13px;line-height:20px;color:var(--secondary)}
.status .dot{flex:none;width:7px;height:7px;border-radius:50%;background:currentColor}
.status.live .dot{animation:pulse 1.3s ease-in-out infinite}
.status:is(.failed,.expired){color:#d0343a}
.status.canceled,.status.expired{color:var(--muted)}
.artifacts-block{display:flex;flex-direction:column;gap:8px}
.block-label{font-size:11px;line-height:16px;color:var(--muted)}
.artifacts{display:flex;flex-wrap:wrap;gap:7px}
.artifact{height:32px;padding:0 12px;border-radius:16px;display:inline-flex;align-items:center;gap:7px;
    font-size:12.5px;font-weight:500;color:var(--text);text-decoration:none;
    background:rgb(255 255 255 / 72%);border:1px solid #fff;
    box-shadow:inset -1px -1px 0 rgb(var(--ink) / 5%),0 1px 4px rgb(0 0 0 / 7%);
    -webkit-backdrop-filter:blur(16px) saturate(1.5);backdrop-filter:blur(16px) saturate(1.5)}
[data-appearance="dark"] .artifact{background:rgb(60 64 72 / 72%);border-color:rgb(255 255 255 / 10%)}
.artifact svg{width:14px;height:14px}
.artifact:hover{background:rgb(255 255 255 / 98%)}
[data-appearance="dark"] .artifact:hover{background:rgb(74 78 88 / 82%)}

/* 输入卡的底部座位：座位本身透明，渐变只做在上方那一条 */
.composer-seat{position:relative;flex:none;z-index:2;padding:8px 0 12px}
.composer-seat::before{content:"";position:absolute;left:0;right:0;top:-36px;height:46px;pointer-events:none;
    background:linear-gradient(180deg,transparent 0,var(--canvas) 36px)}
.composer-seat .composer{width:min(800px,calc(100% - 84px));height:auto;min-height:0;margin:0 auto;padding:12px 16px 14px}
.composer-seat .composer textarea{height:52px;min-height:0}
.composer-seat #attachment-name{top:52px;left:20px}
.composer-seat .send.is-stop{color:var(--text)}
@media(max-width:600px){
    .thread{inset:56px 0 0}
    .thread-inner,.composer-seat .composer{width:calc(100% - 20px)}
    .bubble{max-width:92%}
    h1{font-size:26px;line-height:36px}
    .stage{top:max(92px,calc(50% - 190px))}
    .composer{height:190px;padding:12px}
    .toolbar{height:auto;min-height:76px;flex-wrap:wrap;align-content:end}
}

/* ---- 弹层（菜单、登录、邀请、删除确认）与提示条：一律 CSS 自绘 ---- */
.popover{position:fixed;z-index:50;min-width:176px;max-width:min(300px,calc(100vw - 20px));padding:5px;border-radius:18px;
    display:flex;flex-direction:column;gap:2px;
    background:rgb(255 255 255 / 84%);border:1px solid #fff;
    box-shadow:inset -1px -1px 0 rgb(var(--ink) / 5%),0 16px 44px rgb(0 0 0 / 15%),0 2px 8px rgb(0 0 0 / 6%);
    -webkit-backdrop-filter:blur(28px) saturate(1.7);backdrop-filter:blur(28px) saturate(1.7);
    animation:pop .16s cubic-bezier(.2,.8,.3,1)}
.popover button{height:32px;border-radius:12px;padding:0 8px 0 9px;justify-content:flex-start;font-size:12.5px;font-weight:500;color:var(--secondary)}
.popover button:hover{background:rgb(var(--ink) / 6%)}
.popover button.on{color:var(--text);background:rgb(var(--ink) / 5%)}
.popover button svg{width:14px;height:14px;visibility:hidden}
.popover button.on svg{visibility:visible}
.popover .sep{height:1px;margin:5px 8px;background:var(--edge)}
.popover .empty{padding:7px 11px;font-size:12px;color:var(--faint)}
@keyframes pop{from{opacity:0;transform:scale(.96)}}

.modal{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:16px;
    background:rgb(var(--ink) / 10%);
    -webkit-backdrop-filter:blur(16px) saturate(1.15);backdrop-filter:blur(16px) saturate(1.15)}
.dialog{width:min(100%,360px);border-radius:24px;padding:20px 20px 14px;display:flex;flex-direction:column;gap:11px;
    background:rgb(255 255 255 / 86%);border:1px solid #fff;
    box-shadow:inset -1px -1px 0 rgb(var(--ink) / 5%),0 28px 70px rgb(0 0 0 / 16%),0 2px 8px rgb(0 0 0 / 6%);
    -webkit-backdrop-filter:blur(34px) saturate(1.7);backdrop-filter:blur(34px) saturate(1.7);
    animation:pop .2s cubic-bezier(.2,.8,.3,1)}
.dialog-head{display:flex;align-items:center;gap:10px;padding:0 2px 2px}
.dialog-head img{width:27px;height:25px;object-fit:contain;filter:url(#bird-ink);user-select:none;-webkit-user-drag:none}
.dialog-head h2{margin:0;font-size:18px;font-weight:700;letter-spacing:-.5px;line-height:24px}
.dialog-close{margin-left:auto;width:30px;height:30px;border-radius:15px;color:var(--muted)}
.dialog-close:hover{color:var(--text);background:rgb(var(--ink) / 8%)}
.dialog-close svg{width:15px;height:15px}
.segments{display:flex;gap:3px;height:36px;padding:3px;border-radius:18px;background:rgb(var(--ink) / 6%)}
.segment{flex:1;height:30px;border-radius:15px;font-size:12.5px;font-weight:500;color:var(--muted)}
.segment.on{background:rgb(255 255 255 / 94%);color:var(--text);box-shadow:0 1px 3px rgb(0 0 0 / 9%)}
.dialog input{height:42px;width:100%;border:0;border-radius:13px;padding:0 13px;font:inherit;font-size:15px;font-weight:500;
    color:var(--text);background:rgb(var(--ink) / 5%);outline:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.dialog input::placeholder{color:var(--faint);opacity:1}
.dialog input:focus-visible{outline:2px solid var(--focus-edge);outline-offset:-1px}
.code-row{display:flex;gap:8px}
.code-row input{flex:1;min-width:0}
.ghost-btn{flex:none;padding:0 13px;border-radius:13px;font-size:12.5px;font-weight:500;color:var(--secondary);background:rgb(var(--ink) / 5%)}
.ghost-btn:disabled{color:var(--faint)}
.primary-btn{height:42px;border-radius:14px;background:linear-gradient(180deg,var(--brand-2),var(--brand));color:#fff;font-size:15px;font-weight:500;box-shadow:0 2px 8px rgb(26 28 32 / 28%)}
.primary-btn:disabled{opacity:.6}
.dialog-msg{margin:0;min-height:17px;font-size:12.5px;line-height:17px;color:#d0343a}
[data-appearance="dark"] :is(.popover,.dialog){background:rgb(39 42 48 / 88%);border-color:rgb(255 255 255 / 10%)}
[data-appearance="dark"] .segment.on{background:rgb(255 255 255 / 14%)}
[data-appearance="dark"] .dialog-head img{filter:invert(1)}
[data-appearance="dark"] .primary-btn{background:linear-gradient(180deg,var(--brand-2),var(--brand));color:#fff;box-shadow:0 3px 12px rgb(0 0 0 / 30%)}

.toast{position:fixed;left:50%;bottom:26px;z-index:70;transform:translateX(-50%);max-width:min(84vw,540px);padding:10px 16px;border-radius:16px;
    font-size:13px;line-height:19px;color:#fff;background:rgb(37 38 42 / 93%);
    -webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 10px 30px rgb(0 0 0 / 18%);
    animation:pop .18s cubic-bezier(.2,.8,.3,1)}
.toast.error{background:rgb(190 32 38 / 94%)}

/* ---- 从右往左的语言（阿拉伯语）：镜像左右 ---- */
[dir="rtl"] .sidebar{left:auto;right:0}
[dir="rtl"] main{inset:0 var(--side) 0 0}
[dir="rtl"] .location{left:auto;right:22px}
[dir="rtl"] .nav-chat{padding-left:10px;padding-right:20px}
[dir="rtl"] .bubble{border-radius:18px 18px 18px 6px}
[dir="rtl"] .turn-user{align-items:flex-start}
[dir="rtl"] .turn-meta{padding-right:0;padding-left:4px}

/* ---- 运营页：模型配置（无画布，直接用静态面） ---- */
.sheet-page{position:fixed;inset:0;overflow-y:auto;padding:22px}
.sheet-top{display:flex;align-items:center;gap:10px;height:40px;margin-bottom:18px}
.sheet-top img{width:30px;height:28px;object-fit:contain;filter:url(#bird-ink)}
.sheet-top b{font-size:20px;font-weight:700;letter-spacing:-.6px}
.sheet-top a{margin-left:auto;font-size:14px;font-weight:500;color:var(--secondary);text-decoration:none}
.sheet-top button{height:34px;padding:0 14px;border-radius:17px;font-size:14px;font-weight:500;color:var(--secondary)}
.sheet{max-width:920px;margin:0 auto 16px;padding:22px 24px;border-radius:22px;border:1px solid #dfe2e5;background:#fff;
    box-shadow:inset 1px 1px 0 #fff,inset -1px -1px 0 #272a3206}
.sheet h2{margin:0 0 6px;font-size:17px;font-weight:700;letter-spacing:-.3px}
.sheet p{margin:0 0 14px;font-size:13px;line-height:20px;color:var(--muted)}
.sheet table{width:100%;border-collapse:collapse}
.sheet :is(th,td){padding:10px 8px;text-align:left;font-size:14px;line-height:22px;border-bottom:1px solid var(--edge)}
.sheet th{font-weight:500;color:var(--muted)}
.sheet td:last-child,.sheet th:last-child{text-align:right}
.sheet .edit-btn{height:30px;padding:0 12px;border-radius:15px;font-size:13px;font-weight:500;color:var(--secondary);background:rgb(var(--ink) / 5%)}
.sheet .add-btn{height:40px;margin-top:16px;padding:0 18px;border-radius:13px;font-size:15px;font-weight:500;color:#fff;background:linear-gradient(180deg,var(--brand-2),var(--brand));box-shadow:0 2px 8px rgb(26 28 32 / 26%)}
.fields{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px;margin-top:14px}
.field{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--secondary)}
.field :is(input,select){height:42px;padding:0 12px;border:0;border-radius:12px;font:inherit;font-size:15px;color:var(--text);background:rgb(var(--ink) / 5%);outline:none}
.field :is(input,select):focus-visible{outline:2px solid var(--focus-edge);outline-offset:-1px}
.field .check{flex-direction:row;align-items:center;gap:8px}
.field .check input{width:18px;height:18px;accent-color:#25262a}
.form-actions{display:flex;align-items:center;gap:8px;margin-top:18px}
.form-actions .add-btn{margin-top:0}
.form-actions .danger{color:#d0343a}
.sheet .dialog-msg{margin-top:10px}
[data-appearance="dark"] .sheet{background:#1b1d21;border-color:#2c2f35;box-shadow:none}
[data-appearance="dark"] .sheet-top img{filter:invert(1)}
@media(max-width:640px){.fields{grid-template-columns:1fr}.sheet{padding:18px 16px}}

/* ============================================================
   WorkBuddy design language — 品牌视觉层
   中性墨色 + 透明度分级文字；颜色只出现在语义状态与品牌标记上。
   ============================================================ */

/* 首页标题：大字号 + 中性墨色，克制而专业 */
.stage h1{margin:14px 0 16px;font-size:38px;line-height:1.18;letter-spacing:-1.5px;font-weight:700;
  color:var(--text)}
.stage{top:max(92px,calc(50% - 176px))}

/* 入场动效：只对非材质元素做位移动画（避免与弹簧引擎的 transform 冲突） */
@keyframes wb-rise{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}
.stage h1{animation:wb-rise .55s cubic-bezier(.2,.7,.2,1) both}
@media(prefers-reduced-motion:reduce){.stage h1{animation:none}}

/* —— 品牌名：BOLI boli —— */
.brand .brand-name{font-size:17px;font-weight:700;letter-spacing:.4px;color:var(--text);white-space:nowrap}
.brand .brand-name span{font-weight:500;letter-spacing:-.3px;color:var(--brand-deep)}
[data-appearance="dark"] .brand .brand-name span{color:#f2f3f4}
.brand{position:relative}

/* 新建对话按钮 */
.new svg{stroke-width:2}

/* —— 选中对话行：墨色强调条 —— */
.nav-chat.is-active{color:var(--brand-deep);position:relative}
[data-appearance="dark"] .nav-chat.is-active{color:#f2f3f4}
.nav-chat.is-active::after{content:"";position:absolute;left:2px;top:50%;transform:translateY(-50%);width:3px;height:16px;border-radius:2px;background:var(--brand);z-index:1}
.nav-chat.is-active .dot.running{background:var(--brand)}

/* —— 发送按钮：可用时白色图标 —— */
button.send:not(:disabled){color:#fff!important}
.composer-seat .send.is-stop{color:#fff!important}

/* —— 语义色：错误用红，成功用绿 —— */
.status.failed,.status.expired{color:#d0483b}
[data-appearance="dark"] .status.failed,[data-appearance="dark"] .status.expired{color:#f08484}
.status:not(.failed):not(.expired):not(.canceled) .dot{color:#646a73}

/* —— 链接色向品牌色靠拢 —— */
.sheet-top a{color:var(--brand-deep)}
[data-appearance="dark"] .sheet-top a{color:#f2f3f4}

/* ============================================================
   侧栏信息架构：新建任务 + 主导航组（全球数据 / 语言）+ 对话 + 底部用户栏
   ============================================================ */
.sidebar{padding:0 14px}

/* 品牌头：略收紧 */
.brand{height:52px;padding:9px 0 0 4px;gap:9px}
.brand b{font-size:16px}

/* 新建任务 */
.new{margin:6px 0 14px;height:40px;justify-content:flex-start;padding:0 13px;gap:9px;font-size:14px}
.new .plus{width:17px;height:17px}
[data-appearance="dark"] .new{color:#fff}

/* 主导航组 */
.side-nav{display:flex;flex-direction:column;gap:2px;margin:0 -3px}
.side-item{position:relative;width:100%;height:38px;justify-content:flex-start;gap:11px;
  padding:0 11px;border-radius:9px;font-size:13.5px;font-weight:500;line-height:20px;color:var(--secondary);
  transition:background .16s ease,color .16s ease}
.side-item svg{width:18px;height:18px;flex:none;color:var(--muted)}
.side-item .chev{width:12px;height:12px;margin-left:auto;color:var(--faint);transform:rotate(-90deg)}
.side-item small{margin-left:auto;font-size:11px;color:var(--faint)}
.side-item:hover{background:rgb(var(--ink) / 6%);color:var(--text)}
.side-item:hover svg{color:var(--brand)}
.side-item:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
.side-item:active{background:rgb(var(--ink) / 9%)}
.side-item.is-active{background:rgb(var(--ink) / 8%);color:var(--text)}
.side-item.is-active svg{color:var(--text)}
[data-appearance="dark"] .side-item:hover{background:rgb(255 255 255 / 7%)}
[data-appearance="dark"] .side-item.is-active{background:rgb(255 255 255 / 10%);color:#f2f3f4}

/* 分隔线 */
.side-sep{height:1px;margin:12px 3px 10px;background:var(--edge);opacity:.75}

/* 对话分组标题微调 */
.nav-label{height:26px;margin:0 3px 2px}
.tasks{margin:2px 0 8px}
.nav-chat{gap:10px;padding-left:8px}
.nav-chat .list-hint{color:var(--faint)}

/* 对话行：置顶标记与置顶/删除操作（悬浮或聚焦时出现） */
.nav-chat .pin-flag{display:none;width:12px;height:12px;margin-left:auto;flex:none;color:var(--brand-deep)}
.nav-chat.is-pinned .pin-flag{display:inline-flex}
.nav-chat .row-actions{display:none;align-items:center;gap:1px;margin-left:auto;flex:none}
.nav-chat:hover .row-actions,.nav-chat:focus-within .row-actions{display:flex}
.nav-chat:hover .dot,.nav-chat:focus-within .dot{display:none}
.nav-chat:hover .pin-flag,.nav-chat:focus-within .pin-flag{display:none}
.nav-chat:focus-visible{outline:2px solid var(--focus-edge);outline-offset:1px}
.row-act{width:24px;height:24px;border-radius:7px;color:var(--faint)}
.row-act:hover{background:rgb(var(--ink) / 8%);color:var(--text)}
.row-act.del:hover{color:#d0343a;background:rgb(208 52 58 / 9%)}
.row-act svg{width:13px;height:13px}
@media(hover:none){
  .nav-chat .row-actions{display:flex}
  .nav-chat .dot,.nav-chat .pin-flag{display:none}
}
[data-appearance="dark"] .row-act:hover{background:rgb(255 255 255 / 10%)}
[data-appearance="dark"] .row-act.del:hover{color:#f08484;background:rgb(240 132 132 / 10%)}
.sidebar.is-compact .row-actions{display:none!important}

/* 底部用户栏 */
.user-bar{display:flex;align-items:center;gap:10px;margin:auto -3px 12px;padding:8px 8px 4px;border-radius:12px;
  border-top:1px solid var(--edge)}
.user-avatar{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:#fff;
  background:linear-gradient(145deg,var(--brand-2),var(--brand-deep));box-shadow:0 2px 8px rgb(26 28 32 / 28%)}
.user-avatar svg{width:20px;height:20px}
.user-meta{display:flex;flex-direction:column;gap:1px;min-width:0;line-height:1.25}
.user-meta b{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}
.user-meta small{font-size:11px;color:var(--faint)}
.user-more{flex:none;width:28px;height:32px;margin-inline-start:auto;border-radius:8px;color:var(--faint)}
.user-more:hover,.user-more[aria-expanded="true"]{background:rgb(var(--ink) / 6%);color:var(--text)}
.user-more svg{width:18px;height:18px}
.sidebar.is-compact .user-more{margin-inline:0}

/* 收起态：隐藏新组件内的文字，保留图标 */
.sidebar.is-compact .user-meta,
.sidebar.is-compact .side-item .chev,.sidebar.is-compact .side-item small,
.sidebar.is-compact .side-item span{display:none}
.sidebar.is-compact .new{justify-content:center;padding:0}
.sidebar.is-compact .side-item{justify-content:center;padding:0;margin-inline:0}
.sidebar.is-compact .side-item svg{width:19px;height:19px}
.sidebar.is-compact .user-bar{padding-inline:0;flex-direction:column;gap:8px;margin-inline:0}
.sidebar.is-compact .side-sep{margin-inline:0}

/* RTL（阿拉伯语）：新组件镜像 */
[dir="rtl"] .side-item .chev{margin-left:0;margin-right:auto;transform:rotate(90deg)}
[dir="rtl"] .side-item small{margin-left:0;margin-right:auto}

@media(max-width:600px){
  .stage{top:max(88px,calc(50% - 150px))}
  .stage h1{font-size:29px;letter-spacing:-1px}
}

/* ============================================================
   体验打磨层：首屏字阶、文字对比度、附件排布、侧栏层级与移动端覆盖
   ============================================================ */
 :root{--sidebar-width:210px;--side:var(--sidebar-width);--muted:rgb(var(--ink) / 66%);--faint:rgb(var(--ink) / 54%)}
:root[data-appearance="dark"]{--muted:rgb(var(--ink) / 66%);--faint:rgb(var(--ink) / 56%)}

/* 首屏：中文不追欧文 tighter 字距，标题给字留呼吸 */
.stage h1{margin:8px 0 20px;font-size:34px;line-height:1.28;letter-spacing:-.6px}
.stage{top:max(84px,calc(50% - 168px))}
@media(max-width:600px){.stage h1{font-size:27px;letter-spacing:-.4px}.stage{top:max(76px,calc(50% - 158px))}}

/* 附件名回到文档流：原先的 absolute 会压住输入框末行 */
.composer{row-gap:6px}
/* 首页输入卡也是自适应的：加了附件行让它长高，而不是把内容挤出卡片 */
.stage .composer{height:auto;min-height:156px}
@media(max-width:600px){.stage .composer{min-height:190px}}
.composer #attachment-name,.composer-seat #attachment-name{position:static;top:auto;left:auto;
  align-self:flex-start;max-width:100%;margin-top:2px;font-size:11.5px;line-height:16px}

/* 侧栏行：悬浮与选中要看得见，别只靠一条竖条 */
.nav-chat:not(.is-active){color:var(--secondary)}
.nav-chat:hover{background:rgb(var(--ink) / 5%);color:var(--text)}
.nav-chat.is-active{background:rgb(26 28 32 / 9%)}
[data-appearance="dark"] .nav-chat.is-active{background:rgb(255 255 255 / 10%)}
.nav-chat.is-active::after{left:0;height:18px}
.nav-chat.is-pinned:not(.is-active){background:rgb(var(--ink) / 3%)}

/* 回答正文：长段落控制在易读行宽内 */
.answer .summary{max-width:70ch}

/* 键盘焦点：链接、标签页、产物芯片、数据源都要看得见 */
:where(a,button,input,select,[tabindex]):focus-visible{outline:2px solid var(--focus-edge);outline-offset:3px}
.dialog input:focus-visible,.field :is(input,select):focus-visible{outline-offset:-1px}

/* 侧栏遮罩：窄屏展开侧栏时盖住主区，点击即收起 */
@keyframes wb-fade{from{opacity:0}}
.sidebar-scrim{position:fixed;inset:0;z-index:2;background:rgb(16 22 38 / 26%);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:wb-fade .16s ease-out}
@media(max-width:720px){
  main,[dir="rtl"] main{left:62px;right:0}
  .sidebar:not(.is-compact){z-index:3;box-shadow:12px 0 40px rgb(15 23 42 / 18%)}
  [dir="rtl"] .sidebar:not(.is-compact){box-shadow:-12px 0 40px rgb(15 23 42 / 18%)}
}

/* ============================================================
   整体精修：在材质稿之上统一节奏、层级与反馈
   ============================================================ */

/* 基础质感 */
html{-webkit-text-size-adjust:100%}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
::selection{background:rgb(26 28 32 / 18%);color:var(--text)}
.turn-meta,.status,.block-label,.list-hint{font-variant-numeric:tabular-nums}

/* —— 侧栏：更紧的骨架，更清楚的主操作 —— */
.sidebar{padding:0 12px}
.brand{height:56px;padding:10px 0 0 6px}
.brand-name{font-size:17.5px}
.brand button{width:30px;height:30px;border-radius:9px;color:var(--muted);transition:background .15s,color .15s}
.brand button:hover{background:rgb(var(--ink) / 6%);color:var(--text)}
/* 新建对话与主导航同形：一个安静的入口 */
.new{height:38px;margin:6px -3px 3px;padding:0 11px;border-radius:10px;justify-content:flex-start;gap:11px;
  background:none;box-shadow:none;color:var(--secondary);font-size:13.5px;font-weight:500;line-height:20px;
  letter-spacing:0;transition:background .16s,color .16s}
.new .plus{width:18px;height:18px}
.new svg{color:var(--muted)}
.new span{color:var(--text)}
.new:hover{background:rgb(var(--ink) / 6%);color:var(--text)}
.new:hover svg{color:var(--brand)}
[data-appearance="dark"] .new{color:var(--secondary)}
[data-appearance="dark"] .new:hover{background:rgb(255 255 255 / 7%);color:var(--text)}
:root:not(.gpu) .new{box-shadow:none}

/* —— 图标统一为单色线稿 —— */
#newtask svg,#marketBtn>svg,#langBtn>svg{color:var(--muted)}
#newtask:hover svg,#marketBtn:hover>svg,#langBtn:hover>svg{color:var(--text)}
.side-nav{gap:3px}
.side-item{height:38px;border-radius:10px}
.nav-label{margin-top:2px;letter-spacing:.02em}
.tasks{gap:1px;margin:4px 0 8px;padding:2px 2px 8px}
/* Fade history into the account area; keep the final row scrollable above the fade. */
.tasks{
  padding-bottom:56px;scroll-padding-bottom:56px;
  -webkit-mask-image:linear-gradient(to bottom,#000 0,#000 calc(100% - 48px),transparent 100%);
  mask-image:linear-gradient(to bottom,#000 0,#000 calc(100% - 48px),transparent 100%);
}
.tasks::-webkit-scrollbar{width:6px}
.tasks::-webkit-scrollbar-thumb{background:rgb(var(--ink) / 14%);border-radius:3px}
.nav-chat{height:36px;border-radius:10px}
.nav-chat.is-active{box-shadow:inset 0 0 0 1px rgb(26 28 32 / 10%)}
.nav-chat.is-active::after{left:-1px;width:2.5px;height:20px}
.list-hint{margin:8px 12px;line-height:1.6}
.user-bar{margin:auto -2px 10px;padding:10px 8px 6px;gap:11px}
.sidebar .user-bar{flex-shrink:0;z-index:2}
.user-bar::before{
  content:"";position:absolute;inset:-56px 2px auto;height:48px;pointer-events:none;
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  -webkit-mask-image:linear-gradient(to bottom,transparent,#000);
  mask-image:linear-gradient(to bottom,transparent,#000);
}
.user-avatar{width:36px;height:36px;overflow:hidden;background-size:cover;background-position:center;
  background-image:linear-gradient(145deg,#3c4045,#0c0e10);box-shadow:0 2px 10px rgb(16 18 22 / 24%);
  transition:box-shadow .15s,filter .15s}
.user-avatar:hover{filter:brightness(1.04);box-shadow:0 4px 14px rgb(16 18 22 / 30%)}
.user-avatar:focus-visible{outline:2px solid var(--focus-edge);outline-offset:3px}
.user-avatar.has-image{background-image:var(--avatar);color:transparent}
.user-avatar.has-image svg{display:none}
.user-meta b{font-size:13px}
.user-meta small{font-size:11.5px}

/* —— 首屏：标题只做平衡不断行，不加彩色光晕 —— */
.stage{isolation:isolate}
.stage h1{max-width:100%;text-align:center;text-wrap:balance;font-size:clamp(25.2px,2.7vw,31.5px);line-height:1.26;
  letter-spacing:-.5px;margin:6px 0 22px}
.composer{height:156px;padding:18px 18px 16px}
.composer textarea{height:66px;font-size:15.5px;line-height:25px;padding:2px 4px}
.toolbar{height:36px;gap:7px}
.toolbar button{height:36px;border-radius:18px}
.attachment,.send{width:36px}
.toolbar .model:not(:disabled):hover{background:rgb(var(--ink) / 6%);color:var(--text)}
.toolbar .model:disabled{color:var(--faint)}
/* 无 WebGL 时发送键还是银色回退面：可用态给它主色，白图标才看得见 */
:root:not(.gpu) button.send:enabled::before{
  background:linear-gradient(180deg,var(--brand-2),var(--brand-deep));
  border-color:#fff #d7dadd #0c0e10 #f2f3f4;
  box-shadow:inset 1px 1px 0 #ffffff59,0 2px 8px rgb(26 28 32 / 26%)}

/* —— 会话：给消息列一点呼吸 —— */
.thread-inner{gap:22px;padding:10px 0 24px}
.turn{gap:16px}
.turn-user{gap:7px}
.bubble{max-width:76%;padding:10px 14px;border-radius:19px 19px 7px 19px;
  background:rgb(var(--ink) / 6.5%);font-size:14px;line-height:23px}
.turn-meta{padding-right:6px;font-size:11.5px}
.turn-agent{grid-template-columns:minmax(0,1fr)}
.turn-agent .avatar{width:32px;height:29px;margin-top:1px}
.agent-body{gap:10px}
.process{height:32px;padding:0 2px;border-bottom-color:rgb(var(--ink) / 10%);border-radius:8px 8px 0 0;
  transition:background .15s,color .15s}
.process:hover{background:rgb(var(--ink) / 4%);color:var(--text)}
.steps{background:#141619;border:1px solid rgb(255 255 255 / 8%);border-radius:14px;
  padding:12px 14px;max-height:420px;font:12px/1.65 ui-monospace,"SF Mono",Consolas,"Courier New",monospace}
.step+.step{margin-top:10px;padding-top:10px}
.answer{font-size:14px;line-height:23px}
.status{gap:9px;font-size:13px}
.status .dot{width:8px;height:8px}
.artifacts{gap:8px}
.artifact{height:34px;padding:0 13px;border-radius:17px;font-size:13px;transition:background .15s,box-shadow .15s}
.artifact:active{box-shadow:inset -1px -1px 0 rgb(var(--ink) / 5%),0 0 0 rgb(0 0 0 / 0%)}
.composer-seat{padding:10px 0 14px}

/* —— 弹层与提示：统一半径、阴影和按钮节奏 —— */
.popover{min-width:190px;padding:6px;border-radius:16px;gap:1px;
  box-shadow:inset -1px -1px 0 rgb(var(--ink) / 5%),0 18px 50px rgb(9 18 38 / 18%),0 2px 8px rgb(0 0 0 / 6%)}
.popover button{height:34px;border-radius:10px;font-size:13px}
.popover .sep{margin:6px 9px}
.dialog{width:min(100%,380px);padding:22px 22px 16px;border-radius:24px;gap:12px}
.dialog-head{padding:0 2px 4px}
.dialog-head h2{font-size:19px}
.dialog-close{width:32px;height:32px;border-radius:16px}
.segments{height:38px;border-radius:19px}
.segment{height:32px;border-radius:16px;font-size:13px}
.dialog input{height:44px;border-radius:13px}
.ghost-btn{height:44px;border-radius:13px;color:var(--brand-deep);font-weight:600;
  transition:background .15s,color .15s}
.ghost-btn:hover:not(:disabled){background:rgb(26 28 32 / 10%);color:var(--brand-deep)}
[data-appearance="dark"] .ghost-btn{color:#f2f3f4}
[data-appearance="dark"] .ghost-btn:hover:not(:disabled){background:rgb(120 124 130 / 14%)}
.primary-btn{height:44px;border-radius:14px;font-size:15px;font-weight:600;
  background:linear-gradient(180deg,#3c4045,var(--brand-deep));
  transition:filter .15s,box-shadow .15s}
.primary-btn:hover:not(:disabled){filter:brightness(1.06);box-shadow:0 4px 14px rgb(26 28 32 / 32%)}
.dialog-msg{font-size:13px;line-height:18px}
.toast{max-width:min(84vw,560px);padding:11px 16px;border-radius:14px;font-size:13.5px;
  border:1px solid rgb(255 255 255 / 12%);box-shadow:0 12px 34px rgb(12 20 38 / 22%)}

/* —— 暗色：只用同一套节奏，不另起一套视觉 —— */
[data-appearance="dark"] .bubble{background:rgb(255 255 255 / 8%)}
[data-appearance="dark"] .process{border-bottom-color:rgb(255 255 255 / 10%)}
[data-appearance="dark"] .process:hover{background:rgb(255 255 255 / 6%)}
[data-appearance="dark"] .steps{background:#0a0c0e;border-color:rgb(255 255 255 / 6%)}
[data-appearance="dark"] .primary-btn{background:linear-gradient(180deg,#ffffff,#d6d8db);color:#14161a;box-shadow:0 3px 12px rgb(0 0 0 / 30%)}
/* 暗色里发送键是浅面，图标要反过来 */
[data-appearance="dark"] button.send:not(:disabled){color:#14161a!important}
[data-appearance="dark"] .composer-seat .send.is-stop{color:#14161a!important}

/* —— 断点：平板收字号，手机换节奏，矮屏先保输入 —— */
@media(max-width:980px){
  .stage h1{font-size:clamp(23.4px,3.33vw,28.8px)}
}
@media(max-width:720px){
  .stage{top:max(76px,calc(50% - 170px))}
  .thread-inner,.composer-seat .composer{width:calc(100% - 28px)}
  .composer{height:168px}
}
@media(max-width:600px){
  .stage{top:max(72px,calc(50% - 176px))}
  .stage h1{font-size:23.4px;line-height:1.34;letter-spacing:-.3px;margin:6px 0 18px}
  :root:is([lang="en"],[lang="fr"]) .stage h1{font-size:20.7px;line-height:1.3;letter-spacing:-.4px}
  :root[lang="ar"] .stage h1{font-size:20.7px;line-height:1.5;letter-spacing:0}
  .composer{height:190px;padding:14px}
  .composer textarea{height:72px;font-size:16px;line-height:26px}
  .composer-seat .composer textarea{height:60px}
  .thread-inner,.composer-seat .composer{width:calc(100% - 20px)}
  .bubble{max-width:88%;font-size:13.5px}
  .dialog{padding:20px 18px 14px}
}
@media(max-height:520px){
  .stage{top:16px}
}

/* —— 侧栏：一层同色薄雾压住白面，和主区连成一片 —— */
.sidebar::after{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;border-radius:inherit;
  background:linear-gradient(180deg,rgb(224 231 233 / 44%) 0,rgb(231 236 238 / 38%) 56%,rgb(236 240 242 / 34%) 100%)}
.sidebar>*{position:relative;z-index:1}
.sidebar::before{border-right-color:rgb(26 28 32 / 10%)}
[data-appearance="dark"] .sidebar::after{background:linear-gradient(180deg,rgb(8 12 14 / 48%) 0,rgb(5 8 10 / 34%) 100%)}
[data-appearance="dark"] .sidebar::before{border-right-color:rgb(242 243 244 / 8%)}

/* ============================================================
   全球数据：数据源目录（全部待开放）
   ============================================================ */
/* Compact, searchable source library. */
.market{position:absolute;inset:0;overflow-y:auto;padding:32px 34px 56px;background:var(--bg,#fafbfc)}
.market-inner{max-width:1120px;margin:0 auto}
.market-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:26px}
.market-filters{display:flex;flex-wrap:wrap;gap:4px;padding:4px;border-radius:12px;background:rgb(var(--ink) / 4%)}
.market-filter{display:flex;align-items:center;gap:8px;min-height:36px;padding:0 13px;border:1px solid transparent;border-radius:9px;font-size:12px;font-weight:500;color:var(--muted);background:transparent;transition:background .15s,color .15s}
.market-filter:hover{color:var(--text)}
.market-filter.on{color:var(--text);background:#fff;border-color:rgb(var(--ink) / 6%);box-shadow:0 2px 4px rgb(16 30 24 / 4%)}
.filter-count{font-size:10px;font-variant-numeric:tabular-nums;opacity:.6}
.market-search{display:flex;align-items:center;gap:9px;flex:0 1 270px;min-width:160px;padding:0 12px;height:42px;background:rgb(var(--ink) / 2%);border:1px solid var(--edge);border-radius:11px;color:var(--muted)}
.market-search svg{width:17px;height:17px;flex:none}
.market-search input{width:100%;min-width:0;padding:0;border:0;border-radius:0;outline:none;background:transparent;box-shadow:none;color:var(--text);font:inherit;font-size:12px}
.market-search:focus-within{outline:2px solid #91969e;outline-offset:2px}
.market-results{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.market-results h2{margin:0;font-size:14px;font-weight:600;color:var(--text)}
.market-results>span{font-size:11px;color:var(--muted)}
.market-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.src-card{display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:12px;row-gap:5px;align-items:center;min-width:0;padding:13px 14px;border:1px solid var(--edge);border-radius:13px;background:#fff;transition:border-color .18s,box-shadow .18s,transform .18s}
.src-card:hover{border-color:#c9cdd3;box-shadow:0 6px 22px rgb(30 57 44 / 6%);transform:translateY(-2px)}
.src-top{grid-column:1;grid-row:1;align-self:start}
.src-mark{flex:none;width:36px;height:36px;border-radius:10px;display:grid;place-items:center;font-size:17px;font-weight:700;color:var(--mark,#3c4045);background:#f2f3f5}
.src-mark.wide{font-size:12px}
.src-category{display:none}
.src-info{grid-column:2;min-width:0;display:flex;flex-direction:column;gap:3px}
.src-info b{font-size:14px;font-weight:600;line-height:1.5;color:var(--text);overflow-wrap:anywhere}
.src-info small{font-size:11.5px;line-height:1.6;color:var(--muted)}
.src-foot{grid-column:2;display:flex;align-items:center;justify-content:space-between;min-height:24px}
.src-soon{display:flex;align-items:center;gap:6px;font-size:10px;line-height:20px;color:var(--muted)}
.src-soon::before{content:"";width:4px;height:4px;border-radius:50%;background:#aeb2b9}
.src-add{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:8px;border:0;background:transparent;color:var(--muted);transition:background .15s,color .15s}
.src-add:hover{background:rgb(var(--ink) / 6%);color:var(--text)}
.src-add svg{width:15px;height:15px}
.market :is(button,input):focus-visible{outline:2px solid #91969e;outline-offset:3px}
.market-note{margin:22px 0 0;font-size:11px;line-height:1.8;color:var(--muted)}
.market-empty{text-align:center;padding:60px 20px;border:1px dashed var(--edge);border-radius:17px;color:var(--secondary)}
.market-empty strong{font-size:15px}.market-empty p{font-size:12px;color:var(--muted)}
[data-appearance="dark"] .market-filter.on{background:#303238;border-color:#464950;color:var(--text)}
[data-appearance="dark"] .src-card{background:#222429;border-color:#363940}
[data-appearance="dark"] .src-card:hover{border-color:#626770}
[data-appearance="dark"] .src-mark{background:rgb(255 255 255 / 8%)}
@media(min-width:1450px){.market{padding-top:44px}}
@media(max-width:900px){.market-toolbar{align-items:stretch;flex-direction:column}.market-filters{align-self:flex-start}.market-search{flex:auto}}
@media(max-width:540px){.market{padding:20px 16px 32px}.market-grid{grid-template-columns:1fr;gap:12px}.market-filter{padding:0 10px}.market-toolbar{margin-bottom:22px}.src-card{padding:12px 14px;column-gap:12px;row-gap:4px}}
@media(prefers-reduced-motion:reduce){.src-card{transition:none}.src-card:hover{transform:none}}

/* ============================================================
   邀请好友（沿用主站邀请码）
   ============================================================ */
.invite-dialog{width:min(100%,440px);max-height:min(84vh,660px)}
.invite-body{display:flex;flex-direction:column;gap:12px;min-height:56px;overflow-y:auto}
.invite-loading,.invite-empty{font-size:13px;line-height:20px;color:var(--muted);padding:4px 2px}
.invite-error{font-size:12.5px;line-height:18px;color:#d0343a}
.invite-code-row{display:flex;align-items:center;gap:10px;padding:14px;border-radius:16px;background:rgb(var(--ink) / 4%)}
.invite-code{flex:1;min-width:0;font:600 24px/1.2 ui-monospace,"SF Mono",Consolas,monospace;letter-spacing:3px;
  color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.invite-code-empty{flex:1;font-size:13px;color:var(--muted)}
.invite-btn{height:34px;padding:0 12px;border-radius:10px;font-size:12.5px;font-weight:500;
  color:var(--text);background:#fff;border:1px solid var(--edge);transition:background .15s,color .15s}
.invite-btn:hover:not(:disabled){background:rgb(var(--ink) / 5%)}
.invite-btn:disabled{color:var(--faint)}
.invite-btn.solid{background:var(--text);color:#fff;border-color:var(--text)}
.invite-btn.solid:hover:not(:disabled){filter:brightness(1.06);background:var(--text)}
.invite-btn.solid.copied{background:#646a73;border-color:#646a73;color:#fff}
.invite-btn.solid.copied:hover:not(:disabled){background:#646a73}
.invite-hint{font-size:12px;line-height:17px;color:var(--muted)}
.invite-rule{padding:10px 12px;border-radius:12px;font-size:12.5px;line-height:19px;
  color:var(--secondary);background:rgb(var(--ink) / 4%)}
.invite-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.invite-stat{padding:10px 12px;border:1px solid var(--edge);border-radius:12px}
.invite-stat b{display:block;font-size:17px;line-height:24px;color:var(--text)}
.invite-stat span{font-size:11.5px;color:var(--faint)}
.invite-label{font-size:12px;font-weight:500;color:var(--muted)}
.invite-records{display:flex;flex-direction:column;max-height:190px;overflow-y:auto}
.invite-record{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 2px;
  border-bottom:1px solid var(--edge)}
.invite-record:last-child{border-bottom:0}
.invite-record-meta{display:flex;flex-direction:column;min-width:0}
.invite-record-name{font-size:12.5px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.invite-record-meta span:last-child{font-size:11px;color:var(--faint)}
.invite-record-side{flex:none;font-size:12px;color:var(--muted);text-align:right}
.invite-record-side b{margin-left:6px;color:#646a73}
[data-appearance="dark"] .invite-code-row,[data-appearance="dark"] .invite-rule{background:rgb(255 255 255 / 6%)}
[data-appearance="dark"] .invite-btn{background:rgb(38 41 47 / 82%);border-color:#2c2f35}
[data-appearance="dark"] .invite-btn.solid{background:#f2f3f4;color:#14161a;border-color:#f2f3f4}
[data-appearance="dark"] .invite-stat{border-color:#2c2f35}

/* ============================================================
   删除对话确认
   ============================================================ */
.confirm-dialog{width:min(100%,380px)}
.confirm-dialog h2{margin:2px 0 0;font-size:18px;font-weight:700;letter-spacing:-.4px;line-height:25px}
.confirm-text{margin:0;font-size:13.5px;line-height:21px;color:var(--secondary);word-break:break-word}
.confirm-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.confirm-actions .ghost-btn{background:rgb(var(--ink) / 5%)}
.primary-btn.danger{background:#d0343a;color:#fff;box-shadow:0 2px 8px rgb(208 52 58 / 26%)}
.primary-btn.danger:hover:not(:disabled){filter:brightness(1.06);box-shadow:0 4px 14px rgb(208 52 58 / 30%)}
[data-appearance="dark"] .primary-btn.danger{background:#d0343a;color:#fff}

/* 确认弹层：两个按钮同宽同高，靠内边距撑开，避免被按文字宽度压成胶囊 */
.confirm-actions{gap:10px}
.confirm-actions .ghost-btn,.confirm-actions .primary-btn{min-width:92px;height:44px;padding:0 18px;border-radius:12px}

/* ============================================================
   发送键：可用时实心黑，停用时浅灰；不再由着色器绘制银色小面
   ============================================================ */
#sendBtn{background:var(--brand-deep);color:#fff;border-radius:18px;
  box-shadow:0 2px 8px rgb(12 14 16 / 22%);transition:background .16s,color .16s,box-shadow .16s}
#sendBtn::before{display:none!important}
#sendBtn:disabled{background:rgb(var(--ink) / 7%);color:var(--faint);box-shadow:none}
#sendBtn.is-stop{background:var(--brand-deep);color:#fff}
[data-appearance="dark"] #sendBtn{background:#f2f3f4;color:#14161a;box-shadow:0 2px 8px rgb(0 0 0 / 30%)}
[data-appearance="dark"] #sendBtn:disabled{background:rgb(255 255 255 / 9%);color:rgb(255 255 255 / 38%);box-shadow:none}

/* ============================================================
   数据源 logo：有真实图标时替代首字母标记
   ============================================================ */
.src-mark.has-logo{padding:4px;background:#fff;box-shadow:inset 0 0 0 1px #eef0f2}
.src-logo{display:block;width:28px;height:28px;object-fit:contain}
[data-appearance="dark"] .src-mark.has-logo{background:#fff;box-shadow:none}

/* 流式回答的末端光标 */
.answer .summary.live::after{content:"";display:inline-block;width:2px;height:1.05em;margin-left:2px;border-radius:1px;
  vertical-align:-.15em;background:var(--brand);animation:wb-caret 1s steps(2,start) infinite}
@keyframes wb-caret{50%{opacity:0}}

.process[aria-disabled="true"]{cursor:default}
.process[aria-disabled="true"] svg{display:none}
.turn-process,.activity-timeline{display:flex;flex-direction:column;gap:6px}
/* Legacy steps use the same collapsible cards as new activity events. */
.turn-process>.steps{display:flex;flex-direction:column;gap:6px;max-height:none;overflow:visible;
  border:0;padding:0;background:transparent;color:var(--secondary);font:inherit;white-space:normal}
.turn-process .step+.step{margin:0;padding:0;border-top:1px solid var(--edge)}
.turn-process .step .activity-preview{margin:0;font:12px/1.55 ui-monospace,Consolas,monospace;color:var(--secondary)}
.activity-detail,.process,.answer,.turn-process{flex-shrink:0;min-width:0}
.activity-detail{border:1px solid var(--edge);border-radius:10px;background:rgb(var(--ink) / 3%);min-width:0}
.activity-detail>summary{cursor:pointer;padding:8px 10px;color:var(--secondary);font-size:12.5px;line-height:18px}
.activity-detail>div.activity-heading{padding:8px 10px;color:var(--secondary);font-size:12.5px;line-height:18px;cursor:default}
.activity-detail>summary:focus-visible{outline:2px solid var(--focus-edge);outline-offset:1px;border-radius:9px}
.activity-detail>.activity-heading{display:flex;align-items:center;gap:8px;list-style:none}
.activity-heading::-webkit-details-marker{display:none}
.activity-heading[aria-disabled="true"]{cursor:default}
.activity-heading:not([aria-disabled="true"])::after{
  content:"";width:6px;height:6px;flex:none;border:solid currentColor;border-width:0 1px 1px 0;
  transform:rotate(45deg);margin-inline-end:2px;margin-top:-3px;
}
.activity-detail[open]>.activity-heading::after{transform:rotate(225deg);margin-top:3px}
.activity-dot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--faint)}
.activity-detail[data-state="running"] .activity-dot{background:var(--brand);animation:pulse 1.3s ease-in-out infinite}
.activity-detail[data-state="done"] .activity-dot{background:#646a73}
.activity-detail[data-state="failed"] .activity-dot{background:#d0483b}
.activity-name{font-weight:600;color:var(--text);flex:none}
.activity-target{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.activity-status{margin-inline-start:auto;color:var(--muted);white-space:nowrap;flex:none}
.activity-preview,.reasoning-text{
  margin:0;padding:8px 11px 10px;border-top:1px solid var(--edge);
  color:var(--secondary);max-height:210px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;
}
.activity-preview{font:12px/1.55 ui-monospace,Consolas,monospace}
.reasoning-text{font-size:13px;line-height:1.65}
.answer .markdown{white-space:normal;overflow-wrap:anywhere}
.markdown :is(p,ul,ol,blockquote,pre,h1,h2,h3,h4,h5,h6,table){margin:0 0 .85em}
.markdown :is(h1,h2,h3,h4,h5,h6){font-size:1.15em;line-height:1.45}
.markdown h1{font-size:1.4em}
.markdown h2{font-size:1.25em}
.markdown ol,.markdown ul{padding-inline-start:1.55em}
.markdown li>p{margin-bottom:.3em}
.markdown blockquote{padding-inline-start:.85em;border-inline-start:3px solid var(--edge);color:var(--secondary)}
.markdown pre{padding:11px;overflow:auto;border:1px solid var(--edge);border-radius:10px;background:rgb(var(--ink) / 4%)}
.markdown code{font-family:ui-monospace,Consolas,monospace;font-size:.93em}
.markdown :not(pre)>code{padding:1px 4px;border-radius:4px;background:rgb(var(--ink) / 6%)}
.markdown table{display:block;max-width:100%;overflow:auto;border-collapse:collapse}
.markdown :is(th,td){padding:5px 9px;border:1px solid var(--edge);text-align:start}
.markdown th{background:rgb(var(--ink) / 5%)}
.markdown a{color:var(--brand-deep);text-decoration:underline;text-underline-offset:2px}
.markdown>:last-child{margin-bottom:0}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important;scroll-behavior:auto!important}
}

/* Welcome surface: atmosphere is confined to the home page, away from long conversations. */
.landing-sky,.landing-header{display:none}
.is-landing .sidebar,.is-landing #sidebarScrim,.is-landing #optics{display:none!important}
.is-landing main,[dir="rtl"] .is-landing main{inset:0}
.is-landing .landing-sky{display:block;position:fixed;inset:0;overflow:hidden;pointer-events:none;background:#f7faff}
.landing-sky::after{content:"";position:absolute;inset:0;background-image:linear-gradient(#7293c00b 1px,transparent 1px),linear-gradient(90deg,#7293c00b 1px,transparent 1px);background-size:88px 88px;mask-image:linear-gradient(#0008,transparent 85%)}
.landing-glow{position:absolute;inset:-20%;background:radial-gradient(ellipse at 20% 45%,#8caddf75,transparent 43%),radial-gradient(ellipse at 78% 25%,#b2d8f470,transparent 38%),radial-gradient(ellipse at 55% 78%,#b8c6ee55,transparent 42%);filter:blur(36px);animation:landing-drift 20s ease-in-out infinite alternate;will-change:transform}
@keyframes landing-drift{from{transform:translate(-3%,0) scale(1)}to{transform:translate(4%,3%) scale(1.12)}}
.is-landing .landing-header{display:flex;position:fixed;inset:0 0 auto;z-index:5;align-items:center;justify-content:flex-end;padding:24px clamp(20px,5vw,80px);gap:16px}
.landing-header nav{display:flex;align-items:center;gap:22px;font-size:13px}
.landing-header nav button{min-height:36px}
.landing-subtitle{display:none}
.is-landing .stage{top:clamp(130px,24vh,260px);width:min(820px,calc(100% - 48px));padding-bottom:50px}
.is-landing .stage .emblem{display:none}
.is-landing .stage h1{font-size:clamp(32px,4.2vw,52px);font-weight:450;line-height:1.3;letter-spacing:5px;margin:0 0 18px;color:#243753;text-align:center}
.is-landing .landing-subtitle{display:block;font-size:14px;color:#7a879c;margin:0 0 38px;text-align:center;line-height:1.8}
.is-landing .composer{height:156px;border:1px solid #ffffffc0;border-radius:26px;background:#ffffff85;box-shadow:0 12px 60px #6b88b00c;backdrop-filter:blur(18px)}
.is-landing .composer::before{display:none!important}
.is-landing button.send:not(:disabled){background:#000;color:#fff}
.is-landing button.send:not(:disabled)::before{display:none}
[data-appearance="dark"] .landing-sky{background:#141d2c}
[data-appearance="dark"] .landing-glow{opacity:.3}
[data-appearance="dark"] .is-landing .stage h1{color:#e7efff}
[data-appearance="dark"] .is-landing .composer{background:#1c2a3a99;border-color:#52667a66}
#registerFields{display:flex;flex-direction:column;gap:8px}
#registerFields p{font-size:13px;line-height:1.6;color:var(--muted);margin:0 0 6px}
#registerFields label{font-size:12px;color:var(--muted)}
#registerFields input{width:100%;margin-bottom:6px}
.artifact-group{display:flex;align-items:center;gap:4px;max-width:100%}
.artifact-group .artifact{min-width:0}
.artifact-view{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.preview-panel{position:absolute;inset:16px 16px 16px auto;width:47%;display:flex;flex-direction:column;background:var(--canvas);border:1px solid var(--edge);border-radius:18px;overflow:hidden;z-index:6;box-shadow:0 8px 32px #00000008}
.preview-panel header{display:flex;align-items:center;gap:14px;padding:16px;border-bottom:1px solid var(--edge)}
.preview-panel strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.preview-panel button{font-size:12px;min-height:32px}
#previewContent{flex:1;min-height:0;background:#fff}
.preview-frame{width:100%;height:100%;border:0;display:block;background:#fff}
#previewStatus{margin:0;padding:10px 16px;font-size:13px;color:var(--muted)}
#previewStatus:empty{display:none}
.preview-note{font-size:11px;color:var(--muted);line-height:1.6;padding:10px 16px;margin:0}
.has-preview .thread{right:calc(47% + 32px)}
.has-preview .thread-inner{width:calc(100% - 36px)}
.has-preview .composer-seat{padding-inline:18px}
.has-preview .composer-seat .composer{width:100%}
@media(max-width:1000px){.preview-panel{inset:12px;width:auto}.has-preview .thread{right:0}}
@media(max-width:600px){.landing-header nav{gap:12px}.is-landing .stage{top:25vh;width:calc(100% - 32px)}.is-landing .stage h1{letter-spacing:2px}.is-landing .composer{height:180px}.is-landing .toolbar{min-height:48px}.is-landing .landing-subtitle{margin-bottom:26px;font-size:13px}.landing-header{padding:18px!important}}
@media(prefers-reduced-motion:reduce){.landing-glow{animation:none;will-change:auto}}

#previewContent.pdf-pages{overflow:auto;background:#e5e7eb;padding:16px;scrollbar-width:thin}
.pdf-page{background:white;min-height:100px;margin:0 auto 16px;max-width:1200px;box-shadow:0 2px 8px #0002;overflow:hidden}
.pdf-page canvas{display:block;width:100%;height:auto}
#loginModal .dialog{max-height:calc(100dvh - 32px);overflow-y:auto}
@media(max-height:600px){.is-landing main{overflow-y:auto}.is-landing .stage{top:110px}}

/* Consistent UI typography, with explicit emphasis reserved for headings and branding. */
button,input,select,textarea{font-family:inherit}
.nav-chat,.nav-chat .title,.side-item,.new,.toolbar button,.popover button,.market-filter{font-weight:400}
.brand .brand-name,.brand .brand-name span,.landing-wordmark{font-weight:700}
.is-landing .stage h1,.is-landing .landing-subtitle{
  font-size:clamp(20.16px,2.736vw,34.56px);line-height:1.4;font-weight:400;letter-spacing:0;
  color:var(--text);text-align:center;text-wrap:balance;
}
.is-landing .stage h1{margin:0 0 10px}
.is-landing .landing-subtitle{margin:0 0 38px}
.is-landing .stage h1 .landing-wordmark{font-weight:700}
#attach{background:none;border:0;box-shadow:none}
#attach::before,#attach::after{display:none!important}
#attach:hover{color:var(--text)}
#sendBtn:not(:disabled):not(.is-stop){background:#000;color:#fff!important;border:0;box-shadow:none}
#sendBtn:not(:disabled):not(.is-stop)::before{display:none!important}
@media(max-width:600px){
  .is-landing .stage{top:clamp(120px,20vh,180px)}
  .is-landing .stage h1,.is-landing .landing-subtitle{font-size:clamp(17.28px,4.104vw,20.16px);letter-spacing:0}
  .is-landing .landing-subtitle{margin-bottom:26px}
}
/* Welcome branding: navy wordmark with softer surrounding copy. */
.is-landing .stage h1,.is-landing .landing-subtitle{color:#788391}
.is-landing .stage h1 .landing-wordmark{color:#173b67}
[data-appearance="dark"] .is-landing .stage h1,
[data-appearance="dark"] .is-landing .landing-subtitle{color:#a2adbc}
[data-appearance="dark"] .is-landing .stage h1 .landing-wordmark{color:#92b5e4}

/* A quiet sign-in surface matching the welcome page. */
.is-landing .stage h1,.is-landing .landing-subtitle{color:#3c3c3c}
#loginModal{background:rgb(24 42 64 / 14%);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
#loginModal .dialog{width:min(100%,420px);padding:30px;border-radius:22px;gap:18px;background:#fafcff;border:1px solid #ffffff;box-shadow:0 18px 65px #243b5b18;backdrop-filter:none;-webkit-backdrop-filter:none}
#loginModal .dialog-head{align-items:flex-start;padding:0 0 4px}
.auth-heading{display:flex;flex-direction:column;gap:10px;min-width:0}
.auth-brand{font-size:14px;font-weight:700;letter-spacing:.2px;color:#173b67}
#loginModal .dialog-head h2{font-size:24px;line-height:1.35;font-weight:500;letter-spacing:0}
#loginModal .dialog-close{margin-inline-start:auto;margin-inline-end:0;width:28px;height:28px;color:#778391}
#loginModal .segments{height:42px;padding:0;gap:24px;border-radius:0;background:none;border-bottom:1px solid #e1e6ed}
#loginModal .segment{flex:none;height:42px;border-radius:0;padding:0 0 12px;font-size:14px;font-weight:400;background:none;box-shadow:none;border-bottom:2px solid transparent;color:#808a97}
#loginModal .segment.on{color:#173b67;border-bottom-color:#173b67}
#loginModal input{height:46px;background:#fff;border:1px solid #e0e5ec;border-radius:10px;font-size:14px;font-weight:400;padding:0 14px}
#loginModal input::placeholder{color:#8b95a2}
#loginModal input:focus-visible{outline:2px solid #9eb5d5;outline-offset:1px}
#loginModal .code-row{gap:12px;align-items:center}
#loginModal .ghost-btn{background:none;box-shadow:none;border-radius:8px;padding:0 4px;color:#173b67;font-size:13px;font-weight:400}
#loginModal .ghost-btn:hover:not(:disabled){background:#edf2f8}
#loginModal .ghost-btn:disabled{color:#8b95a2}
#loginModal .primary-btn{height:46px;margin-top:2px;border-radius:10px;background:#111;color:#fff;font-size:14px;font-weight:400;box-shadow:none}
#loginModal .primary-btn:hover:not(:disabled){background:#252525;box-shadow:none;filter:none}
#loginModal .dialog-msg{font-size:12px;line-height:1.6;min-height:0}
#loginModal .dialog-msg:empty{display:none}
[data-appearance="dark"] #loginModal .dialog{background:#1d2430;border-color:#354050;box-shadow:0 18px 65px #0003}
[data-appearance="dark"] #loginModal input{background:#252e3b;border-color:#3b4759;color:#edf1f7}
[data-appearance="dark"] #loginModal .segments{border-color:#3b4759}
[data-appearance="dark"] #loginModal .segment.on{color:#92b5e4;border-color:#92b5e4}
[data-appearance="dark"] #loginModal .auth-brand,[data-appearance="dark"] #loginModal .ghost-btn{color:#92b5e4}
[data-appearance="dark"] #loginModal .ghost-btn:hover:not(:disabled){background:#2c3747}
@media(max-width:600px){.landing-header nav{gap:14px;font-size:12px}#loginModal .dialog{padding:24px;gap:16px}}

body:not(.is-landing) main{background:var(--canvas)}

/* Keep the legal links below the welcome content, even in short viewports. */
.landing-footer{display:none}
.is-landing main{display:flex;flex-direction:column;overflow-y:auto}
.is-landing .stage{position:relative;top:auto;left:auto;transform:none;flex-shrink:0;margin:clamp(130px,24vh,260px) auto 0}
.is-landing .landing-footer{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 20px;margin-top:auto;padding:16px 20px max(20px,env(safe-area-inset-bottom));font-size:12px;line-height:1.6;color:#7a879c;text-align:center}
.landing-footer a{color:inherit;text-decoration:none}
.landing-footer a:hover{text-decoration:underline}
.landing-footer a:focus-visible{outline:2px solid currentColor;outline-offset:4px;border-radius:2px}
[data-appearance="dark"] .landing-footer{color:#a2adbc}
@media(max-width:600px){.is-landing .stage{margin-top:clamp(120px,20vh,180px)}}
@media(max-height:600px){.is-landing .stage{margin-top:110px}}

/* Workspace hierarchy: quiet account entry, readable replies, prominent deliverables. */
body:not(.is-landing){--accent:#45494f;--accent-wash:rgb(26 28 32 / 7%);--focus-edge:#91969e}
[data-appearance="dark"] body:not(.is-landing){--accent:#e0e2e5;--accent-wash:rgb(255 255 255 / 9%);--focus-edge:#858b94}
.sidebar .user-bar{border:0;background:transparent;box-shadow:none;padding:10px 8px;margin-bottom:12px;cursor:pointer;transition:background .15s}
.sidebar .user-bar::before,.sidebar .user-bar::after{display:none}
.sidebar .user-bar:hover,.sidebar .user-bar:focus-within{background:rgb(var(--ink) / 4%)}
.user-avatar,.user-avatar:hover{box-shadow:none}
.user-meta{flex:1}
.user-meta b{max-width:100%;font-size:13px;font-weight:500}
.user-more{color:var(--secondary);width:28px;opacity:1}
.nav-chat.is-active{background:var(--accent-wash);box-shadow:none!important}
.nav-chat.is-active::before,.nav-chat.is-active::after{display:none!important}
.nav-chat.is-active .title{font-weight:500;color:var(--accent)}
.thread-inner{width:min(860px,calc(100% - 64px));gap:28px;padding-block:20px 28px}
.turn{gap:20px}
.turn-meta{font-size:11px;color:var(--muted);opacity:.7}
.bubble{font-size:15px;line-height:1.7;padding:10px 16px;background:rgb(var(--ink) / 4%)}
.answer{font-size:15px;line-height:1.75}
.markdown li+li{margin-top:6px}
.markdown strong{font-weight:600}
.agent-body{gap:12px}
.process{width:fit-content;max-width:100%;padding:0 8px;border:0;border-radius:8px;font-size:12px;color:var(--muted)}
.turn-process{padding-inline-start:10px;border-inline-start:1px solid var(--edge)}
.activity-detail{border:0;border-radius:6px;background:transparent}
.activity-detail>summary{padding:8px 6px;font-size:12px}
.activity-detail>summary:hover{background:rgb(var(--ink) / 3%)}
.activity-name{font-weight:500}
.activity-target{font-size:11px;color:var(--muted)}
.activity-preview{background:rgb(var(--ink) / 3%);border:0;border-radius:8px}
.turn-process .step+.step{border-top:0}
.artifacts-block{gap:10px;padding-inline-start:44px}
.block-label{font-size:12px;color:var(--muted)}
.artifacts{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.artifact-group{display:flex;flex-wrap:wrap;gap:10px;padding:14px;border:1px solid var(--edge);border-radius:14px;background:rgb(var(--ink) / 1.5%)}
.artifact-icon{display:grid;place-items:center;width:38px;height:42px;border-radius:9px;background:var(--accent-wash);color:var(--accent);flex:none}
.artifact-icon svg{width:22px;height:22px}
.artifact-info{display:flex;flex-direction:column;gap:4px;flex:1;min-width:80px}
.artifact-name{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.artifact-type{font-size:10px;letter-spacing:.04em;color:var(--muted)}
.artifact-group .artifact{height:32px;border:0;border-radius:8px;box-shadow:none;background:transparent;backdrop-filter:none;font-size:12px;padding:0 10px;color:var(--secondary)}
.artifact-group .artifact-view{background:var(--accent-wash);color:var(--accent);font-weight:500}
.artifact-group .artifact:hover{background:rgb(var(--ink) / 6%)}
.composer-seat .composer{width:min(860px,calc(100% - 64px));min-height:120px;border:1px solid var(--edge);border-radius:22px;background:var(--canvas);padding:14px 16px 12px}
.composer-seat .composer::before{display:none!important}
.composer-seat .composer:focus-within{border-color:var(--accent)}
.composer-seat .composer textarea{font-size:15px;line-height:24px;height:52px;max-height:180px}
.composer-seat .toolbar{height:36px;min-height:36px;flex-wrap:nowrap}
.composer-seat .model{margin-inline-start:auto}
.composer-seat button.send:enabled:not(.is-stop){background:var(--accent);color:#fff}
.composer-seat button.send:enabled:not(.is-stop)::before{display:none}
@media(min-width:1001px) and (max-width:1250px){.preview-panel{inset:12px;width:auto}.has-preview .thread{right:0}}
@media(max-width:600px){
  .thread-inner,.composer-seat .composer{width:calc(100% - 24px)}
  .thread-inner{padding-top:12px;gap:24px}
  .turn-agent{grid-template-columns:minmax(0,1fr)}
  .turn-agent .avatar{width:26px;height:26px}
  .artifacts-block{padding-inline-start:0}
  .artifact-group{gap:8px;padding:12px}
  .artifact-info{flex-basis:calc(100% - 54px)}
  .artifact-group .artifact-view{margin-inline-start:46px}
}
@supports(field-sizing:content){
  .composer-seat .composer textarea{field-sizing:content;height:auto;min-height:52px;max-height:180px}
}

/* Landing world map and brand introduction. */
#landingMap{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.landing-brand-note{display:none}
.is-landing .landing-brand-note{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:28px;text-align:center;color:#64758c;font-size:12px;line-height:1.9}
.landing-brand-note p{display:flex;justify-content:center;flex-wrap:wrap;gap:3px 12px;margin:0;text-wrap:balance}
.landing-brand-note strong{font-weight:500;color:#405b7b}
.landing-brand-note a{display:inline-flex;align-items:center;gap:9px;color:#45698d;text-decoration:none;border-bottom:1px solid transparent;transition:color .2s,border-color .2s}
.landing-brand-note a:hover{color:#173b67;border-color:currentColor}
.landing-brand-note a:focus-visible{outline:2px solid #45698d;outline-offset:5px;border-radius:2px}
[data-appearance="dark"] .landing-brand-note{color:#a2b4ca}
[data-appearance="dark"] .landing-brand-note strong,[data-appearance="dark"] .landing-brand-note a{color:#a9c9ed}
@media(max-width:600px){.is-landing .landing-brand-note{margin-top:24px;font-size:11px;max-width:320px}.landing-brand-note p{flex-direction:column;gap:2px}}

/* Compact welcome area in the workspace. */
body:not(.is-landing) .stage{width:min(640px,calc(100% - 44px))}
body:not(.is-landing) .stage h1{font-size:clamp(17.64px,1.89vw,22.05px);margin-bottom:18px}
body:not(.is-landing) .stage .composer{height:auto;min-height:120px;padding:14px 16px 12px;border-radius:20px}
body:not(.is-landing) .stage .composer textarea{height:48px}
@media(max-width:980px){body:not(.is-landing) .stage h1{font-size:clamp(16.38px,2.331vw,20.16px)}}
@media(max-width:600px){
  body:not(.is-landing) .stage{width:calc(100% - 24px)}
  body:not(.is-landing) .stage h1{font-size:16.38px}
  :root:is([lang="en"],[lang="fr"],[lang="ar"]) body:not(.is-landing) .stage h1{font-size:14.49px}
  body:not(.is-landing) .stage .composer{min-height:120px;padding:12px}
  body:not(.is-landing) .stage .toolbar{min-height:36px}
}

/* Account balance and monthly usage above the profile actions. */
.account-popover{width:286px;max-height:calc(100dvh - 20px);overflow-y:auto}
.account-summary{padding:16px 13px 12px;border-bottom:1px solid var(--edge);margin-bottom:5px}
.account-caption{display:block;font-size:11px;color:var(--muted)}
.account-points{display:block;margin:7px 0 18px;font-size:23px;line-height:1.3;color:var(--text)}
.account-usage{min-height:149px}
.account-usage>.account-caption{margin-bottom:10px}
.account-quota-row{display:flex;justify-content:space-between;gap:12px;margin:8px 0;font-size:11px;color:var(--muted)}
.account-quota-row b{font-weight:500;color:var(--text);font-variant-numeric:tabular-nums}
.account-hint{font-size:12px;line-height:1.7;color:var(--muted)}
.account-meter{display:block;width:100%;height:5px;margin:10px 0;appearance:none;border:0;border-radius:5px;overflow:hidden;background:rgb(var(--ink) / 8%)}
.account-meter::-webkit-progress-bar{background:rgb(var(--ink) / 8%);border-radius:5px}
.account-meter::-webkit-progress-value{background:#737983;border-radius:5px}
.account-meter::-moz-progress-bar{background:#737983;border-radius:5px}
.popover .account-recharge{width:100%;height:36px;margin-top:12px;justify-content:center;background:var(--text);color:var(--canvas,#fff);border-radius:10px}
.popover .account-recharge:hover{background:var(--text);opacity:.85}

.account-summary.is-guest .account-usage{min-height:64px}

/* Neutral workspace controls and familiar document type badges. */
.user-avatar:not(.has-image){background:#fff;background-image:none;color:#555b65;border:1px solid #e0e3e7}
.user-avatar:not(.has-image):hover{background:#f5f6f7;filter:none}
.nav-chat.is-active,.nav-chat.is-active:hover{background:rgb(var(--ink) / 8%);color:var(--text)}
.nav-chat.is-active .title{color:var(--text)}
.nav-chat.is-active .dot.running{background:var(--muted)}
.composer:focus-within,.composer-seat .composer:focus-within{border-color:#a6abb3;box-shadow:none}
body:not(.is-landing) .composer-seat button.send:enabled:not(.is-stop){background:var(--text);color:var(--canvas,#fff)}
.history-loading,.history-error{padding:20px 0;font-size:13px;color:var(--muted)}
.history-loading::before{content:"";display:inline-block;width:7px;height:7px;margin-inline-end:10px;border-radius:50%;background:currentColor}
.history-error+.ghost-btn{align-self:flex-start;min-height:34px}
.artifacts-block{padding-inline-start:0}
.artifact-group{--file-color:#69717e;flex-wrap:nowrap;gap:12px;padding:12px 14px;border-radius:10px;background:var(--canvas,#fff)}
.artifact-group[data-file-type="pdf"]{--file-color:#d74740}
.artifact-group[data-file-type="html"],.artifact-group[data-file-type="document"]{--file-color:#3575cc}
.artifact-group[data-file-type="sheet"]{--file-color:#b77c24}
.artifact-group[data-file-type="slides"]{--file-color:#d77335}
.artifact-group[data-file-type="image"],.artifact-group[data-file-type="archive"]{--file-color:#8b65b5}
.artifact-icon{position:relative;width:34px;height:42px;border-radius:0;background:transparent;color:var(--file-color)}
.artifact-icon svg{width:32px;height:40px}
.artifact-extension{font:700 7px system-ui,sans-serif;fill:currentColor;stroke:none;letter-spacing:0}
.artifact-info{flex:1;min-width:0;gap:3px}
.artifact-group .artifact-view{margin-inline-start:0;background:rgb(var(--ink) / 5%);color:var(--text);font-weight:400}
.artifact-group .artifact{flex:none}
.preview-panel{inset:0 0 0 auto;width:48%;border:0;border-inline-start:1px solid var(--edge);border-radius:0;box-shadow:none}
.has-preview .thread{right:48%}
#previewContent.pdf-pages{padding:18px;background:rgb(var(--ink) / 3%)}
.pdf-page{box-shadow:none}
@media(max-width:900px){.preview-panel{inset:0;width:100%;border:0}.has-preview .thread{right:0}}
@media(max-width:600px){
  .artifact-group{flex-wrap:wrap;gap:8px;padding:12px}
  .artifact-info{flex-basis:calc(100% - 46px)}
  .artifact-group .artifact-view{margin-inline-start:46px}
}

/* Phone layout: side navigation and a compact, two-row composer. */
@media(max-width:600px){
  body:not(.is-landing) .stage{top:50%;transform:translate(-50%,-50%);width:calc(100% - 32px);padding-bottom:0}
  body:not(.is-landing) .stage h1{font-size:21px;line-height:1.4;margin:0 0 22px;text-align:center}
  .is-landing .landing-header{padding:12px 16px!important}
  .landing-header nav{width:100%;justify-content:flex-end;flex-wrap:wrap;gap:4px 14px;font-size:12px}
  .landing-header nav button{min-height:40px}
  .is-landing .stage{margin-top:clamp(104px,17vh,140px);width:calc(100% - 32px);padding-bottom:28px}
  .is-landing .stage h1{font-size:23px;line-height:1.4;margin-bottom:10px}
  .is-landing .landing-subtitle{font-size:15px;line-height:1.65;margin-bottom:24px;text-wrap:balance}
  .is-landing .stage .composer,body:not(.is-landing) .stage .composer,.composer-seat .composer{height:auto;min-height:120px;padding:12px;border-radius:20px;gap:8px}
  .stage .composer textarea,body:not(.is-landing) .stage .composer textarea,.composer-seat .composer textarea{field-sizing:fixed;height:48px;min-height:48px;max-height:48px;flex:none;padding:0 2px;font-size:16px;line-height:24px;overflow-y:auto}
  .stage .composer .toolbar,.composer-seat .toolbar{height:40px;min-height:40px;flex-wrap:nowrap;gap:6px}
  .composer .toolbar button{height:40px;min-width:40px;border-radius:20px}
  .composer .toolbar .model{width:auto;min-width:0;margin:0;padding-inline:8px;font-size:13px;flex-shrink:1}
  .composer .toolbar .model span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .composer .toolbar button.send{width:40px;margin-inline-start:auto}
  .composer-seat{padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .is-landing .landing-brand-note{margin-top:20px;font-size:11px;gap:8px}
  .is-landing .landing-footer{font-size:11px}
}
@media(max-width:600px) and (max-height:500px){
  body:not(.is-landing) main{overflow-y:auto}
  body:not(.is-landing) .stage{top:24px;transform:translateX(-50%)}
  .is-landing .stage{margin-top:80px}
}

/* Compact progress: status stays beside the operation rather than across the page. */
.turn-process .activity-heading{justify-content:flex-start;gap:8px;min-height:30px;padding:5px 8px}
.turn-process .activity-status{margin-inline-start:0;flex:none;font-size:11px}
.turn-process [data-state="done"]>.activity-heading>.activity-status{display:none}
.turn-process [data-state="done"]>.activity-heading>.activity-dot{width:12px;height:auto;background:none;animation:none}
.turn-process [data-state="done"]>.activity-heading>.activity-dot::after{content:"✓";font-size:12px;color:var(--secondary)}
.turn-process .activity-name{flex:none;max-width:75%;white-space:normal}
.turn-process .activity-target{flex:0 1 auto}
.turn-process .activity-heading::after{margin-inline-start:4px}
.operation-count{color:var(--faint);font-size:12px}
.progress-more{border:0;background:none;color:var(--secondary);font:inherit;font-size:12px;padding:6px 8px;cursor:pointer}
.turn-process [hidden]{display:none!important}
