/* Страница рецепта (макеты «Рецепт, режим готовки и планер», ноябрь 2026).
   Сетка: телефон — одна колонка; 768–1199 — состав слева (липкий), шаги справа,
   совет и КБЖУ под шагами; от 1200 — три колонки 320 | шаги | 288.
   Цвета — те же, что в каталоге (static/css/catalog.css). */

.recipe-page {
    --rp-bg: #F7F3EE;
    --rp-surface: #FFFFFF;
    --rp-ink: #1F2A24;
    --rp-soft: #4F5A54;
    --rp-line: #E6DED3;
    --rp-border: #D9CFC2;
    --rp-ctrl: #8F8372;
    --rp-green: #356C54;
    --rp-forest: #213D2F;
    --rp-mint: #E3EEE7;
    --rp-mint-line: #B9D3C3;
    --rp-club: #A23B62;
    --rp-sand: #F1EBE3;
    --rp-honey: #F8ECD9;
    --rp-honey-line: #EBD5B3;
    --rp-star: #B4741C;
    --rp-on-dark: #F3EDE4;
    --rp-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --rp-sans: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --rp-gutter: 16px;
    --rp-header: 72px;

    background: var(--rp-bg);
    color: var(--rp-ink);
    font-family: var(--rp-sans);
    -webkit-font-smoothing: antialiased;
    min-height: 70vh;
}
/* Поля и ширина — как у шапки и подвала сайта (max-w-container px-4 md:px-6): края совпадают. */
@media (min-width: 768px) { .recipe-page { --rp-gutter: 24px; --rp-header: 80px; } }

.recipe-page *, .recipe-page *::before, .recipe-page *::after { box-sizing: border-box; }
.recipe-page h1, .recipe-page h2, .recipe-page h3 { margin: 0; text-wrap: balance; font-variant-numeric: lining-nums; }
.recipe-page p { text-wrap: pretty; }
.recipe-page button { font-family: inherit; cursor: pointer; }
.recipe-page [x-cloak] { display: none !important; }
.recipe-page :is(a, button, input, summary):focus-visible {
    outline: 3px solid var(--rp-green);
    outline-offset: 3px;
}
.recipe-page :is(.rp-tip, .rp-club, .rp-timer) :is(a, button):focus-visible { outline-color: var(--rp-mint-line); }
.rp-sr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.rp-wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--rp-gutter); }
.rp-h2 { font-family: var(--rp-serif); font-weight: 500; font-size: 24px; line-height: 1.2; }
.rp-h2--lg { font-size: 26px; }
.rp-h3 { font-size: 17px; line-height: 22px; font-weight: 800; }
.rp-icon { flex: none; }
.rp-empty { margin: 0; color: var(--rp-soft); font-size: 15px; }
.rp-link {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 2px;
    background: none; border: 0; color: var(--rp-green); font-weight: 700; font-size: 14px;
    text-decoration: underline; text-underline-offset: 3px;
}
.rp-link:hover { color: var(--rp-forest); }
@media (min-width: 1024px) { .rp-h2--lg { font-size: 30px; } }

/* ---------- Шапка рецепта ---------- */
.rp-hero { padding: 8px 0 24px; }
.rp-crumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px;
    padding: 8px 0 12px; font-size: 13px; line-height: 18px; color: var(--rp-soft);
}
.rp-crumbs a {
    display: inline-flex; align-items: center; min-height: 28px;
    color: var(--rp-soft); text-decoration: underline; text-underline-offset: 3px;
}
.rp-crumbs a:hover { color: var(--rp-ink); }
.rp-crumbs [aria-current] {
    display: inline-block; max-width: 42ch; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; vertical-align: bottom;
}
/* Телефон: крошки короче — «Рецепты › Завтраки»; название рецепта стоит сразу под ними заголовком. */
@media (max-width: 767.98px) {
    .rp-crumbs--cat > :nth-child(-n + 2) { display: none; }
    .rp-crumbs:not(.rp-crumbs--cat) > :nth-last-child(-n + 2) { display: none; }
}
@media (min-width: 768px) { .rp-crumbs { font-size: 14px; padding-bottom: 16px; } }

.rp-hero__grid { display: grid; gap: 20px; }
.rp-hero__media {
    position: relative; overflow: hidden; border-radius: 20px;
    aspect-ratio: 4 / 3; background: #E9DCC6;
}
.rp-hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rp-hero__nophoto {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: #EFE7DC; color: #6E6253; font-size: 15px; font-weight: 600;
}
.rp-hero__nophoto .rp-icon { color: #A89A86; }
.rp-hero__media.is-broken::after {
    content: ""; position: absolute; inset: 0; background: #EFE7DC center / 48px no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A89A86' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21'/%3E%3C/svg%3E");
}
.rp-hero__body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 768px) {
    .rp-hero__grid { gap: 28px; }
    .rp-hero__media { aspect-ratio: 16 / 9; border-radius: 24px; }
    .rp-hero__body { gap: 18px; }
}
@media (min-width: 1024px) {
    .rp-hero { padding-bottom: 40px; }
    .rp-hero__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
    .rp-hero__media { order: 2; aspect-ratio: 1 / 1; border-radius: 28px; }
}
@media (min-width: 1200px) {
    .rp-hero__grid { grid-template-columns: minmax(600px, 1fr) minmax(0, 520px); gap: 56px; }
}

.rp-chips { display: flex; flex-wrap: wrap; gap: 0 8px; margin: -5px 0; padding: 0; list-style: none; }
.rp-chip-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.rp-chip-link:hover .rp-chip { background: #D5E6DB; }
.rp-chips > li > .rp-chip { margin-block: 5px; }
.rp-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px 0 10px;
    border-radius: 999px; background: var(--rp-mint); color: var(--rp-forest);
    font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.rp-chip--club { background: var(--rp-club); color: #FFFFFF; font-weight: 700; font-size: 13px; }

.rp-title {
    font-family: var(--rp-serif); font-weight: 500; font-size: 32px; line-height: 1.12;
    letter-spacing: -0.01em; overflow-wrap: anywhere;
}
@media (min-width: 768px) { .rp-title { font-size: 40px; } }
@media (min-width: 1200px) { .rp-title { font-size: 46px; line-height: 1.14; } }

.rp-lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--rp-soft); max-width: 640px; overflow-wrap: anywhere; }
.rp-lead p { margin: 0 0 0.6em; }
.rp-lead > :last-child { margin-bottom: 0; }
@media (min-width: 768px) { .rp-lead { font-size: 17px; } }
@media (min-width: 1200px) { .rp-lead { font-size: 18px; } }

.rp-byline { display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; }
.rp-author {
    display: flex; align-items: center; gap: 10px; min-height: 44px;
    color: var(--rp-ink); text-decoration: none; font-size: 14px; line-height: 20px;
}
.rp-author img { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; object-position: 50% 18%; background: var(--rp-mint); flex: none; }
.rp-author > span { display: flex; flex-direction: column; }
.rp-author b { font-weight: 700; }
.rp-author span span { color: var(--rp-soft); }
.rp-score {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
    color: var(--rp-ink); text-decoration: none; font-size: 15px;
}
.rp-star { color: var(--rp-star); }
.rp-score__count { color: var(--rp-soft); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.rp-score:hover .rp-score__count { color: var(--rp-ink); }

.rp-facts {
    margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
    background: var(--rp-line); border: 1px solid var(--rp-line); border-radius: 16px; overflow: hidden;
}
.rp-facts > div {
    background: var(--rp-surface); padding: 12px 14px;
    display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px;
}
.rp-facts > div:last-child:nth-child(odd) { grid-column: span 2; }
.rp-facts dt { font-size: 13px; line-height: 16px; color: var(--rp-soft); }
.rp-facts dd {
    margin: 0; font-size: 17px; line-height: 22px; font-weight: 700;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (min-width: 480px) {
    .rp-facts { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .rp-facts > div:last-child:nth-child(odd) { grid-column: auto; }
    .rp-facts dd { font-size: 18px; }
}

/* ---------- Вернулись к рецепту, который готовили ---------- */
.rp-resume {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: -8px 0 16px; padding: 14px 16px;
    border-radius: 18px; background: var(--rp-mint); border: 1px solid var(--rp-mint-line); color: var(--rp-forest);
}
.rp-resume__icon {
    width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--rp-green); color: #FFFFFF;
}
.rp-resume__text { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 20px; min-width: 0; }
.rp-resume__text b { font-size: 15px; }
.rp-resume__go { min-height: 44px; padding: 0 20px; font-size: 15px; }
.rp-resume__close { background: transparent; }
@media (max-width: 479.98px) {
    .rp-resume__go { flex: 1; }
}

/* ---------- Действия ---------- */
.rp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 56px; padding: 0 24px; border-radius: 999px; border: 1.5px solid transparent;
    font-size: 17px; font-weight: 700; line-height: 1.2; text-decoration: none; text-align: center;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.rp-btn--primary { background: var(--rp-green); color: #FFFFFF; }
.rp-btn--primary:hover { background: var(--rp-forest); color: #FFFFFF; }
.rp-btn--club { background: var(--rp-club); color: #FFFFFF; }
.rp-btn--club:hover { background: #87304F; color: #FFFFFF; }
.rp-btn--outline {
    min-height: 48px; padding: 0 20px; background: var(--rp-surface); border-color: var(--rp-border);
    color: var(--rp-ink); font-size: 15px; font-weight: 600;
}
.rp-btn--outline:hover { border-color: var(--rp-ctrl); }
.rp-btn--light { background: #FFFFFF; color: var(--rp-forest); }
.rp-btn--light:hover { background: var(--rp-mint); }
.rp-btn--ghost-dark { background: transparent; border-color: rgb(243 237 228 / 0.4); color: var(--rp-on-dark); }
.rp-btn--ghost-dark:hover { border-color: var(--rp-on-dark); }
.rp-btn--timer {
    min-height: 44px; padding: 0 16px 0 12px; gap: 8px; background: var(--rp-surface);
    border-color: var(--rp-green); color: var(--rp-forest); font-size: 15px;
}
.rp-btn--timer:hover { background: var(--rp-mint); }
.rp-btn--block { width: 100%; }
.rp-btn--outline.rp-btn--block { padding: 0 14px; gap: 8px; font-size: 14px; }
.rp-lock {
    display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 7px;
    border-radius: 999px; background: #FFFFFF; color: var(--rp-club);
    font-size: 12px; font-weight: 800; flex: none;
}

.rp-actions { display: flex; flex-direction: column; gap: 10px; }
.rp-actions__cook { width: 100%; }
.rp-actions__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
/* Совсем узкие экраны: четыре кнопки с подписями в ряд не помещаются — сетка 2 × 2. */
@media (max-width: 359.98px) {
    .rp-actions__row { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
div.rp-actions__fav { display: contents; }
.rp-actions__row:has(> :only-child) .rp-act { flex-direction: row; gap: 8px; min-height: 52px; font-size: 15px; }
.rp-act {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 60px; padding: 8px 2px; border: 1.5px solid var(--rp-border); border-radius: 16px;
    background: var(--rp-surface); color: var(--rp-ink); font-size: 12px; font-weight: 600; line-height: 1.2;
    text-decoration: none; width: 100%; white-space: nowrap;
}
.rp-act:hover { border-color: var(--rp-ctrl); }
.rp-act.is-on { color: var(--rp-club); border-color: #E2B9C9; }
.rp-more { position: relative; display: flex; }
.rp-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 232px;
    display: flex; flex-direction: column; padding: 6px; background: var(--rp-surface);
    border: 1px solid var(--rp-line); border-radius: 16px; box-shadow: 0 12px 32px rgb(31 42 36 / 0.14);
}
.rp-menu__item {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px;
    border: 0; border-radius: 12px; background: none; color: var(--rp-ink); font-size: 15px;
    font-weight: 600; text-align: left; text-decoration: none; white-space: nowrap;
}
.rp-menu__item:hover { background: var(--rp-sand); }
@media (max-width: 767.98px) { .rp-menu__item--wide { display: none; } }

@media (min-width: 768px) {
    .rp-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .rp-actions__cook { width: auto; }
    .rp-actions__row { display: flex; gap: 10px; }
    .rp-act {
        flex-direction: row; gap: 8px; min-height: 56px; padding: 0 20px; border-radius: 999px;
        font-size: 15px; width: auto;
    }
    .rp-act--phone { display: none; }
    .rp-act--icon { width: 56px; padding: 0; }
    .rp-act--icon .rp-act__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Рядом с фото места мало: «Сохранить» — иконкой (подпись остаётся для скринридера). */
@media (min-width: 1024px) {
    .rp-actions__fav.rp-act, .rp-actions__fav .rp-act { width: 56px; padding: 0; }
    .rp-actions__fav .rp-act__label, .rp-actions__fav.rp-act .rp-act__label {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
}

@media (min-width: 1024px) and (max-width: 1199.98px) {
    .rp-act--menu { width: 56px; padding: 0; }
    .rp-act--menu .rp-act__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Разделы на телефоне ---------- */
.rp-tabs {
    position: sticky; top: var(--rp-header); z-index: 20; display: flex;
    background: var(--rp-surface); border-block: 1px solid var(--rp-line);
}
.rp-tabs a {
    flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px;
    color: var(--rp-soft); font-size: 15px; font-weight: 600; text-decoration: none;
    box-shadow: inset 0 -3px 0 transparent;
}
.rp-tabs a.is-on { color: var(--rp-ink); box-shadow: inset 0 -3px 0 var(--rp-green); }
.rp-tabs { flex-wrap: wrap; }
.rp-tabs__wake {
    flex-basis: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 var(--rp-gutter);
    background: var(--rp-mint); color: var(--rp-forest); font-size: 14px; font-weight: 600;
}
.rp-tabs__wake .rp-link { margin-left: auto; min-height: 44px; color: var(--rp-forest); }
@media (min-width: 768px) { .rp-tabs { display: none; } }

/* ---------- Рабочая сетка ---------- */
.rp-work {
    display: grid; gap: 32px; padding: 24px 0 40px;
    grid-template-areas: "ingr" "steps" "rail";
}
.rp-ingr { grid-area: ingr; }
.rp-steps { grid-area: steps; }
.rp-rail { grid-area: rail; }
#ingredients, #steps, #nutrition, #rating { scroll-margin-top: calc(var(--rp-header) + 60px); }
@media (min-width: 768px) {
    .rp-work {
        grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
        grid-template-areas: "ingr steps" "ingr rail";
        column-gap: 32px; row-gap: 32px; align-items: start; padding-top: 8px;
    }
    .rp-ingr { position: sticky; top: calc(var(--rp-header) + 16px); }
    .rp-ingr.is-tall { position: static; }
    #ingredients, #steps, #nutrition, #rating { scroll-margin-top: calc(var(--rp-header) + 16px); }
}
@media (min-width: 1024px) { .rp-work { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } }
@media (min-width: 1200px) {
    .rp-work {
        grid-template-columns: 320px minmax(0, 1fr) 288px;
        grid-template-areas: "ingr steps rail";
        padding-bottom: 64px;
    }
}

.rp-card { background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 20px; padding: 20px; }
@media (min-width: 768px) { .rp-card { border-radius: 24px; padding: 24px; } }
/* Телефон: состав и пищевая ценность идут лентой, без рамки — как в макете. */
@media (max-width: 767.98px) {
    .rp-ingr.rp-card, .rp-nutri.rp-card { background: none; border: 0; border-radius: 0; padding: 0; }
}

/* ---------- Ингредиенты ---------- */
.rp-ingr { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rp-ingr__head { display: flex; flex-direction: column; gap: 10px; }
.rp-yield { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-yield__label { font-size: 15px; font-weight: 600; white-space: nowrap; }
.rp-stepper {
    display: inline-flex; align-items: center; height: 48px; flex: none;
    border: 1.5px solid var(--rp-border); border-radius: 999px; background: var(--rp-surface);
}
.rp-stepper__btn {
    width: 48px; height: 45px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; background: none; color: var(--rp-ink); padding: 0;
}
.rp-stepper__btn:hover:not(:disabled) { background: var(--rp-sand); }
.rp-stepper__btn:disabled { color: var(--rp-ctrl); opacity: 0.45; cursor: not-allowed; }
.rp-stepper__value {
    min-width: 88px; text-align: center; font-size: 16px; font-weight: 700;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rp-ingr__hint { margin: -2px 0 0; font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-ingr__hint--on { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; color: var(--rp-forest); }

.rp-switch {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px;
    border: 1px solid var(--rp-line); border-radius: 16px; background: var(--rp-surface); cursor: pointer;
}
.rp-switch:has(input:focus-visible) { outline: 3px solid var(--rp-green); outline-offset: 2px; }
.rp-switch__icon { color: var(--rp-green); }
.rp-switch__text { flex: 1; display: flex; flex-direction: column; font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-switch__text b { font-size: 15px; line-height: 20px; color: var(--rp-ink); font-weight: 700; }
.rp-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rp-switch__track {
    position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px;
    background: var(--rp-ctrl); transition: background-color 0.15s;
}
.rp-switch__track span {
    position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px;
    background: #FFFFFF; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 0.15s;
}
.rp-switch__input:checked + .rp-switch__track { background: var(--rp-green); }
.rp-switch__input:checked + .rp-switch__track span { transform: translateX(20px); }
@media (min-width: 1200px) { .rp-switch { display: none !important; } }

.rp-ingr__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rp-line); }
.rp-ingr__row {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0;
    border-bottom: 1px solid var(--rp-line); cursor: pointer;
}
.rp-ingr__row:has(input:focus-visible) { outline: 3px solid var(--rp-green); outline-offset: 2px; border-radius: 8px; }
.rp-check {
    width: 24px; height: 24px; flex: none; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--rp-ctrl); border-radius: 7px; background: var(--rp-surface); color: #FFFFFF;
}
.rp-check .rp-icon { opacity: 0; }
.rp-ingr__row.is-done .rp-check { background: var(--rp-green); border-color: var(--rp-green); }
.rp-ingr__row.is-done .rp-check .rp-icon { opacity: 1; }
.rp-ingr__name { flex: 1; min-width: 0; font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }
.rp-ingr__row.is-done .rp-ingr__title { text-decoration: line-through; color: var(--rp-soft); }
.rp-ingr__note { display: block; font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-tag {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
    background: var(--rp-sand); color: var(--rp-soft); font-size: 12px; font-weight: 600;
    vertical-align: 1px; white-space: nowrap;
}
.rp-ingr__qty {
    flex: none; max-width: 45%; text-align: right; font-size: 16px; line-height: 22px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.rp-ingr__row.is-done .rp-ingr__qty { color: var(--rp-soft); }
.rp-ingr__foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 32px; font-size: 14px; color: var(--rp-soft);
}
.rp-ingr__foot b { color: var(--rp-ink); }
.rp-ingr__check { margin: 0; font-size: 13px; line-height: 18px; color: var(--rp-soft); }

/* «Скопировать» и «В покупки»: телефон — в ряд; 768–1199 — столбиком; от 1200 — как в макете. */
.rp-ingr__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rp-ingr__actions.is-single { grid-template-columns: minmax(0, 1fr); }
.rp-ingr__actions .rp-btn { min-height: 48px; padding: 0 12px; gap: 8px; font-size: 15px; white-space: nowrap; }
.rp-ingr__actions .rp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rp-ingr__copy { order: -1; }
.rp-wide { display: none; }
@media (min-width: 768px) {
    .rp-ingr__actions { grid-template-columns: minmax(0, 1fr); }
    .rp-ingr__copy { order: 0; }
    .rp-wide { display: inline; }
    .rp-narrow { display: none; }
}
@media (min-width: 1200px) {
    .rp-ingr__actions { gap: 2px; }
    .rp-ingr__copy { min-height: 44px; border-color: transparent; background: none; color: var(--rp-green); font-size: 14px; font-weight: 700; }
    .rp-ingr__copy:hover { border-color: transparent; color: var(--rp-forest); text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- Шаги ---------- */
.rp-steps { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rp-steps__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rp-steps__count { font-size: 14px; color: var(--rp-soft); white-space: nowrap; }
.rp-steps__time { margin: -6px 0 0; font-size: 14px; line-height: 20px; color: var(--rp-soft); }
.rp-progress { display: flex; flex-direction: column; gap: 8px; }
.rp-progress__text { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--rp-soft); }
.rp-progress__text b { color: var(--rp-ink); }
.rp-progress__bar { height: 8px; border-radius: 999px; background: var(--rp-sand); overflow: hidden; }
.rp-progress__bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--rp-green); transition: width 0.25s; }
.rp-note {
    margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--rp-honey);
    color: #5C3D12; font-size: 14px; line-height: 20px;
}
.rp-steps__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rp-step {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px 0;
    border-top: 1px solid var(--rp-line);
}
.rp-steps__list > .rp-step:first-child { border-top: 0; padding-top: 4px; }
.rp-step__num {
    width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--rp-ctrl); border-radius: 999px; background: var(--rp-surface);
    color: var(--rp-ink); font-size: 17px; font-weight: 800;
}
.rp-step.is-current .rp-step__num { border-color: var(--rp-green); color: var(--rp-green); }
.rp-step.is-done .rp-step__num { border-color: var(--rp-green); background: var(--rp-green); color: #FFFFFF; }
.rp-step__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rp-step__title {
    font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--rp-soft);
}
.rp-step.is-current .rp-step__title, .rp-step.is-done .rp-step__title { color: var(--rp-green); }
.rp-step__text { margin: 0; font-size: 17px; line-height: 1.6; color: var(--rp-ink); overflow-wrap: anywhere; }
.rp-step.is-done .rp-step__text { color: var(--rp-soft); }
.rp-amt { font-weight: 800; white-space: nowrap; }
/* «100 мл тёплой воды» переносится между словами; число от единицы не отрывается (неразрывный пробел). */
.rp-amt--phrase { white-space: normal; }
.rp-step__photos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rp-step__photo {
    display: block; width: 112px; height: 80px; padding: 0; overflow: hidden;
    border: 0; border-radius: 12px; background: var(--rp-sand); cursor: zoom-in;
}
.rp-step__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rp-step__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.rp-step__time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--rp-soft); }
.rp-steps__hint { margin: 0; font-size: 14px; line-height: 20px; color: var(--rp-soft); }
.rp-empty-steps p { margin: 0; font-size: 15px; line-height: 22px; color: var(--rp-soft); }
.rp-steps__folded {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0;
    border: 0; background: none; color: var(--rp-soft); font-size: 15px; font-weight: 600; text-align: left;
}
.rp-steps__folded-num {
    width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--rp-green); color: #FFFFFF;
}
/* Телефон у плиты: прогресс — под шагами, сделанные в прошлый раз шаги свёрнуты. */
@media (max-width: 767.98px) {
    .rp-steps__folded { order: 1; }
    .rp-steps__list { order: 2; }
    .rp-progress { order: 3; }
    .rp-steps__hint { order: 4; }
    .rp-steps > .rp-rating { order: 5; }
    .rp-step.is-folded { display: none; }
}
@media (min-width: 768px) { .rp-steps__folded { display: none !important; } }
@media (min-width: 768px) { .rp-step__text { font-size: 18px; } }
/* От 1200 — шаги карточками, текущий в рамке (вариант Б). */
@media (min-width: 1200px) {
    .rp-steps__list { gap: 12px; }
    .rp-step, .rp-steps__list > .rp-step:first-child {
        gap: 16px; padding: 20px 22px; background: var(--rp-surface);
        border: 1px solid var(--rp-line); border-radius: 20px;
    }
    .rp-step.is-current, .rp-steps__list > .rp-step.is-current:first-child { border: 2px solid var(--rp-green); padding: 19px 21px; }
    .rp-step__text { font-size: 17px; }
}

.rp-timer {
    display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px;
    background: var(--rp-forest); color: var(--rp-on-dark);
}
.rp-timer.is-done { background: #8A3A12; }
.rp-timer__top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #DCD5CA; }
.rp-timer__label { font-weight: 700; color: var(--rp-on-dark); }
.rp-timer__time { font-size: 44px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.rp-timer__bar { height: 6px; border-radius: 999px; background: rgb(243 237 228 / 0.2); overflow: hidden; }
.rp-timer__bar span { display: block; height: 100%; width: 0; background: var(--rp-mint-line); border-radius: 999px; }
.rp-timer__row { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-timer .rp-btn { min-height: 44px; padding: 0 16px; font-size: 15px; }

/* ---------- Оценка ---------- */
.rp-rating {
    margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "avg" "stars" "thanks"; gap: 14px; padding: 20px;
    border-radius: 20px; background: var(--rp-honey); border: 1px solid var(--rp-honey-line);
    transition: border-color 0.2s, box-shadow 0.2s;
}
/* Плашка средней оценки — справа от заголовка на компьютере, под текстом на телефоне. */
.rp-rating #rating-widget, .rp-rating .rp-rate { display: contents; }
.rp-rating__head { grid-area: head; }
.rp-rating .rp-rate__stats { grid-area: avg; justify-self: start; }
.rp-rating .rp-rate__stars { grid-area: stars; }
.rp-rating .rp-rate__thanks { grid-area: thanks; margin: 0; font-size: 14px; line-height: 20px; }
@media (min-width: 1024px) {
    .rp-rating { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head avg" "stars stars" "thanks thanks"; column-gap: 16px; }
    .rp-rating .rp-rate__stats { justify-self: end; }
    .rp-rating:has(.rp-rate__none) { grid-template-areas: "head head" "avg avg" "stars stars" "thanks thanks"; }
    .rp-rating:has(.rp-rate__none) .rp-rate__stats { justify-self: start; }
}
.rp-rating.is-prompt { border-color: var(--rp-star); box-shadow: 0 0 0 3px rgb(180 116 28 / 0.18); }
.rp-rating__head p { margin: 6px 0 0; font-size: 15px; line-height: 22px; color: var(--rp-soft); }
.rp-rate__stars { display: flex; gap: 2px; margin-left: -6px; }
.rp-rate__star {
    width: 52px; height: 52px; padding: 0; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 12px; background: none; color: var(--rp-star);
}
.rp-rate__star:hover { background: rgb(180 116 28 / 0.1); }
.rp-rate__star.is-on svg { fill: currentColor; }
/* Наведение: подсвечиваются звёзды до наведённой включительно. */
.rp-rate__stars:hover .rp-rate__star svg { fill: none; }
.rp-rate__stars .rp-rate__star:hover svg,
.rp-rate__stars .rp-rate__star:has(~ .rp-rate__star:hover) svg { fill: currentColor; }
.rp-rate__stats { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; line-height: 20px; }
.rp-rate__avg {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
    border-radius: 999px; background: var(--rp-surface); border: 1px solid var(--rp-honey-line); color: var(--rp-soft);
}
.rp-rate__avg svg { color: var(--rp-star); flex: none; }
.rp-rate__avg b { color: var(--rp-ink); }
.rp-rate__none { color: var(--rp-soft); }
.rp-rate__thanks { color: var(--rp-forest); font-weight: 700; }
.rp-rate__avg { white-space: nowrap; }
@media (min-width: 768px) { .rp-rating { padding: 22px 24px 20px; } }

/* ---------- Правая колонка ---------- */
.rp-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1024px) and (max-width: 1199.98px) {
    .rp-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .rp-rail > .rp-nutri { grid-row: span 2; }
}
.rp-tip {
    display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 20px;
    background: var(--rp-forest); color: var(--rp-on-dark);
}
.rp-tip__who { display: flex; align-items: center; gap: 12px; }
.rp-tip__who img { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; object-position: 50% 18%; background: var(--rp-mint); flex: none; }
.rp-tip__who > span { display: flex; flex-direction: column; gap: 2px; }
.rp-tip__who b { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rp-mint-line); }
.rp-tip__who span span { font-size: 13px; color: rgb(243 237 228 / 0.8); }
.rp-tip p { margin: 0; font-size: 15px; line-height: 1.6; }
@media (max-width: 767.98px) { .rp-tip p { font-size: 16px; } }

.rp-nutri { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rp-nutri__basis { margin: -6px 0 0; font-size: 14px; color: var(--rp-soft); }
.rp-nutri__missing { margin: 0; font-size: 14px; line-height: 20px; color: var(--rp-soft); }
.rp-kbju {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
    background: var(--rp-line); border: 1px solid var(--rp-line); border-radius: 14px; overflow: hidden;
}
.rp-kbju__cell { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--rp-surface); }
.rp-kbju__val { font-size: 20px; line-height: 26px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-kbju__lab { font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-portion {
    margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 12px 14px;
    border-radius: 14px; background: var(--rp-sand); font-size: 14px; line-height: 20px;
}
.rp-portion b { font-size: 15px; }
.rp-portion > span:nth-of-type(1) { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.rp-portion__meta { flex-basis: 100%; color: var(--rp-soft); }
.rp-nutri__note { margin: 0; font-size: 13px; line-height: 18px; color: var(--rp-soft); }

.rp-calc { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--rp-line); }
.rp-calc__title { font-size: 16px; line-height: 22px; font-weight: 800; }
.rp-calc__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rp-field__label { font-size: 13px; line-height: 18px; font-weight: 600; }
.rp-field__box { position: relative; display: block; }
.rp-field__box input {
    width: 100%; height: 48px; padding: 0 34px 0 14px; border: 1.5px solid var(--rp-ctrl); border-radius: 12px;
    background: var(--rp-surface); color: var(--rp-ink); font: 700 17px/1 var(--rp-sans);
    font-variant-numeric: tabular-nums; appearance: none;
}
.rp-field__box input:focus-visible { outline: 3px solid var(--rp-green); outline-offset: 1px; border-color: var(--rp-green); }
.rp-field__box input::placeholder { color: var(--rp-soft); font-weight: 500; font-size: 15px; }
.rp-field__box > span {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: var(--rp-soft); pointer-events: none;
}
.rp-field__hint { font-size: 12px; line-height: 16px; color: var(--rp-soft); }
.rp-calc__result { display: block; padding: 14px 16px; border-radius: 14px; background: var(--rp-mint); color: var(--rp-forest); }
.rp-calc__inner { display: flex; flex-direction: column; gap: 8px; }
.rp-calc__inner { gap: 6px; }
.rp-calc__label { font-size: 13px; line-height: 18px; font-weight: 700; }
.rp-calc__kcal { font-size: 26px; line-height: 32px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-calc__bju { margin-top: 4px; }
.rp-calc__bju { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12px; line-height: 16px; }
.rp-calc__bju b { display: block; font-size: 16px; line-height: 22px; font-variant-numeric: tabular-nums; }
.rp-calc__per100 { padding-top: 8px; border-top: 1px solid rgb(33 61 47 / 0.18); font-size: 13px; line-height: 18px; }
.rp-calc__empty { display: block; font-size: 14px; line-height: 20px; }

/* Код «Готовить с телефона» — только на компьютере, когда он готов (x-show). */
.rp-qr { align-items: center; gap: 14px; padding: 16px; }
@media (max-width: 1199.98px) { .rp-qr { display: none !important; } }
@media (min-width: 1200px) { .rp-qr { display: flex; } }
.rp-qr__code { width: 96px; height: 96px; flex: none; }
.rp-qr__code svg { display: block; width: 100%; height: 100%; border-radius: 6px; }
.rp-qr__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-qr__title { font-size: 15px; line-height: 20px; font-weight: 700; font-family: var(--rp-sans); }
.rp-qr__text p { margin: 0; font-size: 13px; line-height: 18px; color: var(--rp-soft); }

.rp-collections { display: flex; flex-direction: column; gap: 12px; }
.rp-collections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rp-coll {
    display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px;
    border: 1px solid var(--rp-line); color: var(--rp-ink); text-decoration: none;
}
.rp-coll:hover { border-color: var(--rp-ctrl); }
.rp-coll.is-owned { border-color: #E2B9C9; background: #FBF3F6; }
.rp-coll img, .rp-coll__ph { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; }
.rp-coll__ph { display: flex; align-items: center; justify-content: center; background: var(--rp-sand); color: var(--rp-soft); }
.rp-coll__text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--rp-soft); }
.rp-coll__text b { font-size: 15px; color: var(--rp-ink); overflow-wrap: anywhere; }

/* ---------- Похожие ---------- */
.rp-related { display: flex; flex-direction: column; gap: 16px; padding: 32px 0 56px; border-top: 1px solid var(--rp-line); }
/* Заголовок и ссылка не помещаются в строку — ссылка уходит вниз, слово заголовка не рвётся. */
.rp-related__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
.rp-related__head .rp-h2 { overflow-wrap: normal; }
.rp-related__more {
    display: inline-flex; align-items: center; gap: 4px; min-height: 44px; flex: none;
    color: var(--rp-green); font-size: 15px; font-weight: 700; text-decoration: none;
}
.rp-related__more:hover { color: var(--rp-forest); text-decoration: underline; text-underline-offset: 3px; }
.rp-related__grid {
    display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--rp-gutter)); padding-inline: var(--rp-gutter); scroll-padding-inline: var(--rp-gutter);
}
.rp-related__grid::-webkit-scrollbar { display: none; }
.rp-related__grid > * { scroll-snap-align: start; }
@media (min-width: 768px) {
    .rp-related__grid {
        grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
        overflow: visible; margin-inline: 0; padding-inline: 0;
    }
}
@media (min-width: 1024px) { .rp-related__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Нижняя панель на телефоне ---------- */
.rp-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgb(247 243 238 / 0.96); backdrop-filter: blur(8px); border-top: 1px solid var(--rp-line);
}
.rp-dock__save {
    width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; padding: 0;
    border: 1.5px solid var(--rp-border); border-radius: 999px; background: var(--rp-surface); color: var(--rp-ink);
}
.rp-dock__save[aria-pressed="true"] { color: var(--rp-club); border-color: #E2B9C9; }
.rp-dock__cook { flex: 1; min-width: 0; min-height: 56px; padding: 0 14px; font-size: 16px; gap: 8px; white-space: nowrap; }
@media (max-width: 767.98px) { body:has(.rp-dock) footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); } }
@media (min-width: 768px) { .rp-dock { display: none !important; } }

/* ---------- Лист «В меню» ---------- */
.rp-sheet {
    width: 100%; max-width: 100vw; max-height: 92dvh; margin: auto auto 0; padding: 0;
    border: 0; background: transparent; color: var(--rp-ink); font-family: var(--rp-sans);
}
.rp-sheet::backdrop { background: rgb(31 42 36 / 0.45); }
.rp-sheet__body {
    display: flex; flex-direction: column; gap: 16px; max-height: 92dvh; overflow-y: auto;
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    background: var(--rp-surface); border-radius: 24px 24px 0 0;
}
.rp-sheet__handle { align-self: center; width: 40px; height: 4px; border-radius: 999px; background: var(--rp-border); }
.rp-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-icon-btn {
    width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; background: var(--rp-sand); color: var(--rp-ink); padding: 0;
}
.rp-sheet__recipe { margin: -4px 0 0; display: flex; align-items: center; gap: 12px; }
.rp-sheet__recipe img { width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; background: #E9DCC6; }
.rp-sheet__recipe > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-sheet__recipe b { font-size: 15px; line-height: 20px; color: var(--rp-ink); }
.rp-sheet__text { margin: -4px 0 0; font-size: 15px; line-height: 22px; color: var(--rp-soft); }
.rp-sheet__group { position: relative; margin: 0; padding: 0; border: 0; min-width: 0; }
/* legend рисуется над содержимым fieldset: «сегодня» ставим на его строку снизу вверх. */
.rp-sheet__today {
    position: absolute; bottom: calc(100% + 8px); right: 0; display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; line-height: 20px; color: var(--rp-soft);
}
.rp-sheet__today i, .rp-day__dot { width: 6px; height: 6px; border-radius: 9px; background: var(--rp-green); }
.rp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.rp-day { position: relative; display: flex; min-width: 0; }
.rp-day__box {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 64px; border: 1.5px solid var(--rp-border); border-radius: 14px; background: var(--rp-surface); cursor: pointer;
}
.rp-day__name { font-size: 13px; line-height: 16px; font-weight: 600; }
.rp-day__num { font-size: 18px; line-height: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp-day.is-past .rp-day__box { background: var(--rp-sand); border-color: var(--rp-sand); color: var(--rp-soft); }
.rp-day.is-locked .rp-day__box { background: var(--rp-sand); border-color: var(--rp-sand); color: var(--rp-soft); cursor: not-allowed; }
.rp-day__lock { position: absolute; top: 4px; right: 4px; display: flex; color: var(--rp-club); }
.rp-day input:checked + .rp-day__box { background: var(--rp-forest); border-color: var(--rp-forest); color: #FFFFFF; }
.rp-day input:checked + .rp-day__box .rp-day__dot { background: #FFFFFF; }
.rp-day input:focus-visible + .rp-day__box { outline: 3px solid var(--rp-green); outline-offset: 2px; }
.rp-sheet__club { margin: 8px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-sheet__club .rp-icon { color: var(--rp-club); }
.rp-sheet__club a { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; color: var(--rp-green); font-weight: 700; }
.rp-sheet .rp-seg:not(.rp-seg--days) {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 4px;
    border-radius: 999px; background: var(--rp-sand);
}
.rp-sheet .rp-seg:not(.rp-seg--days) .rp-seg__opt span {
    padding: 0 4px; border: 0; border-radius: 999px; background: transparent; color: var(--rp-soft); font-size: 14px;
}
.rp-sheet .rp-seg:not(.rp-seg--days) .rp-seg__opt input:checked + span {
    background: var(--rp-surface); color: var(--rp-ink); font-weight: 700; box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}
.rp-sheet__legend-col { display: flex; flex-direction: column; }
.rp-sheet__sub { font-size: 13px; line-height: 18px; color: var(--rp-soft); }
.rp-sheet__link--btn { width: 100%; border: 0; background: none; }
.rp-sheet__group legend, .rp-sheet__legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.rp-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-seg--days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rp-seg__opt { position: relative; display: flex; }
.rp-seg__opt span {
    flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
    border: 1.5px solid var(--rp-border); border-radius: 12px; background: var(--rp-surface);
    font-size: 15px; font-weight: 600; cursor: pointer;
}
.rp-seg--days .rp-seg__opt span { padding: 0; }
.rp-seg__opt input:checked + span { background: var(--rp-forest); border-color: var(--rp-forest); color: #FFFFFF; }
.rp-seg__opt input:focus-visible + span { outline: 3px solid var(--rp-green); outline-offset: 2px; }
.rp-sheet__portions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-sheet__portions .rp-sheet__legend { margin: 0; }
.rp-sheet__portions .rp-stepper__value { min-width: 48px; }
.rp-sheet__result:empty { display: none; }
.rp-sheet__link {
    display: flex; align-items: center; justify-content: center; min-height: 44px;
    color: var(--rp-green); font-size: 15px; font-weight: 700; text-decoration: none;
}
@media (min-width: 768px) {
    .rp-sheet { width: 440px; margin: auto; }
    .rp-sheet__body { padding: 24px; border-radius: 24px; }
    .rp-sheet__handle { display: none; }
}

/* ---------- Подсказка внизу и просмотр фото ---------- */
.rp-toast {
    position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 60;
    transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
    display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 16px;
    background: var(--rp-ink); color: #FFFFFF; font-size: 14px; line-height: 20px; font-weight: 600;
    box-shadow: 0 8px 24px rgb(31 42 36 / 0.2);
}
.rp-toast__link {
    flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none;
    color: var(--rp-mint-line); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
@media (min-width: 768px) { .rp-toast { bottom: 24px; } }
/* Сообщение в верхнем слое (поверх открытого окна): снимаем умолчания браузера для popover. */
.rp-toast[popover] { top: auto; right: auto; margin: 0; border: 0; overflow: visible; }
.rp-lightbox {
    position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgb(0 0 0 / 0.9);
}
.rp-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.rp-lightbox__close, .rp-lightbox__nav {
    position: absolute; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.15); color: #FFFFFF; padding: 0;
}
.rp-lightbox__close { top: 12px; right: 12px; }
.rp-lightbox__nav { top: 50%; transform: translateY(-50%); }
.rp-lightbox__nav--prev { left: 12px; }
.rp-lightbox__nav--next { right: 12px; }
.rp-lightbox__count {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    padding: 4px 12px; border-radius: 999px; background: rgb(0 0 0 / 0.45); color: #FFFFFF; font-size: 14px;
}

/* ---------- Закрытый рецепт клуба ---------- */
.rp-ingr__row--static, .rp-ingr__row--skel { cursor: default; }
.rp-ingr__row--skel .rp-check { border: 0; background: var(--rp-sand); }
.rp-skel { display: block; height: 12px; border-radius: 6px; background: var(--rp-sand); width: var(--w, 100%); }
.rp-ingr__row--skel .rp-skel:not(.rp-skel--qty) { flex: 0 1 var(--w); }
.rp-skel--qty { width: 44px; flex: none; margin-left: auto; }
.rp-gate-more { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--rp-soft); }
.rp-step--skel { opacity: var(--fade, 1); }
.rp-step--skel .rp-step__num { border-color: var(--rp-line); color: var(--rp-ctrl); }
.rp-step--skel .rp-step__body { gap: 10px; padding-top: 4px; }
.rp-club {
    display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 24px;
    background: var(--rp-forest); color: var(--rp-on-dark);
}
.rp-eyebrow { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rp-mint-line); }
/* Без выравнивания строк: «Полный рецепт —» / «в клубе», а не «Полный» / «рецепт — в клубе». */
.rp-club .rp-h2 { font-size: 26px; text-wrap: wrap; }
.rp-club__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 21px; }
.rp-club__list li { display: flex; gap: 10px; }
.rp-club__list .rp-icon { color: var(--rp-mint-line); margin-top: 1px; }
.rp-club__price {
    margin: 4px 0 0; padding-top: 16px; border-top: 1px solid rgb(243 237 228 / 0.2);
    display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 22px;
}
.rp-club__price b { font-size: 24px; line-height: 30px; }
.rp-club__alt { color: rgb(243 237 228 / 0.8); }
.rp-club__login {
    align-self: center; display: inline-flex; align-items: center; min-height: 44px;
    color: var(--rp-on-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .recipe-page *, .recipe-page *::before, .recipe-page *::after { transition: none !important; animation: none !important; }
}
@media print {
    .rp-tabs, .rp-dock, .rp-actions, .rp-rating, .rp-related, .rp-switch, .rp-toast, .rp-resume, .rp-qr, .rp-ingr__actions { display: none !important; }
}
