/* ── TOKENS ── */
:root {
  --bg: #e8f5f2;
  --bg-alt: #f0f4f8;
  --card: #ffffff;
  --primary: #0CC9A5;
  --primary-dark: #0AA88D;
  --gradient: linear-gradient(135deg, #0CC9A5 0%, #7C3AED 100%);
  --streak-grad: linear-gradient(135deg, #FB923C 0%, #EF4444 100%);
  --text: #1E1B4B;
  --text-2: #374151;
  --muted: #6B7280;
  --light: #9CA3AF;
  --amber: #F59E0B;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* App page gets a subtle ambient gradient (fixed so it doesn't scroll) */
body.app-page {
  background:
    radial-gradient(ellipse 70% 35% at 5% 0%,  rgba(12,201,165,0.13) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 95% 95%, rgba(124,58,237,0.09) 0%, transparent 100%),
    #f0f9f7;
  background-attachment: fixed;
}

/* ── LOGIN ── */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #d1fae5 0%, #ede9fe 100%);
}

.login-container {
  text-align: center; padding: 3.5rem 2rem;
  max-width: 420px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}

.login-logo {
  width: 140px; height: 140px; border-radius: 50%;
  overflow: hidden; margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(12,201,165,0.3), 0 2px 8px rgba(0,0,0,0.12);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.login-container h1 {
  font-size: 2.2rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.login-tagline {
  color: var(--muted); font-size: 1.02rem; line-height: 1.7;
  margin-bottom: 2.5rem;
}

.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #333;
  padding: 14px 36px; border-radius: var(--pill);
  text-decoration: none; font-weight: 600; font-size: 1rem;
  box-shadow: var(--shadow-md);
  transition: transform .15s, box-shadow .15s;
  margin-bottom: 2.75rem;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.15); }

.login-features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; width: 100%;
}
.login-feature {
  background: rgba(255,255,255,0.75); backdrop-filter: blur(8px);
  padding: 10px 6px; border-radius: var(--radius-sm);
  font-size: 0.78rem; color: var(--text-2); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

/* ── APP HEADER ── */
.app-page { display: flex; flex-direction: column; min-height: 100vh; }

header {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
  padding: 0.75rem 1.5rem 0.7rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-top { display: flex; align-items: center; justify-content: space-between; }
.header-stats { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hdr-level { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.hdr-lvl-badge {
  background: var(--primary); color: white;
  font-size: 0.6rem; font-weight: 700; padding: 2px 8px; border-radius: var(--pill);
  white-space: nowrap; flex-shrink: 0;
}
.hdr-chef-title { font-weight: 700; font-size: 0.76rem; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.hdr-xp-track {
  flex: 1; height: 5px; background: #F3F4F6; border-radius: var(--pill); overflow: hidden; min-width: 40px;
}
.hdr-xp-fill { height: 100%; background: var(--gradient); border-radius: var(--pill); transition: width .5s ease; }
.hdr-xp-text { font-size: 0.68rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.hdr-streak { font-weight: 700; font-size: 0.85rem; white-space: nowrap; flex-shrink: 0; color: #EA580C; }

.header-user { display: flex; align-items: center; gap: 10px; }
.header-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; overflow: hidden; flex-shrink: 0;
}
.header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.header-name { font-weight: 700; font-size: 0.95rem; line-height: 1.2; color: var(--text); }
.header-subtitle { font-size: 0.78rem; color: var(--muted); }

.header-icons { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--border); background: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg); border-color: var(--primary); }

/* ── MAIN ── */
main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ── DASHBOARD ROW ── */
.dash-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
}

.level-card {
  background: var(--card); border-radius: var(--radius); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow);
}

.level-avatar { position: relative; flex-shrink: 0; }
.level-avatar-img {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.level-badge {
  position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: white;
  font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: var(--pill);
  white-space: nowrap;
}

.level-info { flex: 1; min-width: 0; }
.chef-title { font-weight: 700; font-size: 0.92rem; display: block; margin-bottom: 6px; color: var(--text); }
.xp-bar-track { background: #F3F4F6; border-radius: var(--pill); height: 6px; overflow: hidden; margin-bottom: 4px; }
.xp-bar-fill { height: 100%; border-radius: var(--pill); background: var(--gradient); transition: width .5s ease; }
.xp-text { font-size: 0.73rem; color: var(--muted); display: flex; justify-content: space-between; }

.level-star { font-size: 1.3rem; flex-shrink: 0; }

.streak-card {
  background: var(--streak-grad); border-radius: var(--radius); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow);
}
.streak-fire {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0;
}
.streak-info { color: white; }
.streak-label { font-size: 0.68rem; font-weight: 700; letter-spacing: .09em; opacity: 0.85; margin-bottom: 2px; }
.streak-count { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.streak-sub { font-size: 0.78rem; opacity: 0.85; margin-top: 3px; }

/* ── HEADER NAV (tabs row) ── */
.header-nav {
  display: flex; align-items: center; gap: 0.4rem;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 1px;
}
.header-nav::-webkit-scrollbar { display: none; }

/* search row */
.header-search { padding-top: 2px; }
.header-search.hidden { display: none; }
.search-input-hdr {
  width: 100%; padding: 8px 16px;
  border-radius: var(--pill); border: 1.5px solid var(--border);
  background: #f9fafb; font-size: 0.92rem; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.search-input-hdr:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,201,165,0.15); background: white;
}

/* ── TABS ── */
.tab {
  background: white; border: 1.5px solid var(--border);
  color: var(--muted); padding: 7px 16px; border-radius: var(--pill);
  cursor: pointer; font-size: 0.84rem; font-weight: 500; transition: all .15s;
  flex-shrink: 0;
}
.tab.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
  flex-direction: column;
}
.filter-bar > .search-input { align-self: stretch; }
.filter-bar > div { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 0.65rem; }
.filter-label { font-size: 0.68rem; font-weight: 700; letter-spacing: .1em; color: var(--light); margin-bottom: 6px; }

.search-input {
  width: 100%; padding: 10px 18px;
  border-radius: var(--pill); border: 1.5px solid var(--border);
  background: #fff; font-size: 0.95rem; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,201,165,0.15); }
.load-more-wrap { display: flex; justify-content: center; padding: 1rem 0 0.5rem; }
.btn-load-more {
  background: var(--gradient); color: white; border: none;
  font-family: inherit; font-size: 0.9rem; font-weight: 700;
  padding: 12px 32px; border-radius: var(--pill); cursor: pointer;
  box-shadow: 0 4px 14px rgba(12,201,165,0.3); transition: opacity .15s;
}
.btn-load-more:hover { opacity: 0.88; }
.pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pill {
  background: white; border: 1.5px solid var(--border);
  color: var(--text-2); padding: 6px 14px; border-radius: var(--pill);
  cursor: pointer; font-size: 0.83rem; font-weight: 500; transition: all .15s;
  display: flex; align-items: center; gap: 5px;
}
.pill.active { background: var(--primary); border-color: var(--primary); color: white; }
.pill:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

.pill-lvl1:not(.active)  { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.pill-lvl2:not(.active)  { border-color: #5eead4; color: #0f766e; background: #f0fdfa; }
.pill-lvl3:not(.active)  { border-color: #67e8f9; color: #0e7490; background: #ecfeff; }
.pill-lvl4:not(.active)  { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.pill-lvl5:not(.active)  { border-color: #a5b4fc; color: #4338ca; background: #eef2ff; }
.pill-lvl6:not(.active)  { border-color: #fde68a; color: #b45309; background: #fffbeb; }
.pill-lvl7:not(.active)  { border-color: #fed7aa; color: #c2410c; background: #fff7ed; }
.pill-lvl8:not(.active)  { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }
.pill-lvl9:not(.active)  { border-color: #c4b5fd; color: #6d28d9; background: #f5f3ff; }
.pill-lvl10:not(.active) { border-color: #d8b4fe; color: #7e22ce; background: #faf5ff; }

.diff-lv1  { background: #dcfce7; color: #15803d; }
.diff-lv2  { background: #ccfbf1; color: #0f766e; }
.diff-lv3  { background: #cffafe; color: #0e7490; }
.diff-lv4  { background: #dbeafe; color: #1d4ed8; }
.diff-lv5  { background: #e0e7ff; color: #4338ca; }
.diff-lv6  { background: #fef3c7; color: #b45309; }
.diff-lv7  { background: #ffedd5; color: #c2410c; }
.diff-lv8  { background: #fee2e2; color: #b91c1c; }
.diff-lv9  { background: #ede9fe; color: #6d28d9; }
.diff-lv10 { background: #f3e8ff; color: #7e22ce; }

.btn-new {
  background: var(--gradient); color: white;
  border: none; padding: 7px 18px; border-radius: var(--pill);
  cursor: pointer; font-weight: 600; font-size: 0.84rem;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; box-shadow: 0 2px 10px rgba(12,201,165,0.3);
  text-decoration: none;
}
.btn-new:hover { opacity: 0.95; }

/* ── RECIPE CARDS ── */
.recipes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem;
}

.recipe-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  border: 1.5px solid transparent; text-decoration: none; display: block; color: inherit;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.recipe-card.is-cooked { border-color: #10B981; }

.recipe-img {
  position: relative; height: 175px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#86efac,#22c55e); /* safe fallback */
}
.recipe-img img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0; z-index: 0;
}
/* gradient fade at bottom of photo cards */
.recipe-img img + .recipe-img-fade {
  display: block;
}
.recipe-img-fade {
  display: none; position: absolute; bottom: 0; left: 0; right: 0; height: 70px; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
  pointer-events: none;
}
.recipe-img-emoji { font-size: 3.5rem; position: relative; z-index: 1; }

.recipe-top-tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 2; }
.recipe-tag {
  background: rgba(255,255,255,0.92); color: var(--text);
  font-size: 0.71rem; font-weight: 600; padding: 3px 9px; border-radius: var(--pill);
}
.community-tag { background: rgba(124,58,237,0.85) !important; color: white !important; }
.country-pill { padding: 2px 8px; border-radius: var(--pill); font-size: 0.68rem; font-weight: 500; background: rgba(14,165,233,0.12); color: #0369a1; }
.recipe-xp-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: var(--amber); color: white;
  font-size: 0.76rem; font-weight: 700; padding: 4px 10px; border-radius: var(--pill);
}
.recipe-lock-overlay {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(0,0,0,0.38); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.recipe-lock-badge {
  background: white; color: var(--text);
  font-size: 0.83rem; font-weight: 700; padding: 6px 16px; border-radius: var(--pill);
  display: flex; align-items: center; gap: 5px;
}
.btn-challenge {
  background: linear-gradient(135deg,#7C3AED,#9333EA);
  color: white; font-size: 0.75rem; font-weight: 700;
  padding: 5px 14px; border-radius: var(--pill);
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
  transition: opacity .15s;
}
.btn-challenge:hover { opacity: 0.9; }
.recipe-cooked-chip {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: rgba(255,255,255,0.93);
  font-size: 0.78rem; font-weight: 600; padding: 5px 14px; border-radius: var(--pill);
  white-space: nowrap; color: #059669; display: flex; align-items: center; gap: 4px;
}

.recipe-body { padding: 1rem 1.1rem 1.15rem; }
.recipe-body h3 { font-size: 0.97rem; font-weight: 700; margin-bottom: 4px; }
.recipe-body p { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.7rem; line-height: 1.5; }
.recipe-meta-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.77rem; color: var(--muted); }

.diff-pill { padding: 2px 9px; border-radius: var(--pill); font-size: 0.7rem; font-weight: 600; }

/* ── ACHIEVEMENTS ── */
.achievements-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem;
}
.ach-card {
  background: var(--card); border-radius: var(--radius); padding: 1.25rem 1rem;
  text-align: center; box-shadow: var(--shadow); border: 2px solid transparent;
}
.ach-card.earned { border-color: var(--primary); }
.ach-card.locked { opacity: 0.5; filter: grayscale(1); }
.ach-icon-wrap {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 0.75rem;
}
.ach-card.locked .ach-icon-wrap { background: #E5E7EB; }
.ach-card strong { font-size: 0.85rem; display: block; margin-bottom: 4px; }
.ach-card p { font-size: 0.76rem; color: var(--muted); line-height: 1.4; }
.ach-card small { font-size: 0.72rem; color: var(--primary); display: block; margin-top: 6px; }

/* ── HISTORY ── */
.history-list { display: flex; flex-direction: column; gap: 0.75rem; }
.history-item {
  background: var(--card); border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow);
}
.history-item-left strong { font-size: 0.93rem; display: block; margin-bottom: 2px; }
.history-item-right { display: flex; gap: 0.75rem; align-items: center; font-size: 0.81rem; color: var(--muted); flex-shrink: 0; }
.diff-tag { font-size: 0.7rem; padding: 2px 8px; border-radius: var(--pill); background: #F3F4F6; color: var(--muted); display: inline-block; margin-top: 2px; }
.empty { color: var(--muted); text-align: center; padding: 3rem; font-size: 0.95rem; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 12px 24px; border-radius: var(--pill); font-size: 0.9rem;
  z-index: 300; box-shadow: var(--shadow-md);
  white-space: pre-line; text-align: center; max-width: 90vw;
}
.toast.hidden { display: none; }

/* ── COOK PAGE ── */
.cook-page { background: var(--bg-alt); min-height: 100vh; }

.page-header {
  background: white; padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.page-header-title { font-weight: 700; font-size: 1rem; }

.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--border); background: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; text-decoration: none; color: var(--text); flex-shrink: 0;
}

.cook-hero {
  height: 220px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 5rem;
}
.cook-hero img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cook-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
}
.cook-hero-info { position: absolute; bottom: 1.25rem; left: 1.5rem; right: 1.5rem; color: white; }
.cook-hero-info h1 { font-size: 1.4rem; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.cook-hero-info p { font-size: 0.85rem; opacity: 0.9; margin-top: 2px; }

.cook-body { max-width: 700px; margin: 0 auto; padding: 1.5rem; }

.cook-meta-pills { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cook-pill {
  background: white; border: 1.5px solid var(--border);
  padding: 5px 12px; border-radius: var(--pill);
  font-size: 0.81rem; font-weight: 500; color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}
.cook-pill.xp { background: var(--amber); border-color: var(--amber); color: white; }
.cook-pill.challenge { background: linear-gradient(135deg,#7C3AED,#9333EA); border-color: #7C3AED; color: white; }

.progress-card {
  background: white; border-radius: var(--radius); padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.progress-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem;
}
.progress-card-header span { font-size: 0.88rem; font-weight: 600; }
.progress-count { color: var(--primary); font-weight: 700; }
.progress-track { background: #F3F4F6; border-radius: var(--pill); height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient); border-radius: var(--pill); transition: width .4s ease; }

.step-card {
  background: white; border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.step-label {
  color: var(--primary); font-size: 0.78rem; font-weight: 700;
  letter-spacing: .08em; display: flex; align-items: center; gap: 6px; margin-bottom: 0.75rem;
}
.step-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.step-card .step-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1.25rem; }
.step-btn {
  width: 100%; background: var(--gradient); color: white; border: none;
  padding: 14px; border-radius: var(--pill); font-size: 1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 15px rgba(12,201,165,0.3); transition: opacity .15s, transform .1s;
}
.step-btn:hover { opacity: 0.92; transform: translateY(-1px); }

.elementos-pill {
  cursor: pointer; user-select: none;
  background: linear-gradient(135deg,#0CC9A5,#7C3AED) !important;
  color: white !important; border: none !important;
  transition: opacity .15s;
}
.elementos-pill:hover { opacity: 0.88; }

.elements-panel {
  background: white; border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow); margin-bottom: 1rem;
}
.elements-section { margin-bottom: 1rem; }
.elements-section:last-child { margin-bottom: 0; }
.elements-title { font-size: 0.85rem; font-weight: 700; color: var(--text-2); margin-bottom: 0.65rem; }
.elem-check-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; padding: 6px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: color .15s;
}
.elem-check-item:last-child { border-bottom: none; }
.elem-check-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.elem-check-item.checked { color: var(--muted); text-decoration: line-through; }
.elem-equip-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.elem-equip-item:last-child { border-bottom: none; }
.elem-equip-item.missing { color: var(--muted); }
.equip-missing-label {
  margin-left: auto; font-size: 0.72rem; color: #EF4444;
  background: #FEE2E2; padding: 2px 8px; border-radius: var(--pill);
}

.steps-list-card {
  background: white; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.steps-list-card h3 { font-size: 0.88rem; font-weight: 700; margin-bottom: 0.85rem; color: var(--text-2); }
.step-list-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--border);
}
.step-list-item:last-child { border-bottom: none; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; background: #F3F4F6; color: var(--muted);
}
.step-num.done { background: var(--primary); color: white; }
.step-num.current { background: var(--amber); color: white; }
.step-list-text { font-size: 0.86rem; color: var(--muted); }
.step-list-item.done-step .step-list-text { text-decoration: line-through; color: var(--light); }
.step-list-item.current-step .step-list-text { color: var(--text); font-weight: 600; }

.finish-card {
  background: var(--gradient); border-radius: var(--radius); padding: 2rem;
  text-align: center; color: white; box-shadow: var(--shadow-md); margin-bottom: 1.25rem;
}
.finish-card .finish-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.finish-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.finish-card p { opacity: 0.9; margin-bottom: 1.25rem; }
.rating-stars { font-size: 2rem; display: flex; gap: 0.5rem; justify-content: center; margin: 0.75rem 0 1.25rem; }
.rating-stars span { cursor: pointer; opacity: 0.5; transition: opacity .1s; }
.finish-notes {
  width: 100%; background: rgba(255,255,255,0.2); border: none; outline: none;
  border-radius: var(--radius-sm); color: white; padding: 10px 14px; font-size: 0.9rem;
  resize: vertical; min-height: 60px; margin-bottom: 1rem; font-family: inherit;
}
.finish-notes::placeholder { color: rgba(255,255,255,0.65); }
.finish-submit {
  background: white; color: var(--text); border: none;
  padding: 13px 32px; border-radius: var(--pill);
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: opacity .15s;
}
.finish-submit:hover { opacity: 0.92; }

/* ── PROFILE PAGE ── */
.profile-page { background: var(--bg); min-height: 100vh; }

.profile-body { max-width: 700px; margin: 0 auto; padding: 1.5rem; }

.profile-card {
  background: white; border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
}

.profile-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.profile-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; overflow: hidden; flex-shrink: 0;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-info-name { font-size: 1.2rem; font-weight: 800; }
.profile-info-email { color: var(--muted); font-size: 0.86rem; margin-bottom: 0.6rem; }
.profile-stat-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stat-pill { padding: 4px 12px; border-radius: var(--pill); font-size: 0.79rem; font-weight: 600; }
.stat-pill.level   { background: #dcfce7; color: #15803d; }
.stat-pill.xp      { background: #fef3c7; color: #b45309; }
.stat-pill.streak  { background: #fee2e2; color: #b91c1c; }

.progress-label-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.profile-progress-track { background: #F3F4F6; border-radius: var(--pill); height: 7px; overflow: hidden; }
.profile-progress-fill { height: 100%; background: var(--gradient); border-radius: var(--pill); }

.form-group { margin-bottom: 1.25rem; }
.form-label { font-size: 0.9rem; font-weight: 600; display: block; margin-bottom: 0.5rem; }
.form-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; color: var(--text); background: #F9FAFB;
  font-family: inherit; transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--primary); background: white; }

.avatar-grid { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.avatar-opt {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: #F3F4F6; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; border: 2px solid transparent; transition: all .15s;
}
.avatar-opt.selected { border-color: var(--primary); background: #e0faf4; }
.avatar-opt:hover:not(.selected) { border-color: var(--primary); }

.level-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.level-opt {
  padding: 0.9rem 0.75rem; border-radius: var(--radius-sm);
  border: 2px solid var(--border); cursor: pointer; transition: all .15s; background: white;
}
.level-opt.selected { border-color: var(--primary); }
.level-opt strong { display: block; font-size: 0.88rem; margin-bottom: 2px; }
.level-opt span { font-size: 0.75rem; color: var(--muted); }

.restrictions-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.restriction-pill {
  padding: 6px 14px; border-radius: var(--pill);
  border: 1.5px solid var(--border); background: white;
  font-size: 0.84rem; cursor: pointer; transition: all .15s; color: var(--text-2);
}
.restriction-pill.active { background: var(--primary); border-color: var(--primary); color: white; }

.btn-save {
  width: 100%; background: var(--gradient); color: white;
  border: none; padding: 15px; border-radius: var(--pill);
  font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 15px rgba(12,201,165,0.3); margin-top: 1.5rem;
}
.btn-save:hover { opacity: 0.93; }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-delete {
  width: 100%; background: none; color: #ef4444;
  border: 1.5px solid #fca5a5; padding: 12px; border-radius: var(--pill);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.btn-delete:hover { background: #fef2f2; border-color: #ef4444; }

/* Edit/delete row on recipe cards (own recipes only) */
.recipe-edit-row {
  display: flex; gap: 8px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.btn-recipe-edit, .btn-recipe-delete {
  flex: 1; padding: 5px 8px; border-radius: var(--pill);
  font-size: 0.72rem; font-weight: 600; cursor: pointer;
  font-family: inherit; text-align: center; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn-recipe-edit {
  background: none; border: 1.5px solid var(--border); color: var(--text-2);
  text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.btn-recipe-edit:hover { border-color: var(--primary); color: var(--primary); background: rgba(12,201,165,0.06); }
.btn-recipe-delete {
  background: none; border: 1.5px solid #fca5a5; color: #ef4444;
}
.btn-recipe-delete:hover { background: #fef2f2; border-color: #ef4444; }

.logout-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--pill);
  border: 1.5px solid var(--border); background: white;
  font-size: 0.86rem; cursor: pointer; color: var(--text-2);
  text-decoration: none; transition: all .15s; font-family: inherit;
}
.logout-btn:hover { border-color: #EF4444; color: #EF4444; }

/* ── NEW RECIPE PAGE ── */
.nueva-page { background: var(--bg); min-height: 100vh; }
.nueva-body { max-width: 700px; margin: 0 auto; padding: 1.5rem; }
.nueva-body .form-section { margin-bottom: 1.25rem; }
.nueva-body .form-section-title { font-size: 0.75rem; font-weight: 700; letter-spacing: .09em; color: var(--light); margin-bottom: 0.75rem; }
textarea.form-input { resize: vertical; min-height: 80px; }
.ingredients-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.ingredient-row { display: flex; gap: 0.5rem; }
.ingredient-row .form-input { flex: 1; }
.btn-remove {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  border: 1.5px solid #fee2e2; background: #fee2e2; color: #b91c1c;
  cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.btn-add-item {
  background: none; border: 1.5px dashed var(--border);
  color: var(--primary); padding: 8px 16px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.84rem; font-weight: 600; width: 100%;
  transition: background .15s;
}
.btn-add-item:hover { background: #e0faf4; }
.diff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.diff-opt {
  padding: 0.7rem 0.5rem; text-align: center; border-radius: var(--radius-sm);
  border: 2px solid var(--border); cursor: pointer; transition: all .15s; background: white;
  font-size: 0.83rem; font-weight: 600;
}
.diff-opt.selected { border-color: var(--primary); color: var(--primary); background: #e0faf4; }

/* ── PROFILE STATS GRID ── */
.stats-section-title {
  font-weight: 800; font-size: 1rem; margin-bottom: 1rem;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem;
}
.stat-block {
  background: var(--bg-alt); border-radius: var(--radius-sm);
  padding: .75rem .5rem; text-align: center;
}
.stat-val {
  font-size: 1.2rem; font-weight: 800; line-height: 1.2; color: var(--text);
}
.stat-lbl {
  font-size: .7rem; color: var(--muted); margin-top: .25rem; line-height: 1.3;
}
.last-recipe-row {
  display: flex; align-items: center; gap: .5rem; margin-top: .9rem;
  padding-top: .9rem; border-top: 1px solid var(--border);
  font-size: .85rem; flex-wrap: wrap;
}
.last-recipe-label { color: var(--muted); }
.last-recipe-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last-recipe-date { color: var(--muted); flex-shrink: 0; }

/* ── EMAIL LOGIN ── */
.login-divider {
  display: flex; align-items: center; gap: .75rem; width: 100%; margin: 1.25rem 0 1rem;
  color: var(--light); font-size: .82rem;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-tabs {
  display: flex; gap: .25rem; background: #f3f4f6; border-radius: var(--pill);
  padding: .2rem; width: 100%; margin-bottom: 1rem;
}
.login-tab {
  flex: 1; padding: .5rem .75rem; border: none; border-radius: var(--pill);
  background: transparent; font-size: .88rem; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--muted); transition: all .15s;
}
.login-tab.active { background: white; color: var(--text); box-shadow: var(--shadow); }
.email-form { width: 100%; display: flex; flex-direction: column; gap: .65rem; }
.email-form.hidden { display: none; }
.email-input {
  width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .92rem; font-family: inherit;
  outline: none; transition: border-color .15s; background: white; color: var(--text);
}
.email-input:focus { border-color: var(--primary); }
.btn-email-submit {
  width: 100%; padding: .85rem; background: var(--gradient); color: white;
  border: none; border-radius: var(--pill); font-size: .95rem; font-weight: 700;
  cursor: pointer; font-family: inherit; margin-top: .25rem;
  box-shadow: 0 4px 15px rgba(12,201,165,.3);
}
.btn-email-submit:hover { opacity: .93; }
.btn-email-submit:disabled { opacity: .6; cursor: default; }
.login-error {
  width: 100%; padding: .65rem .9rem; background: #fee2e2; border: 1px solid #fca5a5;
  border-radius: var(--radius-sm); color: #b91c1c; font-size: .85rem; text-align: center;
}
.login-error.hidden { display: none; }

/* ── UTENSIL MODAL ── */
.utensil-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.utensil-modal.hidden { display: none; }
.utensil-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
}
.utensil-modal-box {
  position: relative; z-index: 1;
  background: white; border-radius: 24px 24px 0 0;
  padding: 2rem 1.5rem 2.5rem; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}
.utensil-step-icon { font-size: 3rem; margin-bottom: 1rem; text-align: center; }
.utensil-modal-box h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: .4rem; }
.utensil-modal-box > div > p, .utensil-step > p {
  color: var(--muted); font-size: .88rem; margin-bottom: 1.25rem; line-height: 1.5;
}
.utensil-grid {
  display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem;
}
.utensil-chip {
  padding: .42rem .9rem; border-radius: var(--pill);
  border: 1.5px solid var(--border); background: white;
  font-size: .84rem; cursor: pointer; font-family: inherit;
  transition: all .15s; color: var(--text-2);
}
.utensil-chip.selected {
  border-color: var(--primary); background: #e0faf4; color: var(--primary); font-weight: 600;
}
.btn-skip {
  width: 100%; background: none; border: none; color: var(--muted);
  font-size: .88rem; cursor: pointer; padding: .75rem; margin-top: .25rem; font-family: inherit;
}
.btn-skip:hover { color: var(--text-2); }

/* ── DAILY SUGGESTIONS ── */
.daily-suggestions {
  margin-bottom: 1.25rem; background: white;
  border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.suggestions-header {
  display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .9rem;
}
.suggestions-icon { font-size: 1.6rem; flex-shrink: 0; }
.suggestions-title { font-weight: 800; font-size: .95rem; line-height: 1.3; }
.suggestions-subtitle { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.suggestions-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem;
}
.suggestion-card {
  text-decoration: none; color: var(--text);
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1.5px solid var(--border); display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.suggestion-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.suggestion-img {
  height: 72px; display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; position: relative; overflow: hidden;
}
.suggestion-img img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.suggestion-body { padding: .45rem .6rem .55rem; }
.suggestion-lvl {
  font-size: .68rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .04em;
}
.suggestion-title {
  font-size: .8rem; font-weight: 700; line-height: 1.25;
  margin: .18rem 0 .2rem; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.suggestion-meta { font-size: .7rem; color: var(--muted); }

/* ── FILTER TOGGLE / COLLAPSIBLE PANEL ── */
.filter-toggle-row {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
}
.filter-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; border: 1.5px solid var(--border);
  padding: 7px 16px; border-radius: var(--pill);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--text-2); transition: all .15s; font-family: inherit;
  position: relative;
}
.filter-toggle-btn.active,
.filter-toggle-btn.panel-open { border-color: var(--primary); color: var(--primary); }
.filter-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-active-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
  position: absolute; top: 5px; right: 5px;
}
.filter-active-dot.hidden { display: none; }

.filter-search-row { margin-bottom: 0.75rem; }
.filter-search-row.hidden { display: none; }

.filter-panel {
  background: white; border-radius: var(--radius); padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.filter-panel.hidden { display: none; }
.btn-clear-filters {
  background: none; border: 1.5px solid var(--border);
  color: var(--muted); padding: 6px 16px; border-radius: var(--pill);
  cursor: pointer; font-size: 0.82rem; font-family: inherit;
  align-self: flex-start; transition: all .15s;
}
.btn-clear-filters:hover { border-color: #EF4444; color: #EF4444; }

/* ── SECTION ROWS (Netflix-style) ── */
.section-row { margin-bottom: 2rem; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.8rem; padding: 0 2px;
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1rem; color: var(--text);
}
.section-count {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px;
  border-radius: var(--pill); background: #F3F4F6; color: var(--muted);
}
.section-view-all {
  background: none; border: none; color: var(--primary);
  font-weight: 600; font-size: 0.83rem; cursor: pointer;
  padding: 4px 10px; border-radius: 8px; font-family: inherit;
  transition: background .15s;
}
.section-view-all:hover { background: rgba(12,201,165,0.1); }

.section-scroll {
  display: flex; gap: 0.7rem; overflow-x: auto;
  padding-bottom: 0.4rem; padding-right: 0.5rem;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.section-scroll::-webkit-scrollbar { display: none; }

/* Portrait recipe card (for section rows) */
.sec-card {
  flex-shrink: 0; width: 150px;
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit;
  scroll-snap-align: start;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s; display: block;
}
.sec-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-md); }
.sec-card-locked { opacity: 0.65; cursor: default; }

.sec-card-img {
  width: 100%; height: 210px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.sec-card-img img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
}
.sec-card-emoji { font-size: 2.5rem; position: relative; z-index: 1; }
.sec-card-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.08) 55%, transparent 100%);
}
.sec-card-badges {
  position: absolute; top: 7px; left: 7px; right: 7px;
  display: flex; justify-content: space-between; align-items: flex-start; z-index: 2;
}
.sec-card-lvl {
  background: rgba(255,255,255,0.9); color: var(--text);
  font-size: 0.62rem; font-weight: 700; padding: 3px 7px; border-radius: var(--pill);
}
.sec-card-cooked {
  background: #10B981; color: white;
  font-size: 0.62rem; font-weight: 700; padding: 3px 7px; border-radius: var(--pill);
}
.sec-card-info {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 0.55rem 0.65rem;
}
.sec-card-title {
  font-size: 0.79rem; font-weight: 700; color: white; line-height: 1.25;
  margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sec-card-meta { font-size: 0.64rem; color: rgba(255,255,255,0.78); font-weight: 500; }

/* ── IMPROVED RECIPE GRID (filter mode) ── */
.recipes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.recipe-img { position: relative; height: 195px; overflow: hidden; }

/* Hidden utility */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR
══════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(229,231,235,0.8);
  display: flex; align-items: center; justify-content: space-around;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  gap: 4px;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: 14px;
  text-decoration: none; color: var(--light);
  border: none; background: none; cursor: pointer; font-family: inherit;
  transition: color .18s; min-width: 56px; flex: 1;
}
.nav-item .nav-icon-wrap {
  width: 34px; height: 34px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; transition: background .18s, transform .18s;
}
.nav-item .nav-label {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.nav-item:hover { color: var(--primary); }
.nav-item:hover .nav-icon-wrap { background: rgba(12,201,165,0.1); }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon-wrap {
  background: rgba(12,201,165,0.14);
  transform: translateY(-1px);
}

/* Center + button (new recipe) */
.nav-add {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient);
  color: white; font-size: 1.5rem; font-weight: 300; line-height: 1;
  text-decoration: none; text-align: center;
  box-shadow: 0 4px 18px rgba(12,201,165,0.45);
  margin-top: -14px;
  transition: opacity .18s, transform .18s;
  border: 3px solid white;
}
.nav-add:hover { opacity: 0.92; transform: translateY(-2px) scale(1.05); color: white; }

/* Body padding to clear bottom nav */
.app-page main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.profile-body  { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.cook-body     { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.nueva-body    { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

/* ══════════════════════════════════════════════════════
   PAGE TRANSITIONS & ANIMATIONS
══════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

body { animation: fadeIn .25s ease; }
.section-row { animation: fadeUp .3s ease both; }
.section-row:nth-child(2) { animation-delay: .05s; }
.section-row:nth-child(3) { animation-delay: .1s; }
.section-row:nth-child(4) { animation-delay: .15s; }
.section-row:nth-child(5) { animation-delay: .2s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-block { height: 180px; border-radius: var(--radius); }

/* ══════════════════════════════════════════════════════
   IMPROVED PAGE HEADERS (all secondary pages)
══════════════════════════════════════════════════════ */
.page-header {
  background: rgba(255,255,255,0.96); backdrop-filter: blur(16px);
  padding: 0.9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  min-height: 58px;
}
.page-header-title {
  font-weight: 800; font-size: 1rem; color: var(--text);
  flex: 1; text-align: center;
}
.back-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--border); background: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; text-decoration: none; color: var(--text); flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.back-btn:hover { border-color: var(--primary); background: rgba(12,201,165,0.08); }

/* ══════════════════════════════════════════════════════
   APP MAIN HEADER — cleaner, no nav tabs
══════════════════════════════════════════════════════ */
header {
  background: rgba(255,255,255,0.96); backdrop-filter: blur(16px) saturate(180%);
  padding: 0.85rem 1.25rem 0.7rem;
  display: flex; flex-direction: column; gap: 0.55rem;
  border-bottom: 1px solid rgba(229,231,235,0.7);
  position: sticky; top: 0; z-index: 100;
}
/* Accent line at very top of header */
header::before {
  content: ''; display: block;
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient);
}

/* ══════════════════════════════════════════════════════
   IMPROVED RECIPE CARDS (filter grid mode)
══════════════════════════════════════════════════════ */
.recipe-card {
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  transition: transform .2s, box-shadow .2s;
}
.recipe-card:hover { transform: translateY(-5px); box-shadow: 0 8px 28px rgba(0,0,0,0.12); }
.recipe-body h3 { font-size: 0.95rem; font-weight: 700; line-height: 1.3; }

/* ══════════════════════════════════════════════════════
   PROFILE PAGE — improved stats
══════════════════════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;
}
.stat-block {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 1rem; text-align: center;
}
.stat-val {
  font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--text);
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-lbl { font-size: .72rem; color: var(--muted); margin-top: .3rem; line-height: 1.3; font-weight: 500; }
.stats-section-title {
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--light);
  margin-bottom: .9rem; text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════
   COOK PAGE — immersive improvements
══════════════════════════════════════════════════════ */
.cook-hero { height: 260px; }
.step-card { border-radius: 18px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); }
.step-card h2 { font-size: 1.25rem; }
.progress-card { border-radius: 18px; }
.finish-card { border-radius: 18px; }

/* ══════════════════════════════════════════════════════
   DAILY SUGGESTIONS — improved
══════════════════════════════════════════════════════ */
.daily-suggestions {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(12,201,165,0.06) 0%, rgba(124,58,237,0.06) 100%);
  border: 1px solid rgba(12,201,165,0.15);
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════
   PROFILE CARD improvements
══════════════════════════════════════════════════════ */
.profile-card { border-radius: 18px; }

/* ══════════════════════════════════════════════════════
   LOGIN PAGE — visual polish
══════════════════════════════════════════════════════ */
.login-page {
  background: linear-gradient(160deg, #d1fae5 0%, #ede9fe 50%, #fce7f3 100%);
  min-height: 100vh;
}
.login-container {
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
  border-radius: 28px; margin: 1.5rem auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  padding: 2.5rem 2rem;
}
.login-logo {
  width: 110px; height: 110px;
  box-shadow: 0 8px 32px rgba(12,201,165,0.4);
}

/* ══════════════════════════════════════════════════════
   FORM IMPROVEMENTS
══════════════════════════════════════════════════════ */
.form-input { border-radius: 12px; border-color: #E5E7EB; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,201,165,0.15); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .dash-row { grid-template-columns: 1fr; }
  main { padding: 1rem; }
  .level-selector { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: repeat(2, 1fr); }
  .header-subtitle { display: none; }
  .suggestions-row { grid-template-columns: repeat(2, 1fr); }
  .suggestions-row .suggestion-card:last-child { display: none; }
  .sec-card { width: 138px; }
  .sec-card-img { height: 195px; }
  .login-container { margin: 0.5rem; border-radius: 20px; padding: 2rem 1.25rem; }
  .cook-hero { height: 220px; }
}
@media (min-width: 601px) {
  .bottom-nav { max-width: 520px; left: 50%; right: auto; transform: translateX(-50%); border-radius: 24px 24px 0 0; }
}

/* ══════════════════════════════════════════════════════
   SECTION SCROLL — fade hint on right edge
══════════════════════════════════════════════════════ */
.section-scroll-wrap {
  position: relative;
  /* Mask fades out the last ~10% of the scroll container */
  -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
  mask-image:         linear-gradient(to right, black 88%, transparent 100%);
}

/* ══════════════════════════════════════════════════════
   SKELETON LOADING — while fetch is in-flight
══════════════════════════════════════════════════════ */
.skeleton-feed { }
.skeleton-section { margin-bottom: 2rem; }
.skeleton-section-hdr {
  display: flex; align-items: center; gap: 10px; margin-bottom: 0.8rem;
}
.skeleton-scroll { display: flex; gap: 0.7rem; overflow: hidden; }
.skeleton-card {
  flex-shrink: 0; width: 150px; height: 210px; border-radius: var(--radius);
  background: linear-gradient(90deg, #ddf0eb 25%, #c8e8e0 50%, #ddf0eb 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite linear;
}
.skeleton-title  { height: 16px; border-radius: 6px; background: linear-gradient(90deg, #ddf0eb 25%, #c8e8e0 50%, #ddf0eb 75%); background-size: 400px 100%; animation: shimmer 1.5s infinite linear; }
.skeleton-label  { height: 12px; width: 70px; border-radius: 6px; margin-bottom: 6px; background: linear-gradient(90deg, #ddf0eb 25%, #c8e8e0 50%, #ddf0eb 75%); background-size: 400px 100%; animation: shimmer 1.5s infinite linear; }

/* ══════════════════════════════════════════════════════
   IMPROVED TOAST — snackbar with icon
══════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: calc(78px + env(safe-area-inset-bottom) + 0.75rem);
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: #1E1B4B; color: white;
  padding: 12px 18px 12px 14px; border-radius: 14px;
  font-size: 0.88rem; font-weight: 500;
  z-index: 300; box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  white-space: nowrap; max-width: 92vw;
  animation: toastIn .22s ease;
}
@keyframes toastIn {
  from { opacity:0; transform: translateX(-50%) translateY(10px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
.toast.hidden { display: none; }
.toast-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800;
}
.toast-icon.success { background: var(--primary); }
.toast-icon.error   { background: #EF4444; }
.toast-icon.warn    { background: #F59E0B; }

/* ══════════════════════════════════════════════════════
   NAV BADGE DOT — unread indicator
══════════════════════════════════════════════════════ */
.nav-item { position: relative; }
.nav-badge {
  position: absolute; top: 3px; right: calc(50% - 17px);
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444; border: 2px solid white;
  display: none; z-index: 1;
}
.nav-badge.show { display: block; }

/* ══════════════════════════════════════════════════════
   BUTTON PRESS MICRO-INTERACTION
══════════════════════════════════════════════════════ */
.step-btn:active  { transform: scale(0.98); }
.btn-save:active  { transform: scale(0.98); }
.sec-card:active  { transform: scale(0.97); }
.recipe-card:active { transform: scale(0.98); }
.nav-add:active   { transform: scale(0.94); }

/* ══════════════════════════════════════════════════════
   IMAGE PROGRESSIVE LOAD — subtle fade-in
══════════════════════════════════════════════════════ */
.sec-card-img img, .recipe-img img {
  animation: fadeIn .35s ease;
}

/* ══════════════════════════════════════════════════════
   PROFILE PAGE — header accent
══════════════════════════════════════════════════════ */
.page-header::before {
  content: ''; display: block;
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient);
}
.page-header { position: relative; overflow: hidden; }

/* ══════════════════════════════════════════════════════
   COOK PAGE — step card accent border
══════════════════════════════════════════════════════ */
.step-card { border-left: 4px solid var(--primary); }
.step-label { color: var(--primary); }

/* ══════════════════════════════════════════════════════
   SECTION HEADER — divider line
══════════════════════════════════════════════════════ */
.section-row + .section-row { padding-top: 0; }

/* ══════════════════════════════════════════════════════
   FRIENDS PAGE (inside perfil)
══════════════════════════════════════════════════════ */
.friends-section { margin-top: 1.25rem; }
.friend-search-row {
  display: flex; gap: 0.5rem; margin-bottom: 1rem;
}
.friend-search-input {
  flex: 1; padding: 10px 16px;
  border: 1.5px solid var(--border); border-radius: var(--pill);
  font-size: 0.92rem; font-family: inherit; outline: none;
  transition: border-color .15s; background: #f9fafb;
}
.friend-search-input:focus { border-color: var(--primary); background: white; }
.btn-invite {
  background: var(--gradient); color: white; border: none;
  padding: 10px 20px; border-radius: var(--pill);
  font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: inherit;
  white-space: nowrap; transition: opacity .15s;
}
.btn-invite:hover { opacity: 0.9; }
.friend-card {
  background: white; border-radius: var(--radius); padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: 0.85rem;
  box-shadow: var(--shadow); margin-bottom: 0.6rem;
  transition: box-shadow .15s;
}
.friend-card:hover { box-shadow: var(--shadow-md); }
.friend-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; overflow: hidden;
}
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-weight: 700; font-size: 0.92rem; }
.friend-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.friend-action {
  background: none; border: 1.5px solid var(--border);
  padding: 5px 14px; border-radius: var(--pill);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s; color: var(--text-2); flex-shrink: 0;
}
.friend-action.accept  { background: var(--primary); border-color: var(--primary); color: white; }
.friend-action.decline { border-color: #EF4444; color: #EF4444; }
.friend-action.decline:hover { background: #FEF2F2; }
.friend-pending-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; color: var(--amber);
  text-transform: uppercase; margin-bottom: 0.5rem; display: block;
}
.friends-empty {
  text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: 0.9rem;
}
.friends-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* ══════════════════════════════════════════════════════
   FEED NAVIGATION BAR — sticky below main header
══════════════════════════════════════════════════════ */
.feed-nav {
  position: sticky;
  top: 100px; /* overridden by JS after measuring actual header height */
  z-index: 90;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid rgba(229,231,235,0.8);
  display: flex; align-items: stretch;
  padding: 0 1rem; gap: 0;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.feed-nav::-webkit-scrollbar { display: none; }

.feed-tab {
  flex-shrink: 0;
  padding: 0 14px; height: 44px;
  background: none; border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 0.86rem; font-weight: 600; color: var(--muted);
  cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center;
}
.feed-tab:hover { color: var(--text); }
.feed-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Split tab: label → landing page, ▾ → dropdown */
.feed-tab-split {
  padding: 0;
  display: flex; align-items: stretch;
}
.feed-tab-inner, .feed-tab-drop {
  background: none; border: none;
  font-size: 0.86rem; font-weight: 600; color: inherit;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center;
  transition: color .15s, background .12s;
}
.feed-tab-inner { padding: 0 6px 0 14px; white-space: nowrap; }
.feed-tab-drop  { padding: 0 10px 0 2px; font-size: 0.78rem; color: var(--muted); }
.feed-tab-split:hover .feed-tab-inner,
.feed-tab-split:hover .feed-tab-drop { color: var(--text); }
.feed-tab-split.active .feed-tab-inner { color: var(--primary); }
.feed-tab-split.active .feed-tab-drop  { color: var(--primary); }

.feed-nav-new {
  margin-left: auto; flex-shrink: 0;
  align-self: center;
  background: var(--gradient); color: white;
  padding: 6px 14px; border-radius: var(--pill);
  font-size: 0.82rem; font-weight: 700; text-decoration: none;
  white-space: nowrap; transition: opacity .15s; line-height: 1;
}
.feed-nav-new:hover { opacity: 0.9; color: white; }

/* Dropdown wrapper */
.feed-dropdown { position: relative; display: flex; align-items: stretch; }

.feed-dropdown-menu {
  display: none;
  position: fixed; /* portalled — never clipped by parent overflow */
  background: white; border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  min-width: 190px; z-index: 500; overflow: hidden;
  animation: fadeUp .18s ease;
}
.feed-dropdown-menu.open { display: block; }

.feed-dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; width: 100%;
  background: none; border: none; text-align: left;
  font-size: 0.88rem; font-family: inherit; cursor: pointer;
  transition: background .12s; color: var(--text);
}
.feed-dd-item:hover { background: var(--bg); }
.feed-dd-item.active { background: rgba(12,201,165,0.1); color: var(--primary); font-weight: 600; }

/* ══════════════════════════════════════════════════════
   SUB-PAGE VIEW (category / country / level page)
══════════════════════════════════════════════════════ */
.subpage-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.subpage-back {
  background: white; border: 1.5px solid var(--border);
  padding: 7px 14px; border-radius: var(--pill);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  color: var(--text-2); font-family: inherit;
  transition: all .15s; flex-shrink: 0; white-space: nowrap;
}
.subpage-back:hover { border-color: var(--primary); color: var(--primary); background: rgba(12,201,165,0.06); }
.subpage-meta { flex: 1; min-width: 120px; }
.subpage-title { font-size: 1.1rem; font-weight: 800; line-height: 1.2; }
.subpage-count { font-size: 0.75rem; color: var(--muted); margin-top: 2px; font-weight: 500; }
.subpage-search {
  flex: 1; min-width: 140px; max-width: 240px;
  padding: 8px 14px; border-radius: var(--pill);
  border: 1.5px solid var(--border); background: #f9fafb;
  font-size: 0.88rem; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s; color: var(--text);
}
.subpage-search:focus {
  border-color: var(--primary); background: white;
  box-shadow: 0 0 0 3px rgba(12,201,165,0.15);
}

/* ══════════════════════════════════════════════════════
   FLAG IMAGES — country pills and dropdown items
══════════════════════════════════════════════════════ */
.flag-img {
  width: 16px; height: 12px;
  object-fit: cover; border-radius: 2px;
  vertical-align: middle; flex-shrink: 0; display: inline-block;
}
.dd-flag {
  width: 20px; height: 15px;
  object-fit: cover; border-radius: 2px; flex-shrink: 0;
}
.country-pill { display: inline-flex; align-items: center; gap: 4px; }

/* ══════════════════════════════════════════════════════
   IMPROVED BACK BUTTON
══════════════════════════════════════════════════════ */
.back-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: white; color: var(--text-2);
  border: 1.5px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; text-decoration: none; flex-shrink: 0;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .18s;
  box-shadow: var(--shadow);
}
.back-btn:hover {
  background: var(--gradient); color: white; border-color: transparent;
  box-shadow: 0 4px 16px rgba(12,201,165,0.35);
  transform: translateX(-2px);
}

/* Hidden on mobile, shown via desktop media query */
.nav-user-info { display: none; }

/* ══════════════════════════════════════════════════════
   BOOKMARK BUTTON (recipe cards)
══════════════════════════════════════════════════════ */
.recipe-body { position: relative; }
.btn-bookmark-card {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: white; border: 1.5px solid var(--border);
  font-size: 0.85rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background .15s, border-color .15s, transform .12s;
  z-index: 2;
}
.btn-bookmark-card:hover { border-color: var(--primary); transform: scale(1.1); }
.btn-bookmark-card.is-saved { background: var(--primary); border-color: var(--primary); }

/* Cook count pill on recipe cards */
.cook-count-pill {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  background: rgba(0,0,0,0.05); border-radius: var(--pill);
  padding: 2px 6px; white-space: nowrap;
}

/* Bookmark button on cook page (page-header right slot) */
.btn-cook-bookmark {
  width: 36px; height: 36px; border-radius: 50%;
  background: white; border: 1.5px solid var(--border);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.btn-cook-bookmark:hover { border-color: var(--primary); }
.btn-cook-bookmark.is-saved { background: var(--primary); border-color: var(--primary); }

/* ══════════════════════════════════════════════════════
   DESKTOP — bottom nav becomes a top nav (≥768px)
══════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* Move to top */
  .bottom-nav {
    top: 0; bottom: auto;
    left: 0; right: 0;
    max-width: none; transform: none;
    border-radius: 0;
    border-top: none;
    border-bottom: 1px solid rgba(229,231,235,0.8);
    padding: 0 2rem;
    height: 60px;
    z-index: 200;
    justify-content: flex-end;
    gap: 4px;
  }

  /* Compact nav items */
  .nav-item { flex: 0 0 auto; min-width: 0; }
  .nav-add  { width: 38px; height: 38px; margin-top: 0; font-size: 1.3rem; }

  /* App header hidden on desktop — user info moves into the top nav */
  #app-header { display: none; }

  /* Secondary page headers */
  .page-header { top: 60px; }

  /* Feed-nav — JS sets exact measured value via getTopNavOffset() */
  .feed-nav { top: 60px; }

  /* Remove large bottom clearance (no bottom nav on desktop) */
  .app-page main { padding-bottom: 2rem; }
  .profile-body  { padding-bottom: 2rem; }
  .cook-body     { padding-bottom: 2rem; }
  .nueva-body    { padding-bottom: 2rem; }

  /* Toast doesn't need to clear a bottom nav */
  .toast { bottom: 1.5rem; }

  /* ── Desktop nav user info (left side of top bar) ── */
  .nav-user-info { display: flex; align-items: center; margin-right: auto; }
  .nav-user-link {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit;
    padding: 6px 10px 6px 0; border-radius: var(--radius-sm);
    transition: opacity .15s;
  }
  .nav-user-link:hover { opacity: 0.8; }
  .nav-avatar-wrap {
    width: 36px; height: 36px; border-radius: 50%;
    overflow: hidden; background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .nav-avatar-img { width: 100%; height: 100%; object-fit: cover; }
  .nav-avatar-emoji { font-size: 1.25rem; line-height: 1; }
  .nav-user-name { font-size: 0.88rem; font-weight: 700; color: var(--text); line-height: 1.2; }
  .nav-user-sub  { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
  .nav-lvl-chip  {
    font-size: 0.68rem; font-weight: 700; color: white;
    background: var(--gradient); border-radius: var(--pill);
    padding: 1px 6px; white-space: nowrap;
  }
  .nav-xp-track {
    width: 60px; height: 5px; border-radius: 99px;
    background: rgba(0,0,0,0.1); overflow: hidden;
  }
  .nav-xp-fill {
    height: 100%; border-radius: 99px;
    background: var(--gradient); transition: width .4s ease;
  }
  .nav-streak-chip { font-size: 0.72rem; font-weight: 600; color: #f59e0b; white-space: nowrap; }
}

/* ══════════════════════════════════════════════════════
   LANDING PAGES (Categorías / País / Nivel overview)
══════════════════════════════════════════════════════ */
.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 767px) {
  .landing-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}
@media (max-width: 420px) {
  .landing-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
}

.landing-card {
  background: white; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
  text-align: left; font-family: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column;
}
.landing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
  border-color: var(--primary);
}
.landing-card-locked { opacity: 0.72; }
.landing-card-locked:hover { border-color: var(--border); transform: none; }

.landing-card-thumb {
  height: 160px; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.landing-card-thumb-flag { background: #e5e7eb; }

/* Food/flag photo — covers the thumb, emoji stays behind as fallback */
.landing-card-photo {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  transition: transform .35s ease;
}
.landing-card:hover .landing-card-photo { transform: scale(1.05); }

.landing-card-emoji {
  font-size: 3.5rem; line-height: 1;
  position: relative; z-index: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}
.landing-flag-img {
  width: 80px; height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.landing-lvl-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.45); color: white;
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 8px; border-radius: var(--pill);
}
.landing-lock-icon {
  position: absolute; top: 10px; right: 10px;
  font-size: 1.1rem;
}

.landing-card-info {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.landing-card-name {
  font-size: 1rem; font-weight: 800; color: var(--text); line-height: 1.2;
}
.landing-card-count {
  font-size: 0.75rem; color: var(--muted); font-weight: 500;
}
.landing-card-sample {
  font-size: 0.74rem; color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.landing-card-cta {
  margin-top: auto; padding-top: 8px;
  font-size: 0.8rem; font-weight: 700;
  color: var(--primary);
}
