/* «Шеф в кармане» — Mini App.
   Фон и текст берутся из темы Telegram (светлая/тёмная), акцент — свой, тёплый «кухонный». */
:root {
  --page: var(--tg-theme-secondary-bg-color, #f2f2f6);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #16171b);
  --hint: var(--tg-theme-hint-color, #8b909a);
  --link: var(--tg-theme-link-color, #ff6f3c);
  --accent: #ff6f3c;
  --accent-2: #ff4d6d;
  --grad: linear-gradient(135deg, #ffa24a 0%, #ff6a3d 48%, #ff4d6d 100%);
  --ok: #22b573;
  --protein: #4f8bff;
  --fat: #ffb02e;
  --carbs: #22c27a;
  --line: color-mix(in srgb, var(--hint) 20%, transparent);
  --soft: color-mix(in srgb, var(--hint) 10%, transparent);
  --shadow: 0 1px 2px rgba(16, 18, 30, .04), 0 8px 24px rgba(16, 18, 30, .06);
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  /* только для обычного браузера: в Telegram цвета приходят из темы */
  :root {
    --page: var(--tg-theme-secondary-bg-color, #0f1013);
    --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #1b1c21));
    --text: var(--tg-theme-text-color, #f2f3f5);
    --hint: var(--tg-theme-hint-color, #8d929c);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--page); color: var(--text); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}
body.detail { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.fill { fill: currentColor; stroke: none; }

main { max-width: 640px; margin: 0 auto; padding: 14px 16px 28px; }
.enter > * { animation: rise .42s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .03s; }
.enter > *:nth-child(3) { animation-delay: .06s; }
.enter > *:nth-child(4) { animation-delay: .09s; }
.enter > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .enter > * { animation: none; } }

/* ---------- заголовки ---------- */
.hello { color: var(--hint); font-size: 14px; font-weight: 500; margin: 6px 2px 2px; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 2px 2px 16px; font-weight: 800; }
h2 { font-size: 19px; letter-spacing: -.01em; margin: 26px 2px 12px; font-weight: 750; display: flex; align-items: center; justify-content: space-between; }
h2 .more { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; gap: 4px; align-items: center; background: none; border: 0; padding: 0; }
h2 .more .i { width: 16px; height: 16px; }
.hint { color: var(--hint); font-size: 13px; }
.empty { text-align: center; color: var(--hint); padding: 36px 20px; background: var(--card); border-radius: var(--r-lg); }
.empty b { display: block; font-size: 40px; margin-bottom: 6px; }

/* ---------- поиск ---------- */
.search { position: relative; margin-bottom: 14px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hint); }
.search input {
  width: 100%; border: 0; outline: none; border-radius: 16px; background: var(--card); padding: 14px 16px 14px 44px;
  box-shadow: var(--shadow); font-size: 16px;
}
.search input::placeholder { color: var(--hint); }
textarea {
  width: 100%; border: 0; outline: none; border-radius: var(--r-lg); background: var(--card); padding: 14px 16px;
  min-height: 96px; resize: vertical; box-shadow: var(--shadow); font-size: 16px;
}
input[type=text], input[type=number] { width: 100%; border: 0; outline: none; border-radius: var(--r-md); background: var(--soft); padding: 12px 14px; font-size: 16px; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- быстрые действия ---------- */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button {
  position: relative; overflow: hidden; border: 0; border-radius: var(--r-lg); padding: 16px; min-height: 104px;
  color: #fff; text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45);
}
.quick button b { font-size: 16px; line-height: 1.2; }
.quick button span { font-size: 12px; opacity: .85; }
.quick button em { font-style: normal; font-size: 30px; line-height: 1; }
.quick button::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.quick .fridge { background: linear-gradient(140deg, #34c3ff, #2f7bff); }
.quick .invent { background: linear-gradient(140deg, #a77bff, #ff5fa2); }

/* ---------- категории ---------- */
.cats { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 70px; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.cat .tile { width: 58px; height: 58px; border-radius: 19px; font-size: 28px; transition: transform .2s var(--ease); }
.cat.on .tile { background: linear-gradient(140deg, var(--c1), var(--c2)); box-shadow: 0 8px 18px -8px var(--c2); transform: translateY(-2px); }
.cat.on { font-weight: 700; }

/* плитка с эмодзи в цвете категории */
.tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: color-mix(in srgb, var(--c1) 20%, var(--card));
}

/* ---------- списки рецептов ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 14px; width: 100%; border: 0; text-align: left; padding: 12px 14px 12px 12px;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: transform .15s var(--ease);
}
.item:active { transform: scale(.98); }
.item .tile { width: 54px; height: 54px; border-radius: 16px; font-size: 26px; }
.item .tx { flex: 1; min-width: 0; }
.item .nm { font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .sub { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.item > .i { color: var(--hint); width: 18px; height: 18px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--hint); }
.pill .i { width: 13px; height: 13px; }
.pill.kcal { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.pill.ai { background: color-mix(in srgb, #a77bff 16%, transparent); color: #8b5cf6; }
.pill.miss { background: color-mix(in srgb, var(--accent-2) 12%, transparent); color: var(--accent-2); }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* скелетоны при загрузке */
.sk { background: linear-gradient(90deg, var(--card) 25%, color-mix(in srgb, var(--hint) 14%, var(--card)) 50%, var(--card) 75%);
      background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--r-lg); }
.sk.row { height: 78px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 16px;
  padding: 15px 18px; font-weight: 700; font-size: 16px; color: #fff; background: var(--grad);
  box-shadow: 0 12px 24px -14px var(--accent-2); transition: transform .15s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 650; }
.btn.small { width: auto; padding: 10px 14px; font-size: 14px; border-radius: 12px; }
.btn .i { width: 18px; height: 18px; }
.row { display: flex; gap: 10px; margin: 12px 0; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* нижняя закреплённая кнопка на экранах рецепта */
.cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--page) 70%, transparent);
}
.cta .btn { max-width: 608px; margin: 0 auto; }

/* ---------- вкладки ---------- */
#tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; padding: 6px; border-radius: 24px; max-width: 520px; margin: 0 auto;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 10px 30px -10px rgba(10, 12, 30, .25), 0 0 0 1px var(--line);
  transition: transform .3s var(--ease), opacity .3s;
}
body.detail #tabs { transform: translateY(140%); opacity: 0; pointer-events: none; }
#tabs button {
  flex: 1; border: 0; background: none; border-radius: 18px; padding: 7px 0 6px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; color: var(--hint); font-size: 11px; font-weight: 600; transition: background .25s, color .25s;
}
#tabs button .i { width: 22px; height: 22px; }
#tabs button.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- экран рецепта ---------- */
.hero {
  position: relative; height: 210px; margin: -14px -16px 0; overflow: hidden;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  display: flex; align-items: center; justify-content: center;
}
.hero .emoji { font-size: 96px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .22)); animation: float 5s ease-in-out infinite; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.hero::before { width: 220px; height: 220px; left: -70px; top: -90px; }
.hero::after { width: 140px; height: 140px; right: -40px; bottom: -30px; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-3deg); } }
.sheet { position: relative; margin: -26px -16px 0; padding: 22px 16px 8px; background: var(--page); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.sheet h1 { font-size: 24px; margin: 0 2px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2px 4px; }

.card { background: var(--card); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.nutri { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .c b { font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.ring .c span { font-size: 12px; color: var(--hint); margin-top: 2px; }
.macros { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.macro { font-size: 13px; }
.macro div { display: flex; justify-content: space-between; margin-bottom: 4px; }
.macro b { font-weight: 700; }
.bar { height: 7px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--m); transition: width .8s var(--ease); }
.nutri-note { margin: 10px 2px 0; }

.actions { display: flex; gap: 10px; margin: 14px 0 0; }
.round {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; padding: 10px 4px;
  background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); font-size: 12px; color: var(--hint); font-weight: 600;
}
.round b { font-size: 20px; line-height: 1; font-weight: normal; }
.round.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }

.ingr { list-style: none; margin: 0; padding: 4px 16px; }
.ingr li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ingr li:last-child { border-bottom: 0; }
.ingr .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; transition: all .2s; }
.ingr .box .i { width: 14px; height: 14px; stroke-width: 3; color: #fff; opacity: 0; }
.ingr li.done .box { background: var(--ok); border-color: var(--ok); }
.ingr li.done .box .i { opacity: 1; }
.ingr li.done .nm { text-decoration: line-through; color: var(--hint); }
.ingr .nm { flex: 1; }
.ingr .am { color: var(--hint); font-size: 14px; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 44px; }
.timeline li::before {
  content: attr(data-n); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.timeline li::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.tip { display: flex; gap: 10px; background: color-mix(in srgb, var(--fat) 16%, var(--card)); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; }
.locked { text-align: center; padding: 22px 16px; }
.locked b { display: block; font-size: 34px; margin-bottom: 6px; }

/* магазины и покупки */
.seg { display: flex; padding: 4px; gap: 4px; background: var(--soft); border-radius: 14px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 8px 4px; font-weight: 650; font-size: 14px; color: var(--hint); transition: all .2s; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.shop { padding: 4px 16px; }
.shop .line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.shop .line:last-child { border-bottom: 0; }
.shop .line .nm { flex: 1; min-width: 0; }
.shop .line .nm small { display: block; color: var(--hint); font-size: 12px; }
.shop .line input { width: 22px; height: 22px; accent-color: var(--ok); flex: none; margin: 0; }
.shop .line.done .nm { text-decoration: line-through; color: var(--hint); }
.find { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--accent);
        background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 10px; border-radius: 10px; }
.find .i { width: 14px; height: 14px; }
.progress { margin: 4px 2px 14px; }
.progress div { display: flex; justify-content: space-between; font-size: 13px; color: var(--hint); margin-bottom: 6px; }
.progress .bar { height: 9px; }
.progress .bar i { background: var(--ok); }

/* ---------- меню на неделю ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day-pill {
  flex: none; width: 54px; border: 0; border-radius: 16px; padding: 10px 0 8px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text);
}
.day-pill b { font-size: 15px; }
.day-pill span { font-size: 10px; color: var(--hint); font-weight: 600; }
.day-pill.on { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -10px var(--accent-2); }
.day-pill.on span { color: rgba(255, 255, 255, .85); }
.day-pill.today:not(.on) { box-shadow: 0 0 0 2px var(--accent) inset; }
.daycard h3 { margin: 0 0 4px; font-size: 18px; display: flex; justify-content: space-between; align-items: baseline; }
.daycard h3 span { color: var(--accent); font-size: 15px; }
.meal { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.meal .tile { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; }
.meal .tx { flex: 1; min-width: 0; }
.meal .lbl { font-size: 12px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.meal .nm { font-weight: 650; line-height: 1.25; }
.meal .kc { color: var(--hint); font-size: 13px; margin-top: 2px; }
.meal > .i { color: var(--hint); width: 18px; height: 18px; }
.swap {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); transition: transform .2s var(--ease);
}
.swap .i { width: 18px; height: 18px; }
.swap:active { transform: rotate(-90deg) scale(.92); }
.daycard .hint .i { width: 14px; height: 14px; vertical-align: -2px; color: var(--accent); }
.item.alt { cursor: pointer; padding-right: 10px; }
.choose {
  flex: none; border: 0; border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 700;
  background: var(--grad); color: #fff; box-shadow: 0 8px 16px -10px var(--accent-2);
}
.choose:disabled { opacity: .6; }
.back + .hero { margin-top: 0; }
.plan { white-space: normal; line-height: 1.55; }

/* ---------- профиль и премиум ---------- */
.me { display: flex; align-items: center; gap: 14px; margin: 6px 2px 16px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 24px; font-weight: 800;
          display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me b { font-size: 20px; display: block; }
.premium {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px 18px 18px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, #ff6a3d 0%, transparent 55%), linear-gradient(150deg, #2a1f47 0%, #1a1527 100%);
  box-shadow: 0 18px 40px -22px rgba(42, 31, 71, .9);
}
.premium::after { content: "✦"; position: absolute; right: 18px; top: 10px; font-size: 54px; opacity: .14; }
.premium .crown { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ffc37a; }
.premium h3 { margin: 6px 0 10px; font-size: 21px; line-height: 1.2; }
.premium ul { list-style: none; padding: 0; margin: 0 0 16px; }
.premium li { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; color: rgba(255, 255, 255, .88); }
.premium li .i { width: 16px; height: 16px; color: #ffc37a; stroke-width: 3; }
.premium .note { font-size: 12px; color: rgba(255, 255, 255, .6); margin-top: 10px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-btn {
  position: relative; border: 0; border-radius: 16px; padding: 14px 12px; text-align: left; color: #fff;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.plan-btn b { display: block; font-size: 20px; }
.plan-btn span { font-size: 12px; opacity: .8; }
.plan-btn.best { background: var(--grad); box-shadow: 0 12px 24px -12px #ff4d6d; }
.plan-btn em { position: absolute; top: -8px; right: 10px; font-style: normal; font-size: 11px; font-weight: 800; background: #fff; color: #ff4d6d; padding: 2px 8px; border-radius: 99px; }
.donate { display: flex; gap: 8px; margin-top: 12px; }
.donate button { flex: 1; border: 0; border-radius: 12px; padding: 9px 4px; font-weight: 700; font-size: 13px; color: #fff; background: rgba(255, 255, 255, .1); }

fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; margin: 0 2px 10px; font-size: 15px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts.col { flex-direction: column; align-items: stretch; }
.opts.col .opt { text-align: left; }

/* ---------- данные о себе и норма калорий ---------- */
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.nums span { display: block; font-size: 12px; font-weight: 600; color: var(--hint); margin: 0 2px 5px; }
.nums input { text-align: center; padding: 12px 8px; }
.sub-legend { font-size: 13px; font-weight: 650; color: var(--hint); margin: 14px 2px 8px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 650; font-size: inherit; }
.norm { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.norm .flame {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.norm b { font-size: 24px; letter-spacing: -.02em; display: block; line-height: 1.1; }
.norm span { color: var(--hint); font-size: 13px; }
.kbar { height: 6px; border-radius: 999px; background: var(--soft); margin: 10px 0 2px; overflow: hidden; }
.kbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .4s var(--ease); }
.opt { border: 0; border-radius: 12px; padding: 9px 13px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; font-weight: 550; transition: all .2s; }
.opt.on { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px var(--accent-2); }

/* ---------- пошаговый режим ---------- */
.stepper {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--page);
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); animation: rise .3s var(--ease);
}
.stepper .top { display: flex; align-items: center; gap: 12px; }
.stepper .segs { flex: 1; display: flex; gap: 4px; }
.stepper .segs i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.stepper .segs i.on { background: var(--accent); }
.stepper .close { border: 0; background: var(--card); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.stepper .num { margin-top: 22px; font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.stepper .text { flex: 1; overflow-y: auto; font-size: 23px; line-height: 1.45; font-weight: 550; padding: 10px 0 16px; letter-spacing: -.01em; }
.stepper .done-msg { font-size: 44px; text-align: center; margin-top: 10px; }
.timer { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.timer b { font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.timer.run b { color: var(--accent); }
.timer.end { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }

/* ---------- уведомления ---------- */
#toast {
  position: fixed; left: 16px; right: 16px; top: calc(12px + env(safe-area-inset-top)); z-index: 40; max-width: 560px; margin: 0 auto;
  background: color-mix(in srgb, var(--text) 90%, transparent); color: var(--page); padding: 12px 16px; border-radius: 16px;
  font-size: 14px; font-weight: 550; text-align: center; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: drop .35s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }
