:root {
  /* Яркая геометрическая палитра: сочные плашки на белом */
  --primary: #0af;            /* синий — кнопки и акценты */
  --primary-press: #0089cc;
  --primary-soft: #e5f6ff;    /* светлый фон под вторичные кнопки */
  --green: #04e061;           /* зелёный — деньги, успех */
  --green-deep: #00b84f;
  --red: #ff3d4d;             /* красный — акценты, огонь */
  --purple: #9b51e0;          /* фиолетовый — призы */
  --bg: #f2f2f2;              /* фон страницы */
  --card: #ffffff;   /* карточки непрозрачные — поверх узора */
  --ink: #0a0a0a;             /* почти чёрный текст */
  --ink-2: #4a4a4a;
  --muted: #9a9a9a;
  --line: #ededed;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --tabbar-h: 62px;
  /* Всплывающее уведомление внизу экрана */
  --toast-bg: #0a0a0a;
  --toast-ink: #ffffff;
  --toast-shadow: 0 6px 20px rgba(0,0,0,.2);

  /* Тона кнопок. Синий и зелёный — фирменные, как были. Красный и жёлтый
     чуть мягче исходных: в капсуле награды они выходили резковато. */
  --btn-blue: var(--primary);
  --btn-blue-press: var(--primary-press);
  --btn-blue-soft: var(--primary-soft);
  --btn-blue-ink: #0072ad;
  /* Капсула награды — полупрозрачная заливка своего цвета плюс насыщенная
     цифра. На сплошном цвете яркие цифры не читались, а тут контраст ~4:1. */
  --sum-green-bg: rgba(4, 224, 97, .18);
  --sum-green: #0b8a45;
  --sum-yellow-bg: rgba(245, 166, 35, .22);
  --sum-yellow: #a06a12;
  --sum-red-bg: rgba(255, 61, 77, .18);
  --sum-red: #c92434;
  --sum-blue-bg: rgba(0, 170, 255, .16);
  --sum-blue: #0072ad;

  /* Поверхности отдельными токенами — из-за них тема и переключается */
  --bg-base: #ffffff;               /* подложка под фирменный узор */
  --veil: rgba(255, 255, 255, .72); /* вуаль, приглушающая узор */
  --surface-2: #f0f0f1;             /* переключатели, крестик в окне */
  --chip-bg: #f0f1f3;
  --ghost-bg: #ececed;
  --row-active: #fafafa;
  --input-bg: #fafafa;
  --input-bg-focus: #ffffff;
  --note-ink: #0a5a86;
  --badge-wait-bg: #fff3d6;  --badge-wait-ink: #9a6b00;
  --badge-ok-bg: #e2f6e6;    --badge-ok-ink: #12862f;
  --badge-no-bg: #fde3e3;    --badge-no-ink: #cc2222;
  --streak-bg: #fff1e0;      --streak-ink: #d9631f;  --streak-cap: #b0793f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  overscroll-behavior: none;
  /* Фирменный узор фоном. Приглушён вуалью, чтобы не спорил с содержимым. */
  background: var(--bg-base) url("bg.svg") 0 0 / 560px 560px fixed repeat;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0;
  background: var(--veil); pointer-events: none;
}
#app { position: relative; z-index: 1; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* Шапка — белая, как в Avito */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--card); color: var(--ink);
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -.02em;
}
.logo { width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; display: block; }
/* Заголовок центрируем по всей ширине шапки, а не по остатку места —
   иначе он съезжает влево из-за ширины названия бренда. */
.screen-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-weight: 700; font-size: 16px; pointer-events: none;
}
.topbar-spacer { width: 36px; }

#content { flex: 1; padding: 0 12px calc(var(--tabbar-h) + 24px); }
.screen { padding-top: 12px; }

/* Hero / баланс — белая карточка */
.hero {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px; margin-bottom: 12px;
}

.hero-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hero-hi { font-weight: 700; font-size: 13px; letter-spacing: .02em; color: var(--ink); }
.hero-sub { font-size: 13px; color: var(--muted); }
.hero-note { font-size: 12px; color: var(--muted); margin: 4px 0 14px; }
.balance { font-size: 46px; font-weight: 900; line-height: 1.02; margin: 6px 0 16px; letter-spacing: -.035em; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  overflow: hidden; flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }

/* Кнопки */
/* Линейные иконки: контур, скруглённые концы, цвет наследуется от кнопки */
.ic {
  width: 22px; height: 22px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 18px; height: 18px; }

.btn {
  border: none; border-radius: 999px;        /* капсула — как в фирменной геометрии */
  font-size: 15px; font-weight: 800; letter-spacing: -.01em;
  padding: 15px 22px; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .06s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-block { display: flex; width: 100%; }
/* primary — сплошная синяя кнопка */
.btn-dark { background: var(--btn-blue); color: #fff; }
.btn-dark:active { background: var(--btn-blue-press); }

.btn-yellow { background: var(--btn-blue-soft); color: var(--btn-blue-ink); }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; background: transparent; border: none;
  color: var(--btn-blue); font-size: 14px; font-weight: 600; padding: 12px; margin-top: 8px; cursor: pointer;
}
.btn-ghost2 { background: var(--ghost-bg); color: var(--ink); }

/* Тикер реальных выплат */
.ticker {
  background: var(--card); color: var(--ink-2); border-radius: var(--radius-sm);
  padding: 10px 0; margin: 0 0 12px; overflow: hidden; white-space: nowrap; box-shadow: var(--shadow);
  position: relative;
}
/* Растворяем текст у краёв, а не саму плашку: маской на всём блоке
   размывались бы и скруглённые углы. */
.ticker::before, .ticker::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 26px;
  z-index: 2; pointer-events: none;
}
.ticker::before { left: 0;  background: linear-gradient(90deg, var(--card), rgba(255,255,255,0)); }
.ticker::after  { right: 0; background: linear-gradient(270deg, var(--card), rgba(255,255,255,0));
}
.ticker-track {
  display: inline-block; font-size: 13px; will-change: transform;
  /* Сдвигаем ровно на половину: внутри две одинаковые копии строки,
     поэтому в момент перезапуска картинка совпадает и стыка не видно. */
  animation: tickerRun var(--ticker-dur, 40s) linear infinite;
}
/* Не display:none: иначе CSS-анимация начинается с нуля при возврате на вкладку. */
.ticker.ticker-parked {
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}
.ticker.ticker-parked .ticker-track { animation-play-state: paused; }

/* Одна выплата в ленте */
.tick-item {
  display: inline-flex; align-items: center; gap: 7px;
  margin-right: 26px; vertical-align: middle;
}
.tick-ava {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tick-ava svg {
  width: 14px; height: 14px; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.tick-name { color: var(--ink-2); font-weight: 600; }
/* Сумма — главное в строке, поэтому чёрная и жирная */
.tick-amount {
  color: var(--ink); font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.tick-time { color: var(--muted); font-size: 12px; }
@keyframes tickerRun {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* Промо / розыгрыш карточка */
.promo-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.promo-big { font-weight: 800; font-size: 16px; }
.promo-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.promo-timer { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--purple); }

/* Секции / списки */
.section-h { font-size: 17px; font-weight: 900; margin: 18px 4px 10px; letter-spacing: -.02em; }
.section-h.muted { color: var(--muted); text-transform: none; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.list { display: flex; flex-direction: column; gap: 10px; }

.task {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.task-info { min-width: 0; flex: 1 1 auto; }
/* Иконка типа задания: белый глиф на цветной плитке */
.task-ic {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.task-ic svg { width: 22px; height: 22px; display: block; }
.task-title { font-weight: 700; font-size: 15px; }
.task-desc { font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-reward { font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--green); }
.task-cta { background: var(--sum-blue-bg); color: var(--sum-blue); border: none; border-radius: 999px; padding: 11px 18px; font-weight: 800; cursor: pointer; font-family: inherit; white-space: nowrap; }
.task-cta:active { filter: brightness(.94); }
.badge { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; }
.badge-pending { background: var(--badge-wait-bg); color: var(--badge-wait-ink); }
.badge-approved { background: var(--badge-ok-bg); color: var(--badge-ok-ink); }
.badge-rejected { background: var(--badge-no-bg); color: var(--badge-no-ink); }
.empty { text-align: center; color: var(--muted); padding: 28px; font-size: 14px; }

/* Компактная шапка на главной, чтобы реферальная ссылка и квесты
   попадали на первый экран (в «Кошельке» баланс остаётся крупным). */
[data-screen="tasks"] .hero { padding: 14px 16px; margin-bottom: 10px; }
[data-screen="tasks"] .hero-row { margin-bottom: 6px; gap: 10px; }
[data-screen="tasks"] .avatar { width: 38px; height: 38px; font-size: 16px; }
[data-screen="tasks"] .hero-hi { font-size: 12px; }
[data-screen="tasks"] .hero-sub { font-size: 12px; }
[data-screen="tasks"] .balance { font-size: 30px; margin: 2px 0 10px; }
[data-screen="tasks"] .hero .btn { padding: 12px 16px; font-size: 14px; }
[data-screen="tasks"] .btn-ghost { padding: 7px; font-size: 13px; margin-top: 2px; }
[data-screen="tasks"] .section-h { margin: 12px 4px 8px; }
[data-screen="tasks"] .ref-card { padding: 14px; }
[data-screen="tasks"] .ref-link { margin: 6px 0 10px; font-size: 13px; }

/* Квесты за приглашения — прямоугольные плитки */
.quests { display: flex; flex-direction: column; gap: 8px; }
.quest {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--radius-sm); padding: 10px 12px;
  box-shadow: var(--shadow);
}
.quest-inner { display: flex; align-items: center; gap: 11px; }
.quest-ic {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
  background: rgba(155,81,224,.12); color: var(--purple);
  display: grid; place-items: center; font-size: 17px; font-weight: 800;
}
.quest-body { flex: 1; min-width: 0; }
.quest-title { font-weight: 700; font-size: 13.5px; }
.quest-reward { font-size: 12px; color: var(--green); font-weight: 700; margin-top: 1px; }
.quest-bar { height: 4px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.quest-bar span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.quest-prog { font-size: 11px; color: var(--muted); margin-top: 4px; }
.quest-cta {
  border: none; border-radius: 999px; padding: 9px 15px; font-weight: 800; font-size: 13px;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  background: var(--green); color: #fff;
}

/* Закрытый квест: содержимое размыто, поверх — подсказка с замком */
.quest.locked .quest-inner { filter: blur(3.5px); opacity: .55; pointer-events: none; user-select: none; }
.quest-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 7px; font-size: 12px; font-weight: 700; color: var(--ink-2);
  background: rgba(255, 255, 255, .45); text-align: center; padding: 0 12px;
}
.quest-cta:disabled { background: var(--line); color: var(--muted); cursor: default; }
.quest.done { opacity: .65; }
.quest-done-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }



/* Заголовок раздела со ссылкой справа */
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-row .section-h { margin-right: auto; }
.link-btn {
  background: none; border: none; color: var(--btn-blue);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; padding: 4px 2px; white-space: nowrap;
}

/* Заголовок раздела в списке заданий */
.task-group {
  font-size: 12px; font-weight: 700; color: var(--muted);
  margin: 16px 4px 4px; text-transform: uppercase; letter-spacing: .04em;
  text-align: center;
}
.task-group:first-child { margin-top: 0; }
.show-all { margin-top: 4px; }

/* Друзья */
.big-title { font-size: 26px; font-weight: 900; line-height: 1.15; margin: 4px 0 6px; letter-spacing: -.01em; }
.hint { font-size: 13px; color: var(--ink-2); margin: 2px 0 14px; }
.ref-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.ref-label { font-size: 12px; color: var(--muted); }
.ref-link { font-size: 14px; color: var(--primary); word-break: break-all; margin: 8px 0 12px; font-weight: 600; }
.ref-actions { display: flex; gap: 10px; }
.ref-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 14px; padding-right: 14px; }

/* Пошаговая инструкция */
.howto {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-top: 12px;
}
.howto-title { font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.howto-list li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; line-height: 1.35; }
.howto-num {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}

.stat-row { display: flex; gap: 10px; margin: 12px 0; }
.stat-box { flex: 1; background: var(--card); border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 20px; font-weight: 800; }
.stat-cap { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Кошелёк — источники дохода */
.income { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.income-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--line); }
.income-bar span { display: block; height: 100%; }
#barTasks { background: var(--primary); }
#barRefs { background: var(--purple); }
.income-legend { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; font-size: 14px; }
.income-legend div { display: flex; align-items: center; }
.income-legend b { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot-y { background: var(--primary); } .dot-b { background: var(--purple); }

.hist { background: var(--card); border-radius: var(--radius-sm); padding: 14px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow); }
.hist-amt { font-weight: 700; }
.hist-meta { font-size: 13px; color: var(--muted); }

/* Профиль */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 10px 4px 8px; }
/* Огонёк стрика справа от аватарки */
.streak {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  background: var(--streak-bg); border-radius: 20px; padding: 8px 14px;
}
.streak-ic { width: 22px; height: 22px; color: var(--red); }
.streak-num { font-size: 20px; font-weight: 800; color: var(--streak-ink); line-height: 1; }
.streak-cap { font-size: 10px; color: var(--streak-cap); line-height: 1.1; }
/* Компактный вариант — на главной рядом с приветствием */
.streak-sm { padding: 6px 11px; gap: 4px; }
.streak-sm .streak-ic { width: 18px; height: 18px; }
.streak-sm .streak-num { font-size: 16px; }
.streak-word { font-size: 12px; font-weight: 700; color: #b0793f; }
.prof-name { font-size: 20px; font-weight: 800; }
.prof-id { font-size: 13px; color: var(--muted); }
.achievements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ach { background: var(--card); border-radius: var(--radius-sm); padding: 16px 8px; text-align: center; box-shadow: var(--shadow); }
.ach-ic { display: flex; justify-content: center; color: var(--primary); }
.ic-ach { width: 28px; height: 28px; }
.ach-name { font-size: 12px; font-weight: 700; margin-top: 8px; }
/* Незаработанные — серые и приглушённые */
.ach.locked { opacity: .5; }
.ach.locked .ach-ic { color: var(--muted); }

/* Список разделов в профиле */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border: none; border-radius: var(--radius-sm);
  padding: 11px 14px; box-shadow: var(--shadow); cursor: pointer;
  font-family: inherit; text-align: left; color: var(--ink);
}
.menu-row:active { background: var(--row-active); }
.menu-ic {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
  background: var(--primary); color: #fff; display: grid; place-items: center;
}
/* В тёмной плитке 18 px терялись — глиф крупнее и линия чуть плотнее */
.menu-ic .ic { width: 20px; height: 20px; stroke-width: 2.1; }
.menu-title { font-weight: 700; font-size: 14px; flex: 1; }
.menu-arrow { color: var(--muted); }
.legal {
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  margin: 28px 16px 12px;
  font-weight: 400;
}

/* Содержимое информационного окна */
.info-body { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 8px; }
.info-body h4 { font-size: 14px; font-weight: 800; color: var(--ink); margin: 16px 0 6px; }
.info-body h4:first-child { margin-top: 4px; }
.info-body p { margin: 0 0 8px; }
.info-body ul { margin: 0 0 8px; padding-left: 18px; }
.info-body li { margin-bottom: 5px; }

/* Розыгрыш */
.gv-head {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: flex-start;
}
.gv-cap { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.gv-timer { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.01em; }
.gv-participants { font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.gv-sub { font-weight: 600; color: var(--muted); font-size: 13px; }

/* Карточки призов — горизонтальная лента */
.prize-row {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.prize-row::-webkit-scrollbar { height: 0; }
.prize-card {
  flex: 0 0 74%; scroll-snap-align: start; border-radius: var(--radius);
  padding: 16px; color: #fff; min-height: 130px;
  display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow);
}
.prize-1 { background: linear-gradient(135deg, #ff8a3d, #e2551f); }
.prize-2 { background: linear-gradient(135deg, #3a7d5c, #1f5c40); }
.prize-3 { background: linear-gradient(135deg, #5b6bd6, #3a45a0); }
.prize-4 { background: linear-gradient(135deg, #9a5cd6, #6b30a3); }
.prize-5 { background: linear-gradient(135deg, #4a8fb5, #2a6180); }
.prize-place {
  align-self: flex-start; background: rgba(255,255,255,.22); border-radius: 20px;
  padding: 4px 10px; font-size: 11px; font-weight: 700; margin-bottom: auto;
}
.prize-title { font-size: 19px; font-weight: 800; margin-top: 12px; }
.prize-sub { font-size: 12px; opacity: .85; margin-top: 2px; }

/* Билеты и место */
.gv-tickets { background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 12px; box-shadow: var(--shadow); }
.gv-tickets-row { display: flex; justify-content: space-between; align-items: flex-start; }
.gv-num { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1.1; margin-top: 4px; }
.gv-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gv-place { font-size: 28px; font-weight: 800; margin-top: 4px; }
.gv-actions { display: flex; gap: 10px; margin-top: 16px; }
.gv-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 14px; padding-right: 14px; }

/* Нижняя навигация */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  background: none; border: none; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; color: var(--muted); padding: 6px 8px; flex: 1;
}
.tab .ic { width: 24px; height: 24px; }
.tab.active { color: var(--primary); font-weight: 700; }

/* Модалки */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 50; }
.modal-card { position: relative; background: var(--card); width: 100%; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: var(--surface-2); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2;
}
.modal-title { font-size: 19px; font-weight: 800; padding-right: 40px; }
.modal-desc { font-size: 14px; color: var(--muted); margin: 6px 0 12px; }
.field-label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; font-weight: 600; }
textarea, input[type="text"], input[type="number"], select {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 13px;
  font-family: inherit; font-size: 15px; background: var(--input-bg); transition: border-color .15s;
  color: var(--ink); -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%2397979d' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--primary); background-color: var(--input-bg-focus); }
.auto-note {
  background: var(--primary-soft); color: var(--note-ink); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; line-height: 1.4; margin-top: 12px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 14px; padding-right: 14px; }
.seg { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-top: 4px; }
.seg-btn { flex: 1; border: none; background: none; padding: 11px; border-radius: 9px; font-weight: 700; font-family: inherit; cursor: pointer; color: var(--muted); }
.seg-btn.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px); transform: translateX(-50%);
  /* Свои токены, а не var(--ink): в тёмной теме --ink почти белый, и
     всплывашка становилась белым прямоугольником с белым текстом. */
  background: var(--toast-bg); color: var(--toast-ink); padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 14px; z-index: 100; max-width: 90%; text-align: center; box-shadow: var(--toast-shadow);
}

/* Экран «Все задания» — отдельная страница на весь экран, а не шторка.
   Фон повторяет фон приложения (тот же fixed-узор с вуалью), поэтому
   переход выглядит как обычная навигация, а не как всплывающее окно. */
.modal.page { background: none; align-items: stretch; }
.modal-card.page {
  width: 100%; height: 100%; max-height: none;
  border-radius: 0; padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-base) url("bg.svg") 0 0 / 560px 560px fixed repeat;
}
.modal-card.page::before {
  content: ""; position: fixed; inset: 0; z-index: 0;
  background: var(--veil); pointer-events: none;
}
.page-head {
  position: relative; z-index: 1; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
/* Кнопку «назад» уводим влево абсолютом, чтобы заголовок стоял
   ровно по центру экрана, а не по центру оставшегося места. */
.page-head .page-back { position: absolute; left: 6px; }
.page-back {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink); cursor: pointer;
  border-radius: 50%; padding: 0;
}
.page-back:active { background: var(--chip-bg); }
.page-back .ic { width: 22px; height: 22px; }
.page-title { font-size: 18px; font-weight: 900; letter-spacing: -.02em; }
.modal-card.page > .chips {
  position: relative; z-index: 1; flex: 0 0 auto;
  padding: 12px 14px 10px; margin: 0;
}
.modal-card.page > .list {
  position: relative; z-index: 1; flex: 1 1 auto;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
}

/* Цвет суммы по размеру выплаты: до 151 ₽ — зелёная, 152–250 ₽ — жёлтая, от 251 ₽ — красная.
   Сама капсула у всех одинаковая, голубая. */
.task-cta.cta-green  { background: var(--sum-green-bg);  color: var(--sum-green); }
.task-cta.cta-yellow { background: var(--sum-yellow-bg); color: var(--sum-yellow); }
.task-cta.cta-red    { background: var(--sum-red-bg);    color: var(--sum-red); }

/* Изображение приза в карточке — фоном справа, текст поверх.
   Слева тёмная вуаль, чтобы название читалось на любом градиенте. */
.prize-card { position: relative; overflow: hidden; }
.prize-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(0,0,0,.28) 22%, rgba(0,0,0,0) 68%);
  pointer-events: none;
}
.prize-card::after {
  content: ""; position: absolute; right: -14px; bottom: -20px;
  width: 132px; height: 132px; background: no-repeat center / contain;
  pointer-events: none;
}
.prize-card > * { position: relative; z-index: 1; }
.pz-iphone::after  { background-image: url("prize-iphone.svg?v=62"); }
.pz-macbook::after { background-image: url("prize-macbook.svg?v=62"); }
.pz-airpods::after { background-image: url("prize-airpods.svg?v=62"); }
.pz-ipad::after    { background-image: url("prize-ipad.svg?v=62"); }
.pz-watch::after   { background-image: url("prize-watch.svg?v=62"); }
.pz-money::after   { background-image: url("prize-money.svg?v=62"); }
.pz-gift::after    { background-image: url("prize-gift.svg?v=62"); }
/* Фото приза (файл рядом со стилями или ссылка из админки) — занимает
   правую часть карточки и мягко растворяется в градиенте. */
.prize-card.pz-photo::after {
  right: 0; bottom: 0; width: 58%; height: 100%;
  /* Поверх фото — затемнение слева: иначе белый фон снимка
     (часы, iPad) съедает белый заголовок. */
  background-image:
    linear-gradient(95deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.28) 42%, rgba(0,0,0,0) 78%),
    var(--pz-photo);
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 46%);
          mask-image: linear-gradient(90deg, transparent 0, #000 46%);
}
/* Под фото затемнение слева не нужно — оно и так растворяется */
.prize-card.pz-photo::before {
  background: linear-gradient(100deg, rgba(0,0,0,.34) 30%, rgba(0,0,0,0) 72%);
}

/* Цвет карточки под фото: правый конец градиента совпадает с левым краем
   снимка, поэтому стыка между заливкой и фотографией не видно. */
.prize-card.pz-photo.pz-macbook { background: linear-gradient(135deg, #4a4a4d, #000); }
.prize-card.pz-photo.pz-iphone  { background: linear-gradient(135deg, #8c4a6a, #4b2a3b); }
.prize-card.pz-photo.pz-airpods { background: linear-gradient(135deg, #6b6b6e, #2a2a2a); }
.prize-card.pz-photo.pz-ipad    { background: linear-gradient(135deg, #fff, #fafafa); }
.prize-card.pz-photo.pz-watch   { background: linear-gradient(135deg, #f2eeeb, #bcb3af); }

/* Светлые снимки (iPad, часы) — карточка светлая, значит текст тёмный,
   а обе вуали белые: на белом фоне белые буквы не читались бы. */
.prize-card.pz-light { color: #16181c; }
.prize-card.pz-light .prize-sub { color: #4a4f57; opacity: 1; }
.prize-card.pz-light .prize-place { background: rgba(0,0,0,.10); }
.prize-card.pz-light::before {
  background: linear-gradient(100deg, rgba(255,255,255,.88) 26%, rgba(255,255,255,0) 72%);
}
.prize-card.pz-light.pz-photo::after {
  background-image:
    linear-gradient(95deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,.35) 40%, rgba(255,255,255,0) 76%),
    var(--pz-photo);
}

/* Счётчик «онлайн» в правом углу шапки */
.online {
  margin-left: auto; display: flex; flex-direction: column;
  align-items: flex-end; line-height: 1.05;
}
.online-row {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.online-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  flex: 0 0 8px; animation: onlinePulse 2.6s ease-out infinite;
}
.online-cap { font-size: 10px; font-weight: 700; color: var(--muted); }
@keyframes onlinePulse {
  0%   { box-shadow: 0 0 0 0 rgba(4, 224, 97, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(4, 224, 97, 0); }
  100% { box-shadow: 0 0 0 0 rgba(4, 224, 97, 0); }
}
@media (prefers-reduced-motion: reduce) { .online-dot { animation: none; } }

/* Таблица лидеров розыгрыша */
.top-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.top-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.top-table th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 14px 8px; border-bottom: 1px solid var(--line);
}
.top-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.top-table tr:last-child td { border-bottom: none; }
.top-place { width: 34px; font-weight: 800; color: var(--ink-2); }
.top-name { font-weight: 600; color: var(--ink); }
/* Билеты — голубым, как и везде в розыгрыше */
.top-tickets {
  text-align: right; width: 64px; font-weight: 800;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.top-table .top-me { background: var(--primary-soft); }

/* Маскот сидит в карточке приветствия, справа от баланса. Раньше он висел
   поверх экрана и при прокрутке наезжал на задания. */
.mascot {
  position: absolute; right: 6px; top: 50px; z-index: 3;
  border: none; background: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: row; align-items: center; gap: 4px;
  animation: mascotFloat 3.4s ease-in-out infinite;
}
.mascot:active { transform: scale(.94); }
.mascot-img {
  width: 46px; height: auto; display: block;
  filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .16));
}
.mascot-bubble {
  background: var(--purple); color: #fff; font-size: 10px; font-weight: 800;
  padding: 4px 9px; border-radius: 11px 7px 7px 11px; white-space: nowrap;
  /* drop-shadow, а не box-shadow: тень ложится на облачко и хвостик
     одним контуром, без шва между ними */
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.16)); position: relative;
}
/* Хвостик смотрит вправо — облачко сбоку от маскота. Повёрнутый квадрат
   заходит внутрь облачка, поэтому стык не виден. */
.mascot-bubble::after {
  content: ""; position: absolute; right: -3.5px; top: 50%;
  width: 9px; height: 9px; margin-top: -4.5px;
  background: var(--purple); transform: rotate(45deg); border-radius: 0 2px 0 0;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; } }

/* Вкладки в разделе «Все задания» */
/* Вкладки переносятся на вторую строку, а не уезжают за край:
   обрезанная кнопка выглядит как ошибка вёрстки. */
.chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 7px; padding: 2px 0 12px;
}
.chip {
  flex: 0 0 auto; border: none; border-radius: 11px;
  background: var(--chip-bg); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 13px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.chip:active { transform: scale(.97); }
.chip.active { background: var(--primary); color: #fff; }

/* Экран «сервис недоступен в вашей стране» */
body.geo-blocked .tabbar,
body.geo-blocked .mascot,
body.geo-blocked .online,
body.geo-blocked .ticker,
body.geo-blocked .screen-title { display: none !important; }
.geo-wall {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 28px; color: var(--ink);
}
.geo-ic {
  width: 56px; height: 56px; fill: none; stroke: var(--muted);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.geo-title { font-size: 20px; font-weight: 900; margin-top: 18px; }
.geo-text { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; white-space: pre-line; }


/* ---------- тёмная тема ----------
   Переопределяем только токены: компоненты уже ходят через них, поэтому
   отдельных тёмных правил почти не нужно. Тему ставит app.js в data-theme
   на <html>; без него работает системная настройка. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0e1014;
  --card: #171a21;
  --ink: #f1f3f6;
  --ink-2: #b6bcc6;
  --muted: #7c8492;
  --line: #262b33;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);

  --bg-base: #0e1014;
  --veil: rgba(14, 16, 20, .89);
  --surface-2: #222833;
  --chip-bg: #222833;
  --ghost-bg: #272d38;
  --row-active: #1d222a;
  --input-bg: #1c2029;
  --input-bg-focus: #232935;

  --primary-soft: rgba(0, 170, 255, .18);
  --btn-blue-soft: rgba(0, 170, 255, .18);
  --btn-blue-ink: #6cc6f5;
  --note-ink: #8ed2f5;

  /* На тёмной подложке та же заливка читается иначе — цифры светлее */
  --sum-green-bg: rgba(4, 224, 97, .16);   --sum-green: #4ade80;
  --sum-yellow-bg: rgba(245, 166, 35, .18); --sum-yellow: #f3b64b;
  --sum-red-bg: rgba(255, 61, 77, .16);     --sum-red: #ff7b87;
  --sum-blue-bg: rgba(0, 170, 255, .16);    --sum-blue: #6cc6f5;

  --badge-wait-bg: rgba(245, 166, 35, .18); --badge-wait-ink: #f3b64b;
  --badge-ok-bg: rgba(4, 224, 97, .16);     --badge-ok-ink: #4ade80;
  --badge-no-bg: rgba(255, 61, 77, .16);    --badge-no-ink: #ff7b87;
  --streak-bg: rgba(255, 122, 26, .16);     --streak-ink: #ff9d4d;  --streak-cap: #c98c5c;
  /* Всплывашка — тёмная плашка чуть светлее фона, с тонкой рамкой,
     чтобы не терялась на почти чёрном экране */
  --toast-bg: #262c36;  --toast-ink: #f1f3f6;
  --toast-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014;
  --card: #171a21;
  --ink: #f1f3f6;
  --ink-2: #b6bcc6;
  --muted: #7c8492;
  --line: #262b33;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);

  --bg-base: #0e1014;
  --veil: rgba(14, 16, 20, .89);
  --surface-2: #222833;
  --chip-bg: #222833;
  --ghost-bg: #272d38;
  --row-active: #1d222a;
  --input-bg: #1c2029;
  --input-bg-focus: #232935;

  --primary-soft: rgba(0, 170, 255, .18);
  --btn-blue-soft: rgba(0, 170, 255, .18);
  --btn-blue-ink: #6cc6f5;
  --note-ink: #8ed2f5;

  /* На тёмной подложке та же заливка читается иначе — цифры светлее */
  --sum-green-bg: rgba(4, 224, 97, .16);   --sum-green: #4ade80;
  --sum-yellow-bg: rgba(245, 166, 35, .18); --sum-yellow: #f3b64b;
  --sum-red-bg: rgba(255, 61, 77, .16);     --sum-red: #ff7b87;
  --sum-blue-bg: rgba(0, 170, 255, .16);    --sum-blue: #6cc6f5;

  --badge-wait-bg: rgba(245, 166, 35, .18); --badge-wait-ink: #f3b64b;
  --badge-ok-bg: rgba(4, 224, 97, .16);     --badge-ok-ink: #4ade80;
  --badge-no-bg: rgba(255, 61, 77, .16);    --badge-no-ink: #ff7b87;
  --streak-bg: rgba(255, 122, 26, .16);     --streak-ink: #ff9d4d;  --streak-cap: #c98c5c;
  /* Всплывашка — тёмная плашка чуть светлее фона, с тонкой рамкой,
     чтобы не терялась на почти чёрном экране */
  --toast-bg: #262c36;  --toast-ink: #f1f3f6;
  --toast-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.55);
}

/* Светлые фото призов на тёмном фоне: карточку не перекрашиваем, но
   отделяем её рамкой, иначе белый снимок сливается с краем экрана. */
:root[data-theme="dark"] .prize-card.pz-light { box-shadow: 0 0 0 1px var(--line), var(--shadow); }

/* Переключатель в строке меню */
.switch {
  width: 46px; height: 27px; flex: 0 0 46px; border-radius: 999px;
  background: var(--surface-2); position: relative;
  transition: background .18s;
}
.switch i {
  position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .18s;
}
.menu-row[aria-pressed="true"] .switch { background: var(--primary); }
.menu-row[aria-pressed="true"] .switch i { transform: translateX(19px); }

/* Админ-панель в приложении */
.adm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-stat {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow);
}
.adm-stat-title { font-size: 12px; color: var(--muted); font-weight: 700; }
.adm-stat-value {
  font-size: 24px; font-weight: 900; margin-top: 4px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.adm-stat-sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.adm-note { font-size: 13px; color: var(--muted); font-weight: 700; margin: 0 4px 2px; }
.adm-card {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow);
}
.adm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.adm-card-title { font-size: 16px; font-weight: 800; }
.adm-card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.adm-card-id { font-size: 12px; color: var(--muted); font-weight: 700; flex: 0 0 auto; }
/* Реквизиты моноширинно: так видно опечатку в номере карты */
.adm-details {
  margin-top: 10px; padding: 9px 11px; border-radius: 10px;
  background: var(--input-bg); font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.adm-actions .btn { flex: 1 1 auto; font-size: 13px; padding: 11px 14px; }

/* Вкладка «Ссылки» в админ-панели */
.lnk-search {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border-radius: 999px; padding: 12px 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.lnk-search .ic { color: var(--muted); }
.lnk-search input {
  flex: 1; min-width: 0; border: none; background: none; padding: 0;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.lnk-search input:focus { outline: none; background: none; }
.lnk-clear {
  border: none; background: var(--surface-2); color: var(--ink-2);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  font-size: 12px; line-height: 1; flex: 0 0 24px;
}

.lnk-chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.lnk-chips::-webkit-scrollbar { height: 0; }
.lnk-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  border: none; border-radius: 999px; cursor: pointer; font-family: inherit;
  background: var(--card); color: var(--ink); padding: 12px 16px;
  box-shadow: var(--shadow);
}
.lnk-chip.active { background: var(--primary); color: #fff; }
.lnk-chip-name { font-weight: 800; font-size: 15px; }
.lnk-chip-num {
  font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.lnk-chip.active .lnk-chip-num { background: rgba(255, 255, 255, .25); color: #fff; }
.lnk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 8px; }
.lnk-chip.active .lnk-dot { background: rgba(255, 255, 255, .7); }

.lnk-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.lnk-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lnk-card-name { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 900; }
.lnk-card-url { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.lnk-copy {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--primary-soft); color: var(--btn-blue-ink);
  display: grid; place-items: center;
}
.lnk-card-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.lnk-del { background: var(--badge-no-bg); color: var(--badge-no-ink); }
.lnk-totals {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px;
  background: var(--primary-soft); border-radius: var(--radius-sm); padding: 14px 8px;
}
.lnk-totals > div { text-align: center; position: relative; }
/* Разделители рисуем рамкой, а не отдельными элементами */
.lnk-totals > div + div { border-left: 1px solid rgba(128, 128, 128, .22); }
.lnk-totals b { display: block; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.lnk-totals span { display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }

.lnk-periods {
  display: flex; background: var(--surface-2); border-radius: 999px;
  padding: 4px; margin: 12px 0;
}
.lnk-per {
  flex: 1; border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 11px 8px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted);
}
.lnk-per.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.lnk-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.lnk-cell { background: var(--card); padding: 20px 14px; text-align: center; }
.lnk-cell b { display: block; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lnk-cell span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.c-blue { color: var(--primary); }
.c-green { color: #0f9d4f; }
.c-amber { color: #d98e12; }
.c-red { color: var(--red); }
:root[data-theme="dark"] .c-green { color: #4ade80; }
:root[data-theme="dark"] .c-amber { color: #f3b64b; }
/* Точка у задания: зелёная — на главной, фиолетовая — на маскоте, серая — в списке */
.lnk-dot { background: var(--muted); }
.lnk-dot.on { background: var(--green); }
.lnk-dot.promo { background: var(--purple); }
.lnk-chip.active .lnk-dot,
.lnk-chip.active .lnk-dot.on,
.lnk-chip.active .lnk-dot.promo { background: rgba(255, 255, 255, .75); }
/* Три показателя в ряд: цифры чуть мельче, иначе не помещаются */
.lnk-grid.three { grid-template-columns: repeat(3, 1fr); }
.lnk-grid.three .lnk-cell { padding: 18px 6px; }
.lnk-grid.three .lnk-cell b { font-size: 24px; }
.lnk-grid.three .lnk-cell span { font-size: 12px; }

/* Содержимое админ-панели раскладываем блоками, а не флексом.
   Во флекс-колонке лента вкладок схлопывалась по высоте на узких экранах,
   и карточка наезжала на неё. */
#adminBody { display: block; }
#adminBody > * + * { margin-top: 10px; }
#adminBody .adm-grid,
#adminBody .lnk-grid { margin-top: 10px; }
/* Чипы не должны сжиматься по высоте, что бы ни творилось снаружи */
.lnk-chips { align-items: center; }
.lnk-chip { flex: 0 0 auto; align-self: flex-start; }


/* Код ссылки под названием — как в личном кабинете партнёра */
.lnk-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.lnk-chip-code, .lnk-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--muted); letter-spacing: .02em;
}
.lnk-chip.active .lnk-chip-code { color: rgba(255, 255, 255, .8); }
.lnk-card-code { margin: 2px 0 0 16px; font-size: 13px; }
/* Ссылку не переносим по буквам — одна строка с многоточием,
   целиком она копируется кнопкой рядом */
.lnk-card-head > div:first-child { min-width: 0; }
.lnk-card-url { word-break: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Второй ряд плиток ссылки: приглашения и блокировки */
.c-purple { color: var(--purple); }
.c-muted { color: var(--ink-2); }
.lnk-cell em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 3px; }
