:root {
  --bg: #faf3ea;
  --surface: #fffdf9;
  --surface-2: #f5eadb;
  --ink: #2b2118;
  --muted: #7b6a5b;
  --line: #e8d9c6;
  --tomato: #d1452c;
  --tomato-dark: #b33821;
  --tomato-soft: #fff3ef;
  --basil: #4a7a55;
  --blue: #3f6f96;
  --amber: #bf842f;
  --shadow: 0 12px 32px rgba(75, 48, 22, 0.07);
  --radius: 18px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 50% -140px, #fff7ea 0%, rgba(255, 247, 234, 0) 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--tomato-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex: none;
  filter: drop-shadow(0 3px 5px rgba(120, 65, 30, 0.16));
}

.brand-text h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-text p {
  max-width: 62ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.settings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  flex-wrap: wrap;
}

.settings-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(82, 50, 25, 0.08);
}

.settings-toggle:hover {
  background: var(--surface-2);
}

.settings-toggle:focus-visible {
  outline: 2px solid rgba(63, 111, 150, 0.5);
  outline-offset: 1px;
}

.settings-toggle svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.setting {
  display: flex;
  align-items: center;
  gap: 7px;
}

.setting-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 249, 0.75);
}

.segmented button {
  min-width: 38px;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.segmented button[aria-pressed="true"] {
  color: #fff;
  background: var(--tomato);
  box-shadow: 0 1px 3px rgba(82, 50, 25, 0.24);
}

.segmented button:focus-visible {
  outline: 2px solid rgba(63, 111, 150, 0.5);
  outline-offset: 1px;
}

/* Layout ------------------------------------------------------------------ */

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 24px 56px;
}

.progress {
  margin-bottom: 16px;
}

.progress ol {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.progress li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 3px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.progress li span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.progress li em {
  font-style: normal;
}

.progress li.active {
  color: var(--tomato-dark);
  border-color: var(--tomato);
}

.progress li.active span {
  background: var(--tomato);
  color: #fff;
}

.progress li.done {
  color: var(--basil);
  border-color: #b6d2bc;
}

.progress li.done span {
  background: #dcecdf;
  color: var(--basil);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.step h2,
.result-head h2 {
  font-size: 1.55rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 710;
}

.step h2:focus,
.result-head h2:focus {
  outline: none;
}

.helper {
  max-width: 62ch;
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 0.93rem;
}

h3 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4 {
  margin: 18px 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Step 1 ------------------------------------------------------------------ */

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 650;
}

.field > span {
  color: var(--muted);
}

input,
select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}

input:hover,
select:hover {
  border-color: #d9c3ab;
}

input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(209, 69, 44, 0.15);
  border-color: var(--tomato);
}

.time-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

.time-input select {
  padding-left: 8px;
  padding-right: 6px;
  min-width: 58px;
}

.time-input .colon {
  font-weight: 700;
  color: var(--muted);
}

#eat-meridiem {
  min-width: 64px;
}

.date-field {
  position: relative;
}

.date-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
}

.date-trigger:hover {
  border-color: #d9c3ab;
}

.date-trigger:focus-visible {
  outline: 3px solid rgba(209, 69, 44, 0.15);
  border-color: var(--tomato);
}

.calendar-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}

.date-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.date-chevron {
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.calendar-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 280px;
  max-width: 340px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(75, 48, 22, 0.18);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.calendar-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.cal-nav {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
}

.cal-nav:hover {
  background: #efe0cd;
}

.cal-nav:focus-visible,
.cal-day:focus-visible,
.text-btn:focus-visible {
  outline: 3px solid rgba(63, 111, 150, 0.4);
  outline-offset: 2px;
}

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

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-align: center;
}

.calendar-grid {
  min-height: 190px;
}

.cal-empty {
  min-height: 34px;
}

.cal-day {
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cal-day:hover:not(:disabled) {
  background: var(--surface-2);
}

.cal-day.is-today {
  border-color: #d8c1a7;
}

.cal-day.is-selected {
  background: var(--tomato);
  border-color: var(--tomato);
  color: #fff;
}

.cal-day:disabled {
  color: #c9b9a8;
  cursor: not-allowed;
}

.calendar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.calendar-selected {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--tomato-dark);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.step-note {
  margin-top: 14px;
}

.step2-cold-label {
  margin-top: 22px;
}

#fast-options {
  margin-top: 8px;
}

.error {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 10px;
  background: #fbe9e3;
  color: #8f2f1d;
  font-size: 0.86rem;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.81rem;
  font-weight: 600;
  color: #5f4c3a;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: #fff;
  border-color: #d8c1a7;
}

.chip:focus-visible {
  outline: 3px solid rgba(63, 111, 150, 0.35);
  outline-offset: 2px;
}

/* Option cards ------------------------------------------------------------ */

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
}

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

.option {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 92px;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.option:hover {
  border-color: #d7bfa4;
  transform: translateY(-1px);
}

.option-input:checked + .option {
  border-color: var(--tomato);
  background: var(--tomato-soft);
  box-shadow: inset 0 0 0 1px var(--tomato);
}

.option-input:focus-visible + .option {
  outline: 3px solid rgba(63, 111, 150, 0.4);
  outline-offset: 2px;
}

.option-input:disabled + .option {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}

.option-input:disabled + .option:hover {
  transform: none;
  border-color: var(--line);
}

.option-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  line-height: 1.3;
}

.option-desc {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 450;
}

.option-meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.76rem;
}

.badge {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 650;
  line-height: 1.35;
}

.badge.ok {
  color: #38613f;
  background: #e7f1e9;
}

.badge.warn {
  color: #8d3a25;
  background: #fbe8e1;
}

.size-option {
  min-height: 108px;
}

.size-weight {
  font-size: 1.3rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Step 4 ------------------------------------------------------------------ */

.custom-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.custom-row .field {
  flex: 1;
}

.custom-unit {
  padding-bottom: 12px;
  font-weight: 700;
  color: var(--muted);
}

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.count-row .field-label {
  margin: 0;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.stepper button {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--surface-2);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
}

.stepper button:hover {
  background: #efe0cd;
}

.stepper button:focus-visible {
  outline: 3px solid rgba(63, 111, 150, 0.4);
  outline-offset: -3px;
}

.stepper input {
  width: 62px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

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

.count-row .stepper input:focus-visible {
  outline: none;
  background: var(--tomato-soft);
}

.size-summary {
  margin-top: 18px;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.9rem;
  font-weight: 650;
}

/* Actions ----------------------------------------------------------------- */

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.actions .btn[data-back] {
  margin-right: auto;
}

.btn {
  min-height: 44px;
  padding: 0 19px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  text-align: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.btn:hover {
  border-color: #d8c2a8;
  background: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(63, 111, 150, 0.4);
  outline-offset: 2px;
}

.btn.primary {
  border-color: var(--tomato);
  background: var(--tomato);
  color: #fff;
}

.btn.primary:hover {
  background: var(--tomato-dark);
  border-color: var(--tomato-dark);
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.primary:disabled,
.btn.primary:disabled:hover {
  background: var(--tomato);
  border-color: var(--tomato);
}

.actions-spacer {
  flex: 1;
}

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

.result-head {
  background: linear-gradient(135deg, #fff8f0 0%, var(--surface) 65%);
  margin-bottom: 16px;
}

.serve-time {
  margin-top: 8px;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--tomato-dark);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.meta-chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #5c4937;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.start-line {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.warnings {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 15px;
  border: 1px solid #efd4b4;
  border-radius: 13px;
  background: #fdf2e4;
  color: #704222;
}

.warning p {
  font-size: 0.87rem;
  line-height: 1.5;
}

.warning-icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.impossible-card {
  margin-bottom: 16px;
  border-color: #efd4b4;
  background: #fdf6ed;
}

.impossible-card p {
  margin-top: 8px;
  color: #704222;
  font-size: 0.92rem;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.result-grid .card {
  margin: 0;
}

.timeline-card {
  margin-top: 16px;
}

.notes-card {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Ingredients ------------------------------------------------------------ */

.ingredient-card h3 {
  margin-bottom: 2px;
}

.yeast-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.yeast-picker .field-label {
  margin: 0;
}

.yeast-picker .segmented button {
  min-height: 32px;
  font-size: 0.74rem;
}

.ingredient-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control-field .field-label {
  margin: 0;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.stepper-btn {
  width: 34px;
  height: 36px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.stepper-btn:hover {
  background: #efe0cd;
}

.stepper-btn:focus-visible,
.stepper input:focus-visible,
.hydration-control input:focus-visible {
  outline: 3px solid rgba(63, 111, 150, 0.4);
  outline-offset: -2px;
}

.ingredient-controls .stepper input:focus-visible {
  outline: none;
  background: #fff;
}

.stepper input {
  width: 52px;
  height: 36px;
  padding: 0 4px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

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

.hydration-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hydration-stepper input {
  width: 46px;
  padding: 0 2px;
  text-align: center;
}

.hydration-stepper .unit-suffix {
  padding: 0 2px;
  font-size: 0.8rem;
}

.unit-suffix {
  color: var(--muted);
  font-weight: 700;
}

.hydration-reset {
  align-self: flex-start;
  margin-top: 2px;
  white-space: nowrap;
}

.hydration-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.info-tip:hover,
.info-tip:focus-visible {
  background: #efe0cd;
  color: var(--ink);
}

.info-tip:focus-visible {
  outline: 2px solid rgba(63, 111, 150, 0.4);
  outline-offset: 2px;
}

.info-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(280px, 72vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(75, 48, 22, 0.18);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
}

.info-tip:hover::after,
.info-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ingredients {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

.ingredients th,
.ingredients td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  text-align: left;
  vertical-align: top;
}

.ingredients thead th {
  padding-top: 4px;
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.ingredients tbody th {
  font-weight: 550;
}

.ingredients td {
  text-align: right;
  white-space: nowrap;
  padding-left: 12px;
}

.ingredients td.pct {
  width: 58px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ingredients .num {
  text-align: right;
}

.ingredients tr:last-child th,
.ingredients tr:last-child td {
  border-bottom: 0;
}

.ingredient-row.preferred th,
.ingredient-row.preferred td {
  color: var(--tomato-dark);
  font-weight: 700;
}

.selected-mark {
  display: inline-block;
  margin-left: 3px;
  color: var(--tomato);
  font-size: 0.7rem;
  vertical-align: 1px;
}

.ingredient-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 450;
  white-space: normal;
}

#ingredient-note {
  margin-top: 14px;
}

/* Poolish ----------------------------------------------------------------- */

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}

.switch-row input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--tomato);
}

.switch-row input:disabled {
  cursor: not-allowed;
}

.switch-row input:disabled + span {
  color: var(--muted);
}

.notice {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--surface-2);
  color: #6b5643;
  font-size: 0.82rem;
  line-height: 1.45;
}

.notice.warn {
  border: 1px solid #efd4b4;
  background: #fdf2e4;
  color: #704222;
}

.step2-note {
  margin-top: 14px;
}

.pill {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e7f1e9;
  color: #38613f;
  font-size: 0.73rem;
  font-weight: 650;
}

.poolish-tune {
  margin-top: 16px;
  padding-top: 14px;
  margin-bottom: 16px;
  border-top: 1px dashed var(--line);
}

.tune-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tune-head .field-label {
  margin: 0;
}

.tune-mode {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.poolish-start-line {
  margin-top: 8px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.poolish-ready-line,
.poolish-length-line {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.poolish-tune input[type="range"] {
  width: 100%;
  height: 32px;
  margin: 10px 0 0;
  accent-color: var(--tomato);
  cursor: pointer;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: -6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.guide {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: #5f4c3a;
  font-size: 0.8rem;
  line-height: 1.45;
}

.guide.guide-long {
  border-left-color: var(--amber);
  background: #fdf2e4;
  color: #704222;
}

.guide.guide-verylong {
  border-left-color: var(--tomato);
  background: #fbe8e1;
  color: #7a2f1d;
}

.mini-list {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.mini-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.mini-list dt {
  color: var(--muted);
}

.mini-list dd {
  font-weight: 650;
  text-align: right;
}

.mini-list > div:last-child {
  border-bottom: 0;
}

/* Timeline ---------------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.t-day {
  position: relative;
  z-index: 1;
  margin: 22px 0 6px;
  padding: 0 0 2px 72px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.t-day:first-child {
  margin-top: 0;
}

.t-event {
  display: grid;
  grid-template-columns: 64px 20px minmax(0, 1fr);
  gap: 0 14px;
  padding: 4px 0 16px;
}

.t-time {
  padding-top: 1px;
  text-align: right;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.t-marker {
  position: relative;
  display: flex;
  justify-content: center;
}

.t-marker::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: -16px;
  width: 2px;
  background: var(--line);
}

.t-event:last-child .t-marker::before {
  display: none;
}

.t-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: 0 0 0 4px var(--surface);
}

.t-event.t-rest .t-dot {
  background: var(--amber);
}

.t-event.t-cold .t-dot {
  background: var(--blue);
}

.t-event.t-warm .t-dot {
  background: var(--basil);
}

.t-event.t-oven .t-dot {
  background: #8a6b52;
}

.t-event.t-bake .t-dot {
  background: #8d3a1f;
}

.t-event. .t-dot {
  background: var(--ink);
}

.t-body {
  min-width: 0;
}

.t-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.t-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
}

.t-dur {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #6b5643;
  font-size: 0.68rem;
  font-weight: 650;
  white-space: nowrap;
}

.t-parallel {
  padding: 2px 7px;
  border-radius: 999px;
  background: #e7f1e9;
  color: #38613f;
  font-size: 0.64rem;
  font-weight: 650;
  text-transform: lowercase;
}

.t-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Notes ------------------------------------------------------------------- */

.notes-card ul {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-left: 19px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.notes-card li::marker {
  color: #c1a582;
}

/* Misc -------------------------------------------------------------------- */

.result-actions {
  margin-top: 18px;
}

.copy-status {
  min-height: 1.4em;
  margin-top: 8px;
  color: var(--basil);
  font-size: 0.82rem;
  font-weight: 600;
}

footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

footer p + p {
  margin-top: 3px;
}

/* Responsive -------------------------------------------------------------- */

@media (min-width: 560px) {
  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  #fast-options,
  #cold-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #size-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .result-grid .poolish-card {
    order: 2;
  }
}

@media (max-width: 700px) {
  .settings-toggle {
    display: inline-flex;
  }

  .settings {
    display: none;
    width: 100%;
    max-width: 360px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .settings.is-open {
    display: flex;
  }

  .setting {
    width: 100%;
    max-width: 360px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .setting-label {
    text-align: center;
  }

  .setting .segmented {
    width: 100%;
  }

  .setting .segmented button {
    flex: 1;
  }
}

@media (max-width: 559px) {
  .site-header {
    padding: 22px 18px 14px;
  }

  main {
    padding: 4px 16px 44px;
  }

  footer {
    padding: 0 18px 32px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-text h1 {
    font-size: 1.4rem;
  }

  .brand-text p {
    font-size: 0.9rem;
  }

  .settings {
    width: 100%;
  }

  .calendar-popover {
    min-width: 0;
    max-width: none;
  }

  .card {
    padding: 21px 18px;
    border-radius: 15px;
  }

  .step h2,
  .result-head h2 {
    font-size: 1.3rem;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .progress {
    margin-bottom: 12px;
  }

  .progress li {
    gap: 5px;
    font-size: 0.68rem;
    padding-bottom: 7px;
  }

  .progress li span {
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  .actions .btn.primary,
  .actions .btn[data-back] {
    flex: 1 1 100%;
  }

  .actions .btn[data-back] {
    order: 2;
  }

  .actions-spacer {
    display: none;
  }

  .result-actions .btn {
    flex: 1 1 calc(50% - 10px);
  }

  .t-event {
    grid-template-columns: 58px 18px minmax(0, 1fr);
    gap: 0 10px;
  }

  .t-time {
    font-size: 0.76rem;
  }

  .t-day {
    padding-left: 68px;
  }

  .serve-time {
    font-size: 1.08rem;
  }

  .size-summary {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Print ------------------------------------------------------------------- */

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-header,
  .progress,
  .settings,
  .settings-toggle,
  .actions,
  .copy-status,
  footer,
  .skip-link,
  .yeast-picker,
  .ingredient-controls,
  .switch-row,
  .calendar-popover,
  .poolish-tune input[type="range"],
  .poolish-tune .text-btn,
  .tune-mode {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .card {
    border: 1px solid #bbb;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    page-break-inside: avoid;
  }

  .result-head {
    background: #fff;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-card,
  .notes-card,
  .result-head {
    margin-top: 10px;
  }

  .t-event {
    page-break-inside: avoid;
  }

  .t-day {
    background: #fff;
  }

  .t-marker::before {
    background: #bbb;
  }

  .t-dot {
    box-shadow: none;
    border: 1px solid #333;
  }

  .meta-chip,
  .t-dur,
  .pill,
  .badge {
    border: 1px solid #bbb;
    background: #fff;
    color: #000;
  }
}