/* ==========================================================================
   ASCENT Card — Mini App. Чёрный лак + золото (SPEC §11).
   Композиция и размеры — по снимкам образца (1 px снимка 540 px ≈ 0.73 CSS px).
   Всегда тёмная тема. Общие компоненты здесь; экраны аккаунта — в account.css.
   ========================================================================== */

/* --- Шрифты: Manrope (заголовки), Inter (текст); хостим сами — CSP --- */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Переменные --- */

:root {
  --bg: #0A0908;
  --surface: #151310;
  --surface-2: #1D1A16;
  --line: rgba(212, 175, 55, 0.16);
  --line-strong: rgba(212, 175, 55, 0.32);
  --text: #F5EFE3;
  --muted: #A39B8B;
  --gold: #D4AF37;
  --gold-hi: #F3D47A;
  --gold-lo: #9C7424;
  --gold-grad: linear-gradient(135deg, #F6DE8D 0%, #D4AF37 45%, #9C7424 100%);
  --danger: #E5484D;
  --success: #3DD68C;
  --info: #8FB3FF;
  --ink: #1A1408; /* текст на золоте */

  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: 16px;
  --r-card: 24px;
  --r-tile: 20px;
  --r-field: 16px;
  --btn-h: 52px;
  --tabbar-h: 64px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.35);
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --t-grad: radial-gradient(120% 90% at 0% 0%, rgba(243, 212, 122, 0.18), rgba(243, 212, 122, 0) 55%),
    linear-gradient(145deg, #1E1A14 0%, #0F0D0A 55%, #070605 100%);
  color-scheme: dark;
}

/* Оформление тарифов: у каждой карты свой оттенок лака. */
.theme-premium {
  --t-grad: radial-gradient(120% 90% at 0% 0%, rgba(243, 212, 122, 0.2), rgba(243, 212, 122, 0) 55%),
    linear-gradient(145deg, #1F1A12 0%, #0E0C09 55%, #060504 100%);
}

.theme-plastic {
  --t-grad: radial-gradient(120% 90% at 0% 0%, rgba(245, 239, 227, 0.15), rgba(245, 239, 227, 0) 55%),
    linear-gradient(145deg, #2A2825 0%, #141311 55%, #090908 100%);
}

.theme-travel {
  --t-grad: radial-gradient(120% 90% at 0% 0%, rgba(214, 150, 64, 0.26), rgba(214, 150, 64, 0) 55%),
    linear-gradient(145deg, #2E2113 0%, #17110A 55%, #0B0906 100%);
}

.theme-subs {
  --t-grad: radial-gradient(120% 90% at 0% 0%, rgba(232, 196, 120, 0.2), rgba(232, 196, 120, 0) 55%),
    linear-gradient(145deg, #26211A 0%, #13110D 55%, #090807 100%);
}

/* --- База --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(130% 42% at 50% -8%, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0) 62%) no-repeat,
    var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold-hi);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Заголовок листа/диалога получает фокус программно (для читалок) — рамку показываем только с клавиатуры. */
[tabindex="-1"]:focus:not(:focus-visible) {
  outline: 0;
}

.copy-buffer {
  position: fixed;
  top: -1000px;
  left: 0;
  opacity: 0;
}

.noscript {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

/* --- Иконки (спрайт static/img/icons.svg, цвет — currentColor) --- */

.ic {
  display: inline-block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.ic-sm {
  width: 18px;
  height: 18px;
}

.ic-xs {
  width: 14px;
  height: 14px;
}

.gold {
  color: var(--gold);
}

/* --- Каркас --- */

.app {
  min-height: 100vh;
}

.view {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px var(--pad) calc(var(--safe-b) + 24px);
  animation: view-in 0.26s ease both;
}

body.has-tabs .view {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
}

/* Только opacity: transform на .view сделал бы его опорой для position: fixed, и закреплённые кнопки уехали бы вниз. */
@keyframes view-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.testbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(var(--safe-t) + 4px) 12px 4px;
  background: var(--gold-grad);
  color: var(--ink);
  font: 700 11.5px/1.3 var(--font-text);
  letter-spacing: 0.03em;
  text-align: center;
}

.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.boot-logo {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(212, 175, 55, 0.25));
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.7;
    transform: scale(0.97);
  }
}

.gate {
  min-height: calc(100vh - 40px);
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 24px calc(var(--safe-b) + 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.gate-logo {
  width: 127px;
  height: auto;
  margin-bottom: 14px;
  filter: drop-shadow(0 12px 30px rgba(212, 175, 55, 0.25));
}

.gate-title {
  font: 800 26px/1.2 var(--font-head);
}

.gate-text {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* --- Типографика --- */

.h1 {
  font: 800 26px/1.2 var(--font-head);
  letter-spacing: -0.01em;
}

.h2 {
  font: 800 22px/1.2 var(--font-head);
  letter-spacing: -0.01em;
}

.cap {
  margin: 22px 2px 10px;
  font: 700 17px/1.3 var(--font-head);
}

.muted {
  color: var(--muted);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 4px;
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--btn-h);
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 700 16px/1 var(--font-head);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: default;
  opacity: 0.45;
  box-shadow: none;
}

.btn .ic {
  width: 22px;
  height: 22px;
}

/* Цветной знак СБП на золотой кнопке: тёмный кружок, чтобы жёлтые лепестки не терялись на золоте. */
.sbp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0A0908;
  box-shadow: inset 0 0 0 1px rgba(243, 212, 122, 0.35);
}

.sbp-badge img {
  width: 15px;
  height: 18px;
  display: block;
}

.btn-gold:disabled .sbp-badge {
  opacity: 0.6;
}

.btn-gold {
  color: var(--ink);
  background: var(--gold-grad);
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.btn-gold:disabled {
  opacity: 1;
  color: rgba(245, 239, 227, 0.72);
  background: linear-gradient(135deg, #4F4530 0%, #3A3122 60%, #2B241A 100%);
}

.btn-dark {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.btn-ghost {
  color: var(--gold-hi);
  background: transparent;
}

.btn-block {
  width: 100%;
}

.btn-round {
  flex: 0 0 var(--btn-h);
  width: var(--btn-h);
  padding: 0;
}

.btn-sm {
  height: 52px;
  padding: 0 18px;
  border-radius: var(--r-field);
  font-size: 15px;
}

.btn-busy {
  pointer-events: none;
}

.btn-busy::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.btn-icon {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--gold-hi);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  border: 1px solid var(--line-strong);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-hi);
  font: 600 14px/1 var(--font-text);
  white-space: nowrap;
}

.pill.is-active {
  color: var(--ink);
  background: var(--gold-grad);
  border-color: transparent;
}

/* --- Метки и чипы --- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: rgba(10, 9, 8, 0.55);
  border: 1px solid rgba(245, 239, 227, 0.12);
  color: var(--text);
  font: 500 12.5px/1 var(--font-text);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tag-gold {
  border: 0;
  background: var(--gold-grad);
  color: var(--ink);
  font: 800 10.5px/1 var(--font-text);
  letter-spacing: 0.08em;
}

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

.chips-center {
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: rgba(245, 239, 227, 0.08);
  border: 1px solid rgba(245, 239, 227, 0.16);
  color: var(--text);
  font: 600 13px/1 var(--font-text);
}

.chip .ic {
  width: 14px;
  height: 14px;
}

.chip-round {
  justify-content: center;
  width: 28px;
  padding: 0;
  color: var(--gold-hi);
}

.chip-round .ic {
  width: 18px;
  height: 18px;
}

.cur-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(245, 239, 227, 0.28);
  color: var(--muted);
  font: 700 11px/1 var(--font-text);
  letter-spacing: 0.04em;
}

/* --- Блоки, строки «ключ — значение», аккордеоны --- */

.box {
  padding: 16px;
  border-radius: var(--r-tile);
  background: var(--surface);
  border: 1px solid var(--line);
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: 15px;
}

.kv > :first-child {
  min-width: 0;
}

.kv > :last-child {
  flex-shrink: 0;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.kv s,
.old {
  margin-right: 6px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: line-through;
}

.kv.is-total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font: 700 17px/1.3 var(--font-head);
}

.acc {
  margin-top: 10px;
  border-radius: var(--r-tile);
  background: var(--surface);
  border: 1px solid var(--line);
}

.acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 18px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: 700 15px/1.3 var(--font-head);
  letter-spacing: -0.01em;
  text-align: left;
}

.acc-head .chev,
.rate-head .chev {
  color: var(--muted);
  transition: transform 0.22s ease;
}

.acc.is-open .acc-head .chev,
.rate.is-open .rate-head .chev {
  transform: rotate(180deg);
}

.acc-body {
  padding: 0 16px 14px;
  animation: fade-down 0.22s ease both;
}

.acc-text {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-line;
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.xlist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.xlist li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.4;
}

.xlist .ic {
  margin-top: 1px;
  color: var(--muted);
}

/* --- Поля ввода --- */

.field {
  display: block;
  margin-top: 16px;
}

.field-lbl {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--muted);
  font-size: 13px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--r-field);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.input-wrap:focus-within {
  border-color: rgba(212, 175, 55, 0.65);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.input-wrap.is-invalid {
  border-color: rgba(229, 72, 77, 0.7);
}

.input-wrap.is-disabled {
  opacity: 0.5;
}

.input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: 500 16px/1 var(--font-text); /* 16px — iOS не зумит поле */
}

.input:focus-visible {
  outline: 0;
}

.input::placeholder {
  color: rgba(163, 155, 139, 0.72);
}

.input.is-upper {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input.is-upper::placeholder {
  text-transform: none;
  letter-spacing: 0;
}

.input-suffix {
  color: var(--muted);
  font: 600 16px/1 var(--font-text);
}

.field-note {
  min-height: 18px;
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Пустая подсказка (нет ошибки, нет пересчёта) не оставляет дыру между полями. */
.field-note:empty {
  min-height: 0;
  margin-top: 0;
}

.is-error {
  color: var(--danger);
}

.is-ok {
  color: var(--success);
}

.row-gap {
  display: flex;
  gap: 8px;
}

.row-gap > .input-wrap {
  flex: 1;
  min-width: 0;
}

.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check-box .ic {
  width: 14px;
  height: 14px;
  opacity: 0;
}

.check input:checked + .check-box {
  border-color: transparent;
  background: var(--gold-grad);
}

.check input:checked + .check-box .ic {
  opacity: 1;
}

.check input:focus-visible + .check-box {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.check-link {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-color: rgba(243, 212, 122, 0.45);
  text-underline-offset: 2px;
}

/* --- Панель вкладок и закреплённые кнопки --- */

.tabbar {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: calc(var(--safe-b) + 10px);
  display: flex;
  width: calc(100% - 24px);
  max-width: 528px;
  height: var(--tabbar-h);
  padding: 5px;
  border-radius: 32px;
  background: rgba(21, 19, 16, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateX(-50%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 2px;
  border: 0;
  border-radius: 27px;
  background: transparent;
  color: var(--muted);
  font: 600 11px/1.1 var(--font-text);
  transition: background 0.2s ease, color 0.2s ease;
}

.tab .ic {
  width: 22px;
  height: 22px;
}

.tab.is-active {
  color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.07));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.3);
}

.tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-space {
  height: calc(var(--btn-h) + 20px);
}

.dock {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(var(--safe-b) + 12px);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  padding: 0 var(--pad);
  transform: translateX(-50%);
  pointer-events: none;
}

.dock > * {
  pointer-events: auto;
}

.dock > .btn:not(.btn-round) {
  flex: 1;
  min-width: 0;
}

.dock::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30px;
  left: 0;
  right: 0;
  bottom: -140px;
  background: linear-gradient(180deg, rgba(10, 9, 8, 0) 0, rgba(10, 9, 8, 0.94) 26px, var(--bg) 40px);
  pointer-events: none;
}

body.has-tabs .dock {
  bottom: calc(var(--safe-b) + var(--tabbar-h) + 20px);
}

/* --- Нижний лист --- */

/* top/right/bottom/left — для WebView без inset (Chrome < 87, iOS < 14.5): иначе слой нулевого размера и невидим. */
.sheet-root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 70;
}

.sheet-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  background: rgba(5, 4, 3, 0.62);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(var(--tg-viewport-height, 100vh) - 32px);
  /* 100% — высота .sheet-root (fixed на весь видимый экран): лист не выше экрана, даже если Telegram не обновил переменную под клавиатуру. */
  max-height: min(calc(100% - 32px), calc(var(--tg-viewport-height, 100vh) - 32px));
  margin: 0 auto;
  padding-bottom: var(--safe-b);
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #1A1713 0%, var(--surface) 120px);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-bottom: 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1);
  will-change: transform;
}

.sheet-root.is-open .sheet-backdrop {
  opacity: 1;
}

.sheet-root.is-open .sheet {
  transform: translateY(0);
}

.sheet.is-dragging {
  transition: none;
}

.sheet-grip {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 10px 0 8px;
  touch-action: none;
  cursor: grab;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(245, 239, 227, 0.25);
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--pad) 16px;
  overflow-y: auto;
  scroll-padding-bottom: 104px; /* поле в фокусе прокручивается выше закреплённой .sheet-foot (82px) */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sheet-title {
  margin: 4px 0 14px;
  font: 800 24px/1.2 var(--font-head);
}

.sheet-cap {
  margin: 0 2px 10px;
  font: 700 16px/1.3 var(--font-head);
}

.sheet-cap.is-spaced {
  margin-top: 24px;
}

.sheet-foot {
  position: sticky;
  bottom: -16px;
  margin: 18px calc(-1 * var(--pad)) -16px;
  padding: 14px var(--pad) 16px;
  background: linear-gradient(180deg, rgba(21, 19, 16, 0) 0%, var(--surface) 28%);
}

/* --- Полноэкранный слой, диалог, тост --- */

.overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.overlay.is-open {
  opacity: 1;
}

.dialog-root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialog-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  background: rgba(5, 4, 3, 0.62);
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dialog {
  position: relative;
  width: min(100%, 320px);
  padding: 22px 18px 16px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dialog-root.is-open .dialog-backdrop {
  opacity: 1;
}

.dialog-root.is-open .dialog {
  opacity: 1;
  transform: none;
}

.dialog-title {
  padding: 0 4px;
  font: 800 19px/1.25 var(--font-head);
}

.dialog-text {
  margin-top: 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-line;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.dialog-actions.is-single {
  grid-template-columns: 1fr;
}

.dialog-btn {
  height: 46px;
  border-radius: 23px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 700 15px/1 var(--font-head);
}

.dialog-btn.is-main {
  border: 0;
  background: var(--gold-grad);
  color: var(--ink);
}

.dialog-btn.is-danger {
  background: var(--danger);
  color: #FFF;
}

.toast {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: calc(var(--safe-b) + 24px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(29, 26, 22, 0.97);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font: 500 14.5px/1.35 var(--font-text);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: rgba(229, 72, 77, 0.6);
}

body.has-tabs .toast {
  bottom: calc(var(--safe-b) + var(--tabbar-h) + 24px);
}

/* Пока открыт лист, тост сверху — чтобы не закрывать кнопку листа. */
html.is-locked .toast {
  top: calc(var(--safe-t) + 16px);
  bottom: auto;
  transform: translate(-50%, -14px);
}

html.is-locked .toast.is-shown {
  transform: translate(-50%, 0);
}

/* --- Загрузка, пустые состояния --- */

.skel {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface) 0%, #231F19 40%, var(--surface) 80%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skel-line {
  height: 14px;
  border-radius: 7px;
}

.skel-card {
  flex: 0 0 min(320px, calc(100% - 44px));
  aspect-ratio: 340 / 214;
  border-radius: var(--r-card);
}

.skel-story {
  flex: 0 0 104px;
  height: 104px;
  border-radius: 20px;
}

.skel-row {
  height: 52px;
  margin-top: 12px;
  border-radius: 16px;
}

.skel-tcard {
  height: 196px;
  margin-top: 16px;
  border-radius: var(--r-card);
}

.skel-hero {
  height: 360px;
  margin: -8px calc(-1 * var(--pad)) 0;
  border-radius: 0 0 32px 32px;
}

.skel-box {
  height: 72px;
  margin-top: 16px;
  border-radius: var(--r-tile);
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.25);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 12px;
  text-align: center;
}

.state-ic {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--line-strong);
  color: var(--gold-hi);
}

.state.is-error .state-ic {
  background: rgba(229, 72, 77, 0.1);
  border-color: rgba(229, 72, 77, 0.35);
  color: var(--danger);
}

.state-ill {
  width: 160px;
  height: 120px;
  margin-bottom: 4px;
}

.state-title {
  font: 700 18px/1.3 var(--font-head);
}

.state-text {
  max-width: 300px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}

.state.is-compact {
  padding: 24px 12px;
}

/* QR-код из AC.ui.qr(): светлое поле нужно сканерам, вокруг — золотая рамка. */
.qr {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* --- Изображения карт --- */

.card-art {
  aspect-ratio: 340 / 214;
  object-fit: cover;
  background: linear-gradient(135deg, #24201A 0%, #0D0C0A 100%);
}

/* --- 1. Главная --- */

.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
}

.me-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
}

.me-link .ic {
  color: var(--muted);
}

.me-name {
  overflow: hidden;
  font: 700 17px/1.2 var(--font-head);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--ink);
  font: 800 16px/1 var(--font-head);
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.avatar-lg {
  flex-basis: 96px;
  width: 96px;
  height: 96px;
  font-size: 36px;
}

.stories {
  display: flex;
  gap: 10px;
  margin: 0 calc(-1 * var(--pad));
  padding: 2px var(--pad) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stories::-webkit-scrollbar,
.carousel::-webkit-scrollbar,
.pick-row::-webkit-scrollbar {
  display: none;
}

.story {
  flex: 0 0 104px;
  height: 104px;
  padding: 2px;
  border: 0;
  border-radius: 20px;
  background: var(--gold-grad);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.14);
}

.story.is-seen {
  background: rgba(245, 239, 227, 0.14);
  box-shadow: none;
}

.story-in {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 2px solid var(--bg);
  background: radial-gradient(90% 90% at 70% 20%, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0) 70%), var(--surface);
}

.story-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62%;
  object-fit: cover;
}

/* Подпись — на тёмном низу плитки, а не на линиях картинки. */
.story-in::after {
  content: "";
  position: absolute;
  top: 30%;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 30% 0 0;
  background: linear-gradient(180deg, rgba(10, 9, 8, 0) 0%, rgba(10, 9, 8, 0.85) 45%, #0A0908 75%);
}

/* Правый отступ 5px: «О премиальной» (82.2px) иначе не влезает в строку и предлог повисает один. */
.story-cap {
  position: absolute;
  z-index: 1;
  left: 7px;
  right: 5px;
  bottom: 7px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text);
  font: 600 10.5px/1.2 var(--font-text);
  text-align: left;
  text-wrap: balance;
}

.carousel {
  display: flex;
  gap: 12px;
  margin: 14px calc(-1 * var(--pad)) 0;
  padding: 4px var(--pad) 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--pad);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.carousel::after {
  content: "";
  flex: 0 0 4px;
}

.carousel > .state {
  flex: 0 0 100%;
  padding: 24px 12px;
}

.hcard {
  position: relative;
  flex: 0 0 min(320px, calc(100% - 44px));
  aspect-ratio: 340 / 214;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--t-grad);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  scroll-snap-align: start;
  isolation: isolate;
}

@supports not (aspect-ratio: 1) {
  .hcard,
  .skel-card {
    height: 200px;
  }
}

.hcard-art {
  position: absolute;
  top: 0;
  left: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hcard-shade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.55) 100%);
}

.hcard-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 62px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hcard-eye {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hcard-bottom {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
}

.hcard-bal {
  color: #FFF8EA;
  font: 800 40px/1 var(--font-head);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.hcard-bal .cur {
  margin-right: 0.14em;
  font-size: 0.72em;
}

.hcard-num {
  margin-top: 8px;
  color: rgba(245, 239, 227, 0.86);
  font: 600 15px/1 var(--font-text);
  letter-spacing: 0.08em;
}

.hcard-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 18px;
  background: rgba(15, 13, 11, 0.86);
  border: 1px solid rgba(212, 175, 55, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hcard-panel-txt {
  flex: 1;
  min-width: 0;
}

.hcard-panel-title {
  font: 700 15.5px/1.3 var(--font-head);
}

.hcard-panel-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hcard-panel-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-hi);
  font: 600 14px/1.3 var(--font-text);
}

.hcard-panel-ic {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-hi);
}

.hcard-panel-ic.is-bad {
  background: rgba(229, 72, 77, 0.14);
  color: var(--danger);
}

.hcard.is-new {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  border-style: dashed;
  border-color: rgba(212, 175, 55, 0.45);
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0) 60%),
    var(--surface);
}

.hcard.is-new .hcard-plus {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--ink);
}

.hcard-new-title {
  font: 800 22px/1.2 var(--font-head);
}

.hcard-new-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.banner {
  position: relative;
  display: block;
  width: 100%;
  min-height: 100px;
  margin-top: 8px;
  padding: 16px 128px 16px 16px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: linear-gradient(115deg, #2B2213 0%, #17120B 55%, #0F0C08 100%);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.banner-title {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font: 800 17px/1.25 var(--font-head);
}

.banner-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}

.banner-ill {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 124px;
  height: auto;
  pointer-events: none;
}

/* --- Операции (главная и история) --- */

.tx-day {
  margin: 22px 0 4px;
  color: var(--muted);
  font: 600 14px/1.3 var(--font-text);
}

.tx {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.tx-ic {
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--gold);
}

.tx-ic .ic {
  width: 20px;
  height: 20px;
}

.tx-main {
  flex: 1;
  min-width: 0;
}

.tx-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.tx-line + .tx-line {
  margin-top: 3px;
}

.tx-title {
  flex: 1 1 auto;
  display: flex;
  min-width: 0;
  font: 500 16px/1.3 var(--font-text);
  white-space: nowrap;
}

.tx-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-card {
  flex-shrink: 0;
  margin-left: 6px;
  color: var(--muted);
}

.tx-sub {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.dot.is-bad {
  background: var(--danger);
}

.dot.is-wait {
  background: var(--gold);
}

.dot.is-info {
  background: var(--info);
}

.tx-sum {
  flex: 0 0 auto;
  font: 700 16px/1.3 var(--font-head);
  white-space: nowrap;
}

.tx-sum.is-pos {
  color: var(--success);
}

.tx-sum.is-neg {
  color: var(--danger);
}

.tx-orig {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-err {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  margin-top: 8px;
  padding: 0 6px 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.tx-err span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-err .ic {
  width: 16px;
  height: 16px;
}

/* --- 2. Выбор карты --- */

.tlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.tcard {
  position: relative;
  display: block;
  margin-top: 22px;
  padding: 16px 14px 12px;
  border-radius: var(--r-card);
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: var(--t-grad);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.tcard:active {
  transform: scale(0.99);
}

/* Картинка карты выступает над плашкой справа сверху; название идёт под ней слева и до неё не достаёт. */
.tcard-art {
  position: absolute;
  top: -22px;
  right: 12px;
  width: 38%;
  max-width: 150px;
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
}

.tcard-head > .chips {
  padding-right: 40%;
}

.tcard-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font: 700 19px/1.2 var(--font-head);
  letter-spacing: -0.01em;
}

.tcard-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
}

.tcard-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
  padding: 10px 6px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(10, 9, 8, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tcard-cell {
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}

.tcard-cell + .tcard-cell {
  border-left: 1px solid rgba(212, 175, 55, 0.14);
}

.tcard-val {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 6px;
  font: 700 17px/1.3 var(--font-head);
  white-space: nowrap;
}

.tcard-val .old {
  margin: 0;
  font: 500 13px/1.3 var(--font-text);
}

.tcard-lbl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.tcard-lbl .ic {
  color: var(--gold);
}

/* Пометка владельцу «Не продаётся» (тариф не продаётся клиентам) — в строке названия, рядом с USD. */
.tcard-name .tag {
  height: 20px;
  padding: 0 8px;
  font-size: 11px;
}

/* --- 3. Тариф --- */

.hero {
  position: relative;
  margin: -8px calc(-1 * var(--pad)) 0;
  padding: 26px 20px 30px;
  overflow: hidden;
  border-radius: 0 0 32px 32px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  background: var(--t-grad);
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 34%;
  width: 90%;
  height: 50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 10px 0 22px;
  perspective: 900px;
}

.hero-art {
  width: min(76%, 300px);
  border-radius: 16px;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6);
  transform: rotateX(14deg) rotateY(-16deg) rotateZ(-5deg);
  animation: hero-float 7s ease-in-out infinite;
}

@keyframes hero-float {
  50% {
    transform: rotateX(10deg) rotateY(-10deg) rotateZ(-3deg) translateY(-6px);
  }
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-title {
  margin-top: 14px;
  font: 800 28px/1.15 var(--font-head);
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 330px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

.hero-tag {
  margin-top: 12px;
}

.rate {
  margin-top: 16px;
}

.rate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.rate-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 17px/1.3 var(--font-head);
}

.rate-title .ic {
  color: var(--gold);
}

.rate-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.rate-r {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

.rate-val {
  color: var(--gold-hi);
  font: 700 17px/1.3 var(--font-head);
  white-space: nowrap;
}

.rate-body {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  animation: fade-down 0.22s ease both;
}

.rate-cap {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  min-height: 178px;
  padding: 14px 14px 0;
  overflow: hidden;
  border-radius: var(--r-tile);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #1C1914 0%, var(--surface) 62%);
}

.tile-title {
  font: 700 15px/1.25 var(--font-head);
}

.tile-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.tile-ill {
  align-self: flex-end;
  width: 76%;
  aspect-ratio: 160 / 120;
  margin: auto -10px -2px 0;
  padding-top: 8px;
  object-fit: contain;
  pointer-events: none;
}

.faq-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* --- 4. Выпуск и статус заказа --- */

.form-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 6px;
}

.form-art {
  flex: 0 0 96px;
  width: 96px;
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}

.form-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.summary {
  margin-top: 18px;
}

.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  min-height: calc(var(--tg-viewport-height, 100vh) - 120px);
  padding: 24px 8px;
  text-align: center;
}

.status-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: radial-gradient(circle at 30% 30%, rgba(243, 212, 122, 0.18), rgba(212, 175, 55, 0.04) 70%);
  color: var(--gold-hi);
}

.status-ring .ic {
  width: 44px;
  height: 44px;
}

.status-ring.is-wait::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: -1px;
  left: -1px;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold-hi);
  animation: spin 1.1s linear infinite;
}

.status-ring.is-ok {
  border: 0;
  background: var(--gold-grad);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.3);
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.status-ring.is-bad {
  border-color: rgba(229, 72, 77, 0.5);
  background: rgba(229, 72, 77, 0.08);
  color: var(--danger);
}

@keyframes pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
}

.status-title {
  margin-top: 22px;
  font: 800 24px/1.2 var(--font-head);
}

.status-text {
  max-width: 330px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.status-sum {
  margin-top: 14px;
  color: var(--gold-hi);
  font: 700 18px/1.3 var(--font-head);
}

.status-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin-top: 28px;
}

/* --- 5. Реквизиты --- */

.sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sec-art {
  flex: 0 0 96px;
  width: 96px;
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}

.sec-name {
  font: 700 17px/1.3 var(--font-head);
}

.sec-num {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.hint-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-field);
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-hi);
  font: 600 14.5px/1.3 var(--font-text);
  text-decoration: none;
}

.hint-link .ic {
  width: 20px;
  height: 20px;
}

.hint-link .ic:last-child {
  margin-left: auto;
  width: 16px;
  height: 16px;
}

.copy-list {
  padding: 4px 0;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px 10px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.copy-row + .copy-row {
  border-top: 1px solid rgba(212, 175, 55, 0.08);
}

.copy-txt {
  display: block;
  flex: 1;
  min-width: 0;
}

.copy-lbl {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.copy-val {
  display: block;
  margin-top: 2px;
  font: 600 16px/1.35 var(--font-text);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}

.copy-val.is-pan {
  font: 700 19px/1.3 var(--font-head);
  letter-spacing: 0.06em;
}

.copy-ic {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--gold);
}

.copy-ic .ic {
  width: 18px;
  height: 18px;
}

.sheet-close {
  margin-top: 20px;
}

/* --- 6. Пополнение --- */

.pick-row {
  display: flex;
  gap: 10px;
  margin: 0 calc(-1 * var(--pad));
  padding: 2px var(--pad) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pick {
  position: relative;
  flex: 0 0 172px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  border-radius: var(--r-tile);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pick.is-selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 8px 22px rgba(212, 175, 55, 0.12);
}

.pick-art {
  width: 88px;
  border-radius: 7px;
}

.pick-test {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 20px;
  padding: 0 7px;
  font-size: 9.5px;
}

.pick-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pick-num {
  font: 700 17px/1 var(--font-head);
}

.pick-bal {
  color: var(--muted);
  font-size: 15px;
}

.method-row {
  display: flex;
  gap: 10px;
}

.method {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 152px;
  padding: 14px 16px;
  border-radius: var(--r-tile);
  border: 1px solid var(--gold);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.4);
  font-weight: 600;
}

.method-ic {
  width: 24px;
  height: 28px;
}

/* --- Истории и «О сервисе» --- */

.slides-overlay {
  background:
    radial-gradient(120% 55% at 90% 0%, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0) 60%),
    radial-gradient(90% 45% at 0% 100%, rgba(156, 116, 36, 0.22), rgba(156, 116, 36, 0) 65%),
    var(--bg);
}

.slides {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 12px) var(--pad) calc(var(--safe-b) + 16px);
}

.slides-bars {
  display: flex;
  gap: 6px;
  padding-top: 6px;
}

.slides-bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(245, 239, 227, 0.2);
}

.slides-bar i {
  display: block;
  height: 100%;
  background: var(--gold-hi);
  transform: scaleX(0);
  transform-origin: left center;
}

.slides-bar.is-done i {
  transform: scaleX(1);
}

.slides-bar.is-active i {
  animation: slide-progress var(--slide-ms, 7000ms) linear forwards;
}

.slides.is-paused .slides-bar.is-active i {
  animation-play-state: paused;
}

@keyframes slide-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.slides-close {
  align-self: flex-end;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 239, 227, 0.12);
  color: var(--text);
}

.slides-close .ic {
  width: 18px;
  height: 18px;
}

.slides-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.slide {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: slide-in 0.35s ease both;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.slide-title {
  margin-top: 6px;
  font: 800 30px/1.12 var(--font-head);
  letter-spacing: -0.01em;
}

.slide-text {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-line;
}

.slide-ill {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  padding: 28px 0 16px;
}

.slide-ill img {
  width: min(100%, 400px);
  max-height: 100%;
  object-fit: contain;
}

.slides-foot {
  padding-top: 12px;
}

/* --- Узкие экраны --- */

@media (max-width: 370px) {
  .hcard-bal {
    font-size: 34px;
  }

  .tcard-val {
    font-size: 15.5px;
  }

  .slide-title {
    font-size: 26px;
  }

  .banner {
    padding-right: 112px;
  }

  .banner-ill {
    width: 108px;
  }
}

/* --- Меньше движения --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .slides-bar.is-active i {
    animation: none !important;
    transform: scaleX(1);
  }

  .hero-art {
    animation: none !important;
  }
}
