/*
 * HiZero Portal · 2026-11-04
 * 与下载官网共用浅色纸面 / 蓝色强调 / 描边 SVG 的视觉语言。
 * 本文件只加载在 /portal/；不触碰下载首页、模型、计费或账号接口。
 * 保留 portal.css 的功能布局与断点，这里只收敛视觉层级与密度。
 */
:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-inset: #f8f9fb;
  --line: #dfe5e9;
  --line-soft: #e9edf0;
  --ink: #202b33;
  --ink-2: #45545e;
  --ink-soft: #677983;
  --ink-faint: #829099;
  --indigo: #3469c8;
  --indigo-bright: #3469c8;
  --indigo-deep: #244b91;
  --cyan: #4c849b;
  --brand: #3469c8;
  --brand-deep: #28579d;
  --good: #277b60;
  --good-bg: #edf7f1;
  --good-line: #c8e5d6;
  --bad: #b43e4c;
  --bad-bg: #fff1f2;
  --bad-line: #f0c9cf;
  --warn: #916320;
  --warn-bg: #fbf5e8;
  --warn-line: #e9dcc3;
  --radius: 12px;
  --radius-card: 18px;
  --shadow: 0 5px 24px rgba(26, 47, 63, .035), 0 1px 3px rgba(26, 47, 63, .025);
}
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
body::before { display: none; }
/* Author display rules must never override the platform's hidden state. */
[hidden] { display: none !important; }
a { color: var(--brand-deep); }
.ui-icon { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: middle; }
button, input, textarea, select { font-family: var(--font-sans); }
button {
  background: var(--indigo);
  border-radius: 11px;
  box-shadow: none;
  font-weight: 570;
}
button:hover:not(:disabled) { background: var(--indigo-deep); box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}
button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  box-shadow: none;
}
button.ghost:hover:not(:disabled) { background: #eef2f5; }
button:disabled { opacity: .52; }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  min-height: 43px;
  transition: border-color .16s, box-shadow .16s;
}
input::placeholder, textarea::placeholder { color: #9aa6ae; }
input:focus, textarea:focus, select:focus { border-color: #98b6df; box-shadow: 0 0 0 3px rgba(52, 105, 200, .07); }
select { width: 100%; padding: 10px 12px; appearance: auto; }
textarea { min-height: 110px; }
.field { margin-bottom: 17px; }
.field > span { color: var(--ink-2); font-size: 12px; font-weight: 590; margin-bottom: 8px; }
.actions { margin-top: 18px; }

/* 轻量顶部导航：图标来自同源的 portal-icons.js。 */
.top {
  min-height: 70px;
  flex-wrap: nowrap;
  gap: clamp(12px, 2vw, 30px);
  padding: 11px clamp(18px, 3.2vw, 48px);
  background: rgba(247, 248, 246, .91);
  border-bottom: 1px solid #e5e9e9;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}
.brand { gap: 10px; flex: none; }
.mark { border: 1px solid rgba(255, 255, 255, .75); box-shadow: 0 2px 7px rgba(32, 58, 78, .08); border-radius: 9px; }
.brand-name { font-size: 17px; letter-spacing: -.04em; font-weight: 690; }
.brand-sub { font-size: 11px; padding-left: 7px; border-left: 1px solid #d6dfe3; }
.back-download { margin-left: 12px; color: var(--ink-soft); font-weight: 480; }
.back-download:hover { color: var(--brand-deep); }
.tabs {
  margin: 0 auto;
  padding: 0;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex-wrap: nowrap;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--ink-soft);
}
.tabs a .ui-icon { width: 16px; height: 16px; }
.tabs a:hover { color: var(--ink); background: #eef1f2; }
.tabs a[aria-current="page"] {
  color: var(--brand-deep);
  background: #eaf0f9;
  box-shadow: none;
}
.who { gap: 10px; flex: none; }
.who-name { color: var(--ink-2); max-width: 140px; font-weight: 550; }
.who-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid #dbe3ea;
  border-radius: 50%;
  background: #eaf0f7;
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
}
#signout { display: inline-flex; align-items: center; gap: 6px; padding: 8px; border-radius: 9px; }
#signout .ui-icon { width: 16px; height: 16px; }
.page { max-width: 1060px; padding-top: clamp(30px, 5vw, 54px); padding-bottom: 64px; }
.card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card + .card { margin-top: 18px; }
.card-head h2 { color: var(--ink); font-weight: 620; }
h1 { color: var(--ink); letter-spacing: -.04em; font-weight: 650; }
.lead { color: var(--ink-soft); font-size: 13px; }
.section-title { font-size: 16px; letter-spacing: -.025em; }
.section-title::before { display: none; }
.section-head { margin-bottom: 16px; }
.section-hint { font-size: 12px; }
.hint { color: var(--ink-soft); }
.notice { background: #f2f6fb; border-color: #dce7f5; color: var(--ink-2); }
.notice[data-tone="bad"] { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.badge, .tag {
  color: var(--ink-soft);
  border-color: var(--line);
  background: #f7f9fa;
  border-radius: 8px;
}
.badge.good, .tag[data-tone="good"] { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.badge.warn, .tag[data-tone="warn"] { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.tag[data-tone="bad"] { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.loading, .empty { color: var(--ink-soft); }
.empty { background: #fafbfc; border: 1px dashed #dce4e9; }
.terms { color: var(--ink-soft); font-size: 11.5px; }
.foot { border-top: 1px solid #e9edef; color: #88969c; font-size: 11px; }
.toast { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: 0 12px 34px rgba(22, 46, 61, .12); }

/* 账号资料：信息与编辑操作分层，不把 metadata 伪装成表格。 */
.portal-heading { margin-bottom: 24px; }
.portal-heading h1 { font-size: clamp(23px, 3vw, 30px); margin: 0 0 7px; }
.portal-heading p { color: var(--ink-soft); font-size: 13px; margin: 0; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .85fr); align-items: start; gap: 20px; }
.account-layout .card + .card { margin-top: 0; }
.account-profile { padding: 27px 30px 30px; }
.account-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 27px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.account-monogram { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; background: #ecf2fb; color: var(--brand-deep); }
.account-monogram .ui-icon { width: 28px; height: 28px; }
.account-summary strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.account-summary small { display: block; color: var(--ink-soft); margin-top: 2px; }
.account-identity h2 { font-size: 15px; margin: 0 0 18px; }
.identity-list { margin: 0; }
.identity-row { display: grid; gap: 6px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.identity-row:last-child { border-bottom: 0; }
.identity-row dt { color: var(--ink-faint); font-size: 11px; }
.identity-row dd { margin: 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.account-footnote { display: flex; align-items: start; gap: 9px; color: var(--ink-soft); padding-top: 16px; font-size: 11.5px; line-height: 1.7; }
.account-footnote .ui-icon { color: var(--brand); margin-top: 2px; }

/* 积分中心：先余额，再说明，再申请，弱化“营销大横幅”。 */
.mock-recharge { gap: 20px; }
.mock-hero {
  padding: 0 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  overflow: visible;
}
.mock-hero::before, .mock-hero::after { display: none; }
.mock-eyebrow { color: var(--brand); font-size: 11px; letter-spacing: .08em; margin: 0 0 10px; font-weight: 630; }
.mock-hero h1 { color: var(--ink); font-size: clamp(26px, 3vw, 33px); letter-spacing: -.045em; font-weight: 650; line-height: 1.3; }
.mock-hero p { color: var(--ink-soft); font-size: 13px; line-height: 1.7; margin: 10px 0 14px; max-width: 70ch; }
.mock-status { gap: 6px; }
.step {
  background: #edf2f8;
  color: #456587;
  border: 1px solid #dee7f0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.step-arrow { color: #aebbc5; }
.overview { gap: 13px; }
.stat, .stat-primary {
  padding: 23px;
  border: 1px solid var(--line-soft);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
}
.stat-primary { border-color: #d7e4f2; background: #f8fbff; }
.stat-label { color: var(--ink-soft); font-weight: 550; letter-spacing: 0; }
.stat-icon, .stat-icon.cyan, .stat-icon.good {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #eaf1fb;
  color: var(--brand);
  border-color: transparent;
  font-size: inherit;
}
.stat-icon .ui-icon { width: 17px; height: 17px; }
.stat-icon.cyan { background: #edf5f6; color: #4b8293; }
.stat-icon.good { background: #eef7f2; color: var(--good); }
.big-num { color: var(--ink); font-size: clamp(30px, 4vw, 38px); }
.metric-num { color: var(--ink); font-size: 25px; }
.stat-unit, .stat-sub, .stat-note, .split-label { color: var(--ink-soft); }
.split-row b, .split-end strong { color: var(--ink-2); }
.stat-value { margin-top: 19px; }
.dot.good, .dot.cyan, .dot.warn { box-shadow: none; }
.plan, .plan-featured {
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
  gap: 9px;
}
.plan-featured { border-color: #afc8e8; background: #f8fbff; }
.mock-plan:hover { border-color: #aac4e4; box-shadow: 0 6px 22px rgba(22, 50, 84, .06); }
.plan-name { color: var(--ink-2); letter-spacing: 0; font-weight: 620; }
.plan-credits { color: var(--ink); font-size: 27px; }
.plan-price, .plan-meta { color: var(--ink-soft); }
.plan-bonus { color: var(--good); }
.mock-plan .plan-icon { border: 0; background: #edf3fa; color: var(--brand); border-radius: 11px; }
.mock-plan .plan-icon .ui-icon { width: 20px; height: 20px; }
.plan-badge { background: #eaf0f9; color: var(--brand-deep); border-color: #d5e3f3; }
.mock-plan button { margin-top: 13px; }
.application-row { padding: 16px 2px; }
.application-row strong { color: var(--ink); font-weight: 590; font-size: 13px; }
.application-row p { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.application-row > div { min-width: 0; }
.application-row .tag { flex: none; }
.list { width: 100%; }
.list th, .list td { border-bottom: 1px solid #e9edf0; }
.list th { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.list td { color: var(--ink-2); }
.list tr:hover td { background: #fafbfc; }
.list td[data-tone="good"] { color: var(--good); }
.list td[data-tone="bad"] { color: var(--bad); }

/* 对话：ChatGPT 式低噪声双栏，保留真实能力状态与禁发送回退。 */
body.is-chat { background: #fff; }
body.is-chat .page { background: #fff; }
.chat-shell { background: #fff; grid-template-columns: 258px minmax(0, 1fr); }
.chat-rail { gap: 13px; padding: 17px 12px; background: #f7f8f8; border-right: 1px solid #eef0f1; }
.chat-rail-head { gap: 13px; }
.chat-new {
  justify-content: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e7ea;
  color: var(--ink);
  font-weight: 580;
  border-radius: 11px;
  padding: 11px 13px;
  box-shadow: none;
}
.chat-new:hover:not(:disabled) { background: #eef3f8; border-color: #cedbe8; box-shadow: none; }
.chat-new .ui-icon { width: 17px; height: 17px; color: var(--brand); }
.chat-rail-eye { font-size: 11px; font-weight: 560; letter-spacing: 0; padding: 0 9px; color: var(--ink-faint); }
.chat-rail-empty { background: transparent; border: 0; border-radius: 0; padding: 18px 9px; margin: 0; }
.chat-rail-empty strong { color: var(--ink-2); font-size: 12.5px; }
.chat-rail-empty span, .chat-rail-foot { color: var(--ink-faint); font-size: 11.5px; }
.chat-rail-foot { border-top: 1px solid #e6e9eb; padding: 14px 8px 3px; }
.chat-top { border-bottom: 0; background: #fff; padding: 14px clamp(16px, 3vw, 40px); min-height: 58px; }
.chat-titles { flex-direction: row; align-items: center; gap: 12px; }
.chat-titles strong { color: var(--ink); font-size: 14px; font-weight: 650; }
.chat-titles span { color: var(--ink-faint); font-size: 11.5px; }
.chat-status { padding: 5px 10px; background: #faf7ed; color: var(--warn); border-color: transparent; }
.chat-status[data-state="ready"] { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chat-status-dot { box-shadow: none; }
.chat-rail-toggle { background: transparent; border-color: transparent; color: var(--ink-2); }
.chat-rail-toggle:hover:not(:disabled) { background: #eef2f5; border-color: transparent; }
.chat-scroll { padding: clamp(18px, 4vh, 52px) 20px 26px; }
.chat-thread { max-width: 748px; }
.chat-hero { padding-top: 0; }
.chat-hero-mark { width: 50px; height: 50px; border-radius: 15px; box-shadow: 0 5px 20px rgba(35, 69, 96, .08); }
.chat-eyebrow { color: var(--brand); margin: 20px 0 0; font-size: 11px; letter-spacing: .08em; }
.chat-hero h1 { color: var(--ink); font-size: clamp(25px, 3.1vw, 32px); letter-spacing: -.055em; margin-top: 10px; }
.chat-lead { max-width: 48ch; color: var(--ink-soft); font-size: 13px; margin: 12px auto 0; }
.chat-suggest { gap: 10px; margin-top: 28px; max-width: 670px; }
.chat-suggest-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--ink-2);
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(23, 47, 59, .025);
}
.chat-suggest-btn .ui-icon { color: var(--brand); width: 16px; height: 16px; }
.chat-suggest-btn:hover:not(:disabled) { background: #f7f9fb; border-color: #ccd9e6; color: var(--ink); box-shadow: 0 4px 12px rgba(23, 47, 59, .05); }
.chat-notice { background: #f7f9fb; border-color: #e9edf0; color: var(--ink-soft); }
.chat-bubble { background: #f0f3f5; border: 0; color: var(--ink); border-radius: 18px 18px 5px 18px; }
.chat-avatar { background: #eaf1fa; color: var(--brand); box-shadow: none; border-radius: 10px; }
.chat-avatar .ui-icon { width: 15px; height: 15px; }
.chat-msg-body { color: var(--ink-2); }
.chat-composer { background: linear-gradient(180deg, transparent, #fff 28%); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.chat-composer-inner { max-width: 748px; }
.chat-composer-head {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; padding: 0 2px 10px;
}
.chat-composer-head .chat-mode-anchor,
.chat-composer-head .chat-panel-anchor { flex: none; }
body.is-chat .chat-composer-head .chat-mode-trigger {
  height: 30px; padding: 4px 10px; border: 1px solid #e3e7ec; border-radius: 10px;
  background: rgba(255, 255, 255, .72); color: #4b5563; font-size: 12px;
  box-shadow: none; backdrop-filter: blur(8px);
}
body.is-chat .chat-composer-head .chat-mode-trigger:hover,
body.is-chat .chat-composer-head .chat-mode-trigger[aria-expanded="true"] {
  background: #fff; border-color: #cfdae6;
}
body.is-chat .chat-composer-head .chat-panel {
  min-height: 30px; padding: 2px 6px 2px 8px;
  border: 1px solid #e3e7ec; border-radius: 10px;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(8px);
}
body.is-chat .chat-composer-head .chat-panel[data-on="true"] {
  border-color: #cfdae6; background: #fff;
}
@media (max-width: 640px) {
  .chat-composer-head { gap: 6px; padding: 0 0 8px; }
  body.is-chat .chat-composer-head .chat-mode-trigger { padding-inline: 8px; }
}
.chat-box {
  background: #fff;
  border: 1px solid #dce3e8;
  border-radius: 23px;
  padding: 15px 16px 12px;
  box-shadow: 0 6px 26px rgba(24, 42, 59, .07), 0 1px 2px rgba(24, 42, 59, .035);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.chat-box:focus-within { border-color: #aac2db; box-shadow: 0 6px 26px rgba(24, 42, 59, .075), 0 0 0 3px rgba(52, 105, 200, .045); }
.chat-input { min-height: 34px; color: var(--ink); background: transparent; border: 0; box-shadow: none; font-size: 14px; }
.chat-input:focus { border: 0; box-shadow: none; }
.chat-tools { min-height: 36px; }
.chat-chip { border: 0; background: #f2f5f7; color: var(--ink-soft); font-size: 11px; }
.chat-hint { color: #9ba7ae; }
.chat-send { display: grid; place-items: center; border-radius: 50%; background: #2d465a; color: #fff; width: 35px; height: 35px; }
.chat-send .ui-icon { width: 18px; height: 18px; }
.chat-send:hover:not(:disabled) { background: #1d3448; box-shadow: none; }
.chat-note { color: var(--ink-faint); font-size: 11px; margin-top: 8px; }
.chat-scrim { background: rgba(26, 39, 48, .35); }
/* Narrow-screen scrim is a <button>: the generic button:hover rule must
   never replace its translucent overlay with an opaque blue rectangle. */
body.is-chat button.chat-scrim:hover:not(:disabled) {
  background: rgba(23, 35, 45, .34);
  box-shadow: none;
}
@media (max-width: 1100px) {
  .brand-sub, .back-download { display: none; }
  .tabs a { gap: 6px; padding: 8px 10px; }
  .who-name { max-width: 86px; }
}
@media (max-width: 840px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .overview { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 8px; padding: 10px 16px; }
  .tabs { gap: 0; }
  .who-name { display: none; }
}
@media (max-width: 820px) {
  .chat-shell { grid-template-columns: minmax(0, 1fr); }
  .chat-rail { background: #f7f9fa; border-right: 1px solid #e6ebee; }
  .chat-top { padding: 9px 15px; }
  .chat-scroll { padding: 14px 16px; }
  .chat-composer { padding: 6px 12px calc(12px + env(safe-area-inset-bottom)); }
  .chat-scrim { background: rgba(23, 35, 45, .34); }
}
@media (max-width: 640px) {
  .top, body.is-chat .top { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 16px; }
  .who { margin-left: auto; }
  .tabs, body.is-chat .tabs {
    order: 3;
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    margin: 4px 0 0;
    width: 100%;
    padding: 0;
  }
  .tabs a, body.is-chat .tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 49px;
    font-size: 0;
    padding: 5px 1px;
    line-height: 1.2;
  }
  .tabs a::after { content: attr(data-short); font-size: 11px; }
  .tabs a .ui-icon { width: 17px; height: 17px; }
  .page { padding: 24px 14px 42px; }
  .card { padding: 20px; }
  .account-profile { padding: 20px; }
  .mock-hero { padding: 0; }
  .mock-hero h1 { font-size: 26px; }
  .mock-hero p { font-size: 12.5px; }
  .stat { padding: 19px; }
  .chat-hero-mark { width: 43px; height: 43px; }
  .chat-hero h1 { font-size: 23px; }
  .chat-suggest { flex-direction: column; max-width: 330px; width: 100%; gap: 8px; }
  .chat-suggest-btn { justify-content: flex-start; width: 100%; }
  .chat-rail { width: min(285px, 85vw); }
  .chat-box { border-radius: 18px; padding: 11px 12px 9px; }
  .chat-input { font-size: 16px; }
  .chat-hint { display: none; }
  .chat-titles span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .toast, .plan, .mock-plan { animation: none; transition: none; }
}


/* D153: browser/desktop share the same mode order, glyph language and compact picker. */
.chat-mode-anchor { position: relative; display: inline-flex; flex: none; }
.chat-mode-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 5px 10px; border-radius: 10px;
  background: #f1f4f6; border: 1px solid transparent;
  color: var(--ink-2); box-shadow: none; font-size: 12px; font-weight: 580;
}
.chat-mode-trigger:hover:not(:disabled), .chat-mode-trigger[aria-expanded="true"] {
  background: #e8eff5; border-color: #d8e3ec; box-shadow: none;
}
.chat-mode-trigger .ui-icon { width: 16px; height: 16px; }
.chat-mode-trigger .ui-icon:last-child { width: 12px; height: 12px; color: var(--ink-faint); }
.chat-mode-menu {
  position: absolute; bottom: calc(100% + 12px); left: 0; z-index: 60;
  width: min(345px, calc(100vw - 30px));
  padding: 6px; border: 1px solid #dce4e8; border-radius: 17px;
  background: #fff; box-shadow: 0 14px 40px rgba(24, 45, 60, .16);
}
.chat-mode-menu[hidden] { display: none !important; }
.chat-mode-option {
  display: flex; align-items: center; gap: 11px; width: 100%;
  min-height: 60px; text-align: left; padding: 9px 11px;
  border: 0; border-radius: 11px; background: transparent;
  box-shadow: none; color: var(--ink); font-size: 13px; cursor: pointer;
}
.chat-mode-option:hover:not(:disabled), .chat-mode-option[aria-checked="true"] {
  background: #f1f5fa; box-shadow: none; color: var(--ink);
}
.chat-mode-option:disabled { opacity: .54; cursor: not-allowed; }
.chat-mode-option > .ui-icon { width: 19px; height: 19px; color: var(--ink-2); }
.chat-mode-option-body { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.chat-mode-option-body strong { font-size: 13px; line-height: 20px; font-weight: 590; }
.chat-mode-option-body small { font-size: 11px; line-height: 16px; color: var(--ink-soft); font-weight: 400; }
.chat-mode-selected { flex: none; width: 17px; height: 17px; display: grid; place-items: center; color: var(--brand); }
.chat-mode-selected .ui-icon { width: 16px; height: 16px; }
.chat-mode-option[aria-checked="false"] .chat-mode-selected { opacity: 0; }
.chat-mode-unavailable { font-size: 10px; color: var(--ink-faint); white-space: nowrap; }
@media (max-width: 640px) {
  .chat-mode-trigger { padding-inline: 8px; }
  .chat-mode-menu { left: -6px; }
}


/* D154 · A contextual, non-modal execution recommendation, not an agent message. */
.chat-cloud-hint,
.chat-context-preview {
  display: grid;
  gap: 11px;
  max-width: 100%;
  margin-bottom: 13px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #dce6f1;
  background: #f7faff;
  box-shadow: 0 3px 15px rgba(36, 65, 94, .035);
}
.chat-context-preview { background: #fbfcfe; border-color: #e2e8ed; }
.chat-cloud-hint-title, .chat-context-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
}
.chat-cloud-hint-title strong, .chat-context-title strong { font-weight: 640; }
.chat-cloud-hint-title .ui-icon, .chat-context-title .ui-icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.chat-cloud-hint-tag, .chat-context-status {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eaf1fb;
  color: #446a96;
  font-size: 10px;
  white-space: nowrap;
  font-weight: 550;
}
.chat-cloud-hint-detail, .chat-context-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}
.chat-context-meta { font-size: 11px; }
.chat-context-task {
  margin: 0;
  padding: 10px 12px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  border: 1px solid #e8edf2;
  background: #fff;
  border-radius: 10px;
}
.chat-cloud-hint-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.chat-cloud-hint-actions button {
  min-height: 32px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 580;
  box-shadow: none;
}
.chat-cloud-hint-prepare { display: inline-flex; align-items: center; gap: 6px; }
.chat-cloud-hint-prepare .ui-icon { width: 14px; height: 14px; }
.chat-cloud-hint-actions .chat-cloud-hint-dismiss {
  background: transparent; color: var(--ink-soft); padding: 6px 10px;
  border: 1px solid transparent;
}
.chat-cloud-hint-actions .chat-cloud-hint-dismiss:hover:not(:disabled) {
  background: #eaf0f6; border-color: #e1e8ef; color: var(--ink);
}
@media (max-width: 640px) {
  .chat-cloud-hint, .chat-context-preview { padding: 12px; margin-bottom: 10px; }
  .chat-cloud-hint-detail { font-size: 11.5px; }
  .chat-cloud-hint-actions { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-cloud-hint-actions button { transition: none; }
}

/* ------------------------------------------------ 品牌吉祥物与登录入口 */
.mark, .chat-hero-mark, .entry-logo { object-fit: cover; }
.mark { background: #eef3f9; }
.login-entry {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid #cfdcec;
  border-radius: 10px;
  background: #eef4fb;
  color: var(--brand-deep);
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
}
.login-entry:hover { background: #e3edf9; color: var(--indigo-deep); }

/* ------------------------------------------------ 登录页：与桌面端 zero-entry 同版式 */
body.is-login .top,
body.is-login .foot,
body.is-login .skip { display: none; }
body.is-login .page {
  max-width: none;
  width: 100%;
  padding: 0;
}
body.is-login .view { width: 100%; }
.entry-page {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 18px;
  overflow: auto;
  color: #253040;
  background:
    radial-gradient(ellipse 45% 50% at 10% 15%, rgba(187, 206, 225, .55), transparent 96%),
    radial-gradient(ellipse 37% 45% at 90% 85%, rgba(209, 201, 223, .48), transparent 96%),
    linear-gradient(145deg, #f9fafc, #e8edf2);
}
.entry-art {
  position: fixed;
  z-index: -1;
  right: -15vw;
  top: -22vw;
  width: min(56vw, 660px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(255, 255, 255, .22), 0 0 0 47px rgba(255, 255, 255, .55),
    0 0 0 110px rgba(255, 255, 255, .14), 0 0 0 111px rgba(255, 255, 255, .4);
  pointer-events: none;
}
.entry-content { width: min(100%, 410px); margin: auto; }
.entry-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 29px;
}
.entry-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #fff;
  box-shadow: 0 3px 10px rgba(52, 71, 92, .12);
}
.entry-brand strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.6px;
  font-weight: 700;
  color: #253040;
}
.entry-brand small {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: 1.7px;
  font-weight: 600;
  color: #8994a1;
}
.entry-card {
  width: 100%;
  padding: 35px 33px 29px;
  border: 1px solid #fff;
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 60px rgba(52, 71, 92, .09), 0 2px 8px rgba(52, 71, 92, .04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.entry-eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: #527292;
}
.entry-card h1 {
  margin: 12px 0 8px;
  font-size: 25px;
  letter-spacing: -.7px;
  font-weight: 690;
  color: #253040;
}
.entry-sub { margin: 0 0 22px; font-size: 12px; color: #86919d; line-height: 1.7; }
.entry-form { display: flex; flex-direction: column; gap: 15px; }
.entry-field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 580; color: #515d6b; }
.entry-field input {
  width: 100%;
  height: 45px;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  background: #f8fafc;
  color: #283647;
  font: inherit;
  font-size: 13px;
  outline: 0;
  transition: border-color .16s, box-shadow .16s;
}
.entry-field input::placeholder { color: #a9b2bc; }
.entry-field input:focus { border-color: #6987a9; box-shadow: 0 0 0 3px rgba(114, 152, 192, .15); }
.entry-error {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #f0d1ca;
  border-radius: 10px;
  background: #fff4f1;
  color: #a34537;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.entry-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border: 1px solid #304b6d;
  border-radius: 11px;
  background: #354f72;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
.entry-submit:hover:not(:disabled) { background: #273e5d; transform: translateY(-1px); }
.entry-submit:disabled { opacity: .45; cursor: not-allowed; }
.entry-switchline {
  margin-top: 20px;
  text-align: center;
  font-size: 11.5px;
}
.entry-switch { padding: 3px 2px; color: #385e88; font-weight: 650; }
.entry-switch:hover { text-decoration: underline; }
.entry-note { margin: 6px 0 0; text-align: center; font-size: 11px; color: #98a2ad; line-height: 1.6; }
.entry-foot { margin: 24px 0 0; text-align: center; font-size: 10px; letter-spacing: .5px; color: #929ca7; }
.entry-submit:focus-visible, .entry-switch:focus-visible { outline: 2px solid #6987a9; outline-offset: 3px; }
@media (max-width: 520px) {
  .entry-art { display: none; }
  .entry-card { padding: 28px 22px; }
  .entry-brand { margin-bottom: 24px; }
}

/* ------------------------------------------------ 未登录开始对话 */
.chat-login-prompt {
  margin-bottom: 10px;
  padding: 13px 15px;
  border: 1px solid #d8e4f2;
  border-radius: 14px;
  background: #f7faff;
}
.chat-login-title { display: flex; align-items: center; gap: 8px; color: var(--brand-deep); font-size: 13px; }
.chat-login-title .ui-icon { width: 16px; height: 16px; }
.chat-login-text { margin: 6px 0 10px; font-size: 11.5px; color: var(--ink-soft); line-height: 1.6; }
.chat-login-start {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 580;
  box-shadow: none;
}
.chat-login-start .ui-icon { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .chat-login-prompt { padding: 12px; }
}

/* Cloud Agent preview: lightweight progress controls, existing visual language. */
.chat-cancel {
  border: 1px solid #d7e0e8;
  color: #6c3b45;
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  box-shadow: none;
}
.chat-cancel[hidden] { display: none !important; }
.chat-session-item {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px; padding: 10px 12px; border: 0; background: transparent;
  border-radius: 10px; text-align: left; color: var(--ink); box-shadow: none;
}
.chat-session-item:hover { background: #f1f5fa; box-shadow: none; }
.chat-session-item strong {
  font-size: 12px; font-weight: 580; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; max-width: 100%;
}
.chat-session-item small { font-size: 10px; color: var(--ink-soft); }
.chat-artifacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.chat-artifacts strong { width: 100%; font-size: 12px; color: var(--ink-soft); }
.chat-artifact-link {
  border: 1px solid #dce6f0; border-radius: 10px; padding: 9px 12px;
  color: var(--brand); background: #f6faff; font-size: 12px;
  text-decoration: none; overflow-wrap: anywhere;
}
.chat-artifact-link:hover { background: #eaf3fd; }
@media (prefers-reduced-motion: reduce) {
  .chat-session-item, .chat-cancel, .chat-artifact-link { transition: none; }
}

/* D155 · 对话是主画布：门户导航在账号页保留，对话页收进左下账号菜单。 */
body.is-chat .top { display: none !important; }
body.is-chat .page, body.is-chat .view { width: 100%; }
body.is-chat .chat-shell { grid-template-columns: 248px minmax(0, 1fr); }
body.is-chat .chat-rail {
  gap: 5px;
  padding: 19px 11px 11px;
  background: #f7f7f8;
  border-right: 1px solid #eceef0;
}
.chat-rail-head { gap: 8px; }
.chat-rail-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  padding: 0 9px 6px;
  color: #242b32;
}
.chat-rail-brand img { width: 25px; height: 25px; border-radius: 8px; }
.chat-rail-brand strong { font-size: 14px; letter-spacing: -.03em; font-weight: 650; }
body.is-chat .chat-new {
  min-height: 39px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #303942;
  font-size: 12.5px;
  box-shadow: none;
}
body.is-chat .chat-new:hover:not(:disabled) { background: #e9ecef; border-color: transparent; }
body.is-chat .chat-new .ui-icon { width: 17px; height: 17px; color: #424f5f; }
body.is-chat .chat-rail-eye { padding: 13px 10px 5px; font-size: 11px; font-weight: 560; }
body.is-chat .chat-rail-empty {
  margin: 0;
  padding: 5px 10px;
  border: 0;
  color: #99a3ae;
  font-size: 11.5px;
  line-height: 1.5;
}
.chat-account-dock {
  position: relative;
  flex: none;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #e7e9ec;
}
.chat-account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  padding: 6px 8px;
  text-align: left;
  color: #2d3841;
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  font-size: 12.5px;
}
.chat-account-trigger:hover:not(:disabled),
.chat-account-trigger[aria-expanded="true"] { background: #e9ecef; box-shadow: none; }
.chat-account-trigger .who-avatar { width: 28px; height: 28px; font-size: 11px; }
.chat-account-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 550; }
.chat-account-trigger > .ui-icon { width: 13px; height: 13px; color: #8b97a1; }
.chat-account-menu {
  position: absolute;
  z-index: 80;
  bottom: calc(100% + 7px);
  left: 0;
  width: min(228px, calc(100vw - 32px));
  padding: 5px;
  border: 1px solid #e3e7ea;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(20, 36, 48, .13), 0 2px 5px rgba(20, 36, 48, .04);
}
.chat-account-menu a,
.chat-account-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 35px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #36434f;
  text-align: left;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.chat-account-menu a:hover,
.chat-account-menu button:hover:not(:disabled) { background: #f1f3f5; color: #1f2933; box-shadow: none; }
.chat-account-menu .ui-icon { width: 15px; height: 15px; color: #71808d; }
.chat-account-divider { height: 1px; background: #edf0f2; margin: 5px 4px; }

/* 无整行顶栏：移动端的会话按钮叠在画布上，不占用内容高度。 */
.chat-main { position: relative; }
body.is-chat .chat-scroll { padding: 22px 24px 18px; }
body.is-chat .chat-thread { max-width: 760px; gap: 17px; }
body.is-chat .chat-hero { padding: 0; }
body.is-chat .chat-hero-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 2px 12px rgba(42, 65, 92, .045);
}
body.is-chat .chat-hero h1 {
  margin: 19px 0 0;
  font-size: clamp(23px, 2.7vw, 29px);
  font-weight: 620;
  letter-spacing: -.045em;
}
body.is-chat .chat-suggest { gap: 8px; margin-top: 24px; max-width: 580px; }
body.is-chat .chat-suggest-btn {
  padding: 8px 11px;
  border: 1px solid #e5e9ed;
  border-radius: 10px;
  box-shadow: none;
  font-size: 11.5px;
  color: #586574;
}
body.is-chat .chat-suggest-btn .ui-icon { width: 14px; height: 14px; color: #4774b9; }
body.is-chat .chat-suggest-btn:hover:not(:disabled) { background: #f7f9fb; border-color: #d7e1ec; box-shadow: none; }
body.is-chat .chat-composer {
  padding: 8px clamp(14px, 3vw, 28px) calc(15px + env(safe-area-inset-bottom));
  background: #fff;
}
body.is-chat .chat-composer-inner { max-width: 760px; }
body.is-chat .chat-box {
  padding: 13px 14px 10px;
  border: 1px solid #e0e5e9;
  border-radius: 19px;
  box-shadow: 0 2px 15px rgba(24, 42, 59, .045);
}
body.is-chat .chat-box:focus-within {
  border-color: #a6bbd2;
  box-shadow: 0 2px 17px rgba(24, 42, 59, .06);
}
body.is-chat .chat-input { font-size: 14px; min-height: 28px; }
body.is-chat .chat-tools { min-height: 30px; }
body.is-chat .chat-hint { display: none; }
body.is-chat .chat-cancel { margin-left: auto; }
body.is-chat .chat-send { margin-left: auto; width: 32px; height: 32px; background: #2e3e50; }
body.is-chat .chat-send:disabled { background: #a9b2ba; opacity: .65; }
body.is-chat .chat-mode-trigger {
  height: 29px;
  padding: 5px 8px;
  gap: 6px;
  font-size: 11.5px;
  border-radius: 9px;
  background: #f4f5f6;
}
body.is-chat .chat-mode-menu {
  bottom: calc(100% + 9px);
  width: min(256px, calc(100vw - 30px));
  padding: 4px;
  border-radius: 13px;
  box-shadow: 0 10px 35px rgba(20, 36, 48, .14);
}
body.is-chat .chat-mode-option { min-height: 45px; gap: 8px; padding: 6px 8px; border-radius: 9px; }
body.is-chat .chat-mode-option > .ui-icon { width: 16px; height: 16px; }
body.is-chat .chat-mode-option-body strong { font-size: 12px; line-height: 17px; }
body.is-chat .chat-mode-option-body small { font-size: 10px; line-height: 14px; }
body.is-chat .chat-composer-state { display: flex; justify-content: center; padding: 8px 0 0; min-height: 21px; }
body.is-chat .chat-status {
  margin: 0;
  padding: 0;
  gap: 6px;
  background: transparent;
  border: 0;
  color: #99a3ab;
  font-size: 10.5px;
  font-weight: 470;
}
body.is-chat .chat-status[data-state="ready"] { background: transparent; color: var(--good); }
body.is-chat .chat-status-dot { width: 5px; height: 5px; }
body.is-chat .chat-notice {
  max-width: 100%;
  margin: 0 0 9px;
  padding: 8px 11px;
  background: #f7f9fb;
  border-color: #e8edf1;
  text-align: left;
  font-size: 11.5px;
}
/* 二级任务建议也沿用小菜单密度，不用大面积卡片挤占输入区。 */
body.is-chat .chat-cloud-hint,
body.is-chat .chat-context-preview { padding: 11px 13px; gap: 7px; margin-bottom: 9px; border-radius: 12px; }
body.is-chat .chat-cloud-hint-detail,
body.is-chat .chat-context-meta { font-size: 11px; line-height: 1.5; }
body.is-chat .chat-context-task { padding: 8px 10px; }

@media (max-width: 820px) {
  body.is-chat .chat-shell { grid-template-columns: minmax(0, 1fr); }
  body.is-chat .chat-rail { padding: 18px 11px 11px; }
  body.is-chat .chat-rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    left: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    color: #637181;
    background: #fff;
    border: 1px solid #edf0f2;
  }
  body.is-chat .chat-scroll { padding: 58px 17px 18px; }
  body.is-chat .chat-composer { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
  body.is-chat .chat-input { font-size: 16px; }
}
@media (max-width: 640px) {
  body.is-chat .top { display: none !important; }
  body.is-chat .chat-hero h1 { font-size: 23px; }
  body.is-chat .chat-suggest { max-width: 295px; gap: 6px; }
  body.is-chat .chat-suggest-btn { width: 100%; padding: 8px 11px; }
  body.is-chat .chat-box { padding: 11px 12px 9px; border-radius: 17px; }
  body.is-chat .chat-account-menu { width: min(225px, calc(100vw - 30px)); }
}

/* ------------------------------------------------ 2026-11-05 对话页重设计
   安静优先：浅色纸面、居中阅读列、轻量会话行；工具与文件按需展开。 */
body.is-chat { background: #fff; }
body.is-chat .page, body.is-chat .view { width: 100%; max-width: none; padding: 0; }
body.is-chat .chat-shell { grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
body.is-chat .chat-rail {
  background: #f7f7f8;
  border-right: 1px solid #eceef0;
  padding: 14px 10px 10px;
  gap: 2px;
}
body.is-chat .chat-rail-head { gap: 6px; padding: 0 4px; }
body.is-chat .chat-rail-brand { min-height: 32px; padding: 0 8px 4px; }
body.is-chat .chat-rail-brand strong { font-size: 13.5px; font-weight: 650; letter-spacing: -.02em; }
body.is-chat .chat-new {
  min-height: 36px; padding: 7px 9px; border: 0; border-radius: 9px;
  background: transparent; color: #303942; font-size: 12.5px; box-shadow: none;
}
body.is-chat .chat-new:hover:not(:disabled) { background: #eceef1; }
body.is-chat .chat-new .ui-icon { width: 16px; height: 16px; color: #4b5563; }
body.is-chat .chat-rail-eye { padding: 14px 9px 4px; font-size: 10.5px; letter-spacing: .04em; color: #9aa3ad; font-weight: 560; }
body.is-chat .chat-sessions { gap: 1px; padding: 0 2px; overflow-y: auto; }
body.is-chat .chat-session-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; padding: 8px 9px; border: 0; border-radius: 8px;
  background: transparent !important; color: #3a424b; box-shadow: none;
  text-align: left; font-size: 12.5px; line-height: 1.45;
}
body.is-chat .chat-session-item:hover { background: #e9ebee !important; }
body.is-chat .chat-session-item[aria-current="true"] { background: #e6e8eb !important; }
body.is-chat .chat-session-title {
  display: block; width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 540;
}
body.is-chat .chat-session-meta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: #9aa3ad;
}
body.is-chat .chat-session-dot { width: 5px; height: 5px; border-radius: 50%; background: #b7bec7; }
body.is-chat .chat-session-dot.done { background: #34a37a; }
body.is-chat .chat-session-dot.live { background: #3b82f6; }
body.is-chat .chat-session-dot.bad { background: #d06060; }
body.is-chat .chat-rail-empty { padding: 14px 9px; }
body.is-chat .chat-rail-empty strong { font-size: 12px; color: #6b7280; }
body.is-chat .chat-rail-empty span { font-size: 11px; color: #a0a7b0; }
body.is-chat .chat-rail-note {
  margin: 0 4px 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #fbf8f1;
  color: #8a7c5c;
  font-size: 10.5px;
  line-height: 1.55;
}
/* 左下角已经是空间切换器（portal-org.css）；旧的账号行样式保留给账号页复用，
   但不再给对话页的 dock 用。 */
body.is-chat .chat-account-dock { padding: 8px 4px 2px; border-top: 1px solid #eceef0; }
body.is-chat .chat-account-trigger { width: 100%; border-radius: 9px; background: transparent; }
body.is-chat .chat-account-trigger:hover { background: #eceef1; }

body.is-chat .chat-main { min-width: 0; display: flex; flex-direction: column; background: #fff; }
body.is-chat .chat-head {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 clamp(14px, 3vw, 28px);
  border-bottom: 1px solid #f0f1f3; background: rgba(255,255,255,.92);
}
body.is-chat .chat-head-copy { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
body.is-chat .chat-head-copy strong { font-size: 13.5px; font-weight: 620; color: #232a31; }
body.is-chat .chat-head-copy span { font-size: 11.5px; color: #98a1ab; }
body.is-chat .chat-head .chat-status { margin-left: auto; }
body.is-chat .chat-rail-toggle { display: none; }
@media (max-width: 860px) {
  body.is-chat .chat-rail-toggle { display: grid; }
  body.is-chat .chat-head { min-height: 50px; padding: 0 12px; }
}

body.is-chat .chat-scroll { padding: 28px 20px 150px; }
body.is-chat .chat-thread { width: 100%; max-width: 820px; margin: 0 auto; }
body.is-chat .chat-hero { padding: clamp(36px, 10vh, 110px) 0 20px; }
body.is-chat .chat-hero-mark { width: 52px; height: 52px; border-radius: 15px; box-shadow: 0 6px 20px rgba(31,41,55,.08); }
body.is-chat .chat-hero h1 { margin: 18px 0 8px; font-size: clamp(25px, 3.2vw, 32px); letter-spacing: -.04em; font-weight: 660; color: #1f2937; }
body.is-chat .chat-lead { max-width: 560px; margin: 0 auto; font-size: 13.5px; line-height: 1.7; color: #7b8490; }
body.is-chat .chat-suggest { margin-top: 26px; gap: 8px; }
body.is-chat .chat-suggest-btn {
  min-height: 34px; padding: 7px 12px; border: 1px solid #e6e8eb; border-radius: 999px;
  background: #fff; color: #4b5563; font-size: 12px; box-shadow: none;
}
body.is-chat .chat-suggest-btn:hover:not(:disabled) { background: #f7f8f9; border-color: #dcdfe3; }
body.is-chat .chat-suggest-btn .ui-icon { width: 14px; height: 14px; color: #6b7280; }

body.is-chat .chat-msg { margin: 0 0 22px; }
body.is-chat .chat-msg-user { display: flex; justify-content: flex-end; }
body.is-chat .chat-msg-user .chat-bubble {
  max-width: min(76%, 620px); padding: 10px 14px; border-radius: 16px;
  background: #f4f4f5; color: #252b33; font-size: 14px; line-height: 1.65;
}
body.is-chat .chat-msg-agent { display: flex; gap: 11px; align-items: flex-start; }
body.is-chat .chat-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: #f1f4f8; color: #6b7a8c;
}
body.is-chat .chat-msg-body { min-width: 0; font-size: 14.5px; line-height: 1.78; color: #2c333b; white-space: pre-wrap; overflow-wrap: anywhere; }
body.is-chat .chat-msg-agent .chat-bubble { background: transparent; padding: 0; }

body.is-chat .chat-tool {
  margin: 0 0 14px 37px; border: 1px solid #eceef1; border-radius: 10px;
  background: #fafbfc; overflow: hidden;
}
body.is-chat .chat-tool summary {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  cursor: pointer; list-style: none; color: #5b6572; font-size: 12px; font-weight: 550;
}
body.is-chat .chat-tool summary::-webkit-details-marker { display: none; }
body.is-chat .chat-tool summary .ui-icon { width: 14px; height: 14px; color: #8a94a0; }
body.is-chat .chat-tool-detail {
  margin: 0; padding: 10px 12px; border-top: 1px solid #eff1f3;
  max-height: 240px; overflow: auto; background: #fff;
  font: 11.5px/1.6 ui-monospace, "SF Mono", Consolas, monospace; color: #4b5563;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

body.is-chat .chat-artifacts { margin: 16px 0 0 37px; }
body.is-chat .chat-artifacts-title { margin: 0 0 8px; font-size: 11.5px; color: #8a94a0; }
body.is-chat .chat-file {
  display: flex; align-items: center; gap: 10px; max-width: 440px;
  padding: 9px 11px; margin-bottom: 8px; border: 1px solid #e6e8eb; border-radius: 11px;
  background: #fff; color: #2f3740; text-decoration: none;
  transition: border-color .16s ease, background .16s ease;
}
body.is-chat .chat-file:hover { background: #f8f9fa; border-color: #d8dce1; }
body.is-chat .chat-file-icon {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 8px; background: #f1f4f8; color: #5b6b7d;
}
body.is-chat .chat-file-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
body.is-chat .chat-file-body strong { font-size: 12.5px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-chat .chat-file-body small { font-size: 10px; color: #9aa3ad; letter-spacing: .04em; }
body.is-chat .chat-file-download { margin-left: auto; color: #8a94a0; display: grid; place-items: center; }

body.is-chat .chat-composer { padding: 0 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, #fff 72%, rgba(255,255,255,0)); }
body.is-chat .chat-composer-inner { width: 100%; max-width: 820px; margin: 0 auto; }
body.is-chat .chat-box {
  padding: 12px 13px 9px; border: 1px solid #e2e5e9; border-radius: 20px;
  background: #fff; box-shadow: 0 8px 28px rgba(24,39,55,.06);
}
body.is-chat .chat-box:focus-within { border-color: #c9d3df; box-shadow: 0 8px 30px rgba(24,39,55,.09); }
body.is-chat .chat-input { min-height: 26px; max-height: 200px; padding: 2px 2px 6px; border: 0; background: transparent; font-size: 14.5px; line-height: 1.6; resize: none; }
body.is-chat .chat-input:focus { box-shadow: none; }
body.is-chat .chat-tools { min-height: 32px; gap: 6px; }
body.is-chat .chat-mode-trigger {
  min-height: 30px; padding: 4px 9px; border: 1px solid #e6e8eb; border-radius: 9px;
  background: #f8f9fa; color: #4b5563; font-size: 12px; box-shadow: none;
}
body.is-chat .chat-mode-trigger:hover { background: #f1f3f5; }
body.is-chat .chat-hint { font-size: 11px; color: #a0a7b0; }
body.is-chat .chat-send {
  width: 34px; height: 34px; border-radius: 50%; background: #2f4a66;
  box-shadow: none;
}
body.is-chat .chat-send:hover:not(:disabled) { background: #243b52; }
body.is-chat .chat-send:disabled { background: #c7ccd2; opacity: .7; }
body.is-chat .chat-cancel {
  min-height: 30px; padding: 0 11px; border: 1px solid #e3d6c8; border-radius: 9px;
  background: #fffaf4; color: #8a5a2b; font-size: 11.5px; font-weight: 560; box-shadow: none;
}
body.is-chat .chat-cancel:hover:not(:disabled) { background: #fdf3e8; }
body.is-chat .chat-notice {
  margin: 0 auto 8px; max-width: 820px; padding: 8px 11px; border: 1px solid #eceef1;
  border-radius: 9px; background: #fafbfc; color: #6b7280; font-size: 11.5px;
}
body.is-chat .chat-notice[data-tone="bad"] { border-color: #f0d2d2; background: #fff7f7; color: #a34a4a; }
body.is-chat .chat-cloud-hint, body.is-chat .chat-context-preview { display: none !important; }
body.is-chat .chat-status {
  padding: 3px 8px; border: 0; border-radius: 999px; background: transparent;
  font-size: 10.5px; color: #8a94a0;
}
body.is-chat .chat-status[data-state="ready"] { color: #2f8a68; background: #eef8f3; }
body.is-chat .chat-status-dot { width: 5px; height: 5px; }
body.is-chat .chat-mode-menu {
  border: 1px solid #e4e7ea; border-radius: 12px; box-shadow: 0 12px 30px rgba(24,39,55,.10);
  padding: 5px;
}
body.is-chat .chat-mode-option { border-radius: 8px; min-height: 40px; }
body.is-chat .chat-mode-option:hover:not(:disabled) { background: #f5f6f7; }
body.is-chat .chat-account-menu {
  border: 1px solid #e4e7ea; border-radius: 12px; box-shadow: 0 12px 30px rgba(24,39,55,.10);
}
@media (max-width: 860px) {
  body.is-chat .chat-scroll { padding: 22px 14px 140px; }
  body.is-chat .chat-composer { padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
  body.is-chat .chat-msg-user .chat-bubble { max-width: 88%; }
  body.is-chat .chat-tool, body.is-chat .chat-artifacts { margin-left: 0; }
  body.is-chat .chat-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body.is-chat .chat-file, body.is-chat .chat-session-item, body.is-chat .chat-mode-trigger { transition: none; }
}

/* ------------------------------------------------ 2026-11-05 round 2
   Markdown, grouped tool activity, delivery layout and true mobile sizing. */
body.is-chat .chat-msg-body p { margin: 0 0 12px; }
body.is-chat .chat-msg-body p:last-child { margin-bottom: 0; }
body.is-chat .chat-msg-body h1,
body.is-chat .chat-msg-body h2,
body.is-chat .chat-msg-body h3 { margin: 18px 0 8px; line-height: 1.35; letter-spacing: -.02em; color: #1f2937; }
body.is-chat .chat-msg-body h1 { font-size: 20px; }
body.is-chat .chat-msg-body h2 { font-size: 17px; }
body.is-chat .chat-msg-body h3 { font-size: 15px; }
body.is-chat .chat-msg-body ul,
body.is-chat .chat-msg-body ol { margin: 0 0 12px; padding-left: 22px; }
body.is-chat .chat-msg-body li { margin: 3px 0; }
body.is-chat .chat-msg-body blockquote {
  margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid #d9e2ec;
  background: #f8fafc; color: #56616e; border-radius: 0 8px 8px 0;
}
body.is-chat .chat-msg-body a { color: #2563a8; text-decoration: underline; text-underline-offset: 2px; }
body.is-chat .chat-msg-body code {
  padding: 1px 5px; border-radius: 5px; background: #f1f3f5;
  font: 0.92em/1.5 ui-monospace, "SF Mono", Consolas, monospace; color: #334155;
}
body.is-chat .chat-code {
  position: relative; margin: 0 0 14px; padding: 14px 12px 12px; overflow-x: auto;
  border: 1px solid #e9ecef; border-radius: 10px; background: #fafbfc;
}
body.is-chat .chat-code code { padding: 0; background: transparent; font-size: 12px; white-space: pre; }
body.is-chat .chat-code-copy {
  position: absolute; top: 6px; right: 8px; min-height: 24px; padding: 2px 8px;
  border: 1px solid #e2e6ea; border-radius: 6px; background: #fff; color: #6b7280;
  font-size: 10.5px; box-shadow: none;
}
body.is-chat .chat-table-wrap { margin: 0 0 14px; overflow-x: auto; border: 1px solid #eceef1; border-radius: 10px; }
body.is-chat .chat-msg-body table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
body.is-chat .chat-msg-body th,
body.is-chat .chat-msg-body td { padding: 8px 10px; border-bottom: 1px solid #f0f2f4; text-align: left; white-space: nowrap; }
body.is-chat .chat-msg-body th { background: #f8fafb; color: #55616e; font-weight: 600; }
body.is-chat .chat-file-ref { color: #334155; font-weight: 560; }

body.is-chat .chat-tool-group {
  margin: 0 0 16px 37px; border: 1px solid #eceef1; border-radius: 10px;
  background: #fafbfc; overflow: hidden;
}
body.is-chat .chat-tool-group > summary {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  cursor: pointer; list-style: none; color: #5b6572; font-size: 12px; font-weight: 560;
}
body.is-chat .chat-tool-group > summary::-webkit-details-marker { display: none; }
body.is-chat .chat-tool-group > summary .ui-icon { width: 14px; height: 14px; color: #8a94a0; }
body.is-chat .chat-tool-count { margin-left: auto; color: #9aa3ad; font-size: 10.5px; }
body.is-chat .chat-tool-list { padding: 0 10px 6px; }
body.is-chat .chat-tool-row { border-top: 1px solid #f0f2f4; }
body.is-chat .chat-tool-row > summary {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px;
  cursor: pointer; list-style: none; color: #5b6572; font-size: 11.5px; font-weight: 530;
}
body.is-chat .chat-tool-row > summary::-webkit-details-marker { display: none; }
body.is-chat .chat-tool-state { margin-left: auto; font-size: 10.5px; color: #9aa3ad; }
body.is-chat .chat-tool-row[data-state="running"] .chat-tool-state { color: #3b82f6; }
body.is-chat .chat-tool-row[data-state="done"] .chat-tool-state { color: #2f8a68; }
body.is-chat .chat-tool-row[data-state="ended"] .chat-tool-state { color: #9aa3ad; }
body.is-chat .chat-tool-detail {
  margin: 0 0 8px; padding: 8px 10px; max-height: 240px; overflow: auto;
  border: 1px solid #eef1f3; border-radius: 8px; background: #fff;
  font: 11.5px/1.6 ui-monospace, "SF Mono", Consolas, monospace; color: #4b5563;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

body.is-chat .chat-artifacts { display: block; margin: 16px 0 0 37px; }
body.is-chat .chat-artifacts-title { margin: 0 0 8px; font-size: 11.5px; color: #8a94a0; }
body.is-chat .chat-file { width: 100%; max-width: 440px; }

/* True mobile sizing: one column, full viewport content, off-canvas rail. */
body.is-chat .chat-shell { height: 100dvh; min-height: 100dvh; overflow-x: hidden; }
body.is-chat .chat-main { height: 100%; min-height: 0; width: 100%; }
body.is-chat .chat-scroll { flex: 1; min-height: 0; }
body.is-chat .chat-composer { flex: none; }

@media (max-width: 860px) {
  body.is-chat .chat-shell { grid-template-columns: minmax(0, 1fr); }
  body.is-chat .chat-main { width: 100%; min-width: 0; }
  body.is-chat .chat-rail {
    background: #f7f7f8; border-right: 1px solid #eceef0;
    width: min(300px, 84vw); padding-top: 14px;
  }
  body.is-chat .chat-head { min-height: 48px; padding: 0 10px; gap: 8px; }
  body.is-chat .chat-head-copy { flex: 1; min-width: 0; }
  body.is-chat .chat-head-copy strong { font-size: 13px; }
  body.is-chat .chat-hero { padding: 24px 0 10px; }
  body.is-chat .chat-hero h1 { font-size: clamp(22px, 6.4vw, 26px); line-height: 1.3; }
  body.is-chat .chat-lead { font-size: 12.5px; padding: 0 6px; }
  body.is-chat .chat-suggest { gap: 6px; }
  body.is-chat .chat-suggest-btn { width: 100%; justify-content: flex-start; }
  body.is-chat .chat-scroll { padding: 16px 13px calc(112px + env(safe-area-inset-bottom)); }
  body.is-chat .chat-thread { max-width: none; }
  body.is-chat .chat-composer { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  body.is-chat .chat-box { border-radius: 16px; }
  body.is-chat .chat-tool-group, body.is-chat .chat-artifacts, body.is-chat .chat-run-note { margin-left: 0; }
  body.is-chat .chat-msg-user .chat-bubble { max-width: 92%; }
  body.is-chat .chat-file { max-width: none; }
  body.is-chat .chat-code { font-size: 11.5px; }
  body.is-chat .chat-table-wrap { max-width: 100%; }
}
@media (max-width: 360px) {
  body.is-chat .chat-hero h1 { font-size: 21px; }
  body.is-chat .chat-scroll { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 860px) {
  /* The chat head owns the toggle; it is a flex item, not a floating button. */
  body.is-chat .chat-rail-toggle {
    position: static; top: auto; left: auto; z-index: auto; flex: none;
  }
}
@media (max-width: 860px) {
  body.is-chat .chat-rail { transform: translateX(-110%); visibility: hidden; }
  body.is-chat .chat-shell[data-rail="open"] .chat-rail { transform: translateX(0); visibility: visible; }
}

body.is-chat .chat-pending {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  color: #8a94a0; font-size: 12.5px; line-height: 1.6;
}
body.is-chat .chat-pending-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #6b7a8c;
  animation: chat-pending-pulse 1.2s ease-in-out infinite;
}
@keyframes chat-pending-pulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1); }
}
body.is-chat .chat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
body.is-chat .chat-action {
  min-height: 27px; padding: 3px 9px; border: 1px solid #e6e9ec; border-radius: 7px;
  background: #fff; color: #6b7480; font-size: 11px; font-weight: 540; box-shadow: none;
}
body.is-chat .chat-action:hover:not(:disabled) { background: #f7f8f9; border-color: #dce1e6; color: #3f4a56; }
@media (prefers-reduced-motion: reduce) {
  body.is-chat .chat-pending-dot { animation: none; }
}

/* 会话化：一轮的产物与状态跟着这一轮走，不再堆在整段对话末尾。 */
body.is-chat .chat-artifacts { margin: -8px 0 20px 37px; }
body.is-chat .chat-run-note {
  margin: 0 0 18px 37px; padding: 7px 11px; border-radius: 9px;
  background: #fafbfc; color: #8a94a0; font-size: 11.5px; line-height: 1.6;
}
body.is-chat .chat-run-note[data-tone="bad"] { background: #fff7f7; color: #a34a4a; }

body.is-schedules .top { position: relative; top: auto; }
.schedules-page .card-head { justify-content: space-between; flex-wrap: wrap; }
.schedules-page .card, .schedules-page .hint { overflow-wrap: anywhere; }
.schedule-alerts { border-left: 3px solid var(--warn); }
.schedule-alert-list { padding-left: 20px; line-height: 1.8; }
.schedule-table-scroll { max-width: 100%; overflow-x: auto; }
.schedule-table-scroll:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
@media (min-width: 641px) { .schedules-page .list { min-width: 580px; } }
.schedule-create { max-width: 680px; }
@media (max-width: 640px) {
  body.is-schedules .tabs { overflow-x: auto; justify-content: flex-start; }
  body.is-schedules .tabs a { flex: 0 0 54px; }
}

/* 服务端记账后的用量；没有 usage 时这一行根本不存在。 */
body.is-chat .chat-usage {
  margin: 8px 0 0; font-size: 11px; line-height: 1.6;
  color: #9aa3ad; font-variant-numeric: tabular-nums;
}

/* One control: the send button becomes stop while the task runs. */
.chat-send[data-state="stop"] { background: #b0443a; }
.chat-send[data-state="stop"]:hover:not(:disabled) { background: #973a31; }
.chat-send[data-state="stop"] .ui-icon { width: 16px; height: 16px; }


/* Cloud agent product pass: a quiet, one-line history with explicit actions. */
body.is-chat .chat-nav-files {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px;
  padding: 7px 9px; border: 0; border-radius: 9px; text-align: left;
  background: transparent; color: #303942; font-size: 12.5px; box-shadow: none;
}
body.is-chat .chat-nav-files[hidden] { display: none !important; }
body.is-chat .chat-nav-files:hover,
body.is-chat .chat-nav-files[aria-current="page"] { background: #eceef1; }
body.is-chat .chat-nav-files .ui-icon { width: 16px; height: 16px; color: #4b5563; }
body.is-chat .chat-session-group {
  margin: 12px 0 4px; padding: 0 10px; color: #9299a2; font-size: 10.5px;
  font-weight: 560; letter-spacing: .015em;
}
body.is-chat .chat-session-row { position: relative; display: flex; min-width: 0; border-radius: 8px; }
body.is-chat .chat-session-row:hover { background: #e9ebee; }
body.is-chat .chat-session-row:has(.chat-session-item[aria-current="true"]) { background: #e6e8eb; }
body.is-chat .chat-session-row .chat-session-item {
  display: flex; flex-direction: row; align-items: center; flex: 1; min-width: 0;
  height: 36px; min-height: 36px; padding: 7px 36px 7px 9px;
  background: transparent !important;
}
body.is-chat .chat-session-row .chat-session-title { font-size: 12.5px; font-weight: 450; }
body.is-chat .chat-session-more {
  position: absolute; right: 3px; top: 3px; z-index: 2;
}
body.is-chat .chat-session-more > summary {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 7px; list-style: none; cursor: pointer;
  opacity: 0; color: #67717e;
}
body.is-chat .chat-session-more > summary::-webkit-details-marker { display: none; }
body.is-chat .chat-session-more > summary .ui-icon { width: 16px; height: 16px; }
body.is-chat .chat-session-row:hover .chat-session-more > summary,
body.is-chat .chat-session-more[open] > summary,
body.is-chat .chat-session-more > summary:focus-visible { opacity: 1; }
body.is-chat .chat-session-more > summary:hover { background: #dde1e5; }
body.is-chat .chat-session-menu {
  position: absolute; right: 0; top: 34px; width: 158px; padding: 5px;
  border: 1px solid #e8e9ec; border-radius: 10px; background: #fff;
  box-shadow: 0 12px 30px rgba(22,32,44,.13); z-index: 8;
}
/* 只有列表末尾的行才向上弹；会话很少时第一行向上弹会被侧栏头裁掉。 */
body.is-chat .chat-session-row[data-flip="true"] .chat-session-menu {
  top: auto; bottom: 34px;
}
body.is-chat .chat-session-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px;
  padding: 7px 9px; text-align: left; border: 0; border-radius: 7px;
  background: transparent; color: #a63d3d; font-size: 12px;
}
body.is-chat .chat-session-menu button:hover { background: #fff1f1; }
body.is-chat .chat-session-menu .ui-icon { width: 14px; height: 14px; }
body.is-chat .chat-session-meta, body.is-chat .chat-session-dot { display: none; }
body.is-chat .chat-msg-agent { gap: 0; }
body.is-chat .chat-tool-group.chat-work-progress {
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%;
  margin: -1px 0 16px; padding: 5px 0; border: 0; border-radius: 0;
  background: transparent; color: #87919d; font-size: 11.5px; font-weight: 450;
}
body.is-chat .chat-work-progress .chat-tool-count { margin: 0; font-size: inherit; color: inherit; }
body.is-chat .chat-work-pulse {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: #8aa2c1; animation: chat-work-pulse 1.4s ease-in-out infinite;
}
body.is-chat .chat-work-progress.complete { color: #9aa1aa; }
body.is-chat .chat-work-progress.complete .ui-icon { width: 12px; height: 12px; }
@keyframes chat-work-pulse { 50% { opacity: .25; } }

body.is-chat .chat-scroll[hidden], body.is-chat .chat-composer[hidden],
body.is-chat .chat-files-view[hidden] { display: none !important; }
body.is-chat .chat-files-view {
  flex: 1; min-width: 0; overflow-y: auto; padding: 46px clamp(18px, 5vw, 68px) 70px;
  background: #fff;
}
body.is-chat .chat-files-header, body.is-chat .chat-files-list {
  max-width: 900px; margin: 0 auto;
}
body.is-chat .chat-files-header h1 {
  margin: 0 0 8px; color: #222a32; font-size: clamp(23px,3vw,29px);
  font-weight: 640; letter-spacing: -.035em;
}
body.is-chat .chat-files-header p { margin: 0 0 28px; color: #7e8791; font-size: 12.5px; line-height: 1.6; }
body.is-chat .chat-files-search {
  width: 100%; max-width: 400px; height: 38px; padding: 0 13px;
  border: 1px solid #e0e4e8; border-radius: 10px;
  background: #fff; color: #27313a; font-size: 12.5px; outline: none;
}
body.is-chat .chat-files-search:focus { border-color: #8298b3; box-shadow: 0 0 0 3px rgba(91,125,166,.1); }
body.is-chat .chat-files-list { margin-top: 25px; }
body.is-chat .chat-files-row {
  display: flex; align-items: center; gap: 13px; min-height: 70px;
  padding: 12px 8px; border-bottom: 1px solid #eff0f2;
}
body.is-chat .chat-files-icon {
  display: grid; place-items: center; width: 37px; height: 37px; flex: none;
  border-radius: 10px; background: #f3f5f8; color: #697b90;
}
body.is-chat .chat-files-icon .ui-icon { width: 18px; height: 18px; }
body.is-chat .chat-files-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
body.is-chat .chat-files-details strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #28313a; font-size: 13px; font-weight: 560;
}
body.is-chat .chat-files-details small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #9199a2; font-size: 11px;
}
body.is-chat .chat-files-origin, body.is-chat .chat-files-download {
  border: 0; background: transparent; box-shadow: none; color: #758293;
  font-size: 11.5px; text-decoration: none;
}
body.is-chat .chat-files-origin:hover, body.is-chat .chat-files-download:hover { color: #375d87; }
body.is-chat .chat-files-download {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
}
body.is-chat .chat-files-download .ui-icon { width: 16px; height: 16px; }
body.is-chat .chat-files-empty { padding: 32px 3px; color: #939aa4; font-size: 12.5px; }
body.is-chat .chat-delete-dialog {
  width: min(400px, calc(100vw - 36px)); padding: 24px;
  border: 1px solid #eceef0; border-radius: 16px; background: #fff;
  color: #29323b; box-shadow: 0 18px 55px rgba(24,37,50,.2);
}
body.is-chat .chat-delete-dialog::backdrop { background: rgba(23,31,42,.28); }
body.is-chat .chat-delete-dialog h2 { margin: 0 0 10px; font-size: 17px; font-weight: 630; }
body.is-chat .chat-delete-dialog p { margin: 0 0 26px; font-size: 12.5px; line-height: 1.7; color: #707b87; }
body.is-chat .chat-delete-actions { display: flex; justify-content: flex-end; gap: 9px; }
body.is-chat .chat-delete-actions button {
  min-height: 34px; padding: 6px 14px; border-radius: 9px;
  border: 1px solid #e1e5e9; background: #fff; color: #3b4652; font-size: 12.5px;
}
body.is-chat .chat-delete-actions .chat-delete-confirm {
  border-color: #bf4949; background: #b94545; color: #fff;
}
body.is-chat .chat-delete-actions .chat-delete-confirm:hover { background: #a93e3e; }
@media (max-width: 860px) {
  body.is-chat .chat-session-more > summary { opacity: 1; }
  body.is-chat .chat-files-view { padding: 30px 17px 60px; }
  body.is-chat .chat-files-row { gap: 9px; }
  body.is-chat .chat-files-origin { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body.is-chat .chat-work-pulse { animation: none; }
}

/* 会话移动到项目：目标项目选择器 */
.chat-move-select {
  width: 100%; margin: 4px 0 12px; padding: 8px 10px;
  border: 1px solid #dde2e7; border-radius: 9px; background: #fff;
  font-size: 13px; color: #232a31;
}

/* One circular send control becomes a calm, high-contrast stop control. */
body.is-chat .chat-send[data-state="stop"] {
  background: #26303d; color: #fff; border-radius: 50%;
  box-shadow: 0 0 0 4px #eef1f5; transition: background .15s, box-shadow .15s;
}
body.is-chat .chat-send[data-state="stop"]:hover:not(:disabled) { background: #101923; box-shadow: 0 0 0 4px #e2e7ef; }
body.is-chat .chat-send[data-state="stop"]:focus-visible { outline: 2px solid #657a99; outline-offset: 5px; }
body.is-chat .chat-stop-square { width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
body.is-chat .chat-queued[hidden] { display: none; }
body.is-chat .chat-queued {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  margin-bottom: 8px; border-radius: 12px; background: #f3f5f8; color: #465364; font-size: 12px;
}
body.is-chat .chat-queued > span { flex: 1; min-width: 0; overflow-wrap: anywhere; max-height: 90px; overflow: auto; }
body.is-chat .chat-queued button { border: 0; background: transparent; color: #415f88; cursor: pointer; white-space: nowrap; }
body.is-chat .chat-work-elapsed { font-size: 11px; color: #788391; margin-left: 8px; }
body.is-chat .chat-work-progress { flex-wrap: wrap; row-gap: 4px; }
@media (prefers-reduced-motion: reduce) { body.is-chat .chat-work-pulse { animation: none; } }
@media (max-width: 480px) { body.is-chat .chat-tools .chat-hint { display: none; } }

body.is-chat .chat-status[hidden] { display: none !important; }

/* Chinese activity transcript: quiet summary, expandable public milestones. */
body.is-chat details.chat-work-progress { display: block; padding: 2px 0; margin: 14px 0 22px; color: #77808b; }
body.is-chat .chat-work-summary { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; list-style: none; cursor: pointer; font-size: 13px; }
body.is-chat .chat-work-summary::-webkit-details-marker { display: none; }
body.is-chat .chat-work-summary > .ui-icon { width: 14px; height: 14px; opacity: .65; transition: transform .15s; }
body.is-chat .chat-work-progress[open] .chat-work-summary > .ui-icon { transform: rotate(180deg); }
body.is-chat .chat-work-summary:focus-visible { outline: 2px solid #8aa3c1; outline-offset: 4px; border-radius: 4px; }
body.is-chat .chat-work-activities { list-style: none; margin: 14px 0 0 3px; padding: 0 0 0 18px; border-left: 1px solid #e2e7ed; }
body.is-chat .chat-work-activities li { margin: 0; padding: 5px 0; color: #8a929d; font-size: 13px; line-height: 1.65; }
body.is-chat .chat-msg-agent .chat-msg-body { line-height: 1.85; }
body.is-chat .chat-msg-user .chat-bubble { background: #edf4fc; color: #203b5b; border-radius: 22px; }
body.is-chat details.chat-work-progress.complete .chat-work-pulse { display: none; }
@media (prefers-reduced-motion: reduce) { body.is-chat .chat-work-summary > .ui-icon { transition: none; } }
body.is-chat details.chat-tool-group.chat-work-progress { display: block; width: 100%; margin: 14px 0 22px; }
body.is-chat details.chat-tool-group.chat-work-progress > summary { padding: 4px 0; font-size: 13px; font-weight: 450; }

/* Progressive task transcript: append blocks, keep their order, collapse only at terminal. */
body.is-chat .chat-progress-entry { animation: chat-progress-enter 340ms cubic-bezier(.22,1,.36,1) both; animation-delay: var(--entry-delay, 0ms); }
body.is-chat .chat-work-activities .chat-progress-prose { color: #344255; font-size: 14px; line-height: 1.85; padding: 9px 0; }
body.is-chat .chat-progress-prose > :first-child { margin-top: 0; }
body.is-chat .chat-progress-prose > :last-child { margin-bottom: 0; }
body.is-chat .chat-progress-prose p { margin: 0; }
body.is-chat .chat-answer-entry { animation: chat-progress-enter 420ms cubic-bezier(.22,1,.36,1) both; animation-delay: var(--entry-delay, 0ms); }
body.is-chat .chat-work-progress.complete .chat-work-summary { color: #87919d; }
body.is-chat .chat-work-progress .chat-work-activities { margin-top: 8px; }
@keyframes chat-progress-enter { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  body.is-chat .chat-progress-entry, body.is-chat .chat-answer-entry { animation: none; }
}
body.is-chat .chat-run-duration { font-size: 12px; color: #87919d; margin: 14px 0; }

/* User messages keep their original record; editing prepares a new submission. */
body.is-chat .chat-user-content { max-width: min(76%, 620px); min-width: 0; }
body.is-chat .chat-msg-user .chat-user-content .chat-bubble { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
body.is-chat .chat-user-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 5px; opacity: 0; transition: opacity 140ms ease; }
body.is-chat .chat-msg-user:hover .chat-user-actions, body.is-chat .chat-user-content:focus-within .chat-user-actions { opacity: 1; }
body.is-chat .chat-user-actions .chat-action { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #8b95a2; cursor: pointer; }
body.is-chat .chat-user-actions .chat-action:hover { background: #eef2f7; color: #3c5068; }
body.is-chat .chat-user-actions .ui-icon { width: 15px; height: 15px; }
body.is-chat .chat-work-pulse { display: none; }
@media (hover: none), (pointer: coarse) { body.is-chat .chat-user-actions { opacity: 1; } }
@media (max-width: 480px) { body.is-chat .chat-user-content { max-width: 92%; } }
@media (prefers-reduced-motion: reduce) { body.is-chat .chat-user-actions { transition: none; } }

/* Soft reading boundaries without overlays that block selection or clicks. */
body.is-chat .chat-scroll { --edge-top: 1; --edge-bottom: 1; mask-image: linear-gradient(to bottom, rgba(0,0,0,var(--edge-top)) 0, #000 24px, #000 calc(100% - 30px), rgba(0,0,0,var(--edge-bottom)) 100%); -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,var(--edge-top)) 0, #000 24px, #000 calc(100% - 30px), rgba(0,0,0,var(--edge-bottom)) 100%); }
body.is-chat .chat-scroll[data-edge-top="true"] { --edge-top: 0; }
body.is-chat .chat-scroll[data-edge-bottom="true"] { --edge-bottom: 0; }
body.is-chat .chat-caution { text-align: center; font-size: 11px; line-height: 1.5; font-weight: 450; color: #989fa8; margin: 0 0 8px; }
body.is-chat .chat-caution[hidden] { display: none; }
body.is-chat .chat-add-anchor { position: relative; flex: none; }
body.is-chat .chat-add { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #344252; cursor: pointer; }
body.is-chat .chat-add:hover, body.is-chat .chat-add[aria-expanded="true"] { background: #edf1f5; }
body.is-chat .chat-add .ui-icon { width: 21px; height: 21px; }
body.is-chat .chat-add-menu { position: absolute; left: 0; bottom: calc(100% + 14px); width: min(330px, calc(100vw - 48px)); padding: 7px; z-index: 100; border: 1px solid #e4e8ed; border-radius: 17px; background: #fff; box-shadow: 0 12px 42px #20364a1c; animation: space-panel-in 150ms ease; }
body.is-chat .chat-add-menu[hidden] { display: none; }
body.is-chat .chat-add-option { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 10px; border: 0; border-radius: 11px; background: transparent; text-align: left; color: #354354; cursor: pointer; }
body.is-chat .chat-add-option:hover { background: #f3f5f8; }
body.is-chat .chat-add-option > .ui-icon { width: 21px; height: 21px; flex: none; color: #7d8a99; }
body.is-chat .chat-add-option span { display: grid; gap: 3px; }
body.is-chat .chat-add-option strong { font-size: 14px; font-weight: 550; }
body.is-chat .chat-add-option small, body.is-chat .chat-add-hint { font-size: 11px; line-height: 1.6; color: #8b95a2; }
body.is-chat .chat-add-hint { padding: 4px 10px; margin: 3px 0; }
body.is-chat .chat-attachment-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0 10px; }
body.is-chat .chat-attachment-chips[hidden] { display: none; }
body.is-chat .chat-attachment-chip { display: flex; align-items: center; gap: 7px; max-width: 100%; padding: 7px 9px; border: 1px solid #e4e9ef; border-radius: 10px; color: #526277; font-size: 12px; }
body.is-chat .chat-attachment-chip > span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-chat .chat-attachment-chip .ui-icon { width: 15px; height: 15px; flex: none; }
body.is-chat .chat-attachment-chip button, body.is-chat .chat-library-head button { display: grid; place-items: center; background: transparent; color: #8490a0; border: 0; cursor: pointer; }
body.is-chat .chat-library-dialog { width: min(500px, calc(100vw - 36px)); max-height: 75vh; padding: 22px; border: 1px solid #e3e8ed; border-radius: 20px; box-shadow: 0 24px 80px #22344926; color: #344256; }
body.is-chat .chat-library-dialog::backdrop { background: #24334838; backdrop-filter: blur(3px); }
body.is-chat .chat-library-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
body.is-chat .chat-library-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
body.is-chat .chat-library-head .ui-icon { width: 20px; height: 20px; }
body.is-chat .chat-library-dialog input { box-sizing: border-box; width: 100%; border: 1px solid #e2e7ed; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
body.is-chat .chat-library-list { display: grid; gap: 4px; max-height: 45vh; overflow-y: auto; }
body.is-chat .chat-library-item { display: flex; align-items: center; gap: 9px; background: transparent; border: 0; padding: 12px 9px; border-radius: 9px; color: #44536a; text-align: left; cursor: pointer; }
body.is-chat .chat-library-item:hover { background: #f3f5f8; }
body.is-chat .chat-library-item .ui-icon { width: 18px; height: 18px; flex: none; }
body.is-chat .chat-library-item span { overflow-wrap: anywhere; }
body.is-chat .schedule-natural-editor { display: block; border: 1px solid #e2e7ed; border-radius: 20px; padding: 18px 20px 13px; background: #fff; box-shadow: 0 5px 24px #20354c06; margin: 24px 0; }
body.is-chat .schedule-natural-editor textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 0; outline: 0; padding: 3px 0 12px; background: transparent; font: inherit; font-size: 15px; line-height: 1.75; color: #334256; }
body.is-chat .schedule-natural-editor:focus-within { border-color: #a7b8cd; }
body.is-chat .schedule-natural-footer { display: flex; gap: 14px; justify-content: space-between; align-items: center; }
body.is-chat .schedule-understanding { margin: 0; min-width: 0; font-size: 12px; color: #8090a2; line-height: 1.6; }
body.is-chat .schedule-natural-footer button { border: 0; border-radius: 18px; padding: 9px 17px; background: #26394f; color: #fff; cursor: pointer; white-space: nowrap; font-weight: 550; }
body.is-chat .schedule-natural-footer button:disabled { opacity: .4; cursor: default; }
body.is-chat .schedule-natural-editor > .hint { margin: 11px 0 0; font-size: 10.5px; color: #a0a8b3; }
@media (prefers-reduced-motion: reduce) { body.is-chat .chat-add-menu { animation: none; } }
body.is-chat .chat-head .chat-status { display: none !important; }
body.is-chat .chat-attachment-loading { font-size: 12px; color: #8391a2; padding: 8px 3px; }
body.is-chat .chat-head-copy { min-width: 0; overflow: hidden; }
body.is-chat .chat-head-copy > strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }

/* 定时任务整页与项目/插件页共用留白，页标题不贴着顶栏。 */
body.is-chat .org-main > .schedules-page { padding: clamp(14px, 2.4vw, 26px) 0 48px; }

/* ------------------------------------------------ 2026-11-09 可靠性：待发送队列与终态
   队列按账号+会话存 localStorage；刷新后仍在，服务端确认前不删除。 */
body.is-chat .chat-queued {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  margin: 0 0 8px; padding: 8px 10px;
  border: 1px solid #e6e9ec; border-radius: 12px; background: #fafbfc;
  font-size: 11.5px; color: #4b5563;
}
body.is-chat .chat-queued-list { display: flex; flex-direction: column; gap: 6px; }
body.is-chat .chat-queue-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px;
  align-items: center; width: 100%;
}
body.is-chat .chat-queue-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #37424d; font-size: 11.5px;
}
body.is-chat .chat-queue-meta { grid-column: 1; color: #8b95a0; font-size: 10.5px; }
body.is-chat .chat-queue-row[data-status="failed"] .chat-queue-meta { color: #a45151; }
body.is-chat .chat-queue-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 2px; }
body.is-chat .chat-queue-action {
  min-height: 25px; padding: 3px 8px;
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: #415f88; font-size: 10.5px; font-weight: 540; box-shadow: none; cursor: pointer;
  white-space: nowrap;
}
body.is-chat .chat-queue-action:hover:not(:disabled) { background: #eef2f7; }
body.is-chat .chat-queue-remove { color: #8b95a0; }
body.is-chat .chat-queue-remove:hover:not(:disabled) { background: #f2f4f5; color: #5b6673; }

body.is-chat .chat-terminal {
  margin: 10px 0 2px; padding: 10px 12px;
  border: 1px solid #f0dede; border-radius: 12px; background: #fff8f8;
}
body.is-chat .chat-terminal[data-tone="neutral"] { border-color: #e8ebee; background: #fafbfc; }
body.is-chat .chat-terminal-text {
  margin: 0; font-size: 12.5px; line-height: 1.65; color: #8a4a4a;
}
body.is-chat .chat-terminal[data-tone="neutral"] .chat-terminal-text { color: #5b6673; }
body.is-chat .chat-terminal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
body.is-chat .chat-terminal-action {
  min-height: 28px; padding: 4px 10px;
  border: 1px solid #e7d2d2; border-radius: 8px; background: #fff;
  color: #7a4141; font-size: 11px; font-weight: 540; box-shadow: none; cursor: pointer;
}
body.is-chat .chat-terminal-action:hover:not(:disabled) { background: #fff2f2; }
body.is-chat .chat-terminal[data-tone="neutral"] .chat-terminal-action {
  border-color: #e0e4e8; color: #4b5563;
}
body.is-chat .chat-terminal[data-tone="neutral"] .chat-terminal-action:hover:not(:disabled) { background: #f4f6f7; }
@media (max-width: 640px) {
  body.is-chat .chat-queue-row { grid-template-columns: minmax(0, 1fr); }
  body.is-chat .chat-queue-actions { grid-column: 1; grid-row: auto; }
}

/* ------------------------------------------------ 2026-11-09 PR4：任务状态卡片
   一轮任务的状态、文件、预算、检查点与用量放在一处；失败/空交付沿用 chat-terminal。 */
body.is-chat .chat-run-card {
  margin: 12px 0 4px; padding: 11px 13px;
  border: 1px solid #e8ebee; border-radius: 13px; background: #fbfcfc;
}
body.is-chat .chat-run-card[data-tone="bad"] { border-color: #f0dede; background: #fff8f8; }
body.is-chat .chat-run-card[data-tone="warn"] { border-color: #f0e8d6; background: #fffbf3; }
body.is-chat .chat-run-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
body.is-chat .chat-run-card-status { font-size: 12px; font-weight: 610; color: #37424d; }
body.is-chat .chat-run-card[data-tone="bad"] .chat-run-card-status { color: #8a4a4a; }
body.is-chat .chat-run-card[data-tone="warn"] .chat-run-card-status { color: #8a6a2a; }
body.is-chat .chat-run-card-elapsed { font-size: 10.5px; color: #98a1ab; white-space: nowrap; }
body.is-chat .chat-run-card-text { margin: 6px 0 0; font-size: 12px; line-height: 1.65; color: #8a4a4a; }
body.is-chat .chat-run-card[data-tone="warn"] .chat-run-card-text { color: #8a6a2a; }
body.is-chat .chat-run-card-facts {
  display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 7px 0 0;
  font-size: 10.5px; color: #7b8490;
}
body.is-chat .chat-run-card-files {
  margin: 4px 0 0; font-size: 10.5px; color: #98a1ab;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.is-chat .chat-run-card-checkpoint {
  margin: 8px 0 0; padding: 7px 9px;
  border-radius: 9px; background: #f4f6f7;
  font-size: 10.5px; line-height: 1.6; color: #5b6673;
}
body.is-chat .chat-run-card-checkpoint p { margin: 0; }
body.is-chat .chat-run-card-muted { color: #98a1ab; }
body.is-chat .chat-run-card-feedback {
  margin: 8px 0 0; font-size: 10.5px; line-height: 1.65; color: #8a6a2a;
}
body.is-chat .chat-run-card-link { color: #415f88; text-decoration: none; }
body.is-chat .chat-run-card-link:hover { text-decoration: underline; }
body.is-chat .chat-run-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
body.is-chat .chat-run-card-action {
  min-height: 28px; padding: 4px 10px;
  border: 1px solid #e0e4e8; border-radius: 8px; background: #fff;
  color: #4b5563; font-size: 11px; font-weight: 540; box-shadow: none; cursor: pointer;
}
body.is-chat .chat-run-card-action:hover:not(:disabled) { background: #f4f6f7; }
body.is-chat .chat-run-card[data-tone="bad"] .chat-run-card-action {
  border-color: #e7d2d2; color: #7a4141;
}
body.is-chat .chat-run-card[data-tone="bad"] .chat-run-card-action:hover:not(:disabled) { background: #fff2f2; }
/* 加号与云工作同一排，收在输入框底部；圆钮不探出圆角。 */
body.is-chat .chat-tools { align-items: center; }
body.is-chat .chat-tools .chat-add {
  align-self: center;
  width: 32px; height: 32px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; box-shadow: none;
  background: #fff; color: #2c333b;
}
body.is-chat .chat-tools .chat-add .ui-icon { width: 18px; height: 18px; }
body.is-chat .chat-tools button.chat-add:hover:not(:disabled),
body.is-chat .chat-tools .chat-add[aria-expanded="true"],
body.is-chat .chat-tools button.chat-add:focus-visible {
  background: #f7f7f7; box-shadow: none; outline: none;
}

body.is-chat .chat-panel-anchor { position: relative; flex: none; }
body.is-chat .chat-panel {
  display: flex; align-items: center; gap: 4px;
  min-height: 30px; padding: 2px 5px 2px 7px;
  border: 1px solid #e6e8eb; border-radius: 9px;
  background: #f8f9fa; color: #4b5563;
}
body.is-chat .chat-panel[data-on="true"] {
  border-color: #d7dee6; background: #fff; color: #243446;
}
body.is-chat .chat-panel-open,
body.is-chat .chat-panel-switch {
  border: 0; box-shadow: none; font-weight: 550; color: inherit;
  background: transparent;
}
body.is-chat button.chat-panel-open {
  display: flex; align-items: center; gap: 6px;
  margin: 0; padding: 2px 4px 2px 0; border-radius: 7px;
  font-size: 12px; line-height: 1; cursor: pointer;
}
body.is-chat button.chat-panel-open:hover:not(:disabled) { background: transparent; box-shadow: none; }
body.is-chat button.chat-panel-switch:hover:not(:disabled) { background: #c9d0d8; box-shadow: none; }
body.is-chat button.chat-panel-switch[aria-checked="true"],
body.is-chat button.chat-panel-switch[aria-checked="true"]:hover:not(:disabled) { background: #212121; }
body.is-chat .chat-panel-mark { width: 18px; height: 18px; display: block; flex: none; }
body.is-chat .chat-panel-name { letter-spacing: .01em; }
body.is-chat .chat-panel-size {
  font-size: 11px; font-weight: 550; color: #7d8b99; font-variant-numeric: tabular-nums;
}
body.is-chat .chat-panel[data-on="false"] .chat-panel-size { display: none; }
body.is-chat button.chat-panel-switch {
  position: relative; width: 26px; height: 16px; padding: 0; border-radius: 99px;
  background: #d5dbe3; cursor: pointer; flex: none;
}
body.is-chat .chat-panel-knob {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20, 32, 44, .18);
  transition: transform .16s ease;
}
body.is-chat .chat-panel-switch[aria-checked="true"] .chat-panel-knob { transform: translateX(10px); }
body.is-chat .chat-panel-dialog {
  width: min(760px, calc(100vw - 28px)); max-height: min(860px, calc(100vh - 28px));
  margin: auto; padding: 22px 22px 18px; border: 0; border-radius: 22px;
  background: #fff; color: #243446; box-shadow: 0 24px 70px rgba(24, 39, 55, .18);
}
body.is-chat .chat-panel-dialog::backdrop { background: rgba(24, 36, 48, .38); }
body.is-chat .chat-panel-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
body.is-chat .chat-panel-dialog h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
body.is-chat .chat-panel-dialog-head p { margin: 6px 0 0; max-width: 46em; font-size: 13px; line-height: 1.6; color: #7d8b99; }
body.is-chat button.chat-panel-close {
  flex: none; margin: 0; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; box-shadow: none; color: #66768a; font-size: 13px; font-weight: 550; cursor: pointer;
}
body.is-chat button.chat-panel-close:hover:not(:disabled) { background: #f3f5f7; box-shadow: none; }
body.is-chat .chat-panel-toolbar { display: flex; align-items: center; gap: 8px; margin: 18px 0 16px; }
body.is-chat .chat-panel-formations { display: flex; flex-wrap: wrap; gap: 8px; }
body.is-chat button.chat-panel-formation {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  margin: 0; padding: 8px 12px; border: 1px solid #e6e8eb; border-radius: 12px;
  background: #fff; box-shadow: none; color: #3c4c5e; text-align: left; cursor: pointer;
}
body.is-chat button.chat-panel-formation strong { font-size: 13px; font-weight: 600; }
body.is-chat button.chat-panel-formation small { font-size: 11px; color: #8b95a2; font-weight: 450; }
body.is-chat button.chat-panel-formation:hover:not(:disabled) { background: #f7f8fa; box-shadow: none; }
body.is-chat button.chat-panel-formation[aria-checked="true"] { border-color: #243446; background: #f4f7fa; box-shadow: none; }
body.is-chat button.chat-panel-match {
  margin-left: auto; padding: 8px 12px; border: 0; border-radius: 12px;
  background: #243446; box-shadow: none; color: #fff; font-size: 13px; font-weight: 560; cursor: pointer; white-space: nowrap;
}
body.is-chat button.chat-panel-match:hover:not(:disabled) { background: #1b2833; box-shadow: none; }
body.is-chat .chat-panel-seats {
  display: grid; justify-content: center; justify-items: center; gap: 16px 12px;
  margin: 0; padding: 8px 4px 18px; border-bottom: 1px solid #eef1f4;
}
body.is-chat .chat-panel-seats[data-count="3"] { grid-template-columns: repeat(3, 96px); }
body.is-chat .chat-panel-seats[data-count="5"] { grid-template-columns: repeat(5, 96px); }
body.is-chat .chat-panel-seats[data-count="8"] { grid-template-columns: repeat(4, 96px); }
body.is-chat button.chat-panel-seat {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 92px;
  margin: 0; padding: 4px; border: 0; border-radius: 14px; background: transparent;
  box-shadow: none; color: #243446; cursor: pointer;
}
body.is-chat button.chat-panel-seat:hover:not(:disabled),
body.is-chat button.chat-panel-seat.is-over { background: #f4f7fa; box-shadow: none; }
body.is-chat .chat-panel-avatar {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  color: #fff; font-size: 18px; font-weight: 600; letter-spacing: .02em;
}
body.is-chat .chat-panel-roster .chat-panel-avatar { width: 40px; height: 40px; font-size: 15px; flex: none; }
body.is-chat .chat-panel-avatar[data-expert="brief"] { background: #3d5a73; }
body.is-chat .chat-panel-avatar[data-expert="research"] { background: #3f6f62; }
body.is-chat .chat-panel-avatar[data-expert="draft"] { background: #3e5f8a; }
body.is-chat .chat-panel-avatar[data-expert="budget"] { background: #8a6232; }
body.is-chat .chat-panel-avatar[data-expert="deck"] { background: #5b4d86; }
body.is-chat .chat-panel-avatar[data-expert="review"] { background: #6d4c5e; }
body.is-chat .chat-panel-avatar[data-expert="accept"] { background: #2f6d62; }
body.is-chat .chat-panel-avatar[data-expert="follow"] { background: #4d6272; }
body.is-chat .chat-panel-seat-name { font-size: 13px; font-weight: 600; }
body.is-chat .chat-panel-seat-hint { max-width: 88px; font-size: 11px; line-height: 1.35; color: #8b95a2; text-align: center; }
body.is-chat .chat-panel-roster-title { margin: 16px 0 8px; font-size: 12px; color: #8b95a2; }
body.is-chat .chat-panel-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
body.is-chat button.chat-panel-expert {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 8px;
  border: 1px solid transparent; border-radius: 14px; background: #f7f8fa; box-shadow: none;
  color: #243446; text-align: left; cursor: grab;
}
body.is-chat button.chat-panel-expert:hover:not(:disabled) { background: #f1f4f7; box-shadow: none; }
body.is-chat button.chat-panel-expert[aria-pressed="true"] { border-color: #243446; background: #fff; box-shadow: none; }
body.is-chat .chat-panel-expert strong { display: block; font-size: 13px; font-weight: 600; }
body.is-chat .chat-panel-expert small { display: block; margin-top: 1px; font-size: 11px; color: #8b95a2; font-weight: 450; }
@media (max-width: 640px) {
  body.is-chat .chat-panel-dialog { padding: 16px 14px 14px; }
  body.is-chat .chat-panel-toolbar { flex-wrap: wrap; }
  body.is-chat button.chat-panel-match { margin-left: 0; }
  body.is-chat .chat-panel-seats[data-count="5"],
  body.is-chat .chat-panel-seats[data-count="8"] { grid-template-columns: repeat(4, 76px); }
}
@media (prefers-reduced-motion: reduce) {
  body.is-chat .chat-panel-knob { transition: none; }
}

/* ---------------------------------------------------------------- 侧栏改版（2026-11-09）
   参考 ChatGPT 的分组语言：品牌更大、项目与历史同级、各自折叠并独立滚动；
   字体用系统里最接近 SF Pro / Segoe UI Variable 的字重，不再靠 10.5px 小字撑信息。 */
body.is-chat {
  --font-sans: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-family: var(--font-sans);
}
body.is-chat .chat-shell { grid-template-columns: 260px minmax(0, 1fr); }
body.is-chat .chat-rail {
  gap: 12px;
  padding: 20px 12px 12px;
  background: #f9f9f9;
  border-right: 1px solid #ececee;
}
body.is-chat .chat-rail-head { gap: 10px; }
body.is-chat .chat-rail-brand { min-height: 42px; padding: 0 8px 8px; }
body.is-chat .chat-rail-brand strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.05em;
  color: #171717;
}
body.is-chat .chat-new {
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
  gap: 9px;
}
body.is-chat .chat-new:hover:not(:disabled) { background: #ececee; }
body.is-chat .chat-new .ui-icon { width: 18px; height: 18px; color: #3f3f46; }
body.is-chat .rail-section-title {
  padding: 12px 9px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: #8a8f98;
}
body.is-chat .rail-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 16px;
  padding: 2px 0 4px;
}

/* 项目：标题行与历史同级，列表独立滚动，绝不把下方内容往下顶。 */
body.is-chat .rail-projects { flex: 0 0 auto; min-height: 0; margin: 0; padding: 0 2px; }
body.is-chat .rail-projects-head { gap: 0; }
body.is-chat .rail-projects-toggle {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #73737a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  gap: 6px;
}
body.is-chat .rail-projects-toggle:hover:not(:disabled) { background: #efefef; color: #171717; }
body.is-chat .rail-projects-toggle .ui-icon { width: 13px; height: 13px; color: #9a9aa0; }
body.is-chat .rail-projects-label { font-size: 13px; font-weight: 600; }
body.is-chat .rail-projects-count {
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #a0a0a6;
}
body.is-chat .rail-projects-add {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #73737a;
}
body.is-chat .rail-projects-add:hover:not(:disabled) { background: #e9e9e9; color: #171717; }
body.is-chat .rail-projects-add .ui-icon { width: 16px; height: 16px; }
body.is-chat .rail-projects-body { min-height: 0; }
body.is-chat .rail-projects-list {
  max-height: min(34vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
  scrollbar-width: thin;
  scrollbar-color: #d6d6da transparent;
}
body.is-chat .rail-project {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #2f2f33;
  font-size: 13.5px;
  font-weight: 500;
  gap: 9px;
}
body.is-chat .rail-project:hover:not(:disabled) { background: #ececee; }
body.is-chat .rail-project[aria-current="page"] { background: #e7e7e9; font-weight: 600; }
body.is-chat .rail-project > .ui-icon { width: 17px; height: 17px; color: #5f6067; }
body.is-chat .rail-project-count { color: #9a9aa0; font-size: 11px; }

/* 历史对话：与项目同一层级；展开时占满剩余高度并自己滚动。 */
body.is-chat .rail-section-head { display: flex; align-items: center; }
body.is-chat .rail-section { margin: 0; padding: 0 2px; }
body.is-chat .rail-history { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body.is-chat .rail-section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #73737a;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
body.is-chat .rail-section-toggle:hover:not(:disabled) { background: #efefef; color: #171717; }
body.is-chat .rail-section-toggle .ui-icon {
  width: 13px;
  height: 13px;
  color: #9a9aa0;
  transition: transform .15s ease;
}
body.is-chat .rail-section-toggle[aria-expanded="true"] .ui-icon { transform: rotate(90deg); }
body.is-chat .rail-section-count { margin-left: auto; font-size: 11.5px; font-weight: 500; color: #a0a0a6; }
body.is-chat .rail-history-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: 4px;
}
body.is-chat .rail-history[data-open="false"] .rail-history-body { display: none; }
body.is-chat .chat-sessions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 1px;
  padding: 0 0 4px;
  scrollbar-width: thin;
  scrollbar-color: #d6d6da transparent;
}
body.is-chat .chat-session-group {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #9a9aa0;
}
body.is-chat .chat-session-item {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.4;
}
body.is-chat .chat-session-title { font-weight: 500; }
body.is-chat .chat-session-item[aria-current="true"] {
  background: #e7e7e9 !important;
  font-weight: 600;
}
body.is-chat .chat-session-item:hover { background: #ececee !important; }
body.is-chat .chat-rail-empty { padding: 4px 10px; font-size: 12px; color: #9a9aa0; }
body.is-chat .chat-rail-note { margin: 0 8px 6px; font-size: 11px; line-height: 1.55; }

/* 新建项目：与 ChatGPT 的 Create project 同形的轻量弹层。 */
.project-create-dialog {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .24);
}
.project-create-dialog::backdrop { background: rgba(0, 0, 0, .42); backdrop-filter: blur(2px); }
.project-create-form { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.project-create-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-create-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: #171717; }
.project-create-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: #6b6b70; cursor: pointer;
}
.project-create-close:hover { background: #f1f1f3; color: #171717; }
.project-create-close .ui-icon { width: 18px; height: 18px; }
.project-create-label { font-size: 13px; font-weight: 600; color: #3f3f46; }
.project-create-field {
  display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 14px;
  border: 1px solid #d9d9de; border-radius: 12px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.project-create-field:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.project-create-field .ui-icon { width: 18px; height: 18px; flex: none; color: #6b6b70; }
.project-create-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; color: #1f1f1f;
}
.project-create-input::placeholder { color: #9a9aa0; }
.project-create-field input[type="text"],
.project-create-field .project-create-input {
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  padding: 0; min-height: 0;
}
.project-create-field input:focus,
.project-create-field input:focus-visible { outline: 0; box-shadow: none; border-color: transparent; }
.project-create-hint {
  display: flex; gap: 10px; padding: 12px 14px;
  border-radius: 12px; background: #f5f5f5;
  color: #5f5f66; font-size: 12.5px; line-height: 1.55;
}
.project-create-hint .ui-icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: #8a8a90; }
.project-create-hint p { margin: 0; }
.project-create-error { margin: 0; font-size: 12px; color: #b42318; }
.project-create-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.project-create-cancel {
  min-height: 36px; padding: 8px 14px; border: 0; border-radius: 999px;
  background: transparent; color: #5f5f66; font-size: 13.5px; font-weight: 550; cursor: pointer;
}
.project-create-cancel:hover { background: #f1f1f3; color: #171717; }
.project-create-submit {
  min-height: 40px; padding: 9px 18px; border: 0; border-radius: 999px;
  background: #1f1f1f; color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.project-create-submit:disabled { background: #c9c9ce; cursor: not-allowed; }
.project-create-submit:not(:disabled):hover { background: #000; }

body.is-chat .rail-projects-list::-webkit-scrollbar,
body.is-chat .chat-sessions::-webkit-scrollbar { width: 6px; }
body.is-chat .rail-projects-list::-webkit-scrollbar-thumb,
body.is-chat .chat-sessions::-webkit-scrollbar-thumb { background: #d6d6da; border-radius: 999px; }
body.is-chat .rail-projects-list::-webkit-scrollbar-track,
body.is-chat .chat-sessions::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 820px) {
  body.is-chat .chat-shell { grid-template-columns: minmax(0, 1fr); }
  body.is-chat .chat-rail { width: min(285px, 86vw); padding: 18px 11px 11px; }
  .project-create-form { padding: 20px; }
}

/* Expert team studio: one job, one accountable seat. A square stage keeps the ring a
   circle, columns scroll on their own, and the footer never covers the detail panel. */
body.is-chat .expert-studio {
  --es-bg: #fbfbfd; --es-card: #ffffff; --es-ink: #1d1d1f; --es-muted: #737780;
  --es-line: #e9eaee; --es-soft: #f3f4f7; --es-accent: #0071e3; --es-accent-soft: #eaf3ff;
  width: min(1060px, calc(100vw - 40px)); max-width: none; max-height: min(960px, calc(100dvh - 24px));
  margin: auto; padding: 0; border: 1px solid rgba(160,166,180,.22); border-radius: 24px;
  color: var(--es-ink); background: var(--es-bg); box-shadow: 0 40px 110px #12233e26, 0 2px 8px #12233e0f;
  font-family: var(--font-sans); text-align: left; overflow: hidden; overscroll-behavior: contain;
}
body.is-chat .expert-studio[open] { display: flex; flex-direction: column; }
body.is-chat .expert-studio::backdrop { background: #17203545; backdrop-filter: blur(10px); }
body.is-chat .expert-studio button { font-family: inherit; cursor: pointer; box-shadow: none; margin: 0; min-height: 0; letter-spacing: 0; }
body.is-chat .expert-studio button:focus-visible,
body.is-chat .expert-studio input:focus-visible,
body.is-chat .expert-studio textarea:focus-visible { outline: 2px solid var(--es-accent); outline-offset: 2px; }
body.is-chat .expert-studio [hidden] { display: none !important; }

body.is-chat .expert-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex: none; padding: 22px 28px 18px; border-bottom: 1px solid var(--es-line); background: var(--es-card); }
body.is-chat .expert-eyebrow { margin: 0 0 8px; color: var(--es-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
body.is-chat .expert-header h2 { margin: 0; font-size: 25px; font-weight: 640; line-height: 1.25; letter-spacing: -.02em; }
body.is-chat .expert-subtitle { margin: 7px 0 0; color: var(--es-muted); font-size: 12.5px; line-height: 1.6; }
body.is-chat button.expert-close { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--es-soft); color: var(--es-muted); font-size: 21px; font-weight: 300; transition: background .15s, color .15s; }
body.is-chat button.expert-close:hover { background: #e8eaee; color: var(--es-ink); }

body.is-chat .expert-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
/* A soft fade marks “there is more below”; a hard cut under the footer reads as broken. */
body.is-chat .expert-assembly { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; padding: 18px 26px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%); }
body.is-chat .expert-assembly-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
body.is-chat .expert-studio h3 { margin: 0; font-size: 14px; font-weight: 620; color: var(--es-ink); }
body.is-chat .expert-count { display: block; margin-top: 5px; font-size: 10.5px; line-height: 1.6; color: var(--es-muted); max-width: 300px; }
body.is-chat .expert-sizes { display: flex; flex: none; padding: 3px; border: 1px solid var(--es-line); border-radius: 10px; background: var(--es-soft); }
body.is-chat button.expert-size { border: 0; border-radius: 7px; padding: 5px 11px; background: transparent; color: var(--es-muted); font-size: 12px; transition: background .15s, color .15s; }
body.is-chat button.expert-size[aria-pressed="true"] { background: var(--es-card); color: var(--es-ink); box-shadow: 0 1px 3px #00000014; }

body.is-chat .expert-task-setup { display: flex; align-items: flex-start; gap: 8px; }
body.is-chat .expert-task-setup .expert-objective { flex: 1; height: 58px; min-height: 58px; margin: 0; }
body.is-chat .expert-task-setup button, body.is-chat .expert-task-setup select { flex: none; }
body.is-chat textarea.expert-task { box-sizing: border-box; display: block; width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--es-line); border-radius: 9px; background: var(--es-card); color: var(--es-ink); font: inherit; font-size: 12px; line-height: 1.6; resize: vertical; }
body.is-chat textarea.expert-task::placeholder { color: #9aa0aa; }
body.is-chat button.expert-match { padding: 0 14px; height: 38px; border: 1px solid var(--es-line); border-radius: 9px; background: var(--es-card); color: var(--es-ink); font-size: 12px; font-weight: 550; transition: border-color .15s, background .15s; }
body.is-chat button.expert-match:hover { border-color: #c6d5e6; background: #fbfcfe; }
body.is-chat .expert-duration { max-width: 148px; height: 38px; padding: 0 8px; border: 1px solid var(--es-line); border-radius: 9px; background: var(--es-card); color: var(--es-ink); font: inherit; font-size: 11px; }

/* Stage: a wide table. Chips are wider than their ring gap, so the ellipse keeps
   horizontal air for five chairs instead of stacking them on the centre emblem. */
body.is-chat .expert-orbit { position: relative; flex: none; width: min(100%, 500px); height: 292px; margin: 0 auto; }
body.is-chat .expert-orbit[data-size="8"] { height: 312px; }
body.is-chat .expert-orbit-ring { position: absolute; inset: 5%; border: 1px dashed #dfe3ea; border-radius: 50%; }
body.is-chat .expert-orbit-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 116px; height: 116px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #eef4ff 0%, #f7f9ff 55%, transparent 72%); text-align: center; }
body.is-chat .expert-orbit-core .chat-panel-mark { width: 24px; height: 24px; color: #7b89b0; }
body.is-chat .expert-orbit-core strong { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
body.is-chat .expert-orbit-core span { font-size: 9.5px; color: var(--es-muted); }

body.is-chat .expert-seat { position: absolute; transform: translate(-50%,-50%); width: 112px; transition: left .42s cubic-bezier(.22,.68,.32,1), top .42s cubic-bezier(.22,.68,.32,1); }
body.is-chat .expert-orbit[data-size="8"] .expert-seat { width: 84px; }
body.is-chat button.expert-seat-main { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; padding: 8px 4px 7px; border: 1px solid var(--es-line); border-radius: 15px; background: var(--es-card); color: var(--es-ink); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
body.is-chat button.expert-seat-main:hover { transform: translateY(-2px); border-color: #c8d8e9; box-shadow: 0 10px 22px #16365c14; }
body.is-chat button.expert-seat-main:active { transform: translateY(0); }
body.is-chat .expert-seat[data-filled="true"] button.expert-seat-main { border-color: #dbe4ef; box-shadow: 0 1px 2px #16365c0a; }
body.is-chat button.expert-seat-main.is-empty { border-style: dashed; border-color: #d9dde5; background: #ffffff90; color: var(--es-muted); }
body.is-chat button.expert-seat-main.is-empty:hover { border-color: #b9c9dc; background: var(--es-card); }
body.is-chat .expert-seat.is-dragging { opacity: .45; }
body.is-chat button.expert-seat-main.is-drop-target { border-color: var(--es-accent); background: var(--es-accent-soft); box-shadow: 0 0 0 3px #0071e31f; }
body.is-chat .expert-seat strong { font-size: 11px; font-weight: 560; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
body.is-chat .expert-orbit[data-size="8"] .expert-seat strong { font-size: 10px; }
body.is-chat .expert-seat small { color: var(--es-muted); font-size: 9px; letter-spacing: .01em; }
body.is-chat .expert-seat-leave { position: absolute; top: -9px; right: -7px; padding: 2px 6px; border-radius: 999px; background: #2b2f36; color: #fff; font-size: 9px; font-weight: 550; opacity: 0; transform: translateY(2px); transition: opacity .15s, transform .15s; pointer-events: none; }
body.is-chat button.expert-seat-main:hover .expert-seat-leave, body.is-chat button.expert-seat-main:focus-visible .expert-seat-leave { opacity: 1; transform: translateY(0); }
body.is-chat button.expert-seat-edit { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #f0f2f6; color: #737780; font-size: 10px; opacity: 0; transition: opacity .15s, background .15s; }
body.is-chat .expert-seat:hover button.expert-seat-edit, body.is-chat .expert-seat:focus-within button.expert-seat-edit { opacity: 1; }
body.is-chat button.expert-seat-edit:hover { background: #e3e7ee; color: var(--es-ink); }

body.is-chat .expert-avatar, body.is-chat .expert-empty-avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; font-size: 11.5px; font-weight: 650; font-family: var(--font-sans); letter-spacing: -.01em; }
body.is-chat .expert-seat .expert-avatar, body.is-chat .expert-seat .expert-empty-avatar { width: 40px; height: 40px; border-radius: 50%; }
body.is-chat .expert-orbit[data-size="8"] .expert-seat .expert-avatar, body.is-chat .expert-orbit[data-size="8"] .expert-empty-avatar { width: 32px; height: 32px; }
body.is-chat .expert-orbit[data-size="8"] button.expert-seat-main { gap: 2px; padding: 6px 3px 5px; border-radius: 13px; }
body.is-chat .expert-orbit[data-size="8"] .expert-seat small { font-size: 8.5px; }
body.is-chat .expert-empty-avatar { border: 1px dashed #ccd2db; color: #96a0ad; font-size: 20px; font-weight: 300; background: #fff; }
body.is-chat .expert-blue { background: linear-gradient(150deg,#eaf2ff,#d3e2fb); color: #345f97; }
body.is-chat .expert-violet { background: linear-gradient(150deg,#f3edff,#e3daf9); color: #6f5a99; }
body.is-chat .expert-mint { background: linear-gradient(150deg,#e9f8f3,#d2ebe3); color: #3a7569; }
body.is-chat .expert-amber { background: linear-gradient(150deg,#fdf2e3,#f5e4cb); color: #936f3f; }

body.is-chat .expert-presets { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; color: var(--es-muted); font-size: 10.5px; }
body.is-chat .expert-presets-label { margin-right: 2px; }
body.is-chat button.expert-preset { border: 1px solid var(--es-line); border-radius: 999px; padding: 5px 11px; color: #3c4149; font-size: 11px; background: var(--es-card); transition: border-color .15s, background .15s; }
body.is-chat button.expert-preset:hover { border-color: #c6d5e6; background: #fbfcfe; }
body.is-chat .expert-feedback { min-height: 16px; margin: 0; color: #4a5568; font-size: 10.5px; line-height: 1.6; text-align: center; }

body.is-chat .expert-detail { border: 1px solid var(--es-line); border-radius: 15px; padding: 12px 15px; background: var(--es-card); }
body.is-chat .expert-detail-empty strong { font-size: 12.5px; }
body.is-chat .expert-detail-empty p { margin: 7px 0 0; color: var(--es-muted); font-size: 11.5px; line-height: 1.75; }
body.is-chat .expert-detail-heading { display: flex; align-items: center; gap: 10px; }
body.is-chat .expert-detail-title { min-width: 0; }
body.is-chat .expert-detail-heading h3 { font-size: 13px; }
body.is-chat .expert-detail-heading p { margin: 3px 0 0; color: var(--es-muted); font-size: 11px; line-height: 1.55; }
body.is-chat button.expert-remove { flex: none; margin-left: auto; padding: 4px 9px; border: 1px solid var(--es-line); border-radius: 999px; background: var(--es-card); color: var(--es-muted); font-size: 10.5px; transition: border-color .15s, color .15s; }
body.is-chat button.expert-remove:hover { border-color: #e3c9c3; color: #a15a48; }
body.is-chat .expert-contract { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 4px 10px; margin: 10px 0 8px; font-size: 11px; line-height: 1.5; }
body.is-chat .expert-contract dt { color: var(--es-muted); }
body.is-chat .expert-contract dd { margin: 0; color: var(--es-ink); }
body.is-chat .expert-task-label { display: block; color: var(--es-muted); font-size: 10px; }

body.is-chat .expert-library { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 18px 18px 22px; border-left: 1px solid var(--es-line); background: var(--es-card); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
body.is-chat .expert-sources { display: flex; gap: 18px; }
body.is-chat button.expert-source { padding: 0 0 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 13px; font-weight: 600; color: var(--es-muted); background: transparent; }
body.is-chat button.expert-source[aria-pressed="true"] { color: var(--es-ink); border-bottom-color: var(--es-ink); }
body.is-chat .expert-library-note { margin: 10px 0 12px; color: var(--es-muted); font-size: 10px; line-height: 1.6; }
body.is-chat input.expert-search { box-sizing: border-box; width: 100%; padding: 9px 12px; border: 1px solid var(--es-line); border-radius: 10px; color: var(--es-ink); background: var(--es-soft); font: inherit; font-size: 12px; box-shadow: none; }
body.is-chat .expert-filters { display: flex; gap: 4px; padding: 10px 0; }
body.is-chat button.expert-filter { border: 0; border-radius: 6px; padding: 4px 8px; background: transparent; color: var(--es-muted); font-size: 11px; }
body.is-chat button.expert-filter[aria-pressed="true"] { color: var(--es-ink); background: var(--es-soft); }
body.is-chat .expert-library-list { display: grid; align-content: start; gap: 8px; padding: 2px 2px 4px; }
body.is-chat button.expert-role-card { display: block; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--es-line); border-radius: 13px; background: var(--es-card); color: var(--es-ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
body.is-chat button.expert-role-card:hover { border-color: #c6d5e6; box-shadow: 0 6px 16px #16365c0f; transform: translateY(-1px); }
body.is-chat .expert-role-card[data-assigned="true"] { border-color: #cfe0f2; background: #fafcff; }
body.is-chat .expert-card-heading { display: flex; align-items: center; gap: 9px; }
body.is-chat .expert-card-heading strong { display: block; font-size: 12px; font-weight: 620; }
body.is-chat .expert-card-heading small { display: block; margin-top: 3px; color: var(--es-muted); font-size: 9.5px; }
body.is-chat .expert-card-add { margin-left: auto; color: var(--es-accent); font-size: 16px; line-height: 1; }
body.is-chat .expert-role-card p { margin: 8px 0; color: var(--es-muted); font-size: 11px; line-height: 1.65; }
body.is-chat .expert-card-output { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--es-line); font-size: 10px; line-height: 1.55; }
body.is-chat .expert-card-output > span:first-child { flex: none; color: var(--es-muted); }
body.is-chat .expert-network-empty { padding: 44px 12px; text-align: center; }
body.is-chat .expert-network-symbol { display: block; margin-bottom: 14px; color: #a1b5ce; font-size: 42px; }
body.is-chat .expert-network-empty p, body.is-chat .expert-no-results { color: var(--es-muted); font-size: 12px; line-height: 1.75; }

body.is-chat .expert-footer { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 26px; border-top: 1px solid var(--es-line); background: var(--es-card); }
body.is-chat .expert-footer-copy { min-width: 0; }
body.is-chat .expert-footer strong { font-size: 12px; font-weight: 600; }
body.is-chat .expert-footer p { margin: 3px 0 0; color: var(--es-muted); font-size: 10px; line-height: 1.6; }
body.is-chat button.expert-done { flex: none; padding: 9px 20px; border: 0; border-radius: 999px; background: var(--es-accent); color: #fff; font-size: 12px; font-weight: 550; transition: background .15s, transform .15s; }
body.is-chat button.expert-done:hover { background: #0068d0; transform: translateY(-1px); }

@media (max-width: 900px) {
  body.is-chat .expert-body { grid-template-columns: minmax(0, 1fr) 290px; }
  body.is-chat .expert-assembly { padding: 16px 18px 22px; }
}
@media (max-width: 760px) {
  body.is-chat .expert-studio { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  body.is-chat .expert-header { padding: 18px 18px 14px; }
  body.is-chat .expert-header h2 { font-size: 21px; }
  /* One scrolling column: the crew, the chairs and the job list read top to bottom. */
  body.is-chat .expert-body { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: max-content; align-content: start; overflow-y: auto; }
  body.is-chat .expert-assembly { padding: 16px 16px 20px; overflow: visible; mask-image: none; -webkit-mask-image: none; }
  body.is-chat .expert-library { max-height: none; overflow: visible; border-left: 0; border-top: 1px solid var(--es-line); padding: 16px; }
  body.is-chat .expert-task-setup { flex-wrap: wrap; }
  body.is-chat .expert-task-setup .expert-objective { flex-basis: 100%; }
  body.is-chat .expert-count { max-width: 210px; }
  body.is-chat .expert-footer { padding: 12px 16px; gap: 12px; }
  body.is-chat .expert-footer p { display: none; }
  /* Phones turn the table into a two-column list: same chairs, no ring, no overlap. */
  body.is-chat .expert-orbit, body.is-chat .expert-orbit[data-size="8"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; height: auto; margin: 6px 0; }
  body.is-chat .expert-orbit .expert-orbit-ring { display: none; }
  body.is-chat .expert-orbit .expert-orbit-core { position: static; grid-column: 1 / -1; transform: none; width: 100%; height: 58px; margin-bottom: 2px; }
  body.is-chat .expert-orbit .expert-seat, body.is-chat .expert-orbit[data-size="8"] .expert-seat { position: static; transform: none; width: 100%; }
  body.is-chat .expert-orbit button.expert-seat-main, body.is-chat .expert-orbit[data-size="8"] button.expert-seat-main { flex-direction: row; gap: 8px; padding: 8px 10px; text-align: left; }
  body.is-chat .expert-orbit .expert-seat strong { max-width: none; }
  body.is-chat .expert-orbit .expert-seat small { display: none; }
  body.is-chat .expert-orbit button.expert-seat-edit { position: static; width: 24px; height: 24px; margin-left: auto; opacity: 1; }
}
@media (max-width: 420px) {
  body.is-chat .expert-seat strong { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  body.is-chat .expert-studio *, body.is-chat .expert-seat { transition: none !important; animation: none !important; }
}

body.is-chat .expert-task-setup textarea.expert-objective { height: 58px; min-height: 58px; }

/* Live team activity inside an answer. */
body.is-chat .expert-activity { margin: 8px 0 18px; padding: 15px 16px; border: 1px solid #e5e8ed; border-radius: 15px; background: #fbfbfd; font-size: 12px; }
body.is-chat .expert-active-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
body.is-chat .expert-active-count { color: #737780; font-size: 11px; }
body.is-chat .expert-active-members { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 10px; }
body.is-chat .expert-active-member { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 62px; }
body.is-chat .expert-active-member strong { font-size: 10px; font-weight: 550; }
body.is-chat .expert-active-member small { color: #737780; font-size: 10px; }
body.is-chat .expert-active-member[data-state="running"] .expert-avatar { outline: 2px solid #0071e3; outline-offset: 3px; }
body.is-chat .expert-active-member[data-state="failed"] small, body.is-chat .expert-active-member[data-state="interrupted"] small { color: #a15a48; }
body.is-chat .expert-handoffs-wrap { border-top: 1px solid #e9ecf1; padding-top: 10px; }
body.is-chat .expert-handoffs-wrap summary { color: #737780; font-size: 11px; cursor: pointer; }
body.is-chat .expert-handoffs { max-height: 300px; overflow-y: auto; margin: 8px 0 0; padding-left: 18px; }
body.is-chat .expert-handoffs li { margin-top: 10px; }
body.is-chat .expert-handoffs p { white-space: pre-wrap; font-size: 12px; line-height: 1.7; }

/* 统一对话轮次（2026-11-10）：检索来源小卡片与终态说明。
   来源只展示标题 + 域名，点开原链接；终态说明与 Run 状态卡片同一套浅色口径。 */
body.is-chat .chat-work-sources { padding: 8px 0 2px; }
body.is-chat .chat-sources-label { display: block; margin-bottom: 6px; font-size: 11px; color: #98a1ab; }
body.is-chat .chat-source-list { display: flex; flex-wrap: wrap; gap: 6px; }
body.is-chat .chat-source-card {
  display: inline-flex; flex-direction: column; gap: 2px;
  max-width: 240px; padding: 6px 9px;
  border: 1px solid #e6eaee; border-radius: 10px; background: #fff;
  color: #2c3a48; text-decoration: none;
}
body.is-chat .chat-source-card:hover { border-color: #d5dce3; background: #fbfcfd; text-decoration: none; }
body.is-chat .chat-source-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 500; line-height: 1.35;
}
body.is-chat .chat-source-domain { font-size: 11px; line-height: 1.3; color: #8a94a0; }
body.is-chat .chat-turn-note {
  margin: 12px 0 4px; padding: 11px 13px;
  border: 1px solid #f0dede; border-radius: 13px; background: #fff8f8;
}
body.is-chat .chat-turn-note[data-tone="warn"] { border-color: #f0e8d6; background: #fffbf3; }
body.is-chat .chat-turn-note-text { margin: 0; font-size: 13px; line-height: 1.7; color: #37424d; }
body.is-chat .chat-turn-note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
body.is-chat .chat-turn-note-action {
  min-height: 28px; padding: 4px 10px;
  border: 1px solid #e0e4e8; border-radius: 8px; background: #fff;
  color: #4b5563; font-size: 11px; font-weight: 540; box-shadow: none; cursor: pointer;
}
body.is-chat .chat-turn-note-action:hover:not(:disabled) { background: #f4f6f7; }

/* 专家团组合页：先读组合，再进对话。列表与卡片共用浅色口径，不改变对话入口。 */
body.is-chat .team-page { max-width: 1040px; margin: 0 auto; padding: 26px 26px 60px; }
body.is-chat .team-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
body.is-chat .team-page-eyebrow { margin: 0 0 8px; color: #737780; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
body.is-chat .team-page h1 { margin: 0; font-size: 26px; font-weight: 640; letter-spacing: -.02em; color: #1d1d1f; }
body.is-chat .team-page-lead { margin: 9px 0 0; max-width: 620px; color: #6b7078; font-size: 13px; line-height: 1.7; }
body.is-chat button.team-page-open { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 9px 15px; border: 1px solid #e4e6eb; border-radius: 999px; background: #fff; color: #1d1d1f; font-size: 12.5px; font-weight: 550; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
body.is-chat button.team-page-open:hover { border-color: #c8d5e4; box-shadow: 0 4px 12px #16365c10; }
body.is-chat .team-page-status { margin: 16px 0 0; padding: 9px 13px; border-radius: 10px; background: #f4f7fb; color: #4a5568; font-size: 12px; line-height: 1.6; }
body.is-chat .team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
body.is-chat .team-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid #e7e9ee; border-radius: 16px; background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s; }
body.is-chat .team-card:hover { border-color: #cbd9e8; box-shadow: 0 12px 28px #16365c12; transform: translateY(-2px); }
body.is-chat .team-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
body.is-chat .team-card h2 { margin: 0; font-size: 16px; font-weight: 620; color: #1d1d1f; }
body.is-chat .team-card-purpose { margin: 6px 0 0; color: #6b7078; font-size: 12px; line-height: 1.65; }
body.is-chat .team-card-size { flex: none; padding: 3px 9px; border-radius: 999px; background: #f2f4f7; color: #5b6169; font-size: 10.5px; }
body.is-chat .team-card-members { display: flex; flex-wrap: wrap; gap: 10px; }
body.is-chat .team-face { display: inline-flex; align-items: center; gap: 6px; }
body.is-chat .team-face .expert-avatar { width: 26px; height: 26px; border-radius: 9px; font-size: 9.5px; }
body.is-chat .team-face-name { color: #4b525b; font-size: 11px; }
body.is-chat .team-card-outcome { display: flex; gap: 7px; margin: 0; padding-top: 11px; border-top: 1px solid #eef0f3; color: #6b7078; font-size: 11px; line-height: 1.6; }
body.is-chat .team-card-outcome > span:first-child { flex: none; color: #9aa0a8; }
body.is-chat .team-card-actions { display: flex; flex-direction: column; align-items: stretch; gap: 9px; margin-top: auto; }
body.is-chat .team-card-note { margin: 0; color: #9aa0a8; font-size: 10px; line-height: 1.5; }
body.is-chat button.team-card-use { display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: flex-end; padding: 8px 13px; border: 0; border-radius: 999px; background: #0071e3; color: #fff; font-size: 11.5px; font-weight: 550; cursor: pointer; transition: background .15s, transform .15s; }
body.is-chat button.team-card-use:hover { background: #0068d0; transform: translateY(-1px); }
@media (max-width: 620px) {
  body.is-chat .team-page { padding: 18px 14px 48px; }
  body.is-chat .team-page h1 { font-size: 22px; }
  body.is-chat .team-grid { grid-template-columns: 1fr; }
  body.is-chat button.team-card-use { align-self: stretch; }
}

/* 交付区：过程文件默认折叠，避免把中间文件当成成果。 */
body.is-chat .chat-artifacts-more { margin-top: 8px; }
body.is-chat .chat-artifacts-more summary { color: #737780; font-size: 11.5px; cursor: pointer; line-height: 1.6; }
body.is-chat .chat-artifacts-more summary:hover { color: #4b525b; }
body.is-chat .chat-artifacts-more .chat-file { margin-top: 6px; }

/* 专家模式：编队列表、记忆与新建专家（2026-11-11） */
body.is-chat .expert-rose { background: linear-gradient(150deg,#fdecef,#f6d7de); color: #8c4052; }
body.is-chat .expert-roster { display: flex; flex-direction: column; gap: 8px; }
body.is-chat .expert-member textarea.expert-task { min-height: 52px; height: 52px; }
body.is-chat .expert-member { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border: 1px solid var(--es-line); border-radius: 13px; background: var(--es-card); }
body.is-chat .expert-member[data-filled="true"] { border-color: #dbe4ef; box-shadow: 0 1px 2px #16365c0a; }
body.is-chat button.expert-member.is-empty { flex-direction: row; align-items: center; gap: 10px; border-style: dashed; background: #ffffff90; color: var(--es-muted); text-align: left; padding: 11px 12px; }
body.is-chat button.expert-member.is-empty:hover { border-color: #b9c9dc; background: var(--es-card); }
body.is-chat .expert-member.is-empty strong { display: block; font-size: 12px; color: var(--es-ink); }
body.is-chat .expert-member.is-empty small { font-size: 10px; color: var(--es-muted); }
body.is-chat .expert-member-head { display: flex; align-items: center; gap: 9px; }
body.is-chat .expert-member-title { min-width: 0; flex: 1; }
body.is-chat .expert-member-title strong { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-chat .expert-member-title small { display: block; margin-top: 2px; font-size: 10px; color: var(--es-muted); }
body.is-chat button.expert-memory-badge { flex: none; padding: 3px 9px; border: 1px solid #cfe0f4; border-radius: 999px; background: var(--es-accent-soft); color: #2c5f96; font-size: 10px; font-weight: 550; }
body.is-chat button.expert-memory-badge:hover { border-color: #a9c9ec; }
body.is-chat .expert-estimate { display: block; margin-top: 4px; font-size: 10px; color: var(--es-muted); }
body.is-chat .expert-preset-save-row { display: flex; gap: 6px; flex: 1 1 100%; margin-top: 4px; }
body.is-chat input.expert-preset-name { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--es-line); border-radius: 9px; background: var(--es-soft); color: var(--es-ink); font: inherit; font-size: 11px; }
body.is-chat button.expert-preset-save { flex: none; padding: 5px 11px; border: 1px solid var(--es-line); border-radius: 999px; background: var(--es-card); color: var(--es-ink); font-size: 11px; }
body.is-chat button.expert-create-open { margin-top: 10px; padding: 8px 12px; border: 1px dashed #c8d8e9; border-radius: 10px; background: transparent; color: #2c5f96; font-size: 11.5px; }
body.is-chat button.expert-create-open:hover { background: var(--es-accent-soft); }
body.is-chat .expert-card-memory { color: #2c5f96; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
body.is-chat .expert-card-output { display: flex; justify-content: space-between; gap: 8px; }

body.is-chat dialog.expert-create { width: min(520px, 94vw); max-height: 88vh; padding: 0; border: 0; border-radius: 18px; background: var(--es-card); color: var(--es-ink); box-shadow: 0 24px 80px #10182838; }
body.is-chat dialog.expert-create::backdrop { background: #17203545; backdrop-filter: blur(8px); }
body.is-chat .expert-create-body { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow-y: auto; padding: 16px 22px; }
body.is-chat .expert-create-status { margin: 0; font-size: 11px; color: #a13b46; }
body.is-chat .expert-create-body label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--es-muted); }
body.is-chat .expert-create-input { box-sizing: border-box; width: 100%; padding: 8px 10px; border: 1px solid var(--es-line); border-radius: 9px; background: var(--es-soft); color: var(--es-ink); font: inherit; font-size: 12px; }
body.is-chat dialog.expert-create .expert-footer { border-top: 1px solid var(--es-line); }

body.is-chat .expert-memory-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
body.is-chat dialog.expert-memory-studio {
  --es-card: #ffffff; --es-ink: #1d1d1f; --es-muted: #737780;
  --es-line: #e9eaee; --es-soft: #f3f4f7; --es-accent: #0071e3; --es-accent-soft: #eaf3ff;
  width: min(920px, 94vw); height: min(760px, 88vh); padding: 0; border: 0; border-radius: 18px; background: var(--es-card); color: var(--es-ink); box-shadow: 0 24px 80px #10182838; display: flex; flex-direction: column; overflow: hidden; }
body.is-chat dialog.expert-memory-studio::backdrop { background: #17203545; backdrop-filter: blur(8px); }
body.is-chat .expert-memory-meta { margin: 5px 0 0; font-size: 11px; color: var(--es-muted); }
body.is-chat .expert-memory-tabs { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--es-line); background: var(--es-card); }
body.is-chat button.expert-memory-tab { padding: 7px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--es-muted); font-size: 12px; }
body.is-chat button.expert-memory-tab[aria-pressed="true"] { color: var(--es-ink); border-bottom-color: var(--es-accent); font-weight: 600; }
body.is-chat .expert-memory-toolbar { padding: 10px 22px 0; }
body.is-chat input.expert-memory-search { box-sizing: border-box; width: 100%; padding: 8px 11px; border: 1px solid var(--es-line); border-radius: 9px; background: var(--es-soft); color: var(--es-ink); font: inherit; font-size: 12px; }
body.is-chat .expert-memory-results { max-height: 120px; overflow-y: auto; margin-top: 6px; }
body.is-chat .expert-memory-result { padding: 6px 0; border-bottom: 1px solid var(--es-line); font-size: 11px; }
body.is-chat .expert-memory-result strong { margin-right: 6px; color: var(--es-muted); }
body.is-chat .expert-memory-result p { margin: 3px 0 0; }
body.is-chat .expert-memory-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 22px 22px; }
body.is-chat .expert-memory-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
body.is-chat .expert-memory-hint, body.is-chat .expert-memory-note { margin: 0 0 8px; font-size: 11px; color: var(--es-muted); line-height: 1.6; }
body.is-chat textarea.expert-memory-editor { box-sizing: border-box; width: 100%; min-height: 320px; padding: 12px 14px; border: 1px solid var(--es-line); border-radius: 11px; background: #fcfcfd; color: var(--es-ink); font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
body.is-chat .expert-memory-actions { display: flex; gap: 6px; flex-wrap: wrap; }
body.is-chat button.expert-memory-primary, body.is-chat button.expert-memory-secondary, body.is-chat button.expert-memory-quiet, body.is-chat button.expert-memory-danger { padding: 6px 12px; border-radius: 8px; font-size: 11px; border: 1px solid var(--es-line); background: var(--es-card); color: var(--es-ink); }
body.is-chat button.expert-memory-primary { background: var(--es-accent); border-color: var(--es-accent); color: #fff; }
body.is-chat button.expert-memory-secondary { border-color: #cfe0f4; color: #2c5f96; }
body.is-chat button.expert-memory-danger { color: #a13b46; border-color: #f0d2d7; }
body.is-chat .expert-memory-candidate, body.is-chat .expert-memory-version, body.is-chat .expert-memory-task { margin-bottom: 10px; padding: 11px 13px; border: 1px solid var(--es-line); border-radius: 11px; background: var(--es-card); }
body.is-chat .expert-memory-candidate[data-status="conflict"] { border-color: #f0cdb4; background: #fffaf6; }
body.is-chat .expert-memory-candidate-head, body.is-chat .expert-memory-version-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 11px; color: var(--es-muted); }
body.is-chat .expert-memory-candidate p, body.is-chat .expert-memory-version p, body.is-chat .expert-memory-task p { margin: 4px 0; font-size: 12px; line-height: 1.6; }
body.is-chat .expert-memory-evidence { color: var(--es-muted); font-size: 11px !important; }
body.is-chat .expert-memory-snippet { color: #444; font-size: 11px !important; }
body.is-chat .expert-memory-empty { padding: 20px 0; color: var(--es-muted); font-size: 12px; }
body.is-chat .expert-memory-status { margin: 0; padding: 8px 22px; border-top: 1px solid var(--es-line); font-size: 11px; color: var(--es-muted); background: var(--es-card); }
body.is-chat .expert-memory-status[data-bad="true"] { color: #a13b46; }

@media (max-width: 760px) {
  body.is-chat .expert-body { grid-template-columns: 1fr; overflow-y: auto; }
  body.is-chat .expert-library { border-left: 0; border-top: 1px solid var(--es-line); }
  body.is-chat dialog.expert-memory-studio { width: 100vw; height: 100dvh; border-radius: 0; }
  body.is-chat .expert-memory-head { flex-direction: column; }
}

/* Unified schedules: one compact surface for cloud runs and device mirrors. */
body.is-chat .schedule-unified { max-width: 920px; margin: 0 auto; padding: 0 18px 42px; }
body.is-chat .schedule-unified-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 0; }
body.is-chat .schedule-unified-heading h1 { margin: 0 0 5px; font-size: 23px; font-weight: 600; }
body.is-chat .schedule-unified-heading p { margin: 0; color: var(--ink-soft); font-size: 13px; }
body.is-chat .schedule-unified-heading button { flex: none; }
body.is-chat .schedule-unified-editor { margin: 20px 0 24px; padding: 15px 18px 12px; border-radius: 16px; box-shadow: none; }
body.is-chat .schedule-unified-editor textarea { min-height: 68px; resize: vertical; }
body.is-chat .schedule-unified-editor > .schedule-natural-footer { gap: 16px; }
body.is-chat .schedule-unified-editor .schedule-understanding { color: var(--ink-soft); }
body.is-chat .schedule-unified-advanced { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-soft); }
body.is-chat .schedule-unified-advanced summary { cursor: pointer; width: max-content; max-width: 100%; }
body.is-chat .schedule-unified-advanced-row { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 12px; }
body.is-chat .schedule-unified-advanced-row label { width: min(100%, 250px); display: grid; gap: 5px; }
body.is-chat .schedule-unified-advanced-row select { min-height: 36px; padding: 6px 10px; font-size: 12px; }
body.is-chat .schedule-unified-advanced .hint { margin: 9px 0 0; font-size: 12px; }
body.is-chat .schedule-unified-message { margin: 12px 0 0; color: var(--ink-2); font-size: 12px; }
body.is-chat .schedule-unified-alerts { border-left: 2px solid var(--warn); padding: 8px 0 8px 14px; margin-top: 18px; color: var(--ink-2); font-size: 12px; }
body.is-chat .schedule-unified-alert-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
body.is-chat .schedule-unified-alerts ul { margin: 6px 0 0; padding-left: 18px; }
body.is-chat .schedule-unified-alerts li { margin-top: 4px; }
body.is-chat .schedule-unified-alerts p { margin: 7px 0 0; }
body.is-chat .schedule-unified-section { margin-top: 10px; }
body.is-chat .schedule-unified-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 4px; }
body.is-chat .schedule-unified-section-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
body.is-chat .schedule-unified-count { color: var(--ink-faint); font-size: 12px; }
body.is-chat .schedule-unified-filters { display: flex; gap: 3px; align-items: center; margin-left: auto; }
body.is-chat .schedule-unified-filter { border: 0; background: transparent; box-shadow: none; color: var(--ink-soft); font-size: 12px; padding: 6px 12px; border-radius: 8px; }
body.is-chat .schedule-unified-filter[aria-pressed="true"] { background: var(--surface-inset); color: var(--ink); font-weight: 600; }
body.is-chat .schedule-unified-filter:hover:not(:disabled) { background: var(--line-soft); }
body.is-chat .schedule-unified-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 14px 2px; margin: 0; border-bottom: 1px solid var(--line-soft); background: none; box-shadow: none; }
body.is-chat .schedule-unified-row:first-child { border-top: 1px solid var(--line-soft); }
body.is-chat .schedule-unified-main { min-width: 0; flex: 1; }
body.is-chat .schedule-unified-title { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; }
body.is-chat .schedule-unified-title strong { font-size: 13.5px; font-weight: 570; overflow-wrap: anywhere; }
body.is-chat .schedule-unified-origin { color: var(--ink-soft); background: var(--surface-inset); border: 1px solid var(--line-soft); padding: 1px 7px; border-radius: 6px; font-size: 11px; }
body.is-chat .schedule-unified-meta { margin: 5px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.55; }
body.is-chat .schedule-unified-help { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-faint); }
body.is-chat .schedule-unified-details { margin-top: 5px; font-size: 12px; color: var(--ink-faint); }
body.is-chat .schedule-unified-details summary { width: max-content; cursor: pointer; }
body.is-chat .schedule-unified-details p { color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 7px 0 0; }
body.is-chat .schedule-unified-toggle { flex: none; font-size: 12px; padding: 6px 9px; }
body.is-chat .schedule-unified-muted { flex: none; color: var(--ink-faint); font-size: 11.5px; }
body.is-chat .schedule-unified-empty { padding: 34px 8px; text-align: center; color: var(--ink-faint); font-size: 13px; }
body.is-chat .schedule-unified-records { border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 14px; }
body.is-chat .schedule-unified-records > summary { color: var(--ink-soft); cursor: pointer; font-size: 12px; }
body.is-chat .schedule-unified-history-list { margin-top: 12px; }
body.is-chat .schedule-unified-history-row { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line-soft); padding: 10px 0; font-size: 12px; }
body.is-chat .schedule-unified-history-row > div { min-width: 0; flex: 1; }
body.is-chat .schedule-unified-history-row strong { font-weight: 550; color: var(--ink-2); }
body.is-chat .schedule-unified-history-row p { color: var(--ink-faint); margin: 4px 0 0; overflow-wrap: anywhere; }
body.is-chat .schedule-unified-outcome { white-space: nowrap; color: var(--ink-soft); }
body.is-chat .schedule-unified-outcome[data-tone="bad"] { color: var(--bad); }
body.is-chat .schedule-unified-history-row button { flex: none; padding: 6px 8px; font-size: 12px; }
@media (max-width: 640px) {
  body.is-chat .schedule-unified { padding: 0 12px 28px; }
  body.is-chat .schedule-unified-heading h1 { font-size: 20px; }
  body.is-chat .schedule-unified-editor { margin: 15px 0 20px; padding: 13px; }
  body.is-chat .schedule-unified-filter { padding: 6px 8px; }
  body.is-chat .schedule-unified-section-head { row-gap: 8px; }
  body.is-chat .schedule-unified-filters { width: 100%; margin: 0; }
  body.is-chat .schedule-unified-row { align-items: flex-start; }
  body.is-chat .schedule-unified-muted { align-self: center; }
  body.is-chat .schedule-unified-history-row { flex-wrap: wrap; }
}

/* Unified schedule page: one row shows place, rule and state once; details are on demand. */
body.is-chat .schedule-unified [hidden] { display: none !important; }
body.is-chat .schedule-unified-status { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
body.is-chat .schedule-unified-status[data-tone="warn"] { color: var(--warn); }
body.is-chat .schedule-unified-status[data-tone="muted"] { color: var(--ink-faint); }
body.is-chat .schedule-item-details { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
body.is-chat .schedule-item-prompt { margin: 0 0 6px; color: var(--ink-2); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
body.is-chat .schedule-item-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
body.is-chat .schedule-item-actions button { font-size: 12px; padding: 5px 9px; }
body.is-chat .schedule-item-editor { margin-top: 10px; }
body.is-chat .schedule-item-editor-form { display: grid; gap: 10px; max-width: 100%; }
body.is-chat .schedule-field { display: grid; gap: 5px; font-size: 12px; color: var(--ink-soft); min-width: 0; }
body.is-chat .schedule-field input, body.is-chat .schedule-field textarea, body.is-chat .schedule-field select,
body.is-chat .schedule-rule input, body.is-chat .schedule-rule select { width: 100%; box-sizing: border-box; min-width: 0; font: inherit; font-size: 12px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
body.is-chat .schedule-rule { display: grid; gap: 8px; }
body.is-chat .schedule-rule-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
body.is-chat .schedule-rule-row input[type="time"], body.is-chat .schedule-rule-row input[type="number"] { width: min(100%, 160px); }
body.is-chat .schedule-rule-row input[type="datetime-local"] { width: min(100%, 240px); }
body.is-chat .schedule-weekdays { display: flex; gap: 4px; flex-wrap: wrap; }
body.is-chat .schedule-weekdays label { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line-soft); border-radius: 6px; }
body.is-chat .schedule-item-form-actions { display: flex; gap: 8px; }
body.is-chat .schedule-item-form-actions button { font-size: 12px; padding: 6px 12px; }
@media (max-width: 640px) {
  body.is-chat .schedule-unified-title { gap: 5px 8px; }
  body.is-chat .schedule-unified-row { gap: 8px; }
  body.is-chat .schedule-unified-advanced-row label { width: 100%; }
  body.is-chat .schedule-item-editor-form { width: 100%; }
}
body.is-chat .schedule-unified-actions { display: flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; }
body.is-chat .schedule-unified-meta { overflow-wrap: anywhere; }
