/* =====================================================================
   arushan.bio — Motion & Glass Foundation (Stage 1, «Стекло и Движение 2026»)
   Loaded LAST. Pure additive layer: tokens, glass levels, lite fallback,
   reduced-motion, keyframes + Stage 1 layout fixes. Zero neon.
   ===================================================================== */

/* ---------- 1. Motion tokens ---------- */
:root {
  --m-instant: 90ms;
  --m-fast: 140ms;
  --m-base: 220ms;
  --m-slow: 340ms;
  --m-page: 420ms;
  --e-out: cubic-bezier(.22, 1, .36, 1);
  --e-in: cubic-bezier(.4, 0, 1, 1);
  --e-spring: cubic-bezier(.34, 1.56, .64, 1);
  --e-smooth: cubic-bezier(.65, 0, .35, 1);

  /* ---------- 2. Glass tokens ---------- */
  --g1-bg: rgba(255, 255, 255, .62);
  --g1-blur: blur(8px) saturate(140%);
  --g1-border: rgba(255, 255, 255, .72);

  --g2-bg: rgba(255, 255, 255, .74);
  --g2-blur: blur(14px) saturate(160%);
  --g2-border: rgba(255, 255, 255, .78);

  --g3-bg: rgba(250, 249, 255, .80);
  --g3-blur: blur(20px) saturate(170%);
  --g3-border: rgba(255, 255, 255, .85);

  --g-edge: inset 0 1px 0 rgba(255, 255, 255, .85);
  --g-line: rgba(15, 23, 42, .07);
  --g-shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px -10px rgba(30, 20, 80, .14);
  --g-shadow-2: 0 2px 6px rgba(15, 23, 42, .05), 0 14px 34px -16px rgba(30, 20, 80, .22);
  --g-shadow-3: 0 4px 12px rgba(15, 23, 42, .06), 0 28px 70px -24px rgba(30, 20, 80, .32);
  --g-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ---------- 3. Glass utility levels ---------- */
.ag-glass-1,
.ag-glass-2,
.ag-glass-3 {
  position: relative;
  isolation: isolate;
}

.ag-glass-1 {
  background: var(--g1-bg) !important;
  -webkit-backdrop-filter: var(--g1-blur);
  backdrop-filter: var(--g1-blur);
  border: 1px solid var(--g1-border) !important;
  box-shadow: var(--g-edge), var(--g-shadow-1) !important;
}

.ag-glass-2 {
  background: var(--g2-bg) !important;
  -webkit-backdrop-filter: var(--g2-blur);
  backdrop-filter: var(--g2-blur);
  border: 1px solid var(--g2-border) !important;
  box-shadow: var(--g-edge), var(--g-shadow-2) !important;
}

.ag-glass-3 {
  background: var(--g3-bg) !important;
  -webkit-backdrop-filter: var(--g3-blur);
  backdrop-filter: var(--g3-blur);
  border: 1px solid var(--g3-border) !important;
  box-shadow: var(--g-edge), var(--g-shadow-3) !important;
}

/* subtle glass highlight (zero SVG feTurbulence software raster overhead) */
.ag-glass-2::after,
.ag-glass-3::after {
  display: none;
}

/* ---------- 4. Lite glass fallback (weak Android / reduced transparency / no blur support) ---------- */
html.lite-glass .ag-glass-1,
html.lite-glass .ag-glass-2,
html.lite-glass .ag-glass-3 {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html.lite-glass .ag-glass-1 {
  background: rgba(255, 255, 255, .94) !important;
}

html.lite-glass .ag-glass-2 {
  background: rgba(255, 255, 255, .97) !important;
}

html.lite-glass .ag-glass-3 {
  background: #fbfaff !important;
}

html.lite-glass .ag-glass-2::after,
html.lite-glass .ag-glass-3::after {
  display: none !important;
}

/* ---------- 5. Shared keyframes ---------- */
@keyframes agFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes agFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes agPop {
  0% {
    opacity: 0;
    transform: scale(.92);
  }

  60% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes agShimmer {
  from {
    transform: translate3d(-100%, 0, 0);
  }

  to {
    transform: translate3d(100%, 0, 0);
  }
}

@keyframes agShake {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  20%,
  60% {
    transform: translate3d(-6px, 0, 0);
  }

  40%,
  80% {
    transform: translate3d(6px, 0, 0);
  }
}

@keyframes agBreath {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .38);
  }

  65% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
}

/* Stagger helper: JS sets --ag-i on each child and adds .ag-stagger-in */
.ag-stagger-in {
  animation: agFadeUp var(--m-slow) var(--e-out) both;
  animation-delay: calc(var(--ag-i, 0) * 35ms);
}

/* Morph helper for icon swaps (copy -> check) */
.ag-morph-pop {
  animation: agPop var(--m-base) var(--e-spring) both;
}

.ag-shake {
  animation: agShake .32s var(--e-smooth) both;
}

/* Skeleton block (used from Stage 2) */
.ag-skel {
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, .06);
  border-radius: 10px;
}

.ag-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: agShimmer 1.3s var(--e-smooth) infinite;
}

/* ---------- 6. Reduced motion: keep it beautiful but static ---------- */
@media (prefers-reduced-motion: reduce) {

  html.ag-ready *,
  html.ag-ready *::before,
  html.ag-ready *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   STAGE 1 — LAYOUT FIXES
   ===================================================================== */

/* Fix 3: KPI cards were glued to the command bar (0px gap) on desktop */
html body.nl-app #root#root#root .app .main>.cards+.pro-cmdbar {
  margin-top: 16px !important;
}

/* Fix 8: preview selection outline was thick and covered text */
html body #editorModal .preview-selection-box {
  border: 1.5px solid rgba(124, 92, 255, .75) !important;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .12) !important;
  background: transparent !important;
  transition: top var(--m-base) var(--e-out), left var(--m-base) var(--e-out), width var(--m-base) var(--e-out), height var(--m-base) var(--e-out), opacity var(--m-fast) ease !important;
}

/* Fix 7: hover background must never "stick" on touch devices */
@media (hover: none) {

  html body.nl-app #root .snav button:not(.active):hover,
  html body.nl-app #root .snav a:not(.active):hover {
    background: transparent !important;
  }
}

/* Fix 5: radius quick chips overflowed the screen on phones */
html body #editorModal #proStudio .ps-quick {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

html body #editorModal #proStudio .ps-quick button {
  min-width: 0 !important;
  padding: 0 4px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

@media (max-width: 768px) {

  /* Fix 4: second Pro Studio tab row becomes a clean scrollable pill row (no clipped "Эффекты") */
  html body #editorModal#editorModal #proStudio .ps-tabs {
    gap: 2px !important;
    padding: 3px !important;
    border-radius: 12px !important;
    background: rgba(20, 16, 50, .04) !important;
    scroll-snap-type: x proximity !important;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
  }

  html body #editorModal#editorModal #proStudio .ps-tabs button {
    flex: 0 0 auto !important;
    flex-direction: row !important;
    gap: 6px !important;
    min-width: auto !important;
    height: 36px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    scroll-snap-align: center !important;
  }

  html body #editorModal#editorModal #proStudio .ps-tabs button svg {
    width: 15px !important;
    height: 15px !important;
  }

  html body #editorModal#editorModal #proStudio .ps-tabs-ink {
    top: 3px !important;
    bottom: 3px !important;
    border-radius: 9px !important;
  }

  html body #editorModal#editorModal #proStudio .ps-quick button {
    font-size: 11px !important;
    height: 34px !important;
  }

  /* Fix 6: floating ⚡ FAB covered link cards on phones — moved into the header row by JS */
  html body.nl-app .spl-fab#splOpenAnalytics {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  html body.nl-app #root .main .topact .ag-trk-btn {
    display: inline-flex !important;
  }

  /* Fix 9: compact mobile header — language switch lives in Settings, not on every screen */
  html body.nl-app:not(.uip-dash-settings) #root .app .main>.top .topact .lang {
    display: none !important;
  }

  html body.nl-app.uip-dash-analytics #root .app .main>.top {
    position: relative !important;
  }

  html body.nl-app.uip-dash-analytics #root .app .main>.top .topact {
    position: absolute !important;
    top: 6px !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: auto !important;
  }

  html body.nl-app.uip-dash-analytics #root .app .main>.top::after,
  html body.nl-app.uip-dash-analytics #root .app .main>.top .topact::before {
    display: none !important;
  }

  html body.nl-app.uip-dash-analytics #root .app .main>.top>div:first-child {
    padding-right: 104px !important;
  }

  html body.nl-app.uip-dash-analytics #root .app .main>.top .topact {
    display: flex !important;
    gap: 8px !important;
  }
}

/* Mobile tracker-analytics button injected into the header row (hidden on desktop) */
html body.nl-app #root .main .topact .ag-trk-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
  color: #5b3fe0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform var(--m-fast) var(--e-out), background var(--m-fast) ease;
}

html body.nl-app #root .main .topact .ag-trk-btn:active {
  transform: scale(.95);
}

html body.nl-app #root .main .topact .ag-trk-btn svg {
  width: 18px;
  height: 18px;
}

/* =====================================================================
   STAGE 2 — CABINET SHELL: glass sidebar & bottom nav, sliding pills,
   page-enter transitions, ambient drifting blobs, glass toasts
   ===================================================================== */

/* ---------- 2.1 Ambient background blobs (behind cabinet content) ---------- */
html body.nl-app #root .app>.ag-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

html body.nl-app #root .app>.ag-blobs>i {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: .55;
  will-change: transform;
}

html body.nl-app #root .app>.ag-blobs>i:nth-child(1) {
  width: 640px;
  height: 640px;
  left: 10%;
  top: -220px;
  background: radial-gradient(circle, rgba(139, 92, 246, .22) 0%, rgba(139, 92, 246, .08) 42%, rgba(139, 92, 246, 0) 72%);
  animation: agBlobA 46s ease-in-out infinite alternate;
}

html body.nl-app #root .app>.ag-blobs>i:nth-child(2) {
  width: 580px;
  height: 580px;
  right: -160px;
  top: 26%;
  background: radial-gradient(circle, rgba(236, 72, 153, .14) 0%, rgba(236, 72, 153, .05) 42%, rgba(236, 72, 153, 0) 72%);
  animation: agBlobB 54s ease-in-out infinite alternate;
}

html body.nl-app #root .app>.ag-blobs>i:nth-child(3) {
  width: 600px;
  height: 600px;
  left: 26%;
  bottom: -260px;
  background: radial-gradient(circle, rgba(56, 189, 248, .15) 0%, rgba(56, 189, 248, .05) 42%, rgba(56, 189, 248, 0) 72%);
  animation: agBlobC 60s ease-in-out infinite alternate;
}

@keyframes agBlobA {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(90px, 70px, 0);
  }
}

@keyframes agBlobB {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-110px, -60px, 0);
  }
}

@keyframes agBlobC {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(80px, -90px, 0);
  }
}

html.lite-glass body.nl-app #root .app>.ag-blobs>i,
html.ag-reduce body.nl-app #root .app>.ag-blobs>i {
  animation: none !important;
}

html body.nl-app #root .app>.main {
  position: relative;
  z-index: 1;
  contain: layout style;
}

@media (max-width: 768px) {
  html body.nl-app #root .app>.ag-blobs>i {
    opacity: .45;
  }

  html body.nl-app #root .app>.ag-blobs>i:nth-child(1) {
    width: 400px;
    height: 400px;
    left: -100px;
    top: -140px;
  }

  html body.nl-app #root .app>.ag-blobs>i:nth-child(2) {
    width: 360px;
    height: 360px;
    right: -140px;
  }

  html body.nl-app #root .app>.ag-blobs>i:nth-child(3) {
    display: none;
  }
}

/* ---------- 2.2 Glass sidebar (desktop + mobile drawer) ---------- */
html body.nl-app #root#root .app .side {
  background: rgba(255, 255, 255, .82) !important;
  -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
  backdrop-filter: blur(10px) saturate(140%) !important;
  border-right: 1px solid rgba(255, 255, 255, .85) !important;
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, .06), 8px 0 28px -22px rgba(30, 20, 80, .16) !important;
}

html.lite-glass body.nl-app #root#root .app .side {
  background: rgba(255, 255, 255, .97) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ---------- 2.3 Sliding active pill in the sidebar ---------- */
html body.nl-app #root .app .side .snav {
  position: relative !important;
}

html body.nl-app #root .app .side .snav>.ag-nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(124, 92, 255, .11), rgba(124, 92, 255, .07));
  border: 1px solid rgba(104, 71, 238, .22);
  box-shadow: inset 3px 0 0 #6847ee, 0 6px 16px -10px rgba(104, 71, 238, .45);
  pointer-events: none;
  transition: opacity var(--m-fast) ease;
}

html body.nl-app #root .app .side .snav>button,
html body.nl-app #root .app .side .snav>a {
  position: relative;
  z-index: 1;
}

html body.nl-app #root#root#root .app .side .snav.ag-has-pill>button[data-dash].active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html body.nl-app #root#root#root .app .side .snav.ag-has-pill>button[data-dash].active::before,
html body.nl-app #root#root#root .app .side .snav.ag-has-pill>button[data-dash].active::after {
  opacity: 0 !important;
}

/* Sidebar icon micro-motion on hover (mouse only) */
html body.nl-app #root .app .side .snav>button .snav-icon {
  transition: transform var(--m-base) var(--e-spring);
}

@media (hover: hover) {
  html body.nl-app #root .app .side .snav>button:hover .snav-icon {
    transform: translate3d(0, -1px, 0) scale(1.08);
  }

  html body.nl-app #root .app .side .snav>button[data-dash="settings"]:hover .snav-icon {
    transform: rotate(45deg) scale(1.06);
  }

  html body.nl-app #root .app .side .snav>button[data-dash="analytics"]:hover .snav-icon {
    transform: translate3d(1px, -1px, 0) scale(1.08);
  }
}

/* Online dot in the profile card breathes softly */
html body.nl-app #root .app .side .sideuser .pro-ava-dot {
  animation: agBreath 2.6s ease-in-out infinite;
}

/* ---------- 2.4 Glass docked bottom nav (phones) with sliding pill ----------
   Stays docked flush to the bottom (as approved earlier); only glass + motion added. */
@media (max-width: 768px) {
  html body.pro-ui.nl-app.uip-has-bnav:not(.uip-editor-open):not(.uip-overlay-open):not(.uip-drawer-open) nav.uip-bnav {
    background: rgba(255, 255, 255, .80) !important;
    border-top: 1px solid rgba(255, 255, 255, .9) !important;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .06), 0 -10px 30px -14px rgba(30, 20, 80, .22) !important;
  }

  html.lite-glass body.pro-ui.nl-app.uip-has-bnav:not(.uip-editor-open):not(.uip-overlay-open):not(.uip-drawer-open) nav.uip-bnav {
    background: rgba(255, 255, 255, .97) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  html body.nl-app nav.uip-bnav>.ag-bnav-pill {
    position: absolute;
    top: 6px;
    left: 0;
    z-index: 0;
    display: block;
    border-radius: 14px;
    background: rgba(124, 92, 255, .10);
    border: 1px solid rgba(104, 71, 238, .16);
    pointer-events: none;
    transition: transform var(--m-slow) var(--e-out), width var(--m-slow) var(--e-out), opacity var(--m-fast) ease;
  }

  html body.nl-app nav.uip-bnav>button {
    position: relative;
    z-index: 1;
  }

  html body.nl-app nav.uip-bnav.ag-has-pill>button.is-active:not(.uip-bnav-new) {
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.nl-app nav.uip-bnav>button svg {
    transition: transform var(--m-base) var(--e-spring);
  }

  html body.nl-app nav.uip-bnav>button.is-active:not(.uip-bnav-new) svg {
    transform: translate3d(0, -1px, 0) scale(1.08);
  }

  html body.nl-app nav.uip-bnav>.uip-bnav-new:active svg {
    transform: rotate(90deg) scale(.92);
  }

  html body.nl-app nav.uip-bnav>button:active {
    transform: scale(.96);
  }

  /* keep the last card clear of the floating nav */
  html body.nl-app.uip-has-bnav #root .app .main {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ---------- 2.5 Page-enter transition between cabinet sections ---------- */
@keyframes agPageIn {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body.nl-app #root .app .main>.ag-page-in {
  animation: agPageIn var(--m-page) var(--e-out) both;
  animation-delay: calc(var(--ag-i, 0) * 45ms);
}

/* ---------- 2.6 Header micro-motion ---------- */
html body.nl-app #root .main .topact #newLink {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

html body.nl-app #root .main .topact #newLink::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: translate3d(-160%, 0, 0) skewX(-18deg);
  animation: agBtnShine 7s var(--e-smooth) 2.5s infinite;
}

@keyframes agBtnShine {

  0%,
  82% {
    transform: translate3d(-160%, 0, 0) skewX(-18deg);
  }

  100% {
    transform: translate3d(330%, 0, 0) skewX(-18deg);
  }
}

html body.nl-app #root .main .topact #newLink .aru-plus-ic {
  transition: transform var(--m-base) var(--e-spring);
}

@media (hover: hover) {
  html body.nl-app #root .main .topact #newLink:hover .aru-plus-ic {
    transform: rotate(90deg);
  }
}

html body.nl-app #root .main .topact #newLink:active {
  transform: scale(.97);
}

/* Desktop: dark tracker-analytics FAB becomes a light glass pill matching the UI */
@media (min-width: 769px) {
  html body.nl-app .spl-btn.spl-fab#splOpenAnalytics {
    background: rgba(255, 255, 255, .78) !important;
    color: #4c32d8 !important;
    border: 1px solid rgba(255, 255, 255, .9) !important;
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(104, 71, 238, .12), 0 14px 32px -14px rgba(30, 20, 80, .35) !important;
    transition: transform var(--m-base) var(--e-out), box-shadow var(--m-base) ease !important;
  }

  html body.nl-app .spl-btn.spl-fab#splOpenAnalytics svg,
  html body.nl-app .spl-btn.spl-fab#splOpenAnalytics * {
    color: #4c32d8 !important;
  }

  html body.nl-app .spl-btn.spl-fab#splOpenAnalytics:hover {
    transform: translate3d(0, -2px, 0) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(104, 71, 238, .22), 0 18px 38px -14px rgba(30, 20, 80, .4) !important;
  }

  html.lite-glass body.nl-app .spl-btn.spl-fab#splOpenAnalytics {
    background: #fff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* ---------- 2.7 Glass toasts with spring entrance ---------- */
@keyframes agToastIn {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body #arushanGlobalToast {
  background: rgba(15, 23, 42, .86) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 18px 40px -14px rgba(15, 23, 42, .45) !important;
  animation: agToastIn var(--m-slow) var(--e-spring) both;
}

html.lite-glass body #arushanGlobalToast {
  background: #0f172a !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 768px) {
  html body #arushanGlobalToast {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body:not(.uip-has-bnav) #arushanGlobalToast {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* =====================================================================
   STAGE 3 — CABINET SCREENS
   ===================================================================== */

/* ---------- 3.1 Glass KPI cards with gentle hover lift ---------- */
html body.nl-app #root#root .app .main .cards>.stat {
  background: rgba(255, 255, 255, .74) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border-color: rgba(255, 255, 255, .85) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(15, 23, 42, .05), 0 8px 24px -16px rgba(30, 20, 80, .22) !important;
  transition: transform var(--m-base) var(--e-out), box-shadow var(--m-base) ease !important;
}

html.lite-glass body.nl-app #root#root .app .main .cards>.stat {
  background: #fff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html body.nl-app #root .app .main .cards>.stat .pro-stat-ic {
  transition: transform var(--m-base) var(--e-spring);
}

@media (hover: hover) {
  html body.nl-app #root#root .app .main .cards>.stat:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(104, 71, 238, .12), 0 14px 30px -16px rgba(30, 20, 80, .3) !important;
  }

  html body.nl-app #root .app .main .cards>.stat:hover .pro-stat-ic {
    transform: scale(1.08);
  }
}

html body.nl-app #root .app .main .cards>.stat strong {
  font-variant-numeric: tabular-nums;
}

/* ---------- 3.2 Glass command bar ---------- */
html body.pro-ui.nl-app #root#root .app .main .pro-cmdbar {
  background: rgba(255, 255, 255, .72) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-color: rgba(255, 255, 255, .85) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(15, 23, 42, .05), 0 8px 24px -18px rgba(30, 20, 80, .22) !important;
}

html.lite-glass body.pro-ui.nl-app #root#root .app .main .pro-cmdbar {
  background: #fff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ---------- 3.3 Sliding segment pills ---------- */
html body.nl-app .ag-seg {
  position: relative !important;
}

html body.nl-app .ag-seg>button {
  position: relative;
  z-index: 1;
}

html body.nl-app .ag-seg>.ag-seg-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  transition: transform var(--m-slow) var(--e-out), width var(--m-slow) var(--e-out), height var(--m-slow) var(--e-out), opacity var(--m-fast) ease;
}

html body.nl-app #root .main .pro-cmd-pills>.ag-seg-pill {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -6px rgba(30, 20, 80, .18);
}

html body.pro-ui.nl-app #root#root#root .app .main .pro-cmd-pills.ag-seg-on>.pro-cmd-pill.active {
  background: transparent !important;
  box-shadow: none !important;
}

html body.nl-app #root .main .rs-periods>.ag-seg-pill {
  background: #6847ee;
  box-shadow: 0 4px 12px -4px rgba(104, 71, 238, .55);
}

html body.nl-app #root#root .main .rs-periods.ag-seg-on>button.is-on {
  background: transparent !important;
  box-shadow: none !important;
}

html body.nl-app #root .main .rs-periods>button {
  transition: color var(--m-base) ease !important;
}

/* ---------- 3.4 Rows: hover, status morph, copy pop, sparkline draw ---------- */
html body.nl-app #root .main section.table .row {
  transition: background-color var(--m-fast) ease, box-shadow var(--m-base) ease;
}

@media (hover: hover) and (min-width: 1024px) {
  html body.nl-app #root .main section.table .row.pro-row:hover {
    background-color: rgba(124, 92, 255, .035) !important;
  }
}

html body.nl-app #root .main section.table .row .status {
  transition: background-color var(--m-base) ease, color var(--m-base) ease, border-color var(--m-base) ease, transform var(--m-fast) var(--e-out) !important;
}

html body.nl-app #root .main section.table .row .status:active {
  transform: scale(.96);
}

html body.nl-app #root .main .rowact .iconbtn {
  transition: background-color var(--m-fast) ease, color var(--m-fast) ease, transform var(--m-fast) var(--e-out) !important;
}

html body.nl-app #root .main .rowact .iconbtn:active {
  transform: scale(.92);
}

html body.nl-app #root .main .rowact .iconbtn.copied svg {
  animation: agPop var(--m-base) var(--e-spring) both;
}

@keyframes agDraw {
  to {
    stroke-dashoffset: 0;
  }
}

html body.nl-app .pro-spark-svg.ag-spark-draw path[stroke] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: agDraw .9s var(--e-out) .12s forwards;
}

html body.nl-app .pro-spark-svg.ag-spark-draw path:not([stroke]) {
  animation: agFadeIn .6s ease .5s both;
}

html body.nl-app .pro-spark-svg.ag-spark-draw circle {
  animation: agPop .35s var(--e-spring) .95s both;
  transform-box: fill-box;
  transform-origin: center;
}

/* ---------- 3.5 Compact row actions "⋯" (desktop ≥ 1024px) ---------- */
html body.nl-app #root .main .rowact.ag-acts {
  position: relative;
}

html body.nl-app #root .main .rowact .ag-more {
  display: none;
}

@media (min-width: 1024px) {
  html body.nl-app #root .main .rowact.ag-acts .ag-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  html body.nl-app #root .main .rowact.ag-acts-open .ag-more {
    background: rgba(124, 92, 255, .12) !important;
    color: #5b3fe0 !important;
  }

  html body.nl-app #root .main .rowact>.ag-acts-pop {
    position: absolute;
    top: 50%;
    right: 40px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(15, 23, 42, .06), 0 14px 32px -12px rgba(30, 20, 80, .3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(8px, -50%, 0) scale(.96);
    transform-origin: right center;
    transition: opacity var(--m-base) var(--e-out), transform var(--m-base) var(--e-out), visibility 0s linear var(--m-base);
  }

  html.lite-glass body.nl-app #root .main .rowact>.ag-acts-pop {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html body.nl-app #root .main .rowact.ag-acts-open>.ag-acts-pop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, -50%, 0) scale(1);
    transition: opacity var(--m-base) var(--e-out), transform var(--m-base) var(--e-spring), visibility 0s;
  }
}

@media (max-width: 1023.98px) {
  html body.nl-app #root .main .rowact>.ag-acts-pop {
    display: contents;
  }
}

/* ---------- 3.6 Settings section chips + flash ---------- */
html body.nl-app #root .main>.ag-set-chips {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(15, 23, 42, .05);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  animation: agFadeUp var(--m-slow) var(--e-out) both;
}

html body.nl-app #root .main>.ag-set-chips::-webkit-scrollbar {
  display: none;
}

html.lite-glass body.nl-app #root .main>.ag-set-chips {
  background: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html body.nl-app #root .main>.ag-set-chips>button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font: 600 12.5px/1 Inter, system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--m-base) ease, color var(--m-base) ease, transform var(--m-fast) var(--e-out);
}

html body.nl-app #root .main>.ag-set-chips>button:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, .04);
}

html body.nl-app #root .main>.ag-set-chips>button.is-on {
  background: #fff;
  color: #5b3fe0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -6px rgba(30, 20, 80, .18);
}

html body.nl-app #root .main>.ag-set-chips>button:active {
  transform: scale(.97);
}

@keyframes agFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 92, 255, 0);
  }

  30% {
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .22);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(124, 92, 255, 0);
  }
}

html body.nl-app #root .main .ag-flash {
  animation: agFlash 1.2s var(--e-out) both;
}

/* ---------- 3.7 Saved-button morph ---------- */
html body .ag-saved {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
  animation: agPop var(--m-base) var(--e-spring) both;
}

/* ---------- 3.8 Quick start: checkmark pop ---------- */
html body.nl-app #root .main #proQuickStart .pro-qs-step.is-done .pro-qs-num {
  animation: agPop .45s var(--e-spring) both;
}

html body.nl-app #root .main #proQuickStart.pro-qs-card {
  background: rgba(255, 255, 255, .78) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}

html.lite-glass body.nl-app #root .main #proQuickStart.pro-qs-card {
  background: #fff !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ---------- 3.9 Ctrl/⌘+K command palette ---------- */
.ag-cmd {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh 16px 16px;
}

.ag-cmd-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .32);
  opacity: 0;
  transition: opacity var(--m-base) ease;
}

.ag-cmd-box {
  position: relative;
  width: min(620px, 100%);
  max-height: 64vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(250, 249, 255, .86);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 30px 80px -24px rgba(30, 20, 80, .45);
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, -10px, 0) scale(.97);
  transition: opacity var(--m-base) var(--e-out), transform var(--m-slow) var(--e-spring);
}

html.lite-glass .ag-cmd-box {
  background: #fbfaff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ag-cmd.is-open .ag-cmd-bg {
  opacity: 1;
}

.ag-cmd.is-open .ag-cmd-box {
  opacity: 1;
  transform: none;
}

.ag-cmd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, .07);
  color: #64748b;
}

html body .ag-cmd .ag-cmd-head input.ag-cmd-input,
html body.nl-app .ag-cmd .ag-cmd-head input.ag-cmd-input:not([type="checkbox"]):not([type="radio"]) {
  all: unset !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font: 500 15px/1.4 Inter, system-ui, sans-serif !important;
  color: #0f172a !important;
}

.ag-cmd-head kbd {
  font: 600 10.5px/1 Inter, system-ui, sans-serif;
  color: #64748b;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, .06);
}

.ag-cmd-list {
  padding: 6px;
  overflow-y: auto;
}

.ag-cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
  transition: background-color var(--m-fast) ease;
}

.ag-cmd-item.is-on,
.ag-cmd-item:hover {
  background: rgba(124, 92, 255, .1);
}

.ag-cmd-ic {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  color: #5b3fe0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .06);
}

.ag-cmd-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ag-cmd-txt b {
  font: 600 13.5px/1.3 Inter, system-ui, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-cmd-txt small {
  font: 500 11.5px/1.3 Inter, system-ui, sans-serif;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-cmd-empty {
  padding: 22px;
  text-align: center;
  color: #64748b;
  font: 500 13px/1.4 Inter, system-ui, sans-serif;
}

.ag-cmd-foot {
  padding: 9px 16px;
  border-top: 1px solid rgba(15, 23, 42, .07);
  color: #94a3b8;
  font: 500 11px/1.3 Inter, system-ui, sans-serif;
}


/* =====================================================================
   STAGE 4 — TEMPLATE GALLERY & EDITOR
   ===================================================================== */

/* ---------- 4.1 Template picker: staggered cards, live mini previews, picked handoff ---------- */
@keyframes agCardIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body #proTplPicker.is-open .pro-tpl-card {
  animation: agCardIn .46s var(--e-out) both;
}

html body #proTplPicker.is-open .pro-tpl-card:nth-child(1) {
  animation-delay: .06s;
}

html body #proTplPicker.is-open .pro-tpl-card:nth-child(2) {
  animation-delay: .11s;
}

html body #proTplPicker.is-open .pro-tpl-card:nth-child(3) {
  animation-delay: .16s;
}

html body #proTplPicker.is-open .pro-tpl-card:nth-child(4) {
  animation-delay: .21s;
}

html body #proTplPicker .pro-tpl-card {
  transition: transform var(--m-base) var(--e-out), box-shadow var(--m-base) ease, border-color var(--m-base) ease, opacity var(--m-base) ease, filter var(--m-base) ease !important;
}

@media (hover: hover) {
  html body #proTplPicker .pro-tpl-card:hover {
    transform: translate3d(0, -3px, 0);
  }

  /* previews come alive on hover */
  html body #proTplPicker .pro-tpl-card:hover .ptm-white-cta {
    animation: agCtaPulse 1.6s var(--e-smooth) infinite;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-flow-node.is-acc {
    animation: agCtaPulse 1.6s var(--e-smooth) infinite;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-branch {
    animation: agBranchIn .5s var(--e-spring) both;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-branch:nth-child(2) {
    animation-delay: .08s;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-branch:nth-child(3) {
    animation-delay: .16s;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-ver {
    display: inline-block;
    animation: agPop .45s var(--e-spring) both;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-tg-btn1 {
    animation: agCtaPulse 1.6s var(--e-smooth) infinite;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-ed-btn1,
  html body #proTplPicker .pro-tpl-card:hover .ptm-ed-btn2 {
    animation: agBranchIn .45s var(--e-spring) both;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-ed-row .ptm-ed-btn2:nth-child(1) {
    animation-delay: .08s;
  }

  html body #proTplPicker .pro-tpl-card:hover .ptm-ed-row .ptm-ed-btn2:nth-child(2) {
    animation-delay: .16s;
  }
}

@keyframes agCtaPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

@keyframes agBranchIn {
  from {
    opacity: .3;
    transform: translate3d(0, 6px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body #proTplPicker .pro-tpl-dialog.ag-picking .pro-tpl-card:not(.ag-picked) {
  opacity: .35;
  filter: saturate(.6);
  transform: scale(.98);
}

html body #proTplPicker .pro-tpl-card.ag-picked {
  transform: scale(1.025) !important;
  border-color: #6847ee !important;
  box-shadow: 0 0 0 3px rgba(104, 71, 238, .18), 0 24px 50px -20px rgba(30, 20, 80, .4) !important;
}

/* ---------- 4.2 Editor: staggered columns on open ---------- */
@keyframes agColIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body #editorModal.ag-ed-in .builder-outline {
  animation: agColIn .5s var(--e-out) .04s both;
}

html body #editorModal.ag-ed-in .builder-inspector {
  animation: agColIn .5s var(--e-out) .1s both;
}

html body #editorModal.ag-ed-in .builder-stage {
  animation: agColIn .5s var(--e-out) .16s both;
}

html body #editorModal.ag-ed-in .editorfoot {
  animation: agFadeIn .5s ease .2s both;
}

/* Editor header: crisp lightweight glass + containment */
html body #editorModal#editorModal .editorhead {
  background: rgba(255, 255, 255, .88) !important;
  -webkit-backdrop-filter: blur(8px) saturate(135%) !important;
  backdrop-filter: blur(8px) saturate(135%) !important;
}

html body #editorModal .editor,
html body #editorModal .builder-inspector,
html body #editorModal .builder-stage {
  contain: layout style;
}

/* Pause heavy background compositing behind open modals so editor runs at silky 60fps */
html body.uip-editor-open #root .app>.ag-blobs>i,
html body:has(#editorModal.open) #root .app>.ag-blobs>i,
html body:has(#authModal.open) #root .app>.ag-blobs>i,
html body:has(#proTplPicker.is-open) #root .app>.ag-blobs>i {
  animation-play-state: paused !important;
}

html body.uip-editor-open #root#root .app .side,
html body.uip-editor-open #root#root .pro-cmdbar,
html body.uip-editor-open #root#root .lang,
html body:has(#editorModal.open) #root#root .app .side,
html body:has(#editorModal.open) #root#root .pro-cmdbar,
html body:has(#editorModal.open) #root#root .lang {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Smooth crossfade on language switch */
@keyframes agLangFade {
  from {
    opacity: .68;
    transform: translate3d(0, 3px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body.nl-app #root .app>.main.ag-lang-swap {
  animation: agLangFade .22s var(--e-out) both;
}

html.lite-glass body #editorModal#editorModal .editorhead {
  background: #fff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ---------- 4.3 Inspector pane swap ---------- */
@keyframes agPaneIn {
  from {
    opacity: 0;
    transform: translate3d(12px, 0, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html body #editorModal .builder-inspector.ag-pane-swap> :not(.builder-inspector-head) {
  animation: agPaneIn .34s var(--e-out) both;
}

@media (max-width: 768px) {
  html body #editorModal .builder-inspector.ag-pane-swap> :not(.builder-inspector-head) {
    animation-name: agFadeUp;
  }
}

/* Pro Studio tab content fades in */
html body #editorModal #proStudio .ps-pane.active {
  animation: agFadeUp .3s var(--e-out) both;
}

/* Builder outline nodes: smooth hover/active */
html body #editorModal .builder-outline .builder-node {
  transition: background-color var(--m-fast) ease, border-color var(--m-fast) ease, box-shadow var(--m-base) ease, transform var(--m-base) var(--e-out) !important;
}

html body #editorModal .builder-outline .builder-node:active {
  transform: scale(.985);
}

html body #editorModal .builder-outline .builder-node.active .builder-node-ic,
html body #editorModal .builder-outline .builder-node.active>span:first-child {
  animation: agPop .36s var(--e-spring) both;
}

/* ---------- 4.4 Phone screen crossfade on template change ---------- */
@keyframes agScrSwap {
  0% {
    opacity: .35;
    transform: scale(.985);
    filter: saturate(.7);
  }

  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

html body #editorModal #editorScreen.ag-scr-swap> :not(.aru-pro-bg) {
  animation: agScrSwap .46s var(--e-out) both;
}

html body #editorModal #editorScreen .aru-pro-fill {
  transition: background-color .3s ease, filter .3s ease;
}

/* ---------- 4.5 Sliding pills inside editor (mobile tabs, mode toggle, zoom tools) ---------- */
html body #editorModal .mobile-segment-tabs>.ag-seg-pill {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -6px rgba(30, 20, 80, .2);
}

html body.nl-app #editorModal#editorModal .mobile-segment-tabs.ag-seg-on>.mobile-segment-tab.active {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

html body #editorModal .mobile-builder-toggle>.ag-seg-pill {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -6px rgba(30, 20, 80, .2);
}

html body.nl-app #editorModal#editorModal .mobile-builder-toggle.ag-seg-on>.btn-builder-mode.active {
  background: transparent !important;
  box-shadow: none !important;
}

html body #editorModal .device-preview-toolbar .preview-tools>.ag-seg-pill {
  background: #6847ee;
  box-shadow: 0 4px 12px -4px rgba(104, 71, 238, .5);
}

html body.nl-app #editorModal#editorModal .builder-stage .device-preview-toolbar .preview-tools.ag-seg-on>.preview-tool.active {
  background: transparent !important;
  box-shadow: none !important;
}

html body #editorModal .mobile-segment-tabs>button,
html body #editorModal .mobile-builder-toggle>button,
html body #editorModal .device-preview-toolbar .preview-tools>button {
  transition: color var(--m-base) ease !important;
}

/* ---------- 4.6 Drag & drop of extra link blocks ---------- */
html body.ag-drag-on,
html body.ag-drag-on * {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grabbing !important;
}

html body #editorModal .builder-outline [data-builder-node^="extra-"] {
  cursor: grab;
  touch-action: pan-y;
}

html body #editorModal .builder-outline .builder-node.ag-drag-sib {
  transition: transform var(--m-base) var(--e-out) !important;
}

html body #editorModal .builder-outline .builder-node.ag-dragging {
  position: relative;
  z-index: 20;
  transition: none !important;
  background: #fff !important;
  border-color: rgba(104, 71, 238, .5) !important;
  box-shadow: 0 0 0 3px rgba(104, 71, 238, .12), 0 18px 36px -14px rgba(30, 20, 80, .4) !important;
}

html body #editorModal .builder-outline .builder-node.ag-drop-pop {
  animation: agPop .4s var(--e-spring) both;
}

/* ---------- 4.7 Tracker mode cards & share/QR ---------- */
html body .spl-mcard {
  transition: border-color var(--m-base) ease, box-shadow var(--m-base) ease, background-color var(--m-base) ease, transform var(--m-fast) var(--e-out) !important;
}

html body .spl-mcard:active {
  transform: scale(.985);
}

html body .spl-mcard.is-selected {
  animation: agPop .38s var(--e-spring) both;
}

@keyframes agQrIn {
  from {
    clip-path: circle(0% at 50% 50%);
    opacity: .4;
  }

  to {
    clip-path: circle(75% at 50% 50%);
    opacity: 1;
  }
}

html body .sh-modal .sh-qr svg,
html body .sh-modal .sh-qr canvas,
html body .sh-modal .sh-qr img {
  animation: agQrIn .7s var(--e-out) .12s both;
}

html body .sh-modal .sh-sheet {
  animation: agColIn .42s var(--e-spring) both;
}


/* =====================================================================
   STAGE 5 — LANDING PAGE
   ===================================================================== */

/* Generic segment pill base (landing has no body.nl-app) */
.ag-seg {
  position: relative !important;
}

.ag-seg>button {
  position: relative;
  z-index: 1;
}

.ag-seg>.ag-seg-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  transition: transform var(--m-slow) var(--e-out), width var(--m-slow) var(--e-out), height var(--m-slow) var(--e-out), opacity var(--m-fast) ease;
}

html body .ag-seg>.lang-btn~.ag-seg-pill,
html body .ag-seg>.ag-seg-pill:first-child:not(:only-child) {}

html body .ag-seg:has(> .lang-btn)>.ag-seg-pill {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .06);
}

html body .ag-seg.ag-seg-on>.lang-btn.active {
  background: transparent !important;
  box-shadow: none !important;
}

/* ---------- 5.1 Robot float + parallax ---------- */
@keyframes agRoboFloat {

  0%,
  100% {
    translate: var(--agx, 0px) var(--agy, 0px);
    rotate: 0deg;
  }

  50% {
    translate: var(--agx, 0px) calc(var(--agy, 0px) - 9px);
    rotate: -1.2deg;
  }
}

html.ag-landing #roboCanvasWrap {
  animation: agRoboFloat 6s ease-in-out infinite;
  will-change: translate, rotate;
}

html.ag-landing #roboOrbitSvg {
  translate: calc(var(--agx, 0px) * -0.4) calc(var(--agy, 0px) * -0.4);
  transition: translate .2s linear;
}

html.ag-landing #fc1 {
  translate: calc(var(--agx, 0px) * -1.4) calc(var(--agy, 0px) * -1.4);
}

html.ag-landing #fc2 {
  translate: calc(var(--agx, 0px) * -1.1) calc(var(--agy, 0px) * -1.1);
}

html.ag-landing #fc3 {
  translate: calc(var(--agx, 0px) * -1.7) calc(var(--agy, 0px) * -1.7);
}

html.ag-landing .orbit-rotate {
  animation-duration: 60s;
}

/* ---------- 5.2 Hero title reveal + brand dot pop ---------- */
@keyframes agTitleIn {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translate3d(0, 18px, 0);
  }

  to {
    clip-path: inset(-10% -5% -15% -5%);
    transform: none;
  }
}

@keyframes agDotPop {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

html.ag-landing #heroLeft h1 {
  animation: agTitleIn .9s cubic-bezier(.16, 1, .3, 1) .12s both;
}

html.ag-landing #heroLeft h1 .text-brand {
  display: inline-block;
  transform-origin: 50% 80%;
  animation: agDotPop .6s var(--e-spring) .85s both;
}

/* ---------- 5.3 Primary CTA: magnet + soft shine ---------- */
html.ag-landing .btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

html.ag-landing .btn-primary.ag-magnet {
  translate: var(--agmx, 0px) var(--agmy, 0px);
  transition: background-color .25s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease, translate .25s var(--e-out);
}

html.ag-landing .btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .34), transparent);
  transform: translate3d(-170%, 0, 0) skewX(-18deg);
  animation: agBtnShine 6.5s var(--e-smooth) 1.8s infinite;
}

/* ---------- 5.4 "How it works" / share modal grows from its button ---------- */
html.ag-landing .nl-modal.ag-grow .modal-panel {
  transform: scale(.55);
  opacity: 0;
  transition: transform .5s var(--e-spring), opacity .28s ease;
}

html.ag-landing .nl-modal.ag-grow.open .modal-panel {
  transform: scale(1);
  opacity: 1;
}

/* ---------- 5.5 Navbar glass on scroll ---------- */
html.ag-landing #navWrap:has(#navbar.nav-scrolled) {
  background: rgba(255, 255, 255, .72) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .06), 0 10px 30px -18px rgba(20, 12, 60, .18) !important;
}

html.lite-glass.ag-landing #navWrap:has(#navbar.nav-scrolled) {
  background: rgba(255, 255, 255, .97) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ---------- 5.6 Traffic cards: arrow runs in-app → browser ---------- */
@keyframes agArrowRun {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(3px, 0, 0);
  }
}

@media (hover: hover) {
  html.ag-landing .tech-card:hover .lucide-arrow-right {
    animation: agArrowRun .8s var(--e-smooth) infinite;
  }

  html.ag-landing .tech-card:hover .squircle {
    transform: scale(1.1) rotate(-6deg);
  }
}

/* ---------- 5.7 Mobile drawer: links cascade in ---------- */
html.ag-landing #drawer.open .drawer-link {
  animation: agFadeUp .42s var(--e-out) both;
}

html.ag-landing #drawer.open .drawer-link:nth-of-type(1) {
  animation-delay: .06s;
}

html.ag-landing #drawer.open .drawer-link:nth-of-type(2) {
  animation-delay: .1s;
}

html.ag-landing #drawer.open .drawer-link:nth-of-type(3) {
  animation-delay: .14s;
}

html.ag-landing #drawer.open .drawer-link:nth-of-type(4) {
  animation-delay: .18s;
}

/* ---------- 5.8 Final CTA: floating logo + breathing halo ---------- */
@keyframes agLogoFloat {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -6px, 0);
  }
}

@keyframes agHalo {

  0%,
  100% {
    opacity: .75;
    transform: translateX(-50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

html.ag-landing #start img[src*="logo-mark"] {
  animation: agLogoFloat 4.5s ease-in-out infinite;
}

html.ag-landing #start .reveal>div.absolute:first-child {
  animation: agHalo 7s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {

  html.ag-landing #roboCanvasWrap,
  html.ag-landing #heroLeft h1,
  html.ag-landing #heroLeft h1 .text-brand,
  html.ag-landing .btn-primary::after {
    animation: none !important;
  }
}


/* =====================================================================
   STAGE 6 — LOGIN & REGISTRATION MODAL
   ===================================================================== */

/* Clean single-pass entrance (disables conflicting app-1.css authModalPop + heavy backdrop blur stutter) */
@keyframes agAuthCleanIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

html body #authModal#authModal.modalbg,
html body #authModal#authModal.modalbg.open {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(15, 18, 28, .54) !important;
}

html body #authModal#authModal #authForm.modal {
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

html body #authModal#authModal.open #authForm.modal {
  transform: none !important;
  animation: agAuthCleanIn .18s cubic-bezier(.16, 1, .3, 1) both !important;
  will-change: transform, opacity;
}

/* One-shot sheen on logo mark when opening */
@keyframes agAuthLogoSheen {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }

  45% {
    filter: brightness(1.12);
    transform: scale(1.045);
  }

  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

html body #authModal #authForm.ag-sheen #authTitle::before {
  animation: agAuthLogoSheen .65s var(--e-spring) .12s both !important;
}

/* Label focus tint & soft 3px violet ring (no neon) */
html body #authModal #authForm .input:focus-within label {
  color: #5b3fe0 !important;
  transition: color .2s ease !important;
}

html body #authModal #authForm .input input:focus {
  box-shadow: 0 0 0 3px rgba(104, 71, 238, .14) !important;
}

html body #authModal #authForm .input input.ag-err {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}

/* Password wrapper + eye toggle */
html body #authModal #authForm .ag-pw-wrap {
  position: relative !important;
  display: block !important;
}

html body #authModal #authForm .ag-pw-wrap input#authPassword {
  padding-right: 48px !important;
}

html body #authModal #authForm .ag-pw-eye {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  transform: translateY(-50%) !important;
  width: 34px !important;
  height: 34px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #7c7894 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: color .18s ease, background-color .18s ease, transform .15s ease !important;
}

html body #authModal #authForm .ag-pw-eye svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

html body #authModal #authForm .ag-pw-eye:hover {
  color: #5b3fe0 !important;
  background: rgba(104, 71, 238, .08) !important;
}

html body #authModal #authForm .ag-pw-eye:active {
  transform: translateY(-50%) scale(.92) !important;
}

html body #authModal #authForm .ag-pw-eye.is-on {
  color: #5b3fe0 !important;
}

/* 4-segment password strength meter (signup only) */
html body #authModal #authForm .ag-pw-meter {
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  margin-top: 0 !important;
  transition: max-height .24s var(--e-out), opacity .2s ease, margin-top .24s var(--e-out) !important;
}

html body #authModal #authForm .ag-pw-meter.is-show {
  max-height: 34px !important;
  opacity: 1 !important;
  margin-top: 8px !important;
}

html body #authModal #authForm .ag-pw-bars {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 5px !important;
}

html body #authModal #authForm .ag-pw-bars i {
  display: block !important;
  height: 4px !important;
  border-radius: 99px !important;
  background: rgba(104, 71, 238, .12) !important;
  transition: background-color .25s ease, transform .25s var(--e-out) !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="1"] .ag-pw-bars i:nth-child(1) {
  background: #ef4444 !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="2"] .ag-pw-bars i:nth-child(-n+2) {
  background: #f59e0b !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="3"] .ag-pw-bars i:nth-child(-n+3) {
  background: #3b82f6 !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="4"] .ag-pw-bars i:nth-child(-n+4) {
  background: #10b981 !important;
}

html body #authModal #authForm .ag-pw-lbl {
  display: block !important;
  margin-top: 5px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #7c7894 !important;
  min-height: 15px !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="1"] .ag-pw-lbl {
  color: #dc2626 !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="2"] .ag-pw-lbl {
  color: #d97706 !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="3"] .ag-pw-lbl {
  color: #2563eb !important;
}

html body #authModal #authForm .ag-pw-meter[data-lvl="4"] .ag-pw-lbl {
  color: #059669 !important;
}

/* Error shake + notice slide-in */
@keyframes agAuthShake {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  20% {
    transform: translate3d(-6px, 0, 0);
  }

  40% {
    transform: translate3d(6px, 0, 0);
  }

  60% {
    transform: translate3d(-4px, 0, 0);
  }

  80% {
    transform: translate3d(4px, 0, 0);
  }
}

html body #authModal#authModal.open #authForm.modal.ag-shake {
  animation: agAuthShake .42s cubic-bezier(.36, .07, .19, .97) both !important;
}

html body #authModal #authNotice .notice {
  animation: agFadeUp .24s var(--e-out) both !important;
}

/* Submit press + subtle loading dots */
html body #authModal #authSubmit:active {
  transform: scale(.97) !important;
}

html body #authModal #authSubmit.ag-loading::after {
  content: " ···";
  letter-spacing: 2px;
  animation: agPulseSoft 1s ease-in-out infinite;
}

/* Legacy Telegram hint */
html body #authModal #authForm .ag-tg-hint {
  margin: 12px 0 0 !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(104, 71, 238, .10) !important;
  text-align: center !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  color: #7c7894 !important;
}

html body #authModal #authForm .ag-tg-hint a {
  color: #6847ee !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

html body #authModal #authForm .ag-tg-hint a:hover {
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {

  html body #authModal#authModal #authForm.modal,
  html body #authModal #authForm.ag-sheen #authTitle::before,
  html body #authModal#authModal.open #authForm.modal.ag-shake,
  html body #authModal #authNotice .notice {
    animation: none !important;
    transition: none !important;
  }
}


/* =====================================================================
   CABINET POLISH + APPLE LIQUID GLASS (LIGHTWEIGHT 60FPS)
   ===================================================================== */

/* ---------- Landing page: cap huge 60-100px GPU blurs for silky scroll ---------- */
html.ag-landing #nl-landing .blur-3xl,
html.ag-landing #nl-landing .blur-2xl {
  filter: blur(28px) !important;
}

/* ---------- Fix 1: Analytics bottom clearance on desktop + full-width mobile period bar ---------- */
@media (min-width: 769px) {
  html body.nl-app #root .app > .main {
    padding-bottom: 84px !important;
  }
}
@media (max-width: 768px) {
  html body.nl-app #root .main .rs-periods {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 2px !important;
  }
  html body.nl-app #root .main .rs-periods > button {
    width: 100% !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* ---------- Fix 2: Mobile Settings header compact right-aligned tools ---------- */
@media (max-width: 768px) {
  html body.nl-app.uip-dash-settings #root .app .main > .top .topact {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 0 !important;
    border-top: 0 !important;
  }
}

/* ---------- Fix 3: Mobile Links card clean hierarchy (left-aligned slug & actions) ---------- */
@media (max-width: 768px) {
  html body.nl-app #root .main section.table .row > .rowslug {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }
}

/* ---------- Fix 4: Desktop Editor polish (clean title, circular profile mini-avatar, selection breathing room) ---------- */
html body #editorModal .editorhead h3::after {
  content: "" !important;
  display: none !important;
}
html body #editorModal .stage9-profile-card .stage9-profile-avatar,
html body #editorModal .stage9-profile-card .stage9-avatar {
  border-radius: 50% !important;
}
html body #editorModal .preview-selection-box {
  border-radius: 12px !important;
  transform: scale(1.01, 0.94);
  transform-origin: center;
}

/* ---------- Apple Liquid Glass: specular rim on pills, lenses & cards ---------- */
html body.nl-app #root .app .side .snav > .ag-nav-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(242, 238, 255, .78) 100%) !important;
  border: 1px solid rgba(104, 71, 238, .22) !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .98),
    inset 0 -1px 1px rgba(104, 71, 238, .08),
    inset 3px 0 0 #6847ee,
    0 6px 18px -8px rgba(104, 71, 238, .35) !important;
}
html body .ag-seg > .ag-seg-pill {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .95),
    inset 0 -1px 1px rgba(15, 23, 42, .06),
    0 4px 12px -4px rgba(30, 20, 80, .18) !important;
}
html body.nl-app #root .main .rs-periods > .ag-seg-pill {
  background: linear-gradient(180deg, #7c5cff 0%, #6342eb 100%) !important;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, .42),
    inset 0 -1px 1px rgba(25, 10, 80, .22),
    0 6px 16px -6px rgba(104, 71, 238, .55) !important;
}

/* Compact Liquid Glass Lenses (optical refraction in Chromium, clean frosted fallback elsewhere) */
html:not(.lite-glass) body.nl-app .spl-fab#splOpenAnalytics,
html:not(.lite-glass) body #editorModal .device-preview-toolbar,
html:not(.lite-glass) body.nl-app #root .main > .top .lang {
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(248, 246, 255, .70)) !important;
  -webkit-backdrop-filter: blur(12px) saturate(165%) !important;
  backdrop-filter: blur(12px) saturate(165%) url(#ag-lg-refract) !important;
  border: 1px solid rgba(255, 255, 255, .92) !important;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, .96),
    inset 0 -1px 1px rgba(104, 71, 238, .08),
    0 10px 28px -12px rgba(30, 20, 80, .24) !important;
}

/* Glass capsule specular rim on primary buttons */
html body.nl-app #newLink,
html body #editorModal .editorfoot .btn.primary {
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, .45),
    inset 0 -1px 1px rgba(30, 12, 95, .25),
    0 10px 24px -10px rgba(104, 71, 238, .65) !important;
}

/* Interactive desktop specular highlight following cursor (--ag-mx / --ag-my) */
@media (hover: hover) and (pointer: fine) {
  html:not(.lite-glass) body.nl-app #root .app .main .cards .stat,
  html:not(.lite-glass) body #proTplPicker .pro-tpl-card,
  html:not(.lite-glass) body .ag-cmd-box {
    position: relative;
    overflow: hidden;
  }
  html:not(.lite-glass) body.nl-app #root .app .main .cards .stat::after,
  html:not(.lite-glass) body #proTplPicker .pro-tpl-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
      220px circle at var(--ag-mx, 50%) var(--ag-my, 0%),
      rgba(139, 92, 246, .13) 0%,
      rgba(255, 255, 255, .28) 32%,
      transparent 70%
    );
    transition: opacity .25s ease;
  }
  html:not(.lite-glass) body.nl-app #root .app .main .cards .stat:hover::after,
  html:not(.lite-glass) body #proTplPicker .pro-tpl-card:hover::after {
    opacity: 1;
  }
}


/* =====================================================================
   POINT 3 — PRO STUDIO SCENE PICKER + 3x2 STARTER TEMPLATES GALLERY
   ===================================================================== */
html body #editorModal #proStudio .ps-scene-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 5px !important;
}
@media (max-width: 520px) {
  html body #editorModal #proStudio .ps-scene-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
html body #editorModal #proStudio .ps-media-actions {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
}
html body #editorModal #proStudio .ps-media-actions .ps-btn {
  flex: 1 1 auto !important;
  justify-content: center !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
}
html body #editorModal #proStudio .ps-media-actions [data-sc-clear] {
  flex: 0 0 36px !important;
  padding: 8px 0 !important;
}
html body #editorModal #proStudio .ps-rec-box {
  margin-top: 8px !important;
  padding: 10px !important;
  border-radius: 14px !important;
  background: #0f1224 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
}
html body #editorModal #proStudio .ps-rec-box[hidden] { display: none !important; }
html body #editorModal #proStudio .ps-rec-cam {
  width: 120px !important;
  height: 120px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2.5px solid #a78bfa !important;
  transform: scaleX(-1) !important;
}
html body #editorModal #proStudio .ps-rec-t {
  font: 700 12px/1 Inter, system-ui, sans-serif !important;
  color: #f87171 !important;
}
html body #editorModal #proStudio .ps-mstat {
  font: 600 11.5px/1.3 Inter, system-ui, sans-serif !important;
  color: #059669 !important;
  margin-top: 5px !important;
  min-height: 14px !important;
}
html body #editorModal #proStudio .ps-mstat.is-err { color: #dc2626 !important; }
html body #proTplPicker .pro-tpl-mock.is-circle {
  background: radial-gradient(circle at 30% 20%, rgba(104, 71, 238, .6), transparent 55%), linear-gradient(155deg, #101228, #2e1065 60%, #1e1b4b) !important;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 6px !important;
}
html body #proTplPicker .ptm-cir-ring {
  width: 64px; height: 64px; border-radius: 50%; padding: 3px;
  background: linear-gradient(135deg, #a78bfa, #f472b6, #38bdf8);
  display: inline-flex; align-items: center; justify-content: center;
}
html body #proTplPicker .ptm-cir-in {
  width: 100%; height: 100%; border-radius: 50%; background: #1e1b4b;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
}
html body #proTplPicker .ptm-cir-cap { font: 600 10.5px/1.2 Inter, system-ui, sans-serif; color: rgba(255, 255, 255, .86); }

/* Admin Users Table: keep all 7 columns + "Карточка →" button cleanly visible without right-edge clipping */
html body.pro-ui.nl-app #root#root .app .main .adm-users-table th,
html body.pro-ui.nl-app #root#root .app .main .adm-users-table td {
  padding: 10px 8px !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table .admin-user-meta {
  max-width: 195px !important;
  min-width: 0 !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table .admin-user-name,
html body.pro-ui.nl-app #root#root .app .main .adm-users-table .adm-email-txt {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 185px !important;
  display: block !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table .adm-links-cell {
  max-width: 215px !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table .admin-link-badge {
  max-width: 175px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table th:last-child,
html body.pro-ui.nl-app #root#root .app .main .adm-users-table td:last-child {
  position: sticky !important;
  right: 0 !important;
  background: #ffffff !important;
  padding-right: 12px !important;
  white-space: nowrap !important;
  box-shadow: -8px 0 12px -10px rgba(15, 23, 42, .14) !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table th:last-child {
  background: #f8fafc !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table tbody tr:hover td:last-child {
  background: #fcfcfd !important;
}
html body.pro-ui.nl-app #root#root .app .main .adm-users-table .admin-btn-action {
  padding: 6px 11px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

/* Stage 28 — Smart Conversion Coach Banner */
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 13px 16px !important;
  margin: 0 0 14px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(244, 240, 255, .92)) !important;
  border: 1px solid rgba(104, 71, 238, .22) !important;
  box-shadow: 0 10px 26px -14px rgba(104, 71, 238, .26), inset 0 1px 0 rgba(255, 255, 255, .92) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-ic {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  flex: none !important;
  background: linear-gradient(135deg, #6847ee, #8b5cf6) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 6px 14px -4px rgba(104, 71, 238, .45) !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-body {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-top {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-bottom: 3px !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-tag {
  font: 800 10.5px/1.2 Inter, system-ui, sans-serif !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: rgba(104, 71, 238, .12) !important;
  color: #5b3fe0 !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-title {
  font: 750 13.5px/1.3 Inter, system-ui, sans-serif !important;
  color: #0f172a !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-desc {
  font: 500 12.5px/1.42 Inter, system-ui, sans-serif !important;
  color: #475569 !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-desc b {
  color: #0f172a !important;
  font-weight: 700 !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-acts {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: none !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-cta {
  height: 36px !important;
  padding: 0 14px !important;
  border-radius: 11px !important;
  border: 0 !important;
  background: #6847ee !important;
  color: #ffffff !important;
  font: 700 12.5px/1 Inter, system-ui, sans-serif !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: 0 6px 14px -4px rgba(104, 71, 238, .45) !important;
  transition: transform .15s ease, filter .15s ease !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-cta:hover {
  filter: brightness(1.06) !important;
  transform: translateY(-1px) !important;
}
html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-x {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, .10) !important;
  background: #ffffff !important;
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
@media (max-width: 780px) {
  html body.pro-ui.nl-app #root#root .app .main #aruCoachBar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 13px 14px !important;
  }
  html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-ic {
    width: 32px !important;
    height: 32px !important;
  }
  html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-acts {
    width: 100% !important;
  }
  html body.pro-ui.nl-app #root#root .app .main #aruCoachBar .ac-cta {
    flex: 1 1 auto !important;
    height: 38px !important;
  }
}

/* Mobile Editor & Tracker Modal: bulletproof iOS Safari + Android Chrome inset:0 flex layout */
@media (max-width: 760px) {
  html body #editorModal#editorModal.open,
  html body #editorModal#editorModal.editorbg.open {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  html body #editorModal#editorModal.open > .editor,
  html body #editorModal#editorModal.open > #linkForm {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  html body #editorModal#editorModal.open .editorhead {
    flex: 0 0 auto !important;
  }
  html body #editorModal#editorModal.open .editorgrid,
  html body #editorModal#editorModal.open .builder-shell {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  html body #editorModal#editorModal.open:not(.mobile-fullscreen-preview) .editorfoot,
  html body #editorModal#editorModal.open:not(.mobile-fullscreen-preview) .builder-foot {
    flex: 0 0 auto !important;
    position: relative !important;
    bottom: auto !important;
    z-index: 40 !important;
  }
  html body #editorModal#editorModal.mobile-fullscreen-preview .editorfoot,
  html body #editorModal#editorModal.mobile-fullscreen-preview .builder-foot {
    display: none !important;
  }
  html body.nl-app #editorModal#editorModal.mobile-fullscreen-preview .builder-stage .device-preview-toolbar,
  html body.nl-app #editorModal#editorModal .builder-stage .device-preview-toolbar {
    width: fit-content !important;
    min-width: 0 !important;
    max-width: calc(100% - 24px) !important;
    margin: 0 auto 10px !important;
    padding: 5px 8px !important;
    gap: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  html body.nl-app #editorModal#editorModal.mobile-fullscreen-preview .builder-stage .device-preview-toolbar .device-label,
  html body.nl-app #editorModal#editorModal .builder-stage .device-preview-toolbar .device-label {
    display: none !important;
  }
  html body.nl-app #editorModal#editorModal .builder-stage .device-preview-toolbar .preview-tools {
    padding: 3px !important;
    gap: 2px !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
  }
  html body.nl-app #editorModal#editorModal .builder-stage .device-preview-toolbar .preview-tools > button {
    padding: 0 11px !important;
    height: 30px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  html body.nl-app #editorModal#editorModal .builder-stage .device-preview-toolbar .ag-play-btn {
    width: 32px !important;
    height: 32px !important;
    margin-left: 0 !important;
    flex: none !important;
  }
  /* 16px prevents iOS Safari automatic zoom on input focus */
  html body #editorModal#editorModal #proStudio input,
  html body #editorModal#editorModal #proStudio textarea,
  html body #editorModal#editorModal #proStudio select,
  html body #editorModal#editorModal input,
  html body #editorModal#editorModal textarea,
  html body #editorModal#editorModal select,
  html body .spl-modal input,
  html body .spl-modal textarea,
  html body .spl-modal select,
  html body .spl-dialog input,
  html body .spl-dialog textarea,
  html body .spl-dialog select {
    font-size: 16px !important;
  }
  html body .spl-modal {
    position: fixed !important;
    inset: 0 !important;
    padding: 8px !important;
  }
  html body .spl-modal .spl-dialog {
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  html body .spl-modal .spl-dialog-body {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  html body .spl-modal .spl-dialog-foot {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 10 !important;
  }
}

/* Tracker Tier 1/2/3 bulk selection pills — crisp & responsive on all screens */
html body .spl-tier-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-bottom: 4px !important;
}
html body .spl-tier-bar .spl-pill-tier {
  background: rgba(104, 71, 238, .08) !important;
  border-color: rgba(104, 71, 238, .26) !important;
  color: #5b3fe0 !important;
  font-weight: 700 !important;
}
html body .spl-tier-bar .spl-pill-tier small {
  opacity: .72 !important;
  font-weight: 600 !important;
  margin-left: 3px !important;
}
html body .spl-tier-bar .spl-pill-tier.active {
  background: #6847ee !important;
  border-color: #6847ee !important;
  color: #ffffff !important;
}
html body .spl-tier-bar .spl-pill-tier.active small {
  color: rgba(255, 255, 255, .92) !important;
  opacity: 1 !important;
}
html body .spl-tier-bar .spl-pill-inv {
  background: rgba(15, 23, 42, .05) !important;
  border-color: rgba(15, 23, 42, .14) !important;
  color: #334155 !important;
}
@media (max-width: 560px) {
  html body .spl-tier-bar .spl-pill-btn {
    padding: 6px 9px !important;
    font-size: 12px !important;
  }
  html body .spl-countries {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
html body #editorModal #proStudio .ps-scene-tile {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 10px 6px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, .09) !important;
  background: #fff !important;
  color: #1e293b !important;
  font: 700 11.5px/1.2 Inter, system-ui, sans-serif !important;
  cursor: pointer !important;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .15s ease !important;
}
html body #editorModal #proStudio .ps-scene-tile i {
  font-style: normal !important;
  font-size: 16px !important;
  line-height: 1 !important;
}
html body #editorModal #proStudio .ps-scene-tile.active {
  border-color: #6847ee !important;
  background: linear-gradient(180deg, #fff, #f4f0ff) !important;
  color: #5b3fe0 !important;
  box-shadow: 0 0 0 2.5px rgba(104, 71, 238, .14) !important;
}
html body #editorModal #proStudio .ps-scene-tile:active { transform: scale(.96) !important; }
html body #editorModal #proStudio .ps-scene-cfg {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(15, 23, 42, .07) !important;
}
html body #editorModal #proStudio .ps-niche-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}
html body #editorModal #proStudio .ps-niche {
  padding: 6px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(104, 71, 238, .22) !important;
  background: rgba(104, 71, 238, .06) !important;
  color: #5b3fe0 !important;
  font: 600 11.5px/1.1 Inter, system-ui, sans-serif !important;
  cursor: pointer !important;
  transition: background-color .16s ease, transform .14s ease !important;
}
html body #editorModal #proStudio .ps-niche:hover,
html body #editorModal #proStudio .ps-niche.is-act {
  background: #6847ee !important;
  color: #ffffff !important;
  border-color: #6847ee !important;
}
html body #editorModal #proStudio .ps-niche:active { transform: scale(.95) !important; }

/* Starter Templates Gallery: 3x2 grid on desktop (all 6 cards fit without vertical scroll) */
@media (min-width: 960px) {
  html body #proTplPicker .pro-tpl-dialog {
    max-width: 1120px !important;
    padding: 22px 24px 24px !important;
  }
  html body #proTplPicker .pro-tpl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
  html body #proTplPicker .pro-tpl-mock {
    height: 158px !important;
  }
  html body #proTplPicker .pro-tpl-meta {
    padding: 12px 14px 14px !important;
  }
  html body #proTplPicker .pro-tpl-meta p {
    font-size: 12px !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
html body #proTplPicker .pro-tpl-mbadge.is-new {
  background: rgba(104, 71, 238, .92) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, .28) !important;
}
html body #proTplPicker .pro-tpl-mock.is-chat {
  background: radial-gradient(circle at 80% 10%, rgba(124, 92, 255, .42), transparent 50%), #0e1020 !important;
  padding: 36px 14px 10px !important;
}
.ptm-chat-box { width: 100%; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.ptm-chat-h { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 10px; background: rgba(255, 255, 255, .11); border: 1px solid rgba(255, 255, 255, .16); color: #fff; }
.ptm-chat-av { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #f472b6, #6847ee); display: inline-flex; align-items: center; justify-content: center; font: 800 10px/1 Inter, sans-serif; font-style: normal; color: #fff; flex: none; }
.ptm-chat-h b { display: block; font-size: 10.5px; line-height: 1.1; }
.ptm-chat-h span { display: block; font-size: 8.5px; color: #6ee7b7; }
.ptm-chat-b { max-width: 88%; padding: 5px 8px; border-radius: 10px 10px 10px 3px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); color: #fff; font-size: 9.5px; line-height: 1.25; }
.ptm-chat-cta { margin-top: 2px; display: block; text-align: center; padding: 5px 8px; border-radius: 8px; background: linear-gradient(135deg, #7f62ff, #6847ee); color: #fff; font: 700 9.5px/1 Inter, sans-serif; }

html body #proTplPicker .pro-tpl-mock.is-story {
  background: radial-gradient(circle at 65% 20%, rgba(244, 114, 182, .5), transparent 50%), linear-gradient(155deg, #1b1138, #3b1969 55%, #0f172a) !important;
  padding: 36px 14px 10px !important;
}
.ptm-story-box { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.ptm-story-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.ptm-story-bars i { height: 2.5px; border-radius: 99px; background: rgba(255, 255, 255, .3); display: block; }
.ptm-story-bars i.on, .ptm-story-bars i.live { background: #fff; }
.ptm-story-h { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 10px; margin-top: 4px; }
.ptm-st-live { margin-left: auto; font-size: 8.5px; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: rgba(16, 185, 129, .24); color: #a7f3d0; }
.ptm-story-card { margin-top: auto; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); color: #fff; display: flex; flex-direction: column; gap: 5px; }
.ptm-story-card b { font-size: 10.5px; }

html body #proTplPicker .pro-tpl-mock.is-reveal {
  background: radial-gradient(circle at 50% 0%, rgba(124, 92, 255, .36), transparent 55%), #0a0b16 !important;
  padding: 28px 14px 12px !important;
}
.ptm-rev-box { position: relative; width: 100%; height: 100%; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .22); }
.ptm-rev-art { position: absolute; inset: -10px; background: radial-gradient(circle at 35% 35%, #f472b6, transparent 50%), radial-gradient(circle at 75% 70%, #38bdf8, transparent 50%), linear-gradient(135deg, #4c1d95, #be185d); filter: blur(12px); transition: filter .3s ease; }
.ptm-rev-ov { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: rgba(10, 12, 24, .26); color: #fff; }
.ptm-rev-pill { font-size: 8.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); }
.ptm-rev-lock { width: 28px; height: 28px; border-radius: 9px; background: rgba(255, 255, 255, .2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.ptm-rev-ov small { font-size: 9px; opacity: .9; font-weight: 600; }
@media (hover: hover) {
  html body #proTplPicker .pro-tpl-card:hover .ptm-rev-art { filter: blur(4px); }
  html body #proTplPicker .pro-tpl-card:hover .ptm-chat-b { animation: agBranchIn .45s var(--e-spring) both; }
  html body #proTplPicker .pro-tpl-card:hover .ptm-chat-b.is-2 { animation-delay: .1s; }
}

/* ---------- Direct inline editing cue on #editorScreen + ▶ Replay pill ---------- */
html body #editorModal #editorScreen [data-sc-edit] {
  cursor: text !important;
  border-radius: 6px;
  transition: outline-color .16s ease, background-color .16s ease;
  outline: 1.5px dashed transparent;
  outline-offset: 2px;
}
@media (hover: hover) {
  html body #editorModal #editorScreen [data-sc-edit]:hover {
    outline-color: rgba(255, 255, 255, .55);
    background-color: rgba(255, 255, 255, .08);
  }
  html body #editorModal #editorScreen[data-pro-dark="0"] [data-sc-edit]:hover {
    outline-color: rgba(104, 71, 238, .48);
    background-color: rgba(104, 71, 238, .06);
  }
}
html body #editorModal #editorScreen [data-sc-edit][contenteditable="true"] {
  outline: 2px solid #8b5cf6 !important;
  outline-offset: 3px !important;
  background-color: rgba(104, 71, 238, .22) !important;
  min-width: 24px;
}
html body #editorModal .device-preview-toolbar .ag-play-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 30px !important;
  margin-left: 4px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(104, 71, 238, .28) !important;
  background: linear-gradient(180deg, #fff, #f4f0ff) !important;
  color: #5b3fe0 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  box-shadow: inset 0 1px 1px #fff, 0 4px 12px -4px rgba(104, 71, 238, .35) !important;
  transition: transform .16s ease, background-color .16s ease, color .16s ease !important;
}
html body #editorModal .device-preview-toolbar .ag-play-btn svg {
  display: block !important;
  width: 13px !important;
  height: 13px !important;
  fill: currentColor !important;
  stroke: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html body #editorModal .device-preview-toolbar .ag-play-btn:hover {
  background: #6847ee !important;
  color: #fff !important;
}
html body #editorModal .device-preview-toolbar .ag-play-btn:active,
html body #editorModal .device-preview-toolbar .ag-play-btn.is-spin {
  transform: scale(.9) !important;
}