:root {
  --bg: #f9f3ea;
  --surface: #fffaf2;
  --surface-2: #fff;
  --text: #21201d;
  --muted: #605a50;
  --line: #e6d8c4;
  --brand: #cb5d2f;
  --brand-2: #245c4a;
  --chip: #f4e3cd;
  --shadow: 0 16px 40px rgba(40, 25, 8, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Archivo", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -20%, #ffe0be 0%, var(--bg) 45%, #f7efe2 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  top: -90px;
  right: -90px;
  background: #ffcfab;
}

.bg-shape-b {
  width: 260px;
  height: 260px;
  left: -110px;
  bottom: 8%;
  background: #d5efd8;
}

.hero,
.container {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 18px 16px 8px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-2);
}

.all-link {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-2);
  display: inline-grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.all-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

h1 {
  margin: 6px 0;
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 9vw, 42px);
  line-height: 1.02;
}

.patient-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.container {
  padding: 10px 12px 84px;
}

.section-title {
  margin: 0;
  font-size: 22px;
  font-family: "Fraunces", serif;
}

.section-subtitle {
  color: var(--muted);
  margin: 7px 0 12px;
  font-size: 14px;
}

.accordion {
  display: grid;
  gap: 12px;
}

.meal-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.meal-trigger {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-align: left;
}

.meal-trigger:focus-visible,
.ingredient-chip:focus-visible,
.modal-close:focus-visible,
.all-link:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
}

.meal-chevron {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 22px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.meal-panel {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.meal-panel[hidden] {
  display: none;
}

.reference-section {
  margin-top: 18px;
}

.reference-item {
  background: #fff7ee;
}

.reference-panel {
  gap: 12px;
}

.reference-category {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0;
}

.reference-category-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.reference-category-trigger:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: -3px;
}

.reference-category-title {
  margin: 0;
  font-size: 15px;
  color: var(--brand-2);
  font-weight: 700;
}

.reference-category-chevron {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 20px;
}

.reference-entry-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.reference-entry-list[hidden] {
  display: none;
}

.reference-entry {
  border: 1px dashed #e2cfae;
  border-radius: 10px;
  padding: 8px;
  background: #fffaf3;
}

.reference-principal,
.reference-substitutions {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.reference-principal {
  font-weight: 800;
  margin-bottom: 4px;
}

.reference-substitutions {
  color: var(--muted);
}

.option-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  animation: reveal 280ms ease;
}

@keyframes reveal {
  from {
    transform: translateY(4px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.option-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.option-prep {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.ingredient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ingredient-chip {
  border: 1px solid #d9b98f;
  background: linear-gradient(170deg, #fff2de, var(--chip));
  color: #453a2f;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
}

.ingredient-chip .chip-qty {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #725f4a;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 12, 6, 0.52);
  z-index: 40;
}

.modal {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 0);
  width: min(680px, 100vw);
  max-height: 84vh;
  overflow: auto;
  background: var(--surface-2);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.25);
  z-index: 45;
  padding: 14px 14px 24px;
}

.hidden {
  display: none;
}

.modal-close {
  margin-left: auto;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  font-weight: 700;
  padding: 8px 12px;
}

.modal-category {
  margin: 8px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

.modal h3 {
  margin: 4px 0;
  font-family: "Fraunces", serif;
  font-size: 26px;
}

.modal-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-content {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.eq-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  align-items: baseline;
}

.eq-name {
  font-weight: 600;
}

.eq-amount {
  font-weight: 800;
  color: var(--brand);
  white-space: nowrap;
}

.notice {
  border-radius: 12px;
  border: 1px dashed #cc9b7e;
  background: #fff3e8;
  color: #78422f;
  padding: 10px;
  font-size: 13px;
}

@media (min-width: 780px) {
  .hero {
    padding: 22px 24px 10px;
  }

  .container {
    padding: 10px 24px 88px;
  }

  .accordion {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meal-item {
    align-self: start;
  }

  .modal {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    max-height: 86vh;
  }
}
