:root,
[data-theme="light"] {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --text: #22262b;
  --muted: #5c6570;
  --primary: #c1440e;
  --primary-contrast: #ffffff;
  --border: #e2e0da;
  --accent: #2e7d32;
}

[data-theme="dark"] {
  --bg: #14171a;
  --surface: #1e2226;
  --text: #eceff1;
  --muted: #a3adb5;
  --primary: #ff7a45;
  --primary-contrast: #14171a;
  --border: #2c3136;
  --accent: #66bb6a;
}

[data-theme="seasonal"] {
  --bg: #fff6e9;
  --surface: #fffaf1;
  --text: #3a2a1d;
  --muted: #7a5f45;
  --primary: #d9822b;
  --primary-contrast: #ffffff;
  --border: #f0d9b5;
  --accent: #8d6a3f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero { text-align: center; padding: 3rem 1rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

.button, button, input[type="submit"] {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 1rem;
}

.button-primary, button[type="submit"], input[type="submit"] {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  text-decoration: underline;
  font: inherit;
}

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field-checkbox label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.error { color: #c0392b; font-size: 0.9rem; margin: 0.15rem 0 0; }

.flash-messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 0.5rem; border: 1px solid var(--border); }
.flash-success { border-color: var(--accent); }
.flash-error { border-color: #c0392b; }
.flash-info { border-color: var(--primary); }

.meal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.meal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.meal-card h3 { margin: 0 0 0.35rem; }
.meal-card .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.6rem; }
.meal-card .tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.filter-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.pick-result { text-align: center; padding: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.pick-result h2 { font-size: 2rem; margin-top: 0; }

table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }

.pagination { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; background: var(--bg); border: 1px solid var(--border); }
