:root {
  --cp-bg: #f4f8fc;
  --cp-bg-2: #eef5ff;
  --cp-surface: rgba(255, 255, 255, 0.82);
  --cp-surface-strong: rgba(255, 255, 255, 0.96);
  --cp-text: #0f172a;
  --cp-muted: #64748b;
  --cp-line: rgba(148, 163, 184, 0.18);
  --cp-primary: #0f5bd8;
  --cp-primary-strong: #0a47ad;
  --cp-accent: #0ea5e9;
  --cp-success: #059669;
  --cp-danger: #dc2626;
  --cp-warning: #d97706;
  --cp-shadow-1: 0 16px 40px rgba(15, 23, 42, 0.08);
  --cp-shadow-2: 0 28px 70px rgba(15, 23, 42, 0.14);
}

body {
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--cp-text);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 91, 216, 0.1), transparent 24%),
    linear-gradient(180deg, var(--cp-bg) 0%, var(--cp-bg-2) 100%);
}

.cp-shell,
.container,
.wrap {
  width: min(1320px, calc(100% - 24px));
  margin: 0 auto;
}

.cp-hero,
header,
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(8, 15, 33, 0.92), rgba(15, 91, 216, 0.88)),
    linear-gradient(135deg, #0f172a, #1d4ed8);
  box-shadow: var(--cp-shadow-2);
}

.cp-hero::after,
header::after,
.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.34), rgba(125, 211, 252, 0));
  pointer-events: none;
}

.cp-nav-pill,
.nav a,
.nav-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  text-decoration: none;
}

.cp-nav-pill.active,
.nav a.active,
.nav-link.active {
  background: #fff;
  color: #0f172a;
  border-color: #fff;
}

.cp-card,
.card,
.table-card,
.table-container,
.toolbar,
.quality-box,
.metric-card,
.stat {
  background: var(--cp-surface);
  border: 1px solid var(--cp-line);
  box-shadow: var(--cp-shadow-1);
  backdrop-filter: blur(16px);
}

.cp-input,
input,
select,
textarea,
.auth-input,
.search-input,
.input-base,
.select-base,
.textarea-base {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: var(--cp-text);
}

.cp-input:focus,
input:focus,
select:focus,
textarea:focus,
.auth-input:focus,
.search-input:focus,
.input-base:focus,
.select-base:focus,
.textarea-base:focus {
  outline: none;
  border-color: rgba(15, 91, 216, 0.42);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.cp-btn,
.btn,
button.primary,
.btn-primary,
.btn-brand,
.btn-outline,
.actions button,
.toolbar button {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.btn-primary,
.btn-brand,
button.primary {
  color: white;
  background: linear-gradient(135deg, var(--cp-primary), var(--cp-accent));
  box-shadow: 0 14px 28px rgba(15, 91, 216, 0.22);
}

.btn-outline,
.actions .dismiss {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #334155;
}

.actions .valid,
.btn-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.16);
  color: #166534;
}

.actions .anomaly,
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

.metric-label,
.stat-label,
.stat small,
th,
.small,
.card-title {
  color: var(--cp-muted);
  letter-spacing: 0.12em;
  font-weight: 800;
}

.metric-value,
.stat-value,
.stat strong {
  color: var(--cp-text);
  letter-spacing: -0.05em;
}

th {
  background: rgba(248, 250, 252, 0.96);
}

@media (max-width: 920px) {
  .cp-shell,
  .container,
  .wrap {
    width: min(100% - 16px, 100%);
  }

  .nav a,
  .nav-link,
  .toolbar button,
  .actions button {
    width: 100%;
  }
}

.insight-kpi-card {
  padding: 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.88), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.insight-kpi-card__eyebrow {
  font-size: 0.66rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--cp-muted);
}

.insight-kpi-card__value {
  margin-top: 0.45rem;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--cp-text);
}

.insight-kpi-card__meta {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--cp-muted);
}

.insight-kpi-card--positive {
  border-color: rgba(16, 185, 129, 0.18);
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.92));
}

.insight-kpi-card--negative {
  border-color: rgba(239, 68, 68, 0.18);
  background:
    radial-gradient(circle at top right, rgba(248, 113, 113, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 255, 255, 0.92));
}

.insight-kpi-card--neutral {
  border-color: rgba(148, 163, 184, 0.16);
}

.insight-series-subtitle {
  margin-top: 0.22rem;
  font-size: 0.72rem;
  color: var(--cp-muted);
}

.insight-series-subtitle span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--cp-primary-strong);
  font-weight: 700;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.trend-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--cp-muted);
  font-weight: 700;
}

.trend-legend__swatch {
  display: inline-block;
  width: 1.4rem;
  height: 0.32rem;
  border-radius: 999px;
  background: var(--cp-primary);
}

.trend-legend__swatch--observed {
  opacity: 1;
}

.trend-legend__swatch--imputed {
  opacity: 0.45;
  background: repeating-linear-gradient(
    90deg,
    rgba(15, 91, 216, 0.58) 0,
    rgba(15, 91, 216, 0.58) 8px,
    rgba(15, 91, 216, 0.16) 8px,
    rgba(15, 91, 216, 0.16) 14px
  );
}

.sidebar-search-card {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.94));
}

.sidebar-search-badge,
.sidebar-analytics-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.16);
  background: rgba(239, 246, 255, 0.92);
  color: var(--cp-primary-strong);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
  max-width: 6.75rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sidebar-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cp-muted);
  font-size: 1rem;
  pointer-events: none;
}

.sidebar-search-input {
  min-height: 56px;
  font-size: 0.95rem;
  font-weight: 600;
}

.sidebar-selected-product {
  border-radius: 1rem;
  border: 1px solid rgba(14, 165, 233, 0.16);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.94));
  padding: 0.85rem 0.95rem;
}

.sidebar-analytics-shell {
  padding: 1rem;
}

.sidebar-tabs {
  position: relative;
}

.sidebar-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sidebar-tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 1rem;
  background: rgba(241, 245, 249, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.sidebar-tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.6rem 0.8rem;
  border-radius: 0.85rem;
  color: var(--cp-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

#analyticsTabInsight:checked ~ .sidebar-tab-list label[for="analyticsTabInsight"],
#analyticsTabTop:checked ~ .sidebar-tab-list label[for="analyticsTabTop"] {
  color: var(--cp-text);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.sidebar-tab-panels {
  margin-top: 0.9rem;
}

.sidebar-tab-panel {
  display: none;
}

#analyticsTabInsight:checked ~ .sidebar-tab-panels .sidebar-tab-panel--insight,
#analyticsTabTop:checked ~ .sidebar-tab-panels .sidebar-tab-panel--top {
  display: block;
}

.sidebar-analytics-panel {
  border-radius: 1.05rem;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  padding: 1rem;
}

.sidebar-tab-panel > .sidebar-analytics-panel:not(.hidden) + .sidebar-panel-placeholder {
  display: none;
}

.sidebar-panel-placeholder {
  display: grid;
  gap: 0.55rem;
  place-items: center;
  text-align: center;
  min-height: 250px;
  padding: 1.2rem;
  border-radius: 1.05rem;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background:
    radial-gradient(circle at top, rgba(14, 165, 233, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94));
}

.sidebar-panel-placeholder--compact {
  min-height: 220px;
}

.sidebar-panel-placeholder__icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--cp-primary-strong);
  font-size: 1.25rem;
}

.sidebar-panel-placeholder__title {
  color: var(--cp-text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-panel-placeholder__text {
  max-width: 28ch;
  color: var(--cp-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.zone-label-marker,
.h3-count-marker {
  background: transparent;
  border: 0;
}

.h3-number-label {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
}

.h3-number-label__text,
.h3-number-label > div {
  color: #0f172a;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  pointer-events: none !important;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.95),
    0 0 8px rgba(255, 255, 255, 0.85),
    1px 0 0 rgba(255, 255, 255, 0.9),
    -1px 0 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 -1px 0 rgba(255, 255, 255, 0.9);
}

.h3-number-label--compact .h3-number-label__text,
.h3-number-label--compact > div {
  font-size: 8px;
  font-weight: 900;
}

.cp-panel-header {
  align-items: flex-start;
}

.cp-panel-header > * {
  min-width: 0;
}

.cp-text-safe {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cp-panel-scroll {
  max-height: min(40vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cp-metric-clamp {
  font-size: clamp(1.25rem, 4vw, 1.875rem) !important;
}

.cp-panel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.cp-panel-action-btn:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.zone-label-marker > div,
.h3-count-marker,
.h3-count-marker > div {
  display: flex;
  align-items: center;
  justify-content: center;
}

.h3-count-marker {
  width: 0;
  height: 0;
  margin: 0;
  position: relative;
  overflow: visible;
  background: transparent;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.h3-count-marker > div,
.h3-count-marker__value {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}

.h3-count-marker__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
}

.map-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.45rem 0.7rem 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.92);
  color: var(--cp-text);
  text-decoration: none;
  box-shadow: var(--cp-shadow-1);
  backdrop-filter: blur(18px);
}

.map-settings-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
}

.map-settings-btn__label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.map-settings-btn__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.84);
  color: var(--cp-muted);
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.map-settings-btn[data-state="ready"] {
  border-color: rgba(16, 185, 129, 0.2);
}

.map-settings-btn[data-state="ready"] .map-settings-btn__status {
  background: rgba(16, 185, 129, 0.12);
  color: #166534;
}

.map-settings-btn[data-state="partial"] {
  border-color: rgba(217, 119, 6, 0.2);
}

.map-settings-btn[data-state="partial"] .map-settings-btn__status {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.cp-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cp-modal:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.cp-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 24px));
  padding: 1.25rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--cp-shadow-2);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.cp-modal:target .cp-modal__dialog {
  transform: translateY(0) scale(1);
}

.cp-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cp-modal__title {
  margin-top: 0.3rem;
  font-size: 1.3rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--cp-text);
}

.cp-modal__text {
  margin-top: 0.45rem;
  color: var(--cp-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.cp-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.15rem;
}

.cp-field {
  display: grid;
  gap: 0.45rem;
}

.cp-field__label {
  color: var(--cp-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cp-field__hint {
  color: var(--cp-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.cp-settings-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#map,
.leaflet-container {
  position: relative;
  z-index: 0;
  pointer-events: auto;
}

#map.map-location-picking,
#map.map-location-picking *,
#map.map-location-picking .leaflet-interactive,
#map.map-location-picking .leaflet-marker-icon {
  cursor: crosshair !important;
}

.leaflet-pane svg,
.leaflet-overlay-pane svg,
.leaflet-h3-pane svg {
  max-width: none !important;
  overflow: visible !important;
}

.leaflet-h3-pane,
.leaflet-h3-pane svg,
.leaflet-h3-pane path {
  pointer-events: auto;
}

.leaflet-h3-pane path {
  cursor: pointer;
}

.leaflet-tooltip.report-point-tooltip {
  background: rgba(15, 23, 42, 0.94);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
  color: #f8fafc;
  padding: 0.7rem 0.8rem;
  backdrop-filter: blur(14px);
  pointer-events: none;
  white-space: nowrap;
  min-width: 120px;
}

.leaflet-tooltip-top.report-point-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.94);
}

.leaflet-tooltip-bottom.report-point-tooltip::before {
  border-bottom-color: rgba(15, 23, 42, 0.94);
}

.report-point-tooltip__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-point-tooltip__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.15;
  font-weight: 800;
}

.report-point-tooltip__swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.report-point-tooltip__price {
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.report-point-tooltip__meta {
  margin-top: 0.38rem;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.68rem;
  line-height: 1.35;
}

.report-detail-shell {
  position: absolute;
  inset: 0;
  z-index: 32;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.report-detail-shell.is-open {
  opacity: 1;
  pointer-events: auto;
}

.report-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.report-detail-shell.is-open .report-detail-backdrop {
  opacity: 1;
}

.report-detail-card {
  --report-accent: var(--cp-primary);
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: min(440px, calc(100% - 2rem));
  max-height: min(76vh, 620px);
  overflow: auto;
  border-radius: 1.35rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.98), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 28px 62px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(18px);
  padding: 1rem;
  transform: translateY(18px) scale(0.98);
  transition: transform 0.2s ease;
}

.report-detail-shell.is-open .report-detail-card {
  transform: translateY(0) scale(1);
}

.report-detail-card__accent {
  height: 0.34rem;
  margin: -1rem -1rem 0.95rem;
  border-radius: 1.35rem 1.35rem 0.8rem 0.8rem;
  background: linear-gradient(90deg, var(--report-accent), rgba(14, 165, 233, 0.92));
}

.report-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-detail-eyebrow {
  color: var(--cp-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-detail-title {
  margin-top: 0.32rem;
  font-size: 1.15rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--cp-text);
}

.report-detail-body {
  margin-top: 1rem;
  display: grid;
  gap: 0.9rem;
}

.report-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(191, 219, 254, 0.8);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.94));
}

.report-detail-hero__main {
  min-width: 0;
}

.report-detail-hero__label {
  color: var(--cp-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-detail-price {
  margin-top: 0.35rem;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 950;
  color: var(--cp-text);
}

.report-detail-subtitle {
  margin-top: 0.42rem;
  color: var(--cp-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.report-detail-price-context {
  margin-top: 0.42rem;
  color: #1d4ed8;
  font-size: 0.69rem;
  line-height: 1.35;
  font-weight: 700;
}

.report-detail-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 0.42rem;
  max-width: 148px;
}

.report-detail-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.67rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(241, 245, 249, 0.94);
  color: #334155;
}

.report-detail-badge--brand {
  background: rgba(219, 234, 254, 0.96);
  color: #1d4ed8;
  border-color: rgba(147, 197, 253, 0.72);
}

.report-detail-badge--positive {
  background: rgba(220, 252, 231, 0.96);
  color: #166534;
  border-color: rgba(134, 239, 172, 0.72);
}

.report-detail-badge--warning {
  background: rgba(255, 237, 213, 0.96);
  color: #9a3412;
  border-color: rgba(253, 186, 116, 0.72);
}

.report-detail-badge--danger {
  background: rgba(254, 226, 226, 0.96);
  color: #b91c1c;
  border-color: rgba(252, 165, 165, 0.72);
}

.report-detail-badge--neutral {
  background: rgba(241, 245, 249, 0.96);
  color: #475569;
  border-color: rgba(203, 213, 225, 0.72);
}

.report-point-icon-root {
  background: transparent;
  border: 0;
  pointer-events: auto;
  cursor: pointer;
}

.leaflet-marker-icon.report-point-icon-root {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.report-point-icon-root .report-point-marker,
.report-point-icon-root .report-point-marker * {
  pointer-events: none;
}

.report-point-icon-root .report-point-marker,
.report-point-legend .report-point-marker {
  --report-marker-size: 34px;
  --report-marker-accent: #2563eb;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--report-marker-size) + 10px);
  height: calc(var(--report-marker-size) + 10px);
}

.report-point-icon-root .report-point-marker__halo,
.report-point-legend .report-point-marker__halo {
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--report-marker-accent) 28%, white) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0.34;
  transform: scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
  filter: blur(0.2px);
}

.report-point-icon-root .report-point-marker__shell,
.report-point-legend .report-point-marker__shell {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--report-marker-size);
  height: var(--report-marker-size);
  border-radius: 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.report-point-icon-root .report-point-marker__chip,
.report-point-legend .report-point-marker__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--report-marker-size) - 12px);
  height: calc(var(--report-marker-size) - 12px);
  border-radius: 0.85rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--report-marker-accent) 88%, white), color-mix(in srgb, var(--report-marker-accent) 72%, #0f172a));
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.report-point-icon-root .report-point-marker__chip svg,
.report-point-legend .report-point-marker__chip svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-point-icon-root .report-point-marker__emoji,
.report-point-legend .report-point-marker__emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: clamp(16px, calc(var(--report-marker-size) * 0.48), 24px);
  line-height: 1;
  pointer-events: none;
  transform: translateY(-1px);
}

.report-point-icon-root .report-point-marker__badge,
.report-point-legend .report-point-marker__badge {
  position: absolute;
  top: 2px;
  right: 1px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  background: #0f172a;
  color: white;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
}

.report-point-icon-root .report-point-marker.is-recent .report-point-marker__halo,
.report-point-legend .report-point-marker.is-recent .report-point-marker__halo {
  opacity: 0.34;
  transform: scale(0.98);
}

.report-point-icon-root .report-point-marker.is-fresh .report-point-marker__halo,
.report-point-legend .report-point-marker.is-fresh .report-point-marker__halo {
  opacity: 0.42;
  transform: scale(1.04);
}

.report-point-icon-root .report-point-marker.is-anomaly .report-point-marker__shell,
.report-point-legend .report-point-marker.is-anomaly .report-point-marker__shell {
  border-color: rgba(244, 63, 94, 0.92);
  border-style: solid;
  box-shadow:
    0 0 0 2px rgba(244, 63, 94, 0.18),
    0 10px 22px rgba(190, 18, 60, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.report-point-icon-root .report-point-marker.is-hover .report-point-marker__halo,
.report-point-icon-root .report-point-marker.is-active .report-point-marker__halo,
.report-point-legend .report-point-marker.is-active .report-point-marker__halo {
  opacity: 0.5;
  transform: scale(1.08);
}

.report-point-icon-root .report-point-marker.is-hover .report-point-marker__shell,
.report-point-icon-root .report-point-marker.is-active .report-point-marker__shell,
.report-point-legend .report-point-marker.is-active .report-point-marker__shell {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.28),
    0 0 0 1px color-mix(in srgb, var(--report-marker-accent) 28%, white),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.report-point-icon-root .report-point-marker.is-active .report-point-marker__halo {
  animation: report-point-pulse 1.8s ease-in-out infinite;
}

.report-point-legend .report-point-marker--legend.is-active .report-point-marker__halo {
  animation: none;
}

@keyframes report-point-pulse {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.54;
    transform: scale(1.12);
  }
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.65rem;
}

.report-detail-item {
  padding: 0.72rem 0.78rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.92);
}

.report-detail-item__label {
  color: var(--cp-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-detail-item__value {
  margin-top: 0.34rem;
  color: var(--cp-text);
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-detail-item__value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.report-detail-note {
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(248, 250, 252, 0.96);
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.5;
}

.report-detail-note__label {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--cp-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-detail-stack-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 0.78rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(191, 219, 254, 0.8);
  background: rgba(239, 246, 255, 0.9);
}

.report-detail-stack-nav__meta {
  color: #1e3a8a;
  font-size: 0.72rem;
  line-height: 1.4;
  font-weight: 800;
  text-align: center;
}

.report-detail-stack-nav__btn {
  min-height: 34px;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.9);
  background: white;
  color: #1d4ed8;
  font-size: 0.69rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.report-detail-stack-nav__btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.16);
}

.report-detail-stack-nav__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.report-point-legend {
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

.report-point-legend__title {
  color: var(--cp-text);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-point-legend__list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.report-point-legend__row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 0.65rem;
  color: #334155;
  font-size: 0.73rem;
  line-height: 1.4;
}

.report-point-legend__marker-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.report-point-legend__marker-wrap--pair {
  gap: 0.15rem;
}

.location-pick-btn.is-active {
  border-color: rgba(14, 165, 233, 0.34);
  background: rgba(224, 242, 254, 0.96);
  color: var(--cp-primary-strong);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.14);
}

.location-pick-status {
  padding: 0.55rem 0.7rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(125, 211, 252, 0.5);
  background: rgba(239, 246, 255, 0.96);
  color: #0f5bd8;
  font-size: 0.68rem;
  line-height: 1.45;
  font-weight: 700;
}

.receipt-status-panel {
  margin-top: 0.65rem;
  padding: 0.75rem 0.8rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  display: grid;
  gap: 0.42rem;
  text-align: left;
}

.receipt-status-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.receipt-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(241, 245, 249, 0.96);
  color: #334155;
  font-size: 0.63rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receipt-status-text {
  color: var(--cp-text);
  font-size: 0.74rem;
  line-height: 1.45;
  font-weight: 700;
}

.receipt-status-meta {
  color: var(--cp-muted);
  font-size: 0.67rem;
  line-height: 1.4;
}

.receipt-status-link {
  border: 0;
  background: transparent;
  color: var(--cp-primary-strong);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.receipt-status-link:hover {
  text-decoration: underline;
}

.receipt-status-panel[data-status="uploading"] .receipt-status-badge,
.receipt-status-panel[data-status="queued"] .receipt-status-badge {
  background: rgba(254, 249, 195, 0.96);
  color: #854d0e;
  border-color: rgba(253, 224, 71, 0.55);
}

.receipt-status-panel[data-status="processing"] .receipt-status-badge {
  background: rgba(219, 234, 254, 0.96);
  color: #1d4ed8;
  border-color: rgba(147, 197, 253, 0.68);
}

/* Premium B2B UI layer: visual-only overrides, no functional selectors removed. */
:root {
  --cp-premium-glass: rgba(255, 255, 255, 0.72);
  --cp-premium-glass-strong: rgba(255, 255, 255, 0.9);
  --cp-premium-line: rgba(148, 163, 184, 0.22);
  --cp-premium-shadow: 0 22px 55px rgba(15, 23, 42, 0.12);
  --cp-premium-shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.08);
  --cp-premium-green: #10b981;
  --cp-premium-amber: #f59e0b;
  --cp-premium-red: #ef4444;
}

.cp-premium-shell {
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.04), transparent 28%),
    radial-gradient(circle at 18% 8%, rgba(14, 165, 233, 0.14), transparent 26%),
    radial-gradient(circle at 78% 18%, rgba(16, 185, 129, 0.1), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 52%, #f7fafc 100%) !important;
}

#sidebar.cp-sidebar {
  width: min(27.5rem, calc(100vw - 10px)) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.66)),
    rgba(255, 255, 255, 0.62) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    1px 0 0 rgba(148, 163, 184, 0.13),
    28px 0 70px rgba(15, 23, 42, 0.12) !important;
  backdrop-filter: blur(26px) saturate(1.15) !important;
}

@media (min-width: 768px) {
  #mainContent.md\:ml-96 {
    margin-left: min(27.5rem, calc(100vw - 10px)) !important;
  }
}

.cp-sidebar-head,
.cp-sidebar-footer {
  background: rgba(255, 255, 255, 0.64) !important;
  border-color: rgba(226, 232, 240, 0.62) !important;
  backdrop-filter: blur(20px) saturate(1.1) !important;
}

.cp-sidebar-scroll {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.42), rgba(239, 246, 255, 0.3)) !important;
}

#sidebar .card,
#sidebar .cp-panel-section,
#sidebar .sidebar-analytics-panel,
.cp-modal__dialog,
.report-detail-card {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.66)),
    var(--cp-premium-glass) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    var(--cp-premium-shadow-soft) !important;
  backdrop-filter: blur(20px) saturate(1.14) !important;
}

#sidebar .card:hover {
  border-color: rgba(191, 219, 254, 0.76) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 20px 45px rgba(15, 23, 42, 0.1) !important;
}

.card-title,
.cp-field__label,
.report-detail-eyebrow {
  color: #64748b !important;
  font-weight: 900 !important;
  letter-spacing: 0.14em !important;
}

.metric-strong,
.metric-value,
.stat-value,
#insightP50,
#smartBasketTotal,
#smartBasketSavings,
.report-detail-price {
  font-weight: 950 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.055em !important;
}

.sidebar-search-card {
  position: relative;
  overflow: visible;
  padding: 1.1rem !important;
  background:
    radial-gradient(circle at 84% 12%, rgba(14, 165, 233, 0.18), transparent 34%),
    radial-gradient(circle at 12% 0%, rgba(16, 185, 129, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.74)) !important;
}

.sidebar-search-card::after {
  content: "";
  position: absolute;
  inset: auto 1rem 0.8rem 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.34), transparent);
  pointer-events: none;
}

.sidebar-search-badge,
.sidebar-analytics-chip {
  border-color: rgba(14, 165, 233, 0.24) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

.sidebar-search-input {
  min-height: 58px !important;
  padding-left: 2.85rem !important;
  border-radius: 1.05rem !important;
  border: 1px solid rgba(14, 165, 233, 0.24) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)) !important;
  box-shadow:
    0 16px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
}

.sidebar-search-input:focus {
  border-color: rgba(14, 165, 233, 0.55) !important;
  box-shadow:
    0 18px 38px rgba(14, 165, 233, 0.13),
    0 0 0 4px rgba(14, 165, 233, 0.12) !important;
}

.sidebar-search-icon {
  left: 1.1rem !important;
  color: #0f5bd8 !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
}

#productSuggestions,
#reportProductSuggestions,
.product-suggestions-dropdown {
  position: fixed;
  z-index: 9999 !important;
  border-radius: 1rem !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16) !important;
  backdrop-filter: blur(14px) !important;
  margin-top: 0 !important;
}

.sidebar-search-field {
  position: relative;
  overflow: visible !important;
  z-index: 50;
}

.sidebar-search-card--dropdown {
  z-index: 40;
  overflow: visible !important;
}

.cp-sidebar-scroll {
  overflow-x: visible;
}

#sidebar {
  overflow: visible;
}

.sidebar-tab-list {
  background: rgba(226, 232, 240, 0.48) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

.sidebar-tab-label {
  border: 1px solid transparent;
}

#analyticsTabInsight:checked ~ .sidebar-tab-list label[for="analyticsTabInsight"],
#analyticsTabTop:checked ~ .sidebar-tab-list label[for="analyticsTabTop"] {
  border-color: rgba(255, 255, 255, 0.86) !important;
  box-shadow:
    0 12px 26px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.insight-hero-metric {
  position: relative;
  margin-inline: -0.25rem;
  padding: 1rem 0.8rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(191, 219, 254, 0.62);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(255, 255, 255, 0.82));
}

.insight-price-bands .insight-band {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  display: grid;
  align-content: center;
  border-radius: 1rem !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.insight-price-bands .insight-band::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  top: 0.55rem;
  height: 3px;
  border-radius: 999px;
  opacity: 0.8;
}

.insight-band--deal::before { background: linear-gradient(90deg, #059669, #34d399); }
.insight-band--avg::before { background: linear-gradient(90deg, #64748b, #94a3b8); }
.insight-band--high::before { background: linear-gradient(90deg, #dc2626, #fb7185); }

.store-map-marker {
  background: transparent;
  border: 0;
}

.store-map-marker__pin {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid rgba(51, 65, 85, 0.72);
  background: rgba(248, 250, 252, 0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  font-size: 17px;
}

.insight-kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 1rem !important;
  border-radius: 1.15rem !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.7)),
    rgba(255, 255, 255, 0.7) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 38px rgba(15, 23, 42, 0.1) !important;
  backdrop-filter: blur(18px) saturate(1.12);
}

.insight-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.5), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(14, 165, 233, 0.12), transparent 34%);
  pointer-events: none;
}

.insight-kpi-card > * {
  position: relative;
  z-index: 1;
}

.insight-kpi-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.insight-kpi-card__eyebrow {
  color: #64748b !important;
  font-size: 0.64rem !important;
  font-weight: 950 !important;
}

.insight-kpi-card__value {
  margin-top: 0.58rem !important;
  font-size: clamp(1.35rem, 4vw, 1.8rem) !important;
  font-weight: 950 !important;
  font-variant-numeric: tabular-nums !important;
}

.insight-kpi-card__meta {
  min-height: 2.45rem;
  color: #64748b !important;
  font-weight: 650;
}

.insight-kpi-card--positive {
  border-color: rgba(16, 185, 129, 0.28) !important;
}

.insight-kpi-card--positive::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.48), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(16, 185, 129, 0.18), transparent 36%);
}

.insight-kpi-card--positive .insight-kpi-card__value {
  color: #047857 !important;
}

.insight-kpi-card--negative {
  border-color: rgba(239, 68, 68, 0.24) !important;
}

.insight-kpi-card--negative::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.48), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(239, 68, 68, 0.16), transparent 36%);
}

.insight-kpi-card--negative .insight-kpi-card__value {
  color: #b91c1c !important;
}

.trend-pill {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.trend-pill::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 0.34rem solid transparent;
  border-right: 0.34rem solid transparent;
}

.trend-pill--up::before {
  border-bottom: 0.58rem solid var(--cp-premium-red);
}

.trend-pill--forecast::before {
  border-bottom: 0.58rem solid #0f5bd8;
  transform: rotate(45deg);
}

.insight-kpi-card--positive .trend-pill--up::before,
.insight-kpi-card--positive .trend-pill--forecast::before {
  border-bottom-color: var(--cp-premium-green);
  transform: rotate(180deg);
}

.insight-kpi-card--neutral .trend-pill--up::before,
.insight-kpi-card--neutral .trend-pill--forecast::before {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  width: 0.8rem;
  height: 0.18rem;
  border-radius: 999px;
  background: #94a3b8;
  transform: none;
}

.kpi-sparkline {
  margin-top: 0.75rem;
  height: 30px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 0.28rem;
  opacity: 0.78;
}

.kpi-sparkline span {
  display: block;
  min-height: 6px;
  border-radius: 999px 999px 0.3rem 0.3rem;
  background: linear-gradient(180deg, rgba(15, 91, 216, 0.74), rgba(14, 165, 233, 0.24));
}

.kpi-sparkline span:nth-child(1) { height: 35%; }
.kpi-sparkline span:nth-child(2) { height: 52%; }
.kpi-sparkline span:nth-child(3) { height: 44%; }
.kpi-sparkline span:nth-child(4) { height: 72%; }
.kpi-sparkline span:nth-child(5) { height: 88%; }

.kpi-sparkline--forecast span:nth-child(1) { height: 42%; }
.kpi-sparkline--forecast span:nth-child(2) { height: 48%; }
.kpi-sparkline--forecast span:nth-child(3) { height: 60%; }
.kpi-sparkline--forecast span:nth-child(4) { height: 66%; }
.kpi-sparkline--forecast span:nth-child(5) { height: 78%; }

.insight-kpi-card--positive .kpi-sparkline span {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.78), rgba(167, 243, 208, 0.38));
}

.insight-kpi-card--negative .kpi-sparkline span {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.72), rgba(254, 202, 202, 0.36));
}

.premium-metric-tile {
  position: relative;
  overflow: hidden;
  border-radius: 1.05rem !important;
  background: rgba(255, 255, 255, 0.74) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.premium-metric-tile::after {
  content: "";
  position: absolute;
  right: -1rem;
  top: -1.2rem;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  opacity: 0.16;
}

.premium-metric-tile--success::after { background: #10b981; }
.premium-metric-tile--info::after { background: #0ea5e9; }

.layer-toggle-pill {
  min-height: 34px;
  padding: 0.36rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.66);
  font-weight: 800;
  color: #334155;
}

input[type="range"] {
  accent-color: #0f5bd8;
}

.map-fab-button,
.map-settings-btn,
#mapLoader {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  background: rgba(255, 255, 255, 0.76) !important;
  box-shadow: var(--cp-premium-shadow-soft) !important;
  backdrop-filter: blur(18px) saturate(1.12) !important;
}

.leaflet-control-zoom.leaflet-bar {
  border: 0 !important;
  border-radius: 1rem !important;
  overflow: hidden !important;
  box-shadow: var(--cp-premium-shadow-soft) !important;
  backdrop-filter: blur(16px) saturate(1.12) !important;
}

.leaflet-control-zoom.leaflet-bar a {
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.78) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: #0f172a !important;
  font-family: Manrope, system-ui, sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
}

.leaflet-control-zoom.leaflet-bar a:last-child {
  border-bottom: 0 !important;
}

.leaflet-control-zoom.leaflet-bar a:hover {
  background: rgba(239, 246, 255, 0.96) !important;
  color: #0f5bd8 !important;
}

.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) {
  min-width: 230px !important;
  max-width: min(320px, calc(100vw - 2rem)) !important;
  padding: 0.9rem 1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: 1.15rem !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.72)),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.17) !important;
  backdrop-filter: blur(20px) saturate(1.16) !important;
}

.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 0.48rem !important;
  font-family: Manrope, system-ui, sans-serif !important;
  font-size: 0.7rem !important;
  font-weight: 950 !important;
  letter-spacing: 0.14em !important;
  color: #0f172a !important;
}

.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:first-child::before {
  content: "";
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: conic-gradient(from 180deg, #10b981, #f59e0b, #ef4444, #10b981);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.08);
}

.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(2),
.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(4),
.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(5) {
  font-family: Manrope, system-ui, sans-serif !important;
  color: #64748b !important;
  font-weight: 750 !important;
}

.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(3) {
  height: 0.78rem !important;
  gap: 0 !important;
  padding: 2px !important;
  border-radius: 999px !important;
  background: rgba(226, 232, 240, 0.68) !important;
  overflow: hidden !important;
}

.leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(3) span {
  height: 100% !important;
  border-radius: 999px !important;
}

.leaflet-bottom.leaflet-right .report-point-legend {
  border-color: rgba(255, 255, 255, 0.78) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.72)),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.17) !important;
  backdrop-filter: blur(20px) saturate(1.16) !important;
}

@media (max-width: 767px) {
  #sidebar.cp-sidebar {
    width: min(25.5rem, calc(100vw - 10px)) !important;
  }

  .insight-kpi-card {
    min-height: 154px;
  }

  .leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) {
    min-width: 196px !important;
    padding: 0.75rem 0.8rem !important;
  }
}

.receipt-status-panel[data-status="ready"] .receipt-status-badge,
.receipt-status-panel[data-status="confirmed"] .receipt-status-badge {
  background: rgba(220, 252, 231, 0.96);
  color: #166534;
  border-color: rgba(134, 239, 172, 0.72);
}

.receipt-status-panel[data-status="failed"] .receipt-status-badge {
  background: rgba(254, 226, 226, 0.96);
  color: #b91c1c;
  border-color: rgba(252, 165, 165, 0.72);
}

@media (min-width: 768px) {
  #mainContent.md\:ml-96 {
    margin-left: min(26rem, calc(100vw - 10px));
  }
}

@media (max-width: 767px) {
  .sidebar-search-badge,
  .sidebar-analytics-chip,
  .map-settings-btn__status,
  .map-settings-btn__label {
    display: none;
  }

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

  .insight-price-bands {
    grid-template-columns: 1fr !important;
  }

  .sidebar-panel-placeholder__title,
  .sidebar-panel-placeholder__text,
  .insight-kpi-card__meta {
    overflow-wrap: anywhere;
  }

  .cp-settings-grid {
    grid-template-columns: 1fr;
  }

  .cp-settings-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .report-detail-card {
    right: 0.65rem;
    left: 0.65rem;
    bottom: 0.65rem;
    width: auto;
    max-height: 72vh;
  }

  .report-detail-grid {
    grid-template-columns: 1fr;
  }

  .report-detail-hero {
    grid-template-columns: 1fr;
  }

  .report-detail-badges {
    justify-content: flex-start;
    max-width: none;
  }

  .report-detail-stack-nav {
    grid-template-columns: 1fr;
  }

  .report-point-legend {
    max-width: min(280px, calc(100vw - 1.2rem));
  }

  .report-point-legend__row {
    grid-template-columns: 64px 1fr;
  }

  .report-detail-backdrop {
    background: rgba(15, 23, 42, 0.14);
  }
}

/* ============================================================================
 * RICH MAP POPUPS (Leaflet bindPopup) – Tailwind-flavored micro-cards
 * ============================================================================
 * Diseñados para: puntos (price_reports) y hex H3.
 * Soportan autoPan, ancho responsive, badges, monedas y fechas humanas.
 * Versión: 20260519-popup4
 */

.leaflet-popup.cp-rich-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.22),
    0 8px 16px -8px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.1);
  animation: cp-popup-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leaflet-popup.cp-rich-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
  max-width: min(340px, calc(100vw - 32px));
  min-width: 240px;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--cp-text);
}

.leaflet-popup.cp-rich-popup .leaflet-popup-tip {
  background: #ffffff;
  box-shadow: 0 4px 8px -2px rgba(15, 23, 42, 0.12);
}

@keyframes cp-popup-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cp-popup-card {
  padding: 14px 14px 12px;
  display: grid;
  gap: 10px;
}

.leaflet-popup.cp-rich-popup--zoom-17 .cp-popup-card,
.leaflet-popup.cp-rich-popup--zoom-18 .cp-popup-card,
.leaflet-popup.cp-rich-popup--zoom-19 .cp-popup-card,
.leaflet-popup.cp-rich-popup--zoom-20 .cp-popup-card {
  padding: 11px 12px 10px;
  gap: 8px;
}

.leaflet-popup.cp-rich-popup--zoom-17 .cp-popup-price,
.leaflet-popup.cp-rich-popup--zoom-18 .cp-popup-price,
.leaflet-popup.cp-rich-popup--zoom-19 .cp-popup-price,
.leaflet-popup.cp-rich-popup--zoom-20 .cp-popup-price {
  font-size: 1.22rem;
}

.leaflet-popup.cp-rich-popup--zoom-18 .cp-popup-store,
.leaflet-popup.cp-rich-popup--zoom-19 .cp-popup-store,
.leaflet-popup.cp-rich-popup--zoom-20 .cp-popup-store {
  font-size: 0.86rem;
}

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

.cp-popup-eyebrow {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-bottom: 2px;
}

.cp-popup-store {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.cp-popup-product {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  margin-top: 1px;
}

.cp-popup-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(248, 250, 252, 0.92);
  color: #475569;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cp-popup-close:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
  transform: scale(1.06);
}

.cp-popup-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}

.cp-popup-price {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.cp-popup-currency {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}

.cp-popup-currency--USD {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.32);
}

.cp-popup-currency--VES {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.32);
}

.cp-popup-currency--secondary {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.32);
  font-size: 0.62rem;
}

.cp-popup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cp-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  line-height: 1.2;
}

.cp-popup-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}

.cp-popup-badge--success {
  background: rgba(220, 252, 231, 0.94);
  color: #15803d;
  border-color: rgba(134, 239, 172, 0.72);
}

.cp-popup-badge--neutral {
  background: rgba(241, 245, 249, 0.96);
  color: #475569;
  border-color: rgba(203, 213, 225, 0.72);
}

.cp-popup-badge--danger {
  background: rgba(254, 226, 226, 0.96);
  color: #b91c1c;
  border-color: rgba(252, 165, 165, 0.72);
}

.cp-popup-badge--warning {
  background: rgba(254, 243, 199, 0.96);
  color: #b45309;
  border-color: rgba(252, 211, 77, 0.72);
}

.cp-popup-badge--brand {
  background: rgba(219, 234, 254, 0.95);
  color: #1d4ed8;
  border-color: rgba(147, 197, 253, 0.72);
}

.cp-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.cp-popup-cell {
  border: 1px solid rgba(226, 232, 240, 0.88);
  background: rgba(248, 250, 252, 0.82);
  border-radius: 12px;
  padding: 7px 9px;
  min-width: 0;
}

.cp-popup-cell__label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 1px;
}

.cp-popup-cell__value {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.cp-popup-cell__value--muted {
  color: #475569;
  font-weight: 600;
}

.cp-popup-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.32), transparent);
}

.cp-popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f5bd8, #0ea5e9);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 16px -6px rgba(15, 91, 216, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cp-popup-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -6px rgba(15, 91, 216, 0.5);
}

.cp-popup-cta--ghost {
  background: rgba(241, 245, 249, 0.96);
  color: #0f172a;
  border: 1px solid rgba(203, 213, 225, 0.86);
  box-shadow: none;
}

.cp-popup-cta--ghost:hover {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.86);
}

/* Variante para hex (más compacta) */
.cp-popup-card--hex .cp-popup-price {
  font-size: 1.35rem;
}

.cp-popup-card--hex .cp-popup-store {
  font-size: 0.88rem;
}

/* Tooltip enriquecido en hover (hex + puntos) */
.leaflet-tooltip {
  white-space: nowrap;
  min-width: 120px;
}

.leaflet-tooltip.cp-rich-tooltip {
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
  min-width: 120px;
  max-width: none;
  white-space: nowrap;
  line-height: 1.35;
}

.leaflet-tooltip.cp-rich-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.94) !important;
}

.cp-tooltip-title {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cp-tooltip-swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.cp-tooltip-meta {
  margin-top: 3px;
  font-size: 0.66rem;
  color: rgba(241, 245, 249, 0.72);
  font-weight: 600;
}

.cp-tooltip-hint {
  margin-top: 4px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(125, 211, 252, 0.92);
  font-weight: 800;
}

/* Responsive: popup ocupa el ancho útil del viewport en móvil */
@media (max-width: 640px) {
  .leaflet-popup.cp-rich-popup .leaflet-popup-content {
    max-width: calc(100vw - 28px);
    min-width: 0;
  }

  .cp-popup-card {
    padding: 12px;
  }

  .cp-popup-grid {
    grid-template-columns: 1fr;
  }

  .cp-popup-price {
    font-size: 1.4rem;
  }
}

/* Suaviza el zoom: animación más cinemática sobre tiles */
.leaflet-zoom-anim .leaflet-zoom-animated {
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Pane H3 con micro-animación al pintar */
.leaflet-h3-pane {
  transition: opacity 0.22s ease;
}

.leaflet-h3-pane path {
  transition: fill 0.28s ease, fill-opacity 0.22s ease, stroke 0.22s ease;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.cp-marker-cluster {
  background: transparent !important;
  border: 0 !important;
}

.cp-cluster-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.94), rgba(15, 118, 110, 0.92));
  color: #fff;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
}

.cp-cluster-icon.tone-cool {
  background: linear-gradient(145deg, #14b8a6, #0f766e);
}

.cp-cluster-icon.tone-mid {
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.cp-cluster-icon.tone-warm {
  background: linear-gradient(145deg, #f59e0b, #d97706);
}

.cp-cluster-icon.tone-hot {
  background: linear-gradient(145deg, #ef4444, #991b1b);
}

.cp-cluster-icon.is-md {
  width: 38px;
  height: 38px;
  font-size: 0.78rem;
}

.cp-cluster-icon.is-lg,
.cp-cluster-icon.is-xl {
  width: 42px;
  height: 42px;
  font-size: 0.82rem;
}

.marker-cluster-spider-leg {
  stroke: rgba(37, 99, 235, 0.55) !important;
  stroke-width: 1.5px !important;
}

.cp-popup-expanded {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.cp-popup-card.is-expanded {
  max-height: min(72vh, 520px);
  overflow: auto;
}

.cp-popup-grid--expanded {
  margin-top: 0.35rem;
}

.leaflet-marker-icon.leaflet-marker-shadow {
  opacity: 0.28 !important;
}

/* ============================================================================
 * MOBILE MAP SHELL – teléfonos / tablets estrechas
 * ============================================================================ */

body.cp-mobile-map {
  overscroll-behavior: none;
}

body.cp-mobile-map #map {
  touch-action: pan-x pan-y pinch-zoom;
}

body.cp-mobile-map .map-fab-button,
body.cp-mobile-map .map-settings-btn {
  min-width: 44px;
  min-height: 44px;
}

body.cp-mobile-map #toggleSidebarBtn {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  left: calc(0.75rem + env(safe-area-inset-left, 0px));
}

body.cp-mobile-map .map-settings-btn {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: calc(0.75rem + env(safe-area-inset-right, 0px));
}

body.cp-mobile-map #mapLoader {
  top: calc(0.85rem + env(safe-area-inset-top, 0px));
}

@media (max-width: 767px) {
  #sidebar.cp-sidebar {
    width: min(100vw, 24rem) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #sidebar.cp-sidebar:not(.cp-sidebar--open) {
    pointer-events: none !important;
    touch-action: none;
  }

  #sidebar.cp-sidebar:not(.cp-sidebar--open) * {
    pointer-events: none !important;
  }

  #sidebar.cp-sidebar.cp-sidebar--open {
    pointer-events: auto !important;
    touch-action: auto;
  }

  #mainContent {
    margin-left: 0 !important;
  }

  .leaflet-bottom.leaflet-left,
  .leaflet-bottom.leaflet-right {
    bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) {
    min-width: 0 !important;
    max-width: min(168px, calc(50vw - 1rem)) !important;
    font-size: 0.62rem !important;
  }

  .leaflet-bottom.leaflet-right .report-point-legend {
    max-width: min(168px, calc(50vw - 1rem)) !important;
    margin-bottom: 3.35rem !important;
    font-size: 0.62rem !important;
  }

  .leaflet-bottom.leaflet-right .leaflet-control-zoom.leaflet-bar {
    margin-bottom: 0 !important;
  }

  .leaflet-control-zoom.leaflet-bar a {
    width: 42px !important;
    height: 42px !important;
  }

  .leaflet-tooltip.report-point-tooltip,
  .leaflet-tooltip.cp-rich-tooltip {
    max-width: min(240px, calc(100vw - 2rem));
    white-space: normal !important;
    line-height: 1.35 !important;
  }

  .cp-tooltip-title {
    white-space: normal !important;
  }

  .report-detail-shell {
    position: fixed;
    inset: 0;
    z-index: 10060;
  }

  .report-detail-card {
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(78vh, calc(100dvh - 1.2rem));
    border-radius: 1.25rem 1.25rem 0.85rem 0.85rem;
  }

  .report-detail-backdrop {
    background: rgba(15, 23, 42, 0.42) !important;
  }

  .cp-sidebar-scroll {
    -webkit-overflow-scrolling: touch;
  }

  .leaflet-popup.cp-rich-popup {
    margin-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }

  body > .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet,
  .leaflet-container .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet {
    pointer-events: auto;
  }

  .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet .leaflet-popup-close-button {
    display: none !important;
  }

  .cp-popup-card--hex-mobile {
    padding: 11px 12px 10px;
    gap: 8px;
  }

  .cp-popup-card--hex-mobile .cp-popup-store {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  .cp-popup-card--hex-mobile .cp-popup-product {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
  }

  .cp-popup-grid--hex-mobile {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .cp-popup-grid--hex-mobile .cp-popup-cell:nth-child(1) {
    grid-column: 1 / -1;
  }

  .cp-popup-badges--compact {
    gap: 4px;
  }

  .cp-popup-price--mobile {
    font-size: 1.2rem !important;
  }

  .cp-popup-price-row--compact {
    padding: 0;
  }

  .leaflet-popup.cp-rich-popup--zoom-17 .cp-popup-card,
  .leaflet-popup.cp-rich-popup--zoom-18 .cp-popup-card,
  .leaflet-popup.cp-rich-popup--zoom-19 .cp-popup-card,
  .leaflet-popup.cp-rich-popup--zoom-20 .cp-popup-card {
    padding: 11px 12px 10px;
    gap: 8px;
  }

  .leaflet-popup.cp-rich-popup--zoom-17 .cp-popup-price,
  .leaflet-popup.cp-rich-popup--zoom-18 .cp-popup-price,
  .leaflet-popup.cp-rich-popup--zoom-19 .cp-popup-price,
  .leaflet-popup.cp-rich-popup--zoom-20 .cp-popup-price {
    font-size: 1.22rem;
  }

  .leaflet-popup.cp-rich-popup--zoom-18 .cp-popup-store,
  .leaflet-popup.cp-rich-popup--zoom-19 .cp-popup-store,
  .leaflet-popup.cp-rich-popup--zoom-20 .cp-popup-store {
    font-size: 0.86rem;
  }

  .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet .leaflet-popup-content-wrapper {
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18), 0 22px 50px rgba(15, 23, 42, 0.12);
  }

  .cp-popup-card--hex .cp-popup-cta {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .cp-popup-card--hex-compact {
    padding: 10px 12px;
    gap: 8px;
  }

  .cp-popup-head--compact {
    align-items: center;
  }

  .cp-popup-store--compact {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
  }

  .cp-popup-close--compact {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .cp-popup-summary-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  .cp-popup-price--compact {
    font-size: 1.08rem !important;
    line-height: 1.1;
  }

  .cp-popup-price--compact small {
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748b;
    margin-left: 4px;
  }

  .cp-popup-price--muted {
    color: #475569 !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
  }

  .cp-popup-inline-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
  }

  .cp-popup-cta--compact {
    min-height: 38px !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.82rem !important;
  }

  body > .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet,
  .leaflet-container .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet {
    width: min(272px, calc(100vw - 56px)) !important;
    max-width: 272px !important;
  }

  .leaflet-popup.cp-rich-popup.cp-mobile-popup-sheet .leaflet-popup-content-wrapper {
    max-width: 272px !important;
  }

  .cp-popup-hint {
    margin: 0.35rem 0 0.55rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #64748b;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .report-point-legend__row:nth-child(n + 3) {
    display: none;
  }

  .leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(4),
  .leaflet-bottom.leaflet-left > .leaflet-control.leaflet-bar:not(.leaflet-control-zoom) > div:nth-child(5) {
    display: none !important;
  }
}
