/* Site layout and recipe photo styles. Updated 2026-11-25 09:42 EST, revision 2.2.0. */
/* Baker's Percentage Calculator */
:root {
  --bg: #000;
  --panel: #110e0b;
  --panel-2: #1a1510;
  --line: #2e261d;
  --text: #f1e7d6;
  --muted: #a3967f;
  --gold: #e0ad4f;
  --gold-2: #f3cf85;
  --crust: #9c5d26;
  --danger: #d0583c;
  --ok: #8fb36a;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--gold-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
h2 { font-size: 1.35rem; margin: 1.4rem 0 .6rem; color: var(--gold-2); }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: #f0a35a !important; }
[hidden] { display: none !important; }

/* decorative wheat in the page margins */
.bg-wheat {
  position: fixed; bottom: -40px; height: 78vh; opacity: .13;
  pointer-events: none; z-index: 0;
}
.bg-wheat-left { left: -30px; transform: rotate(8deg); }
.bg-wheat-right { right: -30px; transform: rotate(-8deg) scaleX(-1); }

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: 1;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 70% 120%, rgba(156, 93, 38, .28), transparent 60%), #000;
}
.hero {
  max-width: 1200px; margin: 0 auto; padding: 18px 24px 14px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px;
}
.hero-wheat { height: 150px; filter: drop-shadow(0 4px 14px rgba(224, 173, 79, .25)); }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--gold); }
.hero h1 { margin: .1rem 0 .5rem; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.05; }
.hero h1 a { color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px;
  border: 1px solid transparent; font-size: .92rem;
}
.nav a:hover { color: var(--text); border-color: var(--line); }
.nav a.on { color: #000; background: var(--gold); }
.hero-breads { display: flex; align-items: flex-end; gap: 10px; }
.loaf { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .9)); }
.loaf-top { height: 130px; }
.loaf-side { height: 110px; margin-left: -34px; }
.photo { height: 130px; width: 130px; object-fit: cover; border-radius: 50%; border: 2px solid var(--line); }

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 24px; }
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .6);
}
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.desc { margin: .4rem 0 0; min-height: 1.2em; }

/* ---------- form fields ---------- */
.field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 110px; flex: 0 1 140px; }
.field.grow, .grow { flex: 1 1 240px; }
.field > span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; background: #080706; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font: inherit; font-variant-numeric: tabular-nums;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224, 173, 79, .18); }
input:disabled { opacity: .4; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
optgroup { background: #000; color: var(--gold); }
option { background: #000; color: var(--text); }
input[type=number]::-webkit-inner-spin-button { opacity: .35; }
.formula input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.formula input[type=number]::-webkit-inner-spin-button,
.formula input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin: 6px 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 17px; height: 17px; }
.radio-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; }
.radio-group legend { color: var(--muted); font-size: .85rem; padding: 0 6px; }
.radio-group label { display: flex; gap: 8px; align-items: center; margin: 4px 0; cursor: pointer; }
.options { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }

.lock-line { margin: 2px 0 0; }
.badge { display: inline-block; font-size: .8rem; color: var(--gold-2); background: rgba(224, 173, 79, .08);
  border: 1px solid rgba(224, 173, 79, .25); border-radius: 999px; padding: 3px 11px; }

/* ---------- formula table ---------- */
.table-wrap { overflow-x: auto; }
.formula { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.formula th, .formula td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.formula thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.formula tbody th { font-weight: 600; }
.formula .num { text-align: right; width: 130px; }
.formula td:last-child { width: 34px; text-align: center; }
.formula .num input { text-align: right; max-width: 120px; }
.formula .fixed { display: inline-block; padding: 9px 12px; color: var(--muted); }
.formula .row-flour th { color: var(--gold-2); }
.formula tr.sub td { border-bottom-style: dashed; padding-top: 3px; padding-bottom: 3px; }
.formula tr.sub td:first-child { padding-left: 22px; }
.formula tr.sub input { padding: 6px 9px; font-size: .92rem; }
.formula tr.sub .num { position: relative; }
.formula .unit { display: block; font-size: .7rem; color: var(--muted); margin-top: 1px; }
.formula output { color: var(--muted); padding-right: 12px; }
.formula .row-starter th { color: #d9b985; }
.formula .row-total th, .formula .row-total output { color: var(--gold); font-weight: 700; font-size: 1.05rem; }
.formula .row-total td, .formula .row-total th { border-bottom: none; padding-top: 12px; }
.warn-row td { color: #f0a35a; font-size: .85rem; }
.name { min-width: 150px; }
.x { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; line-height: 1; font-size: 16px; }
.x:hover { color: var(--danger); border-color: var(--danger); }
.add-row { margin-top: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gold); color: #120c05; border: 1px solid var(--gold); border-radius: 10px;
  padding: 9px 16px; font: 600 .92rem var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; color: var(--gold-2); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(208, 88, 60, .4); }
.btn.danger:hover { background: rgba(208, 88, 60, .12); }
.small-btn { padding: 6px 11px; font-size: .84rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.actions form { margin: 0; }

/* ---------- weigh-out card ---------- */
.weigh { position: sticky; top: 18px; overflow: hidden; }
.weigh-art { position: absolute; right: -50px; top: -30px; width: 160px; opacity: .14; pointer-events: none; }
.weigh h2 { position: relative; margin-bottom: 2px; padding-right: 70px; }
.weigh-list { list-style: none; margin: 14px 0; padding: 0; position: relative; }
.weigh-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px dotted var(--line); }
.w-name { display: flex; flex-direction: column; }
.w-name small { color: var(--muted); font-size: .78rem; }
.w-g { font: 700 1.25rem var(--serif); color: var(--gold-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-g .u { font-size: .85rem; color: var(--muted); font-weight: 400; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.totals div { background: #080706; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; display: flex; flex-direction: column; }
.totals span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.totals strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.notes { white-space: pre-wrap; margin-top: 14px; font-size: .9rem; color: #cfc2ab; border-left: 3px solid var(--crust); padding: 4px 0 4px 12px; }

/* ---------- method / preferment ---------- */
.pf-box { border: 1px solid rgba(224, 173, 79, .25); background: rgba(224, 173, 79, .04); border-radius: 12px; padding: 12px 14px; margin-bottom: 6px; }
.pf-box .field { flex-basis: 170px; }
.pf-box #pfInfo { margin: 0 0 10px; }
.pf-summary { margin: 10px 0 0; color: var(--gold-2); font-weight: 600; font-size: .92rem; }
.weigh-list li.day-head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border-bottom: 1px solid var(--gold); padding: 14px 0 6px; }
.weigh-list li.day-head:first-child { padding-top: 0; }
.weigh-list li.day-head span { font: 600 1.05rem var(--serif); color: var(--gold); letter-spacing: .02em; }
.weigh-list li.day-head small { color: var(--muted); font-size: .78rem; }
.weigh-list li.day-total { color: var(--muted); font-size: .85rem; border-bottom: none; padding-top: 6px; }
.weigh-list li.strong .w-name { color: var(--gold-2); font-weight: 600; }

/* ---------- PIN ---------- */
.pin-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.pin-row .field { flex: 0 0 130px; min-width: 0; }
.pin-input { letter-spacing: .4em; text-align: center; }
.lock-state { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.lock-state form { display: inline; margin: 0; }
.linkish { background: none; border: none; color: var(--gold-2); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- recipes page ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 12px; }
.section-head h2 { margin: 0; }
.section-head + .cards, .cards + .section-head { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-bottom: 28px; }
.card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius);
}
.card:hover { border-color: #4a3b29; }
.card-art { position: absolute; right: -26px; top: -14px; width: 130px; height: 130px; object-fit: contain; opacity: .35; pointer-events: none; }
/* Reserve the same frame before each lazy-loaded recipe card photo arrives. */
.recipe-card-photo, .recipe-preview {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--panel);
}
.recipe-card-photo { border-bottom: 1px solid var(--line); }
.recipe-preview { display: block; margin-top: 12px; border-radius: 10px; }
.card-body { padding: 16px 18px; position: relative; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: .15rem 0 .3rem; }
.card-art + .card-body h3 { padding-right: 70px; }
.card p { margin: .2rem 0; }
.chips { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.chips li { font-size: .76rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: #d5c8b0; background: #080706; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; }
.card-actions form { margin: 0; }
.empty { margin: 0 0 22px; }
.flash { border-radius: 10px; padding: 11px 15px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { border-color: rgba(143, 179, 106, .45); background: rgba(143, 179, 106, .08); }
.flash.err { border-color: rgba(208, 88, 60, .5); background: rgba(208, 88, 60, .1); }
.backup { margin-top: 10px; }
.import-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.import-form input[type=file] { color: var(--muted); }

.editor { max-width: 900px; margin: 0 auto; }
.rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #080706; }
.row .x { margin-bottom: 6px; }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 0 34px; }
.site-footer img { width: 150px; opacity: .6; display: block; margin: 0 auto 4px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .weigh { position: relative; top: 0; }
  .hero { grid-template-columns: auto 1fr; }
  .hero-breads { display: none; }
  .hero-wheat { height: 100px; }
  .bg-wheat { opacity: .07; }
}
@media (max-width: 520px) {
  .wrap { padding: 14px; }
  .panel { padding: 16px; }
  .formula { font-size: .9rem; }
  .formula th, .formula td { padding: 5px 3px; }
  .formula .num { width: 74px; }
  .formula .num input { max-width: 72px; padding: 8px 6px; }
  .formula tr.sub td:first-child { padding-left: 6px; }
  .formula output { padding-right: 4px; white-space: nowrap; font-size: .85rem; }
  .formula td:last-child { width: 26px; }
  .name { min-width: 0; }
}

/* ---------- print ---------- */
@media print {
  body, html { background: #fff; color: #000; }
  .bg-wheat, .site-header, .pf-box .field, #pfInfo, .site-footer, .actions, .add-row, .options, .lock-line, .weigh-art, #recipeSelect, .recipe-preview, .x { display: none !important; }
  .panel { box-shadow: none; border: 1px solid #ccc; background: #fff; }
  .calc-grid { display: block; }
  .weigh { page-break-inside: avoid; margin-top: 14px; }
  h2, .w-g, .formula .row-total th, .formula .row-total output, .formula .row-flour th { color: #000 !important; }
  input, select { border: none; background: none; color: #000; box-shadow: none; padding: 2px; }
  .muted, .w-name small, .totals span { color: #444 !important; }
  .totals div { background: #fff; }
}
.chips li.chip-gold { border-color: rgba(224,173,79,.5); color: var(--gold-2); }
.row-tip { flex-basis: 100%; margin: 0; }

/* ---------- ingredient tips & guide ---------- */
.info-btn { width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--gold); background: none; color: var(--gold); font: italic 700 11px/1 var(--serif); cursor: pointer; vertical-align: 2px; margin-left: 4px; padding: 0; }
.info-btn:hover { background: var(--gold); color: #000; }
.formula tr.tip-row td { font-size: .84rem; color: #d5c8b0; background: rgba(224, 173, 79, .05); padding: 8px 10px; border-left: 3px solid var(--gold); }
.guide { margin-top: 22px; }
.guide summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary h2 { margin: 0; }
.guide summary h2::before { content: "▸ "; color: var(--gold); }
.guide[open] summary h2::before { content: "▾ "; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 28px; margin-top: 6px; }
.guide dl { margin: 0; }
.guide dt { font-weight: 700; margin-top: 12px; color: var(--text); }
.guide dt .range { font-weight: 400; font-size: .8rem; color: var(--gold-2); margin-left: 4px; }
.guide dd { margin: 3px 0 0; font-size: .9rem; color: #cfc2ab; }
@media print { .guide { display: none; } }
.editor #ed-yeastType, .editor #ed-pfFlour { min-width: 200px; }
.editor .field:has(#ed-yeastType), .editor .field:has(#ed-pfFlour) { flex-basis: 210px; }
.editor .field:has(#ed-category) { flex-basis: 190px; }

/* ---------- gluten-free ---------- */
.gf-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 2px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 40px; height: 22px; border-radius: 999px; background: #2a231b; border: 1px solid var(--line); position: relative; transition: background .2s; }
.switch .slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + .slider { background: rgba(143, 179, 106, .35); border-color: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(18px); background: var(--ok); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(224, 173, 79, .3); }
.gf-note { margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; font-size: .86rem; border: 1px solid rgba(143, 179, 106, .4); background: rgba(143, 179, 106, .07); color: #d9e4c9; line-height: 1.55; }
.formula tr.row-wheat-off th, .formula tr.row-wheat-off td { opacity: .38; color: var(--muted); font-style: italic; }
.formula tr.row-wheat-off s { text-decoration-thickness: 2px; }
.formula .row-flour.gf th { color: var(--ok); }
.chips li.chip-gf { border-color: rgba(143, 179, 106, .6); color: #c4dba8; }

/* ---------- substitutions ---------- */
.row-btns { white-space: nowrap; }
.formula td.row-btns { width: 64px; text-align: right; }
.swap-btn, .undo-btn { background: none; border: 1px solid var(--line); color: var(--gold-2); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-size: 13px; line-height: 1; margin-right: 4px; padding: 0; }
.swap-btn:hover, .undo-btn:hover { border-color: var(--gold); background: rgba(224, 173, 79, .1); }
.swap-icon { color: var(--gold-2); font-weight: 700; }
.formula tr.from-row td { font-size: .78rem; color: var(--gold-2); padding-top: 0; border-bottom-style: dashed; }
.formula tr.from-row td:first-child { padding-left: 22px; }
.formula tr.from-row.omitted td { color: var(--muted); font-style: italic; }
.formula tr.swapped th { color: var(--gold-2); }
.formula tr.swap-row td { padding: 10px; background: rgba(224, 173, 79, .04); border-left: 3px solid var(--gold); }
.swap-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .9rem; }
.swap-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.swap-opt { text-align: left; display: flex; flex-direction: column; gap: 3px; background: #080706; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; font: inherit; }
.swap-opt:hover { border-color: var(--gold); background: #120e0a; }
.so-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.so-change { font-size: .78rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.so-note { font-size: .8rem; color: #cfc2ab; line-height: 1.4; }
.tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.tag-healthier { color: #c4dba8; border-color: rgba(143, 179, 106, .55); }
.tag-vegan { color: #a8d8c4; border-color: rgba(106, 179, 150, .55); }
.swap-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.swap-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: 4px; }
.chip-btn { background: #080706; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px; font: 600 .82rem var(--sans); cursor: pointer; }
.chip-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.chip-btn.ghost-chip { color: var(--gold-2); border-style: dashed; }
.swap-msg { flex-basis: 100%; margin: 4px 0 0; }
.guide .sub-line { display: block; margin: 3px 0; }
@media (max-width: 520px) {
  .formula td.row-btns { width: 58px; }
  .swap-opts { grid-template-columns: 1fr; }
  .formula tr.from-row td:first-child { padding-left: 6px; }
}
@media print { .swap-bar, .swap-row, .swap-btn, .undo-btn { display: none !important; } }

/* ---------- v1.5: stages, filters, edit flows ---------- */
.stage-tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold-2); vertical-align: 2px; margin-left: 4px; font-weight: 600; }
.stage-tag.stage-laminate { border-color: rgba(224, 173, 79, .55); }
.stage-tag.stage-filling { border-color: rgba(156, 93, 38, .7); color: #e2b48a; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 16px; }
.filter-bar input[type=search] { flex: 1 1 260px; }
.filter-bar select { flex: 0 1 220px; width: auto; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cat-head h2 { font-size: 1.15rem; }
.hidden-list summary { cursor: pointer; list-style: none; }
.hidden-list summary::-webkit-details-marker { display: none; }
.hidden-list summary h2 { margin: 0; font-size: 1.1rem; }
.hidden-list summary h2::before { content: "▸ "; color: var(--gold); }
.hidden-list[open] summary h2::before { content: "▾ "; }
.hidden-list ul { list-style: none; padding: 0; margin: 10px 0 0; }
.hidden-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.hidden-list form { margin: 0; }
.edit-note { margin-top: -4px; }
.editor-delete { max-width: 900px; margin: 12px auto 0; text-align: right; }
.card[hidden], .cards[hidden], .cat-head[hidden] { display: none !important; }

/* ===================== v1.6 ===================== */
.pan-link { margin-left: 8px; }
input[type=date], input[type=datetime-local] { width: 100%; background: #080706; color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; color-scheme: dark; }
input[type=file] { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { padding: 8px 13px; cursor: pointer; font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.seg label:has(input:checked) { background: rgba(224, 173, 79, .16); color: var(--gold-2); }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg label:has(input:disabled) { opacity: .5; cursor: default; }

/* ---------- modal (nutrition) ---------- */
dialog.modal { background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; width: min(620px, 94vw); box-shadow: 0 30px 80px rgba(0, 0, 0, .8); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .7); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.modal-head h2 { margin: 0 0 10px; }
.nut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.nut-cell { background: #080706; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; display: flex; flex-direction: column; }
.nut-cell span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.nut-cell strong { font: 700 1.25rem var(--serif); color: var(--gold-2); }
.nut-cell strong small { font: 400 .8rem var(--sans); color: var(--muted); }
.nut-cell.big strong { font-size: 1.6rem; }
.nut-cell.wide { grid-column: 1 / -1; }
.nut-cell em { font-size: .8rem; color: var(--muted); font-style: normal; }
.nut-detail summary { cursor: pointer; color: var(--gold-2); font-size: .9rem; margin-bottom: 6px; }
.nut-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.nut-table th, .nut-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.nut-table .num { text-align: right; }

/* ---------- bake mode ---------- */
.bake-head h2 { margin: 2px 0 4px; font-size: 1.6rem; }
.plan-row, .temp-row { margin-top: 12px; }
.temp-row .switch { margin-bottom: 8px; }
.bk-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.bk-summary div { background: #080706; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.bk-summary span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.bk-summary strong { font: 700 1.15rem var(--serif); color: var(--gold-2); }
.steps { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 82px 1fr; gap: 14px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; }
.step::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--line); }
.step.kind-rise::before { background: #8fb36a; } .step.kind-cold::before { background: #6fa3c7; } .step.kind-bake::before { background: #e07b3c; }
.step.kind-active::before { background: var(--gold); } .step.kind-cool::before, .step.kind-rest::before { background: #7d6d58; }
.step.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 20px 40px rgba(0, 0, 0, .6); }
.step.done { opacity: .55; }
.step.done h3 { text-decoration: line-through; text-decoration-color: rgba(241, 231, 214, .4); }
.step-time { display: flex; flex-direction: column; align-items: flex-start; font-variant-numeric: tabular-nums; }
.step-time strong { font: 700 1.05rem var(--serif); color: var(--gold-2); white-space: nowrap; }
.step-time span { font-size: .75rem; color: var(--muted); }
.step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-head h3 { margin: 0; flex: 1; font-size: 1.1rem; }
.step-head .kind { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.step-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 2px; font-size: .85rem; color: var(--muted); }
.step-meta .dur input { width: 74px; padding: 4px 8px; text-align: right; }
.step-meta select { width: auto; padding: 4px 30px 4px 8px; font-size: .85rem; }
.step-note { margin: 6px 0 0; font-size: .88rem; color: #cfc2ab; }
.preheat { margin: 8px 0 0; font-size: .88rem; color: #f0b27a; }
.step-timer { margin-top: 10px; display: flex; align-items: center; gap: 12px; font: 700 1.3rem var(--serif); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.tbar { flex: 1; height: 8px; border-radius: 999px; background: #080706; border: 1px solid var(--line); overflow: hidden; }
.tbar div { height: 100%; background: linear-gradient(90deg, var(--gold), #f3cf85); transition: width 1s linear; }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px dotted var(--line); }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px dotted var(--line); cursor: pointer; }
.checklist input { width: 22px; height: 22px; flex: none; }
.checklist .ck-name { flex: 1; display: flex; flex-direction: column; }
.checklist .ck-name small { color: var(--muted); font-size: .76rem; }
.checklist .ck-g { font: 700 1.1rem var(--serif); color: var(--gold-2); white-space: nowrap; }
.checklist label.checked .ck-name, .checklist label.checked .ck-g { opacity: .45; text-decoration: line-through; }
.finish { text-align: center; margin-top: 10px; }
.timer-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); background: rgba(10, 8, 6, .96); border-top: 1px solid var(--gold); backdrop-filter: blur(6px); }
.timer-bar.over { border-top-color: #f0a35a; }
.tb-info { display: flex; flex-direction: column; min-width: 0; }
.tb-step { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-time { font: 700 1.35rem var(--serif); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.timer-bar.over .tb-time { color: #f0a35a; }
body:has(.timer-bar:not([hidden])) .site-footer { padding-bottom: 90px; }

/* ---------- pans ---------- */
.pan-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.pan-results { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 18px; }
.style-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.quick-btn { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: #080706; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font: 700 1.05rem var(--serif); cursor: pointer; }
.quick-btn small { font: 400 .8rem var(--sans); color: var(--muted); }
.quick-btn.on, .style-card.on { border-color: var(--gold); background: rgba(224, 173, 79, .08); }
.style-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 10px; }
.style-list > p { grid-column: 1 / -1; margin: 8px 0 0; }
.style-card { text-align: left; display: flex; flex-direction: column; gap: 3px; background: #080706; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: var(--text); font: inherit; cursor: pointer; }
.style-card:hover, .quick-btn:hover { border-color: var(--gold); }
.style-card .per { font-size: .76rem; color: var(--gold-2); }
.style-card .note { font-size: .78rem; color: #cfc2ab; }
.more-styles summary { cursor: pointer; color: var(--gold-2); margin: 4px 0 8px; }
.result h2 { margin-top: 2px; }
.big-num { font: 700 2.4rem var(--serif); color: var(--gold-2); line-height: 1.1; margin: 4px 0; }
.big-num small { font: 400 1rem var(--sans); color: var(--muted); }
.small-h { font-size: .95rem; margin: 12px 0 6px; }
.pan-fits { list-style: none; margin: 0; padding: 0; }
.pan-fits li { padding: 6px 0; border-bottom: 1px dotted var(--line); display: flex; flex-direction: column; }

/* ---------- journal ---------- */
.j-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.j-stats div { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.j-stats span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.j-stats strong { font: 700 1.2rem var(--serif); color: var(--gold-2); }
.j-list { display: flex; flex-direction: column; gap: 14px; }
.j-entry { display: grid; grid-template-columns: auto 1fr; gap: 18px; }
.j-entry:not(:has(.j-photos)) { grid-template-columns: 1fr; }
.j-photos { display: grid; grid-template-columns: repeat(2, 110px); gap: 6px; align-content: start; }
.j-photos img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.j-photos a:first-child:last-child img { width: 226px; height: 170px; }
.j-photos:has(a:only-child) { grid-template-columns: 226px; }
.j-body h3 { margin: 2px 0 4px; }
.j-body p { margin: 4px 0; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 1rem; }
.stars .off { color: #3a3128; }
.ok-t { color: #c4dba8; }
pre.timeline { white-space: pre-wrap; font: .82rem/1.5 var(--sans); color: #cfc2ab; background: #080706; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.rating { border: none; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 2px; }
.rating legend { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; float: left; width: 100%; }
.rating input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating label { font-size: 1.9rem; color: #3a3128; cursor: pointer; line-height: 1; }
.rating input:checked ~ label, .rating label:hover, .rating label:hover ~ label { color: var(--gold); }
.two-col .field { flex-basis: 300px; }
.photo-edit { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.photo-edit label { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.photo-edit img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

@media (max-width: 900px) {
  .pan-grid { grid-template-columns: 1fr; }
  .pan-results { position: static; }
}
@media (max-width: 560px) {
  .step { grid-template-columns: 1fr; gap: 6px; }
  .step-time { flex-direction: row; gap: 8px; align-items: baseline; }
  .j-entry { grid-template-columns: 1fr; }
  .style-quick { grid-template-columns: 1fr; }
  .nav a { padding: 5px 9px; font-size: .86rem; }
}
@media print { .timer-bar, .actions { display: none !important; } }
.pan-fits li { align-items: flex-start; }
.pan-fits .linkish { text-align: left; }
.plan-row .field { flex: 0 1 250px; }

/* ---------- settings ---------- */
.gear { background: none; border: 1px solid var(--line); color: var(--gold-2); border-radius: 999px; width: 34px; height: 34px; font-size: 18px; cursor: pointer; line-height: 1; padding: 0; }
.gear:hover { border-color: var(--gold); background: rgba(224, 173, 79, .1); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.set-grid fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.set-grid fieldset.wide { grid-column: 1 / -1; }
.set-grid legend { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 4px; }
.spoon { color: var(--muted); font-size: .76rem; }
@media (max-width: 560px) { .set-grid { grid-template-columns: 1fr; } }
.fit-note { margin: 8px 0 0; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(224, 173, 79, .35); background: rgba(224, 173, 79, .06); font-size: .9rem; }
.fit-note.bad { border-color: rgba(240, 163, 90, .6); background: rgba(240, 163, 90, .08); color: #f5c08d; }
.fit-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold-2); border: 1px dashed rgba(224, 173, 79, .5); border-radius: 999px; padding: 1px 8px; }
.cold-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
#fitRow { margin-top: 10px; }
.set-grid .field { flex: none; min-width: 0; }
.sort-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-basis: 100%; }
.filter-bar select#rRegion { flex: 0 1 230px; width: auto; }
.card .eyebrow .origin { color: var(--muted); letter-spacing: .12em; }
/* Recipe photo upload in the editor (2.3.0) */
.photo-field { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.photo-thumb { width: 180px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin-top: 6px; }
/* About page & hidden visit counter (2.4.0) */
.ver { background: none; border: none; color: inherit; font: inherit; padding: 0; cursor: default; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--gold-2); }
.about { max-width: 860px; margin: 0 auto; }
.about h2 { font-size: 1.8rem; margin: 4px 0 8px; }
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin: 14px 0; }
.about ul { padding-left: 18px; margin: 6px 0; }
.about li { margin: 5px 0; }
.contact-card { background: #080706; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.contact-card .field { margin-bottom: 8px; }
.contact-card .owner { font: 700 1.3rem var(--serif); color: var(--gold-2); margin: 4px 0; }
.visits-modal { width: min(460px, 92vw); }
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; } }
/* Total-time line in the weigh-out card (2.5.0) */
.time-line { position: relative; margin: 8px 0 0; padding: 8px 11px; border-radius: 10px; background: rgba(224, 173, 79, .07); border: 1px solid rgba(224, 173, 79, .3); font-size: .9rem; }
.time-line strong { color: var(--gold-2); font: 700 1.05rem var(--serif); }
.time-line small { display: block; color: var(--muted); font-size: .76rem; margin-top: 3px; }
@media print { .time-line small { display: none; } }
/* "Also eaten in" (2.6.0) */
.card .also-in { color: #b9ab92; margin: 2px 0; font-size: .78rem; }
/* Owner unlock (2.6.4) */
body.guest .owner-only { display: none !important; }
.owner-box { border-top: 1px solid rgba(224,182,90,.25); margin-top: 14px; padding-top: 12px; }
.owner-box p { margin: 0 0 8px; }
.owner-box .pin-input { width: 110px; }
/* Flour First (2.6.6) */
.house-badge { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .02em; color: #1a1408; background: #e0b65a; border-radius: 999px; padding: 2px 8px; vertical-align: middle; margin-left: 4px; }
