:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --good: #4ade80;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1rem 3rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.topbar { padding: 1.5rem 0 1rem; }
.topbar h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.tagline { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

.account {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.status { margin: 1rem 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.status[data-tone="error"] { color: #fca5a5; }
.status[data-tone="warn"] { color: #fcd34d; }
.status[data-tone="ok"] { color: var(--good); }

.panel {
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.panel p { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }
.panel p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

.form { display: grid; gap: 0.5rem; justify-items: start; }

.form label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.form input,
.form textarea {
  width: 100%;
  max-width: 34rem;
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form textarea { resize: vertical; line-height: 1.5; }
.form input[type="number"] { max-width: 8rem; }

.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.row span { display: grid; gap: 0.25rem; }

.button {
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.button:hover { filter: brightness(1.1); }

.linkbutton {
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

.form input:focus-visible,
.button:focus-visible,
.linkbutton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.card {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.card a { color: var(--accent); font-size: 0.85rem; }
.card .source { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.85rem; }

.card summary {
  font-weight: 600;
  cursor: pointer;
  list-style-position: outside;
}

.card summary::marker { color: var(--muted); }

.ingredients, .steps { margin: 0.75rem 0; padding-left: 1.25rem; }
.ingredients { list-style: none; padding-left: 0; }
.ingredients li { padding: 0.15rem 0; border-bottom: 1px solid var(--line); }
.ingredients li:last-child { border-bottom: 0; }
.steps li { padding: 0.2rem 0; }

.badge {
  justify-self: start;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--good);
  border-radius: 999px;
}

.footer { margin-top: 2rem; color: var(--muted); font-size: 0.8rem; }

@media (min-width: 720px) {
  body { max-width: 60rem; margin: 0 auto; }
}
