/* ===== 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.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(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --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"] .sheet-wrap { background: rgba(0, 0, 0, .45); }
: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; }
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 .42s var(--ease) backwards; }
.view[data-anim="right"] > * { animation-name: inRight; }
.view[data-anim="left"] > * { animation-name: inLeft; }
.view[data-anim="fade"] > * { animation-name: fadeIn; animation-duration: .3s; }
.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: .04s; } .view > *:nth-child(3) { animation-delay: .08s; } .view > *:nth-child(4) { animation-delay: .12s; }
.view > *:nth-child(5) { animation-delay: .16s; } .view > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes inRight { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes inLeft { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: none; } }
/* ступенчатое появление плиток и строк списков */
.view .grid2 > *, .view .grid3 > *, .view .perks > * { animation: pop .5s 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 .4s var(--ease) 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 .12s ease; }
.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: 0; z-index: -1; pointer-events: none; opacity: var(--glare, 0); transition: opacity .5s ease;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .26), transparent 58%); }
.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: 0; z-index: -2; pointer-events: none; background: inherit; background-size: 180% 180%;
  animation: heroShift 14s ease-in-out infinite alternate; }
@keyframes heroShift { 0% { background-position: 0% 30%; } 100% { background-position: 100% 70%; } }
.hero .shine { position: absolute; top: -20%; left: -70%; width: 45%; height: 140%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .26), transparent); transform: skewX(-18deg);
  animation: shine 7s ease-in-out 1.2s infinite; }
@keyframes shine { 0% { left: -70%; } 22%, 100% { left: 140%; } }
.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 { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); } }
.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); animation: knobPulse 2.4s ease-in-out 1.5s infinite; }
@keyframes knobPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .12), 0 0 20px 4px rgba(255, 255, 255, .8); } }
: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 .1s ease, opacity .15s, filter .15s; 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: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 { animation: pingOk 2.4s ease-out infinite; }
@keyframes pingOk { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* ---- подключение ---- */
.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 .2s, color .2s, box-shadow .2s; }
.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; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.tariff.best { border: 1px solid transparent; box-shadow: var(--shadow-lg); }
/* бегущая рамка — псевдоэлементом с маской, чтобы не мешать анимации появления */
.tariff.best::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang), var(--a1), var(--a2), var(--a3), var(--a1));
  -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);
  animation: spinBorder 5s linear infinite; }
@keyframes spinBorder { to { --ang: 360deg; } }
.chip.grad { background-size: 200% 100%; animation: chipShift 3s ease-in-out infinite alternate; }
@keyframes chipShift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.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:active { background: var(--accent-soft); }
.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 .2s; margin-right: 4px; flex: 0 0 auto; }
details.acc[open] summary::after { transform: rotate(-135deg); }
details.acc .acc-body { padding: 0 0 14px; }
.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 { border-radius: var(--r); height: 92px; margin-bottom: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.hero-s { height: 230px; border-radius: 26px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 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 .35s 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;
  transition: transform .5s var(--spring), width .5s var(--spring); }
.tabs.no-anim .tab-ind { transition: none; }

/* ---- шторка и тост ---- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(10, 6, 30, .45); z-index: 15; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { 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 .45s var(--spring); }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.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, glowPulse 2.4s ease-in-out .6s infinite; }
.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; } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 10px 30px var(--glow); } 50% { box-shadow: 0 10px 46px var(--glow), 0 0 0 8px var(--accent-soft); } }
.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 .45s var(--spring); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
.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-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: end; }
.plan-row .field { margin-bottom: 8px; }
.plan-row .plan-price { font-weight: 800; font-size: 14px; padding-bottom: 20px; min-width: 64px; text-align: right; }
.plan-row .icon-btn { margin-bottom: 10px; }
.dim { opacity: .55; }
@media (max-width: 420px) {
  .plan-row { grid-template-columns: 1fr 1fr auto; row-gap: 0; }
  .plan-row .icon-btn { order: 4; }
  .plan-row .plan-price { order: 5; grid-column: 1 / -1; text-align: left; padding: 0 0 10px; margin-top: -4px; font-size: 12.5px; font-weight: 700; color: var(--hint); }
  .plan-row .plan-price:not(:empty)::before { content: attr(data-label); font-weight: 500; }
}

/* ---- приветствие при открытии ---- */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--bg); overflow: hidden;
  transition: opacity .45s ease, transform .55s var(--ease), filter .45s ease; }
.splash.hide { opacity: 0; transform: scale(1.06); filter: blur(6px); pointer-events: none; }
.splash.gone { display: none; }
.splash-glow { position: absolute; left: 50%; top: 42%; width: 120vmin; height: 120vmin; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, var(--splash-glow, var(--glow)) 0%, transparent 62%); opacity: .9; animation: splashGlow 3.2s ease-in-out infinite alternate; }
.splash-inner { position: relative; text-align: center; max-width: 320px; }
.splash-badge { position: relative; width: 84px; height: 84px; margin: 0 auto 40px; perspective: 600px; }
.splash-badge .splash-logo { animation: badgeIn 1s cubic-bezier(.2, .9, .25, 1.2) both; }
.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); }
.splash-logo::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -80%; width: 50%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: badgeShine 1.1s ease .75s both; }
: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 .6s var(--spring) .25s both; }
.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 .6s var(--ease) .12s both; }
.splash-hello .ch { display: inline-block; white-space: pre; animation: chIn .55s cubic-bezier(.2, .8, .2, 1) both; }
.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 .9s cubic-bezier(.2, .8, .2, 1) .55s both, nameShine 1.6s ease 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 .6s var(--ease) .75s both;
  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 .6s var(--ease) .85s both; }
.splash-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--a1), var(--a3));
  animation: splashLoad 1.15s cubic-bezier(.45, 0, .2, 1) infinite; }
:root[data-accent="mono"] .splash-bar i { background: var(--text); }
.splash.ready .splash-bar i { animation: none; width: 100%; transform: none; transition: width .35s var(--ease); }
@keyframes splashPop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes badgeIn { 0% { opacity: 0; transform: rotateY(-110deg) rotateX(18deg) scale(.55); filter: blur(6px); }
  60% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes badgeShine { from { left: -80%; } to { left: 140%; } }
@keyframes chIn { from { opacity: 0; transform: translateY(.55em) rotate(8deg); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes nameIn { from { opacity: 0; letter-spacing: .35em; filter: blur(8px); transform: translateY(6px); } to { opacity: 1; letter-spacing: -.03em; filter: none; 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(12px); } to { opacity: 1; transform: none; } }
@keyframes splashGlow { from { opacity: .55; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@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 { 0% { transform: translateX(-110%); } 100% { 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; opacity: 0; animation: fadeIn 1.4s ease .1s forwards; }
.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: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--text) 6%, transparent) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .5) 18%, transparent 45%); mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .5) 18%, transparent 45%);
  animation: fadeIn 1.6s ease .3s forwards, spin 60s 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; }
.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; animation: badgePulse 1.4s cubic-bezier(.2, .8, .2, 1) .7s; }
.splash-badge .pulse.p2 { animation-delay: 1s; }
.splash.ready .splash-badge .pulse { animation: badgePulse2 1.2s cubic-bezier(.2, .8, .2, 1); }
.splash.ready .splash-badge .pulse.p2 { animation-delay: .25s; }
@keyframes badgePulse { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes badgePulse2 { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
.splash.ready .splash-logo { animation: badgeIn 1s cubic-bezier(.2, .9, .25, 1.2) both, readyPop .5s var(--spring); }
@keyframes readyPop { 40% { transform: scale(1.08); } }
/* уход: тексты уплывают вниз, логотип улетает в шапку, экран раскрывается кругом */
.splash.leaving .splash-hello, .splash.leaving .splash-name, .splash.leaving .splash-sub, .splash.leaving .splash-bar,
.splash.leaving .splash-time, .splash.leaving .orbit { transition: opacity .3s ease, transform .45s var(--ease); opacity: 0; transform: translateY(14px); animation: none; }
.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); }
.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; }
: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; }

/* ---- страна сервера ---- */
.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 .6s var(--ease), transform .75s var(--spring); }
.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(.6) rotate(-14deg); } 60% { transform: translateY(-3px) scale(1.24) rotate(5deg); }
  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 { background: rgb(10 6 30 / calc(.45 - var(--drag, 0) * .4)); }
:root[data-accent="mono"] .sheet-wrap { background: rgb(0 0 0 / calc(.45 - var(--drag, 0) * .4)); }
.sheet-wrap.closing { animation: fadeOut .26s ease forwards; pointer-events: none; }
.sheet-wrap.closing .sheet { animation: sheetDown .28s cubic-bezier(.4, 0, 1, 1) 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); filter: blur(3px); } }

/* график растёт, полосы воронки заполняются */
.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 .9s ease .15s backwards; }
@keyframes orbitIn { from { opacity: 0; } }
.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, .9s; 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); } }

/* плёночное «зерно» на фоне — фактура без лишнего шума */
.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 { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--surface); animation: pingOk 2.2s ease-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; }

/* ---- без анимаций ---- */
: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; }
