.dough-calc { max-width: 1240px; margin: 0 auto; padding: 56px 5% 72px; }
.calc-intro { max-width: 740px; margin-bottom: 24px; }
.calc-intro > p:last-child { margin-bottom: 0; }
.calc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; border-bottom: 1px solid var(--line); }
.dough-calc .calc-tabs { display: flex; width: auto; padding: 0; gap: 6px 20px; }
.calc-tabs button { background: transparent; color: var(--ink); border: 0; border-bottom: 3px solid transparent; padding: 10px 0; min-height: 48px; font: inherit; cursor: pointer; }
.calc-tabs button.active { border-bottom-color: var(--brown); font-weight: 700; }
.calc-toolbar #print { margin-bottom: 8px; cursor: pointer; }
.dough-calc .panel { padding-top: 24px; }
.dough-calc [hidden] { display: none !important; }
.dough-calc .section-heading { margin: 0 0 18px; }
.calc-panel-title { font-size: clamp(25px, 4vw, 32px); }
.recipe-layout, .ferment-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dough-calc .card { background: #fffdf7; border: 1px solid var(--line); border-radius: 6px; padding: clamp(16px, 3vw, 28px); min-width: 0; }
.dough-calc label { display: block; margin-bottom: 8px; font-weight: 700; }
.dough-calc .controls > label:not(:first-child), .dough-calc .label-line { margin-top: 18px; }
.dough-calc input, .dough-calc select { width: 100%; min-height: 44px; border: 1px solid #ad9b88; border-radius: 4px; padding: 8px; color: var(--ink); background: #fff; font: inherit; }
.dough-calc :is(button, input, select, summary, a):focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
.dough-calc .muted, .dough-calc .range-labels, .dough-calc .totals small, .dough-calc .metrics small { color: #685d51; font-size: 14px; line-height: 1.5; }
.dough-calc .stepper, .dough-calc .label-line, .dough-calc .temperature { display: flex; align-items: center; gap: 8px; }
.dough-calc .stepper button { min-height: 44px; border: 1px solid #ad9b88; border-radius: 4px; padding: 0 14px; background: var(--cream); color: var(--ink); font: inherit; cursor: pointer; }
.dough-calc .stepper input { min-width: 0; text-align: center; }
.dough-calc .label-line { justify-content: space-between; }
.dough-calc .label-line label { margin: 0; }
.dough-calc .label-line span { white-space: nowrap; }
.dough-calc #hydration { width: 84px; }
.dough-calc input[type="range"] { accent-color: var(--brown); padding: 0; }
.dough-calc .range-labels { display: flex; justify-content: space-between; }
.dough-calc .text-button { min-height: 44px; color: var(--ink); font: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dough-calc summary { cursor: pointer; padding-block: 10px; }
.dough-calc .card-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dough-calc h3 { font-size: 24px; }
.dough-calc .badge { background: var(--cream); border-radius: 24px; padding: 5px 10px; font-size: 14px; }
.dough-calc table { width: 100%; border-collapse: collapse; }
.dough-calc :is(th, td) { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dough-calc :is(th, td):last-child { text-align: right; }
.dough-calc .totals, .dough-calc .metrics { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 14px; background: var(--cream); margin-top: 16px; }
.dough-calc :is(.totals, .metrics) :is(strong, small) { display: block; }
.dough-calc :is(.totals, .metrics) strong { font-size: 22px; }
.dough-calc .temperature input { min-width: 0; }
.dough-calc .temperature select { width: 76px; flex-shrink: 0; }
.dough-calc .result { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.dough-calc .result > div:not(.cup) { min-width: 0; flex: 1 1 190px; }
.dough-calc .result .big { font: 700 clamp(38px, 7vw, 60px)/1 Signika, sans-serif; margin: 12px 0; }
.dough-calc .result .big small { font-size: .55em; }
.dough-calc .source { margin-top: 20px; }
.dough-calc .source p { font-size: 14px; }
.dough-calc .cup { position: relative; height: 150px; width: 106px; overflow: hidden; border: 2px solid var(--brown); border-top: 0; border-radius: 0 0 15px 15px; background: var(--cream); }
.dough-calc .cup .fill { position: absolute; bottom: 0; width: 100%; background: #dcc7a9; border-top: 2px dashed var(--brown); }
.dough-calc .cup .target { position: absolute; bottom: 85%; width: 100%; border-top: 2px dashed var(--brown); }
.dough-calc .cup span { position: absolute; top: 3px; left: 7px; font-size: 12px; }
.dough-calc #recipeError, .dough-calc #printMessage { color: #963f29; }
.dough-calc dialog { width: min(640px, calc(100% - 24px)); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); color: var(--ink); padding: 20px; }
.dough-calc dialog::backdrop { background: #0008; }
.dough-calc .print-heading, .dough-calc .print-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dough-calc .print-heading { justify-content: space-between; }
.dough-calc .print-heading h2 { font-size: 28px; }
.dough-calc :is(.print-actions, .print-heading) :is(a, button) { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--brown); border-radius: 4px; font: inherit; background: #fffdf7; color: var(--ink); cursor: pointer; }
.dough-calc .print-actions a:not([href]) { display: none; }
.dough-calc #printPreview { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 16px; line-height: 1.6; }
@media (max-width: 800px) {
  .dough-calc { padding-top: 36px; }
  .recipe-layout, .ferment-layout { grid-template-columns: minmax(0, 1fr); }
}
.baking-gear { margin-top: 40px; }
.baking-gear-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.baking-gear-grid img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: contain; margin-bottom: 16px; border-radius: 4px; background: #fff; }
.baking-gear-grid h3 { margin: 0; }
.baking-gear a, .calc-intro a { text-decoration: underline; text-underline-offset: 3px; }
@media print {
  .tools-page > :is(header, footer), .dough-calc :is(.calc-toolbar, .controls, .baking-gear, .calc-intro a, details, dialog), .dough-calc dialog::backdrop { display: none !important; }
  .dough-calc { padding: 0; }
  .recipe-layout, .ferment-layout { display: block; }
  .dough-calc .card { break-inside: avoid; }
}

.dough-calc .result > .ready-estimate { flex: 1 1 100%; border-top: 1px solid var(--line); padding-top: 20px; }
.dough-calc .ready-clock { font-size: 24px; font-weight: 700; margin: 10px 0; }

/* Combined starter quantities. */
.dough-calc .calc-tabs { flex-wrap: wrap; }
.starter-intro { max-width: 760px; }
.starter-bakes { margin-bottom: 24px; }
.starter-bake-row { border-top: 1px solid var(--line); padding: 20px 0; }
.starter-row-total { margin: 10px 0 0; font-weight: 700; color: var(--brown); }
.starter-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.starter-pair > * { min-width: 0; }
.starter-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; background: var(--cream); padding: 18px; margin-top: 18px; }
.starter-summary span, .starter-summary strong { display: block; }
.starter-summary span { font-size: 14px; }
.starter-summary strong { font-family: Signika, sans-serif; font-size: 28px; line-height: 1.3; }
.starter-summary > div:last-child { color: var(--brown); }
.dough-calc #starterDemandError { color: #963f29; }
.starter-allowance { border-top: 1px solid var(--line); padding-top: 12px; }
@media(max-width:800px) { .starter-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width:520px) {
 .starter-pair { grid-template-columns: minmax(0, 1fr); }
 .dough-calc .calc-tabs { gap: 2px 18px; width: 100%; }
 .dough-calc .calc-tabs button { font-size: 16px; }
}
@media print { .starter-allowance { display: none !important; } }

.dough-calc .recipe-topping-title { margin: 28px 0 12px; font-size: 22px; }

.starter-recipe-group { font: 700 23px/1.3 Signika, sans-serif; margin: 26px 0 12px; }
.starter-fixed-fields { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 24px; align-items: center; }
.starter-fixed-fields h4 { font: 700 21px/1.3 Signika, sans-serif; margin: 0 0 6px; }
.starter-fixed-fields p { margin: 0; }
.starter-fixed-fields > * { min-width: 0; }
@media(max-width:520px) { .starter-fixed-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
