:root {
  --cream: #f7f1e7;
  --paper: #fffaf0;
  --paper-soft: rgba(255, 250, 240, .78);
  --ink: #20251d;
  --ink-2: #3a4234;
  --muted: #727b67;
  --olive: #39442e;
  --olive-dark: #222b1e;
  --sage: #8f9b78;
  --sage-soft: #dfe8d6;
  --gold: #caa874;
  --line: rgba(57, 68, 46, .12);
  --shadow: 0 30px 90px rgba(57, 68, 46, .18);
  --shadow-soft: 0 18px 46px rgba(57, 68, 46, .12);
  --blur: blur(18px);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(202, 168, 116, .2), transparent 30%),
    radial-gradient(circle at 10% 0%, rgba(223, 232, 214, .72), transparent 36%),
    linear-gradient(180deg, #fbf7ee, var(--cream));
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(57, 68, 46, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(57, 68, 46, .03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .38), transparent 65%);
}

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

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.topbar,
.auth-card,
.hero-panel,
.controls,
.app-footer,
.recipe-card,
.recipe-modal {
  border: 1px solid rgba(255, 255, 255, .66);
  background: rgba(255, 250, 240, .7);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border-radius: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  font-weight: 900;
}

.brand__mark {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 17px;
  background: #fffaf0;
  box-shadow: 0 12px 28px rgba(57, 68, 46, .12);
}

.brand__mark svg {
  width: 31px;
  height: 31px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--olive-dark), #536143);
  box-shadow: 0 18px 42px rgba(32, 40, 29, .28);
}

.button--ghost {
  color: var(--olive-dark);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
}

.button--admin {
  min-height: 42px;
  color: #fffaf0;
  background: linear-gradient(135deg, #222b1e, #566245);
  box-shadow: 0 14px 34px rgba(32, 40, 29, .2);
}

.button--soft {
  color: #7f3f34;
  border: 1px solid rgba(127, 63, 52, .18);
  background: rgba(255, 246, 239, .72);
}

.topbar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar__actions .button {
  min-height: 42px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--olive);
  background: rgba(255, 255, 255, .56);
  font-size: 12px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: .98;
}

.hero-panel {
  display: grid;
  gap: 24px;
  margin: 22px 0 16px;
  padding: clamp(24px, 5vw, 46px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 4%, rgba(202, 168, 116, .26), transparent 28%),
    linear-gradient(135deg, rgba(255, 250, 240, .88), rgba(255, 255, 255, .56));
}

.hero-panel h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(38px, 8vw, 74px);
}

.hero-panel p {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 20px);
  line-height: 1.55;
}

.app-footer {
  display: grid;
  gap: 18px;
  margin-top: 26px;
  padding: 22px;
  border-radius: 26px;
}

.auth-page .app-footer {
  width: min(720px, calc(100% - 28px));
  margin: 0 auto 28px;
}

.app-footer__brand {
  display: grid;
  gap: 6px;
}

.app-footer__brand strong {
  font-size: 18px;
  font-weight: 900;
}

.app-footer__brand p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 750;
}

.app-footer > div:last-child {
  display: grid;
  gap: 10px;
}

.app-footer__links,
.app-footer__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 15px;
  align-items: center;
}

.app-footer__links a,
.app-footer__contacts a {
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 900;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .54);
}

.telegram-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.service-summary {
  display: grid;
  gap: 18px;
  margin: 0 0 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, .66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.service-summary__head {
  display: grid;
  gap: 8px;
}

.service-summary__head h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
}

.service-summary__head p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 750;
}

.service-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.service-summary__item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .56);
}

.service-summary__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--olive-dark);
  background: linear-gradient(135deg, rgba(223, 232, 214, .92), rgba(255, 250, 240, .76));
}

.service-summary__icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.service-summary__item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 950;
}

.service-summary__item span:last-child {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.controls {
  position: sticky;
  z-index: 15;
  top: 82px;
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 24px;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 999px;
  background: rgba(255, 250, 240, .66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.view-tab {
  min-height: 42px;
  flex: 1;
  border: 0;
  border-radius: 999px;
  color: var(--olive);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.view-tab.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--olive-dark), #536143);
  box-shadow: 0 14px 34px rgba(32, 40, 29, .18);
}

.search {
  display: grid;
  gap: 8px;
}

.search span,
.login-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search input,
.login-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(57, 68, 46, .14);
  border-radius: 18px;
  outline: 0;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.search input:focus,
.login-form input:focus {
  border-color: rgba(86, 98, 69, .38);
  box-shadow: 0 0 0 4px rgba(143, 155, 120, .16);
}

.airfryer-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid rgba(57, 68, 46, .12);
  border-radius: 20px;
  background: rgba(255, 250, 240, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  cursor: pointer;
}

.airfryer-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.airfryer-toggle__control {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 48px;
  border: 1px solid rgba(86, 98, 69, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.airfryer-toggle__control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 4px 12px rgba(32, 40, 29, .18);
  transition: transform .2s ease;
}

.airfryer-toggle input:checked + .airfryer-toggle__control {
  border-color: transparent;
  background: linear-gradient(135deg, var(--olive-dark), #536143);
  box-shadow: 0 12px 28px rgba(32, 40, 29, .16);
}

.airfryer-toggle input:checked + .airfryer-toggle__control::after {
  transform: translateX(20px);
}

.airfryer-toggle input:focus-visible + .airfryer-toggle__control {
  box-shadow: 0 0 0 4px rgba(143, 155, 120, .2);
}

.airfryer-toggle__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.airfryer-toggle__text strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.airfryer-toggle__text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--olive);
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
  font-weight: 850;
}

.filter.is-active {
  color: #fffaf0;
  border-color: transparent;
  background: linear-gradient(135deg, var(--olive-dark), #536143);
  box-shadow: 0 14px 34px rgba(32, 40, 29, .22);
}

.filter:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.filter--favorite {
  color: #7e4b3f;
  background: rgba(255, 238, 232, .72);
}

.recipe-grid {
  display: grid;
  gap: 16px;
}

.recipe-card {
  overflow: hidden;
  border-radius: 28px;
  transition: transform .24s ease, box-shadow .24s ease;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.recipe-card__image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sage-soft);
}

.favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(255, 250, 240, .86);
  box-shadow: 0 14px 34px rgba(32, 40, 29, .18);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: var(--blur);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.favorite-button:hover,
.favorite-button.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, #7e4b3f, #b46b5b);
}

.favorite-button:hover {
  transform: translateY(-2px);
}

.recipe-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card__body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.card-actions {
  display: grid;
  gap: 8px;
}

.recipe-card h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.14;
}

.recipe-card p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--olive);
  background: rgba(223, 232, 214, .9);
  font-size: 12px;
  font-weight: 900;
}

.macro-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.macro-row span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 800;
}

.macro-row strong {
  color: var(--ink);
  font-size: 16px;
}

.card-meta,
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-meta span,
.modal-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--olive);
  background: rgba(223, 232, 214, .66);
  font-size: 12px;
  font-weight: 850;
}

.empty-state {
  padding: 34px 24px;
  border-radius: 24px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .66);
  background:
    radial-gradient(circle at 80% 0%, rgba(202, 168, 116, .18), transparent 30%),
    rgba(255, 255, 255, .54);
  box-shadow: var(--shadow-soft);
  text-align: center;
  font-weight: 800;
}

.day-menu {
  display: grid;
  gap: 16px;
}

.day-menu[hidden],
.shopping-list[hidden],
.ai-analysis[hidden],
.recipe-view[hidden],
.controls[hidden] {
  display: none !important;
}

.day-menu__head,
.day-total,
.day-meal,
.shopping-list__head,
.shopping-item,
.ai-analysis__head,
.ai-panel,
.ai-result {
  border: 1px solid rgba(255, 255, 255, .66);
  background: rgba(255, 250, 240, .72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.day-menu__head,
.shopping-list__head,
.ai-analysis__head {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 32px);
  border-radius: var(--radius-lg);
}

.day-menu__head h2,
.shopping-list__head h2,
.ai-analysis__head h2 {
  margin-bottom: 10px;
  font-size: clamp(34px, 6vw, 56px);
}

.day-menu__head p,
.shopping-list__head p,
.ai-analysis__head p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 650;
}

.shopping-list {
  display: grid;
  gap: 16px;
}

.ai-analysis {
  display: grid;
  gap: 18px;
}

.ai-analysis__head {
  grid-template-columns: 1fr;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(202, 168, 116, .24), transparent 26%),
    linear-gradient(135deg, rgba(255, 250, 240, .9), rgba(255, 255, 255, .58));
}

.ai-analysis__badge {
  display: grid;
  gap: 4px;
  width: fit-content;
  min-width: 170px;
  padding: 16px;
  border: 1px solid rgba(202, 168, 116, .24);
  border-radius: 22px;
  color: var(--olive);
  background: rgba(234, 220, 198, .5);
}

.ai-analysis__badge strong {
  color: var(--ink);
  font-size: 18px;
}

.ai-analysis__badge span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 999px;
  background: rgba(255, 250, 240, .66);
  box-shadow: var(--shadow-soft);
}

.ai-mode-tab {
  min-height: 42px;
  flex: 1;
  border: 0;
  border-radius: 999px;
  color: var(--olive);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.ai-mode-tab.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--olive-dark), #536143);
  box-shadow: 0 14px 34px rgba(32, 40, 29, .18);
}

.ai-panels {
  display: grid;
}

.ai-workspace {
  display: grid;
  gap: 16px;
}

.ai-panel {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 4vw, 24px);
  border-radius: var(--radius-lg);
  align-content: start;
}

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

.ai-field,
.ai-upload {
  position: relative;
  display: grid;
  gap: 8px;
}

.ai-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ai-field textarea {
  width: 100%;
  border: 1px solid rgba(57, 68, 46, .14);
  border-radius: 18px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.ai-field textarea {
  min-height: 150px;
  resize: vertical;
  padding: 14px 16px;
  line-height: 1.5;
}

.ai-field--large textarea {
  min-height: 280px;
}

.ai-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ai-upload__visual {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px;
  border: 1px dashed rgba(86, 98, 69, .28);
  border-radius: 24px;
  color: var(--olive);
  background:
    radial-gradient(circle at 50% 8%, rgba(223, 232, 214, .82), transparent 34%),
    rgba(255, 255, 255, .52);
  text-align: center;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.ai-upload__visual strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.ai-upload__visual small {
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.ai-upload.is-dragging .ai-upload__visual,
.ai-upload:hover .ai-upload__visual {
  border-color: rgba(86, 98, 69, .5);
  background: rgba(223, 232, 214, .56);
  box-shadow: 0 18px 42px rgba(57, 68, 46, .12);
}

.ai-upload__preview {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 640px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 24px;
  background: rgba(255, 250, 240, .72);
  box-shadow: var(--shadow-soft);
}

.ai-upload.has-preview .ai-upload__visual {
  min-height: 84px;
  padding: 14px;
}

.ai-upload.has-preview .ai-upload__visual strong {
  font-size: 15px;
}

.ai-upload.has-preview .ai-upload__visual small {
  font-size: 12px;
}

.ai-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-upload-actions[hidden] {
  display: none !important;
}

.ai-upload-actions .button {
  min-height: 44px;
  flex: 1 1 160px;
}

.ai-field textarea:focus,
.ai-upload input:focus + .ai-upload__visual {
  border-color: rgba(86, 98, 69, .38);
  box-shadow: 0 0 0 4px rgba(143, 155, 120, .16);
}

.ai-result {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 28px);
  border-radius: var(--radius-lg);
  align-content: start;
  background:
    radial-gradient(circle at 84% 0%, rgba(202, 168, 116, .2), transparent 28%),
    rgba(255, 250, 240, .78);
}

.ai-result[hidden] {
  display: none;
}

.ai-result__top h3 {
  margin-bottom: 0;
  font-size: clamp(26px, 5vw, 38px);
}

.ai-result__macros {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ai-macro {
  display: grid;
  gap: 3px;
  min-height: 78px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .6);
}

.ai-macro strong {
  color: var(--ink);
  font-size: 24px;
}

.ai-macro span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-result__block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
}

.ai-result__block h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.ai-result__block p,
.ai-result__block ul {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
  font-weight: 700;
}

.ai-result__block ul {
  padding-left: 20px;
}

.ai-note {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(202, 168, 116, .24);
  border-radius: 18px;
  color: var(--olive);
  background: rgba(234, 220, 198, .42);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 850;
}

.shopping-items {
  display: grid;
  gap: 10px;
}

.shopping-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
}

.shopping-item input {
  width: 22px;
  height: 22px;
  accent-color: var(--olive);
}

.shopping-item__text {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
}

.shopping-item__text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.shopping-item.is-done .shopping-item__text {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-remove {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .62);
  cursor: pointer;
  font-size: 20px;
}

.day-menu__grid {
  display: grid;
  gap: 14px;
}

.day-meal {
  overflow: hidden;
  border-radius: 26px;
}

.day-meal__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sage-soft);
}

.day-meal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.day-meal__slot {
  position: absolute;
  left: 12px;
  top: 12px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--olive);
  background: rgba(255, 250, 240, .88);
  box-shadow: 0 12px 28px rgba(32, 40, 29, .12);
  font-size: 12px;
  font-weight: 900;
}

.day-meal__body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.day-meal h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.15;
}

.day-total {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
}

.day-total span {
  display: grid;
  gap: 2px;
  min-height: 66px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, .6);
  font-size: 12px;
  font-weight: 850;
}

.day-total strong {
  color: var(--ink);
  font-size: 22px;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  padding: 12px;
  overscroll-behavior: contain;
}

.modal.is-open {
  display: grid;
  place-items: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 30, 20, .42);
  backdrop-filter: blur(10px);
}

.recipe-modal {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(900px, calc(100vh - 24px));
  overflow: auto;
  border-radius: 30px;
  background: rgba(255, 250, 240, .94);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal__topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 240, .96), rgba(255, 250, 240, .78));
  backdrop-filter: var(--blur);
}

.modal__back,
.modal__close {
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 240, .88);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-weight: 900;
}

.modal__back {
  min-height: 40px;
  padding: 0 14px;
  color: var(--olive);
  font-size: 13px;
}

.modal__close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  font-size: 28px;
  line-height: 1;
}

.recipe-modal__image {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 26px;
  background: var(--sage-soft);
  box-shadow: var(--shadow-soft);
}

.recipe-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-modal__content {
  display: grid;
  gap: 18px;
  padding: 18px 24px 24px;
}

.modal-category {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--olive);
  background: var(--sage-soft);
  font-size: 12px;
  font-weight: 900;
}

.recipe-modal__header {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.favorite-action {
  min-height: 38px;
  border: 1px solid rgba(126, 75, 63, .14);
  border-radius: 999px;
  padding: 0 14px;
  color: #7e4b3f;
  background: rgba(255, 238, 232, .72);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(126, 75, 63, .1);
}

.favorite-action.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, #7e4b3f, #b46b5b);
}

.favorite-action--shopping {
  color: var(--olive);
  border-color: var(--line);
  background: rgba(255, 255, 255, .62);
}

.recipe-modal h2 {
  margin-bottom: 0;
  font-size: clamp(32px, 7vw, 54px);
}

.modal-description {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 650;
}

.modal-columns {
  display: grid;
  gap: 18px;
}

.modal-columns h3 {
  margin-bottom: 10px;
}

.modal-columns ul,
.modal-columns ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 650;
}

.recipe-tip {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(202, 168, 116, .24);
  border-radius: 20px;
  color: var(--olive);
  background: rgba(234, 220, 198, .46);
}

.recipe-tip strong {
  font-size: 13px;
  font-weight: 900;
}

.recipe-tip span {
  color: var(--ink-2);
  line-height: 1.5;
  font-weight: 700;
}

.pdf-message {
  margin: -6px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(202, 168, 116, .24);
  border-radius: 16px;
  color: var(--olive);
  background: rgba(255, 255, 255, .62);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-shell {
  width: min(520px, 100%);
}

.auth-card {
  display: grid;
  gap: 28px;
  padding: clamp(22px, 6vw, 42px);
  border-radius: var(--radius-xl);
}

.auth-copy h1 {
  margin-bottom: 14px;
  font-size: clamp(38px, 9vw, 62px);
}

.auth-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.form-error {
  margin: -2px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(141, 56, 45, .18);
  border-radius: 16px;
  color: #8d382d;
  background: rgba(255, 238, 232, .72);
  font-size: 13px;
  font-weight: 850;
}

@media (min-width: 680px) {
  .app-page {
    width: min(1180px, calc(100% - 56px));
    padding-top: 24px;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-summary__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .day-menu__head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .ai-analysis__head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .ai-workspace {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    align-items: start;
  }

  .shopping-list__head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .app-footer {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .app-footer__links,
  .app-footer__contacts {
    justify-content: flex-end;
  }

  .day-menu__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .day-total {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal-columns {
    grid-template-columns: .8fr 1.2fr;
  }
}

@media (min-width: 1040px) {
  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .service-summary__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .recipe-modal__content {
    padding: 22px 30px 30px;
  }
}

@media (max-width: 520px) {
  .app-page {
    width: min(100% - 20px, 1180px);
    padding-bottom: 30px;
  }

  .topbar {
    top: 6px;
    border-radius: 20px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .brand small {
    display: none;
  }

  .button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .hero-panel {
    margin-top: 14px;
    border-radius: 26px;
  }

  .controls {
    top: 70px;
    margin-inline: -2px;
    border-radius: 20px;
  }

  .airfryer-toggle {
    align-items: flex-start;
    gap: 10px;
    min-height: 54px;
    padding: 10px;
  }

  .airfryer-toggle__text strong {
    font-size: 13px;
  }

  .airfryer-toggle__text small {
    font-size: 11px;
  }

  .view-tabs {
    border-radius: 20px;
  }

  .day-menu__head .button {
    width: 100%;
  }

  .shopping-list__head .button {
    width: 100%;
  }

  .view-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .view-tab {
    flex: 0 0 auto;
    min-width: 118px;
  }

  .ai-mode-tabs {
    border-radius: 20px;
  }

  .ai-upload__visual {
    min-height: 210px;
    padding: 20px;
  }

  .ai-field--large textarea {
    min-height: 230px;
  }

  .ai-result__macros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal {
    padding: 6px;
    align-items: stretch;
  }

  .modal.is-open {
    place-items: stretch;
  }

  .recipe-modal {
    width: 100%;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 24px;
  }

  .modal__topbar {
    padding: 8px;
  }

  .modal__back {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .modal__close {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    font-size: 26px;
  }

  .recipe-modal__image {
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }

  .recipe-modal__image img {
    min-height: 0;
  }

  .macro-row span {
    padding: 9px 8px;
    font-size: 11px;
  }

  .macro-row strong {
    font-size: 14px;
  }

  .recipe-modal__content {
    gap: 15px;
    padding: 14px 14px 18px;
  }

  .modal-description {
    font-size: 15px;
  }

  .modal-columns {
    gap: 20px;
  }

  .modal-columns h3 {
    font-size: 18px;
  }

  .modal-columns ul,
  .modal-columns ol {
    gap: 10px;
    padding-left: 20px;
    font-size: 16px;
    line-height: 1.6;
  }

  .recipe-modal .button {
    width: 100%;
    margin-top: 2px;
  }

  .favorite-button {
    width: 48px;
    height: 48px;
    font-size: 23px;
  }

  .recipe-modal__header {
    display: grid;
    align-items: start;
  }

  .favorite-action {
    width: 100%;
  }

  .modal-actions {
    width: 100%;
  }

  .shopping-item {
    grid-template-columns: auto 1fr auto;
    padding: 12px 10px;
  }
}
