:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --soft: #f5f5f3;
  --text: #59402d;
  --muted: #59677d;
  --border: #dadde2;
  --rule: #ececed;
  --accent: #dda83d;
  --accent-ink: #785316;
  --accent-bg: #f8edd6;
  --selected: #586980;
  --on-selected: #fff;
  --warm: #8d4a12;
  --warm-bg: #fbefe1;
  --cold: #0b6977;
  --cold-bg: #e5f2f4;
  --shadow: 0 1px 2px #382a1b06, 0 3px 12px #382a1b04;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #1d1c1a; --surface: #272522; --soft: #302e2a; --text: #f4e4d4; --muted: #b5becb;
  --border: #52504d; --rule: #3d3a36; --accent: #e6b452; --accent-ink: #f2cc81; --accent-bg: #47351b;
  --selected: #52647b; --on-selected: #fff; --warm: #ffc28a; --warm-bg: #422e21; --cold: #83d8e2;
  --cold-bg: #23393f; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme=system] {
    color-scheme: dark;
    --bg: #1d1c1a; --surface: #272522; --soft: #302e2a; --text: #f4e4d4; --muted: #b5becb;
    --border: #52504d; --rule: #3d3a36; --accent: #e6b452; --accent-ink: #f2cc81; --accent-bg: #47351b;
    --selected: #52647b; --on-selected: #fff; --warm: #ffc28a; --warm-bg: #422e21; --cold: #83d8e2;
    --cold-bg: #23393f; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button {
  min-height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px;
  background: var(--surface); transition: background .12s ease;
}
button:hover:not(:disabled) { background: var(--soft); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--selected); outline-offset: 3px; }
input:not([type=range], [type=checkbox]), select, textarea {
  min-width: 0; width: 100%; min-height: 42px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--soft); font-variant-numeric: tabular-nums;
}
input[type=number] { appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 730; letter-spacing: -.55px; }
h2 { font-size: 15px; font-weight: 720; }
h3 { font-size: 13px; font-weight: 720; }
p { color: var(--muted); }
svg { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.app-bar { margin: auto; max-width: 1380px; padding: max(8px, env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; gap: 15px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 770; letter-spacing: -.55px; }
.brand-mark, .recipe-icon { display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.primary-nav {
  position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--border); padding: 4px max(3px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(3px, env(safe-area-inset-left));
}
.primary-nav a { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; min-height: 49px; color: var(--muted); font-size: 10px; font-weight: 560; white-space: nowrap; }
.primary-nav [aria-current] { color: var(--accent-ink); font-weight: 730; }
main { max-width: 1380px; margin: auto; padding: 12px 12px calc(75px + env(safe-area-inset-bottom)); }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.segmented { display: flex; align-items: center; min-width: 0; padding: 3px; border-radius: 9px; background: var(--soft); border: 1px solid var(--rule); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; background: transparent; border: 0; border-radius: 6px; font-size: 12px; color: var(--muted); padding-inline: 8px; white-space: nowrap; }
.segmented button[aria-pressed=true] { background: var(--selected); color: var(--on-selected); box-shadow: var(--shadow); }
.category { background: var(--surface); border-color: var(--border); }
.mobile-tabs { display: flex; gap: 14px; padding-inline: 3px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.mobile-tabs button { position: relative; min-height: 38px; padding: 0 4px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 620; }
.mobile-tabs button[aria-pressed=true] { color: var(--text); }
.mobile-tabs button[aria-pressed=true]::after { content: ''; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--accent); border-radius: 2px; }
#formula, #results-panel, #planner-panel { min-width: 0; }
.workspace[data-view=calcular][data-panel=results] #formula,
.workspace[data-view=calcular][data-panel=config] #results-panel,
.workspace[data-view=calcular] #planner-panel,
.workspace[data-view=fermentacion] :is(.workspace-heading, .mobile-tabs, #formula, #results-panel) { display: none; }
.card { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 9px; }
.card > h2, .card-heading { margin-bottom: 8px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-heading select { min-height: 37px; width: auto; max-width: 50%; font-size: 12px; }
.recipe-card { padding: 0; }
.reset-recipe { display: grid; place-items: center; width: 37px; min-height: 42px; padding: 0; color: var(--muted); border-color: transparent; }
.recipe-heading { display: flex; gap: 10px; align-items: center; padding: 10px 10px 9px 13px; }
.recipe-icon { width: 44px; height: 44px; border-radius: 12px; }
.recipe-identity { flex: 1; min-width: 0; position: relative; }
.recipe-identity::after { content: ''; pointer-events: none; position: absolute; top: 10px; right: 5px; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
#recipe { appearance: none; background: transparent; border: 0; border-radius: 4px; margin-left: -3px; width: 100%; min-height: 28px; padding: 0 14px 0 2px; font-size: 15px; font-weight: 720; text-overflow: ellipsis; }
.recipe-identity:has(#recipe:focus-visible) { outline: 2px solid var(--selected); outline-offset: 3px; border-radius: 4px; }
.recipe-meta, .recipe-metrics { display: flex; align-items: center; color: var(--muted); gap: 8px; font-size: 12px; }
.badge { color: var(--accent-ink); background: var(--accent-bg); border-radius: 5px; padding: 2px 6px; font-size: 11px; white-space: nowrap; }
.recipe-metrics { padding: 0 12px; border-top: 1px solid var(--rule); gap: 13px; min-height: 37px; }
.recipe-metrics > span { display: flex; gap: 4px; align-items: center; }
.recipe-metrics > span:first-child { color: var(--cold); }
.recipe-metrics > span:nth-child(2) { color: var(--warm); }
.text-button { margin-left: auto; min-height: 36px; border: 0; padding-inline: 5px; font-size: 12px; color: var(--muted); }
label { display: grid; gap: 4px; color: var(--muted); min-width: 0; font-size: 12px; }
label > input, label > select { color: var(--text); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 8px; }
.fields:not(:has(> :not([hidden]))) { display: none; }
.batch { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; padding: 6px 9px; background: var(--soft); border: 1px solid var(--rule); border-radius: 8px; }
.batch:has(label[data-modes=round]:not([hidden])) { grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.batch label { text-align: center; }
.batch input { background: var(--surface) !important; text-align: center; font-size: 16px; font-weight: 620; min-height: 37px !important; }
.times { align-self: end; display: grid; place-items: center; height: 37px; color: var(--muted); }
.conditions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.condition { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 4px 8px; text-align: left; }
.condition > span:nth-child(2) { flex: 1; min-width: 0; }
.condition-label { display: block; font-size: 11px; }
.condition strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.condition.warm { background: var(--warm-bg); color: var(--warm); border-color: transparent; }
.condition.cool { background: var(--cold-bg); color: var(--cold); border-color: transparent; }
.condition:hover:not(:disabled) { border-color: currentColor; }
.chevron { font-size: 17px; }
.parameter { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(56px, 1.35fr) 56px 12px; gap: 7px; align-items: center; min-height: 43px; border-top: 1px solid var(--rule); }
.parameter label, .yeast-row > span { color: var(--text); line-height: 1.2; }
.parameter input[type=number] { min-height: 34px; text-align: right; padding-inline: 5px; font-size: 13px; }
input[type=range] { appearance: none; width: 100%; margin: 0; height: 35px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--border) var(--fill, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; margin-top: -6.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; box-shadow: 0 1px 3px #0002; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--border); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.hint, .unit, .summary-value { font-size: 11px; color: var(--muted); }
.hint { text-align: right; }
.yeast-row { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding-top: 5px; border-top: 1px solid var(--rule); font-size: 12px; }
.yeast-row .segmented button { min-height: 36px; font-size: 11px; padding: 0 6px; }
.accordion { padding: 0 12px; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.accordion details + details { border-top: 1px solid var(--rule); }
.accordion summary, .standalone summary { display: flex; align-items: center; gap: 7px; min-height: 45px; font-weight: 650; font-size: 13px; }
.summary-value { margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; font-weight: 550; }
.accordion summary::after, .standalone summary::after, .formula-detail summary::after { content: '›'; color: var(--muted); font-size: 17px; }
details[open] > summary::after { transform: rotate(90deg); }
.detail-body { display: grid; gap: 8px; padding-bottom: 12px; }
.ingredient { display: grid; grid-template-columns: minmax(0, 1fr) minmax(53px, .45fr) auto; align-items: end; gap: 6px; margin-bottom: 6px; }
#extras .ingredient, #ingredients .ingredient { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(53px, .45fr)) auto; }
.remove { padding-inline: 9px; }
.secondary { font-size: 12px; font-weight: 620; }
.standalone { padding-block: 0; }
.result .card-heading { padding-bottom: 9px; border-bottom: 1px solid var(--rule); }
.ingredient-group { padding: 7px 0 12px; }
.ingredient-group + .ingredient-group { border-top: 1px solid var(--rule); }
.ingredient-group h3 { margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.ingredient-group h3 span { color: var(--muted); font-weight: 550; }
dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; margin: 0; }
dt { overflow-wrap: anywhere; }
dt small { color: var(--muted); margin-left: 6px; font-size: 10px; white-space: nowrap; }
dd { margin: 0; text-align: right; color: var(--muted); font-weight: 620; font-variant-numeric: tabular-nums; }
.mass-total { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 3px -3px 7px; padding: 9px 10px; background: var(--accent-bg); color: var(--accent-ink); border-radius: 8px; font-weight: 710; }
.total { font-size: 21px; letter-spacing: -.35px; font-variant-numeric: tabular-nums; }
.formula-detail summary { display: flex; justify-content: space-between; align-items: center; min-height: 42px; font-size: 12px; color: var(--muted); }
.formula-detail p { margin: 4px 0; font-size: 12px; }
.result-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--rule); padding-top: 8px; }
.result-actions button { display: grid; justify-items: center; align-content: center; min-height: 46px; gap: 3px; padding: 1px; color: var(--muted); font-size: 10px; background: var(--soft); border-color: transparent; }
.result-actions button:hover:not(:disabled) { border-color: var(--border); }
.standalone summary svg { color: var(--cold); }
.feedback { margin: 8px 0; color: var(--warm); font-size: 12px; }
.water-amounts { font-size: 13px; }
.planner .card-heading svg { color: var(--muted); }
.finish { gap: 6px; }
.finish label { min-width: 0; }
.finish input { font-size: 12px; }
.plan-status { font-size: 12px; margin: 7px 0 8px; }
.timeline { padding: 0; margin: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 7px; padding: 8px 0; border-top: 1px solid var(--rule); --step-color: var(--accent-ink); }
.timeline li.warm { --step-color: var(--warm); }
.timeline li.cool { --step-color: var(--cold); }
.timeline li:not(:last-child)::before { content: ''; position: absolute; top: 32px; bottom: -10px; left: 9px; width: 1px; background: var(--border); }
.timeline input[type=checkbox] { appearance: none; width: 18px; height: 18px; margin: 3px 0 0 1px; border-radius: 50%; border: 1.5px solid var(--step-color); background: var(--surface); cursor: pointer; }
.timeline input[type=checkbox]:checked { background: var(--step-color); }
.timeline input[type=checkbox]:checked::after { display: block; content: '✓'; text-align: center; font-size: 11px; color: var(--surface); }
.timeline .done > div { text-decoration: line-through; opacity: .65; }
.step-time { font-size: 11px; color: var(--muted); text-transform: capitalize; font-variant-numeric: tabular-nums; }
.timeline strong { color: var(--step-color); font-weight: 650; font-size: 13px; }
.step-description { font-size: 11px; }
.duration-input { display: flex; align-items: center; gap: 2px; font-size: 10px; }
.duration-input input[type=number] { width: 44px; min-height: 32px; text-align: center; font-size: 12px; padding: 2px; }
.planner { margin-bottom: 0; }
.subpage { max-width: 760px; margin: auto; }
.subpage h1 { margin-bottom: 12px; }
.subpage p { margin-bottom: 8px; }
.recipe-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 5px 10px; }
.library-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; border-radius: 6px; border-color: var(--rule); }
.library-row span { color: var(--muted); font-size: 11px; flex: none; }
.tool output { display: block; margin-top: 8px; font-weight: 700; }
dialog { width: min(100% - 24px, 400px); margin: auto auto max(12px, env(safe-area-inset-bottom)); border: 1px solid var(--border); box-shadow: 0 8px 40px #0003; padding: 15px; background: var(--surface); color: var(--text); border-radius: 13px; }
dialog::backdrop { background: #1b182270; }
dialog h2 { margin-bottom: 9px; }
dialog li { margin-bottom: 4px; }
dialog textarea { min-height: 180px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 11px; }
.primary { background: var(--selected); color: var(--on-selected); border-color: var(--selected); font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--selected); filter: brightness(1.1); }
#toast:not(:empty) { position: fixed; z-index: 11; right: 12px; bottom: calc(65px + env(safe-area-inset-bottom)); padding: 9px 12px; border-radius: 8px; background: var(--selected); color: var(--on-selected); box-shadow: var(--shadow); }
@media (min-width: 700px) {
  .app-bar { padding: 8px 24px; justify-content: space-between; }
  .primary-nav { position: static; padding: 0; border: 0; display: flex; align-items: center; gap: 4px; }
  .primary-nav a { flex-direction: row; padding: 0 9px; min-height: 40px; gap: 5px; font-size: 12px; border-radius: 8px; }
  .primary-nav a[aria-current] { background: var(--accent-bg); }
  .primary-nav svg { width: 16px; height: 16px; }
  main { padding: 18px 24px 28px; }
  .workspace { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(290px, .95fr); align-items: start; gap: 0 12px; }
  .workspace-heading { grid-column: 1 / -1; margin-bottom: 12px; }
  .mobile-tabs, .config-feedback { display: none; }
  .workspace[data-view=calcular][data-panel] :is(#formula, #results-panel) { display: block; }
  .workspace[data-view=fermentacion] { display: block; max-width: 550px; margin: 0 auto; }
  dialog { margin: auto; }
  #toast:not(:empty) { bottom: 14px; }
}
@media (min-width: 1050px) {
  .app-bar { padding-inline: 30px; }
  main { padding: 20px 30px 34px; }
  .workspace { grid-template-columns: minmax(330px, 1.1fr) minmax(305px, 1fr) minmax(275px, .91fr); gap: 0 13px; }
  .workspace[data-view=calcular] #planner-panel { display: block; }
  .card { padding: 14px; margin-bottom: 10px; }
  .recipe-card { padding: 0; }
  .accordion { padding: 0 13px; }
  .standalone { padding-block: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --text: #171717; --muted: #444; --accent-ink: #171717; --accent-bg: #f0f0f0; }
  body::before { display: block; content: attr(data-print-title); font-size: 22pt; font-weight: 700; margin: 10px 24px; }
  .app-header, .workspace-heading, .mobile-tabs, #formula, #planner-panel, .result-actions, .standalone, #toast { display: none !important; }
  .workspace, #results-panel { display: block !important; }
  .result { border: 0; box-shadow: none; }
  main { padding: 0 12px; }
}

.mobile-view-title, .mobile-label, .mobile-recipe-context { display: none; }
.step-check { display: block; }

@media (max-width: 699px) {
  :root { --mobile-gutter: 12px; }
  .app-header { position: sticky; top: 0; z-index: 9; }
  .app-bar { min-height: 52px; padding-inline: 14px; justify-content: space-between; }
  .mobile-view-title { display: block; color: var(--muted); font-size: 13px; font-weight: 650; }
  .workspace-heading { height: 0; margin: 0; }
  .workspace-heading h1, .subpage h1 {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .workspace-heading .category {
    position: fixed; z-index: 9; top: max(5px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  }
  .primary-nav a { min-height: 52px; font-size: 10px; letter-spacing: -.13px; }
  .primary-nav a svg {
    box-sizing: content-box;
    padding: 3px 11px;
    border-radius: 7px;
  }
  .primary-nav a[aria-current] svg { background: var(--accent-bg); }
  main {
    padding: 9px max(var(--mobile-gutter), env(safe-area-inset-right))
      calc(77px + env(safe-area-inset-bottom)) max(var(--mobile-gutter), env(safe-area-inset-left));
  }
  .mobile-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0;
    margin-bottom: 8px; border-color: var(--rule);
  }
  .workspace[data-view=calcular] .mobile-tabs { margin-top: -5px; }
  .mobile-tabs button { min-height: 43px; font-size: 13px; }
  .mobile-tabs button[aria-pressed=true]::after { inset-inline: 22%; }
  .card { padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px #24150906; }
  .card > h2, .card-heading { margin-bottom: 6px; }
  .card-heading select { min-height: 40px; }
  input:not([type=range], [type=checkbox]), textarea { font-size: 16px; }

  .recipe-card {
    display: grid; grid-template-columns: 42px minmax(0, 1fr) 37px; column-gap: 9px;
    align-items: center; padding: 7px 10px;
  }
  .recipe-heading { display: contents; }
  .recipe-icon { grid-column: 1; grid-row: 1 / 3; width: 42px; height: 42px; }
  .recipe-identity { grid-column: 2; grid-row: 1; }
  .recipe-meta { line-height: 1.2; gap: 6px; }
  .recipe-card .reset-recipe { grid-column: 3; grid-row: 1; align-self: start; }
  .recipe-metrics {
    grid-column: 2 / 4; grid-row: 2; min-height: 24px; padding: 0; border: 0; gap: 9px;
    font-variant-numeric: tabular-nums;
  }
  .recipe-metrics .text-button { min-height: 30px; }
  .recipe-metrics span { gap: 3px; }

  .batch { padding: 2px 7px; gap: 5px; }
  .batch label {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 72px); align-items: center;
    gap: 5px; min-height: 44px; text-align: left; white-space: nowrap;
  }
  .batch:has(label[data-modes=round]:not([hidden])) label { grid-template-columns: 1fr; text-align: center; }
  .batch input { min-height: 40px !important; padding: 2px 4px; }
  .times { height: 44px; }
  .conditions { gap: 5px; }
  .condition { min-height: 44px; padding-block: 2px; }
  .conditions-card { padding-bottom: 9px; }
  .parameter {
    min-height: 42px; grid-template-columns: minmax(88px, 1fr) minmax(60px, 1.4fr) 53px 12px;
    gap: 6px;
  }
  .parameter label { font-size: 13px; }
  .parameter input[type=number] { min-height: 36px; font-size: 16px; }
  .parameter input[type=range] { height: 40px; }
  .yeast-row .segmented button { min-height: 38px; }
  .accordion { padding: 0 12px; }
  .accordion summary, .standalone summary { min-height: 44px; }
  .standalone { padding-block: 0; }

  .mobile-label, .mobile-recipe-context { display: block; }
  .desktop-label { display: none; }
  .mobile-recipe-context { margin-top: 2px; color: var(--muted); font-size: 11px; }
  .result .card-heading { align-items: start; padding-bottom: 7px; }
  .result .hint { margin-top: 2px; white-space: nowrap; }
  .ingredient-group { padding: 7px 0 9px; }
  .ingredient-group h3 { margin-bottom: 5px; }
  .ingredient-group dl { row-gap: 4px; }
  .ingredient-group dd, .water-amounts dd { font-weight: 650; }
  .mass-total { margin: 2px 0; padding: 6px 8px; }
  .formula-detail summary { min-height: 35px; }
  .result-actions button { min-height: 44px; font-size: 11px; }

  .finish input { min-height: 42px; font-size: 14px; }
  .plan-status { margin: 6px 0; font-variant-numeric: tabular-nums; }
  .timeline li {
    grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px;
    align-items: center; min-height: 59px; padding-block: 4px;
  }
  .timeline li:not(:last-child)::before { left: 15px; top: calc(50% + 10px); bottom: -20px; }
  .timeline .step-check { display: grid; place-items: center; min-height: 44px; cursor: pointer; }
  .timeline input[type=checkbox] { position: relative; margin: 0; }
  .timeline strong { display: block; line-height: 1.25; }
  .step-description { margin-top: 1px; line-height: 1.25; }
  .duration-input { gap: 3px; min-height: 44px; }
  .duration-input input[type=number] { min-height: 40px; width: 46px; font-size: 16px; }
  .timeline .warm .duration-input input { background: var(--warm-bg); color: var(--warm); border-color: transparent; }
  .timeline .cool .duration-input input { background: var(--cold-bg); color: var(--cold); border-color: transparent; }

  .subpage .card { padding-top: 11px; }
  .subpage p:last-child { margin-bottom: 0; }
  .recipe-list { display: block; }
  .library-row { min-height: 44px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding-inline: 0 2px; }
  .library-row span { margin-left: auto; }
  .library-row::after, .tool-link::after { content: '›'; color: var(--muted); font-size: 17px; }
  .tool output { padding: 6px 9px; border-radius: 7px; background: var(--accent-bg); color: var(--accent-ink); font-size: 16px; }
  .tool-link { width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 44px; text-align: left; }
  #theme { min-height: 44px; }
  dialog {
    width: min(100%, 430px); max-width: 100%; margin: auto auto 0; padding: 16px 16px max(12px, env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
  }
  #editor-value { min-height: 46px; }
  .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-actions button { min-height: 44px; }
}

@media (max-width: 360px) {
  .category svg { display: none; }
  h1 { font-size: 19px; }
  .segmented button { padding-inline: 5px; }
  .yeast-row .segmented button { padding-inline: 4px; }
  .batch label { grid-template-columns: 1fr; text-align: center; }
}

@media print {
  .mobile-recipe-context { display: none; }
}

.dose-control { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule); }
.dose-control select, #oven-profile { margin-top: 2px; }
.source-link, #recipe-info a { color: var(--cold); text-decoration: underline; text-underline-offset: 2px; }
#recipe-info :is(h3, ul, ol, p) { margin-block: 8px; }
#recipe-info :is(ol, ul) { padding-left: 20px; }
#recipe-info dl { margin-block: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
#recipe-info dd { overflow-wrap: anywhere; }
#profile { max-height: min(720px, 90dvh); }
.plan-options { margin-top: 8px; border-top: 1px solid var(--rule); padding-top: 8px; }
.plan-options summary { min-height: 36px; color: var(--muted); }
.plan-options summary::after { content: ' ›'; }
.plan-overlap .step-description { font-style: italic; }
#flour-library details { border-top: 1px solid var(--rule); }
#flour-library summary { padding-block: 10px; }
#flour-library p { margin: 5px 0 9px; }
