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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background: #120906;
  overflow: hidden;
  font-family: "Cormorant Garamond", serif;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  contain: layout paint;
}

.bg-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.ui-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.ui-btn,
.inventory-panel {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 160ms ease;
  z-index: 5;
}

.ui-btn img,
.panel-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.ui-btn:hover,
.inventory-panel:hover,
.shopping-panel:hover,
.missing-panel:hover {
  transform: translateY(-3px);
}

.inventory-panel {
  top: 29%;
  left: 15.7%;
  width: 25%;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 14px rgba(255, 206, 114, 0.08));
}

.inventory-panel:hover {
  transform: translateY(-4px);
}

.recipe-btn {
  top: 26%;
  right: 13%;
  width: 23%;
}

.shopping-panel {
  position: absolute;
  left: 18%;
  bottom: 16%;
  width: 21.5%;
  transition: transform 120ms ease;
}

.print-shopping-btn {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(89, 42, 16, 0.95),
    rgba(52, 22, 8, 0.95)
  );
  color: white;
  border: 1px solid rgba(255, 220, 184, 0.14);
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: "Cinzel", serif;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.shopping-panel:hover .print-shopping-btn {
  opacity: 1;
}

.missing-panel {
  position: absolute;
  right: 15%;
  bottom: 13%;
  width: 22%;
  transition: transform 120ms ease;
}

.recipe-btn {
  top: 26%;
  right: 13%;
  width: 23%;
  transition: transform 120ms ease;
}

.recipe-btn:hover {
  transform: translateY(-3px);
}

.close-btn {
  position: absolute;
  top: 1px;
  right: -2px;
  width: 100px;
  height: 100px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.close-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.close-btn:hover {
  transform: scale(1.08);
  filter: brightness(1.12);
}

/* ---------- Left navigation rail (matches meal-planner.html) ---------- */
.top-navigation {
  position: fixed;
  top: 0;
  left: clamp(6px, 1.3vw, 20px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 22px 0;
  z-index: 100;
}

.nav-btn {
  position: static;
  width: clamp(84px, 9vw, 130px);
  height: clamp(72px, 7.6vw, 110px);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;

  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link {
  text-decoration: none;
  display: inline-block;
}

.nav-link .nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn .title-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;

  filter: drop-shadow(2px 4px 5px rgba(0, 0, 0, 0.5));
}

.panel-content {
  position: absolute;
  z-index: 4;
}

.shopping-content {
  top: 50%;
  left: 12%;
  width: 81%;
  height: 40%;
}

.missing-content {
  top: 36%;
  left: 12%;
  width: 80%;
  height: 35%;
}

.book-add-missing-btn.active {
  background: linear-gradient(180deg, #b85d4f, #8c3f33);
}

.selected-recipe-name {
  text-align: center;
  color: #f8e2bf;
  font-size: 0.95rem;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  min-height: 1.2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-list {
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-right: 2px;
}

.panel-list::-webkit-scrollbar {
  display: none;
}

.side-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(
    180deg,
    rgba(89, 42, 16, 0.95),
    rgba(52, 22, 8, 0.95)
  );
  border-radius: 20px;
  border: 1px solid rgba(255, 220, 184, 0.14);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    max-height 0.18s ease,
    margin 0.18s ease,
    padding 0.18s ease;
  animation: slideIn 0.4s ease-out;
  position: relative;
  overflow: hidden;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.side-card:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1px rgba(255, 226, 190, 0.15),
    inset 0 -6px 14px rgba(0, 0, 0, 0.2),
    0 14px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 200, 120, 0.1);
  border-color: rgba(255, 200, 120, 0.25);
}

.side-card.purchased {
  opacity: 0.7;
  background: linear-gradient(
    180deg,
    rgba(60, 35, 20, 0.85),
    rgba(35, 18, 8, 0.9)
  );
}

.side-card.purchased .side-name {
  text-decoration: line-through;
  color: #c9a882;
}

.side-card.purchased .purchase-checkbox {
  background: linear-gradient(180deg, #5ab454, #368235);
  border-color: #5ab454;
}

.purchase-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid rgba(255, 220, 184, 0.4);
  background: rgba(255, 244, 231, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  font-size: 14px;
  color: transparent;
}

.purchase-checkbox:hover {
  border-color: rgba(255, 200, 120, 0.6);
  box-shadow: 0 0 12px rgba(255, 200, 120, 0.2);
}

.purchase-checkbox.checked {
  background: linear-gradient(180deg, #5ab454, #368235);
  border-color: #5ab454;
  color: #fff;
}

.side-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
}

.side-quantity {
  background: linear-gradient(
    180deg,
    rgba(255, 200, 120, 0.2),
    rgba(255, 180, 80, 0.1)
  );
  color: #ffd89d;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 200, 120, 0.3);
  font-family: "Cinzel", serif;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
  display: inline-block;
}

.side-card.removing {
  opacity: 0;
  transform: translateX(8px);
  max-height: 0;
  margin: 0;
  padding: 0;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    max-height 0.18s ease,
    margin 0.18s ease,
    padding 0.18s ease;
}

.side-main {
  min-width: 0;
  flex: 1;
}

.side-name {
  color: #fff1dc;
  font-size: 0.9rem;
  font-weight: 700;
  word-break: break-word;
  line-height: 1.05;
  font-family: "Cinzel", serif;
}

.side-sub {
  color: #f0cfa5;
  font-size: 0.72rem;
  margin-top: 0.08rem;
  line-height: 1.05;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
}

.side-btn {
  border: none;
  border-radius: 999px;
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    0 6px 12px rgba(0, 0, 0, 0.22);
  font-size: 0.72rem;
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
}

.side-btn.remove {
  background: linear-gradient(180deg, #b94b3f, #8f2b23);
}

.side-btn.add {
  background: linear-gradient(180deg, #5ab454, #368235);
}

.empty-note {
  color: #fff;
  text-align: center;
  font-size: 0.86rem;
  padding: 0.7rem 0.45rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
}

.book-overlay,
.stash-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(20, 10, 5, 0.65) 0%,
    rgba(8, 4, 2, 0.85) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
  height: 100vh;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.book-overlay.show,
.stash-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(20, 10, 5, 0.65) 0%,
    rgba(8, 4, 2, 0.85) 100%
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.show .modal-card {
  animation: modalSlideIn 0.28s ease-out forwards;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card {
  width: min(92vw, 430px);
  background: linear-gradient(
    135deg,
    rgba(107, 60, 33, 0.85) 0%,
    rgba(74, 40, 21, 0.75) 50%,
    rgba(50, 25, 12, 0.85) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 230, 196, 0.35);
  border-radius: 28px;
  box-shadow:
    0 0 40px rgba(255, 180, 100, 0.15),
    0 0 80px rgba(255, 160, 80, 0.1),
    inset 0 0 60px rgba(255, 200, 150, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.4);
  padding: 28px 24px 24px;
  position: relative;
  overflow: hidden;
  animation: none;
}

.modal-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    135deg,
    rgba(255, 200, 130, 0.4),
    rgba(255, 150, 80, 0.2),
    rgba(255, 200, 130, 0.4)
  );
  border-radius: 28px;
  z-index: -1;
  filter: blur(10px);
  opacity: 0.6;
}

.modal-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 180, 100, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

/* Removed pulsing glow to reduce motion and GPU churn */

.stash-close-button {
  position: absolute;
  top: 45px;
  right: 140px;
  width: 50px;
  height: 60px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.stash-close-button:hover {
  transform: scale(1.03);
}

.stash-close-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-close,
.book-close,
.stash-close {
  position: absolute;
  top: 5px;
  right: 1px;
  border: none;
  background: linear-gradient(
    135deg,
    rgba(68, 30, 12, 0.75),
    rgba(40, 18, 8, 0.85)
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffe7c4;
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  box-shadow:
    inset 0 1px 1px rgba(255, 230, 196, 0.2),
    0 0 20px rgba(255, 180, 100, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 200, 130, 0.25);
  transition: all 0.25s ease;
}

.modal-close:hover,
.book-close:hover,
.stash-close:hover {
  transform: scale(1.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 230, 196, 0.3),
    0 0 20px rgba(255, 180, 100, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 220, 150, 0.35);
}

.modal-title {
  color: #fff5e5;
  font-size: 26px;
  margin-bottom: 20px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  text-align: center;
  text-shadow:
    0 0 20px rgba(255, 180, 100, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.03em;
}

.pantry-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pantry-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pantry-form span {
  color: #ffe8c8;
  font-size: 13px;
  font-weight: 700;
  font-family: "Cinzel", serif;
}

.pantry-form input,
.pantry-form select,
.book-search {
  width: 100%;
  border: 1px solid rgba(255, 200, 130, 0.25);
  outline: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 244, 231, 0.85) 0%,
    rgba(255, 230, 200, 0.8) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #2c170c;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 180, 100, 0.1);
  transition: all 0.25s ease;
}

.pantry-form input:focus,
.pantry-form select:focus,
.book-search:focus {
  border-color: rgba(255, 180, 100, 0.5);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 2px rgba(255, 180, 100, 0.15),
    0 0 20px rgba(255, 180, 100, 0.2);
}

.modal-actions {
  margin-top: 6px;
}

.save-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f5c777 0%, #f0b35f 50%, #e5a54a 100%);
  color: #351a0a;
  font-size: 15px;
  font-weight: 800;
  font-family: "Cinzel", serif;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 4px 12px rgba(240, 179, 95, 0.3),
    0 0 20px rgba(255, 180, 80, 0.2);
  transition: all 0.25s ease;
}

.save-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 6px 16px rgba(240, 179, 95, 0.4),
    0 0 30px rgba(255, 180, 80, 0.35);
  filter: brightness(1.05);
}

.save-btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(240, 179, 95, 0.25);
}

.stash-shell {
  width: min(95vw, 1200px);
  max-width: 95vw;
  max-height: 95vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stash-panel {
  position: relative;
  width: 1100px;
  height: 650px;
}

.stash-panel-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.stash-close {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 100;
  padding: 0;
  transition: transform 0.2s ease;
}

.stash-close img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stash-close:hover {
  transform: scale(1.1) rotate(90deg);
}

.stash-basket-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stash-title span {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  font-weight: 800;
  color: #6b3e1d;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.stash-chef-icon {
  width: 55px;
  height: 55px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stash-top-buttons {
  position: absolute;
  top: 145px;
  left: 65%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.stash-btn-top {
  height: 38px;
  cursor: pointer;
  transition: filter 0.2s ease;
  object-fit: contain;
}

.stash-btn-top:hover {
  filter: brightness(1.15);
}

.search-btn {
  height: 55px;
}

.scan-btn {
  height: 60px;
}

.add-btn {
  height: 48px;
  margin-top: 5px;
}

.stash-categories {
  position: absolute;
  top: 185px;
  left: 205px;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 10;
}

.stash-cat {
  width: 220px;
  height: 55px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
  object-fit: contain;
}

.stash-cat:hover {
  filter: brightness(1.15);
  box-shadow:
    0 0 30px rgba(255, 220, 150, 0.9),
    0 0 45px rgba(255, 200, 100, 0.7),
    inset 0 0 15px rgba(255, 240, 200, 0.5);
}

.stash-cat.active {
  filter: brightness(1.15) drop-shadow(0 0 12px rgba(255, 200, 100, 0.5));
}

.search-text-cats-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-text-cats {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 6px 2px;
}
.search-text-cats .stash-cat {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s ease,
    transform 0.12s ease;
}
.search-text-cats .stash-cat:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.search-text-cats .stash-cat.active {
  background: rgba(255, 200, 100, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Hide native scrollbar but keep scroll functionality */
.search-text-cats::-webkit-scrollbar {
  height: 8px;
}
.search-text-cats::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}
.search-text-cats::-webkit-scrollbar-track {
  background: transparent;
}

.cat-scroll-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #fff8f0, #fff0e0);
  color: #5a3a22;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.cat-scroll-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.stash-sort {
  position: absolute;
  top: 150px;
  left: 380px;
  z-index: 10;
}

.sort-toggle {
  width: 36px;
  height: 34px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  border: 2px solid rgba(139, 90, 43, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8f0, #fff0e0);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.sort-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: #5a3a22;
  border-radius: 2px;
}

.sort-toggle:hover {
  transform: scale(1.03);
  border-color: rgba(139, 90, 43, 0.5);
}

.sort-menu {
  position: absolute;
  top: 44px;
  left: 0;
  min-width: 150px;
  background: #fff;
  border: 1px solid rgba(139, 90, 43, 0.35);
  border-radius: 8px;
  padding: 4px 0;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 20;
}

.sort-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sort-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #5a3a22;
  font-family: "Cinzel", serif;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.sort-menu-item:hover,
.sort-menu-item.active {
  background: rgba(255, 210, 140, 0.25);
}

.stash-items-area {
  position: absolute;
  top: 205px;
  left: 490px;
  width: 505px;
  height: 420px;
  z-index: 10;
}

.expiry-notification {
  position: absolute;
  top: -105px;
  right: 50px;
  z-index: 20;
}

.expiry-notification-btn {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border: 2px solid #ffb347;
  padding: 6px 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #8b6b00;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.expiry-notification-btn:hover {
  background: linear-gradient(135deg, #ffe69c 0%, #ffd700 100%);
  box-shadow: 0 3px 10px rgba(255, 179, 71, 0.4);
}

.expiry-notification:hover .expiry-notification-dropdown {
  display: block;
}

.expiry-notification-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff9e6;
  border: 2px solid #ffb347;
  border-radius: 6px;
  min-width: 200px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  margin-top: 4px;
}

.expiry-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #e8d4a3;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.85rem;
}

.expiry-dropdown-item:last-child {
  border-bottom: none;
}

.expiry-item-name {
  color: #6b4423;
  font-weight: 600;
}

.expiry-item-date {
  color: #c44d2e;
  font-weight: 700;
  font-size: 0.8rem;
}

.expiry-notification-dropdown::-webkit-scrollbar {
  width: 6px;
}

.expiry-notification-dropdown::-webkit-scrollbar-thumb {
  background: #ffb347;
  border-radius: 3px;
}

.stash-empty-state {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #6b3e1d;
  width: 100%;
  z-index: 5;
}

.empty-scroll {
  width: 80px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 15px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stash-empty-state h2 {
  font-family: "Cinzel", serif;
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #6b3e1d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.stash-empty-state p {
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  color: #8b5a2b;
  font-weight: 600;
  line-height: 1.4;
}

.stash-grid {
  display: grid;
  grid-template-columns: repeat(4, 105px);
  grid-template-rows: repeat(5, 140px);
  gap: 8px;
  padding: 15px;
  width: 100%;
  height: 370px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  align-content: start;
}

.stash-grid::-webkit-scrollbar {
  width: 6px;
}

.stash-grid::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.stash-slot {
  position: relative;
  width: 110px;
  height: 140px;
  background: url("../img/PantrySlot.png") center/contain no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
  cursor: pointer;
}

.stash-slot:hover {
  filter: brightness(1.1);
}

.stash-slot.empty {
  opacity: 0.3;
}

.stash-slot-name {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: #4a2c17;
  text-align: center;
  width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 2;
}

.stash-slot-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  font-size: 3.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  pointer-events: none;
  z-index: 2;
}

.stash-slot-qty-controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.stash-slot-qty {
  position: absolute;
  bottom: 18px;
  left: 10px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 0.72rem;
  color: #5a3a22;
  background: rgba(255, 250, 235, 0.85);
  border: 1px solid rgba(139, 90, 43, 0.5);
  border-radius: 10px;
  padding: 2px 6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  min-width: 45px;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}

.stash-slot-tooltip {
  position: absolute;
  top: 105%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stash-slot:hover .stash-slot-tooltip {
  opacity: 1;
}

.stash-slot-info {
  position: absolute;
  bottom: 18px;
  right: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5a2b, #6b3e1d);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #fff8f0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

.stash-slot-info:hover {
  background: linear-gradient(135deg, #ab7a4b, #8b5a2b);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.stash-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #b94b3f, #8f2b23);
  color: #fff3ea;
  font-size: 0.9rem;
  font-family: "Cinzel", serif;
  font-weight: 700;
  width: 70px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stash-slot:hover .stash-remove-btn {
  opacity: 1;
}

.stash-remove-btn:hover {
  background: linear-gradient(180deg, #d95b4f, #af3b33);
}

.stash-slot.low-stock {
  filter: hue-rotate(-30deg) saturate(1.5);
}

.stash-slot.low-stock::after {
  content: "!";
  position: absolute;
  top: -5px;
  left: 43%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ff6b6b, #c0392b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: "Cinzel", serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 4;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.15);
  }
}

.stash-slot.expiring-today,
.stash-slot.expiring-1day {
  filter: hue-rotate(0deg) saturate(1.5);
}

.stash-slot.expiring-today::before,
.stash-slot.expiring-1day::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(231, 76, 60, 0.6),
    transparent
  );
  z-index: 1;
  animation: expiryGlow 2s ease-in-out infinite;
}

.stash-slot.expiring-today {
  animation: pulseDanger 1s infinite;
}

@keyframes pulseDanger {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.stash-slot.expiring-3days::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(246, 197, 2, 0.6),
    transparent
  );
  z-index: 1;
  animation: expiryGlow 2s ease-in-out infinite;
}

.stash-slot.expiring-4plus-days {
  filter: hue-rotate(120deg) saturate(1.2);
}

.stash-slot.expiring-4plus-days::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(46, 204, 113, 0.3),
    transparent
  );
  z-index: 1;
  animation: expiryGlow 2s ease-in-out infinite;
}

.stash-slot.expired {
  filter: grayscale(0.8) brightness(0.7);
}

.stash-slot.expired::before {
  content: "EXPIRED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: linear-gradient(135deg, #c0392b, #922b21);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  font-family: "Cinzel", serif;
  letter-spacing: 0.05em;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.stash-slot.expired-long {
  filter: grayscale(1) brightness(0.4);
}

.stash-slot.expired-long::before {
  content: "EXPIRED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  background: linear-gradient(135deg, #000, #222);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: bold;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

@keyframes expiryGlow {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.pantry-search-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(139, 90, 43, 0.3);
  background: linear-gradient(135deg, #fff8f0, #fff0e0);
  color: #5a3a22;
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.pantry-search-input:focus {
  outline: none;
  border-color: rgba(139, 90, 43, 0.6);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 0 0 3px rgba(255, 180, 100, 0.15);
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Autocomplete */
.ingredient-input-wrap {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 180px;
  overflow-y: auto;
  background: #fff8f0;
  border: 1px solid rgba(255, 180, 100, 0.3);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: none;
  margin-top: 4px;
}

.autocomplete-dropdown.show {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  color: #2c170c;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: #f5c777;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 216, 167, 0.2),
    rgba(255, 240, 200, 0.3)
  );
  border: 1px solid rgba(180, 120, 70, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 216, 167, 0.35),
    rgba(255, 240, 200, 0.45)
  );
  border-color: rgba(180, 120, 70, 0.35);
  transform: translateX(4px);
}

.search-result-emoji {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.search-result-info {
  flex: 1;
}

.search-result-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: #5a3a22;
  font-size: 0.95rem;
}

.search-result-qty {
  font-family: "Cormorant Garamond", serif;
  color: #7a5a3a;
  font-size: 0.85rem;
  font-weight: 600;
}

.scan-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.scan-upload-btn {
  width: 100%;
  padding: 14px 20px;
  top: 10;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f5c777, #e5a54a);
  color: #351a0a;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(240, 179, 95, 0.3);
  transition: all 0.25s ease;
}

.scan-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(240, 179, 95, 0.4);
  filter: brightness(1.05);
}

.scan-or {
  color: #8b5a2b;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.manual-barcode-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid rgba(139, 90, 43, 0.3);
  background: #fff8f0;
  color: #5a3a22;
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.manual-barcode-input:focus {
  outline: none;
  border-color: rgba(139, 90, 43, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 180, 100, 0.15);
}

.scan-action-group {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.scan-submit-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #5ab454, #3f8c3a);
  color: #fffdf6;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(65, 139, 65, 0.35);
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease;
}

.scan-switch-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  margin: 15px auto;
  padding: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #7b451f, #9a5d30);
  border: 2px solid #f7e65a;
  box-shadow:
    0 0 16px rgba(247, 230, 90, 0.8),
    inset 0 0 10px rgba(247, 230, 90, 0.35);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.scan-switch-btn:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 24px rgba(247, 230, 90, 1),
    inset 0 0 15px rgba(247, 230, 90, 0.5);
}

.scan-switch-btn img {
  width: 28px;
  height: 28px;
  display: block;
}

.scan-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(65, 139, 65, 0.45);
  filter: brightness(1.08);
}

.scan-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(90, 180, 84, 0.4);
  filter: brightness(1.05);
}

.book-shell {
  width: min(90vw, 1000px);
  margin: 0 auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.book-frame {
  width: 100%;
  aspect-ratio: 3 / 2;
  position: relative;
  padding: 6% 5%;
  filter: drop-shadow(0 25px 40px rgba(0, 0, 0, 0.35));
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.book-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 0;
}

.book-body {
  position: absolute;
  inset: 8% 6%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  z-index: 1;
}

.book-left-page {
  border-radius: 5px 8px 8px 18px;
  padding: 20px 16px;
  overflow: hidden;
  position: relative;
}

.book-right-page {
  border-radius: 8px 18px 18px 8px;
  padding: 20px 16px;
  overflow: hidden;
  position: relative;
}

.book-right-page .checklist-box {
  padding-bottom: 64px;
}

.book-search-wrap {
  margin-bottom: 10px;
}

.recipe-book-results-meta {
  color: rgba(90, 47, 28, 0.65);
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 2px 8px;
  text-transform: uppercase;
}

.book-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid rgba(120, 70, 40, 0.3);
  background: #fffaf1;
  font-family: "Cormorant Garamond", serif;
}

.recipe-book-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 216, 167, 0.5) transparent;
}

.recipe-book-list::-webkit-scrollbar {
  width: 6px;
}

.recipe-book-list::-webkit-scrollbar-thumb {
  background: rgba(255, 216, 167, 0.5);
  border-radius: 3px;
}

.recipe-book-item {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-weight: 700;
  color: #6b3c21;
}

.recipe-book-item-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recipe-book-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-book-item-meta {
  color: rgba(107, 60, 33, 0.62);
  font-family: "Cinzel", serif;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.recipe-book-item-count {
  color: rgba(107, 60, 33, 0.58);
  flex: 0 0 auto;
  font-family: "Cinzel", serif;
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.recipe-book-empty {
  align-items: center;
  color: rgba(90, 47, 28, 0.72);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 28px 12px;
  text-align: center;
}

.recipe-book-empty strong {
  color: #5a2f1c;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
}

.recipe-book-empty span {
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
}

.book-recommend-section {
  margin-bottom: 16px;
}

.book-recommend-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #5a2f1c;
  margin-bottom: 10px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.book-recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.recipe-recommend-item {
  background: linear-gradient(
    135deg,
    rgba(255, 216, 167, 0.2),
    rgba(255, 240, 200, 0.3)
  );
  border: 1px solid rgba(180, 120, 70, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.recipe-recommend-item:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 216, 167, 0.35),
    rgba(255, 240, 200, 0.45)
  );
  border-color: rgba(180, 120, 70, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(180, 120, 70, 0.15);
}

.recommend-name {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #6b3c21;
  line-height: 1.2;
  margin-bottom: 4px;
}

.recommend-match {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: #4fa64f;
  background: rgba(79, 166, 79, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.recipe-book-item:hover,
.recipe-book-item.active {
  background: rgba(255, 216, 167, 0.15);
  color: #ffd700;
  transform: translateX(3px);
  border-color: rgba(255, 216, 167, 0.25);
}

.recipe-preview-dish {
  text-align: center;
  font-size: 3rem;
  margin-top: 4px;
  margin-bottom: 6px;
  min-height: 60px;
}

.recipe-dish-img-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  background: transparent;
}

.recipe-dish-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fcf5e5;

  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.3),
    0 4px 6px rgba(0, 0, 0, 0.2);
}

.recipe-title-group {
  text-align: center;
  margin: 15px 0;
}

.recipe-dish-title {
  font-family: "Crimson Text", serif;
  font-size: 28px;
  color: #5c3b1e;
  margin-bottom: 5px;
}

.compatibility-badge {
  background-color: #f7e7c8;
  color: #7b5b3a;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid #c9a67a;
}

.book-recipe-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #5a2f1c;
  margin-bottom: 4px;
  font-family: "Cinzel", serif;
  line-height: 1.2;
}

.book-recipe-tag {
  text-align: center;
  color: #8d6e63;
  font-size: 0.9rem;
  margin-bottom: 6px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.book-recipe-compat {
  text-align: center;
  color: #7b4c2d;
  font-size: 0.85rem;
  margin-bottom: 12px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  background: rgba(123, 76, 45, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* Community rating widget (recipe book right page) */
.rr-widget {
  text-align: center;
  margin: 0 0 12px;
}
.rr-widget .rr-summary {
  margin: 0;
  color: #7b5b3a;
  font:
    700 12px/1.3 "Cormorant Garamond",
    serif;
}

.checklist-title {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #5b311d;
  font-family: "Cinzel", serif;
  font-weight: 700;
}

.checklist-box {
  min-height: 80px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 216, 167, 0.5) transparent;
}

.checklist-box::-webkit-scrollbar {
  width: 4px;
}

.checklist-box::-webkit-scrollbar-thumb {
  background: rgba(255, 216, 167, 0.5);
  border-radius: 3px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: #4b2a1b;
  border-bottom: 1px solid rgba(92, 61, 39, 0.1);
  padding: 6px 4px;
}

.check-item:last-child {
  border-bottom: none;
}

.check-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  flex-wrap: wrap;
}

.check-item-name input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4fa64f;
}

.check-item-name input[type="checkbox"]:disabled {
  opacity: 1;
  cursor: default;
}

.check-item-short {
  font-size: 0.75rem;
  font-weight: 500;
  color: #b85d4f;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.check-item-have {
  font-size: 0.75rem;
  font-weight: 500;
  color: #4fa64f;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.check-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
  margin-left: auto;
}

.check-mark.has {
  background: linear-gradient(135deg, #4fa64f, #3d8b3d);
  color: #fff;
  box-shadow: 0 2px 4px rgba(79, 166, 79, 0.3);
}

.check-mark.missing {
  background: transparent;
  color: #c9a9a9;
  border: 2px solid #d4c4b5;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.check-status {
  display: none;
}

.low-qty-warning {
  display: block;
  font-size: 0.65rem;
  color: #f0ad4e;
  margin-top: 2px;
  font-weight: 600;
}

/* Servings Control */
.servings-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
}

.servings-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 207, 0.7);
  background: linear-gradient(145deg, #c8874f, #7a3e20);
  color: #fff8ec;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 5px 12px rgba(91, 45, 24, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.servings-btn:hover {
  filter: saturate(1.15) brightness(1.06);
  transform: translateY(-2px);
  box-shadow:
    0 8px 16px rgba(91, 45, 24, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.35);
}

.servings-btn:active {
  transform: translateY(0) scale(0.96);
}

#servingsDisplay {
  font-size: 0.95rem;
  font-weight: 600;
  color: #5e3418;
  min-width: 100px;
  text-align: center;
}

.book-actions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 2;
}

.book-add-missing-btn,
.book-start-cooking-btn {
  min-height: 48px;
  border: 1px solid rgba(116, 62, 31, 0.35);
  border-radius: 10px;
  background: linear-gradient(145deg, #a96535, #713719);
  color: #fff8ec;
  font-size: 0.74rem;
  font-weight: bold;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow:
    0 6px 14px rgba(91, 45, 24, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.24);
  font-family: "Cinzel", serif;
  letter-spacing: 0.03em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  flex: 1 1 0;
  width: auto;
  max-width: none;
}
.book-start-cooking-btn {
  width: auto;
  background: linear-gradient(145deg, #d87348, #a8472a);
  border-color: rgba(139, 55, 31, 0.4);
}

.book-add-missing-btn {
  background: rgba(255, 248, 236, 0.8);
  color: #7a3e20;
}

.book-add-missing-btn:hover,
.book-start-cooking-btn:hover {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-2px);
  box-shadow:
    0 10px 20px rgba(91, 45, 24, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.3);
}

.book-add-missing-btn:active,
.book-start-cooking-btn:active {
  transform: translateY(0) scale(0.98);
}

.servings-btn:focus-visible,
.book-add-missing-btn:focus-visible,
.book-start-cooking-btn:focus-visible,
.favoriteBtn:focus-visible,
.back-to-recipes-btn:focus-visible,
.add-recipe-btn:focus-visible,
.my-recipes-link-btn:focus-visible {
  outline: 3px solid rgba(214, 111, 72, 0.48);
  outline-offset: 3px;
}

.cooking-title {
  color: #fff5e5;
  font-size: 28px;
  margin-bottom: 24px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  text-align: center;
  text-shadow:
    0 0 24px rgba(255, 180, 100, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.03em;
}

.cooking-card {
  width: min(92vw, 560px);
  background: linear-gradient(
    135deg,
    rgba(80, 45, 25, 0.82) 0%,
    rgba(55, 28, 15, 0.78) 35%,
    rgba(35, 18, 10, 0.85) 100%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 220, 170, 0.3);
  border-radius: 32px;
  box-shadow:
    0 0 50px rgba(255, 170, 90, 0.18),
    0 0 100px rgba(255, 140, 70, 0.12),
    inset 0 0 80px rgba(255, 190, 130, 0.06),
    0 25px 70px rgba(0, 0, 0, 0.45);
  padding: 32px 28px 28px;
  position: relative;
  overflow: hidden;
  animation: cookingGlowPulse 5s ease-in-out infinite;
}

.cooking-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    135deg,
    rgba(255, 190, 100, 0.5),
    rgba(255, 140, 60, 0.25),
    rgba(255, 190, 100, 0.5)
  );
  border-radius: 32px;
  z-index: -1;
  filter: blur(12px);
  opacity: 0.7;
}

.cooking-card::after {
  content: "";
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 180%;
  height: 180%;
  background: radial-gradient(
    ellipse at top,
    rgba(255, 200, 120, 0.12) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: -1;
}

@keyframes cookingGlowPulse {
  0%,
  100% {
    box-shadow:
      0 0 50px rgba(255, 170, 90, 0.18),
      0 0 100px rgba(255, 140, 70, 0.12),
      inset 0 0 80px rgba(255, 190, 130, 0.06),
      0 25px 70px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow:
      0 0 70px rgba(255, 170, 90, 0.28),
      0 0 120px rgba(255, 140, 70, 0.18),
      inset 0 0 100px rgba(255, 190, 130, 0.1),
      0 25px 70px rgba(0, 0, 0, 0.45);
  }
}

.cooking-video-container {
  margin-bottom: 24px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(20, 10, 5, 0.5));
  box-shadow:
    0 0 30px rgba(255, 100, 80, 0.15),
    0 0 60px rgba(255, 80, 60, 0.1),
    inset 0 0 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 180, 150, 0.2);
}

.cooking-youtube-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

.cooking-video-container::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    135deg,
    rgba(255, 120, 80, 0.3),
    rgba(255, 80, 60, 0.1),
    rgba(255, 120, 80, 0.3)
  );
  border-radius: 20px;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
  animation: videoGlowPulse 3s ease-in-out infinite;
}

@keyframes videoGlowPulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
}

.cooking-no-video {
  text-align: center;
  padding: 35px 25px;
  color: #f5dcb8;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  font-style: italic;
  background: linear-gradient(
    135deg,
    rgba(255, 200, 150, 0.06),
    rgba(255, 180, 120, 0.04)
  );
  border-radius: 18px;
  border: 1px dashed rgba(255, 180, 120, 0.35);
  margin-bottom: 20px;
  box-shadow: inset 0 0 30px rgba(255, 180, 100, 0.05);
  line-height: 1.6;
}

.cooking-no-video br {
  margin-top: 8px;
}

.cooking-steps-header {
  color: #ffd5a0;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin: 20px 0 16px;
  text-shadow: 0 0 15px rgba(255, 200, 130, 0.4);
  letter-spacing: 0.05em;
}

.cooking-steps {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 180, 100, 0.4) transparent;
}

.cooking-steps::-webkit-scrollbar {
  width: 6px;
}

.cooking-steps::-webkit-scrollbar-thumb {
  background: rgba(255, 180, 100, 0.4);
  border-radius: 3px;
}

.cooking-step {
  background: linear-gradient(
    135deg,
    rgba(255, 244, 231, 0.06) 0%,
    rgba(255, 220, 180, 0.04) 100%
  );
  border: 1px solid rgba(255, 210, 160, 0.18);
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 12px;
  color: #fff5e5;
  font-size: 1.02rem;
  line-height: 1.45;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  box-shadow:
    inset 0 1px 2px rgba(255, 230, 200, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
  position: relative;
}

.cooking-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 200, 130, 0.4),
    transparent
  );
  opacity: 0.5;
}

.cooking-step:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 244, 231, 0.1) 0%,
    rgba(255, 220, 180, 0.07) 100%
  );
  border-color: rgba(255, 200, 130, 0.3);
  transform: translateX(4px);
  box-shadow:
    inset 0 1px 2px rgba(255, 230, 200, 0.12),
    0 6px 16px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(255, 180, 100, 0.15);
}

.cooking-step strong {
  font-family: "Cinzel", serif;
  color: #ffd5a0;
  text-shadow: 0 0 12px rgba(255, 200, 130, 0.4);
}

.cooking-step strong {
  font-family: "Cinzel", serif;
  color: #ffe8c5;
}

.cooking-panel-body {
  padding: 4px 2px 8px;
}

.cooking-panel-warning {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e0b56a;
  border-radius: 15px;
  background: linear-gradient(180deg, #fdf0cf, #f9e4b1);
  color: #6d4a1d;
  font:
    700 13px/1.45 "Cormorant Garamond",
    serif;
  box-shadow: 0 5px 12px rgba(76, 50, 31, 0.12);
}

.cooking-video-wrap {
  overflow: hidden;
  margin-bottom: 16px;
  border: 6px solid rgba(255, 220, 170, 0.2);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow:
    0 0 30px rgba(255, 100, 80, 0.12),
    inset 0 0 40px rgba(0, 0, 0, 0.3);
  aspect-ratio: 16 / 9;
}

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

.cooking-step-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 10px;
}

.cooking-step-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 220, 170, 0.18);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition:
    width 220ms ease,
    background-color 220ms ease;
}

.cooking-step-dot.is-done {
  background: #bd8f5c;
}

.cooking-step-dot.is-current {
  width: 24px;
  background: #e8a34a;
  box-shadow: 0 0 12px rgba(255, 180, 100, 0.6);
}

.cooking-step-label {
  margin: 0 0 12px;
  color: #ffd5a0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(255, 200, 130, 0.4);
}

.cooking-step-card {
  display: flex;
  min-height: 226px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 26px;
  border: 1px solid rgba(255, 210, 160, 0.25);
  border-radius: 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 244, 231, 0.08) 0%,
    rgba(255, 220, 180, 0.05) 100%
  );
  box-shadow:
    inset 0 1px 2px rgba(255, 230, 200, 0.1),
    0 12px 26px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.cooking-step-flourish {
  color: #e8a34a;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 180, 100, 0.7);
}

.cooking-step-number {
  display: block;
  margin-top: 9px;
  color: #ffd5a0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 200, 130, 0.4);
}

.cooking-step-copy {
  margin: 14px auto 0;
  max-width: 340px;
  color: #fff5e5;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.5;
}

.cooking-step-nav {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.cooking-nav-btn {
  flex: 1;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 18px;
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.cooking-nav-btn:active {
  transform: scale(0.97);
}

.cooking-nav-btn:focus-visible {
  outline: 3px solid #e8a34a;
  outline-offset: 3px;
}

.cooking-nav-back {
  border: 1px solid rgba(255, 210, 160, 0.4);
  background: linear-gradient(
    135deg,
    rgba(255, 244, 231, 0.1) 0%,
    rgba(255, 220, 180, 0.06) 100%
  );
  color: #ffd5a0;
  box-shadow: inset 0 1px 2px rgba(255, 230, 200, 0.08);
}

.cooking-nav-back[hidden] {
  display: none;
}

.cooking-nav-next {
  border: 1px solid #c98a3e;
  background: linear-gradient(135deg, #e0a55c, #c98a3e);
  color: #2a1608;
  text-shadow: 0 1px 0 rgba(255, 235, 200, 0.35);
  box-shadow:
    0 0 25px rgba(255, 170, 90, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.3);
}

.cooking-nav-next.is-final {
  border-color: #6b4530;
  background: linear-gradient(135deg, #8a5c3c, #6d4329);
  color: #fff8ec;
  text-shadow: 0 1px 0 rgba(62, 38, 21, 0.22);
  box-shadow:
    inset 0 0 0 3px rgba(214, 173, 122, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.3);
}

.book-3d::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(
    90deg,
    #4a2510 0%,
    #6b3818 20%,
    #8b5a2b 50%,
    #6b3818 80%,
    #4a2510 100%
  );
  border-radius: 4px 0 0 4px;
  transform: translateX(-30px) translateZ(-1px);
  box-shadow:
    inset -2px 0 4px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(0, 0, 0, 0.2);
}

.book-left-inside::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.05) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  border-radius: 0 12px 12px 0;
  pointer-events: none;
}

.book-right-inside::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.03) 50%,
    transparent 100%
  );
  border-radius: 12px 0 0 12px;
  pointer-events: none;
}

@media (max-width: 1000px) {
  .inventory-panel {
    width: 28%;
    left: 20%;
  }

  .recipe-btn {
    width: 27%;
    right: 13%;
  }

  .shopping-panel {
    width: 25%;
    left: 18%;
  }

  .missing-panel {
    width: 25%;
    right: 13%;
  }

  .book-3d {
    width: 100%;
    height: 450px;
  }

  .book-page {
    width: calc(50% - 15px);
  }
}

@media (max-width: 800px) {
  .stash-shell {
    width: 95vw;
  }

  .stash-grid {
    grid-template-columns: repeat(4, 1fr);
    min-height: 300px;
  }

  .stash-header {
    font-size: 1.5rem;
  }

  .book-3d {
    height: 400px;
  }

  .book-page {
    width: calc(50% - 10px);
    padding: 15px 10px 15px 10px;
  }

  .book-recipe-title {
    font-size: 1.2rem;
  }

  .recipe-book-item {
    font-size: 0.95rem;
    padding: 8px 10px;
  }
}

@media (max-width: 700px) {
  .inventory-panel {
    width: 32%;
    left: 16%;
  }

  .recipe-btn {
    width: 31%;
    right: 10%;
  }

  .shopping-panel {
    width: 30%;
    left: 14%;
  }

  .missing-panel {
    width: 30%;
    right: 10%;
  }

  .book-shell {
    width: 94vw;
  }

  .book-recipe-title {
    font-size: 1.4rem;
  }

  .check-item {
    font-size: 0.8rem;
  }
}

.scan-modal-card {
  position: relative;
  max-width: 420px;
  background: linear-gradient(
    180deg,
    rgba(139, 111, 78, 0.96) 0%,
    rgba(100, 75, 53, 0.98) 45%,
    rgba(54, 38, 26, 1) 100%
  );
  border-radius: 28px;
  border: 3px solid rgba(212, 175, 55, 0.92);
  box-shadow:
    0 0 0 2px rgba(61, 40, 23, 0.9),
    0 0 40px rgba(212, 175, 55, 0.35),
    0 20px 70px rgba(0, 0, 0, 0.45);
  padding: 28px 24px 22px;
  overflow: hidden;
}

.scan-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 230, 150, 0.14),
      transparent 30%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(255, 255, 255, 0.08),
      transparent 20%
    );
}

.scan-modal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(255, 210, 120, 0.08);
}

.scan-modal-card .modal-title {
  font-family: "Cinzel", serif;
  font-size: 1.7rem;
  color: #fff8e7;
  margin-bottom: 5px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 2px;
}

.scan-modal-card .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  border: 2px solid #fff8e7;
  color: #fff8e7;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.scan-modal-card .modal-close:hover {
  background: linear-gradient(135deg, #fff8e7 0%, #d4af37 100%);
  color: #4a3728;
  transform: rotate(90deg);
}

/* Camera Box with Enhanced UI */
.scan-camera-box {
  position: relative;
  width: 100%;
  height: 320px;
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border-radius: 15px;
  margin: 15px auto 10px;
  overflow: hidden;
  border: 3px solid #d4af37;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(212, 175, 55, 0.3);
}

.scan-camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Scanning Frame with Vintage Style */
.scan-overlay-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 220px;
  z-index: 2;
}

.scan-overlay-frame::before {
  content: "";
  position: absolute;
  inset: -1000px;
  background: rgba(0, 0, 0, 0.35);
  z-index: -1;
}

.scan-overlay-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  border: 3px solid rgba(212, 175, 55, 0.9);
  border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.38),
    0 0 30px rgba(212, 175, 55, 0.5),
    inset 0 0 30px rgba(212, 175, 55, 0.2);
}

/* Ornate corner decorations */
.scan-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 3;
  pointer-events: none;
}

.scan-corner-tl {
  top: -3px;
  left: -3px;
  border-top: 4px solid #d4af37;
  border-left: 4px solid #d4af37;
  border-radius: 12px 0 0 0;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.scan-corner-tr {
  top: -3px;
  right: -3px;
  border-top: 4px solid #d4af37;
  border-right: 4px solid #d4af37;
  border-radius: 0 12px 0 0;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.scan-corner-bl {
  bottom: -3px;
  left: -3px;
  border-bottom: 4px solid #d4af37;
  border-left: 4px solid #d4af37;
  border-radius: 0 0 0 12px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.scan-corner-br {
  bottom: -3px;
  right: -3px;
  border-bottom: 4px solid #d4af37;
  border-right: 4px solid #d4af37;
  border-radius: 0 0 12px 0;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* Scanning animation line */
.scan-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #d4af37 20%,
    #fff8e7 50%,
    #d4af37 80%,
    transparent 100%
  );
  animation: scanMove 2.5s ease-in-out infinite;
  box-shadow:
    0 0 15px #d4af37,
    0 0 30px rgba(212, 175, 55, 0.8);
  z-index: 4;
  border-radius: 2px;
}

@keyframes scanMove {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

/* Instruction Text */
.scan-instruction {
  text-align: center;
  color: #fff8e7;
  font-size: 15px;
  margin: 12px 0 8px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Scan icon */
.scan-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  display: block;
  fill: #d4af37;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Status Messages */
.scan-status {
  min-height: 50px;
  text-align: center;
  font-size: 14px;
  padding: 12px 15px;
  border-radius: 10px;
  margin: 10px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
}

.scan-status.error {
  color: #fff8e7;
  background: linear-gradient(
    135deg,
    rgba(192, 57, 43, 0.8) 0%,
    rgba(155, 39, 28, 0.9) 100%
  );
  border: 2px solid rgba(255, 248, 231, 0.3);
  box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}

.scan-status.success {
  color: #fff8e7;
  background: linear-gradient(
    135deg,
    rgba(39, 174, 96, 0.8) 0%,
    rgba(27, 149, 73, 0.9) 100%
  );
  border: 2px solid rgba(255, 248, 231, 0.3);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

/* Confirmation toast for newly added scanned item */
.scan-added-toast {
  position: fixed;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -20%) scale(0.96);
  z-index: 99999;
  opacity: 0;
  transition:
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 260ms ease;
  pointer-events: none;
}

.scan-added-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.scan-added-toast .toast-card {
  min-width: 320px;
  max-width: 420px;
  background: linear-gradient(180deg, #f8ecd9 0%, #f1ddb7 60%);
  border-radius: 18px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(212, 175, 55, 0.15);
  border: 3px solid rgba(140, 100, 50, 0.9);
  overflow: hidden;
  font-family: "Cormorant Garamond", serif;
}

.scan-added-toast .toast-header {
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.95),
    rgba(180, 130, 50, 0.95)
  );
  color: #2e1f12;
  padding: 14px 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
}

.scan-added-toast .toast-body {
  display: flex;
  gap: 12px;
  padding: 14px 16px 18px;
  align-items: center;
}

.scan-added-toast img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.scan-added-toast .toast-info {
  display: flex;
  flex-direction: column;
}

.scan-added-toast .toast-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #3b2716;
  margin-bottom: 6px;
}

.scan-added-toast .toast-qty {
  color: #5a3a22;
  font-weight: 600;
}

/* ========== QTY MODAL STYLES ========== */
#scanQtyModal .modal-card {
  position: relative;
  max-width: 450px;
  background: linear-gradient(180deg, #8b6f47 0%, #6b533b 50%, #4a3728 100%);
  border-radius: 25px;
  border: 4px solid #d4af37;
  box-shadow:
    0 0 0 2px #3d2817,
    0 0 40px rgba(212, 175, 55, 0.4),
    0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 25px 25px 20px;
}

#scanQtyModal .modal-title {
  font-family: "Cinzel", serif;
  font-size: 1.6rem;
  color: #fff8e7;
  text-align: center;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 2px;
}

#scanQtyModal .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  border: 2px solid #fff8e7;
  color: #fff8e7;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

#scanQtyModal .modal-close:hover {
  background: linear-gradient(135deg, #fff8e7 0%, #d4af37 100%);
  color: #4a3728;
  transform: rotate(90deg);
}

/* Success checkmark animation */
.scan-success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  display: block;
  animation: successPop 0.5s ease-out;
}

.scan-success-icon circle {
  fill: #27ae60;
  stroke: #fff8e7;
  stroke-width: 3;
}

.scan-success-icon path {
  stroke: #fff8e7;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkDraw 0.6s ease-out 0.2s forwards;
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes checkDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Product Preview Section */
.scan-product-preview {
  text-align: center;
  margin: 10px 0 20px;
  padding: 20px;
  background: linear-gradient(
    145deg,
    rgba(255, 248, 231, 0.15) 0%,
    rgba(139, 111, 71, 0.3) 100%
  );
  border-radius: 15px;
  border: 2px solid rgba(212, 175, 55, 0.5);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.scan-product-preview img {
  max-width: 150px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  border: 3px solid #d4af37;
  box-shadow:
    0 5px 20px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(212, 175, 55, 0.2);
  background: #fff8e7;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.scan-product-preview img:hover {
  transform: scale(1.05);
}

.scan-product-preview h3 {
  margin: 15px 0 5px;
  color: #fff8e7;
  font-size: 1.4rem;
  font-family: "Cinzel", serif;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.product-category {
  color: #d4af37;
  font-size: 12px;
  font-family: "Cormorant Garamond", serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

/* Form Section */
.scan-form-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
}

/* Quantity Input Section */
.qty-label {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.qty-label:last-of-type {
  margin-bottom: 0;
}

.qty-label span {
  margin-bottom: 6px;
  color: #d4af37;
  font-size: 13px;
  font-weight: 600;
  font-family: "Cormorant Garamond", serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qty-label input,
.qty-label select {
  padding: 12px 15px;
  border: 2px solid rgba(212, 175, 55, 0.5);
  border-radius: 10px;
  font-size: 16px;
  font-family: "Cormorant Garamond", serif;
  background: rgba(255, 248, 231, 0.95);
  color: #4a3728;
  transition: all 0.3s ease;
}

.qty-label input:focus,
.qty-label select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.3),
    0 0 15px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.qty-label input[type="number"] {
  text-align: center;
  font-weight: 600;
  font-size: 18px;
}

/* Input row for qty and unit */
.input-row {
  display: flex;
  gap: 12px;
}

.input-row .qty-label {
  flex: 1;
  margin-bottom: 0;
}

/* Modal Actions */
.modal-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.modal-actions .save-btn {
  flex: 2;
  padding: 15px 25px;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 50%, #d4af37 100%);
  color: #4a3728;
  border: 2px solid #fff8e7;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Cinzel", serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 4px 15px rgba(212, 175, 55, 0.4),
    inset 0 1px 0 rgba(255, 248, 231, 0.5);
}

.modal-actions .save-btn:hover {
  background: linear-gradient(135deg, #e5c056 0%, #d4af37 50%, #e5c056 100%);
  transform: translateY(-2px);
  box-shadow:
    0 6px 25px rgba(212, 175, 55, 0.6),
    inset 0 1px 0 rgba(255, 248, 231, 0.5);
}

.modal-actions .save-btn:active {
  transform: translateY(0);
}

.modal-actions .cancel-btn {
  flex: 1;
  padding: 15px 20px;
  background: linear-gradient(
    135deg,
    rgba(120, 100, 80, 0.6),
    rgba(80, 60, 40, 0.5)
  );
  color: #d7ccc8;
  border: 1px solid rgba(255, 220, 184, 0.2);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: "Cinzel", serif;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal-actions .cancel-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(140, 120, 100, 0.7),
    rgba(100, 80, 60, 0.6)
  );
  transform: translateY(-1px);
}

.modal-actions .cancel-btn:active {
  transform: translateY(0);
}

/* Deduct-confirmation modal (post-cook pantry preview) */
.deduct-subtitle {
  margin: -6px 0 14px;
  font-size: 13px;
  color: #d7ccc8;
  text-align: center;
}

.deduct-preview-list {
  max-height: 45vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px;
}

.deduct-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 230, 196, 0.08);
  border: 1px solid rgba(255, 230, 196, 0.15);
  font-size: 14px;
  color: #fff8e7;
}

.deduct-preview-row.is-removed {
  border-color: rgba(255, 140, 100, 0.35);
  background: rgba(180, 70, 40, 0.15);
}

.deduct-preview-row.is-skipped {
  opacity: 0.75;
}

.deduct-item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deduct-item-change {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.deduct-before {
  color: #bcaaa4;
  text-decoration: line-through;
  text-decoration-color: rgba(188, 170, 164, 0.6);
}

.deduct-arrow {
  color: #d4af37;
}

.deduct-after {
  color: #e5c056;
  font-weight: 700;
}

.deduct-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.deduct-badge.removed {
  background: rgba(200, 80, 50, 0.35);
  color: #ffab91;
  border: 1px solid rgba(255, 140, 100, 0.4);
}

.deduct-badge.skipped {
  background: rgba(120, 100, 80, 0.4);
  color: #d7ccc8;
  border: 1px solid rgba(255, 220, 184, 0.2);
  text-transform: none;
}

.deduct-preview-empty {
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: #bcaaa4;
}

/* Scan success pulse animation on camera box */
.scan-camera-box.scan-success {
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(39, 174, 96, 0.8);
  }
  100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
}

.shopping-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.shopping-actions .action-btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.shopping-actions .action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.shopping-actions .action-btn.pantry-add-btn {
  background: #4caf50;
}

.shopping-actions .action-btn.remove-checked-btn {
  background: #f44336;
}

.shopping-actions .action-btn.select-all-btn {
  background: #2196f3;
  color: white;
}

/* ========================================
   USER RECIPES STYLES
   ======================================== */

/* My Recipes Link Button (in main recipe book) */
.my-recipes-link-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 248, 236, 0.84);
  color: #713719;
  border: 1px solid rgba(113, 55, 25, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Cinzel", serif;
  box-shadow:
    0 4px 10px rgba(91, 45, 24, 0.14),
    inset 0 1px rgba(255, 255, 255, 0.75);
}

.my-recipes-link-btn:hover {
  background: #fff8ec;
  transform: translateY(-50%) translateY(-2px);
  box-shadow:
    0 7px 16px rgba(91, 45, 24, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.9);
}

/* Add Recipe Button (in my recipes view) */
.add-recipe-btn {
  background: linear-gradient(145deg, #79c878, #3e985d);
  color: white;
  border: 1px solid rgba(42, 112, 59, 0.3);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Cinzel", serif;
  box-shadow:
    0 5px 12px rgba(44, 107, 58, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.3);
}

.add-recipe-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 18px rgba(44, 107, 58, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.4);
  background: linear-gradient(145deg, #8bd68a, #4da968);
}

/* User Recipes Section */
.user-recipes-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid rgba(255, 180, 100, 0.3);
}

.user-recipes-title {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd89d;
  margin-bottom: 12px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-recipe-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0 4px;
}

.user-recipe-list::-webkit-scrollbar {
  width: 6px;
}

.user-recipe-list::-webkit-scrollbar-thumb {
  background: rgba(255, 180, 100, 0.3);
  border-radius: 3px;
}

.user-recipe-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(107, 60, 33, 0.6),
    rgba(74, 40, 21, 0.5)
  );
  border: 1px solid rgba(255, 220, 184, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.user-recipe-card:hover {
  transform: translateX(4px);
  border-color: rgba(255, 180, 100, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-recipe-name {
  flex: 1;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffd89d;
}

.user-recipe-meta {
  font-size: 0.75rem;
  color: #bcaaa4;
  white-space: nowrap;
}

.user-recipe-delete {
  background: linear-gradient(135deg, #ef5350, #e53935);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  visibility: hidden;
}

.user-recipe-card:hover .user-recipe-delete {
  opacity: 1;
  visibility: visible;
}

.user-recipe-delete:hover {
  background: linear-gradient(135deg, #e57373, #ef5350);
  transform: scale(1.05);
}

/* User Recipe Form */
.user-recipe-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.user-recipe-form span {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffd89d;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.user-recipe-form input[type="text"] {
  padding: 10px 14px;
  border: 1px solid rgba(255, 180, 100, 0.3);
  border-radius: 8px;
  background: rgba(255, 244, 231, 0.05);
  color: #ffd89d;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.user-recipe-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(255, 180, 100, 0.6);
  box-shadow: 0 0 12px rgba(255, 180, 100, 0.2);
}

.user-recipe-form textarea {
  padding: 10px 14px;
  border: 1px solid rgba(255, 180, 100, 0.3);
  border-radius: 8px;
  background: rgba(255, 244, 231, 0.05);
  color: #ffd89d;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  resize: vertical;
  transition: all 0.2s;
}

.user-recipe-form textarea:focus {
  outline: none;
  border-color: rgba(255, 180, 100, 0.6);
  box-shadow: 0 0 12px rgba(255, 180, 100, 0.2);
}

.user-recipe-form textarea::placeholder {
  color: rgba(255, 216, 157, 0.4);
}

/* Book search wrap with button */
.book-search-wrap {
  position: relative;
  margin-bottom: 15px;
}

.book-search-wrap .book-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 180, 100, 0.3);
  border-radius: 8px;
  background: rgba(255, 244, 231, 0.05);
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  padding-right: 100px;
}

.book-search-wrap .book-search:focus {
  outline: none;
  border-color: rgba(255, 180, 100, 0.6);
  box-shadow: 0 0 12px rgba(255, 180, 100, 0.2);
}

/* My Recipes View Header */
.my-recipes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.back-to-recipes-btn {
  background: rgba(255, 248, 236, 0.78);
  color: #713719;
  border: 1px solid rgba(113, 55, 25, 0.25);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  font-family: "Cinzel", serif;
}

.back-to-recipes-btn:hover {
  background: #fff8ec;
  transform: translateX(-3px);
  box-shadow: 0 6px 14px rgba(91, 45, 24, 0.18);
}

.my-recipes-title {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  color: #ffd89d;
  margin-bottom: 12px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.favoriteBtn {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 48px;
  height: 48px;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 244, 231, 0.95),
    rgba(255, 230, 200, 0.9)
  );
  color: #b85d4f;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    0 4px 12px rgba(184, 93, 79, 0.25),
    0 0 0 2px rgba(184, 93, 79, 0.15);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.favoriteBtn:hover {
  color: #ff6b6b;
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.7),
    0 6px 18px rgba(255, 107, 107, 0.35),
    0 0 0 3px rgba(255, 107, 107, 0.25),
    0 0 20px rgba(255, 107, 107, 0.4);
}

.favoriteBtn:active {
  transform: scale(0.95);
}

.favoriteBtn.favorited {
  color: #ff4757;
  background: linear-gradient(135deg, #fff5f5, #ffe0e0);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    0 4px 15px rgba(255, 71, 87, 0.4),
    0 0 0 3px rgba(255, 71, 87, 0.3),
    0 0 25px rgba(255, 71, 87, 0.4);
  animation: heartPulse 0.6s ease-out;
}

@keyframes heartPulse {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

.floating-heart {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 18px;
  color: #ff5a78;
  text-shadow: 0 0 16px rgba(255, 90, 120, 0.7);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  transition:
    transform 0.9s ease-out,
    opacity 0.9s ease-out;
  z-index: 9999;
}

.favoriteBtn::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255, 200, 130, 0.3),
    transparent,
    rgba(255, 150, 80, 0.3),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  animation: rotate 8s linear infinite;
}

.favoriteBtn.favorited::before {
  opacity: 0.5;
}

.favoriteBtn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -25px;
  left: 45%;
  transform: translateX(-50%);
  background: rgba(60, 40, 30, 0.95);
  color: #ffd89d;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: "Cinzel", serif;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.favoriteBtn:hover::after {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .add-recipe-btn {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 10px;
  }

  .my-recipes-header {
    flex-direction: column;
  }

  .back-to-recipes-btn {
    width: 100%;
  }

  .book-search-wrap .book-search {
    padding-right: 14px;
  }

  .my-recipes-link-btn {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 10px;
  }
}

.shopping-item .side-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shopping-item .shopping-item-details {
  flex: 1;
}

.item-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.side-card.checked .side-name {
  text-decoration: line-through;
  color: #888;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .scan-modal-card,
  #scanQtyModal .modal-card {
    max-width: 92vw;
    padding: 20px 15px 15px;
  }

  .scan-camera-box {
    height: 280px;
  }

  .scan-overlay-frame {
    width: 180px;
    height: 180px;
  }

  .scan-product-preview img {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
  }

  .input-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Responsive adjustments */
/* Hide tutorial buttons (floating button and top navigation) */
.tutorial-start-btn {
  display: none !important;
}

.tutorial-nav-btn,
#tutorialNavBtn {
  display: none !important;
}

@media (max-width: 768px) {
  .shopping-actions {
    gap: 6px;
  }

  .shopping-actions .action-btn {
    padding: 6px 10px;
    font-size: 10px;
  }

  .pantry-add-item-row {
    flex-wrap: wrap;
  }

  .pantry-add-item-row .qty-input,
  .pantry-add-item-row .unit-input {
    width: 100%;
  }
}

/* Respect user's reduced motion preference: disable animations/transitions */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1024px), (max-aspect-ratio: 4/3) {
  .stash-items-area {
    position: absolute;
    top: 205px;
    left: 422px;
    width: 505px;
    height: 420px;
    z-index: 10;
  }
  .stash-grid {
    display: grid;
    grid-template-columns: repeat(4, 105px);
    grid-template-rows: repeat(5, 140px);
    gap: 7px;
    padding: 15px;
    width: 100%;
    height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    align-content: start;
  }

  .stash-categories {
    position: absolute;
    top: 185px;
    left: 146px;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 10;
  }

  .stash-sort {
    position: absolute;
    top: 150px;
    left: 322px;
    z-index: 10;
  }

  .stash-close-button {
    position: absolute;
    top: 25px;
    right: 10px;
    width: 100px;
    height: 60px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: medium;
    border-style: none;
    border-color: currentcolor;
    border-image: none;
    background: transparent;
    border-radius: 50%;
    padding: 0px;
    transition:
      transform 0.2s,
      box-shadow 0.2s;
  }
  .bg-frame {
    position: fixed;
    inset: 0;
    width: 103%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    z-index: 0;
  }
  .book-right-page {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 120px);
  }
}

/* Post-cook rating modal */
.rating-card {
  width: min(92vw, 430px);
  text-align: center;
}
.rating-dialog-image {
  width: 104px;
  height: 104px;
  margin: 0 auto 14px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 230, 196, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.rating-dialog-copy {
  color: #ffe8c8;
  font-size: 15px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}
.rating-dialog-copy strong {
  color: #ffd98e;
  font-weight: 700;
}
.rating-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.rating-star {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 230, 196, 0.35);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 150ms ease,
    color 150ms ease;
}
.rating-star.is-active {
  color: #f0a63c;
  text-shadow: 0 2px 6px rgba(255, 180, 100, 0.5);
  transform: scale(1.1);
}
.rating-star:focus-visible {
  outline: 3px solid rgba(255, 200, 130, 0.7);
  outline-offset: 2px;
}
.rating-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 18px;
}
.rating-actions .save-btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}
.rating-actions .save-btn:disabled:hover {
  transform: none;
}
