:root {
  /* Зелена «кухонна» палітра: свіжа зелень і трохи лайма */
  --bg: #0a100c;
  --bg2: #111a14;
  --bg3: #18241c;
  --t1: #eef5ef;
  --t2: #a6b8aa;
  --t3: #7d8e81;
  --br: #24352a;
  --c1: #22c55e;
  --c2: #a3e635;
  --warm: #fbbf24;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f4f8f1;
  --bg2: #ffffff;
  --bg3: #e9f1e6;
  --t1: #14201a;
  --t2: #46584c;
  --t3: #626e65;
  --br: #d6e3d4;
  --c1: #15803d;
  --c2: #65a30d;
  --warm: #d97706;
  --shadow: 0 10px 30px rgba(20, 30, 60, 0.08);
}


* { box-sizing: border-box; }

html, body {
  scrollbar-gutter: stable;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--t1);
}

html {
  min-height: 100%;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

body {
  position: relative;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100%;
  min-height: 100dvh;
  transition: background 0.25s ease, color 0.25s ease;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }

.accent-text {
  background: linear-gradient(90deg, var(--c1), var(--c2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--br);
  background: var(--bg2);
  color: var(--t1);
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
@media (hover: hover) and (pointer: fine) {
.btn:hover { border-color: var(--c1); }
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  border: none;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  color: #08090c;
}
@media (hover: hover) and (pointer: fine) {
.btn-primary:hover { filter: brightness(1.08); }
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--t2); }
@media (hover: hover) and (pointer: fine) {
.btn-ghost:hover { color: var(--t1); }
}
.btn-danger { color: #ff6b6b; border-color: #ff6b6b44; }
@media (hover: hover) and (pointer: fine) {
.btn-danger:hover { border-color: #ff6b6b; background: #ff6b6b11; }
}
.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font-size: 16px;
}
.btn-icon svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  background: var(--bg3);
  border: 1px solid var(--br);
  color: var(--t1);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease;
  width: 100%;
}

input:not(:focus-visible), textarea:not(:focus-visible), select:not(:focus-visible) {
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--c1); }
textarea { resize: none; min-height: 44px; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
label { font-size: 13px; color: var(--t2); font-weight: 600; display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--bg3); border: 1px solid var(--br);
  font-size: 13px; color: var(--t2); cursor: pointer;
  user-select: none; transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
.chip:hover { border-color: var(--c1); color: var(--t1); }
}
.chip.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--c1) 22%, transparent), color-mix(in srgb, var(--c2) 22%, transparent));
  border: none; color: var(--t1);
}
@media (hover: hover) and (pointer: fine) {
.chip.active:hover { border: none; }
}

.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg2); border: 1px solid var(--br); color: var(--t1);
  padding: 12px 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font-size: 14px; opacity: 0; pointer-events: none; transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, transform 0.25s ease; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: #ff6b6b; }

.modal-overlay {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  background: rgba(4, 6, 10, 0.6);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg2); border: 1px solid var(--br); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 88vh;
  max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: 28px; transform: translateY(16px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal h2 { margin-top: 0; }
.modal-close {
  position: absolute; top: 20px; right: 24px; background: none; border: none;
  color: var(--t2); font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.confirm-overlay { z-index: 300; }
.confirm-modal { max-width: 380px; text-align: center; }
.confirm-modal p { color: var(--t2); }

.burger-btn {
  width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--br);
  background: var(--bg2); color: var(--t1); display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
.burger-btn:hover { background: var(--bg3); border-color: var(--c1); }
}
.burger-panel {
  position: fixed; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom)); height: auto; width: 360px; max-width: calc(100vw - 16px);
  background: var(--bg2); border: 1px solid var(--br); z-index: 250; border-radius: 18px;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.28);
  transform: translateX(calc(100% + 16px)); transition: transform 0.25s ease; padding: 20px;
  display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y;
}
.burger-panel.open { transform: translateX(0); }
.burger-backdrop {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  background: rgba(4, 6, 10, 0.5); z-index: 240;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.burger-backdrop.open { opacity: 1; pointer-events: auto; }
.burger-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--br); }
.burger-head h2 { margin: 0; font-family: "Fraunces", serif; font-size: 21px; }
.burger-close { width: 38px; height: 38px; flex: none; display: grid; place-items: center; color: var(--t2); background: var(--bg3); border: 1px solid var(--br); border-radius: 10px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
.burger-close:hover { color: var(--t1); border-color: var(--c1); }
}
.burger-content { flex: 1; overflow-y: auto; padding: 12px 0; }
.burger-group + .burger-group { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--br); }
.burger-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px;
  border-radius: var(--radius-sm); color: var(--t1); text-decoration: none;
  background: none; border: none; font-size: 14px; cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; line-height: 1.4;
}
@media (hover: hover) and (pointer: fine) {
.burger-row:hover { background: var(--bg3); }
}
.burger-row svg, .burger-setting-label svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--t2); }
.burger-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--t3); padding: 2px 10px 7px; }
.burger-setting { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: var(--radius-sm); }
.burger-setting-label { display: inline-flex; align-items: center; gap: 12px; min-width: 0; font-size: 14px; }
.burger-setting .btn-icon { width: 36px; height: 36px; flex: none; }
.burger-setting-wrap { display: block; }
.burger-setting-top { display: flex; align-items: center; justify-content: space-between; min-height: 38px; }
.burger-language { flex-wrap: wrap; }
.burger-footer { flex: none; padding-top: 12px; border-top: 1px solid var(--br); }
.burger-auth-slot { display: none; margin-bottom: 8px; }
.burger-auth-slot .btn { display: flex; justify-content: center; width: 100%; white-space: normal; text-align: center; }
.burger-donate { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--c1) 42%, var(--br)); border-radius: 10px; background: color-mix(in srgb, var(--c1) 9%, var(--bg2)); color: var(--t1); text-decoration: none; font-size: 14px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
.burger-donate:hover { background: color-mix(in srgb, var(--c1) 16%, var(--bg2)); border-color: var(--c1); }
}
.burger-donate svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.burger-donate .donate-heart { color: #ff6b83; }
.burger-donate .donate-external { width: 15px; height: 15px; margin-left: auto; color: var(--t3); }

.palette-btn {
  width: 32px; height: 32px; border: none; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.palette-dropdown {
  display: none; gap: 10px; padding: 12px 0 4px 30px; flex-wrap: wrap;
}
.palette-dropdown.open { display: flex; }
.palette-dot {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
}
.palette-dot.active { border-color: var(--t1); }

.lang-pills { display: flex; gap: 4px; }
.lang-pill {
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 100px;
  background: var(--bg3); border: 1px solid var(--br); color: var(--t3); cursor: pointer;
}
.lang-pill.active {
  color: var(--bg); background: linear-gradient(135deg, var(--c1), var(--c2));
  border: none;
}
.lang-pills { justify-content: flex-end; flex-wrap: wrap; }
.switch-label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; position: relative; width: 20px; height: 20px; flex: none;
  margin: 0; padding: 0; border: 1.5px solid var(--br); border-radius: 6px; background: var(--bg3); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.switch-label input[type="checkbox"]:checked { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; }
.switch-label input[type="checkbox"]::after { content: ""; position: absolute; left: 5px; top: 2px; width: 6px; height: 10px; border: solid #08090c; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 0.12s ease; }
.switch-label input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.switch-label input[type="checkbox"]:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; }

@media (max-width: 480px) {
  .burger-panel {
    top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom)); max-width: calc(100vw - 12px); padding: 16px;
  }
}

@media (max-width: 640px) {
  input, textarea, select, .custom-select-trigger { font-size: 16px; }
}

@media (max-width: 400px) {
  #auth-slot > .btn { display: none; }
  .burger-auth-slot.has-login { display: block; }
}

.user-badge {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 10px 4px 4px; border-radius: 100px; border: 1px solid var(--br); background: var(--bg2);
  min-width: 0; max-width: 100%;
}
.user-badge img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.user-badge span {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 140px;
}

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--t3);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--br); border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }


/* ====== Живий фон: м'які плями зелені й теплого світла та ледь помітні листочки ====== */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

body::before {
  inset: 0;
  background:
    radial-gradient(42vw 42vw at 8% 0%, color-mix(in srgb, var(--c1) 16%, transparent), transparent 70%),
    radial-gradient(36vw 36vw at 100% 18%, color-mix(in srgb, var(--warm) 10%, transparent), transparent 70%),
    radial-gradient(40vw 40vw at 70% 105%, color-mix(in srgb, var(--c2) 12%, transparent), transparent 70%);
  animation: recipes-glow 24s ease-in-out infinite alternate;
}

body::after {
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M30 50c10-18 30-22 38-18-4 16-20 30-38 18z'/%3E%3Cpath d='M30 50l22-12'/%3E%3Cpath d='M112 112c-4-16 6-34 16-36 6 14 0 34-16 36z'/%3E%3Cpath d='M112 112l10-24'/%3E%3Ccircle cx='120' cy='34' r='5'/%3E%3Ccircle cx='44' cy='124' r='4'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

[data-theme="light"] body::after { opacity: 0.08; }

@keyframes recipes-glow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 2%, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* Картки рецептів трохи «оживають» при наведенні */
@media (hover: hover) {
  .recipe-card { transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, border-color 0.25s; }
  .recipe-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--c1) 45%, var(--br));
    box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--c1) 60%, transparent);
  }
}

.topbar-account { display: flex; align-items: center; }
@media (max-width: 560px) {
  .topbar-account { display: none; }
}

/* ====== Банер-вітання з мозаїкою фото страв ====== */
.rx-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 28px;
  margin: 6px 0 26px;
  padding: 30px;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--c1) 22%, var(--br));
  background:
    radial-gradient(80% 120% at 0% 0%, color-mix(in srgb, var(--c1) 16%, transparent), transparent 60%),
    radial-gradient(60% 90% at 100% 100%, color-mix(in srgb, var(--warm) 12%, transparent), transparent 60%),
    var(--bg2);
  overflow: hidden;
}
.rx-kicker {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c1) 16%, transparent);
  color: var(--c1);
  font-size: 13px;
  font-weight: 700;
}
.rx-title { margin: 14px 0 10px !important; font-size: clamp(30px, 4vw, 44px) !important; line-height: 1.05; }
.rx-sub { margin: 0 0 22px; color: var(--t2); font-size: 15.5px; line-height: 1.6; max-width: 440px; }
.rx-hero .page-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.rx-mosaic {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  grid-template-rows: 150px 150px;
  gap: 10px;
}
.rx-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 34px -20px rgba(0, 0, 0, 0.7);
  animation: rx-float 7s ease-in-out infinite;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.rx-mosaic img:nth-child(1) { grid-row: span 2; animation-delay: -1s; }
.rx-mosaic img:nth-child(2) { animation-delay: -3s; }
.rx-mosaic img:nth-child(3) { animation-delay: -5s; }
.rx-mosaic img:nth-child(4) { animation-delay: -2s; }
.rx-mosaic img:nth-child(5) { animation-delay: -4s; }
@media (hover: hover) { .rx-mosaic img:hover { transform: scale(1.04) rotate(-1deg); } }
@keyframes rx-float { 50% { translate: 0 -6px; } }
.rx-credit { position: absolute; right: 8px; bottom: -18px; font-size: 10.5px; color: var(--t3); }

.rx-state-photo {
  display: block;
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid color-mix(in srgb, var(--c1) 35%, var(--br));
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.7);
}
.rx-state-photo.wide { width: min(420px, 100%); height: 200px; border-radius: 22px; }

@media (max-width: 820px) {
  .rx-hero { grid-template-columns: 1fr; padding: 22px 18px; gap: 20px; }
  .rx-mosaic { grid-template-columns: repeat(5, 120px); grid-template-rows: 120px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 6px; }
  .rx-mosaic::-webkit-scrollbar { display: none; }
  .rx-mosaic img:nth-child(1) { grid-row: auto; }
  .rx-credit { position: static; grid-column: 1 / -1; display: none; }
}
@media (prefers-reduced-motion: reduce) { .rx-mosaic img { animation: none; } }
