/* mr.testlead.org — redesign 1:1 from TestLead-MR-Redesign-AllInOne (MFO-only content) */

/* ─────────────────────────────────────────────────────────────────────────
   TEST LEAD · mr.testlead.org — редизайн кабинета (светлая тема, mobile-first)
   Один файл = 4 раздела (Профиль / Задания / Рефералы / Баланс), таб-бар снизу.
   Токены согласованы с TestLead-MrAuth-Redesign-v1.
   ───────────────────────────────────────────────────────────────────────── */
:root{
  --bg:#F6F6FA;
  --ink:#0C0C18;
  --ink-2:#26263A;
  --muted:#63637A;
  --faint:#A8A8BA;

  --card:#FFFFFF;
  --line:rgba(12,12,22,.09);
  --line-2:rgba(12,12,22,.16);
  --chip:rgba(12,12,22,.04);

  --purple:#7C3AED;
  --purple-soft:rgba(124,58,237,.10);
  --pink:#DB2777;
  --grad-cta:linear-gradient(135deg,#7C3AED,#9333EA 55%,#DB2777);
  --grad-brand:linear-gradient(135deg,#A855F7,#EC4899);
  --good:#059669;
  --good-bg:rgba(5,150,105,.09);
  --warn:#B45309;
  --warn-bg:rgba(180,83,9,.09);

  --cat-mfo:#059669; --cat-card:#0284C7; --cat-rko:#0D9488; --cat-bet:#C2410C; --cat-inv:#7C3AED;

  --r-md:12px; --r-lg:16px; --r-full:999px;
  --ease:cubic-bezier(.2,.7,.2,1);

  --aurora-1:radial-gradient(55% 45% at 20% 0%,rgba(168,85,247,.10),transparent 70%);
  --aurora-2:radial-gradient(45% 45% at 90% 15%,rgba(56,189,248,.06),transparent 70%);
  --aurora-3:radial-gradient(50% 55% at 60% 100%,rgba(236,72,153,.06),transparent 70%);
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);color:var(--ink);
  font-family:'Manrope',system-ui,-apple-system,sans-serif;
  font-weight:500;line-height:1.45;
  font-variant-numeric:tabular-nums;
  -webkit-font-smoothing:antialiased;
  min-height:100dvh;
}
body::before{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:var(--aurora-1),var(--aurora-2),var(--aurora-3),var(--bg);
}
:focus-visible{outline:2px solid var(--purple);outline-offset:2px;border-radius:6px}
.num{font-variant-numeric:tabular-nums}

/* ─── Каркас: центрированная мобильная колонка ──────────────────────────── */
.shell{
  position:relative;z-index:1;
  max-width:480px;margin:0 auto;
  min-height:100dvh;
  display:flex;flex-direction:column;
  padding-bottom:calc(76px + env(safe-area-inset-bottom));
}

/* ─── Шапка ──────────────────────────────────────────────────────────────── */
.app-top{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;gap:10px;
  padding:12px 18px;
  background:color-mix(in srgb,#FFFFFF 82%,transparent);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.shield{
  width:32px;height:32px;border-radius:10px;flex:0 0 32px;
  background:var(--grad-brand);
  display:grid;place-items:center;color:#fff;
  box-shadow:0 6px 16px -6px rgba(168,85,247,.5);
}
.shield svg{width:18px;height:18px}
.app-brand{font-size:14.5px;font-weight:800;letter-spacing:.04em}
.app-brand span{color:var(--muted);font-weight:600}
.app-bal{
  margin-left:auto;
  display:flex;align-items:baseline;gap:3px;
  padding:7px 13px;border-radius:var(--r-full);
  background:var(--good-bg);color:var(--good);
  font-weight:800;font-size:14px;
}
.app-bal em{font-style:normal;font-size:12px;font-weight:700}

/* ─── Страница ───────────────────────────────────────────────────────────── */
.page{padding:20px 18px 8px;display:none;flex-direction:column;gap:14px}
.page.active{display:flex}
.h1{font-size:24px;font-weight:800;letter-spacing:-.02em;margin:0}
.sub{margin:-6px 0 0;color:var(--muted);font-size:13.5px}

/* ─── Карточки ───────────────────────────────────────────────────────────── */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:16px;
  box-shadow:0 10px 30px -18px rgba(34,16,82,.14);
  display:grid;gap:12px;
}
.card h3{margin:0;font-size:15.5px;font-weight:800;letter-spacing:-.01em}
.card > *{min-width:0} /* grid-items не распирают карточку (min-width:auto) */

.list-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 0;border-bottom:1px solid var(--line);
  font-size:14px;
}
.card .list-row:last-child{border-bottom:0}
.list-row .l{color:var(--muted)}
.list-row .v{font-weight:800}
.list-row .v.good{color:var(--good)}
.badge{
  padding:4px 11px;border-radius:var(--r-full);
  background:var(--purple-soft);color:var(--purple);
  font-weight:800;font-size:12.5px;letter-spacing:.04em;
}

/* ─── Поля и кнопки ──────────────────────────────────────────────────────── */
.field{display:grid;gap:6px}
.field label{font-size:12.5px;font-weight:700;color:var(--ink-2)}
.field input{
  font:inherit;font-size:16px;color:var(--ink);
  background:var(--chip);
  border:1px solid var(--line);
  border-radius:var(--r-md);
  padding:12px 14px;min-height:48px;
  transition:border-color .15s,background .15s;
}
.field input::placeholder{color:var(--faint)}
.field input:focus{outline:none;border-color:var(--purple);background:#fff}

.btn{
  font:inherit;font-size:15px;font-weight:800;
  border:0;border-radius:var(--r-md);cursor:pointer;
  min-height:48px;padding:12px 16px;
  display:flex;align-items:center;justify-content:center;gap:8px;
  transition:transform .12s,filter .15s;
  text-decoration:none;
}
.btn:active{transform:scale(.985)}
.btn-primary{background:var(--grad-cta);color:#fff;box-shadow:0 12px 26px -10px rgba(147,51,234,.45)}
.btn-primary:hover{filter:brightness(1.06)}
.btn-ghost{background:var(--chip);color:var(--ink-2);border:1px solid var(--line)}
.btn-ghost:hover{border-color:var(--line-2)}
.btn-sm{min-height:40px;padding:9px 14px;font-size:13.5px;border-radius:10px}

/* ─── Задания ────────────────────────────────────────────────────────────── */
.task{
  display:flex;align-items:center;gap:12px;
  padding:13px 14px;
  background:var(--card);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:0 8px 24px -18px rgba(34,16,82,.14);
}
.task .logo{
  width:44px;height:44px;border-radius:12px;flex:0 0 44px;
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:14px;
}
.task .mid{flex:1;min-width:0;display:grid;gap:2px}
.task .name{font-weight:800;font-size:14.5px;letter-spacing:-.01em}
.task .meta{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.task .meta .dot{width:4px;height:4px;border-radius:50%;background:var(--faint)}
.cat{font-weight:700}
.cat[data-c="mfo"]{color:var(--cat-mfo)}
.cat[data-c="card"]{color:var(--cat-card)}
.cat[data-c="rko"]{color:var(--cat-rko)}
.cat[data-c="bet"]{color:var(--cat-bet)}
.cat[data-c="inv"]{color:var(--cat-inv)}
.task .pay{font-weight:800;font-size:15.5px;color:var(--purple);white-space:nowrap}
.task .pay em{font-style:normal;font-size:12px;margin-left:1px}
.task.locked{opacity:.62}
.lock-note{font-size:11.5px;color:var(--warn);font-weight:600}

.spend-note{
  display:inline-flex;align-items:center;gap:5px;
  font-size:11px;font-weight:700;color:var(--warn);
  background:var(--warn-bg);border-radius:7px;padding:3px 8px;
}
.ins-note{
  display:inline-flex;align-items:center;gap:5px;margin-left:6px;
  font-size:11px;font-weight:700;color:#1D4ED8;
  background:#DBEAFE;border-radius:7px;padding:3px 8px;
}

/* ─── Рефералы ───────────────────────────────────────────────────────────── */
.ref-link{
  display:flex;align-items:center;gap:8px;
  background:var(--chip);border:1px dashed var(--line-2);border-radius:var(--r-md);
  padding:11px 12px;font-size:13.5px;font-weight:600;color:var(--ink-2);
}
.ref-link code{font-family:inherit;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vr{display:grid;gap:8px}
.vr-item{
  display:flex;align-items:center;gap:10px;
  padding:11px 12px;border:1px solid var(--line);border-radius:var(--r-md);
  background:var(--chip);
}
.vr-dot{width:8px;height:8px;border-radius:50%;flex:0 0 8px}
.vr-body{flex:1;min-width:0;display:grid;gap:1px}
.vr-body b{font-size:13.5px}
.vr-sub{font-size:11.5px;color:var(--muted);line-height:1.35}
.vr-amt{font-weight:800;font-size:14.5px;white-space:nowrap}

.empty{
  display:grid;place-items:center;gap:8px;text-align:center;
  padding:26px 16px;color:var(--muted);
}
.empty svg{width:34px;height:34px;color:var(--faint)}
.empty b{color:var(--ink-2);font-size:14.5px}
.empty p{margin:0;font-size:12.5px;max-width:250px}

/* ─── Баланс ─────────────────────────────────────────────────────────────── */
.bal-hero{
  text-align:center;display:grid;gap:4px;padding:22px 16px;
  background:linear-gradient(180deg,rgba(124,58,237,.06),transparent 70%),var(--card);
}
.bal-hero .l{font-size:12.5px;font-weight:700;color:var(--muted);letter-spacing:.06em;text-transform:uppercase}
.bal-hero .v{font-size:40px;font-weight:800;letter-spacing:-.03em;line-height:1.1}
.bal-hero .v em{font-style:normal;font-size:22px;color:var(--muted)}
.bal-hero .hint{font-size:12px;color:var(--muted)}

/* ─── Нижняя навигация ───────────────────────────────────────────────────── */
.nav{
  position:fixed;bottom:0;left:0;right:0;z-index:30;
  max-width:480px;margin:0 auto;
  display:grid;grid-template-columns:repeat(4,1fr);gap:2px;
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  background:color-mix(in srgb,#FFFFFF 88%,transparent);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
}
.nav button{
  font:inherit;border:0;background:none;cursor:pointer;
  display:grid;justify-items:center;gap:3px;
  padding:7px 4px;border-radius:12px;
  font-size:11px;font-weight:700;color:var(--muted);
  min-height:52px;
  transition:background .15s,color .15s;
}
.nav button svg{width:21px;height:21px}
.nav button[aria-current="true"]{background:var(--purple-soft);color:var(--purple)}

/* ─── Motion ─────────────────────────────────────────────────────────────── */
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.page.active{animation:rise .3s var(--ease) backwards}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}


/* ─── Chat (from mock) ─────────────────────────────────────────────────── */
/* ─── Шапка: оффер + менеджер ────────────────────────────────────────────── */
.top{
  position:sticky;top:0;z-index:20;
  background:color-mix(in srgb,#FFFFFF 88%,transparent);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.top-offer{
  display:flex;align-items:center;gap:11px;
  padding:10px 14px;
}
.back{
  width:38px;height:38px;border-radius:11px;flex:0 0 38px;border:0;cursor:pointer;
  background:var(--chip);color:var(--ink-2);
  display:grid;place-items:center;
}
.back svg{width:17px;height:17px}
.offer-logo{
  width:40px;height:40px;border-radius:11px;flex:0 0 40px;
  background:linear-gradient(135deg,#F87171,#B91C1C);
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:14px;
}
.offer-mid{flex:1;min-width:0;display:grid;gap:1px}
.offer-name{font-weight:800;font-size:14.5px;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.offer-mgr{font-size:11.5px;color:var(--muted);display:flex;align-items:center;gap:5px}
.offer-mgr::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--good)}
.offer-pay{
  padding:6px 11px;border-radius:var(--r-full);
  background:var(--purple-soft);color:var(--purple);
  font-weight:800;font-size:13px;white-space:nowrap;
}

/* прогресс шагов задания */
.steps{
  display:flex;align-items:center;gap:8px;
  padding:8px 14px 10px;
  font-size:11.5px;font-weight:700;color:var(--muted);
}
.steps .bar{
  flex:1;height:4px;border-radius:2px;background:var(--chip);overflow:hidden;
}
.steps .bar i{display:block;height:100%;width:66%;border-radius:2px;background:var(--grad-cta)}
.steps b{color:var(--ink-2)}

/* ─── Лента чата ─────────────────────────────────────────────────────────── */
.feed{
  flex:1;
  display:flex;flex-direction:column;gap:10px;
  padding:16px 14px calc(150px + env(safe-area-inset-bottom));
  overflow-x:hidden;
  min-width:0;
}
.day{
  align-self:center;
  font-size:11px;font-weight:700;color:var(--faint);
  padding:4px 12px;border-radius:var(--r-full);background:var(--chip);
}

.msg{display:flex;gap:8px;max-width:min(86%,100%);min-width:0}
.msg .av{
  width:28px;height:28px;border-radius:50%;flex:0 0 28px;align-self:flex-end;
  background:var(--grad-brand);color:#fff;
  display:grid;place-items:center;font-weight:800;font-size:11px;
}
.bub{
  padding:10px 13px;border-radius:16px;
  font-size:14.5px;line-height:1.45;
  background:var(--card);border:1px solid var(--line);
  border-bottom-left-radius:6px;
  box-shadow:0 6px 18px -12px rgba(34,16,82,.16);
}
.bub b{font-weight:800}
.bub .t{display:block;font-size:10.5px;color:var(--faint);margin-top:4px;text-align:right}

.msg.me{align-self:flex-end;flex-direction:row-reverse}
.msg.me .bub{
  background:var(--grad-cta);color:#fff;border:0;
  border-bottom-left-radius:16px;border-bottom-right-radius:6px;
}
.msg.me .bub .t{color:rgba(255,255,255,.7)}

/* вложение-скриншот */
.shot{
  display:grid;gap:6px;
  width:100%;
  max-width:100%;
  min-width:0;
}
.shot .ph{
  width:100%;
  max-width:100%;
  height:auto;
  min-height:140px;
  aspect-ratio:16 / 10;
  border-radius:12px;
  background:
    linear-gradient(135deg,rgba(124,58,237,.14),rgba(219,39,119,.10)),
    repeating-linear-gradient(45deg,var(--chip) 0 8px,transparent 8px 16px);
  border:1px solid var(--line);
  display:grid;place-items:center;color:var(--muted);
  overflow:hidden;
  padding:0;
}
.shot .ph svg{width:26px;height:26px}
.shot .ph img{
  width:100%;height:100%;
  max-width:100%;
  object-fit:contain;
  background:rgba(15,23,42,.04);
  border-radius:12px;display:block;
  cursor:zoom-in;
}
.shot .cap{font-size:11.5px;color:rgba(255,255,255,.8)}

/* системные события */
.sys{
  align-self:center;text-align:center;
  display:flex;align-items:center;gap:7px;
  font-size:13px;font-weight:700;
  padding:7px 14px;border-radius:var(--r-full);
  background:var(--good-bg);color:var(--good);
  max-width:100%;
  box-sizing:border-box;
}
.sys svg{width:14px;height:14px;flex:0 0 14px}
.sys.info{background:var(--purple-soft);color:var(--purple)}
.sys.sys-block{
  align-self:stretch;
  text-align:left;
  align-items:flex-start;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  font-size:14.5px;
  font-weight:600;
  line-height:1.45;
  padding:12px 14px;
  border-radius:14px;
  white-space:normal;
  overflow:hidden;
  min-width:0;
}
.sys.sys-block:has(.instr-img),
.sys.sys-block.sys-has-media{
  flex-direction:column;
  gap:8px;
}
.sys.sys-block:has(.instr-img) > svg,
.sys.sys-block.sys-has-media > svg{display:none}
.sys.sys-block .sys-text{flex:1;min-width:0;width:100%;overflow-wrap:anywhere;word-break:break-word}
.sys.sys-block svg{margin-top:2px}
.sys-text .instr-line{margin:0 0 6px;line-height:1.45}
.sys-text .instr-line:last-child{margin-bottom:0}
.sys-text .instr-img{
  margin:10px 0;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--line);
  background:rgba(15,23,42,.04);
}
.sys-text .instr-img-open{
  display:block;width:100%;margin:0;padding:0;border:0;background:transparent;
  cursor:zoom-in;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
.sys-text .instr-img img,
.sys-text .instr-img .mr-chat-img{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  max-height:70vh; /* fallback старые WebView */
  max-height:min(62dvh, 440px);
  object-fit:contain;
  -webkit-user-select:none;
  user-select:none;
}
.sys-text .instr-img-hint{
  display:block;
  padding:6px 10px 8px;
  font-size:11px;
  font-weight:700;
  color:var(--muted);
  text-align:center;
  background:rgba(255,255,255,.55);
}
.sys-text .instr-bad{margin:4px 0;font-size:12px;color:#b45309}

/* полноэкранный просмотр фото (смартфоны) */
.mr-img-lb{
  position:fixed;inset:0;z-index:200;
  display:none;
  align-items:center;justify-content:center;
  padding:max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background:rgba(8,8,16,.92);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  box-sizing:border-box;
}
.mr-img-lb[hidden]{display:none!important}
.mr-img-lb.is-open{display:flex}
.mr-img-lb img{
  display:block;
  width:auto;height:auto;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  border-radius:10px;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
  pointer-events:none;
}
.mr-img-lb-close{
  position:absolute;
  top:max(10px, env(safe-area-inset-top));
  right:max(10px, env(safe-area-inset-right));
  width:44px;height:44px;border-radius:50%;
  border:0;background:rgba(255,255,255,.14);color:#fff;
  font-size:28px;line-height:1;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
body.mr-lb-open{overflow:hidden;touch-action:none}

/* карточка-инструкция от менеджера */
.guide{
  display:grid;gap:8px;
  padding:12px 13px;border-radius:14px;
  background:var(--card);border:1px solid var(--line);
  border-bottom-left-radius:6px;
  box-shadow:0 6px 18px -12px rgba(34,16,82,.16);
  font-size:13.5px;
}
.guide .gt{font-weight:800;font-size:13px}
.guide ol{margin:0;padding-left:18px;display:grid;gap:4px;color:var(--ink-2)}
.guide .note{
  font-size:12px;color:var(--warn);background:var(--warn-bg);
  border-radius:8px;padding:6px 9px;font-weight:600;
}

/* typing */
.typing{display:inline-flex;gap:4px;padding:12px 14px}
.typing i{width:6px;height:6px;border-radius:50%;background:var(--faint);animation:tp 1.2s infinite}
.typing i:nth-child(2){animation-delay:.15s}
.typing i:nth-child(3){animation-delay:.3s}
@keyframes tp{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}

/* ─── Низ: быстрые ответы + инпут ───────────────────────────────────────── */
.bottom{
  position:fixed;bottom:0;left:0;right:0;z-index:30;
  max-width:480px;margin:0 auto;
  background:color-mix(in srgb,#FFFFFF 92%,transparent);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
  padding:8px 12px calc(10px + env(safe-area-inset-bottom));
  display:grid;gap:8px;
}
.quick{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.quick::-webkit-scrollbar{display:none}
.quick button{
  font:inherit;font-size:12.5px;font-weight:700;color:var(--purple);
  background:#fff;border:1px solid rgba(124,58,237,.28);border-radius:var(--r-full);
  padding:8px 13px;white-space:nowrap;cursor:pointer;min-height:36px;
}
.quick button:hover{background:var(--purple-soft)}
.inrow{display:flex;align-items:flex-end;gap:8px}
.icon-btn{
  width:46px;height:46px;border-radius:13px;flex:0 0 46px;border:0;cursor:pointer;
  background:var(--chip);color:var(--ink-2);
  display:grid;place-items:center;
}
.icon-btn svg{width:20px;height:20px}
.inrow input{
  flex:1;min-width:0;
  font:inherit;font-size:16px;color:var(--ink);
  background:var(--chip);border:1px solid var(--line);border-radius:13px;
  padding:12px 14px;min-height:46px;
}
.inrow input::placeholder{color:var(--faint)}
.inrow input:focus{outline:none;border-color:var(--purple);background:#fff}
.send{
  width:46px;height:46px;border-radius:13px;flex:0 0 46px;border:0;cursor:pointer;
  background:var(--grad-cta);color:#fff;
  display:grid;place-items:center;
  box-shadow:0 10px 22px -8px rgba(147,51,234,.5);
  transition:transform .12s,filter .15s;
}
.send:hover{filter:brightness(1.06)}
.send:active{transform:scale(.95)}
.send svg{width:19px;height:19px}

/* ─── Auth (mock) ─────────────────────────────────────────────────────────── */
body.no-nav{
  display:flex;align-items:center;justify-content:center;
  padding:32px 16px;min-height:100dvh;
}
.auth{position:relative;z-index:1;width:100%;max-width:400px;display:grid;gap:18px;margin:0 auto;animation:rise .4s var(--ease) backwards}
.brand{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.brand .shield,.auth .shield{
  width:52px;height:52px;border-radius:15px;flex:none;
  background:var(--grad-brand);display:grid;place-items:center;color:#fff;
  box-shadow:0 12px 28px -8px rgba(168,85,247,.55);
}
.brand .shield svg,.auth .shield svg{width:28px;height:28px}
.brand-name{font-size:17px;font-weight:800;letter-spacing:.05em}
.brand-name span{color:var(--muted);font-weight:600}
.brand-sub{font-size:13.5px;color:var(--muted);margin-top:-4px}
.auth .card{
  border-radius:20px;padding:24px 22px;
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  box-shadow:0 24px 60px -28px rgba(34,16,82,.16);gap:14px;
}
.tabs{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:3px;background:var(--chip);border:1px solid var(--line);border-radius:var(--r-md)}
.tabs button,.tabs a.tab{
  font:inherit;font-size:13.5px;font-weight:700;color:var(--muted);
  background:none;border:0;border-radius:9px;padding:9px 6px;cursor:pointer;
  transition:background .15s,color .15s;text-decoration:none;
  display:flex;align-items:center;justify-content:center;min-height:40px;
}
.tabs button[aria-selected="true"],.tabs a.tab.on,.tabs a.tab[aria-selected="true"]{
  background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(34,16,82,.12);
}
.auth .field input{padding:13px 14px}
.auth .btn{min-height:50px;padding:13px 16px;gap:9px}
.auth .btn-primary{box-shadow:0 14px 30px -10px rgba(147,51,234,.55)}
.auth .btn-primary:hover{filter:brightness(1.07)}
.row-between{display:flex;justify-content:space-between;align-items:center;gap:10px}
.link{color:var(--purple);text-decoration:none;font-weight:600;font-size:13px}
.link:hover{text-decoration:underline}
.btn-tg{background:var(--chip);color:var(--ink);border:1px solid var(--line)}
.btn-tg:hover{border-color:var(--line-2)}
.btn-tg .tg-badge{width:24px;height:24px;border-radius:50%;background:var(--tg);display:grid;place-items:center;color:#fff;flex:0 0 24px}
.btn-tg .tg-badge svg{width:13px;height:13px}
.divider{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--muted)}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}
.foot{text-align:center;font-size:13px;color:var(--muted);display:grid;gap:8px}
.legal{font-size:13px;color:var(--faint);line-height:1.5}
.legal a{color:var(--muted)}
.auth-pane{display:grid;gap:14px}
.tg-wrap{display:grid;place-items:center;min-height:48px}

/* ─── Chat extras ─────────────────────────────────────────────────────────── */
a.back{text-decoration:none;color:inherit}
.msg,.sys,.guide-wrap{animation:rise .3s var(--ease) backwards}
.offer-logo.logo-img{object-fit:cover;padding:0;font-size:0;background:var(--chip)}
label.icon-btn{margin:0}
.chat-file-name{font-size:12px;color:var(--muted);margin:0}

@media (max-width:480px){
  .sys.sys-block{padding:12px;font-size:14px}
  .sys-text .instr-img img,
  .sys-text .instr-img .mr-chat-img{
    max-height:58vh;
    max-height:min(58dvh, 360px);
  }
  .bub{max-width:100%;min-width:0;overflow:hidden}
  .msg.me .bub.shot{padding:8px}
  .bottom{padding-left:12px;padding-right:12px}
}

/* ─── Prod wiring ─────────────────────────────────────────────────────────── */
:root{--tg:#2AABEE;--bad:#B91C1C;--success:var(--good);--safe-b:env(safe-area-inset-bottom,0px)}
.page{display:flex!important}
body.has-nav{padding-bottom:0}
body.has-nav > .shell{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
body.chat-mode > .shell{padding-bottom:0;min-height:100dvh}
body.chat-mode .app-top,body.chat-mode .nav{display:none!important}
.nav a{
  font:inherit;border:0;background:none;cursor:pointer;
  display:grid;justify-items:center;gap:3px;
  padding:7px 4px;border-radius:12px;
  font-size:11px;font-weight:700;color:var(--muted);
  min-height:52px;transition:background .15s,color .15s;text-decoration:none;
}
.nav a svg{width:21px;height:21px}
.nav a.active,.nav a[aria-current="page"],.nav a[aria-current="true"]{background:var(--purple-soft);color:var(--purple)}
.flash{padding:12px 14px;border-radius:var(--r-md);font-size:13.5px;font-weight:600}
.flash-ok{background:var(--good-bg);color:var(--good)}
.flash-err{background:rgba(185,28,28,.09);color:var(--bad)}
.muted{color:var(--muted);font-size:14.5px;line-height:1.45}
.task-actions{display:grid;gap:8px;margin:-6px 0 4px}
.task .logo.logo-img{object-fit:cover;padding:0;font-size:0;background:var(--chip)}
.h2{margin:6px 0 0;font-size:18px;font-weight:800;letter-spacing:-.02em;color:var(--ink)}
.amt{font-weight:800;white-space:nowrap}
.amt.good{color:var(--good)}
.btn-ghost:disabled{opacity:.55;cursor:default}
.prog-pick{display:grid;gap:10px}
.prog-card{
  width:100%;text-align:left;font:inherit;cursor:pointer;
  display:grid;gap:8px;padding:14px;border-radius:var(--r-lg);
  background:var(--card);border:1px solid var(--line);color:var(--ink);
  box-shadow:0 8px 24px -18px rgba(34,16,82,.14);
}
.prog-card:hover{border-color:var(--line-2)}
.prog-rates{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;padding:4px 10px;border-radius:var(--r-full);background:var(--purple-soft);color:var(--purple);font-size:12px;font-weight:700}
.info-btn{
  width:34px;height:34px;border-radius:50%;border:1px solid var(--line);
  background:var(--chip);color:var(--ink-2);font-weight:800;cursor:pointer;
}
.modal-bg{position:fixed;inset:0;z-index:80;background:rgba(12,12,22,.45);display:none;place-items:center;padding:18px}
.modal-bg.open{display:grid}
.modal{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:18px;max-width:400px;width:100%;display:grid;gap:12px;box-shadow:0 24px 60px -28px rgba(34,16,82,.28)}
.bal-wd{display:grid;gap:12px}
.bal-wd-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.bal-method{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.bal-method-btn{
  font:inherit;font-weight:800;font-size:14.5px;min-height:46px;border-radius:var(--r-md);
  border:1px solid var(--line);background:var(--chip);color:var(--muted);cursor:pointer;
}
.bal-method-btn.on{background:#fff;color:var(--ink);border-color:var(--purple);box-shadow:0 1px 4px rgba(34,16,82,.12)}
.bal-phone{display:flex;align-items:center;gap:8px;background:var(--chip);border:1px solid var(--line);border-radius:var(--r-md);padding:0 14px;min-height:48px}
.bal-phone-code{font-weight:800;color:var(--ink-2)}
.bal-phone input{border:0;background:transparent;flex:1;min-width:0;font:inherit;font-size:16px;padding:12px 0;outline:none}
.bal-hint{margin:0;font-size:12.5px}
.bal-wd[hidden],#balWithdrawForm.is-collapsed{display:none}
.btn-copied{background:var(--good-bg)!important;color:var(--good)!important;border-color:transparent!important}
.ref-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ref-head .h1{margin:0}
@media (max-width:360px){.page{padding:12px}.h1{font-size:22px}.nav a,.nav button{font-size:10px}}