:root {
  --bg-primary: #2F3234;
  --bg-surface: #242729;
  --bg-surface-2: #1c1e20;
  --border-subtle: #3d4246;
  --accent-primary: #D2B78A;
  --accent-soft: #EAE0C8;
  --text-main: #f4f5f6;
  --text-muted: #b3b9bf;
  --ok-green: #38a169;
  --warn-amber: #d69e2e;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --btn-radius: 8px;
  --products-cols: 1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
}

body.privacy-blur .protected-zone {
  filter: blur(8px);
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
}

.logo .author {
  color: var(--accent-primary);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-input {
  background: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  font-size: 13px;
  min-width: 170px;
}

.pill-btn {
  background: var(--bg-surface-2);
  color: var(--accent-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pill-btn.active-accent {
  background: var(--accent-primary);
  color: #181a1c;
  border-color: var(--accent-primary);
}

.nav-bar {
  background: var(--bg-surface-2);
  border-top: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.nav-drop {
  position: relative;
  display: inline-block;
}

.nav-drop-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px;
  z-index: 60;
}

.nav-drop:hover .nav-drop-menu {
  display: block;
}

.drop-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text-main);
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.drop-item:hover {
  background: var(--accent-primary);
  color: #181a1c;
  font-weight: 600;
}

.nav-item {
  background: transparent;
  color: var(--text-main);
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent-primary);
  color: #181a1c;
  font-weight: 600;
}

.nav-item.admin-only,
.nav-item.hidden-sec {
  display: none;
}

.nav-item.admin-only.visible-admin,
.nav-item.hidden-sec.visible-sec {
  display: inline-block;
}

.container {
  max-width: 1240px;
  margin: 22px auto;
  padding: 0 20px 60px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}

.sub-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.hero-kicker {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 10px;
}

/* Колаж-карусель на Головній */
.collage-wrap {
  position: relative;
  margin-bottom: 18px;
}

.collage-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-surface-2);
}

.collage-slide {
  position: relative;
  flex: 0 0 72%;
  min-height: 340px;
  border-radius: 16px;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, #242729 0%, #191b1d 100%);
  display: flex;
  align-items: flex-end;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.collage-slide:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.collage-slide.is-vip-ad {
  border: 2px solid var(--accent-primary);
}

.collage-slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.collage-slide-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 26px;
  background: linear-gradient(180deg, rgba(24, 26, 28, 0.05) 0%, rgba(24, 26, 28, 0.88) 70%, rgba(24, 26, 28, 0.96) 100%);
}

.collage-badge {
  display: inline-block;
  background: rgba(24, 26, 28, 0.85);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.collage-slide.is-vip-ad .collage-badge {
  background: var(--accent-primary);
  color: #181a1c;
}

.collage-slide h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--text-main);
}

.collage-slide p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 680px;
}

.collage-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--accent-primary);
  background: rgba(28, 30, 32, 0.88);
  color: var(--accent-primary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collage-nav-btn:hover {
  background: var(--accent-primary);
  color: #181a1c;
}

.collage-nav-btn.prev {
  left: 12px;
}

.collage-nav-btn.next {
  right: 12px;
}

/* Рекламний банер під колажем */
.home-banner-ad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, var(--bg-surface) 0%, #2a2621 100%);
  border: 1px solid var(--accent-primary);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  cursor: pointer;
}

.home-banner-ad:hover {
  background: linear-gradient(90deg, #282b2e 0%, #322c24 100%);
}

.home-banner-ad-thumb {
  width: 120px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

@media (max-width: 760px) {
  .collage-slide {
    flex: 0 0 90%;
    min-height: 260px;
  }

  .collage-slide h2 {
    font-size: 19px;
  }
}

.btn-beige {
  background: var(--accent-primary);
  color: #181a1c;
  border: none;
  border-radius: var(--btn-radius);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-dark {
  background: var(--bg-surface-2);
  color: var(--accent-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-dark:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-danger {
  border-color: #e53e3e;
  color: #fc8181;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.recipe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.recipe-card.paid-highlight {
  border-color: var(--accent-primary);
}

.thumb-box {
  height: 150px;
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

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

.media-source-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(24, 26, 28, 0.88);
  border: 1px solid var(--accent-primary);
  color: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}

.watermark-tag {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 10px;
  color: rgba(234, 224, 200, 0.65);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

.media-preview-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.media-preview-box img,
.media-preview-box video {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  display: block;
}

.card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meta-line {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.split-2 {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

@media (max-width: 860px) {
  .split-2 {
    grid-template-columns: 1fr;
  }
}

.cat-list-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
}

.cat-list-btn.active {
  background: var(--accent-primary);
  color: #181a1c;
  font-weight: 700;
}

.blurred-box {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.7;
}

.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-pill {
  background: var(--bg-surface-2);
  color: var(--accent-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.tab-pill.active {
  background: var(--accent-primary);
  color: #181a1c;
  font-weight: 700;
}

.nutr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.nutr-cell {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.nutr-cell b {
  display: block;
  color: var(--accent-primary);
  font-size: 15px;
}

.vit-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.vit-chip {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
}

.vit-chip.pick-chip {
  cursor: pointer;
}

.vit-chip.on {
  background: var(--accent-primary);
  color: #181a1c;
  border-color: var(--accent-primary);
  font-weight: 700;
}

.funds-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.fund-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
}

.fund-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--ok-green);
  margin-top: 6px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

input,
select,
textarea {
  background: var(--bg-surface-2);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

input::placeholder,
textarea::placeholder {
  color: #8c949c;
  opacity: 1;
}

.file-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.custom-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  color: var(--accent-soft);
  border: 1px solid var(--accent-primary);
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.custom-file-btn:hover {
  background: var(--accent-primary);
  color: #181a1c;
}

.custom-file-btn input[type="file"] {
  display: none;
}

.file-name-tag {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ing-picker-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
}

.ing-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ing-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--accent-primary);
  color: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.ing-chip button {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
}

details.acc-item {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

details.acc-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-soft);
  font-size: 13px;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--accent-primary);
  border-radius: 14px;
  padding: 20px;
}

.oauth-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 12px;
}

.footer-cols {
  max-width: 1240px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.footer-cols h4 {
  margin: 0 0 8px;
  color: var(--accent-soft);
  font-size: 13px;
}

.footer-cols a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 5px;
  cursor: pointer;
}

.footer-cols a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-main);
}

body[data-btn-style="outline"] .btn-beige {
  background: transparent;
  color: var(--accent-primary);
  border: 1.5px solid var(--accent-primary);
}

body[data-btn-style="outline"] .btn-beige:hover {
  background: var(--accent-primary);
  color: #181a1c;
}

body[data-btn-style="glow"] .btn-beige {
  box-shadow: 0 0 14px rgba(210, 183, 138, 0.45);
}

/* Вкладка 7: Налаштування (тумблери та таблиця тарифів) */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.switch-card:hover {
  border-color: var(--accent-primary);
}

.switch-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.switch-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-pill {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #3d4246;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.toggle-pill::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f5f6;
  transition: transform 0.2s ease;
}

.toggle-pill.on {
  background: var(--ok-green);
  border-color: var(--ok-green);
}

.toggle-pill.on::after {
  transform: translateX(20px);
}

.tariff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.tariff-row {
  display: grid;
  grid-template-columns: 1fr 120px 100px 90px;
  gap: 10px;
  align-items: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
}

.tariff-row-head {
  background: transparent;
  border: none;
  padding: 0 14px 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tariff-row input {
  width: 100%;
  text-align: center;
}

@media (max-width: 720px) {
  .tariff-row {
    grid-template-columns: 1fr 1fr;
  }

  .tariff-row-head {
    display: none;
  }
}

#acc-about-blog > .acc-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-2, #18191c);
  color: var(--text-main, #f2efe9);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Сетка карточек продуктов (управляется из админки) */
#allProductsCardsContainer,
#productsCardsContainer {
  display: grid;
  grid-template-columns: repeat(var(--products-cols, 1), minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

#allProductsCardsContainer .sub-card,
#productsCardsContainer .sub-card {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body[data-products-cols="2"] #allProductsCardsContainer .nutr-grid,
body[data-products-cols="2"] #productsCardsContainer .nutr-grid,
body[data-products-cols="3"] #allProductsCardsContainer .nutr-grid,
body[data-products-cols="3"] #productsCardsContainer .nutr-grid,
body[data-products-cols="4"] #allProductsCardsContainer .nutr-grid,
body[data-products-cols="4"] #productsCardsContainer .nutr-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 1100px) {
  body[data-products-cols="3"] #allProductsCardsContainer,
  body[data-products-cols="3"] #productsCardsContainer,
  body[data-products-cols="4"] #allProductsCardsContainer,
  body[data-products-cols="4"] #productsCardsContainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #allProductsCardsContainer,
  #productsCardsContainer {
    grid-template-columns: 1fr !important;
  }
}

/* Размытие значений КБЖУ и матриц витаминов/минералов */
.nutr-val-blur {
  filter: blur(5px);
  opacity: 0.55;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  display: inline-block;
}

.matrix-locked-wrap {
  position: relative;
  margin-top: 4px;
}

.matrix-blurred-chips {
  filter: blur(5px);
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
}

.prod-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.prod-unlock-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#allProductsCardsContainer .media-preview-box,
#productsCardsContainer .media-preview-box {
  margin: 8px 0;
  gap: 0;
}

#allProductsCardsContainer .media-preview-box img,
#productsCardsContainer .media-preview-box img {
  width: 100%;
  height: 220px;
  max-height: 220px;
  padding: 0;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

body[data-products-cols="2"] #allProductsCardsContainer .media-preview-box img,
body[data-products-cols="2"] #productsCardsContainer .media-preview-box img,
body[data-products-cols="3"] #allProductsCardsContainer .media-preview-box img,
body[data-products-cols="3"] #productsCardsContainer .media-preview-box img,
body[data-products-cols="4"] #allProductsCardsContainer .media-preview-box img,
body[data-products-cols="4"] #productsCardsContainer .media-preview-box img {
  height: 175px;
  max-height: 175px;
  padding: 0;
  object-fit: cover;
}

/* Галерея фото в карточке продукта */
.prod-gallery-wrap {
  position: relative;
  margin: 8px 0;
}

.prod-gallery-next-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accent-primary);
  background: rgba(24, 26, 28, 0.82);
  color: var(--accent-soft);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.prod-gallery-next-btn:hover {
  background: var(--accent-primary);
  color: #181a1c;
  transform: translateY(-50%) scale(1.06);
}

.prod-gallery-counter {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 6;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-soft);
  background: rgba(24, 26, 28, 0.78);
  border: 1px solid rgba(210, 183, 138, 0.45);
  pointer-events: none;
}

/* Список фото с выбором Автор / ШІ в модалках */
.photo-sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 10px;
}

.photo-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.photo-source-thumb {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.photo-source-choices {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.photo-source-choices label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--accent-soft);
}

/* Миниатюра фото продукта внутри чипа ингредиента */
.ing-chip-with-thumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
}

.ing-chip-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  flex-shrink: 0;
}

.ing-chip-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px dashed var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* Карточки рецептов в каталоге */
section:not(#sec-products) .recipe-card .thumb-box {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

section:not(#sec-products) .recipe-card .thumb-box img,
section:not(#sec-products) .recipe-card .thumb-box .prod-gallery-wrap {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

/* Список ингредиентов с мини-фото */
.recipe-ing-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-ing-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recipe-ing-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recipe-ing-thumb-empty {
  color: var(--text-muted);
  font-size: 16px;
}

/* Соцсети и кнопки действий */
.social-links-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.social-links-inputs > div {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .social-links-inputs {
    grid-template-columns: 1fr;
  }
}

.recipe-social-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 10px;
}

.social-video-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fav-btn.fav-active {
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
}

/* Раздел «Зошит» и пометки автора */
.notebook-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
}

.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.heart-btn.heart-active {
  border-color: #ff6b81 !important;
  color: #ff6b81 !important;
  background: rgba(255, 107, 129, 0.12) !important;
}

.mark-priority-btn.is-on {
  border-color: #ff6b81 !important;
  color: #ff6b81 !important;
  background: rgba(255, 107, 129, 0.14) !important;
}

.mark-interest-btn.is-on {
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
  background: rgba(215, 184, 138, 0.16) !important;
}

/* Админка: конструктор с боковым меню */
.builder-workspace {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.builder-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 112px;
}

.builder-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.builder-nav-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-2);
}

.builder-nav-btn.active {
  border-color: var(--accent-primary);
  background: rgba(215, 184, 138, 0.14);
}

.builder-nav-ico {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.builder-nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.builder-nav-text b {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.builder-nav-btn.active .builder-nav-text b {
  color: var(--accent-primary);
}

.builder-nav-text small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.builder-content {
  min-width: 0;
}

.builder-pane {
  display: none;
}

.builder-pane.active {
  display: block;
}

.builder-pane-head {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 860px) {
  .builder-workspace {
    grid-template-columns: 1fr;
  }
  .builder-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

/* Раздел «Що є у Холодильнику» */
.fridge-layout {
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  align-items: start;
}

.fridge-control-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fridge-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.fridge-field-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.fridge-search-inp {
  width: 100%;
}

.fridge-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fridge-chips-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.fridge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-main);
}

.fridge-chip button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
}

.fridge-chip button:hover {
  color: var(--warn-amber);
}

.fridge-mini-thumb,
.fridge-missing-thumb,
.fridge-cart-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-surface-2);
}

.fridge-mini-thumb-empty,
.fridge-missing-thumb-empty,
.fridge-cart-thumb-empty {
  display: inline-block;
  background: var(--bg-surface);
}

.fridge-cart-thumb,
.fridge-missing-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.fridge-basic-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.fridge-basic-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fridge-basic-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fridge-basic-tags span {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--accent-soft);
}

.fridge-params-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fridge-cart-panel {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.fridge-cart-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.fridge-cart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fridge-cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.fridge-cart-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.fridge-cart-item-info {
  min-width: 0;
}

.fridge-cart-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fridge-cart-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.fridge-section-heading {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--accent-primary);
}

.fridge-result-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
}

.fridge-match-ok {
  font-size: 12px;
  color: var(--ok-green);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.28);
}

.fridge-missing-block {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.fridge-missing-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fridge-missing-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fridge-missing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fridge-missing-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fridge-missing-name {
  font-size: 12px;
  font-weight: 600;
}

.fridge-missing-grams {
  font-size: 11px;
  color: var(--text-muted);
}

.fridge-empty-block {
  font-size: 13px;
  color: var(--text-muted);
}

.fridge-empty-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.fridge-gate-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .fridge-layout {
    grid-template-columns: 1fr;
  }
}

/* Открытый рецепт, дополнительные фото и видео */
.recipe-view-modal-card {
  width: min(960px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
}

.recipe-detail-media-stage {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 10px 0 14px;
}

.recipe-detail-media-stage.single {
  grid-template-columns: minmax(0, 440px);
}

.recipe-detail-main-photo {
  width: 100%;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.recipe-detail-main-img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  display: block;
}

.recipe-detail-photo-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.recipe-extra-photos-block {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.recipe-extra-photos-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.recipe-extra-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}

.recipe-extra-photo-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.recipe-extra-photo-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.recipe-extra-photo-frame {
  width: 100%;
  height: 112px;
  overflow: hidden;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
}

.recipe-extra-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-extra-photo-meta {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-extra-photo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-extra-photo-src {
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Центрирование видео внизу открытого рецепта */
#recipeViewModalBody video {
  display: block;
  margin: 10px auto 6px;
  width: 100%;
  max-width: 360px;
  max-height: 440px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-surface-2);
}

/* Лайтбокс просмотра фото */
.recipe-photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.86);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.recipe-photo-lightbox.open {
  display: flex;
}

.recipe-photo-lightbox-inner {
  position: relative;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.recipe-photo-lightbox-inner img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.recipe-photo-lightbox-caption {
  font-size: 12px;
  color: var(--accent-soft);
  text-align: center;
}

.recipe-photo-lightbox-close {
  align-self: flex-end;
}

@media (max-width: 760px) {
  .recipe-detail-media-stage,
  .recipe-detail-media-stage.single {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #recipeViewModal {
    padding: 0;
  }

  .recipe-view-modal-card {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 12px 14px 24px;
  }

  #recipeViewModalBody video {
    max-width: 100%;
  }

  #closeRecipeViewBtn {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

/* ===== АДМІНКА: ВКЛАДКА 10. ІДЕЇ ===== */
.idea-editor-card {
  padding: 16px;
}

.idea-edit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(210, 183, 138, 0.14);
  border: 1px solid var(--accent-primary);
  font-size: 12px;
}

.idea-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.idea-field-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.idea-prod-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.idea-empty-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.idea-filters-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.idea-note-card {
  padding: 14px 16px;
}

.idea-note-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.idea-badges-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 6px;
}

.idea-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--accent-soft);
}

.idea-badge.prio-high {
  border-color: #e53e3e;
  color: #fc8181;
  background: rgba(229, 62, 62, 0.12);
}

.idea-badge.prio-medium {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(210, 183, 138, 0.12);
}

.idea-badge.prio-low {
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.idea-badge.status-ready_to_shoot {
  border-color: var(--ok-green);
  color: #68d391;
  background: rgba(56, 161, 105, 0.12);
}

.idea-badge.status-testing {
  border-color: var(--warn-amber);
  color: #f6ad55;
  background: rgba(214, 158, 46, 0.12);
}

.idea-moved-badge {
  font-size: 11px;
  color: #68d391;
  font-weight: 600;
}

.idea-meta-muted {
  font-size: 11px;
  color: var(--text-muted);
}

.idea-note-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.idea-note-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.idea-note-desc {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
  white-space: pre-line;
}

.idea-note-section {
  margin-top: 10px;
}

.idea-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
  margin-bottom: 5px;
}

.idea-prods-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.idea-prod-tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.idea-note-comment {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-primary);
}

.idea-comment-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-line;
}

.idea-note-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== РОЗШИРЕНА КАРТКА ПРОДУКТУ (41 КОЛОНКА USDA) ===== */
.usda-subhead-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.usda-alt-title {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.usda-core-grid {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)) !important;
  gap: 6px !important;
}

.usda-details-box {
  margin-top: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
}

.usda-details-box summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
}

.usda-details-inner {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usda-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
  margin-bottom: 4px;
}

.usda-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.usda-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
}

.usda-metric-item.is-empty {
  opacity: 0.52;
}

.usda-metric-name {
  color: var(--text-muted);
}

.usda-metric-val {
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
}

.usda-portions-line {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== РЕДАКТОР ДЕТАЛЬНОГО СКЛАДУ ТА ЗНОСКА USDA ===== */
.usda-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 8px;
}

.usda-editor-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.usda-editor-field input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
}

.products-source-disclaimer {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.products-source-disclaimer b {
  color: var(--accent-soft);
}
/* Выравнивание карточек Холодильника */
#fridgeResultsBox .grid-3 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}

#fridgeResultsBox .fridge-result-card {
  min-width: 0 !important;
  max-width: 100% !important;
  width: auto !important;
  margin-bottom: 0 !important;
}

#fridgeResultsBox .fridge-missing-block,
#fridgeResultsBox .fridge-missing-list,
#fridgeResultsBox .fridge-missing-row,
#fridgeResultsBox .fridge-missing-info,
#fridgeResultsBox .fridge-missing-info > div {
  min-width: 0;
  max-width: 100%;
}

#fridgeResultsBox .fridge-missing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

#fridgeResultsBox .fridge-missing-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

#fridgeResultsBox .fridge-missing-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

#fridgeResultsBox .fridge-missing-row .pill-btn,
#fridgeResultsBox .fridge-add-miss-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 5px 9px;
  font-size: 11.5px;
}

@media (max-width: 900px) {
  #fridgeResultsBox .grid-3 {
    grid-template-columns: 1fr !important;
  }
}
/* Рецепти на Головній — в один горизонтальний рядок з прокруткою */
#homeRecipesGrid {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-surface-2);
}

#homeRecipesGrid .recipe-card {
  flex: 0 0 320px;
  max-width: 320px;
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  #homeRecipesGrid .recipe-card {
    flex: 0 0 82vw;
    max-width: 82vw;
  }
}
/* Бейдж «Новий рецепт» на фото (топ-3 рецептів) */
.new-recipe-pill {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--accent-primary);
  color: #181a1c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

/* Іконки особливостей страви (Гостре, Веганське тощо) у картці */
.recipe-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.recipe-tags-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.recipe-tag-ico {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: help;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.recipe-tag-ico:hover {
  transform: scale(1.1);
}

.recipe-tag-ico svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* Підказка при наведенні */
.recipe-tag-ico::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  right: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: #141618;
  color: var(--accent-soft);
  border: 1px solid var(--accent-primary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.recipe-tag-ico:hover::after {
  opacity: 1;
  transform: translateY(0);
}