/* =========================================================
   Crecer Bien — Design System "Canasta"
   Vibrant · Modern · App-first
   ========================================================= */

:root {
  --bg:         #FFFFFF;
  --surface-0:  #FAFAF8;
  --surface-1:  #F4F2EE;
  --surface-2:  #EAE6DE;
  --surface-3:  #DDD8CE;
  --hairline:      #E8E4DC;
  --hairline-soft: #EFECE6;

  --ink:   #1A1613;
  --ink-2: #3D3830;
  --ink-3: #7C7468;
  --ink-4: #B0AA9F;

  /* Primary: warm terracotta (softer than pure orange) */
  --orange:       #C26035;
  --orange-deep:  #9A4520;
  --orange-mid:   #D97848;
  --orange-soft:  #F8EAE0;
  --orange-xsoft: #FCF4EE;

  /* Secondary teal */
  --teal:        #0A7563;
  --teal-deep:   #065A4C;
  --teal-mid:    #12937A;
  --teal-soft:   #D0EDE8;
  --teal-xsoft:  #E8F6F3;

  /* Legacy aliases so existing PHP inline styles still work */
  --sage:        var(--teal);
  --sage-deep:   var(--teal-deep);
  --sage-soft:   var(--teal-soft);
  --terracotta:  var(--orange);
  --clay:        var(--orange-deep);
  --green:       var(--teal);
  --green-deep:  var(--teal-deep);
  --green-mid:   var(--teal-mid);
  --green-soft:  var(--teal-soft);
  --green-xsoft: var(--teal-xsoft);

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-ui:      'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   18px;
  --radius-xl:   26px;
  --radius-pill: 999px;

  --shadow-0: 0 1px 3px rgba(26, 22, 19, 0.06);
  --shadow-1: 0 2px 8px rgba(26, 22, 19, 0.08), 0 1px 2px rgba(26, 22, 19, 0.04);
  --shadow-2: 0 6px 24px rgba(26, 22, 19, 0.10), 0 2px 4px rgba(26, 22, 19, 0.05);
  --shadow-3: 0 12px 48px rgba(26, 22, 19, 0.13), 0 3px 6px rgba(26, 22, 19, 0.06);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--surface-0);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 959px) {
  body { padding-bottom: 72px; }
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--orange-soft); color: var(--ink); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: var(--radius-pill); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Layout */
.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}
@media (min-width: 960px) {
  .app-shell { grid-template-columns: 264px 1fr; }
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 2px 16px rgba(26, 22, 19, 0.05);
}

.topbar-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--orange-xsoft);
  border: 2px solid var(--orange-soft);
  display: grid; place-items: center;
  color: var(--orange-deep);
  font-family: var(--font-display);
  font-size: 24px; font-style: italic; font-weight: 500;
  overflow: hidden; flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1; }

.brand-eyebrow {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 2px; white-space: nowrap;
}
@media (max-width: 720px) { .brand-eyebrow { display: none; } }

.brand-name {
  font-family: var(--font-display); font-size: 22px;
  font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
}
.brand-name em { font-style: italic; color: var(--orange); font-weight: 400; }

.topbar-search { flex: 1 1 100%; max-width: 100%; position: relative; order: 3; }
@media (min-width: 720px) { .topbar-search { flex: 1; max-width: 460px; order: unset; } }

.topbar-search input {
  width: 100%; height: 40px;
  padding: 0 16px 0 40px;
  background: var(--surface-0); border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill); font-size: 14px; outline: none;
  transition: all 0.15s ease;
}
.topbar-search input::placeholder { color: var(--ink-4); }
.topbar-search input:focus {
  background: var(--bg); border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-xsoft);
}

.topbar-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none; display: flex;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-3);
  position: relative; transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--surface-0); color: var(--ink); }
.icon-btn.is-active { color: var(--orange); background: var(--orange-xsoft); }
.icon-btn svg { width: 20px; height: 20px; }

.icon-btn-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--orange); color: white;
  font-family: var(--font-mono); font-size: 9px;
  display: grid; place-items: center; font-weight: 700;
}

.mobile-only { display: grid; }
.desktop-only { display: none; }
@media (min-width: 960px) {
  .mobile-only { display: none; }
  .desktop-only { display: grid; }
}

/* Topbar nav buttons */
.btn-nav-link { font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 5px 8px; border-radius: var(--radius-md); transition: color 0.15s; white-space: nowrap; }
.btn-nav-link:hover { color: var(--ink); }

.btn-nav-accent { font-size: 13px; font-weight: 600; color: var(--teal-deep); background: var(--teal-xsoft); padding: 6px 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--teal-soft); white-space: nowrap; transition: all 0.15s ease; }
.btn-nav-accent:hover { background: var(--teal-soft); }

.btn-nav-cta { font-size: 13px; font-weight: 700; color: white; background: var(--orange); padding: 7px 16px; border-radius: var(--radius-pill); white-space: nowrap; transition: all 0.15s ease; box-shadow: 0 2px 8px rgba(194, 96, 53, 0.28); }
.btn-nav-cta:hover { background: var(--orange-deep); transform: translateY(-1px); }

/* ── BOTTOM NAVIGATION (mobile only) ── */
.bottom-nav {
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  background: var(--bg);
  border-top: 1.5px solid var(--hairline);
  box-shadow: 0 -4px 24px rgba(26, 22, 19, 0.07);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}
@media (min-width: 960px) { .bottom-nav { display: none; } }

.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 2px;
  color: var(--ink-4);
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  font-family: var(--font-ui);
  transition: color 0.15s ease;
  text-decoration: none; min-width: 0;
}
.bottom-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; transition: transform 0.15s ease; }
.bottom-nav-item:hover { color: var(--ink-2); }
.bottom-nav-item:hover svg { transform: translateY(-1px); }
.bottom-nav-item.is-active { color: var(--orange); }

.bottom-nav-item.is-ai { color: var(--ink-3); }
.bottom-nav-item.is-ai .bottom-nav-bubble {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-mid) 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(194, 96, 53, 0.45);
  transition: transform 0.15s ease;
  margin-bottom: 1px;
}
.bottom-nav-item.is-ai .bottom-nav-bubble svg { width: 20px; height: 20px; stroke: white; }
.bottom-nav-item.is-ai:hover .bottom-nav-bubble { transform: translateY(-2px); }

/* Sidebar */
.sidebar {
  display: none;
  background: var(--bg); border-right: 1px solid var(--hairline);
  padding: 24px 20px 64px;
  position: sticky; top: 62px;
  height: calc(100vh - 62px); overflow-y: auto;
}
@media (min-width: 960px) { .sidebar { display: block; } }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline);
}
.sidebar-title { font-family: var(--font-ui); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin: 0; }
.sidebar-clear { font-size: 12px; color: var(--orange); font-weight: 600; transition: opacity 0.15s; }
.sidebar-clear:hover { opacity: 0.75; }

.filter-group { margin-bottom: 22px; }
.filter-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px; font-family: var(--font-ui); }
.filter-options { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-chip {
  padding: 5px 12px; background: var(--surface-0); border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; color: var(--ink-3);
  transition: all 0.12s ease; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.filter-chip:hover { border-color: var(--orange-soft); color: var(--ink); }
.filter-chip.is-active { background: var(--orange); border-color: var(--orange); color: white; box-shadow: 0 2px 8px rgba(194, 96, 53, 0.25); }
.filter-chip-emoji { font-size: 13px; }

.filter-segment {
  display: flex; background: var(--surface-0); border-radius: var(--radius-md);
  padding: 3px; border: 1.5px solid var(--hairline); gap: 2px;
}
.filter-segment button {
  flex: 1; padding: 5px 4px; font-size: 10px; font-weight: 600; color: var(--ink-3);
  border-radius: 7px; transition: all 0.12s ease; font-family: var(--font-ui);
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.filter-segment button.is-active { background: var(--orange); color: white; box-shadow: 0 1px 4px rgba(194, 96, 53, 0.3); }

/* Main */
.main { min-width: 0; background: var(--surface-0); }
.main-inner { max-width: 960px; margin: 0 auto; padding: 28px 18px 80px; }
@media (min-width: 960px) { .main-inner { padding: 40px 48px 80px; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }

.section-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); margin-bottom: 8px; font-family: var(--font-ui); }

.section-title { font-family: var(--font-display); font-size: clamp(36px, 5.5vw, 68px); font-weight: 400; letter-spacing: -0.025em; line-height: 1.05; margin: 0; color: var(--ink); }
.section-title em { font-style: italic; color: var(--orange); font-weight: 400; }

.section-meta { font-size: 13px; color: var(--ink-4); display: flex; align-items: center; gap: 8px; }

/* AI Banner */
.ai-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(130deg, var(--orange-deep) 0%, var(--orange) 55%, var(--orange-mid) 100%);
  border-radius: var(--radius-xl); padding: 28px 32px; margin-bottom: 32px;
  display: flex; align-items: center; gap: 24px;
}
.ai-banner::before { content: ''; position: absolute; top: -30%; right: -5%; width: 260px; height: 260px; background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 65%); pointer-events: none; }
.ai-banner::after { content: ''; position: absolute; bottom: -40%; left: 30%; width: 200px; height: 200px; background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 65%); pointer-events: none; }
.ai-banner-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.ai-banner-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.70); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); }
.ai-banner-eyebrow::before { content: ''; width: 16px; height: 1.5px; background: rgba(255,255,255,0.5); }
.ai-banner-title { font-family: var(--font-display); font-size: 30px; font-style: italic; font-weight: 500; margin: 0 0 6px; line-height: 1.1; color: white; }
.ai-banner-sub { font-size: 13px; color: rgba(255,255,255,0.72); margin: 0; }
.ai-banner-cta { position: relative; z-index: 1; padding: 12px 22px; background: white; color: var(--orange-deep); border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: all 0.15s ease; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.ai-banner-cta:hover { background: var(--orange-xsoft); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.18); }
@media (max-width: 600px) { .ai-banner { flex-direction: column; align-items: flex-start; padding: 22px; gap: 18px; border-radius: var(--radius-lg); } .ai-banner-title { font-size: 26px; } }

/* Featured */
.featured { margin-bottom: 32px; }
.featured-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; display: flex; align-items: center; gap: 12px; font-family: var(--font-ui); }
.featured-eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }
.featured-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .featured-grid { grid-template-columns: 1fr 1fr; } }

.recipe-hero {
  background: var(--bg); border: 1.5px solid var(--hairline);
  border-radius: var(--radius-xl); padding: 28px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 260px; position: relative; cursor: pointer;
  transition: all 0.2s ease; overflow: hidden; box-shadow: var(--shadow-0);
}
.recipe-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--orange-deep) 0%, var(--orange) 60%, var(--orange-mid) 100%); }
.recipe-hero:hover { border-color: var(--orange-soft); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.recipe-hero-emoji { font-size: 72px; line-height: 1; margin-bottom: 16px; }
.recipe-hero-title { font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 10px; }
.recipe-hero-desc { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin: 0 0 16px; }
.recipe-hero-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.recipe-hero-meta span { background: var(--surface-0); border: 1px solid var(--hairline); padding: 3px 9px; border-radius: var(--radius-pill); font-family: var(--font-ui); font-size: 11px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.recipe-hero-meta span::before { display: none; }

/* ── RECIPE GRID & CARDS ── */
#recipe-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) { #recipe-list { gap: 18px; } }
@media (min-width: 1100px) { #recipe-list { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (max-width: 500px) { #recipe-list { grid-template-columns: 1fr; gap: 12px; } }

.recipe-row {
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-0);
  border: 1.5px solid var(--hairline);
}
.recipe-row:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: transparent; }

/* Meal-type color zones — data-meal is set by JS */
.recipe-row-thumb {
  width: 100%; aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, var(--surface-1) 0%, var(--surface-2) 100%);
  display: grid; place-items: center;
  font-size: 56px; flex-shrink: 0; position: relative;
}
.recipe-row[data-meal="desayuno"] .recipe-row-thumb { background: linear-gradient(145deg, #FFF8E8 0%, #FFE5B4 100%); }
.recipe-row[data-meal="almuerzo"] .recipe-row-thumb { background: linear-gradient(145deg, #EDFAF3 0%, #B8EDD2 100%); }
.recipe-row[data-meal="cena"]     .recipe-row-thumb { background: linear-gradient(145deg, #EEF0FB 0%, #C4CAF0 100%); }
.recipe-row[data-meal="refrigerio"] .recipe-row-thumb { background: linear-gradient(145deg, #FEF1F6 0%, #FAC0D8 100%); }

.recipe-row-body { padding: 14px 14px 12px; display: flex; flex-direction: column; flex: 1; }
.recipe-row-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 5px; color: var(--ink); }
.recipe-row-desc { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; min-height: 2.8em; }
.recipe-row-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.recipe-row-meta-item { font-size: 10px; font-weight: 600; font-family: var(--font-ui); color: var(--ink-3); background: var(--surface-0); padding: 3px 8px; border-radius: var(--radius-pill); border: 1px solid var(--hairline); white-space: nowrap; }
.recipe-row-meta-item::before { display: none; }

.recipe-row-fav {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; color: var(--ink-4);
  transition: all 0.15s ease; z-index: 2;
  box-shadow: 0 1px 5px rgba(26, 22, 19, 0.12);
}
.recipe-row-fav:hover { background: white; color: var(--ink-2); transform: scale(1.1); }
.recipe-row-fav.is-fav { color: #E8503A; background: white; }
.recipe-row-fav svg { width: 15px; height: 15px; }
.recipe-row-fav.is-fav svg { fill: currentColor; }
@media (max-width: 420px) { .recipe-row-title { font-size: 16px; } .recipe-row-thumb { aspect-ratio: 4/3; font-size: 48px; } }

/* Empty state */
.empty-state { grid-column: 1 / -1; padding: 56px 24px; text-align: center; color: var(--ink-3); }
.empty-state-glyph { font-family: var(--font-display); font-size: 56px; font-style: italic; color: var(--ink-4); margin-bottom: 12px; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(26, 22, 19, 0.45); z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; backdrop-filter: blur(2px); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--bg); border-radius: 24px 24px 0 0; max-height: 85vh; overflow-y: auto; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); padding: 20px 20px 100px; box-shadow: 0 -8px 40px rgba(26, 22, 19, 0.15); }
.sheet.is-open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; background: var(--hairline); border-radius: 2px; margin: 0 auto 20px; }
.sheet-footer { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 20px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--hairline); display: flex; gap: 10px; }

/* Buttons */
.btn-primary { padding: 13px 24px; background: var(--orange); color: white; border-radius: var(--radius-pill); font-size: 14px; font-weight: 700; border: none; cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(194, 96, 53, 0.28); text-transform: uppercase; letter-spacing: 0.04em; }
.btn-primary:hover { background: var(--orange-deep); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(194, 96, 53, 0.35); }
.btn-secondary { padding: 13px 20px; background: var(--bg); color: var(--ink-2); border: 1.5px solid var(--hairline); border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; justify-content: center; }
.btn-secondary:hover { border-color: var(--orange-soft); color: var(--orange); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(26, 22, 19, 0.50); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-card { background: var(--bg); border-radius: var(--radius-xl); max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-3); position: relative; transform: translateY(16px) scale(0.97); transition: transform 0.28s cubic-bezier(0.34, 1.25, 0.64, 1); }
.modal.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.9); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 2; border: 1px solid rgba(255,255,255,0.5); transition: all 0.15s ease; box-shadow: var(--shadow-0); }
.modal-close:hover { background: white; transform: scale(1.05); }

.detail-hero { padding: 48px 40px 28px; background: linear-gradient(160deg, var(--orange-xsoft) 0%, var(--surface-1) 60%); border-radius: var(--radius-xl) var(--radius-xl) 0 0; position: relative; overflow: hidden; }
.detail-hero::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--orange-deep) 0%, var(--orange) 60%, var(--orange-mid) 100%); }
.detail-hero-emoji { font-size: 72px; line-height: 1; margin-bottom: 20px; }
.detail-hero-title { font-family: var(--font-display); font-size: 36px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 8px; }
.detail-hero-sub { font-size: 14px; color: var(--ink-3); margin: 0; }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--hairline); border-bottom: 1px solid var(--hairline); }
.detail-meta-cell { padding: 14px 16px; background: var(--bg); }
.detail-meta-label { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 4px; font-family: var(--font-ui); font-weight: 700; }
.detail-meta-value { font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--ink); }
.detail-body { padding: 28px 40px 40px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; }
@media (max-width: 720px) { .detail-hero { padding: 36px 22px 22px; } .detail-hero-title { font-size: 28px; } .detail-meta { grid-template-columns: repeat(2, 1fr); } .detail-body { grid-template-columns: 1fr; padding: 22px; gap: 28px; } }
.detail-section-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); font-family: var(--font-ui); font-weight: 700; }

.ingredients-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.ingredients-list li { font-size: 14px; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--hairline); color: var(--ink-2); align-items: baseline; }
.ingredients-list li:last-child { border-bottom: none; }
.ingredients-list .qty { font-family: var(--font-mono); font-size: 12px; color: var(--orange); font-weight: 600; }

.steps-list { list-style: none; padding: 0; margin: 0; counter-reset: step; display: flex; flex-direction: column; gap: 18px; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.steps-list li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; color: white; background: var(--orange); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.steps-list li p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); padding-top: 6px; }

.detail-tip { margin-top: 24px; padding: 18px 20px; background: var(--orange-xsoft); border-radius: var(--radius-md); border: 1.5px solid var(--orange-soft); display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.detail-tip-icon { font-family: var(--font-display); font-size: 24px; font-style: italic; color: var(--orange-deep); line-height: 1; }
.detail-tip-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange-deep); margin-bottom: 4px; font-family: var(--font-ui); font-weight: 700; }
.detail-tip-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.app-footer { border-top: 1px solid var(--hairline); padding: 24px 20px 40px; margin-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-4); font-size: 12px; text-align: center; }
.app-footer-mark { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--ink-3); }

.is-hidden { display: none !important; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); display: inline-block; }

/* ── Theme toggle dots ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-0);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 5px 8px;
}
.theme-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  outline: none;
}
.theme-dot:hover { transform: scale(1.25); }
.theme-dot.is-active {
  box-shadow: 0 0 0 2.5px var(--hairline), 0 0 0 4px rgba(0,0,0,0.12);
  transform: scale(1.1);
}

/* ── Auth / Login page ── */
.auth-split { display: flex; min-height: 100vh; width: 100%; }

.auth-panel-brand {
  display: none;
  position: relative;
  flex: 0 0 44%;
  background: linear-gradient(150deg, var(--orange-deep) 0%, var(--orange) 52%, var(--orange-mid) 100%);
  overflow: hidden;
  padding: 48px 52px;
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 768px) { .auth-panel-brand { display: flex; } }
.auth-panel-brand::before { content: ''; position: absolute; top: -10%; right: -15%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 65%); pointer-events: none; }
.auth-panel-brand::after  { content: ''; position: absolute; bottom: 5%; left: -10%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 65%); pointer-events: none; }

.auth-brand-logo { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand-logo img { width: 58px; height: 58px; border-radius: 50%; object-fit: contain; background: #ffffff; padding: 8px; border: 2px solid rgba(255,255,255,0.90); box-shadow: 0 4px 20px rgba(0,0,0,0.18); }
.auth-brand-logo-text { display: flex; flex-direction: column; line-height: 1; }
.auth-brand-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.62); margin-bottom: 4px; }
.auth-brand-name { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: white; letter-spacing: -0.02em; }
.auth-brand-name em { font-style: italic; font-weight: 400; }

.auth-brand-content { position: relative; z-index: 1; }
.auth-brand-headline { font-family: var(--font-display); font-size: clamp(36px, 3.5vw, 52px); font-weight: 400; line-height: 1.05; letter-spacing: -0.025em; color: white; margin: 0 0 20px; }
.auth-brand-headline em { font-style: italic; }
.auth-brand-desc { font-size: 15px; color: rgba(255,255,255,0.75); line-height: 1.65; margin: 0 0 32px; }

.auth-brand-stats { display: flex; gap: 14px; }
.auth-stat { background: rgba(255,255,255,0.14); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.20); border-radius: var(--radius-lg); padding: 14px 16px; text-align: center; flex: 1; }
.auth-stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 500; color: white; line-height: 1; margin-bottom: 4px; }
.auth-stat-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.62); }
.auth-brand-footer { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,0.45); }

.auth-panel-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-form-inner { width: 100%; max-width: 420px; }

.auth-mobile-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
@media (min-width: 768px) { .auth-mobile-logo { display: none; } }
.auth-mobile-logo img { width: 48px; height: 48px; border-radius: 50%; object-fit: contain; border: 2px solid var(--orange-soft); background: var(--orange-xsoft); }
.auth-mobile-logo-name { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; }
.auth-mobile-logo-name em { font-style: italic; color: var(--orange); }

.auth-form-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange); font-weight: 600; margin-bottom: 10px; }
.auth-form-title { font-family: var(--font-display); font-size: clamp(34px, 4vw, 44px); font-weight: 400; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 8px; }
.auth-form-title em { font-style: italic; color: var(--orange); }
.auth-form-subtitle { font-size: 14px; color: var(--ink-3); margin: 0 0 36px; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.auth-field input { width: 100%; height: 52px; padding: 0 16px; background: var(--surface-0); border: 2px solid var(--hairline); border-radius: var(--radius-md); font-size: 15px; font-family: var(--font-ui); color: var(--ink); outline: none; transition: all 0.15s ease; -webkit-appearance: none; }
.auth-field input:focus { background: var(--bg); border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-xsoft); }
.auth-field input::placeholder { color: var(--ink-4); }

.auth-submit { width: 100%; height: 54px; background: var(--orange); color: white; border: none; border-radius: var(--radius-pill); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; transition: all 0.15s ease; box-shadow: 0 4px 16px rgba(232,98,42,0.30); margin-top: 4px; font-family: var(--font-ui); }
.auth-submit:hover { background: var(--orange-deep); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,98,42,0.38); }
.auth-submit:active { transform: translateY(0); }

.auth-error { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; font-weight: 500; margin-bottom: 20px; }

.auth-footer { margin-top: 28px; text-align: center; font-size: 14px; color: var(--ink-3); }
.auth-footer a { color: var(--orange); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.auth-footer a:hover { color: var(--orange-deep); }

/* ── Theme: Vivaz (forest green) ── */
[data-theme="vivaz"] {
  --orange:       #2A7A58;
  --orange-deep:  #1D5C40;
  --orange-mid:   #3A9870;
  --orange-soft:  #D0EDE0;
  --orange-xsoft: #EAF6EF;
  --teal:         #E8962A;
  --teal-deep:    #C07018;
  --teal-mid:     #F0A840;
  --teal-soft:    #FEF0D8;
  --teal-xsoft:   #FEF8EE;
  --bg:           #FFFDF9;
  --surface-0:    #F6F1E8;
  --surface-1:    #EDE5D4;
  --surface-2:    #E0D8C8;
  --surface-3:    #D4CDB8;
  --hairline:      #E3DCD0;
  --hairline-soft: #EAE4D8;
}
