:root {
  --bg: #fff7fb;
  --card: #ffffff;
  --ink: #241321;
  --muted: #765d72;
  --pink: #ff7ab6;
  --peach: #ffb38a;
  --mint: #86e8c8;
  --shadow: 0 18px 45px rgba(82, 35, 65, .14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255,122,182,.32), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(134,232,200,.38), transparent 32rem),
    var(--bg);
}

header {
  padding: 44px 20px 24px;
  text-align: center;
}
.hero {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(160px, 260px);
  align-items: center;
  gap: 18px;
}
.hero-copy { text-align: left; }
.hero-photo {
  width: min(260px, 34vw);
  justify-self: center;
  filter: drop-shadow(0 22px 34px rgba(82, 35, 65, .22));
  transform: rotate(2deg);
}
.hero .sub { margin-left: 0; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
}
h1 {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 5.2rem);
  line-height: .9;
}
.sub {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}
main { width: min(1080px, calc(100% - 28px)); margin: 0 auto 44px; }
.extras { display: grid; grid-template-columns: 180px repeat(2, 1fr); gap: 14px; margin-bottom: 12px; }
#surprise, .mini-card { border: 0; border-radius: 26px; padding: 18px; box-shadow: var(--shadow); background: rgba(255,255,255,.82); }
#surprise { background: linear-gradient(135deg, var(--pink), var(--peach)); color: white; font-weight: 900; font-size: 1rem; cursor: pointer; }
.mini-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.mini-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.controls {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 0 18px;
  backdrop-filter: blur(12px);
}
.mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px;
  border-radius: 24px;
  background: rgba(255,255,255,.68);
  box-shadow: var(--shadow);
}
.mode {
  border: 0;
  border-radius: 18px;
  padding: 12px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.mode.active {
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--peach));
}
input {
  width: 100%;
  border: 0;
  border-radius: 24px;
  padding: 16px 18px;
  font: inherit;
  box-shadow: var(--shadow);
  outline: 3px solid transparent;
}
input:focus { outline-color: rgba(255,122,182,.35); }
.party-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; }
.party-tools button {
  border: 0; border-radius: 18px; padding: 12px 14px;
  background: rgba(255,255,255,.82); color: var(--ink);
  font: inherit; font-weight: 900; cursor: pointer; box-shadow: var(--shadow);
}
.party-tools button.active { background: var(--ink); color: white; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 14px 2px 2px; }
.chip {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.chip.active { background: var(--ink); color: white; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.card {
  border: 0;
  text-align: left;
  background: var(--card);
  border-radius: 28px;
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 22px 52px rgba(82,35,65,.2); }
.emoji { font-size: 2.4rem; }
.card h2 { margin: 12px 0 8px; }
.card p { color: var(--muted); margin: 0 0 14px; }
.meta { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; font-weight: 800; color: #9a587c; }
.badge { background: #fff0f7; border-radius: 999px; padding: 7px 10px; }
.type-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 7px 10px; margin-bottom: 8px;
  font-size: .75rem; font-weight: 900; letter-spacing: .03em; text-transform: uppercase;
}
.type-badge.mocktail { background: #eafff7; color: #24745c; }
.type-badge.cocktail { background: #fff1df; color: #9a4f00; }
.type-note {
  border-radius: 18px; padding: 12px 14px; font-weight: 800; line-height: 1.4;
}
.type-note.mocktail { background: #eafff7; color: #24745c; }
.type-note.cocktail { background: #fff1df; color: #9a4f00; }
dialog {
  width: min(640px, calc(100% - 28px));
  border: 0;
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(36,19,33,.42); backdrop-filter: blur(4px); }
.close { float: right; border: 0; background: #fff0f7; border-radius: 50%; width: 38px; height: 38px; font-size: 1.5rem; }
.recipe-title { margin-top: 8px; font-size: 2rem; }
ul, ol { padding-left: 22px; line-height: 1.75; }
.tip { background: #f1fff9; border-left: 5px solid var(--mint); padding: 12px 14px; border-radius: 16px; color: #315f50; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.learn { margin-top: 28px; background: rgba(255,255,255,.66); border-radius: 30px; padding: 22px; box-shadow: var(--shadow); }
.learn h2 { margin-top: 0; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.learn article { background: white; border-radius: 22px; padding: 16px; }
.learn strong, .learn span { display: block; }
.learn span { color: var(--muted); margin-top: 8px; line-height: 1.5; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 56px; }
  .hero-copy { text-align: center; }
  .hero .sub { margin-left: auto; }
  .hero-photo { width: min(230px, 68vw); order: -1; }
  .extras { grid-template-columns: 1fr; }
  .mode-toggle { grid-template-columns: 1fr; }
}

/* ---------- v2 additions ---------- */

/* dark mode */
body.dark {
  --bg: #1a1020;
  --card: #2a1c30;
  --ink: #f6e9f1;
  --muted: #c5a7bd;
  --shadow: 0 18px 45px rgba(0,0,0,.45);
}
body.dark {
  background:
    radial-gradient(circle at top left, rgba(255,122,182,.20), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(134,232,200,.16), transparent 32rem),
    var(--bg);
}
body.dark .chip { background: rgba(255,255,255,.10); }
body.dark .chip.active { background: var(--pink); color: #1a1020; }
body.dark .badge { background: rgba(255,255,255,.10); color: var(--peach); }
body.dark .type-badge.mocktail, body.dark .type-note.mocktail { background: rgba(134,232,200,.15); color: #aaf3dd; }
body.dark .type-badge.cocktail, body.dark .type-note.cocktail { background: rgba(255,179,138,.16); color: #ffd0aa; }
body.dark .mini-card, body.dark .learn, body.dark .learn article { background: var(--card); }
body.dark input { background: var(--card); color: var(--ink); }
body.dark .mode-toggle { background: rgba(255,255,255,.10); }
body.dark .mode { color: var(--muted); }
body.dark .mode.active { color: #1a1020; }
body.dark .party-tools button { background: var(--card); color: var(--ink); }
body.dark .party-tools button.active { background: var(--pink); color: #1a1020; }
body.dark .ingredient-row { background: rgba(255,255,255,.09); }
body.dark .tip { background: #16322a; color: #b6f0d8; }
body.dark .close, body.dark .stepper button { background: rgba(255,255,255,.12); color: var(--ink); }

.theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 5;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.82); box-shadow: var(--shadow);
  font-size: 1.2rem; cursor: pointer;
}
body.dark .theme-toggle { background: rgba(255,255,255,.12); }

/* favorite hearts */
.card { position: relative; }
.fav {
  position: absolute; top: 14px; right: 14px;
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--pink);
  transition: transform .15s ease;
}
.fav:hover { transform: scale(1.2); }
.fav.on { color: var(--pink); }
.fav.big { position: static; font-size: 1.8rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head .recipe-title { margin: 8px 0; }

/* servings stepper */
.servings { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 4px; font-weight: 800; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: #fff0f7; font-size: 1.3rem; font-weight: 900; cursor: pointer; color: var(--ink);
}
.stepper strong { min-width: 24px; text-align: center; font-size: 1.2rem; color: var(--ink); }

/* checklists (ingredients + steps) */
.checklist { list-style: none; padding-left: 0; }
.checklist.steps { counter-reset: step; }
.checklist li { margin: 4px 0; }
.checklist label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 8px; border-radius: 12px; }
.checklist label:hover { background: rgba(255,122,182,.08); }
.checklist input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--pink); flex: 0 0 auto; }
.checklist.steps li { counter-increment: step; }
.checklist.steps label span::before { content: counter(step) ". "; font-weight: 800; color: var(--pink); }
.checklist li.done span { text-decoration: line-through; opacity: .5; }
.hint { font-size: .8rem; font-weight: 600; color: var(--muted); }

/* action buttons */
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions button {
  flex: 1; min-width: 140px; border: 0; border-radius: 18px; padding: 14px;
  font: inherit; font-weight: 800; cursor: pointer; color: white;
  background: linear-gradient(135deg, var(--pink), var(--peach)); box-shadow: var(--shadow);
}
.actions button:active { transform: translateY(1px); }
.actions.compact button { flex: 0 1 auto; min-width: 120px; padding: 11px 13px; }
.ingredients-modal { width: min(760px, calc(100% - 28px)); }
.sub.small { font-size: .92rem; margin-top: 6px; }
.ingredient-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  max-height: min(58vh, 560px);
  overflow: auto;
  margin-top: 16px;
  padding-right: 4px;
}
.ingredient-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px;
  background: rgba(255,240,247,.72);
  font-weight: 750;
}
.ingredient-row input { width: 18px; height: 18px; accent-color: var(--pink); flex: 0 0 auto; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
