/* Layout: one column of cards on a quiet ground, masthead with search and filters above. */
:root {
  --bg: #f4f6f1; --surface: #ffffff; --ink: #1c2823; --muted: #5b6b64; --line: #dde5dc;
  --accent: #2d6a58; --accent-ink: #ffffff; --warm: #b8603d; --chip: #e6ece4;
  --shadow: 0 1px 2px rgba(20, 40, 32, 0.06), 0 6px 18px rgba(20, 40, 32, 0.05);
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1714; --surface: #17221e; --ink: #e6efe9; --muted: #9bb0a6; --line: #26362f;
    --accent: #7fc4a9; --accent-ink: #0f1714; --warm: #e39a72; --chip: #203029;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1714; --surface: #17221e; --ink: #e6efe9; --muted: #9bb0a6; --line: #26362f;
  --accent: #7fc4a9; --accent-ink: #0f1714; --warm: #e39a72; --chip: #203029;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.masthead { padding-block: 40px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: "Literata", Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; text-wrap: balance; }
.lede { margin: 10px 0 22px; max-width: 62ch; color: var(--muted); text-wrap: pretty; }
.search input { width: 100%; font: inherit; font-size: 17px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.filters { margin-top: 16px; display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--ink); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.toggles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggles input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
main.wrap { padding-block: 24px 48px; }
.count { margin: 0 0 14px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.card { width: 100%; height: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card:hover { border-color: var(--accent); }
.card .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .title { font-family: "Literata", Georgia, serif; font-size: 18px; font-weight: 600; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--accent); }
.empty { padding: 32px 0; color: var(--muted); text-align: center; }
.foot { padding-block: 8px 40px; font-size: 13px; color: var(--muted); max-width: 72ch; }
.foot p { margin: 0; text-wrap: pretty; }
dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
dialog::backdrop { background: rgba(10, 20, 16, 0.5); }
.sheet { padding: 28px 24px 12px; max-height: calc(100dvh - 80px); overflow-y: auto; overflow-x: hidden; }
.sheet h2 { margin: 4px 0 6px; font-family: "Literata", Georgia, serif; font-size: clamp(24px, 4vw, 30px); line-height: 1.2; text-wrap: balance; }
.sheet h3 { margin: 22px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.sheet .meta { margin: 0; color: var(--muted); font-size: 14px; }
.ing { padding-left: 18px; margin: 0; display: grid; gap: 4px; }
.steps { padding-left: 22px; margin: 0; display: grid; gap: 10px; }
.note { margin: 20px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--chip); font-size: 14px; text-wrap: pretty; }
.note strong { color: var(--warm); }
@media (min-width: 720px) {
  .masthead { padding-block: 56px 36px; }
  .filters { grid-template-columns: 1fr; }
}
.searchrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.searchrow .search { flex: 1 1 260px; min-width: 0; }
.btn { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.searchrow .btn { align-self: center; }
.selects { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.selects label { display: inline-flex; align-items: center; gap: 8px; }
.selects select { font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.star { margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 24px 20px; border-top: 1px solid var(--line); }
.ing label { display: inline-flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.ing label.done { color: var(--muted); text-decoration: line-through; }
.ing input { accent-color: var(--accent); margin-top: 5px; }
#listItems li { list-style: none; }
@media (max-width: 719px) {
  .masthead { padding-block: 28px 18px; }
  .lede { margin-bottom: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; padding-block: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; min-height: 44px; padding-inline: 16px; }
  .toggles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; gap: 8px; }
  .toggles::-webkit-scrollbar { display: none; }
  .toggles label { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .selects select { min-height: 44px; font-size: 16px; }
  .search input { min-height: 48px; font-size: 16px; }
  .btn { min-height: 44px; }
  .card { min-height: 64px; }
  .dlg-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
