.ctc-calculator {
	--ctc-primary: #0D2950;
	--ctc-secondary: #E70000;
	--ctc-bg: #FFFFFF;
	--ctc-surface: #F7F8FA;
	--ctc-border: #E4E7EC;
	--ctc-text: #0D2950;
	--ctc-text-muted: #8A93A3;
	--ctc-radius: 20px;
	--ctc-font-display: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
	--ctc-font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;

	box-sizing: border-box;
	max-width: 980px;
	margin: 0 auto;
	padding: 36px;
	background: var(--ctc-bg);
	border-radius: var(--ctc-radius);
	font-family: var(--ctc-font-body);
	font-weight: 300;
	color: var(--ctc-text);
}

.ctc-calculator *,
.ctc-calculator *::before,
.ctc-calculator *::after {
	box-sizing: border-box;
}

.ctc-layout {
	display: grid;
	grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

/* Grid/flex children default to min-width: auto, i.e. they refuse to shrink
   below their min-content width (nowrap labels, side-by-side fields). On a
   narrow phone that pushed the form past the card's right padding, making
   the widget look off-centre. */
.ctc-layout > * {
	min-width: 0;
}

/* ---------------------------------------------------------------- */
/* Left column: the form                                             */
/* ---------------------------------------------------------------- */

.ctc-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
}

.ctc-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--ctc-surface);
	border: 1.5px solid var(--ctc-border);
	border-radius: 14px;
	padding: 14px 16px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ctc-field:focus-within {
	border-color: var(--ctc-primary);
	box-shadow: 0 0 0 4px rgba(13, 41, 80, 0.06);
}

.ctc-field--primary {
	padding: 18px 20px;
}

.ctc-field--invalid {
	border-color: var(--ctc-secondary);
	background: rgba(231, 0, 0, 0.05);
}

.ctc-field--invalid label,
.ctc-field--invalid .ctc-field-icon {
	color: var(--ctc-secondary);
	stroke: var(--ctc-secondary);
}

.ctc-field label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--ctc-font-body);
	font-weight: 500;
	font-size: 10.5px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ctc-primary);
	white-space: nowrap;
}

.ctc-field-icon {
	width: 12px;
	height: 12px;
	flex: 0 0 auto;
	fill: none;
	stroke: var(--ctc-primary);
	stroke-width: 1.4;
}

.ctc-field-control {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.ctc-field input {
	width: 100%;
	min-width: 0;
	border: none;
	background: transparent;
	padding: 0;
	font-family: var(--ctc-font-display);
	font-weight: 500;
	font-size: 16px;
	color: var(--ctc-primary);
}

.ctc-field--primary input {
	font-size: 26px;
}

.ctc-field input::placeholder {
	color: #B3BAC7;
	font-weight: 400;
}

.ctc-field input:focus {
	outline: none;
}

.ctc-field--primary .ctc-field-control {
	align-items: center;
}

/* L / m³ segmented switch next to the volume input. */
.ctc-unit-toggle {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 3px;
	background: #fff;
	border: 1px solid var(--ctc-border);
	border-radius: 10px;
}

/* Scoped under .ctc-field to beat the generic `.ctc-field label` rule
   (uppercase would otherwise turn "m³" into "M³"). */
.ctc-field .ctc-unit-option {
	position: relative;
	display: block;
	margin: 0;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}

.ctc-unit-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.ctc-unit-option span {
	display: block;
	min-width: 34px;
	padding: 5px 9px;
	border-radius: 7px;
	font-family: var(--ctc-font-body);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	color: var(--ctc-text-muted);
	transition: background 0.2s ease, color 0.2s ease;
}

.ctc-unit-option input:checked + span {
	background: var(--ctc-primary);
	color: #fff;
}

.ctc-unit-option input:focus-visible + span {
	outline: 2px solid var(--ctc-primary);
	outline-offset: 2px;
}

.ctc-field-suffix {
	font-family: var(--ctc-font-body);
	font-size: 12px;
	color: var(--ctc-text-muted);
	white-space: nowrap;
}

.ctc-hint {
	margin: 0;
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--ctc-text-muted);
}

.ctc-field-row {
	display: flex;
	gap: 12px;
}

.ctc-field-row .ctc-field {
	flex: 1 1 0;
	min-width: 0;
}

.ctc-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	border: none;
	background: var(--ctc-primary);
	color: #fff;
	font-family: var(--ctc-font-display);
	font-weight: 600;
	font-size: 15px;
	letter-spacing: 0.02em;
	padding: 16px;
	border-radius: 14px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.ctc-submit:hover {
	background: #163a6e;
}

.ctc-submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.ctc-submit-icon {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.2s ease;
}

.ctc-submit:hover .ctc-submit-icon {
	transform: translateX(2px);
}

.ctc-submit.is-loading .ctc-submit-label::after {
	content: '\2026';
}

.ctc-error {
	margin: 0;
	font-size: 13px;
	color: var(--ctc-secondary);
	font-family: var(--ctc-font-body);
}

.ctc-contact-link {
	color: var(--ctc-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ctc-contact-link:hover {
	color: var(--ctc-secondary);
}

/* ---------------------------------------------------------------- */
/* Right column: the showcase (placeholder / empty / result)         */
/* ---------------------------------------------------------------- */

.ctc-showcase {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 20px;
}

/* The showcase shows exactly one of these three at a time (toggled via the
   `hidden` attribute in JS). Without this, `display: flex` below would win
   over the browser's default `[hidden] { display: none }` and all three
   would stack and show at once. */
.ctc-placeholder[hidden],
.ctc-empty[hidden],
.ctc-result[hidden] {
	display: none;
}

.ctc-placeholder,
.ctc-visual {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 360px;
	background: var(--ctc-surface);
	border-radius: 16px;
	aspect-ratio: 260 / 240;
}

.ctc-placeholder {
	flex-direction: column;
	gap: 14px;
	border: 1.5px dashed var(--ctc-border);
	padding: 24px;
}

.ctc-placeholder-icon {
	width: 48px;
	height: 48px;
	fill: none;
	stroke: #C6CCD6;
	stroke-width: 1.5;
}

.ctc-placeholder p {
	margin: 0;
	max-width: 220px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ctc-text-muted);
}

.ctc-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 360px;
	aspect-ratio: 260 / 240;
	padding: 24px;
	background: var(--ctc-surface);
	border-radius: 16px;
}

.ctc-empty-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--ctc-text);
	text-align: center;
}

.ctc-visual {
	padding: 12px;
}

.ctc-visual svg {
	width: 100%;
	height: 100%;
}

.ctc-cyl-outline {
	fill: #fff;
	stroke: var(--ctc-primary);
	stroke-width: 1.6;
}

.ctc-cyl-rim {
	fill: #fff;
	stroke: var(--ctc-primary);
	stroke-width: 1.6;
}

.ctc-dim-line {
	stroke: var(--ctc-text-muted);
	stroke-width: 1;
}

.ctc-dim-ext {
	stroke: var(--ctc-border);
	stroke-width: 1;
}

.ctc-dim-arrow {
	fill: var(--ctc-text-muted);
}

.ctc-dim-label {
	font-family: var(--ctc-font-display);
	font-weight: 500;
	font-size: 11px;
	fill: var(--ctc-text);
}

/* Reference figure (1.75 m) drawn at the same scale as the tank. */
.ctc-person {
	fill: #A9B1BD;
}

.ctc-ground {
	stroke: var(--ctc-border);
	stroke-width: 1;
}

.ctc-scale-note {
	font-family: var(--ctc-font-display);
	font-size: 9px;
	letter-spacing: 0.02em;
	fill: var(--ctc-text-muted);
}

.ctc-result {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	width: 100%;
	animation: ctc-fade-in 0.3s ease;
}

@keyframes ctc-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ctc-message {
	margin: 0;
	max-width: 360px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ctc-secondary);
	font-family: var(--ctc-font-body);
	font-weight: 400;
}

.ctc-volume-headline {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.ctc-volume-label {
	font-family: var(--ctc-font-body);
	font-weight: 400;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ctc-text-muted);
}

.ctc-volume-value {
	font-family: var(--ctc-font-display);
	font-weight: 600;
	font-size: 44px;
	line-height: 1;
	color: var(--ctc-secondary);
}

.ctc-volume-alt {
	margin-top: 4px;
	font-family: var(--ctc-font-display);
	font-weight: 500;
	font-size: 18px;
	color: var(--ctc-primary);
}

/* ---------------------------------------------------------------- */
/* Mobile: single column                                              */
/* ---------------------------------------------------------------- */

@media (max-width: 720px) {
	.ctc-calculator {
		padding: 22px 18px;
	}

	.ctc-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.ctc-placeholder,
	.ctc-visual,
	.ctc-empty {
		max-width: 280px;
	}

	.ctc-volume-value {
		font-size: 36px;
	}
}

@media (max-width: 420px) {
	.ctc-calculator {
		padding: 20px 14px;
	}

	/* Two side-by-side fields don't fit a phone-width card: stack them. */
	.ctc-field-row {
		flex-direction: column;
	}
}
