:root {
  --bg-1: #fff3d6;
  --bg-2: #ffd79f;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --text: #1f2a1f;
  --muted: #4d5b4d;
  --accent: #1f7a5f;
  --accent-strong: #14503f;
  --vegan: #2c8c44;
  --vegetarian: #8c6a2c;
  --shadow: 0 14px 35px rgba(49, 37, 9, 0.14);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.75), transparent 42%),
    radial-gradient(circle at 88% 85%, rgba(255, 235, 189, 0.9), transparent 50%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.page {
  width: min(1150px, 92vw);
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1.5rem;
}

.hero,
.controls,
.output {
  background: var(--surface);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 1.4rem;
}

.kicker {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
}

h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.subtitle {
  margin: 0.5rem 0 0;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
}

.controls-help {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.diet-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1rem;
}

.diet-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 42, 31, 0.15);
}

.exclusion-field {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
  font-weight: 500;
}

.exclusion-field input {
  width: min(540px, 100%);
  border: 1px solid rgba(31, 42, 31, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
}

.exclusion-field input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, white);
  outline-offset: 1px;
}

.button-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

button {
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 18px rgba(20, 80, 63, 0.28);
}

button:hover {
  transform: translateY(-2px);
}

.secondary-btn {
  background: linear-gradient(120deg, #596e65, #3f5149);
  box-shadow: 0 8px 18px rgba(32, 41, 37, 0.28);
}

.status {
  margin: 0.75rem 0 0;
  min-height: 1.3rem;
  color: var(--accent-strong);
}

.recipe-output {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.85rem;
}

.recipe-block {
  background: var(--surface-strong);
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 31, 0.12);
  overflow: clip;
}

.recipe-block summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem;
}

.recipe-block summary::-webkit-details-marker {
  display: none;
}

.recipe-block summary::after {
  content: "+";
  float: right;
  font-weight: 700;
  color: var(--accent-strong);
}

.recipe-block[open] summary::after {
  content: "-";
}

.summary-title {
  display: block;
  margin: 0;
  font-size: 1.05rem;
  font-family: "Fraunces", serif;
}

.summary-items {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.summary-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.ingredient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(31, 42, 31, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.2rem 0.5rem 0.2rem 0.25rem;
}

.ingredient-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(31, 42, 31, 0.12);
}

.chip-name {
  font-weight: 600;
}

.recipe-editors {
  border-top: 1px solid rgba(31, 42, 31, 0.12);
  padding: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.selection-rule {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.option-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.option-item .ingredient-chip {
  border-color: rgba(31, 42, 31, 0.16);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.option-item input[type="checkbox"]:checked + .ingredient-chip {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, white);
  background: color-mix(in srgb, var(--accent) 8%, white);
}

.option-item input[type="checkbox"]:focus-visible + .ingredient-chip {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, white);
  outline-offset: 1px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge.vegan {
  background: color-mix(in srgb, var(--vegan) 18%, white);
  color: var(--vegan);
}

.badge.vegetarian {
  background: color-mix(in srgb, var(--vegetarian) 18%, white);
  color: var(--vegetarian);
}

@media (max-width: 650px) {
  .page {
    width: min(95vw, 1150px);
    margin-top: 1rem;
  }

  .hero,
  .controls,
  .output {
    padding: 1rem;
  }
}
