:root {
  --page: #efeded;
  --workspace: #f8f8fa;
  --surface: #ffffff;
  --surface-soft: #f8f8fa;
  --surface-selected: #edf6ff;
  --line: rgba(49, 65, 85, 0.08);
  --line-strong: rgba(47, 143, 255, 0.22);
  --text: #344054;
  --muted: #91a1b5;
  --blue: #2f8fff;
  --blue-dark: #227fe8;
  --green: #24a979;
  --green-soft: #e3f6ef;
  --danger: #d94b45;
  --shadow: 0 16px 42px rgba(31, 41, 55, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --radius: 14px;
  --control-radius: 8px;
  --conversation-width: clamp(320px, 22vw, 420px);
  --wechat-rail-width: 82px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
.visually-hidden { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
body { font-size: 15px; font-weight: 400; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(47, 143, 247, 0.35);
  outline-offset: 1px;
}

.primary-button {
  border: 0;
  border-radius: var(--control-radius);
  background: var(--blue);
  color: #fff;
  min-height: 42px;
  padding: 0 22px;
  cursor: pointer;
}
.primary-button:hover { background: var(--blue-dark); }
.primary-button:disabled { opacity: 0.48; cursor: not-allowed; }
.secondary-button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 0 18px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.icon-button, .tool-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #46556c;
}
.icon-button { width: 40px; height: 40px; font-size: 24px; border-radius: var(--control-radius); }
.icon-button:hover { color: var(--blue); }
.icon-button:disabled, .tool-button:disabled { cursor: default; opacity: 0.35; }
.topbar-icon-button {
  background: transparent;
  border-radius: 0;
}
.topbar-icon-button:hover { background: transparent; color: var(--green); }
.topbar-icon-button.logout-icon-button:hover { color: var(--danger); }
.topbar-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logout-icon-button .topbar-icon {
  width: 25.3px;
  height: 25.3px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(36, 169, 121, 0.09), transparent 35%),
    linear-gradient(295deg, rgba(47, 143, 247, 0.11), transparent 42%),
    var(--page);
}
.login-layout {
  width: min(880px, 100%);
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px;
  background: #152537;
  color: #fff;
}
.brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  font-size: 34px;
}
.login-brand h1 { margin: 0 0 8px; font-size: 30px; font-weight: 500; }
.login-brand p { margin: 0; color: #b9c7d6; }
.login-panel { align-self: center; padding: 56px clamp(34px, 7vw, 72px); }
.login-panel header { margin-bottom: 34px; }
.login-panel h2 { margin: 0 0 10px; font-size: 26px; font-weight: 500; }
.login-panel header p { margin: 0; color: var(--muted); }
.login-panel form { display: grid; gap: 10px; }
.login-panel label { margin-top: 9px; color: #56657b; }
.login-panel input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
}
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle { position: absolute; right: 5px; top: 4px; font-size: 15px; }
.form-error { min-height: 22px; margin: 3px 0 0; color: var(--danger); }
.login-submit { margin-top: 4px; width: 100%; height: 48px; }

.app-body { height: 100vh; overflow: hidden; background: var(--page); }
.workspace {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--conversation-width) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  background: var(--page);
  overflow: hidden;
}
.workspace.aggregate-mode {
  grid-template-columns: calc(var(--conversation-width) + var(--wechat-rail-width)) minmax(0, 1fr);
}
.workspace.settings-mode.aggregate-mode {
  grid-template-columns: calc(var(--conversation-width) + var(--wechat-rail-width)) minmax(0, 1fr);
}
@media (min-width: 761px) {
  .workspace.settings-mode .aggregate-toggle-button,
  .workspace.workflow-mode .aggregate-toggle-button { display: grid; }
}
@media (max-width: 760px) {
  .workspace.settings-mode .aggregate-toggle-button,
  .workspace.workflow-mode .aggregate-toggle-button { display: none; }
}
.conversation-pane,
.chat-pane,
.settings-view {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.conversation-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) 64px;
}
.workspace.settings-mode .conversation-pane {
  grid-template-rows: auto minmax(0, 1fr) 64px;
}
.workspace.settings-mode .conversation-browser { display: none; }
.workspace.settings-mode.aggregate-mode .conversation-pane {
  grid-template-columns: var(--wechat-rail-width) minmax(0, 1fr);
}
.workspace.settings-mode.aggregate-mode .conversation-browser {
  display: contents;
}
.workspace.settings-mode.aggregate-mode .conversation-list {
  display: none;
}
.workspace.settings-mode.aggregate-mode .account-header,
.workspace.settings-mode.aggregate-mode .mobile-nav {
  grid-column: 1 / -1;
}
.workspace.settings-mode.aggregate-mode .wechat-account-rail {
  grid-column: 1;
  grid-row: 2;
}
.workspace.settings-mode.aggregate-mode .settings-menu {
  grid-column: 2;
  grid-row: 2;
}
.account-header, .chat-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
}
.wechat-identity, .chat-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 7px;
  background: #dfe8f2;
  color: #3e5066;
  background-position: center;
  background-size: cover;
}
.avatar-wechat { background-color: #d8f2e9; color: #177f5b; }
.avatar.has-image { color: transparent; }
.empty-contact-avatar { background: #edf2f7; color: #60758e; }
.empty-contact-avatar svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.avatar-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  background: #dfe8f2;
}
.avatar-group-tile {
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: #edf2f7;
}
.avatar-group-tile:only-child { grid-column: 1 / -1; grid-row: 1 / -1; }
.avatar-group-tile img { border-radius: 0; }
.external-wechat-label {
  margin-left: 4px;
  color: var(--green);
  font-size: .78em;
  font-weight: 500;
  white-space: nowrap;
}
.internal-group-label {
  margin-left: 4px;
  color: var(--blue);
  font-size: .78em;
  font-weight: 500;
  white-space: nowrap;
}
.identity-copy { min-width: 0; display: grid; gap: 4px; }
.identity-copy strong { font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.connection-provider-label { font-weight: 500; white-space: nowrap; }
.connection-status i { width: 8px; height: 8px; border-radius: 50%; background: #a9b3c0; }
.connection-status.connected { color: var(--green); }
.connection-status.connected i { background: var(--green); }
.connection-status.disconnected { color: var(--danger); }
.connection-status.disconnected i { background: var(--danger); }
.header-actions { display: flex; align-items: center; gap: 2px; }
.aggregate-toggle-button { position: relative; }
.aggregate-toggle-button[aria-pressed="true"] { color: var(--blue); }
.aggregate-unread-badge,
.wechat-rail-unread {
  position: absolute;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #f25555;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.aggregate-unread-badge { top: 0; right: -1px; }

.conversation-controls { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-field { height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--control-radius); color: var(--muted); background: var(--surface); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.wechat-select { height: 38px; border: 1px solid var(--line); border-radius: var(--control-radius); padding: 0 10px; color: #48576e; background: #fff; }
.conversation-browser { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.conversation-list { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0; }
.workspace.aggregate-mode .conversation-browser { grid-template-columns: var(--wechat-rail-width) minmax(0, 1fr); }
@media (min-width: 761px) {
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .conversation-pane {
    grid-template-columns: var(--wechat-rail-width) minmax(0, 1fr);
  }
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .conversation-browser {
    display: contents;
  }
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .account-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .conversation-controls {
    grid-column: 2;
    grid-row: 2;
  }
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .wechat-account-rail {
    grid-column: 1;
    grid-row: 2 / 4;
  }
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .conversation-list {
    grid-column: 2;
    grid-row: 3;
  }
  .workspace.aggregate-mode:not(.settings-mode):not(.workflow-mode) .mobile-nav {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}
.wechat-account-rail {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0;
  border-right: 1px solid var(--line);
  background: #fafbfc;
}
.wechat-rail-item {
  position: relative;
  width: 100%;
  min-height: 66px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 7px 2px;
  background: transparent;
  color: #536277;
  cursor: pointer;
}
.wechat-rail-item:hover { background: #f0f4f8; }
.wechat-rail-item.active { background: transparent; border-left-color: var(--blue); color: var(--blue); }
.wechat-rail-item.active:hover { background: var(--workspace); }
.wechat-rail-avatar-wrap { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.wechat-rail-avatar { width: 48px; height: 48px; }
.wechat-rail-name { display: none; }
.wechat-rail-unread { top: -4px; right: -6px; }
.settings-menu { min-height: 0; overflow-y: auto; padding: 10px 0; }
.workflow-menu { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.workflow-menu-scroll { min-height: 100%; }
.settings-menu-button {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 0 18px;
  background: transparent;
  color: #43536a;
  text-align: left;
  cursor: pointer;
}
.settings-menu-button:hover { background: var(--workspace); }
.settings-menu-button.active { color: var(--blue); border-left-color: var(--blue); }
.settings-menu-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #52708f;
  background: #edf2f7;
}
.settings-menu-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-menu-icon-persona { color: #7256c7; background: #f1edff; }
.settings-menu-icon-subaccounts { color: #3977b9; background: #eaf3fb; }
.settings-menu-icon-faq { color: #8a5bc4; background: #f3edfb; }
.settings-menu-icon-knowledge { color: #19846a; background: #e7f6f1; }
.settings-menu-icon-material { color: #b46c19; background: #fff3e3; }
.settings-menu-icon-semantic { color: #25756f; background: #e7f5f3; }
.settings-menu-icon-sop { color: #4671a3; background: #edf3f9; }
.settings-menu-icon-agent { color: #167e84; background: #e6f5f5; }
.settings-menu-icon-workflow { color: #3979c7; background: #eaf3ff; }
.settings-menu-icon-model { color: #625cc0; background: #eeedfb; }
.settings-menu-icon-tags { color: #c45170; background: #fbeaf0; }
.settings-menu-icon-test { color: #2978a8; background: #e8f4fa; }
.settings-menu-button.active .settings-menu-icon { color: #fff; background: var(--blue); }
.settings-menu-button small { margin-left: auto; color: var(--muted); font-size: 11px; }
.conversation-item {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 10px 18px 10px 20px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.conversation-item:hover { background: var(--workspace); }
.conversation-item.active { background: transparent; border-left-color: var(--blue); }
.conversation-item.active:hover { background: var(--workspace); }
.conversation-item.active .conversation-row strong { color: var(--blue); }
.conversation-item.has-conversation-meta { min-height: 76px; }
.conversation-item.has-conversation-tags { min-height: 92px; }
.conversation-avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
}
.conversation-avatar-wrap .avatar {
  width: 56px;
  height: 56px;
}
.conversation-unread-badge {
  position: absolute;
  top: -3px;
  right: -1px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #f25555;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.conversation-ai-badge {
  position: absolute;
  right: 0;
  bottom: -2px;
  min-width: 22px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  padding: 0 4px;
  background: linear-gradient(135deg, #24a979 0%, #4dcca2 100%);
  box-shadow: 0 0 0 2px var(--surface);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
}
.conversation-copy { display: grid; gap: 7px; min-width: 0; }
.conversation-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.conversation-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 500; }
.conversation-row time { flex: 0 0 auto; color: #9aa6b5; font-size: 12px; }
.conversation-message-row { gap: 8px; }
.conversation-row em { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-style: normal; color: var(--muted); }
.conversation-row b { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: #f25555; color: #fff; font-size: 11px; font-weight: 500; }
.conversation-meta-row {
  min-width: 0;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.conversation-contact-tags {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}
.conversation-contact-tag {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 104px;
  overflow: hidden;
  padding: 2px 7px;
  border: 1px solid #c9dceb;
  border-radius: 8px;
  color: #296677;
  background: linear-gradient(120deg, #d9f8ec 0%, #deefff 55%, #eee5ff 100%);
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
  text-overflow: ellipsis;
}
.conversation-contact-tag.more {
  flex: 0 0 auto;
  color: #296677;
  background: linear-gradient(120deg, #d9f8ec 0%, #deefff 55%, #eee5ff 100%);
}
.conversation-insight {
  flex: 0 0 auto;
  max-width: 104px;
  overflow: hidden;
  white-space: nowrap;
}
.conversation-insight-value {
  display: block;
  overflow: hidden;
  background: linear-gradient(90deg, #0b9b72 0%, #2388d8 52%, #7553c7 100%);
  background-clip: text;
  color: transparent;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.list-empty { padding: 50px 16px; text-align: center; color: var(--muted); }
.mobile-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 64px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.mobile-nav-item {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #7d8999;
}
.mobile-nav-item:disabled { opacity: 1; cursor: default; }
.mobile-nav-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-nav-item.active .mobile-nav-icon { stroke-width: 2.05; }
.mobile-nav-item em { font-size: 16px; line-height: 1.1; font-style: normal; }
.mobile-nav-item.active { color: var(--blue); }

.chat-pane { display: flex; flex-direction: column; min-height: 0; }
.chat-header { justify-content: flex-start; }
.chat-title h1 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.chat-title span { color: var(--muted); font-size: 13px; }
.chat-title > div:not(.avatar) { min-width: 0; }
.chat-title h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title h1 .external-wechat-label { color: var(--green); font-size: .78em; }
.chat-title h1 .internal-group-label { color: var(--blue); font-size: .78em; }
.chat-subtitle-row { display: flex; align-items: center; gap: 6px; min-height: 28px; }
.customer-detail-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #53657d;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.customer-detail-button[hidden] { display: none; }
.customer-detail-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.customer-detail-button span { color: inherit; font-size: 12px; }
.customer-detail-button:hover { color: var(--blue); background: #f3f7fc; }
.mobile-back { display: none; font-size: 34px; }
.message-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px clamp(20px, 3vw, 24px); background: var(--workspace); }
.message-list.empty { display: grid; place-items: center; }
.empty-state { display: grid; justify-items: center; gap: 12px; color: #a0acba; }
.empty-state span { font-size: 36px; }
.empty-chat-icon { width: 38px; height: 38px; fill: none; stroke: #98a8ba; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.empty-state p { margin: 0; }
.message-item { width: min(72%, 760px); display: grid; gap: 6px; margin-bottom: 18px; }
.message-item.incoming { justify-items: start; margin-right: auto; }
.message-item.outgoing { justify-items: end; margin-left: auto; }
.message-sender { display: flex; align-items: center; gap: 7px; min-height: 24px; color: #7d8999; font-size: 12px; }
.message-sender-avatar { width: 22px; height: 22px; border-radius: 4px; font-size: 10px; }
.message-bubble { min-width: 46px; max-width: 100%; padding: 10px 13px; border-radius: var(--control-radius); background: #e8edf3; color: #243044; box-shadow: 0 1px 1px rgba(20, 35, 55, 0.04); overflow-wrap: anywhere; }
.message-item.outgoing .message-bubble { background: var(--blue); color: #fff; }
.message-bubble.failed { background: #fff1f0; color: #9d302b; border: 1px solid #ffd1ce; }
.message-bubble p { margin: 0; white-space: pre-wrap; line-height: 1.6; }
.message-native-emoji { display: inline-block; margin: 0 1px; font-size: 1.34em; line-height: 1; vertical-align: -0.12em; }
.message-meta { display: flex; align-items: center; gap: 7px; color: #96a2b2; font-size: 12px; padding: 0 2px; }
.message-item.outgoing .message-meta { justify-content: flex-end; }
.message-actions { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.message-actions button { border: 0; padding: 0; background: transparent; color: #8c98a8; font-size: 12px; cursor: pointer; }
.message-actions button:hover { color: var(--blue); }
.ai-origin { color: var(--green); }
.send-failed { color: var(--danger); }
.message-image-button { display: block; max-width: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.message-image { display: block; width: auto; max-width: min(300px, 52vw); max-height: 340px; border-radius: 4px; object-fit: contain; }
.message-video { display: block; width: auto; max-width: min(340px, 56vw); max-height: 380px; border-radius: 4px; object-fit: contain; }
.message-emoji { width: auto; max-width: min(180px, 38vw); max-height: 180px; }
.message-audio { display: none; }
.message-file, .message-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.media-placeholder { color: inherit; opacity: 0.78; }
.group-invite-message { display: grid; gap: 10px; min-width: min(240px, 62vw); }
.group-invite-message p { font-weight: 500; }
.group-invite-button {
  justify-self: start;
  min-height: 30px;
  border: 1px solid rgba(36, 169, 121, 0.32);
  border-radius: 6px;
  padding: 4px 12px;
  background: #fff;
  color: var(--green);
  cursor: pointer;
}
.group-invite-button:disabled { cursor: default; opacity: 0.62; }
.voice-message { display: grid; gap: 8px; min-width: min(390px, 64vw); }
.voice-player { min-height: 32px; display: grid; grid-template-columns: 30px auto minmax(80px, 1fr) auto; align-items: center; gap: 8px; }
.voice-player-pending { grid-template-columns: minmax(0, 1fr) auto; }
.voice-play-button { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; padding: 0; background: transparent; color: currentColor; font-size: 14px; cursor: pointer; }
.voice-time { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.voice-progress { min-width: 80px; height: 4px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.transcribe-button {
  justify-self: end;
  min-height: 30px;
  border: 1px solid rgba(36, 169, 121, 0.28);
  border-radius: 6px;
  padding: 3px 10px;
  background: #fff;
  color: var(--green);
  cursor: pointer;
}
.transcribe-button:disabled { cursor: default; opacity: 0.55; }
.voice-transcript { padding-top: 7px; border-top: 1px solid rgba(49, 65, 85, 0.1); }
.refer-message { min-width: min(320px, 62vw); display: grid; gap: 9px; }
.message-reference { min-width: 0; display: grid; gap: 3px; margin: 0; border-left: 3px solid rgba(72, 91, 116, 0.28); padding: 7px 9px; background: rgba(255, 255, 255, 0.52); color: #6d7a8c; }
.message-reference strong, .message-reference span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-reference strong { color: #4d5d72; font-size: 12px; font-weight: 500; }
.message-reference span { font-size: 13px; }
.message-item.outgoing .message-reference { border-left-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.13); color: rgba(255, 255, 255, 0.82); }
.message-item.outgoing .message-reference strong { color: #fff; }

.composer { position: relative; flex: 0 0 auto; border-top: 1px solid var(--line); background: #fff; padding-bottom: env(safe-area-inset-bottom); }
.quote-compose { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px clamp(18px, 3vw, 36px); border-bottom: 1px solid #f0f2f5; background: #f8fafc; }
.quote-compose > div { min-width: 0; display: grid; gap: 2px; border-left: 3px solid var(--blue); padding-left: 10px; }
.quote-compose strong, .quote-compose span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-compose strong { color: var(--blue); font-size: 12px; font-weight: 500; }
.quote-compose span { color: #69778a; font-size: 13px; }
.quote-compose .icon-button { flex: 0 0 auto; width: 30px; height: 30px; }
.composer-tools { height: 50px; display: flex; align-items: center; gap: 17px; padding: 0 clamp(18px, 3vw, 36px); border-bottom: 1px solid #f0f2f5; }
.tool-button { width: 28px; height: 28px; color: #7d8999; }
.composer-tools > .tool-button { flex: 0 0 28px; }
.ai-conversation-controls {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.ai-conversation-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #46566c;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.ai-conversation-toggle.is-disabled {
  opacity: .58;
  cursor: not-allowed;
}
.ai-conversation-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.ai-conversation-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ec8585;
  box-shadow: 0 0 0 3px #fff0f0;
}
.ai-conversation-toggle input:checked + .ai-conversation-status-dot { background: var(--green); box-shadow: 0 0 0 3px #e3f5ef; }
.ai-conversation-toggle input:focus-visible + .ai-conversation-status-dot { outline: 2px solid rgba(47, 143, 255, 0.34); outline-offset: 2px; }
.ai-conversation-state { color: var(--danger); font-size: 11px; font-style: normal; }
.ai-conversation-toggle input:checked ~ .ai-conversation-state { color: var(--green); }
.ai-conversation-toggle .state-on { display: none; }
.ai-conversation-toggle input:checked ~ em .state-on { display: inline; }
.ai-conversation-toggle input:checked ~ em .state-off { display: none; }
.media-tool,
.media-tool:hover,
.media-tool:active { background: transparent; }
.media-tool:hover:not(:disabled) { color: #53657b; }
.media-tool:active:not(:disabled) { color: var(--blue); }
.media-tool-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.emoji-picker {
  position: absolute;
  left: clamp(18px, 3vw, 36px);
  bottom: calc(100% - 50px);
  z-index: 20;
  width: min(390px, calc(100vw - 40px));
  max-height: min(330px, 48vh);
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(38px, 1fr));
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(28, 42, 58, 0.16);
}
.emoji-option {
  min-width: 0;
  height: 48px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}
.emoji-option:hover { background: var(--workspace); }
.emoji-option span { font-size: 23px; line-height: 1; }
.emoji-option small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.upload-status { margin-left: auto; color: var(--green); font-size: 13px; }
.upload-status:empty { display: none; }
.composer-row,
.test-session-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; padding: 9px clamp(18px, 3vw, 36px); }
.composer textarea,
.test-session-composer textarea { min-height: 46px; max-height: 35vh; resize: none; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--control-radius); padding: 12px 14px; line-height: 1.5; color: var(--text); }
.send-button,
.test-session-composer button { height: 46px; }

.settings-view { display: flex; flex-direction: column; min-height: 0; }
.settings-header { display: none; }
.settings-header > div { min-width: 0; flex: 1; }
.settings-header h1 { margin: 0; font-size: 21px; font-weight: 500; }
.settings-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.mobile-settings-back { display: none; font-size: 34px; }
.settings-add-button { min-width: 84px; height: 42px; }
.settings-content { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 18px; background: var(--workspace); }

.workspace.workflow-mode {
  grid-template-columns: var(--conversation-width) minmax(0, 1fr);
}
.workspace.workflow-mode .conversation-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 64px;
}
.workspace.workflow-mode .conversation-browser { display: none; }
.workspace.workflow-mode.aggregate-mode {
  grid-template-columns: calc(var(--conversation-width) + var(--wechat-rail-width)) minmax(0, 1fr);
}
.workspace.workflow-mode.aggregate-mode .conversation-pane {
  grid-template-columns: var(--wechat-rail-width) minmax(0, 1fr);
}
.workspace.workflow-mode.aggregate-mode .conversation-browser { display: contents; }
.workspace.workflow-mode.aggregate-mode .conversation-list { display: none; }
.workspace.workflow-mode.aggregate-mode .account-header,
.workspace.workflow-mode.aggregate-mode .mobile-nav {
  grid-column: 1 / -1;
}
.workspace.workflow-mode.aggregate-mode .wechat-account-rail {
  grid-column: 1;
  grid-row: 2;
}
.workspace.workflow-mode.aggregate-mode .workflow-menu {
  grid-column: 2;
  grid-row: 2;
}
.workspace.workflow-mode .chat-pane,
.workspace.workflow-mode .settings-view {
  display: none;
}
.workflow-view {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--workspace);
  box-shadow: var(--shadow);
}
.workflow-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}
.workflow-sidebar,
.workflow-type-panel,
.workflow-main {
  min-width: 0;
  min-height: 0;
  background: #fff;
}
.workflow-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}
.workflow-sidebar-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.workflow-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.workflow-brand-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd999, #f2a57c);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}
.workflow-brand strong,
.workflow-brand small {
  display: block;
}
.workflow-brand strong { color: #273246; font-size: 17px; font-weight: 600; }
.workflow-brand small { margin-top: 4px; color: var(--green); font-size: 12px; }
.workflow-nav-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-sidebar-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.workflow-scope-select {
  display: grid;
  gap: 7px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0f2f5;
}
.workflow-scope-select span {
  color: var(--muted);
  font-size: 12px;
}
.workflow-setting-block p,
.workflow-type-panel header p {
  color: var(--muted);
  font-size: 13px;
}
.workflow-filter-section h2 {
  color: var(--muted);
  font-size: 15px;
}
.workflow-scope-select select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}
.workflow-setting-block {
  display: grid;
  gap: 9px;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f2f5;
}
.workflow-setting-block header,
.workflow-filter-section h2,
.workflow-type-panel header,
.workflow-task-toolbar,
.workflow-task-group > header,
.workflow-detail-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.workflow-setting-header {
  min-width: 0;
  flex-wrap: wrap;
}
.workflow-setting-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.workflow-setting-title strong {
  min-width: 0;
  line-height: 1.35;
}
.workflow-setting-actions-inline {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.workflow-setting-block header strong { color: #37455a; font-size: 15px; font-weight: 500; }
.workflow-setting-block p { margin: 0; line-height: 1.55; }
.workflow-setting-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.workflow-setting-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.workflow-setting-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-setting-icon-approval {
  color: #3979c7;
  background: #eaf3ff;
}
.workflow-setting-icon-report {
  color: #228b6f;
  background: #e7f6f0;
}
.workflow-readonly-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 12px;
  padding: 0 8px;
  background: #f0f5fb;
  color: #6580a0;
  font-size: 11px;
}
.workflow-setting-tabs { display: inline-flex; gap: 5px; }
.workflow-setting-tabs b,
.workflow-setting-tabs i {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 0 8px;
  background: #edf7f2;
  color: var(--green);
  font-size: 11px;
  font-weight: 400;
  font-style: normal;
}
.workflow-setting-tabs i { background: #f1f4f7; color: #8492a3; }
.workflow-setting-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f4f7;
  color: #8492a3;
  font-size: 11px;
  font-weight: 500;
}
.workflow-setting-status.is-enabled {
  background: #e8f7f0;
  color: #2b9a72;
}
.workflow-disabled-action {
  justify-self: end;
  min-width: 52px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.workflow-daily-report-body {
  display: flex;
  align-items: center;
}
.workflow-setting-actions-inline .workflow-settings-button {
  min-width: 54px;
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
}
.workflow-settings-button { min-width: 72px; }
.workflow-toggle-row,
.workflow-time-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #536277;
  font-size: 12px;
}
.workflow-toggle-row input {
  width: 34px;
  height: 20px;
  accent-color: var(--blue);
}
.workflow-time-input {
  width: 104px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: #405068;
  font: inherit;
}
.workflow-setting-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.workflow-setting-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.workflow-daily-report-body small {
  color: #92a0b0;
  font-size: 11px;
  line-height: 1.45;
}
.workflow-filter-section {
  padding: 16px 20px 8px;
}
.workflow-filter-section h2 {
  margin: 0 0 10px;
  font-weight: 500;
}
.workflow-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.workflow-segmented button {
  min-width: 0;
  height: 38px;
  border: 1px solid #e4ebf3;
  border-radius: 8px;
  background: #fff;
  color: #596b82;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
}
.workflow-segmented button.active {
  border-color: #b9d9ff;
  background: #f0f7ff;
  color: var(--blue);
}
.workflow-status-list {
  display: grid;
  gap: 2px;
  margin-inline: -20px;
}
.workflow-status-list button,
.workflow-type-list button {
  min-width: 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 9px 9px 9px 10px;
  background: transparent;
  color: #56657a;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
}
.workflow-status-list button {
  padding-left: 17px;
  padding-right: 20px;
}
.workflow-status-list button:hover,
.workflow-type-list button:hover {
  border-left-color: var(--blue);
  background: #f4f8fd;
  color: var(--blue);
}
.workflow-status-list button.active,
.workflow-type-list button.active {
  border-left-color: var(--blue);
  background: transparent;
  color: var(--blue);
}
.workflow-status-list button.active .workflow-filter-icon,
.workflow-type-list button.active .workflow-filter-icon {
  color: var(--blue);
  background: #eaf3ff;
}
.workflow-status-list button b,
.workflow-type-list button b {
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  border-radius: 50%;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 500;
}
.workflow-status-list button .workflow-filter-count-status-all,
.workflow-type-list button .workflow-filter-count-type-all { color: #2f7de1; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-pending { color: #b7791f; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-pending.has-unread { background: #fff7df; }
.workflow-status-list button .workflow-filter-count-status-rejected,
.workflow-type-list button .workflow-filter-count-type-moments { color: #c45170; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-rejected { color: #c45170; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-rejected.has-unread { background: #fbeaf0; }
.workflow-status-list button .workflow-filter-count-status-scheduled,
.workflow-type-list button .workflow-filter-count-type-scheduled { color: #25756f; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-scheduled { color: #25756f; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-running,
.workflow-type-list button .workflow-filter-count-type-instant { color: #4671a3; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-running { color: #4671a3; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-completed { color: #19846a; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-failed,
.workflow-status-list button .workflow-filter-count-status-cancelled { color: #777f89; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-failed { color: #777f89; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-expired,
.workflow-type-list button .workflow-filter-count-type-hotel { color: #b46c19; background: transparent; }
.workflow-status-list button .workflow-filter-count-status-expired { color: #b46c19; background: transparent; }
.workflow-type-list button .workflow-filter-count-type-followup { color: #625cc0; background: transparent; }
.workflow-type-list button .workflow-filter-count-type-report { color: #19846a; background: transparent; }
.workflow-status-list button b.workflow-filter-count,
.workflow-type-list button b.workflow-filter-count {
  color: #000;
  font-size: 13px;
}
.workflow-sidebar-nav {
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.workflow-sidebar-nav button {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #7d8999;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.workflow-sidebar-nav button.active { color: var(--blue); }
.workflow-sidebar-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-type-panel {
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.workflow-type-panel header {
  display: block;
  padding: 22px 22px 18px;
}
.workflow-type-panel header h1 {
  margin: 0 0 7px;
  color: #273246;
  font-size: 22px;
  font-weight: 500;
}
.workflow-type-panel header p { margin: 0; line-height: 1.5; }
.workflow-type-panel section {
  padding: 20px 0;
  border-top: 1px solid #f0f2f5;
}
.workflow-type-panel section h2 {
  margin: 0;
  padding: 0 22px 11px;
  color: #37455a;
  font-size: 15px;
  font-weight: 500;
}
.workflow-type-list {
  display: grid;
  gap: 2px;
}
.workflow-type-list button { padding: 9px 22px; }
.workflow-filter-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: currentColor;
  background: #edf2f7;
}
.workflow-filter-icon-status-all,
.workflow-filter-icon-type-all { color: #3979c7; background: #eaf3ff; }
.workflow-filter-icon-status-pending,
.workflow-filter-icon-type-followup { color: #625cc0; background: #eeedfb; }
.workflow-filter-icon-status-rejected,
.workflow-filter-icon-type-moments { color: #c45170; background: #fbeaf0; }
.workflow-filter-icon-status-scheduled,
.workflow-filter-icon-type-scheduled { color: #25756f; background: #e7f5f3; }
.workflow-filter-icon-status-running,
.workflow-filter-icon-type-instant { color: #4671a3; background: #edf3f9; }
.workflow-filter-icon-status-completed,
.workflow-filter-icon-type-report { color: #19846a; background: #e7f6f1; }
.workflow-filter-icon-status-failed { color: #b35a5a; background: #fbeceb; }
.workflow-filter-icon-status-cancelled { color: #777f89; background: #eef1f4; }
.workflow-filter-icon-status-expired,
.workflow-filter-icon-type-hotel { color: #b46c19; background: #fff3e3; }
.workflow-filter-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.workflow-main-header {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 17px 22px 13px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.workflow-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.workflow-calendar-toolbar .icon-button {
  width: 32px;
  height: 34px;
  color: #53657d;
  font-size: 27px;
}
.workflow-today-button {
  height: 34px;
  padding: 0 12px;
  color: var(--blue);
  font-size: 12px;
}
.workflow-calendar-strip {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 1fr);
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: thin;
}
.workflow-calendar-day {
  min-width: 62px;
  min-height: 64px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  border: 1px solid #e9eef4;
  border-radius: 8px;
  background: #f7f9fc;
  color: #718096;
  cursor: pointer;
  font: inherit;
}
.workflow-calendar-day:hover { border-color: #bedcff; background: #f1f7ff; }
.workflow-calendar-day.active { border-color: #79b7ff; background: #edf6ff; color: var(--blue); }
.workflow-calendar-day small { font-size: 10px; }
.workflow-calendar-day strong { font-size: 16px; font-weight: 500; }
.workflow-calendar-day em { min-height: 14px; color: #94a1b1; font-size: 10px; font-style: normal; }
.workflow-calendar-day.active em { color: var(--blue); }
.workflow-task-area {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 34px;
}
.workflow-task-toolbar {
  min-height: 48px;
  margin-bottom: 15px;
}
.workflow-task-toolbar h2 {
  margin: 0 0 5px;
  color: #273246;
  font-size: 20px;
  font-weight: 500;
}
.workflow-task-toolbar span {
  color: var(--muted);
  font-size: 12px;
}
.workflow-create-button { height: 36px; padding: 0 14px; font-size: 12px; }
.workflow-task-group { margin-bottom: 22px; }
.workflow-task-group > header {
  min-height: 30px;
  margin-bottom: 9px;
  color: #506077;
}
.workflow-task-group > header strong { font-size: 14px; font-weight: 500; }
.workflow-task-group > header span { color: #95a1b0; font-size: 12px; }
.workflow-task-cards { display: grid; gap: 9px; }
.workflow-task-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid #e6ecf2;
  border-left: 3px solid #b8c8d9;
  border-radius: 8px;
  padding: 13px 15px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 2px 6px rgba(30, 52, 74, 0.03);
}
.workflow-task-card:hover { border-color: #bddbfa; box-shadow: 0 5px 14px rgba(30, 77, 122, 0.08); }
.workflow-task-card.status-completed { border-left-color: #76c8a7; }
.workflow-task-card.status-pending_approval,
.workflow-task-card.status-ai_rejected { border-left-color: #efb45e; }
.workflow-task-card.status-failed,
.workflow-task-card.status-partially_failed { border-left-color: #e58d8d; }
.workflow-task-time {
  padding-top: 2px;
  color: #77879a;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.workflow-task-card-body { min-width: 0; display: grid; gap: 6px; }
.workflow-task-card-body > strong {
  overflow: hidden;
  color: #334258;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-task-card-body > small {
  overflow: hidden;
  color: #7b899b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-task-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.workflow-task-tags i {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 0 8px;
  background: #f0f4f8;
  color: #6d7d90;
  font-size: 10px;
  font-style: normal;
}
.workflow-task-card.status-completed .workflow-task-tags i:first-child { background: #e8f7f0; color: #2b9a72; }
.workflow-task-card.status-pending_approval .workflow-task-tags i:first-child,
.workflow-task-card.status-ai_rejected .workflow-task-tags i:first-child { background: #fff5e5; color: #b8791c; }
.workflow-empty-state {
  min-height: 340px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: #94a1b1;
}
.workflow-empty-icon { font-size: 42px; line-height: 1; }
.workflow-empty-state strong { color: #607087; font-size: 15px; font-weight: 500; }
.workflow-empty-state p { margin: 0; font-size: 12px; }
.workflow-nav-badge {
  position: absolute;
  top: 2px;
  right: auto;
  left: calc(50% + 14px);
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  padding: 0 4px;
  background: #ef8c8c;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}
.workflow-sidebar-nav button { position: relative; }
.workflow-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(30, 42, 58, 0.28);
}
.workflow-detail-backdrop[hidden] { display: none; }
.workflow-detail-dialog {
  width: min(720px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(30, 45, 64, 0.22);
}
.workflow-detail-dialog > header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.workflow-detail-dialog > header h2 { margin: 0 0 4px; color: #273246; font-size: 18px; font-weight: 500; }
.workflow-detail-dialog > header p { margin: 0; color: var(--muted); font-size: 12px; }
.workflow-detail-body { min-height: 0; overflow-y: auto; padding: 18px; }
.workflow-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.workflow-detail-summary > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  background: #fafbfd;
}
.workflow-detail-summary span { color: var(--muted); font-size: 11px; }
.workflow-detail-summary strong { overflow: hidden; color: #3e4c61; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.workflow-status-text.status-completed { color: #2b9a72; }
.workflow-status-text.status-pending_approval,
.workflow-status-text.status-ai_rejected { color: #b8791c; }
.workflow-status-text.status-failed,
.workflow-status-text.status-partially_failed { color: #c34d4d; }
.workflow-detail-copy { padding-bottom: 15px; border-bottom: 1px solid #edf0f4; }
.workflow-detail-copy h3 { margin: 0 0 12px; color: #344359; font-size: 16px; font-weight: 500; }
.workflow-detail-copy dl { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: 12px; }
.workflow-detail-copy dt { color: var(--muted); }
.workflow-detail-copy dd { min-width: 0; margin: 0; color: #536277; white-space: pre-wrap; overflow-wrap: anywhere; }
.workflow-detail-section { padding-top: 17px; }
.workflow-detail-section > header { margin-bottom: 10px; }
.workflow-detail-section > header h3 { margin: 0; color: #3b4b61; font-size: 14px; font-weight: 500; }
.workflow-detail-section > header span { color: var(--muted); font-size: 11px; }
.workflow-ai-followup-editor {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid #dce9f8;
  border-radius: 7px;
  background: #fbfdff;
}
.workflow-ai-followup-text {
  display: grid;
  gap: 7px;
  color: #6c7d94;
  font-size: 12px;
}
.workflow-ai-followup-text textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid #d6e3f2;
  border-radius: 7px;
  padding: 10px 12px;
  color: #3f4f65;
  font: 13px/1.7 inherit;
  outline: none;
  background: #fff;
}
.workflow-ai-followup-text textarea:focus { border-color: #8ec4ff; box-shadow: 0 0 0 3px rgba(47, 143, 246, 0.12); }
.workflow-ai-followup-text textarea[readonly] { background: #f6f8fb; color: #657489; }
.workflow-ai-followup-materials { margin-top: 12px; }
.workflow-ai-followup-materials-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #4b5d73;
  font-size: 12px;
}
.workflow-ai-followup-materials-head strong { font-weight: 500; }
.workflow-ai-followup-materials-head span { color: var(--muted); }
.workflow-ai-followup-material-list { display: grid; gap: 8px; }
.workflow-ai-followup-material {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: flex-start;
  border: 1px solid #e4ebf3;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
}
.workflow-ai-followup-material.selected { border-color: #9dcfff; background: #f1f8ff; }
.workflow-ai-followup-material input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); }
.workflow-ai-followup-material span { min-width: 0; display: grid; gap: 3px; }
.workflow-ai-followup-material strong { color: #3f4f65; font-size: 12px; font-weight: 500; }
.workflow-ai-followup-material small { color: #8a98aa; font-size: 11px; }
.workflow-ai-followup-material em {
  max-height: 36px;
  overflow: hidden;
  color: #6c7d94;
  font-size: 11px;
  font-style: normal;
  line-height: 1.6;
}
.workflow-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.workflow-detail-actions .primary-button,
.workflow-detail-actions .secondary-button {
  min-width: 96px;
  height: 38px;
}
.workflow-detail-readonly {
  margin: 10px 0 0;
  color: #8a98aa;
  font-size: 12px;
}
.workflow-create-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#workflow-message-modal { z-index: 150; }
.workflow-message-dialog {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(30, 45, 64, 0.22);
}
.workflow-message-dialog > header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.workflow-message-dialog > header h2 { margin: 0 0 4px; color: #273246; font-size: 18px; font-weight: 500; }
.workflow-message-dialog > header p { margin: 0; color: var(--muted); font-size: 12px; }
.workflow-message-modal-body {
  min-height: 0;
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
}
.workflow-message-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f1;
  border-radius: 7px;
  background: #fbfcfe;
}
.workflow-message-section-head,
.workflow-message-batch-head,
.workflow-message-target-panel-head,
.workflow-message-editor header,
.workflow-message-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.workflow-message-batch-head strong,
.workflow-message-section-head strong { color: #37455a; font-size: 14px; font-weight: 500; }
.workflow-message-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.workflow-message-target-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce8f7;
  border-radius: 7px;
  background: #f4f9ff;
}
.workflow-message-target-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.workflow-message-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d6e4f3;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  text-align: left;
}
.workflow-message-chip.active { border-color: #88bfff; background: #edf6ff; }
.workflow-message-chip .avatar { width: 28px; height: 28px; border-radius: 7px; }
.workflow-message-chip span { min-width: 0; display: grid; gap: 2px; }
.workflow-message-chip strong { color: #3f4f65; font-size: 12px; font-weight: 500; }
.workflow-message-chip small { color: #8492a3; font-size: 11px; }
.workflow-message-chip-remove {
  margin-left: 2px;
  color: #9aa7b6;
  font-style: normal;
}
.workflow-message-search { margin-bottom: 2px; }
.workflow-message-search-results {
  display: grid;
  gap: 6px;
  max-height: 190px;
  margin: 8px 0 10px;
  overflow-y: auto;
}
.workflow-message-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dce8f7;
  border-radius: 7px;
  background: #fff;
  color: #40516a;
  text-align: left;
}
.workflow-message-search-result.selected {
  border-color: #8fbfff;
  background: #edf6ff;
}
.workflow-message-search-result .avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.workflow-message-search-result > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.workflow-message-search-result strong {
  overflow: hidden;
  color: #40516a;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-message-search-result small {
  overflow: hidden;
  color: #8b98a8;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-message-search-result i {
  color: #2f8ff6;
  font-size: 11px;
  font-style: normal;
}
.workflow-message-search-empty {
  padding: 8px 2px;
  color: #98a5b4;
  font-size: 12px;
}
.workflow-message-schedule-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.workflow-message-schedule-row .settings-field input[readonly] {
  background: #f6f8fb;
}
.workflow-message-recipient-editors {
  display: grid;
  gap: 10px;
}
.workflow-message-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce5f1;
  border-radius: 7px;
  background: #fff;
}
.workflow-message-editor.active { border-color: #8fbfff; box-shadow: 0 0 0 3px rgba(47, 143, 246, 0.08); }
.workflow-message-editor header strong { color: #37455a; font-size: 13px; font-weight: 500; }
.workflow-message-editor header span { color: #8b98a8; font-size: 11px; }
.workflow-message-editor textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid #d7e3f1;
  border-radius: 7px;
  padding: 10px 12px;
  color: #3f4f65;
  font: 13px/1.7 inherit;
  outline: none;
  background: #fff;
}
.workflow-message-editor textarea:focus {
  border-color: #8fc3ff;
  box-shadow: 0 0 0 3px rgba(47, 143, 246, 0.12);
}
.workflow-message-editor textarea[readonly] { background: #f6f8fb; color: #657489; }
.workflow-message-editor-footer {
  color: #8a98aa;
  font-size: 11px;
}
.workflow-message-empty {
  padding: 10px 0;
  color: #98a5b4;
  font-size: 12px;
}
.workflow-message-dialog footer {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.workflow-message-footer-meta { min-width: 0; color: #7d8ca0; font-size: 12px; }
.workflow-message-footer-actions { display: flex; gap: 10px; }
.workflow-message-footer-actions .primary-button,
.workflow-message-footer-actions .secondary-button {
  min-width: 108px;
  height: 40px;
}
.workflow-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.workflow-report-metrics > div {
  min-width: 0;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  padding: 10px;
  background: #fbfcfe;
}
.workflow-report-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.workflow-report-metrics strong {
  display: block;
  margin-top: 5px;
  color: #314158;
  font-size: 18px;
  font-weight: 600;
}
.workflow-report-meta {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0 0 12px;
  font-size: 12px;
}
.workflow-report-meta dt { color: var(--muted); }
.workflow-report-meta dd {
  min-width: 0;
  margin: 0;
  color: #536277;
  overflow-wrap: anywhere;
}
.workflow-report-body-text {
  margin: 0;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  padding: 12px;
  background: #fbfcfe;
  color: #405068;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.workflow-recipient-list { display: grid; gap: 7px; }
.workflow-recipient-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(100px, 150px) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f6;
}
.workflow-recipient-row .avatar { width: 32px; height: 32px; border-radius: 7px; }
.workflow-recipient-row > div { min-width: 0; display: grid; gap: 3px; }
.workflow-recipient-row strong { overflow: hidden; color: #47566b; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.workflow-recipient-row small { color: var(--muted); font-size: 10px; }
.workflow-recipient-row p { min-width: 0; margin: 0; overflow: hidden; color: #657489; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-detail-empty { padding: 12px 0; color: #98a5b4; font-size: 12px; }
.workflow-timeline { display: grid; gap: 8px; }
.workflow-timeline > div { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 8px; }
.workflow-timeline i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #9fc7ee; }
.workflow-timeline p { display: grid; gap: 3px; margin: 0; }
.workflow-timeline strong { color: #56667c; font-size: 12px; font-weight: 500; }
.workflow-timeline span { color: #96a2b1; font-size: 11px; }
.settings-resource-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}
.settings-resource-list {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.settings-resource-list-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px 8px 16px; }
.settings-resource-list-header > div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.settings-resource-list-header span { color: var(--muted); font-size: 13px; }
.settings-list-add-button { min-height: 36px; padding: 0 14px; white-space: nowrap; }
.settings-list-add-button.secondary-button { color: var(--blue); }
.settings-resource-items { min-height: 0; display: grid; align-content: start; overflow-y: auto; overscroll-behavior: contain; }
.settings-resource-row { min-width: 0; display: flex; align-items: stretch; gap: 8px; padding-right: 10px; }
.settings-resource-item {
  flex: 1 1 auto;
  min-height: 68px;
  display: grid;
  gap: 5px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 12px 15px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.settings-resource-item:hover { background: #f4f7fa; }
.settings-resource-item.active { border-left-color: var(--blue); background: transparent; }
.settings-static-item { cursor: default; }
.settings-static-item:hover { background: #edf6ff; }
.settings-resource-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.settings-resource-item span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.settings-resource-status-button { flex: 0 0 auto; align-self: center; min-height: 34px; padding: 0 10px; white-space: nowrap; }
.settings-scope-badge { display: inline-flex; align-items: center; min-height: 22px; border-radius: 4px; padding: 0 7px; background: #e7f6f0; color: #168963; font-size: 11px; }
.settings-scope-badge.specified { background: #e9f3ff; color: #2c7fd2; }
.settings-scope-badge.inherited { background: #f1f2f4; color: #707b8b; }
.settings-scope-badge.exclusive { background: #fff2e6; color: #c76a19; }
.settings-scope-badge.inactive { background: #fff0f0; color: #c94f4f; }
.settings-editor,
.settings-detail-card {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 28px;
  background: #fff;
}
.settings-detail-stack {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 28px;
  background: #fff;
}
.settings-detail-stack::-webkit-scrollbar-track { margin-block: 12px; }
.settings-workflow-layout { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); }
.settings-workflow-nav .settings-resource-item span { line-height: 1.45; white-space: normal; }
.settings-workflow-detail { padding: 18px 20px 24px; }
.settings-workflow-form { max-width: 860px; margin: 0 auto; }
.settings-workflow-form > .settings-section { gap: 14px; }
.settings-workflow-form .settings-section > header { align-items: flex-start; }
.settings-workflow-form .settings-section > header > div { min-width: 0; }
.settings-workflow-form .settings-section > header p { line-height: 1.5; }
.settings-workflow-placeholder-action { align-content: end; }
.settings-workflow-placeholder-action button { width: max-content; min-width: 92px; }
.settings-workflow-actions { justify-content: space-between; }
.settings-editor.empty { display: grid; place-items: center; color: var(--muted); }
.settings-editor-form { display: grid; gap: 18px; }
.settings-default-notice { padding: 11px 13px; border: 1px solid #c8e8da; border-radius: 6px; background: #effaf5; color: #27775d; font-size: 13px; line-height: 1.55; }
.settings-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-form-row-with-actions { grid-template-columns: minmax(236px, 310px) minmax(0, 1fr); align-items: end; gap: 12px; }
.settings-form-row-import-actions { grid-template-columns: minmax(0, .9fr) minmax(190px, .45fr) auto; align-items: end; }
@media (min-width: 761px) {
  .settings-form-row-with-actions.persona-status-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.settings-status-action-row { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.settings-status-action-row--resource { flex-wrap: nowrap; align-items: center; gap: 8px; }
.settings-resource-status-toggle { flex: 1 1 180px; min-width: 170px; }
.settings-status-action-row--resource .settings-resource-status-toggle { flex: 0 0 154px; min-width: 154px; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; padding-inline: 10px; }
.settings-inline-import-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.settings-inline-import-actions--resource { flex: 1 1 auto; min-width: 0; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.settings-inline-import-actions--resource .primary-button,
.settings-inline-import-actions--resource .danger-button { flex: 0 0 auto; }
.settings-inline-import-actions .primary-button,
.settings-inline-import-actions .danger-button { height: 44px; min-height: 44px; white-space: nowrap; }
.settings-inline-import-actions--resource .primary-button,
.settings-inline-import-actions--resource .danger-button { height: 40px; min-height: 40px; padding-inline: 16px; }
.settings-field { display: grid; gap: 8px; color: #64748a; font-size: 13px; }
.settings-field input,
.settings-field textarea,
.settings-field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 11px 13px;
  background: #fff;
  color: var(--text);
  outline: 0;
}
.settings-field input, .settings-field select { min-height: 44px; }
.settings-field textarea { min-height: 138px; resize: vertical; line-height: 1.6; }
.persona-long-field textarea {
  height: 138px;
  min-height: 138px;
  max-height: 280px;
  overflow-y: auto;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.settings-field input:focus,
.settings-field textarea:focus,
.settings-field select:focus { border-color: #8bc2ff; box-shadow: 0 0 0 3px rgba(51, 145, 255, 0.08); }
.settings-segmented { display: inline-grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); align-items: center; gap: 4px; width: min(100%, 350px); padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #f5f7f9; }
.settings-form-row-with-actions .settings-segmented { grid-template-columns: minmax(88px, .72fr) minmax(132px, 1fr); width: min(100%, 286px); }
.settings-segmented label { position: relative; }
.settings-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.settings-segmented span { min-height: 36px; display: grid; place-items: center; border-radius: 5px; color: var(--muted); cursor: pointer; }
.settings-segmented input:checked + span { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(32, 62, 94, 0.09); }
.settings-target-section { display: grid; gap: 10px; padding: 14px; border: 1px dashed #cfd9e5; border-radius: 7px; }
.settings-target-section header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-help-text { margin: -2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.agent-handoff-target-section { background: #fbfdff; }
.settings-target-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.target-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 29px; border-radius: 4px; padding: 0 9px; background: #edf6ff; color: #2e70b4; font-size: 12px; }
.target-chip small { color: #6f8aaa; }
.target-chip-count { background: #f2f5f8; color: #5d6e82; }
.settings-file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.settings-file-link { color: var(--blue); text-decoration: none; }
#settings-file-input,
#material-add-input {
  min-height: 48px;
  padding: 5px 7px;
  border-color: #c8ddf5;
  background: #fbfdff;
  color: #6f7f94;
  cursor: pointer;
}
#settings-file-input::file-selector-button {
  min-height: 36px;
  margin-right: 12px;
  border: 1px solid #b8d7fb;
  border-radius: 6px;
  padding: 0 15px;
  background: #edf6ff;
  color: #247bd8;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
#material-add-input::file-selector-button {
  min-height: 36px;
  margin-right: 12px;
  border: 1px solid #338bf2;
  border-radius: 6px;
  padding: 0 15px;
  background: #338bf2;
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
#settings-file-input:hover::file-selector-button {
  border-color: #78b5f8;
  background: #e1f0ff;
  color: #126bc8;
}
#material-add-input:hover::file-selector-button {
  border-color: #2379dc;
  background: #2379dc;
  color: #fff;
}
#settings-file-input:active::file-selector-button { background: #d5eaff; }
#material-add-input:active::file-selector-button { background: #1c67c4; }
#settings-file-input:focus-visible,
#material-add-input:focus-visible { border-color: #78b5f8; box-shadow: 0 0 0 3px rgba(51, 145, 255, 0.1); }
.settings-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.subaccount-security-row { align-items: end; }
.subaccount-wechat-section { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #f9fbfd; }
.subaccount-wechat-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subaccount-wechat-section > header strong { font-weight: 500; }
.subaccount-wechat-section > header span { color: var(--muted); font-size: 12px; }
.subaccount-wechat-grid { --subaccount-wechat-option-height: 46px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; max-height: calc(var(--subaccount-wechat-option-height) * 10 + 72px); overflow-y: auto; padding-right: 4px; }
.subaccount-wechat-option { position: relative; min-width: 0; max-width: min(100%, 260px); height: var(--subaccount-wechat-option-height); display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; background: #fff; cursor: pointer; }
.subaccount-wechat-option:hover { border-color: #a8cdf8; }
.subaccount-wechat-option.selected { border-color: #82baff; background: #edf6ff; }
.subaccount-wechat-option input { position: absolute; opacity: 0; pointer-events: none; }
.subaccount-wechat-avatar { width: 32px; height: 32px; border-radius: 7px; }
.subaccount-wechat-option strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.subaccount-wechat-option > i { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border: 1px solid #c8d5e4; border-radius: 50%; color: transparent; font-size: 12px; font-style: normal; }
.subaccount-wechat-option.selected > i { border-color: var(--blue); background: var(--blue); color: #fff; }
.faq-question-section { display: grid; gap: 14px; padding-top: 4px; }
.faq-question-section > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.faq-question-section > header > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.faq-question-section > header strong { font-size: 16px; font-weight: 500; }
.faq-question-section > header span { color: var(--muted); font-size: 12px; }
.faq-question-header-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.faq-question-section > header .faq-question-header-hint {
  max-width: min(640px, 56vw);
  padding: 7px 10px;
  border: 1px solid #c8e8da;
  border-radius: 6px;
  background: #effaf5;
  color: #27775d;
  font-size: 12px;
  line-height: 1.45;
}
.faq-question-header-actions #faq-import-status { margin-left: 0 !important; max-width: min(360px, 36vw) !important; }
.faq-question-compose { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.faq-question-compose .settings-field textarea { height: 138px; min-height: 138px; max-height: 280px; overflow-y: auto; }
.faq-question-compose-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.faq-question-variant-hint {
  margin-right: auto;
  padding: 11px 13px;
  border: 1px solid #c8e8da;
  border-radius: 6px;
  background: #effaf5;
  color: #27775d;
  font-size: 12px;
  line-height: 1.55;
}
.faq-question-list { display: grid; gap: 10px; }
.faq-question-empty { padding: 34px 16px; border: 1px dashed #d6dee8; border-radius: 7px; color: var(--muted); text-align: center; }
.faq-question-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.faq-question-card.disabled { opacity: 0.62; background: #f7f8fa; }
.faq-question-copy { min-width: 0; display: grid; gap: 7px; }
.faq-question-copy strong { font-weight: 500; overflow-wrap: anywhere; }
.faq-question-copy p { margin: 0; color: #627186; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.faq-question-actions { display: flex; align-items: center; gap: 7px; }
.faq-question-actions .secondary-button,
.faq-question-actions .danger-button { min-height: 34px; padding: 0 11px; font-size: 12px; }
.semantic-sample-compose { grid-template-columns: minmax(180px, 0.55fr) minmax(260px, 1fr); }
.semantic-sample-compose .semantic-expression-field { grid-column: 1 / -1; }
.semantic-sample-compose .settings-field textarea { height: auto; min-height: 76px; }
.semantic-sample-card .faq-question-copy small { color: var(--muted); font-size: 12px; }
.semantic-sample-card .faq-question-copy p { display: flex; flex-wrap: wrap; gap: 7px; white-space: normal; }
.semantic-expression-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border: 1px solid #d8e7e5; border-radius: 999px; background: #f1f8f7; color: #35625e; line-height: 1.35; }
.faq-import-actions { display: flex; align-items: center; gap: 10px; }
.faq-import-dialog { width: min(980px, calc(100vw - 40px)); max-height: min(860px, calc(100vh - 40px)); }
.faq-import-list { min-height: 180px; max-height: calc(100vh - 250px); overflow-y: auto; display: grid; gap: 10px; padding: 16px 20px; }
.faq-import-item { display: grid; grid-template-columns: 76px minmax(0, .85fr) minmax(0, 1.15fr); gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.faq-import-item.unselected { opacity: .55; background: #f5f7f9; }
.faq-import-select { min-height: 40px; display: flex; align-items: center; gap: 7px; color: #526174; }
.faq-import-select input { width: 17px; height: 17px; }
.faq-import-item .settings-field textarea { min-height: 102px; max-height: 240px; overflow-y: auto; }
.knowledge-library-section { display: grid; gap: 14px; padding-top: 4px; }
.knowledge-library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.knowledge-library-toolbar > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.knowledge-library-toolbar strong { font-size: 16px; font-weight: 500; }
.knowledge-library-toolbar span,
.knowledge-import-status { color: var(--muted); font-size: 12px; }
.knowledge-import-tools { display: flex; align-items: center; gap: 10px; }
.knowledge-document-list { display: grid; gap: 9px; min-height: 90px; }
.knowledge-document-card { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.knowledge-document-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.knowledge-document-actions .secondary-button,
.knowledge-document-actions .danger-button { min-height: 34px; padding: 0 11px; font-size: 12px; }
.knowledge-document-icon { min-height: 48px; display: grid; place-items: center; border-radius: 6px; background: #edf6ff; color: var(--blue); font-size: 12px; }
.knowledge-document-copy { min-width: 0; display: grid; gap: 5px; }
.knowledge-document-copy strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-document-copy span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-document-copy p { max-height: 4.6em; margin: 2px 0 0; overflow: hidden; color: #627186; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.material-library-section { display: grid; gap: 14px; padding-top: 4px; }
.material-library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.material-library-toolbar > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.material-library-toolbar strong { font-size: 16px; font-weight: 500; }
.material-library-toolbar span { color: var(--muted); font-size: 12px; }
.material-upload-tools { display: flex; align-items: center; gap: 9px; }
.material-upload-tools select { min-width: 130px; height: 40px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 34px 0 12px; color: var(--text); }
.material-kind-tabs { display: grid; grid-template-columns: repeat(5, minmax(76px, 1fr)); gap: 9px; overflow-x: auto; scrollbar-width: none; }
.material-kind-tabs::-webkit-scrollbar { display: none; }
.material-kind-tabs button { min-width: 0; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #344358; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; cursor: pointer; }
.material-kind-tabs button span { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #edf1f5; color: #8492a6; display: inline-grid; place-items: center; font-size: 11px; }
.material-kind-tabs button.active { border-color: #8fc5ff; color: var(--blue); background: #edf6ff; }
.material-kind-tabs button.active span { background: #dceeff; color: var(--blue); }
.material-item-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; min-height: 90px; }
.material-item-list > .list-empty { grid-column: 1 / -1; }
.material-item-card { min-width: 0; align-self: start; display: grid; grid-template-rows: auto auto auto; gap: 10px; padding: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.material-item-visual { width: 100%; aspect-ratio: 16 / 9; min-width: 0; display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 6px; background: #f2f5f8; }
.material-image-preview,
.material-video-preview { height: auto; aspect-ratio: 16 / 9; align-self: start; }
button.material-item-visual { padding: 0; cursor: zoom-in; }
.material-image-preview img,
.material-video-preview video { display: block; width: 100%; height: 100%; }
.material-image-preview img { object-fit: cover; background: #fff; }
.material-video-preview video { object-fit: cover; background: #fff; }
.material-media-fallback { display: none; color: var(--muted); font-size: 12px; }
.material-item-visual.is-unavailable img,
.material-item-visual.is-unavailable video { display: none; }
.material-item-visual.is-unavailable .material-media-fallback { display: inline-flex; }
.material-file-preview { background: #f6f8fa; }
.material-file-icon { position: relative; width: 58px; height: 72px; display: grid; place-items: end center; padding: 0 5px 11px; border-radius: 6px; background: #6f8298; color: #fff; box-shadow: 0 5px 14px rgba(44, 61, 80, 0.12); }
.material-file-icon::after { content: ""; position: absolute; top: 0; right: 0; width: 18px; height: 18px; border-radius: 0 5px 0 5px; background: rgba(255, 255, 255, 0.58); }
.material-file-icon span { position: relative; z-index: 1; width: 100%; overflow: hidden; font-size: 10px; font-weight: 600; line-height: 1; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.material-file-icon--pdf { background: #e65d58; }
.material-file-icon--document { background: #3f82d9; }
.material-file-icon--sheet { background: #2c9b72; }
.material-file-icon--presentation { background: #e58a3d; }
.material-file-icon--archive { background: #8066b2; }
.material-file-icon--text { background: #708090; }
.material-file-icon--audio { background: #d15f91; }
.material-file-icon--link { background: #2f9a9a; }
.material-file-icon--app { background: #7568c7; }
.material-file-icon--channel { background: #d36e53; }
.material-item-copy { min-width: 0; align-content: start; display: grid; gap: 5px; overflow: hidden; }
.material-item-copy strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-item-copy span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-item-copy .material-ai-pending { color: var(--blue); }
.material-item-description { display: -webkit-box; margin: 0; overflow: hidden; color: #627186; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.material-item-actions { min-height: 35px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line); }
.material-item-actions .secondary-button,
.material-item-actions .danger-button { min-height: 34px; padding: 0 11px; font-size: 12px; }
.material-item-actions .secondary-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.material-add-dialog { width: min(720px, calc(100vw - 40px)); grid-template-rows: auto minmax(0, 1fr) auto; }
.material-add-body { min-height: 260px; overflow: auto; display: grid; align-content: start; gap: 14px; padding: 4px 22px 18px; }
.material-upload-button { min-height: 40px; padding-inline: 17px; }
.material-selected-files { min-height: 52px; max-height: 150px; overflow: auto; display: grid; gap: 7px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.material-selected-files > span { color: var(--muted); font-size: 13px; }
.material-selected-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.material-selected-file strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.material-selected-file small { flex: 0 0 auto; color: var(--muted); }
.material-single-fields { display: grid; gap: 14px; }
.material-add-summary { max-width: min(440px, 56%); color: var(--muted); font-size: 12px; line-height: 1.45; }
.material-add-summary--single { padding: 8px 11px; border: 1px solid #b8e6d1; border-radius: 6px; background: #eefaf4; color: #18875e; font-size: 14px; font-weight: 500; }
.material-ai-complete-button { border-color: #b8e6d1; background: #e9f8f0; color: #18875e; }
.material-ai-complete-button:hover { border-color: #85d5b6; background: #d9f2e6; color: #107451; }
.material-batch-ai-option { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid #b9dafb; border-radius: 7px; background: #f1f8ff; }
.material-batch-ai-option input { margin-top: 4px; }
.material-batch-ai-option span { display: grid; gap: 4px; }
.material-batch-ai-option strong { font-size: 14px; font-weight: 500; }
.material-batch-ai-option em { color: var(--muted); font-size: 12px; font-style: normal; line-height: 1.6; }
.danger-button { min-height: 40px; border: 1px solid #ffc9c6; border-radius: var(--control-radius); padding: 0 17px; background: #fff7f6; color: var(--danger); cursor: pointer; }
.settings-placeholder { min-height: 260px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.settings-placeholder span { display: block; margin-bottom: 13px; font-size: 35px; color: #a9b4c1; }
.special-settings-form { width: 100%; display: grid; gap: 18px; margin: 0; }
.agent-section-picker { display: none; }
.special-settings-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 6px; }
.settings-mobile-action { display: none; }
.special-settings-toolbar h2,
.settings-section h2 { margin: 0; font-size: 18px; font-weight: 500; }
.special-settings-toolbar p,
.settings-section header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.settings-section { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.settings-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.token-billing-record-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.settings-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.settings-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13px; }
.token-ledger-table {
  min-width: 0;
  table-layout: fixed;
}
.token-ledger-table th:nth-child(1),
.token-ledger-table td:nth-child(1) {
  width: 156px;
  white-space: nowrap;
}
.token-ledger-table th:nth-child(2),
.token-ledger-table td:nth-child(2) { width: 190px; }
.token-ledger-table th:nth-child(3),
.token-ledger-table td:nth-child(3) { width: 110px; }
.token-ledger-table th:nth-child(4),
.token-ledger-table td:nth-child(4) { width: 132px; }
.token-ledger-table th:nth-child(5),
.token-ledger-table td:nth-child(5) { width: auto; }
.settings-table th,
.settings-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.settings-table th { color: var(--muted); font-weight: 500; background: #f8fafc; }
.settings-table tr:last-child td { border-bottom: 0; }
.settings-table small { display: block; margin-top: 4px; color: var(--muted); }
.token-billing-record-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.token-billing-record-title { font-weight: 400; }
.token-billing-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.token-billing-pagination .secondary-button {
  height: 40px;
  min-height: 40px;
  padding-inline: 14px;
}
.settings-field.token-billing-date {
  min-width: 206px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.settings-field.token-billing-date > span {
  flex: 0 0 auto;
  margin: 0;
}
.settings-field.token-billing-date input {
  height: 40px;
  min-height: 40px;
}
.token-change { font-weight: 600; color: var(--text); }
.token-change.positive { color: #047857; }
.token-change.negative { color: #b91c1c; }
.settings-layer-notice { border: 1px solid #cbe7dc; border-radius: 6px; padding: 11px 13px; background: #f0faf6; color: #287a5e; font-size: 13px; }
.compact-field { width: min(360px, 100%); }
.setting-toggle-row { position: relative; min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) 52px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; color: var(--text); }
.setting-toggle-row > span { display: grid; gap: 3px; }
.setting-toggle-row strong { font-weight: 500; }
.setting-toggle-row small { color: var(--muted); font-size: 12px; }
.setting-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.setting-toggle-row i,
.mini-switch i { position: relative; width: 46px; height: 26px; justify-self: end; border-radius: 13px; background: #c8d4e2; cursor: pointer; }
.setting-toggle-row i::after,
.mini-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.16s ease; }
.setting-toggle-row input:checked + i,
.mini-switch input:checked + i { background: var(--green); }
.setting-toggle-row input:checked + i::after,
.mini-switch input:checked + i::after { transform: translateX(20px); }
.setting-toggle-row input:disabled + i { opacity: 0.55; cursor: default; }
.setting-toggle-row.subaccount-status-toggle { height: 44px; min-height: 44px; padding-block: 0; }
.auto-tag-layout { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
.auto-tag-rule-list { min-width: 0; }
.auto-tag-master-toggle { display: grid; gap: 8px; border-block: 1px solid var(--line); padding: 12px; }
.auto-tag-master-toggle .setting-toggle-row { min-height: 58px; border: 0; padding: 4px 2px; background: transparent; }
.auto-tag-master-toggle > span { color: var(--muted); font-size: 12px; }
.auto-tag-rule-items .settings-resource-item { min-height: 72px; }
.auto-tag-rule-items .settings-resource-item.unavailable { opacity: 0.58; }
.auto-tag-rule-items .settings-resource-item span { min-width: 0; justify-content: space-between; }
.auto-tag-rule-items .settings-resource-item span i { flex: 0 0 auto; border-radius: 10px; padding: 2px 7px; background: #edf3f8; color: #7890a8; font-style: normal; }
.auto-tag-editor { overflow-x: hidden; }
.auto-tag-form { align-content: start; }
.auto-tag-editor-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.auto-tag-editor-header > div:first-child { min-width: 0; display: grid; gap: 5px; }
.auto-tag-editor-header strong { overflow: hidden; color: var(--text); font-size: 18px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.auto-tag-editor-header span { color: var(--muted); font-size: 12px; }
.auto-tag-editor-actions { flex: 0 0 auto; padding-top: 0; }
.auto-tag-toggle-grid,
.auto-tag-condition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.auto-tag-condition-grid textarea { min-height: 260px; resize: vertical; }
.ai-toggle-field .setting-toggle-row { height: 44px; min-height: 44px; padding-block: 0; }
.agent-reply-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.agent-reply-control-grid > .settings-field { min-width: 0; margin: 0; }
.agent-reply-control-grid > .settings-field > small { min-height: 34px; display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.agent-reply-toggle-card { min-height: 96px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.agent-reply-toggle-card .setting-toggle-row { min-height: 94px; height: auto; border: 0; padding: 15px 16px; background: transparent; }
.agent-reply-toggle-card .setting-toggle-row > span { align-self: stretch; justify-content: center; gap: 5px; }
.agent-reply-toggle-card .setting-toggle-row small { line-height: 1.45; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-provider-list { display: grid; gap: 16px; }
.ai-provider-card { gap: 20px; padding: 22px; }
.ai-provider-card > header { min-height: 40px; padding-bottom: 2px; }
.ai-provider-primary-fields { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr) minmax(0, 1fr); }
.ai-provider-access-fields { grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 1fr)); }
.ai-provider-primary-fields > *,
.ai-provider-access-fields > * { min-width: 0; }
.provider-select { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); }
.provider-select input { width: 17px; height: 17px; }
.danger-link { min-height: 36px; border: 1px solid #ffc9c6; border-radius: var(--control-radius); padding: 0 13px; background: #fff; color: var(--danger); white-space: nowrap; cursor: pointer; }
.danger-link:hover { border-color: #ffaaa5; background: #fff7f6; }
.model-name-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.model-name-header strong { font-weight: 500; }
.model-name-list { display: grid; gap: 10px; }
.model-name-row { min-height: 60px; display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: center; gap: 14px; padding: 8px 0; }
.model-name-row > input { min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); padding: 9px 12px; }
.model-name-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.model-name-actions .secondary-button { min-height: 40px; white-space: nowrap; }
.mini-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mini-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mini-switch i { width: 42px; height: 24px; }
.mini-switch i::after { width: 18px; height: 18px; }
.mini-switch input:checked + i::after { transform: translateX(18px); }
.model-test-status { max-width: 180px; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.model-test-status.success { color: var(--green); }
.model-test-status.error { color: var(--danger); }

.modal-backdrop { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(31, 43, 58, 0.38); }
#target-modal { z-index: 140; }
.target-dialog { width: min(720px, 100%); max-height: min(760px, calc(100dvh - 40px)); display: grid; grid-template-rows: auto auto minmax(180px, 1fr) auto; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(20, 33, 48, 0.23); }
.target-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 22px 15px; }
.target-dialog h2 { margin: 0; font-size: 19px; font-weight: 500; }
.target-dialog header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.target-search { margin: 0 22px 14px; }
.target-list { overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.target-option { min-height: 62px; display: grid; grid-template-columns: auto 42px minmax(0, 1fr); align-items: center; gap: 11px; padding: 9px 22px; border-bottom: 1px solid #eef1f4; cursor: pointer; }
.target-option:hover { background: #f7f9fb; }
.target-option input { width: 18px; height: 18px; }
.target-option .avatar { width: 42px; height: 42px; }
.target-option-copy { min-width: 0; display: grid; gap: 4px; }
.target-option-copy strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.target-option-copy strong .external-wechat-label { color: var(--green); font-size: .78em; }
.target-option-copy strong .internal-group-label { color: var(--blue); font-size: .78em; }
.target-option-copy span { color: var(--muted); font-size: 12px; }
.forward-target-item { min-height: 62px; display: grid; grid-template-columns: auto 42px minmax(0, 1fr); align-items: center; gap: 11px; padding: 9px 22px; border-bottom: 1px solid #eef1f4; cursor: pointer; }
.forward-target-item:hover { background: #f7f9fb; }
.forward-target-item input { width: 18px; height: 18px; }
.forward-target-avatar { width: 42px; height: 42px; }
.forward-target-item > span { min-width: 0; display: grid; gap: 4px; }
.forward-target-item strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.forward-target-item strong .external-wechat-label { color: var(--green); font-size: .78em; }
.forward-target-item strong .internal-group-label { color: var(--blue); font-size: .78em; }
.forward-target-item em { color: var(--muted); font-size: 12px; font-style: normal; }
.target-dialog > footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; }
.target-dialog > footer > span { color: var(--muted); font-size: 13px; }
.target-dialog > footer > div { display: flex; gap: 10px; }
.workflow-daily-report-dialog { width: min(780px, 100%); max-height: min(840px, calc(100dvh - 40px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(20, 33, 48, 0.23); }
.workflow-daily-report-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.workflow-daily-report-dialog h2 { margin: 0; font-size: 19px; font-weight: 500; }
.workflow-daily-report-dialog header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.workflow-daily-report-modal-body { min-height: 0; display: grid; gap: 14px; overflow-y: auto; padding: 18px 22px 20px; }
.workflow-daily-report-section { display: grid; gap: 12px; }
.workflow-daily-report-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #51627b; }
.workflow-daily-report-section > header strong { color: #39485e; font-weight: 500; }
.workflow-daily-report-section > header span { color: var(--muted); font-size: 12px; }
.workflow-daily-report-rule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.workflow-daily-report-rule-row .settings-field { margin: 0; min-width: 0; }
.workflow-daily-report-target-section { padding: 14px; background: #fafcff; }
.workflow-daily-report-target-section .settings-target-chips { min-height: 40px; }
.workflow-daily-report-password-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.workflow-daily-report-password-row .settings-field { margin: 0; }
.workflow-daily-report-password-row button { min-width: 104px; }
.workflow-daily-report-password-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.workflow-daily-report-dialog > footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); }
.workflow-daily-report-dialog > footer > div { display: flex; gap: 10px; }
.workflow-daily-report-dialog > footer > div:first-child .secondary-button { min-width: 132px; }
.workflow-ai-approval-dialog {
  width: min(680px, 100%);
  max-height: min(860px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 33, 48, 0.23);
}
.workflow-ai-approval-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.workflow-ai-approval-dialog h2 { margin: 0; color: #273246; font-size: 21px; font-weight: 500; }
.workflow-ai-approval-title-row { display: flex; align-items: center; gap: 9px; }
.workflow-live-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5f7ee;
  color: #2b9a72;
  font-size: 11px;
}
.workflow-ai-approval-dialog > header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.workflow-ai-approval-modal-body { min-height: 0; display: grid; gap: 15px; overflow-y: auto; padding: 18px 24px 22px; }
.workflow-ai-approval-toggle { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.workflow-ai-approval-section { display: grid; gap: 11px; }
.workflow-ai-approval-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #51627b; }
.workflow-ai-approval-section > header strong { color: #39485e; font-weight: 500; }
.workflow-ai-approval-section > header span { color: var(--muted); font-size: 12px; }
.workflow-ai-approval-time-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.workflow-ai-approval-time-row .settings-field { margin: 0; min-width: 0; }
.workflow-ai-approval-retry { padding: 14px; border: 1px solid #e5edf7; border-radius: 8px; background: #fafcff; }
.workflow-ai-approval-fixed-rule { padding: 13px 14px; border: 1px solid #f5dfad; border-radius: 8px; background: #fffaf0; }
.workflow-ai-approval-fixed-rule strong { color: #a35b12; font-size: 14px; font-weight: 500; }
.workflow-ai-approval-fixed-rule p { margin: 7px 0 0; color: #8b6a3e; font-size: 12px; line-height: 1.6; }
.workflow-ai-approval-extra-rules { margin: 0; }
.workflow-ai-approval-extra-rules small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.workflow-ai-approval-dialog > footer { display: flex; justify-content: flex-end; padding: 13px 24px 18px; border-top: 1px solid var(--line); }
.workflow-ai-approval-dialog > footer .primary-button { min-width: 112px; }
.target-dialog.faq-question-dialog { width: min(900px, 100%); grid-template-rows: auto minmax(0, 1fr) auto; }
.target-dialog.test-session-clear-dialog { width: min(500px, 100%); grid-template-rows: auto auto auto; }
.test-session-clear-body { display: grid; gap: 8px; padding: 18px 22px; border-block: 1px solid var(--line); }
.test-session-clear-body strong { color: var(--text); font-size: 15px; font-weight: 500; }
.test-session-clear-body p { margin: 0; color: var(--muted); line-height: 1.6; }
.faq-question-dialog > header { border-bottom: 1px solid var(--line); }
.faq-question-dialog-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px; overflow-y: auto; padding: 18px 22px; }
.faq-question-dialog-body .settings-field textarea { height: 220px; min-height: 220px; max-height: 420px; overflow-y: auto; }
.faq-question-dialog-body .faq-question-variant-hint { grid-column: 1 / -1; margin-right: 0; }
.history-dialog { width: min(920px, 100%); height: min(800px, calc(100dvh - 40px)); display: grid; grid-template-rows: auto auto minmax(180px, 1fr) auto; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(20, 33, 48, 0.23); }
.history-dialog > header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.history-dialog h2 { margin: 0; font-size: 19px; font-weight: 500; }
.history-dialog header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.history-filters { display: grid; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.history-categories { display: flex; align-items: center; gap: 22px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.history-categories::-webkit-scrollbar { display: none; }
.history-categories button { flex: 0 0 auto; min-height: 34px; border: 0; border-bottom: 2px solid transparent; padding: 4px 0; background: transparent; color: #425166; cursor: pointer; }
.history-categories button:hover, .history-categories button.active { color: var(--blue); }
.history-categories button.active { border-bottom-color: var(--blue); }
.history-search-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto auto; align-items: end; gap: 10px; }
.history-search-row > input, .history-search-row label input { min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); padding: 9px 12px; color: var(--text); background: #fff; }
.history-search-row > input { min-width: 0; }
.history-search-row label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.history-date-separator { align-self: end; padding-bottom: 12px; color: var(--muted); font-size: 12px; }
.history-search-row .secondary-button { min-height: 42px; }
.history-results { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 22px; }
.history-empty { min-height: 220px; display: grid; place-items: center; color: var(--muted); }
.history-item { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; padding: 18px 0; border-bottom: 1px solid #edf0f3; }
.history-avatar { width: 42px; height: 42px; border-radius: 5px; font-size: 14px; }
.history-item-copy { min-width: 0; display: grid; gap: 9px; }
.history-item-copy > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.history-item-copy > header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.history-item-copy > header time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.history-item-content { min-width: 0; color: #344258; overflow-wrap: anywhere; }
.history-item-content p { margin: 0; white-space: pre-wrap; line-height: 1.6; }
.history-image-button { display: block; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.history-image-button img, .history-video { display: block; width: auto; max-width: min(260px, 55vw); max-height: 280px; border-radius: 4px; object-fit: contain; }
.history-emoji { display: block; width: auto; max-width: 110px; max-height: 110px; object-fit: contain; }
.history-audio { width: min(360px, 100%); height: 34px; }
.history-voice { display: grid; gap: 8px; }
.history-transcript { padding: 8px 10px; border-left: 2px solid #c7d2df; background: #f7f9fb; color: #607086; }
.history-file, .history-link { color: var(--blue); text-decoration: none; }
.history-file:hover, .history-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.history-link, .history-app-card { display: grid; gap: 4px; max-width: 520px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafc; color: #344258; }
.history-link strong, .history-app-card strong { font-weight: 500; }
.history-link span, .history-app-card span { color: var(--muted); font-size: 12px; }
.history-dialog > footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 22px; border-top: 1px solid var(--line); }
.history-dialog > footer span { color: var(--muted); font-size: 12px; }
.media-preview-dialog { width: min(960px, 100%); max-height: calc(100dvh - 40px); display: grid; grid-template-rows: 52px minmax(0, 1fr); overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(20, 33, 48, 0.23); }
.media-preview-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 20px; border-bottom: 1px solid var(--line); }
.media-preview-dialog > header strong { font-weight: 500; }
.media-preview-canvas { min-height: 240px; display: grid; place-items: center; overflow: auto; padding: 18px; background: #f4f6f8; }
.media-preview-canvas img { display: block; max-width: 100%; max-height: calc(100dvh - 128px); object-fit: contain; }
.modal-open { overflow: hidden; }
.auto-tag-ai-dialog { width: min(440px, 100%); display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 16px; padding: 24px; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(20, 33, 48, 0.23); }
.auto-tag-ai-dialog:focus { outline: none; }
.auto-tag-ai-indicator { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #eef5ff; }
.auto-tag-ai-indicator::before { content: ""; width: 20px; height: 20px; border: 2px solid #b8c8dc; border-top-color: var(--blue); border-radius: 50%; animation: auto-tag-ai-spin 0.8s linear infinite; }
.auto-tag-ai-indicator.success { background: #e9f8f0; }
.auto-tag-ai-indicator.success::before { content: "✓"; width: auto; height: auto; border: 0; color: var(--green); font-size: 24px; line-height: 1; animation: none; }
.auto-tag-ai-indicator.error { background: #fff0ef; }
.auto-tag-ai-indicator.error::before { content: "!"; width: auto; height: auto; border: 0; color: var(--danger); font-size: 24px; font-weight: 600; line-height: 1; animation: none; }
.auto-tag-ai-copy { min-width: 0; display: grid; gap: 8px; }
.auto-tag-ai-copy h2 { margin: 0; font-size: 18px; font-weight: 500; }
.auto-tag-ai-copy p { margin: 0; color: #344258; line-height: 1.6; overflow-wrap: anywhere; }
.auto-tag-ai-copy small { color: var(--muted); line-height: 1.5; }
.auto-tag-ai-dialog > .primary-button { grid-column: 2; justify-self: end; min-width: 96px; }
@keyframes auto-tag-ai-spin { to { transform: rotate(360deg); } }

.customer-detail-modal { position: fixed; z-index: 125; inset: 0; display: flex; justify-content: flex-end; background: rgba(31, 43, 58, 0.32); }
.customer-detail-drawer { width: min(560px, calc(100vw - 28px)); height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border-left: 1px solid var(--line); background: #fff; box-shadow: -18px 0 54px rgba(20, 33, 48, 0.16); }
.customer-detail-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px 14px 22px; border-bottom: 1px solid var(--line); }
.customer-detail-header > div { min-width: 0; }
.customer-detail-header h2 { margin: 0; overflow: hidden; color: var(--text); font-size: 19px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.customer-detail-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.customer-detail-body { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.customer-detail-loading, .customer-detail-empty { min-height: 260px; display: grid; align-content: center; justify-items: center; gap: 9px; padding: 32px; color: var(--muted); text-align: center; }
.customer-detail-loading.error { color: var(--danger); }
.customer-detail-empty strong { color: var(--text); font-size: 16px; font-weight: 500; }
.customer-detail-empty p { max-width: 360px; margin: 0; line-height: 1.65; }
.customer-detail-footer { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 20px; border-top: 1px solid var(--line); background: #fff; }
.customer-detail-footer > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.customer-detail-footer .primary-button { flex: 0 0 auto; min-width: 96px; }
.customer-detail-overview { display: grid; grid-template-columns: 82px repeat(3, minmax(0, 1fr)); align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.customer-detail-overview > div:not(.customer-tier) { min-width: 0; display: grid; gap: 5px; }
.customer-detail-overview .customer-time-stat { grid-column: span 2; }
.customer-detail-overview .customer-time-stat strong { white-space: nowrap; }
.customer-detail-overview span { color: var(--muted); font-size: 11px; }
.customer-detail-overview strong { color: #243348; font-size: 21px; font-weight: 600; }
.customer-detail-overview small { margin-left: 2px; color: var(--muted); font-size: 10px; font-weight: 400; }
.customer-tier { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 8px; background: #eef3f8; color: #53657a; font-size: 16px; font-weight: 600; text-align: center; }
.customer-tier-s { background: #e8f7ef; color: #14845b; }
.customer-tier-a { background: #edf5ff; color: #2276ca; }
.customer-tier-b { background: #fff7e7; color: #a76a00; }
.customer-tier-c, .customer-tier-d { background: #f1f3f5; color: #667487; }
.customer-detail-section { min-width: 0; display: grid; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.customer-detail-collapsible { display: block; padding: 0; }
.customer-detail-collapsible > summary { list-style: none; cursor: pointer; padding: 20px 22px; }
.customer-detail-collapsible > summary::-webkit-details-marker { display: none; }
.customer-detail-collapsible-summary { align-items: center; }
.customer-detail-collapsible-summary h3 { font-weight: 700; }
.customer-detail-collapsible-summary::after { width: 8px; height: 8px; flex: 0 0 auto; margin: 0 3px 4px 0; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); content: ""; transform: rotate(45deg); transition: transform 140ms ease; }
.customer-detail-collapsible:not([open]) > .customer-detail-collapsible-summary::after { margin-bottom: 0; transform: rotate(-45deg); }
.customer-detail-collapsible:not([open]) > .customer-detail-collapsible-summary { border-bottom: 0; }
.customer-detail-collapsible-content { display: grid; gap: 14px; padding: 0 22px 20px; }
.customer-detail-section-heading { min-width: 0; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.customer-detail-section-heading h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 500; }
.customer-detail-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.customer-detail-tags { min-width: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.customer-detail-tags span, .customer-risk-tags span { max-width: 100%; min-height: 26px; display: inline-flex; align-items: center; border-radius: 4px; padding: 3px 8px; background: #edf5ff; color: #2a71ba; font-size: 12px; overflow-wrap: anywhere; word-break: break-word; }
.customer-detail-tags em { color: var(--muted); font-size: 12px; font-style: normal; }
.customer-portrait-tags span { background: #eef7f2; color: #28765a; }
.customer-risk-tags { min-width: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.customer-risk-tags span { background: #fff0ef; color: #b0423d; }
.customer-risk-tags em { color: var(--muted); font-size: 12px; font-style: normal; }
.customer-summary { margin: 0; color: #405067; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-summary-l2 { color: #31445b; }
.customer-detail-layer { background: #fff; }
.customer-detail-subsection { min-width: 0; display: grid; gap: 10px; }
.customer-detail-subsection + .customer-detail-subsection { padding-top: 4px; }
.customer-detail-subsection h4 { margin: 0; color: #25364b; font-size: 13px; font-weight: 500; }
.customer-detail-tag-group { min-width: 0; display: grid; gap: 7px; padding: 8px 0; border-bottom: 1px solid #edf0f3; }
.customer-detail-tag-group > span { color: var(--muted); font-size: 11px; }
.customer-detail-events { min-width: 0; display: grid; gap: 8px; padding-top: 4px; }
.customer-event-row { min-width: 0; display: grid; gap: 4px; padding: 9px 0; border-bottom: 1px solid #edf0f3; }
.customer-event-row strong { color: #344258; font-size: 13px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.customer-event-row span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.customer-detail-facts { display: grid; grid-template-columns: minmax(0, 1fr); }
.customer-detail-fact { min-width: 0; display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.customer-detail-fact span { color: var(--muted); font-size: 11px; }
.customer-detail-fact strong { color: #344258; font-size: 13px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.customer-detail-muted { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.customer-intent-title { min-width: 0; color: #344258; font-size: 14px; font-weight: 500; line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; }
.customer-score-list { display: grid; gap: 15px; }
.customer-score-row { display: grid; gap: 6px; }
.customer-score-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-score-row strong { color: #3a495e; font-size: 12px; font-weight: 500; }
.customer-score-row span { color: #627287; font-size: 12px; }
.customer-score-track { height: 7px; overflow: hidden; border-radius: 4px; background: #e9edf2; }
.customer-score-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.customer-score-row p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.customer-action-section > strong { min-width: 0; color: #2f3e52; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; word-break: break-word; }
.customer-action-section > p { min-width: 0; margin: 0; color: #607086; line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; }
.customer-human-action { width: max-content; min-height: 24px; display: inline-flex; align-items: center; border-radius: 4px; padding: 2px 8px; background: #fff4df; color: #9a6404; font-size: 11px; }
.customer-evidence-list, .customer-history-list { display: grid; }
.customer-evidence-item { margin: 0; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.customer-evidence-item:last-child, .customer-history-row:last-child { border-bottom: 0; }
.customer-evidence-item p { margin: 0; color: #3d4d62; line-height: 1.65; overflow-wrap: anywhere; }
.customer-evidence-item footer { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.customer-evidence-item footer time { flex: 0 0 auto; }
.customer-evidence-item footer span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; text-align: right; white-space: normal; word-break: break-word; }
.customer-history-row { display: grid; grid-template-columns: 128px 58px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 42px; border-bottom: 1px solid #edf0f3; }
.customer-history-row time, .customer-history-row span { color: var(--muted); font-size: 11px; }
.customer-history-row strong { color: #3c4c60; font-size: 12px; font-weight: 500; }
.customer-history-row small { grid-column: 3; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.customer-evidence-more, .customer-history-more { margin-top: 8px; border-top: 1px solid #edf0f3; }
.customer-evidence-more summary, .customer-history-more summary { padding: 10px 0; color: var(--accent); cursor: pointer; font-size: 11px; }

.toast-region {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  pointer-events: none;
}
.toast {
  min-width: 280px;
  max-width: min(520px, calc(100vw - 48px));
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: center;
  box-shadow: 0 18px 48px rgba(35, 55, 80, 0.28);
}
.toast.error { border-color: #ffc7c4; color: #a1322d; }

@media (max-width: 1400px) {
  .ai-provider-primary-fields { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .ai-provider-primary-fields > :last-child { grid-column: 1 / -1; }
  .ai-provider-access-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-provider-access-fields > :first-child { grid-column: 1 / -1; }
  .model-name-row { grid-template-columns: 1fr; }
  .model-name-actions { justify-content: flex-start; }
}

@media (max-width: 1100px) {
  .settings-resource-layout { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr); gap: 12px; }
  .auto-tag-layout { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .workspace { grid-template-columns: 320px minmax(0, 1fr); }
  .workspace.aggregate-mode { grid-template-columns: calc(320px + var(--wechat-rail-width)) minmax(0, 1fr); }
  .workspace.settings-mode.aggregate-mode { grid-template-columns: calc(320px + var(--wechat-rail-width)) minmax(0, 1fr); }
  .message-item { width: min(82%, 720px); }
  .three-columns { grid-template-columns: 1fr; }
  .model-name-row { grid-template-columns: 1fr; }
  .model-name-actions { justify-content: flex-start; }
  .material-item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .material-item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-body { background: #fff; }
  .workspace { display: block; position: relative; overflow: hidden; padding: 0; background: #fff; }
  .conversation-pane,
  .chat-pane,
  .settings-view {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transition: none;
  }
  .conversation-pane { grid-template-rows: auto auto minmax(0, 1fr) 64px; z-index: 1; border-right: 0; }
  .chat-pane { z-index: 2; transform: translateX(100%); }
  .workspace.show-chat .chat-pane { transform: translateX(0); }
  .settings-view { z-index: 3; transform: translateX(100%); }
  .workspace.settings-mode.settings-module-open .settings-view { transform: translateX(0); }
  .workspace.settings-mode .settings-view { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .account-header, .chat-header { height: 78px; padding: 12px 16px; }
  .avatar { width: 50px; height: 50px; }
  .conversation-controls { padding: 12px 14px; }
  .workspace.aggregate-mode .conversation-browser { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .wechat-account-rail {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 68px;
    min-height: 68px;
    max-height: 68px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .wechat-rail-item {
    flex: 0 0 52px;
    width: 52px;
    min-height: 59px;
    height: 59px;
    gap: 0;
    border-left: 0;
    padding: 3px 2px;
  }
  .wechat-rail-avatar-wrap { width: 52px; height: 52px; }
  .wechat-rail-avatar { width: 48px; height: 48px; }
  .wechat-rail-name { display: none; }
  .wechat-rail-item.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 48px;
    height: 2px;
    border-radius: 2px;
    background: var(--blue);
    transform: translateX(-50%);
  }
  .conversation-list { padding: 4px 0; }
  .conversation-item { min-height: 78px; }
  .conversation-item.has-conversation-meta { min-height: 78px; }
  .conversation-item.has-conversation-tags { min-height: 94px; }
  .conversation-contact-tag { max-width: 92px; }
  .conversation-insight { max-width: 92px; }
  .mobile-nav { padding-bottom: env(safe-area-inset-bottom); }
  .mobile-back { display: inline-grid; margin-left: -8px; }
  .mobile-settings-back { display: inline-grid; margin-left: -8px; }
  .chat-header { gap: 2px; }
  .chat-title { flex: 1 1 auto; }
  .customer-detail-button { height: 28px; padding-inline: 5px; }
  .customer-detail-drawer { width: 100%; }
  .customer-detail-overview { grid-template-columns: 70px repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px; }
  .customer-tier { width: 60px; height: 60px; font-size: 14px; }
  .customer-detail-overview strong { font-size: 18px; }
  .customer-detail-section { padding: 18px 16px; }
  .customer-detail-collapsible { padding: 0; }
  .customer-detail-collapsible > summary { padding: 18px 16px; }
  .customer-detail-collapsible-content { padding: 0 16px 18px; }
  .customer-detail-facts { grid-template-columns: 1fr; }
  .customer-detail-header, .customer-detail-footer { padding-left: 16px; padding-right: 16px; }
  .customer-history-row { grid-template-columns: 112px 54px minmax(0, 1fr); }
  .chat-title .avatar { width: 46px; height: 46px; }
  .message-list { padding: 22px 16px; }
  .message-item { width: min(86%, 620px); margin-bottom: 16px; }
  .message-sender-avatar { width: 14px; height: 14px; border-radius: 3px; font-size: 7px; }
  .message-bubble { padding: 10px 12px; }
  .message-image { max-width: min(260px, 70vw); max-height: 320px; }
  .message-video { max-width: min(280px, 74vw); max-height: 360px; }
  .voice-message { min-width: min(330px, 76vw); }
  .voice-player { grid-template-columns: 28px auto minmax(48px, 1fr) auto; gap: 6px; }
  .voice-time { font-size: 12px; }
  .composer-tools { height: 50px; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 0 12px; scrollbar-width: none; }
  .composer-tools::-webkit-scrollbar { display: none; }
  .emoji-picker { left: 12px; right: 12px; width: auto; grid-template-columns: repeat(6, minmax(38px, 1fr)); }
  .composer-row,
  .test-session-composer { gap: 9px; padding: 10px 12px; }
  .composer textarea,
  .test-session-composer textarea { min-width: 0; font-size: 16px; }
  .send-button,
  .test-session-composer button { min-width: 74px; padding: 0 14px; }
  .settings-header { min-height: 52px; display: flex; align-items: center; padding: 4px 8px; border: 0; }
  .settings-header > div, .settings-header .settings-add-button { display: none; }
  .settings-content { padding: 0; background: #fff; }
  .settings-resource-layout { min-height: 100%; grid-template-columns: 1fr; gap: 0; overflow-y: auto; }
  .auto-tag-layout { grid-template-columns: 1fr; }
  .settings-resource-list { border: 0; border-radius: 0; }
  .settings-editor,
  .settings-detail-card { border: 0; border-radius: 0; padding: 18px 16px 26px; }
  .settings-detail-stack { border: 0; border-radius: 0; padding: 18px 16px 26px; scrollbar-gutter: auto; }
  .settings-special-layout .settings-resource-list { display: none; }
  .knowledge-document-card { grid-template-columns: 48px minmax(0, 1fr); }
  .knowledge-document-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .agent-section-picker { display: grid; }
  .settings-mobile-action { display: inline-flex; }
  .settings-form-row { grid-template-columns: 1fr; }
  .token-billing-record-controls { width: 100%; justify-content: flex-start; }
  .token-billing-pagination { flex-wrap: wrap; }
  .token-billing-date { width: 100%; min-width: 0; }
  .agent-reply-control-grid { grid-template-columns: 1fr; }
  .auto-tag-editor-header { align-items: flex-start; flex-direction: column; }
  .auto-tag-editor-actions { width: 100%; }
  .auto-tag-editor-actions button { flex: 1 1 0; min-width: 0; }
  .auto-tag-toggle-grid,
  .auto-tag-condition-grid { grid-template-columns: 1fr; }
  .auto-tag-condition-grid textarea { min-height: 180px; }
  .settings-form-row-import-actions { grid-template-columns: 1fr; }
  .settings-inline-import-actions { width: 100%; justify-content: flex-end; }
  .subaccount-wechat-grid { grid-template-columns: 1fr; }
  .faq-question-compose { grid-template-columns: 1fr; }
  .semantic-sample-compose { grid-template-columns: 1fr; }
  .semantic-sample-compose .semantic-expression-field { grid-column: auto; }
  .faq-question-card { grid-template-columns: 1fr; }
  .faq-question-actions { flex-wrap: wrap; justify-content: flex-end; }
  .faq-question-section > header,
  .knowledge-library-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .faq-question-header-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .faq-question-section > header .faq-question-header-hint { max-width: none; flex: 1 1 260px; }
  .faq-question-header-actions #faq-import-status { max-width: 100% !important; }
  .faq-question-dialog-body { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .faq-question-dialog-body .faq-question-variant-hint { grid-column: auto; }
  .faq-import-actions,
  .knowledge-import-tools { margin-left: auto; }
  .faq-import-dialog { width: calc(100vw - 20px); }
  .faq-import-item { grid-template-columns: 1fr; }
  .faq-import-select { min-height: auto; }
  .material-library-toolbar { align-items: flex-start; flex-direction: column; }
  .material-upload-tools { width: 100%; }
  .material-upload-tools select { flex: 1; min-width: 0; }
  .material-kind-tabs { grid-template-columns: repeat(5, minmax(76px, 1fr)); }
  .material-item-list { grid-template-columns: 1fr; }
  .material-add-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .material-add-body { padding-left: 16px; padding-right: 16px; }
  .settings-view.editing .settings-resource-list { display: none; }
  .settings-view:not(.editing) .settings-editor { display: none; }
  .settings-view.editing .settings-add-button { display: none; }
  .target-dialog { max-height: calc(100dvh - 20px); }
  .history-dialog { height: calc(100dvh - 40px); }
  .media-preview-dialog { max-height: calc(100dvh - 20px); }
  .target-dialog > header, .target-dialog > footer { padding-left: 16px; padding-right: 16px; }
  .target-search { margin-left: 16px; margin-right: 16px; }
  .target-option { padding-left: 16px; padding-right: 16px; }
  .history-dialog > header, .history-filters, .history-results, .history-dialog > footer { padding-left: 14px; padding-right: 14px; }
  .history-search-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 8px; }
  .history-search-row > input { grid-column: 1 / -1; }
  .history-search-row label { min-width: 0; }
  .history-search-row label input { width: 100%; min-width: 0; }
  .history-date-separator { display: none; }
  .history-search-row .secondary-button { grid-column: auto; min-width: 66px; padding-inline: 12px; }
  .history-item { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 15px 0; }
  .history-avatar { width: 36px; height: 36px; }
  .history-item-copy > header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .history-image-button img, .history-video { max-width: min(240px, 68vw); max-height: 260px; }
  .toast-region { inset: 0; padding: 18px; }
}

@media (max-width: 640px) {
  .workflow-message-schedule-row { grid-template-columns: 1fr; }
  .auto-tag-ai-dialog { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 20px; }
  .auto-tag-ai-indicator { width: 38px; height: 38px; }
  .auto-tag-ai-dialog > .primary-button { grid-column: 1 / -1; justify-self: stretch; width: 100%; }
  .login-body { padding: 0; background: #fff; }
  .login-layout { min-height: 100dvh; display: block; border: 0; border-top-left-radius: 0; border-top-right-radius: 0; box-shadow: none; }
  .login-brand { justify-content: flex-start; min-height: 190px; padding: 34px 28px; }
  .brand-mark { width: 58px; height: 58px; font-size: 29px; }
  .login-brand h1 { font-size: 26px; }
  .login-panel { padding: 38px 28px; }
  .login-panel h2 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* WC_BUSINESS_FONT_SCALE_20260715 */
body,
button,
input,
textarea,
select,
.login-brand h1,
.login-panel h2,
.identity-copy strong,
.conversation-row strong,
.chat-title h1,
.message-bubble,
.message-bubble p,
.voice-transcript,
.settings-header h1,
.settings-resource-item strong,
.settings-field input,
.settings-field textarea,
.settings-field select,
.settings-segmented span,
.faq-question-section > header strong,
.faq-question-copy strong,
.faq-question-copy p,
.special-settings-toolbar h2,
.settings-section h2,
.setting-toggle-row strong,
.provider-select,
.danger-link,
.model-name-header strong,
.model-name-row > input,
.target-dialog h2,
.target-option-copy strong,
.toast {
  font-size: 14px;
}

small,
.login-brand p,
.login-panel header p,
.login-panel label,
.form-error,
.connection-status,
.settings-menu-button small,
.conversation-row time,
.conversation-row b,
.conversation-row em,
.mobile-nav-item em,
.chat-title span,
.message-sender,
.message-meta,
.upload-status,
.settings-header p,
.settings-resource-list-header span,
.settings-resource-item span,
.settings-scope-badge,
.settings-default-notice,
.settings-field,
.target-chip,
.faq-question-section > header span,
.faq-question-actions .secondary-button,
.faq-question-actions .danger-button,
.special-settings-toolbar p,
.settings-section header p,
.settings-layer-notice,
.setting-toggle-row small,
.mini-switch,
.model-test-status,
.target-dialog header p,
.target-option-copy span,
.target-dialog > footer > span,
.emoji-option small,
.message-sender-avatar {
  font-size: 12px;
}

.test-session-layout { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); }
.test-session-list-actions {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
}
.test-session-list-actions button { min-width: 0; min-height: 40px; padding-inline: 10px; }
.test-session-list-actions .danger { color: var(--danger); border-color: rgba(217, 75, 69, .24); }
.test-session-items { padding: 6px 0; }
.test-session-item {
  min-height: 68px;
  display: grid;
  gap: 5px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 12px 15px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.test-session-item:hover { background: #f4f7fa; }
.test-session-item.active { border-left-color: var(--blue); background: var(--surface-selected); }
.test-session-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.test-session-item span { color: var(--muted); font-size: 12px; }
.test-session-chat-panel {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
}
.test-session-chat-header {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.test-session-chat-header div { min-width: 0; display: grid; gap: 3px; }
.test-session-chat-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.test-session-chat-header span { color: var(--muted); font-size: 12px; }
.test-session-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px clamp(16px, 3vw, 34px);
  background: #f8fafc;
}
.test-session-empty { height: 100%; min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.test-message-row { width: min(76%, 760px); display: grid; gap: 5px; margin: 0 0 18px; }
.test-message-row.incoming { justify-items: start; }
.test-message-row.outgoing { margin-left: auto; justify-items: end; }
.test-message-row time { color: var(--muted); font-size: 11px; }
.test-message-bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 13px;
  background: #fff;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.test-message-row.outgoing .test-message-bubble:not(.material) { border-color: #cce3fa; background: #eaf4ff; }
.test-message-bubble small {
  display: inline-block;
  margin-right: 7px;
  color: var(--blue-dark);
  font-size: 11px;
}
.test-message-bubble.material { width: min(560px, 100%); display: grid; gap: 10px; padding: 10px; }
.test-material-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.test-material-card:last-of-type { border-bottom: 0; }
.test-material-preview {
  width: 104px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f6;
}
.test-material-preview img, .test-material-preview video { width: 100%; height: 100%; object-fit: contain; }
.test-material-file-mark { color: #56657b; font-size: 13px; }
.test-material-meta { min-width: 0; display: grid; gap: 5px; }
.test-material-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-material-meta span { color: var(--muted); font-size: 12px; }
.test-material-meta a { width: fit-content; color: var(--blue-dark); font-size: 12px; text-decoration: none; }
.test-message-caption { margin: 0; line-height: 1.55; }
.test-agent-trace {
  width: 100%;
  margin-top: 10px;
  border-top: 1px solid rgba(96, 112, 132, .18);
  padding-top: 8px;
  color: #536174;
  font-size: 12px;
}
.test-agent-trace summary {
  width: fit-content;
  cursor: pointer;
  color: #315f86;
  font-weight: 500;
}
.test-agent-trace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 9px 0 0;
}
.test-agent-trace-grid div { min-width: 0; display: grid; gap: 2px; }
.test-agent-trace-grid dt { color: #748196; font-size: 11px; }
.test-agent-trace-grid dd { margin: 0; overflow-wrap: anywhere; }
.test-agent-tools { display: grid; gap: 5px; margin-top: 9px; }
.test-agent-tools div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) repeat(3, auto);
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .68);
}
.test-agent-tools strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.test-agent-tools span { color: #66758a; white-space: nowrap; }
.test-reason-card {
  width: min(620px, 88%);
  margin: 4px auto 18px;
  border: 1px solid #f1d4b2;
  border-radius: 7px;
  padding: 13px 15px;
  background: #fff9f0;
}
.test-reason-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-reason-card header span { color: #a06427; font-size: 11px; }
.test-reason-card p { margin: 8px 0; color: #5f4a35; line-height: 1.55; }
.test-reason-details {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .62);
}
.test-reason-details div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.test-reason-details dt { color: #9a6a35; font-size: 12px; }
.test-reason-details dd { margin: 0; color: #4b5563; font-size: 12px; overflow-wrap: anywhere; }
.test-reason-card footer { color: var(--muted); font-size: 11px; }
.test-system-message { display: grid; justify-items: center; gap: 4px; margin: 8px auto 18px; color: #6e7c8d; font-size: 12px; }
.test-session-composer {
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 1400px) {
  .workflow-shell { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); }
  .workflow-main-header { padding-inline: 16px; }
  .workflow-task-area { padding-inline: 16px; }
}

@media (max-width: 1000px) {
  .workflow-shell { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr); }
  .workflow-sidebar-header,
  .workflow-scope-select,
  .workflow-setting-block,
  .workflow-filter-section { padding-left: 15px; padding-right: 15px; }
  .workflow-status-list { margin-inline: -15px; }
  .workflow-status-list button { padding-left: 12px; padding-right: 15px; }
  .workflow-type-panel header,
  .workflow-type-panel section h2,
  .workflow-type-list button { padding-left: 15px; padding-right: 15px; }
  .workflow-task-card { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; padding-inline: 11px; }
}

@media (max-width: 760px) {
  .workspace.workflow-mode {
    height: 100dvh;
    padding: 0;
    background: #fff;
  }
  .workspace.workflow-mode .workflow-view {
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .workflow-shell {
    height: auto;
    min-height: 100%;
    display: block;
    overflow-y: auto;
  }
  .workflow-sidebar,
  .workflow-type-panel,
  .workflow-main { border-right: 0; }
  .workflow-sidebar { display: block; }
  .workflow-sidebar-scroll { max-height: none; overflow: visible; }
  .workflow-sidebar-nav { min-height: 60px; }
  .workflow-type-panel {
    max-height: 300px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .workflow-type-panel header { padding-top: 16px; padding-bottom: 13px; }
  .workflow-type-panel section { padding-top: 13px; padding-bottom: 13px; }
  .workflow-type-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 8px 8px;
  }
  .workflow-type-list button { padding: 9px 10px; }
  .workflow-main {
    min-height: 620px;
    display: grid;
  }
  .workflow-main-header {
    display: block;
    padding: 10px 12px 8px;
  }
  .workflow-calendar-toolbar { justify-content: space-between; margin-bottom: 8px; }
  .workflow-calendar-strip { grid-auto-columns: 58px; }
  .workflow-task-area { padding: 15px 12px 28px; }
  .workflow-task-toolbar h2 { font-size: 18px; }
  .workflow-detail-backdrop { padding: 10px; }
  .workflow-detail-dialog { max-height: calc(100vh - 20px); }
  .workflow-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-recipient-row { grid-template-columns: 32px minmax(0, 1fr); }
  .workflow-recipient-row p { grid-column: 2; }
}

@media (max-width: 760px) {
  .workspace.workflow-mode {
    display: block;
    height: 100dvh;
    padding: 0;
    background: #fff;
  }
  .workspace.workflow-mode .conversation-pane { display: grid; }
  .workspace.workflow-mode .workflow-view {
    position: absolute;
    inset: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 3;
    width: 100%;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .workflow-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
  }
  .workflow-type-panel,
  .workflow-main {
    border: 0;
    border-radius: 0;
  }
  .workflow-type-panel {
    max-height: 280px;
    border-bottom: 1px solid var(--line);
  }
  .workflow-type-panel header { padding-top: 16px; padding-bottom: 13px; }
  .workflow-type-panel section { padding-top: 13px; padding-bottom: 13px; }
  .workflow-type-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 8px 8px;
  }
  .workflow-type-list button { padding: 9px 10px; }
  .workflow-main {
    min-height: 0;
    display: grid;
  }
  .workflow-main-header {
    display: block;
    padding: 10px 12px 8px;
  }
  .workflow-calendar-toolbar { justify-content: space-between; margin-bottom: 8px; }
  .workflow-calendar-strip { grid-auto-columns: 58px; }
  .workflow-task-area { padding: 15px 12px 28px; }
}

@media (max-width: 760px) {
  .test-session-layout { height: auto; min-height: 100%; grid-template-rows: auto minmax(520px, 1fr); }
  .test-session-list-panel { max-height: 220px; border-bottom: 1px solid var(--line); }
  .test-session-chat-panel { min-height: 520px; padding: 0; }
  .test-session-messages { padding: 18px 12px; }
  .test-message-row { width: min(88%, 620px); }
  .test-reason-card { width: 94%; }
  .test-material-card { grid-template-columns: 78px minmax(0, 1fr); }
  .test-material-preview { width: 78px; height: 68px; }
  .test-session-clear-body { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 880px) {
.workflow-daily-report-dialog { width: min(780px, 100%); }
.workflow-daily-report-modal-body { padding-inline: 18px; }
.workflow-daily-report-rule-row { grid-template-columns: 1fr; }
.workflow-daily-report-password-row { grid-template-columns: 1fr; }
.workflow-daily-report-password-row button { justify-self: start; }
.workflow-ai-approval-dialog { width: min(680px, 100%); }
.workflow-ai-approval-dialog > header { padding-inline: 18px; }
.workflow-ai-approval-modal-body { padding-inline: 18px; }
.workflow-ai-approval-time-row { grid-template-columns: 1fr; }
.workflow-ai-approval-dialog > footer { padding-inline: 18px; }
}
