:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #16211c;
  --muted: #69746f;
  --line: #dce2dc;
  --brand: #1f7a5a;
  --brand-dark: #145941;
  --accent: #d69d35;
  --danger: #b84d42;
  --soft: #eaf3ee;
  --shadow: 0 18px 40px rgba(22, 33, 28, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: #17251f;
  color: #f3f7f4;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #1b1810;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
}

.brand-subtitle,
.eyebrow {
  color: #98a8a0;
  font-size: 12px;
  letter-spacing: 0;
}

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

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

.nav-group-title {
  min-height: 54px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #88a096;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}

.nav-group-title span {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.16);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 950;
}

.nav-group-title strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.15;
}

.nav-group-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  margin-left: 15px;
  padding: 10px 12px 10px 16px;
  text-align: left;
  color: #dce6e0;
  background: transparent;
  display: grid;
  gap: 4px;
  position: relative;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 999px;
  background: var(--line);
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-item.active::before,
.nav-item:hover::before {
  background: var(--brand);
}

.nav-item span {
  font-weight: 850;
}

.nav-item small {
  color: #9caf9f;
  line-height: 1.35;
}

.nav-item.active small,
.nav-item:hover small {
  color: #dce6e0;
}

.nav-group-title {
  width: 100%;
  cursor: pointer;
}

.nav-group-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.nav-group-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.nav-group-items {
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.nav-group.collapsed .nav-group-items {
  display: none;
}

.nav-group.collapsed .nav-group-chevron {
  transform: rotate(-45deg);
}

@media (max-width: 720px) {
  .lead-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-pagination-controls {
    flex-wrap: wrap;
  }

  .lead-pagination-controls label {
    flex: 1 1 140px;
  }
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  color: #dbe7df;
  line-height: 1.55;
}

.panel-label {
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 8px;
}

.main {
  padding: 22px;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

h2 {
  margin-bottom: 10px;
  font-size: 20px;
  letter-spacing: 0;
}

.topbar-actions,
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.account-btn {
  min-height: 38px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  display: grid;
  gap: 1px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(15, 27, 51, 0.05);
}

.account-btn:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.account-btn span,
.account-btn small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-btn span {
  font-size: 13px;
  font-weight: 850;
}

.account-btn small {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-account-card {
  width: 100%;
  min-height: 62px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.94), rgba(255, 255, 255, 0.94));
  color: var(--ink);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 27, 51, 0.06);
}

.sidebar-account-card:hover {
  border-color: rgba(56, 189, 248, 0.68);
  transform: translateY(-1px);
}

.account-avatar,
.auth-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-copy strong,
.account-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
  font-weight: 900;
}

.account-copy small {
  color: var(--muted);
  font-size: 11px;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.danger-btn {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 750;
}

.primary-btn {
  background: var(--brand);
  color: white;
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.ghost-btn,
.icon-btn {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.danger-btn {
  background: #fff2f0;
  border-color: #f0c6c1;
  color: var(--danger);
}

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

.metric-card,
.lead-panel,
.detail-panel,
.import-panel,
.beta-panel,
.auth-panel,
dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 28px;
}

.analytics-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.analytics-header h2,
.analytics-grid h3 {
  margin: 0 0 6px;
}

.analytics-header p {
  margin: 0;
  color: var(--muted);
}

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

.analytics-actions > strong {
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--soft);
  color: var(--brand-dark);
  white-space: nowrap;
}

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

.analytics-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.analytics-row {
  width: 100%;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  color: inherit;
  display: grid;
  gap: 6px;
}

.analytics-row:hover strong {
  color: var(--brand-dark);
}

.analytics-row:focus-visible {
  outline: 2px solid rgba(31, 122, 90, 0.35);
  outline-offset: 3px;
}

.analytics-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.analytics-row-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-row-head span,
.analytics-row small {
  color: var(--muted);
  font-size: 12px;
}

.analytics-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ed;
}

.analytics-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.sales-plan-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.sales-plan-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.sales-plan-header h2,
.sales-plan-header p {
  margin: 0;
}

.sales-plan-header p {
  color: var(--muted);
}

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

.sales-plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  gap: 14px;
  align-items: start;
  background: #fbfcfa;
}

.plan-card-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.plan-card-topline,
.plan-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sales-plan-card h3 {
  margin: 0;
  font-size: 16px;
}

.sales-plan-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.plan-meta-row span,
.plan-next-action {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.plan-meta-row span {
  border: 1px solid #e3e9e4;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
}

.plan-next-action {
  border-left: 3px solid var(--brand);
  padding: 7px 9px;
  border-radius: 0 8px 8px 0;
  background: #eef4ed;
  color: #30483e;
}

.plan-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
  background: var(--soft);
  color: var(--brand-dark);
}

.plan-type.due {
  background: #fff2f0;
  color: var(--danger);
}

.plan-type.fresh {
  background: #e5f6ea;
  color: #1f6b3a;
}

.plan-type.hot {
  background: #fff6df;
  color: #8a5a0f;
}

.plan-type.quote {
  background: #eef4ff;
  color: #315a98;
}

.plan-type.missing {
  background: #f1edf8;
  color: #615182;
}

.plan-priority {
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 850;
}

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

.plan-actions button {
  padding: 8px 10px;
  font-size: 13px;
}

.pipeline-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.pipeline-header h2,
.pipeline-header p {
  margin: 0;
}

.pipeline-header p {
  color: var(--muted);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pipeline-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  min-width: 180px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-column-header span {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 850;
}

.pipeline-card-list {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding-right: 4px;
}

.pipeline-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.pipeline-card-main {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  display: grid;
  gap: 4px;
}

.pipeline-card-main strong,
.pipeline-card-main span,
.pipeline-card-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card-main span,
.pipeline-card-main small {
  color: var(--muted);
  font-size: 12px;
}

.pipeline-card-main:hover strong {
  color: var(--brand-dark);
}

.pipeline-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card-foot button {
  padding: 7px 9px;
  font-size: 12px;
}

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

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.queue-tabs {
  padding: 14px 16px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.queue-tab:hover,
.queue-tab.active {
  border-color: rgba(31, 122, 90, 0.38);
  background: var(--soft);
  color: var(--brand-dark);
}

.queue-tab span {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  text-align: center;
  background: rgba(31, 122, 90, 0.1);
  color: var(--brand-dark);
  font-size: 12px;
}

.toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 160px auto auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.bulk-toolbar {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 150px auto minmax(180px, 1fr) auto 150px auto auto auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.bulk-toolbar strong {
  white-space: nowrap;
}

.bulk-toolbar input,
.bulk-toolbar select {
  min-height: 42px;
}

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

label,
.field-block {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
}

#outreachDraft {
  min-height: 118px;
  max-height: none;
  overflow-y: hidden;
}

.lead-table-wrap {
  overflow-x: hidden;
}

.lead-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  min-width: 0;
}

.lead-table th,
.lead-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.lead-table th {
  color: var(--muted);
  font-size: 12px;
}

.lead-row {
  background: white;
}

.lead-row:hover {
  background: #fbfcfa;
}

.lead-row.selected {
  background: var(--soft);
}

.lead-row.detail-active {
  background: #e8f5ff;
  box-shadow: inset 4px 0 0 #159fe6;
}

.analytics-pie {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 122px;
  margin: 12px 0 16px;
}

.analytics-pie-chart {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 24px #fff;
}

.analytics-pie-legend {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.analytics-pie-legend span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
}

.analytics-pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.ai-research-context {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.ai-research-context p { margin: 5px 0 10px; }
.ai-research-context ul { display: grid; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.ai-research-context li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ai-research-context li span { min-width: 0; overflow-wrap: anywhere; }
.ai-research-context em { flex: 0 0 auto; color: #b42318; font-style: normal; }
.ai-research-context em.found { color: #087443; }

.ai-research-related {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid #dbe8ef;
}

.ai-research-related article {
  display: grid;
  gap: 6px;
  padding: 9px 0;
  border-bottom: 1px solid #e8eff3;
}

.ai-research-related article:last-child { border-bottom: 0; }
.ai-research-related header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ai-research-related header span { display: grid; gap: 2px; min-width: 0; }
.ai-research-related header b { overflow-wrap: anywhere; }
.ai-research-related header small { color: #5f7387; }
.ai-research-related header em { flex: 0 0 auto; font-style: normal; font-weight: 700; }
.ai-research-related header em.found { color: #087443; }
.ai-research-related header em.not-found { color: #9b3d28; }
.ai-research-related header em.unknown { color: #66788a; }
.ai-research-related p { margin: 0; }
.ai-research-related ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.ai-research-related li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ai-research-related li span { min-width: 0; overflow-wrap: anywhere; }
.ai-research-related a { flex: 0 0 auto; }

@media (max-width: 720px) {
  .analytics-pie { grid-template-columns: 88px minmax(0, 1fr); }
  .analytics-pie-chart { width: 88px; box-shadow: inset 0 0 0 19px #fff; }
}

.select-col,
.select-cell {
  width: 44px;
  text-align: center;
}

.lead-table th:nth-child(2),
.lead-table td:nth-child(2) {
  width: 30%;
}

.lead-table th:nth-child(3),
.lead-table td:nth-child(3) {
  width: 20%;
}

.lead-table th:nth-child(4),
.lead-table td:nth-child(4) {
  width: 13%;
}

.lead-table th:nth-child(5),
.lead-table td:nth-child(5),
.lead-table th:nth-child(6),
.lead-table td:nth-child(6) {
  width: 64px;
}

.lead-table th:nth-child(7),
.lead-table td:nth-child(7) {
  width: 16%;
}

.select-col input,
.select-cell input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.company-cell strong {
  display: block;
}

.company-cell {
  min-width: 0;
}

.company-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-cell small,
.muted-text,
.contact-counts,
.followup-date {
  color: var(--muted);
}

.company-cell .lead-url {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-counts {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
}

.followup-date {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
}

.followup-date.due {
  color: var(--danger);
}

.score-pill,
.status-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.score-pill {
  background: #eaf3ee;
  color: var(--brand-dark);
}

.status-pill {
  background: #eef1ed;
  color: #34413b;
}

.status-pill.interested {
  background: #fff1d8;
  color: #7a4e0b;
}

.status-pill.quoted {
  background: #e9f0ff;
  color: #294f9f;
}

.status-pill.won {
  background: #e5f6ea;
  color: #1f6b3a;
}

.status-pill.invalid {
  background: #fff2f0;
  color: var(--danger);
}

.wa-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef1ed;
  color: #435149;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.wa-pill.good {
  background: #e5f6ea;
  color: #17643b;
}

.wa-pill.warn {
  background: #fff4dd;
  color: #80530d;
}

.wa-pill.danger {
  background: #fff2f0;
  color: var(--danger);
}

.entry-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef1ed;
  color: #435149;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.entry-pill.good {
  background: #e5f6ea;
  color: #17643b;
}

.entry-pill.warn {
  background: #fff4dd;
  color: #80530d;
}

.entry-pill.danger {
  background: #fff2f0;
  color: var(--danger);
}

.entry-pill.muted {
  background: #eef1ed;
  color: var(--muted);
}

.cloud-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef1ed;
  color: #435149;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.cloud-pill.synced {
  background: #e5f6ea;
  color: #1f6b3a;
}

.cloud-pill.failed {
  background: #fff2f0;
  color: var(--danger);
}

.cloud-sync-line {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.cloud-sync-line .cloud-id {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel {
  padding: 18px;
  min-height: 460px;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.detail-empty {
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

.detail-content {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.detail-content.hidden {
  display: none;
}

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

.detail-header h2 {
  margin-bottom: 0;
  line-height: 1.25;
}

.detail-tabs {
  margin-top: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.detail-tab {
  border: 0;
  border-radius: 6px;
  padding: 8px 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.detail-tab:hover,
.detail-tab.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 6px rgba(21, 54, 43, 0.08);
}

.detail-tab-body {
  min-height: 0;
  overflow: hidden;
}

.detail-tab-panel {
  max-height: calc(100vh - 238px);
  overflow: auto;
  padding-top: 12px;
  padding-right: 4px;
}

.detail-tab-panel[hidden] {
  display: none;
}

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

.customer-profile-card + .contact-actions {
  margin-top: 12px;
}

.customer-profile-card {
  border: 1px solid #d9e6dd;
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.customer-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.customer-profile-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.customer-profile-head p,
.profile-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.customer-profile-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef1ed;
  color: #34413b;
  font-size: 12px;
  font-weight: 900;
}

.customer-profile-head > span.hot {
  background: #e5f6ea;
  color: #1f6b3a;
}

.customer-profile-head > span.warm {
  background: #fff1d8;
  color: #7a4e0b;
}

.customer-profile-head > span.cold {
  background: #fff2f0;
  color: var(--danger);
}

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

.profile-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 3px;
}

.profile-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-metric strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.profile-section {
  border-left: 3px solid var(--brand);
  padding: 7px 9px;
  border-radius: 0 8px 8px 0;
  background: #eef4ed;
  display: grid;
  gap: 4px;
}

.profile-section strong,
.profile-list-grid strong {
  font-size: 13px;
}

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

.profile-chip-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-chip {
  border-radius: 999px;
  border: 1px solid #e1e7e2;
  background: #fff;
  color: #40564c;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.profile-chip.risk {
  border-color: #efd1cc;
  background: #fff4f1;
  color: var(--danger);
}

.profile-chip.good {
  border-color: #cfe2d3;
  background: #eef8f1;
  color: #1f6b3a;
}

.contact-actions button {
  padding: 8px 10px;
  font-size: 13px;
}

.contact-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tag-actions {
  margin: -4px 0 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-actions button {
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: #fbfcfa;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.detail-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

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

.detail-edit-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-edit-grid input {
  margin-top: 6px;
}

.contact-candidate-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.candidate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

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

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

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-pill {
  max-width: 100%;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 9px;
  background: white;
  color: #2d493d;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-pill.active {
  border-color: rgba(31, 122, 90, 0.45);
  background: var(--soft);
  color: var(--brand-dark);
}

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

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

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

.field-block {
  margin-top: 12px;
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-actions {
  margin-top: 14px;
}

.detail-save-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.quick-actions {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-actions button {
  padding: 8px 10px;
  font-size: 13px;
}

.score-insight-panel {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  gap: 12px;
}

.detail-tab-panel .score-insight-panel {
  margin-top: 0;
}

.score-insight-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.score-insight-header h3 {
  margin: 0;
  font-size: 16px;
}

.score-insight-header span {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  background: #eef1ed;
  color: #34413b;
}

.score-insight-header span.hot {
  background: #e5f6ea;
  color: #1f6b3a;
}

.score-insight-header span.warm {
  background: #fff1d8;
  color: #7a4e0b;
}

.score-insight-header span.cold {
  background: #fff2f0;
  color: var(--danger);
}

.score-factor-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.score-factor-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: start;
}

.score-factor-list li > span {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.score-factor-list li.plus > span {
  background: #e5f6ea;
  color: #1f6b3a;
}

.score-factor-list li.todo > span {
  background: #fff1d8;
  color: #7a4e0b;
}

.score-factor-list li.minus > span {
  background: #fff2f0;
  color: var(--danger);
}

.score-factor-list strong,
.next-best-action strong {
  font-size: 13px;
}

.score-factor-list small,
.next-best-action p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.next-best-action {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 4px;
}

.email-draft-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.timeline-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.detail-tab-panel .email-draft-panel,
.detail-tab-panel .timeline-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#emailDraft {
  min-height: 190px;
}

.email-draft-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

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

.email-draft-controls select {
  min-width: 128px;
}

.email-draft-controls select:last-child {
  min-width: 150px;
}

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

.email-draft-header h3,
.timeline-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.email-draft-header p,
.timeline-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.activity-composer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
}

.activity-composer textarea {
  grid-column: 1 / -1;
  resize: vertical;
}

.activity-composer button {
  grid-column: 2;
  justify-self: end;
  padding: 8px 10px;
}

.timeline-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
  display: grid;
  gap: 3px;
  border-left: 2px solid var(--line);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item span,
.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#emailDraft {
  min-height: 240px;
  line-height: 1.5;
  font-size: 13px;
}

.import-panel {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.csv-import-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #fbfcfa;
}

.csv-import-box h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.csv-import-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.csv-import-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.csv-preview {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.csv-preview.hidden {
  display: none;
}

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

.csv-preview-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  display: grid;
  gap: 3px;
}

.csv-preview-grid strong {
  font-size: 20px;
}

.csv-preview-grid span,
.csv-preview p {
  color: var(--muted);
  font-size: 12px;
}

.csv-preview p {
  margin: 0;
  line-height: 1.45;
}

.cloud-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 12px;
}

.beta-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.beta-header,
.beta-setup-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.beta-header h2,
.beta-header p,
.beta-setup-card p,
.beta-detail-grid h3 {
  margin: 0;
}

.beta-header p,
.beta-setup-card p,
.beta-status-grid small,
.beta-list-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.beta-setup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.beta-setup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.beta-status-grid article,
.beta-detail-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.beta-status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.beta-status-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
}

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

.beta-check-list,
.beta-list {
  display: grid;
  gap: 8px;
}

.beta-check,
.beta-list-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.beta-check {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.beta-check span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.beta-check.ok span {
  background: #e5f6ea;
  color: #1f6b3a;
}

.beta-check.warn span {
  background: #fff1d8;
  color: #7a4e0b;
}

.beta-list-row {
  display: grid;
  gap: 3px;
}

.beta-list-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.auth-header h2,
.auth-header p,
.auth-card h3 {
  margin: 0;
}

.auth-header p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff2f0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
}

.auth-status-pill.signed-in {
  background: #e5f6ea;
  color: #1f6b3a;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.auth-grid-simple {
  grid-template-columns: minmax(320px, 0.85fr) minmax(280px, 0.75fr) minmax(320px, 1fr);
  gap: 14px;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.auth-login-card {
  background: #fff;
}

.auth-help-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-token-card {
  grid-column: span 2;
}

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

.auth-actions-center {
  justify-content: center;
}

.auth-actions-center .danger-btn {
  min-width: 128px;
}

.auth-session-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.auth-session-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.auth-session-list dd {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.auth-token-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.auth-token-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.auth-token-row strong,
.auth-token-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-token-row span {
  color: var(--muted);
  font-size: 12px;
}

.status-line {
  min-height: 22px;
  color: var(--brand-dark);
  font-weight: 750;
}

.status-action-btn {
  margin-left: 10px;
  padding: 4px 10px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--brand-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.status-action-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

.app-status-line {
  margin: -8px 2px 0;
}

.module-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.module-header.compact {
  align-items: center;
}

.module-header h2,
.module-header p,
.search-card h3,
.outreach-card h3,
.settings-card h3 {
  margin: 0;
}

.module-header p,
.search-card p,
.outreach-card p,
.settings-card p {
  color: var(--muted);
  line-height: 1.5;
}

.search-panel,
.website-collector-panel,
.outreach-panel,
.settings-panel {
  display: grid;
  gap: 14px;
}

.website-collector-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.collector-plugin-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.collector-plugin-status.installed {
  color: var(--brand-dark);
}

.website-collector-actions .collector-install-btn {
  border-color: rgba(14, 165, 233, 0.3);
  background: #38bdf8;
  color: #0f1b33;
}

.website-collector-actions .collector-install-btn:hover {
  border-color: rgba(14, 165, 233, 0.5);
  background: #7dd3fc;
}

.website-collector-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 46%, #f7fff8 100%);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.website-collector-copy {
  display: grid;
  gap: 8px;
  align-content: center;
}

.collector-kicker {
  width: fit-content;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
  padding: 4px 9px;
}

.website-collector-copy h3,
.website-collector-copy p {
  margin: 0;
}

.website-collector-copy h3 {
  color: var(--ink);
  font-size: 21px;
}

.website-collector-copy p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 680px;
}

.collector-guide {
  display: grid;
  gap: 6px;
  align-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.collector-guide li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 0;
}

.collector-guide li + li {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 8px;
}

.collector-guide span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 850;
  display: inline-grid;
  place-items: center;
  grid-row: span 2;
}

.collector-guide strong {
  color: var(--ink);
  font-size: 13px;
}

.collector-guide small {
  color: var(--muted);
  line-height: 1.38;
}

.website-collector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.collector-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.collector-card h3,
.collector-card p {
  margin: 0;
}

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

.collector-stat-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.collector-stat-grid strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.collector-stat-grid span,
.website-collector-recent small {
  color: var(--muted);
  font-size: 12px;
}

.website-collector-recent {
  display: grid;
  gap: 8px;
}

.collector-lead-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 12px;
}

.collector-lead-row:hover {
  border-color: rgba(56, 189, 248, 0.64);
  background: #f0f9ff;
}

.collector-lead-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.collector-lead-row span:last-child {
  justify-items: end;
}

.collector-lead-row strong,
.collector-lead-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collector-empty {
  min-height: 180px;
  border: 1px dashed rgba(148, 163, 184, 0.72);
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.collector-empty strong {
  color: var(--ink);
}

.buyer-search-grid,
.social-collector-grid,
.outreach-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
}

.search-card,
.outreach-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.search-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.58fr);
  gap: 10px;
}

.search-form-grid label:first-child {
  grid-column: 1 / -1;
}

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

.source-card {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font-weight: 850;
}

.source-card:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.source-card.active {
  border-color: rgba(56, 189, 248, 0.72);
  background: #e0f2fe;
  color: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.12);
}

.buyer-search-results {
  display: grid;
  gap: 8px;
}

.buyer-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  background: #fbfcfa;
}

.buyer-result-card div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.buyer-result-card strong,
.buyer-result-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-result-card span {
  color: var(--muted);
  font-size: 12px;
}

.social-collector-grid {
  align-items: start;
}

.social-left-stack {
  display: grid;
  gap: 14px;
}

.social-form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.56fr);
}

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

.social-platform-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 9px;
  cursor: pointer;
}

.social-platform-card input {
  margin-top: 2px;
}

.social-platform-card span {
  color: var(--ink);
  font-weight: 900;
}

.social-platform-card small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.45;
}

.social-platform-card.active {
  border-color: rgba(56, 189, 248, 0.72);
  background: #e0f2fe;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.12);
}

.social-strategy {
  display: grid;
  gap: 8px;
}

.social-strategy div {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #f8fcff, #fff);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.social-strategy strong {
  color: var(--brand-dark);
}

.social-strategy span,
.social-results-header p {
  color: var(--muted);
  font-size: 12px;
}

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

.social-results {
  display: grid;
  gap: 8px;
}

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

.social-live-progress {
  min-width: 0;
  padding: 14px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.social-live-progress[hidden] { display: none; }
.social-live-progress p { margin: 8px 0; }
.social-live-progress small { color: var(--muted); }
.social-progress-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  min-width: 0;
}
.social-progress-bar-meta strong { font-size: 13px; }
.social-progress-bar-meta small {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.social-live-progress progress,
.social-inline-progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 5px 0 10px;
  accent-color: #0284c7;
}
.social-live-progress details { margin-top: 12px; }
.social-live-progress summary { cursor: pointer; color: var(--brand-dark); }
.social-live-progress ol {
  max-height: 240px;
  overflow: auto;
  padding-left: 24px;
  font-size: 12px;
  line-height: 1.7;
}
.social-progress-warning { color: #9a5b00; }
.social-history-progress { font-size: 12px; overflow-wrap: anywhere; min-width: 0; }

.social-history-empty {
  min-height: 128px;
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  background: #f8fcff;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px;
}

.social-history-empty span {
  color: var(--muted);
}

.social-history-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 7px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.social-history-item:hover,
.social-history-item.active {
  border-color: rgba(56, 189, 248, 0.72);
  background: #eff9ff;
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.12);
}

.social-history-item:hover {
  transform: translateY(-1px);
}

.social-history-top,
.social-history-foot {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.social-history-top strong,
.social-history-meta,
.social-history-foot small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-history-top strong {
  color: var(--ink);
  font-size: 14px;
}

.social-history-top em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e0f2fe;
  color: var(--brand-dark);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.social-history-meta,
.social-history-foot small {
  color: var(--muted);
  font-size: 12px;
}

.social-empty {
  min-height: 180px;
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  background: #f8fcff;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 18px;
}

.social-empty span {
  color: var(--muted);
}

.social-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(120px, 0.72fr) auto auto auto;
  gap: 10px;
  align-items: center;
}

.social-result-main,
.social-contact-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.social-result-main strong,
.social-result-main small,
.social-contact-cell strong,
.social-contact-cell span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-result-main small,
.social-contact-cell span {
  color: var(--muted);
  font-size: 12px;
}

.social-platform-pill {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e0f2fe;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.social-platform-pill.facebook {
  background: #dbeafe;
  color: #1d4ed8;
}

.social-platform-pill.instagram {
  background: #fce7f3;
  color: #be185d;
}

.outreach-grid {
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
}

.ai-assets-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.ai-assets-source-card {
  align-content: start;
}

.ai-assets-source-card input[type="file"] {
  min-height: 44px;
  padding: 10px;
  border: 1px dashed rgba(56, 189, 248, 0.55);
  border-radius: 8px;
  background: #f8fcff;
}

.ai-asset-detect {
  border: 1px solid rgba(186, 230, 253, 0.95);
  border-radius: 8px;
  padding: 11px 13px;
  background: linear-gradient(135deg, #f8fcff, #ffffff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-asset-detect span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-asset-detect strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.outreach-card.full {
  grid-column: 1 / -1;
}

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

.outreach-profile div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 3px;
  background: #fbfcfa;
}

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

.outreach-profile strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outreach-profile .ai-asset-item {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f8fcff, #ffffff);
  border-color: rgba(186, 230, 253, 0.9);
}

.ai-generation-source {
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #f8fcff, #ffffff);
}

.ai-generation-source div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ai-generation-source span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-generation-source strong,
.ai-generation-source small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-generation-source strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.ai-generation-source small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-generation-progress {
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.88), rgba(255, 255, 255, 0.86)),
    #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ai-generation-progress.is-error {
  border-color: rgba(184, 77, 66, 0.35);
  background:
    linear-gradient(135deg, rgba(254, 226, 226, 0.72), rgba(255, 255, 255, 0.9)),
    #fff;
}

.ai-generation-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 850;
}

.ai-generation-progress-head strong {
  color: var(--ink);
  font-size: 12px;
}

.ai-generation-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e0f2fe;
}

.ai-generation-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #2563eb);
  transition: width 0.35s ease;
}

.ai-generation-progress.is-error .ai-generation-track span {
  background: linear-gradient(90deg, #f97316, var(--danger));
}

.ai-visual-output,
.ai-video-output {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 249, 255, 0.92), rgba(255, 255, 255, 0.98)),
    #fff;
  padding: 12px;
}

.ai-visual-output[hidden],
.ai-video-output[hidden] {
  display: none;
}

.ai-visual-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.ai-visual-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ai-video-output video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06142b;
}

.ai-visual-meta {
  display: grid;
  gap: 4px;
}

.ai-visual-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.ai-visual-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-generation-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-generation-steps li {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-generation-steps li.active {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #e0f2fe;
}

.ai-generation-steps li.done {
  border-color: rgba(56, 189, 248, 0.26);
  color: var(--brand-dark);
  background: #f0f9ff;
}

.ai-generation-steps li.skipped {
  opacity: 0.48;
}

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

.ai-assets-roadmap div {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fcff, #fff);
  display: grid;
  align-content: start;
  gap: 8px;
}

.ai-assets-roadmap strong {
  color: var(--ink);
  font-size: 15px;
}

.ai-assets-roadmap span {
  color: var(--muted);
  line-height: 1.55;
}

.asset-library-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  border-radius: 10px;
  overflow: hidden;
}

.asset-editor-dialog {
  width: min(620px, calc(100vw - 32px));
  border-radius: 14px;
  overflow: hidden;
}

.asset-library-form,
.asset-editor-form {
  gap: 12px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(224, 242, 254, 0.72), rgba(255, 255, 255, 0) 150px),
    #fff;
}

.asset-library-form {
  height: min(900px, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.asset-library-form > :not(.asset-library-list) {
  flex: 0 0 auto;
}

.asset-editor-form {
  display: grid;
}

.asset-editor-form textarea {
  min-height: 190px;
  resize: vertical;
}

.asset-editor-attachments {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.92);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: grid;
  gap: 6px;
}

.asset-editor-attachments strong {
  color: var(--ink);
}

.asset-editor-toggle {
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: rgba(240, 249, 255, 0.88);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.asset-editor-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

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

.asset-library-summary > div {
  min-width: 0;
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  min-height: 88px;
  padding: 11px 12px;
  background: rgba(248, 252, 255, 0.94);
  display: grid;
  gap: 4px;
}

.asset-library-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.asset-library-summary strong {
  color: var(--ink);
  font-size: 21px;
}

.asset-library-summary small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.asset-library-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.asset-library-summary-chip {
  border: 1px solid rgba(125, 211, 252, 0.86);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  padding: 6px 8px;
}

.asset-library-summary-chip:hover,
.asset-library-summary-chip.active {
  border-color: var(--primary);
  background: rgba(224, 242, 254, 0.95);
}

.asset-library-health {
  border: 1px solid rgba(125, 211, 252, 0.72);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.94));
  padding: 12px;
  display: grid;
  gap: 12px;
}

.asset-library-health[hidden] {
  display: none;
}

.asset-library-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-library-health-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.asset-library-health-head strong {
  color: var(--ink);
  font-size: 16px;
}

.asset-library-health-head span,
.asset-library-health-tips p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.asset-library-health-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.asset-library-health-grid div {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.asset-library-health-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.asset-library-health-grid strong {
  color: var(--primary);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.asset-library-health-tips {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  display: grid;
  gap: 5px;
}

.asset-library-health-actions {
  border-top: 1px solid rgba(186, 230, 253, 0.75);
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-library-health-actions span {
  margin-right: auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.asset-library-toolbar {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.9);
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(140px, 180px) auto auto;
  gap: 10px;
  align-items: end;
}

.asset-library-toolbar label:not(.asset-library-toggle) {
  margin: 0;
  min-width: 0;
}

.asset-library-toolbar input,
.asset-library-toolbar select {
  width: 100%;
}

.asset-library-bulk-actions {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.86);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-library-bulk-actions span {
  margin-right: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

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

.asset-library-more-actions,
.asset-library-item-menu {
  position: relative;
}

.asset-library-more-actions > summary,
.asset-library-item-menu > summary {
  list-style: none;
  user-select: none;
}

.asset-library-more-actions > summary::-webkit-details-marker,
.asset-library-item-menu > summary::-webkit-details-marker {
  display: none;
}

.asset-library-more-actions[open] > summary,
.asset-library-item-menu[open] > summary {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #f0f9ff;
}

.asset-library-more-actions > div,
.asset-library-item-menu > div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.asset-library-more-actions > div {
  position: absolute;
  z-index: 8;
  top: calc(100% + 7px);
  right: 0;
  width: 410px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(18, 71, 60, 0.16);
}

.asset-library-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.asset-library-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.asset-library-tabs button:hover,
.asset-library-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--ink);
}

.asset-library-tabs button strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 5px;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--primary-dark);
  font-size: 12px;
}

.asset-library-trash {
  border: 1px solid rgba(125, 211, 252, 0.75);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.95));
  padding: 12px;
  display: grid;
  gap: 10px;
}

.asset-library-trash[hidden] {
  display: none;
}

.asset-library-trash-section {
  gap: 10px;
}

.asset-library-trash-item {
  background: #fff;
}

.asset-library-toggle {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.asset-library-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.asset-library-list {
  flex: 1 1 auto;
  max-height: none;
  overflow: auto;
  min-height: 0;
  padding: 0 5px 4px 0;
}

.asset-library-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.asset-library-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.asset-library-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.asset-library-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-asset-library-note {
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.96), rgba(240, 253, 244, 0.88));
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-asset-library-note strong {
  color: var(--primary);
}

.ai-asset-library-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.asset-library-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fcff, #fff);
  padding: 10px;
  display: grid;
  grid-template-columns: auto 68px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.asset-library-generation-item {
  grid-template-columns: 68px minmax(0, 1fr) auto;
}

.asset-library-thumb {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(186, 230, 253, 0.95);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.94));
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

.asset-library-thumb img,
.asset-library-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.asset-library-thumb video {
  background: #111827;
}

.asset-library-thumb-label {
  width: 100%;
  height: 100%;
  padding: 9px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
}

.asset-library-thumb-label strong {
  color: var(--primary);
  font-size: 15px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.asset-library-thumb-label small,
.asset-library-thumb-badge {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.asset-library-thumb-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border-radius: 999px;
  background: rgba(248, 252, 255, 0.92);
  border: 1px solid rgba(186, 230, 253, 0.9);
  padding: 3px 6px;
}

.asset-library-check {
  align-self: center;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: rgba(240, 249, 255, 0.88);
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.asset-library-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

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

.asset-library-item-menu > div {
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(18, 71, 60, 0.16);
}

.asset-library-item-menu > div > * {
  flex: 1 1 calc(50% - 7px);
  text-align: center;
}

.asset-library-item-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.asset-library-item-main span,
.asset-library-item-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-library-source-pill {
  min-width: 0;
  color: #0f766e;
  background: rgba(240, 253, 250, 0.95);
  border: 1px solid rgba(45, 212, 191, 0.36);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.asset-library-pin-pill {
  width: fit-content;
  max-width: 100%;
  color: #075985;
  background: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.asset-library-cloud-pill {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.asset-library-cloud-pill.synced {
  color: #047857;
  background: #dcfce7;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.asset-library-cloud-pill.pending {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.asset-library-cloud-pill.local {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.36);
}

.asset-library-cloud-pill.trash {
  color: #4338ca;
  background: #e0e7ff;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.asset-library-usage-pill {
  width: fit-content;
  max-width: 100%;
  color: #075985;
  background: rgba(240, 249, 255, 0.96);
  border: 1px solid rgba(125, 211, 252, 0.55);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.asset-library-item-main strong {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-outline-btn {
  border: 1px solid #f0c6c1;
  border-radius: 8px;
  background: #fff7f5;
  color: var(--danger);
  padding: 9px 12px;
  font-weight: 850;
  cursor: pointer;
}

.danger-outline-btn:hover {
  background: #fff2f0;
}

.asset-library-actions .ghost-btn,
.asset-library-actions .danger-outline-btn {
  padding: 8px 10px;
  min-height: 36px;
}

.asset-library-empty {
  min-height: 180px;
  border: 1px dashed rgba(56, 189, 248, 0.55);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.92);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.asset-library-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.asset-library-empty span {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.6;
}

.asset-library-empty.compact {
  min-height: 140px;
}

.asset-library-load-more {
  width: 100%;
  min-height: 42px;
  margin-top: 2px;
}

.asset-detail-dialog,
.generation-detail-dialog {
  width: min(920px, calc(100vw - 32px));
  border-radius: 12px;
  overflow: hidden;
}

.asset-detail-form,
.generation-detail-form {
  padding: 22px;
  display: grid;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(224, 242, 254, 0.58), rgba(255, 255, 255, 0) 150px),
    #fff;
}

.asset-detail-body,
.generation-detail-body {
  display: grid;
  gap: 14px;
}

.asset-detail-media,
.generation-detail-media {
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: #f8fcff;
  padding: 12px;
}

.asset-detail-media {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.asset-detail-media:not([hidden]) {
  display: grid;
}

.asset-detail-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.asset-detail-insight {
  min-width: 0;
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.92);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.asset-detail-insight span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.asset-detail-insight strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.asset-detail-insight small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.asset-detail-insight.synced,
.asset-detail-insight.enabled,
.asset-detail-insight.pinned,
.asset-detail-insight.saved,
.asset-detail-insight.used {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(240, 253, 244, 0.8);
}

.asset-detail-insight.pending,
.asset-detail-insight.paused,
.asset-detail-insight.unsaved,
.asset-detail-insight.unused {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(255, 247, 237, 0.82);
}

.asset-detail-media-item {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.asset-detail-media-item img,
.asset-detail-media-item video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-detail-media-item video {
  background: #111827;
}

.asset-detail-media-item figcaption {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.asset-detail-media-item figcaption strong,
.asset-detail-media-item figcaption small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.asset-detail-media-item figcaption small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-detail-media-item figcaption span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-detail-media-link {
  min-height: 140px;
  border: 1px dashed rgba(56, 189, 248, 0.55);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.95);
  padding: 14px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
}

.asset-detail-media-link span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.generation-detail-media img,
.generation-detail-media video {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: #fff;
}

.asset-detail-files,
.asset-detail-related,
.generation-detail-sources {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: rgba(248, 252, 255, 0.76);
}

.asset-detail-files {
  gap: 8px;
}

.asset-detail-files:not([hidden]) {
  display: grid;
}

.asset-detail-related {
  display: grid;
  gap: 10px;
}

.asset-detail-related-list {
  display: grid;
  gap: 8px;
}

.asset-detail-file-item {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.asset-detail-related-item {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.asset-detail-related-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.asset-detail-related-main span,
.asset-detail-related-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-detail-related-main strong {
  min-width: 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-detail-file-item strong,
.asset-detail-file-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.asset-detail-file-item small {
  color: var(--muted);
  line-height: 1.45;
}

.generation-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.generation-detail-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.generation-detail-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.generation-detail-source-list {
  display: grid;
  gap: 8px;
}

.generation-detail-source-restore-bar {
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 8px;
  background: #eff8f3;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.generation-detail-source-restore-bar span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.generation-detail-source-item {
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.generation-detail-source-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.generation-detail-source-item strong,
.generation-detail-source-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.generation-detail-source-item strong {
  color: var(--ink);
}

.generation-detail-source-item small {
  color: var(--muted);
  line-height: 1.45;
}

.generation-detail-source-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#assetDetailContent,
#generationDetailDraft {
  min-height: 190px;
  max-height: none;
  overflow-y: hidden;
}

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

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  padding: 0;
}

.auth-dialog {
  width: min(440px, calc(100vw - 28px));
  border-radius: 12px;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(8, 14, 11, 0.5);
}

.lead-form,
.auth-dialog-form {
  padding: 20px;
}

.auth-dialog-form {
  display: grid;
  gap: 14px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(224, 242, 254, 0.62), rgba(255, 255, 255, 0) 132px),
    #fff;
}

.auth-dialog-form .dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-modal-section {
  display: grid;
  gap: 12px;
}

#authLoginArea .auth-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  gap: 10px;
}

#authLoginArea .auth-actions button {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.auth-modal-section[hidden] {
  display: none;
}

.auth-profile-card {
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(15, 27, 51, 0.07);
}

.auth-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 18px;
}

.auth-profile-card div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.auth-profile-card strong,
.auth-profile-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-profile-card strong {
  font-size: 16px;
}

.auth-profile-card small {
  color: var(--muted);
  font-size: 12px;
}

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

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

.full {
  grid-column: 1 / -1;
}

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

  .sidebar {
    position: static;
  }

  .workspace-grid,
  .metrics-grid,
  .analytics-grid,
  .beta-status-grid,
  .beta-detail-grid,
  .auth-grid,
  .outreach-grid,
  .ai-assets-grid {
    grid-template-columns: 1fr;
  }

  .analytics-header {
    display: grid;
  }

  .beta-header,
  .beta-setup-card,
  .auth-header {
    display: grid;
  }

  .beta-setup-actions {
    justify-content: flex-start;
  }

  .sales-plan-card {
    grid-template-columns: 1fr;
  }

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

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

  .bulk-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .detail-content {
    height: auto;
  }

  .detail-tab-panel {
    max-height: none;
    overflow: visible;
  }

  .profile-list-grid {
    grid-template-columns: 1fr;
  }

  .ai-assets-roadmap,
  .asset-library-summary,
  .asset-library-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-library-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-library-toolbar > label:first-child {
    grid-column: 1 / -1;
  }

  .asset-library-item {
    grid-template-columns: auto 68px minmax(0, 1fr);
  }

  .asset-library-generation-item {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .asset-library-thumb {
    width: 68px;
    height: 68px;
  }

  .asset-library-check {
    grid-template-columns: auto 1fr;
    place-items: center start;
    align-self: auto;
  }

  .ai-generation-source {
    grid-template-columns: 1fr;
  }

  .asset-detail-form,
  .generation-detail-form {
    padding: 18px;
  }

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

  .asset-library-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .sales-plan-header {
    display: grid;
  }

  .toolbar,
  .bulk-toolbar,
  .email-draft-header,
  .activity-composer,
  .csv-import-actions,
  .csv-preview-grid,
  .form-grid,
  .cloud-grid,
  .detail-edit-grid,
  .ai-assets-roadmap,
  .asset-library-health-grid {
    grid-template-columns: 1fr;
  }

  .asset-library-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-library-toolbar {
    grid-template-columns: 1fr;
  }

  .asset-library-dialog {
    width: calc(100vw - 16px);
  }

  .asset-library-form {
    height: calc(100vh - 16px);
    padding: 14px;
  }

  .asset-library-summary {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
  }

  .asset-library-summary > div {
    flex: 0 0 154px;
    min-height: 90px;
    scroll-snap-align: start;
  }

  .asset-library-summary-chips {
    flex-wrap: nowrap;
    gap: 3px;
  }

  .asset-library-summary-chip {
    padding: 5px;
    font-size: 10px;
  }

  .asset-library-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-library-toolbar > label:first-child {
    grid-column: 1 / -1;
  }

  .asset-library-item,
  .asset-library-generation-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .asset-library-check {
    grid-column: 1 / -1;
  }

  .asset-library-thumb {
    width: 52px;
    height: 52px;
  }

  .asset-library-bulk-actions,
  .asset-library-primary-actions {
    align-items: stretch;
  }

  .asset-library-primary-actions {
    width: 100%;
  }

  .asset-library-primary-actions > button,
  .asset-library-primary-actions > details {
    flex: 1 1 auto;
  }

  .asset-library-more-actions > summary {
    text-align: center;
  }

  .asset-library-more-actions > div {
    right: auto;
    left: 0;
    width: min(330px, calc(100vw - 44px));
  }

  .activity-composer button {
    grid-column: 1;
    justify-self: stretch;
  }

  .email-draft-controls {
    justify-content: stretch;
  }

  .email-draft-controls select {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* LeadsIce homepage-inspired console refresh */
:root {
  --bg: #fbfdfb;
  --bg-soft: #f4f8f5;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #5e6f68;
  --line: #dce9e1;
  --line-strong: #cbded4;
  --brand: #25d366;
  --brand-dark: #128c7e;
  --accent: #0f3d36;
  --danger: #b84d42;
  --warning: #f4a51c;
  --soft: #eff8f3;
  --shadow: 0 14px 38px rgba(18, 71, 60, 0.1);
}

body {
  background:
    linear-gradient(180deg, rgba(239, 248, 243, 0.82), rgba(251, 253, 251, 0.96) 260px),
    var(--bg);
  line-height: 1.55;
}

.app-shell {
  grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-right: 1px solid rgba(220, 233, 225, 0.95);
  box-shadow: 10px 0 34px rgba(18, 71, 60, 0.04);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  box-shadow: 0 10px 22px rgba(18, 140, 126, 0.18);
}

.brand-name {
  color: var(--ink);
  font-size: 21px;
}

.brand-subtitle,
.eyebrow {
  color: var(--muted);
}

.nav-list {
  gap: 18px;
}

.nav-group {
  gap: 8px;
}

.nav-group-title {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.86), rgba(255, 255, 255, 0.92));
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 8px 20px rgba(15, 27, 51, 0.04);
}

.nav-group-title span {
  background: #dff4ff;
  color: var(--brand-dark);
}

.nav-group-title strong {
  color: var(--ink);
}

.nav-group-title small {
  color: var(--muted);
}

.nav-item {
  min-height: 58px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  margin-left: 15px;
  padding-left: 16px;
}

.nav-item span {
  color: var(--ink);
  font-weight: 850;
}

.nav-item small {
  color: var(--muted);
}

.nav-item.active,
.nav-item:hover {
  background: var(--soft);
  border-color: var(--line);
  color: var(--accent);
}

.nav-item.active span,
.nav-item:hover span,
.nav-item.active small,
.nav-item:hover small {
  color: var(--accent);
}

.sidebar-panel {
  border-color: var(--line);
  background: #fbfdfb;
  color: var(--muted);
}

.panel-label {
  color: var(--brand-dark);
}

.main {
  padding: 24px;
  gap: 14px;
  align-content: start;
}

.topbar {
  align-items: center;
  padding: 20px 22px;
  border-color: rgba(220, 233, 225, 0.9);
  box-shadow: var(--shadow);
  min-height: 96px;
}

h1 {
  font-size: clamp(25px, 2.4vw, 34px);
}

h2 {
  color: var(--ink);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.danger-btn {
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 13px;
}

.primary-btn {
  background: var(--brand);
  color: #063b2c;
}

.primary-btn:hover {
  background: #21c75f;
}

.ghost-btn,
.icon-btn {
  background: #fff;
  border-color: var(--line);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--brand);
  color: var(--accent);
  background: #fff;
}

.danger-btn {
  background: #fff5f2;
}

.metric-card,
.lead-panel,
.detail-panel,
.import-panel,
.beta-panel,
.auth-panel,
.analytics-panel,
.sales-plan-panel,
.pipeline-panel,
dialog {
  border-color: rgba(220, 233, 225, 0.95);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 71, 60, 0.07);
}

.metrics-grid {
  gap: 12px;
}

.metric-card {
  min-height: 92px;
  padding: 14px 16px;
  border-top: 3px solid transparent;
}

.metric-card:nth-child(1) {
  border-top-color: var(--brand);
}

.metric-card:nth-child(2) {
  border-top-color: var(--brand-dark);
}

.metric-card:nth-child(3) {
  border-top-color: var(--warning);
}

.metric-card:nth-child(4) {
  border-top-color: #e16b5c;
}

.metric-card strong {
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.58fr) minmax(360px, 0.82fr);
  gap: 16px;
}

.lead-panel {
  overflow: hidden;
}

.lead-pagination {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.lead-pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lead-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-pagination-controls label {
  min-width: 112px;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.lead-pagination-controls select,
.lead-pagination-controls input {
  min-height: 38px;
  padding: 8px 10px;
}

.lead-pagination-controls input {
  width: 76px;
}

.queue-tabs {
  padding: 14px 14px 6px;
  background: #fff;
}

.queue-tab {
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
}

.queue-tab:hover,
.queue-tab.active {
  border-color: rgba(18, 140, 126, 0.35);
  background: var(--soft);
  color: var(--accent);
}

.queue-tab span {
  background: rgba(18, 140, 126, 0.1);
  color: var(--accent);
}

.toolbar {
  padding: 12px 14px;
  grid-template-columns: minmax(240px, 1fr) 136px 150px auto auto;
  background: #fff;
}

.bulk-toolbar {
  padding: 10px 14px;
  background: #f8fbf8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.bulk-toolbar > * {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bulk-toolbar #bulkAiContactBtn {
  flex: 1 1 180px;
}

.lead-toolbar > .icon-btn {
  min-width: 64px;
  white-space: nowrap;
}

.dekeo-import-status {
  padding: 10px 14px;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
  background: #f0f9ff;
}

.dekeo-import-status > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dekeo-import-status strong,
.dekeo-import-status span,
.dekeo-import-status small {
  overflow-wrap: anywhere;
}

.dekeo-import-status small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.dekeo-import-status.error {
  border-color: #fed7aa;
  background: #fff7ed;
}

.dekeo-import-meter {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #dbeafe;
}

.dekeo-import-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: #0284c7;
  transition: width 180ms ease;
}

.lead-ai-task-status {
  margin: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid #dbeafe;
  background: #f0f9ff;
}

.lead-ai-task-status[hidden] {
  display: none;
}

.lead-ai-task-card {
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
}

.lead-ai-task-card[hidden] {
  display: none;
}

.lead-ai-task-card.is-complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.lead-ai-task-card.is-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.lead-ai-task-card-head,
.ai-research-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lead-ai-task-status strong,
.ai-research-header h3 {
  color: #06142b;
}

.lead-ai-task-title.two-line {
  display: grid;
  justify-items: center;
  min-width: 44px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.lead-ai-task-status span {
  color: #48627f;
  font-size: 13px;
}

.lead-ai-task-bar {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.lead-ai-task-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  transition: width 0.2s ease;
}

.lead-ai-task-card.is-error .lead-ai-task-bar span {
  background: linear-gradient(90deg, #fb7185, #ef4444);
}

@media (max-width: 900px) {
  .lead-ai-task-status {
    grid-template-columns: 1fr;
  }
}

.ai-research-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #d9e7f3;
  border-radius: 8px;
  background: #fff;
}

.ai-research-header p,
.ai-research-body p {
  margin: 4px 0 0;
  color: #48627f;
  font-size: 13px;
}

.ai-research-body {
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ai-contact-result {
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.ai-contact-result[hidden] {
  display: none;
}

.ai-contact-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-contact-result-head strong {
  color: #06142b;
}

.ai-contact-result-head p,
.ai-contact-result-body p {
  margin: 4px 0 0;
  color: #48627f;
  font-size: 13px;
}

.ai-contact-result-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ai-contact-result-group {
  display: grid;
  gap: 6px;
}

.ai-contact-result .candidate-pill {
  cursor: default;
}

.ai-contact-result .candidate-pill a {
  margin-left: 8px;
  color: #0077c8;
  font-size: 12px;
  text-decoration: none;
}

.ai-research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0;
  min-width: 0;
  max-width: 100%;
}

.ai-research-metric {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  overflow: clip;
}

.ai-research-metric span {
  display: block;
  color: #48627f;
  font-size: 12px;
}

.ai-research-metric strong {
  display: block;
  margin-top: 4px;
  color: #06142b;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-research-claims {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.ai-research-claims li {
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

.ai-research-claims a {
  display: inline-block;
  margin: 6px 8px 0 0;
  color: #0078c9;
  font-size: 12px;
}

.ai-research-warn {
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
}

label,
.field-block {
  color: var(--muted);
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 6px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(18, 140, 126, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.14);
  outline: none;
}

.lead-table th,
.lead-table td {
  padding: 13px 14px;
}

.lead-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.lead-row:hover {
  background: #f8fbf8;
}

.lead-row.selected {
  background: var(--soft);
}

.score-pill {
  background: #e9f8ef;
  color: #0f6f48;
}

.status-pill {
  background: #eef2ef;
}

.status-pill.interested,
.plan-type.hot {
  background: #fff4dd;
  color: #80530d;
}

.status-pill.quoted,
.plan-type.quote {
  background: #eef5ff;
  color: #27579c;
}

.status-pill.won,
.cloud-pill.synced,
.plan-type.fresh {
  background: #e9f8ef;
  color: #17643b;
}

.tag-pill,
.cloud-pill,
.profile-chip,
.candidate-pill {
  border-color: var(--line);
}

.detail-panel {
  top: 24px;
  max-height: calc(100vh - 48px);
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
}

.detail-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-tabs {
  margin-top: 12px;
  border-color: var(--line);
  background: #f6faf7;
}

.detail-tab {
  min-height: 34px;
  border-radius: 6px;
}

.detail-tab:hover,
.detail-tab.active {
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(18, 71, 60, 0.08);
}

.detail-tab-panel {
  max-height: calc(100vh - 246px);
  scrollbar-width: thin;
}

.detail-panel {
  max-height: none;
  overflow: visible;
}

.detail-content {
  height: auto;
  grid-template-rows: auto auto auto auto;
}

.detail-tab-body,
.detail-tab-panel {
  max-height: none;
  overflow: visible;
}

.customer-profile-card,
.contact-candidate-panel,
.quick-actions,
.score-insight-panel,
.activity-composer,
.pipeline-column,
.sales-plan-card,
.analytics-grid article {
  background: #fbfdfb;
  border-color: var(--line);
}

.profile-section,
.plan-next-action {
  background: var(--soft);
  border-left-color: var(--brand-dark);
}

.detail-save-bar {
  background: rgba(255, 255, 255, 0.96);
}

dialog::backdrop {
  background: rgba(15, 33, 29, 0.45);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(186, 230, 253, 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fcff 0%, #ffffff 62%);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(15, 27, 51, 0.2);
}

.confirm-dialog-form {
  padding: 24px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px 16px;
}

.confirm-dialog-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff1f2, #fee2e2);
  color: #dc2626;
  font-size: 24px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.22);
}

.confirm-dialog-copy {
  min-width: 0;
}

.confirm-dialog-eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.confirm-dialog-copy p:not(.confirm-dialog-eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.delete-confirm-summary,
.delete-confirm-list,
.confirm-dialog-note,
.confirm-dialog-actions {
  grid-column: 1 / -1;
}

.delete-confirm-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(186, 230, 253, 0.92);
  border-radius: 14px;
  background: #eef9ff;
  color: var(--muted);
  font-weight: 800;
}

.delete-confirm-summary strong {
  color: #0ea5e9;
  font-size: 24px;
  line-height: 1;
}

.delete-confirm-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.delete-confirm-list li {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.delete-confirm-list strong,
.delete-confirm-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-confirm-list span {
  color: var(--muted);
  font-size: 12px;
}

.delete-confirm-list .more {
  border-style: dashed;
  background: #f8fafc;
}

.confirm-dialog-note {
  padding: 12px 14px;
  border-left: 3px solid #0ea5e9;
  border-radius: 10px;
  background: #eff8ff;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 2px;
}

.confirm-dialog-actions button {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.confirm-danger-btn {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.confirm-danger-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 1500px) {
  .lead-toolbar {
    grid-template-columns: minmax(140px, 1fr) 108px 128px minmax(120px, 160px) 64px 64px !important;
  }
}

@media (max-width: 1280px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.74fr);
  }
}

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

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

  .workspace-grid,
  .metrics-grid,
  .website-collector-hero,
  .website-collector-grid,
  .buyer-search-grid,
  .social-collector-grid,
  .outreach-grid,
  .settings-grid,
  .source-card-grid,
  .social-platform-grid,
  .auth-grid-simple {
    grid-template-columns: 1fr;
  }

  .outreach-card.full {
    grid-column: auto;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .detail-tab-panel {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    padding: 18px;
  }

  .toolbar,
  .bulk-toolbar,
  .search-form-grid,
  .social-form-grid,
  .collector-guide,
  .collector-stat-grid,
  .cloud-grid {
    grid-template-columns: 1fr;
  }

  .bulk-toolbar {
    display: grid;
  }

  .bulk-toolbar > * {
    width: 100%;
  }

  .website-collector-actions {
    justify-content: stretch;
  }

  .website-collector-actions .primary-btn,
  .website-collector-actions .ghost-btn,
  .collector-lead-row {
    width: 100%;
  }

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

  .collector-lead-row span:last-child {
    justify-items: start;
  }

  .buyer-result-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .social-strategy div,
  .social-results-header {
    display: grid;
  }

  .social-result-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .buyer-result-card .ghost-btn,
  .social-result-card .ghost-btn,
  .social-result-card .primary-btn {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

/* LeadsIce official ice-blue brand alignment */
:root {
  --bg: #f6f8fb;
  --bg-soft: #f0f9ff;
  --panel: #ffffff;
  --ink: #0f1b33;
  --muted: #5f6f86;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #38bdf8;
  --brand-dark: #0284c7;
  --accent: #0f1b33;
  --soft: #e0f2fe;
  --shadow: 0 14px 36px rgba(15, 27, 51, 0.08);
}

body {
  background:
    linear-gradient(180deg, rgba(224, 242, 254, 0.78), rgba(246, 248, 251, 0.96) 260px),
    var(--bg);
}

.sidebar {
  border-right-color: var(--line);
  box-shadow: 10px 0 34px rgba(15, 27, 51, 0.04);
}

.brand-lockup {
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  border-radius: 14px;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.brand-lockup:hover {
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}

.brand-lockup:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.24);
  outline-offset: 3px;
}

.brand-logo {
  width: 158px;
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark,
.brand-name {
  display: none;
}

.nav-item.active,
.nav-item:hover,
.queue-tab:hover,
.queue-tab.active,
.candidate-pill.active,
.lead-row.selected {
  background: var(--soft);
}

.nav-item.active,
.nav-item:hover,
.queue-tab:hover,
.queue-tab.active {
  border-color: rgba(56, 189, 248, 0.42);
}

.nav-item.active span,
.nav-item:hover span,
.nav-item.active small,
.nav-item:hover small,
.queue-tab:hover,
.queue-tab.active,
.detail-tab:hover,
.detail-tab.active,
.analytics-row:hover strong,
.pipeline-card-main:hover strong,
.status-line,
.panel-label {
  color: var(--brand-dark);
}

.primary-btn {
  background: var(--brand);
  color: #082f49;
}

.primary-btn:hover {
  background: #0ea5e9;
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.metric-card:nth-child(1) {
  border-top-color: #38bdf8;
}

.metric-card:nth-child(2) {
  border-top-color: #0284c7;
}

.score-pill,
.cloud-pill.synced,
.status-pill.won,
.plan-type.fresh,
.profile-chip.good,
.score-factor-list li.plus > span {
  background: #e0f2fe;
  color: #0369a1;
}

.queue-tab span,
.analytics-actions > strong,
.pipeline-column-header span,
.plan-type,
.candidate-pill.active {
  background: rgba(56, 189, 248, 0.13);
  color: var(--brand-dark);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.66);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.profile-section,
.plan-next-action {
  background: #f0f9ff;
  border-left-color: var(--brand-dark);
}

.detail-tab:hover,
.detail-tab.active {
  box-shadow: 0 4px 14px rgba(15, 27, 51, 0.08);
}

.nav-group-title {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  grid-template-columns: 34px minmax(0, 1fr) 12px;
}

.nav-group-title:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.24);
  outline-offset: 2px;
}

.nav-group-title .nav-group-copy {
  width: auto;
  height: auto;
  border-radius: 0;
  display: grid;
  place-items: stretch;
  gap: 3px;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.nav-group-title .nav-group-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0;
  display: block;
  background: transparent;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

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

.nav-group.collapsed .nav-group-items {
  display: none;
}

.nav-group.collapsed .nav-group-chevron {
  transform: rotate(-45deg);
}

.cleaning-panel {
  display: grid;
  gap: 16px;
}

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

.cleaning-plugin-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cleaning-plugin-status.connected {
  border-color: rgba(34, 197, 94, 0.35);
  background: #ecfdf5;
  color: #047857;
}

.cleaning-plugin-status.running {
  border-color: rgba(2, 132, 199, 0.35);
  background: #eff6ff;
  color: #0369a1;
}

.cleaning-plugin-status.checking {
  border-color: rgba(2, 132, 199, 0.35);
  background: #eff6ff;
  color: #0369a1;
}

.cleaning-plugin-status.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: #fef2f2;
  color: #dc2626;
}

.cleaning-wa-run-status {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 27, 51, 0.05);
}

.cleaning-wa-run-status > div:first-child {
  display: grid;
  gap: 4px;
}

.cleaning-wa-run-status strong {
  color: var(--ink);
  font-size: 14px;
}

.cleaning-wa-run-status span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cleaning-wa-run-status.running {
  border-color: rgba(2, 132, 199, 0.28);
  background: #f8fbff;
}

.cleaning-wa-run-status.success {
  border-color: rgba(34, 197, 94, 0.32);
  background: #f6fef9;
}

.cleaning-wa-run-status.error {
  border-color: rgba(239, 68, 68, 0.32);
  background: #fff7f7;
}

.cleaning-wa-run-meter {
  overflow: hidden;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5eef8;
}

.cleaning-wa-run-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width 180ms ease;
}

.cleaning-wa-run-status.error .cleaning-wa-run-meter span {
  background: #ef4444;
}

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

.cleaning-stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 27, 51, 0.06);
}

.cleaning-stat.danger {
  border-top-color: #ef4444;
}

.cleaning-stat.good {
  border-top-color: #22c55e;
}

.cleaning-stat span,
.cleaning-stat small {
  display: block;
  color: var(--muted);
}

.cleaning-stat span {
  font-weight: 800;
  font-size: 13px;
}

.cleaning-stat strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.cleaning-board {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

.cleaning-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cleaning-card-wide {
  grid-column: 1 / -1;
}

.cleaning-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.cleaning-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cleaning-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.phone-dedupe-row.available {
  border-color: rgba(34, 197, 94, 0.28);
  background: #f7fefb;
}

.phone-dedupe-row.duplicate,
.phone-dedupe-row.invalid {
  border-color: rgba(239, 68, 68, 0.22);
  background: #fffafa;
}

.phone-dedupe-row.risk {
  border-color: rgba(245, 158, 11, 0.26);
  background: #fffdf6;
}

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

.cleaning-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cleaning-row-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cleaning-row-main small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.cleaning-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.cleaning-badge.warn {
  background: #fff7ed;
  color: #b45309;
}

.cleaning-badge.danger {
  background: #fef2f2;
  color: #dc2626;
}

.cleaning-badge.good {
  background: #ecfdf5;
  color: #047857;
}

.cleaning-match-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

@media (max-width: 1080px) {
  .cleaning-board {
    grid-template-columns: 1fr;
  }

  .cleaning-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cleaning-stat-grid {
    grid-template-columns: 1fr;
  }
}

.internal-maps-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.internal-maps-actions,
.card-header-row,
.internal-detail-card .detail-actions,
.internal-submit-row,
.internal-job-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.internal-help-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.internal-help-strip div {
  min-width: 0;
  border-left: 3px solid rgba(14, 165, 233, 0.55);
  padding-left: 10px;
}

.internal-help-strip strong,
.internal-help-strip span {
  display: block;
}

.internal-help-strip strong {
  color: var(--ink);
  font-size: 13px;
}

.internal-help-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.internal-submit-row {
  margin-top: 12px;
}

.internal-submit-row button {
  flex: 1 1 0;
}

.internal-submit-row.primary-only button {
  flex: 1 1 auto;
  min-height: 46px;
}

.internal-create-card textarea {
  min-height: 160px;
}

.internal-local-settings {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.internal-local-settings summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.internal-local-settings[open] summary {
  color: var(--ink);
}

.internal-local-settings .form-grid,
.internal-local-actions {
  margin-top: 10px;
}

.internal-local-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.internal-local-actions button {
  flex: 0 1 auto;
}

.compact-btn {
  padding: 8px 10px;
  min-height: 36px;
  font-size: 12px;
}

.internal-job-section-title {
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.internal-maps-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.internal-card,
.internal-detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.internal-detail-card {
  overflow: hidden;
}

.internal-card h3,
.internal-detail-card h3 {
  margin: 0 0 10px;
}

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

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

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-line input {
  width: auto;
}

.internal-jobs-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.internal-jobs-list.cloud {
  max-height: 260px;
}

.internal-runner-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.internal-runner-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
}

.internal-runner-item strong,
.internal-runner-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-runner-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.internal-runner-item .runner-cloud-meta {
  white-space: normal;
  line-height: 1.35;
  color: #2563eb;
}

.internal-runner-item .runner-cloud-meta.error {
  color: #b91c1c;
}

.runner-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9ca3af;
}

.runner-dot.online,
.runner-dot.idle {
  background: #15803d;
}

.runner-dot.busy {
  background: #b45309;
}

.runner-dot.offline {
  background: #dc2626;
}
.internal-job-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 11px;
  text-align: left;
  color: var(--ink);
}

.internal-job-item:hover,
.internal-job-item.active {
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(31, 122, 90, 0.08);
}

.internal-job-item.cloud {
  background: #f8fbff;
}

.internal-job-item.cloud.active {
  border-color: #2563eb;
}

.internal-job-item strong {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.internal-status {
  font-weight: 850;
}

.internal-status.running {
  color: #b45309;
}

.internal-status.complete {
  color: #15803d;
}

.internal-status.error,
.internal-status.cancelled {
  color: var(--danger);
}

.internal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.internal-stat-grid > div {
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.internal-stat-grid strong {
  display: block;
  color: var(--brand-dark);
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.internal-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
  min-width: 0;
}

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

.internal-detail-grid > article {
  min-width: 0;
}

.internal-log-list,
.table-scroll {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  max-height: 360px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: auto;
}

.internal-detail-grid.results-only .table-scroll {
  max-height: 520px;
}

.internal-log-line {
  display: grid;
  grid-template-columns: 74px 58px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.internal-log-time {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.internal-log-level {
  font-weight: 850;
  text-transform: uppercase;
}

.internal-log-level.success {
  color: #15803d;
}

.internal-log-level.error {
  color: var(--danger);
}

.internal-results-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.internal-results-table th,
.internal-results-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-results-table a {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.internal-results-table th {
  position: sticky;
  top: 0;
  background: #f0f9ff;
  z-index: 1;
}

.internal-detail-card a.disabled {
  pointer-events: none;
  opacity: 0.52;
}

@media (max-width: 1180px) {
  .internal-help-strip,
  .internal-maps-grid,
  .internal-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .form-grid.compact,
  .internal-stat-grid {
    grid-template-columns: 1fr;
  }
}

.internal-runner-item.outdated {
  border-color: #f59e0b;
  background: #fffbeb;
}

.runner-dot.outdated {
  background: #f59e0b;
}
#internalMapsCreateCloudJobBtn.warning {
  border-color: #f59e0b;
  color: #92400e;
  background: #fffbeb;
}
.internal-retry-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.internal-inline-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.internal-inline-link:hover {
  color: #1d4ed8;
}

/* Final sidebar behavior: menu owns the left rail, details stay in the main workspace. */
.app-shell {
  --sidebar-width: 246px;
  --sidebar-rail-width: 82px;
  display: block;
  grid-template-columns: 246px minmax(0, 1fr);
  transition: grid-template-columns 0.22s ease;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: visible;
  padding-bottom: 18px;
}

.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.22s ease;
}

.brand-lockup,
.sidebar-account-card,
.sidebar-settings-btn {
  flex: 0 0 auto;
}

.sidebar-mini-logo {
  display: none;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  place-items: center;
  background: linear-gradient(135deg, #e0f2fe, #38bdf8);
  color: #0f1b33;
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.2);
}

.sidebar-mini-logo svg {
  width: 38px;
  height: 38px;
  display: block;
}

.sidebar-collapse-toggle {
  position: absolute;
  top: 50%;
  right: -15px;
  z-index: 20;
  width: 30px;
  height: 56px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-left-color: rgba(224, 242, 254, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark);
  box-shadow: 0 14px 34px rgba(15, 27, 51, 0.14);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  transform: translateY(-50%);
}

.sidebar-collapse-toggle:hover {
  border-color: var(--brand);
  box-shadow: 0 16px 32px rgba(14, 165, 233, 0.2);
  transform: translateY(-50%) translateX(2px);
}

.sidebar-collapse-toggle:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.24);
  outline-offset: 2px;
}

.sidebar-collapse-toggle span {
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.nav-list {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 10px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.52) transparent;
}

.nav-group {
  align-content: start;
  align-self: start;
}

.nav-group-title {
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  align-self: start;
}

.nav-group.collapsed .nav-group-title {
  height: 64px;
  min-height: 64px;
  max-height: 64px;
}

.nav-list::-webkit-scrollbar {
  width: 6px;
}

.nav-list::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.52);
  border-radius: 999px;
}

.sidebar-panel {
  display: none;
}

.sidebar-settings-btn {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 27, 51, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-settings-btn:hover {
  border-color: rgba(56, 189, 248, 0.68);
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.13);
  transform: translateY(-1px);
}

.sidebar-settings-btn:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.24);
  outline-offset: 2px;
}

.sidebar-settings-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: var(--brand-dark);
}

.sidebar-settings-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.sidebar-settings-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-settings-copy strong,
.sidebar-settings-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-settings-copy strong {
  font-size: 13px;
  font-weight: 900;
}

.sidebar-settings-copy small {
  color: var(--muted);
  font-size: 11px;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-rail-width);
  align-items: center;
  padding-inline: 14px;
  gap: 16px;
}

.app-shell.sidebar-collapsed .main {
  margin-left: var(--sidebar-rail-width);
}

.app-shell.sidebar-collapsed .brand-lockup {
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding-bottom: 14px;
}

.app-shell.sidebar-collapsed .brand-logo,
.app-shell.sidebar-collapsed .brand-lockup > div,
.app-shell.sidebar-collapsed .account-copy,
.app-shell.sidebar-collapsed .sidebar-settings-copy,
.app-shell.sidebar-collapsed .nav-group-copy,
.app-shell.sidebar-collapsed .nav-group-chevron,
.app-shell.sidebar-collapsed .nav-group-items {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-mini-logo {
  display: grid;
}

.app-shell.sidebar-collapsed .sidebar-collapse-toggle {
  right: -15px;
}

.app-shell.sidebar-collapsed .sidebar-collapse-toggle span {
  transform: rotate(-135deg);
}

.app-shell.sidebar-collapsed .sidebar-account-card {
  width: 54px;
  min-height: 54px;
  padding: 8px;
  justify-content: center;
}

.app-shell.sidebar-collapsed .account-avatar {
  width: 38px;
  height: 38px;
}

.app-shell.sidebar-collapsed .sidebar-settings-btn {
  width: 54px;
  min-height: 54px;
  padding: 8px;
  grid-template-columns: 1fr;
  place-items: center;
}

.app-shell.sidebar-collapsed .sidebar-settings-icon {
  width: 38px;
  height: 38px;
}

.app-shell.sidebar-collapsed .nav-list {
  width: 100%;
  padding: 2px 0 10px;
}

.app-shell.sidebar-collapsed .nav-group {
  justify-items: center;
}

.app-shell.sidebar-collapsed .nav-group-title {
  width: 54px;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  grid-template-columns: 1fr;
  padding: 9px;
  place-items: center;
}

.app-shell.sidebar-collapsed .nav-group-title > span:first-child {
  width: 34px;
  height: 34px;
}

@media (max-width: 1080px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .main,
  .app-shell.sidebar-collapsed .main {
    margin-left: 0;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .nav-list {
    overflow: visible;
  }
}

/* Detail pane should expand with the page; no nested scrollbar in lead info. */
.workspace-grid .detail-panel {
  position: static !important;
  align-self: start;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.workspace-grid .detail-content {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  overflow: visible !important;
  grid-template-rows: auto auto auto auto;
}

.workspace-grid .detail-tab-body,
.workspace-grid .detail-tab-panel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.workspace-grid .detail-tab-panel[hidden] {
  display: none !important;
}

/* Lead controls stay on one scan line while the date range opens in a compact popover. */
.lead-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(108px, 136px) minmax(128px, 150px) minmax(180px, 220px) auto auto !important;
  align-items: end;
}

.lead-date-picker {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.date-range-trigger {
  min-height: 42px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.date-range-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-range-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid #cfe1ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(21, 53, 75, 0.18);
}

.date-range-quick-actions,
.date-range-actions,
.social-result-actions,
.plan-dialog-lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.date-range-actions {
  justify-content: flex-end;
}

.social-result-actions {
  justify-content: flex-end;
  align-items: center;
}

.social-history-item {
  position: relative;
  padding: 0;
  cursor: default;
  overflow: hidden;
}

.social-history-open {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.social-history-retry {
  margin: 0 12px 12px;
  justify-self: start;
}

.plan-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: auto;
}

.plan-dialog-form {
  padding: 20px;
}

.dialog-close-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.plan-dialog-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.plan-dialog-lead {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.plan-dialog-lead summary {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.plan-dialog-lead summary span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.plan-dialog-lead summary small,
.plan-dialog-lead-detail p {
  color: var(--muted);
}

.plan-dialog-lead summary em {
  flex: 0 0 auto;
  font-style: normal;
  color: #087fb6;
  font-weight: 800;
}

.plan-dialog-lead-detail {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.plan-research-progress {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  color: #075985;
}

@media (max-width: 760px) {
  .lead-toolbar {
    min-width: 820px;
  }

  .lead-list-panel {
    overflow-x: auto;
  }

  .date-range-popover {
    left: 0;
    right: auto;
  }
}

@media (min-width: 761px) and (max-width: 1500px) {
  .lead-toolbar {
    grid-template-columns: minmax(140px, 1fr) 108px 128px minmax(120px, 160px) 64px 64px !important;
  }
}
