:root {
  /* Warm Dark Espresso & Cast-Iron Palette */
  --bg-deep: #13120f;
  --bg-surface: #1b1915;
  --bg-elevated: #23201b;
  --bg-card-hover: #2a2620;
  --bg-inset: #161411;

  /* Warm Borders */
  --border-subtle: rgba(232, 217, 194, 0.09);
  --border-medium: rgba(232, 217, 194, 0.16);
  --border-strong: rgba(232, 217, 194, 0.28);

  /* Parchment & Oat Typography */
  --text-primary: #f4ece1;
  --text-secondary: #bfb4a4;
  --text-muted: #8c8274;

  /* Botanical Vegan Greens */
  --sage: #8ead7e;
  --sage-bright: #a8c798;
  --sage-deep: #3d5237;
  --sage-soft: rgba(142, 173, 126, 0.14);

  /* Cozy Hearth Accents */
  --amber: #d99152;
  --amber-soft: rgba(217, 145, 82, 0.15);
  --terracotta: #c96f4b;

  /* Dynamic Active Flavor Accent (updated by JS) */
  --flavor-accent: #e0a84b;
  --flavor-soft: rgba(224, 168, 75, 0.14);

  /* Typography */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radius & Shadows */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 246, 232, 0.04) inset;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Cozy candlelit & herb-garden background glows */
.ambient-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(110px);
}

.ambient-glow--warm {
  width: 580px;
  height: 580px;
  top: -180px;
  left: -140px;
  background: radial-gradient(circle, rgba(217, 145, 82, 0.14) 0%, rgba(217, 145, 82, 0) 70%);
}

.ambient-glow--sage {
  width: 620px;
  height: 620px;
  top: 80px;
  right: -200px;
  background: radial-gradient(circle, rgba(142, 173, 126, 0.13) 0%, rgba(142, 173, 126, 0) 70%);
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(142, 173, 126, 0.2), rgba(217, 145, 82, 0.12));
  border: 1px solid rgba(142, 173, 126, 0.34);
  color: var(--sage-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  color: var(--text-primary);
  background: transparent;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn:focus-visible,
.formula-card:focus-visible,
.flavor-card:focus-visible,
.slot-reroll-btn:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--sage-bright);
  outline-offset: 2px;
}

.btn-icon {
  display: inline-flex;
  width: 17px;
  height: 17px;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

.btn--ghost {
  color: var(--text-secondary);
  border-color: var(--border-subtle);
  background: rgba(255, 248, 236, 0.02);
}

.btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: rgba(255, 248, 236, 0.06);
}

.btn--surface {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn--surface:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn--primary {
  background: linear-gradient(135deg, #7da16c 0%, #5c7d4e 100%);
  color: #11150f;
  border-color: rgba(186, 214, 173, 0.35);
  box-shadow: 0 8px 24px rgba(102, 138, 86, 0.28), 0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.btn--primary:hover {
  background: linear-gradient(135deg, #8db27c 0%, #688c59 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(102, 138, 86, 0.36), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.btn--large {
  padding: 13px 26px;
  font-size: 0.96rem;
}

.btn--small {
  padding: 7px 13px;
  font-size: 0.81rem;
}

.btn--saved {
  background: var(--amber-soft);
  border-color: rgba(217, 145, 82, 0.45);
  color: #f4c493;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--sage-soft);
  color: var(--sage-bright);
  font-size: 0.74rem;
  font-weight: 700;
}

/* Hero */
.hero-intro {
  text-align: center;
  max-width: 680px;
  margin: 34px auto 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sage-bright);
  background: var(--sage-soft);
  border: 1px solid rgba(142, 173, 126, 0.25);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin: 0 0 14px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage-bright);
  box-shadow: 0 0 8px var(--sage-bright);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.hero-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.65;
}

/* Picker Panel */
.picker-panel {
  background: linear-gradient(180deg, rgba(31, 28, 23, 0.94) 0%, rgba(25, 22, 18, 0.96) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 30px;
}

.picker-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.step-pill {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sage-soft);
  border: 1px solid rgba(142, 173, 126, 0.35);
  color: var(--sage-bright);
  font-weight: 700;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.picker-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.picker-hint {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.picker-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 24px 0;
}

/* Formula Grid */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.formula-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.formula-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.formula-card.is-selected {
  background: linear-gradient(145deg, rgba(142, 173, 126, 0.14), rgba(35, 32, 27, 0.96));
  border-color: rgba(142, 173, 126, 0.58);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(142, 173, 126, 0.2) inset;
}

.formula-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 246, 232, 0.03);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.formula-card__icon svg {
  width: 28px;
  height: 28px;
}

.formula-card.is-selected .formula-card__icon {
  background: rgba(142, 173, 126, 0.16);
  border-color: rgba(142, 173, 126, 0.42);
  color: var(--sage-bright);
}

.formula-card__body {
  min-width: 0;
  flex: 1;
}

.formula-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.formula-card__num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.formula-card.is-selected .formula-card__num {
  color: var(--sage-bright);
}

.formula-card__time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.formula-card__name {
  display: block;
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.formula-card__meta {
  display: block;
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.35;
}

/* Flavor Grid */
.flavor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flavor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.flavor-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.flavor-card.is-selected {
  background: linear-gradient(150deg, var(--card-accent-soft), rgba(31, 28, 23, 0.96));
  border-color: var(--card-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--card-accent-soft) inset;
}

.flavor-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flavor-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--card-accent-soft);
  color: var(--card-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flavor-card__icon svg {
  width: 19px;
  height: 19px;
}

.flavor-card__name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
}

.flavor-card__sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.flavor-card__spices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 2px;
}

.spice-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 246, 232, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.flavor-card.is-selected .spice-tag {
  color: var(--text-primary);
  border-color: rgba(255, 246, 232, 0.14);
}

/* Roll Bar */
.roll-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.kbd-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 1px 7px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-inset);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  margin: 0 2px;
}

/* Recipe Card Stage */
.recipe-card {
  position: relative;
  background: linear-gradient(180deg, #1f1c17 0%, #191713 100%);
  border: 1px solid var(--border-medium);
  border-top: 3px solid var(--flavor-accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.recipe-card.is-rolling {
  opacity: 0.55;
  transform: translateY(4px) scale(0.995);
}

.recipe-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 220px;
  background: radial-gradient(circle at top right, var(--flavor-soft), transparent 72%);
  pointer-events: none;
}

.recipe-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.recipe-header__main {
  flex: 1;
  min-width: 280px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 246, 232, 0.04);
  color: var(--text-secondary);
}

.badge--flavor {
  background: var(--flavor-soft);
  border-color: var(--flavor-accent);
  color: var(--text-primary);
}

.badge--vegan {
  background: var(--sage-soft);
  border-color: rgba(142, 173, 126, 0.35);
  color: var(--sage-bright);
}

.badge svg {
  width: 13px;
  height: 13px;
}

.recipe-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.recipe-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  max-width: 68ch;
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Meta Stats Bar */
.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
}

.meta-item__icon {
  color: var(--sage-bright);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.meta-item__icon svg {
  width: 100%;
  height: 100%;
}

.meta-item__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.meta-item__val {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Formula Proportions Ribbon */
.ratios-block {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(142, 173, 126, 0.06);
  border: 1px solid rgba(142, 173, 126, 0.18);
}

.ratios-label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sage-bright);
  margin: 0 0 10px;
}

.ratios-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ratio-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.ratio-pill__amt {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.86rem;
}

.ratio-pill__name {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ratio-plus {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Randomly Rolled Slot Chips (with individual swap!) */
.rolled-slots {
  margin-top: 22px;
}

.rolled-slots__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.section-label {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.slot-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.slot-chip:hover {
  border-color: var(--border-medium);
  background: rgba(35, 32, 27, 0.85);
}

.slot-chip__text {
  min-width: 0;
}

.slot-chip__label {
  display: block;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.slot-chip__value {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
  line-height: 1.35;
  margin-top: 1px;
}

.slot-reroll-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease, color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.slot-reroll-btn svg {
  width: 14px;
  height: 14px;
}

.slot-reroll-btn:hover {
  color: var(--sage-bright);
  border-color: rgba(142, 173, 126, 0.5);
  background: var(--sage-soft);
  transform: rotate(90deg);
}

/* Two-Column Recipe Body */
.recipe-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 28px;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border-subtle);
}

.col-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.col-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.prep-progress {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ingredient-group {
  margin-bottom: 20px;
}

.ingredient-group__title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--flavor-accent);
  margin: 0 0 10px;
}

.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
  user-select: none;
}

.ingredient-item:hover {
  background: rgba(35, 32, 27, 0.8);
  border-color: var(--border-medium);
}

.ingredient-item.is-checked {
  opacity: 0.56;
  background: rgba(142, 173, 126, 0.05);
}

.ingredient-item.is-checked .ingredient-text {
  text-decoration: line-through;
  text-decoration-color: var(--sage);
}

.check-box {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: #13120f;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.check-box svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ingredient-item.is-checked .check-box {
  background: var(--sage);
  border-color: var(--sage);
}

.ingredient-item.is-checked .check-box svg {
  opacity: 1;
  transform: scale(1);
}

.ingredient-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.ingredient-qty {
  font-weight: 700;
  color: var(--sage-bright);
  margin-right: 4px;
}

.ingredient-prep {
  color: var(--text-muted);
  font-size: 0.83rem;
}

/* Flavor Vibe Note */
.vibe-callout {
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--flavor-soft);
  border: 1px solid rgba(255, 246, 232, 0.1);
}

.vibe-callout__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--flavor-accent);
  margin: 0 0 5px;
}

.vibe-callout p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.vibe-callout p + p {
  margin-top: 8px;
  color: var(--text-primary);
}

/* Method Steps */
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid rgba(142, 173, 126, 0.45);
  color: var(--sage-bright);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.step-text {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-primary);
  line-height: 1.65;
}

/* Kitchen Tips Accordion */
.tips-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.tips-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tip-details {
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  overflow: hidden;
}

.tip-details summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tip-details summary::-webkit-details-marker {
  display: none;
}

.tip-details summary .tip-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tip-details[open] summary .tip-chevron {
  transform: rotate(180deg);
  color: var(--sage-bright);
}

.tip-details__body {
  padding: 0 14px 13px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Footer */
.site-footer {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-leaf {
  width: 16px;
  height: 16px;
  color: var(--sage);
  display: inline-flex;
}

.footer-inner p {
  margin: 0;
}

/* Saved Recipe Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 5, 0.72);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: #1a1814;
  border-left: 1px solid var(--border-medium);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.55);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text-primary);
}

.drawer-sub {
  margin: 3px 0 0;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
}

.saved-empty p {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.saved-item {
  padding: 15px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-item__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.03rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.saved-item__meta {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.saved-item__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: #27241e;
  color: var(--text-primary);
  border: 1px solid rgba(142, 173, 126, 0.45);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  z-index: 60;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
  .formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .flavor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recipe-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 16px 40px;
  }
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    justify-content: space-between;
  }
  .picker-panel,
  .recipe-card {
    padding: 20px 16px;
  }
  .formula-grid,
  .flavor-grid {
    grid-template-columns: 1fr;
  }
  .kbd-hint {
    display: none;
  }
}

/* Print-friendly recipe card */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .ambient-glow,
  .grain-overlay,
  .site-header,
  .hero-intro,
  .picker-panel,
  .recipe-actions,
  .rolled-slots,
  .tips-box,
  .site-footer,
  .drawer,
  .drawer-backdrop,
  .toast {
    display: none !important;
  }
  .recipe-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    padding: 16px !important;
  }
  .recipe-title,
  .col-title,
  .ingredient-text,
  .step-text,
  .meta-item__val,
  .ratio-pill__amt {
    color: #111 !important;
  }
  .recipe-summary,
  .ingredient-prep,
  .meta-item__label,
  .ratio-pill__name {
    color: #444 !important;
  }
  .ingredient-item,
  .step-card,
  .meta-item,
  .ratio-pill {
    background: #fafafa !important;
    border-color: #ddd !important;
  }
}
