/* Layout: header with live stats, a labeled finder (search + toggles), recipe cards in sections, "About her cooking" at the bottom. Opening a recipe swaps the list for a phone-first recipe view. */
:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --ink: #1d3328;
  --muted: #5b6b61;
  --rule: #d9dfd6;
  --scallion: #3a7a4c;
  --yolk: #f2b705;
  --yolk-ink: #6b4f00;
  --on-yolk: #2b2100;
  --chip: #e8eee5;
  --done: #8a968e;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111713; --surface: #18201b; --ink: #e4ebe5; --muted: #a2b1a7; --rule: #2c3830;
    --scallion: #7cc08f; --yolk: #f5c842; --yolk-ink: #f5c842; --chip: #223028; --done: #6f7d74; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111713; --surface: #18201b; --ink: #e4ebe5; --muted: #a2b1a7; --rule: #2c3830;
  --scallion: #7cc08f; --yolk: #f5c842; --yolk-ink: #f5c842; --chip: #223028; --done: #6f7d74; color-scheme: dark;
}
html { -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 64px;
}
.wrap { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 2px solid var(--yolk); outline-offset: 2px; }

/* Header */
header { display: flex; flex-direction: column; gap: 18px; }
.title-row { display: flex; align-items: center; gap: clamp(12px, 3vw, 20px); }
.title-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.avatar { width: clamp(64px, 16vw, 96px); height: auto; aspect-ratio: 1; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid var(--yolk); background: var(--chip); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px 20px; font-family: var(--mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.facts b { font-weight: 500; font-size: 1.5rem; display: block; color: var(--ink); line-height: 1.2; }
.facts span { color: var(--muted); }
.header-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.header-foot a { color: var(--ink); text-underline-offset: 3px; }

/* Finder */
.finder { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.finder-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.finder-head h2 { font-size: 1.3rem; }
.count { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.clear { margin-left: auto; font: 500 0.9rem var(--display); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 2px; }
.search { position: relative; display: block; }
.search input { width: 100%; font: 400 1rem var(--display); font-size: max(16px, 1rem); color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px 12px 42px; min-height: 48px; }
.search input::placeholder { color: var(--muted); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.fgroups { display: flex; flex-direction: column; gap: 10px; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flabel { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); width: 4.6rem; flex: none; }
.fchip { font: 500 0.92rem var(--display); border: 1px solid var(--rule); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 38px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.fchip .n { font-family: var(--mono); font-size: 0.72rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fchip.style[aria-pressed="true"] { background: var(--yolk); color: var(--on-yolk); border-color: var(--yolk); }
.fchip:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 560px) { .flabel { width: 100%; } .finder { padding: 14px; } }

/* Results */
#results { display: flex; flex-direction: column; gap: 40px; }
.rsection { display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--ink); padding-top: 12px; }
.section-head p { color: var(--muted); max-width: 62ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; color: inherit; text-decoration: none; min-width: 0; transition: border-color .12s, transform .12s; }
.card:hover { border-color: var(--scallion); }
.card:active { transform: scale(0.99); }
.card-top { display: flex; flex-direction: column; gap: 2px; }
.meta { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.cnote { font-size: 0.93rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.open { margin-top: auto; font: 500 0.9rem var(--display); color: var(--scallion); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--chip); border-radius: 4px; padding: 2px 7px; }
.tag.warm { background: color-mix(in srgb, var(--yolk) 32%, var(--surface)); }
.tag.made { background: var(--ink); color: var(--bg); }
.tag.conf { background: none; border: 1px dashed var(--muted); color: var(--muted); }
.empty, .loading { border: 1px dashed var(--rule); border-radius: 12px; padding: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; color: var(--muted); }
.empty button, .vfoot button { font: 500 0.95rem var(--display); background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; min-height: 44px; }

/* About her cooking */
.about { display: flex; flex-direction: column; gap: 36px; }
.about section { display: flex; flex-direction: column; gap: 18px; }
.about .section-head { border-top-width: 1px; }
.about-intro { border-top: 2px solid var(--ink); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.chart { display: grid; grid-template-columns: minmax(0, 13rem) 1fr; gap: 6px 14px; align-items: center; }
.chart .lbl { font-size: 0.95rem; text-align: right; }
.bar-row { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; outline: none; }
.bar { height: 18px; background: var(--scallion); border-radius: 0 4px 4px 0; min-width: 4px; }
.bar-val { font-family: var(--mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.tip { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 2; background: var(--ink); color: var(--bg); font-size: 0.85rem; line-height: 1.4; padding: 8px 10px; border-radius: 6px; max-width: min(26rem, 80vw); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.bar-row:hover .tip, .bar-row:focus-visible .tip { opacity: 1; transform: none; }
.chart-note { font-size: 0.85rem; color: var(--muted); font-style: italic; }
@media (max-width: 560px) { .chart { grid-template-columns: 1fr; } .chart .lbl { text-align: left; margin-top: 6px; } }
.moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px 28px; }
.move { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.move h3 { font-size: 1.05rem; }
.move p { color: var(--muted); font-size: 0.97rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--chip); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
td:first-child { font-weight: 600; white-space: nowrap; }
.method { font-size: 0.88rem; color: var(--muted); max-width: 70ch; }

/* Recipe view (phone-first) */
.viewer { max-width: 680px; margin: 0 auto; font-size: 19px; line-height: 1.55; }
.vbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.vback, .wake { font: 500 1rem var(--display); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wake[aria-pressed="true"] { background: var(--yolk); color: var(--on-yolk); border-color: var(--yolk); }
.vbody { display: flex; flex-direction: column; gap: 18px; }
.vtitle { font-size: clamp(1.9rem, 8vw, 2.6rem); }
.vmeta { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.vnote { background: var(--surface); border-left: 4px solid var(--yolk); border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: 1rem; }
.vnote b { display: block; font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yolk-ink); margin-bottom: 2px; }
.vmynote { border-left-color: var(--scallion); white-space: pre-line; }
.vmynote b { color: var(--scallion); }
.vnote .conf { display: block; margin-top: 6px; color: var(--muted); font-size: 0.9rem; }
.vhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 2px solid var(--ink); padding-top: 12px; margin-top: 6px; }
.vhead h2 { font-size: 1.45rem; }
.vhead button { font: 500 0.88rem var(--display); background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 2px; }
.vgroup { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checks label { display: flex; align-items: flex-start; gap: 14px; padding: 11px 2px; min-height: 52px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.checks input { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 1px 0 0; border: 2px solid var(--muted); border-radius: 7px; background: var(--surface); display: grid; place-content: center; cursor: pointer; }
.checks input::after { content: ""; width: 12px; height: 7px; border: solid var(--on-yolk); border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.checks input:checked { background: var(--yolk); border-color: var(--yolk); }
.checks input:checked::after { opacity: 1; }
.checks input:checked + span { color: var(--done); text-decoration: line-through; }
.vsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.step { width: 100%; text-align: left; display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; line-height: 1.55; }
.step .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 1rem var(--display); display: grid; place-items: center; }
.step[aria-pressed="true"] { background: transparent; }
.step[aria-pressed="true"] .num { background: var(--yolk); color: var(--on-yolk); }
.step[aria-pressed="true"] .txt { color: var(--done); }
.vhint { font-size: 0.9rem; color: var(--muted); }
.vfacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.vfacts div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.vfacts dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.vfacts dd { margin: 2px 0 0; font: 600 0.98rem var(--display); line-height: 1.3; }
@media (max-width: 520px) { .vfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vequip { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: 1rem; }
.vbox { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 1rem; }
.vbox h3 { font-size: 1.05rem; }
.vbox ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.vfoot { display: flex; justify-content: center; padding-top: 10px; }
@media (prefers-reduced-motion: reduce) { .tip, .card { transition: none; } }

/* Recipe view extras (shared with the add preview) */
.vbox.warn { border-color: var(--yolk); }
.vcredit { font-size: 0.9rem; color: var(--muted); }

/* Add a recipe */
.add-btn { font: 600 0.95rem var(--display); background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.adder { max-width: 680px; margin: 0 auto; font-size: 18px; line-height: 1.55; display: flex; flex-direction: column; gap: 18px; }
.adder .vbar { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field legend { font: 600 0.95rem var(--display); }
.field textarea, .field input[type="password"], .field input[type="text"], .field input[type="date"], .field input[type="url"], .field select {
  width: 100%; font: 400 1rem var(--body); font-size: max(16px, 1rem); color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; min-height: 48px; }
.field textarea { resize: vertical; }
.field .hint { font-size: 0.88rem; color: var(--muted); }
.drop { border: 2px dashed var(--rule); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--surface); }
.drop.over { border-color: var(--scallion); }
.drop .hint { font-size: 0.88rem; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.file { width: 132px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; background: var(--surface); }
.thumb.file strong { font: 700 1.1rem var(--display); color: var(--ink); }
.thumb.file span { font-size: 0.75rem; color: var(--muted); line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font: 700 0.9rem var(--display); cursor: pointer; }
.btn { font: 600 1rem var(--display); border-radius: 999px; padding: 10px 18px; min-height: 46px; cursor: pointer; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.status { font-size: 0.95rem; color: var(--muted); min-height: 1.4em; }
.status.error { color: var(--ink); background: color-mix(in srgb, var(--yolk) 25%, var(--surface)); border-radius: 8px; padding: 10px 12px; }
.choices { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 1rem; }
.choice input { margin-top: 5px; accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.preview { border-top: 2px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 18px; }
.linkish { background: none; border: 0; padding: 4px 0; font: 500 0.9rem var(--display); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: flex-start; }

/* Box / library tabs, status row */
.tabs { display: flex; gap: 0; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; background: var(--bg); align-self: flex-start; max-width: 100%; }
.tab { font: 600 0.95rem var(--display); border: 0; background: none; color: var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer; }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fstatus { display: flex; align-items: center; gap: 12px; }
.fstatus .clear { margin-left: 0; }
.finder-head .add-btn { margin-left: auto; }

/* Personal tags and the box panel */
.tag.mine { background: color-mix(in srgb, var(--scallion) 22%, var(--surface)); text-transform: none; letter-spacing: 0; font-size: 0.75rem; }
.tag.inbox { background: var(--chip); border: 1px solid var(--scallion); }
.fchip.mine[aria-pressed="true"] { background: var(--scallion); border-color: var(--scallion); color: var(--bg); }
.cnote.mine { color: var(--ink); font-style: italic; }
.mybox { border: 2px solid var(--scallion); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 1rem; background: var(--surface); }
.mybox-head h2 { font-size: 1.2rem; }
.mybox-made { font: 600 1rem var(--display); }
.tags.editable .tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; font-size: 0.85rem; }
.tagx { border: 0; background: none; color: inherit; font: 700 1rem var(--display); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; }
.tag.add { border: 1px dashed var(--muted); background: none; cursor: pointer; font-size: 0.8rem; padding: 5px 9px; min-height: 32px; text-transform: none; letter-spacing: 0; }
.flabel-lg { font: 600 0.95rem var(--display); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; font: 400 1rem var(--body); font-size: max(16px, 1rem); color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; min-height: 46px; }
.field .hint, .tags .hint { font-size: 0.88rem; color: var(--muted); }
.mybox .field textarea, .mybox .field select, .mybox .field input[type="password"], .mybox .field input[type="date"] { background: var(--bg); }
.made-before { padding: 12px; border: 1px solid var(--rule); border-radius: 12px; }

/* Landing page */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.person { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; }
.person:hover { border-color: var(--scallion); }
.person img { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--yolk); flex: none; }
.person h2 { font-size: 1.35rem; }

/* Recipe photo, card thumbnails, recipe bar */
.vbar-right { display: flex; gap: 8px; }
@media (max-width: 520px) { .vprint-btn { padding-inline: 12px; } .vprint-btn .lbl { display: none; } }
.vphoto-wrap { display: flex; flex-direction: column; gap: 8px; }
.vphoto-wrap .status:empty { display: none; }
.vphoto { margin: 0; }
.vphoto img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); }
.photo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.card.has-photo .card-top { position: relative; padding-right: 78px; min-height: 66px; }
.cthumb { position: absolute; top: 0; right: 0; width: 66px; height: 66px; border-radius: 10px; object-fit: cover; border: 1px solid var(--rule); }
.print-only { display: none; }

/* Recipe editor */
.vtop { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vtop .linkish { padding: 6px 0; }
.status.saved { color: var(--ink); background: color-mix(in srgb, var(--scallion) 18%, var(--surface)); border-radius: 8px; padding: 10px 12px; }
.editor { display: flex; flex-direction: column; gap: 18px; font-size: 1rem; }
.echecks { border: 0; margin: 0; padding: 0; display: flex; flex-flow: row wrap; gap: 8px; }
.echecks legend { padding: 0; margin-bottom: 8px; }
.echeck { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font: 500 0.95rem var(--display); cursor: pointer; }
.echeck input { width: 20px; height: 20px; margin: 0; accent-color: var(--scallion); }
.egrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.egroups { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.egroups legend { padding: 0; }
.egroup-list { display: flex; flex-direction: column; gap: 10px; }
.egroup { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.egroup input[type="text"], .egroup textarea { font: 400 1rem var(--body); font-size: max(16px, 1rem); color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; width: 100%; }
.egroup input[type="text"] { font-family: var(--display); font-weight: 600; min-height: 44px; }
.easky .field textarea { background: var(--bg); }

/* Scale and nutrition on a recipe */
.pill { font: 600 0.92rem var(--display); border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill[aria-pressed="true"], .pill[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vtools { display: flex; flex-wrap: wrap; gap: 8px; }
.scale { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.scale-label { font: 500 0.75rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.scale .pill { min-width: 40px; justify-content: center; padding-inline: 8px; }
.scale-other { width: 64px; min-height: 40px; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 9px; background: var(--surface); color: var(--ink); font: 600 0.92rem var(--display); font-size: max(16px, 0.92rem); }
.scale-other.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.scale-note[hidden] { display: none; }
.vnutri { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 1rem; }
.nutri-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nutri-head .hint { flex: 1; min-width: 180px; font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.nutri-cal { display: flex; flex-direction: column; line-height: 1.05; }
.nutri-cal strong { font: 700 2rem var(--display); }
.nutri-cal span { font: 500 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nutri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.nutri-grid div { background: var(--surface); padding: 8px 10px; }
.nutri-grid dt { font: 500 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nutri-grid dd { margin: 2px 0 0; font: 600 1rem var(--display); }
.vnutri .status:empty { display: none; }
.vnutri details summary { cursor: pointer; font: 500 0.9rem var(--display); color: var(--muted); }
.vnutri details ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.92rem; display: flex; flex-direction: column; gap: 4px; }

/* Photo framing window */
.crop-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.crop-card { width: min(100%, 560px); background: var(--bg); color: var(--ink); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.crop-card h2 { font-size: 1.3rem; }
.crop-card .hint { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: #000; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 3px solid var(--yolk); outline-offset: 2px; }
.crop-img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-bg { position: absolute; top: -24px; left: -24px; width: calc(100% + 48px); height: calc(100% + 48px); max-width: none; object-fit: cover; filter: blur(16px) brightness(0.75); pointer-events: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); border-radius: 10px; }
.crop-grid::before, .crop-grid::after { content: ""; position: absolute; border: 0 solid rgba(255, 255, 255, 0.45); }
.crop-grid::before { inset: 0 33.333%; border-left-width: 1px; border-right-width: 1px; }
.crop-grid::after { inset: 33.333% 0; border-top-width: 1px; border-bottom-width: 1px; }
.crop-zoom { display: flex; align-items: center; gap: 12px; font: 600 0.95rem var(--display); }
.crop-zoom input { flex: 1; min-width: 0; accent-color: var(--scallion); }

/* A step's times and temperatures are marked (b.kp) for the printout; on screen they look like the rest. */
.step .kp { font-weight: inherit; }

/* Printing a recipe on letter paper, in the house recipe-card style: a serif rust-red title and
   headings, a bold-label Serves/Prep/Cook line over a rule, bulleted ingredients under gray group
   names, numbered steps with times and temperatures in bold. Same look for every kitchen. */
@media print {
  @page { size: letter; margin: 0.75in; }
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --ink: #1a1a1a; --muted: #555; --rule: #c8c8c8; --yolk: #8b2e1f; --yolk-ink: #8b2e1f;
    --on-yolk: #fff; --done: #1a1a1a; color-scheme: light;
    --p-red: #8b2e1f; --p-gray: #404040; --p-shade: #f3e9e3;
    --p-serif: Georgia, "Times New Roman", serif;
    --p-sans: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  }
  html, body { background: #fff !important; color: #1a1a1a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { padding: 0; font: 11pt/1.32 var(--p-sans); }
  #main, #adder, .vbar, .mybox, .vfoot, .vhint:not(.scale-note), .photo-tools, .vtools, .vnutri, .scale, .vphoto-wrap, .passrow, .vhead button, .vbody > .tags, .vbody > .eyebrow, .vbody > .vtop, .vedit, .vbody > .status { display: none !important; }
  .viewer { max-width: none; margin: 0; font: 11pt/1.32 var(--p-sans); }
  .vbody { display: block; }
  .vbody > * { margin: 0 0 6pt; }

  /* Title, kitchen line, and the Serves / Prep / Cook / Total line over a rust-red rule */
  .vtitle { display: block; font: 700 22pt/1.15 var(--p-serif); color: var(--p-red); letter-spacing: 0; margin: 0 0 4pt !important; }
  .vbody > .vprint-from { text-align: right; font: 8pt var(--p-sans); color: #777; margin: 0 0 2pt; }
  .vfacts { display: block; border: 0; border-bottom: 1.25pt solid var(--p-red); border-radius: 0; background: none; overflow: visible; padding: 0 0 5pt; margin: 0 0 12pt; }
  .vfacts div { display: inline; padding: 0; background: none; margin-right: 14pt; }
  .vfacts dt, .vfacts dd { display: inline; margin: 0; font: 11pt var(--p-sans); color: #1a1a1a; letter-spacing: 0; text-transform: none; }
  .vfacts dt { font-weight: 700; }
  .vfacts dt::after { content: ": "; }
  .vprint-photo { float: right; width: 2.2in; margin: 2pt 0 8pt 14pt; }
  .vprint-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4pt; }
  .vbody > .vprint-nutri { font-size: 9.5pt; color: #555; }

  /* The recipe's short description, and this kitchen's own note */
  .vnote { display: block; background: none; border: 0; border-radius: 0; padding: 0; font: italic 10.5pt/1.35 var(--p-sans); color: #444; }
  .vnote b, .vnote .conf { display: none; }
  .vnote.vmynote { display: flow-root; font-style: normal; color: #1a1a1a; background: var(--p-shade); border-left: 2.5pt solid var(--p-red); padding: 5pt 9pt; }
  .vnote.vmynote b { display: inline; font: 700 11pt var(--p-sans); color: var(--p-gray); letter-spacing: 0; text-transform: none; margin: 0 4pt 0 0; }
  .vnote.vmynote b::after { content: ":"; }

  /* Section headings (Equipment, Ingredients, Steps, Tips, Leftovers) and ingredient group names */
  .vhead { display: block; border: 0; padding: 0; margin: 12pt 0 4pt; break-after: avoid; }
  .vhead h2, .vbox h3 { font: 700 15pt/1.2 var(--p-serif); color: var(--p-red); }
  .vhead .vcount { display: none; }
  .vgroup { font: 700 12pt var(--p-sans); color: var(--p-gray); letter-spacing: 0; text-transform: none; margin: 8pt 0 3pt; break-after: avoid; }

  /* Bulleted lists: equipment (two columns), ingredients, tips */
  .vequip, .checks, .vbox ul { display: block; list-style: none; margin: 0 0 4pt; padding: 0 0 0 16pt; }
  .vequip { columns: 2; column-gap: 0.35in; }
  .vequip li, .checks li, .vbox li { position: relative; margin: 0 0 2pt; break-inside: avoid; font-size: 11pt; }
  .vequip li::before, .checks li::before, .vbox li::before { content: "•"; position: absolute; left: -11pt; }
  .checks label { display: block; min-height: 0; padding: 0; border: 0; }
  .checks input { display: none; }
  .checks input:checked + span { color: #1a1a1a; text-decoration: none; }

  /* Numbered steps with times and temperatures in bold */
  .vsteps { display: block; padding: 0; margin: 0; }
  .vsteps li { break-inside: avoid; margin: 0 0 5pt; }
  .step { display: flex; gap: 6pt; padding: 0; border: 0; border-radius: 0; background: none; color: #1a1a1a; font: 11pt/1.32 var(--p-sans); }
  .step .num, .step[aria-pressed="true"] .num { flex: none; display: block; width: 16pt; height: auto; text-align: right; border: 0; border-radius: 0; background: none; color: #1a1a1a; font: 11pt/1.32 var(--p-sans); }
  .step .num::after { content: "."; }
  .step .txt, .step[aria-pressed="true"] .txt { color: #1a1a1a; }
  .step .kp { font-weight: 700; }

  /* Tips and Leftovers read as sections, not boxes */
  .vbox { display: block; border: 0; border-radius: 0; padding: 0; background: none; font-size: 11pt; }
  .vbox h3 { margin: 12pt 0 4pt; break-after: avoid; }
  .vbox p { margin: 0; }
  .vcredit { font-size: 9pt; color: #555; margin-top: 10pt; }
  .print-only { display: flow-root; }
  .scale-note { font: italic 9pt var(--p-sans); color: #555; }
}
