:root { --ink:#1f2328; --muted:#6b7280; --line:#e5e7eb; --bg:#f6f7f9; --card:#fff; --accent:#3a7d1f; --accent-ink:#fff; --danger:#b91c1c; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:var(--ink); background:var(--bg); }
a { color:var(--accent); }
.top { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; padding:12px 20px; background:var(--accent); }
.top a { color:var(--accent-ink); text-decoration:none; }
.brand { font-weight:700; font-size:18px; }
.top nav { display:flex; flex-wrap:wrap; gap:16px; }
main { max-width:1100px; margin:0 auto; padding:20px 16px 48px; }
h1 { font-size:24px; margin:8px 0 12px; } h2 { font-size:18px; margin:20px 0 8px; }
.row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; }
.narrow { max-width:420px; margin:40px auto; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; } .grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
label { display:block; margin:8px 0; font-weight:600; font-size:14px; }
input, select, textarea { display:block; width:100%; margin-top:4px; padding:8px 10px; border:1px solid #cbd5e1; border-radius:6px; font:inherit; background:#fff; }
input[type=checkbox] { display:inline; width:auto; margin:0 6px 0 0; }
.check { font-weight:400; }
.btn { display:inline-block; background:var(--accent); color:var(--accent-ink); border:0; border-radius:6px; padding:9px 16px; font:inherit; font-weight:600; cursor:pointer; text-decoration:none; }
.btn.light { background:#fff; color:var(--ink); border:1px solid #cbd5e1; }
.link { background:none; border:0; padding:0; color:var(--accent); cursor:pointer; font:inherit; }
.danger { color:var(--danger); }
.inline { display:inline; } .right { text-align:right; white-space:nowrap; }
.muted { color:var(--muted); } .small { font-size:13px; }
.flash { padding:10px 14px; border-radius:6px; margin:8px 0 16px; background:#ecfdf5; border:1px solid #a7f3d0; }
.flash.err { background:#fef2f2; border-color:#fecaca; }
.search { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:16px; }
.search input { flex:1 1 220px; width:auto; margin:0; } .search select { width:auto; margin:0; }
table.list { width:100%; border-collapse:collapse; } table.list th, table.list td { text-align:left; padding:8px 6px; border-bottom:1px solid var(--line); vertical-align:top; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:16px; }
.rcard { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; color:var(--ink); text-decoration:none; }
.rcard img, .noimg { width:100%; height:150px; object-fit:cover; display:block; }
.noimg { display:flex; align-items:center; justify-content:center; background:#f3f4f6; color:var(--muted); }
.rbody { padding:10px 12px; }
.recipe { display:grid; grid-template-columns:1fr 1fr; gap:24px; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; }
.hero { width:100%; max-height:340px; object-fit:cover; border-radius:8px; }
.thumb { width:160px; height:110px; object-fit:cover; border-radius:6px; display:block; }
ul.ing { padding-left:18px; } ul.ing li { margin:4px 0; } .qty { font-weight:600; }
ol.steps li { margin:6px 0; }
.ingrow { display:grid; grid-template-columns:80px 90px 1fr 1fr 28px; gap:8px; align-items:center; margin-bottom:8px; }
.ingrow input { margin:0; }
@media (max-width:720px) {
  .grid2, .grid3, .recipe { grid-template-columns:1fr; }
  .ingrow { grid-template-columns:70px 80px 1fr 28px; } .ingrow .t { grid-column:1 / 4; }
}
@media print { .top, .noprint, .btn { display:none; } body { background:#fff; } .recipe { border:0; } }

/* Branded recipe sheet: ZA circle top left, recipe name beside it in green */
:root { --za:#3a7d1f; }
.actions { text-align:right; margin-bottom:8px; }
.sheet { background:#fff; border:1px solid var(--line); border-radius:10px; padding:24px; margin-bottom:16px; max-width:820px; }
.sheet-head { display:flex; align-items:flex-start; gap:20px; margin-bottom:8px; }
.za-logo { flex:0 0 auto; width:130px; height:130px; border:4px solid var(--za); border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:var(--za); font:700 54px/1 Georgia,"Times New Roman",serif; letter-spacing:1px; }
.sheet-title { flex:1; margin:0; padding:10px 16px; border:2px solid var(--za); border-radius:6px; color:var(--za); font-size:24px; }
.sheet-label { display:inline-block; border:2px solid #222; padding:4px 28px; font-weight:700; margin:16px 0 10px; }
.ing-box { border:1.5px solid #222; padding:10px 12px; max-width:420px; }
.ing-table { border-collapse:collapse; width:100%; } .ing-table th, .ing-table td { text-align:left; padding:3px 12px 3px 0; vertical-align:top; }
.ing-table th { font-weight:600; }
ul.notes li { margin:4px 0; }
@media (max-width:600px) { .za-logo { width:88px; height:88px; font-size:36px; } .sheet-title { font-size:19px; } .sheet { padding:16px; } }
@media print { .sheet { border:0; padding:0; } }

/* One-page layout: photo in a small green box under the name, two columns below */
.head-right { flex:1; min-width:0; }
.head-info { display:flex; gap:14px; align-items:flex-start; margin-top:10px; }
.photo-box { flex:0 0 auto; border:2px solid var(--za); border-radius:6px; padding:3px; }
.photo-box img { display:block; width:220px; height:140px; object-fit:cover; border-radius:3px; }
.meta { margin:0 0 4px; color:var(--muted); } .desc { margin:0; }
.sheet-cols { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); gap:28px; margin-top:6px; }
.sheet-cols h2 { margin-top:16px; }
.sheet-cols .ing-box { max-width:none; }
@media (max-width:720px) { .sheet-cols { grid-template-columns:1fr; } .head-info { flex-direction:column; } .photo-box img { width:100%; height:180px; } }
@page { size:letter; margin:12mm; }
@media print {
  body { font-size:10.5pt; line-height:1.35; } main { padding:0; max-width:none; }
  .za-logo { width:96px; height:96px; font-size:40px; border-width:3px; }
  .sheet-title { font-size:18pt; padding:6px 12px; }
  .photo-box img { width:170px; height:110px; }
  .sheet-cols { grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); gap:18px; }
  .sheet-cols h2 { font-size:12pt; margin:12px 0 4px; } .sheet-label { margin:12px 0 6px; padding:2px 20px; }
  ol.steps li, ul.notes li { margin:3px 0; } ol.steps, ul.notes { padding-left:18px; margin:0; }
  .sheet, .sheet-cols section { break-inside:avoid; }
  .flash { display:none; }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

.ing-table td:last-child { white-space:nowrap; }

/* v6: green boxes for ingredients and instructions, smaller photo */
.sheet-cols { align-items:stretch; gap:18px; margin-top:14px; }
.gbox { border:2px solid var(--za); border-radius:6px; padding:12px 16px; }
.gbox h2 { margin:0 0 8px; color:var(--za); font-size:17px; }
.gbox h3 { margin:12px 0 4px; color:var(--za); font-size:15px; }
.gbox ol.steps, .gbox ul.notes { margin:0; padding-left:20px; }
.photo-box img { width:150px; height:100px; }
.head-info { align-items:center; }
@media (max-width:720px) { .photo-box img { width:150px; height:100px; } .head-info { flex-direction:row; } }
@media print {
  .photo-box img { width:120px; height:80px; }
  .gbox { padding:8px 12px; } .gbox h2 { font-size:12.5pt; margin-bottom:4px; } .gbox h3 { font-size:11pt; margin:8px 0 2px; }
  .sheet-cols { gap:12px; margin-top:10px; }
}

/* v7: no photos; servings in a small green box under the name */
.photo-box { display:none; }
.head-info { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:flex-start; margin-top:10px; }
.serve-box { display:inline-block; border:2px solid var(--za); border-radius:6px; padding:3px 12px; color:var(--za); font-weight:700; }
.head-info .meta { margin:0; }
.rcard .rbody { padding:14px 16px; border-top:4px solid var(--za); }
@media print { .serve-box { padding:2px 10px; } }
