/*
 * Client Portal — оформление.
 *
 * Тёплая «кухонная» палитра, светлая и тёмная темы через prefers-color-scheme.
 * Акцент задаётся владельцем портала (branding.accentColor) и подставляется
 * в --accent из JS, поэтому все акцентные элементы берут цвет из переменной,
 * а не из литерала.
 *
 * Ширина сетки — мобильный-первый: телефон на кухне важнее, чем десктоп.
 */

:root {
  --accent: #e8590c;
  --accent-soft: rgba(232, 89, 12, 0.12);

  --bg: #faf8f5;
  --bg-elevated: #ffffff;
  --bg-sunken: #f2efe9;
  --text: #1c1a17;
  --text-muted: #7d766a;
  --border: #e6e1d8;
  --border-strong: #d6cfc2;
  --shadow: 0 1px 2px rgba(28, 26, 23, .05), 0 8px 24px rgba(28, 26, 23, .06);
  --shadow-lg: 0 12px 48px rgba(28, 26, 23, .18);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --topbar-h: 116px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --bg-elevated: #201d17;
    --bg-sunken: #100e0a;
    --text: #f2eee6;
    --text-muted: #9c9484;
    --border: #302b22;
    --border-strong: #423b2f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .6);
    --accent-soft: rgba(232, 89, 12, .18);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }

button, input, select, textarea { font: inherit; color: inherit; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

[hidden] { display: none !important; }

/* ─────────────────────────────── Кнопки ──────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { filter: brightness(1.07); }

.btn--ghost { border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-sunken); }

.btn--block { width: 100%; }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: 13px; }

.iconbtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--bg-sunken); color: var(--text); }
.iconbtn.is-on { color: var(--accent); background: var(--accent-soft); }

.iconbtn__badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
}

/* ──────────────────────────────── Вход ───────────────────────────────── */

.auth {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 460px at 50% -160px, var(--accent-soft), transparent 70%),
    var(--bg);
}

.auth__card {
  width: 100%; max-width: 380px;
  padding: 32px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth__brand { text-align: center; margin-bottom: 24px; }
.auth__mark { font-size: 40px; line-height: 1; }
.auth__title { margin-top: 12px; font-size: 21px; }
.auth__tagline { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }

.auth__form { display: grid; gap: 14px; }
.auth__hint { margin: 0; font-size: 14px; color: var(--text-muted); text-align: center; }
.auth__hint b { color: var(--text); }

.auth__error {
  margin: 16px 0 0; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(200, 40, 40, .1); color: #c02626;
  font-size: 13px; line-height: 1.45;
}
@media (prefers-color-scheme: dark) { .auth__error { color: #ff8a8a; } }

/*
 * Сообщение об удачной оплате: приходит с витрины по ?status=success. Зелёное,
 * а не красное, — это единственное место на экране входа, где новость хорошая,
 * и путать её с ошибкой нельзя.
 */
.auth__notice {
  margin: 16px 0 0; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(47, 158, 68, .12); color: #2f7d3a;
  font-size: 13px; line-height: 1.45;
}
@media (prefers-color-scheme: dark) { .auth__notice { color: #7ddb92; } }

/* Кнопка на тарифы под сообщением об отказе — ссылка, но выглядит как кнопка. */
.auth__upsell { margin: 12px 0 0; text-decoration: none; }

.auth__foot { margin: 20px 0 0; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth__foot a { color: var(--accent); font-weight: 600; text-decoration: none; }

.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.field__input {
  width: 100%; min-height: 44px; padding: 0 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field__input--sm { min-height: 36px; font-size: 14px; }
.field__input--code {
  text-align: center; font-size: 26px; font-weight: 700;
  letter-spacing: .34em; text-indent: .34em;
}

/* ─────────────────────────────── Шапка ───────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar__row {
  display: flex; align-items: center; gap: 12px;
  max-width: 1360px; margin: 0 auto; padding: 10px 16px;
}

.topbar__brand {
  display: flex; align-items: center; gap: 9px;
  border: 0; background: transparent; cursor: pointer; padding: 0;
  font-size: 20px;
}
.topbar__name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }

.search { position: relative; flex: 1; min-width: 0; }
.search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search__input {
  width: 100%; min-height: 40px; padding: 0 36px 0 40px;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: var(--bg-sunken); color: var(--text-muted);
  cursor: pointer; font-size: 17px; line-height: 1;
}

.topbar__actions { display: flex; align-items: center; gap: 2px; }

/* Кнопка открывает шторку фильтров — на десктопе панель и так на виду */
#btn-filters { display: none; }

.cats {
  display: flex; gap: 8px;
  max-width: 1360px; margin: 0 auto; padding: 0 16px 10px;
  overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }

.cat {
  display: inline-flex; align-items: center; gap: 7px;
  flex: 0 0 auto;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elevated); color: var(--text);
  cursor: pointer; font-size: 14px; font-weight: 550;
  transition: background .15s, border-color .15s, color .15s;
}
.cat:hover { border-color: var(--border-strong); }
.cat.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat__count { font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }

/* ─────────────────────────────── Раскладка ───────────────────────────── */

.layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px;
  max-width: 1360px; margin: 0 auto; padding: 20px 16px 64px;
}

@media (max-width: 940px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
}

/* ─────────────────────────────── Фильтры ─────────────────────────────── */

.filters {
  align-self: start;
  position: sticky; top: calc(var(--topbar-h) + 12px);
  max-height: calc(100dvh - var(--topbar-h) - 32px);
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}

.filters__head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.filters__title { flex: 1; font-size: 15px; }
.filters__close { display: none; }

.filters__body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.filters__foot { display: none; padding: 12px 16px; border-top: 1px solid var(--border); }

.fset { margin: 0; padding: 16px 0 0; border: 0; }
.fset + .fset { border-top: 1px solid var(--border); }
.fset__legend { padding: 0 0 10px; font-size: 13px; font-weight: 650; }
.fset__note { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  min-height: 32px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text);
  cursor: pointer; font-size: 13px; font-weight: 550;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

.range { display: grid; gap: 6px; }
.range__input { width: 100%; accent-color: var(--accent); }
.range__value { font-size: 13px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tokens:empty { display: none; }

.token {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.tokens--warn .token { background: rgba(200, 60, 40, .12); color: #c0392b; }
@media (prefers-color-scheme: dark) { .tokens--warn .token { color: #ff9482; } }

.token__x {
  display: grid; place-items: center;
  width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .12); color: inherit; cursor: pointer;
  font-size: 13px; line-height: 1;
}

.switch { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__box {
  flex: 0 0 auto; position: relative;
  width: 38px; height: 22px; margin-top: 1px;
  border-radius: 999px; background: var(--border-strong);
  transition: background .2s;
}
.switch__box::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform .2s;
}
.switch input:checked + .switch__box { background: var(--accent); }
.switch input:checked + .switch__box::after { transform: translateX(16px); }
.switch__text { font-size: 13px; font-weight: 600; }
.switch__text small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ─────────────────────────── Результаты и сетка ──────────────────────── */

.results { min-width: 0; }

.results__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.results__count { font-size: 14px; color: var(--text-muted); }
.results__count b { color: var(--text); }

.sort { display: flex; align-items: center; gap: 8px; }
.sort__label { font-size: 13px; color: var(--text-muted); }
.sort__select {
  min-height: 36px; padding: 0 8px;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer;
}

.activefilters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-sunken); }
.card__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card__fav {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9); color: #4a4238;
  cursor: pointer; backdrop-filter: blur(4px);
}
.card__fav.is-on { background: var(--accent); color: #fff; }
.card__fav svg { width: 17px; height: 17px; }
.card__fav.is-on svg { fill: currentColor; }

.card__time {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(20, 18, 15, .74); color: #fff; backdrop-filter: blur(4px);
  font-size: 12px; font-weight: 650;
}

.card__body { display: flex; flex-direction: column; gap: 8px; padding: 12px 13px 13px; flex: 1; }
.card__title { font-size: 15px; font-weight: 640; line-height: 1.3; }
.card__meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--text-muted);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.tag--accent { background: var(--accent-soft); color: var(--accent); }

.results__empty { padding: 56px 20px; text-align: center; color: var(--text-muted); }
.results__empty-emoji { font-size: 40px; margin-bottom: 12px; }
.results__empty h3 { color: var(--text); margin-bottom: 6px; }
.results__empty p { margin: 0 0 16px; }

.results__more { display: grid; place-items: center; padding: 28px 0 0; }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--border) 37%, var(--bg-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  aspect-ratio: 4 / 5.2;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ─────────────────────────── Шторка / карточка ───────────────────────── */

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(16, 14, 10, .5); backdrop-filter: blur(2px); }

.sheet__panel {
  position: relative;
  width: min(720px, 100%); height: 100%;
  background: var(--bg); box-shadow: var(--shadow-lg);
  overflow-y: auto; overscroll-behavior: contain;
  animation: slidein .22s ease;
}
.sheet__panel--narrow { width: min(460px, 100%); }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }

@media (max-width: 640px) {
  .sheet { align-items: flex-end; }
  .sheet__panel, .sheet__panel--narrow {
    width: 100%; height: 94dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slideup .24s ease;
  }
  @keyframes slideup { from { transform: translateY(28px); opacity: 0; } }
}

.rc__hero { position: relative; aspect-ratio: 16 / 10; background: var(--bg-sunken); }
.rc__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc__close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #2a251d;
  cursor: pointer; font-size: 21px; line-height: 1;
}

.rc__body { padding: 20px 20px 48px; display: grid; gap: 22px; }
@media (min-width: 640px) { .rc__body { padding: 24px 28px 56px; } }

.rc__title { font-size: 24px; }
.rc__subtitle { margin: 8px 0 0; color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }
.rc__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.rc__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutri__cell {
  padding: 10px 8px; text-align: center;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.nutri__value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nutri__label { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }

.block__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block__title { font-size: 17px; }

.servings { display: flex; align-items: center; gap: 4px; }
.servings__btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-elevated); cursor: pointer; font-size: 16px; line-height: 1;
}
.servings__value {
  min-width: 76px; text-align: center;
  font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}

.ing { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ing__group { margin-top: 14px; font-size: 13px; font-weight: 650; color: var(--text-muted); }

.ing__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
}
.ing__item:hover { background: var(--bg-elevated); }
.ing__item.is-done { opacity: .45; text-decoration: line-through; }
.ing__check { width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.ing__name { flex: 1; font-size: 14.5px; }
.ing__amount { font-size: 13.5px; font-weight: 650; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing__allergen { font-size: 11px; color: #c0392b; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }

.step {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  padding: 14px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.step__num {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700;
}
.step__text { margin: 0; font-size: 14.5px; line-height: 1.6; }
.step__img { margin-top: 10px; width: 100%; border-radius: var(--radius-sm); display: block; }
.step__advice {
  margin-top: 10px; padding: 9px 11px;
  background: var(--accent-soft); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5;
}
.step__timer {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg); cursor: pointer; font-size: 13px; font-weight: 620;
}

/* ─────────────────────────── Режим готовки ───────────────────────────── */

.cook {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--bg);
}

.cook__top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.cook__title { flex: 1; font-size: 15px; font-weight: 650; }
.cook__progress { height: 3px; background: var(--bg-sunken); }
.cook__bar { height: 100%; background: var(--accent); transition: width .25s; }

.cook__stage { flex: 1; overflow-y: auto; padding: 24px 20px 32px; }
.cook__inner { max-width: 620px; margin: 0 auto; }
.cook__step { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.cook__text { margin: 12px 0 0; font-size: 19px; line-height: 1.6; }
@media (min-width: 640px) { .cook__text { font-size: 21px; } }
.cook__img { margin-top: 18px; width: 100%; border-radius: var(--radius); display: block; }

.cook__nav {
  display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: var(--bg-elevated);
}
.cook__nav .btn { flex: 1; min-height: 46px; }

.timer {
  position: fixed; right: 16px; bottom: 84px; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg);
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.timer__stop { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 17px; }

/* ────────────────────────── Панель со списком ────────────────────────── */

.side { padding: 20px; display: grid; gap: 18px; }
.side__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* flex: 1 — чтобы на экранах с кнопкой «назад» заголовок занимал середину,
   а крестик оставался прижатым к правому краю, как и на остальных панелях. */
.side__title { font-size: 18px; flex: 1; }
.side__empty { padding: 40px 0; text-align: center; color: var(--text-muted); }

.slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.slist__group {
  margin-top: 12px; padding-bottom: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted);
}

.srow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm); cursor: pointer;
}
.srow:hover { background: var(--bg-elevated); }
.srow.is-done { opacity: .42; text-decoration: line-through; }
.srow__name { flex: 1; font-size: 14.5px; }
.srow__amount { font-size: 13.5px; font-weight: 650; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.srecipe {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.srecipe__title { flex: 1; font-size: 14px; font-weight: 600; }

.acc { display: grid; gap: 4px; }
.acc__row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.acc__key { color: var(--text-muted); }
.acc__val { font-weight: 620; }

/* ─────────────────────────── Подписка и отмена ───────────────────────── */

.subcard {
  display: grid; gap: 10px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated);
}
/* Отключённое продление — состояние со сроком годности, и выглядеть оно
   должно как предупреждение, а не как обычная строка настроек. */
.subcard--warn { border-color: var(--accent); background: var(--accent-soft); }
.subcard__title { font-size: 15px; font-weight: 700; }
.subcard__status { font-size: 14px; line-height: 1.45; }
.subcard__note { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.subcard__wait { font-size: 13.5px; color: var(--text-muted); }
.subcard__error { font-size: 13.5px; line-height: 1.45; color: #d64545; }
.subcard__links { font-size: 12.5px; color: var(--text-muted); }
.subcard__links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-elevated);
}
.opt.is-checked { border-color: var(--accent); background: var(--accent-soft); }
.opt__input { margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.opt__body { display: grid; gap: 4px; }
.opt__title { font-size: 14.5px; font-weight: 650; }
.opt__note { font-size: 13px; line-height: 1.45; color: var(--text-muted); }

/* ──────────────────────────────── Тост ───────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 100; max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 550; text-align: center;
  animation: toastin .2s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ──────────────────── Мобильная шторка фильтров ──────────────────────── */

@media (max-width: 940px) {
  .filters {
    position: fixed; inset: 0; z-index: 70;
    max-height: none; border-radius: 0; border: 0;
    transform: translateX(-100%); transition: transform .24s ease;
  }
  .filters.is-open { transform: none; }
  .filters__close { display: inline-flex; }
  .filters__foot { display: block; }
  #btn-filters { display: inline-flex; }
  :root { --topbar-h: 108px; }
}

@media print {
  .topbar, .filters, .results__bar, .rc__actions, .rc__close, .toast { display: none !important; }
  .sheet__panel { position: static; width: 100%; height: auto; box-shadow: none; overflow: visible; }
  .sheet__backdrop { display: none; }
  body { background: #fff; color: #000; }
}
