/* ============================================================
   paywall.css — денежные шторки (экономика v2, ECONOMY.md 4.8): энергия (components/energySheet.js),
   магазин 💎 (shopSheet.js, скрин Luna 17), «Энергия на срок» (plansSheet.js, скрин 16), «Условия обновились»
   (termsUpdateSheet.js). Общие части — moneySheet.js: шапка в одну строку «кружок · заголовок · баланс».
   Компактно: всё главное — на первом экране при 360×512 (html.h-short ужимает отступы).
   ============================================================ */

/* ---------- Общее: слой, шапка, кружок валюты, баланс ---------- */
/* Денежная шторка — над просмотрщиками (.viewer 55: «Приватное фото» → магазин), под тостами (60) */
.sheet-wrap.sheet-wrap--money { z-index: 58; }
.money-head { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 0 10px; }
.money-head__title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Мышь: в правом верхнем углу шторки — крестик (overlays.css), баланс его не закрывает */
@media (hover: hover) and (pointer: fine) { .money-head { padding-right: 48px; } }
.money-orb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #2a1400;
  background: var(--grad-amber);
  box-shadow: 0 0 0 4px rgba(255, 181, 71, 0.1), 0 6px 18px rgba(255, 150, 60, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.money-orb .icon { width: 18px; height: 18px; }
.money-orb--gems { color: #0b2a33; background: var(--grad-gem); box-shadow: 0 0 0 4px rgba(110, 231, 249, 0.1), 0 6px 18px rgba(110, 231, 249, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.money-orb--plan,
.money-orb--terms { color: #fff; background: var(--grad); box-shadow: 0 0 0 4px rgba(255, 45, 120, 0.12), var(--glow); }
.money-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
}
.money-chip__part { display: inline-flex; align-items: center; gap: 3px; }
.money-chip__part b { font-weight: var(--fw-heavy); }
.money-chip__part .icon { width: 15px; height: 15px; }
.money-chip__part--energy .icon { color: var(--amber); }
.money-chip__part--gems .icon { color: var(--gem); }
.money-gem.icon, .money-star.icon { width: 0.95em; height: 0.95em; vertical-align: -0.12em; }
.money-gem.icon { color: var(--gem); }
.money-star.icon { color: var(--amber); filter: drop-shadow(0 0 4px rgba(255, 181, 71, 0.45)); }
.money-empty { padding: 16px 0 4px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Шторка энергии ---------- */
/* Плитки «Энергия на срок» и плашка админу «продажи выключены» — в energy-plans.css */
.energy-plan,
.energy-claim,
.energy-daily {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--inner-hi);
}
.energy-plan[hidden], .energy-daily[hidden] { display: none; }
.energy-plan { margin-bottom: 8px; align-items: flex-start; background: linear-gradient(135deg, rgba(255, 45, 120, 0.14), var(--card) 70%); border-color: rgba(255, 45, 120, 0.3); }
.energy-plan__icon, .energy-claim__icon, .energy-daily__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
}
.energy-plan__icon { color: var(--pink); background: rgba(255, 45, 120, 0.14); }
.energy-plan__line { font-size: 14px; font-weight: var(--fw-semibold); line-height: 1.35; }
.energy-plan__capped { margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--amber); }
.energy-claim { align-items: flex-start; }
.energy-claim__icon { color: var(--amber); background: rgba(255, 181, 71, 0.14); }
.energy-claim__icon .icon, .energy-daily__icon .icon, .energy-plan__icon .icon { width: 20px; height: 20px; }
.energy-claim__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.energy-claim__status { min-height: 36px; display: flex; align-items: center; font-size: 15px; font-weight: var(--fw-bold); line-height: 1.3; font-variant-numeric: tabular-nums; }
.energy-claim__btn[hidden] { display: none; }
.energy-claim.is-ready { border-color: rgba(45, 212, 160, 0.45); background: linear-gradient(135deg, rgba(45, 212, 160, 0.14), var(--card) 70%); }
.energy-claim.is-ready .energy-claim__btn {
  color: #06231a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%), var(--green);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(45, 212, 160, 0.35);
}
/* С планом «забрать» — второстепенная строка */
.energy-claim.is-secondary { padding: 8px 12px; }
.energy-claim.is-secondary .energy-claim__status { min-height: 28px; font-size: 13px; font-weight: var(--fw-semibold); color: var(--muted); }
.energy-daily { margin-top: 8px; padding: 8px 14px; }
.energy-daily__icon { width: 30px; height: 30px; color: var(--muted); background: rgba(255, 255, 255, 0.05); }
.energy-daily__text { font-size: 14px; font-weight: var(--fw-semibold); line-height: 1.3; }
.energy-daily[data-state="ready"] { border-color: rgba(45, 212, 160, 0.4); }
.energy-daily[data-state="ready"] .energy-daily__icon { color: var(--green); background: rgba(45, 212, 160, 0.14); }
.energy-daily[data-state="waits"] .energy-daily__text { color: var(--muted); }
.energy-offer { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.energy-offer[hidden] { display: none; }
.energy-offer__terms { font-size: 12px; line-height: 1.4; text-align: center; color: var(--muted); text-wrap: balance; }
.energy-offer__all { min-height: 40px; }
/* Кнопки 40 px в денежных шторках: вид прежний, палец попадает в 44 px (невидимое расширение, как у .btn--xs, К7) */
.energy-offer__all::before, .shop-plan__cta::before, .terms-update__link::before {
  content: "";
  position: absolute;
  inset: -4px 0; /* от края рамки (1 px): 38 + 8 = 46, как у .btn--xs */
  border-radius: inherit;
}
/* 24 ч после оплаты Stars баннера плана нет (2.5): при нехватке ⚡ — тихая ссылка на планы */
.energy-offer__link { color: var(--text-2); }
.energy-offer__link .icon { color: var(--pink); }
.energy-sheet__secondary { margin-top: 8px; }

.energy-sheet__foot, .shop-foot, .plan-benefits__note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted-2);
  text-wrap: balance;
}

/* ---------- Магазин 💎 ---------- */
.shop-short { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r); background: rgba(255, 181, 71, 0.08); border: 1px solid rgba(255, 181, 71, 0.3); }
.shop-short[hidden], .shop-debt[hidden] { display: none; }
.shop-short__need { font-size: 14px; font-weight: var(--fw-heavy); }
.shop-short__after { font-size: 13px; color: var(--muted); line-height: 1.35; }
.shop-debt { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r); font-size: 13px; line-height: 1.35; color: var(--amber); background: rgba(255, 181, 71, 0.08); }
/* Продажи выключены (catalog.salesEnabled = false): пояснение под шапкой, почему пакеты неактивны */
.shop-closed { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r); font-size: 13px; line-height: 1.35; text-align: center; color: var(--text-2); background: var(--card-2); }
/* Объявленное повышение цены генерации (catalog.priceNotices, T7s) — сведения, а не тревога, как у долга */
.shop-debt.shop-notice { color: var(--text-2); background: rgba(139, 92, 246, 0.1); }
.shop-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(255, 45, 120, 0.3), transparent 70%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.2), var(--card) 80%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.shop-plan__body { flex: 1; min-width: 0; }
.shop-plan__title { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: var(--fw-black); line-height: 1.25; }
.shop-plan__title .icon { flex: 0 0 auto; width: 16px; height: 16px; color: var(--amber); }
.shop-plan__sub { margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.shop-plan__cta { flex: 0 0 auto; }
/* Бонус «С возвращением» (RETENTION-SPEC п. 7, components/offerBanner.js): над баннером плана, без кнопки — бонус уже
   на карточках пакетов */
.shop-welcome {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(90% 160% at 0% 0%, rgba(255, 181, 71, 0.22), transparent 70%),
    linear-gradient(135deg, rgba(255, 45, 120, 0.16), var(--card) 85%);
  border: 1px solid rgba(255, 181, 71, 0.35);
}
.shop-welcome__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 181, 71, 0.16);
  color: var(--amber);
}
.shop-welcome__icon .icon { width: 20px; height: 20px; }
.shop-welcome__body { flex: 1; min-width: 0; }
.shop-welcome__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-welcome__title { min-width: 0; font-size: 15px; font-weight: var(--fw-black); line-height: 1.25; }
.shop-welcome__sub { margin-top: 3px; font-size: 12.5px; color: var(--text-2); line-height: 1.3; }
.shop-welcome__max { white-space: nowrap; }
.shop-welcome__left {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--amber);
  white-space: nowrap;
}
.shop-prices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--muted);
}
.shop-prices__item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.shop-prices__item + .shop-prices__item::before { content: "·"; margin-right: 9px; color: var(--muted-2); }
.shop-prices__item b { color: var(--text); font-variant-numeric: tabular-nums; }
.gem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 339.98px) { .gem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gem-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 138px;
  padding: 16px 6px 0;
  overflow: hidden;
  border-radius: var(--r);
  text-align: center;
  color: var(--text);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--inner-hi);
  transition: transform var(--t-fast) var(--ease), border-color var(--t), box-shadow var(--t), opacity var(--t);
  animation: rise-in 280ms var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.gem-pack:active { transform: scale(0.97); }
.gem-pack:disabled { opacity: 0.55; }
.gem-pack--skeleton { border: 0; animation: none; }
.gem-pack__badge {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: var(--fw-heavy);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  background: var(--grad);
}
.gem-pack__icon { display: inline-flex; margin-top: 4px; color: var(--gem); filter: drop-shadow(0 0 10px rgba(110, 231, 249, 0.55)); }
.gem-pack__icon .icon { width: 26px; height: 26px; }
.gem-pack__total { font-size: 19px; font-weight: var(--fw-black); letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
/* Строки пакета не мельче 11.5 px: 10–10.5 px на телефоне читались с трудом (S-11) */
.gem-pack__promo, .gem-pack__worth { max-width: 100%; font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.gem-pack__promo { color: var(--green); font-weight: var(--fw-bold); }
.gem-pack__price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: calc(100% + 12px);
  min-height: 34px;
  margin-top: auto;
  padding: 0 4px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.03);
}
.gem-pack__price b { font-weight: var(--fw-heavy); }
.gem-pack__discount { padding: 1px 5px; border-radius: var(--r-pill); font-size: 11px; font-weight: var(--fw-heavy); color: #06231a; background: var(--green); }
/* Выделенный: наименьший достаточный при нехватке */
.gem-pack.is-best {
  border-color: transparent;
  background: linear-gradient(180deg, var(--card-2), var(--card)) padding-box, var(--grad) border-box;
  box-shadow: 0 8px 24px rgba(255, 45, 120, 0.28), var(--inner-hi);
}
.gem-pack.is-best .gem-pack__price { color: #fff; background: var(--grad); border-top-color: transparent; }
.gem-pack.is-short { opacity: 0.5; box-shadow: none; }
.gem-pack.is-loading { pointer-events: none; }
.gem-pack.is-loading .gem-pack__price b { opacity: 0.35; }
.shop-foot__terms { display: block; min-height: 44px; margin: 0 auto; padding: 0 12px; font: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .gem-pack { cursor: pointer; }
  .gem-pack:hover:not(:disabled) { border-color: var(--line-2); box-shadow: var(--elev-1), var(--inner-hi); }
  .gem-pack.is-short:hover { opacity: 0.8; }
}

/* ---------- «Энергия на срок»: строки-радио ---------- */
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--r);
  text-align: left;
  color: var(--text);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--inner-hi);
  transition: transform var(--t-fast) var(--ease), border-color var(--t), background var(--t);
  animation: rise-in 280ms var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.plan-row:active { transform: scale(0.985); }
.plan-row--skeleton { border: 0; animation: none; }
.plan-row.has-badge { margin-top: 8px; }
.plan-row.is-selected {
  border-color: transparent;
  background:
    radial-gradient(80% 120% at 0% 50%, rgba(255, 45, 120, 0.22), transparent 70%) padding-box,
    linear-gradient(180deg, var(--card-2), var(--card)) padding-box,
    var(--grad) border-box;
}
.plan-row__badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-heavy);
  white-space: nowrap;
  color: #fff;
  background: var(--grad);
}
.plan-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-row__title { font-size: 16px; font-weight: var(--fw-heavy); line-height: 1.25; }
.plan-row__meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-row__meta b { color: var(--text); }
.plan-row__bonus { flex: 0 0 auto; padding: 4px 9px; border-radius: var(--r-pill); font-size: 13px; font-weight: var(--fw-heavy); background: rgba(110, 231, 249, 0.1); border: 1px solid rgba(110, 231, 249, 0.3); }
.plan-row__check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  color: transparent;
}
.plan-row__check .icon { width: 14px; height: 14px; }
.plan-row.is-selected .plan-row__check { border-color: transparent; color: #fff; background: var(--grad); }
.plan-benefits { margin-top: 12px; }
.plan-benefits__list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.plan-benefits__list li { padding: 9px 2px; font-size: 14px; font-weight: var(--fw-semibold); line-height: 1.35; border-bottom: 1px solid var(--line); }
/* Кнопка оплаты всегда видна (360×640, iPhone SE): подвал прилипает к низу шторки со сплошным фоном и отступом под
   полосу «домой», как .dock и .adm-msheet__foot. Тело шторки без своего нижнего отступа, пока подвал есть (.has-foot) */
.plans-sheet.has-foot .sheet__body { padding-bottom: 0; }
.plans-sheet__foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px -20px 0;
  padding: 12px 20px calc(12px + var(--sab));
  background: var(--bg-2);
  box-shadow: 0 -1px 0 var(--line);
}
@media (min-width: 1024px) {
  .plans-sheet__foot { margin-inline: -24px; padding: 14px 24px 18px; }
}
.plans-sheet__status { min-height: 16px; font-size: 12px; text-align: center; color: var(--muted); }
.plans-sheet__status:empty { display: none; }

/* ---------- «Условия обновились» ---------- */
.terms-update__lead { font-size: 14px; line-height: 1.45; color: var(--muted); }
.terms-update__list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.terms-update__list li { padding: 10px 12px; border-radius: var(--r); font-size: 14px; line-height: 1.4; background: var(--card); border: 1px solid var(--line); }
.terms-update__link { margin: 0 auto 10px; display: flex; }

/* ---------- Низкие экраны (Android маленький): теснее ---------- */
.h-short .money-head { min-height: 40px; padding-bottom: 6px; }
.h-short .energy-claim, .h-short .energy-plan { padding: 10px 12px; }
.h-short .shop-plan { padding: 8px 10px 8px 12px; }
.h-short .shop-welcome { padding: 6px 10px; }
.h-short .shop-welcome__icon { width: 30px; height: 30px; }
.h-short .gem-pack { min-height: 124px; padding-top: 14px; }
.h-short .gem-pack__worth { display: none; }
.h-short .plan-row { min-height: 56px; }
.h-short .plan-benefits__list li { padding: 7px 2px; }
