:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --nav: #132238;
  --nav-soft: #20314b;
  --blue: #2563eb;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --purple: #7c3aed;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  color: #fff;
  background: var(--nav);
}

.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: #0f766e;
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.brand p,
.sidebar-footer {
  margin: 4px 0 0;
  color: #b8c5d9;
  font-size: 12px;
  line-height: 1.5;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  color: #dce6f5;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--nav-soft);
  color: #fff;
}

.nav-item.is-temporarily-disabled,
.nav-group-title.is-temporarily-disabled {
  color: rgba(220, 230, 245, 0.42);
  filter: grayscale(1);
}

.nav-item.is-temporarily-disabled .nav-icon,
.nav-group-title.is-temporarily-disabled .nav-icon {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(184, 215, 255, 0.38);
}

.nav-item.is-temporarily-disabled:hover {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(220, 230, 245, 0.52);
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #b8d7ff;
  font-size: 11px;
  font-weight: 700;
}

.nav-subitem {
  min-height: 38px;
  padding-left: 50px;
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--muted);
  flex: 0 0 auto;
}

.dot.is-live {
  background: #22c55e;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h2,
.panel h3,
.drawer-header h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.panel h3,
.drawer-header h3 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(780px, 100%);
  justify-content: flex-end;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(180px, 320px);
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #eef3f8;
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand.compact {
  grid-column: 1 / -1;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.login-form,
.settings-form {
  display: grid;
  gap: 12px;
}

.login-form h2 {
  margin: 0;
  font-size: 20px;
}

.login-form label,
.settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input,
.login-form select,
.settings-form input,
.settings-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.secret-field {
  position: relative;
  display: block;
}

.settings-form .secret-field input {
  padding-right: 44px;
}

.secret-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  transform: translateY(-50%);
}

.secret-toggle::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 16px;
  height: 10px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.secret-toggle::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  transform: translate(-50%, -50%);
}

.secret-toggle:hover {
  background: #eff6ff;
}

.secret-toggle.is-visible::before {
  border-color: var(--blue);
}

.secret-toggle.is-visible::after {
  background: var(--blue);
}

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

.settings-form select[multiple] {
  min-height: 116px;
}

.divider-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.check-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: auto;
  min-height: auto;
}

.login-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #b42318;
  font-weight: 700;
}

.autofill-trap {
  position: absolute;
  left: -9999px;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.enable-requirement {
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--amber);
  background: #fff7ed;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.enable-requirement.is-ready {
  border-color: #bbf7d0;
  color: var(--green);
  background: #f0fdf4;
}

.enable-requirement strong {
  color: var(--ink);
}

.enable-requirement code {
  display: inline-block;
  margin: 0 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--amber);
  background: #ffedd5;
  font-family: inherit;
}

.enable-requirement.is-ready code {
  color: var(--green);
  background: #dcfce7;
}

.form-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.current-user {
  color: var(--muted);
  font-weight: 800;
}

.settings-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.settings-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-item strong {
  color: var(--ink);
}

.settings-item p {
  margin: 0;
  color: var(--muted);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-only.is-hidden,
.role-hidden {
  display: none !important;
}

.button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
}

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

.button.secondary,
.ghost-button {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.ghost-button:hover,
.button.secondary:hover {
  border-color: #b6c2d3;
  background: var(--surface-soft);
}

.ghost-button.danger {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff5f5;
}

.ghost-button.danger:hover {
  color: #fff;
  border-color: #b42318;
  background: #d92d20;
}

.ghost-button.success {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.26);
  background: #ecfdf3;
}

.ghost-button.success:hover {
  color: #fff;
  border-color: #047857;
  background: #039855;
}

.ghost-button:disabled,
.ghost-button:disabled:hover {
  cursor: not-allowed;
  color: #98a2b3;
  border-color: var(--line);
  background: #f2f4f7;
}

.overview-action {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.overview-action:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 18px;
}

.metric-grid,
.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.channel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 116px;
  padding: 16px 18px;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 32px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card .trend {
  display: inline-flex;
  margin-top: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--green);
  background: #dcfce7;
  font-size: 12px;
  font-weight: 700;
}

.metric-card .trend.neutral {
  color: var(--blue);
  background: #dbeafe;
}

.metric-card .trend.warning {
  color: var(--amber);
  background: #fff7ed;
}

.metric-card .trend.alert {
  color: var(--red);
  background: #fee2e2;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.config-master-detail {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.config-list-panel,
.config-detail-panel {
  min-width: 0;
}

.config-list-panel {
  position: sticky;
  top: 18px;
}

.config-account-list {
  display: grid;
  gap: 10px;
}

.config-account-card {
  cursor: pointer;
  box-shadow: none;
}

.config-account-card.is-active {
  border-color: var(--blue);
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.config-account-card p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-detail-panel .section-heading small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wecom-kf-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.wecom-kf-sidebar,
.wecom-kf-workspace {
  min-width: 0;
}

.wecom-kf-sidebar {
  position: sticky;
  top: 18px;
}

.wecom-corp-list {
  display: grid;
  gap: 12px;
}

.wecom-corp-node {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.wecom-corp-node.is-active {
  border-color: var(--blue);
  background: #eff6ff;
}

.wecom-corp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.wecom-corp-head span {
  min-width: 0;
}

.wecom-corp-head strong,
.wecom-corp-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wecom-corp-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wecom-corp-head em,
.kf-corp-summary strong.is-on,
.kf-corp-summary strong.is-off {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.wecom-corp-head em.is-on,
.kf-corp-summary strong.is-on {
  color: var(--green);
  background: #dcfce7;
}

.wecom-corp-head em.is-off,
.kf-corp-summary strong.is-off {
  color: var(--red);
  background: #fee2e2;
}

.kf-tree-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
}

.kf-tree-accounts {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.kf-tree-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.kf-tree-account {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.kf-tree-account-row.is-active .kf-tree-account {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.kf-tree-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid #c7d2e5;
  border-radius: 50%;
  color: var(--blue);
  background: #eaf2ff;
  font-size: 13px;
  font-weight: 900;
}

.kf-tree-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kf-tree-account-text {
  min-width: 0;
}

.kf-tree-account-text strong,
.kf-tree-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kf-tree-account-text strong {
  font-size: 14px;
  font-weight: 800;
}

.kf-tree-account small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kf-tree-delete {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--red);
  background: #fff;
  font-size: 18px;
  line-height: 1;
}

.kf-create-panel,
.kf-servicer-add-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.form-actions-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.mailbox-manager-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.role-hint,
.user-wecom-bind {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.role-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.user-wecom-bind {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.user-wecom-bind span,
.user-wecom-bind strong,
.user-wecom-bind small {
  display: block;
}

.user-wecom-bind span {
  color: var(--muted);
  font-weight: 800;
}

.user-wecom-bind strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-wecom-bind small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.user-wecom-actions {
  display: flex;
  gap: 8px;
}

.manager-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manager-box-head span,
.manager-box-head small {
  display: block;
}

.manager-box-head span {
  color: var(--muted);
  font-weight: 800;
}

.manager-box-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.mailbox-manager-list {
  display: grid;
  gap: 8px;
}

.mailbox-manager-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(130px, 0.9fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.mailbox-manager-row div {
  min-width: 0;
}

.mailbox-manager-row strong,
.mailbox-manager-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-manager-row strong {
  color: var(--ink);
  font-size: 13px;
}

.mailbox-manager-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kf-active-account {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kf-active-account article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.kf-active-account span,
.kf-active-account small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kf-active-account strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kf-active-account small {
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kf-servicer-list {
  display: grid;
  gap: 8px;
}

.kf-servicer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.kf-servicer-row strong,
.kf-servicer-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kf-servicer-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kf-corp-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kf-corp-summary article,
.kf-form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.kf-corp-summary article {
  min-width: 0;
  padding: 10px;
}

.kf-corp-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kf-corp-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kf-config-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 12px;
}

.kf-form-card {
  padding: 14px;
}

.kf-list-heading {
  margin-top: 16px;
}

.kf-account-list {
  padding: 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.overview-main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.section-heading,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.source-card,
.queue-item,
.runtime-item,
.audit-item,
.schema-row,
.field-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.source-card {
  min-height: 132px;
  padding: 14px;
}

.source-card.is-disabled {
  opacity: 0.72;
}

.source-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.source-card h4,
.queue-item h4,
.channel-card h3,
.template-preview h4 {
  margin: 0;
  font-size: 15px;
}

.source-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.source-card-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 10px;
}

.source-card-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-card p,
.queue-item p,
.channel-card p,
.runtime-item p,
.audit-item p,
.detail-block p,
.evidence-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.source-progress,
.mix-row i,
.trend-bar i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.source-progress {
  margin-top: 10px;
}

.source-progress span,
.mix-row b,
.trend-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.source-card:nth-child(2) .source-progress span,
.mix-row.wechat b {
  background: var(--green);
}

.source-card:nth-child(3) .source-progress span {
  background: var(--purple);
}

.mix-row.assistant b {
  background: var(--teal);
}

.overview-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.overview-insight {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.insight-head,
.trend-bar,
.mix-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.insight-head {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 10px;
}

.insight-head span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.insight-head b {
  color: var(--muted);
  font-size: 12px;
}

.trend-bars,
.source-mix {
  display: grid;
  gap: 9px;
}

.trend-bar {
  grid-template-columns: 46px minmax(0, 1fr) 24px;
}

.mix-row {
  grid-template-columns: 54px minmax(0, 1fr) 40px;
}

.trend-bar span,
.mix-row span,
.trend-bar strong,
.mix-row strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill,
.source-pill,
.confidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.pending {
  color: var(--amber);
  background: #fff7ed;
}

.status-pill.done {
  color: var(--green);
  background: #dcfce7;
}

.status-pill.need {
  color: var(--red);
  background: #fee2e2;
}

.source-pill.email {
  color: #1d4ed8;
  background: #dbeafe;
}

.source-pill.wechat {
  color: var(--green);
  background: #dcfce7;
}

.source-pill.assistant {
  color: var(--teal);
  background: #ccfbf1;
}

.source-pill.voice {
  color: var(--purple);
  background: #ede9fe;
}

.confidence-pill {
  color: var(--teal);
  background: #ccfbf1;
}

.queue-list,
.runtime-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.queue-item,
.runtime-item,
.audit-item {
  padding: 12px;
}

.queue-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.queue-item:hover {
  border-color: #a7b7cc;
  background: #f8fbff;
}

.queue-item.is-urgent {
  border-color: #fecaca;
  background: #fff7f7;
}

.queue-content {
  min-width: 0;
}

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

.queue-kicker b {
  color: var(--red);
  font-size: 12px;
}

.queue-kicker em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.queue-customer {
  color: var(--ink) !important;
  font-weight: 800;
}

.queue-more {
  width: 100%;
  min-height: 38px;
  border: 1px dashed #b6c2d3;
  border-radius: var(--radius);
  color: var(--blue);
  background: #f8fbff;
  font-size: 13px;
  font-weight: 800;
}

.queue-more:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.empty-state.compact {
  padding: 18px;
  font-size: 13px;
}

.overview-architecture {
  padding: 16px 18px;
}

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

.architecture-summary article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.architecture-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.architecture-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
}

.architecture-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.architecture-panel img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table-panel {
  padding: 0;
}

.table-toolbar {
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  gap: 10px;
}

select,
input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.order-card-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.order-card {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.order-card:hover {
  border-color: #a7b7cc;
  background: #f8fbff;
}

.order-card-head,
.order-card-meta,
.order-card-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-card-head {
  justify-content: space-between;
}

.order-card-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.order-card-head strong {
  font-size: 15px;
  word-break: break-word;
}

.order-card-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.order-card-primary {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(140px, 0.85fr) minmax(178px, 0.95fr);
  gap: 8px;
}

.core-metric {
  min-width: 0;
  border: 1px solid #dfe7f2;
  border-radius: 6px;
  padding: 8px 10px;
  background: #f8fafc;
}

.core-metric.customer {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.core-metric.strain {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.core-metric.quantity {
  border-color: #fed7aa;
  background: #fff7ed;
}

.core-metric.price {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.core-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.core-metric strong {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.core-metric.price strong {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.core-metric.price .price-value {
  color: #047857;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  white-space: nowrap;
}

.core-metric.price .price-value.is-pending {
  color: #b45309;
  font-size: 20px;
}

.order-card-summary {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.order-card-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e8edf4;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
}

.order-card-summary b {
  color: #475467;
  font-size: 11px;
}

.order-card-fields {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  padding-top: 2px;
}

.order-card-fields.is-open {
  display: grid;
}

.order-card-field {
  min-width: 0;
  border: 1px solid #e8edf4;
  border-radius: 6px;
  padding: 5px 8px;
  background: #fbfcfe;
}

.order-card-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.order-card-field strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.order-card-footer {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
}

.ghost-button.compact {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.field-value-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
}

.field-value-line strong {
  min-width: 0;
}

.price-rule-button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0;
  color: var(--blue);
  background: #eff6ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.price-rule-button:hover {
  border-color: var(--blue);
  background: #dbeafe;
}

.order-id {
  color: var(--blue);
  font-weight: 800;
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

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

.small-page-button,
.page-number {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.small-page-button:disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background: #f2f4f7;
}

.page-number {
  width: 30px;
  padding: 0;
}

.page-number.is-active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.page-gap {
  padding: 0 2px;
  color: var(--muted);
}

.schema-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 12px;
  align-items: start;
}

.schema-fields-panel,
.schema-side-panel {
  padding: 14px;
}

.schema-fields-panel .section-heading,
.schema-side-panel .section-heading {
  margin-bottom: 10px;
}

.schema-fields-panel .ghost-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.schema-side-panel {
  position: sticky;
  top: 14px;
}

.schema-table {
  display: grid;
  gap: 5px;
}

.schema-row {
  display: grid;
  grid-template-columns: 32px minmax(160px, 1fr) 56px 66px 46px 84px;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 13px;
}

.schema-row .order {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--nav-soft);
  font-size: 11px;
  font-weight: 800;
}

.schema-field-name {
  min-width: 0;
}

.schema-row strong,
.schema-row .eyebrow {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-row strong {
  font-size: 14px;
  line-height: 1.2;
}

.schema-row .eyebrow {
  margin-top: 1px;
  margin-bottom: 0;
  letter-spacing: 0;
}

.schema-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.schema-meta.is-required {
  color: var(--blue);
  background: #eff6ff;
}

.schema-meta.is-optional {
  color: var(--muted);
  background: transparent;
}

.schema-actions {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
}

.small-button {
  width: 26px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.small-button.danger {
  color: var(--red);
}

.small-button:disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background: #f2f4f7;
}

.field-form {
  display: grid;
  gap: 8px;
}

.field-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-form input:not([type="checkbox"]),
.field-form select {
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
}

.field-form-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.field-form .checkbox-row {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 6px;
  color: var(--ink);
  white-space: nowrap;
}

.field-form .checkbox-row input {
  min-height: 0;
  width: 15px;
  height: 15px;
  padding: 0;
}

.field-form .button {
  min-height: 36px;
}

.template-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pricebook-layout {
  grid-template-columns: minmax(360px, 0.74fr) minmax(0, 1.26fr);
}

.pricebook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.pricebook-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pricebook-summary article,
.pricebook-detail-meta div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.pricebook-summary strong,
.pricebook-detail-meta strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.pricebook-summary span,
.pricebook-detail-meta span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pricebook-search {
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 12px;
}

.pricebook-list {
  display: grid;
  gap: 10px;
}

.pricebook-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.pricebook-card.is-active {
  border-color: var(--blue);
  background: #eff6ff;
}

.pricebook-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.pricebook-select span {
  min-width: 0;
}

.pricebook-select strong {
  display: block;
  font-size: 15px;
}

.customer-name {
  display: inline-grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}

.customer-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: inset 0 -1px 0 rgba(37, 99, 235, 0.16);
}

.company-icon::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 2px;
  height: 2px;
  border-radius: 1px;
  background: var(--blue);
  box-shadow:
    5px 0 0 var(--blue),
    0 5px 0 var(--blue),
    5px 5px 0 var(--blue);
  content: "";
}

.company-icon::after {
  position: absolute;
  bottom: 2px;
  left: 7px;
  width: 4px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #1d4ed8;
  content: "";
}

.pricebook-title-code {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pricebook-select em,
.pricebook-card label,
.price-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pricebook-select b {
  color: var(--teal);
  font-size: 12px;
}

.pricebook-card label {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.pricebook-card input {
  width: 100%;
  min-height: 34px;
  background: #fff;
}

.pricebook-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.price-row-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.price-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.2fr) 64px minmax(92px, 1.2fr) 76px 76px minmax(88px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--surface-soft);
  font-size: 13px;
}

.price-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.price-row input:hover,
.price-row input:focus {
  border-color: var(--blue);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.price-row-head {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-row-head span {
  color: var(--muted);
}

.price-row strong {
  color: var(--blue);
}

.log-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.log-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.log-summary {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.log-list {
  display: grid;
  gap: 10px;
}

.log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.25fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.log-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.log-main strong,
.log-main p {
  min-width: 0;
}

.log-main p {
  width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.log-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.log-side {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.log-detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.log-detail summary {
  cursor: pointer;
  font-weight: 800;
}

.log-detail pre {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

#excelPreview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 248px;
  margin-top: 8px;
  overflow: auto;
}

.field-chip {
  padding: 4px 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.channel-card {
  display: grid;
  gap: 14px;
  min-height: 300px;
  padding: 18px;
}

.channel-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.channel-card header > div {
  min-width: 0;
}

.channel-card header .status-pill {
  min-width: 72px;
  flex: 0 0 auto;
  justify-content: center;
  white-space: nowrap;
}

.channel-meta {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.channel-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.channel-meta strong {
  color: var(--ink);
}

.channel-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.channel-card input[type="checkbox"] {
  min-height: 0;
}

.runtime-item {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 10px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
}

.detail-drawer,
.rule-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.detail-drawer.is-open,
.rule-modal.is-open {
  display: block;
}

.drawer-backdrop,
.rule-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(680px, 100vw);
  height: 100%;
  background: var(--surface);
  box-shadow: -22px 0 60px rgba(15, 23, 42, 0.18);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-header > div:first-child {
  min-width: 0;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.drawer-feedback {
  min-width: 150px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.drawer-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.drawer-confirm-button {
  min-height: 38px;
  padding: 0 18px;
  white-space: nowrap;
}

.drawer-confirm-button.is-confirmed,
.drawer-confirm-button:disabled {
  border-color: #bbf7d0;
  color: var(--green);
  background: #dcfce7;
  box-shadow: none;
}

.drawer-content {
  overflow: auto;
  padding: 22px;
}

.rule-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  transform: translate(-50%, -50%);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.rule-content {
  overflow: auto;
  padding: 20px;
}

.mailbox-manager-modal-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(920px, calc(100vw - 32px));
}

.mailbox-manager-modal-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.mailbox-manager-modal-toolbar input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.mailbox-manager-candidates {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 16px 18px;
}

.mailbox-manager-candidate {
  display: grid;
  grid-template-columns: 24px minmax(160px, 1.1fr) minmax(140px, 0.9fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-soft);
}

.mailbox-manager-candidate:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.mailbox-manager-candidate input {
  width: 16px;
  height: 16px;
}

.mailbox-manager-candidate span {
  min-width: 0;
}

.mailbox-manager-candidate strong,
.mailbox-manager-candidate small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-manager-candidate strong {
  color: var(--ink);
  font-size: 13px;
}

.mailbox-manager-candidate small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.modal-actions > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-actions > div {
  display: flex;
  gap: 8px;
}

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

.sex-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sex-summary div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.sex-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sex-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.detail-block,
.evidence-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.detail-block {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

button.detail-block {
  font: inherit;
}

button.detail-block:disabled {
  cursor: default;
}

.detail-block.is-editable {
  cursor: pointer;
}

.detail-block.is-editable:hover {
  border-color: var(--blue);
  background: #eef4ff;
}

.detail-block.is-missing {
  border-color: #f0b429;
  background: #fff8e6;
}

.detail-block strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.edit-hint {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.field-editor {
  background: #eef4ff;
  border-color: var(--blue);
}

.field-editor-input {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.field-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.section-inline-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-inline-title h4 {
  margin: 0;
}

.section-inline-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drawer-section {
  margin-top: 18px;
}

.drawer-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.drawer-section .section-inline-title h4 {
  margin: 0;
}

.source-raw {
  margin: 0;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.timeline-item strong {
  color: var(--ink);
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.price-rule-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.price-rule-result.matched {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.price-rule-result.fallback {
  border-color: #fed7aa;
  background: #fff7ed;
}

.price-rule-result.none {
  border-color: #fecaca;
  background: #fef2f2;
}

.price-rule-result.manual {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.price-rule-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-rule-result strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.price-rule-result p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.price-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.price-rule-grid div,
.price-rule-steps div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.price-rule-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.price-rule-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.price-rule-steps {
  display: grid;
  gap: 8px;
}

.price-rule-steps div {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
}

.price-rule-steps b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
}

.price-rule-steps span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.assistant-layout {
  display: grid;
  grid-template-areas: "profile chat";
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 150px);
  min-height: 620px;
}

.assistant-profile,
.assistant-chat {
  min-width: 0;
}

.assistant-profile {
  grid-area: profile;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.assistant-portrait-wrap {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 320px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.assistant-portrait-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
}

.assistant-profile h3 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.assistant-scope {
  display: grid;
  gap: 6px;
  max-width: none;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.assistant-scope strong {
  font-size: 14px;
}

.assistant-scope p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.assistant-chat {
  grid-area: chat;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.assistant-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.assistant-chat-head h3 {
  margin: 4px 0 0;
}

.assistant-head-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.assistant-history-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.assistant-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.assistant-history-head strong {
  font-size: 14px;
}

.assistant-history-head span,
.assistant-history-empty {
  color: var(--muted);
  font-size: 12px;
}

.assistant-history-list {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
}

.assistant-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.assistant-history-item:last-child {
  border-bottom: 0;
}

.assistant-history-main,
.assistant-history-delete {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.assistant-history-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.assistant-history-main strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-history-main span {
  color: var(--muted);
  font-size: 12px;
}

.assistant-history-delete {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-history-delete:hover {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.assistant-history-empty {
  padding: 18px 12px;
  text-align: center;
}

.assistant-dropzone {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.assistant-dropzone.is-dragging {
  outline: 2px solid var(--teal);
  outline-offset: -6px;
  background: #ecfdf5;
}

.assistant-composer.is-dragging {
  background: #f0fdfa;
}

.assistant-composer textarea.is-dragging {
  border-color: var(--teal);
  background: #ecfdf5;
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.assistant-messages {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.assistant-message {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.assistant-message.is-user {
  grid-template-columns: minmax(0, 1fr) 44px;
  margin-bottom: 24px;
}

.assistant-message.is-user .assistant-avatar {
  grid-column: 2;
}

.assistant-message.is-user .assistant-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  background: #eaf2ff;
}

.assistant-avatar {
  overflow: hidden;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: #fff;
  font-weight: 800;
}

.assistant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
}

.assistant-avatar span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--teal);
}

.assistant-bubble {
  max-width: min(100%, 680px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.assistant-message.has-review .assistant-bubble {
  width: min(100%, 1120px);
  max-width: min(100%, 1120px);
}

.assistant-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.assistant-message-meta strong {
  font-size: 13px;
}

.assistant-message-meta span {
  color: var(--muted);
  font-size: 12px;
}

.assistant-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.assistant-markdown {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.assistant-markdown p {
  margin: 0 0 10px;
}

.assistant-markdown p:last-child,
.assistant-markdown ul:last-child,
.assistant-markdown ol:last-child,
.assistant-markdown-table:last-child {
  margin-bottom: 0;
}

.assistant-markdown ul,
.assistant-markdown ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.assistant-markdown code {
  border: 1px solid #d8e0ee;
  border-radius: 5px;
  padding: 1px 5px;
  background: #f4f7fb;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.assistant-markdown-table {
  overflow-x: auto;
  margin: 8px 0 12px;
  border: 1px solid #d7e0ee;
  border-radius: 8px;
}

.assistant-markdown-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: #fff;
}

.assistant-markdown-table th,
.assistant-markdown-table td {
  border-bottom: 1px solid #e5ebf3;
  border-right: 1px solid #e5ebf3;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.assistant-markdown-table th:last-child,
.assistant-markdown-table td:last-child {
  border-right: 0;
}

.assistant-markdown-table tr:last-child td {
  border-bottom: 0;
}

.assistant-markdown-table th {
  color: #0f2342;
  background: #f3f7fc;
  font-weight: 800;
}

.assistant-message-files,
.assistant-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-message-files {
  margin-top: 10px;
}

.assistant-message-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
  margin-top: -18px;
  margin-right: 54px;
  opacity: 0.55;
  transition: opacity 0.16s ease;
}

.assistant-message.is-user:hover .assistant-message-tools,
.assistant-message.is-user:focus-within .assistant-message-tools {
  opacity: 0.95;
}

.assistant-message-tools .ghost-button {
  min-height: 28px;
  padding: 4px 9px;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  box-shadow: none;
}

.assistant-message-tools .ghost-button:hover {
  color: var(--teal);
}

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

.assistant-message-actions .ghost-button {
  background: var(--surface);
}

.assistant-message-actions .ghost-button:first-child {
  border-color: rgba(15, 118, 110, 0.28);
  color: var(--teal);
}

.assistant-message-actions .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.assistant-message.is-pending .assistant-bubble {
  border-style: dashed;
  background: #f8fafc;
}

.assistant-message.is-pending .assistant-bubble p::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--teal);
  border-radius: 50%;
  vertical-align: -2px;
  animation: assistantPendingSpin 0.8s linear infinite;
}

@keyframes assistantPendingSpin {
  to {
    transform: rotate(360deg);
  }
}

.assistant-file-chip,
.assistant-pending-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
}

.assistant-file-preview {
  cursor: pointer;
  text-align: left;
}

.assistant-file-preview:hover {
  border-color: rgba(15, 118, 110, 0.38);
  background: #f0fdfa;
}

.assistant-file-thumb {
  overflow: hidden;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #e2e8f0;
}

.assistant-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assistant-file-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: #e0f2fe;
  color: #075985;
  font-size: 11px;
  font-weight: 800;
}

.assistant-file-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.assistant-file-main span {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-file-chip small,
.assistant-pending-file small {
  color: var(--muted);
}

.assistant-pending-file {
  position: relative;
  max-width: 268px;
}

.assistant-pending-preview {
  width: 100%;
  padding-right: 28px;
  cursor: zoom-in;
  text-align: left;
}

.assistant-pending-preview:hover {
  border-color: rgba(15, 118, 110, 0.38);
  background: #f0fdfa;
}

.assistant-pending-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.assistant-pending-remove:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

.assistant-composer {
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
  background: var(--surface);
}

.assistant-composer.is-locked {
  background: #f8fafc;
}

.assistant-composer-lock {
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #854d0e;
  background: #fffbeb;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.assistant-composer textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  background: var(--surface-soft);
}

.assistant-composer textarea:disabled {
  color: var(--muted);
  background: #f1f5f9;
  cursor: not-allowed;
}

.assistant-composer.is-locked .file-button {
  opacity: 0.55;
  pointer-events: none;
}

.assistant-composer textarea:focus,
.assistant-result-table input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

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

.assistant-review-card {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.assistant-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.assistant-review-head strong,
.assistant-review-head span {
  display: block;
}

.assistant-review-head strong {
  color: var(--ink);
  font-size: 13px;
}

.assistant-review-head span,
.assistant-review-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.assistant-result-table {
  min-height: 0;
}

.assistant-result-scroll {
  overflow: auto;
  max-height: min(52vh, 420px);
}

.assistant-result-table table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.assistant-result-table th,
.assistant-result-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.assistant-result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  min-width: 132px;
  background: #eef4fb;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.assistant-result-table td {
  background: var(--surface);
}

.assistant-result-table tr.is-gift-order td {
  background: #ecfdf3;
}

.assistant-result-table input {
  width: 120px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.assistant-result-table tr.is-gift-order input {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.assistant-result-table input:disabled {
  color: var(--ink);
  opacity: 1;
}

.assistant-review-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.assistant-preview-modal {
  z-index: 30;
}

.assistant-preview-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.24);
}

.assistant-preview-body {
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}

.assistant-preview-image {
  display: grid;
  min-height: 320px;
  place-items: center;
}

.assistant-preview-image img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14);
}

.assistant-preview-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-preview-body pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  white-space: pre-wrap;
}

.assistant-preview-table {
  overflow: auto;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.assistant-preview-table table {
  width: 100%;
  border-collapse: collapse;
}

.assistant-preview-table td {
  min-width: 140px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.assistant-preview-table strong,
.assistant-preview-table span {
  display: block;
}

.assistant-preview-table strong {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.assistant-preview-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

body[data-active-view="assistant"] .search-box,
body[data-active-view="assistant"] #exportCsvBtn,
body[data-active-view="assistant"] #syncEmailBtn,
body[data-active-view="assistant"] #simulateOrderBtn {
  display: none;
}

body[data-active-view="assistant"] .topbar-actions {
  min-width: 0;
}

.temporary-unavailable-notice {
  position: fixed;
  left: 50%;
  top: 88px;
  z-index: 2000;
  transform: translate(-50%, -12px);
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.temporary-unavailable-notice.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    min-width: 0;
  }

  .search-box {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .metric-grid,
  .channel-grid,
  .source-overview,
  .layout-two,
  .overview-grid,
  .overview-insight-grid,
  .architecture-summary,
  .schema-layout,
  .pricebook-layout,
  .config-master-detail,
  .wecom-kf-layout,
  .assistant-layout,
  .kf-active-account,
  .mailbox-manager-row,
  .mailbox-manager-candidate,
  .kf-corp-summary,
  .kf-config-grid,
  .log-filter-bar,
  .log-item {
    grid-template-columns: 1fr;
  }

  .wecom-kf-sidebar,
  .config-list-panel {
    position: static;
  }

  .order-card-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-layout {
    grid-template-areas:
      "profile"
      "chat";
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, auto);
    height: auto;
    min-height: auto;
  }

  .assistant-result-scroll {
    max-height: 520px;
  }

  .assistant-profile {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
  }

  .assistant-portrait-wrap {
    width: 72px;
    height: 72px;
    aspect-ratio: auto;
  }

  .assistant-scope {
    grid-column: 1 / -1;
    max-width: none;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

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

  .filters,
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .drawer-header {
    align-items: flex-start;
  }

  .drawer-header-actions {
    flex-wrap: wrap;
  }

  .drawer-feedback {
    width: 100%;
    min-width: 0;
    text-align: right;
  }

  .order-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-card-head > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .order-card-primary {
    grid-template-columns: 1fr;
  }

  .schema-row {
    grid-template-columns: 36px 1fr;
  }

  .schema-row > * {
    min-width: 0;
  }

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

  .sex-summary {
    grid-template-columns: 1fr 1fr;
  }

  .pricebook-summary,
  .pricebook-detail-meta,
  .price-rule-grid {
    grid-template-columns: 1fr;
  }

  .price-row {
    grid-template-columns: 1fr 1fr;
  }

  .pagination-actions {
    justify-content: flex-start;
  }

  .assistant-profile {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .assistant-portrait-wrap {
    width: 60px;
    height: 60px;
  }

  .assistant-message,
  .assistant-message.is-user {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .assistant-message.is-user .assistant-avatar {
    grid-column: 1;
  }

  .assistant-message.is-user .assistant-bubble {
    grid-column: 2;
    justify-self: stretch;
  }

  .assistant-message-tools {
    right: 0;
  }

  .assistant-message.is-user::after {
    right: 0;
    width: min(220px, 100%);
  }

  .assistant-avatar {
    width: 36px;
    height: 36px;
  }
}
