/* Shared neutral dark surfaces. Brand and semantic accents keep their colors. */
:root.dark,:root.dark .theme-sloth{--background:#181818;--foreground:#f2f2f2;--card:#222222;--card-foreground:#f2f2f2;--popover:#2a2a2a;--popover-foreground:#f2f2f2;--secondary:#2c2c2c;--secondary-foreground:#d0d0d0;--muted:#2c2c2c;--muted-foreground:#a6a6a6;--input:#2c2c2c;--border:rgba(255,255,255,.10);--border-subtle:rgba(255,255,255,.06);--border-strong:rgba(255,255,255,.16)}
:root.dark{background:#181818;color-scheme:dark}
:root.dark .theme-sloth [class~="dark:bg-[#131A15]"],:root.dark .theme-sloth [class~="dark:bg-[#131a15]"]{background-color:#222222}
:root.dark .theme-sloth [class*="dark:bg-[#101713]"]{background-color:rgba(34,34,34,.98)}
:root.dark .theme-sloth [class~="dark:bg-[#1A211C]"],:root.dark .theme-sloth [class~="dark:bg-[#19211B]"]{background-color:#2a2a2a}
/* Food detail and its surrounding navigation share the same canvas. */
:root.dark .fd-page-root,:root.dark .fd-redesign{background:#181818}
:root.dark .fd-redesign{--fd-ink:#f2f2f2;--fd-border:#383838}
:root.dark .fd-redesign .fd-card,:root.dark .fd-redesign .fd-macros,:root.dark .fd-redesign .fd-journal-bar,:root.dark .fd-redesign .fd-about,:root.dark .fd-redesign .fd-journal-banner{background:#222222;border-color:#383838}
:root.dark .fd-redesign .fd-donut>div{background:#222222}
:root.dark .fd-redesign .fd-calories:before{background:radial-gradient(ellipse at 60% 80%,#4b4b4b,transparent 70%);opacity:.45}
:root.dark .fd-redesign .fd-burn-info{background:#292929;border-color:#3b3b3b;color:#c7c7c7}
:root.dark .fd-redesign .fd-burn-info strong,:root.dark .fd-redesign .fd-about h2{color:#f2f2f2}
:root.dark .fd-redesign .fd-nutrition dl>div{border-color:#383838}
:root.dark .fd-redesign .fd-serving select,:root.dark .fd-redesign .fd-custom input{background-color:#2a2a2a;border-color:#414141;color:#f2f2f2}
:root.dark .fd-redesign .fd-journal-intro p,:root.dark .fd-redesign .fd-brand,:root.dark .fd-redesign .fd-about p{color:#c3c3c3}
:root.dark .fd-redesign .fd-heading .fd-brand{color:#aaa}:root.dark .fd-redesign .fd-heading .fd-brand strong{color:#ededed}
:root.dark .fd-food-nav{background:rgba(34,34,34,.97);border-color:#383838}
:root.dark .fd-food-nav .fd-nav-logo,:root.dark .fd-food-nav .fd-nav-actions>button{background:#2a2a2a!important;border-color:#414141!important}
:root.dark .fd-food-nav .fd-nav-search input{background:#2a2a2a!important;border-color:#414141!important;color:#f2f2f2!important}
:root.dark .fd-food-nav .fd-nav-search input::placeholder{color:#aaa!important}
:root.dark .fd-food-nav .fd-nav-actions>a[href='/login'],:root.dark .fd-food-nav .fd-nav-actions>a[href='/dashboard']{color:#d2d2d2}
:root.dark .fd-food-nav .fd-nav-actions>a[href='/login']:hover,:root.dark .fd-food-nav .fd-nav-actions>a[href='/dashboard']:hover{background:#333}
:root.dark .theme-sloth:not(:has(.fd-page-root > .fd-redesign)) .fd-food-footer.fd-footer-simple{background:#181818}
:root.dark [class~="dark:bg-[#17191d]"]{background-color:#181818}
/* Legacy fixed profile/card colors are surfaces, not emerald accents. */
:root.dark .theme-sloth [class~="dark:bg-[#111715]" i]{background-color:#222222}
:root.dark .theme-sloth [class~="dark:bg-[#050A0D]" i]{background-color:#2c2c2c}
:root.dark .theme-sloth [class~="dark:bg-[#0D1420]" i]{background-color:#2a2a2a}
/* Food detail: vivid green foliage and borderless dark surfaces. */
:root.dark .fd-redesign{--fd-border:transparent}
:root.dark .fd-redesign .fd-top-leaves{opacity:1;background:none}
:root.dark .fd-redesign .fd-small-leaves i{background:#78cb68}
:root.dark .fd-redesign .fd-card,:root.dark .fd-redesign .fd-macros,:root.dark .fd-redesign .fd-journal-bar,:root.dark .fd-redesign .fd-about,:root.dark .fd-redesign .fd-journal-banner,:root.dark .fd-redesign .fd-burn-info,:root.dark .fd-redesign .fd-product-photo{border:0}
:root.dark .fd-redesign .fd-calories{border-right:0}
:root.dark .fd-redesign .fd-activity+.fd-activity::before{display:none}
:root.dark .fd-redesign .fd-product-info dl>div{border:0}
:root.dark .fd-redesign .fd-serving select,:root.dark .fd-redesign .fd-custom input{border:0}
:root.dark .fd-food-nav{border:0}
:root.dark .fd-food-nav .fd-nav-logo,:root.dark .fd-food-nav .fd-nav-actions>button,:root.dark .fd-food-nav .fd-nav-search input{border:0!important}
/* The footer action stays emerald in dark mode. */
:root.dark .theme-sloth .fd-footer-nav>a.fd-footer-app{background:linear-gradient(110deg,#0ba34a,#00863a);color:#fff;border:0;box-shadow:0 4px 16px #0002}
:root.dark .theme-sloth .fd-footer-nav>a.fd-footer-app:hover{background:linear-gradient(110deg,#0ba34a,#00863a);color:#fff;filter:brightness(1.07)}
/* Anchor the foliage at the base so it bends in the breeze. */
.theme-sloth .fd-food-footer.fd-footer-simple::before,
.theme-sloth .fd-food-footer.fd-footer-simple::after {
  top: auto;
  bottom: 0;
  width: clamp(88px, calc((100vw - 1120px) / 2 - 36px), 154px);
  height: auto;
  aspect-ratio: 144 / 106;
  background-image: url('/food-art/footer-sprig-v1.svg');
  animation: fd-footer-breeze 7s ease-in-out infinite;
}
.theme-sloth .fd-food-footer.fd-footer-simple::after {
  right: 18px;
  opacity: .92;
  transform-origin: 82% 100%;
}
.theme-sloth .fd-food-footer.fd-footer-simple::before {
  left: 18px;
  opacity: .76;
  background-image: url('/food-art/footer-sprig-left-v1.svg');
  transform: none;
  transform-origin: 18% 100%;
  animation-duration: 8.5s;
  animation-delay: -2s;
  animation-direction: reverse;
}
@keyframes fd-footer-breeze {
  0%, 100% { rotate: -4deg; }
  28% { rotate: 5deg; }
  52% { rotate: 1deg; }
  72% { rotate: 7deg; }
}
@media (max-width: 1340px) {
  .theme-sloth .fd-food-footer.fd-footer-simple::before { display: none; }
  .theme-sloth .fd-food-footer.fd-footer-simple::after { width: 78px; }
}
@media (min-width: 761px) and (max-width: 1340px) {
  .theme-sloth .fd-footer-simple .fd-footer-shell { padding-right: 110px; }
}
@media (max-width: 760px) {
  .theme-sloth .fd-food-footer.fd-footer-simple::after {
    width: clamp(70px, 23vw, 104px);
    right: 12px;
    bottom: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-sloth .fd-food-footer.fd-footer-simple::before,
  .theme-sloth .fd-food-footer.fd-footer-simple::after {
    animation: none;
  }
}

/* The emerald footer in light mode uses foliage with more contrast. */
:root:not(.dark) .theme-sloth .fd-food-footer.fd-footer-simple::before {
  background-image: url('/food-art/footer-sprig-left-light-v1.svg');
  opacity: .67;
}
:root:not(.dark) .theme-sloth .fd-food-footer.fd-footer-simple::after {
  background-image: url('/food-art/footer-sprig-light-v1.svg');
  opacity: .84;
}

/* Slightly raised charcoal footer and neutral navigation on dark food detail pages. */
:root.dark .theme-sloth:has(.fd-page-root > .fd-redesign) > .fd-food-footer.fd-footer-simple {
  background: #262827;
  color: #fff;
}
:root.dark .theme-sloth:has(.fd-page-root > .fd-redesign) .fd-footer-simple :is(
  .fd-footer-brand, .fd-footer-brand strong, .fd-footer-identity > p, .fd-footer-meta, .fd-footer-meta a,
  .fd-footer-nav > a:not(.fd-footer-app)
) {
  color: #fff;
}
:root.dark .theme-sloth:has(.fd-page-root > .fd-redesign) .fd-footer-simple a:focus-visible {
  outline-color: #c5ed8a;
}
:root.dark .theme-sloth .public-navbar-shell {
  background-color: rgb(34 34 34 / .96);
  border-color: rgb(255 255 255 / .09);
  box-shadow: 0 10px 34px rgb(0 0 0 / .24);
}

/* The sprig hangs from the upper corner and uses the foliage from the footer. */
.theme-sloth .fd-redesign > .fd-top-leaves {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  top: 2px;
  right: clamp(10px, 2.3vw, 44px);
  width: clamp(112px, 16vw, 245px);
  height: auto;
  aspect-ratio: 144 / 106;
  opacity: 1;
  background: none;
}
.theme-sloth .fd-redesign > .fd-top-leaves i {
  display: none;
}
.theme-sloth .fd-redesign > .fd-top-leaves::before {
  content: "";
  display: block;
  position: absolute;
  inset: -32% -35% -15% -18%;
  width: auto;
  height: auto;
  border-radius: 0;
  background: radial-gradient(ellipse at 78% 28%, rgb(132 213 92 / .22), transparent 65%);
}
:root.dark .theme-sloth .fd-redesign > .fd-top-leaves::before {
  background: radial-gradient(ellipse at 78% 28%, rgb(91 163 80 / .22), transparent 65%);
}
.theme-sloth .fd-redesign > .fd-top-leaves::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/food-art/footer-sprig-v1.svg') center / contain no-repeat;
  transform: translateY(100%) scaleY(-1);
  transform-origin: 82% 0;
  opacity: .88;
  animation: fd-header-sprig-breeze 9s ease-in-out infinite;
}
:root.dark .theme-sloth .fd-redesign > .fd-top-leaves::after {
  opacity: .94;
}
@keyframes fd-header-sprig-breeze {
  0%, 100% { rotate: -3deg; }
  42% { rotate: 3deg; }
  72% { rotate: 0deg; }
}
@media (max-width: 1279px) {
  .theme-sloth .fd-redesign > .fd-top-leaves {
    top: 68px;
  }
}
@media (max-width: 760px) {
  .theme-sloth .fd-redesign > .fd-top-leaves {
    top: 78px;
    right: 11px;
    width: clamp(71px, 23vw, 116px);
  }
  .theme-sloth .fd-redesign .fd-heading {
    padding-right: clamp(64px, 20vw, 109px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-sloth .fd-redesign > .fd-top-leaves::after {
    animation: none;
  }
}

/* Catalog and food-detail pages use the same floating navigation. */
.theme-sloth .public-navbar-links {
  gap: .5rem;
}
.theme-sloth .public-navbar-features {
  gap: .625rem;
}
.theme-sloth .public-navbar-features > a {
  gap: 1rem;
}
