:root {
  color-scheme: light;
  --bg: #fff3e4;
  --ink: #2b1d12;
  --muted: #6f5c4e;
  --accent: #ff6b3d;
  --accent-soft: #ffd3c3;
  --panel: #fff7ed;
  --panel-2: #f6e2c8;
  --table-border: #ead0b5;
  --card: #fffaf3;
  --shadow: 0 24px 50px rgba(45, 25, 12, 0.18);
  --pop: #47c06b;
  --pop-2: #f9c74f;
  --meal-accent: #2f7dff;
  --meal-accent-dark: #1c57c4;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #ffe6c7 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #ffd7cf 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, #e6f7c8 0%, transparent 35%),
    var(--bg);
  color: var(--ink);
  user-select: none;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110d;
  --ink: #f5efe7;
  --muted: #d9cbb8;
  --accent: #ff9a5a;
  --accent-soft: #5b3a24;
  --panel: #1d1712;
  --panel-2: #2a2018;
  --table-border: #3a2b20;
  --card: #231b14;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  --pop: #6be38a;
  --pop-2: #ffd166;
  --meal-accent: #7aa8ff;
  --meal-accent-dark: #3e6fd6;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  background: radial-gradient(circle, rgba(255, 107, 61, 0.18), transparent 60%);
  filter: blur(30px);
  opacity: 0.8;
  z-index: 0;
  animation: floatGlow 18s ease-in-out infinite;
  pointer-events: none;
}

body::after {
  inset: auto -10% -20% -10%;
  height: 60vh;
  background: radial-gradient(circle, rgba(71, 192, 107, 0.2), transparent 60%);
  animation-delay: -9s;
}

@keyframes floatGlow {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(30px) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.1rem;
}

.logo-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--panel-2);
}

.logo-mark svg {
  width: 34px;
  height: 34px;
}

.logo-text {
  font-family: "DM Serif Display", serif;
  letter-spacing: 0.02em;
}

.theme-toggle {
  border: 1px solid var(--panel-2);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

body[data-theme="dark"] .theme-toggle {
  background: #2a2018;
  color: #f5efe7;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  position: relative;
  z-index: 1;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23d9bfa8' stroke-width='2' opacity='0.45'%3E%3Cpath d='M30 60c12-22 32-30 50-20-4 18-18 36-40 46-8-6-12-16-10-26z'/%3E%3Cpath d='M150 40c10-14 28-18 42-6-6 14-18 26-32 30-6-4-10-12-10-24z'/%3E%3Cpath d='M120 140c18-14 42-12 58 6-16 10-36 14-54 12-6-6-8-12-4-18z'/%3E%3Cpath d='M40 150c14-10 34-8 48 6-12 8-28 12-44 10-6-4-8-10-4-16z'/%3E%3Cpath d='M90 90c4-14 14-22 28-22 2 14-2 30-12 40-10-2-16-8-16-18z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

h1 {
  font-family: "DM Serif Display", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin: 0 0 16px;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 24px;
  color: var(--muted);
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.meta-card {
  background: var(--card);
  border: 1px solid var(--panel-2);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--pop-2);
}

.meta-title {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.meta-value {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.hero__panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--panel-2);
  box-shadow: var(--shadow);
}

.hero__panel,
.hero__content,
.meta-card,
.insight-card,
.table-wrap,
.veggie-card {
  animation: liftIn 700ms ease both;
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.panel-header h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.panel-header p {
  margin: 0 0 16px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active,
.chip:hover {
  background: var(--accent);
  color: #fff;
}

.panel-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.controls {
  margin: 40px 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
}

.meal-cta {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
}

.meal-cta .meal-btn {
  min-width: 220px;
  text-align: center;
}

.controls label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}

.controls input,
.controls select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--table-border);
  background: #fff;
  font-size: 0.95rem;
}

.clear-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: var(--accent);
  color: #fff;
}

.toggle {
  display: flex;
  gap: 8px;
}

.view-btn {
  flex: 1;
  border-radius: 14px;
  border: 1px solid var(--table-border);
  background: var(--card);
  padding: 12px 0;
  cursor: pointer;
  transition: 0.2s ease;
}

.view-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.view-btn {
  background: #fff;
}
.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.newsletter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.newsletter__panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--panel-2);
  box-shadow: var(--shadow);
}

.newsletter__panel h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.newsletter__form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.newsletter__form label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.newsletter__form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--table-border);
  background: #fff;
  font-size: 0.95rem;
}

.newsletter__form button {
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.meal-btn {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--meal-accent);
  background: var(--meal-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 0 0 rgba(47, 125, 255, 0.6);
  animation: glowPulse 2.6s ease-in-out infinite;
}

.meal-btn:hover {
  background: var(--meal-accent-dark);
  color: #fff;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0 rgba(47, 125, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 18px rgba(47, 125, 255, 0.7);
  }
  100% {
    box-shadow: 0 0 0 rgba(47, 125, 255, 0.4);
  }
}

.newsletter__note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}



.insight-card {
  border-radius: 18px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--panel-2);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--pop);
}

.insight-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--table-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(3px);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1040px;
}

th,
 td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--table-border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  position: sticky;
  top: 0;
  white-space: normal;
  overflow: visible;
  line-height: 1.2;
}

th button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px 6px;
  white-space: normal;
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-right: 6px;
  overflow: visible;
}

th .sort-arrow {
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 0;
  line-height: 1;
  display: inline-block;
}

tbody tr:hover {
  background: var(--panel-2);
}

tbody tr.selected {
  background: var(--accent-soft);
}

td {
  font-size: 0.9rem;
  line-height: 1.3;
  word-break: break-word;
}

td:first-child,
th:first-child {
  width: 70px;
}

td:nth-child(2),
th:nth-child(2) {
  width: 150px;
}

td:nth-child(3),
th:nth-child(3) {
  width: 170px;
}

td:nth-child(4),
th:nth-child(4) {
  width: 120px;
}

td:nth-child(5),
th:nth-child(5),
td:nth-child(6),
th:nth-child(6),
td:nth-child(7),
th:nth-child(7),
td:nth-child(8),
th:nth-child(8),
td:nth-child(9),
th:nth-child(9) {
  width: 80px;
}

td:nth-child(10),
th:nth-child(10) {
  width: 100px;
}

td:nth-child(11),
th:nth-child(11) {
  width: 210px;
}

td:nth-child(12),
th:nth-child(12) {
  width: 220px;
}

.cards {
  margin-top: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.veggie-card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--panel-2);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  border-top: 3px solid var(--pop);
}

.veggie-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
}

.veggie-card.selected {
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(183, 75, 45, 0.25);
}

.veggie-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.index-pill {
  align-self: flex-start;
  background: var(--panel-2);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.veggie-card .subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.category-tag {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  background: var(--panel-2);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.footer {
  text-align: center;
  padding: 20px 16px 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .toggle {
    flex-direction: column;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

@media (max-width: 540px) {
  .table-wrap {
    border-radius: 14px;
  }

  th {
    font-size: 0.75rem;
  }

  td {
    font-size: 0.9rem;
  }
}
