.crm-geo-map-card {
  padding: 0;
  overflow: hidden;
}

.crm-geo-map {
  min-height: 520px;
  height: clamp(420px, 62vh, 720px);
  position: relative;
  background: #e5edf4;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.crm-geo-map.dragging {
  cursor: grabbing;
}

.crm-geo-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.crm-geo-tile {
  opacity: .96;
}

.crm-geo-map-mask {
  fill: rgba(248, 250, 252, .12);
  pointer-events: none;
}

.crm-geo-marker {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, .25));
}

.crm-geo-marker.prospect {
  fill: #2563eb;
}

.crm-geo-marker.customer {
  fill: #16a34a;
}

.crm-geo-marker.tone-new {
  fill: #2563eb;
}

.crm-geo-marker.tone-review {
  fill: #f59e0b;
}

.crm-geo-marker.tone-contacted {
  fill: #7c3aed;
}

.crm-geo-marker.tone-qualified {
  fill: #0891b2;
}

.crm-geo-marker.tone-converted,
.crm-geo-marker.tone-customer,
.crm-geo-marker.tone-b2b-customer {
  fill: #16a34a;
}

.crm-geo-marker.tone-b2c-customer {
  fill: #db2777;
}

.crm-geo-marker.tone-lost {
  fill: #64748b;
}

.crm-geo-marker.selected {
  stroke: #0f172a;
  stroke-width: 4;
}

.crm-geo-boundary {
  fill: rgba(14, 165, 233, .10);
  stroke: #0369a1;
  stroke-width: 2;
  pointer-events: none;
}

.crm-geo-boundary-label {
  fill: #075985;
  stroke: rgba(255, 255, 255, .9);
  stroke-width: 3;
  paint-order: stroke;
  font-size: 14px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.crm-geo-heat {
  fill: rgba(37, 99, 235, .08);
  stroke: 0;
}

.crm-geo-empty-state {
  position: absolute;
  left: 16px;
  top: 16px;
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .5);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--muted);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  pointer-events: none;
}

.crm-geo-map-caption,
.crm-geo-attribution {
  position: absolute;
  z-index: 1;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .88);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
}

.crm-geo-map-caption {
  left: 8px;
  font-weight: 700;
}

.crm-geo-attribution {
  right: 8px;
}

.crm-geo-map-controls {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: grid;
  gap: 6px;
}

.crm-geo-map-controls button {
  min-width: 38px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, .65);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
  cursor: pointer;
}

.crm-geo-map-controls button:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, .35);
}

.crm-geo-side-panel {
  position: sticky;
  top: 12px;
}

.crm-geo-customer-tools input {
  width: 100%;
  min-width: 0;
}

.crm-geo-customer-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

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

.crm-geo-customer-row:hover,
.crm-geo-customer-row.active {
  border-color: rgba(37, 99, 235, .5);
  background: #f8fbff;
}

.crm-geo-customer-row strong,
.crm-geo-customer-row small {
  display: block;
  overflow-wrap: anywhere;
}

.crm-geo-customer-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.crm-geo-customer-meta {
  flex: 0 0 auto;
  max-width: 45%;
  text-align: right;
}

.crm-geo-list-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.crm-geo-legend {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.crm-geo-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.crm-geo-legend i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .18);
  flex: 0 0 auto;
}

.crm-geo-legend .tone-new { background: #2563eb; }
.crm-geo-legend .tone-review { background: #f59e0b; }
.crm-geo-legend .tone-contacted { background: #7c3aed; }
.crm-geo-legend .tone-qualified { background: #0891b2; }
.crm-geo-legend .tone-converted { background: #16a34a; }
.crm-geo-legend .tone-customer { background: #16a34a; }
.crm-geo-legend .tone-b2b-customer { background: #16a34a; }
.crm-geo-legend .tone-b2c-customer { background: #db2777; }
.crm-geo-legend .tone-lost { background: #64748b; }
.crm-geo-legend .tone-postcode-boundary {
  background: rgba(14, 165, 233, .12);
  border-color: #0369a1;
  box-shadow: none;
}

.crm-geo-area-chip {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.crm-geo-area-chip:hover {
  border-color: rgba(37, 99, 235, .45);
  background: #f8fbff;
}

.crm-geo-area-chip strong,
.crm-geo-area-chip span {
  display: block;
}

.crm-geo-area-chip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.crm-prospect-crm-inline {
  border-color: rgba(37, 99, 235, .18);
  background: #f8fbff;
}

.crm-prospect-customer-ops-summary {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

.crm-prospect-customer-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.crm-prospect-customer-ops-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.crm-prospect-customer-ops-panel h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.crm-prospect-customer-followup-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.crm-prospect-customer-followup-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.crm-prospect-crm-row {
  display: grid;
  grid-template-columns: minmax(120px, .32fr) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.crm-prospect-crm-row span {
  color: var(--muted);
  font-weight: 700;
}

.crm-prospect-crm-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-prospect-crm-section-title {
  margin-top: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .crm-api-integrations-grid,
  .crm-leads-layout,
  .crm-prospect-customer-ops-grid,
  .crm-detail-header,
  .crm-area-layout,
  .crm-geo-map-layout,
  .crm-geo-layout,
  .crm-imports-layout,
  .crm-detail-grid,
  .crm-review-decision-grid,
  .crm-filter-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-score-grid {
    min-width: 0;
    width: 100%;
  }
}
