:root {
  --bg: linear-gradient(180deg, #eef2f7 0%, #f6f7f8 38%, #eef2ef 100%);
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: rgba(39, 56, 48, 0.1);
  --text: #1b241f;
  --muted: #647069;
  --accent: #1aad19;
  --accent-strong: #138813;
  --soft: #edf7ee;
  --warning: #8a5a10;
  --warning-bg: #fff4dc;
  --shadow-soft: 0 10px 30px rgba(18, 33, 27, 0.06);
  --shadow-card: 0 6px 18px rgba(18, 33, 27, 0.05);
  --sidebar-width: 300px;
  --conversation-width: 360px;
  --inspector-width: 360px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  border-color: #b9c3bb;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 111, 99, 0.12);
}

textarea {
  min-height: 78px;
  padding: 9px;
  resize: vertical;
  line-height: 1.6;
}

.app-shell {
  display: grid;
  grid-template-columns:
    var(--sidebar-width) 6px
    var(--conversation-width) 6px
    minmax(380px, 1fr) 6px
    var(--inspector-width);
  height: 100vh;
  overflow: hidden;
}

body.conversation-collapsed .app-shell {
  grid-template-columns:
    var(--sidebar-width) 6px
    minmax(420px, 1fr) 6px
    var(--inspector-width);
}

body.conversation-collapsed .contact-panel,
body.conversation-collapsed #middleResize {
  display: none;
}

.sidebar,
.contact-panel,
.workbench,
.inspector {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: auto;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.sidebar {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  background: #e8e8ea;
}

.wechat-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 14px 8px;
  background: #dedfe4;
  border-right: 1px solid #d6d7db;
}

.rail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: #2f7d58;
  color: #fff;
  font-weight: 700;
}

.rail-icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #62656b;
  font-size: 17px;
}

.rail-icon.active,
.rail-icon:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.55);
}

.rail-spacer {
  flex: 1;
}

.wechat-list-pane {
  min-width: 0;
  overflow: auto;
}

.contact-panel,
.workbench {
  display: flex;
  flex-direction: column;
}

.workbench {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: auto;
  background: transparent;
}

.workbench > section {
  flex: 0 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inspector {
  border-left: 1px solid var(--line);
  padding: 14px;
}

.col-resize-handle {
  cursor: col-resize;
  background: var(--bg);
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  transition: background 0.12s ease;
}

.col-resize-handle:hover,
body.is-resizing .col-resize-handle:hover {
  background: #cfd8d2;
}

body.is-resizing {
  user-select: none;
}

.brand {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.brand-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.brand span,
.topbar p,
.draft-head p,
.rule-card small {
  color: var(--muted);
  margin: 0;
}

.runtime-status {
  margin-top: 6px;
  font-size: 13px;
}

.brand-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #4f5f56;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
}

.brand-mini-btn:hover {
  border-color: #b9c3bb;
}

.runtime-status.fallback {
  color: #9a5b00;
}

.runtime-status.model {
  color: var(--accent-strong);
}

.new-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.new-contact input {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: #f8f8f8;
}

.new-contact button {
  width: 42px;
  height: 34px;
  min-width: 42px;
  min-height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  padding-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  flex: 0 0 42px;
}

.export-row {
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  display: block;
}

.export-entry-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #d7e2d9;
  border-radius: 10px;
  color: #2d5f45;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,250,248,0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 12px rgba(18,33,27,0.04);
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
}

.export-entry-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.customer-table-modal {
  position: absolute;
  inset: 20px 28px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: rgba(250, 252, 251, 0.97);
  box-shadow: 0 28px 80px rgba(17, 31, 28, 0.22);
  overflow: hidden;
}

.customer-table-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
}

.customer-table-filters,
.customer-table-main {
  min-width: 0;
  min-height: 0;
  padding: 18px 20px 22px;
}

.customer-table-filters {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 244, 0.92));
  overflow: auto;
}

.customer-table-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-filter-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.customer-filter-grid label,
.customer-field-picker {
  display: grid;
  gap: 6px;
}

.customer-filter-grid span,
.customer-field-picker-head strong {
  font-size: 12px;
  color: var(--muted);
}

.customer-table-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.customer-field-picker {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(28, 48, 39, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.customer-field-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.customer-field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 2px;
}

.customer-field-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  font-size: 13px;
  color: #33453d;
  padding: 8px 10px;
  border: 1px solid rgba(25, 58, 40, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.customer-field-item:hover {
  border-color: rgba(26, 173, 25, 0.22);
  background: #f7fcf7;
}

.customer-field-item input {
  margin: 2px 0 0;
}

.customer-field-item span {
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 1500px) {
  .customer-field-list {
    grid-template-columns: 1fr;
  }
}

.customer-table-shell {
  margin-top: 12px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(32, 51, 43, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  overflow: auto;
}

.customer-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.customer-table th,
.customer-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(31, 52, 42, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.55;
  color: #30423a;
  word-break: break-word;
}

.customer-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(244, 248, 246, 0.98);
  color: #486157;
  font-weight: 700;
  padding: 0;
}

.customer-table-th-inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px 10px 12px;
}

.customer-table-th-inner span {
  flex: 1;
}

.customer-col-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  min-height: 100%;
  min-width: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: col-resize;
}

.customer-col-resizer::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(72, 97, 87, 0.16);
  transition: background 0.15s ease;
}

.customer-col-resizer:hover::before,
.customer-col-resizer:focus-visible::before,
body.is-resizing-columns .customer-col-resizer::before {
  background: rgba(26, 173, 25, 0.55);
}

.customer-table th:first-child,
.customer-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 1px 0 0 rgba(31, 52, 42, 0.08);
}

.customer-table th:first-child {
  z-index: 4;
  background: rgba(244, 248, 246, 0.99);
}

.customer-table-empty {
  text-align: center !important;
  color: var(--muted) !important;
  padding: 26px 12px !important;
}

.sidebar-entry {
  padding: 10px 10px 8px;
}

.knowledge-entry-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border-color: rgba(26, 173, 25, 0.18);
  background: linear-gradient(180deg, rgba(26, 173, 25, 0.12), rgba(26, 173, 25, 0.04));
  color: #1a6d32;
  font-weight: 600;
}

.contact-list {
  padding: 0;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 30px;
  gap: 0;
  margin-bottom: 0;
}

.contact-row.active .contact-item {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.contact-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 8px 8px 8px 10px;
  text-align: left;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #dddddd;
  background: transparent;
}

.contact-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.contact-item span {
  min-width: 0;
}

.contact-row.active .contact-item span,
.contact-row.active .contact-item em,
.contact-row.active .contact-item i {
  color: rgba(255, 255, 255, 0.86);
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #d9eee0;
  color: #176f3a;
  font-weight: 700;
}

.contact-main {
  display: grid;
  gap: 3px;
}

.contact-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.contact-title-line em {
  flex: 0 0 auto;
  color: #969ba2;
  font-style: normal;
  font-size: 12px;
}

.contact-preview {
  display: block;
  color: #8b9098;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.contact-tags {
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.contact-tags i {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.04);
  color: #798077;
  font-style: normal;
  font-size: 11px;
}

.contact-tags i.hot {
  background: #fff1d6;
  color: #9a5b00;
}

.contact-delete {
  align-self: stretch;
  padding: 0;
  color: #9a3e2f;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #dddddd;
  border-radius: 0;
  font-size: 12px;
}

.topbar {
  padding: 13px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}

.topbar.compact .topbar-title p {
  display: none;
}

.topbar.compact .topbar-actions {
  margin-left: auto;
}

.topbar.compact #clearContactBtn,
.mini-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

.conversation-topbar {
  padding: 10px 14px;
}

.conversation-topbar .topbar-title h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.topbar h1 {
  margin: 0 0 5px;
  font-size: 17px;
  letter-spacing: 0;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 12px 20px;
  background: #f4f4f4;
}

.message {
  position: relative;
  max-width: 86%;
  width: fit-content;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.message.customer {
  margin-right: auto;
}

.message.human_final {
  margin-left: auto;
  color: #10210f;
  grid-template-columns: minmax(0, 1fr) 30px;
}

.message.human_final .message-avatar {
  order: 2;
  background: #4f9a57;
  color: #fff;
}

.message.human_final .message-bubble {
  order: 1;
  background: #95ec69;
  border-color: #7dd957;
}

.message.system_note {
  max-width: 88%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--muted);
  display: block;
}

.message.system_note .message-avatar {
  display: none;
}

.message.system_note .message-bubble {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.message.sending .message-bubble {
  outline: 1px dashed rgba(26, 173, 25, 0.4);
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: #e2e8de;
  color: #5c6b5e;
  font-size: 12px;
  font-weight: 700;
}

.message-bubble {
  padding: 7px 9px;
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  background: #ffffff;
  line-height: 1.55;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}

.message small {
  display: block;
  margin-bottom: 3px;
  color: rgba(0, 0, 0, 0.42);
  font-size: 11px;
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 12px;
  align-items: start;
}

.composer-grid.single {
  grid-template-columns: 1fr;
}

.composer-main,
.composer-side {
  min-width: 0;
}

.composer-side {
  display: grid;
  gap: 8px;
}

.section-head,
.mini-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2,
.mini-panel-head h3,
.inspector h2,
.draft-head h2 {
  display: block;
  margin: 0 0 7px;
  font-size: 14px;
  letter-spacing: 0;
}

.section-head h2,
.draft-head h2,
.inspector h2 {
  position: relative;
  padding-left: 14px;
}

.section-head h2::before,
.draft-head h2::before,
.inspector h2::before,
.mini-panel-head h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #39c64d 0%, #149214 100%);
}

.mini-panel-head h3 {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 13px;
}

.section-head p,
.mini-panel-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-head-inline p {
  line-height: 1.45;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 10px;
}

.composer-actions-main {
  flex-wrap: wrap;
}

.composer-actions-main button {
  flex: 0 1 auto;
}

.draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.draft-head > div:first-child {
  min-width: 0;
}

.composer,
.draft-panel,
.compare-panel,
.inspector section {
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
}

.composer,
.draft-panel,
.compare-panel {
  padding: 14px 16px;
}

.inspector section {
  padding: 12px 14px;
}

.compare-panel {
  min-height: 220px;
  overflow: hidden;
}

.turn-compare {
  overflow: auto;
  max-height: min(40vh, 360px);
  padding-right: 4px;
}

.draft-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.draft-panel textarea {
  min-height: 72px;
}

.legacy-draft {
  display: none;
}

.draft-messages {
  display: grid;
  gap: 8px;
}

.draft-message-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: stretch;
}

.draft-message-row textarea {
  min-height: 62px;
}

.delay-box {
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 10px;
  padding: 7px;
  background: linear-gradient(180deg, #fcfdfc 0%, #f7faf7 100%);
}

.delay-box label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 12px;
}

.delay-box input {
  height: 32px;
  padding: 0 8px;
}

.draft-delete {
  width: 100%;
  min-height: 28px;
  margin-top: 7px;
  padding: 0 6px;
  color: #9a3e2f;
  background: #fff8f6;
  font-size: 12px;
}

.auto-send-bar {
  display: grid;
  grid-template-columns: auto 58px auto auto;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 10px;
  background: linear-gradient(180deg, #fcfefc 0%, #f4faf4 100%);
}

.auto-send-bar span {
  color: var(--muted);
}

.auto-send-bar input {
  height: 28px;
  padding: 0 6px;
}

.auto-send-bar input:disabled {
  background: #f2f4f3;
  color: #a0a8a2;
  border-color: rgba(39, 56, 48, 0.06);
}

.mode-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(17, 31, 24, 0.06);
  gap: 4px;
}

.mode-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.mode-btn.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(18, 33, 27, 0.08);
}

.auto-send-bar strong {
  justify-self: start;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.auto-send-bar strong.running {
  color: var(--accent-strong);
}

.auto-send-bar strong.manual {
  color: #8a5a10;
}

.auto-send-bar strong.blocked {
  color: #b33d2e;
}

.turn-card {
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  box-shadow: 0 4px 14px rgba(18, 33, 27, 0.04);
}

.turn-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.turn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.turn-summary {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.turn-block {
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  white-space: pre-wrap;
  line-height: 1.5;
  min-height: 56px;
  max-height: 140px;
  overflow: auto;
  font-size: 11px;
}

.turn-block strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.diff-before {
  color: #9a5b00;
  font-weight: 600;
  background: #fff4dc;
  border-radius: 3px;
  padding: 1px 2px;
}

.diff-after {
  color: #138813;
  font-weight: 600;
  background: #e8f7ec;
  border-radius: 3px;
  padding: 1px 2px;
}

.turn-correction {
  margin: 8px 0 0;
  padding: 8px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #f7fbf7 0%, #f1f8f3 100%);
  color: #314039;
  line-height: 1.55;
  font-size: 12px;
}

.turn-rule-box {
  margin-top: 8px;
  padding: 8px 9px;
  border: 1px solid #d9e7d7;
  border-radius: 6px;
  background: #f6fbf5;
}

.turn-rule-box strong {
  display: block;
  margin-bottom: 4px;
}

.turn-rule-box p,
.turn-rule-box small {
  margin: 0 0 6px;
  line-height: 1.5;
  font-size: 12px;
}

.learning-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.checkline input {
  width: auto;
}

.empty-note {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fbfcfa;
}

.report-view {
  display: grid;
  gap: 10px;
}

.report-card {
  padding: 14px;
  border: 1px solid #e5dccb;
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(214, 184, 122, 0.16), transparent 34%),
    linear-gradient(180deg, #fffdf8 0%, #f8f3ea 100%);
  box-shadow: 0 8px 24px rgba(104, 86, 46, 0.08);
}

.report-card-title {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  color: #433723;
}

.report-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #85745c;
}

.report-summary {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #5a4d3b;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #80623a;
  color: #fffaf2;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.report-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.94);
  border: 1px solid #eadfcf;
  color: #6d5b42;
  font-size: 12px;
}

.turn-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.mini-json {
  max-height: 120px;
  font-size: 12px;
}

.inspector section {
  margin-bottom: 14px;
}

dl {
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.field-row:has(.value-list),
.field-row:has(.compact-tags) {
  grid-template-columns: 1fr;
  gap: 4px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  word-break: break-word;
}

.value-list {
  margin: 0;
  padding-left: 18px;
}

.value-list li {
  margin-bottom: 4px;
  line-height: 1.55;
}

.compact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-tag {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #d8e1d9;
  border-radius: 6px;
  background: #f4f8f5;
  color: #314039;
  font-size: 12px;
  line-height: 1.35;
}

pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  white-space: pre-wrap;
  line-height: 1.5;
}

.debug-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.debug-details summary {
  cursor: pointer;
  color: var(--muted);
}

.debug-details p {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.inspector-inline-head {
  align-items: flex-start;
}

.quote-meta {
  margin-top: 8px;
  line-height: 1.6;
}

.quote-table-shell {
  margin-top: 10px;
  border: 1px solid rgba(31, 52, 42, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  overflow: auto;
}

.quote-table-shell.hidden {
  display: none;
}

.quote-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.quote-table th,
.quote-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(31, 52, 42, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.45;
  color: #30423a;
  white-space: nowrap;
}

.quote-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(244, 248, 246, 0.98);
  color: #486157;
  font-weight: 700;
}

.quote-table td:nth-child(6) {
  max-width: 240px;
  white-space: normal;
}

.layout-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.floor-plan-stage {
  position: relative;
  margin-top: 10px;
  border: 1px solid rgba(31, 52, 42, 0.1);
  border-radius: 8px;
  background: #f8faf9;
  overflow: hidden;
}

.floor-plan-stage.hidden {
  display: none;
}

.floor-plan-image {
  display: block;
  width: 100%;
  height: auto;
}

.floor-plan-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floor-plan-marker {
  position: absolute;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: grid;
  gap: 3px;
  justify-items: center;
  color: #1b241f;
}

.floor-plan-marker span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--marker-color);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
  font-size: 10px;
  font-weight: 700;
}

.floor-plan-marker strong {
  display: none;
}

.floor-plan-legend {
  margin-top: 8px;
}

.floor-plan-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.floor-plan-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(31, 52, 42, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #35483f;
  font-size: 12px;
}

.floor-plan-legend-chip i {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--marker-color);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}

.floor-plan-marker-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  max-height: 210px;
  overflow: auto;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid rgba(31, 52, 42, 0.08);
  border-radius: 8px;
  background: #fbfcfa;
}

.floor-plan-marker-row {
  display: grid;
  grid-template-columns: 22px minmax(52px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #35483f;
  font-size: 12px;
  line-height: 1.35;
}

.floor-plan-marker-row i {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--marker-color);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}

.floor-plan-marker-row span,
.floor-plan-marker-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floor-plan-marker-row span {
  color: #65746c;
  font-weight: 500;
}

.floor-plan-marker-row strong {
  color: #22322b;
  font-weight: 600;
}

.debug-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.debug-links a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 84, 75, 0.35);
}

.cost-panel {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.cost-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cost-summary-grid article,
.cost-breakdown section {
  border: 1px solid rgba(36, 58, 49, 0.08);
  border-radius: 10px;
  background: rgba(247, 250, 248, 0.92);
  padding: 10px 12px;
}

.cost-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.cost-summary-grid strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.cost-summary-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.cost-breakdown {
  display: grid;
  gap: 8px;
}

.cost-breakdown h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #42584f;
}

.cost-breakdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.cost-breakdown li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.cost-breakdown li span {
  min-width: 0;
  color: #30423a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-breakdown li strong {
  font-size: 12px;
}

.cost-breakdown li em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
}

.sales-review-panel {
  display: grid;
  gap: 10px;
}

.sales-action-group {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.review-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(36, 58, 49, 0.08);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(247, 250, 248, 0.96), rgba(238, 247, 241, 0.9));
}

.review-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.review-summary small em {
  font-style: normal;
  color: var(--accent-strong);
  font-weight: 700;
}

.review-summary strong {
  display: block;
  color: #1d3028;
  font-size: 13px;
  line-height: 1.45;
}

.review-summary p {
  margin: 6px 0 0;
  color: #607168;
  font-size: 12px;
  line-height: 1.5;
}

.review-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.review-summary dl div {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.review-summary dt {
  color: var(--muted);
  font-size: 11px;
}

.review-summary dd {
  margin: 2px 0 0;
  color: #1d3028;
  font-size: 16px;
  font-weight: 800;
}

.review-grid {
  display: grid;
  gap: 8px;
}

.review-grid section,
.review-rules {
  padding: 10px 12px;
  border: 1px solid rgba(36, 58, 49, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.review-grid h3,
.review-rules h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #42584f;
}

.review-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.review-grid li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #30423a;
  font-size: 12px;
}

.review-grid li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-grid li strong {
  color: var(--accent-strong);
  font-size: 12px;
}

.review-rules p {
  margin: 0;
  padding: 7px 0;
  border-top: 1px solid rgba(36, 58, 49, 0.08);
  color: #30423a;
  font-size: 12px;
  line-height: 1.5;
}

.review-rules p:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.playbook-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(36, 58, 49, 0.08);
  border-radius: 10px;
  background:
    radial-gradient(circle at top right, rgba(36, 179, 83, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 246, 0.94));
}

.playbook-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 163, 63, 0.16);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(236, 250, 241, 0.94), rgba(255, 255, 255, 0.92));
}

.playbook-active strong {
  display: block;
  margin-bottom: 3px;
  color: #1d3028;
  font-size: 12px;
}

.playbook-active p {
  margin: 0;
  color: #607168;
  font-size: 11px;
  line-height: 1.4;
}

.playbook-active .mini-btn {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.playbook-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.playbook-head small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.playbook-head strong {
  display: block;
  color: #1d3028;
  font-size: 13px;
}

.playbook-head em {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 163, 63, 0.1);
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.playbook-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.playbook-head-actions .mini-btn {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.playbook-principles {
  display: grid;
  gap: 6px;
}

.playbook-principles p {
  margin: 0;
  padding-left: 9px;
  border-left: 3px solid rgba(31, 163, 63, 0.38);
  color: #30423a;
  font-size: 12px;
  line-height: 1.5;
}

.playbook-sections {
  display: grid;
  gap: 8px;
}

.playbook-sections article {
  padding: 9px 10px;
  border: 1px solid rgba(36, 58, 49, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
}

.playbook-sections h3 {
  margin: 0 0 5px;
  color: #1d3028;
  font-size: 12px;
}

.playbook-sections p {
  margin: 0 0 7px;
  color: #607168;
  font-size: 12px;
  line-height: 1.45;
}

.playbook-sections ul {
  margin: 0;
  padding-left: 16px;
  color: #30423a;
  font-size: 12px;
  line-height: 1.45;
}

.playbook-sections li + li {
  margin-top: 4px;
}

.risk-flags {
  margin-top: 8px;
}

.risk-item {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--warning-bg);
  color: var(--warning);
}

.active-rules-view {
  margin-top: 8px;
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 8px;
  background: #f7faf8;
  color: #334039;
}

.active-rules-view.empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
}

.active-rules-view.has-hit {
  border-color: #b9dfb6;
  background: #f3fbf2;
}

.active-rules-view details {
  padding: 8px 10px;
}

.active-rules-view summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.active-rules-view summary::-webkit-details-marker {
  display: none;
}

.active-rules-view span {
  font-weight: 700;
  color: #26332d;
}

.active-rules-view em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.active-rules-view ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.active-rules-view li {
  margin: 5px 0;
  line-height: 1.45;
  color: #405047;
}

.active-rules-view b {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e6f6e5;
  color: #177d19;
  font-size: 11px;
}

.rule-candidates {
  color: var(--muted);
  line-height: 1.5;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fbfcfa;
  color: var(--text);
}

.rule-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.rule-card strong span,
.rule-card strong em {
  font-style: normal;
}

.rule-card strong span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1d5fc4;
  font-size: 12px;
}

.rule-card strong em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.rule-card.personal {
  border-color: #d8ecdf;
  background: #fbfffc;
}

.rule-card.personal strong span {
  background: #e8f8ee;
  color: #14804a;
}

.rule-card.company {
  border-color: #d7e8ff;
  background: #f8fbff;
}

.rule-card.risk {
  border-color: #ffe1cc;
  background: #fffaf5;
}

.rule-card.risk strong span {
  background: #fff0e6;
  color: #b85b00;
}

.rule-card p {
  margin: 0 0 6px;
  line-height: 1.55;
}

.rule-card small {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.intent-view {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.intent-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.intent-score span {
  font-weight: 700;
}

.intent-score strong {
  color: var(--accent-strong);
  font-size: 18px;
}

.intent-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8e5;
}

.intent-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8adf7b, var(--accent));
}

.intent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.intent-tags em {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--accent-strong);
  font-style: normal;
  font-size: 12px;
}

.intent-view p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.rule-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #1f2a24;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.18s ease;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 15, 20, 0.38);
  backdrop-filter: blur(4px);
}

.knowledge-modal {
  position: absolute;
  inset: 28px 36px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: rgba(250, 252, 251, 0.96);
  box-shadow: 0 28px 80px rgba(17, 31, 28, 0.22);
  overflow: hidden;
}

.knowledge-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 248, 0.92));
}

.knowledge-modal-head h2,
.knowledge-uploader h3,
.knowledge-library h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.knowledge-modal-head p,
.knowledge-uploader p,
.knowledge-library p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-close-btn {
  min-height: 34px;
  padding: 0 14px;
}

.tenant-config-dialog {
  position: absolute;
  inset: 32px 42px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(214, 226, 242, 0.92);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 28px 80px rgba(18, 38, 68, 0.24);
  overflow: hidden;
}

.tenant-config-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #dfe8f3;
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
}

.tenant-config-head span {
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

.tenant-config-head h2 {
  margin: 4px 0;
  color: #17233c;
  font-size: 20px;
}

.tenant-config-head p {
  margin: 0;
  color: #6a7d94;
  font-size: 12px;
}

.tenant-config-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.tenant-config-form,
.tenant-config-health {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.tenant-config-form {
  border-right: 1px solid #dfe8f3;
  background: #ffffff;
}

.tenant-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tenant-config-grid label {
  display: grid;
  gap: 6px;
  color: #5c708b;
  font-size: 12px;
  font-weight: 800;
}

.tenant-config-grid input,
.tenant-config-grid select,
.tenant-config-grid textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #f8fbff;
  color: #17233c;
  font: inherit;
}

.tenant-config-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.tenant-config-check {
  grid-template-columns: auto 18px minmax(0, 1fr);
  align-items: center;
}

.tenant-config-check input {
  width: 16px;
  min-height: 16px;
}

.tenant-config-check em,
.tenant-config-secret-note {
  color: #6a7d94;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.tenant-config-notes {
  grid-column: 1 / -1;
}

.tenant-config-wide {
  grid-column: 1 / -1;
}

.tenant-config-secret-note {
  margin: 12px 0 0;
  line-height: 1.5;
}

.tenant-config-secret-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe8f6;
  border-radius: 10px;
  background: #f8fbff;
}

.tenant-config-secret-box summary {
  cursor: pointer;
  color: #17233c;
  font-size: 13px;
  font-weight: 900;
}

.tenant-config-secret-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.tenant-config-secret-grid label {
  display: grid;
  gap: 6px;
  color: #5c708b;
  font-size: 12px;
  font-weight: 800;
}

.tenant-config-secret-grid select,
.tenant-config-secret-grid textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #ccd9e8;
  border-radius: 8px;
  color: #17233c;
  background: #ffffff;
}

.tenant-config-secret-value textarea {
  min-height: 82px;
  resize: vertical;
}

.tenant-config-secret-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.tenant-config-secret-actions button {
  min-height: 32px;
  padding: 0 12px;
}

.tenant-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.tenant-config-actions button {
  min-height: 34px;
  padding: 0 14px;
}

.tenant-config-health {
  background: linear-gradient(180deg, #f7fbff, #eef6ff);
}

.tenant-config-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tenant-config-health-head strong {
  color: #17233c;
  font-size: 18px;
}

.tenant-config-health-head span,
.tenant-config-reserved span,
.tenant-config-effective span {
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

.tenant-config-health-list {
  display: grid;
  gap: 8px;
}

.tenant-config-health-list div,
.tenant-config-reserved,
.tenant-config-effective {
  padding: 10px;
  border: 1px solid #dbe8f6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
}

.tenant-config-health-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
}

.tenant-config-health-list span {
  color: #17233c;
  font-weight: 900;
}

.tenant-config-health-list em {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #667891;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.tenant-config-health-list em.ready {
  background: #e8f5ff;
  color: #0f72d8;
}

.tenant-config-health-list em.pending {
  background: #eef5ff;
  color: #2860a8;
}

.tenant-config-health-list em.missing {
  background: #fff4e5;
  color: #b76e00;
}

.tenant-config-health-list small {
  grid-column: 1 / -1;
  color: #6a7d94;
  line-height: 1.45;
}

.tenant-config-effective {
  margin-top: 12px;
}

.tenant-config-effective dl {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
}

.tenant-config-effective dl div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.tenant-config-effective dt,
.tenant-config-effective dd {
  margin: 0;
  font-size: 12px;
}

.tenant-config-effective dt {
  color: #7a8ca3;
}

.tenant-config-effective dd {
  color: #273b55;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tenant-config-reserved {
  margin-top: 12px;
}

.tenant-config-reserved p {
  margin: 6px 0 0;
  color: #5c708b;
  font-size: 12px;
  line-height: 1.55;
}

.tenant-secret-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tenant-secret-status-list em {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #50657f;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.tenant-secret-status-list em.ready {
  background: #e8f5ff;
  color: #0f72d8;
}

.tenant-secret-status-list em.missing {
  background: #fff4e5;
  color: #b76e00;
}

@media (max-width: 860px) {
  .tenant-config-dialog {
    inset: 16px;
  }

  .tenant-config-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .tenant-config-form,
  .tenant-config-health {
    overflow: visible;
  }

  .tenant-config-form {
    border-right: 0;
    border-bottom: 1px solid #dfe8f3;
  }

  .tenant-config-grid {
    grid-template-columns: 1fr;
  }

  .tenant-config-secret-grid {
    grid-template-columns: 1fr;
  }
}

.knowledge-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
}

.knowledge-uploader,
.knowledge-library {
  min-width: 0;
  min-height: 0;
  padding: 18px 20px 22px;
}

.knowledge-uploader {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 244, 0.92));
}

.knowledge-library {
  overflow: auto;
}

.knowledge-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.knowledge-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.knowledge-form-grid label > span {
  font-size: 12px;
}

.knowledge-form-grid select,
.knowledge-form-grid input,
.knowledge-form-grid textarea {
  width: 100%;
}

.knowledge-form-grid textarea {
  min-height: 180px;
}

.knowledge-form-grid .span-2 {
  grid-column: span 2;
}

.knowledge-upload-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.knowledge-upload-actions small,
.knowledge-card small {
  color: var(--muted);
  line-height: 1.6;
}

.knowledge-subtitle {
  margin: 12px 0 10px;
  color: #3f5249;
  font-weight: 700;
}

.knowledge-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid rgba(39, 174, 96, 0.2);
  background: rgba(229, 248, 236, 0.92);
  color: #1c6b42;
}

.knowledge-notice.info {
  border-color: rgba(76, 124, 112, 0.16);
  background: rgba(243, 248, 246, 0.96);
  color: #496158;
}

.knowledge-builtin-list,
.knowledge-document-list {
  display: grid;
  gap: 10px;
}

.knowledge-fold {
  border: 1px solid rgba(32, 51, 43, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 249, 0.92);
  overflow: hidden;
}

.knowledge-fold-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: #30443c;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.knowledge-fold-summary::-webkit-details-marker {
  display: none;
}

.knowledge-fold-summary::after {
  content: "收起";
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

.knowledge-fold:not([open]) .knowledge-fold-summary::after {
  content: "展开";
}

.knowledge-fold-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.knowledge-card {
  border: 1px solid rgba(32, 51, 43, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
}

.knowledge-card.builtin {
  background: rgba(246, 249, 247, 0.94);
}

.knowledge-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.knowledge-card-head strong {
  font-size: 14px;
}

.knowledge-card-head span,
.knowledge-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.knowledge-card.is-new {
  border-color: rgba(39, 174, 96, 0.32);
  box-shadow: 0 0 0 1px rgba(39, 174, 96, 0.14), 0 18px 36px rgba(34, 139, 88, 0.12);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.wecom-sidebar-head {
  display: none;
}

body.wecom-sidebar {
  background:
    radial-gradient(circle at 92% 0%, rgba(26, 173, 25, 0.14), transparent 30%),
    linear-gradient(180deg, #f5f8f6 0%, #eef3f0 100%);
  min-width: 360px;
  overflow-x: hidden;
}

body.wecom-sidebar .app-shell {
  display: block;
  height: 100vh;
  overflow: auto;
  overflow-x: hidden;
  background: transparent;
}

body.wecom-sidebar .wecom-sidebar-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 12px;
  padding: 14px 18px 14px 12px;
  border-bottom: 1px solid rgba(39, 56, 48, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 248, 241, 0.92)),
    rgba(247, 249, 248, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 30px rgba(18, 33, 27, 0.08);
}

.wecom-head-main,
.wecom-head-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

body.wecom-sidebar .wecom-head-main,
body.wecom-sidebar .wecom-head-controls {
  display: grid;
  grid-template-columns: 1fr;
}

.wecom-head-main > div,
.wecom-head-controls label {
  min-width: 0;
}

.wecom-head-main span,
.wecom-head-controls span {
  display: block;
  color: #607168;
  font-size: 11px;
  margin-bottom: 3px;
  font-weight: 700;
}

.wecom-head-main strong {
  display: block;
  color: #14251d;
  font-size: 18px;
  line-height: 1.25;
}

.wecom-head-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.wecom-full-link {
  flex: 0 0 auto;
  max-width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(39, 56, 48, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #30423a;
  text-decoration: none;
  font-size: 12px;
}

body.wecom-sidebar .wecom-full-link {
  display: none;
}

.wecom-head-controls label {
  flex: 1;
  min-width: 0;
}

.wecom-head-controls select {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.wecom-intent-badge {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f0;
  color: #607168;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(39, 56, 48, 0.05);
}

body.wecom-sidebar .wecom-intent-badge {
  justify-self: start;
}

.wecom-intent-badge.warm {
  background: #fff5df;
  color: #9a5b00;
}

.wecom-intent-badge.hot {
  background: #e8f8e8;
  color: var(--accent-strong);
}

.wecom-advantage-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.wecom-advantage-strip span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(31, 163, 63, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.68);
  color: #30423a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.wecom-decision-panel {
  display: none;
}

.wecom-demo-panel {
  display: none;
}

body.wecom-sidebar .wecom-decision-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 10px 18px 0 10px;
  padding: 13px 14px;
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(36, 179, 83, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 252, 249, 0.94));
  box-shadow: 0 10px 24px rgba(18, 33, 27, 0.08);
}

.decision-main small {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.decision-main strong {
  display: block;
  color: #14251d;
  font-size: 15px;
  line-height: 1.45;
}

.decision-main p {
  margin: 7px 0 0;
  color: #607168;
  line-height: 1.55;
}

.decision-side {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.decision-side span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef6f0;
  color: #30423a;
  font-size: 11px;
  font-weight: 700;
}

.decision-side span.risk {
  background: #fff4dc;
  color: #8a5a10;
}

body.wecom-sidebar .sidebar,
body.wecom-sidebar .contact-panel,
body.wecom-sidebar .col-resize-handle,
body.wecom-sidebar .compare-panel,
body.wecom-sidebar .side-secondary {
  display: none !important;
}

body.wecom-sidebar .workbench,
body.wecom-sidebar .inspector {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 10px 18px 10px 10px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

body.wecom-sidebar .workbench {
  gap: 10px;
}

body.wecom-sidebar .composer,
body.wecom-sidebar .draft-panel,
body.wecom-sidebar .inspector section {
  max-width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(18, 33, 27, 0.06);
}

body.wecom-sidebar .composer,
body.wecom-sidebar .draft-panel {
  padding: 12px;
}

body.wecom-sidebar .section-head,
body.wecom-sidebar .draft-head {
  display: block;
  gap: 8px;
  margin-bottom: 8px;
}

body.wecom-sidebar .section-head h2,
body.wecom-sidebar .draft-head h2,
body.wecom-sidebar .inspector h2 {
  font-size: 14px;
  margin-bottom: 4px;
}

body.wecom-sidebar .section-head p,
body.wecom-sidebar .draft-head p {
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.wecom-sidebar #customerInput {
  min-height: 96px;
  border-radius: 10px;
  background: #fbfdfb;
}

body.wecom-sidebar #generateQuoteBtn,
body.wecom-sidebar #uploadFloorPlanBtn,
body.wecom-sidebar #reportBtn,
body.wecom-sidebar #proactiveBtn {
  display: none;
}

body.wecom-sidebar .composer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

body.wecom-sidebar .composer-actions-main {
  grid-template-columns: 1fr;
}

body.wecom-sidebar .composer-actions-main .primary {
  min-height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #18b21d, #0d9415);
  box-shadow: 0 8px 18px rgba(26, 173, 25, 0.18);
}

body.wecom-sidebar .composer-actions button {
  width: 100%;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-sidebar .draft-head {
  display: grid;
}

body.wecom-sidebar .auto-send-bar {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
}

body.wecom-sidebar .auto-send-bar input {
  max-width: 58px;
}

body.wecom-sidebar .draft-messages textarea {
  min-height: 72px;
}

body.wecom-sidebar .inspector {
  display: grid;
  gap: 10px;
  padding-top: 0;
}

body.wecom-sidebar .inspector-core:first-of-type {
  order: -3;
}

body.wecom-sidebar .inspector-core:nth-of-type(2) {
  order: -2;
}

body.wecom-sidebar .inspector-core:nth-of-type(3) {
  order: -1;
}

body.wecom-sidebar .inspector section {
  margin-bottom: 0;
  padding: 11px 12px;
}

body.wecom-sidebar .field-row {
  grid-template-columns: 70px minmax(0, 1fr);
  padding: 5px 0;
  font-size: 12px;
}

body.wecom-sidebar .intent-view {
  min-width: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf7 100%);
}

body.wecom-sidebar .intent-score strong {
  font-size: 16px;
}

body.wecom-sidebar dd,
body.wecom-sidebar small,
body.wecom-sidebar p,
body.wecom-sidebar li {
  overflow-wrap: anywhere;
}

body.wecom-sidebar .field-row small {
  display: none;
}

body.wecom-sidebar .wecom-sidebar-head {
  gap: 8px;
  padding: 10px 14px 9px;
  border-bottom-color: rgba(23, 41, 32, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 245, 0.95)),
    rgba(250, 252, 251, 0.96);
  box-shadow: 0 8px 22px rgba(20, 37, 29, 0.08);
}

body.wecom-sidebar .wecom-head-main {
  display: block;
  align-items: center;
  gap: 8px;
}

body.wecom-sidebar .wecom-head-main span {
  margin: 0 0 1px;
  color: #718077;
  font-size: 10px;
  letter-spacing: 0;
}

body.wecom-sidebar .wecom-head-main strong {
  font-size: 16px;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wecom-connect-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ef;
  color: #52635a;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

body.wecom-sidebar .wecom-connect-status {
  display: none;
}

.wecom-connect-status.mapped {
  background: #e8f7ec;
  color: #078420;
}

.wecom-connect-status.demo {
  background: #eef3ff;
  color: #315a9c;
}

body.wecom-sidebar .wecom-head-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 7px;
}

body.wecom-sidebar .wecom-head-controls span {
  margin-bottom: 2px;
  font-size: 10px;
}

body.wecom-sidebar .wecom-head-controls select {
  width: 100%;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
}

.wecom-bind-btn {
  height: 30px;
  min-width: 44px;
  padding: 0 9px;
  border: 1px solid rgba(24, 60, 38, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #233b2e;
  font-size: 12px;
  font-weight: 800;
}

body.wecom-sidebar .wecom-bind-btn {
  display: none;
}

body.wecom-sidebar .wecom-intent-badge {
  display: none;
}

.wecom-customer-meta {
  margin: 0;
  color: #708078;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-sidebar .wecom-advantage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

body.wecom-sidebar .wecom-advantage-strip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 4px;
  border: 1px solid rgba(31, 163, 63, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #2d4638;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

body.wecom-sidebar .wecom-decision-panel {
  margin: 8px 14px 0;
  padding: 10px 11px;
  gap: 7px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(18, 33, 27, 0.06);
}

body.wecom-demo-sidebar {
  background:
    radial-gradient(circle at 92% 0%, rgba(47, 104, 176, 0.12), transparent 30%),
    linear-gradient(180deg, #f5f8f6 0%, #edf2f5 100%);
}

body.wecom-demo-sidebar .wecom-sidebar-head {
  border-bottom-color: rgba(32, 72, 117, 0.1);
}

body.wecom-demo-sidebar .wecom-demo-panel {
  display: grid;
  gap: 8px;
  margin: 8px 14px 0;
  padding: 10px 11px;
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(18, 33, 27, 0.06);
}

.wecom-demo-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.wecom-demo-intro small {
  display: block;
  margin-bottom: 2px;
  color: #315a9c;
  font-size: 10px;
  font-weight: 800;
}

.wecom-demo-intro strong {
  display: block;
  color: #17251f;
  font-size: 13px;
  line-height: 1.35;
}

.wecom-demo-intro span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef3ff;
  color: #315a9c;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.wecom-demo-template-row,
.wecom-demo-scenario-row,
.wecom-demo-action-row {
  display: grid;
  gap: 6px;
}

.wecom-demo-template-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wecom-demo-scenario-row,
.wecom-demo-action-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wecom-demo-template-row a,
.wecom-demo-scenario-row button,
.wecom-demo-action-row button {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid rgba(39, 56, 48, 0.09);
  border-radius: 8px;
  background: #f8faf9;
  color: #243a2e;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wecom-demo-template-row a.active {
  border-color: rgba(49, 90, 156, 0.28);
  background: #eef3ff;
  color: #315a9c;
}

.wecom-demo-scenario-row button {
  background: #f6fbf7;
}

.wecom-demo-action-row button {
  background: #ffffff;
}

.wecom-demo-insight {
  padding: 9px 10px;
  border: 1px solid rgba(39, 56, 48, 0.08);
  border-radius: 10px;
  background: #fbfcfb;
}

.wecom-demo-insight strong {
  display: block;
  margin-bottom: 6px;
  color: #17251f;
  font-size: 12px;
}

.wecom-demo-insight p {
  margin: 0;
  color: #607168;
  font-size: 11px;
  line-height: 1.5;
}

.wecom-demo-insight dl {
  margin: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 5px 8px;
}

.wecom-demo-insight dt {
  color: #647069;
  font-size: 11px;
  font-weight: 800;
}

.wecom-demo-insight dd {
  margin: 0;
  color: #243a2e;
  font-size: 11px;
  line-height: 1.45;
}

body.wecom-sidebar .decision-main small {
  margin-bottom: 2px;
  font-size: 10px;
}

body.wecom-sidebar .decision-main strong {
  font-size: 14px;
  line-height: 1.35;
}

body.wecom-sidebar .decision-main p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.wecom-sidebar .decision-side span {
  padding: 4px 7px;
  font-size: 10px;
}

body.wecom-sidebar .workbench,
body.wecom-sidebar .inspector {
  padding-left: 14px;
  padding-right: 14px;
}

body.wecom-sidebar .workbench {
  padding-top: 8px;
}

body.wecom-sidebar .composer,
body.wecom-sidebar .draft-panel,
body.wecom-sidebar .inspector section {
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(18, 33, 27, 0.05);
}

body.wecom-sidebar .composer,
body.wecom-sidebar .draft-panel {
  padding: 11px;
}

body.wecom-sidebar .section-head h2,
body.wecom-sidebar .draft-head h2,
body.wecom-sidebar .inspector h2 {
  font-size: 13px;
}

body.wecom-sidebar .section-head h2::before,
body.wecom-sidebar .draft-head h2::before,
body.wecom-sidebar .inspector h2::before {
  width: 4px;
  height: 15px;
  border-radius: 999px;
}

body.wecom-sidebar .section-head p,
body.wecom-sidebar .draft-head p {
  font-size: 11px;
}

body.wecom-sidebar #customerInput {
  min-height: 82px;
  font-size: 13px;
  line-height: 1.55;
}

body.wecom-sidebar .composer-actions-main .primary {
  min-height: 38px;
  font-size: 14px;
}

body.wecom-sidebar .draft-tools {
  margin-top: 7px;
}

body.wecom-sidebar .auto-send-bar {
  min-height: 34px;
  padding: 5px;
}

body.wecom-sidebar .mode-btn {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

body.wecom-sidebar .auto-send-bar input {
  height: 24px;
  max-width: 50px;
  padding: 0 6px;
  font-size: 12px;
}

body.wecom-sidebar #autoSendStatus {
  font-size: 11px;
}

body.wecom-sidebar .draft-message-row {
  grid-template-columns: minmax(0, 1fr);
}

body.wecom-sidebar .draft-message-row textarea,
body.wecom-sidebar .draft-messages textarea {
  min-height: 66px;
  font-size: 13px;
  line-height: 1.55;
}

body.wecom-sidebar .draft-message-row > div {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: center;
  gap: 6px;
}

body.wecom-sidebar .draft-delete {
  min-height: 26px;
  margin-top: 0;
  font-size: 11px;
}

body.wecom-sidebar .draft-panel > .composer-actions {
  grid-template-columns: 1fr;
}

body.wecom-sidebar #confirmBtn {
  order: -1;
  min-height: 38px;
  font-size: 13px;
}

body.wecom-sidebar .risk-flags {
  margin-top: 7px;
}

body.wecom-sidebar .inspector {
  gap: 8px;
}

body.wecom-sidebar .inspector section {
  padding: 10px 11px;
}

body.wecom-sidebar .inspector-core:nth-of-type(2),
body.wecom-sidebar .inspector-core:nth-of-type(3) {
  max-height: 188px;
  overflow: auto;
}

body.wecom-sidebar .field-row {
  grid-template-columns: 68px minmax(0, 1fr);
  padding: 4px 0;
  font-size: 12px;
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns:
      280px 6px
      minmax(360px, 1fr) 6px
      340px;
  }

  .contact-panel,
  #middleResize {
    display: none;
  }

  .turn-grid {
    grid-template-columns: 1fr;
  }

  .composer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar,
  .contact-panel,
  .workbench {
    height: auto;
  }

  .messages {
    max-height: 46vh;
  }
}

body.wecom-demo-sidebar {
  min-width: 0;
  overflow: hidden;
  background: #e8e8ea;
}

body.wecom-demo-sidebar .app-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 480px) minmax(280px, 360px);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: #e8e8ea;
}

body.wecom-demo-sidebar .contact-panel {
  grid-column: 1;
  grid-row: 1 / 5;
  display: flex !important;
  height: 100vh;
  min-height: 0;
  border-right: 1px solid #d1d2d5;
  background: #f3f3f4;
}

body.wecom-demo-sidebar .conversation-topbar {
  min-height: 56px;
  padding: 11px 16px;
  border-bottom: 1px solid #d8d8d8;
  background: #f7f7f7;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-title h1 {
  font-size: 16px;
}

body.wecom-demo-sidebar .conversation-topbar #clearContactBtn {
  min-height: 28px;
  border-radius: 6px;
  background: #fff;
}

body.wecom-demo-sidebar .wecom-demo-chat-tools {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #d8d8d8;
  background: #ededee;
}

body.wecom-demo-sidebar .wecom-demo-chat-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

body.wecom-demo-sidebar .wecom-demo-chat-head small {
  display: block;
  margin-bottom: 1px;
  color: #69706d;
  font-size: 10px;
  font-weight: 800;
}

body.wecom-demo-sidebar .wecom-demo-chat-head strong {
  display: block;
  color: #1f2924;
  font-size: 13px;
}

body.wecom-demo-sidebar .wecom-demo-chat-head span {
  color: #69706d;
  font-size: 11px;
  white-space: nowrap;
}

body.wecom-demo-sidebar .contact-panel .wecom-demo-template-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.wecom-demo-sidebar .contact-panel .wecom-demo-scenario-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.wecom-demo-sidebar .messages {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 80px),
    #ededee;
  padding: 18px 18px 22px;
}

body.wecom-demo-sidebar .message {
  max-width: min(74%, 560px);
}

body.wecom-demo-sidebar .message-bubble {
  border-color: #dfdfdf;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(15, 20, 18, 0.05);
}

body.wecom-demo-sidebar .message.human_final .message-bubble {
  background: #95ec69;
  border-color: #87dc5e;
}

body.wecom-demo-sidebar .message-avatar {
  border-radius: 4px;
  background: #d7ded9;
}

body.wecom-demo-sidebar .wecom-sidebar-head {
  grid-column: 2 / 4;
  grid-row: 1;
  position: static;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #d8d8d8;
  border-left: 0;
  background: #f7f7f7;
  box-shadow: none;
}

body.wecom-demo-sidebar .wecom-head-main {
  display: flex;
  align-items: center;
}

body.wecom-demo-sidebar .wecom-head-main strong {
  font-size: 15px;
}

body.wecom-demo-sidebar .wecom-head-controls {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

body.wecom-demo-sidebar .wecom-bind-btn,
body.wecom-demo-sidebar .wecom-intent-badge,
body.wecom-demo-sidebar .wecom-connect-status {
  display: inline-flex;
}

body.wecom-demo-sidebar .wecom-customer-meta {
  white-space: normal;
}

body.wecom-demo-sidebar .wecom-advantage-strip {
  display: none;
}

body.wecom-demo-sidebar .wecom-demo-panel {
  grid-column: 2 / 4;
  grid-row: 2;
  margin: 8px 10px 0;
  padding: 9px 10px;
  border-radius: 8px;
}

body.wecom-demo-sidebar .wecom-decision-panel {
  grid-column: 2 / 4;
  grid-row: 3;
  margin: 8px 10px 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

body.wecom-demo-sidebar .decision-main strong {
  font-size: 13px;
}

body.wecom-demo-sidebar .decision-main p {
  -webkit-line-clamp: 1;
}

body.wecom-demo-sidebar .workbench {
  grid-column: 2;
  grid-row: 4;
  height: auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 8px 12px 10px;
  gap: 8px;
}

body.wecom-demo-sidebar .inspector {
  grid-column: 3;
  grid-row: 4;
  display: grid;
  align-content: start;
  height: auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 10px 12px 0;
  gap: 8px;
}

body.wecom-demo-sidebar .composer,
body.wecom-demo-sidebar .draft-panel,
body.wecom-demo-sidebar .inspector section {
  border-radius: 8px;
  border-color: #dedede;
  background: #ffffff;
  box-shadow: none;
}

body.wecom-demo-sidebar .composer,
body.wecom-demo-sidebar .draft-panel {
  padding: 10px;
}

body.wecom-demo-sidebar .section-head,
body.wecom-demo-sidebar .draft-head {
  margin-bottom: 7px;
}

body.wecom-demo-sidebar .section-head h2,
body.wecom-demo-sidebar .draft-head h2,
body.wecom-demo-sidebar .inspector h2 {
  padding-left: 0;
  margin-bottom: 2px;
  font-size: 13px;
}

body.wecom-demo-sidebar .section-head h2::before,
body.wecom-demo-sidebar .draft-head h2::before,
body.wecom-demo-sidebar .inspector h2::before {
  display: none;
}

body.wecom-demo-sidebar .section-head p,
body.wecom-demo-sidebar .draft-head p {
  font-size: 11px;
}

body.wecom-demo-sidebar #customerInput {
  min-height: 78px;
  border-radius: 6px;
}

body.wecom-demo-sidebar .composer-actions,
body.wecom-demo-sidebar .draft-panel > .composer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body.wecom-demo-sidebar #confirmBtn {
  order: -1;
  grid-column: 1 / -1;
}

body.wecom-demo-sidebar .draft-tools {
  margin-top: 0;
}

body.wecom-demo-sidebar .auto-send-bar {
  min-height: 30px;
  padding: 4px;
  border-radius: 7px;
}

body.wecom-demo-sidebar .draft-message-row textarea,
body.wecom-demo-sidebar .draft-messages textarea {
  min-height: 62px;
  border-radius: 6px;
}

body.wecom-demo-sidebar .inspector-core:nth-of-type(2),
body.wecom-demo-sidebar .inspector-core:nth-of-type(3) {
  max-height: none;
}

body.wecom-demo-sidebar .field-row {
  grid-template-columns: 64px minmax(0, 1fr);
}

@media (max-width: 1180px) {
  body.wecom-demo-sidebar .app-shell {
    grid-template-columns: minmax(360px, 45vw) minmax(360px, 1fr);
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
  }

  body.wecom-demo-sidebar .contact-panel {
    grid-column: 1;
    grid-row: 1 / 6;
    display: flex !important;
  }

  body.wecom-demo-sidebar .wecom-sidebar-head,
  body.wecom-demo-sidebar .wecom-demo-panel,
  body.wecom-demo-sidebar .wecom-decision-panel,
  body.wecom-demo-sidebar .workbench,
  body.wecom-demo-sidebar .inspector {
    grid-column: 2;
  }

  body.wecom-demo-sidebar .wecom-sidebar-head {
    grid-row: 1;
  }

  body.wecom-demo-sidebar .wecom-demo-panel {
    grid-row: 2;
  }

  body.wecom-demo-sidebar .wecom-decision-panel {
    grid-row: 3;
  }

  body.wecom-demo-sidebar .workbench {
    grid-row: 4;
    min-height: 0;
    max-height: none;
  }

  body.wecom-demo-sidebar .inspector {
    grid-row: 5;
    padding-left: 10px;
  }

  body.wecom-demo-sidebar .contact-panel .wecom-demo-scenario-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body.wecom-demo-sidebar {
    overflow: auto;
  }

  body.wecom-demo-sidebar .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body.wecom-demo-sidebar .contact-panel {
    height: 48vh;
    min-height: 360px;
    display: flex !important;
  }

  body.wecom-demo-sidebar .messages {
    max-height: none;
  }

  body.wecom-demo-sidebar .workbench,
  body.wecom-demo-sidebar .inspector {
    height: auto;
    overflow: visible;
    padding: 10px;
  }
}

.demo-login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e8e8ea;
}

.demo-login-gate.hidden {
  display: none;
}

body.demo-auth-pending .app-shell {
  pointer-events: none;
  filter: blur(1px);
}

.demo-login-card {
  width: min(92vw, 380px);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid #d7d8dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(25, 31, 38, 0.12);
}

.demo-login-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #2f7cf6;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.demo-login-title small {
  display: block;
  color: #6b7178;
  font-weight: 800;
}

.demo-login-title h1 {
  margin: 4px 0 5px;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.demo-login-title p {
  margin: 0;
  color: #6b7178;
  line-height: 1.5;
}

.demo-login-card label span {
  display: block;
  margin-bottom: 6px;
  color: #3f4750;
  font-size: 12px;
  font-weight: 800;
}

.demo-login-card input {
  height: 40px;
  padding: 0 11px;
  border-radius: 6px;
}

.demo-login-card button {
  height: 42px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
}

.demo-login-error {
  min-height: 18px;
  margin: 0;
  color: #d93025;
  font-size: 12px;
  line-height: 1.5;
}

.manual-only-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #dce6dc;
  border-radius: 999px;
  background: #f6fbf7;
  color: #16821a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

body.wecom-demo-sidebar {
  min-width: 1024px;
  background: #e8e8ea;
  --accent: #2f7cf6;
  --accent-strong: #1f64d6;
  --soft: #edf4ff;
  --demo-blue: #2f7cf6;
  --demo-blue-strong: #1f64d6;
  --demo-blue-soft: #eaf2ff;
  --demo-conversation-width: 480px;
}

body.wecom-demo-sidebar .app-shell {
  grid-template-columns:
    104px
    minmax(380px, var(--demo-conversation-width))
    6px
    minmax(360px, 1fr)
    6px
    var(--inspector-width);
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #e8e8ea;
}

body.wecom-demo-sidebar .sidebar {
  grid-column: 1;
  grid-row: 1 / 4;
  display: block !important;
  height: 100vh;
  border-right: 1px solid #cfd1d7;
  background: #f4f4f5;
  backdrop-filter: none;
}

body.wecom-demo-sidebar .sidebar .wechat-rail,
body.wecom-demo-sidebar .sidebar .wechat-list-pane {
  display: none !important;
}

.wecom-demo-case-rail {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 8px;
  background: #f4f4f5;
}

.wecom-demo-case-brand {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dddfe5;
  color: #3d444d;
  text-align: center;
}

.case-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--demo-blue);
  color: #fff;
  font-weight: 900;
}

.wecom-demo-case-brand strong {
  font-size: 13px;
  line-height: 1.2;
}

.wecom-demo-case-brand small {
  color: #7b8189;
  font-size: 10px;
  font-weight: 700;
}

.wecom-demo-case-list {
  display: grid;
  gap: 8px;
}

.wecom-demo-case-list a {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #3d444d;
  text-decoration: none;
}

.wecom-demo-case-list a:hover,
.wecom-demo-case-list a.active {
  border-color: #b8cdf2;
  background: #eaf2ff;
  color: #1d5fbf;
}

.wecom-demo-case-list span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font-size: 14px;
  font-weight: 900;
}

.wecom-demo-case-list strong,
.wecom-demo-case-list small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wecom-demo-case-list strong {
  font-size: 12px;
}

.wecom-demo-case-list small {
  color: #7b8189;
  font-size: 10px;
}

.wecom-demo-logout {
  margin-top: auto;
  min-height: 30px;
  border-radius: 6px;
  background: #fff;
  color: #59616b;
  font-size: 12px;
}

body.wecom-demo-sidebar .contact-panel {
  grid-column: 2;
  grid-row: 1 / 4;
  border-right: 1px solid #d1d2d5;
}

body.wecom-demo-sidebar .wecom-sidebar-head {
  display: none !important;
}

body.wecom-demo-sidebar .wecom-decision-panel,
body.wecom-demo-sidebar .wecom-demo-panel {
  grid-column: 4 / 7;
}

body.wecom-demo-sidebar .workbench {
  grid-column: 4;
  grid-row: 3;
}

body.wecom-demo-sidebar .inspector {
  grid-column: 6;
  grid-row: 3;
}

body.wecom-demo-sidebar #leftResize {
  display: none !important;
}

body.wecom-demo-sidebar #middleResize,
body.wecom-demo-sidebar #rightResize {
  display: block !important;
  grid-row: 1 / 4;
  width: 6px;
  background: #dedfe4;
  cursor: col-resize;
  border-left: 1px solid #d3d6de;
  border-right: 1px solid #d3d6de;
}

body.wecom-demo-sidebar #middleResize {
  grid-column: 3;
}

body.wecom-demo-sidebar #rightResize {
  grid-column: 5;
}

body.wecom-demo-sidebar .wecom-head-main span {
  font-size: 11px;
}

body.wecom-demo-sidebar .wecom-head-main strong {
  font-size: 16px;
}

body.wecom-demo-sidebar .wecom-customer-meta {
  color: #6e747b;
  font-size: 11px;
}

body.wecom-demo-sidebar .wecom-demo-chat-tools {
  padding: 9px 14px;
}

.wecom-demo-customer-bar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(170px, 0.9fr);
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid #d8d8d8;
  background: #f7f7f7;
}

.wecom-demo-customer-bar label,
.wecom-demo-customer-bar .demo-new-contact {
  min-width: 0;
}

.wecom-demo-customer-bar label span {
  display: block;
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.wecom-demo-customer-bar select,
.wecom-demo-customer-bar input {
  height: 32px;
  border: 1px solid #d5d8df;
  border-radius: 6px;
  background: #fff;
}

.wecom-demo-customer-bar .demo-new-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: end;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.wecom-demo-customer-bar .demo-new-contact button {
  height: 32px;
  min-height: 32px;
  border-radius: 6px;
  background: var(--demo-blue);
  color: #fff;
  font-weight: 900;
}

body.wecom-demo-sidebar .contact-panel .wecom-demo-scenario-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.wecom-demo-sidebar .messages {
  background: #ebebec;
}

body.wecom-demo-sidebar .message.human_final .message-bubble {
  background: #d8ebff;
  border-color: #b9d7f8;
}

body.wecom-demo-sidebar .composer,
body.wecom-demo-sidebar .draft-panel,
body.wecom-demo-sidebar .inspector section,
body.wecom-demo-sidebar .wecom-demo-panel,
body.wecom-demo-sidebar .wecom-decision-panel {
  border-radius: 8px;
  border-color: #dedede;
  background: #fff;
  box-shadow: none;
}

body.wecom-demo-sidebar .draft-tools {
  justify-self: start;
}

body.wecom-demo-sidebar button.primary,
body.wecom-demo-sidebar .composer-actions-main .primary {
  border-color: var(--demo-blue);
  background: var(--demo-blue);
  box-shadow: none;
}

body.wecom-demo-sidebar button.primary:hover,
body.wecom-demo-sidebar .composer-actions-main .primary:hover {
  border-color: var(--demo-blue-strong);
  background: var(--demo-blue-strong);
}

body.wecom-demo-sidebar .manual-only-pill {
  border-color: #c9dcfb;
  background: #edf4ff;
  color: var(--demo-blue-strong);
}

body.wecom-demo-sidebar .draft-message-row > div {
  grid-template-columns: 1fr;
}

body.wecom-demo-sidebar .draft-message-row input,
body.wecom-demo-sidebar .draft-message-row .delay-box {
  display: none;
}

body.wecom-demo-sidebar .side-secondary,
body.wecom-demo-sidebar .compare-panel,
body.wecom-demo-sidebar #activeRulesView {
  display: none !important;
}

body.wecom-demo-sidebar #noReplyBtn {
  order: 2;
}

body.wecom-demo-sidebar .inspector-core:nth-of-type(2),
body.wecom-demo-sidebar .inspector-core:nth-of-type(3) {
  max-height: 210px;
  overflow: auto;
}

body.wecom-demo-sidebar .wecom-decision-panel {
  grid-row: 1;
  margin: 10px 10px 0;
  border-color: #d8e4fb;
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 124, 246, 0.12), transparent 34%),
    #fff;
}

body.wecom-demo-sidebar .wecom-demo-panel {
  grid-row: 2;
}

body.wecom-demo-sidebar .decision-main small,
body.wecom-demo-sidebar .wecom-demo-intro small {
  color: var(--demo-blue-strong);
}

body.wecom-demo-sidebar .decision-side span,
body.wecom-demo-sidebar .wecom-demo-intro span {
  background: #edf4ff;
  color: var(--demo-blue-strong);
}

body.wecom-demo-sidebar .intent-score strong {
  color: var(--demo-blue-strong);
}

body.wecom-demo-sidebar .intent-meter > span {
  background: var(--demo-blue);
}

@media (max-width: 1180px) {
  body.wecom-demo-sidebar {
    min-width: 0;
    overflow: auto;
  }

  body.wecom-demo-sidebar .app-shell {
    grid-template-columns: 86px minmax(360px, 44vw) minmax(360px, 1fr);
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body.wecom-demo-sidebar .sidebar {
    grid-column: 1;
    grid-row: 1 / 6;
  }

  body.wecom-demo-sidebar .contact-panel {
    grid-column: 2;
    grid-row: 1 / 6;
  }

  body.wecom-demo-sidebar .wecom-sidebar-head,
  body.wecom-demo-sidebar .wecom-demo-panel,
  body.wecom-demo-sidebar .wecom-decision-panel,
  body.wecom-demo-sidebar .workbench,
  body.wecom-demo-sidebar .inspector {
    grid-column: 3;
  }

  body.wecom-demo-sidebar .wecom-sidebar-head {
    grid-row: 1;
  }

  body.wecom-demo-sidebar .wecom-demo-panel {
    grid-row: 2;
  }

  body.wecom-demo-sidebar .wecom-decision-panel {
    grid-row: 3;
  }

  body.wecom-demo-sidebar .workbench {
    grid-row: 4;
  }

  body.wecom-demo-sidebar .inspector {
    grid-row: 5;
    padding-left: 10px;
  }
}

@media (max-width: 860px) {
  body.wecom-demo-sidebar .app-shell {
    display: block;
  }

  body.wecom-demo-sidebar .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #d7d9df;
  }

  .wecom-demo-case-rail {
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .wecom-demo-case-brand {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .wecom-demo-case-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    overflow-x: auto;
  }

  body.wecom-demo-sidebar .contact-panel {
    height: 46vh;
  }
}

body.wecom-demo-sidebar .app-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

body.wecom-demo-sidebar .sidebar,
body.wecom-demo-sidebar .contact-panel,
body.wecom-demo-sidebar #middleResize,
body.wecom-demo-sidebar #rightResize {
  grid-row: 1 / 3;
}

body.wecom-demo-sidebar .wecom-decision-panel {
  display: none !important;
}

body.wecom-demo-sidebar .wecom-demo-panel {
  grid-column: 4;
  grid-row: 1;
  align-self: start;
}

body.wecom-demo-sidebar .workbench {
  grid-column: 4;
  grid-row: 2;
}

body.wecom-demo-sidebar .inspector {
  grid-column: 6;
  grid-row: 1 / 3;
  padding-top: 10px;
}

body.wecom-demo-sidebar .conversation-topbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(64px, 76px) minmax(130px, 1fr) minmax(118px, 140px) 38px;
  align-items: center;
  gap: 6px;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-title {
  min-width: 0;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-title h1 {
  margin-bottom: 2px;
  font-size: 18px;
  line-height: 24px;
  white-space: nowrap;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-title p {
  display: none;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-actions {
  align-self: center;
}

body.wecom-demo-sidebar .wecom-demo-customer-bar {
  display: contents;
}

body.wecom-demo-sidebar .wecom-demo-customer-bar label span {
  display: none;
}

body.wecom-demo-sidebar .wecom-demo-customer-bar select,
body.wecom-demo-sidebar .wecom-demo-customer-bar input {
  height: 32px;
}

body.wecom-demo-sidebar .wecom-demo-chat-tools {
  padding-top: 8px;
}

body.wecom-demo-sidebar .contact-panel .wecom-demo-scenario-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

body.wecom-demo-sidebar .draft-panel > .composer-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wecom-formal-panel {
  display: none;
}

body.wecom-formal-sidebar {
  background: #f5f7fa;
}

body.wecom-formal-sidebar .wecom-sidebar-head {
  gap: 8px;
  padding: 10px 12px 9px;
  border-bottom-color: #e5eaf1;
  background: #fff;
  box-shadow: 0 1px 0 rgba(31, 62, 102, 0.06);
}

body.wecom-formal-sidebar .wecom-head-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

body.wecom-formal-sidebar .wecom-head-main > div > span:first-child {
  display: none;
}

body.wecom-formal-sidebar .wecom-head-main span,
body.wecom-formal-sidebar .wecom-head-controls span {
  color: #5c708b;
}

body.wecom-formal-sidebar .wecom-head-main strong {
  color: #17233c;
  font-size: 18px;
  line-height: 1.25;
}

body.wecom-formal-sidebar #wecomConnectStatus {
  display: none;
}

body.wecom-formal-sidebar .wecom-head-controls {
  display: none !important;
}

body.wecom-formal-sidebar .wecom-head-controls select {
  border-color: rgba(22, 119, 255, 0.16);
  background: #fff;
}

body.wecom-formal-sidebar .wecom-customer-meta {
  color: #667891;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.wecom-formal-sidebar .wecom-header-intent-control {
  margin-top: 8px;
  padding: 9px 10px;
  display: grid;
  gap: 6px;
  border: 1px solid #d7e7ff;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4f9ff 0%, #ffffff 68%);
}

body.wecom-formal-sidebar .wecom-header-intent-row {
  display: grid;
  grid-template-columns: auto minmax(84px, 1fr) auto;
  align-items: center;
  gap: 9px;
}

body.wecom-formal-sidebar .wecom-header-intent-row span {
  display: inline-flex;
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-header-intent-row input[type="range"] {
  width: 100%;
  accent-color: #1677ff;
}

body.wecom-formal-sidebar .wecom-intent-edit-btn {
  border: 1px solid #d6e6ff;
  border-radius: 6px;
  background: #fff;
  color: #1668dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}

body.wecom-formal-sidebar .wecom-intent-edit-btn:hover {
  border-color: #1677ff;
  background: #f0f7ff;
}

body.wecom-formal-sidebar .wecom-header-intent-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0f8;
}

body.wecom-formal-sidebar .wecom-header-intent-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #80d6a3 0%, #3b8dff 100%);
}

body.wecom-formal-sidebar .wecom-formal-header-tags {
  display: block;
  min-width: 0;
}

body.wecom-formal-sidebar .wecom-header-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-header-nav button {
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #31577f;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-header-nav button:hover {
  border-color: #b9d6ff;
  background: #eef6ff;
  color: #1677ff;
}

body.wecom-formal-sidebar .wecom-header-nav button.active {
  border-color: #1677ff;
  background: linear-gradient(180deg, #2d84ff, #1677ff);
  color: #fff;
  box-shadow: 0 8px 16px rgba(22, 119, 255, 0.16);
}

body.wecom-formal-sidebar .wecom-task-toggle,
body.wecom-formal-sidebar .wecom-full-link,
body.wecom-formal-sidebar .wecom-native-detail-link {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #d7e5fb;
  border-radius: 6px;
  background: #f5f9ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

body.wecom-formal-sidebar .wecom-full-link {
  display: none !important;
}

body.wecom-formal-sidebar .wecom-intent-badge,
body.wecom-formal-sidebar .wecom-intent-strip,
body.wecom-formal-sidebar .wecom-native-detail-link {
  display: none !important;
}

body.wecom-formal-sidebar .wecom-header-intent-row.text-only {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

body.wecom-formal-sidebar .wecom-header-intent-row.text-only em {
  min-width: 0;
  color: #31577f;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-header-judgement {
  margin: 0;
  color: #667891;
  font-size: 12px;
  line-height: 1.45;
}

body.wecom-formal-sidebar .wecom-header-more {
  position: relative;
  min-width: 0;
}

body.wecom-formal-sidebar .wecom-header-more summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #31577f;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

body.wecom-formal-sidebar .wecom-header-more summary::-webkit-details-marker {
  display: none;
}

body.wecom-formal-sidebar .wecom-header-more[open] summary {
  border-color: #1677ff;
  background: #eef6ff;
  color: #1677ff;
}

body.wecom-formal-sidebar .wecom-header-more a,
body.wecom-formal-sidebar .wecom-header-more button {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  background: #fff;
  color: #244f87;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

body.wecom-formal-sidebar .wecom-native-detail-link {
  border-color: #e2e8f0;
  background: #fff;
  color: #36506c;
}

body.wecom-formal-sidebar .wecom-task-toggle.active {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

body.wecom-formal-sidebar .wecom-advantage-strip {
  display: none;
}

body.wecom-formal-sidebar .wecom-decision-panel {
  margin: 8px 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border-color: rgba(22, 119, 255, 0.12);
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 119, 255, 0.12), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 8px 20px rgba(31, 62, 102, 0.07);
}

body.wecom-formal-sidebar .decision-main small {
  color: #1677ff;
}

body.wecom-formal-sidebar .decision-main strong {
  color: #17233c;
}

body.wecom-formal-sidebar .decision-side span {
  background: #eef5ff;
  color: #244f87;
}

body.wecom-formal-sidebar .wecom-formal-panel {
  display: block;
  padding: 10px 12px 0;
  container: wecom-formal-panel / inline-size;
}

body.wecom-formal-sidebar .wecom-formal-identifying {
  min-height: 220px;
  border: 1px solid #dbe8ff;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  color: #27364f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 18px;
  text-align: center;
}

body.wecom-formal-sidebar .wecom-formal-identifying::before {
  content: "";
  width: 26px;
  height: 26px;
  border: 3px solid #dbe8ff;
  border-top-color: #2f7cf6;
  border-radius: 999px;
  animation: wecom-spin 0.8s linear infinite;
}

body.wecom-formal-sidebar .wecom-formal-identifying strong {
  font-size: 15px;
  font-weight: 700;
}

body.wecom-formal-sidebar .wecom-formal-identifying p {
  margin: 0;
  color: #6b7a90;
  font-size: 12px;
  line-height: 1.6;
}

@keyframes wecom-spin {
  to {
    transform: rotate(360deg);
  }
}

body.wecom-formal-sidebar .wecom-decision-panel {
  display: none;
}

body.wecom-formal-sidebar .wecom-formal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.2fr) minmax(220px, 0.94fr);
  grid-template-areas: "context reply assist";
  gap: 10px;
  align-items: start;
}

body.wecom-formal-sidebar .wecom-current-card {
  grid-area: current;
}

body.wecom-formal-sidebar .wecom-context-card {
  grid-area: context;
}

body.wecom-formal-sidebar .wecom-reply-card {
  grid-area: reply;
}

body.wecom-formal-sidebar .wecom-formal-assist {
  grid-area: assist;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

body.wecom-formal-sidebar .wecom-formal-stack {
  grid-area: stack;
  display: grid;
  gap: 10px;
  min-width: 0;
}

body.wecom-formal-sidebar .wecom-pending-card {
  grid-area: pending;
}

body.wecom-formal-sidebar .wecom-formal-assist > .wecom-formal-card {
  grid-area: auto;
  width: 100%;
}

body.wecom-formal-sidebar .wecom-formal-card {
  min-width: 0;
  scroll-margin-top: 118px;
  padding: 11px;
  border: 1px solid #e5eaf1;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

body.wecom-formal-sidebar .wecom-section-label {
  display: inline-flex;
  margin: 0 0 7px;
  color: #5c708b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

body.wecom-formal-sidebar .wecom-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

body.wecom-formal-sidebar .wecom-card-head.compact {
  margin-bottom: 8px;
}

body.wecom-formal-sidebar .wecom-card-head span,
body.wecom-formal-sidebar .wecom-message-box label,
body.wecom-formal-sidebar .wecom-suggestion-box label {
  display: block;
  color: #5c708b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

body.wecom-formal-sidebar .wecom-card-head h2 {
  margin: 2px 0 0;
  color: #17233c;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.wecom-formal-sidebar .wecom-card-head strong {
  flex: 0 0 auto;
  max-width: 118px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2860a8;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-card-head strong.ok {
  background: #e8f5ff;
  color: #0f72d8;
}

body.wecom-formal-sidebar .wecom-card-head strong.warn {
  background: #fff4e5;
  color: #b76e00;
}

body.wecom-formal-sidebar .wecom-status-line,
body.wecom-formal-sidebar .wecom-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-status-line {
  margin-bottom: 10px;
}

body.wecom-formal-sidebar .wecom-status-line span,
body.wecom-formal-sidebar .wecom-chip-list span {
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f6ff;
  color: #244f87;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

body.wecom-formal-sidebar .wecom-message-box,
body.wecom-formal-sidebar .wecom-suggestion-box {
  margin-top: 0;
  padding: 10px;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #fbfdff;
}

body.wecom-formal-sidebar .wecom-new-message-block {
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
}

body.wecom-formal-sidebar .wecom-new-message-list {
  display: grid;
  gap: 7px;
}

body.wecom-formal-sidebar .wecom-new-message-item,
body.wecom-formal-sidebar .wecom-new-message-empty {
  padding: 9px 10px;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #f8fbff;
}

body.wecom-formal-sidebar .wecom-new-message-item p {
  margin: 0;
  color: #17233c;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

body.wecom-formal-sidebar .wecom-new-message-item small,
body.wecom-formal-sidebar .wecom-new-message-empty {
  color: #6b7d93;
  font-size: 12px;
  line-height: 1.45;
}

body.wecom-formal-sidebar .wecom-new-message-item small {
  display: block;
  margin-top: 5px;
}

body.wecom-formal-sidebar .wecom-message-box p,
body.wecom-formal-sidebar .wecom-suggestion-box p {
  margin: 6px 0 0;
  color: #1f2d3d;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

body.wecom-formal-sidebar .wecom-message-box small {
  display: block;
  margin-top: 6px;
  color: #7a8aa0;
  font-size: 11px;
}

body.wecom-formal-sidebar .wecom-action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

body.wecom-formal-sidebar .wecom-action-row button {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(22, 119, 255, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #244f87;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-action-row button.primary {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
  box-shadow: 0 8px 16px rgba(22, 119, 255, 0.18);
}

body.wecom-formal-sidebar .wecom-profile-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

body.wecom-formal-sidebar .wecom-profile-list div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(31, 62, 102, 0.08);
}

body.wecom-formal-sidebar .wecom-profile-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body.wecom-formal-sidebar .wecom-profile-list dt {
  color: #6b7d93;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-profile-list dd,
body.wecom-formal-sidebar .wecom-profile-list p {
  margin: 0;
  color: #17233c;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.wecom-formal-sidebar .wecom-mini-empty {
  padding: 10px;
  border: 1px dashed #d8e4f2;
  border-radius: 8px;
  background: #fbfdff;
  color: #667891;
  font-size: 12px;
  line-height: 1.55;
}

body.wecom-formal-sidebar .wecom-learning-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

body.wecom-formal-sidebar .wecom-mini-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

body.wecom-formal-sidebar .wecom-mini-title span {
  color: #17233c;
  font-size: 13px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-mini-title em {
  color: #6b7d93;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

body.wecom-formal-sidebar .wecom-learning-block p {
  margin: 0;
  color: #667891;
  font-size: 12px;
  line-height: 1.55;
}

body.wecom-formal-sidebar .wecom-learning-diff {
  display: grid;
  gap: 5px;
  margin: 0 0 8px;
}

body.wecom-formal-sidebar .wecom-learning-diff small {
  color: #6b7c90;
  font-size: 11px;
  font-weight: 800;
}

body.wecom-formal-sidebar .wecom-learning-diff p {
  padding: 7px 8px;
  border: 1px solid #e1eaf5;
  border-radius: 7px;
  background: #f8fbff;
  color: #1f2d3d;
  white-space: pre-wrap;
}

body.wecom-formal-sidebar .wecom-learning-block ul {
  margin: 8px 0 0;
  padding-left: 16px;
  color: #36506c;
  font-size: 12px;
  line-height: 1.55;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid #d7e5fb;
  border-radius: 8px;
  background: #f6faff;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini.personal {
  border-color: #d8ecdf;
  background: #fbfffc;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini.company {
  border-color: #d7e8ff;
  background: #f8fbff;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini.risk {
  border-color: #ffe1cc;
  background: #fffaf5;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini strong {
  color: #17233c;
  font-size: 12px;
  line-height: 1.45;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini small {
  color: #667891;
  font-size: 11px;
  line-height: 1.45;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini div {
  display: flex;
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #d7e5fb;
  border-radius: 6px;
  background: #fff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-rule-candidate-mini button.is-busy,
.rule-actions button.is-busy {
  color: #6b7c90;
  background: #f4f7fb;
}

body.wecom-formal-sidebar .wecom-pending-list {
  display: grid;
  gap: 8px;
}

body.wecom-formal-sidebar .wecom-pending-list button {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(31, 62, 102, 0.08);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

body.wecom-formal-sidebar .wecom-pending-list button.active {
  border-color: rgba(22, 119, 255, 0.35);
  background: #f2f7ff;
}

body.wecom-formal-sidebar .wecom-pending-list strong,
body.wecom-formal-sidebar .wecom-pending-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-pending-list strong {
  color: #17233c;
  font-size: 13px;
}

body.wecom-formal-sidebar .wecom-pending-list small {
  margin-top: 3px;
  color: #667891;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-pending-list em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #65758d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-pending-list em.pending {
  background: #e8f3ff;
  color: #1677ff;
}

body.wecom-formal-sidebar .wecom-selected-task {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f3ff;
  color: #1677ff;
  font-size: 11px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-action-task-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

body.wecom-formal-sidebar .wecom-action-task-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(31, 62, 102, 0.08);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

body.wecom-formal-sidebar .wecom-action-task-list button.active {
  border-color: rgba(22, 119, 255, 0.42);
  background: linear-gradient(180deg, #f1f7ff, #ffffff);
  box-shadow: inset 3px 0 0 #1677ff;
}

body.wecom-formal-sidebar .wecom-action-task-list span {
  color: #17233c;
  font-size: 13px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-action-task-list small {
  color: #667891;
  font-size: 12px;
  line-height: 1.45;
}

body.wecom-formal-sidebar .wecom-reminder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-bottom: 10px;
}

body.wecom-formal-sidebar .wecom-task-queue-view {
  display: grid;
  gap: 10px;
}

body.wecom-formal-sidebar .wecom-queue-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

body.wecom-formal-sidebar .wecom-queue-topline strong {
  min-width: 0;
  color: #17233c;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-queue-topline small {
  min-width: 0;
  color: #667891;
  font-size: 12px;
  line-height: 1.35;
}

body.wecom-formal-sidebar .wecom-queue-topline button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d7e5fb;
  border-radius: 6px;
  background: #f5f9ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-reminder-form input {
  min-width: 0;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #dbe6f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #17233c;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-reminder-form button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(22, 119, 255, 0.22);
  border-radius: 8px;
  background: #eef6ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-task-list {
  display: grid;
  gap: 8px;
}

body.wecom-formal-sidebar .wecom-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(31, 62, 102, 0.08);
  border-radius: 9px;
  background: #fff;
}

body.wecom-formal-sidebar .wecom-task-row.active {
  border-color: rgba(22, 119, 255, 0.38);
  background: #f2f7ff;
}

body.wecom-formal-sidebar .wecom-task-row > button:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

body.wecom-formal-sidebar .wecom-task-row strong,
body.wecom-formal-sidebar .wecom-task-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-task-row strong {
  color: #17233c;
  font-size: 13px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-task-row small {
  color: #667891;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-task-row em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #65758d;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-task-row em.high {
  background: #e8f3ff;
  color: #1677ff;
}

body.wecom-formal-sidebar .wecom-task-delete {
  min-width: 28px;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid #e4e9f0;
  border-radius: 7px;
  background: #fff;
  color: #7a8797;
  font-size: 11px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-runtime-card {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 14px rgba(31, 62, 102, 0.04);
}

body.wecom-formal-sidebar .wecom-runtime-list {
  display: grid;
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-runtime-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f7fbff;
}

body.wecom-formal-sidebar .wecom-runtime-list span {
  color: #5c708b;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-runtime-list em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #65758d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-runtime-list em.ready {
  background: #e8f5ff;
  color: #0f72d8;
}

body.wecom-formal-sidebar .wecom-runtime-list em.pending {
  background: #eef5ff;
  color: #2860a8;
}

body.wecom-formal-sidebar .wecom-runtime-list em.missing {
  background: #fff4e5;
  color: #b76e00;
}

body.wecom-formal-sidebar .wecom-runtime-next {
  margin: 8px 0 0;
  color: #667891;
  font-size: 12px;
  line-height: 1.5;
}

body.wecom-formal-sidebar .wecom-runtime-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

body.wecom-formal-sidebar .wecom-runtime-actions button,
body.wecom-formal-sidebar .wecom-runtime-actions a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 8px;
  background: #f7fbff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

body.wecom-formal-sidebar .wecom-reply-card {
  border-color: #cfe1ff;
  box-shadow: none;
}

body.wecom-formal-sidebar .wecom-input-label,
body.wecom-formal-sidebar .wecom-context-section > label {
  display: block;
  margin: 8px 0 6px;
  color: #5c708b;
  font-size: 11px;
  font-weight: 800;
}

body.wecom-formal-sidebar .wecom-formal-input {
  width: 100%;
  min-height: 86px;
  max-height: 160px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 8px;
  background: #fbfdff;
  color: #17233c;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
}

body.wecom-formal-sidebar .wecom-formal-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

body.wecom-formal-sidebar .wecom-main-suggestion {
  min-height: 112px;
  background: #fbfdff;
}

body.wecom-formal-sidebar .wecom-formal-draft-list {
  display: grid;
  gap: 8px;
  margin-top: 7px;
}

body.wecom-formal-sidebar .wecom-formal-draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 9px;
  border: 1px solid #dfeafa;
  border-radius: 10px;
  background: #fff;
}

body.wecom-formal-sidebar .wecom-formal-draft-row textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid rgba(22, 119, 255, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: #17233c;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
}

body.wecom-formal-sidebar .wecom-formal-draft-row textarea:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.08);
}

body.wecom-formal-sidebar .wecom-formal-draft-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) 42px;
  gap: 7px;
}

body.wecom-formal-sidebar .wecom-formal-draft-actions button {
  min-width: 0;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #244f87;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-formal-draft-actions button.primary {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
  box-shadow: 0 7px 14px rgba(22, 119, 255, 0.14);
}

body.wecom-formal-sidebar .wecom-formal-draft-actions button:disabled {
  border-color: #e4eaf1;
  background: #f5f7fa;
  color: #a0acbb;
  box-shadow: none;
}

body.wecom-formal-sidebar .wecom-formal-delay {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(22, 119, 255, 0.12);
  border-radius: 8px;
  background: #f7fbff;
}

body.wecom-formal-sidebar .wecom-formal-delay label,
body.wecom-formal-sidebar .wecom-formal-delay span {
  color: #5c708b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

body.wecom-formal-sidebar .wecom-formal-delay input {
  width: 100%;
  height: 26px;
  padding: 0 6px;
  border: 1px solid rgba(22, 119, 255, 0.14);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-formal-delay button {
  min-height: 24px;
  padding: 0;
  border-radius: 6px;
  font-size: 11px;
}

body.wecom-formal-sidebar .wecom-empty-suggestion {
  margin: 0;
  color: #66788f;
  font-size: 13px;
  line-height: 1.6;
}

body.wecom-formal-sidebar .wecom-reply-group {
  display: grid;
  gap: 9px;
}

body.wecom-formal-sidebar .wecom-reply-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

body.wecom-formal-sidebar .wecom-reply-group-head strong {
  display: block;
  color: #17233c;
  font-size: 13px;
  line-height: 1.25;
}

body.wecom-formal-sidebar .wecom-reply-group-head span {
  display: block;
  margin-top: 2px;
  color: #667891;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-reply-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  padding: 2px;
  border-radius: 8px;
  background: #edf4ff;
}

body.wecom-formal-sidebar .wecom-reply-mode-switch button {
  min-height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #31577f;
  font-size: 12px;
  font-weight: 850;
}

body.wecom-formal-sidebar .wecom-reply-mode-switch button.active {
  background: #fff;
  color: #1677ff;
  box-shadow: 0 2px 8px rgba(31, 62, 102, 0.08);
}

body.wecom-formal-sidebar .wecom-reply-segment-list {
  display: grid;
  gap: 8px;
}

body.wecom-formal-sidebar .wecom-reply-segment {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid #dce9fb;
  border-radius: 10px;
  background: #fff;
}

body.wecom-formal-sidebar .wecom-reply-segment.stale {
  opacity: 0.68;
}

body.wecom-formal-sidebar .wecom-segment-index {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf4ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

body.wecom-formal-sidebar .wecom-reply-segment textarea {
  min-height: 72px;
  grid-column: 2;
  width: 100%;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid rgba(22, 119, 255, 0.16);
  border-radius: 8px;
  background: #fbfdff;
  color: #17233c;
  font-size: 13px;
  line-height: 1.58;
  outline: none;
}

body.wecom-formal-sidebar .wecom-reply-segment textarea:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.08);
}

body.wecom-formal-sidebar .wecom-segment-actions {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 42px;
  gap: 7px;
}

body.wecom-formal-sidebar .wecom-segment-actions button,
body.wecom-formal-sidebar .wecom-reply-tune-row button,
body.wecom-formal-sidebar .wecom-custom-tune button,
body.wecom-formal-sidebar .wecom-style-save-row button {
  min-height: 30px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #244f87;
  font-size: 12px;
  font-weight: 850;
}

body.wecom-formal-sidebar .wecom-segment-actions button.primary {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

body.wecom-formal-sidebar .wecom-segment-actions button:disabled,
body.wecom-formal-sidebar .wecom-reply-tune-row button:disabled {
  border-color: #e4eaf1;
  background: #f5f7fa;
  color: #a0acbb;
}

body.wecom-formal-sidebar .wecom-reply-tune-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-custom-tune {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 7px;
}

body.wecom-formal-sidebar .wecom-custom-tune input {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(22, 119, 255, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #17233c;
  font-size: 12px;
  outline: none;
}

body.wecom-formal-sidebar .wecom-style-save-row,
body.wecom-formal-sidebar .wecom-next-action-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #667891;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-record-sent-row button {
  width: 100%;
  min-height: 32px;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #244f87;
  font-size: 12px;
  font-weight: 850;
}

body.wecom-formal-sidebar .wecom-record-sent-row button:hover {
  border-color: #1677ff;
  background: #eef6ff;
  color: #1677ff;
}

body.wecom-formal-sidebar .wecom-style-save-row button.active {
  border-color: #1677ff;
  background: #edf4ff;
  color: #1677ff;
}

body.wecom-formal-sidebar .wecom-next-action-inline {
  padding: 8px 9px;
  border: 1px solid #e1ecfb;
  border-radius: 8px;
  background: #f8fbff;
}

body.wecom-formal-sidebar .wecom-next-action-inline strong {
  min-width: 0;
  color: #17233c;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-fold-detail {
  border: 1px solid #e5eaf1;
  border-radius: 8px;
  background: #fff;
}

body.wecom-formal-sidebar .wecom-fold-detail summary {
  padding: 8px 9px;
  color: #31577f;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

body.wecom-formal-sidebar .wecom-reply-basis {
  margin: 0;
  padding: 0 10px 9px 24px;
  color: #667891;
  font-size: 12px;
  line-height: 1.55;
}

body.wecom-formal-sidebar .wecom-reply-all-filled {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #dce9fb;
  border-radius: 10px;
  background: #f8fbff;
  color: #667891;
  font-size: 12px;
}

body.wecom-formal-sidebar .wecom-reply-all-filled strong {
  color: #1677ff;
  font-size: 13px;
}

body.wecom-formal-sidebar .wecom-generate-row {
  grid-template-columns: 1fr;
  margin-top: 8px;
}

body.wecom-formal-sidebar .wecom-final-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.wecom-formal-sidebar .wecom-intent-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #d7e7ff;
  border-radius: 8px;
  background: #f5f9ff;
}

body.wecom-formal-sidebar .wecom-intent-strip strong {
  color: #1677ff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-intent-strip span {
  min-width: 0;
  color: #17233c;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-intent-strip {
  display: none !important;
}

body.wecom-formal-sidebar .wecom-assist-card .wecom-chip-list {
  margin-top: 8px;
}

body.wecom-formal-sidebar .wecom-action-summary {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

body.wecom-formal-sidebar .wecom-action-summary div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f7fbff;
}

body.wecom-formal-sidebar .wecom-action-summary span {
  color: #6b7d93;
  font-size: 12px;
  font-weight: 800;
}

body.wecom-formal-sidebar .wecom-action-summary strong {
  min-width: 0;
  color: #17233c;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.wecom-formal-sidebar .wecom-header-intent-row.group {
  grid-template-columns: auto minmax(64px, 1fr);
}

body.wecom-formal-sidebar .wecom-group-workbench {
  align-items: start;
}

body.wecom-formal-sidebar .wecom-group-message-list {
  display: grid;
  gap: 8px;
}

body.wecom-formal-sidebar .wecom-group-message {
  padding: 9px 10px;
  border: 1px solid #d8e8ff;
  border-radius: 8px;
  background: #f7fbff;
}

body.wecom-formal-sidebar .wecom-group-message.from-staff {
  background: #f3f8ff;
}

body.wecom-formal-sidebar .wecom-group-message > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

body.wecom-formal-sidebar .wecom-group-speaker {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

body.wecom-formal-sidebar .wecom-group-message strong {
  min-width: 0;
  overflow: hidden;
  color: #1d2f4f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-group-message em,
body.wecom-formal-sidebar .wecom-group-member-list em {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  line-height: 1.5;
}

body.wecom-formal-sidebar .wecom-group-message em.internal,
body.wecom-formal-sidebar .wecom-group-member-list em.internal {
  background: #e8f1ff;
  color: #1d5fc4;
}

body.wecom-formal-sidebar .wecom-group-message em.external,
body.wecom-formal-sidebar .wecom-group-member-list em.external {
  background: #e9f8f0;
  color: #14804a;
}

body.wecom-formal-sidebar .wecom-group-message time {
  flex: 0 0 auto;
  color: #6b7890;
  font-size: 11px;
}

body.wecom-formal-sidebar .wecom-group-message p,
body.wecom-formal-sidebar .wecom-muted-line {
  margin: 0;
  color: #344055;
  font-size: 12px;
  line-height: 1.55;
}

body.wecom-formal-sidebar .wecom-group-member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-group-member-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef5ff;
  color: #1d5fc4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.wecom-formal-sidebar .wecom-action-row button:disabled {
  cursor: not-allowed;
  border-color: rgba(31, 62, 102, 0.08);
  background: #f4f7fb;
  color: #9aa8b8;
  box-shadow: none;
}

body.wecom-formal-sidebar .wecom-context-section {
  margin-top: 10px;
}

body.wecom-formal-sidebar .composer {
  display: none !important;
}

body.wecom-formal-sidebar .inspector {
  display: none !important;
}

body.wecom-formal-sidebar .workbench {
  padding: 0 14px 14px;
}

body.wecom-formal-sidebar .workbench > :not(.draft-panel) {
  display: none !important;
}

body.wecom-formal-sidebar .draft-panel {
  display: none !important;
}

body.wecom-formal-sidebar .draft-panel.wecom-draft-editing {
  display: block !important;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid rgba(22, 119, 255, 0.12);
  background: rgba(255, 255, 255, 0.98);
}

body.wecom-formal-sidebar .draft-panel.wecom-draft-editing .draft-head h2,
body.wecom-formal-sidebar .draft-panel.wecom-draft-editing .draft-head p {
  color: #17233c;
}

body.wecom-formal-sidebar .draft-panel.wecom-draft-editing .auto-send-bar,
body.wecom-formal-sidebar .draft-panel.wecom-draft-editing #autoSendBtn,
body.wecom-formal-sidebar .draft-panel.wecom-draft-editing #autoSendSeconds,
body.wecom-formal-sidebar .draft-panel.wecom-draft-editing #autoSendStatus {
  display: none !important;
}

@media (min-width: 900px) {
  body.wecom-formal-sidebar .wecom-formal-grid {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.28fr) minmax(250px, 0.9fr);
    grid-template-areas: "context reply assist";
  }
}

@media (max-width: 519px) {
  body.wecom-formal-sidebar .wecom-formal-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "reply"
      "context"
      "assist";
  }

  body.wecom-formal-sidebar .wecom-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-formal-grid {
  grid-template-columns: 1fr;
  grid-template-areas:
    "reply"
    "context"
    "assist";
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="two"] .wecom-formal-grid {
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
  grid-template-areas:
    "reply context"
    "reply assist";
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="three"] .wecom-formal-grid {
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.2fr) minmax(220px, 0.94fr);
  grid-template-areas: "context reply assist";
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-action-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-formal-draft-row {
  grid-template-columns: minmax(0, 1fr);
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-formal-draft-actions {
  grid-template-columns: 1fr 0.72fr 40px;
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-formal-delay {
  grid-template-columns: auto 64px auto 42px;
  align-items: center;
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-task-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-task-row em,
body.wecom-formal-sidebar .wecom-formal-panel[data-layout="one"] .wecom-task-delete {
  justify-self: start;
}

@container wecom-formal-panel (max-width: 429px) {
  body.wecom-formal-sidebar .wecom-header-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.wecom-formal-sidebar .wecom-formal-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "reply"
      "context"
      "assist";
  }

  body.wecom-formal-sidebar .wecom-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.wecom-formal-sidebar .wecom-formal-draft-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body.wecom-formal-sidebar .wecom-formal-draft-actions {
    grid-template-columns: 1fr 0.72fr 40px;
  }

  body.wecom-formal-sidebar .wecom-formal-delay {
    grid-template-columns: auto 64px auto 42px;
    align-items: center;
  }
}

@container wecom-formal-panel (min-width: 430px) and (max-width: 959px) {
  body.wecom-formal-sidebar .wecom-formal-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    grid-template-areas:
      "reply context"
      "reply assist";
  }
}

@container wecom-formal-panel (min-width: 960px) {
  body.wecom-formal-sidebar .wecom-formal-grid {
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.2fr) minmax(220px, 0.94fr);
    grid-template-areas: "context reply assist";
  }
}

@media (max-width: 420px) {
  body.wecom-formal-sidebar {
    min-width: 0;
  }

  body.wecom-formal-sidebar .app-shell {
    width: 100vw;
    overflow-x: hidden;
  }

  body.wecom-formal-sidebar .wecom-sidebar-head,
  body.wecom-formal-sidebar .wecom-formal-panel,
  body.wecom-formal-sidebar .workbench {
    padding-left: 8px;
    padding-right: 8px;
  }

  body.wecom-formal-sidebar .wecom-decision-panel {
    margin-left: 8px;
    margin-right: 8px;
  }

  body.wecom-formal-sidebar .wecom-formal-card {
    max-width: 100%;
    padding: 10px;
    overflow: hidden;
  }

  body.wecom-formal-sidebar .wecom-formal-header-tags span {
    max-width: calc(100vw - 20px);
  }

  body.wecom-formal-sidebar .wecom-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.wecom-formal-sidebar .wecom-action-row {
    gap: 7px;
  }

  body.wecom-formal-sidebar .wecom-action-row button {
    padding-left: 6px;
    padding-right: 6px;
  }

  body.wecom-formal-sidebar .wecom-task-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  body.wecom-formal-sidebar .wecom-task-row em,
  body.wecom-formal-sidebar .wecom-task-delete {
    justify-self: start;
  }
}

body.wecom-demo-sidebar #confirmBtn,
body.wecom-demo-sidebar #noReplyBtn,
body.wecom-demo-sidebar #proactiveBtn {
  display: inline-flex !important;
  order: initial;
  grid-column: auto;
  align-items: center;
  justify-content: center;
}

body.wecom-demo-sidebar #reportBtn {
  display: none !important;
}

body.wecom-demo-sidebar #middleResize,
body.wecom-demo-sidebar #rightResize {
  position: relative;
  z-index: 25;
}

body.wecom-demo-sidebar #middleResize::before,
body.wecom-demo-sidebar #rightResize::before {
  content: "";
  position: absolute;
  inset: 0 -4px;
}

body.wecom-demo-sidebar #middleResize:hover,
body.wecom-demo-sidebar #rightResize:hover,
body.wecom-demo-sidebar.is-resizing #middleResize,
body.wecom-demo-sidebar.is-resizing #rightResize {
  background: #b8cdf2;
}

body.wecom-demo-sidebar .conversation-topbar {
  min-height: 48px;
  grid-template-columns: minmax(64px, 76px) minmax(118px, 132px) minmax(112px, 128px) minmax(48px, auto);
  gap: 8px;
  padding: 8px 16px 8px 12px;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-title h1 {
  font-size: 17px;
  line-height: 22px;
}

body.wecom-demo-sidebar .wecom-demo-customer-bar select,
body.wecom-demo-sidebar .wecom-demo-customer-bar input {
  height: 30px;
  padding: 0 9px;
  border-color: #cfd8e6;
  border-radius: 5px;
  font-size: 12px;
}

body.wecom-demo-sidebar .wecom-demo-customer-bar .demo-new-contact {
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 5px;
}

body.wecom-demo-sidebar .wecom-demo-customer-bar .demo-new-contact button {
  display: grid;
  place-items: center;
  min-width: 28px !important;
  width: 28px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 5px;
  line-height: 1;
  font-size: 15px;
}

body.wecom-demo-sidebar .conversation-topbar .topbar-actions {
  justify-self: end;
  margin-left: 4px;
}

body.wecom-demo-sidebar .conversation-topbar #clearContactBtn {
  min-width: 44px;
  height: 30px;
  min-height: 30px;
  margin-right: 2px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
}

body.wecom-demo-sidebar .composer-actions-main,
body.wecom-demo-sidebar .draft-panel > .composer-actions {
  gap: 8px;
}

body.wecom-demo-sidebar .composer-actions-main {
  grid-template-columns: 1fr !important;
}

body.wecom-demo-sidebar .composer-actions-main .primary,
body.wecom-demo-sidebar #confirmBtn {
  min-height: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

body.wecom-demo-sidebar .draft-panel > .composer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.wecom-demo-sidebar #confirmBtn {
  order: -1;
  grid-column: 1 / -1;
}

body.wecom-demo-sidebar #noReplyBtn,
body.wecom-demo-sidebar #proactiveBtn {
  min-height: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

body.wecom-demo-sidebar .draft-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

body.wecom-demo-sidebar .draft-head p {
  margin-top: 2px;
}

body.wecom-demo-sidebar .draft-tools {
  justify-self: end;
  align-self: start;
  margin-top: 0;
}

body.wecom-demo-sidebar .manual-only-pill {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

body.wecom-demo-sidebar .inspector {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 14px 10px;
  gap: 10px;
  scrollbar-gutter: stable;
}

body.wecom-demo-sidebar .inspector section,
body.wecom-demo-sidebar .inspector-core:nth-of-type(2),
body.wecom-demo-sidebar .inspector-core:nth-of-type(3) {
  max-height: none !important;
  overflow: visible !important;
}

body.wecom-demo-sidebar .inspector dl,
body.wecom-demo-sidebar .inspector .intent-view,
body.wecom-demo-sidebar .inspector .report-view,
body.wecom-demo-sidebar .inspector .route-view {
  max-height: none !important;
  overflow: visible !important;
}

body.wecom-demo-sidebar .side-secondary.wecom-demo-sales-review {
  display: block !important;
}

body.wecom-demo-sidebar .wecom-demo-sales-review {
  order: 8;
}

body.wecom-demo-sidebar .wecom-demo-sales-review .inspector-inline-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

body.wecom-demo-sidebar .wecom-demo-sales-review .inspector-inline-head p {
  display: none;
}

body.wecom-demo-sidebar .wecom-demo-sales-review .sales-action-group {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}

body.wecom-demo-sidebar .wecom-demo-sales-review .mini-btn {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
}

body.wecom-demo-sidebar .wecom-demo-sales-review .sales-review-panel {
  max-height: none;
  overflow: visible;
}

body.wecom-demo-sidebar .draft-message-row {
  grid-template-columns: minmax(0, 1fr) 88px !important;
  gap: 7px;
}

body.wecom-demo-sidebar .draft-message-row .delay-box {
  display: block !important;
  min-width: 0;
  padding: 6px;
  border-color: #dbe6f7;
  border-radius: 6px;
  background: #f7fbff;
}

body.wecom-demo-sidebar .draft-message-row .delay-box label {
  margin-bottom: 5px;
  color: #596575;
  font-size: 10px;
  line-height: 1.2;
}

body.wecom-demo-sidebar .draft-message-row .delay-box input {
  display: block !important;
  width: 100%;
  height: 26px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 12px;
}

body.wecom-demo-sidebar .draft-message-row .draft-delete {
  min-height: 24px;
  margin-top: 5px;
  border-radius: 5px;
  font-size: 11px;
}

body.wecom-demo-sidebar #activeRulesView {
  display: flex !important;
  min-height: 0;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #dbe6f7;
  border-radius: 6px;
  background: #f7fbff;
  font-size: 12px;
}

body.wecom-demo-sidebar .compare-panel {
  display: block !important;
  border-radius: 8px;
  border-color: #dedede;
  background: #fff;
  box-shadow: none;
}

body.wecom-demo-sidebar .compare-panel .draft-head {
  margin-bottom: 8px;
}

body.wecom-demo-sidebar .compare-panel .draft-head h2 {
  font-size: 15px;
}

body.wecom-demo-sidebar .compare-panel .draft-head p {
  font-size: 12px;
}

body.wecom-demo-sidebar .compare-panel .learning-actions {
  display: flex;
  justify-content: flex-end;
}

body.wecom-demo-sidebar .turn-compare {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

body.wecom-demo-sidebar .turn-card {
  border-radius: 8px;
  box-shadow: none;
}

body.wecom-demo-sidebar .turn-grid {
  gap: 6px;
}

body.wecom-demo-sidebar .turn-block {
  max-height: 118px;
  border-radius: 6px;
  font-size: 11px;
}

body.wecom-demo-sidebar .turn-correction,
body.wecom-demo-sidebar .turn-rule-box {
  border-radius: 6px;
  font-size: 11px;
}

body.admin-console-mode {
  --admin-blue: #1769e0;
  --admin-blue-deep: #0f4fb2;
  --admin-ink: #172033;
  --admin-muted: #667085;
  --admin-line: #dbe4f0;
  --admin-soft: #f2f7ff;
  background: #eef3f9;
  color: var(--admin-ink);
}

body.admin-console-mode .app-shell {
  display: none;
}

.admin-console {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  background: #eef3f9;
}

.admin-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--admin-line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-brand {
  padding: 8px 8px 14px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0;
}

.admin-brand span {
  display: block;
  margin-top: 4px;
  color: var(--admin-muted);
}

.admin-nav nav {
  display: grid;
  gap: 6px;
}

.admin-nav a,
.admin-side-link {
  color: var(--admin-ink);
  text-decoration: none;
}

.admin-nav nav a,
.admin-side-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 7px;
}

.admin-nav nav a:hover,
.admin-side-link:hover {
  background: var(--admin-soft);
  color: var(--admin-blue);
}

.admin-role-box {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.admin-role-box small {
  color: var(--admin-muted);
}

.admin-role-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #f7f9fc;
}

.admin-role-switch button {
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
}

.admin-role-switch button.active {
  background: var(--admin-blue);
  color: #fff;
}

.admin-role-switch button:disabled {
  color: #9aa8b8;
  cursor: not-allowed;
}

.admin-account-box {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #f7faff;
}

.admin-account-box small,
.admin-account-box span {
  color: var(--admin-muted);
}

.admin-account-box strong {
  min-width: 0;
  overflow: hidden;
  color: var(--admin-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main {
  min-width: 0;
  padding: 20px 24px 40px;
  overflow: auto;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: linear-gradient(120deg, #ffffff 0%, #f4f8ff 68%, #edf7f0 100%);
}

.admin-hero small,
.admin-section-head small {
  display: block;
  color: var(--admin-blue);
  font-weight: 700;
}

.admin-hero h1,
.admin-section-head h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.admin-hero h1 {
  font-size: 26px;
}

.admin-hero p {
  margin: 8px 0 0;
  color: var(--admin-muted);
  line-height: 1.6;
}

.admin-hero-actions,
.admin-section-actions,
.admin-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-hero-actions {
  justify-content: flex-end;
}

.admin-console button.primary,
.admin-console .primary {
  border-color: var(--admin-blue);
  background: var(--admin-blue);
}

.admin-console button.primary:hover,
.admin-console .primary:hover {
  border-color: var(--admin-blue-deep);
  background: var(--admin-blue-deep);
}

.admin-content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.admin-section {
  display: grid;
  gap: 12px;
  scroll-margin-top: 16px;
}

.admin-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-head > span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--admin-blue);
  font-weight: 700;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric-grid article,
.admin-card {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 45, 76, 0.06);
}

.admin-metric-grid article {
  padding: 14px;
}

.admin-metric-grid small,
.admin-card h3 + p,
.admin-card p,
.admin-task-item span,
.admin-customer-item small {
  color: var(--admin-muted);
}

.admin-metric-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
}

.admin-metric-grid span {
  display: block;
  margin-top: 8px;
  color: var(--admin-muted);
}

.admin-metric-grid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-metric-grid.compact article {
  padding: 12px;
}

.admin-metric-grid.compact strong {
  font-size: 22px;
}

.admin-saas-model-card {
  margin-top: 12px;
}

.admin-saas-diagnostics-card {
  margin-top: 12px;
}

.admin-billing-metrics strong {
  font-size: 24px;
}

.admin-ai-provider-secret-card {
  display: grid;
  gap: 12px;
}

.admin-ai-provider-secret-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1.3fr);
  gap: 10px;
}

.admin-ai-provider-secret-form label {
  display: grid;
  gap: 6px;
}

.admin-ai-provider-secret-form span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-ai-provider-secret-form select,
.admin-ai-provider-secret-form input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  background: #fff;
  color: var(--admin-ink);
}

.admin-ai-provider-secret-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-ai-provider-secret-status.configured {
  background: #e7f7ee;
  color: #087b47;
}

.admin-ai-provider-secret-status.missing,
.admin-ai-provider-secret-status.loading {
  background: #fff7e6;
  color: #9a5b00;
}

.admin-ai-provider-secret-status.blocked {
  background: #f4f6f9;
  color: var(--admin-muted);
}

.admin-model-policy-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.admin-model-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-model-route-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 45, 76, 0.05);
}

.admin-model-route-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-model-route-head strong,
.admin-model-route-head span {
  display: block;
}

.admin-model-route-head strong {
  color: var(--admin-text);
  font-size: 16px;
}

.admin-model-route-head span,
.admin-model-route-card small,
.admin-model-route-stats span {
  color: var(--admin-muted);
}

.admin-model-route-head em {
  align-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #059669;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-model-route-head em.warn {
  background: #fff7ed;
  color: #c2410c;
}

.admin-model-route-form {
  display: grid;
  grid-template-columns: 0.72fr 1.3fr 0.72fr;
  gap: 8px;
}

.admin-model-route-form label {
  display: grid;
  gap: 5px;
}

.admin-model-route-form span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-model-route-form input,
.admin-model-route-form select {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--admin-text);
}

.admin-model-route-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-model-route-stats span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f7fb;
  font-size: 12px;
}

.admin-model-route-price {
  padding: 7px 9px;
  border-radius: 8px;
  background: #f7faff;
  color: #52667f;
  font-size: 12px;
  line-height: 1.45;
}

.admin-usage-table-card {
  overflow: hidden;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-usage-table th,
.admin-usage-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--admin-line);
  text-align: left;
  vertical-align: top;
}

.admin-usage-table th {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  background: #f7faff;
}

.admin-usage-table td small {
  display: block;
  margin-top: 3px;
  color: var(--admin-muted);
}

.admin-card-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card-links a,
.admin-card-links button {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--wecom-blue);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.admin-secret-store-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-secret-store-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-secret-store-metrics div {
  padding: 10px;
  border: 1px solid #dfe9f6;
  border-radius: 8px;
  background: #fff;
}

.admin-secret-store-metrics strong {
  display: block;
  color: var(--admin-text);
  font-size: 24px;
  line-height: 1;
}

.admin-secret-store-metrics span {
  display: block;
  margin-top: 5px;
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-secret-store-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-secret-store-slots span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid #dfe9f6;
  border-radius: 8px;
  background: #fff;
}

.admin-secret-store-slots b {
  min-width: 0;
  overflow: hidden;
  color: var(--admin-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-secret-store-slots em {
  color: var(--admin-muted);
  font-size: 12px;
  font-style: normal;
}

.admin-secret-store-slots span.ready {
  border-color: #cfe9dc;
  background: #fbfffd;
}

.admin-secret-store-slots span.ready em {
  color: #078246;
}

.admin-secret-store-slots span.missing {
  border-color: #ffd7d7;
  background: #fffafa;
}

.admin-secret-store-slots span.missing em {
  color: #c0362c;
}

.admin-secret-store-backup {
  padding: 12px;
  border: 1px solid #d7e7ff;
  border-radius: 8px;
  background: #f4f9ff;
}

.admin-secret-store-backup strong {
  color: var(--admin-blue);
}

.admin-secret-store-backup p {
  margin: 6px 0 0;
  color: #26374d;
}

.admin-secret-store-backup ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--admin-muted);
  line-height: 1.55;
}

.admin-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-diagnostic-grid > div {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.admin-diagnostic-grid span,
.admin-diagnostic-grid small {
  display: block;
  color: var(--admin-muted);
}

.admin-diagnostic-grid strong {
  display: block;
  margin: 6px 0;
  color: var(--admin-text);
  font-size: 18px;
}

.admin-diagnostic-grid strong.pass,
.admin-diagnostic-grid strong.ready {
  color: #059669;
}

.admin-diagnostic-grid strong.warn,
.admin-diagnostic-grid strong.pending {
  color: #d97706;
}

.admin-diagnostic-notes {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.admin-diagnostic-notes p {
  margin: 0;
}

.admin-tenant-metrics strong {
  font-size: 24px;
}

.admin-tenant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-tenant-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: #dbe7f7;
}

.admin-tenant-card.ready {
  border-color: #cce9d7;
  background: linear-gradient(180deg, #ffffff 0%, #f6fffa 100%);
}

.admin-tenant-card.pending,
.admin-tenant-card.draft {
  border-color: #f0dfb8;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf1 100%);
}

.admin-tenant-card.missing {
  border-color: #f2c7c7;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
}

.admin-tenant-card.disabled {
  opacity: 0.7;
}

.admin-tenant-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.admin-tenant-head h3 {
  margin: 4px 0;
  font-size: 18px;
}

.admin-tenant-head p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 13px;
}

.admin-tenant-head em {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--admin-blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.admin-tenant-card.ready .admin-tenant-head em {
  background: #e6f8ed;
  color: #047857;
}

.admin-tenant-card.missing .admin-tenant-head em {
  background: #fff0f0;
  color: #b91c1c;
}

.admin-tenant-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.admin-tenant-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7dd3a7 0%, #1677ff 100%);
}

.admin-tenant-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-tenant-dl div {
  min-width: 0;
  padding: 9px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-tenant-dl dt,
.admin-tenant-dl dd {
  margin: 0;
}

.admin-tenant-dl dt {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-tenant-dl dd {
  margin-top: 4px;
  overflow: hidden;
  color: var(--admin-text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tenant-actions-list {
  display: grid;
  gap: 6px;
}

.admin-tenant-actions-list span {
  padding: 8px 10px;
  border: 1px solid #dce9fb;
  border-radius: 8px;
  background: #f8fbff;
  color: #38506d;
  font-size: 13px;
  line-height: 1.45;
}

.admin-ops-metrics strong {
  color: #0f5bd7;
}

.admin-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
}

.admin-ops-pipeline {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-ops-pipeline li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid #dbe7f7;
  border-radius: 8px;
  background: #f8fbff;
}

.admin-ops-pipeline li.ready {
  border-color: #c7ecd7;
  background: #f3fff7;
}

.admin-ops-pipeline li.pending {
  border-color: #d9e6ff;
  background: #f5f9ff;
}

.admin-ops-pipeline li.missing {
  border-color: #ffe3cc;
  background: #fff8f0;
}

.admin-ops-pipeline strong,
.admin-ops-pipeline span {
  display: block;
}

.admin-ops-pipeline strong {
  font-size: 14px;
}

.admin-ops-pipeline span {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-ops-pipeline em {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2764bd;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.admin-ops-pipeline li.ready em {
  background: #e9faef;
  color: #12863b;
}

.admin-ops-pipeline li.missing em {
  background: #fff0e2;
  color: #a54f07;
}

.admin-ops-policy-card p {
  margin: 0 0 10px;
  color: #39506e;
  line-height: 1.65;
}

.admin-ops-lifecycle {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.admin-ops-lifecycle span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px solid #dbe7f7;
  border-radius: 10px;
  background: #f8fbff;
}

.admin-ops-lifecycle span.ready {
  border-color: #c8ecd7;
  background: #f3fff7;
}

.admin-ops-lifecycle span.pending,
.admin-ops-lifecycle span.warn {
  border-color: #d9e6ff;
  background: #f5f9ff;
}

.admin-ops-lifecycle span.missing {
  border-color: #ffe1c7;
  background: #fff8f0;
}

.admin-ops-lifecycle strong {
  color: var(--wecom-blue);
  font-size: 22px;
  line-height: 1;
}

.admin-ops-lifecycle em {
  color: var(--admin-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.admin-ops-auth-section,
.admin-ops-install-card {
  margin-top: 14px;
}

.admin-ops-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-ops-auth-card {
  padding: 13px;
  border: 1px solid #d9e7fb;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.admin-ops-auth-card.ready {
  border-color: #c7e9d4;
}

.admin-ops-auth-card.pending,
.admin-ops-auth-card.warn {
  border-color: #d9e6ff;
}

.admin-ops-auth-card.missing {
  border-color: #ffdcbc;
  background: #fffaf4;
}

.admin-ops-auth-head,
.admin-ops-auth-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-ops-auth-head strong,
.admin-ops-auth-head span {
  display: block;
}

.admin-ops-auth-head strong {
  color: var(--admin-text);
  font-size: 15px;
}

.admin-ops-auth-head span,
.admin-ops-auth-foot small {
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-ops-auth-head em {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2764bd;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.admin-ops-auth-card.ready .admin-ops-auth-head em {
  background: #e7f8ee;
  color: #12863b;
}

.admin-ops-auth-card.missing .admin-ops-auth-head em {
  background: #fff0e2;
  color: #a54f07;
}

.admin-ops-auth-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.admin-ops-auth-meta div {
  padding: 8px;
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.78);
}

.admin-ops-auth-meta dt,
.admin-ops-auth-meta dd {
  margin: 0;
}

.admin-ops-auth-meta dt {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-ops-auth-meta dd {
  margin-top: 3px;
  color: #24364f;
  font-size: 13px;
  font-weight: 700;
}

.admin-ops-auth-error {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff3e6;
  color: #9a4c05;
  font-size: 12px;
  line-height: 1.5;
}

.admin-ops-auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.admin-ops-auth-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d4e5fb;
  border-radius: 8px;
  background: #ffffff;
  color: #185ec9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-ops-auth-actions button:hover {
  border-color: #9fc6ff;
  background: #f3f8ff;
}

.admin-ops-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-ops-role-card {
  padding: 14px;
  border: 1px solid #dce7f7;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.admin-ops-role-card p {
  min-height: 44px;
  margin: 0 0 10px;
  color: #39506e;
  line-height: 1.55;
}

.admin-ops-role-card small {
  display: block;
  margin-top: 10px;
  color: var(--admin-muted);
  line-height: 1.5;
}

.admin-ops-events-grid {
  margin-top: 14px;
}

.admin-launch-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 16px;
  align-items: center;
  border-color: #d9e8ff;
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 119, 255, 0.1), transparent 34%),
    #ffffff;
}

.admin-launch-score {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid #d6e8ff;
  border-radius: 18px;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
  color: var(--wecom-blue);
}

.admin-launch-score strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.admin-launch-score span,
.admin-launch-hero-copy small,
.admin-launch-metrics span,
.admin-launch-item p,
.admin-launch-item small,
.admin-launch-next-list span,
.admin-launch-next-list small,
.admin-launch-phase-head small,
.admin-launch-phase-head p {
  color: var(--admin-muted);
}

.admin-launch-hero-copy h3 {
  margin: 4px 0 6px;
  color: var(--admin-text);
  font-size: 22px;
}

.admin-launch-hero-copy p {
  margin: 0;
  max-width: 720px;
}

.admin-launch-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-launch-metrics span {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2ecfb;
  border-radius: 10px;
  background: #f8fbff;
  font-size: 12px;
}

.admin-launch-metrics b {
  display: block;
  margin-bottom: 2px;
  color: var(--admin-text);
  font-size: 20px;
}

.admin-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-launch-phase {
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: #fff;
}

.admin-launch-phase.ready {
  border-color: #cfe9dc;
}

.admin-launch-phase.pending,
.admin-launch-phase.warn {
  border-color: #f1dfb6;
}

.admin-launch-phase.missing {
  border-color: #ffd1d1;
}

.admin-launch-phase-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-launch-phase-head h3 {
  margin: 2px 0 4px;
  color: var(--admin-text);
  font-size: 16px;
}

.admin-launch-phase-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.admin-launch-phase-head em {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--wecom-blue);
  font-style: normal;
  font-weight: 900;
}

.admin-launch-phase-head em small {
  font-size: 11px;
  font-weight: 700;
  color: #6b7a90;
}

.admin-launch-phase-progress {
  height: 5px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.admin-launch-phase-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f7cff, #35c0a8);
}

.admin-launch-phase ul,
.admin-launch-next-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-launch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfdff;
}

.admin-launch-item strong,
.admin-launch-next-list strong {
  display: block;
  color: var(--admin-text);
  font-size: 13px;
}

.admin-launch-item p,
.admin-launch-item small {
  display: block;
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.admin-launch-item span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--wecom-blue);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-launch-item.ready span {
  background: #e8f8ef;
  color: #078246;
}

.admin-launch-item.pending span,
.admin-launch-item.warn span {
  background: #fff7e6;
  color: #b26a00;
}

.admin-launch-item.missing span {
  background: #fff1f1;
  color: #d93025;
}

.admin-launch-blocker-card {
  border-color: #ffd1d1;
  background: #fffafa;
}

.admin-launch-next-card {
  margin-top: 12px;
}

.admin-launch-next-list li {
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: #fbfdff;
}

.admin-launch-next-list span,
.admin-launch-next-list small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.admin-listing-card {
  display: grid;
  gap: 14px;
}

.admin-listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-listing-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e5edf8;
  background: #fbfdff;
}

.admin-listing-section.ready {
  border-color: #d5eadf;
  background: #fbfffd;
}

.admin-listing-section.pending,
.admin-listing-section.warn {
  border-color: #e4edf9;
}

.admin-listing-section.missing {
  border-color: #f4d1d8;
  background: #fffafb;
}

.admin-launch-next-list strong em {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1769e0;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.admin-delivery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: center;
  border-color: #dbeaff;
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 119, 255, 0.11), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-delivery-hero small,
.admin-delivery-hero p,
.admin-delivery-section-head p,
.admin-delivery-material p,
.admin-delivery-material-head small {
  color: var(--admin-muted);
}

.admin-delivery-hero h3 {
  margin: 4px 0 8px;
  max-width: 760px;
  color: var(--admin-text);
  font-size: 18px;
  line-height: 1.45;
}

.admin-delivery-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-delivery-stats span {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0ebfb;
  border-radius: 12px;
  background: #fff;
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-delivery-stats b {
  display: block;
  margin-bottom: 4px;
  color: var(--wecom-blue);
  font-size: 20px;
  line-height: 1.1;
  word-break: break-all;
}

.admin-delivery-sections {
  display: grid;
  gap: 14px;
}

.admin-delivery-section {
  display: grid;
  gap: 12px;
}

.admin-delivery-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 2px 0;
}

.admin-delivery-section-head h3 {
  margin: 0 0 4px;
  color: var(--admin-text);
  font-size: 17px;
}

.admin-delivery-section-head p {
  margin: 0;
  line-height: 1.5;
}

.admin-delivery-section-head span {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--wecom-blue);
  font-size: 12px;
  font-weight: 900;
}

.admin-delivery-material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-delivery-material {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dfe9f7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 54, 96, 0.04);
}

.admin-delivery-material-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.admin-delivery-material-head h3 {
  margin: 2px 0 0;
  color: var(--admin-text);
  font-size: 15px;
}

.admin-delivery-material-head button {
  flex: 0 0 auto;
}

.admin-delivery-material p {
  margin: 0;
  line-height: 1.5;
}

.admin-delivery-material pre {
  max-height: 220px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #e6eef9;
  border-radius: 10px;
  background: #f8fbff;
  color: #26374f;
  font: 13px/1.7 "Microsoft YaHei", Arial, sans-serif;
  white-space: pre-wrap;
}

.admin-delivery-material-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-delivery-material-foot span,
.admin-delivery-material-foot em {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0f6ff;
  color: #1769e0;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-delivery-material-foot span {
  background: #f4f6f9;
  color: var(--admin-muted);
}

.admin-delivery-caution {
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff7e6;
  color: #9a5b00;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .admin-diagnostic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-model-route-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-launch-hero-card,
  .admin-launch-grid,
  .admin-listing-grid,
  .admin-delivery-hero,
  .admin-delivery-material-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .admin-diagnostic-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-ai-provider-secret-form,
  .admin-model-route-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-muted {
  margin: 12px 0 0;
  color: var(--admin-muted);
}

.admin-two-col,
.admin-dashboard-grid,
.admin-analyzer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.admin-dashboard-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr) minmax(260px, 0.9fr);
}

.admin-three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-card {
  padding: 14px;
  min-width: 0;
}

.admin-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.admin-card p {
  margin: 8px 0;
  line-height: 1.65;
}

.admin-card-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.admin-card-head h3 {
  margin: 0;
}

.admin-task-list,
.admin-customer-list {
  display: grid;
  gap: 8px;
}

.admin-task-item,
.admin-customer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid #e4ebf5;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-task-item.active {
  border-color: #9fc5ff;
  background: #f2f7ff;
  box-shadow: inset 3px 0 0 var(--admin-blue);
}

.admin-task-item button,
.admin-customer-item button {
  display: grid;
  gap: 3px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.admin-task-item em,
.admin-customer-item em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--admin-blue);
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.admin-detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-detail-title small {
  display: block;
  color: var(--admin-muted);
}

.admin-detail-title h3 {
  margin: 3px 0 0;
}

.admin-detail-title > span,
.admin-card-head > span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--admin-blue);
  font-weight: 700;
  white-space: nowrap;
}

.admin-task-detail-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.admin-task-detail-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf1f6;
}

.admin-task-detail-list dt {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-task-detail-list dd {
  margin: 0;
  line-height: 1.65;
}

.admin-task-detail-list dd span {
  display: inline-flex;
  margin: 0 5px 5px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f6ff;
  color: #215998;
}

.admin-detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.admin-detail-actions button,
.admin-detail-actions a {
  min-width: 0;
}

.admin-detail-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  background: #fff;
  color: var(--admin-blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.admin-section-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  background: #fff;
  color: var(--admin-blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.admin-warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--warning-bg);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}

.admin-customer-item button {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e8f1ff;
  color: var(--admin-blue);
  font-weight: 800;
}

.admin-stage-list,
.admin-health-list,
.admin-message-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-stage-list li,
.admin-health-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f6;
}

.admin-health-list li.ready strong {
  color: #168a46;
}

.admin-health-list li.pending strong {
  color: #b76e00;
}

.admin-customer-detail-card {
  margin-top: 2px;
}

.admin-customer-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
}

.admin-customer-detail-grid section {
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-customer-detail-grid h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.admin-mini-dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.admin-mini-dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #edf1f6;
}

.admin-mini-dl dt {
  color: var(--admin-muted);
}

.admin-mini-dl dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-message-list li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 7px;
  background: #fff;
}

.admin-message-list strong {
  color: var(--admin-blue);
}

.admin-message-list span {
  color: var(--admin-muted);
  line-height: 1.5;
}

.admin-mini-task-list {
  display: grid;
  gap: 8px;
}

.admin-mini-task-list button {
  display: grid;
  gap: 4px;
  height: auto;
  min-height: 48px;
  padding: 8px 10px;
  border-color: #dbe8f8;
  background: #fff;
  text-align: left;
}

.admin-archive-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-archive-card {
  overflow: hidden;
}

.admin-archive-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-archive-filters button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border-color: #dce8f8;
  background: #fff;
  color: #31506f;
  font-size: 12px;
  font-weight: 700;
}

.admin-archive-filters button.active {
  border-color: var(--admin-blue);
  background: #eaf2ff;
  color: var(--admin-blue);
}

.admin-archive-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.admin-archive-search input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.admin-archive-search button {
  height: 34px;
  padding: 0 12px;
}

.admin-archive-table-wrap {
  overflow-x: auto;
  border: 1px solid #e6edf7;
  border-radius: 8px;
  background: #fff;
}

.admin-archive-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-archive-table th,
.admin-archive-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  vertical-align: top;
}

.admin-archive-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fc;
  color: #3d4f66;
  font-weight: 800;
  white-space: nowrap;
}

.admin-archive-table td:first-child {
  width: 96px;
}

.admin-archive-table td:first-child strong,
.admin-archive-table td:first-child span {
  display: block;
}

.admin-archive-table td:first-child span,
.admin-archive-table small {
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-archive-table p {
  margin: 0;
  color: #172033;
  line-height: 1.55;
}

.admin-archive-table em {
  display: inline-flex;
  max-width: 148px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: #425a75;
  font-style: normal;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-archive-table em.group {
  background: #e9f9ef;
  color: #168a46;
}

.admin-archive-table em.private {
  background: #eaf2ff;
  color: var(--admin-blue);
}

.admin-archive-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: #425a75;
  font-weight: 800;
  white-space: nowrap;
}

.admin-archive-status.pending_reply,
.admin-archive-status.suggested,
.admin-archive-status.suggestion_failed {
  background: #fff4df;
  color: #9a5b00;
}

.admin-archive-status.confirmed {
  background: #e9f9ef;
  color: #168a46;
}

.admin-archive-status.archived_only,
.admin-archive-status.context_only {
  background: #eef4fb;
  color: #4d647c;
}

.admin-mini-task-list small {
  color: var(--admin-muted);
  line-height: 1.4;
}

.admin-library-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-library-stats span {
  min-height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--admin-soft);
  color: var(--admin-blue);
  font-size: 22px;
  font-weight: 800;
}

.admin-library-stats small {
  display: block;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 500;
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}

.admin-chip-row span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #215998;
}

.admin-rule-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-rule-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 12px;
}

.admin-rule-guide-card {
  align-self: start;
}

.admin-rule-guide {
  display: grid;
  gap: 10px;
  margin: 0;
}

.admin-rule-guide div {
  padding: 10px;
  border: 1px solid #e4edf8;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-rule-guide dt {
  color: #17233c;
  font-weight: 800;
}

.admin-rule-guide dd {
  margin: 5px 0 0;
  color: var(--admin-muted);
  line-height: 1.55;
}

.admin-rule-priority {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #d9e8ff;
  border-radius: 8px;
  background: #f7fbff;
}

.admin-rule-priority strong,
.admin-rule-priority p {
  display: block;
  margin: 0;
}

.admin-rule-priority strong {
  color: #1668dc;
  font-size: 13px;
}

.admin-rule-priority p {
  margin-top: 5px;
  color: var(--admin-text);
  font-weight: 800;
}

.admin-rule-priority ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: var(--admin-muted);
  line-height: 1.55;
}

.admin-rule-list,
.admin-rule-history {
  display: grid;
  gap: 10px;
}

.admin-rule-history {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-rule-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid #dce8f8;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-rule-card.personal {
  border-color: #d8ecdf;
  background: #fbfffc;
}

.admin-rule-card.company {
  border-color: #d7e8ff;
  background: #f8fbff;
}

.admin-rule-card.risk {
  border-color: #ffe1cc;
  background: #fffaf5;
}

.admin-rule-card.adopted {
  border-color: #d8ecdf;
  background: #fbfffc;
}

.admin-rule-card.ignored {
  opacity: 0.78;
}

.admin-rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-rule-card-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.admin-rule-card-head span,
.admin-rule-card-head strong,
.admin-rule-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--admin-blue);
  font-size: 12px;
  line-height: 1;
}

.admin-rule-card.personal .admin-rule-card-head span {
  background: #e8f8ee;
  color: #14804a;
}

.admin-rule-card.company .admin-rule-card-head span {
  background: #eaf2ff;
  color: #1d5fc4;
}

.admin-rule-card.risk .admin-rule-card-head span {
  background: #fff0e6;
  color: #b85b00;
}

.admin-rule-card-head strong {
  background: #f0f5fb;
  color: #4b627a;
}

.admin-rule-card-head small {
  color: var(--admin-muted);
  white-space: nowrap;
}

.admin-rule-card p {
  margin: 0;
  color: #17233c;
  line-height: 1.62;
}

.admin-rule-evidence {
  display: grid;
  gap: 6px;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
}

.admin-rule-evidence div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.admin-rule-evidence b {
  color: #50657f;
}

.admin-rule-evidence span {
  color: var(--admin-muted);
  line-height: 1.5;
}

.admin-rule-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-rule-meta span {
  background: #f2f6fb;
  color: #52677f;
}

.admin-rule-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-rule-actions button.is-busy {
  color: #6b7c90;
  background: #f4f7fb;
}

.admin-analyzer-grid textarea {
  min-height: 140px;
  margin: 8px 0;
}

.admin-kb-search-card {
  display: grid;
  gap: 10px;
}

.admin-kb-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
}

.admin-kb-search-row input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.admin-kb-results,
.admin-analysis-list {
  display: grid;
  gap: 8px;
}

.admin-kb-hit {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e1ebf7;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-kb-hit div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-kb-hit span,
.admin-analysis-list span {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-kb-hit p {
  margin: 0;
  color: var(--admin-ink);
}

.admin-analysis-list button {
  display: grid;
  gap: 4px;
  height: auto;
  min-height: 54px;
  padding: 10px;
  border-color: #e1ebf7;
  background: #fbfdff;
  text-align: left;
}

.admin-analysis-list button:hover {
  border-color: #9fc5ff;
  background: #f2f7ff;
}

.admin-analyzer-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed #cbd8e8;
  border-radius: 8px;
  color: var(--admin-muted);
  text-align: center;
  line-height: 1.7;
}

.admin-analyzer-result,
.admin-config-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.admin-analyzer-result div,
.admin-config-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f6;
}

.admin-analyzer-result dt,
.admin-config-list dt {
  color: var(--admin-muted);
}

.admin-analyzer-result dd,
.admin-config-list dd {
  margin: 0;
  line-height: 1.6;
}

.admin-analyzer-result dd span {
  display: inline-flex;
  margin: 0 5px 5px 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: #215998;
}

.admin-analyzer-result dd p {
  margin: 0 0 4px;
}

.admin-analyzer-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.admin-empty {
  padding: 18px;
  border: 1px dashed #cbd8e8;
  border-radius: 8px;
  color: var(--admin-muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .admin-console {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
    height: auto;
  }

  .admin-nav nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .admin-metric-grid,
  .admin-three-col,
  .admin-rule-history,
  .admin-tenant-grid,
  .admin-ops-grid,
  .admin-ops-role-grid,
  .admin-ops-lifecycle,
  .admin-ops-auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-main {
    padding: 14px;
  }

  .admin-hero,
  .admin-section-head,
  .admin-two-col,
  .admin-three-col,
  .admin-analyzer-grid,
  .admin-rule-grid,
  .admin-rule-history,
  .admin-tenant-grid,
  .admin-ops-grid,
  .admin-ops-role-grid,
  .admin-ops-lifecycle,
  .admin-ops-auth-grid,
  .admin-ops-events-grid,
  .admin-kb-search-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .admin-hero-actions,
  .admin-section-actions {
    justify-content: start;
  }

  .admin-metric-grid,
  .admin-library-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-ops-auth-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.e5c-rule-capture {
  color: #fff;
  border-color: #1677ff !important;
  background: #1677ff !important;
}

.e5c-rule-drawer {
  position: fixed;
  z-index: 90;
  inset: 0 0 0 auto;
  width: min(390px, 94vw);
  padding: 18px;
  overflow: auto;
  background: #fff;
  box-shadow: -12px 0 36px rgb(31 48 74 / 18%);
  transform: translateX(105%);
  transition: transform 180ms ease;
  visibility: hidden;
}

.e5c-rule-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.e5c-rule-drawer > header,
.e5c-rule-drawer > header div,
.e5c-rule-status > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.e5c-rule-drawer > header small,
.e5c-rule-status small {
  display: block;
  margin-top: 4px;
  color: #6b778c;
  font-weight: 400;
}

.e5c-rule-drawer > header button {
  border: 0;
  background: transparent;
  font-size: 24px;
}

.e5c-rule-drawer > nav {
  margin: 16px 0 10px;
}

.e5c-rule-form,
.e5c-rule-status-list {
  display: grid;
  gap: 12px;
}

.e5c-rule-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

.e5c-rule-form textarea,
.e5c-rule-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.e5c-rule-form textarea {
  min-height: 68px;
  resize: vertical;
}

.e5c-rule-source,
.e5c-rule-message,
.e5c-rule-empty {
  color: #667085;
  line-height: 1.55;
}

.e5c-rule-actions,
.e5c-rule-status-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.e5c-rule-status {
  padding: 12px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #fafcff;
}

.e5c-rule-status p {
  margin: 7px 0;
  color: #667085;
}

.e5c-rule-status > span {
  display: block;
  margin-bottom: 10px;
  color: #175cd3;
  font-weight: 600;
}

@media (max-width: 430px) {
  .e5c-rule-drawer {
    width: 100vw;
    box-sizing: border-box;
  }
}
