/* ===== tokens.css ===== */
/* ==========================================================================
   Raffly — дизайн-токены
   Две темы: day (тёплая бумага) и evening (графит, не чёрный).
   Все цвета, отступы, радиусы и тени — только здесь.
   ========================================================================== */

:root {
  /* Палитра — светлая тема (по умолчанию) */
  --bg: #faf8f4;
  --bg-elevated: #fffdfa;
  --surface: #ffffff;
  --surface-2: #f2eee7;
  --surface-3: #e9e3d9;
  --ink: #16181d;
  --ink-soft: #33373f;
  --muted: #5c6373;
  --muted-2: #838a99;
  --line: #e7e1d7;
  --line-strong: #d6cec0;

  --accent: #5b4be6;
  --accent-hover: #4a3ad4;
  --accent-active: #3d2fbd;
  --accent-ink: #ffffff;
  --accent-soft: #ece9ff;
  --accent-line: #cdc6ff;

  --gold: #f0a01a;
  --gold-soft: #fdf0d8;
  --success: #17845c;
  --success-soft: #ddf4e9;
  --danger: #c2413b;
  --danger-soft: #fbe6e4;

  --shadow-sm: 0 1px 2px rgb(22 24 29 / 6%), 0 1px 1px rgb(22 24 29 / 4%);
  --shadow-md: 0 6px 20px -8px rgb(22 24 29 / 16%), 0 2px 6px -2px rgb(22 24 29 / 8%);
  --shadow-lg: 0 30px 60px -30px rgb(22 24 29 / 28%), 0 8px 24px -12px rgb(22 24 29 / 14%);
  --shadow-accent: 0 10px 30px -12px rgb(91 75 230 / 45%);

  /* Геометрия */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  /* Шкала отступов 4px */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Типографика */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.875rem;   /* 14 */
  --text-base: 1rem;     /* 16 */
  --text-lg: 1.125rem;   /* 18 */
  --text-xl: 1.375rem;   /* 22 */
  --text-2xl: 1.75rem;   /* 28 */
  --text-3xl: 2.25rem;   /* 36 */
  --text-4xl: 3rem;      /* 48 */
  --text-5xl: 3.75rem;   /* 60 */

  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Контейнер и движение */
  --container: 1160px;
  --container-narrow: 760px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  --header-h: 68px;

  color-scheme: light;
}

/* Вечерняя тема — тёплый графит, без чистого чёрного и без белого текста */
[data-theme="evening"] {
  --bg: #22262f;
  --bg-elevated: #272c37;
  --surface: #2b303c;
  --surface-2: #333948;
  --surface-3: #3c4355;
  --ink: #ecedf4;
  --ink-soft: #d7dae6;
  --muted: #a5adc0;
  --muted-2: #838b9e;
  --line: #3a4152;
  --line-strong: #4a5266;

  --accent: #8b7bff;
  --accent-hover: #9a8dff;
  --accent-active: #7a68f5;
  --accent-ink: #171a22;
  --accent-soft: #322d4d;
  --accent-line: #4a4173;

  --gold: #ffb84d;
  --gold-soft: #3d3323;
  --success: #3ecf94;
  --success-soft: #213a30;
  --danger: #f0796f;
  --danger-soft: #3d2a29;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-md: 0 8px 24px -12px rgb(0 0 0 / 55%), 0 2px 6px -2px rgb(0 0 0 / 35%);
  --shadow-lg: 0 40px 70px -40px rgb(0 0 0 / 70%), 0 10px 30px -18px rgb(0 0 0 / 50%);
  --shadow-accent: 0 10px 30px -12px rgb(139 123 255 / 45%);

  color-scheme: dark;
}

/* ===== base.css ===== */
/* ==========================================================================
   Raffly — база: сброс, типографика, каркас страницы, шапка, подвал
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-base) var(--ease-in-out),
    color var(--dur-base) var(--ease-in-out);
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-snug);
  text-wrap: balance;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

[hidden] {
  display: none !important;
}

/* Пропуск навигации для клавиатуры */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-5);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--s-4);
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--s-5);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--s-8);
  }
}

.narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--s-16);
}

@media (max-width: 640px) {
  .section {
    padding-block: var(--s-10);
  }
}

.section--tight {
  padding-block: var(--s-10);
}

.section--tinted {
  background: var(--surface-2);
  border-block: 1px solid var(--line);
}

.stack {
  display: grid;
  gap: var(--s-4);
}

.stack--lg {
  gap: var(--s-8);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.display {
  font-size: clamp(2.25rem, 6vw, var(--text-5xl));
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.h2 {
  font-size: clamp(1.625rem, 3.4vw, var(--text-3xl));
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.h3 {
  font-size: var(--text-xl);
}

.lead {
  font-size: clamp(1.0625rem, 1.6vw, var(--text-lg));
  line-height: var(--leading-normal);
  color: var(--muted);
  max-width: 62ch;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 100%;
}

.logo {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  font-size: 1.1875rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-accent);
}

/* Буква — тот же контур, что на иконках приложения */
.logo__mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logo:hover {
  color: var(--ink);
}

.main-nav {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: var(--s-2);
}

.main-nav ul {
  display: flex;
  gap: var(--s-1);
  align-items: center;
}

/* Первые три пункта — единый блок-переключатель */
.nav-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* Скругление по краям вместо overflow: hidden — иначе тень активного пункта обрезается */
.nav-group a:first-child {
  border-top-left-radius: calc(var(--radius-sm) - 1px);
  border-bottom-left-radius: calc(var(--radius-sm) - 1px);
}
.nav-group a:last-child {
  border-top-right-radius: calc(var(--radius-sm) - 1px);
  border-bottom-right-radius: calc(var(--radius-sm) - 1px);
}

.nav-group a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding-inline: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.nav-group a + a {
  border-left: 1px solid var(--line);
}

.nav-group a:hover {
  background: var(--surface-2);
  color: var(--accent);
}

/* Активный раздел: мягкая акцентная заливка вместо чёрной */
.nav-group a[aria-current="page"] {
  position: relative;
  z-index: 1;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700; /* второй сигнал к цвету: видно и при слабом различении оттенков */
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent),
    0 6px 16px -4px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* Рандомайзер — отдельная кнопка: то же скругление, что у «Провести розыгрыш» */
.main-nav .nav-solo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding-inline: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 650;
  white-space: nowrap;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}

.main-nav .nav-solo:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: var(--accent);
}

.main-nav .nav-solo[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 38%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
}

/* На десктопе меню стоит между логотипом и кнопками — там отступ не нужен.
   На мобильном main-nav скрыт, поэтому это правило не должно срабатывать,
   иначе кнопки прилипают к логотипу вместо правого края. */
@media (min-width: 900px) {
  .main-nav + .header-actions {
    margin-left: 0;
  }
}

@media (min-width: 900px) {
  .main-nav {
    display: flex;
  }
  .header-actions {
    margin-left: var(--s-2);
  }
}

/* Кнопки-иконки в шапке */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast),
    color var(--dur-fast), transform var(--dur-fast);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn .icon-sun {
  display: none;
}

.icon-btn[aria-pressed="true"] .icon-moon {
  display: none;
}

.icon-btn[aria-pressed="true"] .icon-sun {
  display: block;
}


.icon-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
}

.lang-switch__item {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding-inline: var(--s-2);
  border-radius: 9px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
}

.lang-switch__item[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.lang-switch__item:hover:not([aria-current="true"]) {
  color: var(--ink);
  background: var(--surface-2);
}

/* Мобильное меню */
.menu-btn {
  display: inline-grid;
}

@media (min-width: 900px) {
  .menu-btn {
    display: none;
  }
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: calc(var(--s-4) + env(safe-area-inset-top)) var(--s-5) calc(var(--s-6) + env(safe-area-inset-bottom));
  background: var(--bg-elevated);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base);
}

.mobile-nav[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    visibility 0s;
}

.mobile-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}

.mobile-nav__title {
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.mobile-nav__close {
  flex: 0 0 44px;
}

.mobile-nav__list {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  padding-bottom: var(--s-4);
}

.mnav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 60px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.0625rem;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}

.mnav-item:hover,
.mnav-item:focus-visible {
  background: var(--surface-2);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.mnav-item__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 40px;
}

.mnav-item__icon svg {
  width: 21px;
  height: 21px;
}

.mnav-item__text {
  flex: 1 1 auto;
}

.mnav-item__chevron {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
}

/* Аккаунт отличается от разделов: акцентная кнопка и своя иконка */
.mnav-item--account {
  margin-top: var(--s-2);
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.mnav-item--account .mnav-item__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.mnav-item--account:hover,
.mnav-item--account:focus-visible {
  background: color-mix(in srgb, var(--accent) 82%, #000);
  border-color: transparent;
  color: #fff;
}

/* Появление пунктов по очереди — меню «раскрывается», а не прыгает */
.mobile-nav[data-open="true"] .mnav-item {
  animation: mnav-in var(--dur-base) var(--ease-out) both;
}
.mobile-nav[data-open="true"] .mnav-item:nth-child(1) { animation-delay: 40ms; }
.mobile-nav[data-open="true"] .mnav-item:nth-child(2) { animation-delay: 80ms; }
.mobile-nav[data-open="true"] .mnav-item:nth-child(3) { animation-delay: 120ms; }
.mobile-nav[data-open="true"] .mnav-item:nth-child(4) { animation-delay: 160ms; }
.mobile-nav[data-open="true"] .mnav-item:nth-child(5) { animation-delay: 200ms; }

@keyframes mnav-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav,
  .mobile-nav[data-open="true"] .mnav-item {
    transition: none;
    animation: none;
  }
}

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

.site-footer {
  margin-top: var(--s-16);
  padding-block: var(--s-10) var(--s-8);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-sm);
  color: var(--muted);
}

.site-footer__grid {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: 1fr;
  align-items: stretch;
}

/* Колонки подвала: высоту выравнивает сам grid (stretch), проценты не нужны */
.site-footer__grid > * {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h2 {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
}

.site-footer ul {
  display: grid;
  gap: var(--s-2);
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted-2);
}

.site-footer__note {
  max-width: 46ch;
  line-height: var(--leading-normal);
}


@media (min-width: 900px) and (max-width: 1199px) {
  .main-nav a {
    padding-inline: 8px;
  }
  .header-cta {
    padding-inline: 12px;
    font-size: var(--text-sm);
  }
}


/* Telegram Mini App: учитываем системные отступы сверху */
html.is-tg-mini-app .site-header { padding-top: env(safe-area-inset-top); }

/* ===== components.css ===== */
/* ==========================================================================
   Raffly — компоненты
   Кнопки, поля, карточки, шаги, таблица участников, сцена розыгрыша.
   ========================================================================== */

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

.btn {
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-6);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--btn-ink);
  text-decoration: none;
}

.btn:active {
  background: var(--accent-active);
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  box-shadow: var(--shadow-accent);
}

.btn--secondary {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-border: var(--line);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--gold {
  --btn-bg: var(--gold);
  --btn-ink: #1a1408;
}

.btn--gold:hover {
  background: color-mix(in srgb, var(--gold) 88%, #000);
  color: #1a1408;
}

.btn--sm {
  min-height: 40px;
  padding-inline: var(--s-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-xs);
}

.btn--lg {
  min-height: 56px;
  padding-inline: var(--s-8);
  font-size: var(--text-lg);
}

.btn--block {
  width: 100%;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Бейджи и пилюли ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Длинный бейдж (например, про гостевой розыгрыш) переносится, а не вылезает за экран */
#guest-badge {
  white-space: normal;
  max-width: 100%;
  line-height: 1.35;
}

.badge--accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.badge--gold {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
  color: color-mix(in srgb, var(--gold) 70%, var(--ink));
}

.badge--success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
}

.badge--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.badge--soon {
  background: transparent;
  border-style: dashed;
}

/* ---------- Карточки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card__body {
  padding: var(--s-6);
}

@media (max-width: 640px) {
  .card__body {
    padding: var(--s-5);
  }
}

.card--pad {
  padding: var(--s-6);
}

.card--lift {
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.card--lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.grid {
  display: grid;
  gap: var(--s-5);
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Формы ---------- */

.field {
  display: grid;
  gap: var(--s-2);
}

.label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}

.hint {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-normal);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast),
    background-color var(--dur-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--muted-2);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.textarea {
  min-height: 172px;
  resize: vertical;
  line-height: var(--leading-normal);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.input--sm {
  min-height: 40px;
  padding-block: var(--s-2);
  font-size: var(--text-sm);
}

.field--error .input,
.field--error .textarea {
  border-color: var(--danger);
}

.field__error {
  display: none;
  font-size: var(--text-sm);
  color: var(--danger);
  font-weight: 550;
}

.field--error .field__error {
  display: block;
}

/* Переключатель */
.switch {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast);
  min-height: 48px;
}

.switch:hover {
  background: var(--surface-2);
}

.switch input {
  appearance: none;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  margin: 2px 0 0;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  position: relative;
  transition: background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base);
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out);
}

.switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked::after {
  transform: translateX(18px);
  background: #fff;
}

.switch__text {
  display: grid;
  gap: 2px;
}

.switch__title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
}

.switch__desc {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* Сегментированный переключатель (вкладки) */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.segmented button,
.segmented a {
  min-height: 40px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.segmented button[aria-selected="true"],
.segmented a[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---------- Шаги ---------- */

.steps {
  display: grid;
  gap: var(--s-3);
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--s-3) var(--s-4);
  align-items: start;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-weight: 750;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* ---------- Таблица участников ---------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
  background: var(--surface);
  max-height: 460px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th,
.table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 650;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table .is-failed {
  color: var(--muted-2);
}

.table .reason {
  white-space: normal;
  color: var(--danger);
  font-size: var(--text-xs);
}

/* ---------- Сообщения ---------- */

.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.alert svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.alert--accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.alert--accent svg {
  color: var(--accent);
}

.alert--success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}

.alert--success svg {
  color: var(--success);
}

.alert--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
}

.alert--danger svg {
  color: var(--danger);
}

/* ---------- Пустое состояние ---------- */

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  color: var(--muted);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted-2);
}

/* ---------- Диалог ---------- */

dialog.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

dialog.modal::backdrop {
  background: rgb(12 14 20 / 55%);
  backdrop-filter: blur(2px);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--line);
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.modal__body {
  padding: var(--s-6);
}

.modal__foot {
  display: flex;
  gap: var(--s-3);
  justify-content: flex-end;
  padding: var(--s-5) var(--s-6);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- Тосты ---------- */

.toast-region {
  position: fixed;
  inset: auto var(--s-4) var(--s-4) var(--s-4);
  z-index: 80;
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  pointer-events: none;
}

@media (min-width: 640px) {
  .toast-region {
    inset: auto var(--s-6) var(--s-6) auto;
    justify-items: end;
  }
}

.toast {
  max-width: 420px;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-base) var(--ease-out);
  pointer-events: auto;
}

.toast--success {
  background: var(--success);
  color: #fff;
}

.toast--error {
  background: var(--danger);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Аватары ---------- */

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--lg {
  width: 88px;
  height: 88px;
  font-size: var(--text-2xl);
}

/* ---------- Сцена розыгрыша ---------- */

.draw-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: var(--s-8) var(--s-5);
  border-radius: var(--radius-lg);
  background: radial-gradient(
      120% 120% at 50% 0%,
      color-mix(in srgb, var(--accent) 12%, transparent) 0%,
      transparent 60%
    ),
    var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

.draw-stage__inner {
  display: grid;
  gap: var(--s-4);
  justify-items: center;
  text-align: center;
  width: 100%;
}

.draw-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  color: var(--muted);
}

.draw-name {
  font-size: clamp(1.75rem, 6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-height: 1.2em;
  filter: blur(0);
  transition: filter 120ms, transform 120ms;
  word-break: break-word;
}

.draw-name.is-rolling {
  filter: blur(0.6px);
  opacity: 0.85;
}

.draw-name.is-winner {
  color: var(--accent);
  animation: winner-pop 620ms var(--ease-out);
}

@keyframes winner-pop {
  0% {
    transform: scale(0.82);
    opacity: 0;
    filter: blur(8px);
  }
  55% {
    transform: scale(1.06);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: scale(1);
  }
}

.draw-card {
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  padding: var(--s-6) var(--s-8);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  max-width: 100%;
}

.draw-card__name {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  word-break: break-word;
}

.draw-card__meta {
  font-size: var(--text-sm);
  color: var(--muted);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.draw-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
}

/* Фишки участников, влетающие в сцену */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
  opacity: 0.75;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Утилиты ---------- */

.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.mb-4 { margin-bottom: var(--s-4); }
.gap-2 { gap: var(--s-2); }
.full { width: 100%; }

.flow > * + * {
  margin-top: var(--s-4);
}


/* CTA в шапке: на мобильном скрыт, на десктопе — виден */
.header-cta {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.header-cta__short {
  display: none;
}

/* На узких экранах освобождаем место: знак без подписи и без дублирующей кнопки входа */
@media (max-width: 480px) {
  .logo > span:not(.logo__mark) {
    display: none;
  }
  .header-auth {
    display: none;
  }
}

/* На телефоне кнопка остаётся, но с короткой подписью */
@media (max-width: 720px) {
  .header-cta {
    padding-inline: 12px;
    min-height: 44px;
  }
  .header-cta__full {
    display: none;
  }
  .header-cta__short {
    display: inline;
  }
}

@media (min-width: 900px) {
  .header-cta {
    display: inline-flex;
  }
}

/* Карточка источника: заголовок и описание друг под другом */
.source > span:nth-child(2) {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
}

.source__title,
.source__desc {
  display: block;
}

.source__desc {
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---------- Уведомление о cookie ---------- */

.rf-note {
  position: fixed;
  inset: auto var(--s-3) var(--s-3) var(--s-3);
  z-index: 70;
  padding: var(--s-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  animation: cookie-in var(--dur-slow) var(--ease-out);
}

@keyframes cookie-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.rf-note__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
}

.rf-note__text {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  max-width: 70ch;
  line-height: var(--leading-normal);
}

.rf-note__actions {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-shrink: 0;
}

.rf-note__link {
  font-size: var(--text-sm);
}

@media (min-width: 900px) {
  .rf-note {
    inset: auto var(--s-6) var(--s-6) var(--s-6);
  }
}

/* ---------- Кнопка языка и вход ---------- */

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  min-width: 56px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 750;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.lang-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.lang-btn svg {
  width: 17px;
  height: 17px;
  opacity: 0.75;
}

.header-auth svg {
  width: 20px;
  height: 20px;
}

.header-auth__label {
  display: none;
  font-size: var(--text-sm);
  font-weight: 600;
}

@media (min-width: 1360px) {
  .header-auth {
    width: auto;
    padding-inline: 12px;
    gap: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .header-auth__label {
    display: inline;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 4px;
  }
  /* 44×44 — минимальная удобная тач-цель, меньше делать нельзя */
  .icon-btn {
    width: 44px;
    height: 44px;
  }
  .lang-btn {
    height: 44px;
    min-width: 52px;
    padding: 0 10px;
  }
  .lang-btn svg {
    display: none;
  }
}

/* Раскрывающиеся блоки: строка должна нажиматься пальцем */
summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}

/* ---------- Отступы заголовков ---------- */

.mt-10 { margin-top: var(--s-10); }
.mt-12 { margin-top: var(--s-12); }
.mt-16 { margin-top: var(--s-16); }

/* Заголовок после блока всегда дышит */
.proof__code + .h2,
.card + .h2,
pre + .h2,
.lead + .h2,
.grid + .h2,
.table-wrap + .h2 {
  margin-top: var(--s-10);
}

/* ---------- Фильтры на страницах списков ---------- */

.filters {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--s-6);
}

@media (min-width: 860px) {
  .filters {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.6fr) auto;
    align-items: end;
  }
}

.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.date-range .input {
  min-width: 0;
  padding-inline: 10px;
  font-size: var(--text-sm);
}

.filters--compact {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .filters--compact {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.filters .field {
  gap: 6px;
}

.filters .input,
.filters .select {
  min-height: 44px;
}

.filters__count {
  font-size: var(--text-sm);
  color: var(--muted);
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ---------- Карточки списков ---------- */

.list-item {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

a.list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: inherit;
}

.list-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.list-item__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.list-item__blogger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
}

.list-item__blogger:hover {
  color: var(--accent);
}

.list-item__blogger .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

.list-item__winner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

/* ---------- Блогеры ---------- */

.blogger-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.blogger-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: inherit;
}

.blogger-card__top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.blogger-card__name {
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.3;
}

.blogger-card__handle {
  font-size: var(--text-sm);
  color: var(--muted);
}

.blogger-card__bio {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-normal);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blogger-card__stats {
  display: flex;
  gap: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--muted);
}

.blogger-card__stats b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Цветные иконки соцсетей ---------- */

.social-link {
  border-color: color-mix(in srgb, var(--social, var(--accent)) 26%, var(--line));
}

.social-link svg {
  color: var(--social, var(--accent));
}

.social-link:hover {
  border-color: var(--social, var(--accent));
  background: color-mix(in srgb, var(--social, var(--accent)) 10%, var(--surface));
  color: var(--social, var(--accent));
}

.social-link--tg { --social: #229ed9; }
.social-link--boosty { --social: #f15a24; }
.social-link--instagram { --social: #d6336c; }
.social-link--dzen { --social: #1b1b1b; }
.social-link--site { --social: var(--accent); }
.social-link--other { --social: var(--muted); }
.social-link--vk { --social: #0077ff; }
.social-link--rutube { --social: #ef2b2d; }
.social-link--youtube { --social: #ff0033; }

[data-theme="evening"] .social-link--vk { --social: #4d9bff; }
[data-theme="evening"] .social-link--rutube { --social: #ff6b6b; }
[data-theme="evening"] .social-link--youtube { --social: #ff5470; }
[data-theme="evening"] .social-link--dzen { --social: #d7d5e0; }
[data-theme="evening"] .social-link--boosty { --social: #ff7a45; }
[data-theme="evening"] .social-link--instagram { --social: #ff7aa8; }

/* ---------- Шеринг ---------- */

.rf-actions {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.rf-actions__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: var(--s-2);
}

.rf-actions__item {
  white-space: nowrap;
}

.rf-actions__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.rf-actions__item:hover {
  border-color: var(--social, var(--accent));
  background: color-mix(in srgb, var(--social, var(--accent)) 10%, var(--surface));
  color: var(--social, var(--accent));
}

.rf-actions__item svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: 0 0 20px;
  color: var(--social, var(--ink-soft));
  overflow: visible;
  display: block;
  flex-shrink: 0;
}

.rf-actions__item--tg { --social: #229ed9; }
.rf-actions__item--vk { --social: #0077ff; }
.rf-actions__item--wa { --social: #25d366; }

/* ---------- Модальное окно входа ---------- */

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.auth-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
}

.auth-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: var(--s-4);
}

.auth-note {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* Компактные иконки соцсетей в карточках */
.social-dot {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--social, var(--accent)) 26%, var(--line));
  background: color-mix(in srgb, var(--social, var(--accent)) 9%, var(--surface));
  color: var(--social, var(--accent));
}

.social-dot svg {
  width: 15px;
  height: 15px;
}

/* ---------- Кнопка сброса кеша в подвале ---------- */

.site-footer__bottom-right {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.cache-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast),
    background-color var(--dur-fast);
}

.cache-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.cache-btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur-slow) var(--ease-out);
}

.cache-btn:hover svg {
  transform: rotate(180deg);
}

/* ---------- Поле с кнопкой очистки ---------- */

.input-with-action {
  position: relative;
  display: grid;
}

.input-with-action .input {
  padding-right: 46px;
}

/* Убираем встроенный крестик type="search": у нас свой, который сбрасывает все фильтры */
.input[type="search"]::-webkit-search-cancel-button,
.input[type="search"]::-webkit-search-decoration,
.input[type="search"]::-webkit-search-results-button,
.input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.input[type="search"]::-ms-clear,
.input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.input-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.input-clear:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.input-clear svg {
  width: 16px;
  height: 16px;
}

/* ---------- Выравнивание фильтров ---------- */

.filters {
  align-items: stretch;
}

.filters .field {
  display: grid;
  grid-template-rows: auto 48px;
  gap: 6px;
  align-content: start;
}

.filters .input,
.filters .select {
  height: 48px;
  min-height: 48px;
  padding-block: 0;
}

.filters .date-range {
  height: 48px;
}

.filters .date-range .input {
  height: 48px;
}

.filters__count {
  align-self: end;
  height: 48px;
}

.filters__error {
  display: none;
  margin: calc(var(--s-2) * -1) 0 0;
  padding: 0 var(--s-4);
  font-size: var(--text-sm);
  color: var(--danger);
}

.filters__error[data-visible="true"] {
  display: block;
}

/* Шеринг на телефоне: две колонки, чтобы блок не занимал весь экран */
@media (max-width: 640px) {
  .rf-actions__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rf-actions__item {
    white-space: normal;
    text-align: center;
    padding-inline: var(--s-2);
    font-size: var(--text-xs);
    line-height: 1.25;
  }
}

/* ---------- Ссылка на страницу блогера с розыгрыша ---------- */

.blogger-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  max-width: 430px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), background-color var(--dur-fast),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base);
}

.blogger-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: inherit;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.blogger-link__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.blogger-link__label {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.blogger-link:hover .blogger-link__label {
  color: var(--accent);
}

.blogger-link__name {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blogger-link__arrow {
  margin-left: auto;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.blogger-link:hover .blogger-link__arrow {
  color: var(--accent);
}

@media (max-width: 480px) {
  .blogger-link {
    max-width: none;
  }
}

/* ---------- Рандомайзер: скорость, звук, крупные числа ---------- */

.segmented--wide {
  display: flex;
  width: 100%;
}

.segmented--wide button {
  flex: 1 1 auto;
  min-width: 120px; /* вдвое длиннее прежнего */
  padding-inline: 14px;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.rng__number {
  min-width: 0;
  padding-inline: 18px;
  font-size: clamp(1.35rem, 4.6vw, 1.9rem);
  font-variant-numeric: tabular-nums;
}

.rng__number.is-rolling {
  filter: blur(0.7px);
  opacity: 0.7;
}

.rng__result {
  gap: var(--s-3);
  align-content: center;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast);
}

.sound-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sound-toggle .sound-toggle__on {
  display: none;
}

.sound-toggle[aria-pressed="true"] .sound-toggle__on {
  display: block;
}

.sound-toggle[aria-pressed="true"] .sound-toggle__off {
  display: none;
}

.sound-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

@media (max-width: 480px) {
  .segmented--wide button {
    font-size: 11px;
    padding-inline: 3px;
  }
}

.switch--boxed {
  min-height: 48px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  background: var(--surface);
}

.mt-2 {
  margin-top: var(--s-2);
}


/* От/До на телефоне остаются в две колонки — они короткие */
@media (max-width: 640px) {
  .rng__range {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Почта на странице контактов ---------- */

.contact-mail {
  display: inline-block;
  margin-top: var(--s-2);
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.contact-mail:hover {
  text-decoration: underline;
}

/* ---------- Хлебные крошки ---------- */

.crumbs {
  /* Залипает под шапкой: на длинных страницах крошки всегда под рукой */
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  padding-block: var(--s-3);
  margin-inline: calc(var(--s-2) * -1);
  padding-inline: var(--s-2);
  font-size: 13.5px;
  letter-spacing: 0.005em;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-radius: var(--radius-sm);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Разделитель — тонкая стрелка, а не типографский символ */
.crumbs li + li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background-color: var(--muted-2, var(--muted));
  opacity: 0.75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 550;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(20, 16, 40, 0.04);
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--dur-fast), background-color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}

/* Иконка раздела: показываем только на телефоне */
.crumbs__icon {
  display: none;
}

/* Первое звено — с иконкой дома */
.crumbs li:first-child a::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  background-color: currentColor;
  opacity: 0.85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.crumbs a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-1px);
}

.crumbs [aria-current="page"] {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 650;
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumbs + .section-head,
.crumbs + section,
.crumbs + h1,
.crumbs + .eyebrow {
  margin-top: var(--s-5);
}

/* Счётчик посещений в подвале: цифры без внешних сервисов */
.counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 3px 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-radius: 6px;
}
.counter:hover {
  color: var(--ink);
}
.counter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.counter svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  opacity: 0.8;
}
.counter strong {
  color: var(--text);
  font-weight: 650;
}
.counter__sep {
  margin: 0 2px;
}

/* ---------- Окно статистики ---------- */
.visits {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(20, 18, 40, 0.28);
}
.visits::backdrop {
  background: rgba(18, 16, 32, 0.45);
  backdrop-filter: blur(2px);
}
.visits__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) 0;
}
.visits__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}
.visits__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.visits__close:hover {
  color: var(--ink);
}
.visits__close svg {
  width: 16px;
  height: 16px;
}
.visits__tabs {
  display: flex;
  gap: 4px;
  margin: var(--s-4) var(--s-4) 0;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
}
.visits__tabs button {
  flex: 1;
  padding: 7px 10px;
  white-space: nowrap;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.visits__tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 18, 40, 0.12);
}
.visits__numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  padding: var(--s-4);
}
.visits__num {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.visits__num strong {
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.visits__num span {
  font-size: var(--text-xs);
  color: var(--muted);
}
.visits__chart {
  padding: 0 var(--s-4) var(--s-2);
}
.visits__chart[hidden] {
  display: none;
}
.visits__bars {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: end;
  gap: 2px;
  height: 56px;
  padding-top: 6px;
}
.visits__bars i {
  display: block;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
.visits__bars i.is-now {
  background: var(--accent);
}
.visits__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}
.visits__note {
  margin: 0;
  padding: 0 var(--s-4) var(--s-4);
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Ссылка-кнопка (например, «Пожаловаться») ---------- */
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
.link-btn:hover {
  color: var(--ink);
}
.report-link {
  margin: var(--s-3) 0 0;
  text-align: right;
}

/* ---------- Окно жалобы ---------- */
.report {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(20, 18, 40, 0.28);
}
.report::backdrop {
  background: rgba(18, 16, 32, 0.45);
  backdrop-filter: blur(2px);
}
.report__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) 0;
}
.report__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}
.report__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.report__close svg {
  width: 16px;
  height: 16px;
}
.report__form {
  padding: var(--s-4);
  display: grid;
  gap: var(--s-3);
}
.report__reasons {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 6px;
}
.report__reasons legend {
  padding: 0 0 6px;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
}
.report__reason {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: var(--text-sm);
  cursor: pointer;
}
.report__reason:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.report__label {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
}
.report__error {
  margin: 0;
  color: var(--danger, #b3261e);
  font-size: var(--text-sm);
}
.report__done {
  margin: 0;
  padding: 0 var(--s-4) var(--s-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ---------- Окно входа и регистрации ---------- */
.auth {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(20, 18, 40, 0.28);
}
.auth::backdrop {
  background: rgba(18, 16, 32, 0.45);
  backdrop-filter: blur(2px);
}
.auth__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) 0;
}
.auth__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}
.auth__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.auth__close svg {
  width: 16px;
  height: 16px;
}
.auth__tabs {
  display: flex;
  gap: 4px;
  margin: var(--s-4) var(--s-4) 0;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
}
.auth__tabs button {
  flex: 1;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.auth__tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 18, 40, 0.12);
}
.auth__form {
  padding: var(--s-4);
  display: grid;
  gap: 6px;
}
.auth__label {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
  margin-top: 4px;
}
.auth__note {
  margin: var(--s-2) 0;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.5;
}
.auth__error {
  margin: 0;
  color: var(--danger, #b3261e);
  font-size: var(--text-sm);
}
.auth__account {
  padding: var(--s-4);
  display: grid;
  gap: var(--s-3);
}
.auth__who {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.auth__form[hidden],
.auth__account[hidden],
.auth__tabs[hidden],
.auth__signup-only[hidden] {
  display: none;
}

/* Счётчик новых жалоб в шапке */
.moderation-badge {
  gap: 6px;
}
.moderation-badge__count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger, #b3261e);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.modal__note {
  margin: 0;
  padding: 0 var(--s-5) var(--s-5);
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}

.auth__forgot {
  justify-self: start;
  margin-top: 2px;
}
.auth__password-wrap[hidden],
.auth__signup-only[hidden] {
  display: none;
}

/* ---------- Шапка и аватар профиля ---------- */
.profile-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 5;
  max-height: 340px;
  overflow: hidden;
  background: var(--surface-2);
}
.profile-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-banner__empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface-2) 70%);
}
.profile-head__avatar {
  display: block;
  margin-top: -72px;
  margin-bottom: var(--s-3);
}
.profile-head__avatar img,
.profile-head__avatar .avatar {
  width: 132px;
  height: 132px;
  font-size: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(20, 18, 40, 0.14);
}

@media (max-width: 759px) {
  .profile-head__avatar img,
  .profile-head__avatar .avatar {
    width: 96px;
    height: 96px;
    font-size: 34px;
  }
  .profile-head__avatar {
    margin-top: -60px;
  }
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
}
.profile-link:hover {
  border-color: var(--accent);
}
.profile-link__name {
  font-weight: 650;
}
.profile-link__handle {
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ---------- Настройки: картинки и соцсети ---------- */
.media-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-4);
  align-items: center;
}

/* Разделяем блоки аватара и шапки, чтобы не сливались */
.media-field + .media-field {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.media-field__label strong {
  font-size: var(--text-base);
}
.media-field__label {
  display: grid;
  gap: 4px;
}
.media-field__control {
  display: grid;
  gap: var(--s-2);
  justify-items: center;
}
.media-field__preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.media-field__preview--avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
}
.media-field__preview--banner {
  width: 220px;
  height: 69px;
}
.media-field__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-field__empty {
  font-size: var(--text-xs);
  color: var(--muted);
}
.link-rows {
  display: grid;
  gap: var(--s-2);
}
.link-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 168px 140px auto auto;
  gap: var(--s-2);
  align-items: center;
}
.link-row__count {
  max-width: 140px;
}
@media (max-width: 760px) {
  .link-row {
    grid-template-columns: 1fr 1fr;
  }
  .link-row__value {
    grid-column: 1 / -1;
  }
  .link-row__count {
    max-width: none;
  }
}

.link-row [data-link-remove] {
  height: 44px;
  width: 44px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

/* Все поля строки одной высоты, чтобы не «плясали» */
.link-row .input,
.link-row select {
  height: 44px;
  min-height: 44px;
  padding-block: 0;
  line-height: 42px;
}
@media (max-width: 640px) {
  .media-field {
    grid-template-columns: 1fr;
  }
  .media-field__control {
    justify-items: start;
  }
  .link-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Окно обрезки ---------- */
.crop {
  width: min(480px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(20, 18, 40, 0.3);
}
.crop::backdrop {
  background: rgba(18, 16, 32, 0.55);
}
.crop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) 0;
}
.crop__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}
.crop__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.crop__stage {
  display: grid;
  place-items: center;
  padding: var(--s-4);
}
.crop__canvas {
  max-width: 100%;
  border-radius: var(--radius-sm);
  touch-action: none;
  cursor: grab;
}
.crop__canvas:active {
  cursor: grabbing;
}
.crop__zoom {
  display: grid;
  gap: 6px;
  padding: 0 var(--s-4);
  font-size: var(--text-sm);
  color: var(--muted);
}
.crop__hint {
  margin: var(--s-2) 0 0;
  padding: 0 var(--s-4);
  font-size: var(--text-xs);
  color: var(--muted);
}
.crop__actions {
  padding: var(--s-4);
}

/* ---------- Соцсети в профиле: иконка в цвете сети ---------- */
.profile-link--telegram { --social: #229ed9; }
.profile-link--vk { --social: #0077ff; }
.profile-link--youtube { --social: #ff0033; }
.profile-link--rutube { --social: #ef2b2d; }
.profile-link--boosty { --social: #f15a24; }
.profile-link--instagram { --social: #d6336c; }
.profile-link--dzen { --social: #1b1b1b; }
.profile-link--site { --social: var(--accent); }
.profile-link--other { --social: var(--muted); }
[data-theme="evening"] .profile-link--vk { --social: #4d9bff; }
[data-theme="evening"] .profile-link--youtube { --social: #ff5470; }
[data-theme="evening"] .profile-link--rutube { --social: #ff6b6b; }
[data-theme="evening"] .profile-link--boosty { --social: #ff7a45; }
[data-theme="evening"] .profile-link--instagram { --social: #ff7aa8; }
[data-theme="evening"] .profile-link--dzen { --social: #d7d5e0; }

.profile-link {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--social, var(--accent)) 32%, var(--line));
  color: var(--social, var(--text));
  box-shadow: 0 1px 2px rgba(20, 16, 40, 0.04);
}
.profile-link:hover {
  border-color: var(--social, var(--accent));
  background: color-mix(in srgb, var(--social, var(--accent)) 6%, var(--surface));
}
.profile-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: -1px;
  color: var(--social, currentColor);
}
.profile-link__name,
.profile-link__handle {
  display: inline-block;
  line-height: 1.25;
}
.profile-link__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.profile-link__name,
.profile-link__handle {
  color: var(--social, currentColor);
}
.profile-link__handle {
  opacity: 0.75;
}

/* ---------- Предпросмотр профиля в настройках ---------- */
.profile-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
}
.profile-preview__label {
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-xs);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.profile-preview__banner {
  height: 96px;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface-2) 70%);
}
.profile-preview__banner.is-empty {
  background: linear-gradient(120deg, var(--accent-soft), var(--surface-2) 70%);
}
.profile-preview__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-preview__head {
  display: flex;
  align-items: flex-end;
  gap: var(--s-3);
  padding: 0 var(--s-3) var(--s-3);
  margin-top: -28px;
}
.profile-preview__avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 3px solid var(--surface);
  box-shadow: 0 4px 14px rgba(20, 18, 40, 0.14);
}
.profile-preview__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-preview__name {
  font-weight: 700;
  color: var(--text);
}
.profile-preview__handle {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Плашка «доступно обновление страницы» */
.build-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: 10px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
  color: var(--text);
  font-size: var(--text-sm);
  text-align: center;
}

.profile-head__bio {
  margin: var(--s-2) 0 0;
  max-width: 62ch;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Выбор роли при регистрации */
.auth__role {
  display: grid;
  gap: 6px;
  margin: var(--s-2) 0;
  padding: 0;
  border: 0;
}
.auth__role-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  cursor: pointer;
}
.auth__role-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.auth__role-option span {
  display: grid;
  gap: 1px;
}
.auth__role-option small {
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ---------- Розыгрыш: победители и участники ---------- */
.winner-list {
  display: grid;
  gap: var(--s-2);
}
.winner-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
}
.winner-item:hover {
  border-color: var(--accent);
}
.winner-item__avatar,
.participant__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.winner-item__avatar img,
.participant__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.winner-item__text {
  display: grid;
}
.winner-item__text span {
  font-size: var(--text-xs);
  color: var(--muted);
}
.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.participant {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-size: var(--text-sm);
}
.participant:hover {
  border-color: var(--accent);
}
.participant__avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  font-size: 12px;
}

/* Ссылка-заголовок в карточках: без подчёркивания, цвет текста, акцент при наведении */
.card-title a,
a.card-title {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-fast, 0.15s) ease;
}
.card-title a:hover,
a.card-title:hover {
  color: var(--accent);
}
.card-title a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Комментарии ---------- */
.comments {
  display: grid;
  gap: var(--s-3);
}
.comment {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.comment__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
}
.comment__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comment__body {
  flex: 1 1 auto;
  min-width: 0;
}
.comment__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.comment__name {
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
a.comment__name:hover {
  color: var(--accent);
}
.comment__meta {
  font-size: var(--text-xs);
  color: var(--muted);
}
.comment__text {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.comment__delete {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.comment__delete:hover {
  color: var(--danger, #b3261e);
}
.comment-form {
  display: grid;
  gap: var(--s-2);
}

/* Профиль без шапки: блок не занимает место, аватар не «висит» на крошках */
.no-banner .profile-banner {
  display: none;
}
.no-banner .profile-head__avatar {
  margin-top: var(--s-6);
}

/* Приватность: крупный чекбокс рядом с текстом */
.privacy-row {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-top: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}
.privacy-row:hover {
  border-color: var(--accent);
}
.privacy-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin: 0;
  border: 2px solid color-mix(in srgb, var(--line) 70%, var(--muted));
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.privacy-row input[type="checkbox"]:hover {
  border-color: var(--accent);
}
.privacy-row input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.privacy-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.privacy-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.privacy-row__text {
  display: grid;
  gap: 4px;
}
.privacy-row__text .hint {
  display: block;
}

/* Длинные адреса и ники не должны расширять карточку */
.field {
  min-width: 0;
}
.handle-url,
.hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Окно аккаунта ---------- */
.auth__account {
  padding: var(--s-4);
  display: grid;
  gap: var(--s-4);
}
.account-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-head__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.account-head__text strong {
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}
.account-head__text span {
  font-size: var(--text-sm);
  color: var(--muted);
}
.account-menu {
  display: grid;
  gap: 6px;
}
.account-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.account-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.account-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.account-item__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.account-item__icon svg {
  width: 20px;
  height: 20px;
}
.account-item__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.account-item__text strong {
  font-weight: 650;
  font-size: var(--text-sm);
}
.account-item__text small {
  color: var(--muted);
  font-size: var(--text-xs);
}
.account-item__chevron {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.account-item--danger {
  color: var(--danger, #b3261e);
}
.account-item--danger .account-item__icon {
  background: color-mix(in srgb, #b3261e 12%, transparent);
  color: var(--danger, #b3261e);
}
.account-item--danger:hover {
  border-color: var(--danger, #b3261e);
  background: color-mix(in srgb, #b3261e 8%, transparent);
}

/* Рандомайзер: зрелищнее — крупный пульсирующий результат */
.rng-value,
.draw-value {
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease, color 0.15s ease;
}
.is-spinning .rng-value,
.is-spinning .draw-value {
  color: var(--accent);
  transform: scale(1.04);
}
@media (prefers-reduced-motion: reduce) {
  .is-spinning .rng-value,
  .is-spinning .draw-value {
    transform: none;
  }
}

/* ---------- Информационные блоки ---------- */
.notice {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  line-height: 1.55;
}
.notice > strong {
  display: block;
  margin-bottom: 6px;
}
.notice--warn {
  background: color-mix(in srgb, #f5a524 10%, var(--surface));
  border-color: color-mix(in srgb, #f5a524 38%, var(--line));
}
.notice--warn > strong {
  color: #8a5a00;
}
:root[data-theme="evening"] .notice--warn > strong {
  color: #f5c66b;
}

/* На узких экранах длинные кнопки скорости переносим в 2×2, чтобы не было прокрутки вбок */
@media (max-width: 620px) {
  .segmented--wide {
    flex-wrap: wrap;
  }
  .segmented--wide button {
    flex: 1 1 calc(50% - 3px);
    min-width: calc(50% - 3px);
    padding-inline: 8px;
  }
}

/* Двуязычные тексты в серверных страницах: показываем нужный по языку документа */
.lang-en {
  display: none;
}
html[lang="en"] .lang-ru {
  display: none;
}
html[lang="en"] .lang-en {
  display: inline;
}

/* Таблицы с длинными пояснениями: текст переносится, ничего не обрезается */
.table--wrap {
  table-layout: fixed;
}
.table--wrap th,
.table--wrap td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* ---------- Календарь выбора даты ---------- */
.dp {
  position: relative;
  min-width: 0;
}
.dp__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.dp__button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--muted);
}
.dp__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp__label.is-empty {
  color: var(--muted);
}

.dp-pop[hidden] {
  display: none;
}
.dp-pop {
  position: absolute;
  z-index: 90;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 55px rgba(23, 21, 31, 0.18);
}
.dp-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.dp-pop__title {
  font-weight: 700;
  font-size: var(--text-base);
}
.dp-pop__nav {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.dp-pop__nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.dp-pop__nav svg {
  width: 20px;
  height: 20px;
}
.dp-pop__week,
.dp-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dp-pop__week {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 650;
  text-align: center;
}
.dp-pop__cell {
  display: grid;
  place-items: center;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.dp-pop__cell:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}
.dp-pop__cell.is-today {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.dp-pop__cell.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.dp-pop__cell:disabled {
  color: var(--muted-2, #b9b5c2);
  cursor: not-allowed;
}
.dp-pop__cell--empty {
  visibility: hidden;
}
.dp-pop__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* На телефоне календарь открывается листом снизу */
@media (max-width: 520px) {
  .dp-pop {
    position: fixed !important;
    left: 12px !important;
    right: 12px;
    bottom: 12px;
    top: auto !important;
    width: auto !important;
    max-height: 82vh;
    overflow-y: auto;
  }
}

/* Фильтр по статусу на странице розыгрышей */
.list-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: var(--s-4) 0;
}
.list-filter button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.list-filter button[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Кнопки выбора (скорость, периоды) — удобная высота на телефоне */
.segmented button {
  min-height: 44px;
}

/* Переключатель в рамке — вся строка нажимается пальцем */
.switch--boxed {
  min-height: 44px;
}

@media (max-width: 640px) {
  /* На телефоне даже «маленькие» кнопки должны быть удобными */
  .btn--sm {
    min-height: 44px;
  }
}

/* Строчные ссылки в документах и подсказках — удобная высота на телефоне */
@media (max-width: 640px) {
  .legal__toc a,
  .cookie a,
  [data-cookie] a {
    display: inline-block;
    padding-block: 3px;
    line-height: 1.6;
  }
}

/* Ссылка «Подробнее» в баннере cookie — не мельче 24 px по высоте */
.rf-note__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  line-height: 1.5;
}

/* Конфетти поверх страницы (модуль fx.js) */
.fx-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}

/* ---------- Подвал: сворачиваемые колонки на телефоне ---------- */
.site-footer__heading {
  margin: 0 0 var(--s-3);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.footer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
}
.footer-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.footer-toggle__chevron {
  display: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--muted);
  transition: transform var(--dur-fast, 0.15s) ease;
}

@media (max-width: 900px) {
  .footer-toggle__chevron {
    display: block;
  }
  .site-footer__col.is-collapsed .footer-links {
    display: none;
  }
  .site-footer__col.is-collapsed .footer-toggle__chevron {
    transform: rotate(0deg);
  }
  .site-footer__col:not(.is-collapsed) .footer-toggle__chevron {
    transform: rotate(180deg);
  }
  .site-footer__heading {
    margin-bottom: var(--s-2);
    border-bottom: 1px solid var(--line);
    padding-bottom: var(--s-2);
  }
}

/* Кнопка опасного действия (удалить) — заметная, но не кричащая */
.btn--danger {
  color: var(--danger, #b3261e);
  border-color: color-mix(in srgb, var(--danger, #b3261e) 35%, var(--line));
}
.btn--danger:hover {
  background: color-mix(in srgb, var(--danger, #b3261e) 8%, transparent);
  border-color: var(--danger, #b3261e);
  color: var(--danger, #b3261e);
}

/* «Провести розыгрыш» на своей странице: подсветка в том же акцентном ключе */
.header-cta[aria-current="page"] {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ---------- Кроппер: живой предпросмотр аватара ---------- */
.crop__preview {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.crop__preview-canvas {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  background: var(--surface);
}
.crop__preview-text {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ---------- Пилюли соцсетей на телефоне ----------
   Остаются узкими и в одну строку: название + адрес рядом.
   Если ссылок много — блок сворачивается кнопкой «Ещё N» (profile.js). */
@media (max-width: 560px) {
  .profile-links {
    gap: 6px;
  }

  .profile-link {
    padding: 5px 10px;
    font-size: 13px;
    gap: 5px;
  }

  .profile-link__name {
    font-size: 13px;
  }

  .profile-link__handle {
    font-size: 11px;
  }

  /* В свёрнутом виде оставляем только название: пилюли становятся узкими
     и встают по две-три в ряд. Развернули — вернулись адреса. */
  .profile-links--compact .profile-link__handle {
    display: none;
  }

  .profile-link--toggle {
    cursor: pointer;
    border-style: dashed;
    color: var(--ink-soft);
    font-weight: 600;
  }

  .profile-link--toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}


/* Плашка «не проведён вовремя» */
.badge--warning {
  background: color-mix(in srgb, #f5a524 16%, transparent);
  color: #a86a00;
  border-color: color-mix(in srgb, #f5a524 40%, transparent);
}
[data-theme="evening"] .badge--warning {
  color: #f5c66b;
}
.notice--warning {
  border-color: color-mix(in srgb, #f5a524 45%, var(--line));
  background: color-mix(in srgb, #f5a524 10%, var(--surface));
}
.notice--warning strong {
  color: #a86a00;
}
[data-theme="evening"] .notice--warning strong {
  color: #f5c66b;
}

/* Длинные абзацы на страницах-приложениях не растягиваем на всю ширину */
.container > .lead,
.container > .hint {
  max-width: 72ch;
}


@media (max-width: 560px) {
  .crumbs {
    padding-block: var(--s-2);
  }

  /* У ссылок остаётся только иконка: текст скрыт визуально, но читается скринридером */
  .crumbs a .crumbs__text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .crumbs a {
    min-width: 34px;
    min-height: 34px;
    padding-inline: 8px;
  }

  .crumbs__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }

  .crumbs__icon svg {
    width: 16px;
    height: 16px;
  }

  /* У «Главной» иконка больше не дублируется через ::before */
  .crumbs li:first-child a::before {
    display: none;
  }

  /* Текущая страница — единственное звено с текстом */
  .crumbs [aria-current="page"] {
    max-width: 22ch;
  }
}

/* Колокольчик непрочитанных поздравлений */
.header-bell {
  position: relative;
}
.header-bell[hidden] {
  display: none;
}
.header-bell__count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Шапка: имя аккаунта не переносится, колокольчик не ломает строку */
.header-actions {
  flex-wrap: nowrap;
}
.header-actions .header-auth {
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: 260px;
}
.header-actions .header-auth__label {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-bell {
  flex: 0 0 auto;
}

/* Колокольчик: мягкое привлечение внимания при новом уведомлении */
.header-bell--new {
  animation: bell-pop 0.6s ease;
}
.header-bell--new .header-bell__count {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
@keyframes bell-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.18) rotate(-8deg); }
  60% { transform: scale(1.08) rotate(6deg); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .header-bell--new {
    animation: none;
  }
}

/* Крошки на телефоне: иконки компактные, чтобы влезали в одну строку */
@media (max-width: 640px) {
  .crumbs ol {
    gap: 4px;
    flex-wrap: nowrap;
  }
  .crumbs li + li::before {
    width: 10px;
    flex: 0 0 10px;
  }
  .crumbs a {
    padding: 0;
    width: 36px;
    height: 36px;
    min-height: 36px;
    justify-content: center;
  }
  .crumbs [aria-current="page"] {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }
}

/* Индикатор новых заявок в меню аккаунта */
.account-item__badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* Кнопка сброса кеша: маленький кружок, но зона нажатия по-прежнему 44 px */
.cache-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  position: relative;
}
.cache-btn::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.cache-btn svg {
  position: relative;
  width: 14px;
  height: 14px;
}
.cache-btn:hover {
  color: var(--accent);
  border-color: transparent;
  background: none;
}
.cache-btn:hover::before {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* Порядок соцсетей: стрелки ↑ ↓ в строке */
.link-row__move {
  display: inline-flex;
  gap: 2px;
}
.link-row__move .btn {
  min-width: 32px;
  padding-inline: 6px;
  font-size: var(--text-sm);
}

/* Обязательные поля в окне обращения */
.req {
  color: var(--danger, #c0392b);
  font-weight: 700;
}
.chips button[aria-pressed="false"] {
  border-color: var(--line-strong);
  opacity: 0.85;
}

/* Окно обращения: заметные подсказки об ошибках */
.feedback-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--danger, #c0392b);
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger, #c0392b) 10%, transparent);
  color: var(--ink);
  font-weight: 600;
}
.feedback-field-error {
  margin-top: 6px;
  color: var(--danger, #c0392b);
  font-size: var(--text-sm);
  font-weight: 600;
}
.is-invalid,
.chips.is-invalid button {
  border-color: var(--danger, #c0392b) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #c0392b) 18%, transparent);
}
.chips.is-invalid {
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--danger, #c0392b);
}

/* Короткая подсказка (тост) — используется кнопками карточек */
.raffly-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  z-index: 200;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink, #16181d);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.raffly-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Телефон: знак логотипа по высоте равен кнопкам шапки, а не мельче их */
@media (max-width: 480px) {
  .logo__mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .logo {
    gap: var(--s-3);
  }
}

/* Мобильная страховка: меню и длинные блоки не должны рождать горизонтальный скролл */
html, body { overflow-x: clip; }

.mobile-nav {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.mobile-nav__list { overflow-x: hidden; }
.mnav-item__text { min-width: 0; overflow-wrap: anywhere; }


/* Поздравления: вся карточка — удобная ссылка к комментариям */
.received { position: relative; transition: border-color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast); }
.received:hover { background: var(--surface-2); transform: translateY(-1px); }
.received:has(.received__link:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.received__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.received a:not(.received__link) { position: relative; z-index: 2; }

/* Админка: панель фильтров и узкие колонки таблицы */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.admin-search { flex: 1 1 260px; display: grid; gap: 4px; font-size: var(--text-sm); color: var(--muted); }
.admin-filter { display: grid; gap: 4px; font-size: var(--text-sm); color: var(--muted); }
.admin-toolbar .input { min-height: 40px; }
.admin__table .input--sm { min-height: 34px; padding: 4px 8px; font-size: var(--text-sm); }
.admin__date { white-space: nowrap; color: var(--muted); }
.admin__th-narrow, .admin__count { width: 1%; white-space: nowrap; text-align: center; }
.admin__th-sort { cursor: pointer; user-select: none; }
.admin__th-sort:hover { color: var(--ink); }

/* Админка: страницы и опасное действие */
.admin-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.admin__danger { color: #b4232a; border-color: color-mix(in srgb, #b4232a 30%, transparent); }
.admin__danger:hover { background: color-mix(in srgb, #b4232a 10%, transparent); color: #b4232a; }

/* A1. Узкие экраны: тема и язык переезжают в меню, шапка помещается */
@media (max-width: 380px) {
  .header-actions { gap: 6px; min-inline-size: 0; flex-shrink: 1; }
  .header-actions > .lang-btn,
  .header-actions > [data-theme-toggle] { display: none; }
  .site-header__inner { padding-inline: 12px; }
  .header-cta { padding-inline: 10px; min-height: 44px; }
}
.mobile-nav__tools {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.mobile-nav__tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  font-size: var(--text-sm);
  cursor: pointer;
}
.mobile-nav__tool svg { width: 18px; height: 18px; }

/* A2. Телефон: плашка cookie стоит в потоке под шапкой и ничего не перекрывает */
@media (max-width: 640px) {
  .rf-note--inline {
    position: static;
    inset: auto;
    margin: 12px 12px 0;
    padding: 14px;
    animation: none;
  }
  .rf-note--inline .rf-note__inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .rf-note--inline .rf-note__text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .rf-note--inline .rf-note__actions { justify-content: space-between; }
}

/* A8. Таблицы в документах: фиксированная ширина и перенос — без «простыни» на 2613 px */
.table-wrap .table { table-layout: fixed; width: 100%; }
.table-wrap .table th,
.table-wrap .table td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .table-wrap .table th,
  .table-wrap .table td { padding: 8px 10px; font-size: 13px; }
}
/* Если таблица всё же прокручивается — это видно по градиенту у правого края */
.table-wrap.is-scrollable {
  scrollbar-width: thin;
  background-image: linear-gradient(to left, rgba(20, 18, 40, 0.06), transparent 24px);
  background-repeat: no-repeat;
  background-position: right;
}

/* Ячейки документов переносят текст: иначе содержимое шире таблицы */
.table-wrap .table th,
.table-wrap .table td { white-space: normal; }

/* A8. Документы и любые таблицы на телефоне: карточки с подписями колонок */
@media (max-width: 640px) {
  .table-wrap .table:not(.table--limits) thead { display: none; }
  .table-wrap .table:not(.table--limits),
  .table-wrap .table:not(.table--limits) tbody,
  .table-wrap .table:not(.table--limits) tr,
  .table-wrap .table:not(.table--limits) td { display: block; width: 100%; }
  .table-wrap .table:not(.table--limits) tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }
  .table-wrap .table:not(.table--limits) tr:last-child { border-bottom: 0; }
  .table-wrap .table:not(.table--limits) td {
    padding: 6px 0;
    border: 0;
  }
  .table-wrap .table:not(.table--limits) td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .table-wrap .table:not(.table--limits) td:first-child { font-weight: 700; }
}

/* Кнопка установки приложения — рядом с логотипом */
.install-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.install-wrap[hidden] { display: none; }

.install-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.install-btn:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: var(--accent); transform: translateY(-1px); }
.install-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.install-btn svg { width: 16px; height: 16px; }
.install-btn > [data-i18n="install.label"] { display: none; }

/* Подсказка с призывом и кнопкой установки */
.install-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 60;
  width: 300px;
  max-width: min(300px, 82vw);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgb(20 18 40 / 14%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s linear var(--dur-fast);
  pointer-events: none;
}
.install-wrap:hover .install-tip,
.install-wrap:focus-within .install-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s;
}
.install-tip__text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.install-tip__cta { margin-top: 10px; width: 100%; min-height: 40px; }

@media (max-width: 720px) {
  .install-btn { padding: 0; width: 44px; min-width: 44px; height: 44px; justify-content: center; }
  .install-btn > [data-i18n="install.label"] { display: none; }
  .install-tip { left: -8px; }
}

/* Диалог установки на iPhone */
.install-dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; max-width: min(440px, 92vw); }
.install-dialog::backdrop { background: rgb(20 18 40 / 45%); }
.install-dialog h2 { margin-top: 0; }
.install-dialog ol { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.install-dialog .btn { margin-top: 16px; }

/* Подсказка у кнопки установки: призыв, а не просто подпись */
.install-btn { position: relative; }
.install-btn__tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 60;
  width: max-content;
  max-width: min(300px, 82vw);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 12px 28px rgb(20 18 40 / 14%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s linear var(--dur-fast);
  pointer-events: none;
}
.install-btn:hover .install-btn__tip,
.install-btn:focus-visible .install-btn__tip {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s;
}
@media (max-width: 720px) {
  .install-btn__tip { left: -8px; }
}

/* Подвал на телефоне: убираем лишнюю пустоту и второй разделитель перед копирайтом */
@media (max-width: 719px) {
  .site-footer__grid { gap: 20px; }
  .site-footer__col.is-collapsed .site-footer__heading { margin-bottom: 0; padding-bottom: 10px; }
  .site-footer__bottom {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 0;
  }
}

/* ---------- «Жетон Raffly»: кнопка наверх с прогрессом ---------- */
.back-top {
  --back-top-lift: 0px;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px) + var(--back-top-lift));
  z-index: 58;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 10px 28px -12px rgb(20 18 40 / 35%), 0 2px 6px -2px rgb(20 18 40 / 12%);
  cursor: pointer;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.back-top[hidden] { display: none; }
.back-top:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 32px -12px rgb(20 18 40 / 45%); }
.back-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.back-top:active { transform: translateY(0); }

.back-top__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.back-top__ring-bg,
.back-top__ring-fill {
  fill: none;
  stroke-width: 2.5;
}
.back-top__ring-bg { stroke: var(--line); }
.back-top__ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.15s linear;
}

.back-top__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 1;
}
.back-top__mark svg { width: 100%; height: 100%; fill: currentColor; }

.back-top__label {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 650;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s linear var(--dur-fast);
  pointer-events: none;
}
.back-top:hover .back-top__label,
.back-top:focus-visible .back-top__label {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s;
}

/* Подброс жетона при клике */
.back-top.is-flipping .back-top__mark { animation: back-top-flip 0.5s cubic-bezier(0.3, 0.9, 0.3, 1); }
.back-top.is-flipping .back-top__ring { animation: back-top-ring 0.5s ease; }
@keyframes back-top-flip {
  0% { transform: rotateX(0) translateY(0); }
  45% { transform: rotateX(180deg) translateY(-6px); }
  100% { transform: rotateX(360deg) translateY(0); }
}
@keyframes back-top-ring {
  50% { transform: rotate(90deg); }
  100% { transform: rotate(270deg); }
}

@media (max-width: 640px) {
  .back-top { width: 52px; height: 52px; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--back-top-lift)); }
  .back-top__mark { width: 26px; height: 26px; }
  .back-top__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .back-top, .back-top__label, .back-top__ring-fill { transition: none; }
  .back-top.is-flipping .back-top__mark,
  .back-top.is-flipping .back-top__ring { animation: none; }
}

@media print { .back-top { display: none !important; } }

/* Уведомление в окне входа: регистрация временно закрыта */
.auth__notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--ink);
}
.auth__notice svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; color: var(--accent); }
.auth__notice p { margin: 0; font-size: var(--text-sm); line-height: 1.5; }

/* Колокольчик без непрочитанных: виден, но спокойный */
.header-bell--quiet { opacity: 0.55; }
.header-bell--quiet:hover { opacity: 1; }

/* Пункты темы и языка в меню аккаунта */
.account-item[data-theme-toggle],
.account-item[data-lang-toggle] { width: 100%; text-align: left; }

/* Тема и язык в меню аккаунта — компактные иконки-пилюли */
.account-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 10px; }
.account-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.account-tool:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.account-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.account-tool svg { width: 18px; height: 18px; color: var(--accent); }

/* Язык в окне входа — доступен гостю */
.auth__head { display: flex; align-items: center; gap: 8px; }
.auth__title { flex: 1; margin: 0; }
.auth__lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}
.auth__lang:hover { border-color: var(--accent); }
.auth__lang svg { width: 17px; height: 17px; color: var(--accent); }
.auth__lang[hidden] { display: none; }

/* ===== pages.css ===== */
/* ==========================================================================
   Raffly — стили страниц
   ========================================================================== */

/* ---------- Главная: герой ---------- */

.hero {
  position: relative;
  padding-block: clamp(32px, 6vw, 72px) clamp(40px, 7vw, 88px);
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background: radial-gradient(
      60% 55% at 20% 20%,
      color-mix(in srgb, var(--accent) 18%, transparent) 0%,
      transparent 70%
    ),
    radial-gradient(
      45% 45% at 85% 10%,
      color-mix(in srgb, var(--gold) 16%, transparent) 0%,
      transparent 70%
    );
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.hero__grid {
  display: grid;
  gap: var(--s-10);
  align-items: center;
}

@media (min-width: 980px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--s-12);
  }
}

.hero__title {
  margin-top: var(--s-4);
}

.hero__lead {
  margin-top: var(--s-5);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: var(--muted);
  max-width: 34ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-8);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin-top: var(--s-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.hero__meta li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.hero__meta svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* Демо-карточка в герое */
.hero-demo {
  position: relative;
  padding: var(--s-5);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.hero-demo__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.hero-demo__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}

.hero-demo .draw-stage {
  min-height: 260px;
  background: var(--surface-2);
}

.hero-demo__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-4);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ---------- Логотипы/«полоса доверия» ---------- */

.trust-strip {
  padding-block: var(--s-6);
  border-block: 1px solid var(--line);
  background: var(--bg-elevated);
}

.trust-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2) var(--s-3);
}

.trust-strip__inner span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-inline: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--ink-soft);
}

/* ---------- Секции ---------- */

.section-head {
  display: grid;
  gap: var(--s-3);
  max-width: 62ch;
  margin-bottom: var(--s-10);
}

.section-head--center {
  justify-items: center;
  text-align: center;
  margin-inline: auto;
}

.feature {
  display: grid;
  gap: var(--s-3);
  align-content: start;
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.feature__icon svg {
  width: 22px;
  height: 22px;
}

.feature__title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.feature__text {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

/* Шаги «как это работает» */
.how-grid {
  display: grid;
  gap: var(--s-5);
  counter-reset: how;
}

@media (min-width: 800px) {
  .how-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.how-step {
  position: relative;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.how-step__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* Блок честности */
.proof {
  display: grid;
  gap: var(--s-8);
  align-items: center;
}

@media (min-width: 900px) {
  .proof {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-12);
  }
}

.proof__code {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.proof__code-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.proof__code pre {
  margin: 0;
  padding: var(--s-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  color: var(--ink-soft);
}

.proof__code b {
  color: var(--accent);
  font-weight: 650;
}

/* CTA-полоса */
.cta-band {
  position: relative;
  display: grid;
  gap: var(--s-5);
  justify-items: center;
  text-align: center;
  padding: clamp(32px, 6vw, 64px) var(--s-6);
  border-radius: var(--radius-xl);
  background: linear-gradient(
      140deg,
      color-mix(in srgb, var(--accent) 92%, #000) 0%,
      var(--accent) 55%,
      color-mix(in srgb, var(--accent) 70%, var(--gold)) 100%
    );
  color: #fff;
  overflow: hidden;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  color: rgb(255 255 255 / 82%);
  max-width: 52ch;
}

.cta-band .btn--secondary {
  --btn-bg: #fff;
  --btn-ink: var(--accent-active);
  --btn-border: transparent;
}

/* FAQ */
.faq {
  display: grid;
  gap: var(--s-3);
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--s-4) var(--s-5);
}

.faq summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  align-items: center;
  min-height: 44px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-out);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin-top: var(--s-3);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ---------- Конструктор ---------- */

.builder {
  display: grid;
  gap: var(--s-8);
  align-items: start;
}

@media (min-width: 980px) {
  .builder {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: var(--s-10);
  }
}

.builder__panel {
  min-width: 0;
}

.builder__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--s-5));
  display: grid;
  gap: var(--s-4);
}

@media (max-width: 979px) {
  .builder__aside {
    position: static;
  }
}

.step-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.step-head__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 750;
}

.step-head__title {
  font-size: var(--text-lg);
  font-weight: 700;
}

/* Источники */
.sources {
  display: grid;
  gap: var(--s-2);
}

.source {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--s-3) var(--s-4);
  align-items: center;
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast),
    box-shadow var(--dur-fast);
}

.source:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.source[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}

.source:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.source__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.source[aria-pressed="true"] .source__icon {
  background: var(--accent);
  color: var(--accent-ink);
}

.source__icon svg {
  width: 22px;
  height: 22px;
}

.source__title {
  font-weight: 650;
  font-size: var(--text-sm);
}

.source__desc {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* Статистика */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stat {
  padding: var(--s-4);
  background: var(--surface);
  display: grid;
  gap: 2px;
}

.stat__value {
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat__label {
  font-size: var(--text-xs);
  color: var(--muted);
}

.stat--danger .stat__value {
  color: var(--danger);
}

.stat--success .stat__value {
  color: var(--success);
}

/* ---------- Публичная страница розыгрыша ---------- */

.result-hero {
  padding-block: var(--s-10);
  background: radial-gradient(
      80% 100% at 50% 0%,
      color-mix(in srgb, var(--accent) 10%, transparent) 0%,
      transparent 70%
    ),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.result-hero__grid {
  display: grid;
  gap: var(--s-8);
  align-items: start;
}

@media (min-width: 900px) {
  .result-hero__grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.winner-card {
  display: grid;
  gap: var(--s-3);
  justify-items: center;
  padding: var(--s-8) var(--s-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.winner-card__avatar {
  width: 88px;
  height: 88px;
  font-size: var(--text-2xl);
}

.winner-card__name {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.winner-card__prize {
  font-size: var(--text-sm);
  color: var(--muted);
}

.protocol {
  display: grid;
  gap: var(--s-3);
}

.protocol__row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 1px dashed var(--line);
  font-size: var(--text-sm);
  align-items: baseline;
}

.protocol__row:last-child {
  border-bottom: 0;
}

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

.protocol__value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  word-break: break-all;
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
}

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Страница блогера ---------- */

.profile-head {
  display: grid;
  gap: var(--s-5);
  padding-block: var(--s-10);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .profile-head {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-6);
  }
}

.profile-head__name {
  font-size: clamp(1.75rem, 4vw, var(--text-3xl));
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-head__bio {
  color: var(--muted);
  max-width: 56ch;
  margin-top: var(--s-2);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 var(--s-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 550;
  text-decoration: none;
}

.social-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.social-link svg {
  width: 16px;
  height: 16px;
}

.giveaway-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.giveaway-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: inherit;
}

.giveaway-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.giveaway-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

.giveaway-card__winner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

/* ---------- Рандомайзер ---------- */

.rng {
  display: grid;
  gap: var(--s-8);
}

@media (min-width: 900px) {
  .rng {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.rng__result {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--s-3);
  height: 100%;
  min-height: 220px;
  padding: var(--s-8) var(--s-5);
  border-radius: var(--radius-lg);
  background: radial-gradient(
      100% 100% at 50% 0%,
      color-mix(in srgb, var(--accent) 12%, transparent) 0%,
      transparent 70%
    ),
    var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
}

.rng__numbers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
}

.rng__number {
  display: grid;
  place-items: center;
  min-width: 88px;
  height: 88px;
  padding-inline: var(--s-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-2xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ---------- Правовые страницы ---------- */

.legal {
  padding-block: var(--s-10);
}

.legal h1 {
  font-size: clamp(1.75rem, 3.4vw, var(--text-3xl));
  margin-bottom: var(--s-2);
}

.legal__updated {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--s-8);
}

.legal h2 {
  font-size: var(--text-xl);
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
}

.legal h3 {
  font-size: var(--text-base);
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
}

.legal p,
.legal li {
  color: var(--ink-soft);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

.legal p + p,
.legal ul + p,
.legal p + ul {
  margin-top: var(--s-3);
}

.legal ul {
  list-style: disc;
  padding-left: 1.4em;
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.legal ol {
  list-style: decimal;
  padding-left: 1.6em;
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.legal__toc {
  padding: var(--s-5);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: var(--s-8);
}

.legal__toc ol,
.legal__toc ul {
  margin-top: var(--s-3);
  font-size: var(--text-sm);
}

.legal__toc ul {
  list-style: none;
  padding-left: 0;
}

.legal__toc li {
  padding-block: 3px;
}

.legal__note {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: var(--text-sm);
}

/* ---------- 404 ---------- */

.notfound {
  display: grid;
  place-items: center;
  min-height: 62vh;
  text-align: center;
  padding-block: var(--s-16);
}

.notfound__code {
  font-size: clamp(4rem, 16vw, 9rem);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Шаги-индикатор в конструкторе ---------- */

.progress {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.progress__bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}

/* ---------- /create/: выбор способа и мастер ---------- */
.studio-hero {
  max-width: 720px;
  margin-bottom: var(--s-6);
}
.studio-grid {
  display: grid;
  gap: var(--s-3);
  /* auto-fill, а не auto-fit: одна карточка в группе не растягивается на всю ширину */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: var(--s-3);
}
.studio-card {
  text-decoration: none;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-areas:
    "icon title"
    "icon text"
    "icon badge";
  grid-template-rows: auto 1fr auto;
  gap: 4px var(--s-3);
  align-items: start;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.studio-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm, 0 6px 18px rgba(23, 21, 31, 0.06));
}
.studio-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.studio-card__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-color, var(--accent)) 14%, transparent);
  color: var(--card-color, var(--accent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-color, var(--accent)) 18%, transparent);
}
.studio-card__icon svg {
  width: 24px;
  height: 24px;
}
.studio-card__title {
  grid-area: title;
  font-weight: 700;
  font-size: var(--text-base);
}
.studio-card__text {
  grid-area: text;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.studio-card__badge {
  grid-area: badge;
  justify-self: start;
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-color, var(--accent)) 12%, transparent);
  color: var(--card-color, var(--accent));
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.studio-card__badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}
.studio-card__badge--lock {
  background: var(--surface-2);
  color: var(--muted);
}
.studio-card__badge--lock::before {
  box-shadow: none;
  opacity: 0.55;
}
.studio-card--soon .studio-card__icon {
  opacity: 0.9;
}
.studio-card--soon {
  cursor: not-allowed;
  opacity: 0.72;
}
.studio-card--soon:hover {
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}

.studio-choose .notice {
  margin-top: var(--s-6);
}
.studio-stage {
  margin-top: var(--s-6);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.studio-stage__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.studio-sound {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.studio-sound svg {
  width: 18px;
  height: 18px;
}
.studio-sound .studio-sound__off,
.studio-sound.is-muted .studio-sound__on {
  display: none;
}
.studio-sound.is-muted .studio-sound__off {
  display: block;
}
.studio-setup-row {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 2fr 1fr;
  margin-top: var(--s-3);
}
.studio-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: var(--s-3);
  font-family: inherit;
  line-height: 1.5;
}
.studio-countdown {
  display: grid;
  place-items: center;
  min-height: 260px;
}
.studio-countdown span {
  font-size: clamp(72px, 18vw, 160px);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.studio-countdown span.is-pop {
  animation: studio-pop 0.85s ease-out;
}
@keyframes studio-pop {
  0% { transform: scale(0.5); opacity: 0; }
  35% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.studio-list {
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
}
.studio-runner {
  font-size: clamp(32px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}
.studio-runner.is-winner {
  color: var(--accent);
  animation: studio-pop 0.5s ease-out;
}
.studio-runner__hint {
  color: var(--muted);
  margin-top: var(--s-3);
}
.studio-wheel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}
.studio-wheel canvas {
  width: min(520px, 86vw);
  height: auto;
}
.studio-wheel__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.studio-winners {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.studio-winner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  animation: studio-pop 0.4s ease-out;
}
.studio-winner__place {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
}
.studio-winner__label {
  font-weight: 700;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}
.studio-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.studio-result-actions__main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  order: -1;
}
.studio-result-actions__main svg {
  width: 20px;
  height: 20px;
}
.studio-result-actions .btn--ghost {
  border: 1px solid var(--line);
  background: var(--surface);
}
.studio-result-actions .btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.studio-saved {
  margin-top: var(--s-4);
}
.studio-saved__row {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.studio-saved__row input {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 640px) {
  .studio-setup-row {
    grid-template-columns: 1fr;
  }
  .studio-choose .notice {
  margin-top: var(--s-6);
}
.studio-stage {
    padding: var(--s-4);
  }
}

/* Конфетти поверх результата */
.studio-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}
[data-ideas-list] li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
[data-ideas-list] li:last-child {
  border-bottom: 0;
}

/* Правовые документы: по-английски показываем пометку о юридической силе русского текста */
.legal__lang-note {
  display: none;
  margin: var(--s-4) 0;
  padding: var(--s-4);
  border: 1px solid color-mix(in srgb, #f5a524 38%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #f5a524 10%, var(--surface));
  line-height: 1.55;
}
html[lang="en"] .legal__lang-note {
  display: block;
}

/* Группы способов по доступности */
.studio-group {
  margin-top: var(--s-6);
}
.studio-group__title {
  margin: 0 0 var(--s-3);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.studio-group + .studio-group {
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.studio-group--idea {
  padding-bottom: var(--s-2);
}

/* Заблокированная карточка: видно, что нажать нельзя, но объяснение есть */
.studio-card.is-locked {
  cursor: not-allowed;
  opacity: 0.62;
}
.studio-card.is-locked:hover {
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}

/* ---------- Идеи в работе ---------- */
.ideas-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.idea-card {
  display: grid;
  gap: 10px;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: idea-in 0.35s ease both;
}
@keyframes idea-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.idea-card__text {
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.idea-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--muted);
}
.idea-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.idea-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.idea-pill--planned {
  background: color-mix(in srgb, #f5a524 16%, transparent);
  color: #a86a00;
}
.idea-pill--done {
  background: color-mix(in srgb, #1c9e5a 16%, transparent);
  color: #147a45;
}
:root[data-theme="evening"] .idea-pill--planned { color: #f5c66b; }
:root[data-theme="evening"] .idea-pill--done { color: #6be3a4; }

/* Сделанное — приглушаем: новости больше нет, но текст читается */
.idea-card--done {
  background: var(--surface-2);
  border-color: var(--line);
}
.idea-card--done .idea-card__text {
  color: var(--muted);
  font-weight: 500;
}
.idea-card--done .idea-pill::before {
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .idea-card {
    animation: none;
  }
}

/* Адрес страницы в настройках — заметный, но не кричащий */
.settings-page-url {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

/* Сколько смен роли осталось */
.settings-role-left {
  margin-top: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
}
.settings-role-left[data-state="empty"] {
  color: var(--muted);
  font-weight: 500;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Профиль: две колонки ---------- */
.profile-layout {
  display: grid;
  gap: var(--s-6);
  padding-block: var(--s-6) var(--s-8);
}

.profile-main {
  display: grid;
  gap: var(--s-6);
  min-width: 0;
}

.profile-side {
  min-width: 0;
}

@media (min-width: 1024px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: var(--s-8);
  }
  .profile-side {
    position: sticky;
    top: 96px;
  }
}

/* Левая колонка: аватар и текст на одной линии */
.profile-head {
  display: grid;
  gap: var(--s-5);
  padding-block: var(--s-8) 0;
  border-bottom: 0;
}

@media (min-width: 760px) {
  .profile-head {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: var(--s-6);
  }
}

/* Правая колонка: карточка со статистикой и действиями */
.profile-card {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 10px 30px rgba(20, 16, 40, 0.06);
}

.profile-stats {
  display: grid;
  gap: 0;
}

.profile-stats__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: 10px;
}
.profile-stats__row + .profile-stats__row {
  border-top: 1px solid var(--line);
}
.profile-stats__value {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.profile-stats__label {
  font-size: var(--text-sm);
  color: var(--muted);
}

.profile-card__note {
  font-size: var(--text-sm);
  color: var(--muted);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}

.profile-actions {
  display: grid;
  gap: var(--s-2);
}

.profile-actions .btn {
  width: 100%;
  justify-content: flex-start;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

@media (max-width: 1023px) {
  .profile-layout {
    padding-block: var(--s-4) var(--s-6);
  }
  .profile-card {
    box-shadow: none;
  }
  .profile-actions {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* ---------- Профиль: розыгрыши строками ---------- */
.draw-rows {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.draw-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-2) var(--s-4);
  align-items: center;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.draw-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.draw-row__main {
  min-width: 0;
}
.draw-row__title {
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draw-row__meta {
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.draw-row__winner {
  color: var(--accent);
  font-weight: 600;
}
.draw-row__arrow {
  color: var(--muted);
  font-size: var(--text-lg);
}
@media (max-width: 560px) {
  .draw-row {
    grid-template-columns: 1fr;
    padding: var(--s-3);
  }
  .draw-row__arrow {
    display: none;
  }
  .draw-row__title {
    white-space: normal;
  }
}

/* ---------- Профиль: кнопки действий ---------- */
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

/* ---------- Ссылка на запись стрима ---------- */
.stream-form__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.stream-form__row {
  display: flex;
  gap: var(--s-2);
  align-items: stretch;
  flex-wrap: wrap;
}
.stream-form__row .input {
  flex: 1 1 260px;
  min-width: 0;
}
.stream-form__row .btn {
  flex: 0 0 auto;
}
@media (max-width: 560px) {
  .stream-form__row .btn {
    width: 100%;
  }
}

/* Пилюли типа и способа в карточке розыгрыша */
.list-item__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.list-item__pills .badge {
  font-size: var(--text-xs);
  padding: 3px 9px;
}

/* ---------- Фильтры розыгрышей: панель и чипы ---------- */
@media (min-width: 860px) {
  /* Поиск тянется, сортировка и кнопка фильтров — по содержимому */
  .filters {
    grid-template-columns: minmax(0, 1fr) 220px auto;
    align-items: end;
  }
}
.field--toggle {
  justify-self: end;
  align-self: end;
}
.filters__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  white-space: nowrap;
}
.filters__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.filters-panel {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.filters-panel[hidden] {
  display: none;
}
.filters-panel__group {
  display: grid;
  gap: 8px;
}
.filters-panel__title {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink);
}
.filters-panel__foot {
  display: flex;
  justify-content: flex-end;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips button {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}
.chips button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chips button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  font-weight: 700;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s-3);
}
.filters__count {
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 859px) {
  .filters {
    grid-template-columns: 1fr;
  }
  .field--toggle {
    justify-self: stretch;
  }
  .filters__toggle {
    width: 100%;
    justify-content: center;
  }
  .filters-panel__foot {
    justify-content: stretch;
  }
  .filters-panel__foot .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .filters-bar {
    margin-top: var(--s-2);
  }
}

/* ---------- Страница розыгрыша: действия и условия ---------- */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.action-row .btn {
  min-height: 48px;
}
@media (max-width: 560px) {
  .action-row .btn {
    width: 100%;
    justify-content: center;
  }
}

.conditions {
  display: grid;
  gap: 8px;
  margin-top: var(--s-3);
  padding-left: 0;
  list-style: none;
  counter-reset: condition;
}
.conditions li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: var(--text-sm);
  color: var(--ink-soft);
  counter-increment: condition;
}
.conditions li::before {
  content: counter(condition);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

/* Единая мера для текста на страницах приложения: контейнер широкий,
   а строки остаются удобными для чтения */
.page-text {
  max-width: 70ch;
}

/* Профиль блогера: верхний отступ как на остальных страницах */
.profile-container {
  padding-top: var(--s-16);
}
@media (max-width: 640px) {
  .profile-container {
    padding-top: var(--s-10);
  }
}
/* Шапка профиля больше не задаёт свой отступ сверху — его держит контейнер */
.profile-container .profile-head {
  padding-block: 0;
}

/* ---------- Страница участника: результаты по розыгрышам ---------- */
.participation {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.participation + .participation {
  margin-top: var(--s-3);
}
.participation--won {
  border-color: color-mix(in srgb, #1c9e5a 35%, var(--line));
  background: color-mix(in srgb, #1c9e5a 5%, var(--surface));
}
.participation__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
}
.participation__title {
  font-size: var(--text-lg);
  font-weight: 700;
}
.participation__title a {
  text-decoration: none;
  color: inherit;
}
.participation__title a:hover {
  color: var(--accent);
}
.participation__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.participation__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}
.participation__form {
  display: grid;
  gap: var(--s-2);
}
.participation__input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  font: inherit;
  padding: 10px 12px;
}
.badge--neutral {
  background: var(--surface-2);
  color: var(--muted);
}

/* Карточки победителей: в центре человек */
.winner-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
.winner-card__head > div { min-width: 0; }
.winner-card .card-title,
.winner-card .card-title a,
.winner-card .hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.winner-card .card-title { max-width: 100%; }
.winner-card__avatar {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
}
.winner-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.winner-card__prize {
  margin-top: var(--s-3);
  font-size: var(--text-sm);
}

/* Страница участника: аватар стоит в потоке, а не наезжает на крошки */
.profile-main .profile-head__avatar,
.profile-main .profile-head__avatar img {
  margin-top: 0;
}

/* Двухполевые фильтры (победители): на телефоне поиск не сжимается */
.filters.filters--two {
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .filters.filters--two {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
}

/* Строчные ссылки в карточках — не мельче 24 px по высоте (WCAG 2.5.8) */
.winner-card__prize a,
.participation__meta a {
  display: inline-block;
  padding-block: 4px;
  line-height: 1.5;
}

/* Разделы на странице участника: воздух между блоками, но без пустых экранов */
.profile-main > .section {
  padding-block: var(--s-5) var(--s-6);
  margin-top: 0;
}
.profile-main .section > h2 {
  margin-bottom: var(--s-4);
}
.profile-main > .section:first-of-type {
  margin-top: var(--s-5);
}

/* Ссылка-счётчик поздравлений */
.participation__count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding-block: 6px;
}
.participation__count:hover {
  text-decoration: underline;
}

/* Адресат в комментариях на странице розыгрыша */
.comment__target {
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}
.comment__target:hover {
  text-decoration: underline;
}

/* Полученные поздравления на странице участника */
.received-list {
  display: grid;
  gap: var(--s-3);
}
.received {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.received__avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.received__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.received__head {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--text-sm);
}
.received__date {
  flex: 0 0 auto;
  color: var(--muted-2, var(--muted));
  font-size: 11.5px;
  white-space: nowrap;
}

/* Строка «розыгрыш · приз» — всегда одна, хвост обрезается */
.received__prize {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.received__prize a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.received__prize a:hover {
  text-decoration: underline;
}

/* Текст поздравления: не больше двух строк, отделён подложкой */
.received__text {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: var(--text-sm);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Переключатель комментариев на странице розыгрыша */
.comments-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.comments-filter button {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.comments-filter button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
@media (max-width: 560px) {
  .comments-filter button {
    min-height: 44px;
  }
}

/* Поздравления в правой колонке страницы участника */
.received-block {
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.received-block h2 {
  font-size: var(--text-lg);
}
.received-list {
  display: grid;
  gap: var(--s-2);
}
.received {
  grid-template-columns: 32px minmax(0, 1fr);
  padding: var(--s-2) var(--s-3);
}
.received__avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}
.received__head {
  font-size: var(--text-sm);
}
.received__text {
  font-size: var(--text-sm);
}

/* Карточка победителя: одинаковая высота, название в одну строку, кнопка снизу */
.winner-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0; /* иначе длинное название растягивает колонку сетки */
}
.winner-card .action-row {
  margin-top: auto;
  padding-top: var(--s-3);
}
.winner-card__prize {
  /* Название показываем двумя строками: обрезка «Розыгрыш: …» бесполезна */
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-width: 0;
  overflow-wrap: anywhere;
}
.winner-card__prize a {
  text-decoration: none;
}
.winner-card__prize a:hover {
  text-decoration: underline;
}

/* Страница заявки блогеру */
.offer-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.hint.is-error {
  color: var(--danger, #b3261e);
  font-weight: 600;
}
.modal-note {
  margin-top: var(--s-3);
}

/* Заявки в кабинете блогера */
.request-list {
  display: grid;
  gap: var(--s-3);
}
.request {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.request__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.request__date {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted);
}
.request__title {
  font-size: var(--text-lg);
  font-weight: 700;
}
.request__text {
  color: var(--ink-soft);
  white-space: pre-line;
}
.request__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.request__contact {
  font-size: var(--text-sm);
}
.request__image {
  max-width: 320px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* Страница заявки: аватар в потоке, отступы между полями */
.offer-head .profile-head__avatar {
  margin-top: 0;
}
.offer-head .profile-head__avatar img,
.offer-head .profile-head__avatar .avatar {
  width: 88px;
  height: 88px;
  font-size: 30px;
}
[data-offer-form] .chips + .field,
[data-offer-form] .field + .chips {
  margin-top: var(--s-4);
}
[data-offer-categories] {
  margin-top: 8px;
}

/* Ответ блогера и просроченные заявки */
.request__reply {
  margin-top: var(--s-2);
  padding: var(--s-3);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.request__overdue {
  margin-top: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--danger, #b3261e);
}

/* Категории в настройках: крестик «убрать» рядом с названием */
[data-offer-cat-list] button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 38px;
  white-space: normal;
  overflow: visible;
  text-align: left;
}
[data-offer-cat-list] button span {
  display: inline-block;
  opacity: 0.65;
  font-size: 15px;
  line-height: 1;
}
[data-offer-cat-list] button:hover span {
  opacity: 1;
}

/* Редактируемые категории: название и крестик внутри чипа */
[data-offer-cat-list] .chip--editable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
}
[data-offer-cat-list] .chip__label {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: text;
  padding: 4px 2px;
  min-height: 32px;
}
[data-offer-cat-list] .chip__label:hover {
  text-decoration: underline dotted;
}
[data-offer-cat-list] .chip__remove {
  border: 0;
  background: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
  opacity: 0.7;
  min-width: 32px;
  min-height: 32px;
}
@media (max-width: 640px) {
  [data-offer-cat-list] .chip__remove {
    min-width: 44px;
    min-height: 44px;
  }
  [data-offer-cat-list] .chip--editable {
    padding: 2px 2px 2px 12px;
  }
}
[data-offer-cat-list] .chip__remove:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
[data-offer-cat-list] .chip__input {
  width: 180px;
  padding: 4px 6px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}

/* Настройки: две карточки в ряд на широком экране */
.settings-grid {
  display: grid;
  gap: var(--s-4);
}
@media (min-width: 900px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* Блок привязки Telegram */
.telegram-link-box {
  display: grid;
  gap: var(--s-2);
}
.telegram-link-box__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.telegram-link-box__value {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--text-sm);
}

/* Настройки: левая колонка со стопкой карточек */
.settings-grid--stack .settings-col {
  display: grid;
  gap: var(--s-4);
  align-content: start;
  min-width: 0;
}

/* Карточка почты: подпись на своей строке, кнопка не прилипает */
[data-email-card] .label {
  display: block;
  margin-top: var(--s-4);
}
[data-email-card] .cluster .input {
  flex: 1 1 200px;
  min-width: 0;
}
[data-email-card] [data-email-resend] {
  margin-top: var(--s-3);
}

/* Настройки: обе колонки заканчиваются на одной линии */
@media (min-width: 900px) {
  .settings-grid--stack {
    align-items: stretch; /* колонки тянем на одну высоту */
  }
  .settings-grid--stack .settings-col {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
  }
  .settings-grid--stack .settings-col > .card {
    flex: 1 1 auto; /* небольшой запас высоты делится между карточками */
  }
}

/* Рандомайзер: нижние блоки «История» и «Честность» одной высоты */
.rng-pair .card {
  height: 100%;
}

/* Рандомайзер: пустая история заполняет карточку аккуратной заглушкой */
.rng-pair .card {
  display: flex;
  flex-direction: column;
}
.rng-pair #rng-empty:not([hidden]) {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  margin-top: var(--s-3);
  padding: var(--s-5);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Кнопки внутри этих карточек не растягиваются на всю ширину */
.rng-pair .card > a.btn,
.rng-pair .card > button.btn {
  align-self: flex-start;
}

/* Кнопка заявки в карточке блогера: заметная, с иконкой */
.offer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.offer-cta svg {
  flex: 0 0 auto;
}

/* Статистика страницы в настройках */
.page-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.page-stats__item dt {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-stats__item dd {
  margin: 2px 0 0;
  font-size: var(--text-xl);
  font-weight: 750;
  line-height: 1.1;
}

/* Кнопка «Добавить соцсеть»: заметная, с иконкой плюса */
.links-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  font-weight: 650;
}
.links-add::before {
  content: "+";
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

/* Шапка кабинета: заголовок слева, действия справа, одной высоты */
.page-head {
  display: grid;
  gap: var(--s-4);
  align-items: center;
}
@media (min-width: 900px) {
  .page-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.page-head__actions .btn {
  min-height: 44px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .page-head__actions {
    width: 100%;
  }
  .page-head__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Диалог обратной связи */
.feedback-dialog {
  width: min(560px, calc(100vw - 32px));
}
.feedback-dialog .modal__body {
  max-height: min(70vh, 560px);
  overflow-y: auto;
}
.footer-feedback-open {
  white-space: nowrap;
}
.site-footer__note {
  max-width: 42ch;
}

/* Подтверждение отправки обращения — заметное */
.feedback-status--done {
  display: block;
  padding: var(--s-4);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, #1a7f37 45%, transparent);
  background: color-mix(in srgb, #1a7f37 10%, var(--surface));
  color: #14532d;
  font-weight: 650;
  font-size: var(--text-md);
}
.feedback-status--done::before {
  content: "✓ ";
  font-weight: 800;
}
@media (prefers-color-scheme: dark) {
  .feedback-status--done {
    color: #86efac;
    background: color-mix(in srgb, #1a7f37 22%, var(--surface));
  }
}

/* Скриншот в обращении (админка) */
.feedback-thumb {
  max-width: 260px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* Подсказка про ограничение доступа к Telegram */
.telegram-fallback {
  display: grid;
  gap: 4px;
  font-size: var(--text-sm);
}

/* Якорь из бота: блок уведомлений не уезжает под липкую шапку */
#telegram {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* Уведомления: кнопки заметнее и с иконками */
.telegram-actions .btn,
.browser-notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.telegram-actions svg,
.browser-notify-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.telegram-link-btn {
  font-weight: 650;
}
.notify-browser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.browser-notify-btn--on {
  border-color: color-mix(in srgb, #1a7f37 45%, transparent);
  background: color-mix(in srgb, #1a7f37 10%, var(--surface));
  color: #14532d;
}
.notify-status--ok {
  color: #14532d;
  font-weight: 600;
}

/* Метка «бот на связи» */
.telegram-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-3);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #1a7f37 40%, transparent);
  background: color-mix(in srgb, #1a7f37 10%, var(--surface));
  color: #14532d;
  font-size: var(--text-sm);
  font-weight: 600;
}
.telegram-badge a {
  color: inherit;
  text-decoration: underline;
}

/* Панель «Telegram привязан» */
.telegram-linked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, #1a7f37 40%, transparent);
  background: color-mix(in srgb, #1a7f37 10%, var(--surface));
}
.telegram-linked__icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a7f37;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  flex: 0 0 auto;
}
.telegram-linked__text {
  display: grid;
  gap: 2px;
  font-size: var(--text-sm);
  color: #14532d;
}
.telegram-linked__text strong {
  font-size: var(--text-md);
  font-weight: 700;
}
.telegram-linked__meta a {
  color: inherit;
  font-weight: 600;
}
.telegram-linked .btn {
  margin-left: auto;
}
@media (max-width: 640px) {
  .telegram-linked .btn {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- Настройки: табы разделов ---------- */
.settings-tabs {
  position: sticky;
  top: calc(var(--header-h) + var(--crumbs-h, 54px)); /* сразу под липкими крошками */
  z-index: 20;
  margin-top: var(--s-6);
  padding: 8px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.settings-tabs__inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.settings-tabs__inner::-webkit-scrollbar {
  display: none;
}
.settings-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.settings-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  color: var(--ink);
}
.settings-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/* разделы не уезжают под липкую шапку с табами */
#avatar,
#banner,
#offers,
#telegram,
#identity,
#profile-links,
#import-file,
#password {
  scroll-margin-top: calc(var(--header-h) + var(--crumbs-h, 54px) + 64px);
}
@media (max-width: 640px) {
  .settings-tab {
    min-height: 44px;
    padding: 10px 14px;
  }
}

/* Аватар и шапка: аккуратная карточка вместо разреженной сетки */
#avatar .media-field,
#banner .media-field {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
#avatar .media-field__control,
#banner .media-field__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-items: start;
}
#avatar .media-field__preview--avatar {
  width: 96px;
  height: 96px;
}
#banner .media-field__preview--banner {
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 16 / 5;
  border-radius: var(--radius-sm);
}
#avatar .media-field__label,
#banner .media-field__label {
  order: 2;
}
#avatar .media-field__control,
#banner .media-field__control {
  order: 1;
}

/* Счётчик в пилюле таба */
.settings-tab__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.settings-tab.is-active .settings-tab__count {
  background: rgb(255 255 255 / 22%);
  color: #fff;
}

/* Форма из двух блоков: тот же ритм отступов, что у остальных карточек */
.settings-split {
  display: block;
}

/* Заметное подтверждение сохранения профиля */
.saved-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #1a7f37 40%, transparent);
  background: color-mix(in srgb, #1a7f37 10%, var(--surface));
  color: #14532d;
  font-weight: 650;
}
.saved-pill::before {
  content: "✓ ";
  font-weight: 800;
}

/* Подписчики в пилюле соцсети */
.profile-link__count {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-socials-note {
  max-width: 52ch;
}

/* Адрес страницы в настройках: отдельная строка, ссылка */
.handle-url-link {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.handle-url-link:hover {
  color: var(--accent-strong, var(--accent));
  text-decoration-thickness: 2px;
}

/* Ошибки обновления подписчиков в настройках */
.socials-error {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.socials-error__title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.socials-error ul {
  margin: 0;
  padding-left: 18px;
}
.socials-error li + li {
  margin-top: 2px;
}

/* Памятка под списком соцсетей: изменения нужно сохранить */
.socials-save-note {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm, 8px);
  background: var(--accent-soft);
  font-size: var(--text-sm);
  color: var(--ink);
}


/* Подсказка: какие сети сайт обновляет сам */
.socials-auto__list {
  margin: 6px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
.socials-auto__list li {
  line-height: 1.45;
}


/* Раздел инструкций: поиск, категории, карточки */
.help-search {
  position: sticky;
  top: calc(var(--header-h, 64px) + 8px);
  z-index: 3;
  padding: 10px 0 6px;
  background: var(--bg);
}
.help-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.chip:hover {
  border-color: var(--accent-line);
}
.help-card__cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-soft);
}
.help-card[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .help-search {
    position: static;
  }
}

/* Инструкции: ширина как у остальных разделов, строки текста остаются читаемыми */
.help-page p,
.help-page li {
  max-width: 78ch;
}

/* Крошки внутри инструкций не должны становиться вертикальным списком */
.help-page .crumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
  gap: 8px;
}
.help-page .crumbs li { max-width: none; }

/* Инструкции: нумерованные шаги снова нумеруются (базовый сброс убирал маркеры) */
.help-page ol {
  list-style: decimal;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}
.help-page ol li::marker {
  color: var(--accent);
  font-weight: 700;
}
.help-page ul {
  padding-left: 20px;
  display: grid;
  gap: 6px;
}
.help-page .card h2 + p {
  margin-top: 8px;
}

/* Тап-цели в инструкциях: ссылки внутри текста и кнопка «Написать нам» */
.help-page p a,
.help-page li a {
  display: inline-block;
  padding-block: 3px;
  text-underline-offset: 3px;
}
.help-page .link-btn {
  min-height: 44px;
  padding: 8px 4px;
}


/* Колесо фортуны: 2/3 колесо, 1/3 список */
.wheel-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--s-6, 32px);
  align-items: start;
}
.wheel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.wheel {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 1;
}
.wheel__svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wheel__pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--accent);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  z-index: 3;
}
.wheel__hub {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 5px solid var(--surface);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  z-index: 2;
}
.wheel__hub:disabled { opacity: 0.6; cursor: default; }
.wheel__confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}
.wheel-alert {
  margin-top: var(--s-3, 12px);
  padding: 10px 12px;
  border-left: 3px solid var(--danger, #c0392b);
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger, #c0392b) 10%, transparent);
  font-weight: 600;
}
.wheel-panel { position: sticky; top: calc(var(--header-h, 64px) + 16px); }
.wheel-result {
  padding: 28px 24px;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  text-align: center;
  scroll-margin-top: calc(var(--header-h, 64px) + 20px);
}
.wheel-result__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--text-xs);
  color: var(--ink-soft);
  font-weight: 700;
}
.wheel-result__name {
  margin-top: 6px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.wheel-result__congrats {
  margin-top: 12px;
  font-size: var(--text-lg, 1.05rem);
  color: var(--ink);
  max-width: 60ch;
  margin-inline: auto;
}
.wheel-result [data-wheel-proof] { white-space: pre-line; font-variant-numeric: tabular-nums; text-align: left; }
.wheel-history { display: grid; gap: 6px; padding-left: 20px; }
@media (max-width: 960px) {
  .wheel-layout { grid-template-columns: 1fr; }
  .wheel-panel { position: static; order: 2; }
  .wheel-stage { order: 1; }
  .wheel__hub { width: 88px; height: 88px; }
}

/* Барабан: стрелка, колышки, звук */
.wheel__hub { display: none; }
.wheel-sound {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.wheel-sound svg { display: block; width: 22px; height: 22px; }
.wheel-sound.is-off { color: var(--muted); opacity: .6; }
.wheel-gate {
  margin-bottom: var(--s-4, 16px);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}
.wheel-save { max-width: 420px; }

/* Заблокированная кнопка старта: замок под курсором */
.btn--locked {
  cursor: not-allowed;
  opacity: .65;
}
.btn--locked::before {
  content: "🔒";
  margin-right: 8px;
  font-size: .95em;
}

/* Стрелка барабана: объёмная, с тенью, вынесена над колесом */
.wheel { padding-top: 46px; }
.wheel__svg { overflow: visible; }
.wheel__pointer {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 62px;
  z-index: 4;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}
.wheel__pointer-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ff5a5f 0%, #e03b42 55%, #b3242b 100%);
  clip-path: polygon(50% 100%, 0% 34%, 22% 34%, 22% 0%, 78% 0%, 78% 34%, 100% 34%);
  border-radius: 4px;
}
.wheel__pointer-body::after {
  content: "";
  position: absolute;
  left: 34%;
  top: 6%;
  width: 14%;
  height: 30%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(2px);
}


/* Барабан: счётчик у заголовка и объём под колесом */
.wheel-heading {
  display: flex;
  align-items: baseline;
  gap: 0;
}
.wheel-count {
  color: var(--accent);
  font-weight: 800;
}
.wheel-count:not(:empty)::before {
  content: ":";
  margin-right: 5px;
}
.wheel::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.22), rgba(0,0,0,0) 70%);
  filter: blur(6px);
  z-index: -1;
}
.wheel__svg {
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .16));
}

/* Плашка «участников больше 24» */
.wheel-many {
  margin-top: var(--s-3, 12px);
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: var(--text-sm);
  color: var(--ink);
}

/* Сохранение результата и переход на страницу розыгрыша */
.studio-redirect {
  margin-top: var(--s-6, 24px);
  padding: 20px 22px;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  text-align: center;
}
.studio-redirect__title {
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 800;
  color: var(--accent);
}

/* Поздравление на экране результата */
.studio-congrats__title {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--accent);
}

/* Запись стрима: заметная плашка и встроенный плеер */
.stream-card {
  margin-top: var(--s-6, 24px);
  padding: 20px 22px;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--accent-line);
  background: linear-gradient(120deg, var(--accent-soft), var(--surface));
}
.stream-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
}
.stream-card__source {
  font-size: var(--text-sm);
  color: var(--accent);
}
.stream-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: transform var(--dur-fast), background-color var(--dur-fast);
}
.stream-cta:hover {
  /* глобальное a:hover делает текст акцентным — на акцентном фоне он пропадал */
  color: #fff;
  background: color-mix(in srgb, var(--accent) 78%, #000);
  transform: translateY(-1px);
}
.stream-cta:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}
.stream-cta__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 46px;
}
.stream-cta__icon svg {
  width: 22px;
  height: 22px;
}
.stream-cta__text strong {
  display: block;
  font-size: var(--text-lg, 1.05rem);
  font-weight: 800;
}
.stream-cta__text small {
  display: block;
  margin-top: 2px;
  font-size: var(--text-sm);
  opacity: 0.85;
}
.stream-modal__body {
  padding: 0;
}
.stream-frame,
.stream-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-md);
  background: #000;
}
@media (max-width: 640px) {
  .stream-cta { flex-direction: column; text-align: center; }
}


/* Страница розыгрыша: строка статусов и кнопка записи справа */
.giveaway-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: var(--s-4);
}
.stream-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.stream-chip__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  flex: 0 0 26px;
}
.stream-chip__icon svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
}
.stream-chip:hover {
  color: #fff;
  background: var(--accent);
  transform: translateY(-1px);
}
.stream-chip:hover .stream-chip__icon {
  background: rgba(255, 255, 255, 0.22);
}
@media (max-width: 640px) {
  .giveaway-top { flex-direction: column; align-items: stretch; }
  .stream-chip { justify-content: center; }
}

/* Неактивная кнопка записи: видна всем, но записи ещё нет */
.stream-chip--muted {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}
.stream-chip--muted:hover {
  transform: none;
  background: var(--surface-2);
  color: var(--muted);
}
.stream-chip--muted .stream-chip__icon {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
}

/* Режим правки страницы розыгрыша */
.edit-pencil {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  flex: 0 0 34px;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.edit-pencil svg { width: 16px; height: 16px; }
.edit-pencil:hover { background: var(--accent); color: #fff; }

.editable-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.editable-row > h1,
.editable-row > p { flex: 1 1 auto; min-width: 0; }
.editable-row [data-field] { position: relative; }

body.is-editing .edit-pencil { display: inline-grid; }
body.is-editing [data-field="title"],
body.is-editing [data-field="description"],
body.is-editing [data-field="prize"],
body.is-editing .congrats__text {
  outline: 2px dashed var(--accent-line);
  outline-offset: 4px;
  border-radius: 6px;
}
.edit-toggle { display: inline-flex; align-items: center; gap: 8px; }
.edit-toggle svg { width: 16px; height: 16px; }
.edit-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.congrats-list { display: grid; gap: 10px; }
.congrats {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.congrats__text {
  flex: 1 1 auto;
  margin: 0;
  white-space: pre-line;
}
@media (max-width: 640px) {
  .editable-row { flex-wrap: wrap; }
}

/* Статус приза и история изменений */
.prize-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.prize-controls .chip {
  min-height: 38px;
  padding: 6px 12px;
  font-size: var(--text-sm);
}
.badge--muted {
  background: var(--surface-2);
  color: var(--muted);
}
.history-list {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  font-size: var(--text-sm);
}
.history-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.history-list time { margin-left: auto; }

/* Предпросмотр «как видят гости»: убираем всё служебное */
body.is-guest-view .edit-toggle,
body.is-guest-view .preview-toggle,
body.is-guest-view .edit-pencil,
body.is-guest-view [data-prize-controls],
body.is-guest-view [data-claims-box],
body.is-guest-view [data-history],
body.is-guest-view .stream-form,
body.is-guest-view .card--owner {
  display: none !important;
}
.preview-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

/* Строка действий под статусами: запись слева, управление справа */
/* Кнопка записи всегда на одном месте — справа, в своей строке */
.giveaway-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  /* место под карандаш правки зарезервировано всегда: кнопка не сдвигается */
  padding-right: 44px;
  margin-top: var(--s-5);
}
.giveaway-actions .edit-pencil {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
body.is-editing .giveaway-actions .edit-pencil { display: inline-grid; }
.owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.owner-actions:empty { display: none; }
@media (max-width: 640px) {
  .giveaway-actions { flex-direction: column; align-items: stretch; }
  .owner-actions { justify-content: stretch; }
  .owner-actions > * { flex: 1 1 auto; justify-content: center; }
}

/* Заметная кнопка сохранения, когда есть несохранённые правки */
.edit-toggle--dirty {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: edit-pulse 1.8s ease-in-out infinite;
}
@keyframes edit-pulse {
  0%, 100% { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
  50% { box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 55%, transparent); }
}

/* Полоса в режиме просмотра гостя: понятно, как вернуться */
.guest-view-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Коды подтверждения приза */
.claims-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.claim-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.claim-code {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.claim-card { max-width: 640px; margin-inline: auto; }
.claim-winner { font-size: 1.4rem; font-weight: 800; color: var(--accent); }

/* Карандаш у приза не увеличивает высоту пилюли — иначе страница «прыгает» */
[data-field="prize"] { position: relative; }
[data-field="prize"] .edit-pencil {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
}

/* Коды подтверждения на телефоне: кнопки во всю ширину, читаемые границы */
@media (max-width: 640px) {
  .claim-row { align-items: flex-start; }
  .claim-row .btn {
    flex: 1 1 100%;
    justify-content: center;
    border: 1px solid var(--line-strong);
    background: var(--surface);
  }
  .claim-code { font-size: 1rem; }
}

/* Переносы строк, заданные при редактировании, сохраняются на странице */
[data-field="description"],
.congrats__text {
  white-space: pre-line;
}

/* ===== Страница розыгрыша: победитель в центре внимания ===== */
.gv-winner {
  margin-top: var(--s-6);
  padding: 26px 26px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, #e0b356 16%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
}
.gv-winner__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.gv-winner__heading svg {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.gv-winner__list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.gv-winner__card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "avatar body pencil" "message message message";
  gap: 8px 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.gv-winner__avatar {
  grid-area: avatar;
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.9rem;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.gv-winner__avatar img { width: 100%; height: 100%; object-fit: cover; }
.gv-winner__place {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}
.gv-winner__body { grid-area: body; min-width: 0; }
.gv-winner__tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.gv-winner__name {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 4.6vw, 2.3rem);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  word-break: break-word;
}
a.gv-winner__name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.gv-winner__meta {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.gv-winner__meta a { color: var(--accent); }
.gv-winner__meta--tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: help;
  border-bottom: 1px dashed var(--line-strong);
}
.gv-winner__info { display: inline-grid; place-items: center; }
.gv-winner__info svg { width: 16px; height: 16px; }

/* Подсказка: почему имя не кликается и откуда взялся победитель */
.gv-winner__meta--tip { position: relative; }
.gv-winner__meta--tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 30;
  width: min(340px, 78vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.45;
  font-weight: 500;
  box-shadow: 0 10px 24px rgba(20, 18, 40, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s linear var(--dur-fast);
}
.gv-winner__meta--tip:hover::after,
.gv-winner__meta--tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s;
}
.gv-winner__message {
  grid-area: message;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  white-space: pre-line;
  font-size: var(--text-sm);
}
.gv-winner__card .edit-pencil { grid-area: pencil; }
.gv-winner__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.gv-winner__verified {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.gv-winner__verified::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e63;
  box-shadow: 0 0 0 4px color-mix(in srgb, #2f9e63 18%, transparent);
}

/* Общий ритм страницы: блоки в своих карточках с воздухом */
.giveaway-page .card,
.giveaway-page .section--tight {
  margin-top: var(--s-6);
}
.giveaway-page > .container > * + *:not(.gv-meta):not(.gv-winner):not(.prize-status-block):not(.giveaway-actions):not(.owner-actions):not(.section--tight):not(.card) { margin-top: 0; }
.giveaway-page .section--tight { margin-block: var(--s-6); }

@media (max-width: 640px) {
  .gv-winner { padding: 18px 16px 16px; }
  .gv-winner__card { grid-template-columns: auto 1fr; grid-template-areas: "avatar body" "message message" "pencil pencil"; }
  .gv-winner__avatar { width: 60px; height: 60px; font-size: 1.5rem; }
  .gv-winner__name { font-size: 1.55rem; }
  .gv-winner__foot { flex-direction: column; align-items: flex-start; }
}

/* Каждый блок — в своей карточке, чтобы страница читалась по частям */
.giveaway-page .section--tight {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.giveaway-page .section--tight h2 { margin-top: 0; }
.giveaway-page .protocol__row { padding-block: 10px; }
@media (max-width: 640px) {
  .giveaway-page .section--tight { padding: 18px 16px; }
}

/* Мета-строка под крошками: кто организатор, сколько участников и когда розыгрыш */
.gv-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--s-6);
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  color: var(--muted);
}
.gv-meta a { color: var(--ink); font-weight: 650; text-decoration: none; }
.gv-meta a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.gv-meta strong { color: var(--ink); }
.gv-meta__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.gv-meta__date svg { width: 15px; height: 15px; color: var(--muted); }

.gv-meta__method {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

/* Крошки на телефоне: переносятся, название не обрезается посередине */
@media (max-width: 640px) {
  /* Крошки остаются в одну строку: длинное название обрезается многоточием */
  .crumbs ol { flex-wrap: nowrap; overflow: hidden; }
  .crumbs li { min-width: 0; flex: 0 0 auto; }
  .crumbs li:last-child { flex: 1 1 auto; }
  /* Только обёртка текущей страницы — не языковые спаны внутри неё */
  .crumbs li:last-child > span:not(.lang-ru):not(.lang-en) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Кнопка записи по центру, когда строка одна */
  .giveaway-actions { justify-content: center; padding-right: 0; }
  .giveaway-actions .edit-pencil { display: none; }
}

/* Кнопки живут в блоке победителя */
.gv-winner { margin-top: var(--s-6); }
.gv-winner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gv-winner__foot {
  flex-direction: column;
  align-items: flex-start;
}
@media (max-width: 640px) {
  .gv-winner__actions { width: 100%; }
  .gv-winner__actions .btn { flex: 1 1 100%; justify-content: center; }
}

.gv-meta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}
/* Вторая строка — факты о проведении: способ и дата всегда рядом */
.gv-meta__row--facts {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

/* Настройки: список привязанных аккаунтов */
.social-links { display: grid; gap: 10px; padding: 0; list-style: none; }
.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.social-link__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 40px;
}
.social-link__icon svg { width: 20px; height: 20px; }
.social-link__text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.social-link--soon { opacity: 0.72; }
@media (max-width: 560px) {
  .social-link { flex-wrap: wrap; }
  .social-link .btn, .social-link .badge { margin-left: 52px; }
}

.social-link__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.social-link .hint.is-ok { color: #1e7a52; font-weight: 600; }

/* Окно привязки Telegram: крупные шаги, код и копирование */
.tg-dialog { width: min(620px, calc(100vw - 24px)); }
.tg-steps__list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.tg-step { display: flex; gap: 14px; align-items: flex-start; }
.tg-step__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  flex: 0 0 34px;
}
.tg-step__body { flex: 1 1 auto; min-width: 0; }
.tg-step__body strong { font-size: 1.0625rem; }
.tg-code {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
}
.tg-code code {
  flex: 1 1 auto;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  word-break: break-all;
}
@media (max-width: 560px) {
  .tg-code code { font-size: 1.15rem; }
  .tg-code .btn { flex: 1 1 100%; justify-content: center; }
}

/* Подсказка под строкой соцсети */
.link-row__hint {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.link-row__hint strong { color: var(--accent); }

/* Подсказка в строке соцсети: успех — зелёная и короткая */
.link-row__hint--ok {
  background: color-mix(in srgb, #1e7a52 12%, transparent);
  color: #1e7a52;
  font-weight: 600;
}

/* Привязка аккаунтов на странице участника */
.verify-card { margin-top: 0; min-width: 0; overflow: visible; position: relative; }
.verify-card__head { display: block; padding-right: 42px; }
.verify-help { position: absolute; top: 12px; right: 12px; }
.verify-help__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  /* глобальное правило summary делает строку 44 px — здесь нужен ровный круг */
  min-height: 30px;
  max-height: 30px;
  padding: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
}
.verify-help__btn::-webkit-details-marker { display: none; }
.verify-help__btn:hover { color: var(--accent); border-color: var(--accent-line); }
.verify-help[open] .verify-help__btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.verify-help__body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(300px, 78vw);
  padding: 14px 16px 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
}
.verify-help__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.verify-help__close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.verify-help__body a { color: var(--accent); font-weight: 600; }
.verify-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.verify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.verify-row__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 28px;
}
.verify-row__icon svg { width: 16px; height: 16px; }
.verify-row__name { font-weight: 650; flex: 0 1 auto; min-width: 0; white-space: nowrap; }
.verify-row .badge {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 3px 8px;
}
.badge--success { background: color-mix(in srgb, #1e7a52 14%, transparent); color: #1e7a52; }

/* Инструкции: списки и шаги */
.help-steps, .help-list { display: grid; gap: 8px; padding-left: 20px; }
.help-steps li, .help-list li { line-height: 1.55; }
.table-wrap { overflow-x: auto; }

/* Телефон: строка привязки должна оставаться в одну линию даже у «ВКонтакте» */
@media (max-width: 480px) {
  .verify-row {
    gap: 6px;
    padding: 7px 9px;
    flex-wrap: nowrap;
  }
  .verify-row__icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }
  .verify-row__icon svg { width: 14px; height: 14px; }
  .verify-row__name { font-size: 0.9375rem; flex: 1 1 auto; }
  .verify-row .badge {
    font-size: 0.6875rem;
    padding: 2px 6px;
    margin-left: 0;
    flex: 0 0 auto;
  }
}

/* Очень узкие экраны: лучше перенести бейдж, чем обрезать название */
@media (max-width: 344px) {
  .verify-row { flex-wrap: wrap; row-gap: 4px; }
  .verify-row__name { flex: 1 1 auto; }
  .verify-row .badge { margin-left: auto; }
}

/* Подвал: кнопка обратной связи — короткая, слева, прижата к низу колонки */
.site-footer .footer-feedback-open {
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  margin-top: auto;
  padding-inline: 22px;
}

/* На телефоне никаких растяжений: колонки идут одна под другой по контенту */
@media (max-width: 719px) {
  .site-footer__grid { align-items: start; }
  .site-footer__grid > * { height: auto; min-height: 0; align-self: start; }
}

/* Участники: цвет состояния и подсказки */
.participant--verified { border-color: color-mix(in srgb, #1e7a52 40%, var(--line)); }
.participant--verified:hover { border-color: #1e7a52; }
.participant--nolink { border-color: color-mix(in srgb, #b7791f 45%, var(--line)); }
.participant--noaccount { color: var(--muted); border-style: dashed; }

.participant--winner {
  border-color: #d9a63c;
  background: color-mix(in srgb, #d9a63c 14%, var(--surface));
  font-weight: 700;
  box-shadow: 0 0 0 2px color-mix(in srgb, #d9a63c 22%, transparent);
}
.participant__medal { color: #b7791f; font-size: 0.95rem; line-height: 1; }

/* Подсказка при наведении/фокусе */
.participant[data-tip] { position: relative; cursor: help; }
.participant[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: max-content;
  max-width: min(280px, 70vw);
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(20, 18, 40, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s linear var(--dur-fast);
}
.participant[data-tip]:hover::after,
.participant[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility 0s;
}

/* Статус приза: отдельный блок сразу под победителем */
.prize-status-block {
  margin-top: var(--s-6);
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(20, 18, 40, 0.06));
}
.prize-status-block__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.prize-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.prize-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 650;
  font-size: var(--text-sm);
  cursor: default;
  transition: transform var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}
button.prize-pill { cursor: pointer; }
button.prize-pill:hover { transform: translateY(-1px); }

/* Неактивные статусы — тихие, чтобы не спорить с текущим */
.prize-pill:not(.is-active) {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line);
  opacity: 0.72;
}
button.prize-pill:not(.is-active):hover {
  opacity: 1;
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

/* Активный статус — единственный цветной и с явной отметкой */
.prize-pill.is-active {
  opacity: 1;
  font-weight: 800;
  border-style: solid;
  padding-left: 34px;
  position: relative;
  box-shadow: 0 6px 18px -8px currentColor;
}
.prize-pill.is-active::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.6875rem;
  line-height: 1;
}
.prize-pill--wait.is-active { background: #d9d3c4; color: #2f2c25; border-color: #c6bea9; }
.prize-pill--wait.is-active::before { background: rgba(0, 0, 0, 0.12); color: #2f2c25; }
.prize-pill--sent.is-active { background: #6d5ae0; color: #fff; border-color: #5a49c9; }
.prize-pill--done.is-active { background: #1e7a52; color: #fff; border-color: #17634a; }
.prize-pill--issue.is-active { background: #c57614; color: #fff; border-color: #a9610c; }
.prize-pill.is-active { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 16%, transparent); }
.prize-pill[data-tip-ru] { position: relative; cursor: help; }


/* Единый вид блоков: карточка с рамкой, скруглением и одинаковой тенью.
   Правило для всех новых блоков на странице розыгрыша. */
.giveaway-page .card,
.giveaway-page .section--tight,
.giveaway-page .gv-winner,
.giveaway-page .gv-meta,
.giveaway-page .prize-status-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

/* ── Пять способов провести розыгрыш (визитная карточка на главной) ── */
.section--sources { position: relative; }
/* Карусель способов: на мониторе видно 3,5 карточки, на телефоне — 1,5 */
.sources-carousel { margin-top: var(--s-8); position: relative; }
.sources-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 4px 14px;
  margin-inline: -4px;
  padding-inline: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}
.sources-track::-webkit-scrollbar { display: none; }
.sources-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.source-card {
  flex: 0 0 calc((100% - 3 * 16px) / 3.5);
  scroll-snap-align: start;
}
@media (max-width: 900px) {
  .source-card { flex-basis: calc((100% - 16px) / 2.4); }
}
@media (max-width: 640px) {
  .source-card { flex-basis: calc((100% - 16px) / 1.5); }
}

.sources-carousel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.sources-carousel__bar .hint { margin: 0; }
.sources-carousel__nav { display: flex; gap: 8px; flex: 0 0 auto; }
.carousel-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast);
}
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.carousel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel-btn:disabled { opacity: 0.4; cursor: default; }
.carousel-btn svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .sources-carousel__bar { flex-direction: column; align-items: flex-start; }
}

.source-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
  overflow: hidden;
}
.source-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--source-color, var(--accent));
  opacity: 0.9;
}
.source-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--source-color, var(--accent)) 45%, var(--line));
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--source-color, var(--accent)) 55%, transparent);
}
.source-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--source-color, var(--accent)) 45%, transparent);
  outline-offset: 3px;
}

.source-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--source-color, var(--accent)) 14%, transparent);
  color: var(--source-color, var(--accent));
}
.source-card__icon svg { width: 24px; height: 24px; }
.source-card__icons { display: flex; gap: 8px; }
.source-card__icon--small { width: 40px; height: 40px; border-radius: 12px; }

.source-card__title { margin: 2px 0 0; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; }
.source-card__text { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
.source-card__text strong { color: var(--ink); font-weight: 700; }
.source-card__link { margin-top: auto; padding-top: 6px; font-size: var(--text-sm); font-weight: 700; color: var(--source-color, var(--accent)); }

/* Свой список — особая карточка: колесо + список */
.source-card--featured {
  --source-color: #6d5ae0;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, #6d5ae0 16%, transparent), transparent 60%),
    var(--surface);
}
.source-card--featured .source-card__link { color: var(--accent); }

.sources-random {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s-6);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.sources-random__text h3 { margin: 0 0 4px; }
.sources-random__text p { margin: 0; max-width: 60ch; }

/* Якорь к идеям: не прятать заголовок под липкой шапкой */
#ideas { scroll-margin-top: calc(var(--header-h) + 24px); }

/* A3. Карточка статистики на главной: на узких экранах счётчики не растягивают карточку */
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { min-width: 0; }
.stat__label { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px; }
  .stat__value { font-size: 1.5rem; }
}

/* A4. «Границы честности»: на телефоне таблица превращается в карточки */
@media (max-width: 640px) {
  .table--limits thead { display: none; }
  .table--limits, .table--limits tbody, .table--limits tr, .table--limits td { display: block; width: 100%; }
  .table--limits tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  .table--limits tr + tr { margin-top: 10px; }
  .table--limits td {
    border: 0;
    padding: 4px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    justify-content: space-between;
  }
  .table--limits td:first-child {
    font-weight: 800;
    font-size: 1.0625rem;
    padding-bottom: 8px;
  }
  .table--limits .badge { white-space: nowrap; }
  .cell-label { color: var(--muted); font-size: var(--text-sm); }
}
@media (min-width: 641px) {
  .cell-label { display: none; }
}

/* A4-доп: пример кода на телефоне переносится, а не уезжает за экран */
@media (max-width: 640px) {
  .proof__code pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-x: visible;
  }
  .proof__code code { white-space: inherit; }
}

/* B1. Карточка победителя на телефоне: одно главное действие, остальные — попарно */
@media (max-width: 640px) {
  .gv-winner__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .gv-winner__actions .btn--primary { grid-column: 1 / -1; }
  .gv-winner__actions .btn {
    min-height: 44px;
    min-width: 0;
    justify-content: center;
    font-size: var(--text-sm);
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    padding-inline: 10px;
  }
  .gv-winner__actions .btn svg { flex: 0 0 auto; }
  .gv-winner__message { grid-column: 1 / -1; }
}

/* B4. Колесо: управление в одну строку на телефоне */
@media (max-width: 400px) {
  .wheel-side .cluster { gap: 6px; flex-wrap: nowrap; }
  .wheel-side .cluster .btn { padding-inline: 10px; font-size: 13px; min-height: 40px; }
  .wheel-side .wheel-sound { min-width: 40px; padding-inline: 8px; }
}

/* B7. Заголовки: меньше «лестниц» из одного слова */
h1, h2, .h2, .display { text-wrap: balance; }

/* B9. Юридические тексты: воздух между строками и пунктами */
.legal p, .legal li { line-height: 1.6; }
.legal li + li { margin-top: 8px; }

/* B1. Очень узкий экран: имя и подпись занимают всю ширину карточки */
@media (max-width: 400px) {
  .gv-winner__card {
    grid-template-columns: 1fr;
    grid-template-areas: "avatar" "body" "message" "pencil";
    gap: 10px;
    padding: 16px;
  }
  .gv-winner__avatar { width: 56px; height: 56px; font-size: 1.4rem; }
  .gv-winner__meta--tip::after { left: 0; right: auto; width: min(280px, 86vw); }
}

/* Метка «проверяемый» и честное «пересчитать нельзя» */
.gv-winner__verified--plain::before { background: var(--muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 18%, transparent); }

/* Статус площадки на карточке: доступно / бета / в разработке */
.source-card__status {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.source-card__status--beta {
  background: color-mix(in srgb, #b7791f 14%, transparent);
  border-color: color-mix(in srgb, #b7791f 40%, var(--line));
  color: #8a5a12;
}

/* Якорь к статусам интеграций не уходит под липкую шапку */
#integrations { scroll-margin-top: calc(var(--header-h) + 24px); }

/* Карусель: точки навигации */
.sources-carousel__dots { display: flex; gap: 4px; margin-left: auto; }
.carousel-dot {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
.carousel-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong, #cfc9ba);
  transition: background-color var(--dur-fast), transform var(--dur-fast);
}
.carousel-dot[aria-current="true"]::before { background: var(--accent); transform: scale(1.25); }
.carousel-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 50%; }
@media (max-width: 640px) {
  .sources-carousel__dots { order: 3; margin-left: 0; }
}

/* Мягкое затухание краёв карусели: слева — только когда лента уже сдвинулась */
.sources-track {
  --fade-left: 0px;
  --fade-right: 28px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
}
.sources-carousel.is-scrolled .sources-track { --fade-left: 28px; }

/* ---------- Конструктор розыгрыша по комментариям ---------- */
.wizard { margin-top: var(--s-6); }
.wizard__steps {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.wizard__steps::-webkit-scrollbar { display: none; }
.wizard-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
}
.wizard-step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
}
.wizard-step[aria-selected="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.wizard-step[aria-selected="true"] span { background: var(--accent); color: #fff; }
.wizard-step.is-done { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.wizard-step.is-done span { background: var(--success); color: #fff; }

.wizard__body { margin-top: var(--s-4); display: grid; gap: var(--s-4); }
.wizard-row { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .wizard-row { grid-template-columns: 1fr 1fr; } }

.choice-grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice-card { position: relative; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; inset: 0; }
.choice-card__inner {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.choice-card input:checked + .choice-card__inner {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
.choice-card input:focus-visible + .choice-card__inner { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-card__title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.choice-card__text { font-size: var(--text-sm); color: var(--muted); line-height: 1.5; }

.radio-row, .check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
  font-size: var(--text-sm);
}
.radio-row input, .check-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.check-list { display: grid; gap: 4px; }

.wizard__bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}
.wizard__status { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.wizard__status[data-tone="ok"] { color: var(--success); }
.wizard__status[data-tone="error"] { color: var(--danger); }
.wizard__status[data-tone="warn"] { color: var(--warning, #a45a10); }
.wizard__nav { display: flex; gap: 8px; margin-left: auto; }

.wizard-summary { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.wizard-summary__row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  font-size: var(--text-sm);
}
.wizard-summary__row + .wizard-summary__row { border-top: 1px solid var(--line); }
.wizard-summary__row span { color: var(--muted); }
.wizard-summary__row strong { text-align: right; max-width: 60%; overflow-wrap: anywhere; }

.draft-list { display: flex; flex-wrap: wrap; gap: 10px; }
.draft-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-sm);
}
.draft-chip:hover { border-color: var(--accent); }
.draft-chip__link {
  display: grid;
  gap: 2px;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
}
.draft-chip__link span { color: var(--muted); font-size: var(--text-xs); }


/* ---------- Проверка ссылки: «магия» с прогрессом ---------- */
.lookup { margin-top: var(--s-5); }
.lookup__field { display: flex; gap: 10px; flex-wrap: wrap; }
.lookup__input {
  flex: 1 1 320px;
  min-height: 56px;
  font-size: 1.0625rem;
  padding-inline: 16px;
}
.lookup__button { min-height: 56px; padding-inline: 22px; flex: 0 0 auto; }
@media (max-width: 520px) { .lookup__button { width: 100%; } }
.lookup__error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--danger);
  font-size: var(--text-sm);
}

.lookup-progress {
  margin-top: var(--s-5);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.lookup-progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink);
}
.lookup-progress__head strong { font-variant-numeric: tabular-nums; color: var(--accent); }
.lookup-progress__bar {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.lookup-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
  transition: width 0.6s ease;
}
.lookup-stages {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.lookup-stages li { display: flex; align-items: center; gap: 8px; }
.lookup-stages li::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--surface);
}
.lookup-stages li.is-active { color: var(--ink); font-weight: 600; }
.lookup-stages li.is-active::before { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); animation: lookup-pulse 1.2s ease-in-out infinite; }
.lookup-stages li.is-done { color: var(--ink-soft); }
.lookup-stages li.is-done::before {
  border-color: var(--success);
  background: var(--success);
  content: "✓";
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
@keyframes lookup-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 8%, transparent); } }

/* ---------- Отчёт о проверке ссылки ---------- */
.lookup-summary {
  margin-top: var(--s-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: lookup-appear 0.35s ease-out;
}
@keyframes lookup-appear { from { opacity: 0; transform: translateY(6px); } }

.lookup-summary__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--success) 7%, var(--surface)), var(--surface));
  border-bottom: 1px solid var(--line);
}
.lookup-summary__platform {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  background: #229ed9;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}
.lookup-summary__platform[data-platform="vk"] { background: #4c75a3; }
.lookup-summary__platform[data-platform="youtube"] { background: #e0342b; }

.lookup-summary__head-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.lookup-summary__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--success);
}
.lookup-summary__place { margin: 0; font-weight: 800; font-size: 1.0625rem; color: var(--ink); overflow-wrap: anywhere; }
.lookup-summary__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.lookup-summary__ok {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}
.lookup-summary__ok svg { width: 18px; height: 18px; }

/* Строки отчёта: одна за другой, с иконкой слева и статусом справа */
.lookup-summary__list { margin: 0; padding: 0; list-style: none; }
.lookup-summary__row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.lookup-summary__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.lookup-summary__icon svg { width: 21px; height: 21px; }
.lookup-summary__body { display: grid; gap: 3px; min-width: 0; }
.lookup-summary__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lookup-summary__body strong { font-size: var(--text-base); overflow-wrap: anywhere; }
.lookup-summary__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.lookup-summary__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lookup-summary__status svg { width: 14px; height: 14px; flex: 0 0 14px; }
.lookup-summary__status--ok {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}
.lookup-summary__status--pending {
  background: color-mix(in srgb, #b7791f 12%, transparent);
  color: #8a5a12;
}

.lookup-summary__note {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--muted);
}
.lookup-summary__actions { display: flex; justify-content: flex-end; padding: 12px 14px; }

@media (max-width: 640px) {
  .lookup-summary__head { padding: 14px; gap: 12px; }
  .lookup-summary__platform { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
  .lookup-summary__row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
  }
  .lookup-summary__icon { width: 40px; height: 40px; border-radius: 11px; }
  .lookup-summary__status { grid-column: 2 / -1; justify-self: start; }
  .lookup-summary__note { padding-inline: 14px; }
}

/* Панель шагов на телефоне: ровная сетка кнопок без переносов */
@media (max-width: 640px) {
  .wizard__bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .wizard__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-left: 0;
  }
  .wizard__nav .btn {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    padding-inline: 8px;
    font-size: var(--text-sm);
  }
  .wizard__nav [data-save-now] { flex: 1 1 100%; order: -2; }
  .wizard__nav [data-drafts-jump] { flex: 1 1 100%; order: -1; }
  .wizard__nav [data-prev],
  .wizard__nav [data-next] { flex: 1 1 0; min-width: 0; }
}

/* Текущий (открытый) черновик в списке */
.draft-chip.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent); }
.draft-chip__current { display: block; margin-top: 2px; color: var(--accent); font-size: var(--text-xs); font-weight: 700; }


/* Карточки прошлых версий черновика — рядом с текущим */
.draft-chip--version {
  border-style: dashed;
  background: var(--surface-2);
}
.draft-chip--version .draft-chip__link {
  text-align: left;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  padding: 6px 10px 6px 0;
}
.draft-chip--version:hover { border-color: var(--accent); }
.draft-chip__restore {
  color: var(--accent) !important;
  font-weight: 650;
}

/* Пояснение к версиям в блоке черновиков */
.drafts-caption { margin: 10px 0 0; }
.draft-chip__badge {
  display: inline-block;
  width: max-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Описание группы/канала под строкой «Где» */
.lookup-report__rows .lookup-report__place-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: var(--text-sm);
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Картинка приза в конструкторе */
.prize-upload { display: grid; gap: 10px; margin-top: 8px; }
.prize-upload__preview {
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.prize-upload__preview img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; }
.prize-upload__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Картинка приза на странице розыгрыша */
.gv-prize-media {
  margin: 18px 0 0;
  max-width: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.gv-prize-media img { display: block; width: 100%; height: auto; }

/* Круглое фото приза в каталоге */
.list-item__title { display: flex; align-items: center; gap: 10px; }
.list-item__prize-img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

/* Страница розыгрыша: круглая картинка приза */
.gv-prize-media {
  width: 168px;
  max-width: 45vw;
  margin: 18px 0 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  aspect-ratio: 1;
}
.gv-prize-media img { display: block; width: 100%; height: 100%; object-fit: cover; }


/* Фото приза: превью и кнопки в одну строку */
.media-field--prize { grid-template-columns: 1fr; justify-items: start; }
.media-field--prize .media-field__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-items: start;
  gap: 10px;
}
@media (max-width: 640px) {
  .media-field--prize .media-field__control { gap: 8px; }
}

/* Блок фото приза — заметный, но спокойный */
.prize-photo-block {
  margin-top: var(--s-5);
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.prize-photo-block__head { display: flex; gap: 12px; align-items: flex-start; }
.prize-photo-block__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}
.prize-photo-block__icon svg { width: 20px; height: 20px; }
.prize-photo-block .hint { margin-bottom: 0; }

/* Шаг «Сроки»: выбор сейчас / в календаре */
.choice-grid { display: grid; gap: 10px; }
.choice-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.choice-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}
.choice-card input { margin-top: 3px; accent-color: var(--accent); flex: 0 0 auto; }
.choice-card span { display: grid; gap: 3px; }
.choice-card strong { font-size: var(--text-base); }
.choice-card small { font-size: var(--text-sm); line-height: 1.45; color: var(--muted); }
.schedule-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.schedule-row .dp { flex: 1 1 220px; }
.schedule-row .dp__button { width: 100%; }
.schedule-row__time { flex: 0 0 150px; }
.consent-options { display: grid; gap: 8px; }
@media (max-width: 640px) {
  .schedule-row__time { flex: 1 1 100%; }
}

/* Поля-наборы в конструкторе без рамки браузера */
.wizard-panel fieldset.field { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.wizard-panel fieldset.field > legend { padding: 0; margin-bottom: 8px; }

/* Условия участия: строки с крупной галочкой */
.condition-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.condition-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--dur-fast);
}
.condition-row:last-child { border-bottom: 0; }
.condition-row:hover { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.condition-row--field { cursor: default; }
.condition-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.condition-icon svg { width: 21px; height: 21px; }
.condition-body { display: grid; gap: 4px; min-width: 0; }
.condition-body strong { font-size: var(--text-base); }
.condition-body > span { font-size: var(--text-sm); line-height: 1.45; color: var(--muted); }
.condition-body small { font-size: var(--text-xs); color: #8a5a12; }
.condition-toggle { position: relative; display: block; width: 34px; height: 34px; flex: 0 0 34px; }
.condition-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.condition-check {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: transparent;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.condition-check svg { width: 20px; height: 20px; }
.condition-toggle input:checked + .condition-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.condition-toggle input:focus-visible + .condition-check {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.condition-toggle input:disabled + .condition-check { opacity: 0.45; }

/* Ввод ключевых слов тегами */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 44px;
}
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.tag-input__chips { display: contents; }
.tag-input__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 650;
}
.tag-input__chip button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.tag-input__chip button:hover { color: var(--danger, #b42318); }
.tag-input__entry {
  flex: 1 1 180px;
  min-width: 120px;
  border: 0;
  background: transparent;
  padding: 4px;
  font: inherit;
  color: var(--ink);
  outline: none;
}
@media (max-width: 640px) {
  .condition-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 14px; }
  .condition-icon { width: 40px; height: 40px; border-radius: 11px; }
}

/* Победители: количество и вариант при неответе */
.condition-number { max-width: 140px; }
.fallback-cards { display: grid; gap: 8px; }
.fallback-cards .choice-card { padding: 12px; }
@media (min-width: 720px) {
  .fallback-cards { grid-template-columns: 1fr 1fr; }
}

/* Импорт старых комментариев */
.trust-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.trust-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}
.trust-card__icon svg { width: 26px; height: 26px; }
.import-facts { display: grid; gap: 10px; }
@media (min-width: 760px) { .import-facts { grid-template-columns: repeat(3, 1fr); } }
.import-fact {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.import-fact strong { font-size: var(--text-sm); }
.import-fact span { font-size: var(--text-sm); line-height: 1.45; color: var(--muted); }
.import-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.import-steps li { padding-left: 4px; }
.import-steps li::marker { color: var(--accent); font-weight: 800; }
.import-steps strong { display: block; margin-bottom: 3px; }
.import-steps span { display: block; font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
.import-drop {
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.import-drop.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.import-drop__label {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 34px 16px;
  text-align: center;
  cursor: pointer;
}
.import-drop__label svg { width: 30px; height: 30px; color: var(--accent); }
.import-drop__label strong { font-size: var(--text-base); }
.import-drop__label span { font-size: var(--text-sm); color: var(--muted); }
.import-status { margin: 12px 0 0; font-size: var(--text-sm); color: var(--muted); }
.import-status[data-kind="ok"] { color: var(--success); }
.import-status[data-kind="error"] { color: var(--danger, #b42318); }
.import-progress {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.import-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.3s ease; }
.import-report { margin-top: 18px; }
.import-report__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.import-report__stats > div {
  display: grid;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.import-report__stats strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.import-report__stats span { font-size: var(--text-xs); color: var(--muted); }
.import-sample { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.import-sample__head { padding: 10px 14px; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.import-sample__row { display: grid; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line); }
.import-sample__row span { font-size: var(--text-sm); font-weight: 700; }
.import-sample__row p { margin: 0; font-size: var(--text-sm); color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .trust-card { padding: 16px; gap: 12px; }
  .trust-card__icon { width: 42px; height: 42px; flex-basis: 42px; }
  .import-report__stats strong { font-size: 1.25rem; }
}

/* Сохранённые на сервере комментарии */
.import-storage {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--success) 6%, var(--surface));
}
.import-storage__text { display: grid; gap: 3px; }
.import-storage__text strong { font-size: var(--text-base); }
.import-storage__text span { font-size: var(--text-sm); color: var(--muted); }
.import-storage__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.import-storage .hint { margin: 0; }

/* Файл result.json в настройках профиля */
.import-settings-list { display: grid; gap: 10px; }
.import-settings-item {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.import-settings-item__head { display: grid; gap: 3px; }
.import-settings-item__head strong { font-size: var(--text-base); }
.import-settings-item__head span { font-size: var(--text-sm); color: var(--muted); }
.import-settings-item__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.import-settings-item .hint { margin: 0; }

/* ---------- Шоу Raffly ---------- */
.show-body { min-height: 100vh; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 12%, var(--bg)), var(--bg) 60%); }
.show-shell { min-height: 100vh; display: flex; flex-direction: column; padding: 18px; }
.show-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.show-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; color: var(--ink); }
.show-logo .logo__mark { width: 34px; height: 34px; }
.show-close { font-size: var(--text-sm); color: var(--muted); text-decoration: none; }
.show-close:hover { color: var(--ink); }
.show-stage, .show-start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; max-width: 900px; width: 100%; margin: 0 auto; }
.show-host { display: flex; align-items: flex-end; gap: 14px; max-width: 680px; }
.show-avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border-radius: 28px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--accent) 70%, transparent);
}
.show-avatar svg { width: 46px; height: 46px; }
.show-bubble {
  position: relative;
  padding: 16px 20px;
  border-radius: 20px 20px 20px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  min-height: 84px;
}
.show-name { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.show-bubble p { margin: 0; font-size: clamp(1rem, 2.2vw, 1.35rem); line-height: 1.4; font-weight: 650; }
.show-progress { width: min(680px, 100%); height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, var(--surface)); overflow: hidden; border: 1px solid var(--line); }
.show-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #8f7dff); transition: width 0.45s ease; }
.show-progress-label { width: min(680px, 100%); text-align: right; font-size: var(--text-xs); color: var(--muted); margin-top: -10px; }
.show-actions { display: flex; gap: 10px; }
.show-start { gap: 24px; text-align: center; }
.show-host--solo { justify-content: center; text-align: left; }
.show-start__button { min-width: 220px; min-height: 52px; font-size: var(--text-base); }
.show-error { color: var(--danger, #b42318); font-size: var(--text-sm); }
.show-final { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 30px 16px; overflow: hidden; }
.show-avatar--final { width: 104px; height: 104px; flex-basis: 104px; margin-bottom: 12px; }
.show-eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.show-winner { margin: 0; font-size: clamp(2rem, 8vw, 4.5rem); line-height: 1.05; overflow-wrap: anywhere; }
.show-comment {
  margin: 14px 0 0;
  padding: 14px 18px;
  max-width: 680px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.5;
  text-align: left;
}
.show-final__hint { margin: 12px 0 0; font-size: var(--text-sm); color: var(--muted); }
.show-final__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.show-message { flex: 1; display: grid; place-content: center; text-align: center; max-width: 520px; margin: 0 auto; }
.show-confetti { position: absolute; inset: 0; pointer-events: none; }
.show-confetti span { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation-name: show-fall; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes show-fall { to { transform: translateY(110vh) rotate(520deg); } }
@media (max-width: 640px) {
  .show-shell { padding: 12px; }
  .show-host { gap: 10px; align-items: flex-start; }
  .show-avatar { width: 64px; height: 64px; flex-basis: 64px; border-radius: 20px; }
  .show-avatar svg { width: 36px; height: 36px; }
  .show-bubble { padding: 14px 16px; min-height: 64px; }
  .show-avatar--final { width: 86px; height: 86px; flex-basis: 86px; }
}
@media (prefers-reduced-motion: reduce) {
  .show-progress span { transition: none; }
  .show-confetti { display: none; }
}

/* Проверка бота Raffly в чате */
.bot-warning {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, #b7791f 35%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, #b7791f 8%, var(--surface));
  color: var(--ink);
}
.bot-warning > strong { display: block; margin-bottom: 6px; font-size: var(--text-base); }
.bot-warning p strong { display: inline; margin: 0; }
.bot-warning p { margin: 0 0 8px; font-size: var(--text-sm); line-height: 1.5; }
.bot-warning ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--text-sm); }
.bot-warning b { font-weight: 800; }

/* Копируемый ник бота в предупреждении */
.bot-copy {
  display: inline;
  padding: 1px 6px;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.bot-copy:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.bot-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bot-warning__open { margin-top: 8px; font-size: var(--text-sm); }
.bot-warning__open a { color: var(--accent); font-weight: 650; }

/* Ручное выделение ника, если браузер запретил буфер */
.bot-select {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 650;
  text-decoration: underline;
  cursor: pointer;
}
.bot-select:hover { color: var(--ink); }
.bot-select__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.bot-select__input {
  width: min(240px, 100%);
  padding: 5px 8px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}
.bot-select__hint { font-size: var(--text-xs); color: var(--muted); }

/* Обратный отсчёт до автоматического розыгрыша */
.countdown-card {
  margin: 20px 0 0;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  box-shadow: 0 16px 40px -24px color-mix(in srgb, var(--accent) 45%, transparent);
}
.countdown-card__eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.countdown-card__timer { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.countdown-card__timer > span { display: grid; gap: 2px; min-width: 58px; }
.countdown-card__timer strong { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-card__timer small { font-size: var(--text-xs); color: var(--muted); }
.countdown-card__note { margin: 12px 0 0; font-size: var(--text-sm); color: var(--muted); }
.countdown-card.is-started { border-color: var(--success); }
.countdown-card.is-finished { border-color: var(--line); }
@media (max-width: 640px) {
  .countdown-card { padding: 16px; }
  .countdown-card__timer { gap: 10px; }
  .countdown-card__timer strong { font-size: 1.7rem; }
  .countdown-card__timer > span { min-width: 48px; }
}

/* Финальный шаг: проверка и публикация */
.verify-head { display: grid; gap: 4px; }
.verify-head .h3 { margin: 0; }
.verify-head .hint { margin: 0; max-width: 70ch; }
.verify-summary { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.verify-summary__title { margin: 0 0 10px; font-size: var(--text-sm); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.verify-schedule {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.verify-schedule strong { font-size: var(--text-base); }
.verify-schedule span { font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
.verify-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-sm);
}
.verify-note svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; color: var(--success); }
.verify-note p { margin: 0; line-height: 1.5; }
@media (max-width: 640px) {
  .verify-summary { padding: 12px; }
  .verify-schedule { padding: 14px; }
}

/* Свежесть данных темы */
.freshness {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.freshness > strong { display: block; margin-bottom: 6px; }
.freshness ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: var(--text-sm); }
.freshness p { margin: 8px 0 0; font-size: var(--text-xs); line-height: 1.5; color: var(--muted); }

.freshness__snippet {
  display: block;
  margin-top: 5px;
  padding: 7px 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: 1.45;
}

/* Нужен ли файл комментариев */
.coverage {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.coverage > strong { display: block; margin-bottom: 4px; }
.coverage p { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }

.coverage__lead { margin: 0 0 6px !important; color: var(--ink) !important; font-weight: 650; }
