:root {
  /* Жёлто-чёрная палитра: светло-серый фон, белые карточки,
     тёмные акцентные плашки и жёлтые кнопки */
  --yellow: #ffd83d;           /* главный акцент: кнопки, активная вкладка */
  --yellow-press: #f5c800;
  --yellow-soft: #fff1bd;      /* вторичные кнопки, плашки */
  --yellow-soft-ink: #1a1a1a;
  --on-yellow: #141414;        /* текст на жёлтом */

  --dark: #1c1c1e;             /* тёмные карточки и нижнее меню */
  --dark-2: rgba(255, 255, 255, .08);
  --on-dark: #ffffff;
  --on-dark-muted: #a1a1a6;
  --tabbar-bg: #1c1c1e;

  --primary: #141414;          /* акцентный текст (ссылки, цифры) */
  --primary-press: #000;
  --primary-soft: #fff4c7;
  --green: #22c55e;
  --red: #ff4d4f;
  --purple: #a855f7;
  --blue: #0a84ff;

  --bg: #f2f2f4;               /* фон страницы */
  /* Текстура «ячейки» выключена. Вернуть:
     linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)), url("bg-cells.jpg?v=2") */
  --bg-image: none;
  --bg-tile: 420px;
  --on-bg: #141414;            /* текст прямо на фоне */
  --on-bg-muted: rgba(20, 20, 20, .68);
  --card: #ffffff;
  --ink: #141414;
  --ink-2: #48484a;
  --muted: #8e8e93;
  --line: #ececef;
  --radius: 26px;
  --radius-sm: 20px;
  --radius-xs: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 4px 14px rgba(0, 0, 0, .04);
  --tabbar-h: 64px;
  --tabbar-bottom: calc(10px + env(safe-area-inset-bottom));

  --toast-bg: #1c1c1e;
  --toast-ink: #ffffff;
  --toast-shadow: 0 8px 24px rgba(0,0,0,.22);

  /* Капсула награды — полупрозрачная заливка своего цвета плюс насыщенная цифра */
  --sum-green-bg: rgba(34, 197, 94, .16);
  --sum-green: #13823e;
  --sum-yellow-bg: var(--yellow-soft);
  --sum-yellow: #7a5a00;
  --sum-red-bg: rgba(255, 77, 79, .15);
  --sum-red: #c42a2c;

  --surface-2: #f2f2f4;        /* переключатели, крестик в окне, поле ссылки */
  --chip-bg: #ffffff;
  --ghost-bg: #efeff1;
  --row-active: #f7f7f8;
  --input-bg: #f5f5f7;
  --input-bg-focus: #ffffff;
  --note-ink: #5c4500;
  --badge-wait-bg: #fff1bd;  --badge-wait-ink: #7a5a00;
  --badge-ok-bg: #dcf5e4;    --badge-ok-ink: #13823e;
  --badge-no-bg: #fde3e3;    --badge-no-ink: #c42a2c;
  --streak-bg: #ffecd9;      --streak-ink: #e8590c;  --streak-cap: #b0703f;
  --avatar-bg: linear-gradient(140deg, #e880d6, #9b5de5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Onest", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background-color: var(--bg); background-image: var(--bg-image);
  background-size: var(--bg-tile) var(--bg-tile); background-repeat: repeat;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- шапка ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 0; color: var(--ink);
}
.brand {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--ink);
}
.brand-logo {
  width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain;
  display: block;
}
#brandName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-title {
  margin: 8px 16px 0; font-size: 28px; line-height: 1.05;
  font-weight: 900; letter-spacing: -.035em; color: var(--ink);
}

#content { flex: 1; padding: 0 12px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
.screen { padding-top: 10px; }

/* ---------- карточки ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

/* Тёмная карточка с тёплым свечением в углу */
.dark-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 216, 61, .30) 0%, rgba(255, 216, 61, .08) 38%, rgba(255, 216, 61, 0) 62%),
    var(--dark);
  color: var(--on-dark); border-radius: var(--radius); padding: 18px;
  margin-bottom: 12px;
}
.hello-row { display: flex; align-items: center; gap: 12px; }
.hello-text { min-width: 0; flex: 1; }
.hello-name {
  font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--on-dark);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hello-sub { font-size: 14px; color: var(--on-dark-muted); margin-top: 1px; }
.hero-note { font-size: 13px; color: var(--on-dark-muted); margin: 2px 0 16px; }
.balance {
  font-size: 44px; font-weight: 900; line-height: 1.02; margin: 14px 0 16px;
  letter-spacing: -.04em; color: var(--on-dark); font-variant-numeric: tabular-nums;
}
.wallet .balance { margin: 6px 0 4px; }

/* Карточка баланса на «Заданиях» — одна строка */
.hero-compact { padding: 10px 10px 10px 12px; margin-bottom: 8px; border-radius: var(--radius-sm); }
.hero-compact .hello-row { gap: 10px; }
.hero-compact .avatar { width: 38px; height: 38px; font-size: 16px; }
.hero-compact .hello-sub { font-size: 12px; margin: 0; line-height: 1.2; }
.hero-compact .balance {
  font-size: 22px; margin: 0; line-height: 1.15; letter-spacing: -.03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-sm { padding: 10px 14px; font-size: 14px; border-radius: 14px; gap: 6px; flex: 0 0 auto; }

/* Приглашение узкой строкой */
.invite-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; cursor: pointer; font-family: inherit; text-align: left; color: var(--ink);
  background: var(--card); border-radius: var(--radius-sm); padding: 9px 12px; box-shadow: var(--shadow);
}
.invite-row:active { transform: scale(.99); }
.invite-ic {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  background: var(--yellow-soft); color: var(--yellow-soft-ink); display: grid; place-items: center;
}
.invite-ic .ic { width: 18px; height: 18px; }
.invite-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.invite-title { font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.invite-sub { font-size: 12.5px; color: var(--muted); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-sub b { color: var(--ink); font-weight: 800; }
.invite-arrow { color: var(--muted); }
.invite-prog {
  display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 700;
}
[data-screen="tasks"] .section-h,
[data-screen="vacancies"] .section-h { margin: 16px 4px 10px; }
[data-screen="tasks"] .link-btn,
[data-screen="vacancies"] .link-btn { margin-top: 4px; flex: 0 0 auto; }
.section-row .section-h { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Приветствие на «Вакансиях»: имя и два маленьких счётчика в одной строке */
.hero-compact .hello-name { font-size: 15.5px; line-height: 1.2; }
.kpis-mini { margin: 0; gap: 6px; flex: 0 0 auto; }
.kpis-mini .kpi { flex: 0 0 auto; min-width: 62px; padding: 6px 9px; border-radius: 12px; text-align: center; }
.kpis-mini .kpi b { font-size: 18px; line-height: 1.1; }
.kpis-mini .kpi span { font-size: 10.5px; margin-top: 1px; overflow: visible; text-overflow: clip; }
.hero-compact .hello-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Подпись приглашения может уйти на вторую строку — лучше, чем обрезать сумму */
.invite-sub { white-space: normal; }
/* Фильтр городов — одна строка с прокруткой вбок вместо двух рядов */
.chips.chips-left {
  flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
  margin: 0 -12px; padding: 2px 12px 12px;
}
.chips.chips-left::-webkit-scrollbar { height: 0; }
.hero-compact + .tiles:not(:has(> .tile:not([hidden]))) { display: none; }

.kpis { display: flex; gap: 8px; margin-top: 16px; }
.kpis > .kpi { flex: 1 1 0; }
.kpi {
  background: var(--dark-2); border-radius: 18px; padding: 12px 12px 11px; min-width: 0;
}
.kpi b {
  display: block; font-size: 26px; font-weight: 900; line-height: 1.1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.kpi span { display: block; font-size: 13px; color: var(--on-dark-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-accent { background: var(--yellow); color: var(--on-yellow); }
.kpi-accent span { color: rgba(20, 20, 20, .7); }

.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--avatar-bg); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  overflow: hidden; flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-lg { width: 72px; height: 72px; font-size: 30px; }

/* Две плитки под приветствием */
.tiles { display: flex; gap: 10px; }
.tiles > .tile { flex: 1 1 0; min-width: 0; }
.tile {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  border: none; border-radius: var(--radius); padding: 16px; min-height: 124px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .08s;
}
.tile:active { transform: scale(.98); }
.tile-accent { background: var(--yellow); color: var(--on-yellow); }
.tile-title { position: relative; font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.tile-sub { position: relative; font-size: 12.5px; line-height: 1.3; margin-top: 3px; color: var(--muted); }
/* Иконка стоит абсолютом сверху — оставляем под неё место, чтобы длинная
   подпись не залезала на кружок */
.tile { padding-top: 66px; }
.tile-accent .tile-sub { color: rgba(20, 20, 20, .66); }
/* Сумма за друга внутри подписи — жирным, чтобы цепляла взгляд */
.tile-reward { color: var(--ink); font-weight: 800; }
.tile-ic {
  position: absolute; left: 16px; top: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink);
  display: grid; place-items: center;
}
.tile-accent .tile-ic { background: rgba(0, 0, 0, .09); color: var(--on-yellow); }
.tile-ic .ic { width: 20px; height: 20px; }

/* ---------- иконки и кнопки ---------- */
.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: 18px;
  font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  padding: 16px 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;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-block { display: flex; width: 100%; }
/* Главная кнопка — жёлтая */
.btn-dark { background: var(--yellow); color: var(--on-yellow); }
.btn-dark:active { background: var(--yellow-press); }
/* Вторичная — светло-жёлтая */
.btn-yellow { background: var(--yellow-soft); color: var(--yellow-soft-ink); }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; background: transparent; border: none;
  color: var(--ink); 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: 999px;
  padding: 7px 0; margin: 10px 0 0; 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), transparent); }
.ticker::after  { right: 0; background: linear-gradient(270deg, var(--card), transparent); }
.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-job { color: var(--ink); font-weight: 600; }
.tick-amount { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.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; } }

/* ---------- секции и списки ---------- */
.section-h { font-size: 22px; font-weight: 800; margin: 24px 4px 12px; letter-spacing: -.03em; }
.list { display: flex; flex-direction: column; gap: 10px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-row .section-h { margin-right: auto; }
.link-btn {
  background: var(--card); border: none; color: var(--ink); border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; padding: 8px 13px; white-space: nowrap; margin-top: 12px;
}
.empty { text-align: center; color: var(--muted); padding: 28px 20px; font-size: 14px; line-height: 1.45; }

/* Поиск */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 999px; padding: 15px 18px;
  box-shadow: var(--shadow); margin-bottom: 12px; color: var(--muted);
}
.search input {
  flex: 1; min-width: 0; border: none; background: none; padding: 0;
  font-family: inherit; font-size: 16px; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; background: none; }
.search-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;
}

/* Чипы-фильтры */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 0 0 12px; }
.chips-left { justify-content: flex-start; }
.chip {
  flex: 0 0 auto; border: none; border-radius: 999px;
  background: var(--chip-bg); color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 10px 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s; box-shadow: var(--shadow);
}
.chip:active { transform: scale(.97); }
.chip.active { background: var(--yellow); color: var(--on-yellow); }

/* ---------- вакансии ---------- */
.vac {
  display: flex; align-items: flex-start; gap: 13px; width: 100%;
  text-align: left; border: none; cursor: pointer; font-family: inherit; color: var(--ink);
  background: var(--card); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow);
  transition: transform .08s;
}
.vac:active { transform: scale(.99); }
.vac-logo {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%;
  background: var(--dark); color: var(--yellow);
  display: grid; place-items: center; font-size: 19px; font-weight: 900;
}
.vac-body { flex: 1; min-width: 0; }
.vac-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vac-title { font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.vac-top .badge { flex: 0 0 auto; }
.vac-meta { font-size: 13.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vac-salary {
  display: inline-block; margin-top: 10px; padding: 6px 11px; border-radius: 999px;
  background: var(--yellow-soft); color: var(--yellow-soft-ink);
  font-weight: 800; font-size: 14px;
}
.vac-modal-head { display: flex; align-items: center; gap: 13px; padding-right: 40px; }
.vac-modal-head .modal-title { padding-right: 0; }
.vac-modal-text { min-width: 0; }
.vac-company { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.vac-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.vac-tags:empty { display: none; }
.vac-tag { font-size: 13.5px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.vac-tag:first-child { background: var(--yellow-soft); color: var(--yellow-soft-ink); }
.vac-desc { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-top: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.vac-desc:empty { display: none; }

/* ---------- задания ---------- */
.task {
  background: var(--card); border-radius: var(--radius-sm); padding: 14px 14px 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 44px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.task-ic svg { width: 22px; height: 22px; display: block; }
.task-title { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.task-desc { font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-cta {
  background: var(--yellow); color: var(--on-yellow); border: none; border-radius: 999px;
  padding: 11px 16px; font-weight: 800; font-size: 14px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.task-cta:active { filter: brightness(.94); }
/* Цвет суммы по размеру выплаты: до 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); }
.badge { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; white-space: nowrap; }
.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); }
.task-group {
  font-size: 12px; font-weight: 700; color: var(--muted);
  margin: 16px 4px 2px; text-transform: uppercase; letter-spacing: .05em;
}
.task-group:first-child { margin-top: 0; }


/* ---------- квесты за приглашения ---------- */
.quests { display: flex; flex-direction: column; gap: 10px; }
.quest {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--radius-sm); padding: 14px;
  box-shadow: var(--shadow);
}
.quest-inner { display: flex; align-items: center; gap: 12px; }
.quest-ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  background: var(--dark); color: var(--yellow);
  display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.quest-body { flex: 1; min-width: 0; }
.quest-title { font-weight: 800; font-size: 14.5px; }
.quest-reward { font-size: 13px; color: var(--sum-green); font-weight: 700; margin-top: 1px; }
.quest-bar { height: 6px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.quest-bar span { display: block; height: 100%; background: var(--yellow); border-radius: 4px; }
.quest-prog { font-size: 12px; color: var(--muted); margin-top: 5px; }
.quest-cta {
  border: none; border-radius: 999px; padding: 10px 15px; font-weight: 800; font-size: 13px;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  background: var(--yellow); color: var(--on-yellow);
}
.quest-cta:disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.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: 13px; font-weight: 700; color: var(--ink-2); text-align: center; padding: 0 12px;
}
.quest.done { opacity: .65; }
.quest-done-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--sum-green); white-space: nowrap; }

/* ---------- друзья ---------- */
.hint { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 14px 6px; }
.ref-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.ref-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4;
  word-break: break-all; margin: 10px 0 14px; padding: 13px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-xs);
}
.ref-actions { display: flex; gap: 10px; }
.ref-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px; }

.howto-title { font-weight: 800; font-size: 17px; letter-spacing: -.02em; margin-bottom: 16px; }
.howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.howto-list li { display: flex; align-items: center; gap: 14px; font-size: 15px; line-height: 1.4; }
.howto-num {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  background: var(--dark); color: var(--yellow);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}

.stat-row { display: flex; gap: 10px; margin: 12px 0; }
.stat-row > .stat-box { flex: 1 1 0; }
.stat-box { background: var(--card); border-radius: var(--radius-sm); padding: 16px 14px; box-shadow: var(--shadow); min-width: 0; }
.stat-num {
  font-size: 22px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-cap { font-size: 13px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- профиль ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 4px 4px 6px; }
.profile-name { min-width: 0; }
.prof-name { font-size: 22px; font-weight: 900; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-id { font-size: 14px; color: var(--muted); margin-top: 2px; }
.streak {
  margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  background: var(--streak-bg); border-radius: 999px; padding: 8px 14px;
}
.streak-ic { width: 20px; height: 20px; color: var(--streak-ink); }
.streak-num { font-size: 20px; font-weight: 900; color: var(--streak-ink); line-height: 1; }
.streak-cap { font-size: 11px; color: var(--streak-cap); line-height: 1.1; }
.streak-sm { padding: 6px 11px; gap: 4px; }
.streak-sm .streak-ic { width: 17px; height: 17px; }
.streak-sm .streak-num { font-size: 16px; }

.achievements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ach {
  background: var(--card); border-radius: var(--radius-sm); padding: 16px 6px 14px;
  text-align: center; box-shadow: var(--shadow); min-width: 0;
}
.ach-ic {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--yellow-soft); color: var(--yellow-soft-ink);
}
.ic-ach { width: 24px; height: 24px; }
.ach-name { font-size: 13px; font-weight: 800; margin-top: 10px; line-height: 1.25; letter-spacing: -.01em; }
.ach.locked .ach-ic { background: var(--surface-2); color: var(--muted); }
.ach.locked .ach-name { color: var(--muted); font-weight: 600; }

.income-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.income-bar span { display: block; height: 100%; }
#barTasks { background: var(--yellow); }
#barRefs { background: var(--dark); }
.income-legend { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; font-size: 15px; }
.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(--yellow); } .dot-b { background: var(--dark); }

.hist { background: var(--card); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.hist-amt { font-weight: 800; }
.hist-meta { font-size: 13px; color: var(--muted); }
.info-body .hist { background: var(--surface-2); box-shadow: none; }

.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: 12px 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: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); display: grid; place-items: center;
}
.menu-ic .ic { width: 20px; height: 20px; }
.menu-title { font-weight: 700; font-size: 15px; flex: 1; }
.menu-arrow { color: var(--muted); }
.legal { text-align: center; font-size: 12px; line-height: 1.45; color: var(--muted); margin: 28px 16px 12px; }

.switch {
  width: 48px; height: 28px; flex: 0 0 48px; border-radius: 999px;
  background: var(--line); position: relative; transition: background .18s;
}
.switch i {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .18s;
}
.menu-row[aria-pressed="true"] .switch { background: var(--yellow); }
.menu-row[aria-pressed="true"] .switch i { transform: translateX(20px); }

/* ---------- розыгрыш ---------- */
.gv-head {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 216, 61, .30) 0%, rgba(255, 216, 61, 0) 60%),
    var(--dark);
  color: var(--on-dark); border-radius: var(--radius); padding: 18px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.gv-cap { font-size: 12px; color: var(--muted); font-weight: 600; }
.gv-head .gv-cap { color: var(--on-dark-muted); }
.gv-timer { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.03em; }
.gv-participants { font-size: 28px; font-weight: 900; margin-top: 4px; color: var(--yellow); letter-spacing: -.03em; }
.gv-sub { font-weight: 600; color: var(--muted); font-size: 14px; letter-spacing: 0; }

.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 {
  position: relative; overflow: hidden;
  flex: 0 0 74%; scroll-snap-align: start; border-radius: var(--radius);
  padding: 16px; color: #fff; min-height: 140px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.prize-1 { background: linear-gradient(135deg, #2c2c2e, #111); }
.prize-2 { background: linear-gradient(135deg, #3a3a3c, #1c1c1e); }
.prize-3 { background: linear-gradient(135deg, #48484a, #2c2c2e); }
.prize-4 { background: linear-gradient(135deg, #8a6d00, #4d3c00); }
.prize-5 { background: linear-gradient(135deg, #636366, #3a3a3c); }
.prize-place {
  align-self: flex-start; background: var(--yellow); color: var(--on-yellow); border-radius: 20px;
  padding: 4px 10px; font-size: 11px; font-weight: 800; margin-bottom: auto;
}
.prize-title { font-size: 20px; font-weight: 900; margin-top: 12px; letter-spacing: -.02em; }
.prize-sub { font-size: 12px; opacity: .85; margin-top: 2px; }

.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%;
  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); }
.prize-card.pz-light { color: #16181c; box-shadow: inset 0 0 0 1px var(--line); }
.prize-card.pz-light .prize-sub { color: #4a4f57; opacity: 1; }
.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);
}

.gv-tickets { background: var(--card); border-radius: var(--radius); padding: 18px; margin-top: 12px; box-shadow: var(--shadow); }
.gv-tickets-row { display: flex; justify-content: space-between; align-items: flex-start; }
.gv-num { font-size: 36px; font-weight: 900; color: var(--ink); line-height: 1.1; margin-top: 4px; letter-spacing: -.03em; }
.gv-hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.gv-place { font-size: 30px; font-weight: 900; margin-top: 4px; letter-spacing: -.03em; }
.gv-actions { display: flex; gap: 10px; margin-top: 16px; }
.gv-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px; }

.top-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.top-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.top-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 13px 16px 9px; border-bottom: 1px solid var(--line);
}
.top-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.top-table tr:last-child td { border-bottom: none; }
.top-place { width: 38px; font-weight: 800; color: var(--ink-2); }
.top-name { font-weight: 600; color: var(--ink); }
.top-tickets { text-align: right; width: 64px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.top-table .top-me { background: var(--yellow-soft); }
.top-table .top-me td { color: var(--yellow-soft-ink); }

/* ---------- онлайн ---------- */
.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(34, 197, 94, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) { .online-dot { animation: none; } }

/* ---------- нижнее меню: плавающая капсула ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: var(--tabbar-bottom);
  max-width: 520px; margin: 0 auto; z-index: 40;
  height: var(--tabbar-h); padding: 6px; gap: 2px;
  background: var(--tabbar-bg); border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.tab {
  flex: 0 0 48px; height: 52px; padding: 0 12px; min-width: 0;
  border: none; background: none; border-radius: 999px; cursor: pointer;
  color: var(--on-dark-muted); font-family: inherit; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; overflow: hidden;
  transition: flex-grow .25s ease, background .2s, color .2s;
}
.tab .ic { width: 23px; height: 23px; }
.tab span { display: none; }
.tab.active { flex: 1 1 auto; background: var(--yellow); color: var(--on-yellow); }
.tab.active span { display: inline; overflow: hidden; text-overflow: ellipsis; }

/* ---------- модалки ---------- */
.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: 28px 28px 0 0; padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
.modal-x {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  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: 22px; font-weight: 900; letter-spacing: -.03em; padding-right: 44px; line-height: 1.2; }
.modal-desc { font-size: 15px; color: var(--muted); margin: 6px 0 14px; line-height: 1.45; }
.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 transparent; border-radius: var(--radius-xs); padding: 14px;
  font-family: inherit; font-size: 16px; background: var(--input-bg); transition: border-color .15s;
  color: var(--ink); -webkit-appearance: none; appearance: none;
}
.search input[type="text"] { border: none; border-radius: 0; padding: 0; background: 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(--yellow); background-color: var(--input-bg-focus); }
.auto-note {
  background: var(--yellow-soft); color: var(--note-ink); border-radius: var(--radius-xs);
  padding: 12px 14px; font-size: 13.5px; line-height: 1.4; margin-top: 14px;
}
.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-xs); padding: 4px; margin-top: 6px; }
.seg-btn { flex: 1; border: none; background: none; padding: 11px; border-radius: 11px; font-weight: 700; font-family: inherit; cursor: pointer; color: var(--muted); }
.seg-btn.active { background: var(--yellow); color: var(--on-yellow); }

.info-body { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-top: 8px; }
.info-body h4 { font-size: 15px; 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; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-ink); padding: 13px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 100; max-width: 90%; text-align: center; box-shadow: var(--toast-shadow);
}

/* Полноэкранные страницы («Все задания», админ-панель) */
.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-color: var(--bg); background-image: var(--bg-image);
  background-size: var(--bg-tile) var(--bg-tile); background-repeat: repeat;
}
.page-head {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
}
.page-head .page-back { position: absolute; left: 10px; }
.page-back {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--card); color: var(--ink); cursor: pointer;
  border-radius: 50%; padding: 0; box-shadow: var(--shadow);
}
.page-back:active { background: var(--row-active); }
.page-back .ic { width: 22px; height: 22px; }
.page-title { font-size: 20px; font-weight: 900; letter-spacing: -.03em; }
.modal-card.page > .chips { flex: 0 0 auto; padding: 6px 14px 10px; margin: 0; }
/* Поиск и фильтр над списком — не прокручиваются вместе с ним */
.page-tools { flex: 0 0 auto; padding: 6px 14px 0; }
.page-tools .search { margin-bottom: 10px; }
/* Вкладки «Все вакансии»: четыре штуки видны сразу, двумя рядами по две */
.page-tools .chips.chips-left {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
  margin: 0; padding: 0 0 10px; overflow: visible;
}
.page-tools .chips.chips-left .chip { text-align: center; padding: 10px 8px; }
.modal-card.page > .list {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 14px calc(24px + env(safe-area-inset-bottom));
}

/* Экран «сервис недоступен в вашей стране» */
body.geo-blocked .tabbar,
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: 22px; font-weight: 900; margin-top: 18px; letter-spacing: -.02em; }
.geo-text { font-size: 15px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; white-space: pre-line; }

/* ---------- админ-панель в приложении ---------- */
.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: 12px 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; 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); border-radius: 0; }
.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; align-items: center; }
.lnk-chips::-webkit-scrollbar { height: 0; }
.lnk-chip {
  flex: 0 0 auto; align-self: flex-start; 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(--yellow); color: var(--on-yellow); }
.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(0, 0, 0, .1); color: var(--on-yellow); }
.lnk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 8px; }
.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(0, 0, 0, .55); }
.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(0, 0, 0, .6); }
.lnk-card-code { margin: 2px 0 0 16px; font-size: 13px; }

.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-head > div:first-child { min-width: 0; }
.lnk-card-name { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.lnk-card-url { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lnk-copy {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--yellow-soft); color: var(--yellow-soft-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(--surface-2); border-radius: var(--radius-xs); padding: 14px 8px;
}
.lnk-totals.two { grid-template-columns: repeat(2, 1fr); }
.lnk-totals.two b { font-size: 18px; }
.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(--card); border-radius: 999px; padding: 4px; margin: 12px 0; box-shadow: var(--shadow); }
.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(--yellow); color: var(--on-yellow); }
.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; }
.lnk-cell em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 3px; }
.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; }
.c-blue { color: var(--blue); }
.c-green { color: #13823e; }
.c-amber { color: #b07d00; }
.c-red { color: var(--red); }
.c-purple { color: var(--purple); }
.c-muted { color: var(--ink-2); }
#adminBody { display: block; }
#adminBody > * + * { margin-top: 10px; }
#adminBody .adm-grid,
#adminBody .lnk-grid { margin-top: 10px; }

/* Текст, который лежит прямо на жёлтой текстуре фона */
.brand, .screen-title, .section-h, .page-title, .online-row { color: var(--on-bg); }
.online-cap, .hint, .legal, .task-group, .adm-note, .gv-sub,
.list > .empty, #giveawayWrap > .empty { color: var(--on-bg-muted); }
.hint { font-weight: 500; }

/* ---------- тёмная тема ----------
   Переопределяем только токены. Тему ставит app.js в data-theme на <html>;
   без него работает системная настройка. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c; --card: #1c1c1e;
    --bg-image: none;
    --on-bg: #f5f5f7; --on-bg-muted: rgba(245, 245, 247, .7); --ink: #f5f5f7; --ink-2: #c7c7cc; --muted: #8e8e93; --line: #2c2c2e;
    --dark: #2a2a2d; --tabbar-bg: #2a2a2d; --primary: #f5f5f7; --primary-soft: rgba(255, 216, 61, .14);
    --yellow-soft: rgba(255, 216, 61, .16); --yellow-soft-ink: #ffd83d;
    --surface-2: #2c2c2e; --chip-bg: #1c1c1e; --ghost-bg: #2c2c2e; --row-active: #242426;
    --input-bg: #2c2c2e; --input-bg-focus: #323235; --note-ink: #ffe27a;
    --shadow: none;
    --sum-green-bg: rgba(34, 197, 94, .16); --sum-green: #4ade80;
    --sum-yellow: #ffd83d; --sum-red-bg: rgba(255, 77, 79, .16); --sum-red: #ff7b7d;
    --badge-wait-bg: rgba(255, 216, 61, .16); --badge-wait-ink: #ffd83d;
    --badge-ok-bg: rgba(34, 197, 94, .16);   --badge-ok-ink: #4ade80;
    --badge-no-bg: rgba(255, 77, 79, .16);   --badge-no-ink: #ff7b7d;
    --streak-bg: rgba(255, 122, 26, .16);    --streak-ink: #ff9d4d; --streak-cap: #c98c5c;
    --toast-bg: #2c2c2e; --toast-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --card: #1c1c1e;
    --bg-image: none;
    --on-bg: #f5f5f7; --on-bg-muted: rgba(245, 245, 247, .7); --ink: #f5f5f7; --ink-2: #c7c7cc; --muted: #8e8e93; --line: #2c2c2e;
  --dark: #2a2a2d; --tabbar-bg: #2a2a2d; --primary: #f5f5f7; --primary-soft: rgba(255, 216, 61, .14);
  --yellow-soft: rgba(255, 216, 61, .16); --yellow-soft-ink: #ffd83d;
  --surface-2: #2c2c2e; --chip-bg: #1c1c1e; --ghost-bg: #2c2c2e; --row-active: #242426;
  --input-bg: #2c2c2e; --input-bg-focus: #323235; --note-ink: #ffe27a;
  --shadow: none;
  --sum-green-bg: rgba(34, 197, 94, .16); --sum-green: #4ade80;
  --sum-yellow: #ffd83d; --sum-red-bg: rgba(255, 77, 79, .16); --sum-red: #ff7b7d;
  --badge-wait-bg: rgba(255, 216, 61, .16); --badge-wait-ink: #ffd83d;
  --badge-ok-bg: rgba(34, 197, 94, .16);   --badge-ok-ink: #4ade80;
  --badge-no-bg: rgba(255, 77, 79, .16);   --badge-no-ink: #ff7b7d;
  --streak-bg: rgba(255, 122, 26, .16);    --streak-ink: #ff9d4d; --streak-cap: #c98c5c;
  --toast-bg: #2c2c2e; --toast-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.55);
}
:root[data-theme="dark"] .c-green { color: #4ade80; }
:root[data-theme="dark"] .c-amber { color: #ffd83d; }

/* Узкие телефоны: плитки и цифры чуть компактнее */
@media (max-width: 360px) {
  .screen-title { font-size: 30px; }
  .kpi b { font-size: 22px; }
  .kpi span, .stat-cap { font-size: 12px; }
  .stat-num { font-size: 19px; }
  .tile-title { font-size: 15px; }
  .tab { flex-basis: 44px; padding: 0 10px; font-size: 14px; }
}
