/**
 * Kenetic Calculators — shared styles.
 *
 * All selectors are prefixed with `kccal_` / `kccal-` to avoid clashing
 * with theme classes. Custom properties are scoped to `.kccal_calculator`
 * rather than `:root`, so nothing leaks into the surrounding theme.
 */

.kccal_calculator {
	--kccal-orange: #e8590c;
	--kccal-orange-dark: #c94f0d;
	--kccal-ink: #1c1c1c;
	--kccal-paper: #faf7f2;
	--kccal-line: #e2ddd3;
	--kccal-muted: #6b6459;

	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto 2em;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--kccal-ink);
}

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

.kccal_calculator__title {
	font-size: 1.5rem;
	margin: 0 0 4px;
}

.kccal_calculator__subtitle {
	color: var(--kccal-muted);
	margin: 0 0 20px;
	font-size: 0.95rem;
}

.kccal_calculator__card {
	background: #fff;
	border: 1px solid var(--kccal-line);
	border-radius: 10px;
	padding: 24px;
	margin-bottom: 20px;
}

.kccal_calculator__label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 6px;
}

.kccal_calculator__row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.kccal_calculator__row--top-gap {
	margin-top: 16px;
}

.kccal_calculator__field {
	flex: 1;
	min-width: 150px;
}

.kccal_calculator__input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--kccal-line);
	border-radius: 6px;
	font-size: 1rem;
	line-height: 1.4;
}

.kccal_calculator__toggle {
	display: flex;
	border: 1px solid var(--kccal-line);
	border-radius: 6px;
	overflow: hidden;
}

.kccal_calculator__toggle-btn {
	flex: 1;
	padding: 10px;
	border: none;
	background: #fff;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--kccal-muted);
}

.kccal_calculator__toggle-btn.is-active {
	background: var(--kccal-orange);
	color: #fff;
}

.kccal_calculator__unit-toggle {
	display: flex;
	gap: 6px;
	margin-top: 6px;
}

.kccal_calculator__unit-btn {
	padding: 5px 10px;
	border: 1px solid var(--kccal-line);
	background: #fff;
	border-radius: 5px;
	font-size: 0.78rem;
	cursor: pointer;
	color: var(--kccal-muted);
	font-weight: 600;
}

.kccal_calculator__unit-btn.is-active {
	background: var(--kccal-orange);
	color: #fff;
	border-color: var(--kccal-orange);
}

.kccal_calculator__hint {
	font-size: 0.8rem;
	color: var(--kccal-muted);
	margin: -8px 0 16px;
}

.kccal_calculator__error {
	font-size: 0.85rem;
	color: #b3261e;
	background: #fdecea;
	border: 1px solid #f4c7c3;
	border-radius: 6px;
	padding: 10px 12px;
	margin: 0 0 16px;
}

.kccal_calculator__error[hidden] {
	display: none;
}

.kccal_calculator__button {
	width: 100%;
	padding: 13px;
	background: var(--kccal-orange);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.kccal_calculator__button:hover {
	background: var(--kccal-orange-dark);
}

.kccal_calculator__result {
	display: none;
	text-align: center;
	padding: 20px;
	margin-top: 4px;
	background: #fff4ec;
	border: 1px solid #f3c9a8;
	border-radius: 8px;
}

.kccal_calculator__result.is-visible {
	display: block;
}

.kccal_calculator__result-label {
	font-size: 0.85rem;
	color: var(--kccal-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.kccal_calculator__result-value {
	font-size: 2.4rem;
	font-weight: 800;
	color: var(--kccal-orange-dark);
	line-height: 1.2;
}

.kccal_calculator__result-meta {
	margin-top: 6px;
	font-size: 0.85rem;
	color: var(--kccal-muted);
}

.kccal_calculator__result-tier {
	margin-top: 8px;
	font-weight: 700;
	font-size: 1.05rem;
}

.kccal_calculator__table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 18px;
	text-align: left;
}

.kccal_calculator__table th,
.kccal_calculator__table td {
	text-align: left;
	padding: 9px 8px;
	border-bottom: 1px solid var(--kccal-line);
	font-size: 0.88rem;
}

.kccal_calculator__table th {
	color: var(--kccal-muted);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.kccal_calculator__table-row--you,
.kccal_calculator__table tr.kccal_calculator__table-row--you {
	background: #fff4ec;
	font-weight: 700;
}

.kccal_calculator__zone-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	margin-right: 8px;
}

.kccal_calculator__zone-swatch--z1 { background: #9ca3af; }
.kccal_calculator__zone-swatch--z2 { background: #3b82f6; }
.kccal_calculator__zone-swatch--z3 { background: #22c55e; }
.kccal_calculator__zone-swatch--z4 { background: #eab308; }
.kccal_calculator__zone-swatch--z5 { background: #f97316; }
.kccal_calculator__zone-swatch--z6 { background: #ef4444; }
.kccal_calculator__zone-swatch--z7 { background: #7c3aed; }

.kccal_calculator__note {
	font-size: 0.8rem;
	color: var(--kccal-muted);
	margin-top: 18px;
	line-height: 1.5;
	text-align: left;
}

.kccal_calculator__footnote {
	font-size: 0.8rem;
	color: var(--kccal-muted);
	text-align: center;
	margin-top: 8px;
	line-height: 1.5;
}
