/* =============================================================
   Тема: тёмный индиго с мягкими цветными свечениями,
   оранжево-розовые градиентные CTA, фиолетовые акценты.
   Все цвета, радиусы и отступы — в токенах ниже.
   ============================================================= */
:root {
  color-scheme: dark;

  /* фон и поверхности */
  --bg-0: #0B0A1C;                 /* фон страницы */
  --bg-1: #14122B;                 /* карточки */
  --bg-2: #1C1938;                 /* плитки, вторичные кнопки, поля ввода */
  --bg-3: #26224A;                 /* нажатие поверхностей */
  --line: rgba(255, 255, 255, .08);   /* границы карточек, разделители */
  --line-2: rgba(255, 255, 255, .14); /* границы кнопок и бейджей */

  /* текст */
  --text-1: #FFFFFF;
  --text-2: #B9B6D3;               /* описания */
  --text-3: #7F7B9E;               /* подписи, неактивные вкладки */

  /* акценты */
  --orange: #FF8A1F;
  --coral: #FF4D3D;
  --pink: #FF2E8A;
  --violet: #7C4DFF;
  --violet-2: #A86BFF;
  --violet-soft: #C4B5FD;
  --gold: #FFB020;

  /* градиенты */
  --grad-accent: linear-gradient(90deg, #FF8A1F 0%, #FF4D3D 55%, #FF2E8A 100%);
  --grad-violet: linear-gradient(135deg, #6A3DF5 0%, #A259FF 100%);
  --grad-warm-card: linear-gradient(135deg, rgba(255, 138, 31, .22) 0%, rgba(255, 46, 138, .12) 55%, rgba(20, 18, 43, 0) 100%);
  --grad-violet-card: linear-gradient(135deg, rgba(124, 77, 255, .22) 0%, rgba(20, 18, 43, 0) 70%);

  /* свечения и тени */
  --glow-accent: 0 10px 30px rgba(255, 90, 70, .35);
  --glow-violet: 0 10px 30px rgba(124, 77, 255, .35);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, .35);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, .18);

  /* радиусы */
  --r-card: 20px;
  --r-btn: 14px;
  --r-tile: 12px;
  --r-badge: 10px;
  --r-pill: 999px;

  /* отступы (сетка 4px) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif;

  --tabbar-h: 64px;
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

/* ===== База ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg-0); color-scheme: dark; }
body {
  margin: 0; background: transparent; color: var(--text-1);  /* фон у html: иначе body перекроет свечение */
  font: 400 15px / 22px var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sp-4));
  overscroll-behavior-y: none;
}

/* Цветные свечения фона: зафиксированы, контент плывёт над ними. Без filter: blur — только градиенты */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(520px 520px at 12% -6%, rgba(124, 77, 255, .38), transparent 62%),
    radial-gradient(420px 420px at 100% 18%, rgba(168, 107, 255, .16), transparent 60%);
}
body::after {
  background:
    radial-gradient(620px 620px at 88% 104%, rgba(255, 46, 138, .30), transparent 62%),
    radial-gradient(360px 360px at 40% 110%, rgba(255, 138, 31, .18), transparent 60%);
}

a { color: var(--violet-soft); text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; user-select: none; }
input, textarea { font: inherit; color: var(--text-1); }
svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}
svg.i-fill { fill: currentColor; stroke: none; }

#app { max-width: 640px; margin: 0 auto; padding: 0 var(--sp-4); }

/* Вертикальный ритм: 16px между блоками, 24px перед заголовком секции */
#app > * + * { margin-top: var(--sp-4); }
#app > .section-title { margin-top: var(--sp-6); }
#app > .section-title + * { margin-top: var(--sp-3); }

/* Появление экрана: мягко снизу, карточки с небольшой задержкой */
#app > * { animation: rise .18s ease-out both; }
#app > :nth-child(3) { animation-delay: .04s; }
#app > :nth-child(4) { animation-delay: .08s; }
#app > :nth-child(5) { animation-delay: .12s; }
#app > :nth-child(6) { animation-delay: .16s; }
#app > :nth-child(n+7) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ===== Общие блоки ===== */
.splash { min-height: 70vh; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(124, 77, 255, .25); border-top-color: var(--violet-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Шапка приложения: марка + название проекта */
.appbar { display: flex; align-items: center; gap: 10px; height: 52px; }
#app > .appbar + .topbar { margin-top: var(--sp-2); }
.appbar .logo {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--grad-violet); color: #fff; box-shadow: var(--inset-hi);
}
.appbar .logo svg { width: 16px; height: 16px; }
.appbar .brand { font-size: 15px; line-height: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

/* Заголовок экрана + бейдж тарифа */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.topbar h1 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.02em; }
.topbar .tagline { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-3); margin-bottom: var(--sp-1); }
.topbar--lead { align-items: flex-end; }
.topbar--lead h1 { font-size: 24px; line-height: 30px; }
.topbar--lead .chip { margin-bottom: 0; align-self: flex-start; margin-top: var(--sp-1); }

.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-badge);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 138, 31, .6);
  font-size: 13px; font-weight: 600; white-space: nowrap; flex: none;
}
.chip:not(.muted) {
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
  box-shadow: inset 0 0 0 40px rgba(255, 255, 255, .06);  /* подложка: фон целиком ушёл в градиент текста */
}
.chip.muted { border-color: var(--line-2); color: var(--text-2); font-weight: 500; }

.lead { margin: 0; color: var(--text-2); font-size: 15px; line-height: 22px; }
#app > .topbar + .lead { margin-top: var(--sp-2); }

.section-title { margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; }

.card {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 18px; box-shadow: var(--shadow-card);
}
.hint { color: var(--text-3); font-size: 13px; line-height: 18px; }
.empty { text-align: center; color: var(--text-3); padding: var(--sp-6) 18px; font-size: 14px; line-height: 22px; }
.empty--icon svg { width: 24px; height: 24px; color: var(--violet-2); display: block; margin: 0 auto var(--sp-3); }
.empty--icon p { margin: 0; }

/* ===== Иконочные плитки ===== */
.tile {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--violet-soft);
}
.tile svg { width: 18px; height: 18px; }
.tile--44 { width: 44px; height: 44px; border-radius: var(--r-tile); }
.tile--44 svg { width: 22px; height: 22px; }
.tile--56 { width: 56px; height: 56px; border-radius: 16px; }
.tile--56 svg { width: 26px; height: 26px; }
.tile--violet { background: rgba(124, 77, 255, .22); color: var(--violet-soft); }
.tile--violet.tile--56 { background: var(--grad-violet); color: #fff; box-shadow: var(--glow-violet), var(--inset-hi); }
.tile--pink { background: rgba(255, 46, 138, .18); color: #F9A8D4; }
.tile--orange { background: rgba(255, 138, 31, .18); color: #FFC078; }
.tile--neutral { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--violet-soft); }

/* ===== Кнопки =====
   .btn.cta / .btn.success — главный градиентный CTA
   .btn / .btn.secondary   — обводка на полупрозрачном фоне
   .btn.ghost              — приглушённая
*/
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  min-height: 48px; padding: 12px var(--sp-4); border-radius: 12px;
  font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text-1);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
  transition: transform .15s, filter .15s, box-shadow .2s, background .15s;
}
.btn svg { width: 18px; height: 18px; color: currentColor; }
.btn:active { transform: scale(.98); background: rgba(255, 255, 255, .10); }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn.cta, .btn.success {
  min-height: 52px; border-radius: var(--r-btn); border: 0;
  font-size: 16px; font-weight: 700; color: #fff;
  background: var(--grad-accent); box-shadow: var(--glow-accent), var(--inset-hi);
}
.btn.cta:active, .btn.success:active { background: var(--grad-accent); filter: brightness(.95); }
.btn.secondary { background: rgba(255, 255, 255, .06); border-color: var(--line-2); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn + .btn { margin-top: var(--sp-2); }
.row-btns { display: flex; gap: var(--sp-2); }
.row-btns .btn + .btn { margin-top: 0; }

.chip-btn {
  height: 36px; padding: 0 14px; border-radius: 12px; flex: none;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
  color: var(--text-1); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: transform .15s, background .15s;
}
.chip-btn:active { transform: scale(.98); background: rgba(255, 255, 255, .10); }

/* ===== Тёплые hero-карточки: приветствие и апсейл ===== */
.banner, .hero {
  position: relative; border-radius: var(--r-card); padding: 18px;
  background: var(--grad-warm-card), var(--bg-1);
  border: 1px solid rgba(255, 122, 60, .55);
  box-shadow: 0 12px 40px rgba(255, 90, 60, .18), var(--inset-hi);
}
.hero-spark { position: absolute; top: 18px; right: 18px; color: var(--orange); opacity: .8; }
.hero-spark svg { width: 20px; height: 20px; }
.banner h2, .hero h2 { margin: 0 32px var(--sp-2) 0; font-size: 18px; line-height: 24px; font-weight: 700; }
.banner p, .hero p { margin: 0 0 var(--sp-4); color: var(--text-2); font-size: 15px; line-height: 22px; }
.hero p { margin-bottom: 0; }
.banner .save {
  font-size: 13px; line-height: 18px; font-weight: 700; margin-bottom: var(--sp-1);
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.banner-head { display: flex; gap: var(--sp-3); align-items: flex-start; }
.banner-head > div { flex: 1; min-width: 0; }
.banner--crown h2 { margin-right: 0; }
.banner .crown { color: var(--gold); margin-top: 1px; filter: drop-shadow(0 0 10px rgba(255, 176, 32, .45)); }
.banner .crown svg { width: 22px; height: 22px; }

.progress { height: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .08); margin: var(--sp-4) 0 var(--sp-2); overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: var(--grad-accent); transition: width .4s ease; }
.hero .progress-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); }
.hero .btn { margin-top: var(--sp-4); }

/* Карточка бесплатного материала */
.promo { display: flex; gap: var(--sp-3); align-items: center; }
.promo b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; }
.promo .hint { display: block; }

/* ===== Видео ===== */
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px;
  overflow: hidden; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Приветственное видео с тезисами: одна карточка, плеер сверху, таймлайн снизу */
.welcome-video.with-notes {
  background: var(--grad-violet-card), var(--bg-1); border: 1px solid rgba(124, 77, 255, .28);
  border-radius: var(--r-card); padding: 10px; box-shadow: 0 12px 36px rgba(124, 77, 255, .14), var(--shadow-card);
}
.welcome-video.with-notes .player { border-radius: 14px; box-shadow: none; }
.notes-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) 8px var(--sp-2); }
.notes-head h3 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; }
.notes { list-style: none; margin: 0; padding: 4px 8px 8px; }
.notes li { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: var(--sp-3); padding: 10px 0; }
/* линия таймлайна между метками времени */
.notes li:not(:last-child)::before {
  content: ""; position: absolute; left: 25px; top: 38px; bottom: -10px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(124, 77, 255, .45), rgba(124, 77, 255, .08));
}
.note-time {
  position: relative; z-index: 1; align-self: start; height: 26px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: var(--bg-2); border: 1px solid rgba(255, 138, 31, .45);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--orange);
}
.note-body b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; }
.note-body p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; line-height: 20px; }
.note-body p::first-letter { text-transform: uppercase; }

/* ===== Разделы и материалы: одна группа-список ===== */
.group {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.module + .module { border-top: 1px solid var(--line); }
.module-head {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  min-height: 56px; padding: 10px var(--sp-4); text-align: left;
}
.module-head:active { background: rgba(255, 255, 255, .04); }
.module-num { width: 24px; flex: none; font-size: 15px; font-weight: 600; color: var(--text-3); }
.module-head .title { flex: 1; min-width: 0; }
.module-head .title b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; }
.module-head .title span { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); }
.module-head .chev { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s ease; }
.module.open .chev { transform: rotate(90deg); }
.lessons { display: none; background: rgba(255, 255, 255, .02); border-top: 1px solid var(--line); }
.module.open .lessons { display: block; }
.lesson-row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  min-height: 52px; padding: 8px var(--sp-4) 8px 52px; text-align: left;
}
.lesson-row + .lesson-row { border-top: 1px solid var(--line); }
.lesson-row:active { background: rgba(255, 255, 255, .04); }
.lesson-row .st {
  width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: rgba(124, 77, 255, .22); color: var(--violet-soft);
}
.lesson-row .st svg { width: 14px; height: 14px; }
.lesson-row.done .st { background: var(--grad-accent); color: #fff; }
.lesson-row.done .st svg { stroke-width: 3; }
.lesson-row.locked .st { background: rgba(255, 255, 255, .06); color: var(--text-3); }
.lesson-row .lt { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 600; }
.lesson-row.locked .lt { color: var(--text-3); }
.tag {
  font-size: 12px; line-height: 16px; font-weight: 600; padding: 3px var(--sp-2); border-radius: var(--r-pill);
  background: rgba(124, 77, 255, .18); color: var(--violet-soft); white-space: nowrap;
}

/* Карточки открытых видео в разделе: обложка + тезисы */
.lessons.with-cards { gap: var(--sp-3); padding: var(--sp-3); }
.module.open .lessons.with-cards { display: grid; }  /* свёрнутый раздел остаётся скрытым */
.lessons.with-cards .lesson-row { border-radius: var(--r-tile); background: rgba(255, 255, 255, .03); padding-left: var(--sp-4); }
.lessons.with-cards .lesson-row + .lesson-row { border-top: 0; }
.lesson-card {
  display: block; width: 100%; text-align: left; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  transition: transform .15s, border-color .15s;
}
.lesson-card:active { transform: scale(.99); border-color: var(--line-2); }
.lc-cover { position: relative; aspect-ratio: 16 / 9; background: var(--grad-violet-card), var(--bg-1); overflow: hidden; }
.lc-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lc-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 10, 28, .1) 0%, rgba(11, 10, 28, .55) 100%); }
.lc-play {
  position: absolute; z-index: 1; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--grad-violet); border: 2px solid rgba(255, 255, 255, .18); box-shadow: 0 8px 28px rgba(108, 76, 245, .55);
}
.lc-play svg { width: 20px; height: 20px; margin-left: 2px; }
.lc-dur {
  position: absolute; z-index: 1; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 8px;
  background: rgba(11, 10, 28, .8); color: #fff; font-size: 12px; line-height: 18px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lc-done {  /* внизу слева: сверху на обложке бывает название блока */
  position: absolute; z-index: 1; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 8px; border-radius: var(--r-pill); background: var(--grad-accent); color: #fff;
  font-size: 12px; line-height: 16px; font-weight: 700; box-shadow: 0 4px 14px rgba(255, 90, 70, .35);
}
.lc-done svg { width: 12px; height: 12px; stroke-width: 3; }
.lesson-card.done .lc-play { background: rgba(11, 10, 28, .6); box-shadow: none; }
.lc-body { display: block; padding: 12px 14px 14px; }
.lc-title { display: block; font-size: 16px; line-height: 22px; font-weight: 700; }
.lc-notes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.lc-notes li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 18px; color: var(--text-2); }
.lc-time {
  flex: none; min-width: 38px; text-align: center; padding: 1px 6px; border-radius: var(--r-pill);
  border: 1px solid rgba(255, 138, 31, .45); color: var(--orange); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lc-more { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--violet-soft); }

/* ===== Материал ===== */
.back-link { display: inline-flex; align-items: center; gap: var(--sp-1); height: 44px; color: var(--text-2); font-weight: 600; }
.back-link svg { width: 18px; height: 18px; }
#app > .lesson-meta { margin-top: var(--sp-4); }
.lesson-meta { color: var(--text-3); font-size: 12px; line-height: 16px; font-weight: 600; }
#app > .lesson-title { margin-top: var(--sp-1); }
.lesson-title { margin: 0; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.02em; }
.rich { font-size: 15px; line-height: 24px; color: var(--text-2); word-wrap: break-word; }
.rich b, .rich strong { color: var(--text-1); }
.rich blockquote {
  margin: var(--sp-3) 0; padding: 10px 14px; border-left: 3px solid var(--violet);
  background: rgba(124, 77, 255, .12); border-radius: 0 var(--r-tile) var(--r-tile) 0; color: var(--text-1);
}
.rich pre, .rich code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
}
.rich code { padding: 1px 5px; }
.rich pre { padding: 10px 12px; overflow-x: auto; }
.rich tg-spoiler { background: var(--bg-3); color: transparent; border-radius: 6px; cursor: pointer; }
.rich tg-spoiler.shown { background: none; color: inherit; }
.materials { padding: 0 var(--sp-4); }
.materials a, .materials div {
  display: flex; gap: var(--sp-3); align-items: center; min-height: 56px; padding: 10px 0;
  word-break: break-word; font-size: 15px; font-weight: 600; color: var(--text-1);
}
.materials a svg { width: 18px; height: 18px; color: var(--violet-soft); }
.materials > * + * { border-top: 1px solid var(--line); }
.lesson-actions .btn + .btn { margin-top: var(--sp-3); }

/* ===== Чек-лист материала ===== */
.checklist { padding: var(--sp-4); }
.chk-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  font-size: 13px; font-weight: 600; color: var(--text-3);
}
.checklist.all-done .chk-head { color: var(--violet-soft); }
.chk-reset { border: 0; background: none; padding: 2px 0; color: var(--text-3); font: inherit; font-size: 13px; }
.checklist ul { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.checklist li {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: 12px 0;
  font-size: 15px; line-height: 22px; color: var(--text-1);
}
.checklist li + li { border-top: 1px solid var(--line); }
.chk-box {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px;
  border: 1.5px solid var(--line-2); background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.chk-box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: opacity .15s ease; }
.checklist li.done .chk-box { background: var(--grad-accent); border-color: transparent; }
.checklist li.done .chk-box svg { opacity: 1; }
.checklist li.done .chk-text { color: var(--text-3); text-decoration: line-through; }

/* ===== Тарифы ===== */
.tariff {
  --tone: 124, 77, 255;
  position: relative; border-radius: var(--r-card); padding: 18px;
  background: var(--bg-1); border: 1px solid rgba(var(--tone), .35);
  box-shadow: 0 8px 28px rgba(var(--tone), .12), var(--shadow-card);
}
.tariff--pink { --tone: 255, 46, 138; }
.tariff--orange { --tone: 255, 138, 31; }
.tariff.current { border-color: rgba(var(--tone), .7); box-shadow: 0 8px 32px rgba(var(--tone), .22), var(--shadow-card); }
.tariff.best::before {
  content: "Популярный"; position: absolute; top: -11px; left: 18px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--grad-accent); color: #fff; font-size: 12px; line-height: 16px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 90, 70, .35);
}
.tariff-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.tariff-level { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-3); }
.tariff h3 { margin: var(--sp-1) 0 2px; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; }
.tariff .sub { color: var(--text-2); font-size: 15px; line-height: 22px; }
.features { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 10px; }
.features li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 22px; font-weight: 600; }
.check {
  width: 18px; height: 18px; flex: none; margin-top: 2px; border-radius: 5px;
  display: grid; place-items: center; background: var(--grad-accent); color: #fff;
}
.check svg { width: 12px; height: 12px; stroke-width: 3; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.price { font-size: 28px; line-height: 32px; font-weight: 800; letter-spacing: -.02em; }
.price-old { color: var(--text-3); text-decoration: line-through; font-size: 15px; font-weight: 500; }
.price-note {
  width: 100%; font-size: 13px; line-height: 18px; font-weight: 600;
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.owned-badge { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }

/* ===== Эфиры ===== */
.locked-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-6) 18px; }
.locked-card b { margin-top: 14px; font-size: 18px; line-height: 24px; font-weight: 700; }
.locked-card p { margin: var(--sp-2) 0 18px; color: var(--text-2); font-size: 15px; line-height: 22px; }
.event { display: flex; gap: 14px; align-items: center; padding: 14px; }
#app > .event + .event, #app > .card + .card { margin-top: var(--sp-3); }
.event-date {
  width: 52px; flex: none; text-align: center; border-radius: 14px; padding: var(--sp-2) 0;
  background: var(--bg-2); border: 1px solid var(--line);
}
.event-date b { display: block; font-size: 20px; line-height: 24px; font-weight: 800; }
.event-date span { display: block; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--orange); }
.event-date.past span { color: var(--text-3); }
.event-body { flex: 1; min-width: 0; }
.event-body b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; }
.event .mini-btn {
  height: 36px; padding: 0 var(--sp-3); border-radius: 12px; white-space: nowrap;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
  color: var(--text-1); font-size: 14px; font-weight: 600;
}
.event .mini-btn:not(.ghost) { background: var(--grad-accent); border: 0; box-shadow: var(--glow-accent); }
.event > .hint svg { width: 18px; height: 18px; color: var(--text-3); }

/* ===== Профиль ===== */
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--grad-violet); color: #fff; font-size: 22px; font-weight: 700;
  box-shadow: var(--glow-violet), var(--inset-hi);
}
.profile-head b { display: block; font-size: 17px; line-height: 22px; font-weight: 700; }
.profile-head .hint { display: block; margin-top: 2px; }
.card.flush { padding: 0; overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  min-height: 56px; padding: 10px var(--sp-4); text-align: left;
}
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item:active { background: rgba(255, 255, 255, .04); }
.list-item > span { flex: 1; font-size: 15px; line-height: 20px; font-weight: 600; }
.list-item .chev { width: 18px; height: 18px; color: var(--text-3); }
#app > .card.flush + .hint { margin-top: var(--sp-2); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--r-tile); outline: none;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus { border-color: rgba(124, 77, 255, .7); box-shadow: 0 0 0 3px rgba(124, 77, 255, .18); }
.field textarea { min-height: 88px; resize: vertical; }

/* ===== Чат поддержки ===== */
body.chat-mode { padding-bottom: calc(76px + var(--safe-b)); }
.chat-head { display: flex; align-items: center; gap: var(--sp-3); padding-top: var(--sp-4); }
.chat-head h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.02em; }
.chat-head .hint { display: block; }
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: var(--sp-3); }
.chat .splash { min-height: 40vh; }
.chat-empty { margin-top: var(--sp-2); }
.chat-day { align-self: center; margin: var(--sp-3) 0 var(--sp-1); }
.chat-day span {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill);
  background: rgba(20, 18, 43, .85); border: 1px solid var(--line); color: var(--text-3);
  font-size: 12px; line-height: 16px; font-weight: 600;
}
.msg {
  max-width: 82%; padding: 9px 13px 6px; border-radius: 18px;
  font-size: 15px; line-height: 21px; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.in {
  align-self: flex-end; border-bottom-right-radius: 6px; color: #fff;
  background: var(--grad-violet); box-shadow: 0 6px 18px rgba(124, 77, 255, .25);
}
.msg.out { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.msg.pending { opacity: .6; }
.msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg-text { white-space: pre-wrap; }
.msg-kind { font-weight: 600; }
.msg-img { display: block; max-width: 100%; max-height: 260px; border-radius: 12px; margin: 2px 0 4px; }
.msg .msg-hint { display: block; margin-top: 2px; font-size: 13px; color: var(--violet-soft); }
.msg-time { margin-top: 2px; text-align: right; font-size: 11px; line-height: 14px; opacity: .65; }

#app > .composer { margin: 0; animation: none; }
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 10px var(--sp-3) calc(10px + var(--safe-b));
  background: rgba(15, 13, 37, .92); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.composer-inner { max-width: 640px; margin: 0 auto; display: flex; align-items: flex-end; gap: var(--sp-2); }
.composer textarea {
  flex: 1; min-height: 42px; max-height: 132px; resize: none; outline: none;
  padding: 10px 14px; border-radius: 21px; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-1); font: 400 15px/20px var(--font);
  transition: border-color .15s;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer textarea:focus { border-color: rgba(124, 77, 255, .7); }
.composer-btn, .composer-send {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center;
  transition: transform .15s, opacity .15s;
}
.composer-btn { background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); color: var(--violet-soft); }
.composer-send { background: var(--grad-accent); color: #fff; box-shadow: var(--glow-accent); }
.composer-send svg { width: 18px; height: 18px; margin: 1px 1px 0 0; }
.composer-send[disabled] { opacity: .4; box-shadow: none; }
.composer-btn:active, .composer-send:active { transform: scale(.94); }

.badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-grid; place-items: center;
  background: var(--grad-accent); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 4px 12px rgba(255, 90, 70, .35);
}
.tabbar a { position: relative; }
.tabbar a.has-dot::after {
  content: ""; position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 8px rgba(255, 46, 138, .8);
}

/* ===== Нижнее меню ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(15, 13, 37, .92); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1);
  color: var(--text-3); font-size: 11px; line-height: 14px; font-weight: 600;
  transition: color .15s;
}
.tabbar a svg { width: 24px; height: 24px; transition: filter .15s; }
.tabbar a.active { color: var(--orange); font-weight: 700; }
.tabbar a.active svg { filter: drop-shadow(0 0 8px rgba(255, 138, 31, .7)); }

/* ===== Шторка оплаты ===== */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(11, 10, 28, .7); animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 640px; margin: 0 auto;
  background: var(--grad-violet-card), var(--bg-1); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .45), var(--inset-hi);
  padding: 10px 18px calc(18px + var(--safe-b));
  max-height: 90vh; overflow-y: auto; animation: up .25s ease;
}
.sheet .grab { width: 40px; height: 5px; border-radius: var(--r-pill); background: var(--line-2); margin: 0 auto var(--sp-4); }
.sheet h3 { margin: 0 0 var(--sp-1); font-size: 20px; line-height: 26px; font-weight: 700; }
.sum-row {
  display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line); font-size: 15px; color: var(--text-2);
}
.sum-row.total { border: 0; color: var(--text-1); font-size: 18px; font-weight: 800; }
.legal { margin: var(--sp-3) 0 var(--sp-4); font-size: 12px; line-height: 18px; color: var(--text-3); }
.legal a { color: var(--violet-soft); }
.wait { text-align: center; }
.wait .spinner { margin: var(--sp-2) auto var(--sp-4); }
.wait p { margin: var(--sp-2) 0 var(--sp-4); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sp-4)); z-index: 60;
  transform: translateX(-50%); max-width: calc(100vw - var(--sp-8));
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-btn);
  background: rgba(28, 25, 56, .96); border: 1px solid var(--line-2); color: var(--text-1);
  font-size: 14px; line-height: 20px; box-shadow: var(--shadow-card); animation: fade .2s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
