:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #17211d;
  --muted: #66736d;
  --line: #dce3df;
  --line-strong: #c7d1cc;
  --nav: #16211d;
  --nav-soft: #22302a;
  --green: #1f7a5a;
  --green-soft: #e8f5ef;
  --blue: #2468a2;
  --blue-soft: #eaf2f8;
  --amber: #a96517;
  --amber-soft: #fff3df;
  --red: #b33a45;
  --red-soft: #fff0f1;
  --shadow: 0 5px 18px rgba(23, 33, 29, .06);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
button:disabled, textarea:disabled { cursor: not-allowed; opacity: .62; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  color: #eef4f1;
  background: var(--nav);
}
.brand {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mark, .login-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 7px;
  font-weight: 800;
  font-size: 18px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 3px; color: #9fb0a8; font-size: 10px; }
.sidebar nav { display: grid; gap: 3px; margin-top: 14px; }
.nav-link {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  color: #bdc9c3;
  border-radius: 6px;
  font-weight: 600;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-link.active { color: #fff; background: var(--nav-soft); box-shadow: inset 3px 0 var(--green); }
.nav-icon { width: 24px; text-align: center; font-size: 15px; }
.nav-badge {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: var(--red);
  border-radius: 10px;
  font-size: 10px;
}
.sidebar-policy {
  display: grid;
  gap: 7px;
  margin: auto 4px 16px;
  padding: 12px;
  color: #a6b4ad;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  font-size: 10px;
}
.sidebar-policy span { color: #72857b; }
.sidebar-policy strong { color: #e7efeb; font-size: 11px; }
.sidebar-user {
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px 1fr 30px;
  align-items: center;
  gap: 9px;
  padding: 9px 8px 0;
  border-top: 1px solid rgba(255,255,255,.09);
}
.avatar, .contact-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: #3c5d50;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user small { margin-top: 3px; color: #92a39b; font-size: 9px; }

.main { min-width: 0; }
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-title { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.page-title h1 { flex: 0 0 auto; margin: 0; font-size: 19px; }
.page-title p { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.top-actions, .section-actions, .toolbar-actions, .row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-chip, .scope-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:hover { border-color: var(--line); background: var(--surface-soft); }
.sidebar .icon-btn { color: #b7c4bd; }
.alert-trigger { width: 76px; position: relative; color: #fff; background: var(--red); border-color: var(--red); font-weight: 800; }
.alert-trigger:hover { color: #fff; background: #9e303b; border-color: #9e303b; }
.alert-trigger b {
  min-width: 16px;
  height: 16px;
  position: absolute;
  right: -6px;
  top: -6px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #fff;
  background: #d93a45;
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
}
.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 22px 26px 34px; }

.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  color: #32423b;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
  font-size: 11px;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-soft); border-color: #aebdb5; }
.btn.small { min-height: 28px; padding: 5px 8px; font-size: 10px; }
.btn-primary { color: #fff; background: var(--green); border-color: var(--green); }
.btn-primary:hover { background: #176b4d; border-color: #176b4d; }
.btn-danger { color: #fff; background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #9e303b; border-color: #9e303b; }
.danger-outline { color: var(--red); background: #fff; border-color: #e5aeb4; }
.danger-outline:hover { background: var(--red-soft); }

.field {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
}
.field:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,122,90,.10); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
.textarea.tall { min-height: 270px; }
label { display: grid; gap: 6px; color: #425149; font-size: 11px; font-weight: 650; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-stack { display: grid; gap: 13px; }

.section-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.section-head > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head p { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.date-field { width: 150px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid #95a49d;
  border-radius: 7px;
  box-shadow: var(--shadow);
}
.metric-card.green { border-top-color: var(--green); }
.metric-card.blue { border-top-color: var(--blue); }
.metric-card.amber { border-top-color: var(--amber); }
.metric-card.red { border-top-color: var(--red); }
.metric-card span { color: var(--muted); font-size: 10px; }
.metric-card strong { margin-top: 8px; font-size: 25px; line-height: 1; }
.metric-card small { margin-top: 8px; color: var(--muted); font-size: 9px; }

.critical-banner {
  min-height: 72px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #7e2730;
  background: var(--red-soft);
  border: 1px solid #efc3c7;
  border-left: 4px solid var(--red);
  border-radius: 7px;
}
.critical-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
}
.critical-banner > div, .receipt-banner > div { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.critical-banner strong { flex: 0 0 auto; font-size: 12px; }
.critical-banner p { min-width: 0; margin: 0; overflow: hidden; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.risk-banner { min-height: 72px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 13px; margin-bottom: 16px; padding: 12px 14px; color: #76521b; background: var(--amber-soft); border: 1px solid #efd7a7; border-left: 4px solid var(--amber); border-radius: 7px; }
.risk-icon { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--amber); border-radius: 50%; font-size: 18px; font-weight: 800; }
.risk-banner > div { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.risk-banner strong { flex: 0 0 auto; font-size: 12px; }
.risk-banner p { min-width: 0; margin: 0; overflow: hidden; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.warning-outline { color: var(--amber); background: #fffaf0; border-color: #e1b86d; }
.warning-outline:hover { color: #7b4d0d; background: var(--amber-soft); border-color: var(--amber); }
.receipt-banner {
  min-height: 72px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #6f4b12;
  background: #fff5df;
  border: 1px solid #efd7a7;
  border-left: 4px solid #d29429;
  border-radius: 7px;
}
.receipt-icon { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #d29429; border-radius: 50%; font-size: 18px; font-weight: 800; }
.receipt-banner strong { flex: 0 0 auto; font-size: 12px; }
.receipt-banner p { min-width: 0; margin: 0; overflow: hidden; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.reminder-overview { max-height: 62px; }
.reminder-count { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 6px; padding: 0 5px; color: #fff; background: var(--red); border-radius: 10px; font-size: 10px; }

.panel {
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}
.panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.panel-head > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 13px; }
.panel-head p { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { padding: 15px; }
.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr);
  gap: 14px;
}

.legend { display: flex; gap: 12px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; }
.legend-sent { background: #d1d8d4; }
.legend-delivered { background: var(--green); }
.bar-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  padding: 20px 20px 14px;
}
.chart-day { height: 100%; display: grid; grid-template-rows: 1fr 18px 14px; text-align: center; }
.chart-bars {
  min-height: 130px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}
.bar { width: min(20px, 34%); min-height: 4px; border-radius: 3px 3px 0 0; }
.bar.sent { background: #d1d8d4; }
.bar.delivered { background: var(--green); }
.chart-day strong { margin-top: 6px; font-size: 9px; }
.chart-day small { color: var(--muted); font-size: 8px; }
.rule-list { display: grid; padding: 8px 15px 14px; }
.rule-list div {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.rule-list div:last-child { border-bottom: 0; }
.rule-list strong { color: var(--green); }
.rule-list strong.negative { color: var(--red); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  white-space: nowrap;
}
th { color: var(--muted); background: var(--surface-soft); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfb; }
.row-danger td { background: #fff8f8; }
.cell-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 400; }
.provider-cell { display: flex; align-items: center; gap: 9px; }
.provider-cell strong, .provider-cell small { display: block; }
.provider-cell small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.provider-code {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #38564a;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
}
.provider-code.large { width: 38px; height: 38px; font-size: 11px; }
.score {
  min-width: 34px;
  display: inline-flex;
  justify-content: center;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 11px;
}
.score.good { color: var(--green); background: var(--green-soft); }
.score.mid { color: var(--amber); background: var(--amber-soft); }
.score.bad { color: var(--red); background: var(--red-soft); }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
}
.status.success { color: var(--green); background: var(--green-soft); }
.status.warning { color: var(--amber); background: var(--amber-soft); }
.status.danger { color: var(--red); background: var(--red-soft); }
.status.muted { color: var(--muted); background: #eef1ef; }
.text-success { color: var(--green) !important; }
.text-warning { color: var(--amber) !important; }
.text-danger { color: var(--red) !important; }
.empty { padding: 34px; color: var(--muted); text-align: center; }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.provider-card {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}
.provider-card-head { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; }
.provider-card-head h3 { margin: 0; font-size: 13px; }
.provider-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.provider-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 14px 0; background: var(--line); }
.provider-stats div { padding: 9px 5px; background: var(--surface-soft); text-align: center; }
.provider-stats span, .provider-stats strong { display: block; }
.provider-stats span { color: var(--muted); font-size: 8px; }
.provider-stats strong { margin-top: 4px; font-size: 12px; }
.provider-card-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }
.provider-card-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.adapter-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 15px;
}
.adapter-flow span { padding: 8px 10px; color: #2f4d40; background: var(--green-soft); border: 1px solid #cfe6db; border-radius: 6px; font-size: 9px; font-weight: 700; }
.adapter-flow b { color: #94a49c; }
.adapter-table { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.adapter-table div { padding: 13px 15px; border-right: 1px solid var(--line); }
.adapter-table div:last-child { border-right: 0; }
.adapter-table strong, .adapter-table span { display: block; }
.adapter-table strong { font-size: 10px; }
.adapter-table span { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.pool-principle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-bottom: 14px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.pool-principle div { padding: 13px 15px; background: var(--surface); }
.pool-principle strong { font-size: 11px; }
.pool-principle p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.workspace-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.search-box {
  width: min(440px, 46%);
  height: 36px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.search-box span { text-align: center; }
.search-box input { min-width: 0; height: 100%; padding: 0 8px 0 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.message-workspace {
  height: calc(100vh - 150px);
  min-height: 610px;
  display: grid;
  grid-template-columns: 290px minmax(430px, 1fr) 250px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}
.conversation-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.conversation-heading { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid var(--line); }
.conversation-heading strong { font-size: 11px; }
.conversation-heading span { color: var(--muted); font-size: 9px; }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; }
.conversation-bulk-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.conversation-bulk-toolbar label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.conversation-bulk-toolbar input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.conversation-bulk-toolbar #bulkSelectedCount { white-space: nowrap; }
.conversation-bulk-actions { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.conversation-bulk-actions[hidden] { display: none; }
.conversation-bulk-actions .btn { min-height: 25px; padding: 4px 7px; font-size: 9px; }
.conversation-bulk-actions .btn:disabled { cursor: not-allowed; opacity: .45; }
.conversation-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.conversation-select { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.conversation-item:hover, .conversation-item.active { background: #f2f8f5; }
.conversation-item.active { box-shadow: inset 3px 0 var(--green); }
.conversation-item.bulk-selected { background: #e9f0ff; box-shadow: inset 3px 0 var(--blue); }
.conversation-column.bulk-select-mode .conversation-item { cursor: pointer; }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy small, .conversation-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 10px; line-height: 1.25; }
.conversation-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.25; }
.conversation-delivery-state.sent { color: var(--green); }
.conversation-delivery-state.failed, .conversation-delivery-reason { color: var(--red) !important; }
.conversation-delivery-reason { margin-top: 3px !important; font-weight: 700; }
.conversation-exception-notice { display: block; margin-top: 5px; overflow: hidden; font-size: 9px !important; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.conversation-exception-notice.pending, .conversation-exception-notice.timeout { color: var(--amber) !important; }
.conversation-exception-notice.misroute { color: var(--red) !important; }
.conversation-number-notice { display: block; margin-top: 5px; overflow: hidden; font-size: 9px !important; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.conversation-number-notice.unavailable { color: var(--red) !important; font-weight: 700; }
.conversation-number-notice.risk { color: var(--amber) !important; font-weight: 700; }
.conversation-meta { min-width: max-content; display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); white-space: nowrap; }
.conversation-meta time { font-size: 9px; }
.conversation-meta .conversation-delivery-state { margin: 0; font-size: 9px; font-weight: 700; }
.conversation-item > b { min-width: 18px; height: 18px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 9px; font-size: 8px; }
.chat-column { min-width: 0; display: grid; grid-template-rows: auto auto 1fr auto; }
.chat-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
}
.chat-head h2 { margin: 0; font-size: 13px; }
.chat-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.sticky-route { min-width: 180px; text-align: right; }
.sticky-route span, .sticky-route strong, .sticky-route small { display: block; }
.sticky-route span { color: var(--muted); font-size: 8px; }
.sticky-route strong { margin-top: 3px; font-size: 10px; }
.sticky-route small { margin-top: 3px; color: var(--green); font-size: 8px; }
.conversation-lock {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: #7e2730;
  background: var(--red-soft);
  border-bottom: 1px solid #efc3c7;
}
.conversation-lock > span { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 50%; font-weight: 800; }
.conversation-lock strong { font-size: 10px; }
.conversation-lock p { margin: 3px 0 0; font-size: 8px; }
.conversation-risk-notice { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 10px 12px; color: #76521b; background: var(--amber-soft); border-bottom: 1px solid #efd7a7; }
.conversation-risk-notice > span { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; background: var(--amber); border-radius: 50%; font-weight: 800; }
.conversation-risk-notice strong { font-size: 10px; }
.conversation-risk-notice p { margin: 3px 0 0; font-size: 8px; }
.messages { min-height: 0; overflow-y: auto; padding: 18px; background: #f7f9f8; }
.message-row { display: flex; margin-bottom: 13px; }
.message-row.out { justify-content: flex-end; }
.bubble { max-width: min(620px, 76%); padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.message-row.out .bubble { color: #173b2d; background: #e6f3ed; border-color: #cae4d7; }
.bubble p { margin: 0; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.bubble span { display: block; margin-top: 6px; color: var(--muted); text-align: right; font-size: 8px; }
.message-failure-reason { display: block; margin-top: 5px; color: var(--red); font-size: 9px; font-weight: 700; line-height: 1.4; }
.composer { padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
.composer textarea { width: 100%; min-height: 68px; padding: 9px; border: 1px solid var(--line-strong); border-radius: 6px; resize: none; outline: none; font-size: 10px; }
.composer textarea:focus { border-color: var(--green); }
.composer > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; }
.composer > div span { color: var(--muted); font-size: 8px; }
.composer.locked { background: #fff7f7; }
.contact-panel { min-width: 0; padding: 14px; border-left: 1px solid var(--line); overflow-y: auto; }
.contact-title { padding: 10px 0 16px; text-align: center; border-bottom: 1px solid var(--line); }
.contact-avatar.large { width: 48px; height: 48px; margin: 0 auto; font-size: 14px; }
.contact-title h3 { margin: 8px 0 0; font-size: 12px; }
.contact-title p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.detail-group { padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-group label, .detail-group strong, .detail-group small { display: block; }
.detail-group label { color: var(--muted); font-size: 8px; }
.detail-group strong { margin-top: 5px; font-size: 10px; }
.detail-group small { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.number-status-notice { display: grid; gap: 4px; margin: 12px 0 2px; padding: 9px 10px; border-radius: 5px; font-size: 9px; line-height: 1.45; }
.number-status-notice strong { font-size: 10px; }
.number-status-notice span { display: block; }
.number-status-notice.unavailable { color: var(--red); background: var(--red-soft); border: 1px solid #efc3c7; }
.number-status-notice.risk { color: #76521b; background: var(--amber-soft); border: 1px solid #efd7a7; }
.ownership-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.ownership-strip div { text-align: center; }
.ownership-strip strong, .ownership-strip span { display: block; }
.ownership-strip strong { font-size: 11px; }
.ownership-strip span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.ownership-strip b { color: #a2afa9; }
.team-panel { border-top: 3px solid var(--team-color); }
.team-head { min-height: 70px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.team-head > span { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--team-color); border-radius: 6px; font-weight: 800; }
.team-head > div { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.team-head h3 { margin: 0; font-size: 13px; }
.team-head p { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.team-head > strong { color: var(--team-color); font-size: 10px; }
.member-inline { display: flex; align-items: baseline; gap: 9px; }
.member-inline small { color: var(--muted); font-size: 8px; font-weight: 400; }

.settings-account { width: 100%; }
.password-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.audit-head { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.audit-toolbar { min-width: 0; display: grid; grid-template-columns: minmax(190px, .8fr) 150px 160px minmax(180px, 1fr) auto; align-items: center; gap: 8px; }
.audit-toolbar .search-box { width: 100%; }
.audit-date { min-width: 0; }

.check-layout, .settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.check-result { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.check-result div { min-height: 100px; display: flex; flex-direction: column; justify-content: center; padding: 14px; background: #fff; text-align: center; }
.check-result span { color: var(--muted); font-size: 9px; }
.check-result strong { margin-top: 7px; font-size: 24px; }
.check-result p { grid-column: 1 / -1; margin: 0; padding: 14px; color: var(--muted); background: var(--surface-soft); font-size: 9px; line-height: 1.5; }
.setting-list { display: grid; }
.setting-list label {
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}
.setting-list label:last-child { border-bottom: 0; }
.setting-list strong, .setting-list small { display: block; }
.setting-list strong { font-size: 10px; }
.setting-list small { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.setting-list input { width: 18px; height: 18px; accent-color: var(--green); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 20, 16, .58);
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
.modal.wide-dialog { width: min(780px, 100%); }
.modal.task-dialog { width: min(820px, 100%); }
.modal.switch-dialog { width: min(720px, 100%); }
.modal.alert-dialog { width: min(650px, 100%); }
.modal-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 14px; }
.modal-body { overflow-y: auto; padding: 16px; }
.modal-foot { min-height: 60px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 11px 15px; background: var(--surface-soft); border-top: 1px solid var(--line); }
.alert-modal > p { color: #584348; line-height: 1.65; }
.alert-severity { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 12px; color: #7e2730; background: var(--red-soft); border-left: 3px solid var(--red); }
.alert-severity span { font-size: 9px; font-weight: 800; }
.alert-severity strong { font-size: 13px; }
.alert-facts, .number-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 14px 0; background: var(--line); border: 1px solid var(--line); }
.alert-facts div, .number-detail-grid div { padding: 11px; background: #fff; }
.alert-facts span, .alert-facts strong, .number-detail-grid span, .number-detail-grid strong { display: block; }
.alert-facts span, .number-detail-grid span { color: var(--muted); font-size: 8px; }
.alert-facts strong, .number-detail-grid strong { margin-top: 5px; font-size: 10px; }
.no-switch-note, .allocation-note {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  color: #7e2730;
  background: var(--red-soft);
  border: 1px solid #efc3c7;
  border-radius: 6px;
}
.no-switch-note strong, .allocation-note strong { font-size: 10px; }
.no-switch-note span, .allocation-note p { margin: 0; font-size: 9px; line-height: 1.55; }
.no-switch-note.recovery-ready {
  color: #145f48;
  background: var(--green-soft);
  border-color: #9ed9c7;
}
.no-switch-note.recovery-pending {
  color: #765014;
  background: #fff6de;
  border-color: #e7c980;
}
.alert-list { display: grid; gap: 7px; }
.alert-row {
  width: 100%;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.alert-row:hover { background: var(--surface-soft); }
.alert-row strong, .alert-row small { display: block; }
.alert-row strong { font-size: 10px; }
.alert-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.alert-row em { color: var(--red); font-size: 8px; font-style: normal; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.critical { background: var(--red); }
.dot.warning { background: var(--amber); }
.quality-score { display: grid; place-items: center; min-height: 120px; margin-bottom: 14px; background: var(--surface-soft); border: 1px solid var(--line); }
.quality-score span { color: var(--muted); font-size: 9px; }
.quality-score strong { font-size: 36px; }
.quality-score small { color: var(--green); font-size: 9px; }
.provider-modal { display: grid; gap: 14px; }
.provider-modal label b { color: var(--green); }
.provider-modal input[type="range"] { width: 100%; accent-color: var(--green); }
.switch-flow { display: grid; gap: 14px; }
.switch-warning { padding: 11px 12px; color: #7e2730; background: var(--red-soft); border-left: 3px solid var(--red); }
.switch-warning strong { font-size: 10px; }
.switch-warning p { margin: 5px 0 0; font-size: 9px; }
.route-change { display: grid; grid-template-columns: 1fr auto 1.35fr; align-items: end; gap: 12px; }
.route-change > div { min-height: 64px; padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.route-change span, .route-change strong, .route-change small { display: block; }
.route-change span { color: var(--muted); font-size: 8px; }
.route-change strong { margin-top: 5px; font-size: 11px; }
.route-change small { margin-top: 5px; color: var(--red); font-size: 8px; }
.route-change > b { padding-bottom: 10px; color: #9ba9a2; }
.confirm-check { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: #3d4d45; font-size: 10px; }
.confirm-check input { width: 17px; height: 17px; accent-color: var(--green); }
.task-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.task-layout > section { display: grid; align-content: start; gap: 12px; padding: 14px; background: #fff; }
.step-title { display: flex; align-items: center; gap: 9px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.step-title > b { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; background: #38564a; border-radius: 6px; font-size: 10px; }
.step-title strong, .step-title small { display: block; }
.step-title strong { font-size: 10px; }
.step-title small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.phone-input { min-height: 168px; }
.task-layout .task-primary-input { min-height: 168px; }
.task-confirmation { margin-top: 14px; padding: 12px 14px; background: var(--surface-soft); border: 1px solid var(--line); }
.attachment-upload { padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.attachment-upload-head { display: flex; align-items: center; gap: 10px; }
.attachment-upload-head > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-upload p { margin: 8px 0 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.file-picker { position: relative; flex: 0 0 auto; cursor: pointer; }
.file-picker input[type="file"] { display: none !important; }
.task-import-summary { display: grid; gap: 8px; }
.task-import-summary:empty { display: none; }
.import-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--line); }
.import-stat-grid div { min-width: 0; padding: 9px 8px; background: #fff; }
.import-stat-grid span, .import-stat-grid strong { display: block; }
.import-stat-grid span { color: var(--muted); font-size: 8px; }
.import-stat-grid strong { margin-top: 4px; font-size: 13px; }
.import-detail { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 9px; line-height: 1.5; }
.import-detail strong { font-size: 10px; }
.import-detail span { color: var(--muted); }
.import-detail.danger { color: var(--red); background: var(--red-soft); border-color: #efc3c7; }
.import-detail.warning { color: var(--amber); background: var(--amber-soft); border-color: #efd7a7; }
.import-existing { max-height: 190px; margin-top: 0; }
.task-provider-control { display: grid; gap: 9px; padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.task-provider-options { display: grid; gap: 8px; }
.task-provider-options[hidden] { display: none; }
.task-provider-options > p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.task-provider-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.task-provider-choice { min-width: 0; display: flex; grid-template-columns: none; align-items: center; gap: 8px; padding: 8px 9px; background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.task-provider-choice input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--green); }
.task-provider-choice span, .task-provider-choice strong, .task-provider-choice small { min-width: 0; display: block; }
.task-provider-choice strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.task-provider-choice small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.allocation-note { color: #2f4d40; background: var(--green-soft); border-color: #cae4d7; }
.compact { max-height: 260px; margin-top: 14px; border: 1px solid var(--line); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: min(390px, calc(100vw - 32px));
  padding: 11px 14px;
  color: #fff;
  background: #1c2923;
  border-radius: 6px;
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
  font-size: 11px;
}
.toast.danger { background: var(--red); }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  background: var(--surface);
}
.login-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 7vw, 110px);
  color: #eef5f1;
  background: var(--nav);
}
.login-logo { width: 52px; height: 52px; margin-bottom: 26px; font-size: 24px; }
.login-brand > div p { margin-bottom: 11px; color: #80b59f; font-size: 10px; font-weight: 800; }
.login-brand h1 { margin-bottom: 11px; font-size: clamp(34px, 5vw, 62px); }
.login-brand h2 { max-width: 660px; margin-bottom: 32px; color: #b9c7c0; font-size: clamp(17px, 2.2vw, 28px); font-weight: 400; line-height: 1.45; }
.login-principles { max-width: 720px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(255,255,255,.12); }
.login-principles span { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 13px; color: #dbe5e0; background: var(--nav); font-size: 11px; }
.login-principles b { color: #6bc19d; font-size: 9px; }
.login-panel { display: grid; place-items: center; padding: 28px; background: #fff; }
.login-panel form { width: min(360px, 100%); display: grid; gap: 14px; }
.form-heading { margin-bottom: 10px; }
.form-heading span { color: var(--green); font-size: 9px; font-weight: 800; }
.form-heading h2 { margin: 6px 0 0; font-size: 22px; }
.login-btn { min-height: 42px; margin-top: 4px; }
.demo-credentials { margin: 0; color: var(--muted); text-align: center; font-size: 9px; line-height: 1.7; }

@media (max-width: 1240px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message-workspace { grid-template-columns: 280px minmax(420px, 1fr); }
  .contact-panel { display: none; }
  .provider-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { width: 100%; grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
  .sidebar { position: static; width: 100%; min-width: 0; height: auto; padding: 10px; }
  .brand { border-bottom: 0; padding-bottom: 8px; }
  .sidebar nav { width: 100%; min-width: 0; display: flex; overflow-x: auto; margin-top: 5px; }
  .nav-link { flex: 0 0 auto; min-height: 36px; grid-template-columns: 22px auto auto; padding: 6px 9px; }
  .sidebar-policy, .sidebar-user { display: none; }
  .topbar { height: 62px; padding: 0 16px; }
  .content { padding: 16px; }
  .dashboard-row { grid-template-columns: 1fr; }
  .message-workspace { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .conversation-column { border-right: 0; }
  .conversation-list { height: auto; max-height: 300px; }
  .chat-column { min-height: 610px; border-top: 1px solid var(--line); }
  .task-layout { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 36px 24px; }
  .login-brand h1 { font-size: 36px; }
  .login-brand h2 { font-size: 17px; margin-bottom: 20px; }
  .login-panel { min-height: 480px; }
}

@media (max-width: 640px) {
  .page-title p, .date-chip { display: none; }
  .topbar { height: 56px; }
  .content { padding: 12px; }
  .section-head, .workspace-toolbar { align-items: stretch; flex-direction: column; }
  .section-actions, .toolbar-actions { width: 100%; overflow-x: auto; }
  .section-actions .btn, .toolbar-actions .btn { flex: 0 0 auto; }
  .search-box { width: 100%; }
  .metric-grid, .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 94px; padding: 12px; }
  .metric-card strong { font-size: 21px; }
  .critical-banner, .risk-banner, .receipt-banner { grid-template-columns: 30px 1fr; }
  .critical-icon { width: 28px; height: 28px; }
  .critical-banner .btn, .risk-banner .btn, .receipt-banner .btn { grid-column: 1 / -1; width: 100%; }
  .bar-chart { height: 190px; gap: 5px; padding: 15px 8px 10px; }
  .pool-principle, .check-layout, .settings-layout, .two-fields { grid-template-columns: 1fr; }
  .provider-stats { grid-template-columns: repeat(2, 1fr); }
  .adapter-flow { justify-content: flex-start; overflow-x: auto; }
  .adapter-flow span { flex: 0 0 auto; }
  .adapter-table { grid-template-columns: 1fr; }
  .adapter-table div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ownership-strip { grid-template-columns: 1fr; }
  .ownership-strip b { transform: rotate(90deg); }
  .conversation-lock { grid-template-columns: 26px 1fr; }
  .conversation-lock .btn { grid-column: 1 / -1; width: 100%; }
  .chat-head { align-items: flex-start; }
  .sticky-route { min-width: 130px; }
  .bubble { max-width: 88%; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 140px; }
  .alert-facts, .number-detail-grid { grid-template-columns: 1fr; }
  .route-change { grid-template-columns: 1fr; }
  .route-change > b { padding: 0; transform: rotate(90deg); text-align: center; }
  .import-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-principles { grid-template-columns: 1fr; }
  .login-principles span { min-height: 48px; }
}

/* PC readability redesign: larger type, clearer hierarchy and roomier controls. */
@media (min-width: 901px) {
  body { font-size: 15px; }
  .app-shell { grid-template-columns: 252px minmax(0, 1fr); }
  .sidebar { padding: 22px 15px 15px; }
  .brand { min-height: 58px; gap: 13px; padding: 0 8px 16px; }
  .brand-mark { width: 40px; height: 40px; font-size: 20px; }
  .brand strong { font-size: 19px; }
  .brand small { font-size: 12px; }
  .sidebar nav { gap: 5px; margin-top: 18px; }
  .nav-link { min-height: 48px; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 10px 12px; font-size: 14px; }
  .nav-icon { width: 26px; font-size: 17px; }
  .nav-badge { min-width: 22px; height: 22px; font-size: 11px; }
  .sidebar-policy { gap: 9px; margin: auto 5px 18px; padding: 15px; font-size: 12px; }
  .sidebar-policy strong { font-size: 13px; }
  .sidebar-user { min-height: 64px; grid-template-columns: 38px 1fr 34px; gap: 11px; padding: 11px 8px 0; }
  .avatar { width: 38px; height: 38px; font-size: 13px; }
  .sidebar-user strong { font-size: 13px; }
  .sidebar-user small { font-size: 11px; }

  .topbar { height: 62px; padding: 0 30px; }
  .page-title { gap: 14px; }
  .page-title h1 { font-size: 23px; }
  .page-title p { font-size: 12px; }
  .date-chip { min-height: 32px; padding: 6px 10px; font-size: 12px; }
  .icon-btn { width: 36px; height: 36px; font-size: 17px; }
  .alert-trigger { width: 76px; }
  .content { max-width: 1720px; padding: 14px 30px 24px; }

  .btn { min-height: 34px; padding: 7px 13px; font-size: 12px; }
  .btn.small { min-height: 30px; padding: 5px 10px; font-size: 11px; }
  .field { min-height: 36px; padding: 8px 10px; font-size: 13px; }
  label { gap: 6px; font-size: 12px; }
  .textarea { min-height: 120px; }
  .textarea.tall { min-height: 300px; }
  .form-stack { gap: 12px; }

  .section-head { min-height: 42px; margin-bottom: 10px; }
  .section-head > div:first-child { gap: 14px; }
  .section-head h2 { font-size: 19px; }
  .section-head p { font-size: 12px; }
  .date-field { width: 160px; }
  .metric-grid { gap: 10px; margin-bottom: 12px; }
  .metric-card { min-height: 98px; padding: 14px 16px; }
  .metric-card span { font-size: 12px; }
  .metric-card strong { margin-top: 7px; font-size: 28px; }
  .metric-card small { margin-top: 7px; font-size: 11px; }

  .critical-banner, .risk-banner, .receipt-banner { min-height: 62px; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; margin-bottom: 10px; padding: 10px 14px; }
  .critical-icon, .risk-icon, .receipt-icon { width: 34px; height: 34px; font-size: 18px; }
  .critical-banner strong, .risk-banner strong, .receipt-banner strong { font-size: 13px; }
  .critical-banner p, .risk-banner p, .receipt-banner p { font-size: 12px; }
  .panel { margin-bottom: 12px; }
  .panel-head { min-height: 48px; padding: 10px 15px; }
  .panel-head > div:first-child { gap: 12px; }
  .panel-head h3 { font-size: 15px; }
  .panel-head p { font-size: 11px; }
  .panel-body { padding: 14px 15px; }
  .dashboard-row { gap: 18px; }
  .legend { font-size: 12px; }
  .bar-chart { height: 250px; padding: 24px 22px 16px; }
  .chart-day { grid-template-rows: 1fr 23px 18px; }
  .chart-day strong { font-size: 12px; }
  .chart-day small { font-size: 11px; }
  .rule-list { padding: 10px 18px 16px; }
  .rule-list div { min-height: 52px; font-size: 13px; }

  th, td { padding: 9px 14px; font-size: 12px; }
  .cell-sub, .provider-cell small { margin-top: 3px; font-size: 10px; }
  .provider-cell { gap: 11px; }
  .provider-code { width: 36px; height: 36px; font-size: 11px; }
  .provider-code.large { width: 46px; height: 46px; font-size: 13px; }
  .score { min-width: 42px; padding: 7px 9px; font-size: 13px; }
  .status { min-height: 29px; padding: 6px 9px; font-size: 11px; }
  .empty { padding: 42px; }

  .provider-grid { gap: 12px; margin-bottom: 12px; }
  .provider-card { padding: 14px 16px; }
  .provider-card-head { grid-template-columns: 40px 1fr auto; gap: 11px; }
  .provider-card-head h3 { font-size: 15px; }
  .provider-card-head p { margin-top: 3px; font-size: 11px; }
  .provider-stats { margin: 18px 0; }
  .provider-stats div { padding: 13px 7px; }
  .provider-stats span { font-size: 11px; }
  .provider-stats strong { margin-top: 6px; font-size: 15px; }
  .provider-card-foot { font-size: 12px; }
  .adapter-flow { gap: 16px; padding: 28px 18px; }
  .adapter-flow span { padding: 11px 14px; font-size: 12px; }
  .adapter-table div { padding: 17px 18px; }
  .adapter-table strong { font-size: 13px; }
  .adapter-table span { font-size: 12px; }
  .pool-principle { margin-bottom: 18px; }
  .pool-principle div { padding: 17px 18px; }
  .pool-principle strong { font-size: 14px; }
  .pool-principle p { margin-top: 7px; font-size: 12px; }

  .workspace-toolbar { min-height: 56px; margin-bottom: 14px; }
  .search-box { width: min(520px, 46%); height: 42px; grid-template-columns: 34px 1fr; }
  .search-box input { font-size: 14px; }
  .message-workspace { height: calc(100vh - 170px); min-height: 660px; grid-template-columns: 330px minmax(520px, 1fr) 290px; }
  .conversation-heading { height: 60px; padding: 0 16px; }
  .conversation-heading strong { font-size: 14px; }
  .conversation-heading span { font-size: 12px; }
  .conversation-list { height: auto; }
  .conversation-item { min-height: 58px; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 7px; padding: 7px 10px; }
  .contact-avatar { width: 42px; height: 42px; font-size: 13px; }
  .conversation-copy strong { font-size: 10px; }
  .conversation-copy small { margin-top: 3px; font-size: 9px; }
  .conversation-item > b { min-width: 18px; height: 18px; font-size: 8px; }
  .chat-head { min-height: 74px; padding: 13px 18px; }
  .chat-head h2 { font-size: 18px; }
  .chat-head p { margin-top: 6px; font-size: 12px; }
  .sticky-route span { font-size: 11px; }
  .sticky-route strong { margin-top: 4px; font-size: 14px; }
  .sticky-route small { margin-top: 4px; font-size: 11px; }
  .conversation-lock { grid-template-columns: 34px 1fr auto auto; gap: 11px; padding: 13px 15px; }
  .conversation-lock > span { width: 32px; height: 32px; }
  .conversation-lock strong { font-size: 13px; }
  .conversation-lock p { margin-top: 4px; font-size: 11px; }
  .conversation-risk-notice { grid-template-columns: 34px 1fr auto; gap: 11px; padding: 13px 15px; }
  .conversation-risk-notice > span { width: 32px; height: 32px; }
  .conversation-risk-notice strong { font-size: 13px; }
  .conversation-risk-notice p { margin-top: 4px; font-size: 11px; }
  .messages { padding: 24px; }
  .message-row { margin-bottom: 17px; }
  .bubble { padding: 13px 15px; }
  .bubble p { font-size: 14px; line-height: 1.65; }
  .bubble span { margin-top: 8px; font-size: 11px; }
  .composer { padding: 13px 15px; }
  .composer textarea { min-height: 88px; padding: 12px; font-size: 14px; }
  .composer > div { margin-top: 10px; }
  .composer > div span { font-size: 11px; }
  .contact-panel { padding: 18px; }
  .contact-avatar.large { width: 58px; height: 58px; font-size: 17px; }
  .contact-title h3 { margin-top: 11px; font-size: 16px; }
  .contact-title p { margin-top: 6px; font-size: 12px; }
  .detail-group { padding: 17px 0; }
  .detail-group label { font-size: 11px; }
  .detail-group strong { margin-top: 7px; font-size: 14px; }
  .detail-group small { margin-top: 7px; font-size: 11px; }
  .ownership-strip { margin-bottom: 18px; padding: 17px 18px; }
  .ownership-strip strong { font-size: 14px; }
  .ownership-strip span { margin-top: 6px; font-size: 12px; }
  .team-head { min-height: 58px; grid-template-columns: 38px 1fr auto; gap: 11px; padding: 9px 14px; }
  .team-head > span { width: 36px; height: 36px; }
  .team-head > div { gap: 12px; }
  .team-head h3 { font-size: 15px; }
  .team-head p { font-size: 11px; }
  .team-head > strong { font-size: 12px; }
  .member-inline { gap: 10px; }
  .member-inline small { font-size: 10px; }

  .settings-account .panel-head { border-bottom: 0; }
  .password-row { padding-top: 4px; }
  .audit-head { min-height: 58px; grid-template-columns: auto minmax(0, 1fr); gap: 22px; }
  .audit-toolbar { grid-template-columns: minmax(210px, .85fr) 155px 160px minmax(180px, 1fr) auto; }
  .check-result div { min-height: 122px; padding: 18px; }
  .check-result span { font-size: 12px; }
  .check-result strong { margin-top: 9px; font-size: 30px; }
  .check-result p { padding: 18px; font-size: 12px; }
  .setting-list label { min-height: 82px; padding: 14px 18px; }
  .setting-list strong { font-size: 14px; }
  .setting-list small { margin-top: 7px; font-size: 11px; }

  .modal { width: min(620px, 100%); }
  .modal.wide-dialog { width: min(860px, 100%); }
  .modal.task-dialog { width: min(900px, 100%); }
  .modal.switch-dialog { width: min(800px, 100%); }
  .modal.alert-dialog { width: min(720px, 100%); }
  .modal-head { min-height: 68px; padding: 14px 18px; }
  .modal-head h3 { font-size: 18px; }
  .modal-body { padding: 20px; }
  .modal-foot { min-height: 72px; padding: 14px 18px; }
  .alert-severity { padding: 13px 15px; }
  .alert-severity span { font-size: 12px; }
  .alert-severity strong { font-size: 16px; }
  .alert-facts div, .number-detail-grid div { padding: 14px; }
  .alert-facts span, .number-detail-grid span { font-size: 11px; }
  .alert-facts strong, .number-detail-grid strong { margin-top: 7px; font-size: 14px; }
  .no-switch-note, .allocation-note { gap: 7px; padding: 14px 15px; }
  .no-switch-note strong, .allocation-note strong { font-size: 13px; }
  .no-switch-note span, .allocation-note p { font-size: 12px; }
  .alert-row { padding: 14px; }
  .alert-row strong { font-size: 13px; }
  .alert-row small { margin-top: 6px; font-size: 11px; }
  .alert-row em { font-size: 11px; }
  .quality-score span, .quality-score small { font-size: 12px; }
  .switch-warning { padding: 14px 15px; }
  .switch-warning strong { font-size: 13px; }
  .switch-warning p { margin-top: 7px; font-size: 12px; }
  .route-change > div { min-height: 78px; padding: 13px; }
  .route-change span { font-size: 11px; }
  .route-change strong { margin-top: 7px; font-size: 14px; }
  .route-change small { margin-top: 7px; font-size: 11px; }
  .confirm-check { font-size: 13px; }
  .task-layout > section { gap: 15px; padding: 17px; }
  .step-title > b { width: 32px; height: 32px; font-size: 13px; }
  .step-title strong { font-size: 13px; }
  .step-title small { margin-top: 4px; font-size: 11px; }
  .attachment-upload { padding: 14px 15px; }
  .attachment-upload-head > span, .attachment-upload p { font-size: 11px; }
  .import-stat-grid span { font-size: 10px; }
  .import-stat-grid strong { font-size: 15px; }
  .import-detail { padding: 11px 12px; font-size: 11px; }
  .import-detail strong { font-size: 12px; }
  .task-provider-control { gap: 12px; padding: 14px 15px; }
  .task-provider-options > p { font-size: 11px; }
  .task-provider-choice { padding: 10px 11px; }
  .task-provider-choice strong { font-size: 12px; }
  .task-provider-choice small { margin-top: 4px; font-size: 10px; }
  .toast { padding: 14px 17px; font-size: 13px; }

  .login-panel form { width: min(420px, 100%); gap: 18px; }
  .login-principles span { min-height: 72px; padding: 16px; font-size: 14px; }
  .login-principles b { font-size: 12px; }
  .form-heading span { font-size: 12px; }
  .form-heading h2 { margin-top: 8px; font-size: 28px; }
  .login-btn { min-height: 48px; }
  .demo-credentials { font-size: 12px; }
}

@media (min-width: 901px) and (max-width: 1500px) {
  .message-workspace { grid-template-columns: 320px minmax(0, 1fr); }
  .contact-panel { display: none; }
}
