/* Fine Teas — tea brewing calculator */

.ft-block--brewing-calculator {
	margin: 2rem 0;
	padding: 1.35rem 1.25rem 1.5rem;
	border-radius: var(--ft-radius-card);
	background: var(--ft-color-surface);
	border: 1px solid var(--ft-color-border);
	max-width: 100%;
}

.ft-calc__title {
	margin: 0 0 0.75rem;
	font-family: var(--ft-font-heading);
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	line-height: 1.25;
	color: var(--ft-color-forest-dark);
}

.ft-calc__intro,
.ft-calc__disclaimer,
.ft-calc__ref-intro,
.ft-calc__ref-outro,
.ft-calc__hint,
.ft-calc__hint-block {
	margin: 0 0 1rem;
	color: var(--ft-color-muted);
	font-size: 0.95rem;
	line-height: 1.55;
}

.ft-calc__disclaimer {
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid var(--ft-color-border);
	font-size: 0.9rem;
}

.ft-calc__form {
	display: grid;
	gap: 1.15rem;
	margin: 1.25rem 0;
}

.ft-calc__field,
.ft-calc__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.ft-calc__label,
.ft-calc__fieldset > legend.ft-calc__label {
	display: block;
	margin: 0 0 0.45rem;
	padding: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ft-color-ink);
}

.ft-calc__hint {
	margin: 0.45rem 0 0;
	font-size: 0.85rem;
}

.ft-calc__hint--volume-warn {
	color: var(--ft-color-forest-dark);
}

.ft-calc__error {
	margin: 0.45rem 0 0;
	font-size: 0.9rem;
	color: var(--ft-color-error);
}

.ft-calc__select,
.ft-calc__input {
	width: 100%;
	min-height: 44px;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--ft-color-border);
	border-radius: var(--ft-radius-control);
	background: var(--ft-color-paper);
	color: var(--ft-color-ink);
	font: inherit;
	font-size: 1rem;
}

.ft-calc__select:focus,
.ft-calc__input:focus,
.ft-calc__segment-option:focus-within,
.ft-calc__diag-btn:focus-visible {
	outline: 2px solid var(--ft-color-forest);
	outline-offset: 2px;
}

.ft-calc__segment {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.5rem;
}

@media (min-width: 480px) {
	.ft-calc__segment {
		grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	}
}

.ft-calc__segment-option {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--ft-color-border);
	border-radius: var(--ft-radius-control);
	background: var(--ft-color-paper);
	cursor: pointer;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 500;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ft-calc__segment-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.ft-calc__segment-option:has(input:checked),
.ft-calc__segment-option.is-selected {
	border-color: var(--ft-color-forest);
	background: var(--ft-color-mist);
	color: var(--ft-color-forest-dark);
	font-weight: 600;
	box-shadow: inset 0 0 0 1px var(--ft-color-forest);
}

.ft-calc__result {
	margin: 0.5rem 0 0;
	padding: 1.15rem 1.2rem;
	border-radius: var(--ft-radius-card);
	background: var(--ft-color-mist);
	border: 1px solid var(--ft-color-border);
}

.ft-calc__result:empty {
	display: none;
}

.ft-calc__summary {
	margin: 0 0 0.85rem;
	font-size: 1rem;
	color: var(--ft-color-ink);
}

.ft-calc__metric {
	margin: 0 0 0.35rem;
	font-family: var(--ft-font-heading);
	font-size: 1.25rem;
	line-height: 1.3;
	color: var(--ft-color-forest-dark);
}

.ft-calc__metric--primary {
	font-size: 1.45rem;
}

.ft-calc__meta {
	font-family: var(--ft-font-body);
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--ft-color-muted);
}

.ft-calc__range {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	color: var(--ft-color-muted);
}

.ft-calc__hint-block {
	margin: 0.85rem 0 0;
}

.ft-calc__article {
	margin: 0.85rem 0 0;
	font-size: 0.95rem;
}

.ft-calc__article a {
	color: var(--ft-color-forest);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.ft-calc__noscript {
	margin: 0;
	color: var(--ft-color-muted);
	font-size: 0.95rem;
}

.ft-calc__diagnostics {
	margin-top: 1.25rem;
	padding: 1rem 1.1rem;
	border: 1px dashed var(--ft-color-border);
	border-radius: var(--ft-radius-card);
	background: var(--ft-color-paper);
}

.ft-calc__diag-title {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ft-color-ink);
}

.ft-calc__diag-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.ft-calc__diag-btn {
	min-height: 44px;
	font-weight: 500;
}

.ft-calc__diag-btn.is-active,
.ft-calc__diag-btn[aria-pressed="true"] {
	border-color: var(--ft-color-forest);
	background: var(--ft-color-mist);
	color: var(--ft-color-forest-dark);
}

.ft-calc__diag-answer {
	margin: 0.85rem 0 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--ft-color-ink);
}

.ft-calc__one-var {
	display: inline-block;
	margin-top: 0.35rem;
	font-weight: 600;
	color: var(--ft-color-forest-dark);
}

.ft-calc__reference {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--ft-color-border);
}

.ft-calc__ref-title {
	margin: 0 0 0.75rem;
	font-family: var(--ft-font-heading);
	font-size: 1.25rem;
	color: var(--ft-color-forest-dark);
}

.ft-calc__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--ft-color-border);
	border-radius: var(--ft-radius-card);
	background: var(--ft-color-surface);
	margin: 1rem 0;
}

.ft-calc__table {
	width: 100%;
	min-width: 36rem;
	border-collapse: collapse;
	font-size: 0.9rem;
	margin: 0;
}

.ft-calc__table th,
.ft-calc__table td {
	padding: 0.7rem 0.85rem;
	border-bottom: 1px solid var(--ft-color-border);
	border-right: 1px solid var(--ft-color-border);
	text-align: left;
	vertical-align: top;
}

.ft-calc__table th:last-child,
.ft-calc__table td:last-child {
	border-right: 0;
}

.ft-calc__table thead th {
	background: var(--ft-color-mist);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--ft-color-muted);
}

.ft-calc__table tbody th {
	font-weight: 600;
	color: var(--ft-color-ink);
	background: var(--ft-color-paper);
}

.ft-calc__table tbody tr:last-child th,
.ft-calc__table tbody tr:last-child td {
	border-bottom: 0;
}

.ft-calc__table a {
	color: var(--ft-color-forest);
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.ft-block--brewing-calculator-compact {
	padding: 1.1rem 1rem 1.25rem;
}

.ft-block--brewing-calculator-compact .ft-calc__title {
	font-size: 1.35rem;
}

/* Gongfu infusion timer */
.ft-calc__timer-cta-wrap {
	margin: 1rem 0 0;
}

.ft-calc__timer-open {
	width: 100%;
	min-height: 48px;
}

.ft-calc__timer-notice {
	margin: 0.85rem 0 0;
	padding: 0.65rem 0.75rem;
	border-radius: var(--ft-radius-control);
	background: color-mix(in srgb, var(--ft-color-terracotta) 10%, var(--ft-color-paper));
	border: 1px solid color-mix(in srgb, var(--ft-color-terracotta) 30%, var(--ft-color-border));
	color: var(--ft-color-ink);
	font-size: 0.9rem;
}

.ft-calc__timer-panel {
	margin-top: 1rem;
}

.ft-calc__timer-panel[hidden] {
	display: none !important;
}

.ft-calc__timer {
	padding: 1.1rem 1rem 1.15rem;
	border-radius: var(--ft-radius-card);
	border: 1px solid var(--ft-color-border);
	background: var(--ft-color-paper);
}

.ft-calc__timer-panel.is-finished .ft-calc__timer {
	border-color: var(--ft-color-forest);
	background: var(--ft-color-mist);
}

.ft-calc__timer-progress {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.65rem 0.85rem;
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}

.ft-calc__timer-dot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	min-width: 1.75rem;
	font-size: 1.1rem;
	line-height: 1;
	color: var(--ft-color-muted);
}

.ft-calc__timer-dot--done {
	color: var(--ft-color-forest-dark);
	font-weight: 700;
}

.ft-calc__timer-dot--current {
	color: var(--ft-color-terracotta);
	font-weight: 700;
}

.ft-calc__timer-dot-num {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ft-color-muted);
}

.ft-calc__timer-title {
	margin: 0 0 0.35rem;
	text-align: center;
	font-size: 1rem;
	font-weight: 600;
	color: var(--ft-color-ink);
}

.ft-calc__timer-clock {
	margin: 0.25rem 0;
	text-align: center;
	font-family: var(--ft-font-heading);
	font-size: clamp(2.5rem, 12vw, 4rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: 0.02em;
	color: var(--ft-color-forest-dark);
	font-variant-numeric: tabular-nums;
}

.ft-calc__timer-clock--done {
	color: var(--ft-color-leaf);
}

.ft-calc__timer-caption,
.ft-calc__timer-sub,
.ft-calc__timer-status {
	margin: 0.35rem 0 0.75rem;
	text-align: center;
	font-size: 0.95rem;
	color: var(--ft-color-muted);
}

.ft-calc__timer-status {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--ft-color-forest-dark);
}

.ft-calc__timer-pour {
	margin: 0.5rem 0 1rem;
	text-align: center;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--ft-color-terracotta);
}

.ft-calc__timer-adjust {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin: 0 0 0.85rem;
}

.ft-calc__timer-adjust-btn {
	min-width: 5.5rem;
}

.ft-calc__timer-actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ft-calc__timer-actions .ft-btn {
	width: 100%;
	min-height: 48px;
}

.ft-calc__timer-start {
	min-height: 52px;
	font-size: 1.05rem;
}

.ft-calc__timer-sound {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	margin: 0.85rem 0 0;
	font-size: 0.9rem;
	color: var(--ft-color-muted);
	cursor: pointer;
}

.ft-calc__timer-sound input {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--ft-color-forest);
}

.ft-calc__timer-actuals {
	margin: 0.35rem auto 1rem;
	padding: 0;
	max-width: 16rem;
	list-style: none;
	font-size: 0.95rem;
	color: var(--ft-color-ink);
}

.ft-calc__timer-actuals li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.25rem 0;
	border-bottom: 1px solid var(--ft-color-border);
}

.ft-calc__timer-actuals li:last-child {
	border-bottom: 0;
}

@media (min-width: 480px) {
	.ft-calc__timer-actions {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
	}

	.ft-calc__timer-actions .ft-btn {
		width: auto;
		min-width: 9rem;
		flex: 1 1 auto;
	}

	.ft-calc__timer-open {
		width: auto;
	}
}

@media (max-width: 359px) {
	.ft-block--brewing-calculator {
		padding: 1rem 0.85rem 1.15rem;
	}

	.ft-calc__metric {
		font-size: 1.15rem;
	}

	.ft-calc__metric--primary {
		font-size: 1.3rem;
	}

	.ft-calc__timer-clock {
		font-size: clamp(2.25rem, 14vw, 3rem);
	}
}

.ft-calc__caffeine-link {
	margin: 0.5rem 0 0;
	font-size: 0.95rem;
}
.ft-calc__caffeine-link a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}
