/* CRM API and pipeline tail styles split from admin-portal.css. */
.crm-api-integrations-grid {
      grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 0.65fr);
    }

    .crm-copy-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .crm-copy-row input {
      flex: 1 1 auto;
      min-width: 0;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    }

    .crm-copy-row code {
      flex: 1 1 auto;
      min-width: 0;
      overflow-wrap: anywhere;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 13px;
      color: #334155;
    }

    .crm-copy-row-compact {
      align-items: flex-start;
    }

    .crm-copy-block {
      width: 100%;
      border: 1px solid var(--line);
      background: #f8fafc;
      color: #111827;
      text-align: left;
      white-space: pre-wrap;
      word-break: break-word;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      cursor: pointer;
    }

    .crm-copy-block:hover,
    .crm-row-button:hover,
    .crm-kanban-card:hover {
      border-color: #94a3b8;
      background: #f8fafc;
    }

    .crm-page-card {
      border-radius: 8px;
    }

    .crm-filter-strip {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      align-items: end;
    }

    .crm-lead-input-rail {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 12px;
    }

    .crm-lead-input-rail button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 30px;
      padding: 5px 9px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #fff;
      color: var(--text);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
    }

    .crm-lead-input-rail button.active {
      border-color: #93c5fd;
      background: #eff6ff;
      color: #0f172a;
    }

    .crm-lead-input-rail strong {
      min-width: 20px;
      padding: 1px 6px;
      border-radius: 999px;
      background: #f1f5f9;
      color: #0f172a;
      text-align: center;
      font-size: 12px;
      line-height: 1.35;
    }

    .crm-filter-search {
      min-width: 260px;
    }

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

    .crm-leads-left,
    .crm-leads-right {
      min-width: 0;
    }

    .crm-leads-table {
      min-width: 420px;
      table-layout: fixed;
    }

    .crm-leads-table th:first-child {
      width: 44%;
    }

    .crm-leads-table th:nth-child(2) {
      width: 34%;
    }

    .crm-leads-table th:nth-child(3) {
      width: 22%;
    }

    .crm-row-button {
      display: flex;
      flex-direction: column;
      gap: 2px;
      width: 100%;
      min-width: 0;
      padding: 0;
      border: 0;
      background: transparent;
      color: inherit;
      text-align: left;
      cursor: pointer;
    }

    .crm-lead-row-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 4px;
    }

    .crm-source-chip {
      display: inline-flex;
      align-items: center;
      max-width: 100%;
      min-height: 20px;
      padding: 2px 6px;
      border: 1px solid #dbe4ef;
      border-radius: 999px;
      background: #f8fafc;
      color: #475569;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.2;
    }

    .crm-source-chip.meta {
      border-color: #bfdbfe;
      background: #eff6ff;
      color: #1d4ed8;
    }

    .crm-source-chip.geo {
      border-color: #bbf7d0;
      background: #f0fdf4;
      color: #166534;
    }

    .crm-source-chip.klaviyo {
      border-color: #e9d5ff;
      background: #faf5ff;
      color: #7e22ce;
    }

    .crm-source-chip.manual {
      border-color: #fed7aa;
      background: #fff7ed;
      color: #9a3412;
    }

    .crm-imports-layout {
      display: grid;
      grid-template-columns: repeat(3, minmax(280px, 1fr));
      gap: 12px;
      align-items: start;
    }

    .crm-imports-layout textarea {
      width: 100%;
      min-height: 160px;
      resize: vertical;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 12px;
      line-height: 1.4;
    }

    .crm-row-button strong {
      line-height: 1.15;
      overflow-wrap: anywhere;
    }

    .crm-row-button span {
      color: var(--muted);
      overflow-wrap: anywhere;
      font-size: 13px;
    }

    tr.active .crm-row-button strong {
      color: #1d4ed8;
    }

    .crm-pipeline-shell-card {
      overflow: hidden;
    }

    .crm-kanban-details,
    .crm-pipeline-table-details {
      padding: 0;
      overflow: hidden;
    }

    .crm-details-summary {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      padding: 14px 16px;
      cursor: pointer;
      font-weight: 700;
    }

    .crm-pipeline-board {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(240px, 290px);
      gap: 10px;
      overflow-x: auto;
      padding: 0 16px 16px;
      align-items: start;
    }

    .crm-pipeline-board-primary {
      padding: 0 0 10px;
      scroll-snap-type: x proximity;
    }

    .crm-kanban-column {
      min-height: 360px;
      border: 1px solid rgba(148, 163, 184, .28);
      border-radius: 8px;
      padding: 6px;
      background: rgba(15, 23, 42, .02);
      scroll-snap-align: start;
    }

    .crm-kanban-card {
      display: block;
      width: 100%;
      text-align: left;
      margin-top: 5px;
      padding: 5px 6px;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      background: #fff;
      cursor: grab;
    }

    .crm-kanban-card:active {
      cursor: grabbing;
    }

    .crm-kanban-drag-image {
      position: fixed;
      top: -1000px;
      left: -1000px;
      z-index: -1;
      pointer-events: none;
      opacity: .96;
      box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
    }

    .crm-kanban-card-head {
      display: grid;
      grid-template-columns: 18px minmax(0, 1fr) 26px;
      align-items: start;
      gap: 6px;
    }

    .crm-kanban-card-head strong {
      min-width: 0;
      font-size: 13px;
      line-height: 18px;
      overflow-wrap: anywhere;
    }

    .crm-kanban-card > span:not(.crm-lead-row-meta) {
      display: block;
      margin-top: 2px;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }

    .crm-kanban-card.active {
      border-color: #1d4ed8;
      box-shadow: inset 0 0 0 1px #1d4ed8;
    }

    .crm-prospect-detail {
      border-radius: 8px;
    }

    .crm-detail-header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr);
      gap: 12px;
      align-items: start;
    }

    .crm-detail-heading {
      min-width: 0;
    }

    .crm-detail-heading a {
      overflow-wrap: anywhere;
    }

    .crm-header-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }

    .crm-score-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
      gap: 8px;
      min-width: 0;
    }

    .crm-score-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 7px 8px;
      background: #f8fafc;
      min-width: 0;
    }

    .crm-score-card span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 2px;
    }

    .crm-score-card strong {
      font-size: 20px;
      line-height: 1.1;
      overflow-wrap: anywhere;
    }

    .crm-score-card small {
      display: block;
      margin-top: 2px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.2;
    }

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

    .crm-detail-grid-tight {
      gap: 10px;
    }

    .crm-detail-block {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: #fff;
      min-width: 0;
    }

    .crm-detail-block h3 {
      margin-bottom: 7px;
      font-size: 16px;
    }

    .crm-research-brief-block .crm-rich-text {
      max-height: 160px;
      overflow: auto;
    }

    .crm-stack > div,
    .crm-source-row {
      padding: 6px 0;
      border-bottom: 1px solid var(--line);
    }

    .crm-stack > div:last-child,
    .crm-source-row:last-child {
      border-bottom: 0;
    }

    .crm-rich-text {
      white-space: pre-line;
      line-height: 1.45;
    }

    .crm-compact-controls {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
      align-items: end;
    }

    .crm-leads-panel .ops-field input,
    .crm-leads-panel .ops-field select,
    .crm-leads-panel .ops-field textarea {
      padding: 8px 10px;
    }

    .crm-score-line {
      display: grid;
      grid-template-columns: minmax(110px, 1fr) auto;
      gap: 6px 10px;
      align-items: baseline;
    }

    .crm-score-line span {
      color: var(--text);
      font-weight: 700;
    }

    .crm-score-line small,
    .crm-score-line em {
      grid-column: 1 / -1;
      color: var(--muted);
      font-size: 12px;
      font-style: normal;
    }

    .crm-compact-source-row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
    }

    .crm-detail-summary {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      cursor: pointer;
      font-weight: 700;
    }

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

    .crm-location-strip {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fafc;
      padding: 10px 12px;
    }

    .crm-location-primary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      color: var(--text);
      font-weight: 700;
    }

    .crm-location-postcode {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 3px 9px;
      border-radius: 999px;
      background: #e0f2fe;
      color: #075985;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 14px;
    }

    .crm-location-address {
      margin-top: 6px;
      color: var(--muted);
      overflow-wrap: anywhere;
    }

    .crm-location-empty {
      color: var(--muted);
    }

    .crm-area-layout,
    .crm-geo-layout {
      display: grid;
      grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
      gap: 12px;
      align-items: start;
    }

    .crm-geo-map-layout {
      display: grid;
      grid-template-columns: minmax(640px, 2.4fr) minmax(320px, .9fr);
      gap: 12px;
      align-items: start;
    }

    .crm-area-summary-grid,
    .crm-area-coverage-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
    }

    .crm-area-kpi {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fafc;
      padding: 10px;
      min-width: 0;
    }

    .crm-area-kpi span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 3px;
    }

    .crm-area-kpi strong {
      display: block;
      font-size: 20px;
      line-height: 1.1;
      overflow-wrap: anywhere;
    }

    .crm-area-table {
      min-width: 760px;
    }

    .crm-area-lead-preview {
      border-top: 1px solid var(--line);
      padding-top: 10px;
    }

    .crm-area-lead-preview-header {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      margin-bottom: 8px;
      color: var(--text);
    }

    .crm-area-lead-list {
      display: grid;
      gap: 6px;
    }

    .crm-area-lead-row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: inherit;
      text-align: left;
      cursor: pointer;
    }

    .crm-area-lead-row:hover {
      border-color: #94a3b8;
      background: #f8fafc;
    }

    .crm-area-lead-row small {
      display: block;
      margin-top: 2px;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }

    .crm-area-row-button,
    .crm-geo-row-button {
      width: 100%;
      border: 0;
      background: transparent;
      text-align: left;
      padding: 0;
      cursor: pointer;
      color: inherit;
    }

    .crm-area-row-button span,
    .crm-geo-row-button span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }
