/* Stories-формат: одне завдання на весь екран, як у сторіс.
   Тема одна (темна) — це продуктовий інтерфейс, він має виглядати
   однаково у всіх, а не плавати за налаштуванням системи. */

:root {
  --bg: #06070d;
  --ink: #ffffff;
  --mut: rgba(255, 255, 255, .60);
  --mut-2: rgba(255, 255, 255, .38);
  --line: rgba(255, 255, 255, .13);
  --glass: rgba(255, 255, 255, .08);
  --glass-2: rgba(255, 255, 255, .15);
  --bolt: #ffd60a;
  --mint: #32e0a1;
  --rose: #ff6b81;
  --blue: #5b8cff;

  /* Типографіка: щільні заголовки з негативним трекінгом і жирним
     накресленням — саме це, а не сімейство, робить вигляд «дорогим». */
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body { overflow: hidden; }

.app { height: 100%; position: relative; }
.hidden { display: none !important; }
.center { text-align: center; }
.pad { padding: 0 4px; }

/* ══════════════════════════════════ STORIES ══════════════ */
.story { position: absolute; inset: 0; overflow: hidden; }

/* тло змінюється під тип завдання — кожна картка свій світ, як сторіс */
.story-bg {
  position: absolute; inset: -20%;
  transition: background 620ms cubic-bezier(.4, 0, .2, 1);
  background: radial-gradient(60% 55% at 25% 12%, #3b3fa8 0%, transparent 62%),
              radial-gradient(65% 60% at 82% 92%, #16324f 0%, transparent 60%),
              var(--bg);
}
.story-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,7,13,.5) 0%, rgba(6,7,13,0) 28%,
                                      rgba(6,7,13,.72) 78%, rgba(6,7,13,.94) 100%);
}

/* смуги прогресу, як у сторіс */
.bars {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex; gap: 4px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0;
}
.bars i {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden; display: block;
}
.bars i::after {
  content: ""; display: block; height: 100%; width: 0;
  background: #fff; border-radius: 2px;
  transition: width .45s ease;
}
/* Смужки читаються як світлофор пачки: жовта — те, що зараз перед очима,
   зелена — виконано, червона — пропущено, сіра — ще попереду. */
.bars i.now::after  { width: 100%; background: var(--bolt); }
.bars i.ok::after   { width: 100%; background: var(--mint); }
.bars i.skip::after { width: 100%; background: var(--rose); }
.bars i.wait::after { width: 100%; background: var(--blue); }
.bars i.ok   { background: rgba(50, 224, 161, .22); }
.bars i.skip { background: rgba(255, 107, 129, .22); }

/* верхній ряд: блискавки + баланс */
.hud {
  position: absolute; left: 0; right: 0;
  top: calc(24px + env(safe-area-inset-top));
  z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
}

/* Енергія = кружечки завдань. Скільки світиться — стільки завдань лишилось
   у пачці. Виконав — один згас. Це один лічильник замість двох: людині не
   треба тримати в голові окремо «енергію» й окремо «скільки ще завдань». */
.dots {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 214, 10, .3);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-family: inherit;
}
.dots-row { display: flex; gap: 4px; align-items: center; }
.dot-e {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  display: block;
  transition: background .35s, box-shadow .35s, transform .35s;
}
.dot-e.on {
  background: var(--bolt);
  box-shadow: 0 0 8px rgba(255, 214, 10, .9);
  animation: dot-pop .4s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes dot-pop { from { transform: scale(.2); } }
.dots-n {
  font-size: 17px; font-weight: 840; letter-spacing: -.03em;
  color: var(--bolt); font-variant-numeric: tabular-nums;
}
.dots.dead { border-color: var(--line); background: rgba(255, 255, 255, .06); }
.dots.dead .dots-n { color: var(--mut-2); }

.purse {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .34);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 17px;
  font-family: inherit;
  display: flex; align-items: baseline; gap: 4px;
}
.purse b {
  font-size: 22px; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.purse em { font-style: normal; font-size: 14px; color: var(--mut); font-weight: 600; }

/* таймер завдання — правий верхній кут, під балансом */
.timer {
  position: absolute; z-index: 5;
  right: 14px;
  top: calc(74px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .38);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mut);
  animation: slide-in .4s both;
}
.timer .ring { width: 16px; height: 16px; display: block; transform: rotate(-90deg); }
.timer .ring circle { fill: none; stroke-width: 3; }
.timer .ring .bg { stroke: rgba(255, 255, 255, .18); }
.timer .ring .fg { stroke: var(--mut); transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer.low { color: var(--rose); border-color: rgba(255, 107, 129, .45); }
.timer.low .ring .fg { stroke: var(--rose); }

/* зони тапу — ліворуч назад, праворуч далі */
/* Зони гортання лежать ПІД карткою (z-index 2 проти 3 у сцени), а не над
   нею. Раніше вони накривали кнопки зверху: промах на кілька пікселів повз
   кнопку зараховувався як «гортнув далі», і людина була впевнена, що
   натиснула «Перевірити», хоча завдання просто пропустилось.
   Тепер клікабельні лише кнопки — усе інше на екрані гортає. */
.tapzone { position: absolute; top: 90px; bottom: 200px; width: 30%; z-index: 2; }
.tap-l { left: 0; }
.tap-r { right: 0; }

/* сцена завдання */
.stage {
  position: absolute; inset: 0;
  z-index: 3;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 22px calc(104px + env(safe-area-inset-bottom));
  pointer-events: none;
}
/* Сама картка кліки не ловить — інакше вона з'їдала б гортання по всій
   своїй площі. Ловлять тільки кнопки. */
.slide { pointer-events: none; }
.acts, .acts .btn { pointer-events: auto; }

.slide { animation: slide-in .42s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes slide-in { from { opacity: 0; transform: translateY(22px); } }
.slide.out { animation: slide-out .2s ease-in both; }
@keyframes slide-out { to { opacity: 0; transform: translateY(-16px); } }

/* «наряднa» іконка: куля з градієнтом, ореолом і кільцем */
.orb {
  width: 104px; height: 104px;
  border-radius: 34px;
  display: grid; place-items: center;
  font-size: 46px; line-height: 1;
  margin-bottom: 22px;
  position: relative;
  background: linear-gradient(150deg, rgba(255,255,255,.26), rgba(255,255,255,.06));
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: 0 22px 50px -18px rgba(0, 0, 0, .9),
              inset 0 1px 0 rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.orb::before {
  content: ""; position: absolute; inset: -14px;
  border-radius: 46px;
  border: 1px solid rgba(255, 255, 255, .12);
  animation: halo 3.4s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.06); opacity: .16; }
}

.step {
  font-size: 12.5px; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--mut);
  margin-bottom: 12px;
}
.title {
  font-size: 33px; font-weight: 800; line-height: 1.08;
  letter-spacing: -.035em; text-wrap: balance;
  margin-bottom: 12px;
}
.desc { font-size: 15.5px; color: var(--mut); line-height: 1.5; margin-bottom: 20px; }

.fee { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.fee b {
  font-size: 52px; font-weight: 850; letter-spacing: -.045em;
  color: var(--bolt); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(255, 214, 10, .35);
}
.fee em { font-style: normal; font-size: 16px; font-weight: 600; color: var(--mut); }
/* уже зараховано — сума перестає бути обіцянкою і стає фактом */
.fee.paid b { color: var(--mint); text-shadow: 0 0 40px rgba(50, 224, 161, .3); }
.orb.ok {
  color: var(--mint);
  background: linear-gradient(150deg, rgba(50, 224, 161, .3), rgba(50, 224, 161, .07));
  border-color: rgba(50, 224, 161, .42);
}
.orb.wait { color: var(--blue); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  font-size: 12px; font-weight: 600;
  color: var(--mut); background: rgba(255, 255, 255, .09);
  border: 1px solid var(--line);
  border-radius: 9px; padding: 5px 10px;
}
.chip.hot { color: var(--bolt); border-color: rgba(255, 214, 10, .4); background: rgba(255,214,10,.11); }

/* Кнопки навмисно ширші за текстову колонку і вищі за звичайні: це головна
   дія екрана, і промахнутись повз неї не має бути можливості. */
.acts { display: grid; gap: 11px; margin: 0 -10px; position: relative; z-index: 6; }
.acts .btn { padding: 21px 20px; font-size: 17.5px; border-radius: 20px; min-height: 62px; }

/* фінальна картка пачки — великими літерами, як просив власник */
.more-t {
  font-size: 40px; font-weight: 860; line-height: 1.02;
  letter-spacing: -.045em; text-transform: uppercase;
  margin-bottom: 14px; text-wrap: balance;
}
.more-p { font-size: 15.5px; color: var(--mut); line-height: 1.5; margin-bottom: 22px; }
.more-p b { color: var(--fg); font-weight: 750; font-variant-numeric: tabular-nums; }
.more-done {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--mint);
  background: rgba(50, 224, 161, .12);
  border: 1px solid rgba(50, 224, 161, .32);
  border-radius: 999px; padding: 7px 14px; margin-bottom: 18px;
}

/* ══════════════════════════════════ КНОПКИ ═══════════════ */
.btn {
  position: relative;
  border: 0;
  border-radius: 18px;
  padding: 17px 20px;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #071022;
  background: linear-gradient(180deg, #ffffff 0%, #d9e2f5 100%);
  box-shadow: 0 12px 28px -12px rgba(255, 255, 255, .45),
              inset 0 -2px 0 rgba(0, 0, 0, .10);
  cursor: pointer;
  overflow: hidden;
  transition: transform .14s cubic-bezier(.3, 1.4, .5, 1), opacity .2s, box-shadow .2s;
}
.btn::after {           /* блік, що пробігає — робить кнопку «живою» */
  content: ""; position: absolute; top: 0; bottom: 0; width: 38%;
  left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-18deg);
  animation: sheen 4.5s ease-in-out 1.4s infinite;
}
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .4; box-shadow: none; }
.btn:disabled::after { animation: none; }
@keyframes sheen {
  0% { left: -50%; } 34%, 100% { left: 130%; }
}

.btn.soft {
  background: rgba(255, 255, 255, .12);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.btn.soft::after { display: none; }
.btn.ghost {
  background: none; color: var(--mut); box-shadow: none; font-weight: 600;
}
.btn.ghost::after { display: none; }
.btn.wide { width: 100%; }

/* ══════════════════════════════════ НАВІГАЦІЯ ════════════ */
/* Нижня панель у дусі Instagram: одна плаваюча капсула на всю ширину,
   контурні іконки без підписів і світла «пігулка» під активною вкладкою. */
.nav {
  position: fixed; z-index: 30;
  left: 14px; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(20, 22, 32, .66);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .95);
}
/* світла пігулка під активною вкладкою — як підсвітка «Home» в інсті */
.nav-pill {
  position: absolute; z-index: 0;
  top: 6px; bottom: 6px; left: 6px;
  width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .17);
  transition: transform .42s cubic-bezier(.4, 1.3, .4, 1), width .42s cubic-bezier(.4, 1.3, .4, 1);
}
.nav-b {
  position: relative; z-index: 1;
  flex: 1;
  border: 0; background: none;
  color: rgba(255, 255, 255, .55);
  display: grid; place-items: center;
  height: 50px; padding: 0;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  transition: color .28s;
}
.nav-b svg {
  width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .34s cubic-bezier(.3, 1.5, .4, 1);
}
.nav-b.on { color: var(--ink); }
.nav-b.on svg { stroke-width: 2.2; transform: scale(1.06); }

/* остання вкладка — аватар, як фото профілю в інсті */
.nav-ava {
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #071022;
  background: linear-gradient(145deg, #ffffff, #b9c8e8);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  transition: box-shadow .28s;
}
.nav-b.on .nav-ava { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

/* маленька червона крапка — «тут на тебе щось чекає» */
.ndot {
  position: absolute; right: 50%; bottom: 11px;
  margin-right: -15px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(20, 22, 32, .9);
  animation: dot-in .4s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes dot-in { from { transform: scale(0); } }

/* та сама крапка на кнопці «Поділитись» */
.btn.dotted { position: relative; }
.btn.dotted .ndot {
  right: 9px; bottom: auto; top: 9px; margin: 0;
  box-shadow: 0 0 0 2px rgba(255, 214, 10, .9);
}

/* ══════════════════════════════════ СТОРІНКИ ═════════════ */
.screen[data-screen="tasks"] { position: absolute; inset: 0; }
.page {
  position: absolute; inset: 0;
  overflow-y: auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom));
  background:
    radial-gradient(70% 40% at 15% 0%, rgba(91, 140, 255, .20), transparent 60%),
    var(--bg);
  animation: page-in .3s ease both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

.ph { font-size: 30px; font-weight: 800; letter-spacing: -.035em; margin: 4px 0 16px; }

.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 12px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.lbl { font-size: 13.5px; font-weight: 700; color: var(--mut); margin-bottom: 10px; letter-spacing: .01em; }
.sub { font-size: 14.5px; color: var(--mut); margin-top: 9px; }

.big { font-size: 46px; font-weight: 850; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.big.money em { font-style: normal; font-size: 19px; color: var(--mut); margin-left: 6px; font-weight: 650; }

/* Головна панель екрана: одне велике число, під ним підпис. Все інше
   на екрані свідомо дрібніше — щоб було видно, що тут головне. */
.hero-p { text-align: center; padding: 26px 18px 22px; position: relative; overflow: hidden; }
.hero-p > *:not(.cat) { position: relative; z-index: 1; }

/* котик у кутку: нижня частина зрізана краєм панелі — так він саме
   визирає, а не сидить наклейкою поверх */
.cat {
  position: absolute; z-index: 0;
  right: -30px; top: 6px;
  width: 96px; height: auto;
  fill: none; stroke: rgba(255, 255, 255, .3);
  stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  color: rgba(255, 255, 255, .3);
  pointer-events: none;
}
.hero-n {
  font-size: 60px; font-weight: 860; letter-spacing: -.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-n.money { color: var(--bolt); text-shadow: 0 0 44px rgba(255, 214, 10, .35); }
.hero-n em { font-style: normal; font-size: 22px; color: var(--mut); margin-left: 7px; font-weight: 700; }
.hero-l {
  font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mut-2); margin-bottom: 10px;
}
.hero-p .hero-l:last-of-type { margin: 10px 0 0; }
.hero-p .hero-n + .hero-l { margin: 10px 0 0; }

.split {
  display: flex; margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.split > div { flex: 1; display: grid; gap: 4px; }
.split > div + div { border-left: 1px solid var(--line); }
.split b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.split span { font-size: 12px; color: var(--mut-2); font-weight: 600; }

.note {
  font-size: 13px; color: var(--mut); line-height: 1.5;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}

.duo { display: flex; justify-content: space-around; margin-top: 16px; }
.duo > div { display: grid; gap: 3px; }
.duo b { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.duo span { font-size: 11.5px; color: var(--mut); }
.duo-btn { display: flex; gap: 8px; margin-top: 12px; }
.duo-btn .btn { flex: 1; padding: 14px; font-size: 15px; }

.track { height: 7px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; margin: 14px 0 2px; }
.track i { display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--bolt), var(--mint)); transition: width .6s; }

.rows { display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 11px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 15px;
  font-size: 14.5px;
  animation: row-in .32s both;
}
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } }
.row .grow { flex: 1; min-width: 0; font-weight: 550; }
.row .sm { font-size: 12px; color: var(--mut); font-weight: 400; margin-top: 2px; }
.mint { color: var(--mint); }
.mut { color: var(--mut); }
.strong { font-weight: 750; font-variant-numeric: tabular-nums; }

.link {
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  font-size: 12.5px;
  word-break: break-all;
  color: var(--blue);
  font-weight: 550;
}

.input {
  width: 100%;
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 15px;
  color: var(--ink);
  font-family: inherit; font-size: 16px; font-weight: 550;
  margin-top: 10px;
}
.input:focus { outline: none; border-color: var(--blue); }

.pills { display: flex; gap: 8px; }
.pill {
  flex: 1;
  border: 1px solid var(--line);
  background: none; color: var(--mut);
  border-radius: 14px; padding: 12px;
  font-family: inherit; font-size: 14px; font-weight: 620;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.pill.on { background: var(--glass-2); color: var(--ink); border-color: rgba(91,140,255,.55); }

.warn {
  margin-top: 12px; padding: 12px 14px;
  border-radius: 15px;
  background: rgba(255, 214, 10, .09);
  border: 1px solid rgba(255, 214, 10, .28);
  color: #ffe9a8;
  font-size: 12.5px; line-height: 1.45;
}

.kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--mut); }
.kv b { font-weight: 750; font-variant-numeric: tabular-nums; }

.ava {
  width: 76px; height: 76px; border-radius: 26px;
  margin: 0 auto 12px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #071022;
  background: linear-gradient(145deg, #ffffff, #b9c8e8);
}
.pname { font-size: 21px; font-weight: 780; letter-spacing: -.02em; }

.empty { text-align: center; color: var(--mut); font-size: 14px; padding: 30px 10px; }

/* ══════════════════════════════════ МОДАЛКИ ══════════════ */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 22px;
  background: rgba(4, 5, 11, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: fade .22s both;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: 100%; max-width: 370px; text-align: center;
  padding: 30px 22px 22px;
  border-radius: 30px;
  background: linear-gradient(170deg, rgba(38,42,68,.96), rgba(14,16,26,.97));
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, .95);
  animation: rise .42s cubic-bezier(.2, 1.1, .3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.93); } }

/* Привітання: майже прозоре скло, без піктограм — говорить сума, а не значок */
.dialog.welcome {
  background: linear-gradient(170deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  padding: 34px 24px 24px;
}
/* шапка вікна: підпис ліворуч, лічильник онлайну праворуч */
.w-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}
.w-cap {
  font-size: 12.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mut);
}
.w-t {
  font-size: 34px; font-weight: 850; line-height: 1.06;
  letter-spacing: -.04em; margin: 0 0 18px;
}
.w-sum {
  display: flex; align-items: baseline; justify-content: center; gap: 7px;
  margin-bottom: 10px;
}
.w-sum b {
  font-size: 62px; font-weight: 860; letter-spacing: -.05em;
  color: var(--bolt); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 46px rgba(255, 214, 10, .45);
  animation: sum-in .6s cubic-bezier(.2, 1.2, .3, 1) both;
}
@keyframes sum-in { from { opacity: 0; transform: translateY(14px) scale(.86); } }
.w-sum em { font-style: normal; font-size: 22px; font-weight: 700; color: var(--mut); }
.w-p { font-size: 15px; color: var(--mut); line-height: 1.5; margin: 0 0 18px; }
.w-p b { color: var(--ink); font-weight: 750; }

/* Онлайн показуємо один раз — у шапці вітання. Сам елемент нейтральний,
   зі скла: зеленою лишається тільки крапка, бо саме вона означає «живе».
   Зелена обводка навколо всього робила з підказки окремий банер. */
.w-online {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--mut); font-weight: 650;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .17);
  white-space: nowrap;
}
.w-online b {
  color: var(--ink); font-size: 12.5px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.w-online .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 9px rgba(50, 224, 161, .95);
  animation: blip 1.6s ease-in-out infinite;
}
@keyframes blip {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.76); }
}

.bolt-hero { width: 74px; height: 74px; margin: 0 auto 16px; }
.bolt-hero svg { width: 100%; height: 100%; }
.bolt-hero path { fill: var(--bolt); filter: drop-shadow(0 0 20px rgba(255,214,10,.7)); }
.bolt-hero.off path { fill: rgba(255,255,255,.2); filter: none; }
.bolt-hero.ok path { fill: var(--mint); filter: drop-shadow(0 0 20px rgba(50,224,161,.6)); }

.dt {
  font-size: 26px; font-weight: 820; line-height: 1.16;
  letter-spacing: -.035em; margin: 0 0 12px; text-wrap: balance;
}
.dt b { color: var(--bolt); }
.dp { font-size: 14.5px; color: var(--mut); margin: 0 0 20px; line-height: 1.5; }
.dp b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dialog .btn + .btn { margin-top: 9px; }

/* ══════════════════════════════════ ТОСТ ═════════════════ */
.toast {
  position: fixed; left: 50%; bottom: 108px;
  transform: translateX(-50%);
  z-index: 70; max-width: 88%;
  padding: 14px 20px; border-radius: 17px;
  background: rgba(20, 23, 38, .95);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 14.5px; font-weight: 620; text-align: center;
  box-shadow: 0 16px 40px -14px rgba(0,0,0,.9);
  animation: toast-in .3s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px) scale(.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.toast.ok { border-color: rgba(50, 224, 161, .55); }
.toast.err { border-color: rgba(255, 107, 129, .55); }

/* ══════════════════════════════════ ПОМИЛКА ══════════════ */
.fatal { max-width: 330px; margin: 0 auto; padding: 100px 22px 0; text-align: center; }
.fatal-ic { font-size: 40px; margin-bottom: 14px; }
.fatal-t { font-size: 19px; font-weight: 780; margin-bottom: 8px; letter-spacing: -.02em; }
.fatal .btn { margin-top: 20px; width: 100%; }

/* ══════════════════════════════════ АДМІНКА ══════════════ */
/* Окрема сторінка /admin. Мова та сама — темне скло, великі числа,
   заокруглення 20+ — але щільніша: тут працюють, а не милуються. */

body.admin { overflow-y: auto; overflow-x: hidden; }
.admin .app {
  height: auto; max-width: 620px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}
.admin .glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 78vw; height: 78vw; border-radius: 50%;
  filter: blur(90px); opacity: .5;
}
.admin .glow-a { top: -22vw; left: -18vw; background: radial-gradient(circle, #3b5bdb, transparent 68%); }

.admin .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin .who { display: flex; align-items: center; gap: 12px; }
.admin .ava {
  width: 46px; height: 46px; border-radius: 16px; margin: 0;
  display: grid; place-items: center; font-size: 21px;
  background: linear-gradient(145deg, rgba(255,255,255,.2), rgba(255,255,255,.07));
  border: 1px solid var(--line); color: var(--ink);
}
.admin .who-name { font-size: 21px; font-weight: 820; letter-spacing: -.03em; }
.admin .who-sub { font-size: 12.5px; }
.admin .lvl {
  border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  border-radius: 16px; padding: 9px 14px; font-family: inherit;
  display: grid; justify-items: center; gap: 1px; cursor: pointer;
}
.admin .lvl-num { font-size: 17px; font-weight: 800; }
.admin .lvl-cap { font-size: 10px; color: var(--mut); }

/* вкладки */
.admin .chips { gap: 7px; margin-bottom: 4px; }
.admin .chip {
  font-size: 14px; font-weight: 700; padding: 10px 15px; border-radius: 14px;
  color: var(--mut); font-family: inherit; cursor: pointer;
}
.admin .chip.on { color: #071022; background: #fff; border-color: transparent; }

.admin .strip-cap {
  font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mut-2); margin: 24px 2px 10px;
}

.admin .card {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 22px; padding: 16px; display: grid; gap: 10px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.admin .list { display: grid; gap: 8px; }

/* плитки статистики */
.admin .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.admin .tile {
  background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 12px; display: grid; gap: 4px; text-align: center;
}
.admin .tile b { font-size: 24px; font-weight: 840; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.admin .tile span { font-size: 10.5px; color: var(--mut-2); line-height: 1.25; }
.admin .mint { color: var(--mint); }

/* рядки списків */
.admin .row-item {
  display: flex; align-items: center; gap: 11px;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; font-size: 14.5px;
}
.admin .row-item.pending-row, .admin .row-item.review-row,
.admin .row-item.src-row { cursor: pointer; }
.admin .grow { flex: 1; min-width: 0; }
.admin .line {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.admin .line:last-child { border-bottom: 0; }
.admin .line span { color: var(--mut); }
.admin .line b { font-weight: 780; font-variant-numeric: tabular-nums; }
.admin .split { display: flex; gap: 8px; }
.admin .split > * { flex: 1; }

/* завдання */
.admin .task {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 18px; padding: 13px; cursor: pointer;
  transition: border-color .2s;
}
.admin .task:active { border-color: rgba(255,255,255,.32); }
.admin .task.off { opacity: .45; }
.admin .task-ic {
  width: 44px; height: 44px; border-radius: 15px; flex: 0 0 44px;
  display: grid; place-items: center; font-size: 21px;
  background: rgba(255,255,255,.09); border: 1px solid var(--line);
}
.admin .task-mid { flex: 1; min-width: 0; display: grid; gap: 4px; }
.admin .task-t { font-size: 16px; font-weight: 750; letter-spacing: -.015em; }
.admin .task-sub {
  font-size: 12px; color: var(--mut-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin .task-url { color: var(--blue); }
.admin .task-m { display: flex; gap: 5px; flex-wrap: wrap; }
.admin .task-m:empty { display: none; }
.admin .task-r {
  font-size: 19px; font-weight: 840; color: var(--bolt);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  letter-spacing: -.03em;
}
.admin .task-r em { font-style: normal; font-size: 12px; color: var(--mut); margin-left: 2px; }

/* смужка стану зліва: увімкнено — зелена, вимкнено — сіра */
.admin .task-state {
  flex: 0 0 3px; align-self: stretch; border-radius: 3px;
  background: rgba(255, 255, 255, .16);
}
.admin .task-state.on { background: var(--mint); }
.admin .tag.warn { color: var(--rose); border-color: rgba(255, 107, 129, .4); }
/* заголовок групи завдань — видно, яка плитка звідки береться */
.admin .group-cap {
  font-size: 12px; color: var(--mut-2); margin: 16px 2px 8px;
}
.admin .group-cap:first-child { margin-top: 2px; }
.admin .group-cap b {
  color: var(--ink); font-size: 13px; font-weight: 780;
  letter-spacing: .01em; margin-right: 2px;
}
.admin .task.just-added { border-color: rgba(50, 224, 161, .6); }
.admin .tag {
  font-size: 10.5px; font-weight: 650; color: var(--mut-2);
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  border-radius: 7px; padding: 3px 7px;
}
.admin .tag.wait { color: var(--bolt); border-color: rgba(255,214,10,.35); }

/* форми */
.admin .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.admin .fl { display: grid; gap: 7px; font-size: 12.5px; color: var(--mut); font-weight: 650; }
.admin .input { font-size: 15.5px; padding: 14px; border-radius: 14px; }
.admin textarea.input { resize: vertical; line-height: 1.45; }
.admin select.input { appearance: none; }
.admin .row2 { display: flex; gap: 8px; }
.admin .btn { padding: 15px 18px; font-size: 15.5px; border-radius: 16px; }
.admin .btn.mini { padding: 9px 13px; font-size: 13px; border-radius: 12px; }
.admin .btn.danger {
  background: linear-gradient(180deg, #ff6b6b, #d63c3c); color: #fff;
  box-shadow: 0 12px 26px -14px rgba(255, 80, 80, .8);
}
.admin .wide { width: 100%; }
.admin input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--bolt); }

/* превʼю розсилки */
.admin .tg-bubble {
  background: rgba(255,255,255,.1); border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px; padding: 13px 15px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  margin-top: 7px;
}
.admin .tg-bubble-btn {
  background: rgba(91,140,255,.2); border: 1px solid rgba(91,140,255,.4);
  border-radius: 5px 5px 16px 16px; padding: 11px; text-align: center;
  font-size: 14px; font-weight: 650; color: #cddaff;
}
.admin .bc-row { display: grid; gap: 6px; }
.admin .bc-text { font-size: 14px; line-height: 1.45; word-break: break-word; }
/* кружок стану розсилки: жовтий пульсує — йде, синій — чекає години,
   сірий — завершена або скасована */
.admin .bc-dot {
  flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); align-self: center;
}
.admin .bc-dot.run {
  background: var(--bolt);
  animation: blip 1.3s ease-in-out infinite;
}
.admin .bc-dot.plan { background: var(--blue); box-shadow: 0 0 8px rgba(91, 140, 255, .8); }
.admin .bc-row { align-items: center; }

/* джерела */
.admin .src-block { display: grid; gap: 8px; }
.admin .src-detail { display: grid; gap: 6px; margin-top: 8px; }
.admin .prof-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }

/* нижні шторки */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(3, 4, 10, .72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; align-items: flex-end;
  animation: fade .22s ease both;
}
.sheet {
  width: 100%; max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #171a26, #0b0d16);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
  display: grid; gap: 11px;
  animation: sheet-up .3s cubic-bezier(.25, 1.15, .4, 1) both;
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: .6; } }
.grip {
  width: 42px; height: 4px; border-radius: 3px; margin: 2px auto 8px;
  background: rgba(255,255,255,.26);
}
.sheet-title { font-size: 22px; font-weight: 820; letter-spacing: -.03em; }

.admin .muted { color: var(--mut); }
.admin .sm { font-size: 12.5px; line-height: 1.5; }
.admin .xl { font-size: 30px; font-weight: 850; letter-spacing: -.04em; }
.admin .strong { font-weight: 780; }
.admin .center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── тенденції в адмінці ─────────────────────────────────────── */
.admin .tr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.admin .tr-row:last-of-type { border-bottom: 0; }
.admin .tr-l { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.admin .tr-r { text-align: right; white-space: nowrap; }
.admin .tr-r b {
  font-size: 22px; font-weight: 840; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; display: block;
}
.admin .tr { font-size: 12px; font-weight: 750; }
.admin .tr.up { color: var(--mint); }
.admin .tr.down { color: var(--rose); }
.admin .tr-flat { font-size: 11.5px; color: var(--mut-2); }

/* запрошені проти органічних — головне порівняння блоку */
.admin .tr-split {
  display: flex; gap: 9px; margin: 16px 0 12px;
}
.admin .tr-q {
  flex: 1; text-align: center; padding: 15px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  display: grid; gap: 4px;
}
.admin .tr-q b {
  font-size: 26px; font-weight: 850; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.admin .tr-q span { font-size: 11.5px; color: var(--mut); line-height: 1.3; }
.admin .tr-q i { font-style: normal; }
.admin .tag.first { color: var(--bolt); border-color: rgba(255, 214, 10, .45); background: rgba(255,214,10,.1); }
