/* «Готовлю!» — стиль «Кухонный журнал». Своя палитра, тема берётся из colorScheme Telegram (html[data-theme]). */

/* ---------- токены ---------- */
:root {
  color-scheme: light;
  --paper: #F6EEE1;  --sheet: #FFFAF1;  --sheet-2: #EFE4D2;
  --ink: #2B1D16;    --ink-2: #6B5748;  --ink-3: #9A8774;
  --line: rgba(43,29,22,.14);
  --outline: rgba(43,29,22,.35);        /* обводка вторичных кнопок */
  --dash: rgba(43,29,22,.30);
  --box: rgba(43,29,22,.45);            /* кружок чекбокса */
  --paprika: #B53A24; --on-paprika: #FFF8EE; --paprika-text: #98301D; --paprika-press: #98301D;
  --paprika-fill: rgba(181,58,36,.18);
  --saffron: #E9A63A; --dill: #4F6B3A; --on-dill: #FFFFFF; --beet: #6E2338;
  --saffron-t: #F8E4B8; --paprika-t: #F4D9CF; --dill-t: #DDE6CB; --beet-t: #EAD3D8; --cinnamon-t: #E8D5BD;
  /* чернила тонов и точки категорий */
  --ti-saffron: #8A5A12; --ti-paprika: #98301D; --ti-cinnamon: #6F4527; --ti-dill: #3C5329; --ti-beet: #6E2338;
  --dot-saffron: #E9A63A; --dot-paprika: #B53A24; --dot-cinnamon: #8A5A38; --dot-dill: #4F6B3A; --dot-beet: #6E2338;
  --sh-1: 0 1px 0 rgba(43,29,22,.04), 0 10px 24px -12px rgba(43,29,22,.35);
  --sh-2: 0 -1px 0 var(--line), 0 14px 30px -10px rgba(43,29,22,.4);
  --edge: rgba(43,29,22,.06);
  --ph-filter: saturate(1.04) contrast(1.02);
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .11 0 0 0 0 .09 0 0 0 .55 -.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-s: 12px; --r-m: 16px; --r-l: 22px; --r-xl: 24px; --r-sheet: 28px; --r-pill: 999px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171110;  --sheet: #211916;  --sheet-2: #2A201C;
  --ink: #F3E8D8;    --ink-2: #BDAA97;  --ink-3: #7F6E60;
  --line: rgba(243,232,216,.14);
  --outline: rgba(243,232,216,.35);
  --dash: rgba(243,232,216,.30);
  --box: rgba(243,232,216,.45);
  --paprika: #E5593F; --on-paprika: #1E0F0B; --paprika-text: #F07A60; --paprika-press: #CF4B32;
  --paprika-fill: rgba(229,89,63,.18);
  --saffron: #F0B84F; --dill: #9DBF78; --on-dill: #17210F; --beet: #5A1B2D;
  --saffron-t: #3B2D14; --paprika-t: #3A1D17; --dill-t: #232C1A; --beet-t: #35171F; --cinnamon-t: #33261B;
  --ti-saffron: #F0B84F; --ti-paprika: #F07A60; --ti-cinnamon: #D4A57C; --ti-dill: #A4C17F; --ti-beet: #D98AA0;
  --dot-saffron: #F0B84F; --dot-paprika: #F07A60; --dot-cinnamon: #D4A57C; --dot-dill: #A4C17F; --dot-beet: #D98AA0;
  --sh-1: 0 10px 24px -12px rgba(0,0,0,.6);
  --sh-2: 0 -1px 0 var(--line), 0 14px 30px -10px rgba(0,0,0,.6);
  --edge: rgba(243,232,216,.08);
  --ph-filter: saturate(1.04) contrast(1.02) brightness(.94);
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317210F' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .9 0 0 0 0 .85 0 0 0 .55 -.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}
/* то же, если открыли вне Telegram и тема ещё не выставлена скриптом */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #171110;  --sheet: #211916;  --sheet-2: #2A201C;
    --ink: #F3E8D8;    --ink-2: #BDAA97;  --ink-3: #7F6E60;
    --line: rgba(243,232,216,.14);
    --outline: rgba(243,232,216,.35);
    --dash: rgba(243,232,216,.30);
    --box: rgba(243,232,216,.45);
    --paprika: #E5593F; --on-paprika: #1E0F0B; --paprika-text: #F07A60; --paprika-press: #CF4B32;
    --paprika-fill: rgba(229,89,63,.18);
    --saffron: #F0B84F; --dill: #9DBF78; --on-dill: #17210F; --beet: #5A1B2D;
    --saffron-t: #3B2D14; --paprika-t: #3A1D17; --dill-t: #232C1A; --beet-t: #35171F; --cinnamon-t: #33261B;
    --ti-saffron: #F0B84F; --ti-paprika: #F07A60; --ti-cinnamon: #D4A57C; --ti-dill: #A4C17F; --ti-beet: #D98AA0;
    --dot-saffron: #F0B84F; --dot-paprika: #F07A60; --dot-cinnamon: #D4A57C; --dot-dill: #A4C17F; --dot-beet: #D98AA0;
    --sh-1: 0 10px 24px -12px rgba(0,0,0,.6);
    --sh-2: 0 -1px 0 var(--line), 0 14px 30px -10px rgba(0,0,0,.6);
    --edge: rgba(243,232,216,.08);
    --ph-filter: saturate(1.04) contrast(1.02) brightness(.94);
    --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317210F' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E");
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .9 0 0 0 0 .85 0 0 0 .55 -.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  }
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html {
  background: var(--paper) var(--grain);
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  accent-color: var(--paprika);
  caret-color: var(--paprika);
}
body {
  margin: 0; min-height: 100vh;
  color: var(--ink);
  font: 400 16px/22px var(--sans);
  font-variant-numeric: tabular-nums;
  padding-top: calc(var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  overflow-x: hidden;
}
::selection { background: var(--saffron-t); }
:focus-visible { outline: 2px solid var(--paprika-text); outline-offset: 2px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; text-align: inherit; }
input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

main { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabs-h) + var(--safe-b)); overflow-x: clip; }
body:has(.recipe-screen) main { padding-bottom: 0; }
body.on-recipe main, body.on-cook main { padding-bottom: 0; }

/* иконки: одна семья, обводка 1.75 */
.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.s14 { width: 14px; height: 14px; stroke-width: 2; }
.i.s16 { width: 16px; height: 16px; stroke-width: 2; }
.i.s18 { width: 18px; height: 18px; stroke-width: 2; }
.i.s20 { width: 20px; height: 20px; }
.i.s22 { width: 22px; height: 22px; }
.i.s34 { width: 34px; height: 34px; stroke-width: 1.5; }
.i.s88 { width: 88px; height: 88px; stroke-width: 1.1; }

/* заголовки */
h1 { font: 800 34px/38px var(--serif); letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
h2 { display: flex; align-items: center; gap: 12px; margin: 36px 20px 14px; font: 700 26px/30px var(--serif); }
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
h2.plain::after { display: none; }
.pad { padding: 24px 20px 0; }
.sub-h, .hint { color: var(--ink-2); font-size: 14px; line-height: 18px; }
.sub-h { margin-top: 6px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 0; height: 56px; padding: 0 20px; border-radius: var(--r-pill);
  font: 600 16px/20px var(--sans); text-align: center; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--outline);
  transition: transform 90ms var(--ease), background-color 90ms;
}
.btn .i { width: 22px; height: 22px; }
.btn:active { background: var(--sheet-2); transform: scale(.97); }
.btn.main { background: var(--paprika); color: var(--on-paprika); box-shadow: none; }
.btn.main:active { background: var(--paprika-press); }
.btn.danger { color: var(--paprika-text); box-shadow: inset 0 0 0 1.5px var(--paprika-text); }
.btn:disabled { opacity: .5; }
.btn.link {
  display: flex; width: 100%; height: 48px; margin-top: 14px; padding: 0 16px;
  color: var(--paprika-text); box-shadow: none; border: 1.5px dashed var(--dash);
}
.btn.link .i { width: 20px; height: 20px; }
.btn.more { display: flex; width: calc(100% - 32px); height: 52px; margin: 24px 16px 0; }

/* ---------- нижняя навигация ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--paper); box-shadow: 0 -1px 0 var(--line);
}
body:has(.recipe-screen) .tabs { display: none; }
body.on-recipe .tabs, body.on-cook .tabs { display: none; }
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; color: var(--ink-2); font: 500 11px/12px var(--sans); }
.tabs .pill { position: relative; display: grid; place-items: center; width: 56px; height: 30px; }
.tabs .pill::before { content: ""; position: absolute; inset: 0; border-radius: 15px; background: var(--paprika-t); opacity: 0; transform: scale(.6); transition: transform 180ms var(--ease), opacity 180ms; }
.tabs .pill .i { position: relative; transition: color 180ms; }
.tabs button.on { color: var(--ink); font-weight: 700; }
.tabs button.on .pill::before { opacity: 1; transform: scale(1); }
.tabs button.on .pill .i { color: var(--paprika-text); fill: var(--paprika-fill); }
.tabs button:active .pill::before { opacity: 1; transform: scale(1); }

/* ---------- главная ---------- */
.logo { padding: 14px 20px 0; font: 800 32px/32px var(--serif); letter-spacing: -.02em; }
.logo i { font-style: italic; font-weight: 600; color: var(--paprika); letter-spacing: 0; }

.search {
  display: flex; align-items: center; gap: 10px; height: 52px; margin: 16px 16px 0; padding: 0 18px;
  border-radius: var(--r-pill); background: var(--sheet); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 120ms;
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--paprika); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px/22px var(--sans); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 16px 0; }
.quick button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; min-width: 0; padding: 0 6px; border-radius: var(--r-pill); font: 600 15px/20px var(--sans); color: var(--ink); transition: transform 90ms var(--ease), filter 90ms; }
.quick button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick button:nth-child(1) { background: var(--saffron-t); }
.quick button:nth-child(2) { background: var(--paprika-t); }
.quick button:nth-child(3) { background: var(--beet-t); }
.quick button:active { transform: scale(.97); filter: brightness(.94); }

/* лента «Идеи» */
.row { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 0 20px 8px; scroll-snap-type: x mandatory; scroll-padding-left: 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.row::-webkit-scrollbar { display: none; }
.idea { flex: none; width: min(72vw, 290px); scroll-snap-align: start; display: flex; flex-direction: column; justify-content: flex-start; transition: transform 120ms var(--ease); }
.idea:nth-child(even) { margin-top: 22px; }
.idea:active { transform: scale(.98); }
.idea .ph, .idea .noph { width: 100%; aspect-ratio: 4 / 5; border-radius: var(--r-l); box-shadow: var(--sh-1); }
.idea .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 12px; font: 600 21px/25px var(--serif); text-wrap: balance; overflow-wrap: anywhere; }
.idea .m { margin-top: 6px; }

/* общая мета у карточек: время · ккал */
.m { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; color: var(--ink-2); font: 500 14px/18px var(--sans); }
.m span { display: inline-flex; align-items: center; gap: 4px; }
.m .sep { font-style: normal; opacity: .7; }

/* плитки */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 16px 0; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; min-height: 132px; padding: 16px; border-radius: var(--r-xl); transition: transform 90ms var(--ease); }
.tile b { position: relative; z-index: 1; font: italic 600 22px/25px var(--serif); text-wrap: balance; }
.tile .i { position: relative; z-index: 1; }
.tile::before, .tile::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid currentColor; opacity: .14; }
.tile::before { width: 110px; height: 110px; right: -55px; bottom: -55px; }
.tile::after { width: 72px; height: 72px; right: -36px; bottom: -36px; }
.tile.beet { background: var(--beet); color: #F9EDE0; }
.tile.saffron { background: var(--saffron); color: #2B1D16; }
.tile:active { transform: scale(.97); }

/* оглавление разделов */
.toc { margin: 0 12px; }
.toc button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 8px; border-radius: var(--r-s); color: var(--ink); transition: background-color 90ms; }
.toc button + button::before { content: ""; position: absolute; top: 0; left: 8px; right: 8px; height: 1px; background: var(--line); }
.toc button:active { background: var(--sheet-2); }
.toc .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.toc .nm { flex: 1; min-width: 0; font: 600 21px/25px var(--serif); }
.toc .cnt { color: var(--ink-2); font: 500 15px/20px var(--sans); }
.toc .i { color: var(--ink-2); }
.d-saffron { background: var(--dot-saffron); }
.d-paprika { background: var(--dot-paprika); }
.d-cinnamon { background: var(--dot-cinnamon); }
.d-dill { background: var(--dot-dill); }
.d-beet { background: var(--dot-beet); }

/* чипы */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.chip { height: 40px; padding: 0 16px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); font: 500 15px/20px var(--sans); color: var(--ink); white-space: nowrap; transition: background-color 90ms, color 90ms; }
.chip:active { background: var(--ink); color: var(--paper); }
.end { height: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* ---------- карточки без фото («тарелка») и фото ---------- */
.ph { display: block; max-width: 100%; height: auto; object-fit: cover; object-position: 50% 50%; filter: var(--ph-filter); background: var(--sheet-2); }
.noph {
  --tb: var(--cinnamon-t); --ti: var(--ti-cinnamon); --d1: 78%; --d2: 52%; --ls: 52px;
  position: relative; overflow: hidden; display: grid; place-items: center; background: var(--tb); color: var(--ti);
}
.noph[data-tone="saffron"] { --tb: var(--saffron-t); --ti: var(--ti-saffron); }
.noph[data-tone="paprika"] { --tb: var(--paprika-t); --ti: var(--ti-paprika); }
.noph[data-tone="dill"] { --tb: var(--dill-t); --ti: var(--ti-dill); }
.noph[data-tone="beet"] { --tb: var(--beet-t); --ti: var(--ti-beet); }
.noph::before, .noph::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid currentColor; opacity: .22; transform: translate(-50%, -50%); }
.noph::before { width: var(--d1); aspect-ratio: 1; }
.noph::after { width: var(--d2); aspect-ratio: 1; }
.noph span { position: relative; z-index: 1; font: italic 700 var(--ls)/1 var(--serif); opacity: .9; }

.rc .ph, .rc .noph { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-m); --d1: 68%; --d2: 44%; --ls: 52px; }
.rc .ph { outline: 1px solid var(--edge); outline-offset: -1px; }
.idea .noph { --d1: 78%; --d2: 52%; --ls: 88px; }
.rc.feat .ph, .rc.feat .noph { aspect-ratio: 16 / 10; border-radius: var(--r-l); --d1: 56%; --d2: 38%; --ls: 110px; }

/* ---------- сетка рецептов ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 12px; margin-top: 20px; padding: 0 16px; }
.rc { display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; transition: transform 120ms var(--ease); }
.rc:active { transform: scale(.98); }
.rc:active .ph { filter: var(--ph-filter) brightness(.95); }
.rc .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font: 600 16px/20px var(--serif); overflow-wrap: anywhere; }
.rc .m { margin-top: 4px; font-size: 13.5px; line-height: 18px; }
.rc.feat { grid-column: 1 / -1; }
.rc.feat .t { margin-top: 10px; font-size: 24px; line-height: 28px; text-wrap: balance; }
.rc.feat .m { margin-top: 6px; font-size: 14px; }

/* ---------- лоадер и пустые состояния ---------- */
.loader { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30vh 0 0; color: var(--ink-2); font-size: 14px; line-height: 18px; }
.pad + .loader, .meal-top + .loader { padding-top: 20vh; }
#plan .loader { padding-top: 40px; }
.steam { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.steam .s1, .steam .s2, .steam .s3 { stroke-dasharray: 8 8; animation: steam 1.8s linear infinite; }
.steam .s2 { animation-delay: .25s; }
.steam .s3 { animation-delay: .5s; }
@keyframes steam { 0% { stroke-dashoffset: 16; opacity: .2; } 50% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: .2; } }

.empty { padding: 48px 40px; text-align: center; color: var(--ink-2); }
.empty .i { display: block; margin: 0 auto; color: var(--ink-3); }
.empty p { margin-top: 16px; font: italic 500 20px/26px var(--serif); text-wrap: balance; overflow-wrap: anywhere; }

/* ---------- рецепт ---------- */
.recipe-screen { padding-bottom: calc(72px + var(--safe-b) + 16px); }
.hero { width: 100%; height: auto; aspect-ratio: 10 / 9; }
.noph.hero { aspect-ratio: 10 / 6; --d1: 58%; --d2: 40%; --ls: 120px; }
.sheet { position: relative; margin-top: -28px; padding: 24px 20px 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--paper) var(--grain); }
.sheet h1 { font-size: 32px; line-height: 36px; }
.sheet h2 { margin-left: 0; margin-right: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; color: var(--ink-2); font: 500 14px/18px var(--sans); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.desc { margin-top: 16px; font: 400 17px/27px var(--serif); overflow-wrap: anywhere; }
.desc::first-letter { float: left; padding: 4px 8px 0 0; font: 800 3.3em/.85 var(--serif); color: var(--paprika); }
.cap { margin-top: 8px; color: var(--ink-2); font: 500 12.5px/16px var(--sans); }

.bju { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bju > div { min-width: 0; padding: 0 12px; }
.bju > div:first-child { padding-left: 0; }
.bju > div + div { border-left: 1px solid var(--line); }
.bju b { display: block; font: 700 24px/26px var(--serif); white-space: nowrap; }
.bju small { margin-left: 2px; color: var(--ink-2); font: 500 14px/18px var(--sans); }
.lg { display: block; margin-top: 2px; color: var(--ink-2); font: 400 13px/18px var(--sans); white-space: nowrap; }
.lg i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.bju .lg .d-beet { background: var(--dot-beet); }

.h2row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; }
.h2row h2 { margin-right: 0; }
.stepper { display: inline-flex; align-items: center; flex: none; height: 44px; border-radius: var(--r-pill); background: var(--sheet-2); font: 600 15px/20px var(--sans); }
.stepper button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; transition: transform 90ms var(--ease), background-color 90ms; }
.stepper button:active { background: rgba(127,110,96,.2); transform: scale(.94); }
.stepper button:disabled { opacity: .35; pointer-events: none; }
.stepper #srv { min-width: 64px; text-align: center; white-space: nowrap; }
@media (max-width: 429px) { .stepper #srv { min-width: 52px; } }
@media (max-width: 389px) { .h2row h2 { font-size: 22px; line-height: 28px; } }

.recipe-card { margin: 0 -4px; padding: 4px 18px; border-radius: var(--r-xl); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line), var(--sh-1); }
.ing { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 14px 0; cursor: pointer; }
.ing + .ing { border-top: 1px dashed var(--line); }
.tx { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font: 400 17px/24px var(--sans); }
.nm { min-width: 0; overflow-wrap: anywhere; }
.nm > span, .shop .nm > span { background: linear-gradient(currentColor, currentColor) 0 62% / 0 1.5px no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size 220ms var(--ease); }
.dots { flex: 1; min-width: 16px; border-bottom: 2px dotted var(--ink-3); transform: translateY(-5px); }
.qt { flex: none; max-width: 45%; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ing.done .tx, .shop .done .nm { color: var(--ink-2); }
.ing.done .nm > span, .shop .done .nm > span { background-size: 100% 1.5px; }

/* чекбокс-кружок: приложение рисует галочку само */
.ing input, .shop input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; margin: 0; width: 26px; height: 26px; border-radius: 50%;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--box); cursor: pointer; transition: background-color 180ms, box-shadow 180ms;
}
.ing input::after, .shop input::after { content: ""; position: absolute; inset: 0; background: var(--tick) center / 16px no-repeat; clip-path: inset(0 100% 0 0); transition: clip-path 180ms var(--ease); }
.ing input:checked, .shop input:checked { background: var(--dill); box-shadow: none; }
.ing input:checked::after, .shop input:checked::after { clip-path: inset(0 0 0 0); }

/* «Чем заменить» */
.subs-box { margin-top: 14px; padding: 18px; border-radius: var(--r-l); background: var(--saffron-t); }
.subs-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font: italic 600 20px/26px var(--serif); }
.sub { padding-top: 14px; }
.sub b { display: block; font: 600 17px/22px var(--serif); overflow-wrap: anywhere; }
.sub ul { margin: 4px 0 0; padding: 0; list-style: none; color: var(--ink-2); font: 400 15px/21px var(--sans); }
.sub li { padding-left: 20px; position: relative; overflow-wrap: anywhere; }
.sub li::before { content: "—"; position: absolute; left: 0; }

/* шаги */
.steps { display: grid; gap: 28px; }
.step { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
.step .n { position: relative; align-self: start; width: 48px; height: 48px; padding: 0; font: 800 40px/40px var(--serif); letter-spacing: -.03em; color: var(--paprika); text-align: left; transition: color 180ms; }
.step .tk { position: absolute; top: 2px; right: 0; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--dill); color: var(--on-dill); opacity: 0; transform: scale(.4); transition: opacity 180ms, transform 180ms var(--ease); }
.step .tk .i { width: 11px; height: 11px; stroke-width: 3; }
.step.done .n { color: var(--dill); }
.step.done .tk { opacity: 1; transform: scale(1); }
.sx { min-width: 0; padding-top: 7px; }
.sx p { font: 400 17px/27px var(--serif); overflow-wrap: anywhere; transition: color 180ms; }
.step.done .sx p { color: var(--ink-2); }

.timer { display: inline-flex; align-items: center; gap: 8px; height: 48px; margin-top: 12px; padding: 0 18px; border-radius: var(--r-pill); background-color: var(--saffron-t); color: var(--ink); font: 600 15px/20px var(--sans); text-align: left; transition: background-color 180ms; }
.timer .tm { font: 700 20px/20px var(--serif); }
.timer .stop { font: 400 13px/16px var(--sans); }
.timer.run { background-color: var(--saffron); background-image: linear-gradient(to right, rgba(0,0,0,.12) calc(var(--p, 0) * 100%), transparent 0); color: #2B1D16; animation: pulse 2s ease-in-out infinite; }
.timer.fin { background: var(--dill); color: var(--on-dill); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(233,166,58,0); } 50% { box-shadow: 0 0 0 6px rgba(233,166,58,.35); } }

.tips { margin-top: 32px; padding: 18px 18px 20px; border-radius: var(--r-l); background: var(--saffron-t); }
.tips-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font: italic 600 20px/26px var(--serif); }
.tips-h .i { color: var(--paprika-text); }
.tips p { font: 400 17px/27px var(--serif); overflow-wrap: anywhere; }

/* панель действий вместо вкладок. На родителях fixed — никаких transform */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 480px; margin: 0 auto;
  display: flex; gap: 10px; padding: 8px 16px calc(8px + var(--safe-b));
  background: var(--paper); box-shadow: var(--sh-2);
}
.actionbar #favBtn { flex: none; width: 132px; padding: 0 12px; }
.actionbar #shopBtn { flex: 1; }
.actionbar .btn.saved .i { fill: var(--paprika); stroke: var(--paprika); }
.actionbar .btn.pop .i { animation: spring 280ms var(--ease); }
@keyframes spring { 0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- меню на день ---------- */
.kcal { display: flex; align-items: flex-end; gap: 12px; margin: 20px 16px 0; padding: 0 4px; }
.kline { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; min-height: 64px; border-bottom: 2px solid var(--ink); }
.kline input { flex: 1; min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 800 56px/56px var(--serif); -moz-appearance: textfield; appearance: textfield; }
.kline input:placeholder-shown { font-size: 22px; font-weight: 500; line-height: 56px; }
.kline input::placeholder { color: var(--ink-2); opacity: 1; font-weight: 500; }
.kline input::-webkit-inner-spin-button, .kline input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.kline input:placeholder-shown + .u { display: none; }
.kline .u { font: italic 400 22px/26px var(--serif); color: var(--ink-2); }
.kcal .btn { flex: none; width: 112px; height: 52px; margin-bottom: 6px; padding: 0; }

.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 16px 0; }
.chip.pre { display: flex; align-items: center; justify-content: center; gap: 4px; height: 44px; padding: 0; min-width: 0; }
.chip.pre b { font: 600 16px/20px var(--sans); }
.chip.pre small { color: var(--ink-2); font: 500 12.5px/16px var(--sans); }
.chip.pre.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip.pre.on small { color: var(--paper); opacity: .8; }
@media (max-width: 389px) { .chip.pre { flex-direction: column; gap: 0; justify-content: center; } .chip.pre small { font-size: 11.5px; line-height: 12px; } }

.meal { margin-top: 32px; }
.meal-h { display: flex; align-items: center; gap: 10px; margin: 0 20px 4px; color: var(--paprika-text); }
.meal-h h3 { color: var(--ink); font: italic 700 26px/30px var(--serif); }
.meal-h .rule { flex: 1; min-width: 12px; height: 1px; background: var(--line); }
.meal-h .k { flex: none; color: var(--ink-2); font: 600 15px/20px var(--sans); }
.li { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 100px; padding: 12px 20px; transition: background-color 90ms; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px; background: var(--line); }
.li:active { background: var(--sheet-2); }
.li .ph, .li .noph { flex: none; width: 76px; height: 76px; border-radius: var(--r-m); --d1: 0; --d2: 0; --ls: 34px; }
.li .noph::before, .li .noph::after { display: none; }
.li .lt { flex: 1; min-width: 0; }
.li .lt > b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 600 17px/21px var(--serif); overflow-wrap: anywhere; }
.li .hint { display: block; margin-top: 4px; font-size: 14px; line-height: 18px; }
.li .pq { color: var(--paprika-text); font-weight: 600; }
.li > .i { color: var(--ink-2); }

.total { margin: 28px 16px 0; padding: 20px; border-radius: var(--r-xl); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); }
.total .lbl { display: block; color: var(--ink-2); font-size: 15px; line-height: 20px; }
.total .big { margin-top: 4px; font: 800 40px/40px var(--serif); }
.total .big small { margin-left: 8px; color: var(--ink-2); font: italic 500 20px/26px var(--serif); }
.total .bju { margin-top: 16px; padding-bottom: 0; border-bottom: 0; }
.macro { display: flex; gap: 2px; height: 8px; margin-top: 16px; border-radius: 4px; overflow: hidden; }
.macro i { display: block; min-width: 2px; }
.actions { display: grid; gap: 10px; margin: 20px 16px 0; }
.actions.two { grid-template-columns: 1fr 1.2fr; }
.actions.two.even { grid-template-columns: 1fr 1fr; margin-top: 24px; }
.actions .btn { padding: 0 8px; gap: 8px; white-space: nowrap; }
.actions.even .btn { white-space: normal; line-height: 18px; text-wrap: balance; }
@media (max-width: 379px) { .actions.two { grid-template-columns: 1fr 1fr; } .actions .btn { font-size: 15px; gap: 6px; } .actions .btn .i { width: 20px; height: 20px; } }

/* ---------- покупки ---------- */
.sum { margin-top: 12px; font: 400 20px/26px var(--serif); }
.sum b { font-weight: 800; color: var(--paprika-text); }
.bar { height: 4px; margin-top: 14px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--dill); transition: width 220ms var(--ease); }
.shop { margin: 8px 20px 0; }
.shop label { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 14px 0; cursor: pointer; font: 400 17px/24px var(--sans); }
.shop label + label { border-top: 1px dashed var(--line); }
.shop input { width: 28px; height: 28px; }

/* ---------- тост ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 14px + var(--safe-b)); z-index: 60;
  display: flex; align-items: center; gap: 10px; max-width: min(90vw, 440px); padding: 12px 16px;
  border-radius: var(--r-m); background: var(--ink); color: var(--paper); box-shadow: var(--sh-2);
  font: 400 15px/20px var(--sans); opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
#toast .i { color: var(--saffron); }
#toast span { min-width: 0; overflow-wrap: anywhere; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.recipe-screen) #toast { bottom: calc(72px + 14px + var(--safe-b)); }
body.on-recipe #toast { bottom: calc(72px + 14px + var(--safe-b)); }
body.on-cook #toast { bottom: calc(96px + 14px + var(--safe-b)); }

/* ---------- движение ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#view > :nth-child(1) { animation: rise 360ms var(--ease) backwards; }
#view > :nth-child(2) { animation: rise 360ms var(--ease) 40ms backwards; }
#view > :nth-child(3) { animation: rise 360ms var(--ease) 80ms backwards; }
#view > :nth-child(4) { animation: rise 360ms var(--ease) 120ms backwards; }
#view > :nth-child(5) { animation: rise 360ms var(--ease) 160ms backwards; }
#view > :nth-child(6) { animation: rise 360ms var(--ease) 200ms backwards; }
#view > .recipe-screen, #view > .cook, #view > .fridge-screen { animation: fade 360ms var(--ease) backwards; }   /* только opacity: внутри fixed-панель */
#view.still > * { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .steam .s1, .steam .s2, .steam .s3 { animation: none; stroke-dasharray: none; opacity: 1; }
  .btn:active, .fridge-card:active, .pro-banner:active, .tile:active, .rc:active, .idea:active, .quick button:active, .stepper button:active { transform: none; }
}

/* =====================================================================
   Новое: шапка с короной, холодильник, подписка, режим «Готовлю»
   ===================================================================== */

.btn.sq { flex: none; width: 56px; padding: 0; }
.logo { display: flex; align-items: center; justify-content: space-between; padding-right: 8px; }
.crown { display: grid; place-items: center; width: 44px; height: 44px; margin-top: -4px; border-radius: 50%; color: var(--paprika-text); background: var(--paprika-t); transition: transform 90ms var(--ease); }
.crown:active { transform: scale(.94); }

/* блок «Что есть в холодильнике?» и баннер подписки на главной */
.fridge-card, .pro-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; width: calc(100% - 32px); margin: 28px 16px 0; padding: 18px 20px; border-radius: var(--r-xl); background: var(--dill-t); color: var(--ink); text-align: left; transition: transform 90ms var(--ease); }
.fridge-card::before, .fridge-card::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--ti-dill); opacity: .22; }
.fridge-card::before { width: 130px; height: 130px; right: -40px; top: -50px; }
.fridge-card::after { width: 84px; height: 84px; right: -18px; top: -27px; }
.fridge-card > .i:first-child { color: var(--ti-dill); }
.fridge-card .ft b { font: italic 600 22px/25px var(--serif); text-wrap: balance; }
.fridge-card .ft span, .pro-banner .ft span { display: block; margin-top: 4px; color: var(--ink-2); font: 400 14px/18px var(--sans); }
.fridge-card:active, .pro-banner:active { transform: scale(.98); }
.ft { flex: 1; min-width: 0; }
.fridge-card > .i:last-child, .pro-banner > .i:last-child { color: var(--ink-2); }
.pro-banner { margin-top: 12px; padding: 14px 20px; gap: 14px; background: var(--paprika-t); }
.pro-banner > .i:first-child { color: var(--paprika-text); }
.pro-banner .ft b { display: block; font: 600 18px/22px var(--serif); }
.pro-banner .ft span { margin-top: 0; }

/* кнопка «Начать готовить» + «Поделиться» на экране рецепта */
.cookrow { display: flex; gap: 10px; margin-top: 24px; }
.cookrow #cookBtn { flex: 1; }

/* ---------- холодильник ---------- */
.fridge-screen { padding-bottom: calc(var(--tabs-h) + 88px + var(--safe-b)); }
.addp { display: flex; gap: 8px; margin: 20px 16px 0; }
.addp input { flex: 1; min-width: 0; height: 56px; padding: 0 20px; border: 0; outline: 0; border-radius: var(--r-pill); background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font: 400 16px/22px var(--sans); transition: box-shadow 120ms; }
.addp input:focus { box-shadow: inset 0 0 0 2px var(--paprika); }
.addp input::placeholder { color: var(--ink-2); opacity: 1; }
.grp { margin: 28px 20px 12px; font: italic 700 22px/26px var(--serif); }
.chip.pick { display: inline-flex; align-items: center; gap: 0; }
.chip.pick .i { width: 0; opacity: 0; margin-right: 0; transition: width 150ms var(--ease), opacity 150ms, margin 150ms; }
.chip.pick.on { background: var(--dill); color: var(--on-dill); box-shadow: none; }
.chip.pick.on .i { width: 16px; opacity: 1; margin-right: 6px; }
.chip.pick:active { background: var(--ink); color: var(--paper); }
.chip.pick.on:active { background: var(--dill); color: var(--on-dill); filter: brightness(.92); }
.fridge-cta { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 9; max-width: 480px; margin: 0 auto; padding: 10px 16px; background: var(--paper); box-shadow: 0 -1px 0 var(--line); }
.fridge-cta .btn { width: 100%; }

/* результаты: сколько продуктов уже есть */
.fit .fit-b { display: block; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fit .fit-b i { display: block; height: 100%; background: var(--dill); }
.fit .fit-t { margin-top: 6px; color: var(--ink); font: 600 13.5px/18px var(--sans); }
.fit .miss { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--ink-2); font: 400 13px/17px var(--sans); overflow-wrap: anywhere; }

/* ---------- подписка ---------- */
.pro-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; margin: 20px 16px 0; padding: 24px 20px; border-radius: var(--r-sheet); background: var(--paprika-t); color: var(--ti-paprika); }
.pro-hero::before, .pro-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid currentColor; opacity: .2; }
.pro-hero::before { width: 190px; height: 190px; right: -60px; bottom: -80px; }
.pro-hero::after { width: 120px; height: 120px; right: -25px; bottom: -45px; }
.pro-hero b { position: relative; margin-top: 8px; color: var(--ink); font: italic 700 28px/32px var(--serif); text-wrap: balance; }
.pro-hero > span { position: relative; max-width: 80%; color: var(--ink-2); font: 400 15px/21px var(--sans); }
.feat-list { margin: 12px 20px 0; }
.fl { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.fl + .fl { border-top: 1px dashed var(--line); }
.fi { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--cinnamon-t); color: var(--ti-cinnamon); }
.fi[data-tone="saffron"] { background: var(--saffron-t); color: var(--ti-saffron); }
.fi[data-tone="paprika"] { background: var(--paprika-t); color: var(--ti-paprika); }
.fi[data-tone="dill"] { background: var(--dill-t); color: var(--ti-dill); }
.fi[data-tone="beet"] { background: var(--beet-t); color: var(--ti-beet); }
.fl .ft b { display: block; font: 600 17px/22px var(--serif); }
.fl .ft span { display: block; margin-top: 2px; color: var(--ink-2); font: 400 14px/19px var(--sans); }
.pro-cta { margin: 20px 16px 0; }
.pro-cta .btn { width: 100%; }
#buy .i { fill: currentColor; }
.pro-cta .note { margin-top: 12px; color: var(--ink-2); font: 400 14px/19px var(--sans); text-align: center; text-wrap: balance; }
.pro-on { display: flex; align-items: center; gap: 12px; margin: 20px 16px 0; padding: 16px 20px; border-radius: var(--r-l); background: var(--dill-t); color: var(--ink); font: 400 17px/24px var(--serif); }
.pro-on .i { color: var(--ti-dill); }
.pro-on b { font-weight: 800; }
.invite { margin: 28px 16px 0; padding: 20px; border-radius: var(--r-xl); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); }
.invite h3 { font: italic 600 22px/26px var(--serif); }
.invite p { margin-top: 4px; color: var(--ink-2); font: 400 15px/21px var(--sans); }
.inv-n { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.inv-n b { font: 800 40px/40px var(--serif); }
.inv-n span { color: var(--ink-2); font: 400 15px/20px var(--sans); }
.invite .actions { margin: 16px 0 0; }

/* ---------- режим «Готовлю» ---------- */
.cook { position: fixed; inset: 0; z-index: 30; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; background: var(--paper) var(--grain); padding-top: calc(var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px)); }
.cook-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0; }
.cook-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; transition: background-color 90ms, transform 90ms var(--ease); }
.cook-x:active { background: var(--sheet-2); transform: scale(.94); }
.cook-step { flex: 1; min-width: 0; font: 600 17px/22px var(--sans); }
.cook-ingb { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: var(--r-pill); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); font: 600 15px/20px var(--sans); transition: transform 90ms var(--ease); }
.cook-ingb:active { transform: scale(.97); background: var(--sheet-2); }
.cook-bar { height: 4px; margin: 12px 16px 0; border-radius: 2px; background: var(--line); overflow: hidden; }
.cook-bar i { display: block; height: 100%; background: var(--paprika); border-radius: 2px; transition: width 260ms var(--ease); }
.cook-plaque { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.cook-plaque::-webkit-scrollbar { display: none; }
.cook-plaque:empty { display: none; }
.pl { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); font: 600 14px/18px var(--sans); }
.pl.run { background: var(--saffron); color: #2B1D16; }
.pl.fin { background: var(--dill); color: var(--on-dill); }
.cook-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 20px; }
.cook-n { font: 800 88px/88px var(--serif); letter-spacing: -.03em; color: var(--paprika); }
.cook-t { margin-top: 4px; font: 400 24px/34px var(--serif); overflow-wrap: anywhere; }
.cook-t.long { font-size: 21px; line-height: 30px; }
.cook-timer { margin-top: 24px; }
.cook-timer:empty { display: none; }
.timer.big { display: flex; width: 100%; height: 64px; margin-top: 0; justify-content: center; padding: 0 20px; font-size: 17px; }
.timer.big .tm { font-size: 32px; line-height: 32px; }
.timer.big .stop { font-size: 13px; max-width: 120px; }
.cook-body .tips { margin-top: 24px; }
.bon { margin-top: 24px; font: italic 700 32px/38px var(--serif); color: var(--paprika-text); text-align: center; text-wrap: balance; }
.cook-body.go-next { animation: cslideL 240ms var(--ease); }
.cook-body.go-prev { animation: cslideR 240ms var(--ease); }
@keyframes cslideL { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes cslideR { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.cook-nav { display: flex; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--paper); box-shadow: 0 -1px 0 var(--line); }
.cook-nav .btn { height: 68px; font-size: 18px; }
.cook-nav #cprev { flex: 1; }
.cook-nav #cnext { flex: 1.5; }
.cook-nav .btn:disabled { opacity: .35; pointer-events: none; }
.cook-scrim { position: absolute; inset: 0; background: rgba(20, 10, 5, .5); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease); }
.cook.open .cook-scrim { opacity: 1; pointer-events: auto; }
.cook-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; display: flex; flex-direction: column; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--paper) var(--grain); box-shadow: var(--sh-2); transform: translateY(104%); visibility: hidden; transition: transform 280ms var(--ease), visibility 0s linear 280ms; }
.cook.open .cook-sheet { transform: none; visibility: visible; transition-delay: 0s; }
.cook-sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 8px 20px; }
.cook-sheet-h h3 { font: 700 24px/28px var(--serif); }
.cook-sheet-h h3 span { color: var(--ink-2); font: 500 15px/20px var(--sans); }
.cook-sheet-b { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(20px + var(--safe-b)); }
.cook-sheet-b .recipe-card { margin: 0; }
@media (max-width: 379px) { .cook-n { font-size: 72px; line-height: 72px; } .cook-t { font-size: 22px; line-height: 31px; } .cook-ingb span { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .cook-body.go-next, .cook-body.go-prev { animation: none; } }

/* переключатель мер: как в рецепте / в граммах / без весов */
.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 -4px 12px;
  border-radius: var(--r-pill); background: var(--sheet-2); }
.units button { min-height: 40px; padding: 0 6px; border-radius: var(--r-pill); font: 600 14px/18px var(--sans);
  color: var(--ink-2, inherit); transition: background-color 120ms var(--ease), color 120ms var(--ease); }
.units button.on { background: var(--sheet); color: var(--ink, inherit); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.units button:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .units button { transition: none; } }
