:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #2d2a24;
  --muted: #7a7466;
  --green: #4a7c3f;
  --green-dark: #3a6231;
  --cream: #f3ecdd;
  --accent: #c0392b;
  --gold: #d4a017;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(45, 42, 36, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff;
  padding: 44px 20px 52px;
  text-align: center;
  border-radius: 0 0 32px 32px;
}
.hero h1 { font-size: 2.6rem; font-weight: 900; letter-spacing: .5px; }
.tagline { font-size: 1.35rem; font-weight: 700; color: #ffe9a8; margin-top: 2px; }
.sub { max-width: 520px; margin: 10px auto 0; opacity: .92; font-size: 1rem; }

.dod-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 18px auto 0;
  width: min(420px, 100%);
}
.dod-btn {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, .13);
  border: 1.5px solid rgba(255, 255, 255, .45);
  color: #fff;
  font-family: inherit;
  border-radius: 18px;
  padding: 10px 28px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  transition: background .15s, transform .1s;
}
.dod-btn:hover { background: rgba(255, 255, 255, .24); }
.dod-btn:active { transform: scale(.96); }
.dod-label { font-size: .8rem; opacity: .85; font-weight: 600; }
.dod-btn strong { font-size: 1.15rem; font-weight: 900; line-height: 1.4; }
.dod-hint { font-size: .72rem; opacity: .7; }

.dod-next {
  flex: 0 0 52px;
  background: rgba(255, 255, 255, .13);
  border: 1.5px solid rgba(255, 255, 255, .45);
  color: #fff;
  font-family: inherit;
  font-size: 1.35rem;
  border-radius: 18px;
  cursor: pointer;
  transition: background .15s, transform .25s;
}
.dod-next:hover { background: rgba(255, 255, 255, .24); }
.dod-next:active { transform: rotate(-180deg); }

.dod-card {
  max-width: 560px;
  margin: 14px auto 0;
  background: #fff;
  color: var(--ink);
  text-align: right;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .95rem;
  box-shadow: var(--shadow);
}
.dod-card-title { font-weight: 900; font-size: 1.05rem; margin-bottom: 6px; }
.dod-card-title small { color: var(--muted); font-weight: 600; font-size: .8rem; margin-inline-start: 8px; }
.dod-card .ings { color: var(--muted); margin-bottom: 6px; }
.dod-card .how { color: var(--ink); }
.dod-card b { color: var(--green-dark); }

/* ---------- Tabs ---------- */
.tabs {
  max-width: 1100px;
  margin: -26px auto 0;
  padding: 0 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.tab {
  background: #fff;
  border: 2px solid #e8e1d2;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all .15s;
}
.tab:hover { border-color: var(--accent); }
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1100px;
  margin: 20px auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .layout.single { grid-template-columns: 1fr; max-width: 760px; }
  .results-panel { position: sticky; top: 16px; }
}

.cat-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 20px 2px 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--cream);
}
.cat-title:first-child { margin-top: 6px; }

.expand {
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
  transition: transform .15s;
}
.dish.open .expand { transform: rotate(45deg); }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-head h2 { font-size: 1.25rem; font-weight: 700; }

.count-badge {
  background: var(--cream);
  color: var(--green-dark);
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: .9rem;
}

.clear-btn {
  border: none;
  background: #fdeeec;
  color: var(--accent);
  font-family: inherit;
  font-weight: 700;
  font-size: .85rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.clear-btn:hover { background: #fadbd8; }

/* ---------- Search + pantry note ---------- */
.search-box {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 11px 16px;
  border: 2px solid #e8e1d2;
  border-radius: 12px;
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.search-box:focus { border-color: var(--green); }
.pantry-note {
  font-size: .82rem;
  color: var(--muted);
  margin: 8px 2px 14px;
}

/* ---------- Ingredient chips ---------- */
.group { margin-bottom: 16px; }
.group-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 2px solid #e8e1d2;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .13s;
  user-select: none;
}
.chip:hover { border-color: var(--green); }
.chip.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.chip.hidden { display: none; }

/* ---------- Results ---------- */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
  font-size: 1.05rem;
}
.empty-state .big { font-size: 3rem; display: block; margin-bottom: 8px; }

.dish {
  border: 1.5px solid #eee7d8;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fffdf8;
  transition: box-shadow .15s;
}
.dish:hover { box-shadow: var(--shadow); }
.dish.ready { border-color: var(--green); background: #f4f9f2; }

.dish-top {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.dish-emoji { font-size: 2rem; line-height: 1; }
.dish-info { flex: 1; min-width: 0; }
.dish-name { font-size: 1.1rem; font-weight: 700; }
.dish-meta { font-size: .82rem; color: var(--muted); }

.badge {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.ok { background: var(--green); color: #fff; }
.badge.missing { background: #fdf3d7; color: #8a6d00; }

.missing-line {
  margin-top: 8px;
  font-size: .88rem;
  color: #8a6d00;
  background: #fdf6e3;
  border-radius: 10px;
  padding: 6px 12px;
}
.missing-line b { color: #6b5500; }

.dish-details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e0d8c5;
  font-size: .92rem;
}
.dish.open .dish-details { display: block; }
.dish-details .ings { color: var(--muted); margin-bottom: 6px; }
.amt { color: var(--green-dark); font-size: .85em; font-weight: 600; }
.dish-details .how { color: var(--ink); }
.dish-details b { color: var(--green-dark); }

/* ---------- Jump button (mobile) ---------- */
.jump-btn {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(192, 57, 43, .4);
  cursor: pointer;
  z-index: 10;
}
.jump-count {
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  padding: 0 9px;
  margin-inline-start: 4px;
}
@media (min-width: 900px) { .jump-btn { display: none !important; } }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 20px 10px 30px;
}
