/* ===== Mini App: дизайн-система =====
   Тема = акцент (data-accent: amethyst | ocean | emerald | sunset | rose | neon | graphite)
        + режим (data-theme: light | dark | black). Цвета интерфейса выводятся из трёх цветов акцента. */
@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope.woff2?v=2") format("woff2"), url("fonts/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* акцент по умолчанию — «Аметист» */
  --a1: #5b5bf0; --a2: #7c4dff; --a3: #a855f7;
  --accent-l: #6d4aff; --accent-d: #9d8bff;

  --bg: #f4f3fa;
  --bg-2: #ebe9f6;
  --surface: #ffffff;
  --surface-2: #f7f6fc;
  --text: #15122e;
  --text-2: #4a4670;
  --hint: #827fa3;
  --line: rgba(32, 24, 96, .09);
  --accent: var(--accent-l);
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --grad: linear-gradient(135deg, var(--a1) 0%, var(--a2) 55%, var(--a3) 100%);
  --hero-grad: var(--grad);
  --hero-ink: #ffffff;
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--a1) 14%, transparent), color-mix(in srgb, var(--a3) 14%, transparent));
  --glow: color-mix(in srgb, var(--a2) 32%, transparent);
  --ok: #16a34a; --ok-soft: rgba(22, 163, 74, .12);
  --warn: #d97706; --warn-soft: rgba(217, 119, 6, .13);
  --bad: #e11d48; --bad-soft: rgba(225, 29, 72, .11);
  --r: 20px; --r-md: 16px; --r-sm: 12px;
  --tab-h: 64px;
  --shadow: 0 1px 2px rgba(30, 20, 90, .05), 0 8px 24px rgba(30, 20, 90, .06);
  --shadow-lg: 0 18px 40px var(--glow);
  --spring: cubic-bezier(.28, 1.28, .5, 1);   /* мягкая пружина: лёгкий перелёт без резкого отскока */
  --ease: cubic-bezier(.22, 1, .36, 1);        /* плавное замедление */
  --out: cubic-bezier(.16, 1, .3, 1);          /* очень плавное замедление — для появления */
  --in: cubic-bezier(.5, 0, .75, 0);           /* разгон — для ухода */
  --fx-opacity: .26;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"], :root[data-theme="black"] {
  --bg: #0d0c17;
  --bg-2: #15131f;
  --surface: #17152a;
  --surface-2: #1e1b33;
  --text: #f1effe;
  --text-2: #c9c5ec;
  --hint: #918db8;
  --line: rgba(205, 196, 255, .1);
  --accent: var(--accent-d);
  --accent-soft: color-mix(in srgb, var(--accent) 17%, transparent);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
  --bad: #fb7185; --bad-soft: rgba(251, 113, 133, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --glow: color-mix(in srgb, var(--a2) 36%, transparent);
  --fx-opacity: .17;
  color-scheme: dark;
}
:root[data-theme="black"] {
  --bg: #000000;
  --bg-2: #0b0b10;
  --surface: #0f0f16;
  --surface-2: #16161f;
  --line: rgba(220, 215, 255, .09);
  --fx-opacity: .13;
}
/* Акценты */
/* Ч/Б (по умолчанию): чёрный акцент на белом, в тёмных режимах — белые кнопки с тёмным текстом */
:root[data-accent="mono"] { --a1: #3f3f46; --a2: #18181b; --a3: #000000; --accent-l: #111111; --accent-d: #fafafa;
  --glow: rgba(0, 0, 0, .22); --fx-opacity: .1; }
:root[data-accent="mono"][data-theme="dark"], :root[data-accent="mono"][data-theme="black"] {
  --a1: #ffffff; --a2: #e4e4e7; --a3: #a1a1aa; --accent-ink: #0a0a0a;
  --hero-grad: linear-gradient(135deg, #2a2a30 0%, #141417 60%, #050506 100%);
  --glow: rgba(255, 255, 255, .08); --fx-opacity: .07; }
:root[data-accent="mono"][data-theme="dark"] .hero, :root[data-accent="mono"][data-theme="black"] .hero { border: 1px solid rgba(255, 255, 255, .08); }
:root[data-accent="mono"] .chip.accent { color: var(--text); }
/* Ч/Б: нейтральные фон, текст и тени — без фиолетового оттенка базовой палитры */
:root[data-accent="mono"][data-theme="light"] { --bg: #f4f4f5; --bg-2: #e9e9ec; --surface: #ffffff; --surface-2: #f6f6f7; --text: #0a0a0b;
  --text-2: #3f3f46; --hint: #71717a; --line: rgba(9, 9, 11, .09); --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06);
  --splash-glow: rgba(0, 0, 0, .12); }
:root[data-accent="mono"][data-theme="dark"] { --bg: #0c0c0e; --bg-2: #151518; --surface: #161619; --surface-2: #1f1f23; --text: #fafafa;
  --text-2: #d4d4d8; --hint: #a1a1aa; --line: rgba(255, 255, 255, .09); }
:root[data-accent="mono"][data-theme="black"] { --bg: #000000; --bg-2: #0b0b0c; --surface: #0f0f11; --surface-2: #18181b; --text: #fafafa;
  --text-2: #d4d4d8; --hint: #a1a1aa; --line: rgba(255, 255, 255, .085); }
:root[data-accent="mono"] .tabs { box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
:root[data-accent="mono"] .seg button.active { box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-accent="mono"] .qr-panel { box-shadow: 0 10px 30px rgba(0, 0, 0, .1); }
:root[data-accent="mono"] .swatch .sw { box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
:root[data-accent="mono"] .hero.off { background: linear-gradient(135deg, #52525b, #27272a); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
/* статус подписки в Ч/Б — цветной отблеск, кольцо и точка на тёмной карточке вместо яркой заливки */
:root[data-accent="mono"] .hero.warn, :root[data-accent="mono"] .hero.bad { background: var(--hero-grad); box-shadow: 0 14px 34px rgba(0, 0, 0, .25); }
:root[data-accent="mono"] .hero.warn::before { background: radial-gradient(circle, rgba(251, 191, 36, .42), transparent 65%); }
:root[data-accent="mono"] .hero.bad::before { background: radial-gradient(circle, rgba(251, 113, 133, .42), transparent 65%); }
:root[data-accent="mono"] .hero.warn .ring .bar { stroke: #fbbf24; filter: drop-shadow(0 0 6px rgba(251, 191, 36, .55)); }
:root[data-accent="mono"] .hero.bad .ring .bar { stroke: #fb7185; filter: drop-shadow(0 0 6px rgba(251, 113, 133, .55)); }
:root[data-accent="mono"] .hero.warn .bar-line > i, :root[data-accent="mono"] .hero.warn .pill .dot { background: #fbbf24; }
:root[data-accent="mono"] .hero.bad .bar-line > i, :root[data-accent="mono"] .hero.bad .pill .dot { background: #fb7185; }
:root[data-accent="ocean"]    { --a1: #06b6d4; --a2: #2563eb; --a3: #4f46e5; --accent-l: #2563eb; --accent-d: #60a5fa; }
:root[data-accent="emerald"]  { --a1: #22c55e; --a2: #059669; --a3: #0d9488; --accent-l: #047857; --accent-d: #34d399; }
:root[data-accent="sunset"]   { --a1: #f59e0b; --a2: #f43f5e; --a3: #db2777; --accent-l: #e11d48; --accent-d: #fb7185; }
:root[data-accent="rose"]     { --a1: #f472b6; --a2: #db2777; --a3: #9333ea; --accent-l: #db2777; --accent-d: #f472b6; }
:root[data-accent="neon"]     { --a1: #22d3ee; --a2: #8b5cf6; --a3: #f472b6; --accent-l: #7c3aed; --accent-d: #67e8f9; }
:root[data-accent="graphite"] { --a1: #6b7280; --a2: #374151; --a3: #111827; --accent-l: #374151; --accent-d: #d1d5db; }
:root[data-accent="graphite"][data-theme="dark"], :root[data-accent="graphite"][data-theme="black"] { --a1: #9ca3af; --a2: #4b5563; --a3: #1f2937; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); transition: background-color .35s ease; }
html, body { margin: 0; padding: 0; color: var(--text); font: 15.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: transparent; overflow-x: hidden; }
/* экран въезжает сбоку — сдвинутые блоки не должны расширять страницу: иначе мобильный браузер на миг
   уменьшает масштаб, и всё, включая нижние вкладки, дёргается */
#app { overflow-x: clip; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
button:focus, a:focus { outline: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 26px; height: 26px; }
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---- шапка ---- */
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  color: var(--accent-ink); background: var(--grad); box-shadow: 0 6px 16px var(--glow); letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--hint); min-width: 0; }
.topbar-right span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #64748b, #334155); flex: 0 0 auto; }
.avatar.accent { background: var(--grad); color: var(--accent-ink); }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }

/* ---- контент ---- */
.view { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 6px 16px calc(var(--tab-h) + 30px + env(safe-area-inset-bottom)); }
.view > * { animation: rise .55s var(--out) backwards; }
.view[data-anim="right"] > * { animation-name: inRight; }
.view[data-anim="left"] > * { animation-name: inLeft; }
.view[data-anim="fade"] > * { animation-name: fadeIn; animation-duration: .35s; animation-timing-function: ease; }
.view[data-anim="none"] > *, .view[data-anim="none"] .grid2 > *, .view[data-anim="none"] .perks > *,
.view[data-anim="none"] .list > .item, .view[data-anim="none"] .app-row, .view[data-anim="none"] .server-row { animation: none; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; } .view > *:nth-child(4) { animation-delay: .14s; }
.view > *:nth-child(5) { animation-delay: .18s; } .view > *:nth-child(n+6) { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes inRight { from { opacity: 0; transform: translate3d(32px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes inLeft { from { opacity: 0; transform: translate3d(-32px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.9); } 100% { opacity: 1; transform: none; } }
/* ступенчатое появление плиток и строк списков */
.view .grid2 > *, .view .grid3 > *, .view .perks > * { animation: pop .6s var(--spring) backwards; }
.view .grid2 > :nth-child(2), .view .perks > :nth-child(2) { animation-delay: .06s; }
.view .grid2 > :nth-child(3), .view .perks > :nth-child(3) { animation-delay: .12s; }
.view .grid2 > :nth-child(4) { animation-delay: .18s; } .view .grid2 > :nth-child(5) { animation-delay: .24s; } .view .grid2 > :nth-child(n+6) { animation-delay: .3s; }
.view .list > .item, .view .app-row, .view .server-row { animation: rise .5s var(--out) backwards; }
.view .list > .item:nth-child(2), .view .app-row:nth-child(2), .view .server-row:nth-child(2) { animation-delay: .05s; }
.view .list > .item:nth-child(3), .view .app-row:nth-child(3), .view .server-row:nth-child(3) { animation-delay: .1s; }
.view .list > .item:nth-child(4), .view .app-row:nth-child(4), .view .server-row:nth-child(4) { animation-delay: .15s; }
.view .list > .item:nth-child(n+5), .view .app-row:nth-child(n+5), .view .server-row:nth-child(n+5) { animation-delay: .2s; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 8px 2px 16px; }
.page-title h1 { font-size: 27px; line-height: 1.15; margin: 0; letter-spacing: -.03em; font-weight: 800; }
.page-title .sub { color: var(--hint); font-size: 14px; margin-top: 4px; }
.section { display: flex; align-items: center; justify-content: space-between; margin: 24px 4px 10px; font-size: 13px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--hint); }
.card { background: var(--surface); border-radius: var(--r); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.tap { cursor: pointer; transition: transform .35s var(--out); }
.card.tap:active { transform: scale(.985); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h .t { font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--hint); } .small { font-size: 13.5px; } .tiny { font-size: 12.5px; } .center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.top { align-items: flex-start; }
.stack > * + * { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ---- герой подписки ---- */
.hero { position: relative; overflow: hidden; color: var(--hero-ink); border-radius: 26px; padding: 20px; margin-bottom: 14px;
  background: var(--hero-grad); box-shadow: var(--shadow-lg); isolation: isolate;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .7s var(--ease); }
.hero.tilting { transition: transform .12s linear; }
.hero .glare { position: absolute; inset: -50%; z-index: -1; pointer-events: none; opacity: var(--glare, 0); transition: opacity .5s ease;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .26), transparent 29%); will-change: transform;
  transform: translate3d(0, -12.5%, 0); }
.hero.tilting .glare { opacity: 1; }
.hero .sparks { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero .sparks b { position: absolute; bottom: -6px; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: 0;
  box-shadow: 0 0 6px rgba(255, 255, 255, .9); animation: spark 6s linear infinite; }
.hero .sparks b:nth-child(1) { left: 8%; animation-delay: .2s; } .hero .sparks b:nth-child(2) { left: 19%; animation-delay: 2.6s; animation-duration: 7.5s; }
.hero .sparks b:nth-child(3) { left: 31%; animation-delay: 4.1s; width: 2px; height: 2px; } .hero .sparks b:nth-child(4) { left: 44%; animation-delay: 1.3s; animation-duration: 8s; }
.hero .sparks b:nth-child(5) { left: 56%; animation-delay: 3.3s; width: 2px; height: 2px; } .hero .sparks b:nth-child(6) { left: 67%; animation-delay: .8s; animation-duration: 6.8s; }
.hero .sparks b:nth-child(7) { left: 78%; animation-delay: 5s; } .hero .sparks b:nth-child(8) { left: 89%; animation-delay: 2s; animation-duration: 7.2s; width: 2px; height: 2px; }
.hero .sparks b:nth-child(9) { left: 25%; animation-delay: 5.6s; animation-duration: 9s; } .hero .sparks b:nth-child(10) { left: 72%; animation-delay: 6.4s; animation-duration: 8.5s; }
@keyframes spark { 0% { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; } 12% { opacity: .9; }
  50% { transform: translate3d(10px, -110px, 0) scale(1); opacity: .55; } 100% { transform: translate3d(-8px, -240px, 0) scale(.4); opacity: 0; } }
/* «живой» градиент — отдельным слоем, чтобы не конфликтовать с анимацией появления карточки */
.hero .hero-bg { position: absolute; inset: -40%; z-index: -2; pointer-events: none; background: inherit;
  animation: heroShift 14s ease-in-out infinite alternate; }
@keyframes heroShift { 0% { transform: translate3d(-12%, -8%, 0) rotate(-6deg); } 100% { transform: translate3d(12%, 8%, 0) rotate(6deg); } }
.hero .shine { position: absolute; top: -20%; left: 0; width: 45%; height: 140%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .26), transparent); transform: translate3d(-160%, 0, 0) skewX(-18deg);
  animation: shine 7s cubic-bezier(.65, 0, .35, 1) 1.2s infinite; }
@keyframes shine { 0% { transform: translate3d(-160%, 0, 0) skewX(-18deg); } 22%, 100% { transform: translate3d(320%, 0, 0) skewX(-18deg); } }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; filter: blur(2px); }
.hero::before { width: 260px; height: 260px; right: -90px; top: -120px; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); }
.hero::after { width: 220px; height: 220px; left: -80px; bottom: -130px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%); }
.hero.off { background: linear-gradient(135deg, #64607f, #403c5c); box-shadow: 0 14px 34px rgba(30, 25, 60, .3); }
.hero.bad { background: linear-gradient(135deg, #e4475f, #b4237d); box-shadow: 0 14px 34px rgba(200, 30, 80, .28); }
.hero.warn { background: linear-gradient(135deg, #f59e0b, #e8590c); box-shadow: 0 14px 34px rgba(230, 120, 20, .28); }
.hero h2 { margin: 0 0 6px; font-size: 23px; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
.hero p { margin: 0 0 16px; opacity: .92; font-size: 14.5px; }
.hero .pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 800;
  background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px); }
.hero .pill .dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.hero .pill .dot::after, .chip.ok .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0;
  animation: ping 2.2s var(--out) infinite; }
.hero .pill .dot::after { background: #fff; }
@keyframes ping { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3.4); } }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-main { display: flex; align-items: center; gap: 18px; margin: 16px 0 14px; }
.ring { position: relative; width: 104px; height: 104px; flex: 0 0 auto; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(255, 255, 255, .22); }
.ring .bar { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 1.3s cubic-bezier(.2, .8, .2, 1) .15s;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55)); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .22);
  animation: spin 26s linear infinite; }
.ring .knob { position: absolute; inset: 0; transform: rotate(var(--deg, 0deg)); transition: transform 1.3s cubic-bezier(.2, .8, .2, 1) .15s; pointer-events: none; }
.ring .knob b { position: absolute; left: 50%; top: 5.8%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25), 0 0 14px 2px rgba(255, 255, 255, .7); }
.ring .knob b::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: 0; animation: knobPulse 2.4s var(--out) 1.5s infinite; }
@keyframes knobPulse { 0% { opacity: .5; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(2.6); } }
:root[data-accent="mono"] .hero.warn .ring .knob b { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .25), 0 0 14px 2px rgba(251, 191, 36, .7); }
:root[data-accent="mono"] .hero.bad .ring .knob b { background: #fb7185; box-shadow: 0 0 0 3px rgba(251, 113, 133, .25), 0 0 14px 2px rgba(251, 113, 133, .7); }
.ring .val b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ring .val span { font-size: 11.5px; opacity: .85; font-weight: 700; }
.hero-facts { display: grid; gap: 8px; min-width: 0; flex: 1; }
.fact { display: flex; align-items: center; gap: 8px; font-size: 14px; opacity: .96; min-width: 0; }
.fact svg { opacity: .85; }
.fact b { font-weight: 800; }
.hero .bar-line { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .25); overflow: hidden; margin-top: 2px; }
.hero .bar-line > i { display: block; height: 100%; background: #fff; border-radius: 6px; }
.hero .btn { background: #fff; color: #111; }
:root:not([data-accent="mono"]) .hero .btn { color: var(--accent-l); }
.hero .btn.glass { background: rgba(255, 255, 255, .18); color: #fff; }
.hero .deco { position: absolute; right: -14px; bottom: -22px; opacity: .14; z-index: -1; animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(-4deg); } }
.hero .deco svg { width: 150px; height: 150px; stroke: #fff; stroke-width: 1.4; fill: none; }

/* ---- плитки ---- */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow); }
.tile .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.tile .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.tile .l { font-size: 12.5px; color: var(--hint); line-height: 1.3; margin-top: 2px; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.perk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 10px; text-align: center; box-shadow: var(--shadow); }
.perk .ico { width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); }
.perk b { display: block; font-size: 13px; line-height: 1.25; }
.perk span { display: block; font-size: 11.5px; color: var(--hint); margin-top: 2px; line-height: 1.25; }

/* ---- кнопки ---- */
.btn, .tab, .method, .item, .icon-btn, .seg button, .admin-nav button, .swatch { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .22; transform: scale(0);
  animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 15px; border: 0;
  background: var(--grad); color: var(--accent-ink); font-size: 15px; font-weight: 800; cursor: pointer; white-space: nowrap;
  transition: transform .35s var(--out), opacity .2s ease, filter .2s ease; letter-spacing: -.005em; text-decoration: none; min-width: 0; text-overflow: ellipsis; }
.btn:active { transform: scale(.96); filter: brightness(.96); }
.btn:not(.tonal):not(.outline):not(.ghost):not(.danger):not(.ok):not(.glass) { box-shadow: 0 6px 18px var(--glow); }
.btn.block { width: 100%; }
.btn.tonal { background: var(--accent-soft); color: var(--accent); }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.sm { padding: 9px 13px; font-size: 13.5px; border-radius: 12px; }
.btn.xs { padding: 6px 10px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-row.col { flex-direction: column; }
.btn-row.col .btn, .btn-row.split .btn { width: 100%; }
.btn-row.split { display: grid; grid-template-columns: 1fr 1fr; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.icon-btn { transition: transform .35s var(--out), color .2s ease, border-color .2s ease; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.done { color: var(--ok); border-color: var(--ok); animation: pop .35s var(--spring); }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 14.5px; font-weight: 700; padding: 0; cursor: pointer; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--accent); font-size: 15px; font-weight: 700; padding: 4px 0 12px; cursor: pointer; }

/* ---- чипы ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap;
  background: color-mix(in srgb, var(--hint) 15%, transparent); color: var(--text-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.grad { background: var(--grad); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: 0 0 auto; }
.chip.ok .dot { position: relative; }

/* ---- подключение ---- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 14px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 1 0; min-width: max-content; padding: 9px 10px; border-radius: 11px; border: 0; background: transparent; color: var(--hint);
  font-size: 13.5px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: background-color .3s ease, color .3s ease, box-shadow .3s ease; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 10, 80, .12); }
/* в тёмных режимах фон «таблетки» и активный сегмент почти одного цвета — выделяем активный явно */
:root[data-theme="dark"] .seg:not(.pills) button.active, :root[data-theme="black"] .seg:not(.pills) button.active { background: color-mix(in srgb, var(--text) 13%, var(--surface)); }
.seg.pills { background: transparent; padding: 2px 0 10px; gap: 6px; margin-bottom: 4px; }
.seg.pills button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); }
.seg.pills button.active { background: var(--text); color: var(--bg); border-color: var(--text); box-shadow: none; }
.app-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.app-row:first-child { border-top: 0; padding-top: 2px; }
.app-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; flex: 0 0 auto; }
.app-row .a-main { flex: 1; min-width: 0; }
.app-row .a-t { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .a-s { color: var(--hint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-panel { background: #fff; border-radius: 22px; padding: 10px; margin: 2px auto 12px; width: min(100%, 280px); box-shadow: 0 10px 30px rgba(40, 30, 120, .12); }
.qr-panel img { display: block; width: 100%; height: auto; border-radius: 14px; opacity: 0; transform: scale(.92);
  transition: opacity .5s ease, transform .6s var(--spring); }
.qr-panel img.loaded { opacity: 1; transform: none; }
.linkbox { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border-radius: 14px; padding: 10px 10px 10px 14px; margin: 6px 0 4px; }
.linkbox .mono { flex: 1; min-width: 0; }
.server-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.server-row:first-child { border-top: 0; padding-top: 0; }
.server-row .flag { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); font-size: 19px; flex: 0 0 auto; }
.server-row .s-main { flex: 1; min-width: 0; font-weight: 700; }
.server-row .s-sub { color: var(--hint); font-size: 12.5px; font-weight: 500; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 4px 0 0; }
.steps li { position: relative; padding-left: 44px; margin-bottom: 14px; font-size: 14.5px; }
.steps li:last-child { margin-bottom: 2px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; background: var(--grad); color: var(--accent-ink); font-weight: 800; font-size: 13.5px; }
.steps li b { display: block; }
.steps li span { color: var(--hint); font-size: 13.5px; }

/* ---- тарифы ---- */
.tariff { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; }
.tariff.best { border: 1px solid transparent; box-shadow: var(--shadow-lg); }
/* бегущая рамка — псевдоэлементом с маской, чтобы не мешать анимации появления */
.tariff.best > .best-border { position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none; overflow: hidden;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.tariff.best > .best-border::before { content: ""; position: absolute; left: 50%; top: 50%; width: 120%; aspect-ratio: 1; margin-left: -60%;
  transform: translateY(-50%) rotate(0deg); background: conic-gradient(var(--a1), var(--a2), var(--a3), var(--a1));
  animation: spinBest 5s linear infinite; will-change: transform; }
@keyframes spinBest { to { transform: translateY(-50%) rotate(360deg); } }
.tariff .t-main { flex: 1; min-width: 0; }
.tariff .t-name { font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; }
.tariff .t-sub { color: var(--hint); font-size: 13px; margin-top: 3px; }
.tariff .t-price { text-align: right; flex: 0 0 auto; }
.tariff .rub { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.tariff .per { color: var(--hint); font-size: 12px; }
.tariff .stars { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 12px; font-weight: 800; color: var(--warn);
  background: var(--warn-soft); padding: 2px 7px; border-radius: 99px; }
.tariff .badge { position: absolute; top: -10px; left: 16px; }
.method { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; transition: transform .1s; }
.method:active { transform: scale(.985); }
.method.primary { border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
.method .m-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.method .m-t { font-weight: 800; font-size: 15px; }
.method .m-s { color: var(--hint); font-size: 12.5px; }
.method .m-p { margin-left: auto; font-weight: 800; white-space: nowrap; font-size: 16px; }

/* ---- формы ---- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--hint); margin-bottom: 6px; font-weight: 700; }
input, textarea, select { width: 100%; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 100px; resize: vertical; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px;
  box-shadow: var(--shadow); margin-bottom: 12px; color: var(--hint); }
.search input { border: 0; background: transparent; padding: 12px 0; box-shadow: none; }
.search input:focus { box-shadow: none; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: 0 0 auto; }

/* ---- списки ---- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item { transition: background-color .25s ease; }
.item:active { background: var(--accent-soft); transition-duration: 0s; }
.item .i-main { flex: 1; min-width: 0; }
.item .i-t { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .i-s { color: var(--hint); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .i-r { color: var(--hint); font-size: 13px; text-align: right; flex: 0 0 auto; }
.item .chev { color: var(--hint); }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 14px; font-size: 14px; }
.kv > div:nth-child(odd) { color: var(--hint); }
.kv > div:nth-child(even) { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* ---- чат ---- */
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; padding: 4px 0; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--grad); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.admin { align-self: flex-start; background: var(--bg-2); border-bottom-left-radius: 5px; }
.msg .time { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }

/* ---- разное ---- */
details.acc { border-top: 1px solid var(--line); }
details.acc:first-of-type { border-top: 0; }
details.acc summary { list-style: none; cursor: pointer; padding: 13px 0; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--hint); border-bottom: 2px solid var(--hint); transform: rotate(45deg); transition: transform .35s var(--out); margin-right: 4px; flex: 0 0 auto; }
details.acc[open] summary::after { transform: rotate(-135deg); }
details.acc .acc-body { padding: 0 0 14px; }
details.acc[open] > :not(summary) { animation: accIn .45s var(--out); }
@keyframes accIn { from { opacity: 0; transform: translate3d(0, -6px, 0); } }
.content-html { line-height: 1.6; white-space: pre-wrap; font-size: 14.5px; }
.content-html img { max-width: 100%; border-radius: 14px; }
.empty { text-align: center; padding: 30px 12px; color: var(--hint); }
.empty .e-ico { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 20px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); font-size: 28px; }
.empty .e-t { color: var(--text); font-weight: 800; font-size: 16.5px; margin-bottom: 4px; }
.skeleton { position: relative; overflow: hidden; border-radius: var(--r); height: 92px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translate3d(-100%, 0, 0);
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent); animation: shimmer 1.4s cubic-bezier(.45, 0, .55, 1) infinite; }
.skeleton.hero-s { height: 230px; border-radius: 26px; }
@keyframes shimmer { to { transform: translate3d(100%, 0, 0); } }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 11px 13px; font-size: 13.5px; background: var(--warn-soft);
  color: color-mix(in srgb, var(--warn) 75%, var(--text)); margin-bottom: 12px; }
.notice.info { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice svg { margin-top: 1px; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.progress { height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; margin: 10px 0 4px; }
.progress > i { display: block; height: 100%; border-radius: 8px; background: var(--grad); }
.progress > i.warn { background: var(--warn); } .progress > i.bad { background: var(--bad); }

/* ---- нижние вкладки ---- */
.tabs { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 520px);
  height: var(--tab-h); display: flex; padding: 6px; gap: 2px; border-radius: 22px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px);
  box-shadow: 0 10px 30px rgba(20, 10, 70, .16); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 800;
  color: var(--hint); background: none; border: 0; cursor: pointer; border-radius: 16px; transition: color .25s; z-index: 1; }
.tab svg.i { width: 22px; height: 22px; transition: transform .45s var(--spring); }
.tab.active { color: var(--accent); }
.tab.active svg.i { transform: translateY(-1px) scale(1.12); }
.tab-ind { position: absolute; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 16px; background: var(--accent-soft); z-index: 0; transform-origin: 0 50%; will-change: transform;
  transition: transform .5s var(--spring), width .5s var(--spring); }
.tabs.no-anim .tab-ind { transition: none; }

/* ---- шторка и тост ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 15; display: flex; align-items: flex-end; justify-content: center; }
/* затемнение — отдельным слоем: проявляется только оно, а шторка выезжает уже непрозрачной */
.sheet-wrap::before { content: ""; position: absolute; inset: 0; background: rgba(10, 6, 30, .45); animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: relative; z-index: 1; background: var(--surface); border-radius: 26px 26px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); width: 100%; max-width: 680px; max-height: 92vh; overflow: auto;
  animation: up .5s var(--out); }
@keyframes up { from { transform: translate3d(0, 100%, 0); } to { transform: none; } }
.sheet .handle { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 6px auto 16px; }
.sheet h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; font-weight: 800; }
.sheet .sub { color: var(--hint); font-size: 14px; margin-bottom: 16px; }
.success-ico { width: 74px; height: 74px; border-radius: 24px; margin: 6px auto 12px; display: grid; place-items: center; background: var(--grad); color: var(--accent-ink);
  box-shadow: var(--shadow-lg); animation: pop .6s var(--spring) both; }
.success-ico svg { width: 38px; height: 38px; stroke-width: 2.6; }
.success-ico svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .55s ease-out .35s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1d1838; color: #fff;
  padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 700; z-index: 30; max-width: 90%; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: toastIn .5s var(--out); }
@keyframes toastIn { from { opacity: 0; transform: translate3d(-50%, 18px, 0) scale(.94); } to { opacity: 1; transform: translate3d(-50%, 0, 0); } }
.toast.out { animation: toastOut .3s var(--in) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translate3d(-50%, 10px, 0) scale(.96); } }
.toast.error { background: var(--bad); }
.toast.ok { background: #16a34a; }

/* ---- админка ---- */
.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 2px; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 800; cursor: pointer; }
.admin-nav button.active { background: var(--grad); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 16px var(--glow); }
.stat-big { display: flex; align-items: baseline; gap: 8px; }
.stat-big b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }

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

/* ---- узкие экраны (iPhone SE, маленькие Android) ---- */
@media (max-width: 380px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 8px 12px; }
  .topbar-right span { display: none; }
  .hero { padding: 16px; border-radius: 22px; }
  .hero-main { gap: 12px; margin: 12px 0 12px; }
  .ring, .ring svg { width: 84px; height: 84px; }
  .ring .val b { font-size: 25px; }
  .fact { font-size: 13px; gap: 6px; }
  .btn { padding: 12px 12px; font-size: 14px; gap: 6px; }
  .btn-row.split { gap: 6px; }
  .card { padding: 15px; }
  .seg button { padding: 8px 6px; font-size: 12.5px; }
  .page-title h1 { font-size: 24px; }
  .perks { gap: 6px; }
  .perk { padding: 10px 6px; }
  .perk b { font-size: 12px; }
  .app-row { gap: 10px; }
  .app-ico { width: 38px; height: 38px; border-radius: 12px; }
  .app-row .btn.sm { padding: 8px 10px; }
  .tariff { gap: 10px; padding: 14px 12px 14px 14px; }
  .tariff .rub { font-size: 19px; }
  .swatches { gap: 6px; }
  .swatch { font-size: 10.5px; padding: 8px 2px 6px; }
  .swatch .sw { width: 32px; height: 32px; }
  .kv { grid-template-columns: minmax(90px, auto) 1fr; font-size: 13.5px; }
  .tab { font-size: 10px; }
  .tabs { width: calc(100% - 16px); }
}

/* ---- живой фон ---- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx i { position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%; opacity: var(--fx-opacity); will-change: transform;
  transition: background .6s ease; }
.bg-fx i:nth-child(1) { background: radial-gradient(circle, var(--a1) 0%, transparent 60%); top: -45vmax; left: -35vmax; animation: drift1 24s ease-in-out infinite alternate; }
.bg-fx i:nth-child(2) { background: radial-gradient(circle, var(--a3) 0%, transparent 60%); top: 15vh; right: -48vmax; animation: drift2 30s ease-in-out infinite alternate; }
.bg-fx i:nth-child(3) { background: radial-gradient(circle, var(--a2) 0%, transparent 60%); bottom: -55vmax; left: -10vmax; animation: drift3 36s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(22vw, 16vh, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-26vw, 10vh, 0) scale(.9); } }
@keyframes drift3 { to { transform: translate3d(18vw, -20vh, 0) scale(1.2); } }
:root[data-fx="off"] .bg-fx { display: none; }

/* ---- конфетти ---- */
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }

/* ---- оформление ---- */
.top-btn { width: 34px; height: 34px; border-radius: 11px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { border: 2px solid transparent; border-radius: 16px; padding: 10px 4px 8px; background: var(--surface-2); cursor: pointer; text-align: center;
  font-size: 11.5px; font-weight: 800; color: var(--text-2); transition: border-color .2s, transform .2s var(--spring); }
.swatch:active { transform: scale(.94); }
.swatch .sw { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 6px; color: #fff;
  box-shadow: 0 6px 14px rgba(20, 10, 60, .2); transition: transform .35s var(--spring); }
.swatch .sw svg { opacity: 0; transform: scale(.4); transition: all .3s var(--spring); }
.swatch.active { border-color: var(--accent); color: var(--text); }
.swatch.active .sw { transform: scale(1.08); }
.swatch.active .sw svg { opacity: 1; transform: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.switch { width: 50px; height: 30px; border-radius: 99px; border: 0; background: color-mix(in srgb, var(--text) 15%, transparent); position: relative; cursor: pointer; flex: 0 0 auto;
  transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .35s var(--spring); }
.switch.on { background: var(--grad); }
.switch.on::after { transform: translateX(20px); background: var(--accent-ink); }
.theme-preview { display: flex; gap: 6px; margin: 2px 0 14px; }
:root[data-accent="mono"] .link-btn, :root[data-accent="mono"] .content-html a { text-decoration: underline; text-underline-offset: 3px; }
.theme-preview i { flex: 1; height: 8px; border-radius: 8px; background: var(--grad); }
.theme-preview i:nth-child(2) { background: var(--accent-soft); }
.theme-preview i:nth-child(3) { background: var(--surface-2); border: 1px solid var(--line); }

/* ---- тарифы: устройства и промокод ---- */
.devices-pick { padding: 14px 16px; }
.devices-pick .seg button { display: flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 800; font-size: 15px; }
.devices-pick .seg button small { font-size: 10.5px; font-weight: 700; color: var(--hint); }
.devices-pick .seg button.active small { color: var(--text-2); }
.tariff .rub s.old, .method .m-p s.old { font-size: .62em; font-weight: 700; color: var(--hint); margin-right: 3px; }
.notice.promo-on { align-items: center; }
.notice.promo-on > div { flex: 1; }
.notice.promo-on .link-btn { color: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.promo-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 2px; padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--text) 22%, transparent); border-radius: 16px; background: transparent; color: var(--text-2);
  font-weight: 700; font-size: 14px; cursor: pointer; }
.promo-link:active { transform: scale(.985); }

/* ---- устройства ---- */
.dev-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dev-row:first-of-type { border-top: 0; padding-top: 2px; }
.dev-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); color: var(--text); flex: 0 0 auto; }
.dev-row .d-main { flex: 1; min-width: 0; }
.dev-row .d-t { font-weight: 800; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-row .d-s { color: var(--hint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skeleton.line { height: 44px; margin: 4px 0 0; border-radius: 12px; }
.ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }

/* ---- аналитика ---- */
.section .seg.mini { margin: 0; padding: 3px; gap: 2px; border-radius: 11px; text-transform: none; letter-spacing: 0; }
.section .seg.mini button { padding: 5px 9px; font-size: 12px; border-radius: 9px; flex: 0 0 auto; min-width: 0; }
.stat-mid { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }
.chart-tip { font-size: 12.5px; color: var(--text-2); margin: 12px 0 6px; min-height: 18px; }
.chart { display: block; width: 100%; height: 110px; }
.chart rect { fill: var(--a2); opacity: .85; cursor: pointer; transition: opacity .2s; }
.chart rect.zero { fill: var(--line); opacity: 1; }
.chart rect.sel { opacity: 1; fill: var(--accent); }
.fn-row { margin: 10px 0; }
.fn-row:first-of-type { margin-top: 0; }
.fn-bar { height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; margin-top: 5px; }
.fn-bar > i { display: block; height: 100%; border-radius: 8px; background: var(--grad); transition: width .8s var(--ease); }

/* ---- промокоды, устройства в тарифах, команда ---- */
.promo-code { font-size: 18px; font-weight: 800; letter-spacing: .04em; word-break: break-all; }
/* варианты устройств — компактная таблица: заголовки один раз, строка = устройств · наценка · цена · убрать */
.plan-head, .plan-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px 34px; gap: 8px; align-items: center; }
.plan-head { margin: 12px 2px 6px; font-size: 11.5px; font-weight: 800; color: var(--hint); text-transform: uppercase; letter-spacing: .04em; }
.plan-head span:nth-child(3) { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-row { margin-bottom: 8px; animation: rise .45s var(--out) backwards; }
.plan-row input { padding: 10px 12px; }
.plan-row .plan-price { font-weight: 800; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.icon-btn.sm-btn { width: 34px; height: 34px; border-radius: 10px; }
.dim { opacity: .55; transition: opacity .3s ease; }

/* ---- приветствие при открытии ---- */
/* Всё движение — только transform и opacity: их считает видеокарта, поэтому анимация не дёргается, даже пока грузятся данные */
.splash { --s-out: cubic-bezier(.16, 1, .3, 1); --s-pop: cubic-bezier(.2, 1.3, .4, 1); --s-io: cubic-bezier(.65, 0, .35, 1);
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--bg); overflow: hidden;
  transition: opacity .45s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash.gone { display: none; }
.splash.leaving { pointer-events: none; }
.splash-glow { position: absolute; left: 50%; top: 42%; width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; border-radius: 50%;
  background: radial-gradient(circle, var(--splash-glow, var(--glow)) 0%, transparent 62%);
  animation: glowIn 1.6s var(--s-out) both, splashGlow 4s ease-in-out 1.6s infinite alternate; }
@keyframes glowIn { from { opacity: 0; transform: scale(.5); } to { opacity: .9; transform: none; } }
@keyframes splashGlow { from { opacity: .9; transform: none; } to { opacity: .6; transform: scale(1.1); } }
.splash-inner { position: relative; text-align: center; max-width: 320px; }
/* значок: мягко «всплывает», потом еле заметно покачивается, пока идёт загрузка */
.splash-badge { position: relative; width: 84px; height: 84px; margin: 0 auto 40px; animation: badgeFloat 3.6s ease-in-out 1.1s infinite alternate; }
@keyframes badgeFloat { to { transform: translateY(-5px); } }
.splash-logo { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 26px; overflow: hidden;
  background: var(--hero-grad); color: var(--hero-ink); font-weight: 800; font-size: 28px; letter-spacing: -.03em;
  box-shadow: 0 16px 40px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .14); animation: badgeIn 1s var(--s-pop) .05s both; }
.splash.ready .splash-logo { animation: badgeIn 1s var(--s-pop) .05s both, readyPop .6s var(--s-out); }
@keyframes badgeIn { from { opacity: 0; transform: translateY(18px) scale(.55) rotate(-10deg); } 45% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes readyPop { 35% { scale: 1.07; } }
.splash-logo::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 50%; transform: translateX(-170%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: badgeShine 1.2s var(--s-io) .75s both; }
@keyframes badgeShine { from { transform: translateX(-170%) skewX(-20deg); } to { transform: translateX(300%) skewX(-20deg); } }
:root[data-accent="mono"][data-theme="dark"] .splash-logo, :root[data-accent="mono"][data-theme="black"] .splash-logo { border: 1px solid rgba(255, 255, 255, .1); }
.splash-time { position: absolute; right: -10px; bottom: -10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: splashPop .7s var(--s-pop) .5s backwards; }
.splash-time svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.splash-time svg.sun { animation: splashSpin 10s linear infinite; }
.splash-time svg.sunset { animation: splashBob 2.4s ease-in-out infinite; }
.splash-time svg.moon { animation: splashRock 3s ease-in-out infinite; transform-origin: 50% 60%; }
.splash-time svg .st { animation: splashSteam 1.8s ease-in-out infinite; }
.splash-time svg .st:nth-child(2) { animation-delay: .3s; } .splash-time svg .st:nth-child(3) { animation-delay: .6s; }
.splash-time svg .tw { animation: splashTwinkle 1.6s ease-in-out infinite; transform-origin: 20px 5px; }
.splash-hello { font-size: 16px; font-weight: 700; color: var(--text-2); min-height: 1.45em; }
.splash-hello:not(:has(.ch)) { animation: splashUp .8s var(--s-out) .3s backwards; }
.splash-hello .ch { display: inline-block; white-space: pre; animation: chIn .8s var(--s-out) backwards; }
.splash-name { margin-top: 2px; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  background: linear-gradient(100deg, var(--text) 35%, color-mix(in srgb, var(--text) 35%, transparent) 50%, var(--text) 65%) 120% 0 / 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: nameIn 1s var(--s-out) .6s backwards, nameShine 1.8s var(--s-io) 1.3s both; }
.splash-name.long { font-size: 24px; }
.splash-name:empty { display: none; }
.splash-sub { min-height: 1.45em; margin-top: 10px; font-size: 14px; color: var(--hint); animation: splashUp .8s var(--s-out) .85s backwards;
  transition: opacity .25s ease; }
.splash-sub.typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor;
  animation: caret .7s steps(1) infinite; }
.splash-sub.swap { opacity: 0; }
/* полоса загрузки: бегущий отрезок, а когда данные пришли — плавное заполнение слева направо */
.splash-bar { position: relative; width: 132px; height: 4px; margin: 22px auto 0; border-radius: 4px; overflow: hidden;
  background: color-mix(in srgb, var(--text) 10%, transparent); animation: splashUp .8s var(--s-out) .95s backwards; }
.splash-bar i, .splash-bar::after { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: linear-gradient(90deg, var(--a1), var(--a3)); }
.splash-bar i { width: 40%; animation: splashLoad 1.4s var(--s-io) infinite; transition: opacity .3s ease; }
.splash-bar::after { content: ""; right: 0; transform: scaleX(0); transform-origin: 0 50%; }
:root[data-accent="mono"] .splash-bar i, :root[data-accent="mono"] .splash-bar::after { background: var(--text); }
.splash.ready .splash-bar i { opacity: 0; }
.splash.ready .splash-bar::after { transform: none; transition: transform .8s var(--s-out); }
@keyframes splashPop { from { opacity: 0; transform: scale(.4) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes chIn { from { opacity: 0; transform: translate3d(0, .5em, 0) scale(.85); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes nameIn { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes nameShine { from { background-position: 120% 0; } to { background-position: -20% 0; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes splashUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes splashSpin { to { transform: rotate(360deg); } }
@keyframes splashBob { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-2px); } }
@keyframes splashRock { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } }
@keyframes splashSteam { 0%, 100% { opacity: .2; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-1.5px); } }
@keyframes splashTwinkle { 0%, 100% { opacity: .35; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes splashLoad { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
/* приветствие: сцена по времени суток, частицы, пульс логотипа, уход */
#splash-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.splash-sky { position: absolute; inset: 0; pointer-events: none; animation: fadeIn 1.4s ease backwards; }
.splash[data-tod="morning"] .splash-sky { background: radial-gradient(120% 55% at 50% 112%, rgba(255, 176, 102, .30), transparent 62%),
  radial-gradient(60% 40% at 80% 0%, rgba(255, 214, 165, .12), transparent 70%); }
.splash[data-tod="day"] .splash-sky { background: radial-gradient(90% 55% at 50% -12%, rgba(255, 233, 160, .26), transparent 64%); }
.splash[data-tod="evening"] .splash-sky { background: radial-gradient(130% 55% at 50% 115%, rgba(255, 110, 80, .26), transparent 60%),
  radial-gradient(90% 50% at 50% -10%, rgba(130, 100, 255, .16), transparent 66%); }
.splash[data-tod="night"] .splash-sky { background: radial-gradient(70% 45% at 78% 8%, rgba(150, 170, 255, .18), transparent 66%),
  radial-gradient(120% 60% at 50% 120%, rgba(60, 70, 140, .18), transparent 60%); }
/* лучи: слой поменьше прежнего (меньше памяти видеокарты), видимая часть та же */
.splash-rays { position: absolute; left: 50%; top: 42%; width: 104vmax; height: 104vmax; margin: -52vmax 0 0 -52vmax; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--text) 6%, transparent) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle closest-side, #000 0%, rgba(0, 0, 0, .5) 38%, transparent 100%);
  mask: radial-gradient(circle closest-side, #000 0%, rgba(0, 0, 0, .5) 38%, transparent 100%);
  animation: fadeIn 1.8s ease .2s backwards, spin 70s linear infinite; }
.splash[data-tod="morning"] .splash-rays, .splash[data-tod="day"] .splash-rays { display: block; }
.splash[data-tod="evening"] .splash-rays, .splash[data-tod="night"] .splash-rays { display: none; }
/* «готово»: от значка расходятся два кольца (класс ready ставится не раньше, чем значок появился) */
.splash-badge .pulse { position: absolute; inset: 0; border-radius: 26px; border: 2px solid color-mix(in srgb, var(--text) 30%, transparent);
  pointer-events: none; opacity: 0; }
.splash.ready .splash-badge .pulse { animation: badgePulse 1.4s var(--s-out); }
.splash.ready .splash-badge .pulse.p2 { animation-delay: .22s; }
@keyframes badgePulse { from { opacity: .8; transform: none; } to { opacity: 0; transform: scale(2.2); } }
/* уход: тексты тают, логотип по дуге перелетает в шапку, приветствие растворяется, а приложение поднимается навстречу */
.splash.leaving .splash-logo { visibility: hidden; }
.splash-ghost { position: fixed; z-index: 60; display: grid; place-items: center; pointer-events: none; overflow: hidden; border-radius: 26px;
  background: var(--hero-grad); color: var(--hero-ink); font-weight: 800; font-size: 28px; letter-spacing: -.03em; box-shadow: 0 16px 40px var(--glow);
  will-change: transform; }
.splash-ghost i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; border-radius: inherit; }
.splash-ghost .to { background: var(--grad); color: var(--accent-ink); letter-spacing: -.02em; opacity: 0; }
.land-ring { position: fixed; z-index: 59; pointer-events: none; border-radius: 10px; border: 2px solid color-mix(in srgb, var(--text) 40%, transparent); }
:root[data-motion="off"] #splash-fx, :root[data-motion="off"] .splash-rays, :root[data-motion="off"] .splash-badge .pulse { display: none; }
/* пока приветствие на экране — приложение под ним не «мелькает» анимациями */
html.booting { overflow: hidden; }
html.booting .tabs { opacity: 0; }
.tabs:empty { display: none; }
.tabs { transition: opacity .4s ease; }
:root[data-motion="off"] .splash-bar i { animation: none !important; width: 100%; opacity: .35; }
/* первый экран после приветствия: блоки поднимаются по очереди, пока приветствие растворяется */
.view[data-anim="boot"] > * { animation: bootRise .85s cubic-bezier(.16, 1, .3, 1) .1s backwards; }
.view[data-anim="boot"] > :nth-child(2) { animation-delay: .17s; } .view[data-anim="boot"] > :nth-child(3) { animation-delay: .24s; }
.view[data-anim="boot"] > :nth-child(4) { animation-delay: .31s; } .view[data-anim="boot"] > :nth-child(n+5) { animation-delay: .38s; }
.view[data-anim="boot"] .grid2 > *, .view[data-anim="boot"] .grid3 > *, .view[data-anim="boot"] .perks > *, .view[data-anim="boot"] .list > .item,
.view[data-anim="boot"] .app-row, .view[data-anim="boot"] .server-row { animation: none; }
@keyframes bootRise { from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- страна сервера ---- */
.country-row { display: flex; gap: 10px; align-items: center; }
.country-row select { flex: 1; min-width: 0; }
.flag-big { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; line-height: 1;
  background: var(--bg-2); flex: 0 0 auto; color: var(--hint); }

/* ---- предпросмотр подписки «как в Happ» ---- */
.happ-pv { border-radius: 22px; padding: 14px 14px 10px; margin-bottom: 12px; background: #0f1115; color: #f4f4f5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .06); }
.pv-head { display: flex; gap: 12px; align-items: flex-start; padding: 2px 2px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.pv-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #3f3f46, #18181b);
  flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .1); }
.pv-title { font-weight: 800; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-desc { font-size: 12.5px; color: #a1a1aa; margin-top: 3px; line-height: 1.35; overflow-wrap: anywhere; }
.pv-desc:empty::before { content: "без описания"; opacity: .6; }
.pv-srv { display: flex; align-items: center; gap: 10px; padding: 9px 2px; font-size: 14px; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.pv-srv:last-of-type { border-bottom: 0; }
.pv-flag { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.pv-ping { margin-left: auto; font-size: 12px; font-weight: 700; color: #4ade80; }
.pv-note { font-size: 11.5px; color: #71717a; text-align: center; margin-top: 6px; }

/* ==================== ЭФФЕКТЫ ==================== */

/* появление блоков при прокрутке */
.view > .reveal { animation: none; opacity: 0; transform: translate3d(0, 26px, 0) scale(.97);
  transition: opacity .7s ease, transform .85s var(--out); }
.view > .reveal.in { opacity: 1; transform: none; }

/* шапка: тень при прокрутке, название экрана переезжает в шапку */
.topbar { transition: box-shadow .3s ease, border-color .3s ease; border-bottom: 1px solid transparent; }
html.scrolled .topbar { border-bottom-color: var(--line); box-shadow: 0 6px 20px rgba(0, 0, 0, .06); }
.brand { position: relative; min-width: 0; }
.brand #brand-name { transition: opacity .25s ease, transform .3s var(--ease); }
.top-title { position: absolute; left: 42px; top: 50%; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translate3d(0, 60%, 0); transition: opacity .25s ease, transform .35s var(--ease); pointer-events: none; }
html.titled .brand #brand-name { opacity: 0; transform: translate3d(0, -60%, 0); }
html.titled .top-title { opacity: 1; transform: translate3d(0, -50%, 0); }
.page-title { transform-origin: 0 100%; will-change: transform, opacity; }

/* вкладки: значок «подпрыгивает», у индикатора — свечение */
.tab.pop svg.i { animation: tabPop .55s var(--spring) backwards; }
@keyframes tabPop { 0% { transform: scale(.7) rotate(-10deg); } 60% { transform: translateY(-3px) scale(1.2) rotate(4deg); }
  100% { transform: translateY(-1px) scale(1.12); } }
.tab-ind { transition: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); }

/* шторка: плавное закрытие и смахивание вниз */
.sheet-wrap::before { background: rgb(10 6 30 / calc(.45 - var(--drag, 0) * .4)); }
:root[data-accent="mono"] .sheet-wrap::before { background: rgb(0 0 0 / calc(.45 - var(--drag, 0) * .4)); }
.sheet-wrap.closing { pointer-events: none; }
.sheet-wrap.closing::before { animation: fadeOut .3s ease forwards; }
.sheet-wrap.closing .sheet { animation: sheetDown .3s cubic-bezier(.5, 0, .75, .4) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetDown { to { transform: translate3d(0, 105%, 0); } }
.sheet .handle { width: 46px; height: 5px; cursor: grab; position: relative; }
.sheet .handle::after { content: ""; position: absolute; inset: -14px -40px; }

/* цены «перелистываются» при смене числа устройств */
.t-price.flip .rub, .t-price.flip .stars, .t-price.flip .per { animation: priceFlip .55s var(--spring) backwards; animation-delay: inherit; }
@keyframes priceFlip { from { opacity: 0; transform: translate3d(0, -10px, 0) rotateX(80deg); } }

/* график растёт, полосы воронки заполняются */
.chart rect.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: barGrow .75s var(--spring) backwards; }
@keyframes barGrow { from { transform: scaleY(0); opacity: 0; } }

/* приветствие: орбиты вокруг значка */
.splash-badge .orbit { position: absolute; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--text) 22%, transparent); pointer-events: none;
  animation: spin 12s linear infinite, orbitIn 1.2s cubic-bezier(.16, 1, .3, 1) .3s backwards; }
@keyframes orbitIn { from { opacity: 0; scale: .6; } }
.splash-badge .orbit.o1 { inset: -16px; }
.splash-badge .orbit.o2 { inset: -34px; border-style: solid; border-color: color-mix(in srgb, var(--text) 8%, transparent);
  animation-duration: 20s, 1.3s; animation-delay: 0s, .45s; animation-direction: reverse, normal; }
.splash-badge .orbit b { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--text);
  box-shadow: 0 0 10px color-mix(in srgb, var(--text) 50%, transparent); }
.splash-badge .orbit.o2 b { width: 6px; height: 6px; top: -3px; margin-left: -3px; opacity: .6; }

/* успех: расходящиеся кольца вокруг галочки */
.success-ico { position: relative; }
.success-ico::before, .success-ico::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--a2);
  opacity: 0; animation: burst 1.1s ease-out .3s; pointer-events: none; }
.success-ico::after { animation-delay: .55s; }
@keyframes burst { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
.success-ico::before, .success-ico::after { animation-timing-function: var(--out); animation-duration: 1.3s; }

/* плёночное «зерно» на фоне — фактура без лишнего шума */
.bg-fx::after { content: ""; position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .bg-fx::after, :root[data-theme="black"] .bg-fx::after { opacity: .07; }
.bg-fx { transition: transform .9s var(--ease); }

/* глубина карточек в тёмных темах: мягкий верхний свет */
:root[data-theme="dark"] .card, :root[data-theme="black"] .card, :root[data-theme="dark"] .list, :root[data-theme="black"] .list,
:root[data-theme="dark"] .tile, :root[data-theme="black"] .tile {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 90px); }
.btn:not(.tonal):not(.outline):not(.ghost):not(.danger):not(.ok):not(.glass) { box-shadow: 0 6px 18px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .16); }

/* пустые экраны и устройства «на связи» */
.empty .e-ico { animation: float 6s ease-in-out infinite; }
.dev-ico { position: relative; }
.dev-ico.live::after, .dev-ico.live::before { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--surface); }
.dev-ico.live::before { border-color: transparent; opacity: 0; animation: ping 2.2s var(--out) infinite; }

/* смена оформления — круговая «волна» от точки касания (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* при выключенных анимациях эффекты не нужны */
:root[data-motion="off"] .hero .sparks, :root[data-motion="off"] .ring::before, :root[data-motion="off"] .splash-badge .orbit { display: none; }
:root[data-motion="off"] .hero { transform: none; }

/* ---- серверы: карточки с живым состоянием, проверка соединения, журнал ---- */
.flag-box { border-radius: 13px; display: grid; place-items: center; background: var(--bg-2); flex: 0 0 auto; }
.flag-box .i { width: 20px; height: 20px; }
.srv-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.srv-card .tiny.mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
.srv-meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.meter { background: var(--bg-2); border-radius: 12px; padding: 8px 10px 9px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.meter > span { font-size: 11px; color: var(--hint); font-weight: 600; }
.meter > b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.meter .bar { height: 4px; border-radius: 99px; margin-top: 5px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
.meter.warn .bar i { background: var(--warn); } .meter.bad .bar i { background: var(--bad); }
.meter.bad > b { color: var(--bad); } .meter.ok > b { color: var(--ok); }
.tile.warn .v { color: var(--warn); } .tile.bad .v { color: var(--bad); }
.srv-tiles .v { font-size: 20px; } .srv-tiles .l { overflow-wrap: anywhere; }
.srv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.srv-actions .btn { flex: 1 1 calc(50% - 8px); justify-content: center; min-width: 0; min-height: 44px; padding: 9px 8px; font-size: 13px; line-height: 1.2; white-space: normal; text-align: center; }
.inb-row:first-child { border-top: 0; padding-top: 2px; }
.diag { margin: 6px 0 4px; }
.diag-row { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.diag-row:first-child { border-top: 0; }
.diag-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--ok-soft); color: var(--ok); }
.diag-row.warn .diag-ico { background: var(--warn-soft); color: var(--warn); }
.diag-row.fail .diag-ico { background: var(--bad-soft); color: var(--bad); }
.diag-row.skip .diag-ico { background: var(--bg-2); color: var(--hint); }
.diag-row .small { overflow-wrap: anywhere; }
.logbox { max-height: 56vh; overflow: auto; margin: 8px 0 4px; padding: 12px; border-radius: 12px; background: var(--bg-2); color: var(--text);
  font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 360px) { .srv-meters { grid-template-columns: repeat(2, 1fr); } .srv-actions .btn { flex-basis: 100%; } }

/* ---- производительность ---- */
/* карточка подписки наклоняется за телефоном — отдельный слой, чтобы наклон не перерисовывал её */
.hero { will-change: transform; }
/* декоративные бесконечные анимации карточки, которая ушла за край экрана, стоят на паузе */
.anim-idle, .anim-idle *, .anim-idle::before, .anim-idle::after, .anim-idle *::before, .anim-idle *::after { animation-play-state: paused !important; }
/* длинные списки админки: строки ниже первого экрана не раскладываются и не рисуются, пока до них не дошли */
.list > .item:nth-child(n+14) { content-visibility: auto; contain-intrinsic-size: auto 64px; }
/* облегчённый режим (слабый телефон: класс LOW в Telegram, мало памяти/ядер, экономия трафика или низкий FPS):
   фон не плавает, без размытия под шапкой и вкладками, без мелких декоративных анимаций */
:root[data-lite="on"] .bg-fx i { animation: none; will-change: auto; }
:root[data-lite="on"] .bg-fx::after { display: none; }
:root[data-lite="on"] .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 97%, transparent); }
:root[data-lite="on"] .tabs { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
:root[data-lite="on"] .hero .pill { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 255, 255, .24); }
:root[data-lite="on"] .hero .sparks, :root[data-lite="on"] .ring::before, :root[data-lite="on"] .splash-rays { display: none; }
:root[data-lite="on"] .hero .hero-bg, :root[data-lite="on"] .hero .deco, :root[data-lite="on"] .empty .e-ico { animation: none; }
:root[data-lite="on"] .tariff.best > .best-border::before { animation-duration: 9s; }

/* ---- без анимаций ---- */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
:root[data-motion="off"] .hero .shine, :root[data-motion="off"] .bg-fx i, :root[data-motion="off"] .ripple { animation: none !important; }
:root[data-motion="off"] .hero .shine { display: none; }

/* ---- флажок в карточке (применить к выданным пробным) ---- */
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--text-2); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; margin: 0; }

/* ---- нет соединения ---- */
.net-banner { position: fixed; z-index: 40; left: 50%; top: calc(8px + env(safe-area-inset-top)); transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 12px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 700;
  text-align: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); animation: toastIn .4s var(--out); }

/* ==================== ВЕБ-ПАНЕЛЬ АДМИНОВ (браузер) ==================== */
:root[data-panel="1"] .tabs { display: none !important; }
:root[data-panel="1"] .view { max-width: 1080px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
:root[data-panel="1"] .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
.panel-side { display: none; }
/* экран входа */
:root.panel-guest .topbar { visibility: hidden; }
.panel-login { max-width: 420px; margin: 8vh auto 0; text-align: center; padding: 28px 24px; }
.panel-login h2 { margin: 14px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.panel-login p { margin: 0 0 16px; }
.panel-login .logo.big { width: 56px; height: 56px; margin: 0 auto; border-radius: 18px; font-size: 20px; }
.panel-qr { display: block; width: 220px; height: 220px; margin: 4px auto 16px; border-radius: 16px; background: #fff; padding: 8px;
  box-shadow: var(--shadow); }
/* боковое меню и окна по центру — на широком экране */
@media (min-width: 900px) {
  :root[data-panel="1"]:not(.panel-guest) .panel-side { display: flex; flex-direction: column; position: fixed; z-index: 8; inset: 0 auto 0 0;
    width: 248px; padding: 18px 12px; gap: 2px; overflow-y: auto; border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  :root[data-panel="1"]:not(.panel-guest) #app { margin-left: 248px; }
  :root[data-panel="1"]:not(.panel-guest) .admin-nav { display: none; }
  :root[data-panel="1"]:not(.panel-guest) .topbar .brand .logo { display: none; }
  :root[data-panel="1"] .view { padding-left: 28px; padding-right: 28px; }
  :root[data-panel="1"] .sheet-wrap { align-items: center; padding: 24px; }
  :root[data-panel="1"] .sheet { max-width: 580px; max-height: 86vh; border-radius: 22px; padding-bottom: 22px; animation: modalIn .32s var(--out); }
  :root[data-panel="1"] .sheet .handle { display: none; }
  :root[data-panel="1"] .sheet-wrap.closing .sheet { animation: modalOut .2s ease forwards; }
}
@keyframes modalIn { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.97); } }
@keyframes modalOut { to { opacity: 0; transform: translate3d(0, 8px, 0) scale(.98); } }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.side-brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.side-brand span.tiny { display: block; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none;
  color: var(--text-2); font: inherit; font-size: 14.5px; font-weight: 700; text-align: left; cursor: pointer;
  transition: background-color .2s ease, color .2s ease; }
.side-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.side-item.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; }
.side-user b { display: block; font-size: 13.5px; }
.side-user span.tiny { display: block; }
/* курсор и наведение — в браузере на компьютере */
@media (hover: hover) {
  :root[data-panel="1"] .item:hover, :root[data-panel="1"] .card.tap:hover { background-color: color-mix(in srgb, var(--text) 3%, var(--surface)); }
}


/* ==================== ПОЛИРОВКА: аккуратность и плавность ==================== */
/* инбаунды сервера: название и переключатель / описание и действия */
.inb-row { padding: 12px 0; border-top: 1px solid var(--line); }
.inb-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inb-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inb-top .switch { margin-left: auto; }
.inb-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.inb-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
/* сетка карточек (серверы, тарифы): на телефоне — колонка, на широком экране панели — две */
.cards-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.cards-grid > .card { margin-bottom: 0; animation: rise .5s var(--out) backwards; }
.cards-grid > :nth-child(2) { animation-delay: .05s; } .cards-grid > :nth-child(3) { animation-delay: .1s; }
.cards-grid > :nth-child(4) { animation-delay: .15s; } .cards-grid > :nth-child(n+5) { animation-delay: .2s; }
/* декоративные значки в героях — меньше и тише, не налезают на кнопки и бейджи */
.hero .deco { right: -6px; bottom: -14px; opacity: .1; }
.hero .deco svg { width: 112px; height: 112px; }

/* «бегунок» переключателей и бокового меню */
.seg.has-glide, .side-nav { position: relative; }
.glide { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 11px; background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 10, 80, .12), 0 4px 12px rgba(20, 10, 80, .06); will-change: transform; }
.seg.has-glide > button { position: relative; z-index: 1; }
.seg.has-glide > button.active { background: transparent; box-shadow: none; }
.side-nav .glide { border-radius: 12px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); }
.side-nav > .side-item { position: relative; z-index: 1; }
.side-nav > .side-item.active { background: transparent; }
/* у «таблеток» новый выбранный пункт мягко пружинит */
.pop-in { animation: pillPop .5s var(--spring); }
@keyframes pillPop { 0% { transform: scale(.9); } 100% { transform: none; } }

/* кнопка «думает»: действие идёт дольше 0,2 с — индикатор вместо значка */
.btn.busy, .icon-btn.busy { pointer-events: none; }
.btn.busy svg, .icon-btn.busy svg { display: none; }
.btn.busy::before, .icon-btn.busy::before { content: ""; width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .85; }
.btn.busy { opacity: .85; }

/* переключатели «вкл/выкл»: ползунок пружинит, нажатие слегка вдавливает */
.switch::after { transition: transform .45s var(--spring), width .25s var(--out), background-color .25s ease; }
.switch:active::after { width: 28px; }
.switch.on:active::after { transform: translateX(16px); }
.switch { transition: background .3s ease, box-shadow .3s ease; }
.switch.on { box-shadow: 0 4px 12px var(--glow); }

/* полосы нагрузки и прогресса — плавное заполнение */
.meter .bar i, .bar-line > i, .progress > i { transition: width .9s var(--out); }

/* поля ввода: мягкая подсветка фокуса */
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
/* клавиатура (панель на компьютере): видимая рамка фокуса */
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }

/* наведение мышью (компьютер): карточки приподнимаются, кнопки и пункты подсвечиваются */
@media (hover: hover) and (pointer: fine) {
  .card.tap, .tile, .perk, .srv-card, .method, .promo-link { transition: transform .35s var(--out), box-shadow .35s var(--out), border-color .25s ease; }
  .card.tap:hover, .srv-card:hover, .method:hover, .promo-link:hover { transform: translateY(-2px);
    box-shadow: var(--shadow), 0 14px 32px rgba(20, 10, 70, .12); border-color: color-mix(in srgb, var(--text) 14%, var(--line)); }
  .tile:hover, .perk:hover { transform: translateY(-2px); }
  .btn:hover { filter: brightness(1.06); }
  .btn.outline:hover, .btn.ghost:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .icon-btn:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--line)); }
  .seg button:not(.active):hover, .admin-nav button:not(.active):hover { color: var(--text); }
  .item:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
  .btn svg, .icon-btn svg { transition: transform .35s var(--spring); }
  .btn:hover svg { transform: translateX(1px) scale(1.06); }
  .icon-btn:hover svg { transform: scale(1.1); }
}

/* веб-панель на широком экране: больше колонок, шире содержимое */
@media (min-width: 1200px) {
  :root[data-panel="1"] .view { max-width: 1240px; }
  :root[data-panel="1"] .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[data-panel="1"] .view > .grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
:root[data-motion="off"] .glide { transition: none; }
/* в героях с кнопками декор едва заметен — не просвечивает сквозь полупрозрачные кнопки */
.hero:has(.btn-row) .deco { opacity: .055; }
