:root {
  --bg: #f7f1e8;
  --card: #fffdf9;
  --text: #2f3a2f;
  --muted: #7a7f72;
  --green: #6f8f6a;
  --green-dark: #5a7856;
  --line: #e8dfd2;
  --radius: 18px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}

.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 20px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; flex-direction: column; animation: fade .3s ease; }
.screen.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.badge {
  align-self: flex-start;
  background: #e6eedf;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 99px;
  margin-bottom: 18px;
}

h1 { font-size: 30px; line-height: 1.2; margin-bottom: 14px; }
h2 { font-size: 24px; line-height: 1.25; margin-bottom: 18px; }
.lead { color: var(--muted); font-size: 17px; margin-bottom: 22px; }

.benefits { list-style: none; margin-bottom: 28px; }
.benefits li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: block;
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(111, 143, 106, .3);
  margin-top: auto;
}
.btn:active { background: var(--green-dark); transform: scale(.99); }

.hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 12px; }

.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; width: 0; background: var(--green); transition: width .3s ease; }
.step { color: var(--muted); font-size: 14px; margin-bottom: 8px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  display: flex;
  gap: 12px;
  align-items: center;
}
.option:active, .option.selected { border-color: var(--green); background: #eef3ea; }

.back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  margin-top: 18px;
  align-self: flex-start;
  cursor: pointer;
}

#screen-loading { align-items: center; justify-content: center; text-align: center; }
.spinner {
  width: 54px; height: 54px;
  border: 5px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check { font-size: 48px; margin-bottom: 10px; }
.summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 16px; }
.summary-row + .summary-row { border-top: 1px solid var(--line); }
.summary-row span:first-child { color: var(--muted); }
.summary-row span:last-child { font-weight: 600; text-align: right; }

.footer { text-align: center; font-size: 12px; color: var(--muted); padding-top: 24px; }
.footer a { color: var(--muted); }

/* Маленькие экраны (iPhone SE и меньше): кнопка должна помещаться без прокрутки */
@media (max-width: 360px), (max-height: 640px) {
  .app { padding-top: 20px; }
  h1 { font-size: 25px; margin-bottom: 10px; }
  .lead { font-size: 16px; margin-bottom: 16px; }
  .badge { margin-bottom: 12px; }
  .benefits { margin-bottom: 18px; }
  .benefits li { padding: 11px 14px; font-size: 15px; margin-bottom: 8px; }
  .btn { padding: 16px; }
  .footer { padding-top: 14px; }
}

/* История создателей после квиза: шаги как в квизе */
.offer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.offer-brand { font-weight: 700; color: var(--green-dark); }
.skip { background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; padding: 8px 0 8px 12px; }
.skip.hidden { visibility: hidden; }

.dots { display: flex; gap: 6px; margin-bottom: 22px; }
.dots span { flex: 1; height: 4px; border-radius: 99px; background: var(--line); transition: background .2s; }
.dots span.on { background: var(--green); }

.story-step { display: none; flex-direction: column; flex: 1; }
.story-step.active { display: flex; animation: fade .3s ease; }
.story-icon { font-size: 48px; margin-bottom: 14px; }
.eyebrow { color: var(--green-dark); font-weight: 700; font-size: 14px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.block-label { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 14px; }

.story-nav {
  display: flex; align-items: center; gap: 16px; margin-top: 24px;
  position: sticky; bottom: 0; padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, rgba(247, 241, 232, 0));
}
.story-nav .back { margin-top: 0; }
.story-nav .btn { flex: 1; margin-top: 0; }
.story-nav.last .btn { display: none; }
.story-nav.first .back { visibility: hidden; }

.dishes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dish { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.dish-photo { width: 48px; height: 48px; flex-shrink: 0; border-radius: 10px; background: #ece4d6; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.dish-name { font-size: 15px; line-height: 1.3; }
.dish-day { display: block; color: var(--muted); font-size: 12px; }

.steps { list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 46px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: #e6eedf; color: var(--green-dark); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 15px; }

.expert { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.expert-photo { width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; background: #ece4d6; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

.faq { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin-top: 8px; color: var(--muted); font-size: 15px; }

.plan { display: block; margin-bottom: 10px; cursor: pointer; }
.plan input { position: absolute; opacity: 0; }
.plan-body { display: block; position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 16px; }
.plan-body b { display: block; font-size: 18px; }
.plan input:checked + .plan-body { border-color: var(--green); background: #eef3ea; }
.plan-tag { position: absolute; top: -10px; right: 14px; background: var(--green); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
#plans .faq:first-of-type { margin-top: 6px; }
#plans .btn { margin-top: 12px; }

/* ---------- Воронка 04.11: меню дня, оплата ---------- */
#screen-menu .btn, #screen-pay .btn { margin-top: 18px; }
.menu-day { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.menu-dish {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px;
}
.menu-dish img, .menu-dish .no-photo {
  width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
}
.menu-dish .no-photo { background: #eef3ea; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.menu-dish .meal { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.menu-dish b { font-size: 16px; line-height: 1.3; }
.lock {
  background: #fff4e5; border: 1px dashed #e8b871; border-radius: 14px;
  padding: 12px 14px; font-size: 15px; margin-bottom: 26px;
}
.plans-title { font-size: 21px; margin-bottom: 12px; }
.note { color: #a0612a; font-size: 14px; margin-top: 8px; }
.pay-steps { padding-left: 20px; margin-bottom: 6px; font-size: 16px; }
.pay-steps li { margin-bottom: 14px; }
.code {
  display: block; margin: 10px 0 4px; width: 100%;
  font: 700 34px/1 ui-monospace, Menlo, monospace; letter-spacing: 6px;
  background: var(--card); color: var(--text); border: 2px dashed var(--green);
  border-radius: 14px; padding: 16px; cursor: pointer;
}
.waiting { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); margin-top: 16px; }
.spinner.small { width: 20px; height: 20px; border-width: 3px; margin: 0; }
#tg-link { margin-top: 8px; }
.warn { background: #fff4e5; border-left: 4px solid #e8913a; border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 15px; line-height: 1.4; color: #6b3d10; }
.support a { color: inherit; text-decoration: underline; }
