/* Pepzora reconstitution calculator — matches the storefront palette. */

:root {
	--pzrc-ivory: #FBF8F3;
	--pzrc-beige: #F2EAE0;
	--pzrc-sand: #E0D3C0;
	--pzrc-espresso: #221C16;
	--pzrc-body: #3D3429;
	--pzrc-muted: #6B5844;
	--pzrc-gold: #B08D4F;
	--pzrc-flag: #8B4A3B;
	--pzrc-serif: "Cormorant Garamond", Georgia, serif;
	--pzrc-sans: Montserrat, "Helvetica Neue", Arial, sans-serif;
	--pzrc-text: Inter, "Helvetica Neue", Arial, sans-serif;
}

.pzrc {
	font-family: var(--pzrc-text);
	color: var(--pzrc-body);
	box-sizing: border-box;
}

.pzrc *,
.pzrc *::before,
.pzrc *::after {
	box-sizing: inherit;
}

/* ---------- Inputs ---------- */

.pzrc__form {
	margin: 0 0 26px;
}

.pzrc__inputs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.pzrc__label {
	display: block;
	margin-bottom: 9px;
	font-family: var(--pzrc-sans);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 1.8px;
	line-height: 1.6;
	text-transform: uppercase;
	color: var(--pzrc-muted);
}

.pzrc__control {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--pzrc-sand);
	border-radius: 2px;
	background: var(--pzrc-ivory);
	overflow: hidden;
	transition: border-color 0.3s ease;
}

.pzrc__control:focus-within {
	border-color: var(--pzrc-gold);
}

.pzrc__input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	padding: 15px 14px;
	border: 0;
	background: transparent;
	font-family: var(--pzrc-text);
	font-size: 17px;
	line-height: 1.4;
	color: var(--pzrc-espresso);
	-moz-appearance: textfield;
}

.pzrc__input:focus {
	outline: none;
}

.pzrc__input::-webkit-outer-spin-button,
.pzrc__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pzrc__unit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	padding: 0 15px;
	background: var(--pzrc-beige);
	border-left: 1px solid var(--pzrc-sand);
	font-family: var(--pzrc-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--pzrc-muted);
}

.pzrc__hint {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.55;
	color: var(--pzrc-muted);
}

/* ---------- Results ---------- */

.pzrc__results {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--pzrc-sand);
	border: 1px solid var(--pzrc-sand);
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 26px;
}

.pzrc__result {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 22px 20px;
	background: var(--pzrc-ivory);
	text-align: center;
}

.pzrc__result--primary {
	background: var(--pzrc-beige);
}

.pzrc__result-label {
	font-family: var(--pzrc-sans);
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 1.6px;
	line-height: 1.5;
	text-transform: uppercase;
	color: var(--pzrc-muted);
}

.pzrc__result-value {
	font-family: var(--pzrc-serif);
	font-size: 30px;
	font-weight: 600;
	line-height: 1.15;
	color: var(--pzrc-espresso);
}

.pzrc__result--primary .pzrc__result-value {
	color: var(--pzrc-gold);
}

.pzrc__result-sub {
	font-size: 12px;
	line-height: 1.5;
	color: var(--pzrc-muted);
}

.pzrc__error {
	margin: 0 0 22px;
	padding: 14px 18px;
	background: var(--pzrc-beige);
	border-left: 3px solid var(--pzrc-flag);
	border-radius: 2px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--pzrc-flag);
}

.pzrc__error[hidden] {
	display: none;
}

/* ---------- Reference table ---------- */

.pzrc__table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--pzrc-sand);
	border-radius: 2px;
	margin: 0 0 24px;
}

.pzrc__caption {
	caption-side: top;
	padding: 0 0 12px;
	text-align: left;
	font-family: var(--pzrc-sans);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: var(--pzrc-muted);
}

/* No text-transform here: uppercasing would turn the micro sign in the
   microlitre heading into Greek capital Mu, which looks exactly like M and
   would present that column as millilitres. The headings are written in the
   case they should display. */
.pzrc__table th {
	padding: 13px 16px;
	background: var(--pzrc-beige);
	border-bottom: 1px solid var(--pzrc-sand);
	font-family: var(--pzrc-sans);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 1.6px;
	text-transform: none;
	color: var(--pzrc-muted);
	text-align: left;
}

.pzrc__table td {
	padding: 14px 16px;
	border-top: 1px solid var(--pzrc-sand);
	font-size: 14px;
	line-height: 1.5;
	color: var(--pzrc-body);
}

.pzrc__table tbody tr:first-child td {
	border-top: 0;
}

.pzrc__table td:first-child {
	font-weight: 500;
	color: var(--pzrc-espresso);
}

/* ---------- Compliance note ---------- */

.pzrc__note {
	margin: 0;
	padding-top: 18px;
	border-top: 1px solid var(--pzrc-sand);
	font-size: 12px;
	line-height: 1.75;
	color: var(--pzrc-muted);
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
	.pzrc__inputs,
	.pzrc__results {
		grid-template-columns: 1fr;
	}

	.pzrc__results {
		gap: 1px;
	}

	.pzrc__result {
		padding: 18px;
	}

	.pzrc__table thead {
		display: none;
	}

	.pzrc__table,
	.pzrc__table tbody,
	.pzrc__table tr,
	.pzrc__table td {
		display: block;
		width: 100%;
	}

	.pzrc__table tr {
		border-bottom: 1px solid var(--pzrc-sand);
		padding: 6px 0;
	}

	.pzrc__table tr:last-child {
		border-bottom: 0;
	}

	.pzrc__table td {
		display: flex;
		justify-content: space-between;
		gap: 16px;
		border-top: 0;
		padding: 7px 16px;
	}

	/* Same reasoning as the table headings: these labels carry unit symbols
	   and must not be uppercased. */
	.pzrc__table td::before {
		content: attr(data-label);
		font-family: var(--pzrc-sans);
		font-size: 9px;
		font-weight: 600;
		letter-spacing: 1.4px;
		text-transform: none;
		color: var(--pzrc-muted);
	}
}

/* ---------------------------------------------- target quantity unit ---- */

/* Two units on the target field. Materials are worked in mg or mcg depending
   on the compound, and asking anyone to shift a decimal three places in their
   head is where a thousand-fold error gets made. */
.pzrc__units {
	display: inline-flex;
	border: 1px solid #E2D6C2;
	overflow: hidden;
	flex: 0 0 auto;
}

.pzrc__unit-btn {
	background: transparent;
	border: 0;
	padding: 6px 12px;
	font: inherit;
	font-size: 12px;
	letter-spacing: 0.08em;
	color: #7A6D5D;
	cursor: pointer;
	/* Pre-capitalised, never uppercased by CSS: text-transform maps µ (U+00B5)
	   to Greek capital Mu, so "mcg" and "µl" headings stop meaning what they
	   say in a tool where a unit mix-up is a thousand-fold error. */
	text-transform: none;
}

.pzrc__unit-btn + .pzrc__unit-btn { border-left: 1px solid #E2D6C2; }

.pzrc__unit-btn[aria-pressed="true"] {
	background: #241D17;
	color: #FBF8F3;
}

.pzrc__unit-btn:focus-visible { outline: 2px solid #241D17; outline-offset: 2px; }
