/* Recipe box v1 — dark-only minimal, mobile-first */

:root {
  --bg: #141311;
  --surface: #1e1c18;
  --border: #322e27;
  --text: #f0ece4;
  --muted: #a8a094;
  --accent: #e8a33d;
  --accent-dim: #8a5f1f;
  --danger: #e05c5c;
  --green: #7bc98a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.35rem; margin: 0.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; color: var(--accent); }

/* ---------- Top bar ---------- */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 8px; }
.back:hover { color: var(--text); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1408;
  font-weight: 700;
}
.btn.ghost { background: transparent; }
.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}
.btn.small { min-height: 40px; padding: 0 14px; font-size: 0.9rem; }

/* ---------- Search ---------- */
#search {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}
#search::placeholder { color: var(--muted); }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-height: 96px;
  touch-action: manipulation;
}
.card:active { transform: scale(0.99); border-color: var(--accent-dim); }
.card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.card-meta { font-size: 0.85rem; color: var(--muted); }
.card-tags, .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ---------- Detail ---------- */
.meta { color: var(--muted); margin: 4px 0 10px; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { margin-bottom: 4px; }
.ing {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  min-height: 48px;
  touch-action: manipulation;
}
.ing input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.ing.done span { text-decoration: line-through; color: var(--muted); }
.steps { padding-left: 1.4rem; margin: 0; }
.steps li { margin-bottom: 12px; line-height: 1.5; }
.row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
#reset-checks { margin-top: 8px; }

/* ---------- Form ---------- */
.field {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.field textarea { resize: vertical; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--danger); min-height: 1.4em; margin-bottom: 8px; }
