/* P102 Funnel chart — scoped, wp-admin safe. Clean teal→green ramp (no AI-purple cliché). */

.wi-funnel-chart {
	box-sizing: border-box;
	margin: 0 0 24px;
	padding: 20px 22px;
	background: #ffffff;
	border: 1px solid #e6e9ee;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wi-funnel-chart *,
.wi-funnel-chart *::before,
.wi-funnel-chart *::after {
	box-sizing: border-box;
}

.wi-funnel-chart__head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 16px;
}

.wi-funnel-chart__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #101828;
}

.wi-funnel-chart__sub {
	font-size: 12px;
	color: #667085;
}

.wi-funnel-chart__rows {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wi-funnel-chart__row {
	display: grid;
	grid-template-columns: 140px 1fr 54px;
	align-items: center;
	gap: 12px;
	position: relative;
}

.wi-funnel-chart__label {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	min-width: 0;
	font-size: 13px;
	color: #344054;
	text-align: right;
}

.wi-funnel-chart__label-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Info icon (hover AND focus/tap). The tooltip is anchored to the row, not the ellipsised
   label, so it is never clipped by the label's overflow. */
.wi-funnel-chart__info {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: #e4e7ec;
	color: #475467;
	font-size: 10px;
	font-weight: 700;
	font-style: normal;
	line-height: 1;
	cursor: help;
	user-select: none;
}

.wi-funnel-chart__info:hover,
.wi-funnel-chart__info:focus {
	background: #d0d5dd;
	color: #101828;
	outline: 2px solid #0ea5a4;
	outline-offset: 1px;
}

.wi-funnel-chart__info::after {
	content: attr(data-tip);
	position: absolute;
	z-index: 20;
	left: 0;
	top: calc(100% + 6px);
	width: min(300px, 80vw);
	padding: 8px 10px;
	border-radius: 6px;
	background: #1d2327;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
	box-shadow: 0 6px 16px rgba(16, 24, 40, 0.2);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.wi-funnel-chart__info:hover::after,
.wi-funnel-chart__info:focus::after {
	opacity: 1;
	visibility: visible;
}

.wi-funnel-chart__bar-track {
	position: relative;
	height: 34px;
	background: #f2f4f7;
	border-radius: 6px;
	overflow: hidden;
}

.wi-funnel-chart__bar {
	display: flex;
	align-items: center;
	height: 100%;
	/* #A1208: no min-width so 0% stages stay empty; proportional widths taper */
	min-width: 0;
	box-sizing: border-box;
	padding: 0 10px;
	border-radius: 6px;
	background: linear-gradient(90deg, #0ea5a4 0%, #14b8a6 55%, #22c55e 100%);
	transition: width 0.35s ease;
	overflow: hidden;
}

.wi-funnel-chart__bar[style*="width: 0%"] {
	padding: 0;
}

/* #A1203/#A1204 test overlay: test activity, not in main totals */
.wi-funnel-chart__bar--admin-test {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 10px;
	min-width: 0;
	padding: 0 6px;
	border-radius: 0 0 6px 6px;
	background: linear-gradient(90deg, #d97706 0%, #f59e0b 55%, #fbbf24 100%) !important;
	z-index: 2;
	overflow: hidden;
}

.wi-funnel-chart__bar--admin-test .wi-funnel-chart__count {
	font-size: 10px;
	line-height: 10px;
}

.wi-funnel-chart__legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin: 0 0 12px;
	font-size: 12px;
	color: #667085;
}

.wi-funnel-chart__legend-swatch {
	display: inline-block;
	width: 14px;
	height: 10px;
	border-radius: 3px;
	margin-right: 4px;
	vertical-align: middle;
}

.wi-funnel-chart__legend-swatch--real {
	background: linear-gradient(90deg, #0ea5a4 0%, #22c55e 100%);
}

.wi-funnel-chart__legend-swatch--admin {
	background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
}

.wi-funnel-chart__count {
	font-size: 12px;
	font-weight: 600;
	color: #ffffff;
	white-space: nowrap;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.wi-funnel-chart__step {
	font-size: 12px;
	font-weight: 600;
	color: #0f766e;
	text-align: right;
}

/* Progressive de-saturation down the funnel for quick scanning. */
.wi-funnel-chart__row[data-step="registered"] .wi-funnel-chart__bar { background: linear-gradient(90deg, #0ea5a4 0%, #14b8a6 100%); }
.wi-funnel-chart__row[data-step="mail"] .wi-funnel-chart__bar { background: linear-gradient(90deg, #1499a8 0%, #22b3ac 100%); }
.wi-funnel-chart__row[data-step="live"] .wi-funnel-chart__bar { background: linear-gradient(90deg, #2a8fb8 0%, #38bd99 100%); }
.wi-funnel-chart__row[data-step="watch_ok"] .wi-funnel-chart__bar { background: linear-gradient(90deg, #3b82c4 0%, #4ec48a 100%); }
.wi-funnel-chart__row[data-step="replay"] .wi-funnel-chart__bar { background: linear-gradient(90deg, #4f7fce 0%, #63cc7f 100%); }
.wi-funnel-chart__row[data-step="purchased"] .wi-funnel-chart__bar { background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%); }

.wi-funnel-chart__modes {
	display: inline-flex;
	gap: 4px;
	margin-bottom: 12px;
	padding: 3px;
	background: #f2f4f7;
	border-radius: 8px;
}

.wi-funnel-chart__mode {
	border: 0;
	background: transparent;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #667085;
	border-radius: 6px;
	cursor: pointer;
}

.wi-funnel-chart__mode.is-active {
	background: #fff;
	color: #101828;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}

.wi-funnel-chart__mode-hint {
	margin: 0 0 14px;
	font-size: 12px;
	line-height: 1.4;
	color: #667085;
}

/* #A1206: refresh without full Settings reload */
.wi-funnel-chart__refresh {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin: 0 0 14px;
}

.wi-funnel-chart__refresh-btn {
	margin: 0 !important;
}

.wi-funnel-chart__auto {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #344054;
	cursor: pointer;
	user-select: none;
}

.wi-funnel-chart__auto-input {
	margin: 0 !important;
}

.wi-funnel-chart__refresh-status {
	font-size: 12px;
	color: #667085;
	min-height: 1.2em;
}

.wi-funnel-chart.is-refreshing .wi-funnel-chart__refresh-btn {
	opacity: 0.7;
}

.wi-funnel-chart__rows[hidden] {
	display: none !important;
}

.wi-funnel-chart__reset {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px dashed #e6e9ee;
}

.wi-funnel-chart__reset-actions {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 8px;
}

.wi-funnel-chart__reset-action .wi-funnel-chart__cfg-note {
	margin: 6px 0 0;
}

.wi-funnel-chart__reset-btn {
	margin-top: 0;
}

.wi-funnel-chart__reset-btn--danger {
	color: #b42318;
	border-color: #fecdca;
}

.wi-funnel-chart__reset-btn--danger:hover,
.wi-funnel-chart__reset-btn--danger:focus {
	color: #912018;
	border-color: #f97066;
}

.wi-funnel-chart__cfg-note--danger {
	color: #b42318;
}

.wi-funnel-chart__reset-status {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	color: #067647;
	vertical-align: middle;
}

.wi-funnel-chart__settings {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px dashed #e6e9ee;
}

.wi-funnel-chart__settings-summary {
	font-size: 13px;
	font-weight: 600;
	color: #475467;
	cursor: pointer;
}

.wi-funnel-chart__cfg {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
}

.wi-funnel-chart__cfg-label {
	font-size: 13px;
	font-weight: 600;
	color: #344054;
}

.wi-funnel-chart__cfg-note {
	flex: 1 1 100%;
	font-size: 11px;
	color: #98a2b3;
}

.wi-funnel-chart__page-picker {
	flex: 1 1 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 520px;
}

.wi-funnel-chart__page-query {
	width: 100%;
	box-sizing: border-box;
}

.wi-funnel-chart__page-select {
	display: block;
	width: 100%;
	min-height: 8.5em;
	height: 8.5em;
	padding: 6px 8px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	font-size: 13px;
	line-height: 1.45;
	color: #1d2327;
	overflow-y: auto;
	box-sizing: border-box;
}

.wi-funnel-chart__pixel {
	flex: 1 1 100%;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 8px;
}

.wi-funnel-chart__pixel-input {
	width: 100%;
	max-width: 100%;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px;
}

.wi-funnel-chart__badge {
	display: inline-block;
	align-self: flex-start;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	background: #f2f4f7;
	color: #667085;
}

.wi-funnel-chart__badge--ok {
	background: #dcfae6;
	color: #067647;
}

.wi-funnel-chart__badge--partial {
	background: #fef0c7;
	color: #93370d;
}

.wi-funnel-chart__badge--never {
	background: #f2f4f7;
	color: #667085;
}

.wi-funnel-chart__toggle {
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 0 4px;
	font-size: 14px;
	line-height: 1;
	color: #667085;
}

.wi-funnel-chart__pin {
	margin-left: auto;
	font-size: 11px;
	color: #667085;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 500;
}

.wi-funnel-chart--compact {
	margin: 8px 12px 12px;
	padding: 10px 14px;
	width: auto;
	max-width: 100%;
	align-self: stretch;
}

/* List rows use .editableSectionHeading { display:flex; row }. Keep funnel under the webinar link. */
.wi-list-apps .wi-webinar.editableSectionHeading,
.wi-list-apps .wi-webinar.editableSectionHeadingDASH {
	flex-direction: column;
	align-items: stretch;
}

.wi-list-apps .wi-webinar.editableSectionHeadingDASH > a {
	width: 100%;
	max-width: 100%;
}

.wi-funnel-chart--compact .wi-funnel-chart__cfg {
	display: none;
}

.wi-funnel-chart--compact.is-collapsed {
	padding: 8px 12px;
}

.wi-funnel-chart--compact.is-collapsed .wi-funnel-chart__head {
	margin-bottom: 0;
	flex-wrap: wrap;
}

.wi-funnel-chart.is-collapsed .wi-funnel-chart__body {
	display: none;
}

.wi-funnel-chart.is-collapsed .wi-funnel-chart__chev {
	display: inline-block;
	transform: rotate(-90deg);
}

/* Keyboard: expand while focus is inside the chart (JS also toggles class on focusin). */
.wi-funnel-chart.is-collapsed:focus-within .wi-funnel-chart__body {
	display: block;
}

.wi-funnel-chart.is-collapsed:focus-within .wi-funnel-chart__chev {
	transform: none;
}

/* #A1138 P2 — campaign timeseries reuse (Tab1) */
.wi-funnel-chart__timeseries {
	margin: 0 0 14px;
	padding: 10px 12px;
	background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 70%);
	border: 1px solid #e6e9ee;
	border-radius: 10px;
}

.wi-funnel-chart__timeseries-label {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	color: #344054;
}

.wi-funnel-chart__timeseries-empty {
	margin: 0;
	font-size: 12px;
	color: #667085;
}

.wi-funnel-chart__timeseries-svg svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 140px;
}

.wi-funnel-chart__utm {
	margin: 4px 0 10px;
	padding: 8px 10px;
	border: 1px solid #d5dbe3;
	border-radius: 6px;
	background: #f8fafc;
}

.wi-funnel-chart--filtered .wi-funnel-chart__utm {
	border-color: #5b9bd5;
	background: #f0f6fd;
}

.wi-funnel-chart__utm-title {
	font-weight: 600;
	font-size: 12px;
	color: #344054;
	margin-right: 6px;
}

.wi-funnel-chart__utm-hint {
	font-size: 11px;
	color: #667085;
}

.wi-funnel-chart__utm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.wi-funnel-chart__chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 10px;
	font-size: 12px;
	line-height: 1.6;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	background: #ffffff;
	color: #344054;
	cursor: pointer;
}

.wi-funnel-chart__chip:hover {
	border-color: #5b9bd5;
}

.wi-funnel-chart__chip.is-active {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #ffffff;
}

.wi-funnel-chart--filtered .wi-funnel-chart__title {
	color: #1d4ed8;
}

@media (max-width: 782px) {
	.wi-list-apps .wi-funnel-chart--compact {
		margin: 6px 10px 10px;
	}

	.wi-list-apps .wi-funnel-chart--compact .wi-funnel-chart__pin {
		display: none;
	}

	.wi-list-apps .wi-funnel-chart--compact .wi-funnel-chart__title {
		font-size: 13px;
	}

	.wi-list-apps .wi-funnel-chart--compact .wi-funnel-chart__sub {
		font-size: 11px;
		flex: 1 1 auto;
	}

	.wi-funnel-chart__row {
		grid-template-columns: 92px 1fr 44px;
		gap: 8px;
	}

	.wi-funnel-chart__label {
		font-size: 12px;
	}
}

/* #funnel-stats (2026-09-14): KI-Hinweis unter dem Kampagnen-Trichter. */
.wi-funnel-chart__ai-hint{margin:10px 0 4px;padding:8px 10px;border-left:3px solid #14b8a6;background:#f0fdfa;color:#0f172a;font-size:12px;line-height:1.5;border-radius:4px}

/* #ask-link (2026-09-14): Hinweis-Text ist ein Link, der den Mini-Agenten mit vor-eingefuegter Anweisung oeffnet. */
.wi-agent-ask{color:#0f766e;text-decoration:underline;font-weight:600;cursor:pointer}
.wi-agent-ask:hover,.wi-agent-ask:focus{color:#115e59}
