.c4p-fpc {
	box-sizing: border-box;
	--c4p-fpc-stroke: #0b6e4f;
	--c4p-fpc-fill: #0b6e4f;
	--c4p-fpc-fill-opacity: 0.55;
	--c4p-fpc-axis: #64748b;
	--c4p-fpc-grid: #e2e8f0;
	--c4p-fpc-toolbar-icon: #6e8192;
	--c4p-fpc-toolbar-icon-active: #008ffb;
	--c4p-fpc-toolbar-icon-size: 14px;
	--c4p-fpc-select-border-active: #0b6e4f;
}

html.c4p-fpc-filters-lock {
	overflow: hidden;
}

.c4p-fpc-title {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
	line-height: 1.3;
}

/* —— Filters: Voxel ts-btn / ts-btn-1; compact = button + dialog/sheet —— */
.c4p-fpc-filters-btn.ts-btn,
button.c4p-fpc-filters-btn {
	display: none;
	width: auto;
	max-width: 100%;
	margin: 0 0 0.85rem;
	box-sizing: border-box;
	font-weight: inherit;
	cursor: pointer;
	/* Fallbacks if Voxel commons.css not loaded; otherwise theme tokens win. */
	height: 44px;
	padding: 10px 15px;
	border-radius: 7px;
	border: 1px solid var(--ts-shade-3, #d1d5db);
	background: #fff;
	color: var(--ts-shade-2, #525a6e);
	font-size: var(--e-global-typography-text-font-size, 15px);
	grid-gap: 10px;
	gap: 10px;
	--ts-icon-size: 20px;
	--ts-icon-color: var(--ts-shade-2, #525a6e);
}

.c4p-fpc-filters-btn.ts-btn:hover,
button.c4p-fpc-filters-btn:hover {
	border-color: var(--ts-shade-2, #6b7280);
	color: var(--ts-shade-1, #374151);
	cursor: pointer;
}

.c4p-fpc-filters-btn--icon-only {
	padding-left: 12px;
	padding-right: 12px;
	min-width: 44px;
}

.c4p-fpc-filters-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	flex-shrink: 0;
}

.c4p-fpc-filters-btn__icon i {
	font-size: var(--ts-icon-size, 20px);
	color: var(--ts-icon-color, currentColor);
}

.c4p-fpc-filters-btn__icon svg {
	width: var(--ts-icon-size, 20px);
	height: var(--ts-icon-size, 20px);
	fill: var(--ts-icon-color, currentColor);
	flex-shrink: 0;
}

.c4p-fpc-filters-btn__label {
	display: inline-flex;
	align-items: center;
	font-weight: inherit;
	min-width: 0;
}

.c4p-fpc-filters-shell {
	position: static;
}

.c4p-fpc-filters-backdrop,
.c4p-fpc-filters-head,
.c4p-fpc-filters-done,
.c4p-fpc-filters-close {
	display: none;
}

.c4p-fpc-filters-panel {
	position: static;
	background: transparent;
}

.c4p-fpc-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-bottom: 0.85rem;
	align-items: flex-end;
}

.c4p-fpc-controls .c4p-fpc-control,
.c4p-fpc-controls .ts-form-group {
	flex: 1 1 10rem;
	min-width: 10rem;
	margin: 0;
}

.c4p-fpc-controls .c4p-fpc-control > label,
.c4p-fpc-controls .ts-form-group > label {
	display: block;
	margin: 0 0 0.35rem;
	font-size: 0.8rem;
	font-weight: 600;
}

/* Compact: show trigger, hide inline shell until opened (shell portals to body). */
.c4p-fpc--compact-active .c4p-fpc-filters-btn {
	display: inline-flex;
	cursor: pointer;
}

.c4p-fpc--compact-active .c4p-fpc-filters-btn * {
	cursor: pointer;
}

.c4p-fpc--compact-active .c4p-fpc-filters-shell:not(.c4p-fpc-filters-shell--open) {
	display: none !important;
}

/*
 * Open dialog styles live on the shell itself so they still apply after
 * appendChild(document.body) — Elementor/Voxel overflow/transform would clip fixed-in-parent.
 */
.c4p-fpc-filters-shell.c4p-fpc-filters-shell--open {
	display: block !important;
	position: fixed !important;
	inset: 0 !important;
	z-index: 1000500 !important;
	margin: 0;
	padding: 0;
}

.c4p-fpc-filters-shell--open .c4p-fpc-filters-backdrop {
	display: block;
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.c4p-fpc-filters-shell--open .c4p-fpc-filters-panel {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(28rem, calc(100% - 2rem));
	max-height: min(85vh, 40rem);
	overflow: auto;
	padding: 1rem 1.1rem 1.15rem;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
	box-sizing: border-box;
}

.c4p-fpc-filters-shell--open .c4p-fpc-filters-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.85rem;
}

.c4p-fpc-filters-shell--open .c4p-fpc-filters-head__title {
	font-size: 1rem;
	font-weight: 700;
	color: #0f172a;
}

/* Voxel .ts-icon-btn — keep theme look (circle + border + SVG). */
.c4p-fpc-filters-shell--open .c4p-fpc-filters-close.ts-icon-btn,
.c4p-fpc-filters-shell--open button.c4p-fpc-filters-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	flex-shrink: 0;
	border: 1px solid var(--ts-shade-3, #d1d5db);
	border-radius: 40px;
	background: transparent;
	color: var(--ts-shade-2, #525a6e);
	line-height: normal;
	cursor: pointer;
	--ts-icon-size: 18px;
	--ts-icon-color: var(--ts-shade-2, #525a6e);
}

.c4p-fpc-filters-shell--open .c4p-fpc-filters-close svg {
	width: var(--ts-icon-size, 18px);
	height: var(--ts-icon-size, 18px);
	fill: var(--ts-icon-color, #525a6e);
}

.c4p-fpc-filters-shell--open .c4p-fpc-controls {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.85rem;
	margin-bottom: 1rem;
	align-items: stretch;
}

.c4p-fpc-filters-shell--open .c4p-fpc-controls .c4p-fpc-control,
.c4p-fpc-filters-shell--open .c4p-fpc-controls .ts-form-group {
	width: 100%;
	min-width: 0;
	flex: none;
}

.c4p-fpc-filters-shell--open .c4p-fpc-controls label {
	color: #0f172a;
}

/* Bottom dialog close — Voxel ts-btn-2; Elementor Style can override. */
.c4p-fpc-filters-shell--open .c4p-fpc-filters-done.ts-btn,
.c4p-fpc-filters-shell--open button.c4p-fpc-filters-done {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 44px;
	padding: 10px 15px;
	border: 0;
	border-radius: 7px;
	background: var(--ts-accent-1, #0b6e4f);
	color: #fff;
	font-size: var(--e-global-typography-text-font-size, 15px);
	font-weight: inherit;
	cursor: pointer;
	box-sizing: border-box;
	--ts-icon-color: #fff;
}

.c4p-fpc-filters-shell--open .c4p-fpc-filters-done.ts-btn:hover,
.c4p-fpc-filters-shell--open button.c4p-fpc-filters-done:hover {
	background: var(--ts-accent-2, #095c42);
	color: #fff;
}

@media (max-width: 767px) {
	.c4p-fpc-filters-shell--open .c4p-fpc-filters-panel {
		display: flex;
		flex-direction: column;
		left: 0;
		right: 0;
		top: auto;
		bottom: 0;
		transform: none;
		width: 100%;
		max-height: min(88vh, 36rem);
		border-radius: 0 !important; /* Voxel mobile sheet: straight top edge */
		overflow: hidden !important;
		padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	}

	.c4p-fpc-filters-shell--open .c4p-fpc-controls {
		flex: 1 1 auto;
		min-height: 0;
		overflow: auto;
	}

	.c4p-fpc-filters-shell--open .c4p-fpc-filters-done {
		flex-shrink: 0;
	}
}

.c4p-fpc-controls .c4p-popup-picker__trigger,
.c4p-fpc-filters-shell .c4p-popup-picker__trigger {
	background: #ffffff !important;
	background-color: #ffffff !important;
	color: #0f172a !important;
}

.c4p-fpc-controls .c4p-popup-picker__trigger:focus,
.c4p-fpc-controls .c4p-popup-picker--open .c4p-popup-picker__trigger {
	border-color: var(--c4p-fpc-select-border-active) !important;
	box-shadow: 0 0 0 1px var(--c4p-fpc-select-border-active);
	outline: none;
}

/* Desktop: portaled picker dropdowns — don't clip. Mobile sheet uses overflow:hidden above. */
@media (min-width: 768px) {
	.c4p-fpc-filters-shell--open .c4p-fpc-filters-panel {
		overflow: visible;
	}

	.c4p-fpc-filters-shell--open .c4p-fpc-controls {
		overflow: visible;
	}
}

.c4p-fpc-canvas {
	width: 100%;
	min-height: 240px;
}

.c4p-fpc-caption {
	margin: 0.65rem 0 0;
	font-size: 0.8rem;
	line-height: 1.4;
	opacity: 0.85;
}

.c4p-fpc-empty,
.c4p-fpc-hint {
	padding: 1.25rem;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	color: #64748b;
	font-size: 0.9rem;
}

/* Area / bar fill from Style → Area fill & bar color */
.c4p-fpc path.apexcharts-area,
.c4p-fpc path.apexcharts-bar-area {
	fill: var(--c4p-fpc-fill);
	fill-opacity: var(--c4p-fpc-fill-opacity);
}

/*
 * Line stroke: Apex 4 area charts use path.apexcharts-area (with stroke),
 * not path.apexcharts-line. JS tags real stroke paths with .c4p-fpc-stroke-path.
 *
 * Theme CSS often sets `path { fill: currentColor }` → black under the Line curve
 * even when the SVG attribute is fill="none". Force none on line series only.
 */
.c4p-fpc path.c4p-fpc-stroke-path {
	stroke: var(--c4p-fpc-stroke) !important;
}

.c4p-fpc path.apexcharts-line,
.c4p-fpc .apexcharts-line-series path.apexcharts-line {
	stroke: var(--c4p-fpc-stroke) !important;
	fill: none !important;
	fill-opacity: 0 !important;
}

.c4p-fpc .apexcharts-line-series .apexcharts-marker {
	fill: var(--c4p-fpc-stroke) !important;
}

/* Toolbar — Font Awesome / Elementor ICONS (avoid Voxel path{fill:inherit} squares) */
.c4p-fpc .apexcharts-toolbar {
	color: var(--c4p-fpc-toolbar-icon) !important;
	gap: 2px;
}

.c4p-fpc .apexcharts-toolbar > div {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 28px !important;
	height: 28px !important;
	line-height: 1;
	cursor: pointer;
	box-sizing: border-box;
	color: var(--c4p-fpc-toolbar-icon) !important;
}

.c4p-fpc .apexcharts-toolbar i,
.c4p-fpc .apexcharts-toolbar .e-font-icon-svg,
.c4p-fpc .apexcharts-toolbar svg {
	font-size: var(--c4p-fpc-toolbar-icon-size) !important;
	width: 1em !important;
	height: 1em !important;
	max-width: 1em;
	max-height: 1em;
	line-height: 1 !important;
	color: var(--c4p-fpc-toolbar-icon) !important;
	fill: var(--c4p-fpc-toolbar-icon) !important;
	display: inline-block;
	vertical-align: middle;
}

.c4p-fpc .apexcharts-toolbar path:not([fill='none']):not([fill='transparent']) {
	fill: var(--c4p-fpc-toolbar-icon) !important;
}

/* fa-search fills the em-box more than search-plus/minus — optically normalize */
.c4p-fpc .apexcharts-zoom-icon i.fa-search,
.c4p-fpc .apexcharts-zoom-icon svg.e-fas-search {
	font-size: calc(var(--c4p-fpc-toolbar-icon-size) * 0.86) !important;
}

.c4p-fpc .apexcharts-toolbar path[fill='none'],
.c4p-fpc .apexcharts-toolbar path[fill='transparent'] {
	fill: none !important;
}

.c4p-fpc .apexcharts-toolbar .apexcharts-selected,
.c4p-fpc .apexcharts-toolbar .apexcharts-selected i,
.c4p-fpc .apexcharts-toolbar .apexcharts-selected svg {
	color: var(--c4p-fpc-toolbar-icon-active) !important;
	fill: var(--c4p-fpc-toolbar-icon-active) !important;
}

.c4p-fpc .apexcharts-toolbar .apexcharts-selected path:not([fill='none']):not([fill='transparent']) {
	fill: var(--c4p-fpc-toolbar-icon-active) !important;
}
