/* ───────────────────────────────────────────────────────────────
 * Lead Engine v1 — Phase 2 styles
 * Lifted from mockups/lead-engine-v1-2026-05-26.html, scoped under
 * `.le-view` so the new surface composes cleanly with the rest of
 * the CRM without collisions on common class names.
 * ─────────────────────────────────────────────────────────────── */

.le-view {
  --le-bg:            #0d1117;
  --le-surface:       #161c27;
  --le-surface-2:     #1e2535;
  --le-surface-hover: #232c3d;
  --le-surface-elev:  #1a212e;
  --le-border:        #313d54;
  --le-border-light:  #1e2535;

  --le-primary:       #004ef9;
  --le-primary-hover: #0041d4;
  --le-primary-dim:   rgba(0, 78, 249, 0.12);

  --le-ig-grad:       linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);

  --le-success:       #22c55e;
  --le-warning:       #f59e0b;
  --le-warning-dim:   rgba(245, 158, 11, 0.12);
  --le-danger:        #ef4444;

  /* AI lead-temperature (#16): hot / warm / cold + tinted backgrounds */
  --le-hot:           #f87171;
  --le-hot-bg:        rgba(248, 113, 113, 0.14);
  --le-warm:          #fbbf24;
  --le-warm-bg:       rgba(251, 191, 36, 0.15);
  --le-cold:          #94a3b8;
  --le-cold-bg:       rgba(148, 163, 184, 0.14);

  --le-text:          #e8edf5;
  --le-text-muted:    #9aaabe;
  --le-text-subtle:   #7a8fa8;

  --le-row-border:    rgba(255, 255, 255, 0.05);
  --le-hover-overlay: rgba(255, 255, 255, 0.04);

  --le-radius:        6px;
  --le-radius-sm:     4px;
  --le-radius-lg:     10px;

  /* Take over the full CRM main area */
  padding: 0 !important;
  background: var(--le-bg);
  color: var(--le-text);
  font-size: 14px;
  line-height: 1.45;
  display: flex !important;
  flex-direction: column;
  /* Fill the scroll area minus the in-flow footer (same pattern as inbox/clients). */
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Light theme ─────────────────────────────────────────────
   Lead Engine rides the platform theme: applyTheme() sets
   [data-theme="light"] on <html>. We remap only the --le-* COLOR
   tokens to the platform's light palette (from styles.css
   [data-theme="light"]) so Lead Engine matches the rest of the CRM.
   Radii / layout tokens are unchanged. */
[data-theme="light"] .le-view {
  --le-bg:            #f1f4f9;
  --le-surface:       #ffffff;
  --le-surface-2:     #f5f7fb;
  --le-surface-hover: #edf1f7;
  --le-surface-elev:  #ffffff;
  --le-border:        #dde3ed;
  --le-border-light:  #edf1f7;

  --le-primary:       #004ef9;
  --le-primary-hover: #0041d4;
  --le-primary-dim:   rgba(0, 78, 249, 0.10);

  --le-success:       #16a34a;
  --le-warning:       #d97706;
  --le-warning-dim:   rgba(245, 158, 11, 0.12);
  --le-danger:        #dc2626;

  --le-hot:           #e11d48;
  --le-hot-bg:        rgba(225, 29, 72, 0.10);
  --le-warm:          #d97706;
  --le-warm-bg:       rgba(217, 119, 6, 0.12);
  --le-cold:          #64748b;
  --le-cold-bg:       rgba(100, 116, 139, 0.12);

  --le-text:          #1e293b;
  --le-text-muted:    #64748b;
  --le-text-subtle:   #94a3b8;

  --le-row-border:    rgba(0, 0, 0, 0.06);
  --le-hover-overlay: rgba(0, 0, 0, 0.04);
}

.le-view.hidden { display: none !important; }

.le-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Sub-sidebar: collapsible section rail ───────────────── */
.le-sidebar {
  width: 56px;
  flex-shrink: 0;
  background: var(--le-surface);
  border-right: 1px solid var(--le-border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 4px;
  transition: width 0.18s ease;
}
.le-sidebar.expanded {
  width: 184px;
  align-items: stretch;
  padding: 14px 10px;
}
.le-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.le-sidebar.expanded .le-sidebar-brand { padding: 0 6px; }
.le-sidebar-logo {
  width: 32px;
  height: 32px;
  background: var(--le-ig-grad);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(220, 39, 67, 0.3);
}
.le-sidebar-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--le-text);
  white-space: nowrap;
  display: none;
}
.le-sidebar.expanded .le-sidebar-name { display: inline; }
.le-sidebar-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--le-text-subtle);
  border-radius: var(--le-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.le-sidebar.expanded .le-sidebar-btn {
  width: 100%;
  height: 38px;
  justify-content: flex-start;
  gap: 11px;
  padding: 0 9px;
}
.le-sidebar-btn:hover:not(.le-disabled) {
  background: var(--le-surface-2);
  color: var(--le-text);
}
.le-sidebar-btn.active {
  background: var(--le-primary-dim);
  color: #6e92ff;
}
.le-sidebar-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.le-sidebar-btn.le-disabled { opacity: 0.32; cursor: not-allowed; }
.le-sidebar-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: none;
}
.le-sidebar.expanded .le-sidebar-label { display: inline; }
/* Hover tooltip — only when collapsed (the label is visible when expanded). */
.le-sidebar:not(.expanded) .le-sidebar-btn:hover::after,
.le-sidebar:not(.expanded) .le-sidebar-collapse:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 46px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--le-surface);
  border: 1px solid var(--le-border);
  color: var(--le-text);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: var(--le-radius);
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 30;
  pointer-events: none;
}
/* Collapse toggle at the bottom of the rail */
.le-sidebar-collapse {
  margin-top: auto;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--le-text-subtle);
  border-radius: var(--le-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.le-sidebar.expanded .le-sidebar-collapse {
  width: 100%;
  justify-content: flex-start;
  padding: 0 9px;
}
.le-sidebar-collapse:hover { background: var(--le-surface-2); color: var(--le-text); }
.le-sidebar-collapse svg { width: 17px; height: 17px; flex-shrink: 0; transition: transform 0.18s; }
.le-sidebar.expanded .le-sidebar-collapse svg { transform: rotate(180deg); }

/* Connected account + Disconnect at the sidebar bottom — reachable in review mode */
.le-sidebar-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.le-sidebar-account.hidden { display: none; }
.le-sidebar-acct-handle {
  font-size: 11px;
  color: var(--le-text-subtle);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.le-sidebar:not(.expanded) .le-sidebar-acct-handle { display: none; }
.le-sidebar-disconnect:hover { background: rgba(239, 68, 68, 0.12) !important; color: var(--le-danger) !important; }

/* ── Main area + loader / empty states ───────────────────── */
.le-main { flex: 1; display: flex; min-width: 0; overflow: hidden; }

/* ── Full-width section surfaces (Leads · Lists · Sources · Metrics) ── */
.le-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--le-bg);
}
.le-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--le-border-light);
  background: var(--le-surface);
  flex-shrink: 0;
}
.le-section-head h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--le-text);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}
.le-section-head .le-section-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--le-text-subtle);
  background: var(--le-surface-2);
  padding: 1px 9px;
  border-radius: 999px;
}
.le-section-head-actions { display: flex; align-items: center; gap: 8px; }
.le-section-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.le-section-sub { font-size: 12.5px; color: var(--le-text-muted); margin: -4px 0 14px; line-height: 1.5; }
.le-section-search {
  background: var(--le-surface-2);
  border: 1px solid var(--le-border);
  border-radius: var(--le-radius);
  padding: 7px 11px;
  color: var(--le-text);
  font: inherit;
  font-size: 13px;
  width: 240px;
}
.le-section-search::placeholder { color: var(--le-text-subtle); }
.le-section-search:focus { outline: none; border-color: var(--le-primary); }
.le-section-empty {
  padding: 48px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--le-text-subtle);
  line-height: 1.6;
}

/* ── Leads table ─────────────────────────────────────────── */
.le-leads-table { width: 100%; border-collapse: collapse; }
.le-leads-table thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--le-text-subtle);
  padding: 0 14px 9px;
  border-bottom: 1px solid var(--le-border-light);
}
.le-leads-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--le-row);
  font-size: 13px;
  color: var(--le-text);
  vertical-align: middle;
}
.le-lead-row { cursor: pointer; }
.le-lead-row:hover td { background: var(--le-hover); }
.le-lead-cell-name { display: flex; align-items: center; gap: 11px; }
.le-lead-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px;
  background: var(--le-ig-grad); background-size: cover; background-position: center;
}
.le-lead-name-wrap { display: flex; flex-direction: column; min-width: 0; }
.le-lead-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-lead-handle { font-size: 11.5px; color: var(--le-text-subtle); }
.le-lead-cell-muted { color: var(--le-text-muted); }
.le-lead-cell-value { font-weight: 600; }
.le-lead-win {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--le-surface-2); color: var(--le-text-subtle);
}
.le-lead-win--on { background: var(--le-success-dim, rgba(34,197,94,0.14)); color: var(--le-success, #22c55e); }

/* ── List / source manager rows (Lists & Lead Sources sections) ── */
.le-manage-list { display: flex; flex-direction: column; gap: 6px; max-width: 660px; }
.le-manage-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--le-surface);
  border: 1px solid var(--le-border-light);
  border-radius: var(--le-radius);
}
.le-manage-row--ghost { opacity: 0.4; }
.le-manage-handle { color: var(--le-text-subtle); cursor: grab; font-size: 13px; letter-spacing: -2px; flex-shrink: 0; }
.le-manage-color { width: 26px; height: 26px; padding: 0; border: none; border-radius: 6px; background: none; cursor: pointer; flex-shrink: 0; }
.le-manage-color::-webkit-color-swatch-wrapper { padding: 2px; }
.le-manage-color::-webkit-color-swatch { border: 1px solid var(--le-border); border-radius: 5px; }
.le-manage-srcdot { width: 9px; height: 9px; border-radius: 50%; background: var(--le-success, #22c55e); flex-shrink: 0; margin: 0 4px; }
.le-manage-name {
  flex: 1; min-width: 0;
  background: var(--le-surface-2); border: 1px solid transparent;
  border-radius: 5px; padding: 7px 10px;
  color: var(--le-text); font: inherit; font-size: 13px;
}
.le-manage-name:hover { border-color: var(--le-border); }
.le-manage-name:focus { outline: none; background: var(--le-bg); border-color: var(--le-primary); }
.le-manage-count {
  font-size: 11px; font-weight: 700; color: var(--le-text-muted);
  background: var(--le-surface-2); border-radius: 999px; padding: 2px 9px; min-width: 26px; text-align: center; flex-shrink: 0;
}
.le-manage-auto {
  font-size: 11px; font-weight: 600; color: var(--le-warning, #f59e0b);
  background: var(--le-warning-dim, rgba(245,158,11,0.14)); border: none; border-radius: 999px;
  padding: 3px 8px; cursor: pointer; flex-shrink: 0;
}
.le-manage-flag, .le-manage-eye, .le-manage-del {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--le-border);
  border-radius: 6px; color: var(--le-text-subtle); cursor: pointer; font-size: 13px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.le-manage-flag:hover, .le-manage-eye:hover { border-color: var(--le-text-subtle); color: var(--le-text); }
.le-manage-flag.on { background: var(--le-primary-dim); border-color: var(--le-primary); color: #6e92ff; }
.le-manage-eye.on { border-color: var(--le-border); color: var(--le-text); }
.le-manage-del:hover { border-color: var(--le-danger, #ef4444); color: var(--le-danger, #ef4444); }
/* Core (is_system) lists — name + delete locked, the rest stays editable. */
.le-manage-name--locked { color: var(--le-text-muted); cursor: default; }
.le-manage-name--locked:hover { border-color: transparent; }
.le-manage-lock {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--le-text-subtle); font-size: 12px; cursor: help; opacity: 0.7;
}

/* ── Metrics: pipeline snapshot ──────────────────────────── */
.le-metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; max-width: 720px; }
.le-metric-card { background: var(--le-surface); border: 1px solid var(--le-border-light); border-radius: var(--le-radius-lg, 10px); padding: 16px 18px; }
.le-metric-val { font-size: 28px; font-weight: 700; color: var(--le-text); line-height: 1.1; }
.le-metric-label { font-size: 13px; font-weight: 600; color: var(--le-text); margin-top: 4px; }
.le-metric-sub { font-size: 11.5px; color: var(--le-text-subtle); margin-top: 2px; }
.le-metric-block { max-width: 720px; margin-bottom: 22px; }
.le-metric-block-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--le-text-subtle); margin-bottom: 10px; }
.le-funnel { display: flex; flex-direction: column; gap: 8px; }
.le-funnel-row { display: flex; align-items: center; gap: 12px; }
.le-funnel-name { width: 130px; flex-shrink: 0; font-size: 13px; font-weight: 500; color: var(--le-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-funnel-track { flex: 1; height: 22px; background: var(--le-surface-2); border-radius: 5px; overflow: hidden; }
.le-funnel-bar { height: 100%; border-radius: 5px; min-width: 2px; transition: width 0.3s ease; }
.le-funnel-count { width: 36px; flex-shrink: 0; text-align: right; font-size: 13px; font-weight: 700; color: var(--le-text); }

/* ── Metrics: sub-tabs + window picker ─────────────────────── */
.le-metrics-tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.le-mtab {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--le-text-muted); cursor: pointer; transition: background 0.12s, color 0.12s;
}
.le-mtab:hover { background: var(--le-surface-2); color: var(--le-text); }
.le-mtab.active { background: var(--le-surface-2); color: var(--le-text); border-color: var(--le-border); font-weight: 600; }
.le-mtab-spacer { flex: 1; }
.le-mwindow {
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 12.5px; color: var(--le-text); cursor: pointer;
}

/* ── Metrics: ROI / scorecard tables ───────────────────────── */
.le-roi-wrap { max-width: 980px; overflow-x: auto; }
.le-roi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.le-roi-table th, .le-roi-table td { padding: 9px 12px; text-align: right; white-space: nowrap; }
.le-roi-table th.l, .le-roi-table td.l { text-align: left; }
.le-roi-table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
  color: var(--le-text-subtle); border-bottom: 1px solid var(--le-border);
}
.le-roi-table tbody td { color: var(--le-text); border-bottom: 1px solid var(--le-border-light); }
.le-roi-table tbody td.l { font-weight: 600; }
.le-roi-table tbody tr:hover td { background: var(--le-surface); }
.le-roi-table tfoot td { font-weight: 700; color: var(--le-text); border-top: 1px solid var(--le-border); padding-top: 11px; }
.le-roi-good { color: var(--le-success, #22c55e); font-weight: 700; }
.le-roi-bad { color: var(--le-warning, #f59e0b); font-weight: 700; }
.le-roi-tag {
  display: inline-block; margin-left: 7px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--le-text-subtle); background: var(--le-surface-2);
  border-radius: 999px; padding: 1px 6px; vertical-align: middle;
}
.le-loading,
.le-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--le-text-muted);
  font-size: 14px;
  padding: 32px;
  text-align: center;
}

.le-empty-card {
  max-width: 460px;
  background: var(--le-surface);
  border: 1px solid var(--le-border);
  border-radius: var(--le-radius-lg);
  padding: 32px 28px;
  text-align: center;
}
.le-empty-card h2 { font-size: 18px; font-weight: 600; margin: 0 0 8px; color: var(--le-text); }
.le-empty-card p { font-size: 14px; line-height: 1.55; color: var(--le-text-muted); margin: 0 0 18px; }
.le-empty-card .le-btn-primary { display: inline-flex; }

/* ── Convo list (left pane) ──────────────────────────────── */
.le-convo-list {
  width: 340px;
  flex-shrink: 0;
  background: var(--le-surface);
  border-right: 1px solid var(--le-border-light);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.le-convo-list-head {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--le-border-light);
}
.le-convo-list-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
  color: var(--le-text);
}
.le-convo-list-head h2 .le-count {
  font-size: 11px;
  color: var(--le-text-muted);
  font-weight: 500;
  background: var(--le-surface-2);
  padding: 2px 7px;
  border-radius: 999px;
}
.le-convo-search {
  width: 100%;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  border-radius: var(--le-radius);
  padding: 7px 10px 7px 30px;
  color: var(--le-text);
  font-size: 13px;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8fa8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px;
}
.le-convo-search::placeholder { color: var(--le-text-subtle); }
.le-convo-search-row { display: flex; gap: 8px; align-items: center; }
.le-convo-search-row .le-convo-search { width: auto; flex: 1; min-width: 0; }
.le-queue-reorder {
  flex-shrink: 0; width: 34px; height: 34px;
  border-radius: var(--le-radius); border: 1px solid var(--le-border);
  background: var(--le-surface-2); color: var(--le-text-subtle);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color 0.12s, border-color 0.12s;
}
.le-queue-reorder:hover { color: var(--le-text); border-color: var(--le-text-subtle); }
.le-queue-reorder svg { width: 15px; height: 15px; }

/* ── Shared reorder / hide modal (queues · lists · sources) ── */
.le-ro-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9000; display: flex; align-items: center; justify-content: center; }
.le-ro-modal { width: 430px; max-width: 92vw; background: var(--le-surface); border: 1px solid var(--le-border); border-radius: var(--le-radius-lg, 10px); box-shadow: 0 16px 48px rgba(0,0,0,0.4); overflow: hidden; }
.le-ro-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--le-border-light); }
.le-ro-title { font-size: 15px; font-weight: 600; color: var(--le-text); }
.le-ro-sub { font-size: 12px; color: var(--le-text-subtle); margin-top: 3px; line-height: 1.5; }
.le-ro-x { border: none; background: none; color: var(--le-text-subtle); font-size: 20px; cursor: pointer; line-height: 1; flex-shrink: 0; }
.le-ro-x:hover { color: var(--le-text); }
.le-ro-list { max-height: 52vh; overflow-y: auto; padding: 10px; }
.le-ro-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--le-border-light); border-radius: var(--le-radius); background: var(--le-surface-2); margin-bottom: 6px; cursor: grab; }
.le-ro-row.le-ro-dragging { opacity: 0.4; }
.le-ro-row.le-ro-dragover { border-color: var(--le-primary); }
.le-ro-grip { color: var(--le-text-subtle); cursor: grab; font-size: 13px; }
.le-ro-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.le-ro-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--le-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-ro-pos { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--le-text-subtle); }
.le-ro-eye { border: none; background: none; color: var(--le-text-subtle); cursor: pointer; padding: 2px; display: flex; align-items: center; }
.le-ro-eye svg { width: 15px; height: 15px; }
.le-ro-eye:hover { color: var(--le-primary); }
.le-ro-arrows { display: flex; flex-direction: column; gap: 1px; }
.le-ro-arrow { border: none; background: none; color: var(--le-text-muted); font-size: 9px; cursor: pointer; padding: 1px 4px; line-height: 1; }
.le-ro-arrow:disabled { opacity: 0.25; cursor: default; }
.le-ro-arrow:hover:not(:disabled) { color: var(--le-primary); }
.le-ro-row.le-ro-hidden { opacity: 0.6; cursor: default; }
.le-ro-row.le-ro-hidden .le-ro-name { color: var(--le-text-subtle); }
.le-ro-divider { display: flex; align-items: center; gap: 8px; margin: 14px 2px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--le-text-subtle); font-weight: 600; }
.le-ro-divider-ct { margin-left: auto; background: var(--le-surface-2); border-radius: 20px; padding: 1px 7px; font-size: 10px; }
.le-ro-foot { padding: 12px 18px; border-top: 1px solid var(--le-border-light); display: flex; justify-content: flex-end; }
.le-ro-done { font: inherit; font-size: 13px; font-weight: 500; padding: 8px 18px; border-radius: var(--le-radius); background: var(--le-primary); color: #fff; border: none; cursor: pointer; }

.le-filter-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--le-border-light);
  padding: 0 6px;
  gap: 2px;
  scrollbar-width: none;
}
.le-filter-tabs::-webkit-scrollbar { display: none; }
.le-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 11px 11px 10px;
  font-size: 13px;
  color: var(--le-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  transition: color 0.12s;
}
.le-filter-tab:hover { color: var(--le-text); }
.le-filter-tab.active { color: var(--le-text); border-bottom-color: var(--le-primary); }
.le-filter-tab .le-badge { font-size: 11px; color: var(--le-text-subtle); }
.le-filter-tab.active .le-badge { color: #6e92ff; }
/* Queue tabs (show_in_sidebar lists) carry a colored dot before the label. */
.le-tab-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.le-filter-tab.le-tab-loading { opacity: 0.55; cursor: progress; }

.le-convo-items { overflow-y: auto; flex: 1; }
/* Backfill "Importing conversations…" banner */
.le-import-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  font-size: 12px; color: var(--le-text-muted);
  background: var(--le-primary-dim);
  border-bottom: 1px solid var(--le-border-light);
}
.le-import-banner strong { color: var(--le-text); font-weight: 600; }
.le-import-spinner {
  width: 13px; height: 13px; flex-shrink: 0;
  border: 2px solid var(--le-border);
  border-top-color: var(--le-primary);
  border-radius: 50%;
  animation: le-spin 0.7s linear infinite;
}
@keyframes le-spin { to { transform: rotate(360deg); } }
/* Outbound "Seen" read-receipt — emphasized vs plain "Sent" */
.le-msg-seen { font-weight: 600; opacity: 0.95; }
.le-convo-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--le-row-border);
  display: flex;
  gap: 11px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 3px solid transparent;
}
.le-convo-item:hover { background: var(--le-hover-overlay); }
.le-convo-item.active {
  background: var(--le-primary-dim);
  border-left-color: var(--le-primary);
  padding-left: 13px;
}
.le-convo-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--le-ig-grad);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
/* Profile-pic overlay — covers the gradient + initial when it loads. onerror
   removes it (IG pic urls are CDN links that expire ~4.5 days), so an
   expired/broken pic falls back to the initial instead of a blank circle. */
.le-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.le-convo-body { flex: 1; min-width: 0; }
.le-convo-row1 {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 3px;
}
.le-convo-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--le-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 180px;
}
.le-convo-time {
  font-size: 11px;
  color: var(--le-text-subtle);
  flex-shrink: 0;
  margin-left: 6px;
}
.le-convo-preview {
  font-size: 13px;
  color: var(--le-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.le-convo-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.le-tag-chip {
  font-size: 10.5px;
  color: var(--le-text-muted);
  background: var(--le-surface-2);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--le-border-light);
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.le-tag-chip.le-tag-inbound { color: #f5b76b; background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.25); }
.le-tag-chip.le-tag-outbound { color: #93b8ff; background: rgba(0,78,249,0.10); border-color: rgba(0,78,249,0.25); }
.le-tag-chip.le-tag-replied { color: #6ee7a0; background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.25); }

/* ── Thread (center pane) ────────────────────────────────── */
.le-thread {
  flex: 1;
  background: var(--le-bg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.le-thread-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--le-text-subtle);
  font-size: 14px;
  padding: 32px;
}
.le-thread-head {
  padding: 14px 22px;
  border-bottom: 1px solid var(--le-border-light);
  background: var(--le-surface);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.le-thread-head-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.le-thread-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--le-ig-grad);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.le-thread-head-meta { min-width: 0; }
.le-thread-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--le-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.le-thread-handle {
  font-size: 13px;
  color: var(--le-text-muted);
}
.le-thread-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.le-btn-secondary {
  background: var(--le-surface-2);
  color: var(--le-text);
  border: 1px solid var(--le-border);
  padding: 7px 12px;
  border-radius: var(--le-radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.le-btn-secondary:hover { background: var(--le-surface-hover); border-color: var(--le-text-subtle); }
.le-btn-secondary svg { width: 13px; height: 13px; }
.le-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.le-btn-primary {
  background: var(--le-primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--le-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s;
}
.le-btn-primary:hover { background: var(--le-primary-hover); }

.le-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 32px;
  display: flex; flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.le-day-divider {
  text-align: center;
  color: var(--le-text-subtle);
  font-size: 11px;
  margin: 6px 0 2px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Inline thread events (Added to list / Moved to stage) */
.le-thread-event {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 82%;
  font-size: 11.5px;
  color: var(--le-text-subtle);
  background: var(--le-surface);
  border: 1px solid var(--le-border-light);
  border-radius: 20px;
  padding: 4px 12px;
}
.le-thread-event svg { width: 12px; height: 12px; opacity: 0.7; flex-shrink: 0; }
.le-thread-event b { color: var(--le-text); font-weight: 600; }
.le-thread-event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.le-thread-event-time { opacity: 0.85; }
.le-thread-event-time::before { content: '·'; margin-right: 5px; }
.le-thread-event--stage {
  color: var(--le-primary);
  border-color: var(--le-primary-dim);
  background: var(--le-primary-dim);
}
.le-thread-event--stage b { color: var(--le-primary); }
.le-msg {
  position: relative;
  max-width: 60%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.le-msg.le-inbound {
  align-self: flex-start;
  background: var(--le-surface);
  border: 1px solid var(--le-border-light);
  color: var(--le-text);
  border-bottom-left-radius: 4px;
}
.le-msg.le-outbound {
  align-self: flex-end;
  background: var(--le-primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.le-msg.le-deleted {
  font-style: italic;
  opacity: 0.7;
}
.le-msg-meta {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
}
/* Inline reply (quoted message) shown above a bubble */
.le-msg-quote {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  padding: 5px 9px;
  margin-bottom: 6px;
  border-left: 3px solid currentColor;
  border-radius: 5px;
  opacity: 0.78;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 3.4em;
  overflow: hidden;
}
.le-quote-inbound { background: rgba(0, 0, 0, 0.06); }
.le-quote-outbound { background: rgba(255, 255, 255, 0.16); }
.le-msg-quote-who {
  display: block;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 1px;
}
/* Lead's reaction emoji pinned to the bubble's bottom corner */
.le-msg-has-reaction { position: relative; margin-bottom: 10px; }
.le-msg-reaction {
  position: absolute;
  bottom: -10px;
  font-size: 15px;
  line-height: 1;
  padding: 2px 3px;
  background: var(--le-surface);
  border: 1px solid var(--le-border-light);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.le-msg.le-outbound .le-msg-reaction { right: 6px; }
.le-msg.le-inbound .le-msg-reaction { left: 6px; }
/* Inbound media attachments (photo / video / audio / file) */
.le-msg-media {
  display: block;
  margin-bottom: 6px;
  max-width: 240px;
  border-radius: 12px;
  overflow: hidden;
}
.le-msg-media img,
.le-msg-media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.le-msg-audio {
  display: block;
  margin-bottom: 6px;
  max-width: 240px;
}
.le-msg-attlink {
  display: inline-block;
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.le-msg.le-outbound .le-msg-attlink { background: rgba(255, 255, 255, 0.18); }
/* Shared reel/post/story permalink — rich link card (Meta gives only the
   instagram.com link for shares, not the media file) */
.le-msg-sharecard {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  color: var(--le-text);
  text-decoration: none;
  font-size: 12px;
  max-width: 240px;
}
.le-msg-sharecard svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--le-text-muted); }
.le-sharecard-label { flex: 1; font-weight: 600; }
.le-sharecard-go { color: var(--le-primary); font-weight: 500; white-space: nowrap; }
.le-msg.le-outbound .le-msg-sharecard { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.le-msg.le-outbound .le-msg-sharecard svg { color: rgba(255, 255, 255, 0.8); }
.le-msg.le-outbound .le-sharecard-go { color: #fff; }

/* Inline Instagram embed (shared reels / posts / IGTV) — renders the actual
   content in an iframe instead of a link-out card. Reels are vertical, so the
   frame needs height; capped width keeps it tidy in the thread. Height is a
   reasonable default — tune to taste. Fallback "Open on Instagram" link sits
   beneath for private/deleted targets the embed can't render. */
.le-msg-embed { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; max-width: 326px; }
.le-msg-embed-frame {
  width: 100%;
  max-width: 326px;
  height: 600px;
  border: 1px solid var(--le-border-light);
  border-radius: 12px;
  background: var(--le-surface-2);
  overflow: hidden;
  display: block;
}
.le-msg-embed-open { font-size: 11px; color: var(--le-primary); text-decoration: none; align-self: flex-start; font-weight: 500; }
.le-msg-embed-open:hover { text-decoration: underline; }
.le-msg.le-outbound .le-msg-embed-open { color: #fff; }

/* ── Composer ────────────────────────────────────────────── */
.le-composer {
  border-top: 1px solid var(--le-border-light);
  background: var(--le-surface);
  padding: 12px 22px;
  display: flex; gap: 10px; align-items: flex-end;
  flex-shrink: 0;
}
.le-composer-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.le-composer-row { display: flex; gap: 10px; align-items: flex-end; }
.le-composer-channel {
  color: var(--le-text-muted);
  font-size: 11px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--le-border-light);
  border-radius: var(--le-radius);
  background: var(--le-surface-2);
  flex-shrink: 0;
}
.le-composer-input {
  flex: 1;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  color: var(--le-text);
  padding: 9px 14px;
  border-radius: var(--le-radius);
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 38px;
  max-height: 120px;
}
.le-composer-input::placeholder { color: var(--le-text-subtle); }
.le-composer-input:focus { outline: none; border-color: var(--le-primary); }
.le-composer-send {
  width: 38px; height: 38px;
  background: var(--le-primary);
  border: none;
  border-radius: var(--le-radius);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
  flex-shrink: 0;
}
.le-composer-send:hover { background: var(--le-primary-hover); }
.le-composer-send:disabled { opacity: 0.4; cursor: not-allowed; }
.le-composer-send svg { width: 16px; height: 16px; }

.le-composer-warning {
  background: var(--le-warning-dim);
  border-left: 2px solid var(--le-warning);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--le-text-muted);
  border-radius: var(--le-radius-sm);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  line-height: 1.45;
}
.le-composer-warning a,
.le-composer-warning button.le-link {
  color: #f5b76b;
  text-decoration: underline;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
/* Attach button — mirrors the templates button */
.le-composer-attach {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--le-border-light);
  background: var(--le-surface-2);
  color: var(--le-text-muted);
  cursor: pointer;
}
.le-composer-attach:hover:not(:disabled) {
  color: var(--le-primary);
  border-color: var(--le-primary);
}
.le-composer-attach svg { width: 16px; height: 16px; }
.le-composer-attach:disabled { opacity: 0.4; cursor: not-allowed; }
/* Reply / attachment context chips above the composer row */
.le-composer-context:empty { display: none; }
.le-composer-context {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 2px 8px;
}
.le-composer-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  border-left: 3px solid var(--le-primary);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}
.le-composer-chip-label { font-weight: 600; color: var(--le-text); flex-shrink: 0; }
.le-composer-chip-preview {
  color: var(--le-text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.le-composer-chip-x {
  flex-shrink: 0;
  border: none; background: none; cursor: pointer;
  color: var(--le-text-subtle); font-size: 16px; line-height: 1;
  padding: 0 2px;
}
.le-composer-chip-x:hover { color: var(--le-text); }
/* React affordance — inbound only, floats to the right of the bubble on
   hover. (Outbound inline-reply affordance was removed — IG doesn't reliably
   show our quoted reply on the lead's end.) */
.le-msg-react-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  right: -30px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--le-border-light);
  background: var(--le-surface);
  color: var(--le-text-soft);
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s;
}
.le-msg-react-btn svg { width: 14px; height: 14px; }
.le-msg-react-btn::before {        /* bridge the gap so hover doesn't drop */
  content: '';
  position: absolute;
  top: -6px; bottom: -6px;
  left: -16px; width: 16px;
}
.le-msg:hover .le-msg-react-btn,
.le-msg-react-btn:hover { opacity: 1; pointer-events: auto; }
.le-msg-react-btn:hover { color: var(--le-primary); border-color: var(--le-primary); }
/* Emoji reaction picker (floating, fixed-positioned in JS) */
.le-reaction-picker {
  display: flex; gap: 2px;
  background: var(--le-surface);
  border: 1px solid var(--le-border-light);
  border-radius: 20px;
  padding: 4px 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  z-index: 1000;
}
.le-reaction-opt {
  border: none; background: none; cursor: pointer;
  font-size: 19px; line-height: 1;
  padding: 3px 4px;
  border-radius: 50%;
  transition: transform 0.1s, background 0.1s;
}
.le-reaction-opt:hover { transform: scale(1.25); }
.le-reaction-opt-active { background: var(--le-primary-dim, rgba(0,78,249,0.15)); }

/* ── Right detail panel ──────────────────────────────────── */
.le-detail {
  width: 320px;
  flex-shrink: 0;
  background: var(--le-surface);
  border-left: 1px solid var(--le-border-light);
  display: flex; flex-direction: column;
  min-height: 0;
}
.le-detail-head {
  padding: 22px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--le-border-light);
}
.le-detail-avatar-link {
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.le-detail-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--le-ig-grad);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  margin: 0 auto 10px;
  box-shadow: 0 2px 14px rgba(220,39,67,0.25);
  transition: transform 0.15s;
  background-size: cover;
  background-position: center;
}
.le-detail-avatar-link:hover .le-detail-avatar { transform: scale(1.04); }
.le-detail-avatar-link:hover .le-ig-link-overlay { opacity: 1; }
.le-ig-link-overlay {
  position: absolute;
  top: -4px; right: 50%;
  transform: translateX(40px);
  background: var(--le-surface-2);
  color: #f5b76b;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--le-border);
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.le-detail-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--le-text);
}
.le-detail-handle {
  font-size: 13px;
  color: var(--le-text-muted);
}
.le-detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--le-border-light);
  padding: 0 12px;
  gap: 4px;
}
.le-detail-tab {
  padding: 11px 8px;
  font-size: 13px;
  color: var(--le-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.le-detail-tab.active { color: var(--le-text); border-bottom-color: var(--le-primary); }
.le-detail-tab.le-disabled { opacity: 0.4; cursor: not-allowed; }

.le-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 22px;
}
.le-detail-section { margin-bottom: 18px; }
.le-detail-section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.le-detail-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--le-text-subtle);
  font-weight: 600;
}
.le-detail-field {
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  padding: 8px 12px;
  border-radius: var(--le-radius);
  font-size: 13px;
  color: var(--le-text);
  word-wrap: break-word;
}
.le-detail-field.le-muted { color: var(--le-text-muted); font-style: italic; }
.le-financial-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.le-fin-cell {
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  padding: 9px 12px;
  border-radius: var(--le-radius);
}
.le-fin-label {
  font-size: 10.5px;
  color: var(--le-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}
.le-fin-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--le-text);
}
.le-charge-btn {
  width: 100%;
  background: var(--le-primary);
  border: none;
  color: white;
  padding: 11px 16px;
  border-radius: var(--le-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.12s;
  margin-top: 10px;
  font-family: inherit;
}
.le-charge-btn:hover { background: var(--le-primary-hover); }
.le-charge-btn-hint {
  font-size: 11px;
  color: var(--le-text-subtle);
  text-align: center;
  margin-top: 7px;
}

/* ── Phase 3A: pipeline stage + templates ─────── */

/* (FU state badges + row layout were Phase 3A v1 — replaced by the
   prominent .le-fu-card block further down in this file.) */

/* Pipeline stage select */
.le-stage-select {
  width: 100%;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  color: var(--le-text);
  padding: 8px 12px;
  border-radius: var(--le-radius);
  font-size: 13px;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aaabe' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}
.le-stage-select:focus {
  outline: none;
  border-color: var(--le-primary);
}

/* Composer Templates button */
.le-composer-templates {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  border-radius: var(--le-radius);
  color: var(--le-text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s;
}
.le-composer-templates:hover:not(:disabled) {
  background: var(--le-surface-hover);
  color: var(--le-text);
  border-color: var(--le-text-subtle);
}
.le-composer-templates:disabled { opacity: 0.4; cursor: not-allowed; }
.le-composer-templates svg { width: 13px; height: 13px; }

/* Template picker dropdown */
.le-template-picker {
  background: var(--le-surface-elev);
  border: 1px solid var(--le-border);
  border-radius: var(--le-radius);
  margin-bottom: 8px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.le-template-picker.hidden { display: none; }
.le-template-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--le-border-light);
}
.le-template-picker-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--le-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.le-template-picker-close {
  background: transparent;
  border: none;
  color: var(--le-text-subtle);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}
.le-template-picker-close:hover { color: var(--le-text); }
.le-template-picker-body {
  overflow-y: auto;
  flex: 1;
  padding: 4px;
}
.le-template-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--le-radius);
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
  color: var(--le-text);
}
.le-template-item:hover { background: var(--le-surface-hover); }
.le-template-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--le-text);
  margin-bottom: 2px;
}
.le-template-item-preview {
  font-size: 12px;
  color: var(--le-text-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.le-template-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--le-text-subtle);
}
.le-template-picker-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--le-border-light);
  display: flex;
  gap: 6px;
  background: var(--le-surface);
}
.le-template-picker-foot .le-btn-secondary {
  padding: 6px 10px;
  font-size: 12px;
  flex: 1;
  justify-content: center;
}

/* Template management modal — defensive fallbacks on every CSS var
   so it renders correctly even if the overlay ends up outside .le-view
   scope (CSS custom properties don't cascade across DOM boundaries). */
.le-template-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 18, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: le-modal-fade-in 0.18s ease-out;
}
@keyframes le-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes le-modal-scale-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.le-template-modal {
  background: var(--le-surface, #161c27);
  border: 1px solid var(--le-border, #313d54);
  border-radius: var(--le-radius-lg, 10px);
  width: 600px;
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  color: var(--le-text, #e8edf5);
  animation: le-modal-scale-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.le-template-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--le-border-light, #1e2535);
}
.le-template-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--le-text, #e8edf5);
}
.le-template-modal-sub {
  font-size: 12px;
  color: var(--le-text-muted, #9aaabe);
  line-height: 1.5;
}
.le-template-modal-sub code {
  background: var(--le-surface-2, #1e2535);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Menlo', monospace;
  font-size: 11px;
  color: var(--le-text, #e8edf5);
}
.le-template-modal-close {
  background: transparent;
  border: none;
  color: var(--le-text-muted, #9aaabe);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--le-radius-sm, 4px);
}
.le-template-modal-close:hover { background: var(--le-surface-2, #1e2535); color: var(--le-text, #e8edf5); }
.le-template-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--le-surface, #161c27);
}
.le-template-modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--le-border-light, #1e2535);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--le-surface, #161c27);
}

/* Template list inside modal */
.le-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.le-template-list-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  border-radius: var(--le-radius);
}
.le-template-list-main { flex: 1; min-width: 0; }
.le-template-list-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--le-text);
  margin-bottom: 4px;
}
.le-template-list-preview {
  font-size: 12px;
  color: var(--le-text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.le-template-list-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.le-template-list-actions .le-btn-secondary { padding: 5px 10px; font-size: 12px; }

/* Form controls inside modal */
.le-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--le-text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.le-form-input {
  width: 100%;
  background: var(--le-surface-2);
  border: 1px solid var(--le-border-light);
  color: var(--le-text);
  padding: 9px 12px;
  border-radius: var(--le-radius);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.12s;
}
.le-form-input:focus {
  outline: none;
  border-color: var(--le-primary);
  background: var(--le-surface-hover);
}
.le-form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.5;
}

/* Token-insert buttons row */
.le-tpl-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.le-tpl-tokens .le-btn-secondary {
  padding: 5px 9px;
  font-size: 11px;
  font-family: 'Menlo', monospace;
}

.le-tpl-preview-block { margin-top: 14px; }
.le-tpl-preview {
  background: var(--le-surface-2);
  border: 1px dashed var(--le-border);
  border-radius: var(--le-radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--le-text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 60px;
}

/* ── Phase 3A polish v4: compact FU strip + active/inactive groups ── */

/* Section title row can host inline actions (FU dropdown, "+" buttons) */
.le-detail-section-head {
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Compact Follow-Up strip ─────────────────────────────────
   Same surface treatment as other detail sections. State conveyed
   by a small color-filled pill + the primary action button picking
   up the same color. No heavy gradients, no big card. The color
   carries the prominence, not the size. */
.le-fu-strip {
  --le-fu-color: #7a8fa8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.le-fu-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--le-fu-color);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px color-mix(in oklab, var(--le-fu-color) 35%, transparent);
}
.le-fu-pill.le-fu-pill--empty {
  background: transparent;
  color: var(--le-text-subtle, #7a8fa8);
  border: 1px dashed var(--le-border, #313d54);
  font-weight: 500;
  box-shadow: none;
}
.le-fu-strip .le-btn-primary {
  background: var(--le-fu-color);
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--le-radius, 6px);
  cursor: pointer;
  font-family: inherit;
  flex: 1;
  min-width: 0;
  justify-content: center;
}
.le-fu-strip .le-btn-primary:hover {
  background: color-mix(in oklab, var(--le-fu-color) 86%, #000);
}
.le-fu-strip .le-btn-secondary {
  padding: 5px 10px;
  font-size: 11px;
}
.le-fu-context {
  font-size: 11px;
  color: var(--le-text-muted, #9aaabe);
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Tag/Source chip grid (active/inactive subsections) ──────
   "On this lead" group renders at top with solid-filled chips.
   "Available" group renders below with stronger dimming so they
   visually fade into the background — clear separation between
   what's on vs what's available. */
.le-chip-group { margin-bottom: 10px; }
.le-chip-group:last-of-type { margin-bottom: 0; }
.le-chip-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--le-text-subtle, #7a8fa8);
  margin-bottom: 6px;
}
.le-chip-group--inactive .le-chip-group-label { opacity: 0.6; }
.le-chip-empty {
  font-size: 12px;
  color: var(--le-text-subtle, #7a8fa8);
  font-style: italic;
  padding: 4px 0;
}
.le-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* The chip. UNSELECTED (in "Available" group) = ghost outline +
   dimmed; SELECTED (in "On this lead" group) = full color fill with
   white text. With the active/inactive grouping, the visual job is
   clearer: solid fill above = on, dim ghost below = available. */
.le-tag-chip {
  --le-chip-color: #9aaabe;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 9px;
  background: transparent;
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--le-text-subtle, #7a8fa8);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  white-space: nowrap;
}
.le-tag-chip:hover:not(.selected) {
  background: var(--le-surface-2, #1e2535);
  color: var(--le-text, #e8edf5);
  border-color: var(--le-text-subtle, #7a8fa8);
  opacity: 1;
}
/* Inactive group: dim chips further so the "available" pool clearly
   fades into the background. Hover restores full opacity to invite
   interaction. */
.le-chip-group--inactive .le-tag-chip { opacity: 0.6; }
.le-chip-group--inactive .le-tag-chip .le-tag-chip-dot { opacity: 0.7; }
.le-chip-group--inactive .le-tag-chip:hover { opacity: 1; }
.le-chip-group--inactive .le-tag-chip:hover .le-tag-chip-dot { opacity: 1; }
.le-tag-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--le-chip-color);
  flex-shrink: 0;
  transition: background 0.12s;
}
.le-tag-chip-label { line-height: 1; }

/* Selected — bold solid fill */
.le-tag-chip.selected {
  background: var(--le-chip-color);
  border-color: var(--le-chip-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--le-chip-color) 35%, transparent);
}
.le-tag-chip.selected .le-tag-chip-dot {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Source chip — neutral blue treatment (no color dot, distinct from
   coloured tags). Same selected/unselected pattern. */
.le-tag-chip--source {
  --le-chip-color: #93b8ff;
}
.le-tag-chip--source.selected {
  background: var(--le-primary, #004ef9);
  border-color: var(--le-primary, #004ef9);
  box-shadow: 0 2px 8px rgba(0, 78, 249, 0.35);
}

/* Inline "+" button — sits at end of chip row */
.le-chip-add-mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px dashed var(--le-border, #313d54);
  color: var(--le-text-muted, #9aaabe);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: all 0.12s;
  flex-shrink: 0;
}
.le-chip-add-mini:hover {
  background: var(--le-surface-2, #1e2535);
  border-color: var(--le-primary, #004ef9);
  border-style: solid;
  color: var(--le-primary, #004ef9);
}
.le-chip-add-mini.hidden { display: none; }

/* Inline input that replaces the "+" when adding */
.le-chip-add-input {
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-primary, #004ef9);
  color: var(--le-text, #e8edf5);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  min-width: 120px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 78, 249, 0.15);
}
.le-chip-add-input::placeholder { color: var(--le-text-subtle, #7a8fa8); }
.le-chip-add-input.hidden { display: none; }

/* FU non-linear state dropdown (small, sits in section header right side) */
.le-fu-direct-select {
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  color: var(--le-text-muted, #9aaabe);
  padding: 3px 22px 3px 8px;
  border-radius: var(--le-radius-sm, 4px);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aaabe' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 11px;
}
.le-fu-direct-select:hover { color: var(--le-text, #e8edf5); border-color: var(--le-text-subtle, #7a8fa8); }
.le-fu-direct-select:focus { outline: none; border-color: var(--le-primary, #004ef9); }

/* Notes tab — large textarea + save indicator in section header */
.le-notes-textarea {
  min-height: 280px;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}
.le-save-indicator {
  font-size: 11px;
  font-weight: 500;
  color: var(--le-text-subtle, #7a8fa8);
  transition: color 0.2s;
}
.le-save-indicator.typing { color: var(--le-text-subtle, #7a8fa8); }
.le-save-indicator.saving { color: #6e92ff; }
.le-save-indicator.saved  { color: var(--le-success, #22c55e); }
.le-save-indicator.error  { color: var(--le-danger, #ef4444); }

/* ── Settings → Integrations card ────────────────────────── */
.le-settings-card .le-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2, #1e2535);
  border: 1px solid var(--border, #313d54);
  border-radius: 8px;
  margin-top: 12px;
}
.le-settings-card .le-status-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--le-ig-grad);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.le-settings-card .le-status-meta { flex: 1; min-width: 0; }
.le-settings-card .le-status-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e8edf5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.le-settings-card .le-status-since {
  font-size: 11px;
  color: var(--text-muted, #9aaabe);
}

/* ═══════════════════════════════════════════════════════════════
 * 7C LOCK — Locked detail-panel design (see mockup
 * lead-engine-detail-panel-options-2026-05-27.html Option 7C).
 * All new selectors use `le7c-` prefix so they coexist with the
 * legacy `.le-*` styles above during the transition.
 * ═══════════════════════════════════════════════════════════════ */

/* Section: divider-led, no card backgrounds */
.le7c-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--le-border-light, #1e2535);
}
.le7c-section:first-child { padding-top: 0; }
.le7c-section:last-child  { border-bottom: none; padding-bottom: 0; }
.le7c-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.le7c-label {
  font-size: 12px;
  color: var(--le-text-muted, #9aaabe);
  font-weight: 500;
  margin-bottom: 8px;
}
.le7c-section-head .le7c-label { margin-bottom: 0; }
.le7c-link {
  font-size: 11px;
  color: #6e92ff;
  background: transparent;
  border: none;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.le7c-link:hover { text-decoration: underline; }
.le7c-helper {
  font-size: 11px;
  color: var(--le-text-subtle, #7a8fa8);
  line-height: 1.5;
  margin-top: 8px;
}

/* Assigned-to dropdown */
.le7c-assigned-select {
  width: 100%;
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  color: var(--le-text, #e8edf5);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8fa8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
  padding-right: 30px;
}
.le7c-assigned-select:focus { outline: none; border-color: var(--le-primary, #004ef9); }

/* FU paired pills: current state (filled amber) + next phase (outlined
   amber, fills on hover). Same visual treatment, paired pills. */
.le7c-fu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.le7c-fu-current,
.le7c-fu-advance {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
  font-family: inherit;
  border: 1.5px solid #f5b76b;
}
.le7c-fu-current {
  background: #f5b76b;
  color: #1a1207;
}
.le7c-fu-current--empty {
  background: transparent;
  color: var(--le-text-subtle, #7a8fa8);
  border-color: var(--le-border, #313d54);
  border-style: dashed;
  font-weight: 500;
}
.le7c-fu-advance {
  background: transparent;
  color: #f5b76b;
  cursor: pointer;
  transition: all 0.15s;
}
.le7c-fu-advance:hover {
  background: #f5b76b;
  color: #1a1207;
}

/* Pipeline chevron strip — SVG-rendered, blue (primary). Filled
   chevrons = completed + current. Outlined = future. */
.le7c-chevron-strip {
  display: flex;
  gap: 1px;
  flex-wrap: nowrap;
  margin-top: 4px;
}
.le7c-chevron {
  flex: 1;
  min-width: 0;
  height: 34px;
  cursor: pointer;
  transition: opacity 0.15s;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
}
.le7c-chevron svg { width: 100%; height: 100%; display: block; }
.le7c-chevron:hover { opacity: 0.85; }

/* Tag/source chip grid — 3-per-line at panel width. Active = outlined
   amber on dark bg. Inactive = neutral outline, dimmed. */
.le7c-chip-grp { margin-bottom: 20px; }
.le7c-chip-grp:last-of-type { margin-bottom: 0; }
.le7c-chip-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.le7c-chip {
  padding: 5px 6px;
  background: transparent;
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--le-text-subtle, #7a8fa8);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.le7c-chip:hover:not(.on) {
  color: var(--le-text, #e8edf5);
  border-color: #f5b76b;
}
.le7c-chip.on {
  background: var(--le-surface-2, #1e2535);
  color: #f5b76b;
  border: 1.5px solid #f5b76b;
  font-weight: 700;
}
.le7c-chip-grp--off .le7c-chip { opacity: 0.5; }
.le7c-chip-grp--off .le7c-chip:hover { opacity: 1; }
.le7c-see-more {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-size: 11px;
  color: #6e92ff;
  background: transparent;
  border: none;
  padding: 0;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.le7c-see-more:hover { text-decoration: underline; }

/* ── Phase 4 pills (right-pane Lists + Lead Sources) ───────── */
.le-pillgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.le-pill {
  font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  padding: 7px 10px; border-radius: 20px;
  border: 1px solid var(--le-border); background: transparent; color: var(--le-text-muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.le-pill:hover { border-color: var(--le-text-subtle); color: var(--le-text); }
.le-pill.on { background: var(--le-primary); border-color: var(--le-primary); color: #fff; }
.le-pill.src.on { background: var(--le-success, #22c55e); border-color: var(--le-success, #22c55e); color: #fff; }
.le-pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.le-pill.stageflag::after { content: '◆'; font-size: 8px; opacity: 0.55; margin-left: 1px; }
.le-pill.on.stageflag::after { opacity: 0.75; }
.le-pill-divider { display: flex; align-items: center; gap: 8px; margin: 11px 0 9px; }
.le-pill-divider-ln { flex: 1; height: 1px; background: var(--le-border-light); }
.le-pill-divider-tx { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--le-text-subtle); font-weight: 600; }
.le-pill-empty { font-size: 11px; color: var(--le-text-subtle); grid-column: 1 / 3; padding: 2px 0; }

/* Inline "+" input for creating new tag/source */
.le7c-chip-add-input {
  width: 100%;
  margin-top: 8px;
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-primary, #004ef9);
  color: var(--le-text, #e8edf5);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 78, 249, 0.15);
}
.le7c-chip-add-input::placeholder { color: var(--le-text-subtle, #7a8fa8); }
.le7c-chip-add-input.hidden { display: none; }

/* Money / text input for Lead Value + Contact fields */
.le7c-money-input {
  width: 100%;
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  color: var(--le-text, #e8edf5);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.le7c-money-input:focus {
  outline: none;
  border-color: var(--le-primary, #004ef9);
}
.le7c-money-input::placeholder { color: var(--le-text-subtle, #7a8fa8); }

/* Profile tab: read-only fields + IG stats */
.le7c-readonly-field {
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--le-text, #e8edf5);
  line-height: 1.55;
  word-wrap: break-word;
}
.le7c-readonly-field--muted {
  color: var(--le-text-muted, #9aaabe);
  font-style: italic;
}
.le7c-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.le7c-stat {
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  padding: 9px 12px;
  border-radius: 6px;
}
.le7c-stat-label {
  font-size: 10.5px;
  color: var(--le-text-subtle, #7a8fa8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}
.le7c-stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--le-text, #e8edf5);
}
.le7c-field-label {
  display: block;
  font-size: 11px;
  color: var(--le-text-muted, #9aaabe);
  font-weight: 500;
  margin-bottom: 4px;
}

/* Settings tab DNF toggle */
.le7c-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.le7c-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--le-surface-hover, #232c3d);
  border: 1px solid var(--le-border, #313d54);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.le7c-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.le7c-toggle.on {
  background: #f97171;
  border-color: #f97171;
}
.le7c-toggle.on .le7c-toggle-thumb { transform: translateX(20px); }
.le7c-toggle-status {
  font-size: 12px;
  color: var(--le-text-muted, #9aaabe);
  flex: 1;
}

/* ── Customize modal — Lists + Lead Sources management ──────── */
.le7c-head-actions {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.le-custom-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.le-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 6px;
}
.le-custom-handle {
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 14px;
  cursor: grab;
  user-select: none;
  letter-spacing: -2px;
  flex-shrink: 0;
}
.le-custom-color {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid var(--le-border, #313d54);
  border-radius: 4px;
  cursor: pointer;
  padding: 1px;
  flex-shrink: 0;
}
.le-custom-color::-webkit-color-swatch-wrapper { padding: 0; }
.le-custom-color::-webkit-color-swatch { border: none; border-radius: 3px; }
.le-custom-name {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--le-text, #e8edf5);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}
.le-custom-name:hover { border-color: var(--le-border-light, #1e2535); }
.le-custom-name:focus {
  outline: none;
  border-color: var(--le-primary, #004ef9);
  background: var(--le-surface, #161c27);
}
.le-custom-delete {
  background: transparent;
  border: none;
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 4px;
  font-family: inherit;
  flex-shrink: 0;
}
.le-custom-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--le-danger, #ef4444);
}
.le-custom-add {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--le-border, #313d54);
  color: var(--le-text-muted, #9aaabe);
  padding: 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
}
.le-custom-add:hover {
  background: var(--le-surface-2, #1e2535);
  border-color: var(--le-primary, #004ef9);
  border-style: solid;
  color: var(--le-primary, #004ef9);
}

/* ── Themed confirm dialog (replaces native confirm()) ─────── */
.le-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 18, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: le-modal-fade-in 0.15s ease-out;
}
.le-confirm-dialog {
  background: var(--le-surface, #161c27);
  border: 1px solid var(--le-border, #313d54);
  border-radius: var(--le-radius-lg, 10px);
  padding: 22px 24px 18px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: le-modal-scale-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.le-confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--le-text, #e8edf5);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.le-confirm-message {
  font-size: 13px;
  color: var(--le-text-muted, #9aaabe);
  line-height: 1.5;
  margin-bottom: 18px;
}
.le-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.le-confirm-actions .le-btn-secondary {
  padding: 7px 14px;
  font-size: 12px;
}
.le-confirm-go {
  background: var(--le-primary, #004ef9);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.le-confirm-go:hover { background: var(--le-primary-hover, #0041d4); }
.le-confirm-go.le-confirm-go--danger {
  background: var(--le-danger, #ef4444);
}
.le-confirm-go.le-confirm-go--danger:hover {
  background: color-mix(in oklab, var(--le-danger, #ef4444) 88%, #000);
}

/* ── Customize modal inline-add row (replaces prompt()) ────── */
.le-custom-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--le-surface, #161c27);
  border: 1.5px solid var(--le-primary, #004ef9);
  border-radius: 6px;
  margin-bottom: 8px;
  box-shadow: 0 0 0 3px rgba(0, 78, 249, 0.12);
}
.le-custom-add-row.hidden { display: none; }
.le-custom-add-row .le-custom-name {
  border-color: transparent;
  background: transparent;
  flex: 1;
}
.le-custom-add-row .le-custom-name:focus {
  background: var(--le-surface-2, #1e2535);
  border-color: transparent;
}

/* ── Customize modal row-morph confirm (replaces confirm()) ── */
.le-custom-row--confirming {
  background: rgba(239, 68, 68, 0.10) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}
.le-custom-confirm-text {
  flex: 1;
  font-size: 12px;
  color: var(--le-text, #e8edf5);
  line-height: 1.5;
}
.le-custom-confirm-text strong {
  font-weight: 700;
  color: #fca5a5;
}

/* SortableJS ghost (the placeholder row while dragging) */
.le-custom-row--ghost {
  opacity: 0.4;
  background: var(--le-primary-dim, rgba(0, 78, 249, 0.18)) !important;
  border-color: var(--le-primary, #004ef9) !important;
}
.le-custom-handle:active { cursor: grabbing; }


/* ═══════════════════════════════════════════════════════════════
   AUTOMATIONS PAGE
   Central rules surface — mounted into #le-main when the
   sub-sidebar "Automations" section is active.
   ═══════════════════════════════════════════════════════════════ */

.le-auto-page {
  height: 100%;
  overflow-y: auto;
  padding: 28px 36px 60px;
  background: var(--le-bg, #0d1117);
}

.le-auto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.le-auto-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--le-text, #e8edf5);
  margin: 0 0 4px;
}
.le-auto-sub {
  font-size: 13px;
  color: var(--le-text-muted, #9aaabe);
  margin: 0;
}
.le-auto-head-actions { display: flex; gap: 8px; }

/* Suggestion banner — only shown when 0 automations exist */
.le-auto-suggest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(0, 78, 249, 0.08), rgba(0, 78, 249, 0.02));
  border: 1px solid rgba(0, 78, 249, 0.25);
  border-radius: 10px;
}
.le-auto-suggest-text {
  font-size: 13px;
  color: var(--le-text-muted, #9aaabe);
  line-height: 1.55;
}
.le-auto-suggest-text strong {
  color: var(--le-text, #e8edf5);
  font-weight: 600;
}

/* Filter chips (All / Active / Paused) */
.le-auto-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  align-items: center;
}
.le-auto-chip {
  padding: 5px 12px;
  background: var(--le-surface, #161c27);
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 999px;
  font-size: 12px;
  color: var(--le-text-muted, #9aaabe);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.le-auto-chip:hover {
  color: var(--le-text, #e8edf5);
  background: var(--le-surface-2, #1e2535);
}
.le-auto-chip.active {
  background: rgba(245, 158, 11, 0.12);
  color: #f5b76b;
  border-color: rgba(245, 158, 11, 0.45);
  font-weight: 500;
}
.le-auto-chip-badge {
  margin-left: 5px;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}
.le-auto-chip.active .le-auto-chip-badge {
  background: rgba(245, 158, 11, 0.22);
  color: #f5b76b;
}

/* Card list */
.le-auto-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.le-auto-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--le-text-muted, #9aaabe);
  background: var(--le-surface, #161c27);
  border: 1px dashed var(--le-border, #313d54);
  border-radius: 10px;
  line-height: 1.6;
}
.le-auto-empty strong { color: var(--le-text, #e8edf5); font-weight: 600; }

.le-auto-card {
  background: var(--le-surface, #161c27);
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 10px;
  padding: 14px 18px;
  transition: border-color 0.15s, background 0.15s;
}
.le-auto-card:hover {
  background: var(--le-surface-elev, #1a212e);
  border-color: var(--le-border, #313d54);
}
.le-auto-card--paused { opacity: 0.65; }

/* Managed #18 auto-queue card — pinned above the custom rules, mint accent. */
.le-auto-card--managed {
  border-left: 2px solid #34d399;
  margin-bottom: 18px;
}
.le-auto-card--managed.le-auto-card--off { opacity: 0.7; }
.le-auto-card--managed.le-auto-card--off { border-left-color: var(--le-border, #313d54); }
.le-lq-badge {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: #34d399; background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25); border-radius: 999px; padding: 2px 7px;
}
.le-lq-desc { font-size: 12px; line-height: 1.6; color: var(--le-text-subtle, #7a8fa8); }
.le-lq-steps { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 8px; }
.le-lq-step { font-size: 11.5px; color: var(--le-text-muted, #9aaabe); }
.le-lq-step b { color: var(--le-text, #e8edf5); font-weight: 600; }

.le-auto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.le-auto-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--le-text, #e8edf5);
}
.le-auto-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.le-auto-fires {
  font-size: 11px;
  color: var(--le-text-subtle, #7a8fa8);
}
.le-auto-fires strong {
  color: var(--le-text-muted, #9aaabe);
  font-weight: 600;
}

/* On/off toggle */
.le-auto-toggle {
  width: 34px;
  height: 20px;
  background: var(--le-surface-hover, #232c3d);
  border-radius: 999px;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}
.le-auto-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.15s;
}
.le-auto-toggle.on { background: #34d399; }
.le-auto-toggle.on::after { left: 16px; }

.le-auto-card-edit,
.le-auto-card-delete {
  background: transparent;
  border: none;
  color: var(--le-text-subtle, #7a8fa8);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.le-auto-card-edit:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--le-text, #e8edf5);
}
.le-auto-card-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff8b8b;
}

/* Rule flow (trigger → action) */
.le-auto-card-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}
.le-auto-arrow {
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 14px;
  font-weight: 500;
}
.le-auto-arrow--mini {
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 12px;
  margin: 0 4px;
}
.le-auto-trigger,
.le-auto-action {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
}
.le-auto-trigger {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #f5b76b;
}
.le-auto-action--add {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
}
.le-auto-action--remove {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ff8b8b;
}

/* List pills inside a flow statement */
.le-auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--le-surface-2, #1e2535);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--le-text, #e8edf5);
  font-weight: 500;
  border: 1px solid var(--le-border, #313d54);
}
.le-auto-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
}
.le-auto-pill--missing {
  background: transparent;
  color: var(--le-text-subtle, #7a8fa8);
  font-style: italic;
  border-color: var(--le-border-light, #1e2535);
}


/* ═══════════════════════════════════════════════════════════════
   BUILDER MODAL (3-step wizard)
   ═══════════════════════════════════════════════════════════════ */

.le-builder-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  backdrop-filter: blur(4px);
}
.le-builder-dialog {
  background: var(--le-surface, #161c27);
  border: 1px solid var(--le-border, #313d54);
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.le-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--le-border-light, #1e2535);
}
.le-builder-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--le-text, #e8edf5);
}
.le-builder-sub {
  font-size: 12px;
  color: var(--le-text-subtle, #7a8fa8);
  margin-top: 3px;
}
.le-builder-close {
  background: transparent;
  border: none;
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-top: -2px;
}
.le-builder-close:hover { color: var(--le-text, #e8edf5); }

/* Step indicator */
.le-builder-steps {
  display: flex;
  gap: 22px;
  padding: 12px 22px;
  background: var(--le-surface-elev, #1a212e);
  border-bottom: 1px solid var(--le-border-light, #1e2535);
}
.le-builder-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--le-text-subtle, #7a8fa8);
}
.le-builder-step.active { color: var(--le-text, #e8edf5); font-weight: 500; }
.le-builder-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--le-surface-2, #1e2535);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--le-text-muted, #9aaabe);
}
.le-builder-step.active .le-builder-step-num {
  background: var(--le-primary, #004ef9);
  color: #fff;
}
.le-builder-step.done .le-builder-step-num {
  background: #34d399;
  color: #0a2a1a;
}

.le-builder-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
}

.le-builder-section { margin-bottom: 22px; }
.le-builder-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--le-text-subtle, #7a8fa8);
  margin-bottom: 8px;
}
.le-builder-block {
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 8px;
  padding: 14px;
}
.le-builder-row {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr;
  gap: 10px;
  align-items: center;
}
.le-builder-arrow {
  text-align: center;
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 14px;
  font-weight: 500;
}
.le-builder-help {
  margin-top: 10px;
  font-size: 12px;
  color: var(--le-text-subtle, #7a8fa8);
  line-height: 1.55;
}

.le-builder-select {
  background: var(--le-bg, #0d1117);
  border: 1px solid var(--le-border, #313d54);
  color: var(--le-text, #e8edf5);
  padding: 9px 32px 9px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%239aaabe' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  min-width: 0;
  width: 100%;
}
.le-builder-select:focus { outline: none; border-color: var(--le-primary, #004ef9); }
.le-builder-select option:disabled { color: var(--le-text-subtle, #7a8fa8); }

.le-builder-input {
  width: 100%;
  background: var(--le-bg, #0d1117);
  border: 1px solid var(--le-border, #313d54);
  color: var(--le-text, #e8edf5);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
}
.le-builder-input:focus { outline: none; border-color: var(--le-primary, #004ef9); }

/* Actions list (step 2) */
.le-builder-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.le-builder-action-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 6px;
}
.le-builder-action-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--le-text-subtle, #7a8fa8);
  background: var(--le-surface-elev, #1a212e);
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 28px;
  text-align: center;
}
.le-builder-action-controls {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.le-builder-action-remove {
  background: transparent;
  border: none;
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
}
.le-builder-action-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff8b8b;
}
.le-builder-action-add {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--le-border, #313d54);
  color: var(--le-primary, #004ef9);
  font-size: 12.5px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.le-builder-action-add:hover {
  background: var(--le-primary-dim, rgba(0, 78, 249, 0.12));
  border-color: var(--le-primary, #004ef9);
}
.le-builder-empty {
  text-align: center;
  padding: 20px;
  font-size: 12.5px;
  color: var(--le-text-subtle, #7a8fa8);
  font-style: italic;
}

.le-builder-future {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--le-border, #313d54);
  border-radius: 8px;
  color: var(--le-text-subtle, #7a8fa8);
  font-size: 12px;
  line-height: 1.6;
}
.le-builder-future strong {
  color: var(--le-text-muted, #9aaabe);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
.le-builder-future ul { margin: 0; padding-left: 18px; }
.le-builder-future li { margin: 2px 0; }

/* Step 3 summary */
.le-builder-summary {
  margin-top: 20px;
  padding: 14px;
  background: var(--le-surface-2, #1e2535);
  border: 1px solid var(--le-border-light, #1e2535);
  border-radius: 8px;
}
.le-builder-summary-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.le-builder-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--le-border-light, #1e2535);
  background: var(--le-surface-elev, #1a212e);
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ═══════════════════════════════════════════════════════════════
   CUSTOMIZE MODAL — automations accordion (Option A borrow)
   Read-only summary at the bottom of list-edit row, with deep-link
   into Automations filtered to that list.
   ═══════════════════════════════════════════════════════════════ */

.le-custom-auto-accordion {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.20);
  border-radius: 6px;
  font-size: 12px;
  color: var(--le-text-muted, #9aaabe);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.le-custom-auto-accordion strong {
  color: var(--le-text, #e8edf5);
  font-weight: 600;
}
.le-custom-auto-link {
  background: transparent;
  border: none;
  color: var(--le-primary, #004ef9);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.le-custom-auto-link:hover {
  background: var(--le-primary-dim, rgba(0, 78, 249, 0.12));
}

/* Per-row automation count chip (Option A borrow — inline in customize) */
.le-custom-auto-chip {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.40);
  color: #f5b76b;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.le-custom-auto-chip:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.60);
}


/* ═══════════════════════════════════════════════════════════════
   PIPELINE CHEVRON STRIP (Phase 2)
   Sales stages under the convo header. Click a chevron to advance.
   ═══════════════════════════════════════════════════════════════ */
.le-pipe-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--le-border-light, #1e2535);
  background: var(--le-surface-elev, #1a212e);
  flex-wrap: wrap;
}
.le-chevrons { display: flex; flex: 1; min-width: 0; }
.le-chev {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 8px 12px 8px 24px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--le-surface-2, #1e2535);
  color: var(--le-text-subtle, #7a8fa8);
  border: none;
  font-family: inherit;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 13px 50%);
  margin-right: -9px;
  transition: background 0.13s, color 0.13s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.le-chev:first-child {
  padding-left: 14px;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
}
.le-chev:hover { background: var(--le-surface-hover, #232c3d); color: var(--le-text-muted, #9aaabe); }
.le-chev--done { background: rgba(52, 211, 153, 0.10); color: #34d399; }
.le-chev--done:hover { background: rgba(52, 211, 153, 0.16); }
.le-chev--cur {
  background: var(--le-primary, #004ef9);
  color: #fff;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(0, 78, 249, 0.4), 0 4px 14px rgba(0, 78, 249, 0.22);
}
.le-chev--cur:hover { background: var(--le-primary-hover, #0041d4); color: #fff; }
.le-chev-check { font-size: 11px; }

/* Exit off-ramps — beside the chevron, not part of it */
.le-pipe-exits { display: flex; gap: 6px; flex-shrink: 0; }
.le-pipe-exit {
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--le-border-light, #1e2535);
  background: var(--le-surface-2, #1e2535);
  color: var(--le-text-subtle, #7a8fa8);
  font-family: inherit;
  transition: all 0.13s;
}
.le-pipe-exit:hover { border-color: rgba(239, 68, 68, 0.5); color: #ff8b8b; }
.le-pipe-exit--cur {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ff8b8b;
}

/* Non-stage list pills (follow-up status, Hot, etc.) beside the chevron */
.le-pipe-side { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.le-pipe-side-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pill, #9aaabe);
  background: color-mix(in srgb, var(--pill, #9aaabe) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill, #9aaabe) 45%, transparent);
}
.le-pipe-side-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pill, #9aaabe);
}


/* ── Customize row: stage + show/hide toggles (Phase 4) ─────── */
.le-custom-flag,
.le-custom-eye {
  background: transparent;
  border: 1px solid var(--le-border, #313d54);
  color: var(--le-text-subtle, #7a8fa8);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.le-custom-flag:hover,
.le-custom-eye:hover { background: rgba(255,255,255,0.05); color: var(--le-text, #e8edf5); }
/* Stage flag ON = blue (chevron membership) */
.le-custom-flag.on {
  background: var(--le-primary-dim, rgba(0,78,249,0.14));
  border-color: var(--le-primary, #004ef9);
  color: #6e92ff;
}
/* Eye ON = showing (mint); OFF = muted */
.le-custom-eye.on {
  color: #34d399;
  border-color: rgba(52,211,153,0.4);
  background: rgba(52,211,153,0.10);
}
/* Hidden list row reads dimmer so the curated set is obvious */
.le-custom-row--hidden { opacity: 0.55; }
.le-custom-row--hidden .le-custom-name { color: var(--le-text-subtle, #7a8fa8); }


/* ── Disconnect Instagram button (settings card) ──────────────── */
.le-status-row { display: flex; align-items: center; gap: 11px; }
.le-disconnect-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ff8b8b;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.13s, border-color 0.13s;
}
.le-disconnect-btn:hover { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.6); }

/* ───────────────────────────────────────────────────────────────
 * Leads page (Lead Wizard layout) — tabs + virtualized table + modals
 * 2026-06-02 rebuild. All colours via --le-* (light mode rides the remap).
 * ─────────────────────────────────────────────────────────────── */

.le-lp { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--le-bg); position: relative; }

/* Head: title + search + filter */
.le-lp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px 12px;
}
.le-lp-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--le-text);
}
.le-lp-title-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--le-radius-sm);
  background: var(--le-warning-dim); color: var(--le-warning);
}
.le-lp-title-icon svg { width: 16px; height: 16px; }
.le-lp-tools { display: flex; align-items: center; gap: 10px; }
.le-lp-search-wrap { position: relative; display: flex; align-items: center; }
.le-lp-search-wrap svg {
  position: absolute; left: 10px; width: 14px; height: 14px; color: var(--le-text-subtle); pointer-events: none;
}
.le-lp-search {
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  color: var(--le-text); font-family: inherit; font-size: 13px;
  padding: 8px 12px 8px 30px; width: 240px; transition: border-color 0.13s;
}
.le-lp-search::placeholder { color: var(--le-text-subtle); }
.le-lp-search:focus { outline: none; border-color: var(--le-primary); }
.le-lp-filter-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  color: var(--le-text-muted); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 13px; cursor: pointer; transition: color 0.13s, border-color 0.13s;
}
.le-lp-filter-btn svg { width: 14px; height: 14px; }
.le-lp-filter-btn:hover { color: var(--le-text); border-color: var(--le-text-subtle); }

/* Tab strip */
.le-lp-tabs {
  display: flex; align-items: stretch; gap: 4px;
  padding: 0 18px; border-bottom: 1px solid var(--le-border);
  overflow-x: auto; scrollbar-width: none;
}
.le-lp-tabs::-webkit-scrollbar { display: none; }
.le-lp-tab {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--le-text-muted); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 11px 10px 10px; cursor: pointer; transition: color 0.13s;
}
.le-lp-tab:hover { color: var(--le-text); }
.le-lp-tab.active { color: var(--le-text); border-bottom-color: var(--le-primary); }
.le-lp-tabcount { font-size: 11px; color: var(--le-text-subtle); }
.le-lp-tab.active .le-lp-tabcount { color: #6e92ff; }
.le-lp-tabdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.le-lp-tabx { margin-left: 2px; font-size: 11px; opacity: 0.6; }
.le-lp-tabx:hover { opacity: 1; color: var(--le-danger); }
.le-lp-tab-add { color: var(--le-text-subtle); font-weight: 500; }
.le-lp-tab-add:hover { color: var(--le-primary); }
.le-lp-tab-gear { color: var(--le-text-subtle); padding: 11px 8px 10px; }
.le-lp-tab-gear svg { width: 15px; height: 15px; }
.le-lp-tab-gear:hover { color: var(--le-text); }

/* Virtual table */
.le-lp-table { flex: 1; min-height: 0; }
.le-lt { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.le-lt-head {
  display: grid; grid-template-columns: var(--le-lt-cols); align-items: center;
  height: 40px; padding: 0 22px; border-bottom: 1px solid var(--le-border);
  background: var(--le-surface);
}
.le-lt-hcell {
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--le-text-subtle); padding: 0 10px;
}
.le-lt-viewport {
  flex: 1; min-height: 0; overflow-y: auto; position: relative;
  scrollbar-gutter: stable; overflow-anchor: none;
}
.le-lt-spacer { position: absolute; top: 0; left: 0; width: 1px; }
.le-lt-window { position: absolute; top: 0; left: 0; right: 0; }
.le-lt-row {
  position: absolute; left: 0; right: 0; height: var(--le-lt-rowh, 56px);
  display: grid; grid-template-columns: var(--le-lt-cols); align-items: center;
  padding: 0 22px; border-bottom: 1px solid var(--le-row-border);
  cursor: pointer; box-sizing: border-box;
  content-visibility: auto; contain-intrinsic-size: auto var(--le-lt-rowh, 56px);
}
.le-lt-row:hover { background: var(--le-surface-hover); box-shadow: inset 3px 0 0 var(--le-primary); }
.le-lt-cell {
  padding: 0 10px; min-width: 0; font-size: 13px; color: var(--le-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.le-lt-muted { color: var(--le-text-subtle); }
.le-lt-value { font-variant-numeric: tabular-nums; }
.le-lt-namecell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.le-lt-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--le-surface-2);
}
.le-lt-av-fb {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--le-text-muted);
  background: var(--le-surface-2);
}
.le-lt-nametext { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.le-lt-name1 { font-size: 14px; color: var(--le-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-lt-name2 { font-size: 12px; color: var(--le-text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-lt-chips { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.le-lt-chip {
  flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  background: color-mix(in srgb, var(--c, #9aaabe) 16%, var(--le-surface));
  color: var(--c, var(--le-text-muted));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.le-lt-chip-more { background: var(--le-surface-2); color: var(--le-text-subtle); }
.le-lt-empty { padding: 28px 22px; color: var(--le-text-subtle); font-size: 13px; font-style: italic; }

/* ── Lead modal (Details / Inbox / Profile / Notes) ─────────── */
.le-lead-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(8, 11, 18, 0.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: le-fade-in 0.16s ease;
}
@keyframes le-fade-in { from { opacity: 0; } to { opacity: 1; } }
.le-lead-modal {
  position: relative; display: flex; flex-direction: column;
  width: min(560px, 94vw); height: min(680px, 88vh);
  background: var(--le-surface); border: 1px solid var(--le-border); border-radius: var(--le-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5); overflow: hidden;
}
.le-lead-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 28px; height: 28px; border: none; background: none; border-radius: var(--le-radius-sm);
  color: var(--le-text-subtle); font-size: 15px; cursor: pointer; transition: color 0.13s, background 0.13s;
}
.le-lead-modal-close:hover { color: var(--le-text); background: var(--le-surface-hover); }
.le-lead-modal-head {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 26px 20px 14px; text-align: center;
}
.le-lead-modal-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--le-surface-2); color: var(--le-text-muted); font-size: 20px; font-weight: 600;
  background-size: cover; background-position: center;
}
.le-lead-modal-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--le-text); }
.le-lead-modal-handle { font-size: 13px; color: var(--le-text-subtle); }
.le-lead-modal-tabs {
  display: flex; align-items: stretch; gap: 4px; justify-content: center;
  padding: 0 16px; border-bottom: 1px solid var(--le-border); flex-shrink: 0;
}
.le-lm-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--le-text-muted); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 10px 14px; cursor: pointer; transition: color 0.13s;
}
.le-lm-tab:hover { color: var(--le-text); }
.le-lm-tab.active { color: var(--le-text); border-bottom-color: var(--le-primary); }
.le-lead-modal-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
/* Reuse the inbox thread + detail inside the modal, full-width, no chrome */
.le-lead-modal-body .le-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.le-lead-modal-body .le-detail {
  flex: 1; min-height: 0; width: auto; border: none; overflow-y: auto;
  display: block; padding: 4px 0;
}
.le-lead-modal-body .le-detail-head,
.le-lead-modal-body .le-detail-tabs { display: none; }   /* modal's top tabs own this */
.le-lead-modal-body .le-detail-content { padding: 14px 20px; }

/* ── Filter modal + Views manager ───────────────────────────── */
.le-fm-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(8, 11, 18, 0.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: le-fade-in 0.16s ease;
}
.le-fm {
  display: flex; flex-direction: column; width: min(520px, 94vw); max-height: 86vh;
  background: var(--le-surface); border: 1px solid var(--le-border); border-radius: var(--le-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5); overflow: hidden;
}
.le-fm-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 14px; }
.le-fm-head-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: var(--le-radius-sm); background: var(--le-warning-dim); color: var(--le-warning);
}
.le-fm-head-icon svg { width: 15px; height: 15px; }
.le-fm-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--le-text); }
.le-fm-body { padding: 4px 22px 8px; overflow-y: auto; }
.le-fm-field { margin-bottom: 18px; }
.le-fm-label { display: block; font-size: 12px; font-weight: 500; color: var(--le-text-muted); margin-bottom: 8px; }
.le-fm-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.le-fm-label-row .le-fm-label { margin-bottom: 0; }
.le-fm-mode {
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: 20px;
  color: var(--le-text-muted); font-family: inherit; font-size: 11px; font-weight: 600;
  padding: 3px 10px; cursor: pointer; transition: color 0.13s, border-color 0.13s;
}
.le-fm-mode:hover { color: var(--le-text); border-color: var(--le-text-subtle); }
.le-fm-select {
  width: 100%; background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  color: var(--le-text); font-family: inherit; font-size: 13px; padding: 9px 11px; cursor: pointer;
}
.le-fm-select:focus { outline: none; border-color: var(--le-primary); }
.le-fm-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.le-fm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: 20px;
  color: var(--le-text-muted); font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 12px; cursor: pointer; transition: all 0.13s;
}
.le-fm-chip:hover { border-color: var(--le-text-subtle); color: var(--le-text); }
.le-fm-chip.on { background: var(--le-primary); border-color: var(--le-primary); color: #fff; }
.le-fm-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.le-fm-chip.on .le-fm-chip-dot { display: none; }
.le-fm-empty { font-size: 12px; color: var(--le-text-subtle); font-style: italic; }
.le-fm-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--le-border);
}
.le-fm-foot-right { display: flex; align-items: center; gap: 8px; }
.le-fm-btn {
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  color: var(--le-text-muted); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 14px; cursor: pointer; transition: color 0.13s, border-color 0.13s, background 0.13s;
}
.le-fm-btn:hover { color: var(--le-text); border-color: var(--le-text-subtle); }
.le-fm-btn-primary { background: var(--le-primary); border-color: var(--le-primary); color: #fff; }
.le-fm-btn-primary:hover { background: var(--le-primary-hover); border-color: var(--le-primary-hover); color: #fff; }

.le-vm-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.le-vm-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  padding: 9px 12px;
}
.le-vm-handle { color: var(--le-text-subtle); cursor: grab; font-size: 13px; }
.le-vm-name { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--le-text); min-width: 0; }
.le-vm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-vm-edit {
  background: none; border: none; color: var(--le-text-muted); font-family: inherit; font-size: 12px;
  cursor: pointer; padding: 2px 6px;
}
.le-vm-edit:hover { color: var(--le-primary); }
.le-vm-del { background: none; border: none; color: var(--le-text-subtle); cursor: pointer; font-size: 13px; padding: 2px 6px; }
.le-vm-del:hover { color: var(--le-danger); }

/* ── Bulk multi-select (checkboxes + floating action bar) ───── */
.le-lt-selcell { justify-content: center; padding: 0; }
/* Custom checkbox (appearance:none) so it's theme-aware in dark AND light —
   a bordered box when off, primary-filled with a white check when on. */
.le-lt-check, .le-convo-check {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 16px; height: 16px; flex-shrink: 0; position: relative; cursor: pointer;
  border: 1.5px solid var(--le-border); border-radius: 4px;
  background: var(--le-surface-2); transition: background 0.12s, border-color 0.12s;
}
.le-lt-check:hover, .le-convo-check:hover { border-color: var(--le-text-subtle); }
.le-lt-check:checked, .le-convo-check:checked { background: var(--le-primary); border-color: var(--le-primary); }
.le-lt-check:checked::after, .le-convo-check:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.le-lt-head .le-lt-selcell, .le-lt-hcell.le-lt-selcell { display: flex; align-items: center; justify-content: center; }
.le-lp-bulkbar {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 14px;
  background: var(--le-surface); border: 1px solid var(--le-border); border-radius: var(--le-radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); padding: 8px 12px;
}
.le-lp-bulk-count { font-size: 13px; font-weight: 600; color: var(--le-text); white-space: nowrap; }
.le-lp-bulk-actions { display: flex; align-items: center; gap: 6px; }
.le-lp-bulk-btn {
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  color: var(--le-text-muted); font-family: inherit; font-size: 12.5px; font-weight: 500;
  padding: 6px 11px; cursor: pointer; white-space: nowrap; transition: color 0.13s, border-color 0.13s;
}
.le-lp-bulk-btn:hover { color: var(--le-text); border-color: var(--le-text-subtle); }
.le-lp-bulk-clear {
  background: none; border: none; color: var(--le-text-subtle); font-family: inherit; font-size: 12.5px;
  cursor: pointer; padding: 6px 4px;
}
.le-lp-bulk-clear:hover { color: var(--le-danger); }
.le-lp-bulk-menu {
  position: fixed; z-index: 40; min-width: 180px; max-height: 280px; overflow-y: auto;
  background: var(--le-surface); border: 1px solid var(--le-border); border-radius: var(--le-radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); padding: 6px;
}
.le-lp-bulk-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; border-radius: var(--le-radius-sm); color: var(--le-text);
  font-family: inherit; font-size: 13px; padding: 8px 10px; cursor: pointer;
}
.le-lp-bulk-menu-item:hover { background: var(--le-surface-hover); }
.le-lp-bulk-menu-empty { padding: 10px; font-size: 12px; color: var(--le-text-subtle); font-style: italic; }

/* A display rule on .le-*-bulkbar outranks the UA [hidden] rule, so make
   hidden explicit (otherwise an empty bar shows when nothing is selected). */
.le-lp-bulkbar[hidden], .le-inbox-bulkbar[hidden] { display: none !important; }

/* Inbox convo-list bulk: per-conversation checkbox + floating bar */
.le-convo-check { margin-right: 4px; align-self: center; }
.le-inbox-bulkbar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 35;
  display: flex; align-items: center; gap: 14px;
  background: var(--le-surface); border: 1px solid var(--le-border); border-radius: var(--le-radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); padding: 8px 12px;
}

/* ── Lead status picker (Settings tab) ─────────────────────── */
.le-status-opts { display: flex; flex-direction: column; gap: 6px; }
.le-status-opt {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  background: var(--le-surface-2); border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  padding: 10px 12px; cursor: pointer; transition: border-color 0.13s, background 0.13s;
}
.le-status-opt:hover { border-color: var(--le-text-subtle); }
.le-status-opt.on { border-color: var(--le-primary); background: var(--le-primary-dim); }
.le-status-radio {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--le-border);
  flex-shrink: 0; margin-top: 1px; position: relative; transition: border-color 0.13s;
}
.le-status-opt.on .le-status-radio { border-color: var(--le-primary); }
.le-status-opt.on .le-status-radio::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--le-primary);
}
.le-status-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.le-status-opt-label { font-size: 13.5px; font-weight: 500; color: var(--le-text); }
.le-status-opt-sub { font-size: 12px; color: var(--le-text-subtle); line-height: 1.4; }
.le-status-flag { font-size: 12.5px; font-weight: 500; padding: 8px 12px; border-radius: var(--le-radius-sm); margin-bottom: 6px; }
.le-status-flag--good { background: color-mix(in srgb, var(--le-success) 14%, transparent); color: var(--le-success); }
.le-status-flag--danger { background: color-mix(in srgb, var(--le-danger) 14%, transparent); color: var(--le-danger); }

/* ── #16 AI Conversation Progress score ─────────────────────── */
/* Details-pane "Conversation Progress" block */
.le-cp .le-cp-row { display: flex; align-items: center; gap: 8px; }
.le-cp-score {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 26px; padding: 0 9px;
  font-size: 14px; font-weight: 700; line-height: 1;
  border-radius: var(--le-radius-sm); font-variant-numeric: tabular-nums;
}
.le-cp-seg {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  font-size: 11px; font-weight: 600; border-radius: 999px;
}
.le-cp-hot  { color: var(--le-hot);  background: var(--le-hot-bg); }
.le-cp-warm { color: var(--le-warm); background: var(--le-warm-bg); }
.le-cp-cold { color: var(--le-cold); background: var(--le-cold-bg); }
.le-cp-reason { margin-top: 8px; font-size: 12px; color: var(--le-text-muted); line-height: 1.45; }
.le-cp-signals { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.le-cp-sig {
  font-size: 10.5px; color: var(--le-text-subtle);
  background: var(--le-surface-2); border: 1px solid var(--le-border-light);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.le-cp-loading, .le-cp-empty { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--le-text-muted); }
.le-cp-rescore {
  margin-left: auto; cursor: pointer; background: none; border: none;
  color: var(--le-text-subtle); font-size: 14px; line-height: 1; padding: 2px;
}
.le-cp-rescore:hover { color: var(--le-text); }
.le-cp-empty button { cursor: pointer; background: none; border: none; color: var(--le-primary); font-size: 12px; font-weight: 600; padding: 0; }
.le-cp-spin {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--le-border); border-top-color: var(--le-primary);
  animation: le-cp-spin 0.7s linear infinite;
}
@keyframes le-cp-spin { to { transform: rotate(360deg); } }

/* Leads-table "Score" column chip */
.le-lt-score { display: flex; align-items: center; }
.le-score-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 21px; padding: 0 7px;
  font-size: 12px; font-weight: 700; line-height: 1;
  border-radius: var(--le-radius-sm); font-variant-numeric: tabular-nums;
}
.le-score-hot  { color: var(--le-hot);  background: var(--le-hot-bg); }
.le-score-warm { color: var(--le-warm); background: var(--le-warm-bg); }
.le-score-cold { color: var(--le-cold); background: var(--le-cold-bg); }

/* Conversation Progress — coverage + gate + link */
.le-cp-cov { margin-top: 8px; font-size: 12px; color: var(--le-text-muted); line-height: 1.45; }
.le-cp-missing { color: var(--le-text-subtle); }
.le-cp-gate { margin-top: 6px; font-size: 11.5px; color: var(--le-warning); }
.le-cp-link {
  margin-top: 8px; cursor: pointer; background: none; border: none; padding: 0;
  font-size: 12px; font-weight: 600; color: var(--le-primary);
}
.le-cp-link:hover { text-decoration: underline; }

/* ── AI tab (qualify-info) ───────────────────────────────────── */
.le-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.le-ai-head-actions { display: flex; align-items: center; gap: 12px; }
.le-ai-setup { font-size: 12.5px; color: var(--le-text-muted); line-height: 1.5; }
.le-ai-list { display: flex; flex-direction: column; gap: 12px; }
.le-ai-q { border-left: 2px solid var(--le-border); padding-left: 10px; }
.le-ai-q.le-ai-answered { border-left-color: var(--le-success); }
.le-ai-q.le-ai-partial  { border-left-color: var(--le-warning); }
.le-ai-q-head { display: flex; align-items: center; gap: 7px; }
.le-ai-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.le-ai-ic-answered { color: #fff; background: var(--le-success); }
.le-ai-ic-partial  { color: #fff; background: var(--le-warning); }
.le-ai-ic-not_yet  { color: var(--le-text-subtle); border: 1.5px solid var(--le-border); }
.le-ai-q-text { font-size: 12.5px; font-weight: 600; color: var(--le-text); line-height: 1.35; }
.le-ai-req { color: var(--le-hot); font-size: 11px; }
.le-ai-answer { margin: 4px 0 0 23px; font-size: 12.5px; color: var(--le-text); line-height: 1.4; }
.le-ai-answer.le-ai-none { color: var(--le-text-subtle); font-style: italic; }
.le-ai-quote {
  margin: 4px 0 0 23px; font-size: 11.5px; color: var(--le-text-muted);
  border-left: 2px solid var(--le-border-light); padding-left: 8px; line-height: 1.4;
}

/* ── Qualifying-questions config modal (reuses le-ro-* chrome) ── */
.le-ql-modal { width: min(640px, 94vw); }
.le-ql-list { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow: auto; padding: 2px; }
.le-ql-row { display: flex; align-items: center; gap: 8px; }
.le-ql-arrows { display: flex; flex-direction: column; }
.le-ql-text {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  background: var(--le-surface-2); border: 1px solid var(--le-border);
  border-radius: var(--le-radius-sm); color: var(--le-text); font-size: 13px;
}
.le-ql-text:focus { outline: none; border-color: var(--le-primary); }
.le-ql-weight {
  height: 32px; padding: 0 6px; background: var(--le-surface-2);
  border: 1px solid var(--le-border); border-radius: var(--le-radius-sm);
  color: var(--le-text); font-size: 12px;
}
.le-ql-req { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--le-text-muted); white-space: nowrap; cursor: pointer; }
.le-ql-del { cursor: pointer; background: none; border: none; color: var(--le-text-subtle); font-size: 18px; line-height: 1; padding: 0 4px; }
.le-ql-del:hover { color: var(--le-danger); }
.le-ql-add {
  margin-top: 10px; cursor: pointer; background: none; border: 1px dashed var(--le-border);
  border-radius: var(--le-radius-sm); color: var(--le-primary); font-size: 12.5px; font-weight: 600;
  padding: 8px; width: 100%;
}
.le-ql-add:hover { background: var(--le-surface-2); }
.le-ql-foot { display: flex; align-items: center; gap: 10px; }
.le-ql-status { font-size: 12px; color: var(--le-text-muted); margin-right: auto; }
.le-ql-save { background: var(--le-primary); color: #fff; border-color: var(--le-primary); }
.le-ql-save:hover { background: var(--le-primary-hover); }
