/* Horizontal micro bars under overview funnel table cells (/overview). */

.funnel-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 4.25rem;
}

.funnel-cell-value {
  line-height: 1.2;
}

.funnel-cell-value--conversion {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.01em;
}

.funnel-cell-value--ratio-over-one {
  color: #fbbf24;
}

.funnel-cell-value--ratio-neutral {
  color: inherit;
}

.overview-table th.col-conversion--ratio,
.overview-table td.col-conversion--ratio {
  background: color-mix(in srgb, var(--muted) 5%, transparent);
}

.overview-table th.col-conversion,
.overview-table td.col-conversion {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

.overview-table th.col-conversion {
  font-size: 0.8125rem;
}

.funnel-micro-bar {
  width: 100%;
  max-width: 4.5rem;
}

.funnel-micro-track {
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 65%, transparent);
}

.funnel-micro-fill {
  height: 100%;
  border-radius: 3px 0 0 3px;
  min-width: 0;
  transition: width 0.2s ease;
}

.funnel-micro-bar--funnel_volume .funnel-micro-fill {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.funnel-micro-bar--step_conversion .funnel-micro-fill {
  background: linear-gradient(90deg, #059669, #34d399);
}

.funnel-micro-bar--ancillary_volume .funnel-micro-fill {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
  opacity: 0.85;
}

.funnel-micro-fill--strong {
  filter: saturate(1.05);
}

.funnel-micro-fill--medium {
  opacity: 0.88;
}

.funnel-micro-fill--weak {
  opacity: 0.72;
  background: linear-gradient(90deg, #dc2626, #f87171) !important;
}

.funnel-micro-bar--step_conversion.funnel-micro-bar--over-cap .funnel-micro-track {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #f59e0b 55%, var(--border));
}

.funnel-micro-bar--step_conversion.funnel-micro-bar--over-cap .funnel-micro-fill {
  background: linear-gradient(90deg, #d97706, #fbbf24) !important;
}

.funnel-micro-bar--ratio_coefficient .funnel-micro-fill,
.funnel-micro-fill--ratio {
  background: linear-gradient(90deg, #64748b, #94a3b8) !important;
  opacity: 0.9;
}

.funnel-micro-bar--ratio_coefficient .funnel-micro-track {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 45%, var(--border));
}

.overview-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.overview-source-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.overview-source-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.overview-source-tab-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.funnel-gap-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fbbf24;
  background: color-mix(in srgb, #fbbf24 14%, transparent);
  border: 1px solid color-mix(in srgb, #fbbf24 35%, transparent);
  vertical-align: middle;
}

.funnel-gap-badge-inline {
  margin-left: 0;
  text-transform: none;
  font-size: 0.75rem;
}

.funnel-cell--install-gap .funnel-cell-value {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.funnel-row:hover .funnel-micro-track {
  background: color-mix(in srgb, var(--muted) 30%, transparent);
}

@media (max-width: 768px), (max-width: 932px) and (max-height: 500px) {
  .funnel-cell {
    align-items: flex-end;
    min-width: 0;
    max-width: 100%;
  }

  .funnel-micro-bar {
    max-width: min(5.5rem, 36vw);
  }
}
