:root {
	--gdcffc-bg: #f5f7fb;
	--gdcffc-panel: #ffffff;
	--gdcffc-panel-soft: #f1f4f9;
	--gdcffc-text: #172033;
	--gdcffc-muted: #657084;
	--gdcffc-border: #dce3ef;
	--gdcffc-primary: #4b5565;
	--gdcffc-primary-dark: #313946;
	--gdcffc-shadow: 0 18px 48px rgba(24, 31, 44, 0.12);
	--gdcffc-focus: #2563eb;
	--gdcffc-success: #127a48;
	--gdcffc-radius-xl: 28px;
	--gdcffc-radius-lg: 20px;
	--gdcffc-radius-md: 14px;
}

.gdcffc-calculator,
.gdcffc-calculator * {
	box-sizing: border-box;
}

.gdcffc-calculator {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 16px;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--gdcffc-text);
}

.gdcffc-calculator[data-theme="dark"] {
	--gdcffc-bg: #0d1118;
	--gdcffc-panel: #151b25;
	--gdcffc-panel-soft: #1d2633;
	--gdcffc-text: #edf2fb;
	--gdcffc-muted: #a7b2c3;
	--gdcffc-border: #2d3849;
	--gdcffc-primary: #9aa5b8;
	--gdcffc-primary-dark: #c6ceda;
	--gdcffc-shadow: 0 20px 54px rgba(0, 0, 0, 0.38);
	--gdcffc-focus: #8ab4ff;
	--gdcffc-success: #52d995;
}

.gdcffc-shell {
	width: 100%;
	background: linear-gradient(180deg, var(--gdcffc-bg), var(--gdcffc-panel-soft));
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-xl);
	box-shadow: var(--gdcffc-shadow);
	padding: clamp(16px, 3vw, 32px);
	overflow: hidden;
}

.gdcffc-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}

.gdcffc-eyebrow {
	margin: 0 0 6px;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gdcffc-muted);
}

.gdcffc-header h2,
.gdcffc-result-hero h3 {
	margin: 0;
	line-height: 1.1;
	font-weight: 850;
	letter-spacing: -0.04em;
	color: var(--gdcffc-text);
}

.gdcffc-header h2 {
	font-size: clamp(1.55rem, 4vw, 2.65rem);
}

.gdcffc-theme-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--gdcffc-border);
	border-radius: 999px;
	background: var(--gdcffc-panel);
	color: var(--gdcffc-text);
	min-height: 44px;
	padding: 10px 14px;
	font-weight: 750;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
	transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.gdcffc-theme-toggle:hover {
	transform: translateY(-1px);
	border-color: var(--gdcffc-primary);
}

.gdcffc-form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
	width: 100%;
}

.gdcffc-stack {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 18px;
	width: 100%;
	max-width: 100%;
	clear: both;
}

.gdcffc-stack > .gdcffc-form,
.gdcffc-stack > .gdcffc-results {
	float: none !important;
	clear: both !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	flex: 0 0 auto !important;
	grid-column: 1 / -1 !important;
}

.gdcffc-stack > .gdcffc-form {
	order: 1 !important;
}

.gdcffc-stack > .gdcffc-results {
	order: 2 !important;
}

.gdcffc-card,
.gdcffc-results {
	width: 100%;
	background: var(--gdcffc-panel);
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-lg);
	padding: clamp(16px, 2.3vw, 24px);
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.gdcffc-card {
	transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gdcffc-card:hover {
	transform: translateY(-1px);
	border-color: rgba(75, 85, 101, 0.45);
}

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

.gdcffc-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 14px;
	background: var(--gdcffc-panel-soft);
	border: 1px solid var(--gdcffc-border);
	font-size: 1.15rem;
	flex: 0 0 auto;
}

.gdcffc-section-heading h3 {
	margin: 0 0 4px;
	font-size: clamp(1.05rem, 2vw, 1.28rem);
	line-height: 1.2;
}

.gdcffc-section-heading p {
	margin: 0;
	color: var(--gdcffc-muted);
	font-size: 0.95rem;
	line-height: 1.45;
}

.gdcffc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	width: 100%;
}

.gdcffc-field {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.gdcffc-field > span,
.gdcffc-switch > span:last-child {
	font-size: 0.92rem;
	font-weight: 760;
	color: var(--gdcffc-text);
}

.gdcffc-field input,
.gdcffc-field select {
	width: 100%;
	min-height: 48px;
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-md);
	background: var(--gdcffc-panel-soft);
	color: var(--gdcffc-text);
	padding: 12px 14px;
	font: inherit;
	outline: none;
	transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.gdcffc-field select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--gdcffc-muted) 50%), linear-gradient(135deg, var(--gdcffc-muted) 50%, transparent 50%);
	background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 36px;
}

.gdcffc-field input:focus,
.gdcffc-field select:focus,
.gdcffc-theme-toggle:focus-visible,
.gdcffc-btn:focus-visible,
.gdcffc-switch input:focus-visible + .gdcffc-slider {
	border-color: var(--gdcffc-focus);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.gdcffc-money {
	display: flex;
	align-items: center;
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-md);
	background: var(--gdcffc-panel-soft);
	overflow: hidden;
}

.gdcffc-money > span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 48px;
	font-weight: 850;
	color: var(--gdcffc-muted);
	border-right: 1px solid var(--gdcffc-border);
}

.gdcffc-money input {
	border: 0;
	border-radius: 0;
	background: transparent;
}

.gdcffc-switch {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 12px;
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-md);
	background: var(--gdcffc-panel-soft);
	cursor: pointer;
}

.gdcffc-switch input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.gdcffc-slider {
	position: relative;
	width: 48px;
	height: 28px;
	border-radius: 999px;
	background: #99a3b3;
	transition: background 180ms ease;
	flex: 0 0 auto;
}

.gdcffc-slider::after {
	content: "";
	position: absolute;
	width: 22px;
	height: 22px;
	left: 3px;
	top: 3px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
	transition: transform 180ms ease;
}

.gdcffc-switch input:checked + .gdcffc-slider {
	background: var(--gdcffc-success);
}

.gdcffc-switch input:checked + .gdcffc-slider::after {
	transform: translateX(20px);
}

.gdcffc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	width: 100%;
	margin: 2px 0 0;
}

.gdcffc-btn {
	appearance: none;
	border: 1px solid var(--gdcffc-border);
	background: var(--gdcffc-panel);
	color: var(--gdcffc-text);
	border-radius: 999px;
	min-height: 46px;
	padding: 10px 16px;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.gdcffc-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.11);
	border-color: var(--gdcffc-primary);
}

.gdcffc-btn-primary {
	background: linear-gradient(180deg, var(--gdcffc-primary), var(--gdcffc-primary-dark));
	color: #ffffff;
	border-color: var(--gdcffc-primary-dark);
}

.gdcffc-btn-muted {
	color: var(--gdcffc-muted);
}

.gdcffc-results {
	margin-top: 0;
	display: block;
}

.gdcffc-result-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
	align-items: center;
	padding: clamp(18px, 2.5vw, 28px);
	border-radius: var(--gdcffc-radius-lg);
	background: linear-gradient(135deg, var(--gdcffc-panel-soft), var(--gdcffc-panel));
	border: 1px solid var(--gdcffc-border);
}

.gdcffc-result-hero h3 {
	font-size: clamp(2rem, 6vw, 4rem);
	margin-bottom: 8px;
}

.gdcffc-result-hero p:last-child {
	margin: 0;
	color: var(--gdcffc-muted);
	font-weight: 650;
	line-height: 1.5;
}

.gdcffc-meter {
	height: 12px;
	width: 100%;
	background: var(--gdcffc-border);
	border-radius: 999px;
	overflow: hidden;
}

.gdcffc-meter span {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--gdcffc-primary), var(--gdcffc-success));
	border-radius: inherit;
	transition: width 240ms ease;
}

.gdcffc-result-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin-top: 14px;
}

.gdcffc-mini-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 15px;
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-md);
	background: var(--gdcffc-panel-soft);
}

.gdcffc-mini-card span {
	color: var(--gdcffc-muted);
	font-weight: 750;
}

.gdcffc-mini-card strong {
	font-size: 1.1rem;
	white-space: nowrap;
}

.gdcffc-details-wrap {
	margin-top: 18px;
}

.gdcffc-details-wrap h4 {
	margin: 0 0 10px;
	font-size: 1rem;
}

.gdcffc-table {
	display: grid;
	border: 1px solid var(--gdcffc-border);
	border-radius: var(--gdcffc-radius-md);
	overflow: hidden;
}

.gdcffc-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 12px 14px;
	background: var(--gdcffc-panel);
	border-bottom: 1px solid var(--gdcffc-border);
}

.gdcffc-row:nth-child(even) {
	background: var(--gdcffc-panel-soft);
}

.gdcffc-row:last-child {
	border-bottom: 0;
}

.gdcffc-row span {
	font-weight: 700;
	line-height: 1.35;
}

.gdcffc-row strong {
	white-space: nowrap;
}

.gdcffc-notice {
	margin: 14px 0 0;
	padding: 12px 14px;
	border-left: 4px solid var(--gdcffc-primary);
	border-radius: 12px;
	background: var(--gdcffc-panel-soft);
	color: var(--gdcffc-muted);
	line-height: 1.5;
	font-size: 0.92rem;
}

.gdcffc-error {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14) !important;
}

@media (min-width: 640px) {
	.gdcffc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gdcffc-wide,
	.gdcffc-switch {
		grid-column: 1 / -1;
	}

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

@media (min-width: 900px) {
	.gdcffc-result-hero {
		grid-template-columns: minmax(0, 1fr) 220px;
	}
}

@media (max-width: 560px) {
	.gdcffc-calculator {
		padding: 8px;
	}

	.gdcffc-shell {
		border-radius: 20px;
	}

	.gdcffc-header {
		flex-direction: column;
	}

	.gdcffc-theme-toggle,
	.gdcffc-btn {
		width: 100%;
		justify-content: center;
	}

	.gdcffc-actions {
		display: grid;
		grid-template-columns: 1fr;
	}

	.gdcffc-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

@media print {
	.gdcffc-calculator {
		max-width: none;
		padding: 0;
	}

	.gdcffc-shell {
		box-shadow: none;
		border: 0;
		background: #ffffff;
	}

	.gdcffc-form,
	.gdcffc-theme-toggle,
	.gdcffc-actions {
		display: none !important;
	}

	.gdcffc-results {
		box-shadow: none;
		border: 1px solid #cbd5e1;
	}
}


/* Hard layout lock: results must always render below the input form, never beside it. */
.gdcffc-calculator .gdcffc-stack {
	display: flex !important;
	flex-direction: column !important;
}

.gdcffc-calculator .gdcffc-stack > .gdcffc-form {
	order: 1 !important;
	width: 100% !important;
}

.gdcffc-calculator .gdcffc-stack > .gdcffc-results {
	order: 2 !important;
	width: 100% !important;
	grid-column: 1 / -1 !important;
}

.gdcffc-calculator .gdcffc-result-hero {
	grid-template-columns: 1fr !important;
}
