/* FFF Meat Cooking Time Calculator v1.0.0 — scoped to .fffmc / .fffmc-ref */
.fffmc, .fffmc-ref {
	--m-ink: #263238;
	--m-muted: #5b6a66;
	--m-sage: #4f6f57;
	--m-sage-soft: #e7eee6;
	--m-butter: #f2c94c;
	--m-ember: #b4552f;
	--m-wash: #f6f7f2;
	--m-line: #dadfd6;
	--m-radius: 10px;
	color: var(--m-ink);
	box-sizing: border-box;
}
.fffmc *, .fffmc *::before, .fffmc *::after { box-sizing: inherit; }
.fffmc {
	margin: 2em 0; padding: clamp(16px, 3vw, 28px);
	background: var(--m-wash); border: 1px solid var(--m-line); border-radius: 14px;
	font-size: 17px; line-height: 1.45;
}
.fffmc [hidden] { display: none !important; }
.fffmc .fffmc-title { margin: 0 0 .75em; font-size: 1.5em; line-height: 1.2; }

/* Tabs */
.fffmc .fffmc-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 0 18px; border-bottom: 2px solid var(--m-line); }
.fffmc .fffmc-tabs::-webkit-scrollbar { display: none; }
.fffmc .fffmc-tab {
	flex: 0 0 auto; appearance: none; background: none; border: 0; cursor: pointer; margin-bottom: -2px;
	padding: 10px 14px; font: inherit; font-size: .92em; font-weight: 600; color: var(--m-muted);
	border-bottom: 4px solid transparent; border-radius: 6px 6px 0 0;
}
.fffmc .fffmc-tab:hover { color: var(--m-ink); }
.fffmc .fffmc-tab[aria-selected="true"] { color: var(--m-ink); border-bottom-color: var(--m-sage); }

/* Top row */
.fffmc .fffmc-toprow { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.fffmc .fffmc-lead { margin: 0; color: var(--m-muted); font-size: .95em; max-width: 52ch; }
.fffmc .fffmc-units { display: inline-flex; flex: 0 0 auto; border: 1.5px solid var(--m-line); border-radius: 999px; background: #fff; padding: 2px; }
.fffmc .fffmc-seg { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: .82em; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--m-muted); white-space: nowrap; }
.fffmc .fffmc-seg[aria-pressed="true"] { background: var(--m-sage); color: #fff; }

/* Meat categories */
.fffmc .fffmc-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fffmc .fffmc-cat {
	appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: .95em;
	padding: 8px 16px; min-height: 42px; border-radius: 999px; background: #fff; color: var(--m-ink); border: 1.5px solid var(--m-line);
}
.fffmc .fffmc-cat:hover { border-color: var(--m-sage); }
.fffmc .fffmc-cat[aria-checked="true"] { background: var(--m-ink); border-color: var(--m-ink); color: #fff; }

/* Fields */
.fffmc .fffmc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.fffmc .fffmc-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fffmc .fffmc-field-wide { grid-column: 1 / -1; }
.fffmc label { font-size: .85em; font-weight: 600; color: var(--m-muted); margin: 0; }
.fffmc .fffmc-input {
	width: 100%; min-height: 46px; margin: 0; padding: 10px 12px; font: inherit; font-size: 1em; color: var(--m-ink);
	background: #fff; border: 1.5px solid var(--m-line); border-radius: var(--m-radius); box-shadow: none;
}
.fffmc .fffmc-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.fffmc .fffmc-input:focus { outline: none; border-color: var(--m-sage); box-shadow: 0 0 0 3px rgba(79, 111, 87, .22); }
.fffmc .fffmc-input.is-invalid { border-color: var(--m-ember); }
.fffmc .fffmc-with-suffix { position: relative; }
.fffmc .fffmc-with-suffix .fffmc-input { padding-right: 46px; }
.fffmc .fffmc-suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--m-muted); font-weight: 600; pointer-events: none; }
.fffmc .fffmc-check { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; background: #fff; border: 1.5px solid var(--m-line); border-radius: var(--m-radius); font-size: 1em; color: var(--m-ink); font-weight: 600; cursor: pointer; }
.fffmc .fffmc-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--m-sage); }
.fffmc .fffmc-piece-note { margin: 12px 0 0; font-size: .9em; color: var(--m-muted); }

/* Result */
.fffmc .fffmc-result { margin-top: 22px; padding: 20px; background: #fff; border: 1.5px solid var(--m-line); border-radius: var(--m-radius); }
.fffmc .fffmc-headline { border-left: 6px solid var(--m-butter); padding-left: 14px; margin-bottom: 18px; }
.fffmc .fffmc-kicker { margin: 0 0 4px; color: var(--m-muted); font-weight: 600; font-size: .92em; }
.fffmc .fffmc-big { margin: 0; font-size: clamp(1.35em, 4.2vw, 1.9em); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fffmc .fffmc-empty { margin: 0; color: var(--m-muted); }
.fffmc .fffmc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.fffmc .fffmc-stat { background: var(--m-wash); border-radius: 8px; padding: 10px 12px; margin: 0; }
.fffmc .fffmc-stat dt { font-size: .8em; font-weight: 600; color: var(--m-muted); margin: 0; }
.fffmc .fffmc-stat dd { margin: 2px 0 0; font-size: 1.08em; font-weight: 700; font-variant-numeric: tabular-nums; }
.fffmc .fffmc-stat-sub { display: block; font-size: .78em; color: var(--m-muted); margin-top: 2px; }
.fffmc .fffmc-thermo { margin: 0 0 12px; font-size: .95em; }
.fffmc .fffmc-warn { margin: 0 0 12px; padding: 10px 14px 10px 32px; background: #fbefe9; border-radius: 8px; color: #6e2f17; font-size: .9em; }
.fffmc .fffmc-warn li { margin: 2px 0; }
.fffmc .fffmc-late { margin: 0 0 12px; padding: 10px 14px; background: #fbefe9; border-radius: 8px; color: #6e2f17; font-size: .92em; }
.fffmc .fffmc-callout { margin: 0 0 14px; padding: 10px 14px; background: var(--m-sage-soft); border-radius: 8px; font-size: .95em; }
.fffmc .fffmc-subhead { margin: 20px 0 10px; font-size: 1.1em; }
.fffmc .fffmc-tips { margin: 0 0 12px; padding-left: 20px; font-size: .95em; }
.fffmc .fffmc-tips li { margin: 4px 0; }
.fffmc .fffmc-note { margin: 12px 0 0; font-size: .86em; color: var(--m-muted); }

/* Timeline */
.fffmc .fffmc-timeline { list-style: none; margin: 0 0 8px; padding: 0; position: relative; }
.fffmc .fffmc-timeline li { display: grid; grid-template-columns: minmax(118px, auto) 1fr; gap: 14px; position: relative; padding: 0 0 14px 22px; margin: 0; }
.fffmc .fffmc-timeline li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--m-sage); }
.fffmc .fffmc-timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: -4px; width: 2px; background: var(--m-line); }
.fffmc .fffmc-timeline li:last-child::after { display: none; }
.fffmc .fffmc-timeline li.is-in::before, .fffmc .fffmc-timeline li.is-serve::before { background: var(--m-butter); border-color: #c99b17; }
.fffmc .fffmc-timeline li.is-out::before { background: var(--m-ember); border-color: var(--m-ember); }
.fffmc .fffmc-timeline time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fffmc .fffmc-step { display: block; font-weight: 600; }
.fffmc .fffmc-step-detail { display: block; font-size: .88em; color: var(--m-muted); }

/* Actions */
.fffmc .fffmc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px; }
.fffmc .fffmc-btn { appearance: none; cursor: pointer; font: inherit; font-weight: 600; min-height: 44px; padding: 10px 18px; background: var(--m-sage); color: #fff; border: 0; border-radius: var(--m-radius); }
.fffmc .fffmc-btn:hover { filter: brightness(1.08); }
.fffmc .fffmc-btn-quiet { appearance: none; background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: .92em; font-weight: 600; color: var(--m-sage); text-decoration: underline; text-underline-offset: 3px; }

/* Tables */
.fffmc .fffmc-scroll, .fffmc-ref .fffmc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fffmc .fffmc-table, .fffmc-ref .fffmc-table { width: 100%; border-collapse: collapse; margin: 8px 0 0; background: #fff; font-size: .95em; font-variant-numeric: tabular-nums; }
.fffmc .fffmc-table th, .fffmc .fffmc-table td, .fffmc-ref .fffmc-table th, .fffmc-ref .fffmc-table td { padding: 8px 12px; border-bottom: 1px solid var(--m-line); text-align: left; vertical-align: top; }
.fffmc .fffmc-table thead th, .fffmc-ref .fffmc-table thead th { background: var(--m-sage-soft); font-size: .88em; white-space: nowrap; }
.fffmc .fffmc-table tbody th, .fffmc-ref .fffmc-table tbody th { font-weight: 600; }
.fffmc-ref { margin: 2em 0; }
.fffmc-ref h3 { margin-top: 1.6em; }

.fffmc button:focus-visible, .fffmc input[type="checkbox"]:focus-visible { outline: 3px solid var(--m-sage); outline-offset: 2px; }

@media (max-width: 680px) {
	.fffmc { font-size: 16px; }
	.fffmc .fffmc-toprow { flex-direction: column; gap: 10px; }
	.fffmc .fffmc-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.fffmc .fffmc-result { padding: 16px; }
	.fffmc .fffmc-timeline li { grid-template-columns: 1fr; gap: 0; }
	.fffmc .fffmc-cat { padding: 7px 13px; }
}

@media print {
	html.fffmc-printing body * { visibility: hidden !important; }
	html.fffmc-printing .fffmc-print-target, html.fffmc-printing .fffmc-print-target * { visibility: visible !important; }
	html.fffmc-printing .fffmc-print-target { position: absolute; top: 0; left: 0; width: 100%; border: 0; }
	html.fffmc-printing .fffmc-actions { display: none !important; }
}
