/* Раздел «Рецепты»: карточки, подборки, баннер после тренировки и карточка рецепта.
   Палитра: тёмные поверхности, янтарный акцент, мятный/голубой/коралловый для категорий.
   Раскладка: ряды фильтров прокручиваются от края до края, список рецептов
   показывается страницами, низ экрана не перекрывается нижней навигацией. */

.rx-screen {
  --rx-card: rgba(255, 255, 255, .045);
  --rx-card-strong: rgba(255, 255, 255, .075);
  --rx-line: rgba(255, 255, 255, .09);
  --rx-text: #f4f7f8;
  --rx-muted: #9fb0bd;
  --rx-amber: #f7b955;
  --rx-mint: #55e0ac;
  --rx-sky: #62cfff;
  --rx-coral: #ff8a5c;
  --rx-radius: 18px;
  --rx-pad: 16px;
  color: var(--rx-text);
  padding: 16px var(--rx-pad) calc(104px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 420px) { .rx-screen { --rx-pad: 14px; } }

/* ── Шапка и поиск ─────────────────────────────────────────────────────── */
.rx-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rx-head-text { flex: 1; min-width: 0; }
.rx-head-text h2 { font-size: 20px; font-weight: 900; color: var(--rx-text); }
.rx-head-text p { font-size: 12px; color: var(--rx-muted); margin-top: 2px; }
.rx-icon-btn {
  width: 44px; height: 44px; flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 1px solid var(--rx-line); background: var(--rx-card); color: var(--rx-muted);
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.rx-icon-btn.is-active { color: var(--rx-coral); border-color: rgba(255, 138, 92, .45); background: rgba(255, 138, 92, .12); }
.rx-icon-btn:hover { color: var(--rx-text); border-color: rgba(255, 255, 255, .22); }
.rx-search { margin-bottom: 10px; }

/* ── Фильтры ───────────────────────────────────────────────────────────── */
.rx-chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  margin: 0 calc(-1 * var(--rx-pad)); padding: 2px var(--rx-pad) 10px;
}
.rx-chips::-webkit-scrollbar { display: none; }
.rx-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 38px; padding: 0 13px; white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--rx-line); background: var(--rx-card);
  color: var(--rx-muted); font-size: 13px; font-weight: 700; scroll-snap-align: start;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .12s ease;
}
.rx-chip i { font-size: 11px; }
.rx-chip:active { transform: translateY(1px); }
.rx-chip:focus-visible { outline: 2px solid var(--rx-amber); outline-offset: 2px; }
.rx-chip.is-active { color: #201503; background: var(--rx-amber); border-color: transparent; }
.rx-active-filter {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
  padding: 10px 14px; border-radius: 14px; background: rgba(247, 185, 85, .12); border: 1px solid rgba(247, 185, 85, .3);
}
.rx-active-filter span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--rx-amber); }
.rx-link { background: none; border: 0; padding: 4px 0; color: var(--rx-amber); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ── Подборки ──────────────────────────────────────────────────────────── */
.rx-collection { margin: 4px 0 16px; }
.rx-collection-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rx-collection-head i { color: var(--rx-amber); font-size: 13px; }
.rx-collection-head h3 { flex: 1; font-size: 14px; font-weight: 800; color: var(--rx-text); }
.rx-collection-head span { font-size: 12px; color: var(--rx-muted); }
.rx-collection-row {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  margin: 0 calc(-1 * var(--rx-pad)); padding: 0 var(--rx-pad) 6px;
}
.rx-collection-row::-webkit-scrollbar { display: none; }
.rx-mini {
  flex: 0 0 224px; min-height: 76px; text-align: left; padding: 10px; border-radius: 14px;
  border: 1px solid var(--rx-line); background: var(--rx-card); display: flex; align-items: center; gap: 10px;
  scroll-snap-align: start;
}
.rx-mini-image { width: 48px; height: 54px; flex: 0 0 48px; object-fit: cover; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.rx-mini-image.is-broken { opacity: 0; }
.rx-mini-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rx-mini strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 800; color: var(--rx-text); }
.rx-mini-copy > span { font-size: 11px; color: var(--rx-muted); }
.rx-mini:hover { border-color: rgba(255, 255, 255, .2); background: var(--rx-card-strong); }

/* ── Список рецептов ───────────────────────────────────────────────────── */
.rx-section-title { font-size: 14px; font-weight: 800; color: var(--rx-text); margin: 4px 0 6px; }
.rx-count-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.rx-count { font-size: 12px; color: var(--rx-muted); }
.rx-count-row .rx-link { font-size: 12.5px; }
.rx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .rx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .rx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rx-card {
  position: relative; border-radius: var(--rx-radius); border: 1px solid var(--rx-line); background: var(--rx-card); overflow: hidden;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}
.rx-card-main { display: block; width: 100%; text-align: left; padding: 10px 10px 14px; background: none; border: 0; color: inherit; }
.rx-card:hover { border-color: rgba(255, 255, 255, .2); background: var(--rx-card-strong); }
.rx-card:active { transform: scale(.99); }
.rx-cover {
  position: relative; display: flex; align-items: center; justify-content: center; height: 92px; border-radius: 14px;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02));
}
.rx-cover i { font-size: 28px; opacity: .92; color: var(--rx-amber); }
.rx-cover[data-tint="amber"], .rx-sheet-hero[data-tint="breakfast"] { background-image: linear-gradient(135deg, rgba(247, 185, 85, .3), rgba(247, 185, 85, .06)); }
.rx-cover[data-tint="emerald"], .rx-sheet-hero[data-tint="main"] { background-image: linear-gradient(135deg, rgba(85, 224, 172, .3), rgba(85, 224, 172, .06)); }
.rx-cover[data-tint="sky"], .rx-sheet-hero[data-tint="light"] { background-image: linear-gradient(135deg, rgba(98, 207, 255, .3), rgba(98, 207, 255, .06)); }
.rx-cover[data-tint="coral"], .rx-sheet-hero[data-tint="sport"] { background-image: linear-gradient(135deg, rgba(255, 138, 92, .3), rgba(255, 138, 92, .06)); }
.rx-cover[data-tint="emerald"] i, .rx-sheet-hero[data-tint="main"] i { color: var(--rx-mint); }
.rx-cover[data-tint="sky"] i, .rx-sheet-hero[data-tint="light"] i { color: var(--rx-sky); }
.rx-cover[data-tint="coral"] i, .rx-sheet-hero[data-tint="sport"] i { color: var(--rx-coral); }
.rx-cover-cat {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px;
  background: rgba(8, 16, 22, .72); color: var(--rx-text); font-size: 10px; font-weight: 700;
}
.rx-card-body { display: block; padding-top: 10px; }
.rx-card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 34px; font-size: 13.5px; font-weight: 800; line-height: 1.25; color: var(--rx-text);
}
.rx-card-meta { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--rx-muted); }
.rx-card-meta i { font-size: 10px; }
.rx-card-meta em { font-style: normal; color: var(--rx-amber); font-weight: 800; }
.rx-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.rx-tag { padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--rx-muted); font-size: 10.5px; font-weight: 600; }
.rx-fav {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(8, 16, 22, .66); color: rgba(255, 255, 255, .5);
}
.rx-fav.is-on { color: var(--rx-coral); border-color: rgba(255, 138, 92, .5); }
.rx-more {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px;
  margin-top: 14px; padding: 0 16px; border-radius: 16px; border: 1px dashed var(--rx-line);
  background: var(--rx-card); color: var(--rx-text); font-size: 13.5px; font-weight: 700;
  transition: border-color .16s ease, background .16s ease;
}
.rx-more:hover { border-color: rgba(255, 255, 255, .24); background: var(--rx-card-strong); }
.rx-more i { color: var(--rx-amber); font-size: 12px; }

.rx-empty { text-align: center; padding: 34px 18px; border-radius: var(--rx-radius); border: 1px dashed var(--rx-line); background: var(--rx-card); }
.rx-empty i { font-size: 26px; color: var(--rx-amber); }
.rx-empty h3 { margin-top: 12px; font-size: 16px; font-weight: 800; }
.rx-empty p { margin: 8px auto 16px; max-width: 320px; font-size: 13px; line-height: 1.5; color: var(--rx-muted); }

/* ── Баннер «после тренировки» ─────────────────────────────────────────── */
.rx-banner { border-radius: var(--rx-radius); border: 1px solid rgba(247, 185, 85, .32); background: rgba(247, 185, 85, .1); padding: 12px 14px; margin-bottom: 12px; }
.rx-banner-idle { display: flex; align-items: center; gap: 12px; border-color: var(--rx-line); background: var(--rx-card); }
.rx-banner-idle i { font-size: 18px; color: var(--rx-amber); }
.rx-banner-idle strong { display: block; font-size: 13.5px; font-weight: 800; }
.rx-banner-idle p { margin-top: 3px; font-size: 12px; color: var(--rx-muted); }
.rx-banner-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--rx-amber); text-transform: uppercase; letter-spacing: .04em; }
.rx-banner-reason { margin: 6px 0 8px; font-size: 12.5px; line-height: 1.45; color: var(--rx-text); }
.rx-banner-card { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(247, 185, 85, .3); background: rgba(8, 16, 22, .5); }
.rx-banner-card strong { display: block; font-size: 13.5px; font-weight: 800; color: var(--rx-text); }
.rx-banner-card span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--rx-muted); }
.rx-banner-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.rx-banner-actions .rx-link { padding: 6px 0; }

/* ── Карточка рецепта (лист) ───────────────────────────────────────────── */
body.rx-lock { overflow: hidden; }
.rx-sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.rx-sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(4, 10, 14, .72); backdrop-filter: blur(2px); }
.rx-sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: #0f1a23; border: 1px solid var(--rx-line); border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 44px rgba(0, 0, 0, .45); animation: rx-slide-up .22s ease;
}
@keyframes rx-slide-up { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) { .rx-sheet-wrap { align-items: center; } .rx-sheet { border-radius: 22px; border-bottom: 1px solid var(--rx-line); } }
.rx-sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(8, 16, 22, .7); color: var(--rx-text);
}
.rx-sheet-body { padding: 18px 18px 26px; }
.rx-sheet-hero { border-radius: 16px; padding: 16px 18px 18px; margin-bottom: 14px; background-image: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)); }
.rx-sheet-hero h2 { font-size: 20px; font-weight: 900; line-height: 1.2; margin-top: 8px; }
.rx-sheet-hero p { margin-top: 6px; font-size: 13px; color: rgba(244, 247, 248, .78); }
.rx-sheet-cat { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(8, 16, 22, .55); font-size: 11px; font-weight: 700; }
.rx-sheet-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--rx-muted); margin-bottom: 14px; }
.rx-sheet-meta i { margin-right: 6px; color: var(--rx-amber); }
.rx-macro-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.rx-macro-p { background: var(--rx-mint); }
.rx-macro-c { background: var(--rx-amber); }
.rx-macro-f { background: var(--rx-coral); }
.rx-macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.rx-macro-grid div { padding: 10px 8px; border-radius: 12px; background: var(--rx-card); text-align: center; }
.rx-macro-grid span { display: block; font-size: 10.5px; color: var(--rx-muted); text-transform: uppercase; letter-spacing: .04em; }
.rx-macro-grid strong { display: block; margin-top: 4px; font-size: 14px; font-weight: 800; }
.rx-servings { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--rx-card); margin-bottom: 18px; }
.rx-servings > span { font-size: 13px; color: var(--rx-muted); }
.rx-stepper { display: inline-flex; align-items: center; gap: 14px; }
.rx-stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rx-line); background: rgba(255, 255, 255, .05); color: var(--rx-text); }
.rx-stepper strong { min-width: 20px; text-align: center; font-size: 15px; font-weight: 800; }
.rx-sheet-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; margin: 0 0 10px; }
.rx-sheet-title i { color: var(--rx-amber); font-size: 12px; }
.rx-ingredients { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rx-ing { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--rx-line); background: var(--rx-card); color: var(--rx-text); font-size: 13.5px; text-align: left; }
.rx-ing em { font-style: normal; color: var(--rx-muted); font-size: 12.5px; }
.rx-ing.is-done { opacity: .5; }
.rx-ing.is-done span { text-decoration: line-through; }
.rx-steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: rx-step; display: flex; flex-direction: column; gap: 10px; }
.rx-steps li { position: relative; padding-left: 38px; font-size: 13.5px; line-height: 1.5; color: rgba(244, 247, 248, .92); }
.rx-steps li::before { counter-increment: rx-step; content: counter(rx-step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(247, 185, 85, .16); color: var(--rx-amber); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rx-tip { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(85, 224, 172, .1); border: 1px solid rgba(85, 224, 172, .26); margin-bottom: 16px; }
.rx-tip i { color: var(--rx-mint); margin-top: 2px; }
.rx-tip p { font-size: 12.5px; line-height: 1.5; color: rgba(244, 247, 248, .9); }
.rx-allergens { margin-bottom: 16px; }
.rx-allergens strong { display: block; font-size: 12px; color: var(--rx-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.rx-allergens div { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-meal-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rx-sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rx-sheet-actions .ng-btn-primary, .rx-sheet-actions .ng-btn-secondary { flex: 1 1 160px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.rx-sheet-post h2 { font-size: 19px; font-weight: 900; }
.rx-post-hero { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(247, 185, 85, .14); color: var(--rx-amber); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.rx-post-reason { margin: 10px 0 8px; font-size: 13.5px; line-height: 1.5; }
.rx-post-meta { margin-bottom: 16px; font-size: 12.5px; color: var(--rx-muted); }
.rx-post-alts { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.rx-post-alts > span { font-size: 12px; color: var(--rx-muted); text-transform: uppercase; letter-spacing: .04em; }
.rx-post-alts .rx-mini { flex: 1 1 auto; min-height: 56px; }
.rx-post-later { align-self: center; margin-top: 14px; color: var(--rx-muted); }

/* ── Фотографии блюд ───────────────────────────────────────────────────── */
.rx-cover { overflow: hidden; isolation: isolate; }
.rx-cover-image, .rx-sheet-hero-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  display: block; transition: transform .25s ease, opacity .2s ease;
}
.rx-cover-image { z-index: 0; }
.rx-cover-image.is-broken, .rx-sheet-hero-image.is-broken { opacity: 0; }
.rx-cover-shade, .rx-sheet-hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 12, 16, .08) 18%, rgba(7, 12, 16, .72) 100%);
}
.rx-cover-shade { z-index: 1; }
.rx-cover-fallback { position: relative; z-index: 2; opacity: .95; }
.rx-cover-cat { z-index: 3; }
.rx-card:hover .rx-cover-image { transform: scale(1.045); }
.rx-sheet-hero { position: relative; overflow: hidden; isolation: isolate; min-height: 156px; display: flex; flex-direction: column; justify-content: flex-end; }
.rx-sheet-hero-image { z-index: 0; }
.rx-sheet-hero-shade { z-index: 1; }
.rx-sheet-hero > :not(.rx-sheet-hero-image):not(.rx-sheet-hero-shade) { position: relative; z-index: 0; }
.rx-sheet-hero h2 { text-shadow: 0 1px 14px rgba(0, 0, 0, .45); }
.rx-sheet-hero p { text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }

/* ── Названия блюд видны целиком ───────────────────────────────────────────
 * Карточки рецептов — кнопки, а общее правило #screenContent button запрещает
 * перенос строк. Здесь перенос возвращается, а ограничение в 2 строки снято. */
#screenContent :is(.rx-mini, .rx-card-main, .rx-banner-card),
#screenContent :is(.rx-mini, .rx-card-main, .rx-banner-card) * {
  white-space: normal !important;
}
#screenContent :is(.rx-card-title, .rx-mini strong, .rx-banner-card strong) {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  overflow-wrap: break-word;
  hyphens: manual;
  text-wrap: pretty;
  font-size: 15px;
  line-height: 1.3;
}
.rx-card-title { min-height: calc(2 * 1.3em); }
/* Подборки: карточка растёт по высоте под длинное название. */
.rx-mini { flex-basis: 236px; min-height: 84px; align-items: center; height: auto; }
.rx-collection-row { align-items: stretch; }
/* Ряд подборок прокручивается от края до края, карточки начинаются у поля экрана. */
.rx-screen { --rx-pad: 4px; }
/* Название и подробности — по левому краю, как задумано в карточке. */
#screenContent :is(.rx-card-main, .rx-mini, .rx-mini-copy, .rx-card-title, .rx-mini strong) { text-align: left !important; }
#screenContent .rx-mini-copy { align-items: flex-start !important; }
