:root {
  --bg: #faf6f0; --surface: #fff; --ink: #2a2420; --muted: #6e6860; --line: #e8dfd2;
  --accent: #b04a26; --accent-ink: #fff; --accent-soft: #f6e3d9; --ok: #3f7a3a; --ok-soft: #e4f0e1;
  --radius: 14px; --shadow: 0 1px 2px rgba(60,40,20,.06), 0 4px 14px rgba(60,40,20,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1815; --surface: #25211d; --ink: #f1ebe3; --muted: #a8a096; --line: #3a342e;
    --accent: #e07a4f; --accent-ink: #1b1815; --accent-soft: #3d2a20; --ok: #8fca86; --ok-soft: #22301f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h1 { font-family: "Iowan Old Style", Georgia, serif; font-size: clamp(1.8rem, 5vw, 2.5rem); margin: .2em 0 .3em; }
h2 { font-size: 1.15rem; margin: 1.4em 0 .6em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px 18px 48px; }
.muted { color: var(--muted); } .center { text-align: center; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: max(10px, env(safe-area-inset-top)) 18px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  color: var(--accent-ink); font-size: 13px; letter-spacing: .5px; }
nav { display: flex; align-items: center; gap: 14px; font-size: 15px; overflow-x: auto; }
nav a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.pill { padding: 5px 12px; border-radius: 99px; background: var(--accent); color: var(--accent-ink) !important; font-weight: 600; }
.pill.pro { background: var(--ok-soft); color: var(--ok) !important; }
.inline { display: inline; margin: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.danger { color: #c0392b; }

.flash { max-width: 924px; margin: 14px auto 0; padding: 12px 16px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.hero { text-align: center; padding: 18px 0 8px; }
.hero p { color: var(--muted); margin: 0 auto 18px; max-width: 34ch; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  text-decoration: none; font-weight: 600; transition: transform .12s, border-color .12s; }
.cat:hover, .cat:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.cat-emoji { font-size: 2.1rem; line-height: 1; }

.section { margin-top: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card-emoji { font-size: 1.8rem; }
.card-body { display: flex; flex-direction: column; min-width: 0; }
.card-body small { color: var(--muted); }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

.back { display: inline-block; margin: 4px 0 6px; color: var(--muted); text-decoration: none; font-size: 15px; }
.page-title span { margin-right: 4px; }
.builder fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.builder legend { font-weight: 700; margin-bottom: 8px; }
.opt { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 6px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 12px 0 16px; scrollbar-width: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-link { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 15px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.chip input:checked + span, .chip-link.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number] {
  width: 100%; padding: 12px 14px; margin-bottom: 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; }
input.short { width: 110px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.more { margin: 0 0 22px; } .more summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { width: 100%; padding: 15px; font-size: 1.05rem; }
.btn.locked { color: var(--muted); }

.loading { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; background: color-mix(in srgb, var(--bg) 94%, transparent); text-align: center; padding: 20px; }
.loading[hidden] { display: none; }
.loading p { font-size: 1.2rem; font-weight: 600; margin: 14px 0 0; }
.loading small { color: var(--muted); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent);
  animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--accent); font-weight: 700; margin: 10px 0 0; }
.byline { color: var(--muted); margin: -4px 0 8px; }
.lede { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0; border-block: 1px solid var(--line); padding: 10px 0; }
.meta div { text-align: center; } .meta dt { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.check { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.cols { display: grid; gap: 8px 40px; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1.5fr; } }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { border-bottom: 1px solid var(--line); }
.ingredients label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.ingredients input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
.steps { padding-left: 0; list-style: none; counter-reset: s; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 18px 46px; cursor: pointer; border-radius: 10px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.steps li.done { color: var(--muted); } .steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.tips { padding-left: 20px; color: var(--muted); }
.save-box { margin-top: 32px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.save-box h2 { margin-top: 0; }
.save-form label { display: block; font-weight: 600; margin-bottom: 10px; }
.save-form input[type=text] { margin-top: 6px; font-weight: 400; }
.check-row { display: flex !important; gap: 8px; align-items: center; font-weight: 400 !important; }
.danger-row { margin-top: 36px; text-align: center; }

/* Cooking mode: bigger text for reading from across the counter */
body.cooking { font-size: 21px; }
body.cooking .topbar, body.cooking .foot, body.cooking .save-box, body.cooking .back, body.cooking .lede { display: none; }
body.cooking #cook-mode { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.narrow { max-width: 440px; margin: 24px auto; }
.stack label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.stack input { margin-top: 6px; font-weight: 400; }
.perks { list-style: none; padding: 0; } .perks li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.price { font-size: 2.2rem; font-weight: 800; text-align: center; margin: 18px 0; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.search { display: flex; gap: 8px; } .search input { margin: 0; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 max(24px, env(safe-area-inset-bottom)); }

@media print {
  .topbar, .foot, .actions, .save-box, .back, .danger-row, .flash { display: none !important; }
  body { background: #fff; color: #000; }
}
