/* =========================================================================
   EclipseLink 3.0 — Obsidian & Neon Violet · только SVG-иконки (разделы 42–46: лендинг, вход, пол, кольца, карточка)
   Реализация docs/DESIGN.md. Контракт DOM — docs/DOM.md.
   Разделы:
     01 Токены            02 База и сброс        03 Утилиты
     04 Фон               05 Экраны (boot/auth)  06 Каркас (nav/header/main)
     07 Кнопки            08 Поля и контролы     09 Чипы, бары, аватары
     10 Карточки и бенто  11 Неделя              12 Герой серии
     13 Привычки          14 Фото и миниатюры    15 Партнёр
     16 Цель и цифры      17 Магазин             18 Купоны
     19 Аналитика         20 Тепловая карта      21 Диалоги и листы
     22 Настройки         23 Лайтбокс            24 Поповеры и меню
     25 Тосты             26 Монеты и конфетти   27 Скелеты
     28 Пустые состояния  29 Анимации            30 Доступность движения
     31 Логотип           32 Капсулы (pill)      33 Затмение и темы колец
     34 Вход/регистрация  35 Ожидание партнёра   36 Топ пар
     37 Eclipse PRO       38 Настройки 3.0       39 Документы
     40 Cookie-баннер     41 Мелкие помощники
   ========================================================================= */

/* =========================================================================
   01 ТОКЕНЫ (§2)
   ========================================================================= */
:root {
  color-scheme: dark;

  /* ---------- Поверхности ---------- */
  --surface-0: #0a0a0f;
  --surface-1: #12121a;
  --surface-2: #1a1a25;
  --surface-3: #232331;
  --glass-bg: rgba(18, 18, 26, 0.72);
  --glass-bg-strong: rgba(14, 14, 20, 0.86);
  --scrim: rgba(5, 5, 10, 0.72);
  --scrim-strong: rgba(5, 5, 10, 0.9);

  /* ---------- Границы ---------- */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(139, 92, 246, 0.2);
  --border-strong: rgba(139, 92, 246, 0.45);
  --border-input: rgba(255, 255, 255, 0.12);
  --border-success: rgba(74, 222, 128, 0.4);
  --border-danger: rgba(248, 113, 113, 0.5);

  /* ---------- Текст ---------- */
  --text-1: #f4f3fa;
  --text-2: #b4b2c6;
  --text-3: #8e8ca3;
  --text-on-accent: #ffffff;
  --text-on-light: #0a0a0f;

  /* ---------- Акцент ---------- */
  --accent-100: #ede9fe;
  --accent-200: #ddd6fe;
  --accent-300: #c084fc;
  --accent-400: #a78bfa;
  --accent-500: #8b5cf6;
  --accent-600: #7c3aed;
  --accent-700: #6d28d9;
  --accent-900: #2a2146;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
  --accent-gradient-btn: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);

  /* ---------- Статусы ---------- */
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --danger-solid: #dc2626;
  --coin: #fbbf24;
  --freeze: #7dd3fc;

  /* ---------- Тона привычек ---------- */
  --tone-violet: #a78bfa;  --tone-violet-bg: rgba(139, 92, 246, 0.16);
  --tone-blue:   #7dd3fc;  --tone-blue-bg:   rgba(56, 189, 248, 0.14);
  --tone-pink:   #f9a8d4;  --tone-pink-bg:   rgba(236, 72, 153, 0.14);
  --tone-gold:   #fcd34d;  --tone-gold-bg:   rgba(251, 191, 36, 0.14);
  --tone-green:  #86efac;  --tone-green-bg:  rgba(74, 222, 128, 0.14);

  /* ---------- Тепловая карта ---------- */
  --heat-0: #262633;
  --heat-1: #4c3d85;
  --heat-2: #8b5cf6;
  --heat-3: linear-gradient(135deg, #a78bfa, #c084fc);
  --heat-3-glow: 0 0 8px rgba(192, 132, 252, 0.65);
  --heat-gap: 4px;
  --heat-cell: 18px;

  /* ---------- Радиусы ---------- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* ---------- Отступы ---------- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --gutter: 16px;
  --bento-gap: 12px;

  /* ---------- Типографика ---------- */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-caption: 12px;  --lh-caption: 16px;
  --fs-label: 13px;    --lh-label: 18px;
  --fs-body-sm: 15px;  --lh-body-sm: 22px;
  --fs-body: 16px;     --lh-body: 24px;
  --fs-title-sm: 17px; --lh-title-sm: 24px;
  --fs-title: 20px;    --lh-title: 28px;
  --fs-h2: 24px;       --lh-h2: 30px;
  --fs-h1: 30px;       --lh-h1: 36px;
  --fs-display: 56px;  --lh-display: 56px;
  --fs-display-lg: 80px; --lh-display-lg: 80px;
  --fw-regular: 400;  --fw-medium: 500;  --fw-semibold: 600;  --fw-bold: 700;
  --tracking-tight: -0.02em;
  --tracking-eyebrow: 0.08em;
  --num: "tnum" 1, "cv11" 1;

  /* ---------- Тени и свечения ---------- */
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  --shadow-3: 0 24px 64px -16px rgba(0, 0, 0, 0.8);
  --glow-sm: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 0 16px rgba(139, 92, 246, 0.25);
  --glow-md: 0 0 0 1px rgba(139, 92, 246, 0.45), 0 0 28px rgba(139, 92, 246, 0.35);
  --glow-lg: 0 0 0 1px rgba(192, 132, 252, 0.55), 0 0 48px rgba(192, 132, 252, 0.4);
  --glow-success: 0 0 0 1px rgba(74, 222, 128, 0.4), 0 0 20px rgba(74, 222, 128, 0.2);
  --glow-coin: 0 0 16px rgba(251, 191, 36, 0.45);

  /* ---------- Размытие ---------- */
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --glass-saturate: 140%;

  /* ---------- Слои ---------- */
  --z-base: 0;
  --z-raised: 1;
  --z-sticky: 100;
  --z-nav: 200;
  --z-scrim: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-toast: 600;
  --z-fly: 650;
  --z-confetti: 700;

  /* ---------- Движение ---------- */
  --dur-instant: 90ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 380ms;
  --dur-spring: 520ms;
  --dur-xslow: 700ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring-soft: cubic-bezier(0.3, 1.25, 0.6, 1);

  /* ---------- Фокус ---------- */
  --focus-ring: 0 0 0 2px var(--surface-0), 0 0 0 4px var(--accent-300);
  --focus-ring-inset: inset 0 0 0 2px var(--accent-300);

  /* ---------- Каркас ---------- */
  --header-h: 56px;
  --tabbar-h: 64px;
  --rail-w: 240px;
  --content-max: 1200px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Производные (не из DESIGN, служебные) */
  --ring-c: 144.513;   /* 2π·23 — длина окружности кольца таймера */

  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-1);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Регистрация --progress, чтобы conic-кольцо аватара партнёра анимировалось */
@property --progress { syntax: "<number>"; inherits: true; initial-value: 0; }

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.05, 0.174, 0.341, 0.522, 0.697, 0.851, 0.975, 1.066,
      1.125, 1.156, 1.163, 1.153, 1.131, 1.104, 1.074, 1.046, 1.021, 1.002, 0.988,
      0.979, 0.974, 0.974, 0.975, 0.979, 0.984, 0.989, 0.993, 0.997, 1, 1.002, 1.004, 1);
    --ease-spring-soft: linear(0, 0.036, 0.124, 0.239, 0.365, 0.489, 0.604, 0.705,
      0.79, 0.86, 0.914, 0.955, 0.985, 1.005, 1.018, 1.025, 1.028, 1.028, 1.026,
      1.023, 1.02, 1.016, 1.013, 1.01, 1);
  }
}

@media (min-width: 641px)  { :root { --gutter: 24px; --bento-gap: 16px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --bento-gap: 20px; --heat-cell: 22px; --heat-gap: 5px; } }
@media (max-width: 359px)  { :root { --heat-cell: 16px; --heat-gap: 3px; } }

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: 0ms; --dur-fast: 0ms; --dur-base: 120ms; --dur-slow: 120ms;
    --dur-spring: 120ms; --dur-xslow: 0ms;
    --ease-spring: var(--ease-out); --ease-spring-soft: var(--ease-out);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-bg: var(--surface-1); --glass-bg-strong: var(--surface-1); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-bg: var(--surface-1); --glass-bg-strong: #0e0e14; }
}

/* =========================================================================
   02 БАЗА И СБРОС
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--surface-0);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 16px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--surface-0);
  overflow-x: hidden;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"], .partner-habits, .split-list, .test-results { list-style: none; padding: 0; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-400); text-decoration: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* Свой скроллбар — только для мыши: на iPhone стилизованный ::-webkit-scrollbar рисуется постоянной полосой
   вместо системного индикатора, который сам прячется. */
@media (hover: hover) and (pointer: fine) {
  html { scrollbar-color: rgba(139, 92, 246, 0.35) transparent; scrollbar-width: thin; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.28); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: rgba(139, 92, 246, 0.5); }
}
::selection { background: rgba(139, 92, 246, 0.45); color: var(--text-1); }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* =========================================================================
   03 УТИЛИТЫ
   ========================================================================= */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.num { font-feature-settings: var(--num); font-variant-numeric: tabular-nums; }

.icon {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
}

.eyebrow {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-3);
}

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 16px;
  z-index: var(--z-toast);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-600);
  color: var(--text-on-accent);
  font-weight: var(--fw-semibold);
  /* сдвиг учитывает вырез: иначе на iPhone ссылка торчит в статус-баре */
  transform: translateY(calc(-100% - var(--safe-top) - 16px));
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.noscript { padding: 24px; text-align: center; color: var(--text-2); }

/* =========================================================================
   04 ФОН — два фиксированных пятна
   ========================================================================= */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 10% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(500px circle at 110% 110%, rgba(192, 132, 252, 0.12), transparent 60%);
}

/* =========================================================================
   05 ЭКРАНЫ: загрузка и вход
   ========================================================================= */
.boot-screen {
  min-height: 100dvh;
  padding: calc(var(--safe-top)) calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
}
.boot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
}
.boot-header-spacer { flex: 1; }
.boot-body {
  display: grid;
  gap: var(--bento-gap);
  max-width: 720px;
  margin: 16px auto 0;
}
.boot-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.boot-week .skeleton { height: 64px; border-radius: var(--radius-md); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-title-sm);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  color: var(--text-1);
}
.brand-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-title {
  margin-top: var(--space-8);
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}
.auth-form { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
.auth-note { margin-top: var(--space-5); color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); text-align: center; }

/* =========================================================================
   06 КАРКАС: навигация, шапка, контент
   ========================================================================= */
.app-shell { min-height: 100dvh; }

/* ---------- Навигация (таб-бар ≤1023) ---------- */
.nav {
  position: fixed;
  z-index: var(--z-nav);
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0 calc(8px + var(--safe-right)) var(--safe-bottom) calc(8px + var(--safe-left));
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--glass-saturate));
  border-top: 1px solid var(--border-subtle);
}
.nav-brand, .nav-footer { display: none; }
.nav-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: var(--tabbar-h);
  margin: 0;
}
.nav-list li { display: flex; }
.nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  min-width: 44px;
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: var(--fw-semibold);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.nav-link:active { transform: scale(0.94); transition-duration: var(--dur-instant); }
.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px; height: 30px;
  border-radius: var(--radius-pill);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.nav-icon .icon { width: 24px; height: 24px; }
.nav-link[aria-current="page"] { color: var(--accent-300); }
.nav-link[aria-current="page"] .nav-icon { background: var(--accent-900); }
.nav-link[aria-current="page"] .nav-icon .icon { filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.6)); }
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover { color: var(--text-1); }
}
.nav-badge {
  position: absolute;
  top: -4px; right: 6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger-solid);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: var(--fw-bold);
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface-0);
}

/* ---------- Таб-бар-пилюля (641–1023) ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
  .nav {
    left: 50%; right: auto;
    bottom: calc(12px + var(--safe-bottom));
    width: 420px;
    height: var(--tabbar-h);
    padding: 0 8px;
    transform: translateX(-50%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-3);
  }
  .nav-link { border-radius: var(--radius-pill); }
}

/* ---------- Рейл (≥1024) ---------- */
@media (min-width: 1024px) {
  .nav {
    top: 0; right: auto;
    width: var(--rail-w);
    height: auto;
    display: flex;
    flex-direction: column;
    padding: var(--safe-top) 12px calc(16px + var(--safe-bottom)) calc(12px + var(--safe-left));
    border-top: 0;
    border-right: 1px solid var(--border-subtle);
  }
  .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-h);
    padding: 0 12px;
    font-size: var(--fs-title-sm);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
  }
  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: auto;
    margin-top: 16px;
  }
  .nav-link {
    position: relative;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body-sm);
    font-weight: var(--fw-medium);
    color: var(--text-2);
    transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
  }
  .nav-link:active { transform: scale(0.98); }
  .nav-icon { width: 20px; height: 20px; background: none !important; }
  .nav-icon .icon { width: 20px; height: 20px; }
  .nav-link[aria-current="page"] {
    background: var(--accent-900);
    color: var(--text-1);
  }
  .nav-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: 2px;
    border-radius: 2px;
    background: var(--accent-300);
    box-shadow: 0 0 8px var(--accent-300);
  }
  .nav-link[aria-current="page"] .nav-icon { color: var(--accent-300); }
  @media (hover: hover) and (pointer: fine) {
    .nav-link:not([aria-current="page"]):hover { background: var(--surface-2); color: var(--text-1); }
  }
  .nav-icon { position: static; }
  .nav-badge { top: 50%; right: 12px; transform: translateY(-50%); box-shadow: none; }

  .nav-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
  }
}
.nav-profile, .nav-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-profile { min-height: 52px; color: var(--text-1); font-weight: var(--fw-semibold); }
.nav-profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item-btn--danger { color: var(--danger); }
@media (hover: hover) and (pointer: fine) {
  .nav-profile:hover, .nav-item-btn:hover { background: var(--surface-2); color: var(--text-1); }
  .nav-item-btn--danger:hover { color: var(--danger); background: var(--danger-bg); }
}
@media (display-mode: standalone) {
  #rail-install, #settings-install, #settings-install-ios { display: none !important; }
}

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) calc(var(--gutter) - 4px + var(--safe-right)) 0 calc(var(--gutter) - 4px + var(--safe-left));
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--glass-saturate));
  border-bottom: 1px solid var(--border-subtle);
}
.header-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 2px; flex: none; }
.header-title-wrap { display: none; min-width: 0; overflow: hidden; }
.header-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); letter-spacing: -0.01em; white-space: nowrap; }
.header-date { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); font-size: var(--fs-label); line-height: var(--lh-label); white-space: nowrap; }
.header .header-logout { display: none; }
@media (min-width: 640px) { .header .header-logout { display: inline-grid; } }
/* Узкий экран: звук, выход и ADMIN — в настройках, логотип — в таб-баре */
@media (max-width: 639px) {
  .header .header-mute, .header #header-admin-pill, .header #header-support-pill { display: none; }
  .header-left { gap: 4px; }
}
@media (min-width: 560px) { .header-right { gap: 6px; } }
@media (min-width: 1024px) {
  .header {
    padding-left: var(--gutter);
    padding-right: calc(var(--gutter) + var(--safe-right));
  }
  .header .avatar-btn, .header .header-logo { display: none; }
  .header-title-wrap { display: flex; align-items: baseline; gap: 10px; }
  .header-title-wrap .header-date::before { content: "· "; }
  .header-right { gap: 8px; }
}

.avatar-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  flex: none;
}
.avatar-btn:active .avatar { transform: scale(0.94); }

/* Щит и монеты в шапке — капсулы (раздел 32) */
.pill--freeze { color: var(--freeze); }
.pill--freeze[data-status="used"] { color: var(--text-3); }
.pill--freeze[data-status="used"] .pill-icon { opacity: 0.45; }
.pill--freeze[data-status="loading"] > * { visibility: hidden; }
.pill--coins { color: var(--coin); text-decoration: none; }
.pill--coins .num { min-width: 2ch; color: var(--text-1); }
.pill--coins[data-negative="true"] .num { color: var(--danger); }
.pill--coins[aria-busy="true"] > * { visibility: hidden; }
@media (max-width: 380px) { .header .pill--coins, .header .pill--freeze { padding: 4px 9px; gap: 5px; } }

/* Индикатор синхронизации */
.sync {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 36px;
  height: 44px;
  padding: 0 4px;
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-size: var(--fs-label);
  flex: none;
}
.sync-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.55);
  flex: none;
}
.sync-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
}
.sync[data-state="syncing"] .sync-dot { background: var(--accent-400); box-shadow: 0 0 8px rgba(167, 139, 250, 0.6); }
.sync[data-state="syncing"] .sync-dot::after { animation: sync-pulse 1200ms var(--ease-out) infinite; }
.sync[data-state="offline"] .sync-dot { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.sync[data-state="error"] .sync-dot { background: var(--danger); box-shadow: 0 0 8px rgba(248, 113, 113, 0.55); }
.sync-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 1024px) {
  .sync { padding: 0 10px; }
  .sync-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .sync[data-state="offline"] .sync-label { color: var(--warn); }
  .sync[data-state="error"] .sync-label { color: var(--danger); }
}
@media (hover: hover) and (pointer: fine) { .sync:hover { background: var(--surface-2); } }

/* Звук */
.header-mute .icon--sound-off { display: none; }
.header-mute[aria-pressed="true"] .icon--sound-on { display: none; }
.header-mute[aria-pressed="true"] .icon--sound-off { display: block; }
.header-mute[aria-pressed="true"] { color: var(--text-3); }

.header-settings { position: relative; }
.dot-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-300);
  box-shadow: 0 0 6px var(--accent-300);
}

/* ---------- Контент ---------- */
.main {
  padding:
    var(--space-4)
    calc(var(--gutter) + var(--safe-right))
    calc(var(--tabbar-h) + var(--safe-bottom) + 24px)
    calc(var(--gutter) + var(--safe-left));
}
.main:focus-visible { box-shadow: none; }
@media (min-width: 641px) and (max-width: 1023px) {
  .main { padding-bottom: calc(var(--tabbar-h) + 12px + var(--safe-bottom) + 32px); }
}
@media (min-width: 1024px) {
  .app-shell { padding-left: var(--rail-w); }
  .main { padding: var(--space-6) calc(var(--gutter) + var(--safe-right)) 48px var(--gutter); }
  .view { max-width: var(--content-max); margin: 0 auto; }
}

.view-title {
  margin-bottom: var(--space-4);
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}
.view-title:focus-visible { box-shadow: none; text-decoration: underline 2px var(--accent-300); text-underline-offset: 6px; }
@media (min-width: 1024px) {
  .view-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
}

/* =========================================================================
   07 КНОПКИ
   ========================================================================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-spring);
}
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(0.97); transition-duration: var(--dur-instant); }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: var(--fs-label); line-height: var(--lh-label); border-radius: var(--radius-md); }
@media (min-width: 1024px) { .btn { min-height: 44px; } }

.btn--primary { background: var(--accent-gradient-btn); color: var(--text-on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.btn--secondary { background: var(--surface-2); border-color: var(--border-default); color: var(--text-1); }
.btn--ghost { background: transparent; color: var(--accent-400); }
.btn--danger { background: var(--danger-solid); color: #fff; }
.btn--danger-ghost { color: var(--danger); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover:not(:disabled):not([aria-disabled="true"]) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--glow-sm); }
  .btn--secondary:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--border-strong); background: var(--surface-3); }
  .btn--ghost:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--accent-900); color: var(--accent-300); }
  .btn--danger:hover:not(:disabled) { background: #b91c1c; }
  .btn--danger-ghost:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-icon { width: 18px; height: 18px; }
.btn .icon { width: 18px; height: 18px; }

/* Загрузка: спиннер слева, ширина не меняется */
.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
  flex: none;
}
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .btn-spinner { display: inline-block; }
.btn[aria-busy="true"] .btn-icon { display: none; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  flex: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.icon-btn:active:not(:disabled) { transform: scale(0.92); transition-duration: var(--dur-instant); }
.icon-btn--quiet { color: var(--text-3); }
.icon-btn--accent { background: var(--accent-900); color: var(--accent-300); border: 1px solid var(--border-strong); }
.icon-btn:disabled, .icon-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text-1); }
  .icon-btn--accent:hover:not(:disabled) { background: var(--accent-900); color: var(--accent-200); box-shadow: var(--glow-sm); }
}

/* Спиннер (общий) */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(192, 132, 252, 0.25);
  border-top-color: var(--accent-300);
  animation: spin 800ms linear infinite;
}

/* =========================================================================
   08 ПОЛЯ И КОНТРОЛЫ
   ========================================================================= */
.field { display: grid; gap: 6px; min-width: 0; }
.field--inline { grid-template-columns: auto 72px; align-items: center; gap: 12px; margin-top: 10px; justify-content: start; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-label {
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
}
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-optional { font-weight: var(--fw-regular); color: var(--text-3); }
.field-hint { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.field-error, .form-error { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--danger); }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); border: 1px solid var(--border-danger); }
.field-counter { font-size: var(--fs-caption); color: var(--text-3); }
.field-counter[data-warn="true"] { color: var(--warn); }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:focus { outline: none; }
.input:focus-visible, .input:focus { border-color: var(--accent-300); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--border-danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 4px var(--danger); }
.input:disabled { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .input:hover:not(:focus):not(:disabled) { border-color: rgba(255, 255, 255, 0.2); } }
.textarea { padding-top: 12px; padding-bottom: 12px; resize: none; min-height: 48px; max-height: 120px; field-sizing: content; }
input[type="number"].input { -moz-appearance: textfield; appearance: textfield; }
input[type="number"].input::-webkit-inner-spin-button,
input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.input-group { position: relative; }
.input-group .input { padding-right: 52px; }
.input-group-btn { position: absolute; top: 2px; right: 2px; }
.input-group-btn .icon--eye-off { display: none; }
.input-group-btn[aria-pressed="true"] .icon--eye { display: none; }
.input-group-btn[aria-pressed="true"] .icon--eye-off { display: block; }

.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.stepper-btn { background: var(--surface-2); border: 1px solid var(--border-default); }
.stepper-input { text-align: center; font-weight: var(--fw-semibold); }

/* Сегмент-контрол (табы купонов и радио типа привычки) */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.segmented-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: var(--fw-semibold);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.segmented-item[aria-selected="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-default), 0 2px 8px -2px rgba(0, 0, 0, 0.5); }
.segmented-item:focus-visible { box-shadow: var(--focus-ring-inset); }
.segmented--radio .segmented-item { padding: 0; }
.segmented--radio input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented--radio input + span {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.segmented--radio input:checked + span { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-strong); }
.segmented--radio input:focus-visible + span { box-shadow: var(--focus-ring-inset); }
@media (hover: hover) and (pointer: fine) {
  .segmented-item:not([aria-selected="true"]):hover, .segmented--radio input:not(:checked) + span:hover { color: var(--text-1); }
}

/* Пикеры иконок (SVG-пресеты) и тона */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.icon-option { position: relative; display: grid; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.icon-option > .icon {
  width: 100%; height: 44px;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.icon-option input:checked + .icon { background: var(--accent-900); border-color: var(--accent-300); color: var(--accent-200); box-shadow: var(--glow-sm); }
.icon-option input:focus-visible + .icon { box-shadow: var(--focus-ring); }
.icon-option:active > .icon { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .icon-option input:not(:checked) + .icon:hover { background: var(--surface-3); color: var(--text-1); } }

.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 10px; }
.avatar-option { position: relative; display: grid; place-items: center; cursor: pointer; }
.avatar-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.avatar-option > .avatar-svg {
  width: 48px; height: 48px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-subtle);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.avatar-option input:checked + .avatar-svg { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--accent-300), 0 0 18px rgba(192, 132, 252, 0.45); }
.avatar-option input:focus-visible + .avatar-svg { box-shadow: var(--focus-ring); }
.avatar-option:active > .avatar-svg { transform: scale(0.92); }

.tone-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.tone-option { position: relative; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.tone-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tone-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tone, var(--tone-violet));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out);
}
.tone-option input:checked + .tone-swatch { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--tone); transform: scale(0.9); }
.tone-option input:focus-visible + .tone-swatch { box-shadow: var(--focus-ring); }
[data-tone="violet"] { --tone: var(--tone-violet); --tone-bg: var(--tone-violet-bg); }
[data-tone="blue"]   { --tone: var(--tone-blue);   --tone-bg: var(--tone-blue-bg); }
[data-tone="pink"]   { --tone: var(--tone-pink);   --tone-bg: var(--tone-pink-bg); }
[data-tone="gold"]   { --tone: var(--tone-gold);   --tone-bg: var(--tone-gold-bg); }
[data-tone="green"]  { --tone: var(--tone-green);  --tone-bg: var(--tone-green-bg); }

/* Переключатель */
.switch {
  position: relative;
  flex: none;
  width: 52px; height: 32px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-input);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.switch::before { content: ""; position: absolute; inset: -6px -2px; }
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--text-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform var(--dur-base) var(--ease-spring), background-color var(--dur-fast) var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--accent-600); border-color: var(--accent-500); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(20px); background: #fff; }

/* Ползунок */
.range {
  --value: 60;
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-500) calc(var(--value) * 1%), var(--surface-3) 0);
}
.range::-moz-range-track { height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); }
.range::-moz-range-progress { height: 6px; border-radius: var(--radius-pill); background: var(--accent-500); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.range:focus-visible { box-shadow: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }
.range:focus-visible::-moz-range-thumb { box-shadow: var(--focus-ring); }
.range-value { width: 3ch; text-align: right; color: var(--text-2); font-size: var(--fs-label); }

/* =========================================================================
   09 ЧИПЫ, ПРОГРЕСС-БАРЫ, АВАТАРЫ
   ========================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.chip--accent { background: var(--accent-900); color: var(--accent-300); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--success { background: var(--success-bg); color: var(--success); }
.count-chip {
  display: inline-grid;
  place-items: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-900);
  color: var(--accent-300);
  font-size: var(--fs-caption);
  letter-spacing: 0;
}

/* Прогресс-бар: JS ставит --progress (0…1) на .bar */
.bar {
  --progress: 0;
  --bar-fill: var(--accent-500);
  position: relative;
  display: block;
  flex: 1;
  min-width: 0;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.bar--xs { height: 4px; }
.bar--sm { height: 6px; }
.bar--md { height: 8px; }
.bar-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--bar-fill);
  transform-origin: left center;
  transform: scaleX(clamp(0, var(--progress), 1));
  transition: transform var(--dur-slow) var(--ease-spring-soft), background-color var(--dur-base) var(--ease-out);
}
.bar--partner { --bar-fill: var(--accent-300); }
.bar--gradient { --bar-fill: var(--accent-gradient); }
.bar[data-state="done"] { --bar-fill: var(--success); }

/* Аватары */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.25);
  flex: none;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.avatar-svg { display: block; width: 100%; height: 100%; }
.avatar--partner { box-shadow: 0 0 0 1px rgba(240, 171, 252, 0.3); }
.avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.avatar--xs { width: 28px; height: 28px; font-size: 12px; }

/* =========================================================================
   10 КАРТОЧКИ И БЕНТО
   ========================================================================= */
.card {
  position: relative;
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (min-width: 1024px) { .card { padding: var(--space-5); } }

/* Загрузка карточки целиком — шиммер поверх, содержимое скрыто */
.card[aria-busy="true"] > * { visibility: hidden; }
.card[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: var(--space-4);
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.08), transparent) 0 0 / 50% 100% no-repeat,
    var(--surface-2);
  animation: shimmer-bg 1400ms linear infinite;
}

.bento {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

/* ---------- Бенто «Сегодня» ---------- */
.bento--today > .bento-numbers { display: none; }
@media (min-width: 641px) {
  .bento--today { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento--today > .bento-week     { grid-column: 1 / -1; grid-row: 1; }
  .bento--today > .bento-hero     { grid-column: 1 / 5;  grid-row: 2; align-self: stretch; }
  .bento--today > .bento-goal     { grid-column: 5 / 7;  grid-row: 2; align-self: stretch; }
  .bento--today > .bento-partner  { grid-column: 1 / -1; grid-row: 3; }
  .bento--today > .bento-habits   { grid-column: 1 / -1; grid-row: 4; }
}
@media (min-width: 1024px) {
  .bento--today {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto auto 1fr;
  }
  .bento--today > .bento-week     { grid-column: 1 / 9;  grid-row: 1; }
  .bento--today > .bento-hero     { grid-column: 1 / 6;  grid-row: 2 / 4; }
  .bento--today > .bento-goal     { grid-column: 6 / 9;  grid-row: 2; }
  .bento--today > .bento-numbers  { display: flex; grid-column: 6 / 9; grid-row: 3; align-self: stretch; }
  .bento--today > .bento-habits   { grid-column: 1 / 9;  grid-row: 4; }
  .bento--today > .bento-partner  {
    grid-column: 9 / 13;
    grid-row: 1 / 5;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + var(--safe-top) + 20px);
  }
}

/* ---------- Бенто «Магазин» ---------- */
@media (min-width: 1024px) {
  .bento--shop {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr;
  }
  .bento--shop > .bento-rewards { grid-column: 1 / 9;  grid-row: 1 / 4; }
  .bento--shop > .bento-balance { grid-column: 9 / 13; grid-row: 1; }
  .bento--shop > .bento-fulfill { grid-column: 9 / 13; grid-row: 2; }
  .bento--shop > .bento-coupons { grid-column: 9 / 13; grid-row: 3; }
}

/* ---------- Бенто «Аналитика» ---------- */
@media (min-width: 1024px) {
  .bento--analytics { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .bento--analytics > .bento-stats { grid-column: 1 / -1; }
  .bento--analytics > .bento-heat  { grid-column: 1 / 9; align-self: stretch; }
  .bento--analytics > .bento-split { grid-column: 9 / 13; align-self: stretch; }
}

/* Заголовки секций */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: var(--space-3);
}
.section-title {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.section-title-day { color: var(--text-3); font-weight: var(--fw-medium); }
.section-count { color: var(--text-3); font-size: var(--fs-label); font-weight: var(--fw-semibold); white-space: nowrap; }
.eyebrow--section { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-3) 2px; }
.eyebrow--icon { display: flex; align-items: center; gap: 6px; }
.eyebrow--icon .icon { width: 14px; height: 14px; color: var(--accent-300); }
#fulfill-title .icon { color: var(--warn); }
.shop-section { min-width: 0; }

/* =========================================================================
   11 НЕДЕЛЯ (§4.3)
   ========================================================================= */
.card--week { padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
@media (min-width: 641px) {
  .card--week {
    padding: var(--space-3);
    border: 1px solid var(--border-default);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
    box-shadow: var(--shadow-1);
  }
}
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
@media (min-width: 641px) { .week-strip { gap: 8px; } }
.week-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 64px;
  padding: 8px 0 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(18, 18, 26, 0.5);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
@media (min-width: 641px) { .week-day { min-height: 72px; } }
@media (min-width: 400px) { .week-day { min-width: 44px; } }
.week-dow {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.week-num { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-semibold); color: var(--text-1); }
.week-today-dot {
  position: absolute;
  top: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-300);
  box-shadow: 0 0 6px var(--accent-300);
  opacity: 0;
}
.week-markers { display: flex; align-items: center; justify-content: center; gap: 3px; height: 10px; }
.week-marker { display: none; width: 6px; height: 6px; border-radius: 50%; }
.week-marker--mine { background: var(--accent-400); }
.week-marker--pair { background: var(--accent-300); box-shadow: 0 0 6px rgba(192, 132, 252, 0.9); }
svg.week-marker--frozen { width: 10px; height: 10px; border-radius: 0; fill: rgba(125, 211, 252, 0.25); stroke: var(--freeze); stroke-width: 2.5; }
.week-day[data-mine="true"] .week-marker--mine { display: block; }
.week-day[data-pair="true"] .week-marker--pair { display: block; }
.week-day[data-frozen="true"] .week-marker--frozen { display: block; }
.week-day[data-frozen="true"] .week-marker--pair { display: none; }

.week-day[data-today="true"] .week-num { color: var(--accent-300); }
.week-day[data-today="true"] .week-today-dot { opacity: 1; }
.week-day[aria-checked="true"] { background: var(--accent-900); border-color: var(--border-strong); box-shadow: var(--glow-sm); }
.week-day[aria-checked="true"] .week-dow { color: var(--text-2); }
.week-day[aria-disabled="true"], .week-day[data-future="true"] { opacity: 0.35; cursor: default; }
.week-day:active:not([aria-disabled="true"]) { transform: scale(0.95); transition-duration: var(--dur-instant); }
@media (hover: hover) and (pointer: fine) {
  .week-day:not([aria-checked="true"]):not([aria-disabled="true"]):hover { background: var(--surface-2); }
}

.past-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: var(--space-3);
  padding: 4px 4px 4px 14px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.past-banner-text { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-1); padding: 8px 0; }
.past-banner .btn--ghost { color: var(--warn); }

/* =========================================================================
   12 ГЕРОЙ ОБЩЕЙ СЕРИИ (§4.4)
   ========================================================================= */
.streak-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 128px;
  overflow: hidden;
}
.streak-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at 85% 20%, rgba(139, 92, 246, 0.16), transparent 70%);
  pointer-events: none;
}
.streak-main { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.streak-value { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.streak-number {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  transform-origin: left bottom;
}
.streak-word { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-medium); color: var(--text-2); }
.streak-freeze-note { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--freeze); }
.streak-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.streak-pills .pill { max-width: 100%; white-space: normal; text-align: left; }
.streak-bars { display: grid; gap: 8px; margin-top: 6px; max-width: 420px; }
.streak-bar-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; }
.streak-bar-label { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.streak-card > .eclipse--hero { position: absolute; top: 12px; right: 8px; width: 132px; }
@media (min-width: 641px) { .streak-card > .eclipse--hero { position: relative; top: auto; right: auto; align-self: center; } }

/* Состояния героя */
.streak-card[data-state="waiting"] .streak-chip { color: var(--accent-300); }
.streak-card[data-state="waiting"] .streak-chip .pill-icon { color: #fb923c; animation: breathe 2400ms var(--ease-in-out) infinite alternate; }
.streak-card[data-state="zero"] .streak-chip { color: var(--text-2); }
.streak-card[data-state="zero"] .streak-chip .pill-icon { color: var(--text-3); }
.streak-card[data-state="done"] { border-color: var(--border-strong); box-shadow: var(--shadow-1), var(--glow-md); }
.streak-card[data-state="done"] .streak-chip { color: var(--success); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35); }
.streak-card[data-state="done"] .streak-chip .pill-icon { color: #fb923c; }
.streak-card[data-state="loading"] > * { visibility: hidden; }
.streak-card[data-state="loading"]::after {
  content: "";
  position: absolute;
  inset: var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.08), transparent) 0 0 / 50% 100% no-repeat, var(--surface-2);
  animation: shimmer-bg 1400ms linear infinite;
}

@media (min-width: 641px) {
  .streak-card { grid-template-columns: minmax(0, 1fr) minmax(96px, 34%); }
  .streak-card > .eclipse--hero { width: 100%; max-width: 176px; justify-self: end; }
}
@media (min-width: 1024px) {
  .streak-card { padding: var(--space-6); align-content: center; }
  .streak-number { font-size: var(--fs-display-lg); line-height: var(--lh-display-lg); }
  .streak-card > .eclipse--hero { max-width: 220px; }
  .streak-bars { margin-top: 12px; }
}

/* =========================================================================
   13 ПРИВЫЧКИ (§4.6a–4.9)
   ========================================================================= */
.habits { min-width: 0; }
.habit-list { display: grid; gap: 10px; }
@media (min-width: 641px) { .habit-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--bento-gap); } }

.habit-card {
  position: relative;
  min-width: 0;
  padding: 14px 12px 14px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: rgba(18, 18, 26, 0.86);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.habit-card:has([aria-expanded="true"]), .habit-card.is-menu-open { z-index: 5; }
@media (min-width: 1024px) { .habit-card { padding: 16px 14px 16px 16px; } }

.habit-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.habit-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--tone-bg, var(--tone-violet-bg));
  flex: none;
}
.habit-icon-svg { width: 22px; height: 22px; color: var(--tone, var(--tone-violet)); }
.habit-streak-icon { width: 13px; height: 13px; color: #fb923c; margin-right: 2px; vertical-align: -2px; }
.habit-icon-badge {
  position: absolute;
  right: -4px; bottom: -4px;
  width: 18px; height: 18px;
  padding: 3px;
  border-radius: 50%;
  background: var(--success);
  stroke: var(--text-on-light);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  box-shadow: 0 0 0 2px var(--surface-1);
  transform: scale(0);
  transition: transform var(--dur-spring) var(--ease-spring);
}
.habit-text { flex: 1; min-width: 0; }
.habit-name {
  font-size: var(--fs-title-sm);
  line-height: var(--lh-title-sm);
  font-weight: var(--fw-semibold);
  /* До двух строк: на телефоне длинные названия не обрезаются после пары слов. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.habit-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
}
.habit-meta:empty { display: none; }
.habit-subtitle { overflow: hidden; text-overflow: ellipsis; }
.habit-subtitle:empty { display: none; }
.habit-timer-text, .habit-timer-note { display: none; font-weight: var(--fw-semibold); color: var(--text-2); flex: none; }
.habit-timer-note { font-weight: var(--fw-regular); color: var(--text-3); }
.habit-card[data-kind="timer"][data-past="false"] .habit-timer-text { display: inline; }
.habit-card[data-kind="timer"][data-past="true"] .habit-timer-note { display: inline; }
.habit-card[data-kind="timer"][data-past="false"] .habit-subtitle:not(:empty)::before,
.habit-card[data-kind="timer"][data-past="true"] .habit-subtitle:not(:empty)::before { content: "· "; }

.habit-streak {
  display: none;
  align-items: center;
  gap: 1px;
  height: 18px;
  padding: 0 6px 0 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-caption);
  line-height: 18px;
  font-weight: var(--fw-semibold);
  flex: none;
  align-self: center;
}
.habit-streak > span:first-child { font-size: 11px; }
.habit-card[data-has-streak="true"] .habit-streak { display: inline-flex; }

/* Блоки по типу */
.habit-card [data-block] { display: none; }
.habit-card[data-kind="binary"] [data-block="binary"],
.habit-card[data-kind="timer"][data-past="true"] [data-block="binary"] { display: grid; }
.habit-card[data-kind="counter"] [data-block="counter"] { display: flex; }
.habit-card[data-kind="timer"][data-past="false"] [data-block="timer"] { display: grid; }

.menu-anchor { position: relative; flex: none; margin-right: -6px; }
.habit-more { width: 36px; }
@media (min-width: 641px) { .habit-more { width: 44px; } }

/* --- Binary: круглая галочка --- */
.check-btn {
  position: relative;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  color: var(--text-on-light);
  flex: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
@media (min-width: 1024px) { .check-btn { width: 44px; height: 44px; } }
.check-btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent-300);
  opacity: 0;
  pointer-events: none;
}
.check-icon {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--dur-base) var(--ease-out) 80ms, opacity var(--dur-fast) var(--ease-out);
}
.check-btn:active { transform: scale(0.9); transition-duration: var(--dur-instant); }
.check-btn[aria-checked="true"] {
  background: var(--accent-gradient);
  border-color: transparent;
  box-shadow: var(--glow-md);
}
.check-btn[aria-checked="true"] .check-icon { stroke-dashoffset: 0; }
.check-btn[aria-checked="false"] .check-icon { transition-delay: 0ms; transition-duration: var(--dur-fast); opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .check-btn[aria-checked="false"]:hover { background: var(--accent-900); border-color: var(--accent-400); }
}
.check-spinner {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-300);
  opacity: 0;
  pointer-events: none;
}
.check-btn[aria-busy="true"] .check-spinner { opacity: 1; animation: spin 800ms linear infinite; }

/* --- Counter --- */
.habit-counter-value {
  align-items: baseline;
  gap: 1px;
  font-size: var(--fs-title-sm);
  line-height: var(--lh-title-sm);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  flex: none;
}
.counter-digits { display: inline-block; overflow: clip; overflow: hidden; vertical-align: bottom; }
.counter-digits > span { display: inline-block; }
.counter-sep { color: var(--text-3); font-weight: var(--fw-medium); margin: 0 1px; }
.habit-unit { margin-left: 4px; font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--text-3); }
@media (max-width: 380px) { .habit-unit { display: none; } }

.habit-row2 { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-left: 56px; }
.habit-card:not([data-kind="counter"])[data-moment="none"] .habit-row2 { display: none; }
.counter-controls { flex: 1; align-items: center; gap: 8px; min-width: 0; border-radius: var(--radius-md); }
.counter-controls:focus-visible { box-shadow: var(--focus-ring); }
.counter-overflow { min-height: 22px; padding: 0 7px; font-size: var(--fs-caption); }
.step-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  color: var(--text-1);
  flex: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.step-btn--plus { border-color: var(--border-strong); color: var(--accent-300); }
.step-btn:active:not(:disabled) { transform: scale(0.92); transition-duration: var(--dur-instant); }
.step-btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .step-btn:hover:not(:disabled) { background: var(--surface-3); }
  .step-btn--plus:hover:not(:disabled) { box-shadow: var(--glow-sm); }
}
.habit-card[data-kind="counter"][data-state="done"] .counter-controls .bar { --bar-fill: var(--success); }
.habit-card[data-kind="counter"][data-state="done"] .habit-counter-value { color: var(--success); }

/* --- Timer --- */
.timer { position: relative; place-items: center; width: 52px; height: 52px; flex: none; }
.timer-ring { position: absolute; inset: 0; width: 52px; height: 52px; transform: rotate(-90deg); }
.timer-ring-track { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.timer-ring-arc {
  fill: none;
  stroke: var(--accent-500);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 144.513;
  stroke-dashoffset: calc(144.513 * (1 - clamp(0, var(--ring), 1)));
  transition: stroke-dashoffset 1000ms linear, stroke var(--dur-base) var(--ease-out);
}
.timer-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-300);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.timer-btn::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.timer-btn .icon { width: 18px; height: 18px; }
.timer-btn .icon--pause { display: none; }
.timer-btn[aria-pressed="true"] .icon--play { display: none; }
.timer-btn[aria-pressed="true"] .icon--pause { display: block; }
.timer-btn:active { transform: scale(0.9); transition-duration: var(--dur-instant); }
@media (hover: hover) and (pointer: fine) { .timer-btn:hover { background: var(--accent-900); } }
.habit-card.is-running { border-color: var(--border-strong); box-shadow: var(--shadow-1), var(--glow-sm); animation: timer-glow 2400ms var(--ease-in-out) infinite alternate; }
.habit-card.is-running .habit-timer-text { color: var(--accent-300); }
.habit-card.is-running .timer-btn { background: var(--accent-900); }
.habit-card[data-kind="timer"][data-state="done"] .timer-ring-arc { stroke: var(--success); }
.habit-card[data-kind="timer"][data-state="done"] .timer-btn { color: var(--success); }

/* --- Выполнено --- */
.habit-card[data-state="done"] { border-color: var(--border-success); }
.habit-card[data-state="done"] .habit-icon-badge { transform: scale(1); }

/* --- Ошибка/откат --- */
.habit-card.is-shaking { animation: shake 320ms linear; }

/* =========================================================================
   14 ФОТО И МИНИАТЮРЫ (§4.10)
   ========================================================================= */
.moment-slot { display: flex; align-items: center; flex: none; }
.moment-slot:empty { display: none; }
.habit-card[data-kind="counter"] .moment-slot { margin-left: 2px; }
.moment { display: flex; align-items: center; }
.moment-attach { width: 44px; padding: 0; color: var(--text-2); border: 1px dashed var(--border-strong); }
.moment-attach > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.moment .thumb { display: none; }
.moment[data-state="attach"] .moment-attach { display: inline-flex; }
.moment:not([data-state="attach"]) .moment-attach { display: none; }
.moment:not([data-state="attach"]) .thumb { display: grid; }

.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--surface-2);
  overflow: visible;
  flex: none;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.thumb--sm { width: 36px; height: 36px; }
.thumb--sm::before { content: ""; position: absolute; inset: -4px; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius-sm) - 1px); }
.thumb-img:not([src]), .thumb-img[src=""] { visibility: hidden; }
.thumb-spinner { position: absolute; display: none; }
.thumb-error { position: absolute; display: none; color: var(--danger); width: 18px; height: 18px; }
.thumb-reaction .icon { width: 12px; height: 12px; }
.thumb-reaction {
  position: absolute;
  right: -6px; bottom: -6px;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface-3);
  box-shadow: 0 0 0 2px var(--surface-1);
  color: var(--accent-300);
}
.thumb:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .thumb:hover { border-color: var(--border-strong); } }
.moment[data-state="loading"] .thumb, .thumb[data-state="loading"] { overflow: hidden; }
.moment[data-state="loading"] .thumb::after, .thumb[data-state="loading"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.12), transparent);
  animation: shimmer 1400ms linear infinite;
}
.moment[data-state="uploading"] .thumb-img { opacity: 0.5; }
.moment[data-state="uploading"] .thumb-spinner { display: block; }
.moment[data-state="error"] .thumb-img, .thumb[data-state="error"] .thumb-img { visibility: hidden; }
.moment[data-state="error"] .thumb-error, .thumb[data-state="error"] .thumb-error { display: block; }

/* =========================================================================
   15 ПАРТНЁР (§4.6)
   ========================================================================= */
.partner-card { display: flex; flex-direction: column; gap: 12px; }
.partner-head { display: flex; align-items: center; gap: 12px; }
.partner-avatar {
  --progress: 0;
  --ring-color: var(--accent-300);
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(clamp(0, var(--progress), 1) * 360deg), var(--surface-3) 0);
  flex: none;
  transition: --progress var(--dur-slow) var(--ease-out);
}
.partner-avatar .avatar { width: 38px; height: 38px; box-shadow: 0 0 0 2px var(--surface-1); }
.partner-meta { flex: 1; min-width: 0; }
.partner-name { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-semibold); }
.partner-status { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
.partner-percent { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-bold); color: var(--accent-300); }
.partner-card[data-state="idle"] .partner-status { color: var(--text-3); }
.partner-card[data-state="done"] { box-shadow: var(--shadow-1), var(--glow-success); border-color: var(--border-success); }
.partner-card[data-state="done"] .partner-status, .partner-card[data-state="done"] .partner-percent { color: var(--success); }
.partner-card[data-state="done"] .partner-avatar { --ring-color: var(--success); }
.partner-card[data-state="done"] .bar { --bar-fill: var(--success); }
.partner-card[data-state="loading"] > :not(.partner-head):not(.partner-habits) { visibility: hidden; }
.partner-card[data-state="loading"] .partner-meta > *, .partner-card[data-state="loading"] .partner-percent { color: transparent; background: var(--surface-2); border-radius: 6px; }

.partner-habits { display: grid; gap: 2px; margin: 0 -6px; }
.partner-habit {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.partner-habit-icon {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--tone-bg, var(--tone-violet-bg));
  color: var(--tone, var(--tone-violet));
}
.partner-habit-icon .icon { width: 16px; height: 16px; }
.partner-habit-name { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.partner-habit-value { grid-column: 4; display: inline-flex; align-items: center; justify-content: flex-end; min-width: 24px; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-2); }
.partner-habit .thumb { grid-column: 3; }
.partner-check { display: none; width: 20px; height: 20px; fill: none; stroke: var(--success); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.partner-circle { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); }
.partner-habit[data-kind="binary"] .partner-value-text { display: none; }
.partner-habit[data-kind="binary"][data-state="done"] .partner-check { display: block; }
.partner-habit[data-kind="binary"][data-state="todo"] .partner-circle { display: block; }
.partner-habit:not([data-kind="binary"])[data-state="done"] .partner-value-text { color: var(--success); }
.partner-habit.is-live { animation: live-flash 1200ms var(--ease-out); }
.partner-habit.is-live .partner-check { animation: check-pop var(--dur-spring) var(--ease-spring); }
.partner-ping { margin-top: 2px; }

.skeleton-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px; }

/* =========================================================================
   16 ЦЕЛЬ И «СЕГОДНЯ В ЦИФРАХ» (§4.5)
   ========================================================================= */
.goal-card { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.goal-head { display: flex; align-items: center; justify-content: space-between; margin: -10px -10px 0 0; }
.goal-body { display: flex; flex-direction: column; gap: 8px; }
.goal-reward {
  font-size: var(--fs-title-sm);
  line-height: var(--lh-title-sm);
  font-weight: var(--fw-semibold);
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.goal-progress { display: flex; align-items: center; gap: 10px; }
.goal-percent { font-size: var(--fs-label); font-weight: var(--fw-bold); color: var(--accent-300); min-width: 4ch; text-align: right; }
.goal-caption { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
.goal-done { display: none; font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-semibold); color: var(--accent-300); }
.goal-empty { display: none; flex-direction: column; align-items: flex-start; gap: 6px; }
.goal-empty-title { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-semibold); }
.goal-empty-text { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); margin-bottom: 4px; }
.goal-card[data-state="empty"] .goal-body { display: none; }
.goal-card[data-state="empty"] .goal-empty { display: flex; }
.goal-card[data-state="completed"] { border-color: rgba(192, 132, 252, 0.55); box-shadow: var(--shadow-1), var(--glow-lg); }
.goal-card[data-state="completed"] .goal-done { display: block; }
.goal-card[data-state="completed"] .goal-caption { display: none; }
.goal-card .bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
}
.goal-card.is-celebrating .bar-fill::after { animation: shine 900ms var(--ease-in-out) 1; }
@media (min-width: 641px) { .goal-card { justify-content: space-between; } }

.numbers-card { display: flex; flex-direction: column; gap: 12px; }
.numbers-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.numbers-item dt { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.numbers-item dd { white-space: nowrap; font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.numbers-coins { color: var(--warn); }

/* =========================================================================
   17 МАГАЗИН (§4.12–4.13)
   ========================================================================= */
.balance-card { display: flex; align-items: center; gap: 14px; }
.balance-coin {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-size: 26px;
  line-height: 1;
  flex: none;
}
.balance-main { min-width: 0; }
.balance-value { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); color: var(--warn); }
.balance-unit { font-size: var(--fs-body-sm); font-weight: var(--fw-medium); letter-spacing: 0; color: var(--text-2); }
.balance-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-3); }
.balance-today { color: var(--success); }
.balance-sep { color: var(--text-3); }

.reward-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 641px) { .reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--bento-gap); } }
@media (min-width: 1024px) { .reward-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

.reward-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 152px;
  padding: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: rgba(18, 18, 26, 0.86);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.reward-card:has([aria-expanded="true"]), .reward-card.is-menu-open { z-index: 5; }
.reward-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--accent-300);
  transition: transform var(--dur-base) var(--ease-spring);
}
.reward-icon .icon { width: 28px; height: 28px; }
.reward-title {
  flex: 1;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  font-weight: var(--fw-semibold);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reward-buy { min-height: 44px; padding: 0 10px; border-radius: var(--radius-pill); font-size: var(--fs-label); font-weight: var(--fw-bold); }
.reward-card[data-state="ok"] .reward-buy,
.reward-card[data-state="busy"] .reward-buy { background: var(--accent-gradient-btn); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.reward-card[data-state="short"] .reward-buy { background: var(--surface-2); border-color: var(--border-subtle); color: var(--text-3); cursor: not-allowed; }
.reward-card[data-state="short"] .reward-buy[aria-disabled="true"] { opacity: 1; }
.reward-menu-anchor { position: absolute; top: 6px; right: 6px; margin: 0; display: none; }
.reward-card[data-own="true"] .reward-menu-anchor { display: block; }
.reward-card .menu { right: 0; }
.reward-card.is-bumping { animation: bump 420ms var(--ease-spring); }
@media (hover: hover) and (pointer: fine) {
  .reward-card:hover { border-color: var(--border-strong); }
  .reward-card:hover .reward-icon { transform: scale(1.08); }
  .reward-card[data-state="ok"] .reward-buy:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--glow-sm); }
}

.reward-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 152px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-strong);
  color: var(--accent-300);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.reward-add .icon { width: 24px; height: 24px; }
.reward-add:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .reward-add:hover { background: var(--accent-900); border-color: var(--accent-300); } }

.reward-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-default);
}
.reward-preview .reward-icon { background: var(--surface-3); }
.reward-preview-text { display: grid; gap: 2px; min-width: 0; }
.reward-preview-title { font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reward-preview-cost { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-size: var(--fs-label); font-weight: var(--fw-bold); }

/* =========================================================================
   18 КУПОНЫ (§4.14)
   ========================================================================= */
.coupon-list { display: grid; gap: 10px; }
@media (min-width: 641px) and (max-width: 1023px) {
  #coupons-pending-list, #coupons-redeemed-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .coupon-panel { max-height: calc(100dvh - 260px); overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; }
}
.bento-coupons .segmented { margin-bottom: 12px; }

.coupon {
  --stub: 72px;
  position: relative;
  display: grid;
  grid-template-columns: var(--stub) minmax(0, 1fr);
  min-height: 88px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  -webkit-mask:
    radial-gradient(circle 7px at var(--stub) 0, transparent 97%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 7px at var(--stub) 100%, transparent 97%, #000 100%) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 7px at var(--stub) 0, transparent 97%, #000 100%) top / 100% 51% no-repeat,
    radial-gradient(circle 7px at var(--stub) 100%, transparent 97%, #000 100%) bottom / 100% 51% no-repeat;
}
.coupon-stub {
  display: grid;
  place-items: center;
  background: var(--accent-900);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--accent-300);
  border-right: 1.5px dashed var(--border-strong);
}
.coupon-stub .icon { width: 30px; height: 30px; }
.coupon-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 14px; min-width: 0; }
.coupon-title { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coupon-meta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.coupon-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.coupon-chip { min-height: 24px; font-size: var(--fs-caption); padding: 0 8px; }
.coupon-who { font-size: var(--fs-caption); color: var(--text-3); }
.coupon-redeem { display: none; align-self: flex-start; margin-top: 6px; }
.coupon-stamp {
  position: absolute;
  top: 50%; right: 12px;
  display: none;
  padding: 4px 8px;
  border: 1.5px solid var(--success);
  border-radius: 8px;
  color: var(--success);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-50%) rotate(-8deg);
  background: rgba(10, 10, 15, 0.6);
  pointer-events: none;
}
.coupon[data-variant="fulfill"][data-status="pending"] { border-color: var(--border-strong); box-shadow: var(--glow-sm); }
.coupon[data-variant="fulfill"][data-status="pending"] .coupon-status { display: none; }
.coupon[data-variant="fulfill"][data-status="pending"] .coupon-redeem { display: inline-flex; }
.coupon[data-status="redeemed"] { opacity: 0.7; }
.coupon[data-status="redeemed"] .coupon-status { display: none; }
.coupon[data-status="redeemed"] .coupon-stamp { display: block; }
.coupon[data-status="redeemed"] .coupon-body { padding-right: 104px; }
.coupon.is-stamping { opacity: 1; }
.coupon.is-stamping .coupon-stamp { animation: stamp var(--dur-spring) var(--ease-spring) both; }

/* =========================================================================
   19 АНАЛИТИКА (§4.15)
   ========================================================================= */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
@media (min-width: 641px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bento-gap); } }
.stat { display: flex; flex-direction: column; gap: 4px; min-height: 104px; }
@media (min-width: 641px) { .stat { min-height: 112px; } }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-3); }
.stat-icon { width: 16px; height: 16px; color: var(--accent-300); }
.stat-icon--flame { color: #fb923c; }
.stat-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}
@media (min-width: 1024px) { .stat-value { font-size: 36px; line-height: 40px; } }
.stat-unit { font-size: var(--fs-title); color: var(--text-2); margin-left: -6px; }
.stat-record { min-height: 22px; font-size: var(--fs-caption); letter-spacing: 0; }
.stat-context { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); min-height: 16px; display: flex; align-items: center; }
.stat-context .bar { margin-top: 6px; }

#view-analytics[data-state="loading"] .stat-value,
#view-analytics[data-state="loading"] .stat-context { color: transparent; }
#view-analytics[data-state="loading"] .stat-value { width: 64px; border-radius: 8px; background: var(--surface-2); }
#view-analytics[data-state="loading"] .stat-value > * { visibility: hidden; }
#view-analytics[data-state="error"] .bento--analytics { display: none; }
.analytics-error { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 16px; text-align: center; }

.split-card { display: flex; flex-direction: column; gap: 12px; }
.split-list { display: grid; gap: 10px; }
.split-row { display: flex; align-items: center; gap: 12px; }
.split-text { min-width: 0; }
.split-name { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); }
.split-meta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.split-bar {
  --split: 0.5;
  display: flex;
  gap: 2px;
  height: 10px;
  margin-top: auto;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface-1);
}
.split-bar-me { flex: var(--split) 1 0; background: var(--accent-500); min-width: 4px; transition: flex-grow var(--dur-slow) var(--ease-out); }
.split-bar-partner { flex: calc(1 - var(--split)) 1 0; background: var(--accent-300); min-width: 4px; transition: flex-grow var(--dur-slow) var(--ease-out); }
.split-percents { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-2); font-weight: var(--fw-semibold); }

/* =========================================================================
   20 ТЕПЛОВАЯ КАРТА (§4.16)
   ========================================================================= */
.heat-card { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.heat-wrap {
  /* Размер ячейки ужимается под ширину карточки: 14 колонок + колонка подписей 24px */
  --cell: var(--heat-cell);
  --gap: var(--heat-gap);
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: 16px auto;
  row-gap: 6px;
  justify-content: start;
  margin-top: 4px;
}
@supports (width: 1cqi) {
  .heat-wrap { --cell: clamp(10px, calc((100cqi - 24px - 13 * var(--heat-gap)) / 14), var(--heat-cell)); }
}
.heat-months {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-auto-columns: var(--cell);
  column-gap: var(--gap);
  font-size: var(--fs-caption);
  line-height: 16px;
  color: var(--text-3);
}
.heat-month { grid-row: 1; grid-column: var(--col) / span 3; white-space: nowrap; }
.heat-days {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  row-gap: var(--gap);
  font-size: 11px;
  color: var(--text-3);
}
.heat-days span { grid-row: var(--row); line-height: var(--cell); }
.heat-grid {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-columns: var(--cell);
  gap: var(--gap);
  border-radius: var(--radius-xs);
}
.heat-row { display: contents; }
.heat-cell {
  position: relative;
  display: grid;
  place-items: center;
  grid-column: var(--col);
  grid-row: var(--row);
  width: var(--cell);
  height: var(--cell);
  border-radius: 4px;
  background: var(--heat-0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
@media (min-width: 1024px) { .heat-cell { border-radius: var(--radius-xs); } }
.heat-cell::before { content: ""; position: absolute; inset: calc(var(--gap) / -2); }
.heat-cell[data-level="1"] { background: var(--heat-1); box-shadow: none; }
.heat-cell[data-level="2"] { background: var(--heat-2); box-shadow: none; }
.heat-cell[data-level="3"] { background: var(--heat-3); box-shadow: var(--heat-3-glow); }
.heat-cell[data-level="3"]::after {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-on-light);
}
.heat-cell[data-today="true"] { outline: 1.5px solid var(--text-2); outline-offset: 1px; }
.heat-shield { display: none; position: absolute; width: 10px; height: 10px; fill: rgba(125, 211, 252, 0.3); stroke: var(--freeze); stroke-width: 2.5; }
.heat-cell[data-frozen="true"] .heat-shield { display: block; }
.heat-cell[data-frozen="true"][data-level="3"]::after { display: none; }
.heat-cell:focus-visible { z-index: 1; box-shadow: var(--focus-ring); }
.heat-cell[aria-selected="true"], .heat-cell.is-active { z-index: 1; transform: scale(1.15); }
@media (hover: hover) and (pointer: fine) { .heat-cell:hover { z-index: 1; transform: scale(1.15); } }

.heat-grid.is-revealing .heat-cell { animation: fade-in 240ms var(--ease-out) both; animation-delay: calc((var(--col) - 1) * 12ms); }
#view-analytics[data-state="loading"] .heat-grid {
  width: calc(13 * var(--cell) + 12 * var(--gap));
  height: calc(7 * var(--cell) + 6 * var(--gap));
  background:
    linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent) 0 0 / 50% 100% no-repeat,
    repeating-linear-gradient(90deg, var(--surface-2) 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap))),
    transparent;
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
  mask: repeating-linear-gradient(180deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
  animation: shimmer-bg 1400ms linear infinite;
}
.heat-empty { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }

.heat-readout {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  color: var(--text-1);
}
.heat-foot { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: var(--fs-caption); color: var(--text-3); }
.heat-legend span:first-child { margin-right: 4px; }
.heat-legend span:last-child { margin-left: 4px; }
.heat-swatch { position: relative; display: grid; place-items: center; width: 12px; height: 12px; border-radius: 3px; background: var(--heat-0); }
.heat-swatch[data-level="1"] { background: var(--heat-1); }
.heat-swatch[data-level="2"] { background: var(--heat-2); }
.heat-swatch[data-level="3"] { background: var(--heat-3); box-shadow: var(--heat-3-glow); }
.heat-swatch[data-level="3"]::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--text-on-light); }
.heat-legend-text { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); text-align: right; }

.heat-details { margin-top: -4px; }
.heat-summary { list-style: none; display: inline-flex; padding: 0 10px; margin-left: -10px; cursor: pointer; }
.heat-summary::-webkit-details-marker { display: none; }
.heat-summary-hide { display: none; }
.heat-details[open] .heat-summary-show { display: none; }
.heat-details[open] .heat-summary-hide { display: inline; }
.table-wrap { max-height: 320px; overflow: auto; margin-top: 8px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.heat-table { width: 100%; font-size: var(--fs-label); line-height: var(--lh-label); }
.heat-table th, .heat-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-subtle); }
.heat-table th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: var(--fw-semibold); }
.heat-table td { color: var(--text-1); }
.heat-table tr:last-child td { border-bottom: 0; }

.heat-tooltip {
  position: fixed;
  left: var(--tx, 0px);
  top: var(--ty, 0px);
  transform: translate(-50%, calc(-100% - 8px));
  pointer-events: none;
  white-space: nowrap;
}

/* =========================================================================
   21 ДИАЛОГИ И ЛИСТЫ (§4.11, §4.18)
   ========================================================================= */
.dialog {
  width: min(480px, calc(100vw - 32px));
  max-width: none;
  max-height: min(92dvh, 760px);
  padding: 0;
  margin: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  color: var(--text-1);
  box-shadow: var(--shadow-3);
  overflow: auto;
  overscroll-behavior: contain;
}
.dialog::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
}
.dialog[open] { animation: modal-in var(--dur-base) var(--ease-spring-soft); }
.dialog[open]::backdrop { animation: fade-in var(--dur-base) var(--ease-out); }
.dialog.is-closing { animation: modal-out var(--dur-fast) var(--ease-in) forwards; }
.dialog.is-closing::backdrop { animation: fade-out var(--dur-fast) var(--ease-in) forwards; }
.dialog--narrow { width: min(440px, calc(100vw - 32px)); }
.dialog--settings { width: min(520px, calc(100vw - 32px)); }
.dialog--confirm { width: min(400px, calc(100vw - 32px)); }

.dialog-body { position: relative; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -10px 0 0; }
.dialog-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.dialog-text { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-2); }
.dialog-close { margin-left: auto; }
.dialog-actions { display: flex; gap: 12px; margin-top: var(--space-2); }
.dialog-actions--split { justify-content: flex-end; }
.dialog-actions--split .btn { min-width: 112px; }
@media (max-width: 640px) {
  .dialog-actions--split { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions--split .btn { min-width: 0; }
}
.dialog--confirm .dialog-body { gap: var(--space-3); }
.dialog--confirm .dialog-title { text-wrap: balance; }
#confirm-dialog[data-tone="primary"] #confirm-ok { background: var(--accent-gradient-btn); }
.confirm-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: var(--radius-lg); background: var(--accent-900); color: var(--accent-300); box-shadow: var(--glow-sm); }
.confirm-icon .icon { width: 32px; height: 32px; }

/* Редактор привычки: поля цели переключаются по data-kind формы */
#habit-form [data-kind-field] { display: none; }
#habit-form[data-kind="counter"] [data-kind-field="counter"],
#habit-form[data-kind="timer"] [data-kind-field="timer"] { display: grid; }

.sheet-handle { display: none; }

/* Лист снизу на мобильном */
@media (max-width: 640px) {
  .dialog--sheet {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 720px);
    margin: auto 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: 0;
  }
  .dialog--sheet[open] { animation: sheet-in var(--dur-slow) var(--ease-spring-soft); }
  .dialog--sheet.is-closing { animation: sheet-out var(--dur-base) var(--ease-in) forwards; }
  .dialog--sheet .dialog-body {
    padding: var(--space-3) calc(var(--space-5) + var(--safe-right)) calc(var(--space-6) + var(--safe-bottom)) calc(var(--space-5) + var(--safe-left));
  }
  .sheet-handle {
    display: block;
    width: 36px; height: 4px;
    margin: 0 auto 4px;
    border-radius: 2px;
    background: var(--surface-3);
  }
  .dialog--sheet.is-dragging { transition: none; animation: none; transform: translateY(var(--drag-y, 0px)); }
}

/* Чипы быстрых фраз */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  color: var(--text-1);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.chip-btn:active:not([aria-disabled="true"]) { transform: scale(0.96); transition-duration: var(--dur-instant); }
.chip-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .chip-btn:not([aria-disabled="true"]):hover { border-color: var(--border-strong); background: var(--accent-900); } }

/* =========================================================================
   22 НАСТРОЙКИ (§4.17)
   ========================================================================= */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.settings-section--plain { padding: 0; background: none; border: 0; }
.settings-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section-title { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); }
.settings-section .input { background: var(--surface-1); }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.test-result { font-size: var(--fs-label); line-height: var(--lh-label); }
.test-result[data-result="ok"] { color: var(--success); }
.test-result[data-result="fail"] { color: var(--danger); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.setting-row--range { gap: 12px; }
.setting-row-label { font-size: var(--fs-body-sm); color: var(--text-1); flex: none; }

/* =========================================================================
   23 ЛАЙТБОКС (§4.10)
   ========================================================================= */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-1);
  overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fade-in var(--dur-slow) var(--ease-out); }
.lightbox.is-closing { animation: fade-out var(--dur-base) var(--ease-in) forwards; }
.lightbox::backdrop {
  background: var(--scrim-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
}
.lightbox-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(56px + var(--safe-top));
  padding: var(--safe-top) calc(8px + var(--safe-right)) 0 calc(16px + var(--safe-left));
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
  border-bottom: 1px solid var(--border-subtle);
}
.lightbox-caption-wrap { flex: 1; min-width: 0; }
.lightbox-caption { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-date { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.lightbox-close { color: var(--text-1); }
.lightbox-stage { position: relative; display: grid; place-items: center; padding: 16px; min-height: 0; }
.lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 200px);
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  transform-origin: center;
}
.lightbox-img:not([src]), .lightbox-img[src=""] { display: none; }
.lightbox-spinner { position: absolute; display: none; width: 32px; height: 32px; }
.lightbox-stage[aria-busy="true"] .lightbox-spinner { display: block; }
.lightbox-stage[aria-busy="true"] .lightbox-img { opacity: 0.4; }
.lightbox-bottom {
  display: flex;
  justify-content: center;
  padding: 12px calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
}
.reactions { display: flex; gap: 12px; }
.reaction {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.reaction .icon { width: 26px; height: 26px; }
.reaction[data-reaction="heart"] { --react: #f472b6; }
.reaction[data-reaction="fire"] { --react: #fb923c; }
.reaction[data-reaction="love"] { --react: #fbbf24; }
.reaction[data-reaction="clap"] { --react: #a78bfa; }
.reaction[aria-pressed="true"], .reaction:hover { color: var(--react, var(--accent-300)); }
.reaction:active { transform: scale(0.9); transition-duration: var(--dur-instant); }
.reaction[aria-pressed="true"] { background: var(--accent-900); border-color: var(--accent-300); box-shadow: var(--glow-sm); }
@media (hover: hover) and (pointer: fine) { .reaction:not([aria-pressed="true"]):hover { background: var(--surface-3); transform: translateY(-2px); } }
.lightbox[data-owner="mine"] .reactions { display: none; }
.lightbox[data-owner="partner"] .lightbox-delete { display: none; }
.reaction-fly {
  position: fixed;
  z-index: var(--z-fly);
  font-size: 26px;
  pointer-events: none;
  animation: reaction-fly 500ms var(--ease-out) forwards;
}
.lightbox.is-dragging { animation: none; }
.lightbox.is-dragging .lightbox-stage { transform: translateY(var(--drag-y, 0px)); }

/* =========================================================================
   24 ПОПОВЕРЫ И МЕНЮ
   ========================================================================= */
.popover-anchor { position: relative; flex: none; }
.popover {
  position: absolute;
  z-index: var(--z-popover);
  top: calc(100% + 6px);
  right: -8px;
  width: min(260px, calc(100vw - 32px));
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-3);
  animation: pop-in var(--dur-base) var(--ease-spring-soft);
  transform-origin: top right;
}
@media (max-width: 640px) {
  .popover:not(.heat-tooltip) {
    position: fixed;
    top: calc(var(--safe-top) + var(--header-h) + 6px);
    left: calc(16px + var(--safe-left));
    right: calc(16px + var(--safe-right));
    width: auto;
    transform-origin: top center;
  }
}
.popover-title { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-semibold); color: var(--text-1); }
.popover-text { margin-top: 4px; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
.popover-status { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-label); line-height: var(--lh-label); color: var(--freeze); }
.popover-status[data-status="used"] { color: var(--text-2); }
.popover--tooltip {
  width: auto;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
}
.popover--tooltip .popover-text { margin-top: 0; color: var(--text-3); font-size: var(--fs-caption); }
.heat-tooltip { right: auto; top: var(--ty, 0px); z-index: var(--z-popover); font-size: var(--fs-caption); color: var(--text-1); animation: none; }

.menu {
  position: absolute;
  z-index: var(--z-popover);
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-3);
  animation: pop-in var(--dur-base) var(--ease-spring-soft);
  transform-origin: top right;
}
.menu[data-placement="top"] { top: auto; bottom: calc(100% + 4px); transform-origin: bottom right; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: var(--fs-body-sm);
  color: var(--text-1);
  text-align: left;
  white-space: nowrap;
}
.menu-item .icon { width: 18px; height: 18px; color: var(--text-2); }
.menu-item--danger, .menu-item--danger .icon { color: var(--danger); }
.menu-item:focus-visible { box-shadow: var(--focus-ring-inset); }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, 0.06); }
.menu-item--danger:hover, .menu-item--danger:focus-visible { background: var(--danger-bg); }
.menu-item[hidden] { display: none; }

/* =========================================================================
   25 ТОСТЫ (§4.19)
   ========================================================================= */
.toast-stack {
  position: fixed;
  z-index: var(--z-toast);
  top: calc(var(--safe-top) + var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 32px), 420px);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.toast-stack:empty { display: none; }
@media (min-width: 1024px) {
  .toast-stack {
    top: auto; left: auto;
    right: calc(24px + var(--safe-right));
    bottom: calc(24px + var(--safe-bottom));
    transform: none;
    width: 380px;
    flex-direction: column;
  }
}
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  pointer-events: auto;
  touch-action: pan-y;
  animation: toast-in var(--dur-spring) var(--ease-spring-soft) both;
}
@media (min-width: 1024px) { .toast { animation-name: toast-in-up; } }
.toast.is-leaving { animation: toast-out var(--dur-fast) var(--ease-in) forwards; }
.toast.is-dragging { animation: none; transform: translateX(var(--drag-x, 0px)); opacity: var(--drag-opacity, 1); }
.toast-icon { display: grid; place-items: center; flex: none; }
.toast-icon .icon { display: none; }
.toast[data-type="info"] .toast-icon--info { display: block; color: var(--accent-300); }
.toast[data-type="success"] .toast-icon--success { display: block; color: var(--success); }
.toast[data-type="error"] .toast-icon--error { display: block; color: var(--danger); }
.toast[data-type="offline"] .toast-icon--offline { display: block; color: var(--warn); }
.toast[data-type="error"] { border-color: var(--border-danger); }
.toast-text { flex: 1; min-width: 0; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-1); }
.toast-action { margin: -8px -8px -8px 0; flex: none; }
.toast-life {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent-gradient);
  opacity: 0.6;
  transform-origin: left;
  animation: toast-life var(--life, 3500ms) linear forwards;
}
.toast[data-paused="true"] .toast-life { animation-play-state: paused; }
.toast[data-persistent="true"] .toast-life { display: none; }

.toast--notify { align-items: flex-start; padding: 14px 8px 14px 14px; }
.notify-visual { position: relative; flex: none; }
.notify-avatar { width: 36px; height: 36px; }
.notify-kind { display: none; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent-900); color: var(--accent-300); }
.notify-kind .icon { width: 20px; height: 20px; }
.toast--notify[data-kind="coupon"] .notify-avatar,
.toast--notify[data-kind="coupon_redeemed"] .notify-avatar,
.toast--notify[data-kind="all_done"] .notify-avatar { display: none; }
.toast--notify[data-kind="coupon"] .notify-kind,
.toast--notify[data-kind="coupon_redeemed"] .notify-kind,
.toast--notify[data-kind="all_done"] .notify-kind,
.toast--notify[data-kind="pro"] .notify-kind { display: grid; }
.toast--notify[data-kind="pro"] .notify-avatar { display: none; }
.notify-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notify-title { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); }
.notify-text {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.notify-text:empty { display: none; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.notify-actions:not(:has(> :not([hidden]))) { display: none; }
.notify-primary[hidden] { display: none; }
.toast--notify[data-kind="coupon"] .notify-primary { background: var(--accent-gradient-btn); border-color: transparent; color: #fff; }
.toast--notify[data-kind="coupon"] { border-color: var(--border-strong); }
.notify-close { margin: -10px 0 -10px 0; }

/* =========================================================================
   26 МОНЕТЫ (+N) И КОНФЕТТИ (§5.2–5.3)
   ========================================================================= */
.fly-layer { position: fixed; inset: 0; z-index: var(--z-fly); pointer-events: none; overflow: hidden; }
.fly-layer:empty { display: none; }
.coin-fly {
  position: fixed;
  left: var(--x0);
  top: var(--y0);
  pointer-events: none;
  will-change: transform;
}
.coin-fly-y { display: block; will-change: transform; }
.coin-fly-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  translate: -50% -50%;
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  color: var(--warn);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
  white-space: nowrap;
  opacity: 0;
}
.coin-fly.is-flying { animation: fly-x var(--dur-xslow) linear forwards; }
.coin-fly.is-flying .coin-fly-y { animation: fly-y var(--dur-xslow) linear forwards; }
.coin-fly.is-flying .coin-fly-label { animation: fly-label var(--dur-xslow) linear forwards; }
.coin-fly.is-floating .coin-fly-y { animation: float-y 600ms var(--ease-out) forwards; }
.coin-fly.is-floating .coin-fly-label { animation: float-label 600ms var(--ease-out) forwards; }

.pill--coins.is-bumping { animation: bump-coin 420ms var(--ease-spring); box-shadow: var(--glow-coin), inset 0 0 0 1px rgba(251, 191, 36, 0.7); }
.pill--coins.is-draining .num { animation: drain 300ms var(--ease-out); }

.confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: var(--z-confetti);
  pointer-events: none;
}

/* =========================================================================
   27 СКЕЛЕТЫ (§4.20)
   ========================================================================= */
.skeleton {
  --w: 100%;
  --h: 16px;
  position: relative;
  display: block;
  width: var(--w);
  height: var(--h);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  flex: none;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1400ms linear infinite;
}
.skeleton--circle { border-radius: 50%; }
.skeleton--pill { border-radius: var(--radius-pill); }
.skeleton--card { border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
.skeleton--habit { height: 78px; }
.skeleton--reward { height: 152px; }
[aria-busy="true"] .sr-only { position: absolute !important; }

/* =========================================================================
   28 ПУСТЫЕ СОСТОЯНИЯ (§4.21)
   ========================================================================= */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
}
.empty-art {
  display: grid;
  place-items: center;
  width: 80px; height: 80px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent-900);
  color: var(--accent-400);
  box-shadow: inset 0 0 0 1px var(--border-default);
}
.empty-art .icon { width: 40px; height: 40px; stroke-width: 1.5; }
.empty-art--danger { background: var(--danger-bg); color: var(--danger); }
.empty-title { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-semibold); }
.empty-text { max-width: 34ch; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-2); }
.empty .btn { margin-top: 8px; }
.empty--compact { text-align: left; padding: 14px 16px; align-items: center; justify-items: start; }
.empty--compact .empty-art { width: 44px; height: 44px; margin: 0; flex: none; }
.empty--compact .empty-art .icon { width: 22px; height: 22px; }
.empty--compact .empty-title { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.empty--compact .empty-text { font-size: var(--fs-label); line-height: var(--lh-label); }
.empty--compact > :not(.empty-art) { min-width: 0; }
.empty--compact { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 0; }
.empty--compact .empty-art { grid-row: 1 / 3; }
.partner-card .empty--compact { padding: 4px 0; }
.bento-habits .empty { border-style: dashed; }

/* =========================================================================
   29 АНИМАЦИИ (§5.1) — keyframes и триггер-классы
   ========================================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes shimmer-bg { from { background-position: -100% 0, 0 0; } to { background-position: 200% 0, 0 0; } }
@keyframes breathe { from { opacity: 0.7; } to { opacity: 1; } }
@keyframes sync-pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.2); opacity: 0; } }
@keyframes timer-glow { from { box-shadow: var(--shadow-1), var(--glow-sm); } to { box-shadow: var(--shadow-1), var(--glow-md); } }

/* Вкладки и бенто */
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes stagger-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.view.is-entering { animation: view-in var(--dur-base) var(--ease-out); }
.is-staggering > * { animation: stagger-in var(--dur-slow) var(--ease-spring-soft) both; animation-delay: calc(min(var(--i, 0), 7) * 50ms); }

/* Check-pop (§5.1 #5) */
@keyframes check-pop {
  0% { transform: scale(1); }
  25% { transform: scale(0.85); }
  65% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes ring-flash { from { transform: scale(0.6); opacity: 0.6; } to { transform: scale(1.6); opacity: 0; } }
.is-popping { animation: check-pop var(--dur-spring) var(--ease-out); }
.check-btn.is-popping::after { animation: ring-flash 420ms var(--ease-out); }
.timer.is-popping, .habit-counter-value.is-popping { animation: check-pop var(--dur-spring) var(--ease-out); }

/* Counter tick (§5.1 #7): JS ставит data-dir="up|down" и класс .is-ticking на .counter-digits */
@keyframes tick-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tick-down { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.counter-digits.is-ticking[data-dir="up"] > span { animation: tick-up 180ms var(--ease-out); }
.counter-digits.is-ticking[data-dir="down"] > span { animation: tick-down 180ms var(--ease-out); }

/* Shake (§5.1 #23) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.is-shaking { animation: shake 320ms linear; }

/* Герой «комбо» (§5.1 #13) */
@keyframes combo-bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
.streak-card.is-combo .streak-number { animation: combo-bump var(--dur-xslow) var(--ease-spring); }
.streak-card.is-combo { animation: fade-glow var(--dur-xslow) var(--ease-out); }
@keyframes fade-glow { from { box-shadow: var(--shadow-1); } to { box-shadow: var(--shadow-1), var(--glow-md); } }
.streak-card.is-static-glow { box-shadow: var(--shadow-1), var(--glow-lg); }

/* Монеты (§5.3) */
@keyframes fly-x {
  0%, 28.5% { transform: translateX(0); animation-timing-function: var(--ease-in-out); }
  100% { transform: translateX(var(--dx)); }
}
@keyframes fly-y {
  0% { transform: translateY(0); animation-timing-function: var(--ease-spring); }
  28.5% { transform: translateY(-24px); animation-timing-function: var(--ease-in); }
  100% { transform: translateY(var(--dy)); }
}
@keyframes fly-label {
  0% { opacity: 0; scale: 0.6; animation-timing-function: var(--ease-spring); }
  28.5% { opacity: 1; scale: 1.1; animation-timing-function: var(--ease-in); }
  100% { opacity: 0.2; scale: 0.5; }
}
@keyframes float-y { from { transform: translateY(0); } to { transform: translateY(-36px); } }
@keyframes float-label { 0% { opacity: 0; scale: 0.6; } 30% { opacity: 1; scale: 1.1; } 100% { opacity: 0; scale: 1; } }
@keyframes bump-coin { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes drain { 0%, 100% { color: inherit; } 30% { color: var(--danger); } }

/* Покупка, штамп, live-подсветка, блик цели */
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes stamp {
  from { opacity: 0; transform: translateY(-50%) scale(1.6) rotate(-20deg); }
  to { opacity: 1; transform: translateY(-50%) scale(1) rotate(-8deg); }
}
@keyframes live-flash { from { background-color: var(--accent-900); } to { background-color: transparent; } }
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes reaction-fly { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(-50%, calc(-50% - 40px)) scale(1.6); opacity: 0; } }

/* Диалоги, листы, поповеры */
@keyframes modal-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes modal-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { from { transform: none; } to { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* Тосты */
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-in-up { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* =========================================================================
   30 ДОСТУПНОСТЬ ДВИЖЕНИЯ (§5.4)
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .skeleton::after,
  .card[aria-busy="true"]::after,
  .streak-card[data-state="loading"]::after,
  #view-analytics[data-state="loading"] .heat-grid,
  .sync[data-state="syncing"] .sync-dot::after,
  .streak-card[data-state="waiting"] .streak-chip .pill-icon,
  .habit-card.is-running,
  .eclipse-corona,
  .cookie-banner,
  .is-staggering > *,
  .heat-grid.is-revealing .heat-cell,
  .is-shaking,
  .habit-card.is-shaking,
  .coupon.is-stamping .coupon-stamp,
  .goal-card.is-celebrating .bar-fill::after,
  .streak-card.is-combo,
  .streak-card.is-combo .streak-number,
  .reward-card.is-bumping,
  .is-popping,
  .check-btn.is-popping::after,
  .partner-habit.is-live .partner-check,
  .counter-digits.is-ticking > span,
  .pill--coins.is-bumping {
    animation: none !important;
  }
  .habit-card.is-shaking, .is-shaking { border-color: var(--border-danger) !important; }
  .coin-fly, .reaction-fly, .confetti { display: none !important; }
  .toast-life { animation-duration: var(--life, 3500ms) !important; }
  .bar-fill, .timer-ring-arc, .check-icon { transition: none !important; }
  .lightbox[open] { animation-duration: 120ms; }
}

/* =========================================================================
   31 ЛОГОТИП
   ========================================================================= */
.brand-logo {
  display: block;
  width: 32px; height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(192, 38, 211, 0.35));  /* планета без фона — свечение по контуру */
  flex: none;
}
.brand-logo--lg { width: 72px; height: 72px; }
.brand-word { white-space: nowrap; }
.brand--auth { flex-direction: column; gap: 14px; width: 100%; font-size: var(--fs-title); }
.header-logo { display: none; }
@media (min-width: 640px) and (max-width: 1023px) { .header .header-logo { display: block; } }

/* =========================================================================
   32 КАПСУЛЫ (pill): ADMIN, PRO, серия, щит, монеты, INCOGNITO
   ========================================================================= */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border: 0;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
  flex: none;
}
.pill-icon { width: 16px; height: 16px; flex: none; fill: currentColor; }
.pill--sm { padding: 4px 12px; gap: 6px; font-size: 12px; line-height: 16px; }
.pill--sm .pill-icon { width: 14px; height: 14px; }
.pill--xs { padding: 2px 8px; gap: 4px; font-size: 10.5px; line-height: 14px; letter-spacing: 0.02em; }
.pill--xs .pill-icon { width: 11px; height: 11px; }

/* ADMIN — системный статус суперпользователя: строгий рубиново-красный, белая корона и текст. */
.pill--admin {
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 2px 12px rgba(220, 38, 38, 0.4);
}
.pill--admin .pill-icon { color: #fff; }
.pill--pro {
  background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(124, 58, 237, 0.4);
}
.pill--muted {
  background: rgba(18, 18, 26, 0.82);
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px var(--border-default), 0 0 14px rgba(139, 92, 246, 0.12);
}
.pill--incognito { color: var(--accent-200); }

/* Кнопка-капсула: визуально 32px, зона касания 44px */
.pill--button { cursor: pointer; transition: transform var(--dur-fast) var(--ease-spring), filter var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.pill--button::before, a.pill::before, button.pill::before { content: ""; position: absolute; inset: -6px -2px; }
.pill--button:active, button.pill:active, a.pill:active { transform: scale(0.96); }
.pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) {
  .pill--pro.pill--button:hover, .pill--admin.pill--button:hover { filter: brightness(1.1); }
  button.pill--muted:hover, a.pill--muted:hover { box-shadow: inset 0 0 0 1px var(--border-strong), 0 0 18px rgba(139, 92, 246, 0.25); }
}
#pro-open[data-active="true"] { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(192, 132, 252, 0.6), 0 0 18px rgba(147, 51, 234, 0.55); }
.header #pro-open { padding: 6px 13px; }
@media (max-width: 380px) { .header #pro-open { padding: 6px 10px; gap: 5px; } }

/* =========================================================================
   33 ЗАТМЕНИЕ: два кольца сближаются по прогрессу и сливаются при 100%
   --me, --partner ∈ [0..1]; data-state: apart | near | full
   ========================================================================= */
:root, [data-ring-theme="violet"], .theme-option[data-theme="violet"] { --ring-a: #a78bfa; --ring-b: #e879f9; --corona: #c084fc; }
[data-ring-theme="aurora"], .theme-option[data-theme="aurora"] { --ring-a: #5eead4; --ring-b: #a78bfa; --corona: #5eead4; }
[data-ring-theme="solar"], .theme-option[data-theme="solar"] { --ring-a: #fbbf24; --ring-b: #fb7185; --corona: #f59e0b; }
[data-ring-theme="ice"], .theme-option[data-theme="ice"] { --ring-a: #7dd3fc; --ring-b: #c7d2fe; --corona: #38bdf8; }

.eclipse { display: block; overflow: visible; flex: none; }
.eclipse-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 3; }
.eclipse-arc {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  transform: rotate(-90deg);
  transform-origin: center;
  transform-box: fill-box;
  transition: stroke-dashoffset var(--dur-xslow) var(--ease-out);
}
.eclipse-ring { transition: transform var(--dur-xslow) var(--ease-spring); }
.eclipse-ring--me { transform: translateX(calc(-28px * (1 - var(--me, 0)))); }
.eclipse-ring--partner { transform: translateX(calc(28px * (1 - var(--partner, 0)))); }
.eclipse-ring--me .eclipse-arc { stroke: var(--ring-a); stroke-dashoffset: calc(100 - var(--me, 0) * 100); filter: drop-shadow(0 0 3px var(--ring-a)); }
.eclipse-ring--partner .eclipse-arc { stroke: var(--ring-b); stroke-dashoffset: calc(100 - var(--partner, 0) * 100); filter: drop-shadow(0 0 3px var(--ring-b)); }
.eclipse-disc { fill: #07070b; opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
.eclipse-corona {
  fill: none;
  stroke: var(--corona);
  stroke-width: 7;
  opacity: 0;
  filter: blur(3px) drop-shadow(0 0 10px var(--corona));
  transform-origin: center;
  transform-box: fill-box;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.eclipse[data-state="near"] .eclipse-corona { opacity: 0.25; }
.eclipse[data-state="full"] .eclipse-disc { opacity: 1; }
.eclipse[data-state="full"] .eclipse-corona { opacity: 0.95; animation: corona-pulse 3200ms var(--ease-in-out) infinite alternate; }
.eclipse[data-state="full"] .eclipse-track { stroke: transparent; }
.eclipse--mini { width: 52px; height: 32px; }
.eclipse--pro { width: 220px; height: 132px; margin: 0 auto; }
@media (max-width: 359px) { .header .eclipse--mini { display: none; } }
@keyframes corona-pulse { from { transform: scale(0.97); filter: blur(3px) drop-shadow(0 0 8px var(--corona)); } to { transform: scale(1.04); filter: blur(4px) drop-shadow(0 0 16px var(--corona)); } }

/* =========================================================================
   34 ВХОД И РЕГИСТРАЦИЯ
   ========================================================================= */
.auth-tabs { margin-top: var(--space-6); width: 100%; }
.auth-tabs .segmented-item { flex: 1; }
#register-form { gap: var(--space-4); }
.input--code { text-transform: uppercase; letter-spacing: 0.14em; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.input--code::placeholder { letter-spacing: 0.14em; }

.consent {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  color: var(--text-2);
}
.consent-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.consent-box {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-top: -2px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.consent-box .icon { width: 14px; height: 14px; stroke-width: 2.6; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring); }
.consent-input:checked + .consent-box { background: var(--accent-gradient-btn); border-color: transparent; box-shadow: var(--glow-sm); }
.consent-input:checked + .consent-box .icon { opacity: 1; transform: none; }
.consent-input:focus-visible + .consent-box { box-shadow: var(--focus-ring); }
.consent[data-invalid="true"] .consent-box { border-color: var(--danger); }

/* =========================================================================
   35 ПАРТНЁР: ожидание пары и инвайт-код
   ========================================================================= */
.partner-card[data-state="waiting"] .partner-active,
.partner-card:not([data-state="waiting"]) .partner-waiting { display: none; }
.partner-waiting, .partner-active { display: flex; flex-direction: column; gap: var(--space-3); }
.partner-card-title { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-semibold); }
.partner-waiting-text { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
.invite-code-box {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  background: rgba(139, 92, 246, 0.06);
}
.invite-code {
  font-size: 34px;
  line-height: 42px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: all;
}
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-actions .btn { flex: 1 1 auto; }
.join-form { display: grid; gap: 6px; padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

/* =========================================================================
   36 ТОП ПАР
   ========================================================================= */
.bento--top { display: grid; gap: var(--bento-gap); }
@media (min-width: 1024px) {
  .bento--top { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
  .bento-privacy, .bento-leaderboard { grid-column: 1 / -1; }
}

.privacy-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.privacy-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--accent-900); color: var(--accent-200); box-shadow: var(--glow-sm); }
.privacy-icon .icon { width: 24px; height: 24px; }
.privacy-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); }
.privacy-desc { margin-top: 2px; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
.privacy-card[data-pro="false"] .switch { opacity: 0.6; }
.privacy-card[data-hidden="true"] { border-color: var(--border-strong); box-shadow: var(--shadow-1), var(--glow-sm); }

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}
.podium-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; --medal: #cbd5e1; --base-h: 64px; }
.podium-slot[data-place="1"] { order: 2; --medal: #fbbf24; --base-h: 92px; }
.podium-slot[data-place="2"] { order: 1; --medal: #cbd5e1; --base-h: 72px; }
.podium-slot[data-place="3"] { order: 3; --medal: #d97706; --base-h: 56px; }
.podium-laurel { color: var(--medal); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--medal) 55%, transparent)); }
.podium-laurel .icon { width: 30px; height: 30px; }
.podium-slot[data-place="1"] .podium-laurel .icon { width: 38px; height: 38px; }
.podium-avatars { display: flex; }
.podium-avatars .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface-1); }
.podium-names {
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: var(--fw-semibold);
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.podium-badges, .leader-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.podium-badges:empty, .leader-badges:empty { display: none; }
.podium-streak, .leader-streak { display: inline-flex; align-items: center; gap: 4px; font-weight: var(--fw-bold); color: var(--text-1); }
.podium-streak .icon, .leader-streak .icon { width: 15px; height: 15px; fill: #fb923c; stroke: none; color: #fb923c; }
.podium-base {
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--base-h);
  margin-top: 4px;
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 28%, transparent), rgba(18, 18, 26, 0.6));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--medal) 60%, transparent);
  font-size: 26px;
  font-weight: 800;
  color: var(--medal);
}
.podium-slot[data-me="true"] .podium-names { color: var(--accent-200); }

.my-rank-card { display: grid; gap: 4px; align-content: center; }
.my-rank-value { display: flex; align-items: baseline; gap: 8px; }
#my-rank { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-bold); background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.my-rank-of { color: var(--text-3); font-size: var(--fs-label); }
.my-rank-meta { color: var(--text-2); font-size: var(--fs-label); }
.my-rank-card .pill { justify-self: start; margin-top: 6px; }

.leaderboard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.leaderboard-list { display: grid; gap: 6px; margin-top: var(--space-3); padding: 0; list-style: none; }
.leader-row {
  display: grid;
  grid-template-columns: 28px auto minmax(0, 1fr) auto;
  grid-template-areas: "rank avatars names streak" "rank avatars badges streak";
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.leader-rank { grid-area: rank; color: var(--text-3); font-weight: var(--fw-bold); text-align: center; }
.leader-avatars { grid-area: avatars; display: flex; }
.leader-avatars .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface-2); }
.leader-names { grid-area: names; display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); }
.leader-names-text, .leader-handles { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-badges { grid-area: badges; justify-content: flex-start; }
.leader-streak { grid-area: streak; }
.leader-row:has(.leader-badges:empty) .leader-names { grid-row: 1 / 3; }
.leader-row[data-me="true"] { border-color: var(--border-strong); background: var(--accent-900); box-shadow: var(--glow-sm); }
@media (min-width: 641px) {
  .leader-row { grid-template-columns: 28px auto minmax(0, 1fr) auto auto; grid-template-areas: "rank avatars names badges streak"; }
}
#view-top[data-state="loading"] .bento--top { opacity: 0.6; }

/* =========================================================================
   37 ECLIPSE PRO
   ========================================================================= */
.dialog--pro .dialog-head { justify-content: space-between; }
.pro-hero { margin: -4px 0 -8px; }
.pro-title { text-align: center; font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); text-wrap: balance; }
.pro-sub { text-align: center; color: var(--text-2); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.pro-benefits { display: grid; gap: 10px; padding: 0; list-style: none; }
.pro-benefit { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; }
.pro-benefit-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.25), rgba(99, 102, 241, 0.25));
  box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.35);
  color: var(--accent-200);
}
.pro-benefit-icon .icon { width: 20px; height: 20px; }
.pro-benefit-title { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-semibold); }
.pro-benefit-text { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.pro-offer { display: grid; gap: 10px; }
.pro-plans .segmented-item { flex: 1; }
.pro-plans .plan { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: auto; min-height: 60px; padding: 8px 6px; white-space: nowrap; }
.plan-name { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); color: var(--text-2); }
.plan-price { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-bold); color: var(--text-1); }
.pro-save { display: inline-block; padding: 0 6px; line-height: 16px; border-radius: 9999px; background: var(--success-bg); color: var(--success); font-size: 11px; font-weight: var(--fw-bold); }
.pro-price-note { text-align: center; font-size: var(--fs-label); color: var(--text-3); }
.btn--pro {
  border-radius: 9999px;
  border-color: transparent;
  background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%);
  color: #fff;
  font-weight: var(--fw-semibold);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 6px 20px rgba(124, 58, 237, 0.45);
}
@media (hover: hover) and (pointer: fine) { .btn--pro:hover:not(:disabled) { filter: brightness(1.08); } }
.dialog--pro[data-state="offer"] .pro-active-state,
.dialog--pro[data-state="forever"] .pro-offer { display: none; }  /* вечный PRO продлевать не нужно */
.pro-active-state { display: grid; gap: 6px; text-align: center; }
.pro-active-text { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--accent-200); }

/* =========================================================================
   38 НАСТРОЙКИ 3.0: Telegram, владелец, профиль, пара, темы колец
   ========================================================================= */
.settings-section-title--icon { display: flex; align-items: center; gap: 8px; }
.settings-section-title--icon .icon { width: 18px; height: 18px; color: var(--accent-300); }
.settings-text { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
.icon--telegram { fill: #29a9eb; stroke: none; }
.settings-section-title--icon .icon--telegram { color: #29a9eb; }

.status-pill[data-status="linked"] { color: var(--success); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.4); }
.status-pill[data-status="linking"] { color: var(--accent-300); }

#settings-telegram .tg-off-text,
#settings-telegram .tg-unconfigured-text,
#settings-telegram .tg-connect,
#settings-telegram .tg-link-panel,
#settings-telegram .tg-linked-actions { display: none; }
#settings-telegram[data-state="off"] .tg-off-text { display: block; }
#settings-telegram[data-state="off"] .tg-connect { display: inline-flex; }
#settings-telegram[data-state="unconfigured"] .tg-unconfigured-text { display: block; }
#settings-telegram[data-state="linking"] .tg-link-panel { display: grid; }
#settings-telegram[data-state="linked"] .tg-linked-actions { display: flex; }
.tg-link-panel { gap: 10px; }
.tg-linked-actions { flex-wrap: wrap; gap: 8px; }
.btn--telegram { border-radius: 9999px; background: #229ed9; border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(34, 158, 217, 0.35); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .btn--telegram:hover { filter: brightness(1.08); } }
.tg-waiting { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); color: var(--text-2); }

.settings-section--owner { border-color: rgba(255, 107, 43, 0.35); background: linear-gradient(180deg, rgba(255, 107, 43, 0.06), var(--surface-2) 40%); }
.owner-form { display: grid; gap: 8px; }
.owner-form > *, .settings-section > * { min-width: 0; }
.owner-form .settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.profile-form, .password-form { display: grid; gap: var(--space-3); }
.password-form { padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.profile-form .btn, .password-form .btn { justify-self: start; }

.theme-fieldset { margin-top: 4px; }
.theme-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-option { position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--border-subtle); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.theme-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.theme-swatch { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(from 200deg, var(--ring-a), var(--ring-b), var(--ring-a)); box-shadow: 0 0 12px color-mix(in srgb, var(--corona) 50%, transparent); }
.theme-name { font-size: var(--fs-caption); color: var(--text-2); }
.theme-lock { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; color: var(--text-3); }
.theme-option:has(input:checked) { border-color: var(--accent-300); box-shadow: var(--glow-sm); }
.theme-option:has(input:focus-visible) { box-shadow: var(--focus-ring); }
#settings-couple[data-pro="true"] .theme-lock { display: none; }
#settings-couple[data-pro="false"] .theme-option[data-pro-only="true"] { opacity: 0.75; }
.couple-leave { display: grid; gap: 8px; padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
#settings-couple[data-paired="false"] .couple-leave { display: none; }
.settings-links { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: var(--fs-label); color: var(--text-3); }

/* =========================================================================
   39 ДОКУМЕНТЫ (соглашение и политика)
   ========================================================================= */
.legal-tabs .segmented-item { flex: 1; }
.legal-doc {
  max-height: min(56dvh, 520px);
  overflow-y: auto;
  padding-right: 6px;
  font-size: var(--fs-label);
  line-height: 21px;
  color: var(--text-2);
}
.legal-doc h3 { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); color: var(--text-1); }
.legal-doc h4 { margin-top: 14px; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-1); }
.legal-doc p, .legal-doc ul { margin-top: 6px; }
.legal-doc ul { padding-left: 18px; }
.legal-doc li + li { margin-top: 4px; }
.legal-meta { color: var(--text-3); font-size: var(--fs-caption); }
.legal-placeholder { padding: 0 4px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); }

/* =========================================================================
   40 COOKIE-БАННЕР
   ========================================================================= */
.cookie-banner {
  position: fixed;
  z-index: var(--z-toast);
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  width: min(560px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-3);
  transform: translateX(-50%);
  animation: cookie-in var(--dur-slow) var(--ease-spring) both;
}
body:has(#app-shell:not([hidden])) .cookie-banner { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }
@media (min-width: 1024px) { body:has(#app-shell:not([hidden])) .cookie-banner { bottom: calc(24px + var(--safe-bottom)); } }
.cookie-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-900); color: var(--accent-300); }
.cookie-icon .icon { width: 20px; height: 20px; }
.cookie-text { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); }
@keyframes cookie-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* =========================================================================
   41 МЕЛКИЕ ПОМОЩНИКИ
   ========================================================================= */
.link-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent-300);
  text-decoration: underline;
  text-decoration-color: rgba(192, 132, 252, 0.45);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn:focus-visible { outline: none; border-radius: 4px; box-shadow: var(--focus-ring); }
.code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--accent-200);
  overflow-wrap: anywhere;
}
.code-row { display: flex; align-items: center; gap: 6px; }
.code-row .code { flex: 1; padding: 10px 12px; font-size: 13px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4b2c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}
.select option { background: var(--surface-2); color: var(--text-1); }
.field-label--icon { display: flex; align-items: center; gap: 6px; }
.field-label--icon .icon { width: 15px; height: 15px; color: var(--accent-300); }
.spinner--sm { width: 14px; height: 14px; border-width: 2px; }
.icon--coin { width: 16px; height: 16px; color: var(--coin); }
.numbers-coins { display: inline-flex; align-items: center; gap: 6px; }
.limit-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--space-3); font-size: var(--fs-label); color: var(--text-3); }
.limit-note .icon { width: 14px; height: 14px; }

/* =========================================================================
   42 ЛЕНДИНГ (гость): навбар, hero, возможности, промо, тарифы, футер
   ========================================================================= */
.landing { min-height: 100dvh; display: flex; flex-direction: column; }
.landing-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: calc(var(--safe-top) + 10px) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}
.landing-brand { text-decoration: none; }
.landing-links { display: none; flex: 1; justify-content: center; gap: 4px; }
.landing-link {
  padding: 8px 12px;
  border-radius: 9999px;
  color: var(--text-2);
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.landing-link:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.05); }
.landing-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.landing-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 900px) { .landing-links { display: flex; } .landing-actions { margin-left: 0; } }
@media (max-width: 380px) { .landing-nav .brand-word { display: none; } }

.landing-main { width: min(1120px, 100% - 32px); margin: 0 auto; flex: 1; }
.landing-hero {
  display: grid;
  gap: 32px;
  align-items: center;
  padding: clamp(40px, 9vw, 96px) 0 clamp(40px, 7vw, 72px);
}
@media (min-width: 960px) { .landing-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.hero-copy { display: grid; gap: 18px; justify-items: start; }
.hero-title {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero-accent {
  background: linear-gradient(120deg, #c084fc 0%, #8b5cf6 45%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { max-width: 52ch; color: var(--text-2); font-size: var(--fs-body); line-height: 26px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta { min-height: 52px; padding: 0 22px; font-size: var(--fs-body-sm); }
.hero-points { display: grid; gap: 8px; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-label); }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points .icon { width: 16px; height: 16px; color: var(--success); stroke-width: 2.2; }
/* Сцена героя: орбиты-восьмёрки (SVG + SMIL, цикл 7 с, встреча на 50%) и карточки, которые script.js
   перезапускает в начале каждого цикла классом .is-cycle — поэтому они не расходятся с анимацией SVG. */
.hero-visual { --cycle: 7s; position: relative; width: min(500px, 100%); margin-inline: auto; aspect-ratio: 440 / 360; }
.orbit-scene { position: absolute; inset: 4% 0 6%; width: 100%; height: 90%; overflow: visible; }
.orbit-stars circle { fill: #fff; animation: orbit-twinkle 3.6s ease-in-out infinite alternate; }
.orbit-stars circle:nth-child(3n) { animation-delay: -1.2s; animation-duration: 4.4s; }
.orbit-stars circle:nth-child(3n + 1) { animation-delay: -2.5s; animation-duration: 2.8s; }
@keyframes orbit-twinkle { from { opacity: 0.15; } to { opacity: 0.85; } }
.orbit-dial { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; stroke-dasharray: 1 5; transform-box: fill-box; transform-origin: center; animation: orbit-spin 90s linear infinite; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.orbit-track { fill: none; stroke: rgba(196, 181, 253, 0.16); stroke-width: 1; stroke-dasharray: 0.6 1.4; }
.orbit-ghost { fill: none; stroke: rgba(196, 181, 253, 0.18); stroke-width: 1.5; }
.orbit-trail { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 16 84; opacity: 0.85; }
.orbit-trail--me { stroke: #a78bfa; filter: drop-shadow(0 0 4px #8b5cf6); }
.orbit-trail--partner { stroke: #e879f9; filter: drop-shadow(0 0 4px #d946ef); }
.orbit-diamond { transform-box: fill-box; transform-origin: center; animation: orbit-sparkle 1.6s ease-in-out infinite alternate; }
@keyframes orbit-sparkle { from { transform: scale(0.6) rotate(0deg); opacity: 0.6; } to { transform: scale(1.25) rotate(45deg); opacity: 1; } }

.hero-card, .hero-toast {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: var(--fs-label);
  color: var(--text-2);
}
.hero-card { padding: 10px 14px 10px 10px; border-radius: 16px; animation: hero-bob 6s ease-in-out infinite alternate; }
.hero-card .num, .hero-toast .num { color: var(--text-1); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.hero-card-body { display: grid; gap: 3px; min-width: 0; }
.hero-card-label { color: var(--text-3); font-size: 11px; line-height: 14px; }
.hero-card-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; }
.hero-card-icon .icon { width: 18px; height: 18px; }
.hero-card-icon--flame { color: #fb923c; background: rgba(251, 146, 60, 0.14); box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.28); }
.hero-card-icon--flame .icon { fill: #fb923c; stroke: none; }
.hero-card-icon--habit { color: #6ee7b7; background: rgba(52, 211, 153, 0.13); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.26); }
@keyframes hero-bob { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

.hero-card--streak { top: 0; left: 0; }
.hero-flip { position: relative; height: 20px; overflow: hidden; color: var(--text-2); font-size: 14px; line-height: 20px; }
.hero-flip > span { display: block; white-space: nowrap; }
.hero-flip-to { position: absolute; inset: 0; transform: translateY(100%); opacity: 0; }
.hero-week { display: flex; gap: 4px; margin-top: 2px; }
.hero-week i { width: 8px; height: 8px; border-radius: 3px; background: linear-gradient(135deg, #a78bfa, #e879f9); }
.hero-week i.hero-week-today { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }

.hero-card--habit { bottom: 0; left: 4%; animation-delay: -3s; }
.hero-habit-name { color: var(--text-1); font-weight: var(--fw-semibold, 600); font-size: 13px; line-height: 18px; white-space: nowrap; }
.hero-people { display: flex; margin-left: 4px; }
.hero-person {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: #fff;
  box-shadow: 0 0 0 2px #121218;
}
.hero-person + .hero-person { margin-left: 6px; }
.hero-person--me { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.hero-person--partner { background: linear-gradient(135deg, #d946ef, #ec4899); }
.hero-person .icon {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  padding: 2px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  stroke-width: 3.5;
  box-shadow: 0 0 0 2px #121218;
  transform: scale(0);
}

.hero-toast { right: 0; bottom: 24%; padding: 8px 14px; border-radius: 9999px; opacity: 0; transform: translateY(8px) scale(0.92); }
.hero-toast .icon { width: 16px; height: 16px; }

/* Цикл: отметка «А» на 18%, «М» на 34%, встреча на 50% — серия +1, сегодняшний день закрашен, монеты; к 96% всё сбрасывается. */
.hero-visual.is-cycle .hero-person--me .icon { animation: hero-check var(--cycle) linear forwards; }
.hero-visual.is-cycle .hero-person--partner .icon { animation: hero-check-late var(--cycle) linear forwards; }
.hero-visual.is-cycle .hero-flip-from { animation: hero-flip-out var(--cycle) linear forwards; }
.hero-visual.is-cycle .hero-flip-to { animation: hero-flip-in var(--cycle) linear forwards; }
.hero-visual.is-cycle .hero-week-today { animation: hero-today var(--cycle) linear forwards; }
.hero-visual.is-cycle .hero-toast { animation: hero-toast var(--cycle) linear forwards; }
@keyframes hero-check { 0%, 17% { transform: scale(0); } 20% { transform: scale(1.25); } 22%, 92% { transform: scale(1); } 96%, 100% { transform: scale(0); } }
@keyframes hero-check-late { 0%, 33% { transform: scale(0); } 36% { transform: scale(1.25); } 38%, 92% { transform: scale(1); } 96%, 100% { transform: scale(0); } }
@keyframes hero-flip-out { 0%, 50% { transform: translateY(0); opacity: 1; } 55%, 93% { transform: translateY(-100%); opacity: 0; } 97%, 100% { transform: translateY(0); opacity: 1; } }
@keyframes hero-flip-in { 0%, 50% { transform: translateY(100%); opacity: 0; } 55%, 92% { transform: translateY(0); opacity: 1; } 96%, 100% { transform: translateY(0); opacity: 0; } }
@keyframes hero-today {
  0%, 50% { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
  53% { background: #fff; box-shadow: 0 0 10px #e879f9; }
  58%, 92% { background: linear-gradient(135deg, #a78bfa, #e879f9); box-shadow: 0 0 6px rgba(232, 121, 249, 0.6); }
  96%, 100% { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
}
@keyframes hero-toast {
  0%, 50% { opacity: 0; transform: translateY(8px) scale(0.92); }
  54% { opacity: 1; transform: translateY(-2px) scale(1.04); }
  57%, 84% { opacity: 1; transform: translateY(0) scale(1); }
  90%, 100% { opacity: 0; transform: translateY(-6px) scale(0.98); }
}
/* Без анимации — итоговый кадр: обе отметки, 42 дня, монеты. */
.hero-visual.is-static .hero-person .icon { transform: scale(1); }
.hero-visual.is-static .hero-flip-from { opacity: 0; }
.hero-visual.is-static .hero-flip-to { transform: none; opacity: 1; }
.hero-visual.is-static .hero-week-today { background: linear-gradient(135deg, #a78bfa, #e879f9); }
.hero-visual.is-static .hero-toast { opacity: 1; transform: none; }

@media (max-width: 480px) {
  .hero-card, .hero-toast { font-size: 12px; }
  .hero-card { gap: 8px; padding: 8px 10px 8px 8px; border-radius: 14px; }
  .hero-card-icon { width: 28px; height: 28px; border-radius: 9px; }
  .hero-card-icon .icon { width: 15px; height: 15px; }
  .hero-habit-name { font-size: 12px; }
  .hero-person { width: 24px; height: 24px; font-size: 10px; }
  .hero-card--habit { left: 0; }
  .hero-toast { bottom: 22%; }
}

.landing-section { padding: clamp(40px, 7vw, 80px) 0; border-top: 1px solid var(--border-subtle); scroll-margin-top: 72px; }
.landing-eyebrow { color: var(--accent-300); }
.landing-h2 { margin-top: 8px; font-size: clamp(28px, 4.5vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.landing-text { margin-top: 12px; max-width: 52ch; color: var(--text-2); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }

.feature-bento { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 720px) { .feature-bento { grid-template-columns: repeat(3, minmax(0, 1fr)); } .feature-card--wide { grid-column: span 2; } }
.feature-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.08), rgba(18, 18, 26, 0.85) 45%);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-900); color: var(--accent-200); box-shadow: var(--glow-sm); }
.feature-icon .icon { width: 22px; height: 22px; }
.feature-card:first-child .feature-icon .icon { fill: #fb923c; stroke: none; color: #fb923c; }
.feature-icon--coin { color: var(--coin); }
.feature-icon--tg .icon { fill: #29a9eb; stroke: none; }
.feature-title { font-size: var(--fs-title-sm); line-height: var(--lh-title-sm); font-weight: var(--fw-semibold); }
.feature-text { color: var(--text-2); font-size: var(--fs-label); line-height: 20px; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.feature-heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; max-width: 380px; margin-top: 6px; }
.feature-heat i { aspect-ratio: 1; border-radius: 4px; background: var(--heat-0); }
.feature-heat i[data-level="1"] { background: var(--heat-1); }
.feature-heat i[data-level="2"] { background: var(--heat-2); }
.feature-heat i[data-level="3"] { background: var(--heat-3); box-shadow: var(--heat-3-glow); }

.landing-split { display: grid; gap: 24px; align-items: center; }
@media (min-width: 860px) {
  .landing-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .landing-split--rev > :first-child { order: 2; }
}
.promo-rewards { display: grid; gap: 10px; padding: 0; list-style: none; }
.promo-reward {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  font-weight: var(--fw-semibold);
}
.promo-reward .reward-icon { width: 44px; height: 44px; }
.promo-reward .reward-icon .icon { width: 22px; height: 22px; }
.promo-cost { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: var(--fw-bold); }
.promo-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); }
.promo-place { display: grid; justify-items: center; gap: 6px; padding-top: 12px; border-radius: 14px 14px 6px 6px; color: var(--medal); background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 25%, transparent), transparent); font-size: 24px; font-weight: 800; }
.promo-place .icon { width: 32px; height: 32px; }
.promo-place--1 { --medal: #fbbf24; height: 160px; }
.promo-place--2 { --medal: #cbd5e1; height: 124px; }
.promo-place--3 { --medal: #d97706; height: 100px; }

/* Тарифы: оформление — в разделе 67. */

.landing-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  width: min(1120px, 100% - 32px);
  margin: 24px auto 0;
  padding: 24px 0 calc(24px + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  color: var(--text-3);
  font-size: var(--fs-label);
}
.landing-footer-brand { display: flex; align-items: center; gap: 10px; }
.landing-footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.landing-footer .link-btn { color: var(--text-2); text-decoration-color: transparent; }
.landing-footer .link-btn:hover { color: var(--text-1); text-decoration-color: currentColor; }
body:has(#landing:not([hidden])) .cookie-banner { bottom: calc(16px + var(--safe-bottom)); }

/* =========================================================================
   43 ОКНО ВХОДА И РЕГИСТРАЦИИ
   ========================================================================= */
.dialog--auth { max-width: 460px; }
.dialog-head--auth { align-items: flex-start; }
.dialog--auth .brand--auth { flex-direction: row; width: auto; font-size: var(--fs-title-sm); gap: 12px; }
.brand-logo--md { width: 52px; height: 52px; }
.dialog--auth .auth-title { margin-top: 0; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.dialog--auth .auth-tabs { margin-top: 0; }
.dialog--auth .auth-form { margin-top: 0; }
.dialog--auth .auth-note { margin-top: 0; }

/* =========================================================================
   44 ВЫБОР ПОЛА
   ========================================================================= */
.gender-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gender-option { position: relative; display: grid; cursor: pointer; --g: #6366f1; }
.gender-option[data-gender="female"] { --g: #d946ef; }
.gender-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.gender-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.gender-card .icon { width: 22px; height: 22px; color: var(--g); stroke-width: 2; }
.gender-option input:checked + .gender-card {
  color: var(--text-1);
  border-color: var(--g);
  background: color-mix(in srgb, var(--g) 14%, var(--surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--g) 50%, transparent), 0 0 18px color-mix(in srgb, var(--g) 35%, transparent);
}
.gender-option input:focus-visible + .gender-card { box-shadow: var(--focus-ring); }
.gender-option:active .gender-card { transform: scale(0.97); }
#gender-dialog .gender-picker { margin-top: 4px; }

/* =========================================================================
   45 ЦВЕТ ЛИЧНЫХ КОЛЕЦ ПО ПОЛУ (тема Violet; PRO-темы задают свои цвета)
   ========================================================================= */
#app-shell[data-ring-theme="violet"][data-me-gender="male"] { --ring-a: #6366f1; }
#app-shell[data-ring-theme="violet"][data-me-gender="female"] { --ring-a: #d946ef; }
#app-shell[data-ring-theme="violet"][data-partner-gender="male"] { --ring-b: #6366f1; }
#app-shell[data-ring-theme="violet"][data-partner-gender="female"] { --ring-b: #d946ef; }
#app-shell[data-me-gender="male"] .bar--me .bar-fill { background: linear-gradient(90deg, #4f46e5, #818cf8); }
#app-shell[data-me-gender="female"] .bar--me .bar-fill { background: linear-gradient(90deg, #c026d3, #e879f9); }
#app-shell[data-partner-gender="male"] .bar--partner .bar-fill { background: linear-gradient(90deg, #4f46e5, #818cf8); }
#app-shell[data-partner-gender="female"] .bar--partner .bar-fill { background: linear-gradient(90deg, #c026d3, #e879f9); }

/* =========================================================================
   46 «ВМЕСТЕ N ДНЕЙ», НИКНЕЙМ, ДАТА ПАРЫ, КАРТОЧКА ПАРЫ
   ========================================================================= */
.pill--together .pill-icon { color: #f472b6; }
@media (max-width: 639px) { .header .pill--together { padding: 4px 9px; } .header .pill--together #together-text { font-size: 11px; } }
@media (max-width: 559px) { .header .pill--together { display: none; } }

.input-prefix { position: relative; }
.input-prefix-sign { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: var(--fw-semibold); pointer-events: none; }
.input-prefix .input { padding-left: 32px; }

.anniversary-form { display: grid; gap: 6px; }
input[type="date"].input { color-scheme: dark; }

.dialog--share { max-width: 520px; }
.share-stage { display: grid; place-items: center; padding: 8px; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--border-subtle); }
.share-canvas { display: block; width: min(100%, 360px); height: auto; aspect-ratio: 1080 / 1350; border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
#share-download { text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .orbit-stars circle, .orbit-dial, .orbit-diamond, .hero-card { animation: none !important; }
}

/* =========================================================================
   47 ADMIN CONTROL CENTER И ПРОМОКОД (только SVG и капсулы, без эмодзи)
   ========================================================================= */
.dialog--admin { width: min(960px, calc(100vw - 32px)); }
.admin-title { display: flex; align-items: center; gap: 10px; }
.admin-title-icon { width: 22px; height: 22px; color: #ff6b2b; flex: none; }

.admin-tabs { overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; flex: 1 0 auto; }
.admin-tab .icon { width: 16px; height: 16px; flex: none; }
@media (max-width: 520px) { .admin-tab span { display: none; } .admin-tab { min-width: 52px; } }

.admin-panel { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 641px) { .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.admin-stat { min-height: 104px; }
#admin-stat-tile-banned .stat-icon { color: var(--danger); }
#admin-stat-tile-pro .stat-icon { color: #a855f7; }

.admin-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.admin-empty { text-align: center; padding: var(--space-4) 0; }
.admin-diag[data-result="ok"] { color: var(--success); }
.admin-diag[data-result="fail"] { color: var(--danger); }

/* Поиск */
.admin-search { position: relative; }
.admin-search-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.admin-search-input { padding-left: 42px; }

/* Пользователи */
.admin-user-list, .admin-promo-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.admin-user {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  min-width: 0;
}
.admin-user[data-banned="true"] { border-color: var(--border-danger); background: linear-gradient(0deg, var(--danger-bg), var(--danger-bg)), var(--surface-1); }
.admin-user-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-user-avatar { width: 40px; height: 40px; flex: none; }
.admin-user-id { flex: 1; min-width: 0; }
.admin-user-name { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-login, .admin-user-email { color: var(--text-3); font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-regular); }
.admin-user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-user-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
@media (min-width: 641px) { .admin-user-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.admin-user-meta dt { color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.admin-user-meta dd { margin: 0; font-size: var(--fs-label); line-height: var(--lh-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-action { min-height: 32px; }
.admin-action[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.admin-user[data-pro="true"] .admin-action[data-action="pro"] { box-shadow: inset 0 0 0 1px rgba(147, 51, 234, 0.7); color: #d8b4fe; }
.admin-user[data-hidden="true"] .admin-action[data-action="top"] { color: var(--accent-200); box-shadow: inset 0 0 0 1px var(--border-strong); }
.admin-action--danger { color: #fca5a5; box-shadow: inset 0 0 0 1px var(--border-danger); }
.admin-user[data-banned="true"] .admin-action--danger { color: var(--success); box-shadow: inset 0 0 0 1px var(--border-success); }
.admin-user[data-owner="true"] .admin-action--danger,
.admin-user[data-owner="true"] .admin-action[data-action="reset"] { display: none; }
.admin-user-result { padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); overflow-wrap: anywhere; }
.admin-user-result[data-result="fail"] { color: var(--danger); }
.admin-user-result code { color: var(--text-1); font-weight: var(--fw-semibold); user-select: all; }

.pill--danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* Промокоды */
.admin-promo-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .admin-promo-row { grid-template-columns: 1.4fr 1fr 1fr; } }
.admin-promo-form .btn { align-self: flex-start; }
.admin-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.admin-promo[data-active="false"] { opacity: 0.55; }
.admin-promo-icon { width: 20px; height: 20px; color: var(--accent-300); flex: none; }
.admin-promo-main { flex: 1; min-width: 0; }
.admin-promo-code { font-weight: var(--fw-bold); letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; }
.admin-promo-meta { color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.admin-promo-toggle { min-height: 36px; }
@media (max-width: 420px) { .admin-promo { flex-wrap: wrap; } .admin-promo-toggle { margin-left: auto; } }

.admin-broadcast-text { min-height: 112px; max-height: 240px; }
#admin-broadcast-form .btn { align-self: flex-start; }

/* Промокод в настройках пользователя */
.promo-row { display: flex; align-items: center; gap: 10px; }
.promo-row .input { flex: 1; min-width: 0; }
.promo-submit { min-height: 36px; }
#promo-result[data-result="ok"] { color: var(--success); }
#promo-result[data-result="fail"] { color: var(--danger); }
/* Линейные иконки (ключ, запрет) внутри капсул: обводка вместо заливки */
.admin-action[data-action="reset"] .pill-icon,
.admin-action[data-action="ban"] .pill-icon,
.pill--danger .pill-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) {
  .admin-user-head { flex-wrap: wrap; }
  .admin-user-badges { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .admin-user-badges:empty { display: none; }
}

/* =========================================================================
   48 ПОДТВЕРЖДЕНИЕ ПОЧТЫ, ВОССТАНОВЛЕНИЕ ПАРОЛЯ, SMTP
   ========================================================================= */
.dialog--auth:is([data-tab="verify"], [data-tab="forgot"], [data-tab="reset"]) :is(.auth-tabs, .auth-title, .auth-note) { display: none; }
.auth-step { justify-items: center; text-align: center; animation: auth-step-in var(--dur-slow) var(--ease-spring-soft) both; }
.auth-step .field, .auth-step .btn--block, .auth-step .form-error { justify-self: stretch; text-align: left; }
@keyframes auth-step-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-step { animation: none; } }
.auth-step-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.28), rgba(99, 102, 241, 0.22));
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--glow-sm);
  color: var(--accent-200);
}
.auth-step-icon .icon { width: 26px; height: 26px; }
.auth-step-title { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.auth-step-text { color: var(--text-2); max-width: 34ch; margin-top: -8px; }
.auth-step-email { color: var(--text-1); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.auth-link { justify-self: center; margin-top: -6px; }
#login-form .auth-link { margin-top: -4px; }

/* 6 ячеек кода */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 360px; }
.otp-cell {
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 26px;
  font-weight: var(--fw-bold);
  border-radius: 16px;
  caret-color: var(--accent-400);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.otp-cell:nth-child(3) { margin-right: 6px; }
.otp-cell:focus { border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28), var(--glow-sm); transform: translateY(-1px); }
.otp-cell.is-filled { border-color: var(--border-strong); background: var(--surface-3); }
.otp[data-state="error"] .otp-cell { border-color: var(--border-danger); animation: otp-shake 360ms var(--ease-out); }
.otp[data-state="success"] .otp-cell { border-color: var(--border-success); box-shadow: var(--glow-success); }
@keyframes otp-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (max-width: 380px) { .otp { gap: 6px; } .otp-cell { height: 50px; font-size: 22px; border-radius: 13px; } }
.otp-resend:disabled { color: var(--text-3); text-decoration: none; cursor: default; }

/* Тех-бейдж режима разработки */
.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: rgba(251, 191, 36, 0.08);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35);
  color: #fcd34d;
  font-size: 12px;
  line-height: 16px;
  text-align: left;
}
.dev-badge .icon { width: 16px; height: 16px; flex: none; }
.dev-badge code { font-weight: var(--fw-bold); letter-spacing: 0.18em; color: #fff; user-select: all; }

/* SMTP в админке */
.smtp-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.smtp-presets .pill[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--border-strong), var(--glow-sm); color: var(--accent-200); }
.smtp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
#gender-later[hidden] + #gender-save { flex: 1; grid-column: 1 / -1; }

/* =========================================================================
   49 НАБОР ИКОНОК: КАТЕГОРИИ ПИКЕРА, SPICY 18+, ШАБЛОНЫ НАГРАД
   ========================================================================= */
.icon-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; padding: 2px; }
.icon-cats::-webkit-scrollbar { display: none; }
.icon-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 600 13px/18px var(--font-sans);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.icon-cat:hover { color: var(--text-1); }
.icon-cat[aria-selected="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-strong), var(--glow-sm); }
.icon-cat:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.icon-cat--spicy[aria-selected="true"] { color: #fbcfe8; box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.6), 0 0 16px rgba(236, 72, 153, 0.35); }
.pill--spicy {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 10px rgba(236, 72, 153, 0.4);
}

.icon-picker { display: block; }
.icon-pane { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; animation: icon-pane-in var(--dur-base) var(--ease-out); }
@keyframes icon-pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .icon-pane { animation: none; } }
.icon-option:hover > .icon { border-color: var(--border-default); color: var(--text-1); }

/* Spicy 18+: малиново-неоновый акцент */
.icon-pane[data-cat="spicy"] .icon-option > .icon { color: #f9a8d4; }
.icon-pane[data-cat="spicy"] .icon-option:hover > .icon {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(147, 51, 234, 0.18));
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.35);
  color: #fbcfe8;
}
.icon-pane[data-cat="spicy"] .icon-option input:checked + .icon {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.34), rgba(244, 63, 94, 0.24));
  border-color: #ec4899;
  color: #fff;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}

/* Быстрые шаблоны наград */
.reward-templates { display: grid; gap: 8px; min-width: 0; }
.reward-templates-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
.reward-templates-row::-webkit-scrollbar { display: none; }
.reward-template { min-height: 34px; }
.reward-template--spicy { color: #fbcfe8; box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.45), 0 0 14px rgba(236, 72, 153, 0.16); }
.reward-template--spicy:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(147, 51, 234, 0.2));
  box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.7), 0 0 18px rgba(236, 72, 153, 0.35);
}

/* =========================================================================
   50 МАРШРУТ ДО TELEGRAM: ПРОКСИ, ПРЕСЕТЫ, АВТО-ПОИСК
   ========================================================================= */
.tg-route { padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.tg-route .settings-section-head { align-items: center; }
.tg-route-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#admin-route-status[data-status="linked"] { color: var(--success); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.4); }
@media (max-width: 420px) { .tg-route-row { grid-template-columns: 1fr; } }

/* =========================================================================
   51 ТЕМЫ ОФОРМЛЕНИЯ (html[data-theme]) И СВОЙ АВАТАР
   Obsidian — базовые токены :root. Темы переопределяют только палитру.
   ========================================================================= */
:root[data-theme="cyberpunk"] {
  --surface-0: #06060c;
  --surface-1: #0b0d18;
  --surface-2: #121528;
  --surface-3: #1a1e36;
  --glass-bg: rgba(11, 13, 24, 0.72);
  --glass-bg-strong: rgba(8, 9, 18, 0.86);
  --border-default: rgba(59, 130, 246, 0.22);
  --border-strong: rgba(236, 72, 153, 0.45);
  --accent-100: #dbeafe;
  --accent-200: #bfdbfe;
  --accent-300: #f472b6;
  --accent-400: #60a5fa;
  --accent-500: #3b82f6;
  --accent-600: #2563eb;
  --accent-700: #1d4ed8;
  --accent-900: #16213f;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #ec4899 100%);
  --accent-gradient-btn: linear-gradient(180deg, #2563eb 0%, #db2777 100%);
  --glow-sm: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 0 16px rgba(236, 72, 153, 0.22);
  --glow-md: 0 0 0 1px rgba(59, 130, 246, 0.45), 0 0 28px rgba(236, 72, 153, 0.3);
  --glow-lg: 0 0 0 1px rgba(236, 72, 153, 0.55), 0 0 48px rgba(59, 130, 246, 0.4);
  --heat-1: #1e3a8a;
  --heat-2: #3b82f6;
  --heat-3: linear-gradient(135deg, #3b82f6, #ec4899);
  --heat-3-glow: 0 0 8px rgba(236, 72, 153, 0.6);
  --tone-violet: #60a5fa;
  --tone-violet-bg: rgba(59, 130, 246, 0.16);
}
:root[data-theme="rose"] {
  --surface-0: #141215;
  --surface-1: #1c191d;
  --surface-2: #252126;
  --surface-3: #2f2a30;
  --glass-bg: rgba(28, 25, 29, 0.74);
  --glass-bg-strong: rgba(22, 20, 23, 0.88);
  --border-default: rgba(244, 63, 94, 0.2);
  --border-strong: rgba(192, 132, 252, 0.45);
  --accent-100: #ffe4e6;
  --accent-200: #fecdd3;
  --accent-300: #c084fc;
  --accent-400: #fb7185;
  --accent-500: #f43f5e;
  --accent-600: #e11d48;
  --accent-700: #be123c;
  --accent-900: #3a1a25;
  --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #c084fc 100%);
  --accent-gradient-btn: linear-gradient(180deg, #e11d48 0%, #a855f7 100%);
  --glow-sm: 0 0 0 1px rgba(244, 63, 94, 0.35), 0 0 16px rgba(192, 132, 252, 0.22);
  --glow-md: 0 0 0 1px rgba(244, 63, 94, 0.45), 0 0 28px rgba(192, 132, 252, 0.3);
  --glow-lg: 0 0 0 1px rgba(192, 132, 252, 0.55), 0 0 48px rgba(244, 63, 94, 0.4);
  --heat-1: #5b2333;
  --heat-2: #f43f5e;
  --heat-3: linear-gradient(135deg, #f43f5e, #c084fc);
  --heat-3-glow: 0 0 8px rgba(244, 63, 94, 0.6);
  --tone-violet: #fb7185;
  --tone-violet-bg: rgba(244, 63, 94, 0.16);
}
body { transition: background-color var(--dur-slow) var(--ease-out); }
@media (max-width: 420px) { .header .header-theme { display: none; } }

/* Свой аватар поверх SVG-пресета: <image class="avatar-photo"> внутри того же <svg> */
.avatar-photo { clip-path: circle(50%); }
.avatar-upload { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.avatar-upload-preview { width: 72px; height: 72px; flex: none; border-radius: 50%; box-shadow: var(--glow-sm); }
.avatar-upload-actions { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.avatar-upload-actions label.btn { cursor: pointer; }
.avatar-upload[aria-busy="true"] .avatar-upload-preview { opacity: 0.55; }

/* Карточки тем */
.ui-theme-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .ui-theme-picker { grid-template-columns: 1fr; } }
.ui-theme-option { position: relative; display: grid; cursor: pointer; }
.ui-theme-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ui-theme-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.ui-theme-option:hover .ui-theme-card { border-color: var(--border-default); }
.ui-theme-option input:checked + .ui-theme-card { border-color: var(--accent-400); box-shadow: var(--glow-sm); }
.ui-theme-option input:focus-visible + .ui-theme-card { box-shadow: var(--focus-ring); }
.ui-theme-option:active .ui-theme-card { transform: scale(0.98); }
.ui-theme-swatch { display: flex; gap: 6px; }
.ui-theme-swatch i { width: 18px; height: 18px; border-radius: 9999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
[data-ui-theme="obsidian"] .ui-theme-swatch i:nth-child(1) { background: #0a0a0f; }
[data-ui-theme="obsidian"] .ui-theme-swatch i:nth-child(2) { background: #8b5cf6; }
[data-ui-theme="obsidian"] .ui-theme-swatch i:nth-child(3) { background: #c084fc; }
[data-ui-theme="cyberpunk"] .ui-theme-swatch i:nth-child(1) { background: #06060c; }
[data-ui-theme="cyberpunk"] .ui-theme-swatch i:nth-child(2) { background: #3b82f6; }
[data-ui-theme="cyberpunk"] .ui-theme-swatch i:nth-child(3) { background: #ec4899; }
[data-ui-theme="rose"] .ui-theme-swatch i:nth-child(1) { background: #1c191d; }
[data-ui-theme="rose"] .ui-theme-swatch i:nth-child(2) { background: #f43f5e; }
[data-ui-theme="rose"] .ui-theme-swatch i:nth-child(3) { background: #c084fc; }
.ui-theme-name { font-weight: var(--fw-semibold); font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-1); }
.ui-theme-desc { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }


/* =========================================================================
   52 ПОДДЕРЖКА: ВИДЖЕТ, ОБРАЩЕНИЯ, ЖИВОЙ ЧАТ (синяя палитра поддержки)
   ========================================================================= */
:root { --support: #3b82f6; --support-2: #60a5fa; --support-deep: #0f1a33; --support-line: rgba(59, 130, 246, 0.35); }

.pill--support {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(37, 99, 235, 0.4);
}
.btn--support { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); color: #fff; border: 0; box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35); }
.btn--support:hover { filter: brightness(1.08); }

.dialog--support { width: min(560px, calc(100vw - 32px)); --accent-300: #60a5fa; --border-strong: var(--support-line); }
.dialog--support .dialog-body { border-top: 3px solid var(--support); }
.support-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.support-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-title-icon { width: 22px; height: 22px; color: var(--support-2); flex: none; }
.support-back { margin-right: 4px; }
.support-view { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.support-empty { text-align: center; color: var(--text-3); padding: var(--space-4) 0; }
.support-first { min-height: 120px; max-height: 240px; }

/* Список обращений */
.support-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.support-ticket {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.support-ticket:hover { border-color: var(--support-line); }
.support-ticket:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--support-2); }
.support-ticket[aria-current="true"] { border-color: var(--support); background: var(--support-deep); }
.support-ticket-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.support-ticket-subject { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-ticket-last { color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-ticket-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.support-ticket-time { color: var(--text-3); font-size: 11px; }
.support-status { background: rgba(255, 255, 255, 0.06); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-default); }
.support-status[data-status="open"] { color: #93c5fd; box-shadow: inset 0 0 0 1px var(--support-line); }
.support-status[data-status="answered"] { color: var(--success); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.4); }
.support-status[data-status="closed"] { color: var(--text-3); }

/* Живой чат */
.support-chat { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.support-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.support-chat-subject { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.support-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: min(52vh, 440px);
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  scroll-behavior: smooth;
}
.support-msg { display: grid; gap: 4px; max-width: 82%; justify-self: start; align-self: flex-start; }
.support-msg[data-mine="true"] { align-self: flex-end; justify-items: end; }
.support-msg-text {
  padding: 10px 14px;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface-3);
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.support-msg[data-mine="true"] .support-msg-text { border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.support-msg[data-role="support"][data-mine="false"] .support-msg-text { background: var(--support-deep); box-shadow: inset 0 0 0 1px var(--support-line); }
.support-msg-meta { color: var(--text-3); font-size: 11px; padding: 0 6px; }
.support-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.support-input { min-height: 48px; max-height: 140px; }
.support-send { width: 48px; height: 48px; border-radius: 9999px; background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.support-send:disabled { opacity: 0.5; }

/* Поддержка в админке */
.support-staff-head { flex-wrap: wrap; }
.support-filter { flex-wrap: wrap; }
.support-filter .segmented-item[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--support-line); }
.support-count { margin-left: 4px; color: var(--text-3); }
.support-split { display: grid; gap: 14px; }
@media (min-width: 860px) { .support-split { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } }
.support-split-list { display: grid; gap: 8px; max-height: 620px; overflow-y: auto; }
.support-user { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--support-deep); box-shadow: inset 0 0 0 1px var(--support-line); }
.support-user-avatar { width: 42px; height: 42px; flex: none; }
.support-user-id { flex: 1; min-width: 0; }
.support-user-name { font-weight: var(--fw-semibold); }
.support-user-meta { color: var(--text-3); font-size: var(--fs-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.support-actions .pill { min-height: 32px; }
.support-actions .pill:disabled { opacity: 0.5; cursor: default; }


/* =========================================================================
   53 CRM ПОЛЬЗОВАТЕЛЕЙ, PRO-ПОДПИСКИ И ПРИОРИТЕТНАЯ ПОДДЕРЖКА
   ========================================================================= */
.crm-filter { flex-wrap: wrap; }
.crm-filter .segmented-item[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pill--free { color: var(--text-3); letter-spacing: 0.04em; }
.admin-user[data-pro="false"] .admin-action--extend { display: none; }
.admin-user[data-pro="true"] .admin-action--extend { color: #d8b4fe; box-shadow: inset 0 0 0 1px rgba(147, 51, 234, 0.6); }
.admin-user [data-field="plan"][data-plan="forever"] { color: #d8b4fe; font-weight: var(--fw-semibold); }
.admin-user [data-field="plan"][data-plan="soon"] { color: var(--warn); font-weight: var(--fw-semibold); }

.pill--priority {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 0 14px rgba(59, 130, 246, 0.45);
}
.pill--priority .pill-icon { fill: currentColor; }
.pill--priority-glow { animation: priority-glow 2400ms var(--ease-in-out) infinite alternate; }
@keyframes priority-glow {
  from { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 0 10px rgba(59, 130, 246, 0.4); }
  to { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 0 26px rgba(124, 58, 237, 0.7); }
}
@media (prefers-reduced-motion: reduce) { .pill--priority-glow { animation: none; } }
.support-ticket[data-priority="true"] {
  border-color: rgba(96, 165, 250, 0.55);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(124, 58, 237, 0.12)), var(--surface-2);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.18);
}
.support-chat-head { flex-wrap: wrap; }


/* =========================================================================
   54 РОЛЬ SUPPORT И РОЛИ ПО ЛОГИНУ
   ========================================================================= */
/* Сотрудник поддержки видит в панели только вкладку «Поддержка»; сервер всё равно проверяет права на каждом запросе. */
#admin-dialog[data-staff="support"] .admin-tab:not([data-tab="support"]) { display: none; }
#admin-dialog[data-staff="support"] #admin-support-proforever { display: none; }
#admin-dialog[data-staff="support"] .admin-title-icon { color: var(--support-2); }
.roles-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 10px; }
@media (max-width: 560px) { .roles-row { grid-template-columns: 1fr; } }
.roles-actions { display: flex; gap: 10px; }
.roles-actions .btn { min-width: 112px; }


/* =========================================================================
   55 MOBILE-FIRST ПОЛИРОВКА И ПРОИЗВОДИТЕЛЬНОСТЬ
   ========================================================================= */
/* Горизонтального скролла нет ни у страницы, ни у окна браузера (clip не создаёт контейнер прокрутки). */
html { overflow-x: clip; }

/* --- Таб-бар телефона и планшета: 5 вкладок, «Поддержка» вместо плавающей кнопки ------------------------- */
:where(button.nav-link) { appearance: none; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
@media (min-width: 1024px) { .nav-support-item .nav-link { width: 100%; } }
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1023px) {
  .nav-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .nav-icon { width: 44px; }
  .nav-label { font-size: 10.5px; letter-spacing: -0.01em; }
}

/* --- Зоны касания на сенсорных экранах: не меньше 44px (Apple HIG / WCAG 2.5.5) -------------------------- */
@media (pointer: coarse) {
  .pill--button::before, a.pill::before, button.pill::before { inset: -9px -2px; }
  .link-btn { position: relative; }
  .link-btn::before { content: ""; position: absolute; inset: -13px -2px; }
  .icon-btn { min-width: 40px; min-height: 44px; }
}

/* --- Анимации только через transform и opacity (композитор, 60 FPS на слабых телефонах) ------------------ */
@keyframes glow-pulse { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes glow-flash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
@keyframes skeleton-pulse { from { opacity: 0.55; } to { opacity: 1; } }

/* Идущий таймер: свечение — статичная тень на псевдоэлементе, пульсирует только его прозрачность. */
.habit-card.is-running { animation: none; box-shadow: var(--shadow-1); }
.habit-card.is-running::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: var(--glow-md);
  pointer-events: none;
  animation: glow-pulse 2400ms var(--ease-in-out) infinite alternate;
  will-change: opacity;
}

/* Комбо серии: вспышка свечения без анимации box-shadow. */
.streak-card.is-combo { animation: none; }
.streak-card.is-combo:not([data-state="loading"])::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  /* inset: у карточки overflow: hidden, внешняя тень обрезалась бы */
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.45), inset 0 0 28px rgba(139, 92, 246, 0.35);
  pointer-events: none;
  animation: glow-flash var(--dur-xslow) var(--ease-out) both;
}

/* Корона затмения: размытие статичное, «дышат» только масштаб и прозрачность. */
.eclipse[data-state="full"] .eclipse-corona {
  filter: blur(3.5px) drop-shadow(0 0 12px var(--corona));
  transform-box: fill-box;
  transform-origin: center;
  animation: corona-breathe 3200ms var(--ease-in-out) infinite alternate;
}
@keyframes corona-breathe { from { transform: scale(0.97); opacity: 0.8; } to { transform: scale(1.04); opacity: 1; } }

/* Капсула PRIORITY SUPPORT: сияние на псевдоэлементе. */
.pill--priority-glow { animation: none; }
.pill--priority-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 26px rgba(124, 58, 237, 0.7);
  pointer-events: none;
  animation: glow-pulse 2400ms var(--ease-in-out) infinite alternate;
  will-change: opacity;
}

/* Скелетоны загрузки: пульс прозрачности вместо сдвига фона (background-position перерисовывает каждый кадр). */
.card[aria-busy="true"]::after,
.streak-card[data-state="loading"]::after,
#view-analytics[data-state="loading"] .heat-grid { animation: skeleton-pulse 1100ms var(--ease-in-out) infinite alternate; }

/* Окна и листы появляются через transform/opacity; подсказка браузеру — только на время анимации. */
.dialog[open] { will-change: transform, opacity; }
.dialog:not([open]) { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  .habit-card.is-running::after, .pill--priority-glow::after, .eclipse[data-state="full"] .eclipse-corona { animation: none; }
  .streak-card.is-combo::after { display: none; }
  .card[aria-busy="true"]::after, .streak-card[data-state="loading"]::after, #view-analytics[data-state="loading"] .heat-grid { animation: none; }
}

/* --- Прокручиваемые таблицы: тень-подсказка у края, за которым есть ещё содержимое (без JS).
   Слои с attachment: local едут вместе с содержимым и закрывают тень, когда край достигнут. */
.table-wrap {
  background:
    linear-gradient(to right, var(--surface-1) 30%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface-1) 30%, transparent) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.55), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.55), transparent) right center / 14px 100% no-repeat scroll,
    var(--surface-1);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.heat-table th, .heat-table td { white-space: nowrap; }

/* --- Листы снизу на телефоне во всю ширину: .dialog--admin и .dialog--support задают ширину позже и перебивали её. */
@media (max-width: 640px) { .dialog.dialog--sheet { width: 100%; } }

/* --- Стекло дешевле на телефонах: размытие — самый дорогой эффект для слабых GPU -------------------------- */
@media (max-width: 767px) {
  :root { --blur-lg: 16px; --blur-md: 12px; --blur-sm: 6px; }
}


/* =========================================================================
   56 TELEGRAM MINI APP
   ========================================================================= */
/* Внутри Telegram приложение уже открыто из бота: кнопка установки PWA там не нужна. */
html[data-tma] #rail-install,
html[data-tma] #settings-install { display: none !important; }
html[data-tma] body { overscroll-behavior-y: none; }


/* =========================================================================
   57 MINI APP ТОЛЬКО ДЛЯ PRO — экран-заглушка внутри Telegram
   ========================================================================= */
.pro-gate {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 32px) calc(var(--gutter) + var(--safe-right)) calc(var(--safe-bottom) + 32px) calc(var(--gutter) + var(--safe-left));
  overflow: hidden;
  isolation: isolate;
  background: var(--surface-0);
}
.pro-gate[hidden] { display: none; }
/* Мягкое неоново-фиолетовое сияние за кольцами: статичный градиент, «дышит» только прозрачность. */
.pro-gate::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 22%;
  width: min(560px, 140vw);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.34), rgba(217, 70, 239, 0.12) 55%, transparent 75%);
  pointer-events: none;
  animation: glow-pulse 3600ms var(--ease-in-out) infinite alternate;
}
.pro-gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 440px;
  text-align: center;
}
.pro-gate-visual { width: min(260px, 72vw); margin-bottom: 4px; }
.pro-gate-eclipse { width: 100%; height: auto; filter: drop-shadow(0 0 28px rgba(139, 92, 246, 0.45)); }
.pro-gate-badge { padding: 7px 14px; letter-spacing: 0.08em; font-size: 12px; box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.45), 0 0 22px rgba(147, 51, 234, 0.45); }
.pro-gate-title {
  margin: 4px 0 0;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.22;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-wrap: balance;
}
.pro-gate-text { margin: 0; color: var(--text-2); font-size: var(--fs-body); line-height: 1.55; text-wrap: pretty; }
.pro-gate-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 8px; padding: 0; list-style: none; }
.pro-gate-cta { width: 100%; min-height: 54px; padding: 12px 22px; white-space: normal; text-align: center; line-height: 1.3; }
.pro-gate-cta .icon { width: 18px; height: 18px; flex: none; }
.pro-gate-recheck { font-size: var(--fs-body-sm); }
.pro-gate-note { margin: 0; color: var(--text-3); font-size: var(--fs-caption); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .pro-gate::before { animation: none; } }

/* =========================================================================
   58 ДЛИННЫЕ ПОДПИСИ НА УЗКИХ ЭКРАНАХ И С КРУПНЫМ СИСТЕМНЫМ ШРИФТОМ (Android, Telegram)
   ========================================================================= */
/* Фильтры CRM и тикетов: подписи длиннее равной колонки — капсулы переносятся на новую строку, а не наезжают. */
.crm-filter, .support-filter { display: flex; flex-wrap: wrap; }
.crm-filter .segmented-item, .support-filter .segmented-item { flex: 1 1 auto; gap: 6px; }
/* Кнопка во всю ширину: длинная подпись переносится, иконка остаётся внутри. */
.btn--block { white-space: normal; text-align: center; padding-block: 10px; }
.btn--block .btn-label { min-width: 0; }
.btn .icon, .btn .btn-icon { flex: none; }
/* Плитки статистики на телефоне: ширина в em растёт вместе с системным шрифтом — при крупном шрифте одна колонка. */
@media (max-width: 640px) { .admin-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9em), 1fr)); } }
.stat-label { min-width: 0; overflow-wrap: anywhere; }
/* Заголовок секции и капсула статуса: при нехватке места капсула уходит на следующую строку. */
.settings-section-head { flex-wrap: wrap; row-gap: 8px; }
/* Вкладки документов — как фильтры: при нехватке места переносятся. */
.legal-tabs { display: flex; flex-wrap: wrap; }
.legal-tabs .segmented-item { flex: 1 1 auto; }
/* Поля форм не шире контейнера: собственная ширина <input> растёт вместе с шрифтом. */
.field, .input { min-width: 0; }
.profile-form > *, .password-form > * { min-width: 0; }
/* Пол: иконка над словом, если в половину ширины они не помещаются. */
.gender-card { flex-wrap: wrap; row-gap: 4px; text-align: center; }
/* Длинные названия наград переносятся внутри карточки. */
.reward-card { min-width: 0; }
.reward-title { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
/* Любая кнопка: при нехватке места подпись переносится, а не вылезает за край (на обычных экранах — одна строка). */
.btn { white-space: normal; text-align: center; }
.btn .btn-label { min-width: 0; overflow-wrap: anywhere; }
.settings-actions > * { min-width: 0; }


/* =========================================================================
   59 ТАРИФЫ: ВИТРИНА PRO С АКЦЕНТОМ; УВЕДОМЛЕНИЯ И ТИХИЙ ЧАС
   ========================================================================= */
/* Почему открылась витрина (упёрлись в лимит, PRO-функция): мягкая фиолетовая плашка, а не красная ошибка. */
.pro-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--text-1);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}
.pro-reason[hidden] { display: none; }
.pro-reason .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent-300); }
/* Подсвеченное преимущество: рамка и мягкое свечение на псевдоэлементе (анимируется только прозрачность). */
.pro-benefit.is-highlighted {
  position: relative;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.10);
  box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.45);
}
.pro-benefit.is-highlighted::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 24px rgba(147, 51, 234, 0.45);
  pointer-events: none;
  animation: glow-pulse 2400ms var(--ease-in-out) infinite alternate;
}
.pro-benefit.is-highlighted .pro-benefit-icon { background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%); color: #fff; }
@media (prefers-reduced-motion: reduce) { .pro-benefit.is-highlighted::after { animation: none; } }

/* Уведомления и Тихий час: видны, когда Telegram подключён. */
.tg-prefs { display: none; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
#settings-telegram[data-state="linked"] .tg-prefs { display: grid; }
.tg-prefs-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--text-1); }
.tg-prefs-title .icon { width: 18px; height: 18px; color: var(--accent-300); }
.tg-prefs .setting-row-label { flex: 1 1 auto; min-width: 0; }
.select--time { width: auto; min-width: 104px; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.quiet-range { display: flex; flex-wrap: wrap; gap: 10px; transition: opacity var(--dur-fast) var(--ease-out); }
.quiet-range[data-disabled="true"] { opacity: 0.45; }
.quiet-range-field { display: flex; align-items: center; gap: 8px; }
.quiet-range-label { color: var(--text-3); font-size: var(--fs-body-sm); }


/* =========================================================================
   60 ПРОДЛЕНИЕ ECLIPSE PRO
   ========================================================================= */
/* Активный PRO: карточка срока над продлением; за 3 дня до конца — тёплый акцент. */
.dialog--pro .pro-active-state {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: rgba(139, 92, 246, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.32);
}
.pro-active-left { margin: 0; color: var(--text-2); font-size: var(--fs-body-sm); }
.pro-active-left[data-warn="true"] { color: var(--warn); font-weight: var(--fw-semibold); }
.pro-renew-title { margin: 4px 0 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text-1); text-align: center; }
.pro-renew-title[hidden] { display: none; }
.pro-onetime-note { text-align: center; }
/* Капсула в шапке «Продлить PRO»: та же PRO-капсула, но тёплое свечение — время продлевать. */
#pro-open[data-expiring="true"] { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(251, 191, 36, 0.55), 0 0 16px rgba(251, 191, 36, 0.35); }
/* «Продлить» в капсуле — только когда PRO заканчивается и в шапке есть место; на узких экранах остаётся «PRO» со свечением. */
.pro-open-verb { display: none; }
#pro-open[data-expiring="true"] .pro-open-verb { display: inline; }
@media (max-width: 380px) { #pro-open[data-expiring="true"] .pro-open-verb { display: none; } }

/* =========================================================================
   61 КОНТАКТЫ НА ЛЕНДИНГЕ
   ========================================================================= */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 24px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  color: var(--text-1);
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .contact-card:hover { border-color: var(--border-strong); transform: translateY(-2px); } }
.contact-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.contact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(34, 158, 217, 0.35);
}
.contact-icon .icon { width: 24px; height: 24px; }
.contact-icon--support { background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35); }
.contact-body { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.contact-title { font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.contact-handle { color: var(--accent-300); font-size: var(--fs-body-sm); overflow-wrap: anywhere; }
.contact-text { color: var(--text-3); font-size: var(--fs-label); line-height: 1.4; }
.contact-arrow { flex: none; width: 18px; height: 18px; color: var(--text-3); }
.contact-icon--support ~ .contact-arrow { transform: rotate(180deg); }


/* =========================================================================
   62 ОДНА КНОПКА «ВЫЙТИ», ЛЕНДИНГ ДЛЯ ВОШЕДШЕГО, КАРТОЧКА ПРОФИЛЯ
   ========================================================================= */
/* На компьютере выход — только в меню слева; на планшете и телефоне — в шапке и в настройках. */
@media (min-width: 1024px) { .header .header-logout { display: none; } }

/* Логотип в меню приложения — кнопка «на главную». */
button.nav-brand { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; border-radius: var(--radius-md); }
button.nav-brand:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { button.nav-brand:hover .brand-word { color: var(--text-1); } }

/* Меню аккаунта на лендинге: выезжает сверху вниз. */
.landing-account { position: relative; }
.landing-account[hidden] { display: none; }
.landing-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 40px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text-1);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.landing-account-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.landing-account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body-sm); }
.landing-account-chevron { width: 16px; height: 16px; flex: none; color: var(--text-3); transform: rotate(-90deg); transition: transform var(--dur-fast) var(--ease-out); }
.landing-account-btn[aria-expanded="true"] .landing-account-chevron { transform: rotate(90deg); }
.landing-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-popover, 60);
  display: grid;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--surface-1);
  box-shadow: var(--shadow-3);
  transform-origin: top right;
  animation: account-menu-in var(--dur-base) var(--ease-out);
}
.landing-account-menu[hidden] { display: none; }
@keyframes account-menu-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.landing-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-body-sm);
  text-align: left;
  cursor: pointer;
}
.landing-account-item .icon { width: 18px; height: 18px; color: var(--accent-300); }
.landing-account-item:focus-visible { outline: none; background: var(--surface-3); }
@media (hover: hover) and (pointer: fine) { .landing-account-item:hover { background: var(--surface-3); } }
@media (prefers-reduced-motion: reduce) { .landing-account-menu { animation: none; } }

/* Кликабельные аватары (Топ, карточка партнёра, CRM). */
.is-card-trigger { cursor: pointer; border-radius: 50%; }
.is-card-trigger:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { .is-card-trigger:hover { filter: brightness(1.12); } }

/* Карточка профиля. */
.profile-card { display: grid; justify-items: center; gap: 10px; text-align: center; }
.profile-card-avatar .avatar { width: 88px; height: 88px; box-shadow: var(--glow-sm); }
.profile-card-name { margin: 6px 0 0; font-size: var(--fs-title); font-weight: var(--fw-bold); line-height: 1.2; overflow-wrap: anywhere; }
.profile-card-login { margin: -6px 0 0; font-size: var(--fs-body-sm); }
.profile-card-login[hidden] { display: none; }
.profile-card-statuses { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.profile-card-statuses:empty { display: none; }
.profile-card-since { margin: 0; color: var(--text-2); font-size: var(--fs-body-sm); }
.profile-card-block { justify-self: stretch; display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border-subtle); text-align: left; }
.profile-card-label { margin: 0; display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.profile-card-bio { margin: 0; color: var(--text-1); font-size: var(--fs-body-sm); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.profile-card-bio[data-empty="true"] { color: var(--text-3); font-style: italic; }
.dialog--profile-card[data-state="loading"] .profile-card-block,
.dialog--profile-card[data-state="loading"] .profile-card-since,
.dialog--profile-card[data-state="error"] .profile-card-block,
.dialog--profile-card[data-state="error"] .profile-card-since { visibility: hidden; }
.dialog--profile-card[data-state="error"] .profile-card-block { display: none; }
.profile-card-block { min-width: 0; }
/* Фильтры достижений: статус (сегмент) и категории (пилюли с переносом) */
.ach-filters { display: grid; gap: 8px; min-width: 0; }
.ach-status { padding: 3px; }
.ach-status .segmented-item { min-height: 32px; padding: 0 8px; font-size: 12.5px; }
.segmented-item[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-default), 0 2px 8px -2px rgba(0, 0, 0, 0.5); }
.ach-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-cat { min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--surface-1); border: 1px solid var(--border-subtle); color: var(--text-3); font-size: 12px; font-weight: var(--fw-semibold); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.ach-cat[aria-pressed="true"] { background: var(--accent-900); border-color: rgba(167, 139, 250, 0.35); color: var(--accent-300); }
.ach-cat:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { .ach-cat:not([aria-pressed="true"]):hover { color: var(--text-1); } }
.ach-empty { margin: 0; padding: 12px 0; text-align: center; font-size: var(--fs-label); color: var(--text-3); }
/* Сетка: прокрутка внутри карточки, без горизонтального переполнения */
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr)); gap: 8px; max-height: 360px; margin: 0; padding: 2px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; list-style: none; scrollbar-width: thin; }
.achievement { display: grid; min-width: 0; }
.achievement-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--border-subtle); color: inherit; text-align: left; cursor: pointer; opacity: 0.62; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.achievement-btn:active { transform: scale(0.97); }
.achievement-btn:focus-visible { outline: none; opacity: 1; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { .achievement-btn:hover { opacity: 0.9; } }
.achievement-icon { position: relative; display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); color: var(--text-3); }
.achievement-icon .icon { width: 16px; height: 16px; }
.achievement-icon .achievement-lock { position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; padding: 2px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border-default); color: var(--text-2); stroke-width: 2.25; }
.achievement-body { display: grid; min-width: 0; }
.achievement-title { font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-2); overflow-wrap: anywhere; }
.achievement-hint { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 11.5px; line-height: 1.35; color: var(--text-3); overflow-wrap: anywhere; }
.achievement[data-earned="true"] .achievement-btn { opacity: 1; border-color: rgba(167, 139, 250, 0.35); background: rgba(139, 92, 246, 0.10); }
.achievement[data-earned="true"] .achievement-icon { background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%); color: #fff; }
.achievement[data-earned="true"] .achievement-lock { display: none; }
.achievement[data-earned="true"] .achievement-title { color: var(--text-1); }
.achievement[data-earned="true"] .achievement-hint { color: var(--accent-300); }
/* Телефоны: иконка над текстом — тексту вся ширина карточки, ряды одной высоты, без «слипания». */
@media (max-width: 480px) {
  .achievements { scrollbar-gutter: stable; }
  .achievement-btn { flex-direction: column; align-items: flex-start; gap: 8px; height: 100%; padding: 10px; }
  .achievement-body { gap: 2px; }
  .achievement-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.6em; line-height: 1.3; }
  .achievement-hint { min-height: 2.7em; }
}
/* Превью достижения */
.dialog--ach .dialog-body { align-items: center; text-align: center; }
.dialog--ach .dialog-head { align-self: stretch; }
.ach-preview-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--radius-lg); background: var(--surface-3); color: var(--text-3); }
.ach-preview-icon .icon { width: 36px; height: 36px; }
.dialog--ach[data-earned="true"] .ach-preview-icon { background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%); color: #fff; box-shadow: var(--glow-sm); }
.dialog--ach[open] .ach-preview-icon { animation: ach-pop var(--dur-slow) var(--ease-spring-soft); }
@keyframes ach-pop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.ach-preview-title { margin: 0; text-wrap: balance; }
.ach-preview-status { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-3); }
.dialog--ach[data-earned="true"] .ach-preview-status { color: var(--accent-300); }
.dialog--ach .dialog-text { margin: 0; }
.ach-preview-reward { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border-subtle); font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-1); }
.ach-preview-reward .icon { width: 16px; height: 16px; color: #fbbf24; }
@media (prefers-reduced-motion: reduce) { .dialog--ach[open] .ach-preview-icon { animation: none; } .achievement-btn:active { transform: none; } }
.field-hint--count { justify-self: end; text-align: right; }
.settings-actions--single { grid-template-columns: auto; justify-content: start; }
/* «Главная страница» в настройках — для телефона и планшета; на компьютере её роль играет логотип в меню слева. */
.settings-home .brand-logo { width: 20px; height: 20px; border-radius: 6px; flex: none; }
@media (min-width: 1024px) { .settings-home { display: none; } }

/* «Запомнить меня» во входе — та же галочка, что согласие при регистрации. */
.login-remember { margin-top: 2px; }
.login-remember .consent-text { font-weight: var(--fw-semibold); color: var(--text-1); }
.login-remember-hint { margin-top: -4px; }


/* =========================================================================
   63 СЕЗОННАЯ ЛИГА
   ========================================================================= */
.season-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--bento-gap); }
.season-pill {
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(139, 92, 246, 0.16));
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--text-1);
  font-weight: var(--fw-semibold);
  white-space: normal;
}
.season-pill[hidden] { display: none; }
.season-pill .pill-icon { color: #fbbf24; }
.season-pill[data-final="true"] { box-shadow: 0 0 18px rgba(251, 191, 36, 0.3); }
.top-scope { flex: 1 1 320px; max-width: 520px; display: flex; flex-wrap: wrap; }
.top-scope .segmented-item { flex: 1 1 auto; }
.top-scope .segmented-item[aria-selected="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* Что видно в каждом режиме. */
.bento-prizes, .bento-archive { grid-column: 1 / -1; }
#top-bento[data-scope="season"] .bento-archive,
#top-bento[data-scope="all"] .bento-prizes,
#top-bento[data-scope="all"] .bento-archive,
#top-bento[data-scope="archive"] > :not(.bento-archive):not(.bento-privacy) { display: none; }

.leaderboard-hint, .prizes-note { color: var(--text-3); font-size: var(--fs-label); }
.leaderboard-head { flex-wrap: wrap; row-gap: 4px; }

/* Призы сезона. */
.prizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.prize {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.prize[data-place="1"] { border-color: rgba(251, 191, 36, 0.5); background: linear-gradient(160deg, rgba(251, 191, 36, 0.14), var(--surface-2) 60%); }
.prize[data-place="2"] { border-color: rgba(203, 213, 225, 0.4); background: linear-gradient(160deg, rgba(203, 213, 225, 0.10), var(--surface-2) 60%); }
.prize[data-place="3"] { border-color: rgba(217, 119, 6, 0.4); background: linear-gradient(160deg, rgba(217, 119, 6, 0.12), var(--surface-2) 60%); }
.prize-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); }
.prize[data-place="1"] .prize-icon { color: #fbbf24; }
.prize[data-place="2"] .prize-icon { color: #cbd5e1; }
.prize[data-place="3"] .prize-icon { color: #d97706; }
.prize-icon .icon { width: 22px; height: 22px; }
.prize-place { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.prize-lines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-body-sm); }
.prize-badge { justify-self: start; }

/* Бейдж чемпиона сезона. */
.pill--champion { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); color: #1c1305; border-color: transparent; font-weight: var(--fw-bold); letter-spacing: 0.04em; }
.pill--champion .pill-icon { color: #1c1305; }

/* Подиум сезона: короны в цвет мест. */
.podium-slot[data-season="true"] .podium-laurel { color: #fbbf24; }
.podium-slot[data-season="true"][data-place="2"] .podium-laurel { color: #cbd5e1; }
.podium-slot[data-season="true"][data-place="3"] .podium-laurel { color: #d97706; }

/* Архив сезонов. */
.season-archive { display: grid; gap: 14px; margin: 12px 0 0; padding: 0; list-style: none; }
.archive-season { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border-subtle); }
.archive-season-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.archive-season-title { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.archive-top { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }

/* Админка: сезоны. */
.admin-season-leaders, .admin-season-history { display: grid; gap: 4px; margin: 0; padding-left: 0; list-style: none; color: var(--text-2); font-size: var(--fs-body-sm); overflow-wrap: anywhere; }
.admin-season-history { color: var(--text-3); font-size: var(--fs-label); }


/* =========================================================================
   64 КОСМЕТИКА ПРОФИЛЯ: РАМКИ АВАТАРА И БАННЕРЫ (только CSS и SVG)
   Анимируются только transform и opacity; размытие и тени — статичные.
   ========================================================================= */
@keyframes cos-spin { to { transform: rotate(360deg); } }
@keyframes cos-pulse { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes cos-twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes cos-fire { 0% { transform: rotate(0deg) scale(0.96); opacity: 0.75; } 50% { transform: rotate(-180deg) scale(1.05); opacity: 1; } 100% { transform: rotate(-360deg) scale(0.96); opacity: 0.75; } }

/* --- Рамка аватара: кольцо (::before, маска-кольцо) + свечение / частицы (::after) --- */
.avatar-frame { --fg: 6px; --fr: 3px; position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; isolation: isolate; }
.avatar-frame > .avatar { position: relative; z-index: 1; }
.avatar-frame--lg { width: 96px; height: 96px; --fg: 7px; --fr: 4px; }
.avatar-frame--md { width: 56px; height: 56px; --fg: 5px; --fr: 3px; }
.avatar-frame--lg > .avatar, .avatar-frame--md > .avatar { width: 100%; height: 100%; }
.avatar-frame--sm { --fg: 4px; --fr: 2.5px; }
.avatar-frame[data-frame^="frame_"]::before,
.avatar-frame[data-frame^="frame_"]::after {
  content: "";
  position: absolute;
  inset: calc(var(--fg) * -1);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.avatar-frame[data-frame^="frame_"]::before {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--fr) - 0.5px), #000 calc(100% - var(--fr)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--fr) - 0.5px), #000 calc(100% - var(--fr)));
}
.frame-deco { display: none; }

/* 1. Неоновое затмение: двухцветное кольцо индиго + фуксия вращается, свечение дышит. */
.avatar-frame[data-frame="frame_neon_eclipse"]::before {
  background: conic-gradient(from 0deg, #6366f1, #a855f7, #d946ef, #6366f1 50%, #a855f7, #d946ef, #6366f1);
  animation: cos-spin 3.6s linear infinite;
}
.avatar-frame[data-frame="frame_neon_eclipse"]::after {
  box-shadow: 0 0 12px 1px rgba(99, 102, 241, 0.6), 0 0 24px 3px rgba(217, 70, 239, 0.4);
  animation: cos-pulse 2.4s ease-in-out infinite alternate;
}

/* 2. Кибер-импульс: по тонкому бирюзовому контуру бежит яркий импульс. */
.avatar-frame[data-frame="frame_cyber_pulse"]::before {
  background: conic-gradient(from 0deg, transparent 0 68%, rgba(34, 211, 238, 0.15) 76%, #22d3ee 92%, #ecfeff 95.5%, transparent 96.5%);
  animation: cos-spin 1.8s linear infinite;
}
.avatar-frame[data-frame="frame_cyber_pulse"]::after {
  border: 1px solid rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.35), inset 0 0 6px rgba(34, 211, 238, 0.25);
  animation: cos-pulse 0.9s steps(2, jump-none) infinite alternate;
}

/* 3. Золотая корона: золотой орнамент, корона сверху и тёплые искры. */
.avatar-frame[data-frame="frame_golden_crown"]::before {
  background: conic-gradient(#b45309, #fde68a, #f59e0b, #fef3c7, #d97706, #fde68a, #b45309);
  animation: cos-spin 14s linear infinite;
}
.avatar-frame[data-frame="frame_golden_crown"]::after {
  inset: calc(var(--fg) * -1.9);
  background:
    radial-gradient(circle at 10% 34%, #fde68a 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 90% 26%, #fbbf24 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 82% 86%, #fef3c7 0 1.8px, transparent 2.8px),
    radial-gradient(circle at 16% 82%, #fbbf24 0 1.3px, transparent 2.3px),
    radial-gradient(circle at 50% 99%, #fde68a 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 96% 56%, #fef3c7 0 1.1px, transparent 2px);
  animation: cos-twinkle 1.8s ease-in-out infinite;
}
.avatar-frame[data-frame="frame_golden_crown"] .frame-deco {
  display: block;
  position: absolute;
  z-index: 3;
  top: calc(var(--fg) * -1);
  left: 50%;
  width: 40%;
  transform: translate(-50%, -58%);
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.75));
  pointer-events: none;
}
.frame-deco .icon { display: block; width: 100%; height: auto; aspect-ratio: 1; fill: currentColor; }

/* 4. Космическая пустота: широкое фиолетовое кольцо-дымка и мерцающие микро-звёзды. */
.avatar-frame[data-frame="frame_cosmic_void"]::before {
  background: conic-gradient(#1e1b4b, #4c1d95, #7c3aed, #312e81, #581c87, #1e1b4b);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--fr) * 1.8 - 0.5px), #000 calc(100% - var(--fr) * 1.8));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--fr) * 1.8 - 0.5px), #000 calc(100% - var(--fr) * 1.8));
  animation: cos-spin 9s linear infinite;
}
.avatar-frame[data-frame="frame_cosmic_void"]::after {
  inset: calc(var(--fg) * -1.7);
  background:
    radial-gradient(circle at 18% 24%, #fff 0 0.9px, transparent 1.7px),
    radial-gradient(circle at 80% 16%, #ddd6fe 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 92% 62%, #fff 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 30% 90%, #c4b5fd 0 1px, transparent 1.8px),
    radial-gradient(circle at 64% 96%, #fff 0 0.7px, transparent 1.5px),
    radial-gradient(circle at 6% 58%, #e9d5ff 0 1px, transparent 1.8px);
  box-shadow: 0 0 18px 3px rgba(91, 33, 182, 0.45);
  animation: cos-twinkle 2.6s ease-in-out infinite, cos-spin 40s linear infinite;
}

/* 5. Огненная серия: кольцо пламени и языки огня, которые танцуют вокруг. */
.avatar-frame[data-frame="frame_fire_streak"]::before {
  background: conic-gradient(#7f1d1d, #ef4444, #f97316, #facc15, #f97316, #ef4444, #7f1d1d);
  animation: cos-spin 2.4s linear infinite;
}
.avatar-frame[data-frame="frame_fire_streak"]::after {
  inset: calc(var(--fg) * -2.6);
  z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(249, 115, 22, 0.95) 0deg 6deg, rgba(250, 204, 21, 0.7) 6deg 9deg, transparent 9deg 20deg);
  /* языки огня — в полосе снаружи кольца: начинаются под ним и затухают к краю */
  -webkit-mask: radial-gradient(farthest-side, transparent 68%, #000 76%, rgba(0, 0, 0, 0.7) 88%, transparent 100%);
  mask: radial-gradient(farthest-side, transparent 68%, #000 76%, rgba(0, 0, 0, 0.7) 88%, transparent 100%);
  filter: blur(0.6px);
  animation: cos-fire 3s linear infinite;
}

/* --- Баннеры профиля --- */
.cosmetic-banner {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(236, 72, 153, 0.18) 60%, var(--surface-2));
}
.cosmetic-banner[hidden] { display: none; }
.cosmetic-banner[data-banner^="banner_"]::before,
.cosmetic-banner[data-banner^="banner_"]::after { content: ""; position: absolute; pointer-events: none; }

/* 1. Глубокий космос: туманность, мерцающие звёзды и созвездия. */
.cosmetic-banner[data-banner="banner_deep_space"] {
  background:
    radial-gradient(ellipse 60% 80% at 28% 35%, rgba(124, 58, 237, 0.55), transparent 60%),
    radial-gradient(ellipse 50% 70% at 78% 65%, rgba(236, 72, 153, 0.35), transparent 60%),
    radial-gradient(ellipse 40% 50% at 60% 18%, rgba(56, 189, 248, 0.18), transparent 60%),
    linear-gradient(160deg, #04040a, #0d0a22 55%, #160b2b);
}
.cosmetic-banner[data-banner="banner_deep_space"]::before {
  inset: 0;
  background:
    radial-gradient(1px 1px at 8% 18%, #fff, transparent), radial-gradient(1px 1px at 22% 72%, #e9d5ff, transparent),
    radial-gradient(1.5px 1.5px at 38% 30%, #fff, transparent), radial-gradient(1px 1px at 52% 84%, #fff, transparent),
    radial-gradient(1px 1px at 66% 12%, #ddd6fe, transparent), radial-gradient(1.5px 1.5px at 74% 46%, #fff, transparent),
    radial-gradient(1px 1px at 88% 24%, #fff, transparent), radial-gradient(1px 1px at 94% 78%, #e9d5ff, transparent),
    radial-gradient(1px 1px at 14% 92%, #fff, transparent), radial-gradient(1px 1px at 46% 58%, #fff, transparent);
  animation: cos-twinkle 3.2s ease-in-out infinite;
}
.cosmetic-banner[data-banner="banner_deep_space"]::after {
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 140' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23c4b5fd' stroke-opacity='.5' stroke-width='.8'%3E%3Cpolyline points='34,34 74,56 112,42 146,72 132,104'/%3E%3Cpolyline points='242,28 276,48 318,34 352,62 336,98'/%3E%3Cpolyline points='196,96 222,118 258,110'/%3E%3C/g%3E%3Cg fill='%23ede9fe'%3E%3Ccircle cx='34' cy='34' r='1.8'/%3E%3Ccircle cx='74' cy='56' r='1.4'/%3E%3Ccircle cx='112' cy='42' r='2'/%3E%3Ccircle cx='146' cy='72' r='1.5'/%3E%3Ccircle cx='132' cy='104' r='1.7'/%3E%3Ccircle cx='242' cy='28' r='1.6'/%3E%3Ccircle cx='276' cy='48' r='2'/%3E%3Ccircle cx='318' cy='34' r='1.4'/%3E%3Ccircle cx='352' cy='62' r='1.9'/%3E%3Ccircle cx='336' cy='98' r='1.5'/%3E%3Ccircle cx='196' cy='96' r='1.4'/%3E%3Ccircle cx='222' cy='118' r='1.7'/%3E%3Ccircle cx='258' cy='110' r='1.3'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
  animation: cos-pulse 5s ease-in-out infinite alternate;
}

/* 2. Кибер-сетка: неоновое солнце и сетка, бегущая к горизонту. */
.cosmetic-banner[data-banner="banner_cyber_grid"] {
  background: linear-gradient(to bottom, #07021a 0%, #1d0640 45%, #4a0d63 57%, #0a0218 57.5%, #0a0218 100%);
}
.cosmetic-banner[data-banner="banner_cyber_grid"]::before {
  left: 50%;
  top: 8%;
  width: min(34%, 120px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, #fde047, #fb923c 45%, #ec4899 85%);
  -webkit-mask: linear-gradient(to bottom, #000 54%, transparent 54% 60%, #000 60% 66%, transparent 66% 71%, #000 71% 75%, transparent 75%);
  mask: linear-gradient(to bottom, #000 54%, transparent 54% 60%, #000 60% 66%, transparent 66% 71%, #000 71% 75%, transparent 75%);
  animation: cos-pulse 3s ease-in-out infinite alternate;
}
@keyframes cos-grid { from { transform: perspective(140px) rotateX(58deg) translateY(0); } to { transform: perspective(140px) rotateX(58deg) translateY(26px); } }
.cosmetic-banner[data-banner="banner_cyber_grid"]::after {
  left: -60%;
  right: -60%;
  top: 57%;
  height: 120%;
  transform-origin: top center;
  background-color: #0a0218;
  background-image: linear-gradient(rgba(236, 72, 153, 0.85) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 72, 153, 0.85) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 22%);
  mask: linear-gradient(to bottom, transparent, #000 22%);
  animation: cos-grid 1.2s linear infinite;
}

/* 3. Северное сияние: две волны света плывут навстречу друг другу. */
@keyframes cos-aurora-a { from { transform: translateX(-14%) skewY(-6deg); } to { transform: translateX(14%) skewY(4deg); } }
@keyframes cos-aurora-b { 0% { transform: translateX(12%) skewY(5deg); opacity: 0.55; } 100% { transform: translateX(-12%) skewY(-3deg); opacity: 1; } }
.cosmetic-banner[data-banner="banner_aurora_borealis"] { background: linear-gradient(180deg, #020617 0%, #04182a 60%, #062a3a 100%); }
.cosmetic-banner[data-banner="banner_aurora_borealis"]::before {
  inset: -40% -60%;
  background: linear-gradient(100deg, transparent 22%, rgba(16, 185, 129, 0.55) 36%, rgba(56, 189, 248, 0.45) 48%, rgba(168, 85, 247, 0.5) 60%, transparent 76%);
  filter: blur(16px);
  animation: cos-aurora-a 9s ease-in-out infinite alternate;
}
.cosmetic-banner[data-banner="banner_aurora_borealis"]::after {
  inset: -30% -50%;
  background: linear-gradient(78deg, transparent 26%, rgba(52, 211, 153, 0.42) 40%, rgba(129, 140, 248, 0.36) 55%, transparent 70%);
  filter: blur(20px);
  animation: cos-aurora-b 12s ease-in-out infinite alternate;
}

/* 4. Обсидиан: матовый камень, тонкая геометрия и знак EclipseLink. */
.cosmetic-banner[data-banner="banner_obsidian_minimal"] { background: linear-gradient(135deg, #09090d 0%, #14141b 55%, #0c0c11 100%); }
.cosmetic-banner[data-banner="banner_obsidian_minimal"]::before {
  inset: 0;
  background:
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-60deg, rgba(167, 139, 250, 0.07) 0 1px, transparent 1px 34px),
    linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.55), transparent) left bottom / 100% 1px no-repeat;
  animation: cos-pulse 6s ease-in-out infinite alternate;
}
.cosmetic-banner[data-banner="banner_obsidian_minimal"]::after {
  right: 18px;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  background: url("/icons/logo-192.png") center / contain no-repeat;
  opacity: 0.55;
}

/* 5. Романтический закат: пурпур переходит в янтарь, солнце светится над холмами. */
@keyframes cos-sun { from { opacity: 0.7; transform: translateX(-50%) scale(0.97); } to { opacity: 1; transform: translateX(-50%) scale(1.03); } }
.cosmetic-banner[data-banner="banner_romantic_sunset"] { background: linear-gradient(180deg, #1e0630 0%, #4a1048 35%, #9d2a4f 62%, #e2702a 85%, #f8b04b 100%); }
.cosmetic-banner[data-banner="banner_romantic_sunset"]::before {
  left: 50%;
  bottom: -30%;
  width: min(40%, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 237, 180, 0.95), rgba(251, 146, 60, 0.7) 45%, transparent 70%);
  animation: cos-sun 4s ease-in-out infinite alternate;
}
.cosmetic-banner[data-banner="banner_romantic_sunset"]::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 38 C60 18 110 44 170 30 S290 10 340 28 S390 36 400 30 V60 H0Z' fill='%233b0a3f' fill-opacity='.75'/%3E%3Cpath d='M0 50 C70 36 130 56 200 44 S330 34 400 46 V60 H0Z' fill='%231e0630'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-frame::before, .avatar-frame::after, .cosmetic-banner::before, .cosmetic-banner::after { animation: none !important; }
}

/* --- Карточка профиля: баннер сверху, аватар в рамке заходит на баннер (как в Discord) --- */
.profile-card-banner { justify-self: stretch; height: 128px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; -webkit-mask: linear-gradient(to bottom, #000 55%, transparent); mask: linear-gradient(to bottom, #000 55%, transparent); }
.profile-card .profile-card-avatar { margin-top: -64px; position: relative; z-index: 1; }
.profile-card-avatar .avatar-frame--lg > .avatar { box-shadow: 0 0 0 4px var(--surface-1); }

/* --- Виджет партнёра: рамка вокруг кольца прогресса и полоска баннера за шапкой --- */
.partner-head { position: relative; isolation: isolate; }
.partner-banner { position: absolute; inset: -10px -12px; z-index: -1; border-radius: var(--radius-md); opacity: 0.6; -webkit-mask: linear-gradient(90deg, #000 25%, transparent 92%); mask: linear-gradient(90deg, #000 25%, transparent 92%); }

/* --- Магазин: «Купоны пары» / «Гардероб профиля» --- */
.shop-tabs { margin-bottom: var(--bento-gap); max-width: 460px; }
.shop-tabs .segmented-item { gap: 8px; }
.shop-tabs .segmented-item .icon { width: 18px; height: 18px; flex: none; }
.shop-tabs .segmented-item[aria-selected="true"] { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border-strong); }
.wardrobe { display: grid; gap: var(--bento-gap); }
.wardrobe[hidden] { display: none; }
.wardrobe[data-state="loading"] { opacity: 0.6; }
.wardrobe-preview { padding: 0; overflow: hidden; }
.wardrobe-preview-banner { height: 120px; -webkit-mask: linear-gradient(to bottom, #000 50%, transparent); mask: linear-gradient(to bottom, #000 50%, transparent); }
.wardrobe-preview-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: -56px; padding: 0 18px 18px; position: relative; }
.wardrobe-preview-frame > .avatar { box-shadow: 0 0 0 4px var(--surface-1); }
.wardrobe-preview-text { flex: 1 1 180px; min-width: 0; }
.wardrobe-preview-name { margin: 0; font-size: var(--fs-title-sm); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.wardrobe-preview-hint { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-label); }
.wardrobe-preview-reset[hidden] { display: none; }
.wardrobe-balance { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-weight: var(--fw-semibold); }
.wardrobe-balance .icon { width: 16px; height: 16px; }
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.wardrobe-grid--banners { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.cosmetic-card { display: grid; gap: 10px; align-content: space-between; min-width: 0; padding: 12px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border-subtle); transition: border-color var(--dur-fast) var(--ease-out); }
.cosmetic-card[data-selected="true"] { border-color: var(--accent-400, #a78bfa); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.5); }
.cosmetic-card[data-equipped="true"] { border-color: rgba(52, 211, 153, 0.55); }
.cosmetic-try { display: grid; gap: 8px; justify-items: center; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; border-radius: var(--radius-md); }
.cosmetic-try:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cosmetic-thumb { display: grid; place-items: center; width: 100%; min-height: 76px; }
.cosmetic-card[data-type="banner"] .cosmetic-thumb { min-height: 64px; }
.cosmetic-banner--thumb { width: 100%; height: 64px; border-radius: var(--radius-md); }
.cosmetic-title { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.cosmetic-name { font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); }
.cosmetic-desc { color: var(--text-3); font-size: var(--fs-label); line-height: 1.4; }
.cosmetic-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cosmetic-price { gap: 6px; font-weight: var(--fw-semibold); }
.cosmetic-price--coins { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.cosmetic-price--rub { color: var(--text-1); }
.cosmetic-card[data-owned="true"] .cosmetic-price,
.cosmetic-card[data-owned="false"] .cosmetic-equip { display: none; }
.cosmetic-card[data-equipped="true"] .cosmetic-equip { background: var(--surface-3); }
.wardrobe-note { text-align: center; }


/* =========================================================================
   65 ECLIPSE INFINITY: БЕЙДЖ, ТАРИФЫ, ЭКСКЛЮЗИВНАЯ КОСМЕТИКА
   ========================================================================= */
/* Бейдж INFINITY: тёмная капсула с вращающейся радужно-золотой каймой и мягким свечением. */
@keyframes infinity-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.pill--infinity {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: transparent;
  color: #fde68a;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45), 0 0 24px rgba(245, 158, 11, 0.2);
}
.pill--infinity::before {
  content: "";
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 50%;
  width: max(220%, 180px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: conic-gradient(#f59e0b, #ec4899, #8b5cf6, #22d3ee, #f59e0b);
  animation: infinity-spin 3.2s linear infinite;
}
.pill--infinity::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, #0b0a1a, #1e1b4b 55%, #2e1065);
}
.pill--infinity .pill-icon { color: #fbbf24; fill: none; stroke: currentColor; }



/* Окно PRO: блок INFINITY. */
.infinity-offer {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid rgba(192, 132, 252, 0.4);
  background: radial-gradient(120% 70% at 50% 0%, rgba(168, 85, 247, 0.16), transparent 62%), #0c0c14;
  box-shadow: 0 0 40px -10px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(224, 231, 255, 0.06);
}
.infinity-offer[data-focus="true"] { border-color: rgba(192, 132, 252, 0.75); box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.45), 0 0 44px -8px rgba(168, 85, 247, 0.45); }
.infinity-offer-title { margin: 0; font-size: var(--fs-title-sm); font-weight: var(--fw-bold); }
.infinity-offer-status { margin: 0; color: #e0e7ff; font-weight: var(--fw-semibold); }
.infinity-offer-status[hidden] { display: none; }
.infinity-perks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; justify-self: stretch; text-align: left; }
.infinity-perks li { display: flex; align-items: center; gap: 10px; color: var(--text-1); font-size: var(--fs-body-sm); }
.infinity-perks .icon { width: 18px; height: 18px; flex: none; color: #e0e7ff; }
.infinity-price { margin: 0; color: var(--text-2); font-size: var(--fs-body-sm); }
.infinity-price span[id] { color: var(--text-1); font-weight: var(--fw-bold); }

/* Гардероб: эксклюзив INFINITY — вместо цен капсула «Только INFINITY». */
.cosmetic-exclusive { display: none; }
.cosmetic-card[data-exclusive="true"] .cosmetic-price { display: none; }
.cosmetic-card[data-exclusive="true"][data-owned="false"] .cosmetic-exclusive { display: inline-flex; }
.cosmetic-card[data-exclusive="true"] { border-color: rgba(251, 191, 36, 0.35); }

/* --- Рамка «Бесконечная пустота»: горизонт событий с кольцом аккреции и знаком бесконечности --- */
.avatar-frame[data-frame="frame_infinity_void"]::before {
  background: conic-gradient(#000, #312e81, #22d3ee 18%, #000 30%, #7c3aed 52%, #000 64%, #f472b6 84%, #000);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--fr) * 1.5 - 0.5px), #000 calc(100% - var(--fr) * 1.5));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--fr) * 1.5 - 0.5px), #000 calc(100% - var(--fr) * 1.5));
  animation: cos-spin 5s linear infinite;
}
.avatar-frame[data-frame="frame_infinity_void"]::after {
  box-shadow: 0 0 12px 2px rgba(34, 211, 238, 0.35), 0 0 26px 6px rgba(124, 58, 237, 0.35);
  animation: cos-pulse 3s ease-in-out infinite alternate;
}
.avatar-frame[data-frame="frame_infinity_void"] .frame-deco {
  display: block;
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--fg) * -1);
  width: 34%;
  transform: translate(-50%, 46%);
  padding: 2px;
  border-radius: 50%;
  background: radial-gradient(circle, #0b0a1a 62%, transparent 72%);
  color: #67e8f9;
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.8));
  pointer-events: none;
}
.avatar-frame[data-frame="frame_infinity_void"] .frame-deco .icon { fill: none; stroke: currentColor; stroke-width: 2.4; }

/* --- Рамка «Небесное золото»: двойное золотое кольцо и звёзды, вращающиеся навстречу --- */
@keyframes cos-spin-rev { to { transform: rotate(-360deg); } }
.avatar-frame[data-frame="frame_celestial_gold"]::before {
  background: conic-gradient(#b45309, #fef3c7, #f59e0b, #fffbeb, #d97706, #fde68a, #b45309);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6.5px), #000 calc(100% - 4.5px), transparent calc(100% - 4px), transparent calc(100% - 2.2px), #000 calc(100% - 1.7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6.5px), #000 calc(100% - 4.5px), transparent calc(100% - 4px), transparent calc(100% - 2.2px), #000 calc(100% - 1.7px));
  animation: cos-spin 10s linear infinite;
}
.avatar-frame[data-frame="frame_celestial_gold"]::after {
  inset: calc(var(--fg) * -1.8);
  background:
    radial-gradient(circle at 50% 2%, #fffbeb 0 1.8px, transparent 3px),
    radial-gradient(circle at 98% 50%, #fde68a 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 50% 98%, #fffbeb 0 1.8px, transparent 3px),
    radial-gradient(circle at 2% 50%, #fde68a 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 16% 16%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 84% 84%, #fff 0 1px, transparent 2px);
  filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.9));
  animation: cos-twinkle 2.2s ease-in-out infinite, cos-spin-rev 16s linear infinite;
}

/* --- Баннер «Туманность бесконечности»: светящийся знак бесконечности в глубокой туманности --- */
@keyframes cos-infinity-glow { from { opacity: 0.7; transform: translate(-50%, -50%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } }
.cosmetic-banner[data-banner="banner_infinity_nebula"] {
  background:
    radial-gradient(ellipse 55% 75% at 50% 55%, rgba(124, 58, 237, 0.6), transparent 62%),
    radial-gradient(ellipse 40% 60% at 18% 30%, rgba(34, 211, 238, 0.25), transparent 60%),
    radial-gradient(ellipse 40% 60% at 82% 70%, rgba(236, 72, 153, 0.3), transparent 60%),
    linear-gradient(160deg, #030014, #0b0626 60%, #120a2e);
}
.cosmetic-banner[data-banner="banner_infinity_nebula"]::before {
  left: 50%;
  top: 50%;
  width: min(62%, 240px);
  aspect-ratio: 140 / 60;
  transform: translate(-50%, -50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 60'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%2322d3ee'/%3E%3Cstop offset='.5' stop-color='%23c084fc'/%3E%3Cstop offset='1' stop-color='%23fbbf24'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M70 30 C58 12 30 12 30 30 C30 48 58 48 70 30 C82 12 110 12 110 30 C110 48 82 48 70 30 Z' fill='none' stroke='url(%23g)' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.85)) drop-shadow(0 0 16px rgba(34, 211, 238, 0.45));
  animation: cos-infinity-glow 3.6s ease-in-out infinite alternate;
}
.cosmetic-banner[data-banner="banner_infinity_nebula"]::after {
  inset: 0;
  background:
    radial-gradient(1px 1px at 10% 22%, #fff, transparent), radial-gradient(1px 1px at 28% 78%, #e9d5ff, transparent),
    radial-gradient(1.5px 1.5px at 44% 16%, #fff, transparent), radial-gradient(1px 1px at 62% 86%, #fff, transparent),
    radial-gradient(1px 1px at 78% 18%, #a5f3fc, transparent), radial-gradient(1.5px 1.5px at 90% 52%, #fff, transparent),
    radial-gradient(1px 1px at 6% 64%, #fff, transparent), radial-gradient(1px 1px at 96% 88%, #e9d5ff, transparent);
  animation: cos-twinkle 2.8s ease-in-out infinite;
}

/* --- Баннер «Королевский аметист»: грани кристалла, золотая филигрань и бегущий блик --- */
@keyframes cos-shimmer { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.cosmetic-banner[data-banner="banner_royal_amethyst"] {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 140' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23fbbf24' stroke-opacity='.75' stroke-width='1.1'%3E%3Cpath d='M0 128 H400'/%3E%3Cpath d='M0 12 C30 12 34 34 58 30 C78 26 70 6 92 10'/%3E%3Cpath d='M400 12 C370 12 366 34 342 30 C322 26 330 6 308 10'/%3E%3Ccircle cx='200' cy='128' r='3' fill='%23fbbf24'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat,
    repeating-conic-gradient(from 20deg at 30% 62%, rgba(216, 180, 254, 0.16) 0deg 12deg, transparent 12deg 30deg),
    repeating-conic-gradient(from 0deg at 74% 38%, rgba(192, 132, 252, 0.14) 0deg 10deg, transparent 10deg 26deg),
    linear-gradient(135deg, #1a0533, #3b0764 45%, #581c87 70%, #2e1065);
}
.cosmetic-banner[data-banner="banner_royal_amethyst"]::after {
  inset: 0 -50%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.2) 50%, transparent 60%);
  animation: cos-shimmer 4.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pill--infinity::before { animation: none; }
}


/* =========================================================================
   66 @USERNAME: моноширинная приглушённая подпись под именем (профиль, партнёр, Топ)
   ========================================================================= */
.handle {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold);
  color: var(--text-3); letter-spacing: 0; overflow-wrap: anywhere;
}
.handle:empty { display: none; }
.partner-handle { margin: 0; }
.partner-handle[hidden] { display: none; }
.podium-handles { margin: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

/* =========================================================================
   67 ТАРИФЫ: Free (матовая) · PRO (фиолетовый акцент) · INFINITY (флагман)
   ========================================================================= */
.pricing-grid { display: grid; gap: 28px 16px; margin-top: 40px; align-items: stretch; }
@media (min-width: 760px) { .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 760px) and (max-width: 1023px) { .price-card--infinity { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 28px 24px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
}
.price-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.price-name { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: var(--fs-title); line-height: 28px; font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.price-tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #1e1e2a;
  color: var(--text-3);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.price-tag--pro { color: #ddd6fe; border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.14); }
.price-value { margin: 0; font-size: 40px; line-height: 44px; font-weight: 800; letter-spacing: -0.03em; }
.price-period { font-size: var(--fs-body-sm); font-weight: var(--fw-medium); letter-spacing: 0; color: var(--text-3); }
.price-alt { margin: -8px 0 0; color: var(--text-3); font-size: var(--fs-label); line-height: 20px; }
/* Список растягивается: кнопки всех трёх карточек стоят на одной линии. */
.price-list {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 4px 0 0;
  padding: 18px 0 0;
  list-style: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-2);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}
.price-list li { display: flex; align-items: flex-start; gap: 10px; }
.price-list .icon { width: 18px; height: 18px; margin-top: 1px; flex: none; color: var(--text-3); }
.price-card .btn { margin-top: 8px; }

/* Free — матовая, без свечения. */
.price-card--free { background: #0d0d12; border-color: #1e1e2a; }

/* PRO — аккуратный фиолетовый акцент. */
.price-card--pro {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.09), transparent 45%), #0f0f17;
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 18px 44px -26px rgba(139, 92, 246, 0.6);
}
.price-card--pro .price-list .icon { color: #a78bfa; }

/* INFINITY — обсидиан, аметистовая рамка, платиново-золотая кайма сверху. */
.price-card--infinity {
  isolation: isolate;
  background: radial-gradient(120% 60% at 50% 0%, rgba(168, 85, 247, 0.16), transparent 62%), #0c0c14;
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 40px -10px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(224, 231, 255, 0.06);
}
.price-card--infinity::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c084fc 20%, #e0e7ff 50%, #fbbf24 80%, transparent);
  pointer-events: none;
}
.price-card--infinity .price-list { border-top-color: rgba(192, 132, 252, 0.18); color: var(--text-1); }
.price-card--infinity .price-list .icon { color: #e0e7ff; }
.price-name-icon { width: 24px; height: 24px; color: #e0e7ff; stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.55)); }
.price-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(135deg, #c084fc 0%, #e0e7ff 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.price-crown {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: #0c0c14;
  color: #fde68a;
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 18px -6px rgba(251, 191, 36, 0.45);
}
.price-crown .icon { width: 13px; height: 13px; color: #fbbf24; }

/* Кнопка INFINITY: плотный фиолетово-индиговый градиент с внутренним бликом (лендинг и окно подписки). */
.btn--infinity {
  border-radius: 9999px;
  border-color: transparent;
  color: #fff;
  font-weight: var(--fw-bold);
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 10px 28px -8px rgba(124, 58, 237, 0.65);
}
.btn--infinity .icon { fill: none; stroke: currentColor; }
.btn--infinity:focus-visible { outline: none; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 0 2px #0c0c14, 0 0 0 4px #c084fc; }
@media (hover: hover) and (pointer: fine) { .btn--infinity:hover:not(:disabled) { filter: brightness(1.1); } }

/* =========================================================================
   68 ВЕРХНЯЯ ПОЛОСА ЗАГРУЗКИ при переходах между страницами
   ========================================================================= */
.top-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #7c3aed 0%, #c084fc 60%, #e0e7ff 100%);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.7);
}
.top-loader[data-state="loading"] { opacity: 1; transform: scaleX(0.85); transition: transform 2.4s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 0.1s linear; }
.top-loader[data-state="done"] { opacity: 0; transform: scaleX(1); transition: transform 0.2s ease-out, opacity 0.25s linear 0.15s; }
@media (prefers-reduced-motion: reduce) {
  .top-loader[data-state="loading"] { transform: scaleX(1); transition: opacity 0.1s linear; }
  .top-loader[data-state="done"] { transition: opacity 0.25s linear; }
}

/* =========================================================================
   69 ECLIPSE INFINITY — ОГНЕННАЯ ПАЛИТРА (отдельно от рубинового ADMIN)
   ========================================================================= */
/* Капсулы INFINITY: монолитная огненная заливка, белый текст и белый знак бесконечности. */
.pill--infinity {
  overflow: visible;
  background: #ff4d26;
  color: #fff;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 2px 14px rgba(255, 77, 38, 0.4);
}
.pill--infinity::before,
.pill--infinity::after { content: none; display: none; animation: none; }
.pill--infinity .pill-icon { color: #fff; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* Карточка тарифа: тонкая рамка цвета огня и тёплый эмбиент. */
.price-card--infinity {
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 87, 34, 0.12), transparent 62%), #0c0c14;
  border-color: rgba(255, 87, 34, 0.45);
  box-shadow: 0 0 30px -8px rgba(255, 87, 34, 0.2), inset 0 1px 0 rgba(255, 237, 230, 0.05);
}
.price-card--infinity::before { background: linear-gradient(90deg, transparent, #ff5722 25%, #ff8a65 50%, #ff3d00 75%, transparent); }
.price-card--infinity .price-list { border-top-color: rgba(255, 87, 34, 0.2); }
.price-card--infinity .price-list .icon { color: #ff8a65; }
.price-name-icon { color: #fff; filter: none; }
.price-name-text { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #fff; }
.price-crown {
  border-color: transparent;
  background: #ff4d26;
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 16px rgba(255, 77, 38, 0.4);
}
.price-crown .icon { color: #fff; }
.icon--shirt { width: 18px; height: 18px; }

/* Кнопка «Выбрать INFINITY» (лендинг и окно подписки): плотный огненный градиент с рассеянным свечением. */
.btn--infinity {
  color: #fff;
  background: linear-gradient(135deg, #ff5722 0%, #ff3811 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 4px 20px rgba(255, 74, 28, 0.35);
}
.btn--infinity:focus-visible { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 0 2px #0c0c14, 0 0 0 4px #ff8a65; }

/* Блок INFINITY в окне подписки — в той же палитре. */
.infinity-offer {
  border-color: rgba(255, 87, 34, 0.45);
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 87, 34, 0.12), transparent 62%), #0c0c14;
  box-shadow: 0 0 30px -8px rgba(255, 87, 34, 0.2), inset 0 1px 0 rgba(255, 237, 230, 0.05);
}
.infinity-offer[data-focus="true"] { border-color: rgba(255, 87, 34, 0.75); box-shadow: 0 0 0 1px rgba(255, 87, 34, 0.45), 0 0 40px -8px rgba(255, 87, 34, 0.4); }
.infinity-offer-status { color: #ffccbc; }
.infinity-perks .icon { color: #ff8a65; }

/* =========================================================================
   70 ЮЗЕРНЕЙМЫ АККАУНТА: блок в CRM и переключатель основного в профиле
   ========================================================================= */
.admin-usernames { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border-subtle); }
.admin-usernames-title { margin: 0; color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-semibold); letter-spacing: 0.06em; text-transform: uppercase; }
.admin-usernames-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.admin-username {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 4px 2px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-default);
  background: var(--surface-1);
}
.admin-username:has(.admin-username-remove[hidden]) { padding-right: 6px; }
.admin-username-name { color: var(--text-1); }
.admin-username-remove { width: 28px; height: 28px; min-width: 28px; padding: 0; border-radius: 9999px; color: var(--text-3); }
.admin-username-remove .icon { width: 14px; height: 14px; }
.admin-username-remove[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .admin-username-remove:hover { color: var(--danger); background: rgba(239, 68, 68, 0.12); } }
.admin-usernames-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-usernames-input { flex: 1 1 160px; min-width: 0; height: 36px; padding: 0 12px; font-size: var(--fs-label); }

.username-switch { position: relative; display: grid; justify-items: center; gap: 8px; margin: -6px 0 0; }
.username-switch[hidden] { display: none; }
.username-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-default);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.username-switch-btn:focus-visible { outline: 2px solid var(--accent-400, #a78bfa); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .username-switch-btn:hover { border-color: var(--border-strong); } }
.username-switch-count { padding: 1px 6px; border-radius: 9999px; background: rgba(139, 92, 246, 0.18); color: #ddd6fe; font-size: 11px; line-height: 14px; font-weight: var(--fw-bold); }
.username-switch-chevron { width: 14px; height: 14px; transition: transform 0.15s ease; }
.username-switch-btn[aria-expanded="true"] .username-switch-chevron { transform: rotate(180deg); }
.username-switch-menu { width: min(100%, 300px); display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--surface-1); text-align: left; }
.username-switch-menu[hidden] { display: none; }
.username-switch-title { margin: 0; color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.username-switch-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.username-switch-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm, 10px);
  background: transparent;
  color: var(--text-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.username-switch-option .handle { color: inherit; font-size: var(--fs-body-sm); }
.username-switch-option[aria-pressed="true"] { background: rgba(139, 92, 246, 0.12); }
.username-switch-option:focus-visible { outline: 2px solid var(--accent-400, #a78bfa); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .username-switch-option:hover { background: var(--surface-2); } }
@media (prefers-reduced-motion: reduce) { .username-switch-btn, .username-switch-chevron { transition: none; } }
.admin-usernames-form .pill-icon { fill: none; stroke: currentColor; stroke-width: 2.4; }

/* =========================================================================
   71 ОКНО ПОДПИСКИ ПО ТАРИФУ: data-tier (free | pro | infinity), data-show (pro | infinity)
   ========================================================================= */
.pro-tier-tabs { margin: 4px 0 0; }
.pro-tier-tabs[hidden] { display: none; }
.pro-tier-tabs .icon { width: 16px; height: 16px; }
.pro-tier-tabs .segmented-item { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.dialog--pro .eclipse--pro { --ring-a: #a78bfa; --ring-b: #e879f9; --corona: #c084fc; }
.dialog--pro[data-show="infinity"] .eclipse--pro { --ring-a: #ff5722; --ring-b: #ffab40; --corona: #ff3d00; }
.dialog--pro[data-show="infinity"] .infinity-offer { margin-top: 4px; }
.dialog--pro[data-show="infinity"] .pro-active-state { border-color: rgba(255, 87, 34, 0.35); background: rgba(255, 87, 34, 0.07); }

/* =========================================================================
   72 ЭКСКЛЮЗИВ ADMIN: рамка «Корона администратора» и баннер «Командный центр»
   ========================================================================= */
/* Рамка: рубиновое кольцо с бегущим бликом, мягкое красное свечение и белая корона сверху. */
.avatar-frame[data-frame="frame_admin_crown"]::before {
  background: conic-gradient(from 0deg, #7f1d1d, #dc2626 18%, #fecaca 24%, #ef4444 30%, #991b1b 50%, #dc2626 68%, #fca5a5 74%, #b91c1c 80%, #7f1d1d);
  animation: cos-spin 6s linear infinite;
}
.avatar-frame[data-frame="frame_admin_crown"]::after {
  box-shadow: 0 0 12px 1px rgba(239, 68, 68, 0.55), 0 0 26px 4px rgba(220, 38, 38, 0.3);
  animation: cos-pulse 2.2s ease-in-out infinite alternate;
}
.avatar-frame[data-frame="frame_admin_crown"] .frame-deco {
  display: block;
  position: absolute;
  z-index: 3;
  top: calc(var(--fg) * -1);
  left: 50%;
  width: 38%;
  transform: translate(-50%, -58%);
  color: #fff;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.95)) drop-shadow(0 0 10px rgba(220, 38, 38, 0.6));
  pointer-events: none;
}

/* Баннер: тёмный рубин, алая сетка, сканирующий луч и корона-водяной знак справа. */
.cosmetic-banner[data-banner="banner_admin_command"] {
  background:
    radial-gradient(120% 140% at 85% 50%, rgba(220, 38, 38, 0.38), transparent 60%),
    linear-gradient(135deg, #12060a 0%, #2a0a10 55%, #12060a 100%);
}
.cosmetic-banner[data-banner="banner_admin_command"]::before {
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fecaca' fill-opacity='.22' d='M3.2 7.6 7.8 11 12 4.5l4.2 6.5 4.6-3.4-1.9 10.4H5.1Z'/%3E%3Crect fill='%23fecaca' fill-opacity='.22' x='5' y='19' width='14' height='2' rx='1'/%3E%3C/svg%3E") right 14px center / 64px 64px no-repeat,
    repeating-linear-gradient(0deg, rgba(248, 113, 113, 0.12) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, rgba(248, 113, 113, 0.12) 0 1px, transparent 1px 18px),
    linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.7), transparent) left bottom / 100% 1px no-repeat;
}
.cosmetic-banner[data-banner="banner_admin_command"]::after {
  inset: 0 -40%;
  background: linear-gradient(100deg, transparent 42%, rgba(254, 202, 202, 0.22) 50%, transparent 58%);
  animation: cos-shimmer 4s ease-in-out infinite;
}

/* Карточка в гардеробе: рубиновая кайма вместо золотой. */
.cosmetic-card[data-admin="true"] { border-color: rgba(239, 68, 68, 0.45); }

/* =========================================================================
   73 ГАРДЕРОБ v2: кнопки покупки, редкость, новые рамки и баннеры
   ========================================================================= */
/* Кнопки: крупная зона нажатия (≥ 44px), без «уезжания» при нажатии; превью и декор не ловят клики. */
.cosmetic-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cosmetic-actions > .cosmetic-price, .cosmetic-actions > .cosmetic-equip { position: relative; z-index: 2; width: 100%; min-height: 44px; padding: 10px 12px; justify-content: center; cursor: pointer; }
.cosmetic-actions > .cosmetic-equip, .cosmetic-actions > .cosmetic-exclusive { grid-column: 1 / -1; }
.cosmetic-actions > .cosmetic-exclusive { justify-self: center; }
.cosmetic-card[data-exclusive="true"] .cosmetic-actions > :not(.cosmetic-price) { grid-column: 1 / -1; }
.cosmetic-actions .pill--button:active, .cosmetic-actions .btn:active { transform: none; filter: brightness(0.9); }
.cosmetic-price--coins { border: 1px solid rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.12); font-size: var(--fs-body-sm); }
.cosmetic-price--rub { border: 1px solid var(--border-default); background: var(--surface-1); font-size: var(--fs-body-sm); }
@media (hover: hover) and (pointer: fine) {
  .cosmetic-price--coins:hover:not(:disabled) { background: rgba(251, 191, 36, 0.2); }
  .cosmetic-price--rub:hover:not(:disabled) { border-color: var(--border-strong); }
}
.cosmetic-price:disabled, .cosmetic-equip:disabled { opacity: 0.6; cursor: progress; }
.cosmetic-thumb, .cosmetic-thumb * { pointer-events: none; }

/* Редкость: капсула у названия и тонкая кайма карточки. */
.cosmetic-rarity { padding: 2px 8px; border-radius: 9999px; font-size: 11px; line-height: 16px; font-weight: var(--fw-semibold); letter-spacing: 0.02em; border: 1px solid currentColor; }
.cosmetic-rarity[hidden] { display: none; }
.cosmetic-card[data-rarity="common"] .cosmetic-rarity { color: #a1a1aa; }
.cosmetic-card[data-rarity="rare"] .cosmetic-rarity { color: #60a5fa; }
.cosmetic-card[data-rarity="epic"] .cosmetic-rarity { color: #c084fc; }
.cosmetic-card[data-rarity="legendary"] .cosmetic-rarity { color: #fbbf24; }
.cosmetic-card[data-rarity="rare"]:not([data-equipped="true"]):not([data-selected="true"]) { border-color: rgba(96, 165, 250, 0.28); }
.cosmetic-card[data-rarity="epic"]:not([data-equipped="true"]):not([data-selected="true"]) { border-color: rgba(192, 132, 252, 0.32); }
.cosmetic-card[data-rarity="legendary"]:not([data-equipped="true"]):not([data-selected="true"]) { border-color: rgba(251, 191, 36, 0.4); box-shadow: 0 0 18px -8px rgba(251, 191, 36, 0.45); }

@keyframes cos-glitch { 0%, 88%, 100% { transform: translate(0, 0); opacity: 0.85; } 90% { transform: translate(-1.5px, 0.5px); opacity: 1; } 93% { transform: translate(1.5px, -0.5px); } 96% { transform: translate(-0.5px, 0); } }
@keyframes cos-drift { from { transform: translateX(-8%); } to { transform: translateX(8%); } }

/* --- Рамки: милые и уютные --- */
.avatar-frame[data-frame="frame_lavender_haze"]::before { background: conic-gradient(#c3aed6, #e6d7ff, #b8a1e3, #f1e8ff, #c3aed6); animation: cos-spin 12s linear infinite; }
.avatar-frame[data-frame="frame_lavender_haze"]::after { box-shadow: 0 0 12px 1px rgba(195, 174, 214, 0.55); animation: cos-pulse 3.2s ease-in-out infinite alternate; }

.avatar-frame[data-frame="frame_strawberry_milk"]::before { background: linear-gradient(160deg, #fff0f3 0%, #ffb3c6 45%, #ff8fab 100%); }
.avatar-frame[data-frame="frame_strawberry_milk"]::after {
  inset: calc(var(--fg) * -0.55);
  border: 2px solid #ffe3ea;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 35%) top / 100% 50% no-repeat;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  filter: drop-shadow(0 3px 6px rgba(255, 105, 140, 0.45));
}

.avatar-frame[data-frame="frame_cloudy_dream"]::before { background: conic-gradient(from 90deg, #a1c4fd, #c2e9fb, #d6c8ff, #a1c4fd); animation: cos-spin 9s linear infinite; }
.avatar-frame[data-frame="frame_cloudy_dream"]::after { box-shadow: 0 0 14px 2px rgba(161, 196, 253, 0.55), 0 0 26px 6px rgba(194, 233, 251, 0.25); animation: cos-pulse 3.6s ease-in-out infinite alternate; }

.avatar-frame[data-frame="frame_sakura_blossom"]::before { background: conic-gradient(#ffb7c5, #ffdde1, #ff8fab, #ffe4ec, #ffb7c5); animation: cos-spin 10s linear infinite; }
.avatar-frame[data-frame="frame_sakura_blossom"]::after {
  inset: calc(var(--fg) * -1.8);
  background:
    radial-gradient(ellipse 3px 2px at 14% 30%, #ffc2d1 0 60%, transparent 70%),
    radial-gradient(ellipse 2.5px 1.8px at 86% 22%, #ffdde1 0 60%, transparent 70%),
    radial-gradient(ellipse 3px 2px at 90% 78%, #ff9fb6 0 60%, transparent 70%),
    radial-gradient(ellipse 2.5px 1.8px at 18% 84%, #ffd1dc 0 60%, transparent 70%),
    radial-gradient(ellipse 2px 1.5px at 52% 98%, #ffb7c5 0 60%, transparent 70%),
    radial-gradient(circle, rgba(255, 183, 197, 0.35), transparent 70%);
  animation: cos-twinkle 2.6s ease-in-out infinite;
}

/* --- Рамки: дарк и киберпанк --- */
.avatar-frame[data-frame="frame_eclipse_void"]::before { background: conic-gradient(from 0deg, #0b0014 0 52%, #3b0066 64%, #7f00ff 78%, #e100ff 90%, #0b0014); animation: cos-spin 4s linear infinite; }
.avatar-frame[data-frame="frame_eclipse_void"]::after { box-shadow: 0 0 12px 1px rgba(127, 0, 255, 0.65), 0 0 28px 5px rgba(225, 0, 255, 0.35); animation: cos-pulse 2.2s ease-in-out infinite alternate; }

.avatar-frame[data-frame="frame_cyber_glitch"]::before { background: conic-gradient(#00f2fe, #ff0844, #00f2fe, #ff0844, #00f2fe); animation: cos-spin 2.4s linear infinite; }
.avatar-frame[data-frame="frame_cyber_glitch"]::after { box-shadow: -2px 0 0 rgba(0, 242, 254, 0.75), 2px 0 0 rgba(255, 8, 68, 0.75), 0 0 16px rgba(0, 242, 254, 0.35); animation: cos-glitch 2.8s steps(1, end) infinite; }

/* --- Рамки: фэнтези и премиум --- */
.avatar-frame[data-frame="frame_stardust_gold"]::before { background: conic-gradient(#f6d365, #fda085, #fff3c4, #f6d365, #e8a96b, #fff3c4, #f6d365); animation: cos-spin 8s linear infinite; }
.avatar-frame[data-frame="frame_stardust_gold"]::after {
  inset: calc(var(--fg) * -1.9);
  background:
    radial-gradient(circle at 12% 28%, #fff3c4 0 1.2px, transparent 2px),
    radial-gradient(circle at 88% 20%, #f6d365 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 94% 64%, #fff 0 1px, transparent 1.8px),
    radial-gradient(circle at 70% 94%, #fda085 0 1.3px, transparent 2.2px),
    radial-gradient(circle at 22% 88%, #fff3c4 0 1.1px, transparent 2px),
    radial-gradient(circle at 4% 56%, #f6d365 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(253, 160, 133, 0.28), transparent 68%);
  animation: cos-twinkle 1.6s ease-in-out infinite;
}

.avatar-frame[data-frame="frame_emerald_dragon"]::before { background: conic-gradient(#064e3b, #10b981, #fde68a, #34d399, #065f46, #a7f3d0, #10b981, #064e3b); animation: cos-spin 5s linear infinite; }
.avatar-frame[data-frame="frame_emerald_dragon"]::after { box-shadow: 0 0 14px 2px rgba(16, 185, 129, 0.6), 0 0 30px 6px rgba(253, 230, 138, 0.22); animation: cos-pulse 1.8s ease-in-out infinite alternate; }

/* --- Баннеры: милые и уютные --- */
.cosmetic-banner[data-banner="banner_cozy_matcha"] { background: linear-gradient(120deg, #b7d8b0 0%, #d8e8c8 45%, #f3efe0 100%); }
.cosmetic-banner[data-banner="banner_cozy_matcha"]::before {
  inset: 0;
  background:
    radial-gradient(circle, rgba(63, 98, 58, 0.16) 1.2px, transparent 1.6px) 0 0 / 16px 16px,
    linear-gradient(90deg, transparent, rgba(63, 98, 58, 0.35), transparent) left 70% / 100% 1px no-repeat;
}

.cosmetic-banner[data-banner="banner_rose_quartz"] { background: linear-gradient(135deg, #f7c6d0 0%, #fbe3e8 45%, #e8c8f0 100%); }
.cosmetic-banner[data-banner="banner_rose_quartz"]::before {
  inset: 0;
  background:
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(-60deg, rgba(190, 120, 160, 0.16) 0 1px, transparent 1px 28px);
}
.cosmetic-banner[data-banner="banner_rose_quartz"]::after { inset: 0 -40%; background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, 0.45) 50%, transparent 58%); animation: cos-shimmer 5s ease-in-out infinite; }

.cosmetic-banner[data-banner="banner_pastel_sunset"] { background: linear-gradient(180deg, #c9b6ff 0%, #ffb3c7 48%, #ffcfa8 100%); }
.cosmetic-banner[data-banner="banner_pastel_sunset"]::before {
  inset: -20% -10%;
  background:
    radial-gradient(ellipse 22% 40% at 20% 40%, rgba(255, 255, 255, 0.45), transparent 70%),
    radial-gradient(ellipse 18% 34% at 62% 30%, rgba(255, 240, 245, 0.4), transparent 70%),
    radial-gradient(ellipse 26% 44% at 86% 64%, rgba(255, 255, 255, 0.35), transparent 70%);
  filter: blur(4px);
  animation: cos-drift 9s ease-in-out infinite alternate;
}

/* --- Баннеры: дарк и киберпанк --- */
.cosmetic-banner[data-banner="banner_vaporwave_dusk"] { background: linear-gradient(180deg, #2b1055 0%, #7b2a8c 45%, #d53a9d 72%, #f5a65b 100%); }
.cosmetic-banner[data-banner="banner_vaporwave_dusk"]::before {
  left: 50%;
  top: 18%;
  width: 34%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd36b 0%, #ff6ec7 100%);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 7px, transparent 7px 10px) bottom / 100% 55% no-repeat, linear-gradient(#000, #000) top / 100% 45% no-repeat;
  mask: repeating-linear-gradient(180deg, #000 0 7px, transparent 7px 10px) bottom / 100% 55% no-repeat, linear-gradient(#000, #000) top / 100% 45% no-repeat;
  box-shadow: 0 0 24px rgba(255, 110, 199, 0.6);
}
.cosmetic-banner[data-banner="banner_vaporwave_dusk"]::after {
  left: -20%;
  right: -20%;
  bottom: -30%;
  height: 70%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 110, 199, 0.55) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 110, 199, 0.55) 0 1px, transparent 1px 14px);
  transform: perspective(140px) rotateX(58deg);
  animation: cos-grid 3s linear infinite;
}

.cosmetic-banner[data-banner="banner_abyssal_aura"] { background: #0a0a0c; }
.cosmetic-banner[data-banner="banner_abyssal_aura"]::before { inset: -40%; background: radial-gradient(circle at 50% 60%, rgba(153, 27, 27, 0.75), rgba(69, 10, 10, 0.4) 30%, transparent 60%); animation: cos-pulse 4s ease-in-out infinite alternate; }
.cosmetic-banner[data-banner="banner_abyssal_aura"]::after { inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px); }

.cosmetic-banner[data-banner="banner_midnight_tokyo"] { background: linear-gradient(180deg, #050a24 0%, #0b1a4a 60%, #3a0d4f 100%); }
.cosmetic-banner[data-banner="banner_midnight_tokyo"]::before {
  left: -20%;
  right: -20%;
  bottom: -30%;
  height: 65%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 46, 151, 0.6) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(0deg, rgba(255, 46, 151, 0.6) 0 1px, transparent 1px 12px);
  transform: perspective(140px) rotateX(58deg);
  animation: cos-grid 2.6s linear infinite;
}
.cosmetic-banner[data-banner="banner_midnight_tokyo"]::after {
  left: 0;
  right: 0;
  bottom: 30%;
  height: 46%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath fill='%23070b22' d='M0 60V38h18V24h10v14h14V12h16v26h10V30h12v8h16V18h8V8h6v10h8v20h14V26h18v12h10V16h14v22h12V28h16v10h18V20h10V6h8v14h10v18h14V30h12v8h16V14h16v24h10V26h14v12h18V22h12v16h14V60Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  filter: drop-shadow(0 -2px 6px rgba(255, 46, 151, 0.55));
}

/* --- Баннеры: фэнтези и премиум --- */
.cosmetic-banner[data-banner="banner_dragon_scale"] { background: linear-gradient(135deg, #022c22 0%, #065f46 55%, #022c22 100%); }
.cosmetic-banner[data-banner="banner_dragon_scale"]::before {
  inset: 0;
  background:
    radial-gradient(circle at 50% 0, transparent 58%, rgba(253, 230, 138, 0.5) 60%, transparent 66%) 0 0 / 24px 14px,
    radial-gradient(circle at 50% 0, transparent 58%, rgba(253, 230, 138, 0.5) 60%, transparent 66%) 12px 7px / 24px 14px,
    radial-gradient(circle at 50% 30%, rgba(52, 211, 153, 0.35), transparent 70%);
}
.cosmetic-banner[data-banner="banner_dragon_scale"]::after { inset: 0 -40%; background: linear-gradient(100deg, transparent 42%, rgba(253, 230, 138, 0.3) 50%, transparent 58%); animation: cos-shimmer 4.5s ease-in-out infinite; }

.cosmetic-banner[data-banner="banner_starlight_galaxy"] {
  background:
    radial-gradient(ellipse 50% 70% at 30% 40%, rgba(88, 28, 135, 0.6), transparent 65%),
    radial-gradient(ellipse 40% 60% at 80% 60%, rgba(30, 64, 175, 0.5), transparent 65%),
    #030312;
}
.cosmetic-banner[data-banner="banner_starlight_galaxy"]::before {
  inset: 0;
  background:
    radial-gradient(circle at 8% 22%, #fff 0 0.8px, transparent 1.4px), radial-gradient(circle at 18% 70%, #c7d2fe 0 0.7px, transparent 1.3px),
    radial-gradient(circle at 29% 38%, #fff 0 1px, transparent 1.6px), radial-gradient(circle at 37% 84%, #e9d5ff 0 0.7px, transparent 1.3px),
    radial-gradient(circle at 46% 16%, #fff 0 0.8px, transparent 1.4px), radial-gradient(circle at 55% 58%, #fff 0 1.1px, transparent 1.7px),
    radial-gradient(circle at 63% 30%, #c7d2fe 0 0.7px, transparent 1.3px), radial-gradient(circle at 71% 80%, #fff 0 0.9px, transparent 1.5px),
    radial-gradient(circle at 80% 18%, #e9d5ff 0 1px, transparent 1.6px), radial-gradient(circle at 88% 48%, #fff 0 0.7px, transparent 1.3px),
    radial-gradient(circle at 95% 86%, #fff 0 0.9px, transparent 1.5px), radial-gradient(circle at 4% 92%, #c7d2fe 0 0.8px, transparent 1.4px);
  animation: cos-twinkle 2.4s ease-in-out infinite;
}
.cosmetic-banner[data-banner="banner_starlight_galaxy"]::after {
  inset: -30% -20%;
  background: linear-gradient(160deg, transparent 38%, rgba(196, 181, 253, 0.28) 48%, rgba(147, 197, 253, 0.2) 54%, transparent 64%);
  filter: blur(6px);
  animation: cos-drift 14s ease-in-out infinite alternate;
}

/* =========================================================================
   74 ПРИВЫЧКИ v2: Bento-сетка, акцентное свечение, люди на карточке, неделя, расписание, кап монет
   ========================================================================= */
:root {
  --tone-mint:   #6ee7b7;  --tone-mint-bg:   rgba(52, 211, 153, 0.14);
  --tone-olive:  #bef264;  --tone-olive-bg:  rgba(163, 190, 60, 0.15);
  --tone-coral:  #fda4af;  --tone-coral-bg:  rgba(251, 113, 133, 0.15);
}
[data-tone="mint"]  { --tone: var(--tone-mint);  --tone-bg: var(--tone-mint-bg); }
[data-tone="olive"] { --tone: var(--tone-olive); --tone-bg: var(--tone-olive-bg); }
[data-tone="coral"] { --tone: var(--tone-coral); --tone-bg: var(--tone-coral-bg); }

/* Bento: первая привычка — во всю ширину, остальные по две в ряд (на телефоне — одна под другой). */
@media (min-width: 640px) {
  .habit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habit-list > .habit-card:first-child { grid-column: 1 / -1; }
}
.habit-card { background-image: radial-gradient(120% 70% at 50% 125%, var(--tone-bg, var(--tone-violet-bg)), transparent 70%); }
.habit-card[data-state="done"] { background-image: radial-gradient(120% 80% at 50% 125%, color-mix(in srgb, var(--tone, var(--tone-violet)) 26%, transparent), transparent 72%); }

.habit-freq { color: var(--text-3); flex: none; }
.habit-meta .habit-streak { margin-left: auto; }

/* Мини-аватарки с рамками: выполнил — 100%, ещё нет — 35%. */
.habit-people { display: inline-flex; align-items: center; flex: none; margin-right: 2px; }
.habit-people:empty { display: none; }
.avatar-frame--xs { width: 26px; height: 26px; --fg: 3px; --fr: 2px; }
.avatar-frame--xs > .avatar { width: 100%; height: 100%; }
.avatar-frame--xs .frame-deco { display: none !important; }
.habit-person + .habit-person { margin-left: -6px; }
.habit-person > .avatar { box-shadow: 0 0 0 2px var(--surface-1); }
.habit-person[data-done="false"] { opacity: 0.35; }
.habit-person { transition: opacity var(--dur-base) var(--ease-out); }

/* Неделя: 7 капсул пн–вс, выполненные — акцентным цветом. */
.habit-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.habit-week-day { height: 6px; border-radius: 9999px; background: var(--surface-3); }
.habit-week-day[data-done="true"] { background: var(--tone, var(--tone-violet)); box-shadow: 0 0 8px color-mix(in srgb, var(--tone, var(--tone-violet)) 55%, transparent); }
.habit-week-day[data-off="true"]:not([data-done="true"]) { opacity: 0.35; }
.habit-week-day[data-today="true"]:not([data-done="true"]) { box-shadow: inset 0 0 0 1px var(--border-strong); }

/* Диалог: расписание и «общая для пары». */
.freq-weekly, .freq-days { margin-top: 10px; }
.freq-weekly[hidden], .freq-days[hidden] { display: none; }
.freq-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.freq-day { position: relative; display: grid; }
.freq-day input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.freq-day span { display: grid; place-items: center; min-height: 44px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--surface-2); font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-2); transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.freq-day input:checked + span { background: var(--accent-900, rgba(139, 92, 246, 0.25)); border-color: var(--accent-400, #a78bfa); color: var(--text-1); }
.freq-day input:focus-visible + span { box-shadow: var(--focus-ring); }
.habit-shared { margin-top: 4px; }
.habit-shared[hidden], .habit-shared-note[hidden] { display: none; }

/* Плашка дневного лимита монет. */
.coin-cap { gap: 4px; color: var(--text-2); }
.coin-cap .pill-icon { color: var(--warn, #fbbf24); }
.coin-cap[data-full="true"] { color: #fde68a; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.5); }

/* Узкие Bento-карточки (по две в ряд): сверху иконка и управление, название с частотой и серией — отдельной строкой. */
@media (min-width: 640px) {
  .habit-list > .habit-card:not(:first-child) .habit-row { flex-wrap: wrap; row-gap: 10px; }
  .habit-list > .habit-card:not(:first-child) .habit-text { order: 10; flex: 1 0 100%; }
  .habit-list > .habit-card:not(:first-child) .habit-people { margin-left: auto; }
  .habit-list > .habit-card:not(:first-child) .habit-row { column-gap: 8px; }
  .habit-list > .habit-card:not(:first-child) .habit-icon { width: 38px; height: 38px; }
  .habit-list > .habit-card:not(:first-child) .habit-more { width: 36px; }
}

/* =========================================================================
   75 ПОДДЕРЖКА БЕЗ РЕГИСТРАЦИИ: форма гостевого обращения
   ========================================================================= */
.guest-support-form { display: grid; gap: 14px; }
.guest-support-sent { display: none; justify-items: center; gap: 10px; padding: 12px 0 4px; text-align: center; }
#guest-support-dialog[data-state="sent"] .guest-support-form { display: none; }
#guest-support-dialog[data-state="sent"] .guest-support-sent { display: grid; }
.guest-support-sent-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(59, 130, 246, 0.16); color: var(--support-2, #60a5fa); }
.guest-support-sent-icon .icon { width: 28px; height: 28px; }
.guest-support-sent-title { margin: 0; font-size: var(--fs-title-sm); font-weight: var(--fw-bold); }
button.landing-link { appearance: none; border: 0; background: none; font-family: inherit; cursor: pointer; }

/* =========================================================================
   76 ЗАДАНИЯ НЕДЕЛИ
   ========================================================================= */
.quests { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: rgba(18, 18, 26, 0.86); }
.quests[hidden] { display: none; }
.quests-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quests-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); }
.quests-title .icon { width: 18px; height: 18px; color: var(--warn, #fbbf24); }
.quests-left { color: var(--text-3); font-size: var(--fs-caption); }
.quests-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.quest { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
.quest-text { min-width: 0; }
.quest-name { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-semibold); }
.quest-hint { margin: 0; color: var(--text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.quest-reward { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 9999px; background: rgba(251, 191, 36, 0.12); color: var(--warn, #fbbf24); font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.quest-reward .icon { width: 14px; height: 14px; }
.quest-bar { grid-column: 1 / -1; }
.quest[data-done="true"] .quest-name { color: var(--success, #34d399); }
.quest[data-done="true"] .quest-reward { background: rgba(52, 211, 153, 0.14); color: var(--success, #34d399); }
.quest[data-done="true"] .bar-fill { background: var(--success, #34d399); }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Иконки заданий: плитка с цветом группы, выполненное — зелёное. */
.quest { grid-template-columns: auto minmax(0, 1fr) auto; }
.quest-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--q-bg); color: var(--q-fg); box-shadow: inset 0 0 0 1px var(--q-line); }
.quest-icon .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.quest[data-group="days"]   { --q-fg: #c4b5fd; --q-bg: rgba(139, 92, 246, 0.16); --q-line: rgba(167, 139, 250, 0.28); }
.quest[data-group="habits"] { --q-fg: #fcd34d; --q-bg: rgba(251, 191, 36, 0.14); --q-line: rgba(251, 191, 36, 0.26); }
.quest[data-group="social"] { --q-fg: #f9a8d4; --q-bg: rgba(236, 72, 153, 0.14); --q-line: rgba(244, 114, 182, 0.26); }
.quest[data-group="shop"]   { --q-fg: #6ee7b7; --q-bg: rgba(52, 211, 153, 0.13); --q-line: rgba(52, 211, 153, 0.26); }
.quest[data-group="shared"] { --q-fg: #7dd3fc; --q-bg: rgba(56, 189, 248, 0.14); --q-line: rgba(56, 189, 248, 0.26); }
.quest[data-done="true"] .quest-icon { --q-fg: #34d399; --q-bg: rgba(52, 211, 153, 0.16); --q-line: rgba(52, 211, 153, 0.4); }
