/* Warm and quiet: paper, brown ink, one teal accent used sparingly. */
:root {
  --paper: #faf7f2;
  --raised: #ffffff;
  --ink: #2e2823;
  --soft: #5f564e;
  --muted: #968b80;
  --line: #ebe4da;
  --accent: #2c7a74;
  --accent-wash: #e2efed;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1916;
    --raised: #24201c;
    --ink: #ece4da;
    --soft: #c4b8ab;
    --muted: #8f8377;
    --line: #342e28;
    --accent: #72c0b6;
    --accent-wash: #1d302d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { font-family: var(--serif); font-size: 21px; text-decoration: none; margin-right: auto; white-space: nowrap; }
.nav-link { font-size: 14px; color: var(--soft); text-decoration: none; }
.nav-link:hover { color: var(--ink); }
.units { display: inline-flex; gap: 2px; font-size: 13px; }
.units button { border: 0; background: none; padding: 2px 4px; cursor: pointer; color: var(--muted); }
.units button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.units .sep { color: var(--line); }
@media (max-width: 420px) {
  .top .wrap { gap: 12px; }
  .brand { font-size: 18px; }
  .units { font-size: 12px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 9px 18px; text-decoration: none; cursor: pointer; font-size: 15px; white-space: nowrap; color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: default; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--soft); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link-btn:hover { color: var(--ink); text-decoration-color: var(--muted); }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 6px; font-size: 18px; line-height: 1; color: var(--soft); text-decoration: none; }

/* ---------- list ---------- */
.hero { padding: 44px 0 4px; }
.hero h1 { font-size: clamp(30px, 7vw, 40px); }
.hero p { margin: 6px 0 0; color: var(--muted); }

.search {
  width: 100%; margin: 26px 0 14px; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; font-size: 17px; outline: none; border-radius: 0;
}
.search:focus { border-bottom-color: var(--ink); }
.search::placeholder { color: var(--muted); }

.filter-rows { display: grid; gap: 4px; }
.filters { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: baseline; font-size: 14px; }
/* Course and diet stay on one line each; on a phone they scroll sideways. */
.filters.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; padding-bottom: 2px; }
.filters.scroll::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; white-space: nowrap; }
.filter-foot { display: flex; gap: 18px; margin-top: 8px; }
.filter-row { display: flex; align-items: baseline; min-width: 0; }
.filter-row .filters { flex: 1; min-width: 0; }
.chip {
  border: 0; background: none; padding: 3px 0; cursor: pointer; color: var(--soft); font-size: 14px;
  border-bottom: 1px solid transparent;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.filter-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 66px; flex: none; }

.listbar { display: flex; align-items: center; gap: 16px; margin: 22px 0 4px; font-size: 13px; color: var(--muted); }
.listbar .spacer { flex: 1; }
.listbar select { border: 0; background: none; color: var(--soft); font-size: 13px; cursor: pointer; padding: 0; }

.list { padding-bottom: 110px; }
.item {
  position: relative; display: block; text-decoration: none; padding: 16px 0 15px; border-top: 1px solid var(--line);
}
.item:last-child { border-bottom: 1px solid var(--line); }
.item h3 { font-size: 21px; transition: color .15s; }
.item:hover h3 { color: var(--accent); }
.item .meta { margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.item.pickable { padding-left: 34px; }
.item .pick {
  position: absolute; left: 0; top: 21px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted);
}
.item.picked .pick { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--paper); }
.empty { text-align: center; color: var(--muted); padding: 56px 0; }

.printbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--raised); border-top: 1px solid var(--line);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.printbar .wrap { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.printbar .spacer { flex: 1; }

/* ---------- recipe ---------- */
.recipe { padding-top: 28px; padding-bottom: 120px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.recipe h1 { font-size: clamp(34px, 8vw, 48px); margin: 22px 0 12px; }
.recipe .lede { font-family: var(--serif); font-size: 20px; line-height: 1.45; color: var(--soft); margin: 0 0 14px; }
.recipe .by { font-size: 14px; color: var(--muted); margin: 0; }
.recipe .labels { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.recipe .labels .diet { color: var(--accent); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 24px 0 0; font-size: 14px; color: var(--soft); }
.facts b { font-weight: 500; color: var(--muted); margin-right: 6px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 26px 0 8px; }

.cols { display: grid; gap: 36px; margin-top: 40px; }
@media (min-width: 720px) { .cols { grid-template-columns: 1fr 1.55fr; gap: 48px; } .cols .ing { position: sticky; top: 24px; align-self: start; } }
.recipe h2 { font-size: 24px; margin-bottom: 14px; }
.recipe h4, .sheet h4, .slide h4 { margin: 18px 0 4px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
ul.ingredients { list-style: none; padding: 0; margin: 0; }
ul.ingredients li { padding: 7px 0 7px 26px; border-bottom: 1px solid var(--line); position: relative; cursor: pointer; font-size: 15.5px; }
ul.ingredients li::before {
  content: ''; position: absolute; left: 0; top: 14px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted);
}
ul.ingredients li.got { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
ul.ingredients li.got::before { background: var(--accent); border-color: var(--accent); }
ol.steps { padding: 0; margin: 0; list-style: none; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding: 0 0 20px 34px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; font-family: var(--serif); font-size: 20px; color: var(--accent);
}
.notes { margin-top: 12px; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--soft); white-space: pre-wrap; }
.notes::before { content: 'Notes'; display: block; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.source { margin-top: 22px; font-size: 13.5px; color: var(--muted); word-break: break-word; }

/* ---------- make this (cook mode) ---------- */
.cook { position: fixed; inset: 0; z-index: 50; background: var(--paper); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.cook-top .title { flex: 1; font-family: var(--serif); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 2px; background: var(--line); }
.progress div { height: 100%; background: var(--accent); transition: width .25s; }
.deck { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.deck::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; overflow-y: auto; padding: 24px 24px; display: flex; }
.slide .inner { margin: auto; width: 100%; max-width: 560px; }
.slide .n { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.slide .text { font-family: var(--serif); font-size: clamp(24px, 6vw, 32px); line-height: 1.35; margin-top: 14px; }
.slide h2 { font-size: 30px; margin: 10px 0 14px; }
.cook-nav { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.cook-nav .btn { flex: 1; padding: 14px; font-size: 16px; }

.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(28, 22, 18, .35); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 600px; max-height: 82vh; overflow-y: auto; background: var(--raised);
  border-radius: 18px 18px 0 0; padding: 20px 22px calc(24px + env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet h2 { font-size: 24px; }
.sheet .facts { margin: 4px 0 10px; }

/* ---------- add ---------- */
.form { padding-top: 28px; padding-bottom: 80px; max-width: 600px; }
.form h1 { font-size: 36px; margin: 22px 0 8px; }
.form > p { color: var(--soft); margin-top: 0; }
.field { margin: 22px 0; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field .hint { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); font-size: 16px; outline: none;
}
.input:focus { border-color: var(--muted); }
textarea.input { min-height: 180px; resize: vertical; }
.tabs { display: flex; gap: 18px; flex-wrap: wrap; margin: 28px 0 0; }
.rec { display: flex; align-items: center; gap: 14px; }
.status { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); font-size: 15px; }
.status.ok { border-color: var(--accent); color: var(--accent); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: 100%; max-width: 340px; text-align: center; }
.login h1 { font-size: 38px; margin-bottom: 8px; }
.login .input { margin: 28px 0 12px; text-align: center; }
.login .btn { width: 100%; padding: 12px; }
.login .wrong { color: var(--accent); margin-top: 14px; font-size: 14px; }

/* ---------- print and PDF ---------- */
.print-tools { padding: 18px 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.print-tools .hint { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.print-page { background: #fff; color: #222; }
.print-page .top { display: none; }
.book { font-family: 'Newsreader', Georgia, serif; color: #222; }
.cover { padding: 120px 0 60px; text-align: center; }
.cover h1 { font-size: 46px; }
.cover p { color: #777; font-size: 17px; margin: 8px 0 0; }
.toc { padding: 30px 0; }
.toc h2 { font-size: 26px; margin-bottom: 14px; }
.toc h3 { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #888; margin: 18px 0 6px; font-weight: 500; }
.toc ol { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; display: flex; gap: 10px; font-size: 15px; padding: 2px 0; }
.toc li .no { color: #999; width: 26px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.toc a { text-decoration: none; color: inherit; }
.print-recipe { padding: 34px 0; border-top: 1px solid #e5e5e5; }
.print-recipe .kicker { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #999; }
.print-recipe h1 { font-size: 30px; margin: 4px 0 6px; }
.print-recipe .lede { margin: 0 0 4px; font-size: 16px; color: #444; font-style: italic; }
.print-recipe .labels { font-family: var(--sans); font-size: 12px; color: #777; }
.print-recipe .facts { font-family: var(--sans); font-size: 12px; color: #555; margin: 10px 0 0; gap: 4px 18px; }
.print-recipe .facts b { color: #999; }
.print-recipe h2 { font-size: 18px; margin: 18px 0 6px; }
.print-recipe h4 { font-family: var(--sans); font-size: 10.5px; margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .08em; color: #888; font-weight: 500; }
.print-recipe ul { columns: 2; column-gap: 30px; margin: 0; padding-left: 16px; font-size: 14px; }
.print-recipe ul li { break-inside: avoid; margin-bottom: 2px; }
.print-recipe ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.print-recipe ol li { margin-bottom: 6px; break-inside: avoid; }
.print-recipe .notes { color: #444; font-size: 13px; border-color: #e5e5e5; }
.print-recipe .notes::before { color: #999; }
.print-recipe .source { color: #888; font-size: 11.5px; font-family: var(--sans); }

@media print {
  @page { margin: 16mm 15mm; }
  body { background: #fff; }
  .no-print, .top, .printbar { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .cover { padding-top: 35vh; break-after: page; }
  .toc { break-after: page; padding-top: 0; }
  .print-recipe { border: 0; padding: 0; break-before: page; }
  .print-recipe:first-child { break-before: auto; }
  a { text-decoration: none; color: inherit; }
}
