/* 广告私信工作台 */

.message-page {
  --pm-brand: #ff4d1f;
  --pm-brand-soft: #fff4ef;
  --pm-navy: #111b2c;
  --pm-green: #0d9f6e;
  --pm-amber: #b8790a;
  gap: 12px;
}

.message-topbar .topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.msg-syncbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  background: linear-gradient(135deg, #fbfcff, #f5f7fb);
}

.msg-syncbar.ready {
  border-color: rgba(13, 159, 110, 0.18);
  background: linear-gradient(135deg, #f7fffb, #f3f8f7);
}

.msg-syncbar.warn {
  border-color: rgba(199, 123, 8, 0.22);
  background: #fffaf1;
}

.msg-sync-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.msg-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pm-green);
  box-shadow: 0 0 0 4px rgba(13, 159, 110, 0.12);
}

.msg-syncbar.warn .msg-live-dot {
  background: var(--pm-amber);
  box-shadow: 0 0 0 4px rgba(184, 121, 10, 0.12);
}

.msg-sync-main > div {
  min-width: 0;
}

.msg-sync-main b {
  display: block;
  font-size: 12px;
  color: var(--ink);
}

.msg-sync-main span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.msg-sync-rule {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 10.5px;
  text-align: right;
}

.msg-sync-rule code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(17, 27, 44, 0.06);
  color: var(--ink-2);
  font-size: 10px;
}

.msg-notice {
  margin: 0;
}

.msg-last-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid rgba(215, 68, 62, 0.14);
  border-radius: 10px;
  background: #fff7f6;
  color: #a83b36;
  font-size: 10.5px;
  line-height: 1.55;
}

.msg-last-error .i {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.msg-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.msg-kpis .ops-kpi {
  padding: 12px 13px;
}

.msg-kpis .ops-kpi b {
  font-size: 21px;
}

.msg-quick {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 3px;
  border-radius: 12px;
  background: #eef0f4;
  scrollbar-width: none;
}

.msg-quick::-webkit-scrollbar {
  display: none;
}

.msg-quick-btn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.msg-quick-btn.active {
  background: #fff;
  color: var(--pm-brand);
  box-shadow: 0 2px 8px -4px rgba(20, 24, 35, 0.25);
}

.msg-filter-card {
  padding: 10px 12px;
}

.msg-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-days {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #f3f4f7;
}

.msg-days button {
  height: 29px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
}

.msg-days button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(20, 24, 35, 0.1);
}

.msg-search-box {
  flex: 1 1 210px;
  min-width: 180px;
}

.msg-result-count {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.msg-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 12px;
  align-items: start;
}

.msg-list-panel {
  min-width: 0;
}

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.msg-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: 0 6px 18px -18px rgba(20, 28, 44, 0.5);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}

.msg-row:hover {
  border-color: #cfd6e1;
  transform: translateY(-1px);
}

.msg-row.selected {
  border-color: rgba(255, 77, 31, 0.25);
  border-left-color: var(--pm-brand);
  background: linear-gradient(90deg, #fff9f6, #fff 38%);
}

.msg-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(145deg, #ff7c4c, #ff3e2e);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 8px 16px -10px rgba(255, 77, 31, 0.8);
}

.msg-avatar.large {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 18px;
}

.msg-row-main {
  min-width: 0;
}

.msg-row-head {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.msg-row-head > b {
  min-width: 0;
  max-width: 42%;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-row-head time {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.pm-tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  background: #f0f2f5;
  color: #798294;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.pm-tag.lead {
  background: rgba(13, 159, 110, 0.1);
  color: #07845b;
}

.pm-tag.spoke {
  background: rgba(47, 107, 255, 0.09);
  color: #285ed6;
}

.pm-tag.phone {
  background: rgba(255, 77, 31, 0.09);
  color: #d94419;
}

.pm-tag.valid {
  background: rgba(13, 159, 110, 0.12);
  color: #07845b;
}

.pm-tag.invalid {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.pm-tag.pending {
  background: rgba(245, 158, 11, 0.13);
  color: #a16207;
}

.pm-tag.shallow {
  background: rgba(47, 107, 255, 0.1);
  color: #285ed6;
}

.pm-tag.muted {
  background: #f2f3f5;
  color: #8991a0;
}

.msg-row-last {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 9.5px;
  white-space: nowrap;
}

.msg-row-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-row-meta span + span::before {
  content: "·";
  margin-right: 8px;
  color: #c6cbd4;
}

.msg-row-arrow {
  color: #c3c9d3;
}

.msg-row-arrow .i {
  width: 15px;
  height: 15px;
}

.msg-detail-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px -28px rgba(20, 28, 44, 0.6);
  scrollbar-width: thin;
}

.msg-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 430px;
  padding: 30px;
  color: var(--ink-3);
  text-align: center;
}

.msg-detail-empty .i {
  width: 34px;
  height: 34px;
  color: #b8c0ce;
}

.msg-detail-empty b {
  color: var(--ink-2);
  font-size: 13px;
}

.msg-detail-empty span {
  max-width: 240px;
  font-size: 10.5px;
  line-height: 1.6;
}

.pm-detail {
  padding: 15px;
}

.pm-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-detail-person {
  flex: 1;
  min-width: 0;
}

.pm-detail-person h2 {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-detail-person p {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-detail-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pm-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
}

.pm-detail-summary > div,
.pm-attribution > div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #edf0f4;
  border-radius: 9px;
  background: #fafbfc;
}

.pm-detail-summary span,
.pm-attribution span {
  display: block;
  color: var(--ink-3);
  font-size: 9px;
}

.pm-detail-summary b,
.pm-attribution b {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-detail-summary small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-attribution {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.pm-intent-panel {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(47, 107, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(47, 107, 255, 0.045), #fff 62%);
}

.pm-intent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pm-intent-head > div {
  min-width: 0;
}

.pm-intent-head b {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.pm-intent-head span:not(.pm-tag) {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.5;
}

.pm-intent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.pm-intent-grid > div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(20, 24, 35, 0.05);
}

.pm-intent-grid span,
.pm-intent-grid small {
  display: block;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-intent-grid b {
  display: block;
  margin: 2px 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-intent-grid b.good {
  color: #07845b;
}

.pm-intent-grid b.warn {
  color: #a16207;
}

.pm-intent-grid b.bad {
  color: #b91c1c;
}

.pm-intent-note,
.pm-intent-error {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.55;
}

.pm-intent-error {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #b45309;
}

.pm-intent-error .i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

/* ── 线索回传工作台 ───────────────────────────────────────── */

.callback-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.callback-kpis .ops-kpi {
  padding: 12px 13px;
}

.callback-kpis .ops-kpi b {
  font-size: 21px;
}

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

.callback-rules > div {
  padding: 11px 12px;
  border: 1px solid rgba(20, 24, 35, 0.06);
  border-radius: 11px;
  background: #fff;
}

.callback-rules b {
  display: block;
  color: var(--ink-2);
  font-size: 10.5px;
}

.callback-rules span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1.55;
}

.callback-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.callback-filters {
  flex: 1;
  min-width: 0;
}

.callback-filters .msg-quick-btn span {
  margin-left: 5px;
  color: var(--ink-3);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.callback-table-card {
  padding: 0;
  overflow: hidden;
}

.callback-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.callback-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 10px;
}

.callback-table th {
  padding: 9px 10px;
  background: #f7f8fa;
  color: var(--ink-3);
  font-size: 8.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.callback-table td {
  padding: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}

.callback-table td b {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-table td small {
  display: block;
  max-width: 240px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.callback-table td small.reason {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.callback-table td .pm-tag {
  height: 18px;
  margin-bottom: 3px;
}

.callback-event {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.callback-event.shallow {
  background: rgba(47, 107, 255, 0.1);
  color: #285ed6;
}

.callback-event.deep {
  background: rgba(13, 159, 110, 0.12);
  color: #07845b;
}

.callback-status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: #f0f2f5;
  color: #798294;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.callback-status.good {
  background: rgba(13, 159, 110, 0.12);
  color: #07845b;
}

.callback-status.bad {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.callback-status.warn {
  background: rgba(245, 158, 11, 0.13);
  color: #a16207;
}

.callback-status.muted {
  background: #f2f3f5;
  color: #8991a0;
}

.callback-no-action {
  color: var(--ink-3);
  font-size: 9px;
}

.callback-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.callback-empty {
  padding: 6px;
}

/* 线索主干：一条留资私信同时承载浅层 / 深层两个事件 */

.callback-lead-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.callback-lead-list {
  display: grid;
  gap: 12px;
}

.callback-lead-card {
  overflow: hidden;
  border: 1px solid rgba(20, 24, 35, 0.08);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(18, 25, 40, 0.035);
}

.callback-lead-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid rgba(20, 24, 35, 0.055);
  background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%);
}

.callback-lead-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.callback-lead-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(47, 107, 255, 0.1);
  color: #285ed6;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.callback-lead-mark .i {
  width: 12px;
  height: 12px;
}

.callback-lead-identity b {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-lead-identity > span:not(.callback-lead-mark) {
  overflow: hidden;
  max-width: 220px;
  color: var(--ink-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-lead-identity em {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--ink-3);
  font-size: 8.5px;
  font-style: normal;
  white-space: nowrap;
}

.callback-lead-time {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 5px;
  text-align: right;
  white-space: nowrap;
}

.callback-lead-time span,
.callback-lead-time small {
  color: var(--ink-3);
  font-size: 8.5px;
}

.callback-lead-time b {
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
}

.callback-lead-time small {
  grid-column: 1 / -1;
}

.callback-lead-meta {
  display: flex;
  align-items: center;
  gap: 8px 15px;
  flex-wrap: wrap;
  padding: 9px 15px;
  color: var(--ink-3);
  font-size: 9px;
}

.callback-lead-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.callback-lead-meta .i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: #8b94a5;
}

.callback-lead-meta .callback-session {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.callback-lead-preview {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 15px 11px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f8fb;
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.55;
}

.callback-lead-preview .i {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: #8b94a5;
}

.callback-lead-preview span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.callback-event-panel {
  overflow: hidden;
  border: 1px solid rgba(20, 24, 35, 0.075);
  border-radius: 11px;
  background: #fff;
}

.callback-event-panel.shallow {
  border-top: 3px solid #4d7df3;
}

.callback-event-panel.deep {
  border-top: 3px solid #12a474;
}

.callback-event-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 8px;
  border-bottom: 1px solid rgba(20, 24, 35, 0.05);
  background: #fbfcfe;
}

.callback-event-panel > header > div {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.callback-event-panel code {
  color: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}

.callback-event-body {
  padding: 9px 10px 10px;
}

.callback-checkline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.callback-checkline b {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-event-body > small {
  display: block;
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.5;
}

.callback-event-body .pm-tag {
  height: 18px;
  flex: 0 0 auto;
}

.callback-backfill-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 7px;
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.1);
  color: #946200;
  font-size: 8.5px;
  line-height: 1.45;
}

.callback-backfill-note .i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.callback-event-reason {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.callback-event-foot {
  display: flex;
  align-items: center;
  gap: 4px 9px;
  flex-wrap: wrap;
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 8px;
}

.callback-event-foot span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-manual-note {
  display: block;
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 8.5px;
}

.callback-event-body .callback-actions {
  margin-top: 8px;
}

.callback-event-body .callback-actions .desk-btn {
  min-height: 26px;
  padding: 0 8px;
  font-size: 9px;
}

.callback-event-body .callback-mark-btn {
  border-color: rgba(20, 24, 35, 0.09);
  background: #fff;
  color: var(--ink-3);
}

.callback-chain {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px 9px;
  border-top: 1px solid rgba(20, 24, 35, 0.055);
  background: #fbfcfe;
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1.5;
}

.callback-chain .i {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.callback-chain.done {
  background: rgba(13, 159, 110, 0.055);
  color: #087a56;
}

.callback-chain.backfill {
  background: rgba(245, 158, 11, 0.07);
  color: #936000;
}

/* 单行线索：摘要 + 浅转 / 深转两块 + 时间与操作 */

.callback-lead-list {
  gap: 7px;
}

.callback-lead-row {
  overflow: hidden;
  border: 1px solid rgba(20, 24, 35, 0.08);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(18, 25, 40, 0.025);
}

.callback-lead-row.expanded {
  border-color: rgba(47, 107, 255, 0.22);
  box-shadow: 0 6px 18px rgba(18, 25, 40, 0.055);
}

.callback-lead-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.05fr) minmax(360px, 1.15fr) 92px auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
}

.callback-lead-summary {
  min-width: 0;
}

.callback-lead-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.callback-lead-title .callback-lead-mark {
  height: 18px;
  padding: 0 6px;
  font-size: 8px;
}

.callback-lead-title b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.callback-lead-title > span:not(.callback-lead-mark) {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-lead-title em {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: #f1f3f6;
  color: var(--ink-3);
  font-size: 8px;
  font-style: normal;
}

.callback-lead-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8.5px;
  white-space: nowrap;
}

.callback-lead-sub > span {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.callback-lead-sub .callback-lead-plan {
  flex: 1 1 auto;
  max-width: none;
}

.callback-lead-sub i {
  flex: 0 0 auto;
  color: #c5cad3;
  font-style: normal;
}

.callback-mini-events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.callback-mini-event {
  min-width: 0;
  padding: 4px 6px 5px;
  border: 1px solid rgba(20, 24, 35, 0.065);
  border-left-width: 3px;
  border-radius: 7px;
  background: #fbfcfe;
}

.callback-mini-event.shallow {
  border-left-color: #4d7df3;
}

.callback-mini-event.deep {
  border-left-color: #12a474;
}

.callback-mini-head {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.callback-mini-name {
  flex: 0 0 auto;
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}

.callback-mini-backfill {
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.14);
  color: #9a6500;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 650;
}

.callback-mini-head .callback-status {
  height: 17px;
  padding: 0 5px;
  font-size: 8px;
}

.callback-mini-action {
  min-height: 19px;
  margin-left: auto;
  padding: 0 5px;
  border: 1px solid rgba(20, 24, 35, 0.1);
  border-radius: 5px;
  background: #fff;
  color: var(--ink-2);
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.callback-mini-action.primary {
  border-color: transparent;
  background: #2f6bff;
  color: #fff;
}

.callback-mini-summary {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-row-time {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}

.callback-row-time b {
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 650;
}

.callback-row-time small {
  max-width: 92px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8px;
  text-overflow: ellipsis;
}

.callback-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.callback-row-actions .desk-btn {
  min-height: 26px;
  padding: 0 7px;
  font-size: 8.5px;
}

.callback-row-actions .i {
  width: 12px;
  height: 12px;
}

.callback-expand-btn .i {
  transition: transform 0.16s ease;
}

.callback-lead-row.expanded .callback-expand-btn .i {
  transform: rotate(90deg);
}

.callback-lead-expanded {
  padding: 9px 12px 10px;
  border-top: 1px solid rgba(20, 24, 35, 0.06);
  background: #fafbfd;
}

.callback-expanded-meta {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 8.5px;
}

.callback-expanded-preview {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-expanded-preview .i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

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

.callback-expanded-event {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(20, 24, 35, 0.07);
  border-radius: 9px;
  background: #fff;
}

.callback-expanded-event-head {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.callback-expanded-event-head code {
  color: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}

.callback-expanded-event-head .callback-status {
  margin-left: auto;
}

.callback-expanded-facts {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
}

.callback-expanded-facts > div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.callback-expanded-facts dt {
  color: var(--ink-3);
  font-size: 8.5px;
}

.callback-expanded-facts dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-2);
  font-size: 8.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.callback-expanded-event .callback-backfill-note {
  margin-top: 7px;
}

.callback-expanded-event .callback-manual-note {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 8.5px;
}

.callback-expanded-event .callback-actions {
  margin-top: 7px;
}

.callback-expanded-event .callback-actions .desk-btn {
  min-height: 24px;
  padding: 0 7px;
  font-size: 8.5px;
}

.callback-expanded-chain {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.5;
}

.callback-expanded-chain .i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.callback-expanded-chain.done {
  color: #087a56;
}

.callback-expanded-chain.backfill {
  color: #936000;
}

/* 右侧私信抽屉 */

.sheet-mask.callback-drawer-mask {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  border-radius: 0;
}

.sheet-mask.callback-drawer-mask .sheet-panel.callback-message-sheet {
  width: min(760px, 100vw);
  max-width: 760px;
  height: 100vh;
  max-height: 100vh;
  padding: 16px 18px calc(22px + var(--safe-b));
  border-radius: 20px 0 0 20px;
  animation: callbackDrawerIn 0.24s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.sheet-mask.callback-drawer-mask .sheet-handle {
  display: none;
}

.callback-message-sheet .sheet-body {
  overflow: auto;
  padding-top: 10px;
}

.app-frame.desktop .sheet-mask.callback-drawer-mask {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.app-frame.desktop .sheet-mask.callback-drawer-mask .sheet-panel.callback-message-sheet {
  width: min(760px, 92vw);
  max-width: 760px;
  height: 100vh;
  max-height: 100vh;
  padding: 18px 20px 24px;
  border-radius: 20px 0 0 20px;
  animation: callbackDrawerIn 0.24s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

@keyframes callbackDrawerIn {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1180px) {
  .callback-lead-main {
    grid-template-columns: minmax(190px, 0.95fr) minmax(320px, 1.15fr) 82px auto;
  }
}

@media (max-width: 960px) {
  .callback-lead-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
  }

  .callback-lead-summary {
    grid-column: 1;
  }

  .callback-mini-events {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .callback-row-time {
    grid-column: 2;
    grid-row: 1;
  }

  .callback-row-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-end;
  }

  .callback-expanded-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sheet-mask.callback-drawer-mask .sheet-panel.callback-message-sheet,
  .app-frame.desktop .sheet-mask.callback-drawer-mask .sheet-panel.callback-message-sheet {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }
}

@media (max-width: 1180px) {
  .callback-lead-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .callback-lead-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .callback-lead-time {
    text-align: left;
  }

  .callback-lead-meta .callback-session {
    margin-left: 0;
  }

  .callback-event-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .callback-lead-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .callback-lead-identity {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

.pm-detail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.pm-detail-sync {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 9px;
}

.pm-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 77, 31, 0.04), transparent 42%),
    #f6f7f9;
}

.pm-thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 12px;
  color: var(--ink-3);
  text-align: center;
}

.pm-thread-empty .i {
  width: 25px;
  height: 25px;
}

.pm-thread-empty b {
  color: var(--ink-2);
  font-size: 11px;
}

.pm-thread-empty span {
  max-width: 240px;
  font-size: 9.5px;
  line-height: 1.55;
}

.pm-day {
  align-self: center;
  margin: 2px 0;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(17, 27, 44, 0.06);
  color: var(--ink-3);
  font-size: 8.5px;
}

.pm-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.pm-msg.agent {
  align-self: flex-start;
  align-items: flex-start;
}

.pm-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.pm-msg.system {
  align-self: center;
  align-items: center;
}

.pm-bubble {
  padding: 8px 10px;
  border: 1px solid #e9ecf1;
  border-radius: 4px 11px 11px 11px;
  background: #fff;
  color: #263246;
  font-size: 11px;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.pm-msg.user .pm-bubble {
  border-color: #ffd9ca;
  border-radius: 11px 4px 11px 11px;
  background: #fff1ea;
  color: #4e2a1e;
}

.pm-msg.system .pm-bubble {
  border-radius: 9px;
  background: #f0f2f5;
  color: var(--ink-3);
}

.pm-msg-meta {
  margin-top: 3px;
  color: #9aa2b0;
  font-size: 8.5px;
  line-height: 1.4;
}

.msg-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 10px;
}

.msg-empty-list,
.message-empty-card {
  padding: 6px;
}

.message-detail-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 12px;
  color: #a83b36;
  font-size: 11px;
}

.message-detail-error .i {
  width: 16px;
  height: 16px;
}

.message-detail-error .desk-btn {
  margin-left: auto;
}

.sheet-panel.message-sheet {
  width: min(720px, 100%);
  max-height: 92vh;
}

.sheet-panel.message-sheet .sheet-body {
  overflow: auto;
  padding-bottom: 24px;
}

@media (max-width: 1279px) {
  .msg-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
  }
  .msg-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pm-intent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pm-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .callback-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .message-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .message-topbar .topbar-main {
    flex: 1 0 100%;
    min-width: 0;
  }
  .message-topbar .topbar-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .message-topbar .topbar-actions::-webkit-scrollbar {
    display: none;
  }
  .msg-workspace {
    grid-template-columns: 1fr;
  }
  .msg-detail-panel {
    display: none;
  }
  .msg-syncbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .msg-sync-rule {
    padding-left: 18px;
    text-align: left;
  }
  .msg-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .msg-kpis .ops-kpi:first-child {
    grid-column: span 2;
  }
  .callback-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .callback-rules {
    grid-template-columns: 1fr;
  }
  .msg-search-box {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    position: relative;
  }
  .msg-search-box .i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ink-3);
    pointer-events: none;
  }
  .msg-search-box input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: #fafbfc;
    font-size: 12.5px;
    outline: none;
    transition: 0.16s;
  }
  .msg-search-box input::placeholder {
    color: #b3b9c4;
  }
  .msg-search-box input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 77, 31, 0.08);
  }
  .msg-result-count {
    margin-left: 0;
  }
  .msg-row {
    padding: 12px;
  }
}

@media (max-width: 430px) {
  .message-page {
    gap: 10px;
  }
  .message-topbar .topbar-actions .opsdesk-account-chip {
    display: none;
  }
  .msg-kpis {
    gap: 7px;
  }
  .msg-kpis .ops-kpi {
    padding: 10px;
  }
  .msg-kpis .ops-kpi b {
    font-size: 18px;
  }
  .msg-row {
    grid-template-columns: 38px minmax(0, 1fr) 14px;
    gap: 8px;
  }
  .msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 13px;
  }
  .msg-row-head > b {
    max-width: 38%;
  }
  .msg-row-head .pm-tag:nth-of-type(3) {
    display: none;
  }
  .msg-filter-card {
    padding: 8px;
  }
  .msg-days {
    width: 100%;
  }
  .msg-days button {
    flex: 1;
  }
  .pm-detail {
    padding: 12px;
  }
  .pm-detail-summary {
    grid-template-columns: 1fr 1fr;
  }
  .pm-detail-summary > div:last-child {
    grid-column: span 2;
  }
  .pm-attribution {
    grid-template-columns: 1fr 1fr;
  }
  .pm-detail-head {
    align-items: flex-start;
  }
  .pm-detail-tags {
    flex-direction: row;
  }
  .tab-label {
    font-size: 9px;
  }
}

/* ── 转化跟踪（追踪线索） ─────────────────────────────────── */

.conversion-tracking-page {
  gap: 12px;
}

.ct-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.ct-kpis .ops-kpi {
  min-width: 0;
  padding: 12px 13px;
}

.ct-kpis .ops-kpi b {
  font-size: 20px;
}

.ct-kpis .ops-kpi small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.9fr);
  gap: 10px;
  align-items: start;
}

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

.ct-form .field {
  display: block;
  min-width: 0;
  margin-top: 14px;
}

.ct-form .field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
}

.ct-form .field .input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11.5px;
}

.ct-form .field.wide,
.ct-enabled,
.ct-form-actions {
  grid-column: 1 / -1;
}

.ct-enabled {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 10.5px;
  cursor: pointer;
}

.ct-enabled input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.ct-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ct-event-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.ct-event-map > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(20, 24, 35, 0.055);
  border-radius: 9px;
  background: #fafbfc;
}

.ct-event-map span,
.ct-event-map em {
  display: block;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-event-map b {
  display: block;
  margin: 2px 0;
  color: var(--ink-2);
  font-size: 10.5px;
}

.ct-check-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.ct-check-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.ct-check-row > div {
  min-width: 0;
}

.ct-check-row b {
  display: block;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.ct-check-row small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ct-check-row.ok {
  border-color: rgba(13, 159, 110, 0.18);
  background: rgba(13, 159, 110, 0.025);
}

.ct-check-row.pending {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.025);
}

.ct-check-row.fail {
  border-color: rgba(220, 38, 38, 0.16);
  background: rgba(220, 38, 38, 0.02);
}

.ct-check {
  flex: 0 0 auto;
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  background: #f0f2f5;
  color: #798294;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 19px;
  white-space: nowrap;
}

.ct-check.ok {
  background: rgba(13, 159, 110, 0.12);
  color: #07845b;
}

.ct-check.manual {
  background: rgba(47, 107, 255, 0.1);
  color: #285ed6;
}

.ct-check.pending {
  background: rgba(245, 158, 11, 0.13);
  color: #a16207;
}

.ct-check.fail {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.ct-link-box {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(47, 107, 255, 0.16);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.045), rgba(47, 107, 255, 0.015));
}

.ct-link-box .link-box {
  margin-top: 8px;
}

.ct-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ct-param-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.ct-param-grid span {
  display: block;
  color: var(--ink-3);
  font-size: 8.5px;
}

.ct-param-grid code {
  display: block;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 9.5px;
  overflow-wrap: anywhere;
}

.ct-macros {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 9px;
}

.ct-macros code {
  padding: 3px 6px;
  border-radius: 5px;
  background: #f2f4f7;
  color: var(--ink-2);
  font-size: 8.5px;
}

.ct-samples {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.ct-sample-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.ct-sample-head b {
  color: var(--ink-2);
  font-size: 10.5px;
}

.ct-sample-head span {
  color: var(--ink-3);
  font-size: 8.5px;
  text-align: right;
}

.ct-sample {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(20, 24, 35, 0.045);
}

.ct-sample:last-child {
  border-bottom: 0;
}

.ct-sample > span {
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1.5;
}

.ct-sample code {
  color: var(--ink-2);
  font-size: 8.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ct-macro-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.ct-macro-map > div {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(20, 24, 35, 0.06);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.ct-macro-map code {
  display: block;
  color: var(--ink-2);
  font-size: 8px;
  overflow-wrap: anywhere;
}

.ct-macro-map span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 8px;
}

.ct-replay {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 77, 31, 0.16);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 77, 31, 0.04), rgba(255, 77, 31, 0.012));
}

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

.ct-replay-form textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  line-height: 1.55;
}

.ct-replay-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ct-replay-controls select {
  flex: 1 1 180px;
  min-width: 0;
}

.ct-replay-preview {
  margin-top: 9px;
  color: var(--ink-3);
  font-size: 9px;
}

.ct-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.ct-preview-grid > div {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.ct-preview-grid span {
  display: block;
  color: var(--ink-3);
  font-size: 8px;
}

.ct-preview-grid code {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 8.5px;
  overflow-wrap: anywhere;
}

.ct-replay-error {
  color: #b91c1c;
  font-size: 9px;
}

.ct-replay-result,
.ct-replay-pending {
  display: grid;
  gap: 2px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 9px;
}

.ct-replay-result b {
  font-size: 10.5px;
}

.ct-replay-result span {
  color: var(--ink-2);
}

.ct-replay-result small {
  color: var(--ink-3);
  font-size: 8.5px;
  overflow-wrap: anywhere;
}

.ct-replay-result.ok {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.055);
}

.ct-replay-result.ok b {
  color: #047857;
}

.ct-replay-result.fail {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(220, 38, 38, 0.045);
}

.ct-replay-result.fail b {
  color: #b91c1c;
}

.ct-replay-pending {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
}

.ct-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.ct-action {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.ct-action > span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.ct-action b {
  display: block;
  color: var(--ink-2);
  font-size: 10.5px;
}

.ct-action p {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.55;
}

@media (max-width: 1279px) {
  .ct-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ct-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .conversion-tracking-page .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .conversion-tracking-page .topbar-main {
    flex: 1 0 100%;
    min-width: 0;
  }
  .conversion-tracking-page .topbar-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .conversion-tracking-page .topbar-actions::-webkit-scrollbar {
    display: none;
  }
  .conversion-tracking-page .topbar-actions > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .ct-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ct-form {
    grid-template-columns: 1fr;
  }
  .ct-form .field.wide,
  .ct-enabled,
  .ct-form-actions {
    grid-column: auto;
  }
  .ct-event-map,
  .ct-param-grid,
  .ct-macro-map,
  .ct-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ct-sample-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .ct-sample-head span {
    text-align: left;
  }
}

@media (max-width: 430px) {
  .conversion-tracking-page .topbar-actions .opsdesk-account-chip {
    display: none;
  }
  .ct-event-map,
  .ct-param-grid,
  .ct-macro-map,
  .ct-preview-grid {
    grid-template-columns: 1fr;
  }
  .ct-sample {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
