/* Accent colour defaults. Replaced at runtime with app_splash.bg_color (api/_brand_accent.php;
   applied by js/rp-config.js and js/brand-theme.js). Inserted by scripts/brand-accent.mjs: keep
   it in every file that uses var(--rp-accent) or var(--rp-o-*). */
:root {
    --rp-accent: #F97D09;
    --rp-accent-rgb: 249, 125, 9;
    --rp-o-b85b00: 184, 91, 0;
    --rp-o-c96a00: 201, 106, 0;
    --rp-o-e07702: 224, 119, 2;
    --rp-o-e08938: 224, 137, 56;
    --rp-o-f08228: 240, 130, 40;
    --rp-o-fa8803: 250, 136, 3;
    --rp-o-ff8c00: 255, 140, 0;
    --rp-o-ffb347: 255, 179, 71;
    --rp-o-ffecd4: 255, 236, 212;
    --rp-o-fff3e6: 255, 243, 230;
    --rp-o-fff4e6: 255, 244, 230;
    --rp-o-fff8ed: 255, 248, 237;
}
:root {
  --brand: rgb(var(--rp-o-fa8803));
  --brand-dark: rgb(var(--rp-o-e07702));
  --brand-light: rgb(var(--rp-o-fff4e6));
  --navy: #0D1B2A;
  --slate: #3D4A5C;
  --muted: #8E9BAD;
  --bg: #FFFFFF;
  --card-bg: #FFFFFF;
  --border: #EFF2F6;
  --shadow-sm: 0 2px 12px rgba(13, 27, 42, 0.07);
  --shadow-md: 0 8px 32px rgba(13, 27, 42, 0.12);
  --shadow-lg: 0 20px 60px rgba(13, 27, 42, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
}

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

html,
body {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeSpeed;
}

/* FOUC protection: keep hidden overlays/sheets locked off-screen with no animation until
   first paint settles. JS removes [data-fouc] once interactive so transitions resume. */
[data-fouc="locked"] {
  transform: translateY(120%) !important;
  visibility: hidden !important;
  transition: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

[data-fouc-bg="locked"] {
  opacity: 0 !important;
  transition: none !important;
  pointer-events: none !important;
}

/* ── App Shell ── */
#app {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── Main App Screen ── */
#main-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Nav — 3-column app bar matching main.html */
.top-nav {
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  background: linear-gradient(180deg, rgb(var(--rp-o-fa8803)) 0%, rgba(255, 255, 255, 0.95) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

.app-bar-left {
  justify-self: start;
  display: flex;
  align-items: center;
}

.app-bar-center {
  justify-self: center;
  white-space: nowrap;
}

.app-bar-right {
  justify-self: end;
  display: flex;
  align-items: center;
}

.top-nav .post-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 99px;
  letter-spacing: .3px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(var(--rp-o-fa8803), .32);
  transition: transform .15s, box-shadow .15s;
}

.top-nav .post-btn:active {
  transform: scale(.95);
  box-shadow: 0 2px 8px rgba(var(--rp-o-fa8803), .22);
}

.top-nav .post-btn i {
  font-size: 13px;
}

@media (max-width: 415px) {
  .top-nav {
    padding: 0 8px;
    gap: 6px;
  }
}

/* Search Bar */
.search-wrap {
  padding: 12px 20px 8px;
  background: #fff;
}

.search-inner {
  display: flex;
  align-items: center;
  background: #F3F6FA;
  border-radius: 14px;
  padding: 10px 16px;
  gap: 10px;
}

.search-inner input {
  border: none;
  background: transparent;
  flex: 1;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--navy);
  outline: none;
}

.search-inner input::placeholder {
  color: var(--muted);
}

.search-inner .si {
  color: var(--muted);
  font-size: 18px;
}

/* Category Pills */
.category-scroll {
  padding: 14px 20px 8px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #F3F6FA;
  border: 2px solid transparent;
  border-radius: 99px;
  padding: 9px 18px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}

.cat-pill.active {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.cat-pill .emoji {
  font-size: 16px;
}

/* Section header */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.section-hdr h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.section-hdr a {
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

/* Featured horizontal scroll */
.featured-scroll {
  display: flex;
  gap: 16px;
  padding: 4px 20px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.featured-scroll::-webkit-scrollbar {
  display: none;
}

.feat-card {
  flex-shrink: 0;
  width: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  position: relative;
  background: #111;
  transition: transform .2s;
}

.feat-card:active {
  transform: scale(.97);
}

.feat-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  opacity: .82;
  display: block;
}

.feat-card .feat-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(13, 27, 42, .92) 60%, transparent);
  padding: 18px 14px 14px;
}

.feat-card .feat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  padding: 4px 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.feat-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 6px;
}

.feat-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .75);
}

.feat-card .meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}

/* Recipe Grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 4px 20px 16px;
  margin-bottom: 65px;
}

/* Pagination sentinel — sits under the grid; IntersectionObserver
   loads the next page when this scrolls into view. */
.rec-grid-sentinel,
.rec-grid-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px 90px;
  color: var(--muted);
  font: 600 13px/1 'Inter', system-ui, sans-serif;
  letter-spacing: .2px;
}
.rec-grid-sentinel[hidden],
.rec-grid-end[hidden] { display: none; }
.rec-grid-end {
  padding-top: 8px;
  color: #B3BCC8;
  font-size: 12px;
}
.rec-loader-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid #E2E8F0;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: recLoaderSpin .8s linear infinite;
}
@keyframes recLoaderSpin { to { transform: rotate(360deg); } }

.rec-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--border);
}

.rec-card:active {
  transform: scale(.97);
  box-shadow: var(--shadow-md);
}

.rec-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #f0f0f0;
  overflow: hidden;
}

.rec-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.rec-card:hover .thumb img {
  transform: scale(1.05);
}

.rec-card .thumb .like-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, .92);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: all .2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

.rec-card .thumb .like-btn.liked {
  color: #FF4D6D;
}

.rec-card .thumb .time-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(13, 27, 42, .75);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 99px;
  padding: 3px 9px;
  backdrop-filter: blur(4px);
}

.rec-card .info {
  padding: 10px 10px 12px;
}

.rec-card .info h5 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-card .info .stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-card .info .cal {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.rec-card .info .saves {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

@media (max-width: 767px) {

  /* --- Bottom Nav Styling --- */
  .bottom-nav {
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
    height: 65px;
    /* Fixed height for better touch targets */
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9990;
  }

  /* 3D bottom navigation. */

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #a0a0a0;
    /* Neutral gray for inactive text */
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    position: relative;
    background: transparent;
    border: none;
  }

  /* Professional 3D bottom navigation. */

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888888;
    /* Professional neutral gray for inactive text */
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    position: relative;
    background: transparent;
    border: none;
    overflow: hidden;
    /* Keeps ripple effects clean */
  }

  /* 1. Inactive state: 3D premium gold. */
  .bottom-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* 🔥 MAKE BOLD: Adds a 0.5px stroke to physically thicken the icon */
    -webkit-text-stroke: 0.5px rgba(var(--rp-o-ff8c00), 0.5);

    /* Glossy Gold/Orange Gradient Fill */
    background: linear-gradient(135deg, #ffdf40 0%, #ff8c00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    /* 3D Depth Shadows (Bottom extrusion + Top highlight) */
    filter: drop-shadow(0px 3px 2px rgba(var(--rp-o-ff8c00), 0.35)) drop-shadow(0px -1px 1px rgba(255, 255, 255, 0.9));
  }

  /* 2. Tactile "press" animation. */
  .bottom-nav-item:active i {
    /* Pushes the icon down into the screen */
    transform: scale(0.9) translateY(2px);
    /* Shrinks the shadow to mimic physical pressing */
    filter: drop-shadow(0px 1px 1px rgba(var(--rp-o-ff8c00), 0.5));
  }

  /* 3. Active state: 3D premium emerald. */
  .bottom-nav-item.active {
    color: #00a85a;
    /* Green label text */
    font-weight: 700;
    /* Bolder text when active */
  }

  .bottom-nav-item.active i {
    /* Glossy Emerald Green Gradient Fill */
    background: linear-gradient(135deg, #28c76f 0%, #00753e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    /* 🔥 MAKE BOLD: Thickens the active icon with a dark green stroke */
    -webkit-text-stroke: 0.5px rgba(0, 117, 62, 0.6);

    /* Deeper Green 3D Drop Shadow */
    filter: drop-shadow(0px 5px 4px rgba(0, 117, 62, 0.4)) drop-shadow(0px -1px 1px rgba(255, 255, 255, 0.9));

    /* Triggers the 3D Pop Keyframe */
    animation: iconPop3D 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }

  /* 4. Active "pop" 3D keyframe animation. */
  @keyframes iconPop3D {
    0% {
      transform: translateY(0) scale(1);
    }

    50% {
      transform: translateY(-6px) scale(1.25);
    }

    100% {
      transform: translateY(-2px) scale(1.1);
    }

    /* Rests slightly lifted off screen */
  }
}

/* --- DESKTOP HEADER (Min Width 768px) --- */
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
}

/* ── Offcanvas / Recipe List Panel ── */
.offcanvas-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 680px;
  height: 100vh;
  background: #ffffff;
  z-index: 500;
  transition: right .35s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 32px rgba(13, 27, 42, .10);
}

.offcanvas-panel.open {
  right: 0;
}

/* Header */
.oc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 16px;
  background: #ffffff;
  border-bottom: 1px solid #EFF2F6;
}

.oc-back {
  background: #F3F6FA;
  border: none;
  cursor: pointer;
  color: var(--navy);
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
}

.oc-back:hover {
  background: #e8eef6;
}

.oc-back:active {
  transform: scale(.92);
}

.oc-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
  line-height: 1.2;
}

.oc-filter-btn {
  background: #F3F6FA;
  border: none;
  cursor: pointer;
  color: var(--slate);
  font-size: 17px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.oc-filter-btn:hover {
  background: #e8eef6;
}

/* Body */
.oc-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 80px;
  background: #ffffff;
  scrollbar-width: none;
}

.oc-body::-webkit-scrollbar {
  display: none;
}

/* Recipe cards */
.oc-recipe-card {
  display: flex;
  gap: 14px;
  padding: 13px 20px;
  cursor: pointer;
  transition: background .18s;
  border-bottom: 1px solid #EFF2F6;
}

.oc-recipe-card:hover {
  background: #F8FAFB;
}

.oc-recipe-card:active {
  background: #EFF2F6;
}

.oc-recipe-card .oc-thumb {
  width: 96px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #F3F6FA;
}

.oc-recipe-card .oc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.oc-recipe-card .oc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.oc-recipe-card h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.oc-recipe-card .oc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.oc-recipe-card .oc-cal {
  margin-top: auto;
  font-size: 11px;
  color: var(--brand);
  font-weight: 700;
}

.oc-recipe-card .oc-heart {
  align-self: center;
  color: #CBD5E1;
  font-size: 16px;
  margin-left: auto;
  flex-shrink: 0;
  transition: color .2s;
}

.oc-recipe-card:hover .oc-heart {
  color: #FDA4AF;
}

/* Sort / filter panel (toggled by .oc-filter-btn, applied in recipe-blog.js).
   The button shows a dot while anything other than the default
   "Most saved / All" is active, so a filtered list is never mistaken for
   the whole category. */
.oc-filter-btn {
  position: relative;
}

#ocFilterBtn.is-open {
  background: var(--app-btn-hover-bg, rgb(var(--rp-o-fff3e6))) !important;
  color: var(--brand) !important;
}

.oc-filter-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px #fff;
}

.oc-filter-dot[hidden] {
  display: none;
}

.oc-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 20px 12px;
  background: #F8FAFB;
  border-bottom: 1px solid #EFF2F6;
  animation: ocFilterIn .18s ease;
}

.oc-filter-panel[hidden] {
  display: none;
}

@keyframes ocFilterIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.oc-filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.oc-filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
}

.oc-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.oc-chip {
  min-height: 32px;
  padding: 6px 13px;
  border: 1px solid #E2E8F0;
  border-radius: 99px;
  background: #fff;
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.oc-chip:hover {
  border-color: #CBD5E1;
}

.oc-chip[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.oc-chip:focus-visible,
.oc-filter-reset:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.oc-filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.oc-filter-count {
  font-size: 12px;
  color: var(--muted);
}

.oc-filter-reset {
  border: 0;
  background: none;
  padding: 4px 2px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Loading, error and "no matches" messages inside the list. */
.oc-empty {
  padding: 32px 20px;
  text-align: center;
  color: #8E9BAD;
  font-size: 13.5px;
  line-height: 1.6;
}

.oc-empty .oc-filter-reset {
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .oc-filter-panel { animation: none; }
}

/* ── Overlay bg ── */
.overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.overlay-bg.show {
  opacity: 1;
  pointer-events: all;
}

/* Recipe detail — full-screen redesign. */

.detail-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  visibility: hidden;
  width: 100%;
  max-width: 680px;
  height: 100%;
  height: 100dvh;
  z-index: 700;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  transition: transform .42s cubic-bezier(.32, .72, 0, 1),
    visibility 0s linear .42s;
}

/* On mobile the bottom-nav (z-index 9990, height 65px) sits above the overlay; trim the
   overlay's height so the CTA bar lands flush on top of the nav instead of being covered. */
@media (max-width: 767px) {
  .detail-overlay {
    height: calc(100% - 65px);
    height: calc(100dvh - 65px);
  }
}

.detail-overlay.open {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
  transition: transform .42s cubic-bezier(.32, .72, 0, 1),
    visibility 0s linear 0s;
  will-change: transform;
}

/* ── Cinematic Hero ── */
.det-hero {
  position: relative;
  width: 100%;
  height: 32vh;
  min-height: 190px;
  flex-shrink: 0;
  overflow: hidden;
}

.det-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.06);
  transition: transform 1s cubic-bezier(.25, .46, .45, .94);
}

.detail-overlay.open .det-hero-img {
  transform: scale(1);
}

/* Scrim fades to white at the bottom so content blends seamlessly */
.det-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(10, 13, 17, .42) 0%,
      transparent 30%,
      transparent 52%,
      rgba(255, 255, 255, .72) 80%,
      rgba(255, 255, 255, 1) 100%);
}

/* Subtle noise grain */
.det-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  pointer-events: none;
}

/* Top bar floating over hero */
.det-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 0;
}

.det-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 13, 17, .52);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  transition: background .2s, transform .15s;
}

.det-icon-btn:active {
  transform: scale(.9);
}

.det-icon-btn.saved {
  color: #FF4D6D;
  background: rgba(255, 77, 109, .18);
  border-color: rgba(255, 77, 109, .3);
}

.det-topbar-actions {
  display: flex;
  gap: 10px;
}

/* Category chip on hero */
.det-cat-chip {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(var(--rp-o-fa8803), .18);
  border: 1px solid rgba(var(--rp-o-fa8803), .4);
  backdrop-filter: blur(12px);
  color: rgb(var(--rp-o-ffb347));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 5px 14px;
  white-space: nowrap;
}

/* Hero bottom content */
.det-hero-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0 22px 22px;
}

.det-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.det-stars {
  color: #FFB800;
  font-size: 11px;
  letter-spacing: 1px;
}

.det-rating-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}

.det-rating-count {
  font-size: 11px;
  color: var(--muted);
}

.det-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.22;
  margin-bottom: 10px;
}

.det-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.det-tag {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(13, 27, 42, .1);
  backdrop-filter: blur(8px);
  color: var(--slate);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 99px;
  padding: 4px 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.det-tag i {
  font-size: 11px;
  color: var(--brand);
}

/* ── Stats Strip ── */
.det-stats-strip {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.det-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 5px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
}

.det-stat:active {
  background: var(--brand-light);
}

.det-stat+.det-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--border);
}

.det-stat .stat-icon,
.det-stat .det-stat-icon {
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--brand);
}

.det-stat .stat-val,
.det-stat .det-stat-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.det-stat .stat-lbl,
.det-stat .det-stat-lbl {
  font-size: 8px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 1px;
}

/* ── Quick Action Row ── */
.det-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Subtle dim while live-translation requests are in flight. */
.det-scroll-body.is-translating .ing-text,
.det-scroll-body.is-translating .step-text {
  opacity: .55;
  transition: opacity .15s;
}

.det-action-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #F3F6FA;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}

.det-action-pill i {
  font-size: 14px;
}

.det-action-pill:active {
  background: #e8eef6;
}

.det-action-pill.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 4px 18px rgba(var(--rp-o-fa8803), .3);
}

.det-action-pill.primary:active {
  background: var(--brand-dark);
}

.det-action-pill {
  position: relative;
  cursor: pointer;
}

/* Save pill: persistent "saved" indicator, distinct from .primary (the transient
   last-clicked highlight) so both can coexist without visual conflict. */
#savePill.saved {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(var(--rp-o-fa8803), .32);
}
#savePill.saved:active {
  background: var(--brand-dark);
}
#savePill.saved .bi {
  color: #ffffff;
}
#savePill.is-pulsing .bi {
  animation: savePillPop .42s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes savePillPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Language dropdown — fixed to viewport so overflow:auto cannot clip it */
.lang-dropdown {
  position: fixed;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(13, 27, 42, .18), 0 2px 10px rgba(13, 27, 42, .08);
  border: 1px solid var(--border);
  min-width: 176px;
  z-index: 99999;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeUp .18s ease both;
}

.lang-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--caret-left, 50%);
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff;
  pointer-events: none;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: background .15s;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.lang-btn:hover {
  background: #F3F6FA;
}

.lang-btn:active {
  background: #e8eef6;
  transform: scale(.97);
}

.lang-btn.active {
  background: var(--brand-light, rgb(var(--rp-o-fff4e6)));
  color: var(--brand);
  font-weight: 700;
}

.lang-btn .lang-tick {
  color: var(--brand);
  font-size: 13px;
  opacity: 0;
  transition: opacity .15s;
}

.lang-btn.active .lang-tick {
  opacity: 1;
}

/* ── Scrollable body ── */
.det-scroll-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  background: #ffffff;
}

.det-scroll-body::-webkit-scrollbar {
  display: none;
}

/* ── Tab Bar ── */
.det-tabs {
  display: flex;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.det-tab {
  flex: 1;
  padding: 14px 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color .2s;
  letter-spacing: .3px;
}

.det-tab.active {
  color: var(--navy);
}

.det-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: var(--brand);
  border-radius: 99px;
}

/* ── Tab Panels ── */
.det-panel {
  display: none;
}

.det-panel.active {
  display: block;
}

/* Ingredients panel */
.ing-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.ing-list-header h4 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}

.ing-count-badge {
  background: var(--brand-light);
  border: 1px solid rgba(var(--rp-o-fa8803), .25);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  padding: 4px 10px;
}

.ing-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.ing-row:active {
  background: var(--brand-light);
}

.ing-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #F3F6FA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
  flex-shrink: 0;
}

.ing-text {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--slate);
  line-height: 1.4;
}

.ing-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-light);
  border: 1.5px solid rgba(var(--rp-o-fa8803), .3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}

.ing-add:active {
  background: rgba(var(--rp-o-fa8803), .25);
  transform: scale(.9);
}

/* Steps panel */
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.step-header h4 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}

.step-count-badge {
  background: #F3F6FA;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
}

.step-row {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  position: relative;
}

.step-row+.step-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 34px;
  width: 1px;
  height: 16px;
  background: var(--border);
}

.step-num-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--rp-o-fa8803), .28);
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  padding-top: 5px;
}

.step-text {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.65;
}

/* Nutrition panel */
.nutrition-panel {
  padding: 18px 20px 40px;
}

.nutrition-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
}

.nut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.nut-card {
  background: #F8FAFB;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.nut-card .nut-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.nut-card .nut-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.nut-card .nut-unit {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.nut-card .nut-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.nut-bar-row {
  margin-bottom: 12px;
}

.nut-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate);
  font-weight: 500;
  margin-bottom: 5px;
}

.nut-bar-track {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.nut-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), #ffd68a);
  transition: width 1s cubic-bezier(.4, 0, .2, 1);
}

/* Video Panel */
.video-panel {
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.video-panel-header {
  margin-bottom: 14px;
}

.video-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #FF0000, #CC0000);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  padding: 5px 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  margin-bottom: 8px;
  box-shadow: 0 4px 14px rgba(255, 0, 0, .28);
}

.video-panel-badge i {
  font-size: 13px;
}

.video-panel-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}

.video-embed-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  position: relative;
}

.video-embed-wrap iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.video-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.video-meta-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F3F6FA;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: background .2s;
}

.video-meta-chip:active {
  background: #e8eef6;
}

.video-meta-chip i {
  font-size: 13px;
  color: var(--brand);
}

/* Reviews bottom sheet (ambient backdrop + slide-up sheet) sits above the bottom-nav
   (z-index 9990) so it covers the viewport while open, restoring the nav on close. */
.rv-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 42, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9991;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
}
.rv-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .28s ease, visibility 0s linear 0s;
}

.rv-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  visibility: hidden;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  max-height: 90dvh;
  z-index: 9992;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -20px 60px rgba(2, 6, 23, .25);
  display: flex;
  flex-direction: column;
  transition: transform .38s cubic-bezier(.32, .72, 0, 1),
              visibility 0s linear .38s;
  overscroll-behavior: contain;
}
.rv-sheet.open {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
  transition: transform .38s cubic-bezier(.32, .72, 0, 1),
              visibility 0s linear 0s;
}

.rv-handle {
  width: 44px;
  height: 4px;
  background: #E2E8F0;
  border-radius: 99px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}

.rv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rv-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.rv-title {
  font: 800 17px/1.2 'Inter', system-ui, sans-serif;
  color: var(--navy);
  margin: 0;
}
.rv-sub {
  font: 600 11.5px/1 'Inter', system-ui, sans-serif;
  color: var(--muted);
  letter-spacing: .2px;
}
.rv-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #F3F6FA;
  color: var(--slate);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.rv-close:active { background: #E2E8F0; transform: scale(.94); }

.rv-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 32px;
  scrollbar-width: none;
}
.rv-body::-webkit-scrollbar { display: none; }

/* ── Summary card ── */
.rv-summary {
  display: grid;
  grid-template-columns: minmax(96px, 30%) 1fr;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fff9f0 0%, rgb(var(--rp-o-fff4e6)) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
}
.rv-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px dashed #CBD5E1;
}
.rv-score {
  font: 900 32px/1 'Inter', system-ui, sans-serif;
  color: var(--navy);
  letter-spacing: -1px;
}
.rv-score-stars {
  font-size: 13px;
  letter-spacing: 1px;
  color: #FBBF24;
}
.rv-score-stars .star-empty { color: #E2E8F0; }
.rv-score-count {
  font: 600 11px/1 'Inter', system-ui, sans-serif;
  color: var(--muted);
  margin-top: 2px;
}
.rv-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.rv-bar-row {
  display: grid;
  grid-template-columns: 14px 1fr 28px;
  align-items: center;
  gap: 8px;
  font: 600 11px/1 'Inter', system-ui, sans-serif;
  color: var(--slate);
}
.rv-bar-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
}
.rv-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FBBF24, #F59E0B);
  border-radius: 99px;
  width: 0%;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.rv-bar-count { text-align: right; color: var(--muted); }

/* ── Composer card ── */
.rv-compose-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(2, 6, 23, .04);
}
.rv-compose-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rv-compose-prompt-text {
  font: 700 13.5px/1.3 'Inter', system-ui, sans-serif;
  color: var(--navy);
}
.rv-compose-prompt-text small {
  display: block;
  font: 500 11.5px/1 'Inter', system-ui, sans-serif;
  color: var(--muted);
  margin-top: 4px;
}
.rv-cta-write {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 10px 18px;
  font: 700 12.5px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(var(--rp-o-fa8803), .28);
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.rv-cta-write:active { background: var(--brand-dark); transform: scale(.97); }

.rv-compose-form { display: flex; flex-direction: column; gap: 12px; }
.rv-compose-label {
  font: 700 11.5px/1 'Inter', system-ui, sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.rv-star-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 32px;
  line-height: 1;
  user-select: none;
}
.rv-star-picker .rv-star {
  cursor: pointer;
  color: #E2E8F0;
  transition: color .15s, transform .12s;
}
.rv-star-picker .rv-star.active { color: #FBBF24; }
.rv-star-picker .rv-star:active { transform: scale(1.15); }
.rv-star-hint {
  font: 600 12.5px/1 'Inter', system-ui, sans-serif;
  color: var(--navy);
  margin-left: 6px;
}
.rv-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font: 500 13.5px/1.45 'Inter', system-ui, sans-serif;
  color: var(--navy);
  resize: vertical;
  background: #FAFBFC;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
.rv-textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #ffffff;
}
.rv-compose-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.rv-btn {
  padding: 10px 18px;
  border-radius: 99px;
  font: 700 12.5px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  border: none;
  transition: background .2s, transform .1s, opacity .15s;
}
.rv-btn-secondary {
  background: #F3F6FA;
  color: var(--slate);
}
.rv-btn-secondary:active { background: #E2E8F0; transform: scale(.97); }
.rv-btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 20px rgba(var(--rp-o-fa8803), .28);
}
.rv-btn-primary:active { background: var(--brand-dark); transform: scale(.97); }
.rv-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}
.rv-btn .rv-btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rvSpin .7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes rvSpin { to { transform: rotate(360deg); } }

/* ── Review list ── */
.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv-loading,
.rv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 16px;
  color: var(--muted);
  font: 600 13px/1.4 'Inter', system-ui, sans-serif;
  text-align: center;
}
.rv-empty i { font-size: 32px; color: #CBD5E1; }
.rv-empty p { margin: 0; }
.rv-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #E2E8F0;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rvSpin .8s linear infinite;
}

.rv-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  transition: border-color .15s;
}
.rv-item.is-mine {
  border-color: rgba(var(--rp-o-fa8803), .35);
  background: linear-gradient(180deg, #fff9f0 0%, #ffffff 100%);
}
.rv-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--rp-o-fa8803)), rgb(var(--rp-o-e07702)));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 14px/1 'Inter', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.rv-item-body { flex: 1; min-width: 0; }
.rv-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.rv-item-name {
  font: 700 13.5px/1 'Inter', system-ui, sans-serif;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rv-mine-chip {
  font: 700 9.5px/1 'Inter', system-ui, sans-serif;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 3px 7px;
  border-radius: 99px;
}
.rv-item-date {
  font: 600 11px/1 'Inter', system-ui, sans-serif;
  color: var(--muted);
  white-space: nowrap;
}
.rv-item-stars {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: #FBBF24;
  margin-bottom: 6px;
}
.rv-item-stars .star-empty { color: #E2E8F0; }
.rv-item-comment {
  font: 500 13.5px/1.5 'Inter', system-ui, sans-serif;
  color: var(--slate);
  margin: 0;
  word-wrap: break-word;
}
.rv-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.rv-action-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  font: 700 11px/1 'Inter', system-ui, sans-serif;
  color: var(--slate);
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rv-action-btn:active { background: #F3F6FA; }
.rv-action-btn.danger { color: #E11D48; }
.rv-action-btn.danger:active { background: #FEE2E2; }

/* FOUC suppression */
.rv-backdrop[data-fouc="locked"],
.rv-sheet[data-fouc="locked"] {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Opening entrance animation: staggered reveal of top nav/search/category chrome on load,
   plus cascading fade-up for recipe cards as each is inserted. */
@keyframes rbEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.top-nav        { animation: rbEnter .45s cubic-bezier(.22,.61,.36,1) both; }
.search-wrap     { animation: rbEnter .45s cubic-bezier(.22,.61,.36,1) .07s both; }
.category-scroll { animation: rbEnter .45s cubic-bezier(.22,.61,.36,1) .14s both; }
#recipeGrid > *  { animation: rbEnter .4s cubic-bezier(.22,.61,.36,1) both; }
#recipeGrid > *:nth-child(1) { animation-delay: .18s; }
#recipeGrid > *:nth-child(2) { animation-delay: .21s; }
#recipeGrid > *:nth-child(3) { animation-delay: .24s; }
#recipeGrid > *:nth-child(4) { animation-delay: .27s; }
#recipeGrid > *:nth-child(5) { animation-delay: .30s; }
#recipeGrid > *:nth-child(6) { animation-delay: .33s; }

@media (prefers-reduced-motion: reduce) {
  .top-nav, .search-wrap, .category-scroll, #recipeGrid > * { animation: none; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Post recipe dialog. */
.post-overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, .72);
  backdrop-filter: blur(6px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.post-overlay-bg.show {
  opacity: 1;
  pointer-events: all;
}

.post-dialog {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  visibility: hidden;
  width: 100%;
  max-width: 680px;
  height: 100%;
  height: 100dvh;
  z-index: 950;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #FFFFFF;
  /* visibility delay matches slide duration so it hides only after close animation ends */
  transition: transform .44s cubic-bezier(.32, .72, 0, 1),
    visibility 0s linear .44s;
}

.post-dialog.open {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
  /* on open: show immediately, promote layer only while animating */
  transition: transform .44s cubic-bezier(.32, .72, 0, 1),
    visibility 0s linear 0s;
  will-change: transform;
}

.pd-header {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(var(--rp-accent-rgb), 0.281) 0%, rgba(255, 255, 255, 1) 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pd-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F3F6FA;
  border: 1px solid var(--border);
  color: var(--slate);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
}

.pd-close-btn:hover {
  background: #E8EDF4;
}

.pd-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pd-header-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(var(--rp-o-fa8803), .15);
  border: 1px solid rgba(var(--rp-o-fa8803), .3);
  color: rgb(var(--rp-o-fa8803));
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
  border-radius: 99px;
  padding: 3px 10px;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.pd-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 900;
  color: var(--navy);
  margin: 0;
}

.pd-submit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgb(var(--rp-o-fa8803)), rgb(var(--rp-o-e07702)));
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: 99px;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(var(--rp-o-fa8803), .35);
  transition: transform .15s, box-shadow .15s;
}

.pd-submit-btn:active {
  transform: scale(.95);
}

.pd-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.pd-body::-webkit-scrollbar {
  display: none;
}

/* Upload zone */
.pd-upload-zone {
  position: relative;
  width: 100%;
  height: 200px;
  background: #F3F6FA;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: background .2s;
}

.pd-upload-zone:active {
  background: #E8EDF4;
}

.pd-upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  position: relative;
  transition: opacity .2s;
}

.pd-upload-icon-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(var(--rp-o-fa8803), .12);
  border: 2px dashed rgba(var(--rp-o-fa8803), .4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgb(var(--rp-o-fa8803));
  animation: pulseRing 2.4s ease infinite;
}

@keyframes pulseRing {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--rp-o-fa8803), .3);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(var(--rp-o-fa8803), 0);
  }
}

.pd-upload-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.pd-upload-sub {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.pd-image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 1;
}

.pd-image-preview.visible {
  display: block;
}

.pd-upload-change {
  position: absolute;
  bottom: 12px;
  right: 14px;
  z-index: 4;
  background: rgba(10, 13, 20, .8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 5px 12px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .15);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pd-upload-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(10, 13, 20, .68);
  border: 1.5px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  transition: background .18s, transform .15s;
}

.pd-upload-clear:hover {
  background: rgba(239, 68, 68, .82);
  border-color: rgba(239, 68, 68, .5);
}

.pd-upload-clear:active {
  transform: scale(.88);
}

/* Form body */
.pd-form {
  padding: 20px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pd-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 9px;
}

.pd-required {
  color: #FF4D6D;
}

.pd-field-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pd-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.pd-section-label .pd-label {
  margin-bottom: 0;
}

.pd-add-row-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--rp-o-fa8803), .12);
  border: 1px solid rgba(var(--rp-o-fa8803), .25);
  color: rgb(var(--rp-o-fa8803));
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .2s;
}

.pd-add-row-btn:active {
  background: rgba(var(--rp-o-fa8803), .22);
}

.pd-add-row-btn i {
  font-size: 13px;
}

.pd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  isolation: isolate;
}

.pd-field-icon {
  position: absolute;
  inset-inline-start: 9px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--rp-o-fa8803), .16);
  border-radius: 10px;
  background: linear-gradient(145deg, rgb(var(--rp-o-fff8ed)), rgb(var(--rp-o-ffecd4)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 5px rgba(150, 80, 0, .06);
  font-size: 16px;
  line-height: 1;
  color: rgb(var(--rp-o-b85b00));
  pointer-events: none;
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}

.pd-field-icon::before {
  display: block;
  line-height: 1;
}

.pd-field-icon.bi-youtube {
  color: #d62828;
  background: linear-gradient(145deg, #fff5f5, #ffe4e4);
  border-color: rgba(214, 40, 40, .16);
}

.pd-input-wrap:focus-within .pd-field-icon {
  border-color: rgba(var(--rp-o-fa8803), .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 3px rgba(var(--rp-o-fa8803), .08);
}

.pd-input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #FFFFFF, #F6F8FB);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px 13px 52px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--navy);
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}

.pd-input::placeholder {
  color: var(--muted);
}

.pd-input:focus {
  border-color: rgba(var(--rp-o-fa8803), .5);
  background: rgba(var(--rp-o-fa8803), .04);
  box-shadow: 0 0 0 3px rgba(var(--rp-o-fa8803), .1);
}

.pd-select {
  cursor: pointer;
}

.pd-select option {
  background: #FFFFFF;
  color: var(--navy);
}

.pd-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Category chips */
.pd-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pd-cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  appearance: none;
  background: linear-gradient(160deg, #FFFFFF, #F3F6FA);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 6px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--slate);
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}

.pd-cat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(var(--rp-o-fa8803), .14);
  border-radius: 12px;
  background: linear-gradient(145deg, #fffaf2, rgb(var(--rp-o-ffecd4)));
  box-shadow: inset 0 1px 0 #fff, 0 3px 8px rgba(150, 80, 0, .06);
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.pd-cat-label {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.pd-cat-chip:focus-visible {
  outline: 3px solid rgba(var(--rp-o-fa8803), .5);
  outline-offset: 2px;
}

@media (hover: hover) {
  .pd-cat-chip:hover {
    border-color: rgba(var(--rp-o-fa8803), .45);
    box-shadow: 0 4px 12px rgba(150, 80, 0, .08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-cat-chip {
    transition: none;
  }
}

.pd-cat-chip.active {
  background: rgba(var(--rp-o-fa8803), .1);
  border-color: rgba(var(--rp-o-fa8803), .5);
  color: var(--brand-dark);
}

/* Ingredients */
.pd-ing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pd-ing-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(var(--rp-o-fa8803), .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: rgb(var(--rp-o-fa8803));
  flex-shrink: 0;
}

.pd-ing-input {
  flex: 1;
  background: #F3F6FA;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  color: var(--navy);
  outline: none;
  transition: border-color .2s;
}

.pd-ing-input::placeholder {
  color: var(--muted);
}

.pd-ing-input:focus {
  border-color: rgba(var(--rp-o-fa8803), .45);
}

/* Ingredient suggest trigger button */
.pd-ing-suggest-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-light);
  border: 1.5px solid rgba(var(--rp-o-fa8803), .3);
  color: var(--brand-dark);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}

.pd-ing-suggest-btn:hover {
  background: rgba(var(--rp-o-fa8803), .2);
  border-color: rgba(var(--rp-o-fa8803), .5);
}

.pd-ing-suggest-btn:active {
  transform: scale(.9);
}

.pd-ing-suggest-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.pd-ing-suggest-btn.has-selection {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(var(--rp-o-fa8803), .35);
}

.pd-ing-suggest-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: #FF4D6D;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid #fff;
}

.pd-ing-suggest-btn.has-selection .pd-ing-suggest-count {
  display: flex;
}

/* Product suggest bottom sheet.
   Both layers sit ABOVE the mobile bottom-nav (z-index 9990), matching the
   reviews sheet (.rv-backdrop 9991 / .rv-sheet 9992) further down this file.
   At 1000/1050 they sat below it, and because the nav and the sheet's footer are
   both pinned to the bottom of the viewport they overlapped at EVERY height:
   elementFromPoint() over "Apply Selection" returned the nav, so the sheet's
   only confirming action could not be tapped on a phone — and since the recipe
   form refuses to submit until every ingredient has 3 linked products, that was
   a dead end for the whole form. The raised backdrop also stops the nav being
   tapped straight through the scrim and navigating away mid-selection. */
.sug-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, .55);
  backdrop-filter: blur(4px);
  z-index: 9991;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}

.sug-backdrop.show {
  opacity: 1;
  pointer-events: all;
}

.sug-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 680px;
  height: 58vh;
  max-height: 640px;
  min-height: 320px;
  z-index: 9992;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(13, 27, 42, .18);
  display: flex;
  flex-direction: column;
  visibility: hidden;
  overflow: hidden;
  transition: transform .38s cubic-bezier(.32, .72, 0, 1),
    visibility 0s linear .38s;
}

.sug-sheet.open {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
  transition: transform .38s cubic-bezier(.32, .72, 0, 1),
    visibility 0s linear 0s;
  will-change: transform;
}

.sug-handle-bar {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.sug-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: #DDE3EC;
}

.sug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 18px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.sug-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sug-header-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--brand);
  text-transform: uppercase;
}

.sug-sheet-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 900;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}

.sug-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F3F6FA;
  border: 1px solid var(--border);
  color: var(--slate);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}

.sug-close-btn:hover {
  background: #E8EDF4;
}

.sug-close-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sug-search-wrap {
  position: relative;
  margin: 12px 16px 8px;
  flex-shrink: 0;
}

.sug-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.sug-search-input {
  width: 100%;
  background: #F3F6FA;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px 11px 38px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--navy);
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}

.sug-search-input:focus {
  border-color: rgba(var(--rp-o-fa8803), .5);
  background: #fff;
}

.sug-search-input::placeholder {
  color: var(--muted);
}

.sug-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 16px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(33% - 7px), 1fr));
  grid-auto-rows: max-content;
  gap: 10px;
  align-content: start;
  scroll-snap-type: y proximity;
  scroll-padding-top: 10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sug-grid::-webkit-scrollbar {
  width: 4px;
}

.sug-grid::-webkit-scrollbar-track {
  background: transparent;
}

.sug-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

.sug-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: block;
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}

.sug-card:hover {
  border-color: rgba(var(--rp-o-fa8803), .3);
  box-shadow: 0 4px 16px rgba(var(--rp-o-fa8803), .1);
}

.sug-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sug-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(var(--rp-o-fa8803), .18), 0 4px 16px rgba(var(--rp-o-fa8803), .15);
}

.sug-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  z-index: 2;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}

.sug-card.selected .sug-card-badge {
  opacity: 1;
  transform: scale(1);
}

.sug-card-img-wrap {
  width: 100%;
  height: 110px;
  background: #F4F7FB;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.sug-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.sug-card-body {
  padding: 8px 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sug-card-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  /* Width-aware truncation, and the only truncation: _cardHtml() renders the
     full title (the `title` attribute carries it too). Without this the name was
     hard-clipped mid-letter — visible on a 108px card at 360px width. */
  text-overflow: ellipsis;
}

.sug-card-rating {
  font-size: 10px;
  font-weight: 700;
  color: #F59E0B;
  display: flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
}

.sug-card-rating-val {
  color: var(--slate);
  font-weight: 500;
  font-size: 9.5px;
}

.sug-card-cat {
  font-size: 9px;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--brand-light);
  border-radius: 99px;
  padding: 2px 7px;
  display: inline-block;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sug-card-add-btn {
  width: 100%;
  margin-top: 3px;
  background: var(--brand-light);
  border: 1.5px solid rgba(var(--rp-o-fa8803), .35);
  color: var(--brand-dark);
  border-radius: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  padding: 5px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, color .2s, box-shadow .15s;
  line-height: 1;
}

.sug-card-add-btn:hover {
  background: rgba(var(--rp-o-fa8803), .18);
  border-color: rgba(var(--rp-o-fa8803), .6);
}

.sug-card.selected .sug-card-add-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(var(--rp-o-fa8803), .28);
}

.sug-add-icon {
  display: block;
}

.sug-chk-icon {
  display: none;
}

.sug-card.selected .sug-add-icon {
  display: none;
}

.sug-card.selected .sug-chk-icon {
  display: block;
}

.sug-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
}

.sug-empty-icon {
  font-size: 30px;
  color: var(--muted);
  margin-bottom: 8px;
}

.sug-empty-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.sug-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}

.sug-apply-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 24px rgba(var(--rp-o-fa8803), .28);
  transition: transform .15s, box-shadow .15s;
}

.sug-apply-btn:active {
  transform: scale(.98);
  box-shadow: 0 3px 12px rgba(var(--rp-o-fa8803), .2);
}

.sug-apply-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Skeleton loading cards */
@keyframes sugPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .45
  }
}

.sug-skeleton {
  pointer-events: none;
  animation: sugPulse 1.4s ease-in-out infinite;
}

.sug-skel-img {
  width: 100%;
  height: 110px;
  background: #EFF2F6;
}

.sug-skel-line {
  background: #EFF2F6;
  border-radius: 5px;
  margin-bottom: 5px;
}

.sug-skel-nm {
  height: 10px;
  width: 90%;
}

.sug-skel-nm2 {
  height: 10px;
  width: 65%;
}

.sug-skel-ct {
  height: 8px;
  width: 55%;
}

.sug-skel-btn {
  height: 26px;
  width: 100%;
  border-radius: 8px;
  margin-top: 2px;
}

/* Infinite-scroll sentinel (invisible, triggers IntersectionObserver) */
.sug-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

/* Load-more animated dots */
.sug-load-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 0 6px;
}

.sug-load-more-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sug-load-more-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: sugDotPulse 1.2s ease-in-out infinite;
}

.sug-load-more-dots span:nth-child(2) {
  animation-delay: .2s;
}

.sug-load-more-dots span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes sugDotPulse {

  0%,
  80%,
  100% {
    transform: scale(.65);
    opacity: .45;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Difficulty custom select. */
.pd-diff-select {
  position: relative;
  width: 100%;
}

/* Trigger button — visually matches .pd-input */
.pd-diff-trigger {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #FFFFFF, #F6F8FB);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px 13px 52px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  outline: none;
  text-align: left;
  transition: border-color .22s, background .22s, box-shadow .22s, border-radius .22s;
  -webkit-appearance: none;
  appearance: none;
}

.pd-diff-trigger:focus {
  border-color: rgba(var(--rp-o-fa8803), .5);
  background: rgba(var(--rp-o-fa8803), .04);
  box-shadow: 0 0 0 3px rgba(var(--rp-o-fa8803), .1);
}

.pd-diff-select.open .pd-diff-trigger {
  border-color: rgba(var(--rp-o-fa8803), .5);
  background: rgba(var(--rp-o-fa8803), .04);
  box-shadow: 0 0 0 3px rgba(var(--rp-o-fa8803), .1);
  border-radius: 12px 12px 0 0;
  border-bottom-color: transparent;
}

/* Placeholder text */
.pd-diff-ph {
  color: var(--muted);
}

/* Chevron */
.pd-diff-caret {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), color .22s;
}

.pd-diff-caret::before {
  display: block;
  line-height: 1;
}

@media (max-width: 380px) {
  .pd-two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-field-icon,
  .pd-diff-caret {
    transition: none;
  }
}

.pd-diff-select.open .pd-diff-caret {
  transform: rotate(180deg);
  color: var(--brand);
}

/* Dropdown panel (in-flow; expands below trigger) */
.pd-diff-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  border: 1.5px solid rgba(var(--rp-o-fa8803), .28);
  border-top: none;
  border-radius: 0 0 14px 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(13, 27, 42, .12), 0 2px 8px rgba(var(--rp-o-fa8803), .07);
  transition: max-height .28s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}

.pd-diff-select.open .pd-diff-panel {
  max-height: 260px;
  opacity: 1;
  pointer-events: all;
}

/* Options */
.pd-diff-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

.pd-diff-opt:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.pd-diff-opt:hover {
  background: #F8FAFB;
}

.pd-diff-opt:active {
  background: var(--brand-light);
}

.pd-diff-opt.selected {
  background: var(--brand-light);
}

.pd-diff-opt:focus {
  outline: none;
  background: #F3F6FA;
}

/* Color dot */
.pd-diff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Option text block */
.pd-diff-opt-body {
  flex: 1;
  min-width: 0;
}

.pd-diff-opt-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.pd-diff-opt-hint {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

/* Checkmark */
.pd-diff-tick {
  font-size: 15px;
  color: var(--brand);
  flex-shrink: 0;
  opacity: 0;
  transform: scale(.45);
  transition: opacity .18s, transform .18s cubic-bezier(.34, 1.56, .64, 1);
}

.pd-diff-opt.selected .pd-diff-tick {
  opacity: 1;
  transform: scale(1);
}


.pd-ing-del {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 77, 109, .1);
  border: 1px solid rgba(255, 77, 109, .2);
  color: #FF4D6D;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}

.pd-ing-del:hover {
  background: rgba(255, 77, 109, .2);
}

/* Steps */
.pd-step-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.pd-step-row .pd-ing-del {
  align-self: center;
}

.pd-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--rp-o-fa8803)), rgb(var(--rp-o-e07702)));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 3px 10px rgba(var(--rp-o-fa8803), .3);
}

.pd-step-input {
  flex: 1;
  background: #F3F6FA;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  color: var(--navy);
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color .2s;
}

.pd-step-input::placeholder {
  color: var(--muted);
}

.pd-step-input:focus {
  border-color: rgba(var(--rp-o-fa8803), .45);
}

/* Notes textarea */
.pd-textarea-wrap {
  position: relative;
}

.pd-textarea {
  width: 100%;
  background: #F3F6FA;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--navy);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color .2s;
}

.pd-textarea::placeholder {
  color: var(--muted);
}

.pd-textarea:focus {
  border-color: rgba(var(--rp-o-fa8803), .45);
}

/* Publish bar */
.pd-publish-bar {
  display: flex;
  align-items: center;
  margin-top: 8px;
  min-height: 50px;
  margin-bottom: 50px;
}

.pd-submit-btn {
  flex: 1;
  background: linear-gradient(135deg, rgb(var(--rp-o-fa8803)), rgb(var(--rp-o-e07702)));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(var(--rp-o-fa8803), .35);
  transition: transform .15s, box-shadow .15s;
}

.pd-submit-btn:active {
  transform: scale(.98);
  box-shadow: 0 4px 16px rgba(var(--rp-o-fa8803), .25);
}


/* ── Success Toast ── */
.success-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  z-index: 9999;
  transform: translateX(-50%) translateY(20px);
  background: #0D2B22;
  border: 1px solid rgba(var(--rp-o-fa8803), .4);
  border-radius: 99px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: rgb(var(--rp-o-fa8803));
  opacity: 0;
  pointer-events: none;
  transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3), 0 0 0 1px rgba(var(--rp-o-fa8803), .2);
  white-space: nowrap;
}

.success-toast.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* ── Validation Error Toast ── */
.error-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  z-index: 10000;
  transform: translateX(-50%) translateY(20px);
  background: #1E0A0A;
  border: 1px solid rgba(239, 68, 68, .45);
  border-radius: 99px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #EF4444;
  opacity: 0;
  pointer-events: none;
  transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35), 0 0 0 1px rgba(239, 68, 68, .18);
  white-space: nowrap;
  max-width: 92vw;
}
.error-toast.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* ── Field invalid state ── */
.pd-input.pd-invalid,
.pd-ing-input.pd-invalid,
.pd-step-input.pd-invalid {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .18) !important;
}
.pd-cat-grid.pd-invalid {
  outline: 2px solid rgba(239, 68, 68, .7);
  outline-offset: 4px;
  border-radius: 12px;
}
#pdIngredientsList.pd-invalid,
#pdStepsList.pd-invalid {
  border-radius: 12px;
  outline: 2px solid rgba(239, 68, 68, .5);
  outline-offset: 4px;
}

@keyframes pdShake {
  0%, 100% { transform: translateX(0); }
  18%       { transform: translateX(-7px); }
  36%       { transform: translateX(7px); }
  54%       { transform: translateX(-4px); }
  72%       { transform: translateX(4px); }
}
.pd-shake { animation: pdShake .42s ease; }

/* ── Numeric-only rejection flash ── */
@keyframes pdNumReject {
  0%   { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,.22); }
  100% { border-color: var(--border); box-shadow: none; }
}
.pd-numeric-reject {
  animation: pdNumReject .35s ease forwards;
}

/* ── Suggest button: insufficient suggestions state ── */
.pd-ing-suggest-btn.sug-warn {
  background: rgba(245, 158, 11, .15);
  border-color: rgba(245, 158, 11, .55);
  color: #D97706;
}
.pd-ing-suggest-btn.sug-warn .pd-ing-suggest-count {
  display: flex;
  background: #F59E0B;
}
.pd-ing-suggest-btn.sug-ok {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(var(--rp-o-fa8803), .35);
}
.pd-ing-suggest-btn.sug-ok .pd-ing-suggest-count {
  display: flex;
  background: rgb(var(--rp-o-fa8803));
}

/* ── Per-ingredient suggestion inline hint ── */
.pd-ing-sug-hint {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px 3px;
  border-radius: 6px;
  margin-top: 3px;
  display: block;
  pointer-events: none;
}
.pd-ing-sug-hint.warn  { color: #D97706; background: rgba(245,158,11,.1); }
.pd-ing-sug-hint.ok    { color: rgb(var(--rp-o-c96a00)); background: rgba(var(--rp-o-fa8803), .1); }
.pd-ing-sug-hint.error { color: #EF4444; background: rgba(239,68,68,.08); }

/* ── FAB cart button (recipe-blog — fixed positioning, main_style.css not loaded) ── */
.fab-cart-btn {
  position: fixed;
  bottom: 70px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--rp-o-e08938)) 0%, var(--rp-accent) 100%);
  color: #fff;
  border: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px rgba(var(--rp-o-f08228), .45);
  z-index: 9500;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.175,.885,.32,1.275), box-shadow .2s;
  animation: rbFabIn .3s cubic-bezier(.175,.885,.32,1.275) both;
}
.fab-cart-btn:active { transform: scale(.9); box-shadow: 0 4px 10px rgba(var(--rp-o-f08228), .5); }
@keyframes rbFabIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Badge */
.fab-cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ff3b30;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 50px;
  border: 2px solid #fff;
  line-height: 1;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
}

/* Cart total under the basket icon. The .fab-cart-total span is added by
   rbSyncFab() in recipe-blog.js. */
.fab-cart-btn {
  flex-direction: column;
  gap: 2px;
}
.fab-cart-btn .colorful-basket {
  font-size: 1.25rem;
  line-height: 1;
}
.fab-cart-total {
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: .56rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
  pointer-events: none;
}

/* Animated gradient icon */
.colorful-basket {
  background: linear-gradient(135deg, #fff 0%, #ebedee 55%, #c3cfe2 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: basketPulse 2s infinite ease-in-out;
}
@keyframes basketPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.14); }
}

/* Ingredient product suggestion panel. */

/* Active state for the + button */
.ing-add.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(var(--rp-o-fa8803), .35);
}

/* Collapsible wrapper */
.ing-prod-collapse {
  overflow: hidden;
  max-height: 0;
  transition: max-height .32s cubic-bezier(.4,0,.2,1);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.ing-prod-collapse.open { max-height: 320px; }

/* Horizontal scroll strip */
.ing-prod-scroll {
  display: flex;
  gap: 8px;
  padding: 10px 12px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  align-items: stretch;
}
.ing-prod-scroll::-webkit-scrollbar { display: none; }

/* Exactly 3 cards per visible row at every screen size */
.ip-col {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  scroll-snap-align: start;
}

/* ── Product card (mirrors .product-card-design from main_style.css) ── */
.ip-card {
  position: relative;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 5px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.ip-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.07); border-color: #e2e8f0; }

/* Wishlist stub */
.ip-wl-btn {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  border: 1px solid #f1f5f9;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  padding: 0;
  opacity: .5; cursor: default;
}

/* Discount / status badge */
.ip-badge {
  position: absolute; top: 0; left: 0;
  font-size: .58rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 6px; color: #fff;
  z-index: 10; border-radius: 11px 0 8px 0;
  box-shadow: 2px 2px 8px rgba(0,0,0,.1);
  overflow: hidden;
}
.ip-badge::after {
  content: ''; position: absolute;
  top: -20%; left: -60%;
  width: 35%; height: 160%;
  background: linear-gradient(90deg,transparent 0%,rgba(255,255,255,.5) 50%,transparent 100%);
  transform: skewX(-18deg);
  animation: ipBadgeShine 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ipBadgeShine {
  0%   { left:-60%;opacity:0; }
  8%   { opacity:1; }
  38%  { left:130%;opacity:.7; }
  39%,100% { left:130%;opacity:0; }
}
.ip-badge-red  { background: #ef4444; }
.ip-badge-sec  { background: #94a3b8; }
.ip-badge-success { background: #22c55e; }
.ip-badge-info { background: #3b82f6; }
.ip-badge-warning { background: #f59e0b; }
.ip-badge-primary { background: #00A859; }

/* Options overlay pill */
.ip-var-badge {
  position: absolute; bottom: 4px; right: 4px;
  z-index: 10; padding: 3px 6px;
  font-size: .58rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .3px;
  border-radius: 6px;
  background: rgba(255,255,255,.95);
  color: #00A859; border: 1px solid #bbf7d0;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

/* Image wrapper — square with product-image treatment */
.ip-img-wrap {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px; padding: 2px;
  overflow: hidden;
}
.ip-img-link {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.ip-img-wrap img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Product title */
.ip-title {
  font-size: .68rem; font-weight: 700;
  color: #0f172a; margin-bottom: 2px;
  line-height: 1.2; text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;`n            line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.4em;
}

/* Stars */
.ip-rating {
  display: flex; align-items: center; justify-content: center;
  gap: 1px; margin-bottom: 2px; font-size: 7px;
}
.ip-rating .bi-star-fill, .ip-rating .bi-star-half { color: #F59E0B; }
.ip-rating .bi-star { color: #e2e8f0; }
.ip-rc { color: #94a3b8; font-weight: 700; margin-left: 2px; font-size: 7px; }

/* Pricing */
.ip-price-wrap {
  display: flex; align-items: baseline;
  justify-content: center; gap: 4px;
  margin-bottom: 4px;
}
.ip-price-cur { font-size: .8rem; font-weight: 800; color: #0f172a; letter-spacing: -.2px; }
.ip-price-old { font-size: .6rem; font-weight: 500; color: #94a3b8; text-decoration: line-through; }

/* Add-to-cart button */
.ip-btn-add {
  width: 100%; border-radius: 999px; font-weight: 700;
  font-size: .68rem; padding: 4px 0;
  background: #fff; color: #00A859;
  border: 1.5px solid #00A859;
  cursor: pointer; transition: background .15s, color .15s;
}
.ip-btn-add:hover { background: #f0fdf4; }

/* Qty stepper */
.ip-qty-ctrl {
  width: 100%; height: 26px; border-radius: 999px;
  background: #00A859; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1px;
}
.ip-qty-btn {
  width: 24px; height: 24px;
  background: transparent; border: none;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; padding: 0;
  transition: background .12s;
  font-size: .7rem;
}
.ip-qty-btn:hover { background: rgba(255,255,255,.2); }
.ip-qty-val { font-size: .75rem; font-weight: 700; min-width: 16px; text-align: center; }

/* Out-of-stock / Options buttons */
.ip-btn-oos {
  width: 100%; border-radius: 999px; font-size: .68rem;
  font-weight: 700; padding: 4px 0;
  background: #f1f5f9; color: #94a3b8;
  border: 1px solid #e2e8f0; cursor: not-allowed;
}
.ip-btn-opts {
  display: block; width: 100%; border-radius: 999px;
  font-size: .68rem; font-weight: 700; padding: 4px 0;
  background: #f0fdf4; color: #00A859;
  border: 1.5px solid #bbf7d0;
  text-align: center; text-decoration: none;
  transition: background .15s;
}
.ip-btn-opts:hover { background: #dcfce7; }

/* ── Shimmer skeleton ── */
.ip-skel-card {
  background: #fff; border: 1px solid #f1f5f9;
  border-radius: 12px; padding: 6px; overflow: hidden;
}
.ip-skel-img {
  width: 100%; aspect-ratio: 1/1; border-radius: 7px;
  margin-bottom: 4px;
  background: linear-gradient(90deg,#f0f4f8 25%,#e2e8f0 50%,#f0f4f8 75%);
  background-size: 200% 100%;
  animation: ipShimmer 1.4s ease infinite;
}
.ip-skel-line {
  height: 10px; border-radius: 5px; margin-bottom: 5px;
  background: linear-gradient(90deg,#f0f4f8 25%,#e2e8f0 50%,#f0f4f8 75%);
  background-size: 200% 100%;
  animation: ipShimmer 1.4s ease infinite;
}
.ip-sl-w80 { width: 80%; margin-inline: auto; }
.ip-sl-w55 { width: 55%; margin-inline: auto; }
.ip-sl-w90 { width: 90%; }
@keyframes ipShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty / error state ── */
.ip-empty {
  flex: 0 0 100%; padding: 24px 16px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 6px;
}
.ip-empty-ic { font-size: 26px; opacity: .35; }
.ip-empty-msg { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ── Cart toast ── */
.ip-cart-toast {
  position: fixed; bottom: 76px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a; color: #fff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 12px;
  white-space: nowrap; z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.ip-cart-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* "Featured Today" row (.featured-scroll) on 360px–720px screens: a set
   number of cards in view — 2 (360–389px), 2½ (390–410px), 3 (411–520px)
   and 3½ (521–720px). Cards were a fixed 300px, so 1.1–2.3 showed. The row
   keeps its 20px left inset (lined up with the section header) but drops
   the right one, so the visible width is exactly the content box and each
   card is (row − gaps) / N: ~164px at 360px, ~138px at 390px, ~122–159px at
   411–520px, ~133–190px at 521–720px. A whole-number count leaves the next
   card a full gap past the screen edge, so no sliver shows.
   The card's contents were laid out for 300px, so each card is an
   inline-size container and its photo height, overlay padding, badge,
   title and meta line scale from the card's own width (cqi, floored for
   legibility). Below 200px the meta line drops its last item ("saves") so
   views and time stay readable instead of being cut mid-word. */
@media (min-width: 360px) and (max-width: 720px) {
    .featured-scroll {
        --feat-gap: 12px;
        gap: var(--feat-gap);
        padding: 4px 0 8px 20px;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 20px;
    }
    .feat-card {
        container-type: inline-size;
        scroll-snap-align: start;
    }
    .feat-card img {
        height: clamp(120px, calc(70px + 32cqi), 190px);
    }
    .feat-card .feat-overlay {
        padding: clamp(10px, 6cqi, 18px) clamp(8px, 4.7cqi, 14px) clamp(8px, 4.7cqi, 14px);
    }
    .feat-card .feat-badge {
        gap: clamp(3px, 1.67cqi, 5px);
        padding: clamp(2px, 1.33cqi, 4px) clamp(6px, 3.33cqi, 10px);
        margin-bottom: clamp(4px, 2cqi, 6px);
        font-size: clamp(7.5px, calc(5px + 1.67cqi), 10px);
        letter-spacing: .3px;
    }
    .feat-card h4 {
        font-size: clamp(11px, calc(7px + 2.7cqi), 15px);
        line-height: 1.25;
        margin-bottom: clamp(4px, 2cqi, 6px);
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }
    .feat-card .meta {
        gap: clamp(5px, 3.33cqi, 10px);
        font-size: clamp(8.5px, calc(5.5px + 2cqi), 11.5px);
        white-space: nowrap;
        overflow: hidden;
    }
    @container (max-width: 199.98px) {
        .feat-card .meta > span:nth-last-child(-n + 2) {
            display: none;
        }
    }
}
@media (min-width: 360px) and (max-width: 389px) {
    .feat-card { width: calc((100% - var(--feat-gap)) / 2); }
}
@media (min-width: 390px) and (max-width: 410px) {
    .feat-card { width: calc((100% - 2 * var(--feat-gap)) / 2.5); }
}
@media (min-width: 411px) and (max-width: 520px) {
    .feat-card { width: calc((100% - 2 * var(--feat-gap)) / 3); }
}
@media (min-width: 521px) and (max-width: 720px) {
    .feat-card { width: calc((100% - 3 * var(--feat-gap)) / 3.5); }
}

/* "Featured Today" placeholders and empty state (rendered by renderFeatured()
   / _featuredSkeleton() in recipe-blog.js). A placeholder is a .feat-card, so
   it takes the same per-range width as a real card; its height matches the
   real card's photo (190px, or ~120–131px in the 360px–720px layout). */
.feat-card.feat-skel {
  height: 190px;
  background: linear-gradient(100deg, #e9edf2 30%, #f4f6f9 50%, #e9edf2 70%);
  background-size: 200% 100%;
  box-shadow: none;
  cursor: default;
  animation: featSkel 1.4s ease-in-out infinite;
}

@keyframes featSkel {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

.feat-empty {
  flex: 1 0 100%;
  padding: 28px 20px 28px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 360px) and (max-width: 720px) {
  .feat-card.feat-skel { height: 125px; }
}

@media (prefers-reduced-motion: reduce) {
  .feat-card.feat-skel { animation: none; }
}

/* ── Header: the same design as main.html's home header (css/home-header.css, 2026-11) ──────
   Blue band behind logo / title (following the dynamic splash colour through --rp-hd-*, set by
   js/rp-config.js + js/brand-theme.js on every page), then the search pill on the pale tint.
   The Post Recipe button (.top-nav .post-btn, above) stays exactly as it was, in the slot the
   home page uses for the express-delivery badge. !important only where the bundled HTML of
   installed apps carries inline styles (logo filter, title colours, slogan). */
:root {
  --rp-hd-deep: 0, 30, 113;
  --rp-hd-mid: 0, 71, 179;
  --rp-hd-edge: 1, 149, 249;
  --rp-hd-tint: #f4f7fe;
  --rp-hd-ink: #0a1640;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700 800;
  font-display: optional;
  src: url(fonts/montserrat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.recipe-page .top-nav {
  height: 64px;
  padding: 0 14px;
  grid-template-columns: auto auto 1fr;   /* logo | title (flush against the logo) | Post Recipe */
  gap: 0;
  background:
    radial-gradient(58% 150% at 50% 22%, rgb(var(--rp-hd-deep)) 0%, rgba(var(--rp-hd-deep), 0.92) 30%, rgba(var(--rp-hd-mid), 0.75) 62%, rgba(var(--rp-hd-mid), 0) 100%),
    linear-gradient(180deg, rgb(var(--rp-hd-edge)) 0%, rgba(var(--rp-hd-mid), 0.72) 100%),
    rgb(var(--rp-hd-edge));
}

.recipe-page .top-nav .app-bar-left img {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 8, 40, 0.38);
  filter: none !important;
}

.recipe-page .top-nav .app-bar-center {
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center !important;
}

.recipe-page .top-nav .brand-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 1.16rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
  line-height: 1 !important;
}

.recipe-page .top-nav .brand-title > span:first-child {
  color: #f8faff !important;
  text-shadow: 0 2px 6px rgba(0, 8, 40, 0.35) !important;
}

.recipe-page .top-nav .brand-title > span:last-child {
  color: #f7be0e !important;
  text-shadow: 0 2px 6px rgba(60, 30, 0, 0.3) !important;
}

.recipe-page .top-nav .brand-slogan {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 6px !important;
  font-size: 0.5rem !important;
  font-weight: 700 !important;
  letter-spacing: 1.35px !important;
  line-height: 1 !important;
  color: rgba(240, 248, 255, 0.92) !important;
  text-shadow: none !important;
}

.recipe-page .top-nav .brand-slogan::before,
.recipe-page .top-nav .brand-slogan::after {
  content: '';
  width: 8px;
  height: 1.2px;
  border-radius: 1px;
  background: rgba(240, 248, 255, 0.85);
  flex-shrink: 0;
}

/* Under the band: the pale tint with the edge colour fading out, rounded off like the home header. */
.recipe-page .search-wrap {
  padding: 10px 12px 14px;
  background:
    linear-gradient(180deg, rgba(var(--rp-hd-mid), 0.55) 0%, rgba(var(--rp-hd-edge), 0.3) 35%, rgba(var(--rp-hd-edge), 0) 100%),
    var(--rp-hd-tint);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 12px 26px -16px rgba(var(--rp-hd-deep), 0.45);
}

.recipe-page .search-inner {
  height: 44px;
  padding: 0 5px 0 16px;
  gap: 10px;
  border: 1.5px solid rgba(var(--rp-hd-mid), 0.6);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fe 50%, #eef3fd 100%);
  box-shadow: 0 7px 16px -6px rgba(var(--rp-hd-edge), 0.45), inset 0 1px 0 #ffffff;
  transition: border-color .2s, box-shadow .2s;
}

.recipe-page .search-inner:focus-within {
  border-color: rgb(var(--rp-hd-mid));
  box-shadow: 0 7px 16px -6px rgba(var(--rp-hd-edge), 0.5), 0 0 0 3px rgba(var(--rp-hd-edge), 0.22);
}

.recipe-page .search-inner input {
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
}

.recipe-page .search-inner input::placeholder {
  color: #5a6378;
}

.recipe-page .search-inner .si {
  color: var(--rp-hd-ink);
  font-size: 1.1rem;
}

/* Round "go" button, as on the home search pill (decorative: the list filters as you type). */
.recipe-page .search-inner::after {
  content: '';
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 17px no-repeat,
    linear-gradient(150deg, rgb(var(--rp-hd-edge)) 0%, rgb(var(--rp-hd-mid)) 115%);
  box-shadow: 0 3px 8px rgba(var(--rp-hd-mid), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.recipe-page .category-scroll {
  padding-top: 16px;
}

@media (max-width: 389px) {
  .recipe-page .top-nav {
    height: 58px;
    padding: 0 10px;
  }

  .recipe-page .top-nav .app-bar-left img {
    width: 40px;
    height: 40px;
  }

  .recipe-page .top-nav .brand-title {
    font-size: 1rem !important;
  }

  .recipe-page .top-nav .brand-slogan {
    margin-top: 5px !important;
    font-size: 0.46rem !important;
    letter-spacing: 1.1px !important;
    gap: 3px;
  }

  .recipe-page .top-nav .brand-slogan::before,
  .recipe-page .top-nav .brand-slogan::after {
    width: 6px;
  }

  .recipe-page .search-inner {
    height: 40px;
  }

  .recipe-page .search-inner::after {
    flex-basis: 30px;
    height: 30px;
  }
}

@media (max-width: 359px) {
  .recipe-page .top-nav .app-bar-left img { width: 34px; height: 34px; }
  .recipe-page .top-nav .brand-title { font-size: 0.88rem !important; }
  .recipe-page .top-nav .brand-slogan::before,
  .recipe-page .top-nav .brand-slogan::after { display: none; }
}
