/* PERSONAL ×1000 CASCADE · 2026-07-31
 * Cascade-LAST after personal-use + any inline autonomous blocks.
 * warmer · intimate · soft motion · large clear taps · ZERO chrome overlap.
 * Canon: Onest/Unbounded · cobalt #1d4ed8 · light-first · no purple / terracotta slop.
 * Cache: ?v=20260731-px1k3
 */
:root {
  --px1k-cobalt: #1d4ed8;
  --px1k-deep: #1e40af;
  --px1k-amber: #e8a54b;
  --px1k-mint: #2db892;
  --px1k-ink: #1a2332;
  --px1k-mute: #5a6578;
  --px1k-line: #e2d9cf;
  --px1k-paper: #f8f5f1;
  --px1k-glass: rgba(255, 250, 245, 0.78);
  --px1k-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --px1k-hit: 52px;
  --px1k-hit-sm: 48px;
  /* Chrome stacking — never share a plane */
  --px1k-z-bg: 0;
  --px1k-z-app: 1;
  --px1k-z-list: 2;
  --px1k-z-head: 20;
  --px1k-z-filters: 25;
  --px1k-z-composer: 30;
  --px1k-z-net: 40;
  --px1k-z-fab: 50;
  --px1k-z-switcher: 1900;
  --px1k-z-panel: 2000;
  --px1k-z-modal: 3000;
}

@keyframes px1k-breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(1.03); }
}
@keyframes px1k-drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0.9%, -0.6%, 0); }
}
@keyframes px1k-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.68; }
}
@keyframes px1k-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Warmer intimate wash (beats cool autonomous blues) ──────────────────── */
html body[data-page="messenger"]:not([data-page="voice"]),
html body[data-page="voice"],
html body.vy-shell-body[data-landing-v2],
html body[data-page="account"],
html body:has(.hero-surface),
html body[data-page="video"] {
  --bg: var(--px1k-paper);
  --text: var(--px1k-ink);
  --muted: var(--px1k-mute);
  color: var(--px1k-ink);
  font-family: "Onest", "Segoe UI", system-ui, sans-serif !important;
  background:
    radial-gradient(980px 460px at 4% -10%, rgba(232, 165, 75, 0.22), transparent 56%),
    radial-gradient(860px 440px at 100% -4%, rgba(29, 78, 216, 0.18), transparent 54%),
    radial-gradient(700px 460px at 78% 108%, rgba(45, 184, 146, 0.12), transparent 50%),
    linear-gradient(168deg, #f0e8df 0%, #f8f5f1 40%, #eaf0f7 100%) !important;
  background-image:
    radial-gradient(980px 460px at 4% -10%, rgba(232, 165, 75, 0.22), transparent 56%),
    radial-gradient(860px 440px at 100% -4%, rgba(29, 78, 216, 0.18), transparent 54%),
    radial-gradient(700px 460px at 78% 108%, rgba(45, 184, 146, 0.12), transparent 50%),
    linear-gradient(168deg, #f0e8df 0%, #f8f5f1 40%, #eaf0f7 100%) !important;
  background-color: #f8f5f1 !important;
  background-attachment: fixed !important;
}

/* Soft parallel atmosphere — presence, not noise */
html body[data-page="messenger"]:not([data-page="voice"])::before {
  z-index: var(--px1k-z-bg) !important;
  opacity: 0.2 !important;
  animation: px1k-breathe 14s var(--px1k-ease) infinite !important;
}
html body.vy-shell-body[data-landing-v2] .hero::before,
html body:has(.hero-surface) .hero-aurora {
  animation: px1k-breathe 10s var(--px1k-ease) infinite, px1k-drift 16s var(--px1k-ease) infinite !important;
}

/* ── ZERO chrome overlap — Messenger stacking planes ─────────────────────── */
html body[data-page="messenger"]:not([data-page="voice"]) .app {
  position: relative;
  z-index: var(--px1k-z-app);
  isolation: isolate;
}
html body[data-page="messenger"]:not([data-page="voice"]) .app > .chatlist {
  position: relative;
  z-index: var(--px1k-z-list);
  isolation: isolate;
  overflow: hidden;
}
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head {
  position: relative;
  z-index: var(--px1k-z-head) !important;
  background: var(--px1k-glass) !important;
  border-bottom: 1px solid rgba(226, 217, 207, 0.9) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  overflow: visible !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head .row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
  position: relative;
  z-index: 2;
}
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Unbounded", system-ui, sans-serif !important;
  font-size: clamp(1.12rem, 1.5vw, 1.36rem) !important;
  letter-spacing: -0.03em !important;
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: var(--px1k-ink) !important;
  -webkit-text-fill-color: var(--px1k-ink) !important;
  filter: none !important;
  animation: none !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head h2::after {
  display: none !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head-actions {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: none !important;
  overflow: visible !important;
  position: relative;
  z-index: 3;
}
/* ONE services control in header slot — no square-in-square fight */
html body[data-page="messenger"]:not([data-page="voice"]) .vy-msg-switcher-slot {
  flex: 0 0 auto !important;
  width: var(--px1k-hit-sm) !important;
  min-width: var(--px1k-hit-sm) !important;
  max-width: var(--px1k-hit-sm) !important;
  height: var(--px1k-hit-sm) !important;
  overflow: visible !important;
  position: relative;
  z-index: 4;
}
html body[data-page="messenger"]:not([data-page="voice"]) .vy-msg-switcher-slot .vy-product-switcher,
html body[data-page="messenger"]:not([data-page="voice"]) .vy-msg-switcher-slot .vy-product-launcher {
  position: relative !important;
  width: var(--px1k-hit-sm) !important;
  height: var(--px1k-hit-sm) !important;
  min-width: var(--px1k-hit-sm) !important;
  min-height: var(--px1k-hit-sm) !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 14px !important;
}

/* Stories + filters: own plane below header, never under actions */
html body[data-page="messenger"]:not([data-page="voice"]) .tg-stories,
html body[data-page="messenger"]:not([data-page="voice"]) .stories {
  position: relative;
  z-index: calc(var(--px1k-z-head) - 2);
  margin: 0 !important;
  padding: 8px 12px 4px !important;
  animation: px1k-rise 0.5s var(--px1k-ease) both;
}
html body[data-page="messenger"]:not([data-page="voice"]) .tg-filters,
html body[data-page="messenger"]:not([data-page="voice"]) .cl-tabs,
html body[data-page="messenger"]:not([data-page="voice"]) [role="tablist"].tg-filters {
  position: relative;
  z-index: var(--px1k-z-filters) !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  margin: 0 0 6px !important;
  padding: 6px 12px 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: transparent !important;
  isolation: isolate;
}
html body[data-page="messenger"]:not([data-page="voice"]) .tg-filter,
html body[data-page="messenger"]:not([data-page="voice"]) .filters button,
html body[data-page="messenger"]:not([data-page="voice"]) .kind-tabs button {
  flex: 0 0 auto !important;
  min-height: var(--px1k-hit-sm) !important;
  min-width: 44px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  white-space: nowrap !important;
  position: relative;
  z-index: 1;
  background: rgba(255, 252, 248, 0.9) !important;
  border: 1px solid rgba(226, 217, 207, 0.95) !important;
  color: var(--px1k-mute) !important;
  -webkit-text-fill-color: var(--px1k-mute) !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .tg-filter[aria-selected="true"],
html body[data-page="messenger"]:not([data-page="voice"]) .tg-filter[aria-pressed="true"] {
  color: var(--px1k-cobalt) !important;
  -webkit-text-fill-color: var(--px1k-cobalt) !important;
  background: rgba(29, 78, 216, 0.1) !important;
  border-color: rgba(29, 78, 216, 0.35) !important;
}
/* «Избранное» / saved chip — never clip into title/background */
html body[data-page="messenger"]:not([data-page="voice"]) .tg-filter[data-tg-filter="saved"] {
  letter-spacing: 0 !important;
  padding-inline: 12px !important;
  background: rgba(255, 252, 248, 0.96) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset !important;
}

/* Conv list clear of chrome */
html body[data-page="messenger"]:not([data-page="voice"]) .cl-scroll,
html body[data-page="messenger"]:not([data-page="voice"]) .chatlist .list,
html body[data-page="messenger"]:not([data-page="voice"]) .app > .chatlist .cl-scroll {
  position: relative;
  z-index: 1;
  padding-top: 2px !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .conv {
  position: relative;
  z-index: 1;
  min-height: 64px !important;
  margin: 2px 8px !important;
  border-radius: 14px !important;
  background: rgba(255, 252, 248, 0.55) !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .conv .cv-nm {
  color: var(--px1k-ink) !important;
  -webkit-text-fill-color: var(--px1k-ink) !important;
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  animation: none !important;
  font-family: "Onest", system-ui, sans-serif !important;
  font-weight: 700 !important;
}

/* Composer / thread heads — own plane */
html body[data-page="messenger"]:not([data-page="voice"]) .composer,
html body[data-page="messenger"]:not([data-page="voice"]) .tg-comp {
  position: relative;
  z-index: var(--px1k-z-composer) !important;
  background: var(--px1k-glass) !important;
  border-top: 1px solid rgba(226, 217, 207, 0.9) !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .th-head,
html body[data-page="messenger"]:not([data-page="voice"]) .tg-head {
  position: relative;
  z-index: var(--px1k-z-head) !important;
  background: var(--px1k-glass) !important;
}

/* Mobile FAB switcher — clear of composer + filters; desktop header-only */
@media (min-width: 641px) {
  html body[data-page="messenger"]:not([data-page="voice"]) > .vy-product-switcher {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
@media (max-width: 640px) {
  html body[data-page="messenger"]:not([data-page="voice"]) .vy-msg-switcher-slot {
    display: none !important;
  }
  html body[data-page="messenger"]:not([data-page="voice"]) > .vy-product-switcher {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: fixed !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 76px)) !important;
    left: auto !important;
    top: auto !important;
    z-index: var(--px1k-z-switcher) !important;
    width: var(--px1k-hit) !important;
    height: var(--px1k-hit) !important;
    margin: 0 !important;
    transform: none !important;
  }
  html body[data-page="messenger"]:not([data-page="voice"]) > .vy-product-switcher .vy-product-launcher {
    width: var(--px1k-hit) !important;
    height: var(--px1k-hit) !important;
    min-width: var(--px1k-hit) !important;
    min-height: var(--px1k-hit) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 28px -14px rgba(29, 78, 216, 0.45) !important;
  }
  html body[data-page="messenger"]:not([data-page="voice"]) > .vy-product-switcher .vy-product-panel {
    z-index: var(--px1k-z-panel) !important;
    bottom: calc(100% + 12px) !important;
    top: auto !important;
    right: 0 !important;
    left: auto !important;
  }
  /* Keep list content clear of FAB thumb zone */
  html body[data-page="messenger"]:not([data-page="voice"]) .app > .chatlist .cl-scroll,
  html body[data-page="messenger"]:not([data-page="voice"]) .cl-scroll {
    padding-bottom: calc(var(--px1k-hit) + 96px) !important;
  }
  html body[data-page="messenger"]:not([data-page="voice"]) .composer,
  html body[data-page="messenger"]:not([data-page="voice"]) .tg-comp {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    /* FAB is lifted above composer — do not tax input width with 72px right pad */
    padding-right: 10px !important;
  }
}

/* Kill stacked junk chrome so nothing overlaps the personal planes */
html body[data-page="messenger"]:not([data-page="voice"]) .vm-tabbar,
html body[data-page="messenger"]:not([data-page="voice"]) .mtabbar,
html body[data-page="messenger"]:not([data-page="voice"]) .dsnav,
html body[data-page="messenger"]:not([data-page="voice"]) .rail,
html body[data-page="messenger"]:not([data-page="voice"]) .vshell-rail,
html body[data-page="messenger"]:not([data-page="voice"]) .vshell-ch,
html body[data-page="messenger"]:not([data-page="voice"]) .app > .rightpanel,
html body[data-page="messenger"]:not([data-page="voice"]) #vyAiFab,
html body[data-page="messenger"]:not([data-page="voice"]) #vyNews,
html body[data-page="messenger"]:not([data-page="voice"]) #vyBug,
html body[data-page="messenger"]:not([data-page="voice"]) .vy-eco-assistant,
html body[data-page="messenger"]:not([data-page="voice"]) #vyEcoAssistant {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* Netbar: thin strip, never over filters */
html body[data-page="messenger"]:not([data-page="voice"]) .nb,
html body[data-page="messenger"]:not([data-page="voice"]) .netbar,
html body[data-page="messenger"]:not([data-page="voice"]) [data-vy-netbar] {
  z-index: var(--px1k-z-net) !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  max-width: min(400px, calc(100vw - 24px)) !important;
}

/* ── Large clear taps ────────────────────────────────────────────────────── */
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head-actions a,
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head-actions .btn,
html body[data-page="messenger"]:not([data-page="voice"]) .cl-head-actions button,
html body[data-page="messenger"]:not([data-page="voice"]) .vy-msg-account,
html body[data-page="messenger"]:not([data-page="voice"]) .composer .cbtns .send,
html body[data-page="messenger"]:not([data-page="voice"]) .composer button.send,
html body[data-page="messenger"]:not([data-page="voice"]) .tg-comp .send,
html body[data-page="messenger"]:not([data-page="voice"]) .btn.icon {
  min-width: var(--px1k-hit-sm) !important;
  min-height: var(--px1k-hit-sm) !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .composer .cbtns .send,
html body[data-page="messenger"]:not([data-page="voice"]) .tg-comp .send {
  min-width: var(--px1k-hit) !important;
  min-height: var(--px1k-hit) !important;
  border-radius: 14px !important;
  background: var(--px1k-cobalt) !important;
  box-shadow: 0 10px 22px -12px rgba(29, 78, 216, 0.5) !important;
}
html body[data-page="messenger"]:not([data-page="voice"]) .composer .cbox,
html body[data-page="messenger"]:not([data-page="voice"]) .composer textarea {
  min-height: var(--px1k-hit-sm) !important;
  font-size: 15.5px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--px1k-ink) !important;
}

/* Soft presence on story rings only */
html body[data-page="messenger"]:not([data-page="voice"]) .tg-stories .st .av,
html body[data-page="messenger"]:not([data-page="voice"]) .tg-story__ring,
html body[data-page="messenger"]:not([data-page="voice"]) .story-item .av {
  animation: px1k-soft 3.4s var(--px1k-ease) infinite;
  box-shadow: 0 0 0 2px var(--px1k-paper), 0 0 0 3.5px rgba(29, 78, 216, 0.5) !important;
}

/* ── Voice intimate chrome · no overlap ──────────────────────────────────── */
html body[data-page="voice"] .topbar,
html body[data-page="voice"] .sb-head,
html body[data-page="voice"] .stage-head,
html body[data-page="voice"] header.vhead {
  position: relative;
  z-index: var(--px1k-z-head);
  background: var(--px1k-glass) !important;
  isolation: isolate;
}
html body[data-page="voice"] .ctrl,
html body[data-page="voice"] .controls {
  position: relative;
  z-index: var(--px1k-z-composer);
}
html body[data-page="voice"] .ctrl button,
html body[data-page="voice"] .controls button,
html body[data-page="voice"] .fab {
  min-width: var(--px1k-hit) !important;
  min-height: var(--px1k-hit) !important;
  border-radius: 16px !important;
}
html body[data-page="voice"] .wave,
html body[data-page="voice"] .vv-wave,
html body[data-page="voice"] .live-dot {
  animation: px1k-soft 2.8s var(--px1k-ease) infinite !important;
}
/* Voice: keep product switcher / assistant from stacking on stage */
html body[data-page="voice"] .vy-product-switcher {
  z-index: var(--px1k-z-switcher) !important;
}
html body[data-page="voice"] .vy-eco-assistant,
html body[data-page="voice"] #vyEcoAssistant {
  z-index: calc(var(--px1k-z-switcher) - 10) !important;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  right: max(16px, env(safe-area-inset-right)) !important;
}

/* ── Landing / Account / Apex: large taps · soft motion · calm chrome ─────── */
html body.vy-shell-body[data-landing-v2] .btn,
html body.vy-shell-body[data-landing-v2] .nav .btn,
html body:has(.hero-surface) .btn,
html body[data-page="account"] .btn,
html body[data-page="account"] button[type="submit"] {
  min-height: var(--px1k-hit) !important;
  padding-inline: 18px !important;
  border-radius: 14px !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
}
html body.vy-shell-body[data-landing-v2] .btn-primary,
html body:has(.hero-surface) .btn.primary,
html body[data-page="account"] button[type="submit"] {
  background: var(--px1k-cobalt) !important;
  border-color: var(--px1k-cobalt) !important;
  box-shadow: 0 14px 28px -16px rgba(29, 78, 216, 0.45) !important;
}
html body:has(.hero-surface) .pulse-dot,
html body.vy-shell-body[data-landing-v2] .brand .mark {
  animation: px1k-soft 2.6s var(--px1k-ease) infinite, px1k-rise 0.65s var(--px1k-ease) both;
}
html body[data-page="account"] .auth-card,
html body[data-page="account"] .card,
html body:has(.hero-surface) .auth-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 252, 248, 0.92) !important;
  border-color: rgba(226, 217, 207, 0.95) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 48px -28px rgba(26, 35, 50, 0.22) !important;
}
/* Landing chrome: nav above hero wash, no overlap with CTAs */
html body.vy-shell-body[data-landing-v2] .nav,
html body:has(.hero-surface) .nav,
html body:has(.hero-surface) header.nav {
  position: relative;
  z-index: var(--px1k-z-head);
  background: rgba(255, 250, 245, 0.82) !important;
  backdrop-filter: blur(12px) !important;
}
html body.vy-shell-body[data-landing-v2] .hero,
html body:has(.hero-surface) .hero-surface {
  position: relative;
  z-index: 1;
}

/* Video: keep bridges readable, large taps */
html body[data-page="video"] .vv-card-bridges a,
html body[data-page="video"] .btn,
html body[data-page="video"] .guest-strip a {
  min-height: var(--px1k-hit-sm) !important;
}

@media (max-width: 640px) {
  :root {
    --px1k-hit: 52px;
    --px1k-hit-sm: 48px;
  }
  html body[data-page="messenger"]:not([data-page="voice"]) .tg-filter {
    min-height: var(--px1k-hit-sm) !important;
    font-size: 13.5px !important;
  }
  html body[data-page="messenger"]:not([data-page="voice"]) .cl-head h2 {
    font-size: 1.15rem !important;
  }
  html body.vy-shell-body[data-landing-v2] .hero-cta .btn,
  html body:has(.hero-surface) .hero-actions .btn {
    width: 100%;
    min-height: var(--px1k-hit) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body[data-page="messenger"]:not([data-page="voice"])::before,
  html body[data-page="messenger"]:not([data-page="voice"]) .tg-stories .st .av,
  html body[data-page="messenger"]:not([data-page="voice"]) .tg-story__ring,
  html body[data-page="messenger"]:not([data-page="voice"]) .story-item .av,
  html body[data-page="voice"] .wave,
  html body[data-page="voice"] .vv-wave,
  html body[data-page="voice"] .live-dot,
  html body.vy-shell-body[data-landing-v2] .hero::before,
  html body:has(.hero-surface) .hero-aurora,
  html body:has(.hero-surface) .pulse-dot,
  html body.vy-shell-body[data-landing-v2] .brand .mark {
    animation: none !important;
  }
}


/* Beat autonomous cool thread wash */
html body[data-page="messenger"]:not([data-page="voice"]) .app > .thread,
html body[data-page="messenger"]:not([data-page="voice"]) .thread {
  background:
    radial-gradient(ellipse 82% 48% at 50% -10%, rgba(232, 165, 75, 0.12), transparent 60%),
    radial-gradient(ellipse 48% 42% at 100% 84%, rgba(29, 78, 216, 0.1), transparent 56%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.55), rgba(248, 245, 241, 0.35)) !important;
  background-image:
    radial-gradient(ellipse 82% 48% at 50% -10%, rgba(232, 165, 75, 0.12), transparent 60%),
    radial-gradient(ellipse 48% 42% at 100% 84%, rgba(29, 78, 216, 0.1), transparent 56%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.55), rgba(248, 245, 241, 0.35)) !important;
}

/* Honest verify: never show dm-empty under filled dialog list */
html body[data-page="messenger"] .cl-scroll .dm-empty[hidden],
html body[data-page="messenger"] .cl-scroll .dm-empty[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}
