:root {
  font-family: Inter, "Microsoft YaHei", sans-serif;
  color: #d9e5f2;
  background: #0a111c;
  --line: #203044;
  --panel: rgba(17, 29, 45, .82);
  --blue: #55b9ff;
  --muted: #8296aa;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% 0, #153250 0, transparent 34%), #0a111c; }
.login-screen { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; background: rgba(4, 10, 18, .92); backdrop-filter: blur(9px); }
.login-screen[hidden] { display: none; }
.login-card { width: min(390px, calc(100% - 40px)); padding: 32px; border: 1px solid #2a4760; border-radius: 15px; background: #101e2f; box-shadow: 0 24px 80px rgba(0, 0, 0, .4); }
.login-card p { color: var(--muted); font-size: 13px; margin: 20px 0; }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; color: #9fb4c8; font-size: 12px; }
.login-card input { border: 1px solid #28445d; border-radius: 7px; padding: 11px; background: #0b1725; color: #fff; outline: 0; }
.login-card input:focus { border-color: var(--blue); }
.login-error { min-height: 16px; color: #ff9da9; font-size: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; padding: 24px 16px; border-right: 1px solid var(--line); background: rgba(8, 16, 27, .9); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 700; color: #fff; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #54c9ff, #4f79ff); color: #07121f; }
.tenant { margin: 31px 10px 16px; color: var(--muted); font-size: 12px; }
.online-dot { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: #42df9b; }
nav { display: grid; gap: 15px; max-height: none; overflow: visible; }
.nav-section { display: grid; gap: 4px; }
.nav-section > span { padding: 0 13px 3px; color: #4e6a82; font-size: 10px; letter-spacing: 1px; }
nav button, .text-button { border: 0; background: transparent; color: #8fa5ba; text-align: left; padding: 12px 13px; border-radius: 9px; cursor: pointer; font-size: 14px; }
nav button:hover, nav button.active { color: #fff; background: rgba(77, 163, 229, .16); }
.side-foot { position: absolute; bottom: 24px; left: 26px; color: #526b82; font-size: 11px; }
.main { width: calc(100% - 238px); min-height: 100vh; margin-left: 238px; padding: 36px 42px; }
header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: #4e91c7; }
h1 { margin: 8px 0 0; color: #fff; font-size: 31px; }
h2 { margin: 0; color: #f4f8fb; font-size: 16px; }
.refresh, .primary { border: 1px solid #2e6e9f; background: #123352; color: #bde6ff; padding: 9px 15px; border-radius: 7px; cursor: pointer; }
.primary { border: 0; background: linear-gradient(135deg, #2184c4, #385bd0); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stats article, .panel { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.stats article { padding: 19px; }
.stats span, .stats small { display: block; color: var(--muted); font-size: 12px; }
.stats strong { display: block; margin: 11px 0 4px; color: #fff; font-size: 29px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.panel-head-actions, .workbench-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-search { width: min(320px, 100%); border: 1px solid #28445d; border-radius: 6px; padding: 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.contact-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.contact-filters select { min-width: 150px; }
.action-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -3px 0 16px; padding-bottom: 14px; border-bottom: 1px solid #1c2b3d; }
.group-action-target { display: grid; gap: 2px; min-width: 220px; max-width: 360px; padding: 7px 10px; border: 1px solid #28445d; border-radius: 6px; background: #0b1725; color: #d9e5f2; }
.group-action-target strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-action-target small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.group-action-target.muted { border-style: dashed; color: var(--muted); }
.friend-requests-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.friend-requests-section h3 { margin: 0; font-size: 15px; }
.friend-request-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.friend-request-toolbar .panel-search { flex: 1 1 260px; }
.friend-request-toolbar select { border: 1px solid #28445d; border-radius: 6px; padding: 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form select, .inline-form input { border: 1px solid #28445d; border-radius: 6px; padding: 8px 9px; background: #0b1725; color: #d9e5f2; outline: 0; }
.task-panel-head { align-items: flex-start; flex-wrap: wrap; gap: 14px 18px; }
.task-panel-head h2 { flex: 0 0 auto; white-space: nowrap; padding-top: 8px; }
.task-toolbar { display: flex; flex: 1 1 600px; min-width: 0; align-items: center; flex-wrap: wrap; gap: 10px; }
.task-outcome { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.task-outcome select { border: 1px solid #28445d; border-radius: 6px; padding: 8px 9px; background: #0b1725; color: #d9e5f2; }
.task-outcome input { accent-color: #55b9ff; }
.task-toolbar .task-outcome:nth-child(3) { flex: 1 1 220px; min-width: 180px; }
.task-toolbar .task-outcome:nth-child(3) input:not([type="checkbox"]) { min-width: 0; width: 100%; border: 1px solid #28445d; border-radius: 6px; padding: 8px 9px; background: #0b1725; color: #d9e5f2; outline: 0; }
.task-toolbar .primary { flex: 0 0 auto; white-space: nowrap; }
.form-label { display: grid; gap: 7px; margin-bottom: 12px; color: #9fb4c8; font-size: 12px; }
.form-label input, .form-label textarea, .form-label select { width: 100%; border: 1px solid #28445d; border-radius: 7px; padding: 10px; background: #0b1725; color: #e9f4ff; outline: 0; font: inherit; resize: vertical; }
.form-label input:focus, .form-label textarea:focus, .form-label select:focus { border-color: var(--blue); }
.stack-form { display: grid; gap: 2px; }
.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; margin-bottom: 17px; }
.policy-toggle { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 0; color: #c8d9e8; font-size: 13px; }
.policy-toggle input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: #55b9ff; }
.policy-fields { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(150px, .7fr) minmax(260px, 1.6fr); gap: 12px; }
.policy-fallback { margin-bottom: 0; }
.compact-list { display: grid; gap: 8px; margin-top: 15px; }
.config-runtime-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.config-runtime-status span { display: grid; gap: 4px; padding: 10px; border: 1px solid #22364a; border-radius: 7px; background: rgba(12, 24, 38, .65); color: var(--muted); font-size: 11px; }
.config-runtime-status b { color: #d9e5f2; font-size: 12px; }
.role-row { grid-template-columns: .7fr 2fr 1fr; }
.compact-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid #22364a; border-radius: 8px; background: rgba(12, 24, 38, .7); }
.compact-item strong, .compact-item small { display: block; }
.result-box { display: grid; gap: 8px; min-height: 84px; margin-top: 14px; padding: 13px; border: 1px solid #2a4760; border-radius: 8px; background: rgba(7, 18, 30, .72); line-height: 1.6; }
.result-box small { color: var(--muted); font-size: 11px; }
.knowledge-entries { display: grid; gap: 9px; margin-top: 16px; }
.knowledge-entry { padding: 13px; border: 1px solid #22364a; border-radius: 8px; background: rgba(12, 24, 38, .7); }
.knowledge-entry p { margin: 9px 0; color: #d5e4ef; line-height: 1.7; }
.entry-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.review-list { display: grid; gap: 9px; }
.review-item { display: grid; gap: 10px; min-width: 0; padding: 13px; border: 1px solid #4f4430; border-radius: 8px; background: rgba(31, 28, 20, .58); }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-width: 0; }
.review-head > div { min-width: 0; }
.review-head strong, .review-head small { display: block; }
.review-message { padding: 10px; border-left: 2px solid #ffd27a; color: #f3e3c2; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-draft { margin: 0; }
.error-text { color: #ff9da9; }
.muted { color: var(--muted); font-size: 12px; }
.robot-list, .robot-grid, .task-list { display: grid; gap: 9px; }
.robot-grid { grid-template-columns: repeat(3, 1fr); }
.robot, .task-row { display: flex; align-items: center; justify-content: space-between; padding: 13px; border: 1px solid #22364a; border-radius: 8px; background: rgba(12, 24, 38, .7); }
.channel-map-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.channel-map-hero p { max-width: 760px; margin: 10px 0 0; }
.channel-framework-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.channel-framework-card { display: grid; gap: 11px; min-width: 0; padding: 15px; border: 1px solid #22364a; border-radius: 8px; background: rgba(12, 24, 38, .7); }
.channel-framework-card.is-online { border-color: #2d8069; }
.channel-framework-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.channel-framework-head > div { min-width: 0; flex: 1; }
.channel-framework-head strong, .channel-framework-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-framework-head small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.channel-framework-card p { min-height: 38px; margin: 0; color: #c5d7e5; line-height: 1.55; font-size: 13px; }
.channel-framework-subtabs { display: flex; gap: 5px; min-width: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.channel-framework-subtab { flex: 0 0 auto; padding: 5px 7px; border: 1px solid #28445d; border-radius: 5px; background: rgba(8, 20, 33, .7); color: #8fa9bb; font-size: 10px; white-space: nowrap; }
.channel-framework-subtab.active { border-color: #4e91bd; background: #173650; color: #dff3ff; }
body[data-theme="light"] .channel-framework-subtab { background: #f7fbff; border-color: #c8d6e4; color: #617387; }
body[data-theme="light"] .channel-framework-subtab.active { background: #e4f1fb; border-color: #4c98c8; color: #21435d; }
body[data-theme="graphite"] .channel-framework-subtab { background: #15181c; border-color: #414852; color: #aeb7c4; }
body[data-theme="graphite"] .channel-framework-subtab.active { background: #2a3440; border-color: #8aa8ff; color: #e5e9ef; }
.channel-framework-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.channel-framework-meta span { min-width: 0; overflow-wrap: anywhere; }
.channel-framework-actions { display: flex; justify-content: flex-end; }
.workspace-tabs { display: flex; gap: 5px; overflow-x: auto; margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8, 17, 29, .7); scrollbar-width: thin; }
.workspace-tab { flex: 0 0 auto; border: 0; border-radius: 6px; padding: 10px 14px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; white-space: nowrap; }
.workspace-tab:hover, .workspace-tab.active { background: #183955; color: #ecf8ff; }
.workspace-pane[hidden] { display: none !important; }
body[data-theme="light"] .workspace-tabs { background: #eef3f8; border-color: #d8e1eb; }
body[data-theme="light"] .workspace-tab:hover, body[data-theme="light"] .workspace-tab.active { background: #dcecff; color: #1d5fae; }
body[data-theme="graphite"] .workspace-tabs { background: #20242a; border-color: #414852; }
body[data-theme="graphite"] .workspace-tab:hover, body[data-theme="graphite"] .workspace-tab.active { background: #2a3440; color: #e5e9ef; }
.robot-name { display: flex; gap: 10px; align-items: center; }
.robot-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #163a5b; color: #73c8ff; }
.state { color: #4ce0a0; font-size: 11px; }
.task-row { padding: 11px; }
.task-id { color: #9fb4c8; font-family: monospace; font-size: 11px; }
.status { padding: 4px 7px; border-radius: 5px; background: #203b52; color: #88cefa; font-size: 11px; }
.status.succeeded { background: #113f36; color: #69ebb9; }
.status.failed { background: #4a2630; color: #ff99a8; }
.status.verification_required { background: #493d1f; color: #ffd27a; }
.status.write_not_executed { background: #493d1f; color: #ffd27a; }
.status.blocked_by_account, .status.unavailable { background: #4a2630; color: #ff99a8; }
.table { display: grid; gap: 8px; }
.table-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid #1c2b3d; font-size: 13px; }
.contact-table-row { grid-template-columns: 34px 1.25fr 1fr .65fr 1fr 1.3fr; }
.group-table-row { grid-template-columns: 34px 1.4fr .7fr 1fr 1.2fr 1fr; }
.select-cell { display: flex; align-items: center; justify-content: center; }
.select-cell input { width: 15px; height: 15px; accent-color: var(--blue); }
.bulk-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px; border: 1px solid #22364a; border-radius: 7px; background: rgba(12, 24, 38, .55); }
.bulk-toolbar select, .bulk-toolbar input { border: 1px solid #28445d; border-radius: 6px; padding: 7px 9px; background: #0b1725; color: #d9e5f2; outline: 0; }
.bulk-toolbar input { min-width: 190px; }
.friend-request-row { grid-template-columns: 1.1fr 1.4fr 0.8fr 1.6fr 0.9fr 0.7fr; }
.history-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.history-toolbar .panel-search { flex: 1 1 auto; }
.history-toolbar select { flex: 0 0 auto; border: 1px solid #28445d; border-radius: 6px; padding: 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.history-toolbar .badge { flex: 0 0 auto; white-space: nowrap; }
.session-snapshot-panel { margin-top: 18px; }
.session-toolbar { display: flex; align-items: center; gap: 8px; }
.session-toolbar select { border: 1px solid #28445d; border-radius: 6px; padding: 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.snapshot-evidence { margin: -4px 0 12px; overflow-wrap: anywhere; }
.session-read-row { grid-template-columns: minmax(150px, 1.3fr) minmax(110px, .75fr) minmax(180px, 1.8fr) 55px 75px minmax(80px, .7fr); }
.session-read-row > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
.session-read-row strong, .session-read-row small { display: block; }
.session-unread { display: grid; place-items: center; justify-self: start; min-width: 26px; min-height: 26px; border: 1px solid #2b4257; border-radius: 50%; color: var(--muted); font-size: 11px; }
.session-unread.has-unread { border-color: #d5974b; background: #4b341b; color: #ffd799; }
.grid.two.wechat-read-grid { grid-template-columns: minmax(0, 1fr); }
.history-read-row { grid-template-columns: minmax(0, 2.4fr) .55fr .6fr minmax(150px, 1fr); }
.moments-read-row { grid-template-columns: minmax(0, 3fr) minmax(150px, 1fr); }
.contact-chat-settings-panel, .group-chat-settings-panel { margin-top: 18px; }
.group-chat-settings-panel .panel-head .refresh { flex: 0 0 auto; white-space: nowrap; }
.contact-settings-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) minmax(80px, .7fr); }
.history-read-row > span, .moments-read-row > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.55; }
.history-read-row .status { justify-self: start; }
.task-table-row { grid-template-columns: 1.2fr 1fr 1fr .5fr minmax(230px, 2fr); }
.capability-row { grid-template-columns: 1fr 2.4fr 1fr; }
.table-row.head { color: #6f879d; font-size: 11px; }
.workbench { padding: 0; overflow: hidden; }
.workbench-head { min-height: 76px; margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.workbench-head > div { display: grid; gap: 5px; }
.workbench-grid { display: grid; grid-template-columns: 250px minmax(360px, 1fr) 270px; min-height: 0; }
.conversation-sidebar, .contact-pane { min-width: 0; padding: 16px; background: rgba(8, 17, 29, .55); }
.conversation-sidebar { border-right: 1px solid var(--line); }
.contact-pane { border-left: 1px solid var(--line); }
.subhead { display: grid; gap: 11px; margin-bottom: 14px; }
.subhead strong { color: #edf6ff; font-size: 13px; }
.subhead input, .subhead select { width: 100%; border: 1px solid #28445d; border-radius: 6px; padding: 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.conversation-list { display: grid; gap: 6px; max-height: none; overflow: visible; }
.conversation-list[hidden], .workbench-resource-list[hidden] { display: none !important; }
.conversation-item { display: grid; gap: 5px; width: 100%; padding: 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #cfe0ec; text-align: left; cursor: pointer; }
.conversation-item:hover, .conversation-item.active { border-color: #2e6e9f; background: rgba(38, 103, 149, .2); }
.conversation-item strong, .conversation-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item small { color: var(--muted); font-size: 11px; }
.list-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; margin-top: 10px; padding: 10px 2px 0; border-top: 1px solid #1c2b3d; }
.list-pager > .muted { color: #b5d4e6; font-size: 11px; font-weight: 600; }
.list-pager .row-actions { display: flex; gap: 6px; }
.list-pager .task-action { min-width: 58px; }
.chat-pane { display: block; min-width: 0; background: rgba(9, 19, 32, .36); }
.chat-header { display: grid; gap: 4px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chat-header strong { color: #f3f8fc; }
.message-toolbar { display: flex; gap: 8px; margin-top: 8px; }
.message-toolbar input, .message-toolbar select { min-width: 0; border: 1px solid #28445d; border-radius: 6px; padding: 8px 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.message-toolbar input { flex: 1 1 auto; }
.message-toolbar select { flex: 0 0 auto; }
.message-toolbar input:focus, .message-toolbar select:focus { border-color: var(--blue); }
.message-list { display: flex; flex-direction: column; gap: 10px; padding: 20px; overflow: visible; min-height: 0; }
.message { display: flex; max-width: 82%; }
.message.outbound { align-self: flex-end; justify-content: flex-end; }
.message-bubble { padding: 10px 12px; border: 1px solid #29445b; border-radius: 8px; background: rgba(17, 35, 53, .9); }
.message.outbound .message-bubble { border-color: #286c58; background: rgba(15, 62, 54, .72); }
.message-meta { display: flex; gap: 8px; margin-bottom: 5px; color: #6f879d; font-size: 10px; }
.message-text { color: #e3eef6; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-attachment { margin: 6px 0 0; }
.message-attachment img { display: block; max-width: min(240px, 100%); height: auto; border-radius: 6px; }
.message-attachment figcaption, .message-receipt { margin-top: 4px; font-size: 12px; opacity: .85; }
.message-translation { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(122, 190, 228, .22); color: #9ed8f2; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.message-translation span { display: block; margin-bottom: 3px; color: #6f9db7; font-size: 10px; }
.chat-compose { display: flex; gap: 9px; padding: 14px 16px; border-top: 1px solid var(--line); }
.chat-compose input, .chat-compose textarea, .chat-compose select { min-width: 0; border: 1px solid #28445d; border-radius: 7px; padding: 10px; background: #0b1725; color: #e9f4ff; outline: 0; font: inherit; }
.chat-compose input { flex: 1; }
.chat-compose textarea { flex: 1; min-height: 48px; max-height: 150px; resize: vertical; line-height: 1.55; }
.chat-compose input:focus, .subhead input:focus { border-color: var(--blue); }
.contact-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.contact-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f3f8fc; }
.contact-summary { display: grid; gap: 14px; }
.contact-summary[hidden], #group-summary[hidden] { display: none !important; }
.contact-facts { display: grid; gap: 10px; margin: 0; }
.contact-facts div { display: grid; gap: 4px; }
.contact-facts dt { color: #6f879d; font-size: 11px; }
.contact-facts dd { margin: 0; color: #d9e5f2; line-height: 1.55; overflow-wrap: anywhere; }
.contact-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 12px; padding: 11px; border: 1px solid #243d53; border-radius: 7px; background: rgba(12, 27, 42, .55); }
.contact-source-grid div { display: grid; gap: 4px; min-width: 0; }
.contact-source-grid strong { overflow-wrap: anywhere; color: #dcecf7; font-size: 11px; font-weight: 500; }
.group-member-card { align-items: stretch; }
.contact-actions, .modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.followup-section { border-top: 1px solid var(--line); padding-top: 14px; }
.followup-section .panel-head { margin-bottom: 10px; }
.followup-list { display: grid; gap: 8px; max-height: none; overflow: visible; }
.followup-item { padding: 10px; border: 1px solid #22364a; border-radius: 8px; background: rgba(12, 24, 38, .7); }
.followup-item p { margin: 8px 0 5px; color: #d5e4ef; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.followup-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workbench { min-height: 0; }
.workbench-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 90px; margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(10, 22, 36, .72); }
.workbench-title { display: grid; gap: 5px; min-width: 0; }
.workbench-title h2 { font-size: 19px; }
.workbench-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.workbench-metrics { display: flex; align-items: center; gap: 13px; color: #8398aa; font-size: 11px; }
.workbench-metrics span { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.workbench-metrics strong { color: #d9eefb; font-size: 15px; }
.workbench-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(13, 27, 43, .58); }
.conversation-channel-tabs { display: flex; align-items: center; gap: 3px; padding-right: 12px; border-right: 1px solid var(--line); }
.conversation-filters { display: flex; align-items: center; gap: 3px; }
.filter-tab { border: 0; border-bottom: 2px solid transparent; padding: 10px 13px; background: transparent; color: #7f95a9; cursor: pointer; font-size: 12px; }
.filter-tab:hover, .filter-tab.active { border-bottom-color: var(--blue); color: #ecf8ff; }
.workbench-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.conversation-sidebar, .contact-pane { overflow: visible; }
.conversation-sidebar { padding: 16px 12px 16px 16px; }
.conversation-sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 2px 4px 13px 0; }
.conversation-sidebar-head > div { display: grid; gap: 3px; }
.conversation-sidebar-head strong { color: #edf6ff; font-size: 13px; }
.queue-live { display: inline-flex; align-items: center; gap: 5px; color: #65d9a7; font-size: 10px; }
.queue-live i { width: 6px; height: 6px; border-radius: 50%; background: #4ce0a0; box-shadow: 0 0 0 3px rgba(76, 224, 160, .12); }
.subhead { margin-bottom: 10px; }
.subhead input, .subhead select { width: 100%; }
.subhead select { border: 1px solid #28445d; border-radius: 6px; padding: 8px 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.conversation-list { display: grid; align-content: start; gap: 3px; min-height: 0; max-height: calc(100vh - 250px); overflow-y: auto; }
.conversation-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 9px; padding: 10px 8px; border-radius: 6px; }
.conversation-item:hover, .conversation-item.active { border-color: #2c638c; background: rgba(38, 103, 149, .2); }
.conversation-avatar, .chat-avatar, .contact-avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #24547a; color: #d9f3ff; font-size: 12px; font-weight: 700; }
.conversation-avatar { width: 32px; height: 32px; margin-top: 2px; }
.conversation-avatar.group, .chat-avatar.group { background: #5b4c2a; color: #ffe5a5; }
.conversation-copy { display: grid; min-width: 0; gap: 4px; }
.conversation-name-row, .conversation-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.conversation-name-row strong { color: #eaf4fb; font-size: 12px; }
.conversation-unread { display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #b36b32; color: #fff4df; font-size: 10px; }
.conversation-item small { font-size: 10px; }
.conversation-meta em { flex: 0 0 auto; padding: 2px 5px; border: 1px solid #62502a; border-radius: 4px; color: #e9c77c; font-size: 9px; font-style: normal; }
.workbench-grid { grid-template-columns: 278px minmax(430px, 1fr) 310px; min-height: 0; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 76px; padding: 13px 18px; }
.chat-header-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-header-main > div { display: grid; gap: 4px; min-width: 0; }
.chat-header-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-avatar { width: 36px; height: 36px; }
.chat-header-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.chat-language-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.chat-language-toggle input { accent-color: var(--blue); }
.chat-header-actions select { max-width: 112px; border: 1px solid #28445d; border-radius: 6px; padding: 7px; background: #0b1725; color: #d9e5f2; }
.chat-header .message-toolbar { flex: 1 1 auto; margin: 0 0 0 12px; }
.message-toolbar { min-width: 220px; }
.message-list { padding: 18px 20px; background: linear-gradient(180deg, rgba(9, 19, 32, .16), rgba(8, 18, 30, .48)); }
.message { max-width: min(76%, 680px); }
.message-bubble { position: relative; padding: 9px 12px; }
.message.outbound .message-bubble { border-top-right-radius: 3px; }
.message:not(.outbound) .message-bubble { border-top-left-radius: 3px; }
.chat-compose { display: grid; gap: 8px; padding: 10px 15px 11px; background: rgba(10, 22, 36, .82); }
.composer-tools, .composer-entry { display: flex; align-items: center; gap: 8px; }
.composer-tools select { border: 1px solid #28445d; border-radius: 6px; padding: 7px 8px; background: #0b1725; color: #d9e5f2; outline: 0; font-size: 11px; }
.composer-entry input { flex: 1; min-width: 0; }
.file-trigger { display: inline-flex; align-items: center; min-height: 29px; cursor: pointer; }
.composer-hint { color: #627d92; font-size: 10px; }
.contact-pane { padding: 16px 17px; }
.contact-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 13px; border-bottom: 1px solid #1c2b3d; margin-bottom: 14px; }
.contact-pane-head strong { color: #edf6ff; font-size: 13px; }
.contact-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.contact-identity > div { display: grid; gap: 5px; min-width: 0; }
.contact-avatar { width: 34px; height: 34px; background: #32695e; }
.contact-title { align-items: center; }
.contact-title strong { font-size: 14px; }
.priority-dot { width: 9px; height: 9px; border-radius: 50%; background: #7c8d9c; box-shadow: 0 0 0 3px rgba(124, 141, 156, .12); }
.priority-5 { background: #ff8b69; box-shadow: 0 0 0 3px rgba(255, 139, 105, .14); }
.priority-4 { background: #f0c05f; box-shadow: 0 0 0 3px rgba(240, 192, 95, .14); }
.priority-3 { background: #69c6a0; box-shadow: 0 0 0 3px rgba(105, 198, 160, .14); }
.quick-action-row { display: flex; gap: 7px; margin: 0 0 14px; }
.quick-action-row .task-action { flex: 1; }
.handling-block { padding: 12px; border: 1px solid #243d53; border-radius: 7px; background: rgba(12, 27, 42, .72); }
.handling-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.handling-block-head strong { color: #d9eaf5; font-size: 12px; }
.handling-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.handling-grid > div { display: grid; gap: 4px; min-width: 0; }
.field-label { color: #698197; font-size: 10px; }
.handling-grid strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dcecf7; font-size: 12px; font-weight: 500; }
.tag-strip { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid #1c2b3d; color: #b9d7e8; font-size: 12px; overflow-wrap: anywhere; }
.contact-facts { gap: 8px; padding-top: 12px; }
.contact-facts div { grid-template-columns: 54px minmax(0, 1fr); align-items: start; gap: 8px; }
.contact-facts dt { padding-top: 2px; }
.contact-facts dd { font-size: 11px; }
.followup-section { padding-top: 13px; }
.followup-list { max-height: 240px; }
.followup-item { padding: 9px; }
.followup-item p { font-size: 11px; }
.global-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.theme-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.theme-control select { border: 1px solid #28445d; border-radius: 6px; padding: 8px 9px; background: #0b1725; color: #d9e5f2; outline: 0; }
.help-trigger { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #315b7b; border-radius: 50%; background: #10283e; color: #b8e3fa; cursor: pointer; font-weight: 700; }
.resource-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 0 12px; padding: 3px; border: 1px solid #20394f; border-radius: 7px; background: rgba(7, 16, 27, .68); }
.resource-tab { border: 0; border-radius: 5px; padding: 8px 4px; background: transparent; color: #7690a5; cursor: pointer; font-size: 11px; }
.resource-tab b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 2px; border-radius: 9px; background: #1a334b; color: #a7c9dd; font-size: 9px; }
.resource-tab:hover, .resource-tab.active { background: #183955; color: #ecf8ff; }
.resource-tab.active b { background: #2c6d9b; color: #fff; }
.channel-center-panel { display: grid; gap: 16px; }
.channel-category-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.channel-category-tab { border: 1px solid #28445d; border-radius: 6px; padding: 8px 11px; background: rgba(10, 24, 39, .72); color: #8fa9bb; cursor: pointer; font-size: 11px; }
.channel-category-tab:hover, .channel-category-tab.active { border-color: var(--blue); background: #183955; color: #ecf8ff; }
.channel-category-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.channel-category-head h2 { margin: 0 0 4px; }
.channel-category-head .muted { display: block; }
body[data-theme="light"] .channel-category-tab { background: #f7fbff; border-color: #c8d6e4; color: #617387; }
body[data-theme="light"] .channel-category-tab:hover, body[data-theme="light"] .channel-category-tab.active { background: #e4f1fb; border-color: #4c98c8; color: #21435d; }
body[data-theme="graphite"] .channel-category-tab { background: #15181c; border-color: #414852; }
body[data-theme="graphite"] .channel-category-tab:hover, body[data-theme="graphite"] .channel-category-tab.active { background: #2a3440; border-color: #8aa8ff; color: #e5e9ef; }
.workbench-resource-list { display: grid; gap: 3px; }
.resource-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 9px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #cfe0ec; text-align: left; cursor: pointer; }
.resource-item:hover { border-color: #2c638c; background: rgba(38, 103, 149, .2); }
.resource-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #32695e; color: #e1fff5; font-size: 11px; font-weight: 700; }
.resource-avatar.group { background: #5b4c2a; color: #ffe5a5; }
.resource-copy { display: grid; gap: 3px; min-width: 0; }
.resource-copy strong, .resource-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-copy strong { color: #eaf4fb; font-size: 11px; }
.resource-copy small { color: var(--muted); font-size: 10px; }
.resource-arrow { color: #65b5e8; font-size: 10px; }
.composer-tools { flex-wrap: wrap; }
.compose-tool { border: 0; border-radius: 5px; padding: 7px 8px; background: transparent; color: #8eacc1; cursor: pointer; font-size: 11px; }
.compose-tool:hover { background: #173653; color: #eaf8ff; }
.compose-tool.disabled { color: #50667a; cursor: not-allowed; }
.chat-compose .composer-tools #chat-message-type { display: none; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #627d92; font-size: 10px; }
#composer-counter { flex: 0 0 auto; }
.help-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px; }
.help-hero h2 { margin: 7px 0; font-size: 24px; }
.help-hero p { max-width: 720px; margin: 0; color: #8fa6b9; line-height: 1.7; }
.help-grid { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 18px; }
.help-steps { display: grid; gap: 15px; margin: 0; padding-left: 22px; }
.help-steps li { padding-left: 5px; color: #d5e6f1; }
.help-steps strong, .help-steps span { display: block; }
.help-steps span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.shortcut-list { display: grid; gap: 10px; }
.shortcut-list div { display: flex; align-items: center; gap: 6px; color: #c9dce9; font-size: 12px; }
kbd { min-width: 24px; padding: 4px 6px; border: 1px solid #31506a; border-bottom-width: 2px; border-radius: 4px; background: #0b1725; color: #d9efff; text-align: center; font-size: 10px; }
.shortcut-list span { margin-left: 5px; }
.help-note { display: grid; gap: 5px; padding: 11px 0; border-bottom: 1px solid #1c2b3d; }
.help-note:last-child { border-bottom: 0; }
.help-note strong { color: #dbeef9; font-size: 12px; }
.help-note span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.ai-workspace { padding: 0; overflow: hidden; }
.ai-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: rgba(10, 22, 36, .72); }
.ai-workspace-head h2 { margin: 4px 0; font-size: 20px; }
.ai-workspace-head p { margin: 0; }
.ai-workspace-metrics { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 11px; }
.ai-workspace-metrics span { display: grid; gap: 4px; text-align: right; white-space: nowrap; }
.ai-workspace-metrics strong { color: #d9eefb; font-size: 17px; }
.ai-desk-grid { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(360px, 1.5fr) minmax(230px, .9fr); min-height: 560px; }
.ai-online-workspace { padding: 0; overflow: hidden; }
.ai-online-grid { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(420px, 1.6fr); min-height: 520px; }
.ai-online-context { min-width: 0; padding: 18px; border-right: 1px solid var(--line); background: rgba(8, 17, 29, .45); }
.ai-online-agent { min-width: 0; padding: 22px; }
.ai-online-facts { display: grid; gap: 8px; margin: 15px 0; }
.ai-online-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.ai-online-facts dt { color: var(--muted); }
.ai-online-facts dd { margin: 0; color: #d9e5f2; text-align: right; overflow-wrap: anywhere; }
.ai-online-setting-card, .ai-online-verification { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(17, 35, 53, .42); }
.setting-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-online-setting-card p, .ai-online-verification p { margin: 0; line-height: 1.5; font-size: 12px; }
.verification-actions { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; gap: 7px; align-items: center; }
.verification-actions input { min-width: 0; }
.subtle-link { color: var(--muted); font-size: 11px; text-decoration: none; }
.subtle-link:hover { color: var(--blue); text-decoration: underline; }
.ai-online-context-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.ai-online-context-details summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.ai-online-selection-note { display: block; margin-top: 8px; }
.ai-online-workspace .ai-workspace-metrics { align-items: center; }
.ai-online-workspace .ai-workspace-metrics span { text-align: right; }
.ai-online-workspace .ai-workspace-metrics .status { display: inline-block; font-size: 11px; }
.status.good { color: #1b8b5c; }
.status.paused { color: #a15b24; }
.ai-queue, .ai-agent-panel, .ai-knowledge-panel { min-width: 0; padding: 18px; }
.ai-queue { border-right: 1px solid var(--line); background: rgba(8, 17, 29, .45); }
.ai-agent-panel { background: rgba(9, 19, 32, .25); }
.ai-knowledge-panel { border-left: 1px solid var(--line); background: rgba(8, 17, 29, .45); }
.ai-column-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ai-column-head > div { display: grid; gap: 4px; min-width: 0; }
.ai-column-head strong { color: #edf6ff; font-size: 13px; }
.ai-column-head small { font-size: 11px; }
.ai-queue-context { min-height: 44px; margin-bottom: 12px; padding: 10px; border: 1px solid #28445d; border-radius: 7px; background: rgba(17, 35, 53, .6); line-height: 1.5; }
.ai-source-strip { display: flex; align-items: center; gap: 7px; margin: -2px 0 14px; color: var(--muted); font-size: 11px; }
.ai-source-dot { width: 7px; height: 7px; border-radius: 50%; background: #58d7a1; box-shadow: 0 0 0 3px rgba(88, 215, 161, .12); }
.ai-agent-controls { display: flex; align-items: end; gap: 10px; }
.ai-agent-controls .form-label { flex: 1; margin-bottom: 0; }
.ai-agent-controls .primary { flex: 0 0 auto; min-height: 40px; }
.ai-agent-panel .result-box { min-height: 150px; margin-top: 16px; }
.ai-agent-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ai-agent-actions .muted { margin-left: auto; }
.knowledge-search-form { display: flex; gap: 7px; margin-bottom: 10px; }
.knowledge-search-form input { min-width: 0; flex: 1; border: 1px solid #28445d; border-radius: 6px; padding: 9px; background: #0b1725; color: #e9f4ff; outline: 0; }
.knowledge-search-results { display: grid; gap: 8px; max-height: 405px; overflow: auto; margin-top: 12px; }
.knowledge-search-result { padding: 10px; border: 1px solid #28445d; border-radius: 7px; background: rgba(12, 24, 38, .72); }
.knowledge-search-result strong, .knowledge-search-result small { display: block; }
.knowledge-search-result p { margin: 7px 0; color: #d5e4ef; font-size: 12px; line-height: 1.55; }
.ai-admin-grid { display: grid; grid-template-columns: minmax(330px, .85fr) minmax(0, 1.5fr); gap: 18px; }
.knowledge-maintenance { min-width: 0; }
.knowledge-maintenance h3 { margin: 17px 0 8px; color: #dbeef9; font-size: 12px; }
.knowledge-admin-columns { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(0, 1.3fr); gap: 18px; margin-top: 16px; }
.knowledge-admin-columns .knowledge-entries { max-height: 390px; overflow: auto; }
body[data-theme="light"] { color: #25364a; background: #f3f6fa; --line: #d9e1eb; --panel: rgba(255, 255, 255, .96); --muted: #718096; --blue: #2d78ef; }
body[data-theme="light"] .sidebar { background: #f7f9fc; }
body[data-theme="light"] .group-action-target { background: #fff; border-color: #c7d6e4; color: #25364a; }
body[data-theme="light"] .group-action-target small { color: #718497; }
body[data-theme="light"] .main { background: #f3f6fa; }
body[data-theme="light"] .panel, body[data-theme="light"] .stats article { box-shadow: 0 5px 18px rgba(35, 58, 87, .06); }
body[data-theme="light"] .workbench-head, body[data-theme="light"] .workbench-toolbar, body[data-theme="light"] .chat-compose { background: #fff; }
body[data-theme="light"] .conversation-sidebar, body[data-theme="light"] .contact-pane { background: #f8fafc; }
body[data-theme="light"] .chat-pane { background: #fff; }
body[data-theme="light"] input, body[data-theme="light"] textarea, body[data-theme="light"] select, body[data-theme="light"] .theme-control select, body[data-theme="light"] kbd { background: #fff; color: #25364a; border-color: #cfd9e5; }
body[data-theme="light"] .form-label { color: #526b82; }
body[data-theme="light"] .result-box { background: #fff; color: #30465b; border-color: #cfd9e5; }
body[data-theme="light"] .result-box small { color: #617387; }
body[data-theme="light"] h1, body[data-theme="light"] h2, body[data-theme="light"] .conversation-name-row strong, body[data-theme="light"] .resource-copy strong { color: #1d2e43; }
body[data-theme="light"] .conversation-item, body[data-theme="light"] .resource-item { color: #30465b; }
body[data-theme="light"] .conversation-item:hover, body[data-theme="light"] .conversation-item.active, body[data-theme="light"] .resource-item:hover { background: #eaf3ff; border-color: #9bc3f4; }
body[data-theme="light"] .message-bubble { background: #f2f6fa; border-color: #d6e0eb; }
body[data-theme="light"] .message.outbound .message-bubble { background: #e4f7e9; border-color: #b6dfc0; }
body[data-theme="light"] .resource-tabs { background: #eef3f8; border-color: #d8e1eb; }
body[data-theme="light"] .resource-tab:hover, body[data-theme="light"] .resource-tab.active { background: #dcecff; color: #1d5fae; }
body[data-theme="light"] .handling-block { background: #f2f7fb; border-color: #d7e1eb; }
body[data-theme="light"] .contact-source-grid { background: #f2f7fb; border-color: #d7e1eb; }
body[data-theme="light"] .contact-source-grid strong { color: #30465b; }
body[data-theme="light"] .help-note, body[data-theme="light"] .followup-section { border-color: #e0e6ee; }
body[data-theme="light"] .brand { color: #1d2e43; }
body[data-theme="light"] .nav-section > span { color: #8b9aaa; }
body[data-theme="light"] nav button, body[data-theme="light"] .text-button { color: #526b82; }
body[data-theme="light"] nav button:hover, body[data-theme="light"] nav button.active { color: #1d5fae; background: #e2efff; }
body[data-theme="light"] .side-foot { color: #718096; }
body[data-theme="light"] .help-steps li { color: #30465b; }
body[data-theme="light"] .help-steps span, body[data-theme="light"] .help-hero p, body[data-theme="light"] .help-note span { color: #617387; }
body[data-theme="light"] .shortcut-list div { color: #30465b; }
body[data-theme="light"] .workbench-metrics strong, body[data-theme="light"] .conversation-sidebar-head strong, body[data-theme="light"] .contact-pane-head strong { color: #1d2e43; }
body[data-theme="light"] .contact-title strong,
body[data-theme="light"] .handling-block-head strong,
body[data-theme="light"] .handling-grid strong,
body[data-theme="light"] .wechat-group-title strong,
body[data-theme="light"] .detail-panel-head strong,
body[data-theme="light"] .wechat-info-list strong,
body[data-theme="light"] .wechat-member-card strong { color: #1d2e43; }
body[data-theme="light"] .field-label,
body[data-theme="light"] .contact-facts dt,
body[data-theme="light"] .wechat-group-subline,
body[data-theme="light"] .wechat-member-card small { color: #526b82; }
body[data-theme="light"] .contact-facts dd,
body[data-theme="light"] .tag-strip,
body[data-theme="light"] .detail-evidence,
body[data-theme="light"] .wechat-member-fields dd { color: #1d2e43; }
body[data-theme="light"] .tag-strip,
body[data-theme="light"] .contact-pane-head,
body[data-theme="light"] .followup-section { border-color: #e0e6ee; }
body[data-theme="light"] .followup-item { background: #fff; border-color: #d7e1eb; }
body[data-theme="light"] .followup-item p,
body[data-theme="light"] .followup-item small { color: #1d2e43; }
body[data-theme="light"] .quick-action-row .task-action,
body[data-theme="light"] .wechat-group-actions .task-action { border-color: #b7cbe0; background: #f4f8fc; color: #1d4e86; }
body[data-theme="light"] .quick-action-row .task-action:hover,
body[data-theme="light"] .wechat-group-actions .task-action:hover { border-color: #2d78ef; color: #143e72; }
body[data-theme="light"] .filter-tab { color: #60758a; }
body[data-theme="light"] .filter-tab:hover, body[data-theme="light"] .filter-tab.active { color: #1d5fae; }
body[data-theme="light"] .ai-workspace-head { background: #fff; }
body[data-theme="light"] .ai-queue, body[data-theme="light"] .ai-knowledge-panel { background: #f8fafc; }
body[data-theme="light"] .ai-agent-panel { background: #fff; }
body[data-theme="light"] .ai-column-head strong, body[data-theme="light"] .knowledge-maintenance h3 { color: #1d2e43; }
body[data-theme="light"] .ai-workspace-metrics strong { color: #1d2e43; }
body[data-theme="light"] .ai-queue-context, body[data-theme="light"] .knowledge-search-result { background: #f2f7fb; border-color: #d1dce8; }
body[data-theme="light"] .knowledge-search-form input { background: #fff; color: #25364a; border-color: #cfd9e5; }
body[data-theme="light"] .knowledge-search-result p { color: #30465b; }
body[data-theme="light"] .ai-source-strip { color: #617387; }
body[data-theme="light"] .ai-agent-actions .muted { color: #617387; }
body[data-theme="light"] .ai-online-context { background: #f8fafc; }
body[data-theme="light"] .ai-online-agent { background: #fff; }
body[data-theme="light"] .ai-online-facts dd { color: #30465b; }
body[data-theme="light"] .ai-online-facts div { border-color: #e0e6ee; }
body[data-theme="light"] .ai-online-setting-card, body[data-theme="light"] .ai-online-verification { background: #f6f9fc; border-color: #d6e0ea; }
body[data-theme="light"] .ai-online-context-details { border-color: #e0e6ee; }
body[data-theme="light"] .ai-online-selection-note { color: #50667b; }
body[data-theme="light"] .status.good { color: #17734d; }
body[data-theme="light"] .status.paused { color: #8d4a1c; }
body[data-theme="graphite"] { background: #17191d; --line: #343942; --panel: rgba(31, 34, 40, .94); --muted: #9aa4b2; --blue: #8aa8ff; }
body[data-theme="graphite"] .sidebar { background: #15171b; }
body[data-theme="graphite"] .group-action-target { background: #15181c; border-color: #4a5564; color: #e5e9ef; }
body[data-theme="graphite"] .main, body[data-theme="graphite"] .chat-pane { background: #1b1e23; }
body[data-theme="graphite"] .workbench-head, body[data-theme="graphite"] .workbench-toolbar, body[data-theme="graphite"] .chat-compose { background: #20242a; }
body[data-theme="graphite"] .conversation-sidebar, body[data-theme="graphite"] .contact-pane { background: #1c2025; }
body[data-theme="graphite"] input, body[data-theme="graphite"] textarea, body[data-theme="graphite"] select, body[data-theme="graphite"] .theme-control select { background: #15181c; border-color: #414852; }
body[data-theme="graphite"] .contact-source-grid { background: #242930; border-color: #414852; }
body[data-theme="graphite"] .ai-workspace-head, body[data-theme="graphite"] .ai-queue, body[data-theme="graphite"] .ai-knowledge-panel { background: #20242a; }
body[data-theme="graphite"] .ai-agent-panel { background: #1b1e23; }
body[data-theme="graphite"] .knowledge-search-form input { background: #15181c; border-color: #414852; color: #e5e9ef; }
body[data-theme="graphite"] .ai-queue-context, body[data-theme="graphite"] .knowledge-search-result { background: #242930; border-color: #414852; }
body[data-theme="graphite"] .ai-online-setting-card, body[data-theme="graphite"] .ai-online-verification { background: #242930; border-color: #414852; }
.modal-dialog { width: min(560px, calc(100% - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 0; border: 1px solid #31506a; border-radius: 10px; background: #101e2f; color: #d9e5f2; box-shadow: 0 24px 90px rgba(0, 0, 0, .58); }
.modal-dialog::backdrop { background: rgba(2, 8, 15, .72); backdrop-filter: blur(5px); }
.modal-dialog form { padding: 22px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.modal-head h2 { margin-top: 5px; }
.icon-button { width: 32px; height: 32px; border: 1px solid #31506a; border-radius: 7px; background: #0b1725; color: #b8cede; cursor: pointer; font-size: 20px; line-height: 1; }
.icon-button:hover { border-color: var(--blue); color: #fff; }
.empty-state { display: grid; place-items: center; min-height: 120px; color: var(--muted); font-size: 12px; text-align: center; }
.empty-state[hidden] { display: none; }
.intro { color: #93a8ba; line-height: 1.8; }
.badge { padding: 4px 8px; border: 1px solid #286c58; border-radius: 5px; color: #7fe3ba; font-size: 11px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.task-action { border: 1px solid #315b7b; border-radius: 5px; padding: 5px 8px; background: #10283e; color: #a9ddfa; cursor: pointer; font-size: 11px; }
.task-action:hover { border-color: var(--blue); color: #fff; }
.task-action:disabled { opacity: .55; cursor: wait; }
.task-action.danger { border-color: #74404c; background: #351d27; color: #ffb0b8; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.staff-item small { display: block; margin-top: 3px; }
.status.queued, .status.retry_wait { background: #203b52; color: #88cefa; }
.status.paused, .status.cancelled { background: #3d3030; color: #f0bd91; }
.status.claimed, .status.running { background: #26355c; color: #a9bfff; }
.view { display: none; }
.view.active { display: block; }
.toast { position: fixed; right: 32px; bottom: 26px; padding: 12px 16px; border: 1px solid #2e6e9f; border-radius: 8px; background: #10263c; color: #d4efff; opacity: 0; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
@media (min-width: 851px) and (max-width: 1200px) { .workbench-grid { grid-template-columns: 200px minmax(0, 1fr) 220px; } }
@media (max-width: 850px) { .sidebar { position: static; width: auto; padding: 14px; } .tenant { margin: 12px 8px 8px; } nav { display: flex; max-height: none; gap: 5px; overflow: visible; padding-bottom: 4px; flex-wrap: wrap; } .nav-section { display: flex; gap: 5px; flex-wrap: wrap; } .nav-section > span { display: none; } nav button { flex: 0 0 auto; white-space: nowrap; } .side-foot { display: none; } .main { width: auto; margin-left: 0; padding: 22px; } .stats { grid-template-columns: repeat(2, 1fr); } .grid.two, .robot-grid, .policy-grid, .policy-fields, .help-grid, .ai-online-grid { grid-template-columns: 1fr; } .table-row, .contact-table-row, .group-table-row, .task-table-row, .friend-request-row, .history-read-row, .moments-read-row, .session-read-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .session-read-row.head span:nth-child(n+3) { display: none; } .session-toolbar { align-items: stretch; flex-direction: column; } .contact-settings-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(64px, .7fr); } .task-toolbar { align-items: stretch; flex-direction: column; } .compact-item { align-items: stretch; flex-direction: column; } .bulk-toolbar { align-items: stretch; flex-direction: column; } .bulk-toolbar select, .bulk-toolbar input, .bulk-toolbar button { width: 100%; } .workbench-head, .workbench-toolbar, .help-hero { align-items: stretch; flex-direction: column; } .workbench-head-actions { justify-content: flex-start; } .workbench-metrics { justify-content: space-between; } .workbench-grid { grid-template-columns: 1fr; min-height: 0; } .conversation-sidebar, .contact-pane { border: 0; } .conversation-sidebar { border-bottom: 1px solid var(--line); } .contact-pane { border-top: 1px solid var(--line); } .conversation-list, .workbench-resource-list { max-height: none; overflow: visible; } .chat-pane { min-height: 0; } .message { max-width: 92%; } .modal-dialog { width: calc(100% - 20px); } .global-actions { justify-content: flex-start; } }
@media (max-width: 560px) { .verification-actions { grid-template-columns: 1fr; } .verification-actions button, .verification-actions input { width: 100%; } }
@media (max-width: 560px) { .history-toolbar { flex-wrap: wrap; } .history-toolbar .panel-search { flex-basis: 100%; width: 100%; } }

/* Conversation workbench: keep the chat header compact and move group details into tabs. */
.chat-pane { overflow: visible; }
.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main actions" "secondary secondary";
  align-items: center;
  gap: 8px 12px;
  min-height: 0;
}
.chat-header-main { grid-area: main; min-width: 0; }
.chat-header-actions { grid-area: actions; max-width: 100%; justify-content: flex-end; flex-wrap: wrap; }
.chat-header-secondary {
  grid-area: secondary;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.chat-header-secondary .chat-language-toggle { flex: 0 0 auto; }
.chat-header-secondary select { min-width: 92px; max-width: 120px; }
.chat-header-secondary .message-toolbar { flex: 1 1 280px; min-width: 180px; margin: 0; }
.chat-header-secondary .message-toolbar input { min-width: 0; }
.contact-pane { display: flex; flex-direction: column; overflow: visible; }
.contact-pane > .contact-summary { min-height: 0; overflow: visible; }
.contact-pane > #group-summary { min-height: 0; overflow: visible; }
.detail-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.detail-summary-head .contact-title { margin: 0; min-width: 0; }
.detail-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin: 14px 0; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(7, 16, 27, .68); }
.detail-tab { min-width: 0; border: 0; border-radius: 5px; padding: 8px 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; white-space: nowrap; }
.detail-tab:hover, .detail-tab.active { background: #183955; color: #ecf8ff; }
.detail-tab b { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 2px; border-radius: 8px; background: #1a334b; color: #a7c9dd; font-size: 9px; }
.detail-tab.active b { background: #2c6d9b; color: #fff; }
.detail-tab-panel { min-height: 0; overflow: hidden; }
.detail-tab-panel[hidden] { display: none !important; }
.compact-facts { gap: 9px; }
.detail-evidence { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; line-height: 1.55; }
.detail-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.detail-panel-head > div { display: grid; gap: 4px; min-width: 0; }
.detail-panel-head strong { font-size: 12px; }
.group-member-list { display: grid; gap: 5px; }
.group-member-row { border: 1px solid #22364a; border-radius: 7px; background: rgba(12, 24, 38, .7); overflow: hidden; }
.group-member-row summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px; cursor: pointer; list-style: none; }
.group-member-row summary::-webkit-details-marker { display: none; }
.group-member-row summary::after { content: "›"; color: var(--muted); font-size: 16px; transform: rotate(0deg); transition: transform .15s; }
.group-member-row[open] summary::after { transform: rotate(90deg); }
.group-member-avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #32695e; color: #e1fff5; font-size: 10px; font-weight: 700; }
.group-member-main { display: grid; gap: 3px; min-width: 0; }
.group-member-main strong, .group-member-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member-main strong { color: #eaf4fb; font-size: 11px; }
.group-member-main small { color: var(--muted); font-size: 10px; }
.group-member-details { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 9px 10px 10px 42px; border-top: 1px solid #22364a; }
.group-member-details div { display: grid; gap: 2px; min-width: 0; }
.group-member-details span { color: var(--muted); font-size: 9px; }
.group-member-details strong { overflow-wrap: anywhere; color: #d9e5f2; font-size: 10px; font-weight: 500; }
.detail-pager { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 34px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.detail-pager .muted { font-size: 10px; }
.detail-action-list { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; line-height: 1.6; }
.conversation-queue-tabs { display: flex; align-items: center; gap: 3px; padding-left: 10px; border-left: 1px solid var(--line); }
.conversation-item { position: relative; display: block; grid-template-columns: none; }
.conversation-open { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 9px; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.conversation-copy { padding-right: 18px; }
.conversation-queue-action { position: absolute; top: 7px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; }
.conversation-item:hover .conversation-queue-action, .conversation-item.active .conversation-queue-action, .conversation-queue-action:focus-visible { opacity: 1; }
.conversation-queue-action:hover { border-color: #47718e; background: rgba(62, 112, 145, .25); color: #e8f5ff; }
.message-history-hint { flex: 0 0 auto; order: -1; padding: 2px 0 8px; color: #7894a8; font-size: 10px; text-align: center; }
body[data-theme="light"] .detail-tabs { background: #eef3f8; }
body[data-theme="light"] .detail-tab:hover, body[data-theme="light"] .detail-tab.active { background: #dcecff; color: #1d5fae; }
body[data-theme="light"] .detail-tab b { background: #d7e4f2; color: #536b83; }
body[data-theme="light"] .detail-tab.active b { background: #4c98c8; color: #fff; }
body[data-theme="light"] .group-member-row { border-color: #d8e1eb; background: #f8fafc; }
body[data-theme="light"] .group-member-details { border-color: #e0e6ee; }
body[data-theme="light"] .group-member-main strong, body[data-theme="light"] .group-member-details strong { color: #30465b; }
body[data-theme="light"] .detail-evidence, body[data-theme="light"] .detail-action-list { background: #f8fafc; border-color: #d8e1eb; }
@media (max-width: 1200px) {
  .workbench-grid { grid-template-columns: 230px minmax(0, 1fr) 255px; }
  .chat-header-actions .task-action { padding-inline: 6px; }
}
@media (max-width: 850px) {
  .chat-header { grid-template-columns: 1fr; grid-template-areas: "main" "actions" "secondary"; }
  .chat-header-actions { justify-content: flex-start; }
  .chat-header-secondary { align-items: stretch; flex-wrap: wrap; }
  .chat-header-secondary .message-toolbar { flex-basis: 100%; }
  .contact-pane { overflow: visible; }
  .contact-pane > #group-summary, .contact-pane > .contact-summary { overflow: visible; }
  .conversation-queue-tabs { width: 100%; padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (min-width: 851px) {
  .workbench { height: auto; min-height: 0; }
  .workbench-grid { height: auto; min-height: 0; }
  .conversation-sidebar, .chat-pane, .contact-pane { min-height: 0; }
}

/* Final workbench layout pass: natural page flow, one readable conversation surface. */
body { overflow-x: hidden; }
.sidebar {
  position: absolute;
  inset: 0 auto auto 0;
  height: auto;
  min-height: 100vh;
}
.side-foot {
  position: static;
  margin: 30px 10px 0;
}
.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}
.login-card .brand-logo { width: 40px; height: 40px; flex-basis: 40px; }
.workbench,
.workbench-grid,
.conversation-sidebar,
.chat-pane,
.contact-pane,
.conversation-list,
.workbench-resource-list,
.message-list,
.followup-list {
  height: auto;
  max-height: none;
  overflow: visible;
}
.workbench { border-radius: 10px; }
.workbench-head { min-height: 74px; }
.workbench-title h2 { font-size: 16px; }
.workbench-grid {
  align-items: start;
  grid-template-columns: 270px minmax(430px, 1fr) 300px;
}
.conversation-sidebar,
.contact-pane {
  align-self: start;
}
.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 22px;
  background: #0d1b2b;
}
.message-history-control,
.message-history-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 0 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.message-history-control .task-action { min-width: 120px; }
.message-history-status { border-bottom: 1px solid var(--line); }
.message { max-width: min(78%, 680px); }
.message-bubble { box-shadow: none; }
.chat-compose {
  position: relative;
  z-index: 1;
}

.ai-online-workspace { overflow: hidden; }
.ai-online-grid {
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 0;
}
.ai-online-thread-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #0c1827;
  overflow: hidden;
}
.ai-online-thread-list {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  margin-top: 12px;
  overflow-y: auto;
}
.ai-online-thread {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ai-online-thread:hover,
.ai-online-thread.active {
  border-color: #2c638c;
  background: #142e46;
}
.ai-online-thread strong,
.ai-online-thread small,
.ai-online-thread time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-online-thread { position: relative; }
.ai-online-thread-open {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0 54px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ai-online-thread-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  gap: 4px;
}
.ai-online-thread-actions button {
  border: 0;
  background: transparent;
  color: #8fb4cc;
  font-size: 10px;
  cursor: pointer;
}
.ai-online-thread strong { color: #eaf4fb; font-size: 12px; }
.ai-online-thread small,
.ai-online-thread time { color: var(--muted); font-size: 10px; }
.ai-online-agent {
  display: grid;
  grid-template-rows: auto auto minmax(280px, auto) auto auto auto;
  min-width: 0;
  padding: 0;
  background: #0f1d2d;
}
.ai-online-conversation-head {
  min-height: 68px;
  margin: 0;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.ai-online-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 22px 0;
}
.ai-online-history-head .task-action {
  padding: 6px 9px;
  font-size: 11px;
}
.ai-online-message-list {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: clamp(280px, 38vh, 460px);
  max-height: min(62vh, 680px);
  padding: 24px 26px;
  background: #101f30;
  overflow-y: auto;
  scrollbar-width: none;
}
.ai-online-message-list::-webkit-scrollbar,
.ai-online-thread-list::-webkit-scrollbar {
  display: none;
}
.ai-online-message {
  display: grid;
  gap: 6px;
  width: fit-content;
  max-width: min(78%, 760px);
}
.ai-online-message-user { justify-self: end; }
.ai-online-message-assistant,
.ai-online-message-system { justify-self: start; }
.ai-online-message-meta {
  color: #7f96a9;
  font-size: 10px;
}
.ai-online-message-user .ai-online-message-meta { text-align: right; }
.ai-online-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: currentColor;
  opacity: 0.8;
  vertical-align: text-bottom;
  animation: ai-online-caret 1s steps(1) infinite;
}
@keyframes ai-online-caret {
  50% { opacity: 0; }
}
.ai-online-message-body {
  padding: 12px 15px;
  border: 1px solid #2b465c;
  border-radius: 10px 10px 10px 3px;
  background: #172c40;
  color: #e4eff7;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-online-message-user .ai-online-message-body {
  border-color: #286c58;
  border-radius: 10px 10px 3px 10px;
  background: #123e37;
}
.ai-online-message-system .ai-online-message-body {
  border-color: #55472b;
  background: #302b1e;
  color: #f1dfb2;
}
.ai-online-compose {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px 22px 12px;
  border-top: 1px solid var(--line);
  background: #0f1d2d;
}
.ai-online-compose textarea {
  width: 100%;
  min-height: 148px;
  max-height: 280px;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid #31516a;
  border-radius: 9px;
  background: #0a1725;
  color: #ecf7ff;
  font: inherit;
  line-height: 1.7;
}
.ai-online-compose textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(85, 185, 255, .14);
}
.ai-online-compose textarea::placeholder { color: #6e8497; }
.ai-online-compose .ai-agent-controls {
  display: grid;
  grid-template-columns: minmax(140px, .75fr) minmax(220px, 1.25fr) auto;
  align-items: end;
  gap: 10px;
}
.ai-online-compose .form-label { margin-bottom: 0; }
.ai-online-compose .primary { min-height: 40px; min-width: 90px; }
.ai-online-agent > .ai-agent-actions {
  margin: 0;
  padding: 0 22px 16px;
}
.ai-online-agent > .ai-agent-actions .muted { margin-left: auto; }
.ai-online-settings-drawer {
  margin: 0 22px 22px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.ai-online-settings-drawer > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}
.ai-online-settings-drawer > summary::-webkit-details-marker { display: none; }
.ai-online-settings-drawer > summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  color: var(--blue);
  font-size: 15px;
}
.ai-online-settings-drawer[open] > summary::before { content: "−"; }
.ai-online-settings-drawer .ai-online-context {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1827;
}
.ai-online-settings-drawer .ai-online-setting-card { margin-top: 0; }
.ai-online-context-details { margin-top: 0; }

body[data-theme="light"] .sidebar { background: #f7f9fc; }
body[data-theme="light"] .message-list,
body[data-theme="light"] .ai-online-message-list,
body[data-theme="light"] .ai-online-agent { background: #f6f8fb; }
body[data-theme="light"] .ai-online-message-list { background: #edf3f7; }
body[data-theme="light"] .ai-online-thread-panel { background: #f6f9fc; }
body[data-theme="light"] .ai-online-thread:hover,
body[data-theme="light"] .ai-online-thread.active { background: #eaf3fc; border-color: #b9d3e7; }
body[data-theme="light"] .ai-online-thread strong { color: #243b51; }
body[data-theme="light"] .ai-online-message-body { background: #f1f6fa; border-color: #d1dfe9; color: #2d4358; }
body[data-theme="light"] .ai-online-message-user .ai-online-message-body { background: #e4f7e9; border-color: #b6dfc0; }
body[data-theme="light"] .ai-online-message-system .ai-online-message-body { background: #fff7e3; border-color: #ead8a9; color: #604e27; }
body[data-theme="light"] .ai-online-compose,
body[data-theme="light"] .ai-online-settings-drawer .ai-online-context { background: #eef3f7; }
body[data-theme="light"] .ai-online-compose { background: #e9eff4; }
body[data-theme="light"] .ai-online-compose textarea { background: #fff; color: #25364a; border-color: #c7d6e4; }
body[data-theme="light"] .ai-online-compose textarea::placeholder { color: #8a9aaa; }

body[data-theme="graphite"] .sidebar { background: #15171b; }
body[data-theme="graphite"] .message-list,
body[data-theme="graphite"] .ai-online-message-list,
body[data-theme="graphite"] .ai-online-agent { background: #1b1e23; }
body[data-theme="graphite"] .ai-online-thread-panel,
body[data-theme="graphite"] .ai-online-settings-drawer .ai-online-context { background: #20242a; }
body[data-theme="graphite"] .ai-online-thread:hover,
body[data-theme="graphite"] .ai-online-thread.active { background: #2a3440; border-color: #667b9d; }
body[data-theme="graphite"] .ai-online-message-body { background: #252a31; border-color: #4a5564; color: #e5e9ef; }
body[data-theme="graphite"] .ai-online-message-user .ai-online-message-body { background: #24463f; border-color: #4d947c; }
body[data-theme="graphite"] .ai-online-message-system .ai-online-message-body { background: #413a29; border-color: #766643; color: #f1dfb2; }
body[data-theme="graphite"] .ai-online-compose { background: #20242a; }
body[data-theme="graphite"] .ai-online-compose textarea { background: #15181c; color: #e5e9ef; border-color: #4a5564; }

body[data-theme="light"] .chat-header strong,
body[data-theme="light"] .conversation-sidebar-head strong,
body[data-theme="light"] .workbench-metrics strong { color: #1d2e43; }
body[data-theme="light"] .workbench-metrics,
body[data-theme="light"] .message-meta,
body[data-theme="light"] .message-history-hint,
body[data-theme="light"] .conversation-item small { color: #5c7084; }
body[data-theme="light"] .message-text { color: #1d2e43; }
body[data-theme="light"] .message-translation { color: #1d4e86; border-top-color: #d3e1ee; }
body[data-theme="light"] .message-translation span { color: #5c7084; }
body[data-theme="light"] .message-bubble { background: #f4f7fb; border-color: #d3deea; color: #1d2e43; }
body[data-theme="light"] .message.outbound .message-bubble { background: #e5f6ea; border-color: #b7dcc2; }
body[data-theme="light"] .detail-tabs { background: #eef3f8; }
body[data-theme="light"] .detail-tab:hover,
body[data-theme="light"] .detail-tab.active { background: #e4f1fb; color: #1d4e86; }
body[data-theme="light"] .detail-tab b { background: #d7e6f5; color: #1d4e86; }
body[data-theme="light"] .detail-tab.active b { background: #2d78ef; color: #fff; }
body[data-theme="light"] .conversation-queue-action:hover { border-color: #9bc3f4; background: #e4f1fb; color: #1d4e86; }
body[data-theme="light"] .conversation-meta em { border-color: #e2d2a4; color: #7a5b16; }
body[data-theme="light"] .chat-header-actions .task-action,
body[data-theme="light"] .message-history-control .task-action { border-color: #b7cbe0; background: #f4f8fc; color: #1d4e86; }
body[data-theme="light"] .chat-header-actions .task-action:hover,
body[data-theme="light"] .message-history-control .task-action:hover { border-color: #2d78ef; color: #143e72; }

body[data-theme="graphite"] .chat-header strong,
body[data-theme="graphite"] .conversation-sidebar-head strong,
body[data-theme="graphite"] .conversation-name-row strong,
body[data-theme="graphite"] .workbench-metrics strong { color: #f2f4f7; }
body[data-theme="graphite"] .workbench-metrics,
body[data-theme="graphite"] .message-meta,
body[data-theme="graphite"] .conversation-item small { color: #a8b1bd; }
body[data-theme="graphite"] .conversation-item { color: #e5e9ef; }
body[data-theme="graphite"] .conversation-item:hover,
body[data-theme="graphite"] .conversation-item.active { border-color: #667b9d; background: #2a3440; }
body[data-theme="graphite"] .message-text { color: #f2f4f7; }
body[data-theme="graphite"] .message-translation { color: #c5d4ee; border-top-color: #4a5564; }
body[data-theme="graphite"] .message-translation span { color: #a8b1bd; }
body[data-theme="graphite"] .message-bubble { background: #2a3038; border-color: #4a5564; }
body[data-theme="graphite"] .message.outbound .message-bubble { background: #243f38; border-color: #4d947c; }
body[data-theme="graphite"] .detail-tabs { background: #15181c; }
body[data-theme="graphite"] .detail-tab:hover,
body[data-theme="graphite"] .detail-tab.active { background: #343c48; color: #f2f4f7; }
body[data-theme="graphite"] .detail-tab b,
body[data-theme="graphite"] .detail-tab.active b { background: #4a5564; color: #f2f4f7; }
body[data-theme="graphite"] .conversation-queue-action:hover { border-color: #667b9d; background: #2a3440; color: #f2f4f7; }
body[data-theme="graphite"] .conversation-avatar,
body[data-theme="graphite"] .chat-avatar,
body[data-theme="graphite"] .contact-avatar { background: #3a4658; color: #f2f4f7; }
body[data-theme="graphite"] .conversation-avatar.group,
body[data-theme="graphite"] .chat-avatar.group { background: #5a4a2e; color: #ffe5a5; }
body[data-theme="graphite"] .chat-header-actions .task-action,
body[data-theme="graphite"] .message-history-control .task-action { border-color: #667b9d; background: #2a3038; color: #e5e9ef; }
body[data-theme="graphite"] .filter-tab { color: #a8b1bd; }
body[data-theme="graphite"] .filter-tab:hover,
body[data-theme="graphite"] .filter-tab.active { color: #f2f4f7; }

@media (max-width: 1200px) {
  .workbench-grid { grid-template-columns: 230px minmax(360px, 1fr) 255px; }
}
@media (max-width: 850px) {
  .sidebar { position: static; min-height: 0; }
  .side-foot { margin: 18px 8px 0; }
  .workbench-grid,
  .ai-online-grid { grid-template-columns: 1fr; }
  .conversation-sidebar,
  .ai-online-thread-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .ai-online-message { max-width: 94%; }
  .ai-online-compose .ai-agent-controls { grid-template-columns: 1fr; }
  .ai-online-compose .primary { width: 100%; }
  .message { max-width: 92%; }
}
