:root {
  --ink: #1b1d45;
  --ink-2: #555b8c;
  --ink-3: #8a8fb6;
  --violet: #6f5cff;
  --blue: #4a86ff;
  --cyan: #2fb9f7;
  --grad: linear-gradient(120deg, #7c64ff 0%, #4f86ff 52%, #2fc0f8 100%);
  --grad-soft: linear-gradient(120deg, rgba(124,100,255,.14), rgba(47,192,248,.14));

  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-line: rgba(255, 255, 255, .8);
  /* 18px вместо 80px: визуально почти то же, а кадры рисуются в разы быстрее */
  --blur: blur(18px) saturate(1.5);
  --shadow: 0 6px 20px rgba(52, 60, 140, .1), 0 1px 2px rgba(52, 60, 140, .06);
  /* Готовая размытая картинка фона прямо в стилях (~2 КБ): карточки открываются
     уже «стеклянными», браузеру нечего вычислять и нечего догружать */
  --frost: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wAARCABwAEADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD29eRQUBqCOYBefSnRS+Znmq5WieZMfgD0owvt+dVbnKnINVlkYnkmrULq5DnZ2NTCjnio5GT1H51QluNq9aqhnkbgmqjS6sidXoa8aqx7VOFArMjfyRyea0Efcqn1FROLRUJozTOigknjFJbTF8lDxUF3asykJ6VUiuDZQNuPNdPImtCXJLVm4ysyc1VZNpJrMstbLyYfpWwZEmj3DpUuEoPUzjVjU2Mu4Ys+BUiXUVuuCRmquoyhMlOtZ0SPcNlia6owUlrsc8m76bmw9yJRkGp/t7RqgHpWHMJIRx0qzFcRbE3nnFN0VYu7Rtfa1t7ctL6Vy11ereykR9M1qX7fa0KA8YqnpljBaklzU04qCcnuY1HOpLlWw2K3SOPJODWhbSsYSiGqlzJE0vyn5aamqW9tIF3DNTVlZXZVKF52j0HNa3Dy8g4ovL+10qLM7AGtVJzPCZIxnivGPihe3gkcZYD2q4yc1rsjeCSlpud7a+KtNvJ/KLr1x1rom0uO6jjkgOVIzxXynaancW84kEjZz619HfDXXZL3TIN+T8vel7TmjzU3sa2d7TWhoxW919qzg7K0WtoTHlzjitqHyzFjAzisq9s3kVgh/KsVV5nZ6Eyioq1jkdTlC3BSEk1iT6dfNciX5tma7i20eJJN83X3qfULi0ii8pVXNbykqlorU5aUXSbn3K2g36Q24ic84xzVLxBoNjrSkMF3GqE52kvHmn6P9rmvAW3bc1o8PypyuQq0lozhNV+GDrPuhT5SfSvUvA+hw6RpsUcmAwWtyaZEhAYDOKxb69ZGXHA9q54Rc1ZaHTTxKWki54kuJ7GzaSHOQO1ZnhDXJr1WWcHOe9dfdWcd1EUkAIxWPFo8FkS0OAfasYVIuNmtToatuS3qM5471nvo7TncSa17dHkPzCrjjy04FNVnDSJlKmp7mFb6Gg+/0qac2unxEqBkCrU0z4IArndUt7i5JVc81tT5qr996HNVairRRyuu+K5WvvJhJznHFdTo1nNfW8TzA5I71mWnhKJbkXE4+bOea7m2jEUMSxrwBV1KigrRKhSiaZGQRWbMhRjWkeAfpVMkPndXnU3Y9CdmRQz7TzVrzEkFZdyrA/LRau4ODmtnTTV0QnbQuyRg9Koupjl+7xWijKeO9KYA5zioUrbicb7Gf5TTMBjArVjjWFFHoKjdkhXHenn5wp9qU5OXoJRUfUmHIqlMnJ21dXpS4HoKzjKxs1coRwluoqT7MByBVulpuowUUjNkidTkZqSG5wdrVdqN4167BT509GS4taoryxebyKtIm1VHoKVDx0xS1LlfQcUtz//Z");
  --glow: 0 8px 22px rgba(79, 110, 255, .35);

  --ok: #12a26a;
  --ok-soft: rgba(18, 162, 106, .13);
  --bad: #e2445c;
  --bad-soft: rgba(226, 68, 92, .12);
  --warn: #df8a12;
  --warn-soft: rgba(223, 138, 18, .14);

  --r-lg: 30px;
  --r-md: 20px;
  --r-sm: 14px;
  --font: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: Unbounded, Manrope, -apple-system, sans-serif;
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #e3ebfb; color: var(--ink); font-family: var(--font); }
body { position: relative; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Фон ----------
   Картинка лежит в отдельном фиксированном слое: при скролле он не перерисовывается.
   contain + translateZ — чтобы слой жил на отдельной поверхности и не дёргал остальную страницу. */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; contain: strict;
  transform: translateZ(0);
  /* Снизу — крошечная копия фона прямо в стилях: она видна с первого кадра,
     поэтому стеклу сразу есть что размывать. Сверху доезжает полная картинка. */
  background:
    url("bg.jpg") center / cover no-repeat,
    url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAA0JCgsKCA0LCwsPDg0QFCEVFBISFCgdHhghMCoyMS8qLi00O0tANDhHOS0uQllCR05QVFVUMz9dY1xSYktTVFH/2wBDAQ4PDxQRFCcVFSdRNi42UVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVH/wAARCAArABgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD0fzVbcucFfWoWuSgJbHHHSs64uvs85Ecil3CkJKT8oxyeB/OnzztNCuyM+aTj5PmAPHPvnPFdCpnO6q2Rfinww34y2MDFFYSXCS3BgiuYp5kO54vNG7j6UVbop9QU5IszJJbiedjskYZUom4sMcZ9+aqwNd20pF6uyB1AVUOCpHducevPetV4bqO/lbz91u0ahYQMMreoPvSS6fbht8sZkYjnPIoU09yZQa1RxuneFfsniG31uDUs2fmeYVKHcfbjrRXQfZ7651FPMIhsgu1YlHLnP6CinJQfxMcJztsb9wM54+hFMTzFXEvIzxVvauc45owK5ubSxvYqrEqFRGvX+L0FFWERVyFGBmik2JRR/9k=") center / cover no-repeat,
    #e3ebfb;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(240,244,255,.05) 0%, rgba(240,244,255,.2) 45%, rgba(240,244,255,.45) 100%);
}

.glass {
  background:
    linear-gradient(var(--glass), var(--glass)),
    var(--frost) center / cover no-repeat fixed;
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
}

/* ---------- Шапка ---------- */
.topbar {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: calc(14px + var(--tg-content-safe-area-inset-top, 0px)) 16px 0;
}
/* Обе плашки шапки одинаковой высоты и формы, фон у них стеклянный */
.brand, .support-btn { display: flex; align-items: center; height: 44px; border-radius: 999px; }
/* Под логотипом фон светлее, поэтому белого в плашке меньше — иначе она
   выглядит плотнее, чем «Поддержка» */
.brand {
  justify-content: center; padding: 0 16px; min-width: 0;
  background:
    linear-gradient(rgba(255,255,255,.42), rgba(255,255,255,.42)),
    var(--frost) center / cover no-repeat fixed;
}
.brand img { height: 26px; width: auto; display: block; }
.support-btn { gap: 7px; padding: 0 16px 0 13px; font-weight: 700; font-size: 14px; flex: none; }
@media (max-width: 370px) {
  .brand, .support-btn { height: 40px; }
  .brand { padding: 0 12px; }
  .brand img { height: 23px; }
}
.support-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--violet); stroke-width: 2; stroke-linecap: round; }
.support-btn:active, .brand:active { transform: scale(.97); }

/* ---------- Страница ---------- */
.page { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 18px 16px calc(120px + var(--safe-bottom)); }
.loader { display: grid; place-items: center; height: 60vh; }
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.8); border-top-color: var(--violet); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.stack-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--ink-2); }

/* ---------- Кнопки ---------- */
.btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 18px;
  border-radius: 18px; font-size: 16px; font-weight: 700; transition: transform .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--glass-line); }
.btn-soft { background: var(--grad-soft); color: var(--blue); }
.btn-danger { color: var(--bad); font-weight: 600; }
.btn-sm { width: auto; padding: 10px 16px; border-radius: 14px; font-size: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.icon-btn.grad { background: var(--grad); color: #fff; box-shadow: var(--glow); }

/* ---------- Карточка подписки ---------- */
.sub-card { border-radius: var(--r-lg); padding: 18px; }
.sub-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: rgba(85,91,140,.1); color: var(--ink-2); }
.price-tag { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.price-tag b { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 14px; }
.sub-main { display: flex; align-items: center; gap: 18px; margin: 16px 0 18px; }
.ring {
  --p: 0; width: 118px; height: 118px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(from -90deg, #7c64ff, #4f86ff calc(var(--p) * 50%), #2fc0f8 calc(var(--p) * 100%), rgba(85,91,140,.12) 0);
}
.ring > div { width: 94px; height: 94px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-content: center; text-align: center; }
.ring b { font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1; }
.ring small { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-top: 3px; }
.sub-info { display: grid; gap: 12px; min-width: 0; }
.sub-info .value { font-size: 19px; font-weight: 800; margin-top: 2px; }

/* minmax(0, 1fr) — иначе длинное слово («Установить») растягивает свою колонку
   и плитки получаются разной ширины */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px;
  min-width: 0; padding: 14px 2px 11px; border-radius: var(--r-md);
  font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center;
}
/* подпись в одну строку: если не влезает — чуть ужимаем буквы, а не ломаем сетку */
.quick button > span:last-child { max-width: 100%; letter-spacing: -.02em; white-space: nowrap; }
.quick button:active { transform: scale(.96); }
.quick .qi { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); color: var(--violet); }
.quick .qi svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.notice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border-radius: var(--r-md); text-align: left; }
.notice .ni { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.notice .ni svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.notice b { display: block; font-size: 14px; }
.notice small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.chev { width: 18px; height: 18px; margin-left: auto; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Блоки со списками ---------- */
.block { border-radius: var(--r-lg); padding: 16px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.block-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.counter { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: rgba(85,91,140,.1); color: var(--ink-2); }
.block-head .push { margin-left: auto; }
.rows { display: grid; gap: 10px; }
.row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 18px;
  background: rgba(255,255,255,.66); text-align: left; border: 1px solid rgba(255,255,255,.7);
}
.row:active { transform: scale(.985); }
.row .ri { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--grad-soft); color: var(--blue); }
.row .ri svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.row .rm { min-width: 0; flex: 1; }
.row .rm b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rm small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.row .val { font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.empty { padding: 20px 12px 6px; text-align: center; }
.empty p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }

/* ---------- Рефералы ---------- */
.page-title { padding: 6px 4px 2px; }
.page-title h1 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.page-title p { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.earn-card { border-radius: var(--r-lg); padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.big { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }
.big-sub { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { border-radius: var(--r-md); padding: 14px 10px; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 20px; font-weight: 800; white-space: nowrap; }
.stat span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-top: 3px; }
.link-box { border-radius: var(--r-lg); padding: 16px; display: grid; gap: 10px; }
.link-field {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 16px;
  background: rgba(255,255,255,.8); border: 1.5px dashed rgba(111,92,255,.35); text-align: left;
}
.link-field span { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-field svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--violet); stroke-width: 2; }
.how { border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; }
.how-step { display: flex; gap: 12px; align-items: flex-start; }
.how-step i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-style: normal; font-size: 13px; font-weight: 800; flex: none; }
.how-step p { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.how-step p b { color: var(--ink); }

/* ---------- Профиль ---------- */
.profile-card { border-radius: var(--r-lg); padding: 24px 18px 20px; text-align: center; }
.avatar {
  width: 96px; height: 96px; margin: 0 auto 12px; border-radius: 32px; display: grid; place-items: center;
  font-family: var(--display); font-size: 42px; font-weight: 800; color: #fff; overflow: hidden;
  box-shadow: var(--glow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card h1 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.tg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px; background: rgba(255,255,255,.75); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.tg-chip svg { width: 20px; height: 20px; }

/* ---------- Таббар ---------- */
.tabbar {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-bottom));
  width: min(calc(100% - 24px), 460px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 6px; border-radius: 26px;
  background:
    linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
    var(--frost) center / cover no-repeat fixed;
}
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; border-radius: 20px; color: var(--ink-3); font-size: 11.5px; font-weight: 700; transition: background .2s, color .2s; }
.tab-badge { position: absolute; top: 5px; right: calc(50% - 22px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.tabbar button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { background: var(--grad); color: #fff; box-shadow: var(--glow); }

/* ---------- Шторка ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(27, 29, 69, .35); animation: fade-bg .2s ease both; }
@keyframes fade-bg { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; margin: 0 auto; max-width: 560px;
  background: #f7f9ff; border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + var(--safe-bottom));
  box-shadow: 0 -2px 16px rgba(27, 29, 69, .12);
  animation: slide-up .3s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes slide-up { from { transform: translateY(100%); } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: rgba(85,91,140,.22); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.sheet .lead { margin: 0 0 18px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.card-in { border-radius: var(--r-md); background: #fff; border: 1px solid rgba(85,91,140,.1); }
.field { width: 100%; padding: 14px 15px; border-radius: 16px; border: 1.5px solid rgba(85,91,140,.16); background: #fff; font-size: 16px; font-weight: 600; outline: none; }
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(79,134,255,.14); }
textarea.field { resize: none; min-height: 110px; line-height: 1.4; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 14px 0 8px; }
.hint { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center; margin: 12px 0 14px; }
.stack { display: grid; gap: 10px; }
.gap { height: 16px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: rgba(85,91,140,.09); }
.segmented button { padding: 10px 6px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(27,29,69,.1); }

.periods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 15px; border-radius: 18px; background: #fff; border: 1.5px solid rgba(85,91,140,.12); text-align: left; }
.period b { font-size: 16px; font-weight: 800; }
.period span { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.period.on { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.period.on span { color: var(--blue); }

.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.platform { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 15px 6px 12px; border-radius: 18px; background: #fff; border: 1.5px solid rgba(85,91,140,.12); font-size: 13px; font-weight: 700; }
.platform svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.platform.on { background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 2px solid transparent; color: var(--blue); }
.platform.on svg { stroke: var(--violet); }

.device-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.device-head .ri { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--glow); }
.device-head .ri svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.device-head h2 { margin: 0 0 2px; }
.steps { display: grid; gap: 10px; margin: 16px 0 6px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 15px; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.step h3 { margin: 4px 0 4px; font-size: 16px; font-weight: 800; }
.step p { margin: 0 0 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.step p:last-child { margin-bottom: 0; }
.warn-box { padding: 14px; border-radius: 18px; background: var(--bad-soft); color: #b42340; font-size: 14px; font-weight: 600; line-height: 1.45; margin-top: 14px; }
.warn-box .btn { margin-top: 10px; }

.history { display: grid; gap: 2px; margin-top: 8px; }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.tx-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 19px; background: #fff; border: 1px solid rgba(85,91,140,.1); }
.tx .meta { flex: 1; min-width: 0; }
.tx .meta b { display: block; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .meta small { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.tx .amt { font-weight: 800; font-size: 15px; white-space: nowrap; }
.tx .amt.plus { color: var(--ok); }

.faq { display: grid; gap: 8px; margin: 4px 0 16px; }
.faq details { border-radius: 16px; background: #fff; border: 1px solid rgba(85,91,140,.1); padding: 13px 15px; }
.faq summary { font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; font-size: 20px; font-weight: 600; color: var(--violet); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; font-weight: 600; line-height: 1.5; }
.section-label { font-size: 13px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 18px 2px 10px;  }

.toast {
  position: fixed; z-index: 40; left: 50%; top: calc(16px + var(--tg-content-safe-area-inset-top, 0px)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: rgba(27, 29, 69, .92); color: #fff;
  font-size: 14.5px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.18); animation: rise .2s ease both;
}

.error-screen { border-radius: var(--r-lg); padding: 28px 20px; text-align: center; margin-top: 40px; }
.error-screen h2 { font-size: 21px; margin: 0 0 8px; }
.error-screen p { color: var(--ink-2); margin: 0 0 18px; font-weight: 600; }

@media (max-width: 370px) {
  .support-btn span { display: none; }
  .support-btn { padding: 10px; }
  .ring { width: 104px; height: 104px; }
  .ring > div { width: 82px; height: 82px; }
  .ring b { font-size: 27px; }
  .quick button { font-size: 11.5px; }
  .big { font-size: 30px; }
}

/* ---------- Задания ---------- */
.task {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r-lg);
  background:
    linear-gradient(var(--glass), var(--glass)),
    var(--frost) center / cover no-repeat fixed;
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
}
.task.done { opacity: .62; }
.task-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; font-size: 22px; background: var(--grad-soft); }
.task-body { flex: 1; min-width: 0; }
.task-body b { display: block; font-size: 15px; font-weight: 700; }
.task-body p { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.task-reward { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 4px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; }
.task-reward.muted { background: rgba(85,91,140,.1); color: var(--ink-2); }
.task .btn { width: auto; flex: none; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; }
.task-done-mark { font-size: 22px; flex: none; color: var(--ok); }
.task-tomorrow { flex: none; font-size: 11.5px; font-weight: 800; line-height: 1.2; text-align: center; color: var(--ink-3); }
.task-progress { height: 5px; border-radius: 3px; background: rgba(85,91,140,.14); margin-top: 8px; overflow: hidden; }
.task-progress i { display: block; height: 100%; border-radius: 3px; background: var(--grad); }

/* ---------- Способы оплаты ---------- */
.methods { display: grid; gap: 8px; }
.method {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border-radius: 18px;
  background: #fff; border: 1.5px solid rgba(85,91,140,.12); text-align: left; transition: border-color .15s, transform .15s;
}
.method:active { transform: scale(.985); }
.method:hover { border-color: rgba(111,92,255,.45); }
.m-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 21px; background: var(--grad-soft); }
.m-body { flex: 1; min-width: 0; }
.m-body b { display: block; font-size: 15px; font-weight: 700; }
.m-body small { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 1px; }
.m-sum { font-size: 14px; font-weight: 800; white-space: nowrap; color: var(--blue); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 2px; }
.presets button { flex: 1 1 0; min-width: 72px; padding: 11px 6px; border-radius: 14px; background: #fff; border: 1.5px solid rgba(85,91,140,.12); font-weight: 700; font-size: 15px; }
.presets button.on { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 2px solid transparent; color: var(--blue); }

/* ---------- СБП через Stars ---------- */
.sbp-open {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px;
  border-radius: 18px; background: #fff; border: 1.5px solid rgba(85,91,140,.12); text-align: left;
}
.sbp-open:active { transform: scale(.985); }
.sbp-logo { flex: none; width: 36px; height: 36px; object-fit: contain; }
.sbp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sbp-head h2 { margin: 0 0 2px; }
.sbp-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sbp-icon-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1;
  display: grid; place-items: center; background: var(--grad-soft); color: var(--blue); font-weight: 700;
}
.sbp-icon-btn:disabled { opacity: .35; }
.sbp-dots { flex: 1; display: flex; justify-content: center; gap: 6px; }
.sbp-dots i { width: 6px; height: 6px; border-radius: 6px; background: rgba(85,91,140,.25); transition: width .25s, background .25s; }
.sbp-dots i.on { width: 20px; background: var(--blue); }
.sbp-count { font-size: 13px; font-weight: 800; color: var(--ink-3); }
.sbp-shot {
  height: min(42vh, 320px); padding: 6px; border-radius: 16px; background: #fff;
  border: 1px solid rgba(85,91,140,.12); overflow: hidden;
}
.sbp-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sbp-step { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 16px; font-weight: 700; }
.sbp-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 14px;
}
.sbp-text { margin: 0 0 14px; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink-2); min-height: 42px; }
.step code { background: rgba(85,91,140,.1); padding: 1px 5px; border-radius: 6px; font-size: 12.5px; }

/* ---------- Производительность ----------
   Внутри шторки фон непрозрачный, размывать там нечего — лишний слой только тормозит. */
.sheet .glass, .sheet .task { background: #fff; }

/* Прокрутка не должна заставлять браузер перерисовывать весь экран */
.sheet { will-change: transform; }
.page { contain: layout paint; }

/* Если в системе включено «уменьшить движение» — выключаем анимации */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Каркас до загрузки данных ----------
   Плашки те же самые (.glass), поэтому размытие видно с первого кадра,
   а внутри — серые прямоугольники вместо текста. */
.sk { display: block; background: rgba(90, 100, 150, .13); border-radius: 8px; }
.sk-pill { width: 140px; height: 26px; border-radius: 999px; }
.sk-sm { width: 86px; height: 16px; }
.sk-xs { width: 62px; height: 12px; }
.sk-md { width: 120px; height: 20px; margin-top: 7px; }
.sk-btn { width: 100%; height: 50px; border-radius: 18px; margin-top: 2px; }
.sk-row { width: 100%; height: 64px; border-radius: 18px; }
.sk-ring { width: 118px; height: 118px; border-radius: 50%; flex: none; }
.sk-qi { background: rgba(90, 100, 150, .13) !important; }
#skeleton .sub-info { gap: 14px; }
#skeleton .quick button { pointer-events: none; }
#skeleton { animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: .62; } }
@media (prefers-reduced-motion: reduce) { #skeleton { animation: none; } }
