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

.edc-calculator {
	--edc-bg: #f4f6f8;
	--edc-surface: #ffffff;
	--edc-surface-2: #eef1f5;
	--edc-text: #17202a;
	--edc-muted: #5f6b7a;
	--edc-border: #d9dee7;
	--edc-accent: #2f6fed;
	--edc-accent-2: #1f2937;
	--edc-good: #147d64;
	--edc-warn: #9a6700;
	--edc-danger: #b42318;
	--edc-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
	--edc-radius: 22px;
	--edc-radius-sm: 14px;
	--edc-focus: 0 0 0 4px rgba(47, 111, 237, 0.24);
	width: 100%;
	max-width: 100%;
	padding: 18px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--edc-text);
}

.edc-calculator[data-theme="dark"] {
	--edc-bg: #101418;
	--edc-surface: #171d24;
	--edc-surface-2: #222a33;
	--edc-text: #f3f6fa;
	--edc-muted: #aab5c2;
	--edc-border: #333d49;
	--edc-accent: #8ab4ff;
	--edc-accent-2: #e6edf7;
	--edc-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
	--edc-focus: 0 0 0 4px rgba(138, 180, 255, 0.28);
}

.edc-shell {
	max-width: 1220px;
	margin: 0 auto;
	padding: 16px;
	background:
		radial-gradient(circle at top left, rgba(47, 111, 237, 0.12), transparent 34%),
		linear-gradient(135deg, var(--edc-bg), var(--edc-surface-2));
	border-radius: 28px;
}

.edc-header-card,
.edc-card {
	background: rgba(255, 255, 255, 0.86);
	background: color-mix(in srgb, var(--edc-surface) 92%, transparent);
	border: 1px solid var(--edc-border);
	box-shadow: var(--edc-shadow);
	border-radius: var(--edc-radius);
}

.edc-header-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 22px;
	margin-bottom: 16px;
}

.edc-eyebrow {
	margin: 0 0 7px;
	font-size: 0.76rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--edc-accent);
}

.edc-title,
.edc-results h3,
.edc-section h3,
.edc-breakdown h4 {
	margin: 0;
	line-height: 1.15;
	color: var(--edc-text);
}

.edc-title {
	font-size: clamp(1.55rem, 4vw, 2.45rem);
	text-transform: capitalize;
}

.edc-subtitle,
.edc-section-heading p {
	margin: 8px 0 0;
	color: var(--edc-muted);
	line-height: 1.55;
}

.edc-theme-toggle,
.edc-btn {
	border: 0;
	border-radius: 999px;
	font-weight: 800;
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.edc-theme-toggle {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--edc-surface-2);
	color: var(--edc-text);
	border: 1px solid var(--edc-border);
}

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

.edc-theme-toggle:focus-visible,
.edc-btn:focus-visible,
.edc-field input:focus-visible,
.edc-field select:focus-visible,
.edc-check input:focus-visible {
	outline: none;
	box-shadow: var(--edc-focus);
}

.edc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	align-items: start;
}

.edc-card {
	padding: 18px;
}

.edc-form {
	display: grid;
	gap: 16px;
}

.edc-section {
	padding: 16px;
	border: 1px solid var(--edc-border);
	border-radius: 18px;
	background: color-mix(in srgb, var(--edc-surface) 74%, var(--edc-surface-2));
}

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

.edc-section h3 {
	font-size: 1.08rem;
}

.edc-icon {
	width: 38px;
	height: 38px;
	min-width: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 13px;
	background: linear-gradient(135deg, var(--edc-accent), var(--edc-accent-2));
	color: #fff;
	font-weight: 900;
}

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

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

.edc-field > span,
.edc-range-field > span {
	font-size: 0.93rem;
	font-weight: 800;
	color: var(--edc-text);
}

.edc-field small {
	color: var(--edc-muted);
	line-height: 1.35;
}

.edc-field input,
.edc-field select {
	width: 100%;
	min-height: 46px;
	border: 1px solid var(--edc-border);
	border-radius: var(--edc-radius-sm);
	background: var(--edc-surface);
	color: var(--edc-text);
	padding: 11px 13px;
	font: inherit;
	transition: border 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.edc-field input:hover,
.edc-field select:hover {
	border-color: color-mix(in srgb, var(--edc-accent) 55%, var(--edc-border));
}

.edc-field input[type="range"] {
	min-height: auto;
	padding: 0;
	accent-color: var(--edc-accent);
}

.edc-money {
	display: flex;
	align-items: center;
	border: 1px solid var(--edc-border);
	border-radius: var(--edc-radius-sm);
	background: var(--edc-surface);
	overflow: hidden;
	transition: box-shadow 160ms ease, border 160ms ease;
}

.edc-money:focus-within {
	box-shadow: var(--edc-focus);
	border-color: var(--edc-accent);
}

.edc-money span {
	padding: 0 0 0 13px;
	font-weight: 900;
	color: var(--edc-muted);
}

.edc-money input {
	border: 0;
	border-radius: 0;
	box-shadow: none !important;
}

.edc-scale {
	display: flex;
	justify-content: space-between;
	font-size: 0.78rem;
	color: var(--edc-muted);
}

.edc-check-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin-top: 14px;
}

.edc-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--edc-border);
	border-radius: var(--edc-radius-sm);
	background: var(--edc-surface);
	font-weight: 700;
	color: var(--edc-text);
	cursor: pointer;
}

.edc-check input {
	width: 19px;
	height: 19px;
	margin-top: 1px;
	accent-color: var(--edc-accent);
	flex: 0 0 auto;
}

.edc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.edc-btn {
	min-height: 44px;
	padding: 11px 16px;
	background: linear-gradient(135deg, var(--edc-accent), var(--edc-accent-2));
	color: #fff;
	box-shadow: 0 12px 24px rgba(47, 111, 237, 0.22);
}

.edc-btn-secondary {
	background: var(--edc-surface-2);
	color: var(--edc-text);
	border: 1px solid var(--edc-border);
	box-shadow: none;
}

.edc-status {
	min-height: 22px;
	font-weight: 800;
	color: var(--edc-good);
}

.edc-field.edc-error input,
.edc-field.edc-error select,
.edc-field.edc-error .edc-money {
	border-color: var(--edc-danger);
}

.edc-field.edc-error > span::after {
	content: " required";
	color: var(--edc-danger);
	font-weight: 900;
}

.edc-results {
	position: relative;
	display: grid;
	gap: 16px;
}

.edc-results-top h3 {
	font-size: 1.35rem;
}

.edc-main-result {
	padding: 20px;
	border-radius: 20px;
	background: linear-gradient(135deg, var(--edc-accent), var(--edc-accent-2));
	color: #fff;
}

.edc-main-result span,
.edc-main-result small {
	display: block;
	color: rgba(255, 255, 255, 0.86);
	font-weight: 700;
}

.edc-main-result strong {
	display: block;
	margin: 8px 0;
	font-size: clamp(2rem, 8vw, 3.2rem);
	letter-spacing: -0.05em;
	line-height: 1;
}

.edc-result-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.edc-mini-card {
	padding: 14px;
	border-radius: 16px;
	border: 1px solid var(--edc-border);
	background: var(--edc-surface-2);
}

.edc-mini-card span {
	display: block;
	color: var(--edc-muted);
	font-size: 0.85rem;
	font-weight: 800;
}

.edc-mini-card strong {
	display: block;
	margin-top: 4px;
	font-size: 1.18rem;
	color: var(--edc-text);
}

.edc-meter-wrap {
	display: grid;
	gap: 8px;
}

.edc-meter-label {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-weight: 900;
}

.edc-meter {
	height: 14px;
	border-radius: 999px;
	background: var(--edc-surface-2);
	overflow: hidden;
	border: 1px solid var(--edc-border);
}

.edc-meter span {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--edc-danger), var(--edc-warn), var(--edc-good));
	transition: width 220ms ease;
}

.edc-chart {
	display: grid;
	gap: 12px;
}

.edc-chart-row {
	display: grid;
	grid-template-columns: minmax(92px, 0.8fr) minmax(88px, 1.4fr) minmax(76px, auto);
	gap: 10px;
	align-items: center;
	font-size: 0.84rem;
	font-weight: 800;
	color: var(--edc-text);
}

.edc-chart-row div {
	height: 12px;
	background: var(--edc-surface-2);
	border-radius: 999px;
	overflow: hidden;
}

.edc-chart-row i {
	display: block;
	height: 100%;
	width: 0%;
	border-radius: inherit;
	background: var(--edc-accent);
	transition: width 220ms ease;
}

.edc-chart-row strong {
	text-align: right;
	font-size: 0.82rem;
}

.edc-breakdown {
	padding: 15px;
	border-radius: 18px;
	background: var(--edc-surface-2);
	border: 1px solid var(--edc-border);
}

.edc-breakdown h4 {
	font-size: 1rem;
}

.edc-breakdown p {
	margin: 8px 0 12px;
	color: var(--edc-muted);
	line-height: 1.55;
}

.edc-breakdown ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 8px;
}

.edc-breakdown li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding-top: 8px;
	border-top: 1px solid var(--edc-border);
	font-weight: 800;
}

.edc-breakdown li span {
	color: var(--edc-muted);
}

.edc-disclaimer {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.55;
	color: var(--edc-muted);
}

@media (min-width: 560px) {
	.edc-shell {
		padding: 22px;
	}

	.edc-header-card {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.edc-theme-toggle {
		align-self: center;
		white-space: nowrap;
	}

	.edc-card {
		padding: 22px;
	}

	.edc-fields,
	.edc-result-cards,
	.edc-check-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 980px) {
	.edc-grid {
		grid-template-columns: minmax(0, 1.55fr) minmax(350px, 0.85fr);
	}

	.edc-results {
		position: sticky;
		top: 24px;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.edc-calculator *,
	.edc-calculator *::before,
	.edc-calculator *::after {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.edc-calculator {
		padding: 0;
	}

	.edc-shell {
		background: #fff !important;
		padding: 0;
	}

	.edc-header-card,
	.edc-card {
		box-shadow: none !important;
	}

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

	.edc-grid {
		grid-template-columns: 1fr;
	}
}
