:root {
  --bg: #f6f1e9;
  --surface: #fffdf9;
  --text: #2a2620;
  --muted: #6f675c;
  --line: #e4dccf;
  --accent: #b5502f;
  --accent-text: #fff;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b18;
    --surface: #27241f;
    --text: #ece6dc;
    --muted: #a39a8c;
    --line: #3a352e;
    --accent: #e07a52;
    --accent-text: #1d1b18;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }

.bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
nav { display: flex; gap: 1rem; align-items: center; }
nav a { text-decoration: none; color: var(--muted); }
nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

main { max-width: 42rem; margin: 0 auto; padding: 1rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.error { color: #c0392b; margin: 0; }
.pill { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: .75rem; text-align: center; }

label { display: block; font-weight: 600; font-size: .9rem; }
input, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], textarea {
  display: block; width: 100%; margin-top: .25rem;
  padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font-weight: 400;
}
textarea { min-height: 8rem; resize: vertical; }
button {
  padding: .6rem 1rem; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; }
button:disabled { opacity: .5; }

.recipes { list-style: none; padding: 0; margin: 1rem 0 0; }
.recipes li + li { margin-top: .5rem; }
.recipes a { display: block; text-decoration: none; color: inherit; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.tag { font-size: .8rem; padding: 0 .5rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

.recipe-photo { width: 100%; border-radius: var(--radius); margin-bottom: .75rem; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { display: flex; gap: .5rem; align-items: baseline; padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.steps { white-space: pre-wrap; }

.list { list-style: none; padding: 0; margin: 1rem 0 0; }
.list li { display: flex; gap: .75rem; align-items: center; padding: .65rem .25rem; border-bottom: 1px solid var(--line); }
.list input[type="checkbox"] { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); flex: none; }
.list .done .name { text-decoration: line-through; color: var(--muted); }
.list .for { font-size: .8rem; color: var(--muted); }
.list .del { margin-left: auto; }
