:root {
	--ccffc-bg: #f4f6f8;
	--ccffc-card: #ffffff;
	--ccffc-card-2: #f9fafb;
	--ccffc-text: #1f2937;
	--ccffc-muted: #64748b;
	--ccffc-border: #d8dee6;
	--ccffc-primary: #343a46;
	--ccffc-primary-2: #111827;
	--ccffc-accent: #6b7280;
	--ccffc-focus: #2563eb;
	--ccffc-danger: #b91c1c;
	--ccffc-danger-bg: #fef2f2;
	--ccffc-success: #047857;
	--ccffc-shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
	--ccffc-radius: 22px;
	--ccffc-radius-sm: 14px;
}

.ccffc-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 16px;
	color: var(--ccffc-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ccffc-wrap *,
.ccffc-wrap *::before,
.ccffc-wrap *::after {
	box-sizing: border-box;
}

.ccffc-shell {
	width: 100%;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 242, 247, 0.92));
	border: 1px solid rgba(148, 163, 184, 0.28);
	border-radius: 28px;
	box-shadow: var(--ccffc-shadow);
	padding: 16px;
	overflow: hidden;
}

.ccffc-header {
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: stretch;
	justify-content: space-between;
	padding: 8px 4px 20px;
}

.ccffc-kicker {
	margin: 0 0 6px;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ccffc-accent);
}

.ccffc-header h2,
.ccffc-results h3 {
	margin: 0;
	line-height: 1.1;
	color: var(--ccffc-text);
}

.ccffc-header h2 {
	font-size: clamp(1.55rem, 4vw, 2.55rem);
	font-weight: 850;
	letter-spacing: -0.035em;
}

.ccffc-subtitle,
.ccffc-result-top p,
.ccffc-section-heading p,
.ccffc-help,
.ccffc-note {
	color: var(--ccffc-muted);
}

.ccffc-subtitle {
	max-width: 760px;
	margin: 10px 0 0;
	font-size: 0.98rem;
	line-height: 1.65;
}

.ccffc-theme-toggle,
.ccffc-btn {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-weight: 750;
	line-height: 1;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.ccffc-theme-toggle {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 12px 16px;
	background: var(--ccffc-primary);
	color: #ffffff;
	box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.ccffc-theme-toggle:hover,
.ccffc-btn:hover {
	transform: translateY(-1px);
}

.ccffc-theme-toggle:focus-visible,
.ccffc-btn:focus-visible,
.ccffc-wrap input:focus-visible,
.ccffc-wrap select:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.32);
	outline-offset: 3px;
}

.ccffc-layout,
.ccffc-layout-stacked {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	clear: both !important;
}

.ccffc-card {
	width: 100%;
	max-width: 100%;
	float: none;
	background: var(--ccffc-card);
	border: 1px solid rgba(148, 163, 184, 0.36);
	border-radius: var(--ccffc-radius);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.ccffc-form,
.ccffc-results {
	padding: clamp(16px, 3vw, 26px);
}

.ccffc-form,
.ccffc-results {
	display: block !important;
	float: none !important;
	clear: both !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	flex: 0 0 100% !important;
	grid-column: 1 / -1 !important;
}

.ccffc-form {
	order: 1;
	margin-bottom: 18px;
}

.ccffc-results,
.ccffc-output-below {
	order: 2;
	margin-top: 18px;
	position: relative !important;
	top: auto !important;
	right: auto !important;
	left: auto !important;
}

.ccffc-section-heading {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 16px;
}

.ccffc-section-gap {
	margin-top: 28px;
}

.ccffc-section-heading > span {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	border-radius: 14px;
	background: linear-gradient(135deg, #e5e7eb, #f8fafc);
	color: var(--ccffc-primary-2);
	font-size: 1.05rem;
	box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.24);
}

.ccffc-section-heading h3 {
	margin: 0;
	font-size: 1.04rem;
	line-height: 1.25;
}

.ccffc-section-heading p {
	margin: 4px 0 0;
	font-size: 0.9rem;
	line-height: 1.5;
}

.ccffc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

.ccffc-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.ccffc-field label,
.ccffc-mini-label {
	font-size: 0.9rem;
	font-weight: 750;
	color: var(--ccffc-text);
}

.ccffc-wrap input,
.ccffc-wrap select {
	width: 100%;
	min-height: 46px;
	border: 1px solid var(--ccffc-border);
	border-radius: 14px;
	background: var(--ccffc-card-2);
	color: var(--ccffc-text);
	font: inherit;
	font-size: 0.98rem;
	padding: 11px 13px;
	transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ccffc-wrap input:hover,
.ccffc-wrap select:hover {
	border-color: #a8b0bd;
}

.ccffc-wrap input[type="checkbox"] {
	width: 19px;
	height: 19px;
	min-height: auto;
	margin: 0;
	accent-color: var(--ccffc-primary-2);
}

.ccffc-input-suffix,
.ccffc-pair {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ccffc-input-suffix {
	position: relative;
}

.ccffc-input-suffix input {
	padding-right: 46px;
}

.ccffc-input-suffix span {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--ccffc-muted);
	font-weight: 800;
	pointer-events: none;
}

.ccffc-pair input {
	min-width: 0;
}

.ccffc-help {
	font-size: 0.8rem;
	line-height: 1.35;
}

.ccffc-checkbox-card {
	justify-content: center;
	min-height: 100%;
	padding: 14px;
	border: 1px solid rgba(148, 163, 184, 0.28);
	border-radius: var(--ccffc-radius-sm);
	background: var(--ccffc-card-2);
}

.ccffc-checkline {
	display: flex;
	gap: 10px;
	align-items: center;
	cursor: pointer;
	line-height: 1.35;
}

.ccffc-nested-check {
	margin-top: 8px;
	padding-left: 2px;
	font-size: 0.85rem;
	color: var(--ccffc-muted);
}

.ccffc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid rgba(148, 163, 184, 0.26);
}

.ccffc-btn {
	min-height: 43px;
	padding: 12px 15px;
	background: #e5e7eb;
	color: #111827;
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ccffc-btn-primary {
	background: var(--ccffc-primary-2);
	color: #ffffff;
}

.ccffc-btn-secondary {
	background: transparent;
	border: 1px solid var(--ccffc-border);
	box-shadow: none;
}

.ccffc-alert {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid rgba(185, 28, 28, 0.25);
	border-radius: 16px;
	background: var(--ccffc-danger-bg);
	color: var(--ccffc-danger);
	font-weight: 700;
}

.ccffc-result-top {
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: flex-start;
	justify-content: space-between;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.ccffc-results h3 {
	font-size: clamp(2rem, 8vw, 4rem);
	font-weight: 900;
	letter-spacing: -0.06em;
}

.ccffc-result-top p {
	margin: 8px 0 0;
	font-size: 0.94rem;
	line-height: 1.5;
}

.ccffc-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	padding: 9px 13px;
	background: #edf2f7;
	color: #334155;
	font-size: 0.84rem;
	font-weight: 800;
	white-space: normal;
}

.ccffc-result-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin-top: 18px;
}

.ccffc-metric {
	min-width: 0;
	padding: 15px;
	border: 1px solid rgba(148, 163, 184, 0.28);
	border-radius: 18px;
	background: linear-gradient(180deg, var(--ccffc-card-2), var(--ccffc-card));
}

.ccffc-metric span {
	display: block;
	margin-bottom: 7px;
	color: var(--ccffc-muted);
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.ccffc-metric strong {
	display: block;
	font-size: 1.35rem;
	line-height: 1.1;
	word-break: break-word;
}

.ccffc-chart {
	margin-top: 18px;
}

.ccffc-chart-bar {
	display: flex;
	overflow: hidden;
	width: 100%;
	height: 16px;
	border-radius: 999px;
	background: #e5e7eb;
}

.ccffc-chart-bar span {
	display: block;
	width: 0%;
	min-width: 0;
	transition: width 220ms ease;
}

.ccffc-chart-bar span[data-chart="court"],
.ccffc-legend i[data-dot="court"] {
	background: #111827;
}

.ccffc-chart-bar span[data-chart="service"],
.ccffc-legend i[data-dot="service"] {
	background: #4b5563;
}

.ccffc-chart-bar span[data-chart="addons"],
.ccffc-legend i[data-dot="addons"] {
	background: #9ca3af;
}

.ccffc-chart-bar span[data-chart="electronic"],
.ccffc-legend i[data-dot="electronic"] {
	background: #cbd5e1;
}

.ccffc-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-top: 10px;
	font-size: 0.82rem;
	font-weight: 750;
	color: var(--ccffc-muted);
}

.ccffc-legend span {
	display: inline-flex;
	gap: 7px;
	align-items: center;
}

.ccffc-legend i {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 999px;
}

.ccffc-table-wrap {
	width: 100%;
	overflow-x: auto;
	margin-top: 20px;
	border: 1px solid rgba(148, 163, 184, 0.3);
	border-radius: 18px;
}

.ccffc-breakdown {
	width: 100%;
	min-width: 620px;
	border-collapse: collapse;
	background: var(--ccffc-card);
}

.ccffc-breakdown caption {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.ccffc-breakdown th,
.ccffc-breakdown td {
	padding: 12px 14px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.22);
	text-align: left;
	vertical-align: top;
}

.ccffc-breakdown th {
	background: var(--ccffc-card-2);
	font-size: 0.82rem;
	font-weight: 850;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ccffc-muted);
}

.ccffc-breakdown td:last-child,
.ccffc-breakdown th:last-child {
	text-align: right;
	font-weight: 800;
}

.ccffc-breakdown tr:last-child td {
	border-bottom: 0;
}

.ccffc-total-row td {
	background: var(--ccffc-card-2);
	font-size: 1rem;
	font-weight: 900;
}

.ccffc-note {
	margin-top: 16px;
	padding: 13px 14px;
	border-left: 4px solid var(--ccffc-primary);
	border-radius: 14px;
	background: var(--ccffc-card-2);
	font-size: 0.88rem;
	line-height: 1.55;
}

.ccffc-wrap.is-dark {
	--ccffc-bg: #0f172a;
	--ccffc-card: #111827;
	--ccffc-card-2: #1f2937;
	--ccffc-text: #f8fafc;
	--ccffc-muted: #cbd5e1;
	--ccffc-border: #334155;
	--ccffc-primary: #e5e7eb;
	--ccffc-primary-2: #f8fafc;
	--ccffc-accent: #d1d5db;
	--ccffc-danger-bg: #3f1111;
	--ccffc-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
}

.ccffc-wrap.is-dark .ccffc-shell {
	background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
}

.ccffc-wrap.is-dark .ccffc-theme-toggle,
.ccffc-wrap.is-dark .ccffc-btn-primary {
	background: #f8fafc;
	color: #111827;
}

.ccffc-wrap.is-dark .ccffc-btn {
	background: #334155;
	color: #f8fafc;
}

.ccffc-wrap.is-dark .ccffc-btn-secondary {
	background: transparent;
	color: #f8fafc;
}

.ccffc-wrap.is-dark .ccffc-section-heading > span,
.ccffc-wrap.is-dark .ccffc-badge {
	background: #1f2937;
	color: #f8fafc;
}

@media (min-width: 540px) {
	.ccffc-wrap {
		padding: 22px;
	}

	.ccffc-shell {
		padding: 22px;
	}

	.ccffc-grid-2,
	.ccffc-grid-3,
	.ccffc-result-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 860px) {
	.ccffc-header {
		flex-direction: row;
		align-items: center;
	}

	.ccffc-result-top {
		flex-direction: column;
		align-items: flex-start;
	}

	.ccffc-layout,
	.ccffc-layout-stacked {
		display: block !important;
		grid-template-columns: 1fr !important;
		column-gap: 0 !important;
	}

	.ccffc-theme-toggle {
		white-space: nowrap;
	}

	.ccffc-grid-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ccffc-result-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1180px) {
	.ccffc-shell {
		padding: 28px;
	}

	.ccffc-form,
	.ccffc-results {
		padding: 30px;
	}
}

@media (max-width: 430px) {
	.ccffc-wrap {
		padding: 10px;
	}

	.ccffc-shell {
		padding: 12px;
		border-radius: 22px;
	}

	.ccffc-actions {
		flex-direction: column;
	}

	.ccffc-actions .ccffc-btn {
		width: 100%;
	}

	.ccffc-pair {
		flex-direction: column;
		align-items: stretch;
	}
}

@media print {
	.ccffc-theme-toggle,
	.ccffc-actions,
	.ccffc-form {
		display: none !important;
	}

	.ccffc-wrap,
	.ccffc-shell,
	.ccffc-card {
		max-width: none;
		padding: 0;
		box-shadow: none;
		border: 0;
	}

	.ccffc-results {
		display: block !important;
	}
}


/* Forced vertical layout: the output/result card must stay below the input form on every screen size. */
.ccffc-wrap .ccffc-layout.ccffc-layout-stacked,
.ccffc-wrap [data-layout="stacked"] {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	grid-template-columns: 1fr !important;
	clear: both !important;
}

.ccffc-wrap .ccffc-layout.ccffc-layout-stacked > .ccffc-form,
.ccffc-wrap .ccffc-layout.ccffc-layout-stacked > .ccffc-results,
.ccffc-wrap [data-layout="stacked"] > [data-role="form"],
.ccffc-wrap [data-layout="stacked"] > [data-role="results"] {
	display: block !important;
	float: none !important;
	clear: both !important;
	width: 100% !important;
	max-width: 100% !important;
	flex-basis: 100% !important;
	grid-column: 1 / -1 !important;
}

.ccffc-wrap .ccffc-layout.ccffc-layout-stacked > .ccffc-results,
.ccffc-wrap [data-layout="stacked"] > [data-role="results"] {
	margin-top: 20px !important;
}
