/* =====================================================================================================================
   "Orbit": the 3B Store look. Loaded last on every page.
   Colours come from the logo: deep space, the planet's solar orange and gold, and an electric ion blue.
   - Every page: colours, display type, buttons, scroll line.
   - Public pages (body.public): the 3D hero, glass cards that tilt, bento layouts, grain, marquee.
   - The dashboard (body.app) keeps its layout; it only picks up the colours and buttons.
   ===================================================================================================================== */

:root,
:root[data-theme='dark'] {
  --bg: #04060f;
  --surface: #0a1020;
  --surface-2: #0f1830;
  --surface-glass: rgba(10, 16, 32, 0.62);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2efe9;
  --muted: #9a98a8;
  --sun: #ff7a2f;
  --gold: #ffc65c;
  --ion: #5cc8ff;
  --accent: #ff9a4d;
  --accent-strong: #ff7a2f;
  --accent-soft: rgba(255, 122, 47, 0.14);
  --cyan: var(--ion);
  --glow: rgba(255, 122, 47, 0.35);
  --display: 'Unbounded', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
html {
  background: var(--bg);
}

/* ---------- Scroll progress line ---------- */
.scroll-line {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--gold), var(--sun) 50%, var(--ion));
  pointer-events: none;
}
[dir='rtl'] .scroll-line {
  transform-origin: right;
}

/* ---------- Buttons: solar, not "rounded blue" ---------- */
.btn-primary,
.btn-cta {
  position: relative;
  border: 0 !important;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd28a 0%, var(--sun) 45%, #e5461c 100%) !important;
  color: #1b0d03 !important;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(120, 30, 0, 0.35), 0 10px 30px -10px rgba(255, 122, 47, 0.7) !important;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, filter 0.25s;
}
.btn-primary:hover,
.btn-cta:hover {
  filter: brightness(1.08) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(120, 30, 0, 0.35), 0 16px 44px -12px rgba(255, 122, 47, 0.9) !important;
}
.btn-primary svg,
.btn-cta svg {
  transition: transform 0.25s var(--ease-out);
}
.btn-primary:hover svg {
  transform: translate(2px, -2px);
}
.btn-ghost {
  border: 1px solid transparent !important;
  border-radius: 999px;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(92, 200, 255, 0.28), rgba(255, 154, 77, 0.4)) border-box !important;
  color: var(--text) !important;
}
.btn-ghost:hover {
  background:
    linear-gradient(#0b1224, #0b1224) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(92, 200, 255, 0.5), rgba(255, 154, 77, 0.6)) border-box !important;
}

/* =========================== Public pages =========================== */

/* Film grain over everything: a printed, physical feel instead of flat digital fills */
body.public::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Glass nav that floats over the scene */
body.public .nav {
  background: rgba(4, 6, 15, 0.45) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
body.public .nav-links a {
  position: relative;
}
body.public .nav-links a::after {
  content: '';
  position: absolute;
  inset: auto 0 -6px;
  height: 1px;
  transform: scaleX(0);
  background: var(--sun);
  transition: transform 0.3s var(--ease-out);
}
body.public .nav-links a:hover::after {
  transform: scaleX(1);
}

/* ---------- The 3D stage ---------- */
.scene-wrap {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: max(100vh, 680px);
  overflow: hidden;
  pointer-events: none;
}
.scene-wrap.lite {
  position: fixed;
  height: 100vh;
  opacity: 0.7;
}
canvas.scene3d {
  display: block;
  width: 100%;
  height: 100%;
}
.home .sky-arc {
  display: none;
}
/* No WebGL / slow device / reduced motion: a still planet made with CSS */
.scene-static::before,
.scene-static::after {
  content: '';
  position: absolute;
  top: 18%;
  inset-inline-end: -6vw;
  width: min(44vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
}
.scene-static::before {
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 236, 200, 0.9), transparent 22%),
    repeating-linear-gradient(172deg, rgba(150, 50, 10, 0.55) 0 6%, transparent 6% 11%, rgba(255, 200, 120, 0.4) 11% 14%, transparent 14% 19%),
    radial-gradient(circle at 35% 35%, #ffb35c, #e2561c 55%, #3a1004 100%);
  box-shadow: inset -40px -30px 80px rgba(0, 0, 0, 0.7), 0 0 120px 10px rgba(92, 200, 255, 0.18), 0 0 60px rgba(255, 122, 47, 0.25);
}
.scene-static::after {
  width: min(78vw, 980px);
  aspect-ratio: 3.2;
  top: calc(18% + min(44vw, 560px) * 0.33);
  inset-inline-end: calc(-6vw - min(17vw, 210px));
  border: min(2.2vw, 26px) solid rgba(255, 214, 160, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 180, 110, 0.25) inset;
  transform: rotate(-14deg);
}
.scene-wrap.lite.scene-static::before,
.scene-wrap.lite.scene-static::after {
  opacity: 0.5;
}

/* ---------- Hero: big editorial type, the planet beside it ---------- */
body.home .h-hero {
  min-height: min(calc(100vh - 70px), 860px);
  align-content: center;
  justify-items: start;
  padding: 72px 0 40px;
  text-align: start;
  transform: translateY(calc(var(--scroll, 0) * -70px));
  opacity: calc(1 - var(--scroll, 0) * 0.9);
}
body.home .h-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 30px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 12px 32px -10px rgba(255, 122, 47, 0.6);
}
body.home .h-hero h1 {
  max-width: 14ch;
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 108px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
}
[dir='rtl'] body.home .h-hero h1 {
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.2;
}
body.home .h-hero h1 > span {
  display: block;
  animation: rise 1s var(--ease-out) both;
}
body.home .h-fade {
  background: none;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(242, 239, 233, 0.75);
  animation-delay: 0.12s !important;
  transition: color 0.4s;
}
body.home .h-hero h1:hover .h-fade {
  color: var(--sun);
  -webkit-text-stroke-color: var(--sun);
}
body.home .h-lead {
  max-width: 34rem;
  margin: 28px 0 36px;
  font-size: clamp(16px, 1.4vw, 19px);
  animation: rise 1s 0.22s var(--ease-out) both;
}
body.home .h-actions {
  justify-content: flex-start;
  animation: rise 1s 0.32s var(--ease-out) both;
}
body.home .h-tags {
  justify-content: flex-start;
  animation: rise 1s 0.42s var(--ease-out) both;
}
body.home .h-tags li {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}
@media (max-width: 760px) {
  body.home .h-hero {
    min-height: 0;
    padding-top: 300px; /* the planet sits above the title on phones */
  }
  body.home .h-logo {
    display: none;
  }
}

/* ---------- Marquee of everything the bot does ---------- */
.marquee {
  overflow: hidden;
  margin: 70px 0 10px;
  padding: 18px 0;
  border-block: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 239, 233, 0.35);
}
.marquee-track span:nth-child(3n + 1) {
  color: var(--text);
  -webkit-text-stroke: 0;
}
.marquee-track span::after {
  content: '✦';
  color: var(--sun);
  -webkit-text-stroke: 0;
  font-size: 0.6em;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
[dir='rtl'] .marquee-track {
  animation-direction: reverse;
}

/* ---------- Section heads ---------- */
body.public .h-head h2,
body.public .buy-title,
body.public .legal h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
[dir='rtl'] body.public .h-head h2,
[dir='rtl'] body.public .buy-title {
  line-height: 1.3;
  letter-spacing: 0;
}

/* Modules: numbered chapters (01, 02...) instead of coloured dots */
#modules {
  counter-reset: chapter;
}
body.home .m-group {
  counter-increment: chapter;
}
body.home .m-dot {
  display: none;
}
body.home .m-group-head {
  align-items: end;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
body.home .m-group-head::before {
  content: counter(chapter, decimal-leading-zero);
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 800;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--sun);
}
body.home .m-group-head h3 {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
}

/* ---------- Bento grid: cards of different sizes, the rhythm changes per chapter ---------- */
body.home .m-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
body.home .m-grid > :nth-child(1) { grid-column: span 4; }
body.home .m-grid > :nth-child(2) { grid-column: span 2; }
body.home .m-grid > :nth-child(3) { grid-column: span 2; }
body.home .m-grid > :nth-child(4) { grid-column: span 4; }
body.home .m-group:nth-of-type(even) .m-grid > :nth-child(1) { grid-column: span 2; }
body.home .m-group:nth-of-type(even) .m-grid > :nth-child(2) { grid-column: span 4; }
body.home .m-group:nth-of-type(even) .m-grid > :nth-child(3) { grid-column: span 4; }
body.home .m-group:nth-of-type(even) .m-grid > :nth-child(4) { grid-column: span 2; }
@media (max-width: 980px) {
  body.home .m-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.home .m-grid > *,
  body.home .m-group:nth-of-type(even) .m-grid > * {
    grid-column: span 1 !important;
  }
}
@media (max-width: 640px) {
  body.home .m-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Glass cards that catch the light ---------- */
body.public .m-card,
body.public .why,
body.public .plan {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01) 40%),
    var(--surface-glass) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  transition: transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
  will-change: transform;
}
body.public .m-card::after,
body.public .plan::after,
body.public .why::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 168, 96, 0.16), transparent 45%);
  transition: opacity 0.3s;
}
body.public .tilting::after {
  opacity: 1;
}
body.public .m-card:hover,
body.public .plan:hover,
body.public .why:hover {
  border-color: rgba(255, 168, 96, 0.35) !important;
}
body.public .why {
  padding: 24px;
}

/* Cards come in one after another as a chapter scrolls into view */
body.home .reveal .m-card,
body.home .h-why .why {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out) calc(var(--i, 0) * 80ms), transform 0.7s var(--ease-out) calc(var(--i, 0) * 80ms),
    border-color 0.3s, box-shadow 0.3s;
}
body.home .reveal.in .m-card,
body.home .h-why .why.in,
body.home .h-why.in .why {
  opacity: 1;
  transform: none;
}

/* ---------- Plans ---------- */
body.public .plan.popular {
  border-color: rgba(255, 154, 77, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 80px -40px rgba(255, 122, 47, 0.7) !important;
}
body.public .plan-price {
  font-family: var(--display);
  letter-spacing: -0.03em;
}
body.public .plan.premium::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), transparent 0 70%, var(--gold) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 5s linear infinite;
}
@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes spin {
  to {
    --spin: 360deg;
  }
}

/* Phones and tablets: blur behind many cards costs too much while scrolling */
@media (hover: none), (max-width: 760px) {
  body.public .m-card,
  body.public .why,
  body.public .plan {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01) 40%), var(--surface) !important;
  }
}

/* =========================== Dashboard and Admin (body.app) =========================== */
/* Same world as the home page: deep space, a planet glowing in the corner, glass panels and big display headings.
   Body text stays compact (Plus Jakarta); the wide face is only for headings and numbers. */
body.app {
  --display: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --headline: 'Unbounded', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --glass: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 45%), rgba(10, 16, 32, 0.66);
  /* The space background sits behind the page (z-index -1), so the body itself must be see-through */
  background: transparent !important;
}

/* Space: a warm light from the planet, a cool one from below, a few stars, the fine grid, grain */
body.app .backdrop {
  background:
    radial-gradient(ellipse 55% 45% at 100% 0%, rgba(255, 122, 47, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(92, 200, 255, 0.08), transparent 70%),
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 34% 72%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 28%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 76% 64%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1px 1px at 90% 86%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 22% 92%, rgba(255, 255, 255, 0.35), transparent 60%),
    var(--bg);
}
body.app .dash-blobs {
  display: none;
}

/* The planet, half out of the top corner, its bands drifting slowly; the ring crosses in front */
body.app .bg-glow {
  display: block !important;
  position: fixed;
  inset: -170px -150px auto auto;
  z-index: -1;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 236, 200, 0.55), transparent 42%),
    radial-gradient(circle at 70% 75%, rgba(4, 6, 15, 0.92), transparent 60%),
    repeating-linear-gradient(172deg, #c4581b 0 18px, #f08a3a 18px 34px, #ffbf72 34px 44px, #d9692a 44px 66px);
  background-size: 100% 100%, 100% 100%, 100% 300%;
  box-shadow: 0 0 120px 20px rgba(255, 122, 47, 0.35), inset -30px -40px 80px rgba(4, 6, 15, 0.85), inset 6px 6px 24px rgba(92, 200, 255, 0.35);
  animation: bands 60s linear infinite;
}
body.app .bg-glow::after {
  content: '';
  position: absolute;
  inset: 42% -45%;
  border-radius: 50%;
  border: 10px solid transparent;
  background: linear-gradient(90deg, rgba(255, 220, 170, 0.75), rgba(255, 170, 100, 0.25) 50%, rgba(255, 220, 170, 0.75)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transform: rotate(-16deg);
}
[dir='rtl'] body.app .bg-glow {
  inset: -170px auto auto -150px;
}
@keyframes bands {
  to {
    background-position: 0 0, 0 0, 0 300%;
  }
}

/* Glass bars */
body.app .nav {
  background: rgba(4, 6, 15, 0.55) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
body.app .brand-name {
  font-family: var(--headline);
  font-weight: 700;
  letter-spacing: -0.02em;
}
body.app .sidebar {
  background: rgba(6, 9, 20, 0.6) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body.app .nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold) !important;
}
body.app .nav-group::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 10px var(--sun);
}
body.app .nav-item {
  position: relative;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--ease-out);
}
body.app .nav-item:hover {
  transform: translateX(3px);
}
[dir='rtl'] body.app .nav-item:hover {
  transform: translateX(-3px);
}
body.app .nav-item.active {
  background: linear-gradient(90deg, rgba(255, 122, 47, 0.22), rgba(255, 122, 47, 0.04)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 154, 77, 0.28) !important;
}
[dir='rtl'] body.app .nav-item.active {
  background: linear-gradient(270deg, rgba(255, 122, 47, 0.22), rgba(255, 122, 47, 0.04)) !important;
}
body.app .nav-item.active::before {
  content: '';
  position: absolute;
  inset-block: 8px;
  inset-inline-start: -1px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--gold), var(--sun));
  box-shadow: 0 0 12px var(--sun);
}
body.app .nav-item.active svg {
  color: var(--sun) !important;
}
body.app .server-switch {
  background: var(--glass) !important;
  border-color: var(--border) !important;
}

/* Page title: the home page's big type, warm gradient */
body.app .crumbs {
  color: var(--sun) !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
}
body.app .page-head h1 {
  font-family: var(--headline);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #fff 30%, #ffd7a8 70%, var(--sun));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[dir='rtl'] body.app .page-head h1 {
  letter-spacing: 0;
}

/* Glass cards */
body.app .card {
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  background: var(--glass) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 60px -45px rgba(0, 0, 0, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.app .card h2 {
  letter-spacing: -0.015em;
}
body.app .list-row,
body.app .meta-item,
body.app .mini-stat {
  background: rgba(255, 255, 255, 0.025) !important;
  border-color: var(--border) !important;
  border-radius: 14px;
}

/* Number tiles: big display numbers, a glowing line in their colour, a light that follows the mouse */
body.app .tstat {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border) !important;
  padding: 18px 20px;
  text-align: start;
  transition: transform 0.3s var(--ease-out), border-color 0.3s !important;
  --tone: var(--ion);
}
body.app .tstat.green {
  --tone: #4ee39a;
}
body.app .tstat.amber {
  --tone: var(--gold);
}
body.app .tstat.red {
  --tone: #ff5d6c;
}
body.app .tstat.gray {
  --tone: #8a8fa6;
}
body.app .tstat::before {
  content: '';
  position: absolute;
  inset: 0 18% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tone), transparent);
  box-shadow: 0 0 18px 1px var(--tone);
}
body.app .tstat::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--tone) 22%, transparent), transparent 55%);
  transition: opacity 0.3s;
}
body.app .tstat.tilting::after,
body.app .tstat:hover::after {
  opacity: 1;
}
body.app .tstat:hover {
  border-color: color-mix(in srgb, var(--tone) 45%, transparent) !important;
}
body.app .tstat b {
  font-family: var(--headline) !important;
  font-size: clamp(19px, 1.8vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The "Saved" message stays above the phone keyboard */
.toast {
  bottom: calc(20px + var(--kb, 0px)) !important;
}

/* "Leave without saving?": a glass card over the dimmed page, in the site's style */
.ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 4, 10, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ask-fade 0.2s ease-out;
}
.ask-box {
  width: min(440px, 100%);
  padding: 24px !important;
  border-color: rgba(255, 154, 77, 0.35) !important;
  box-shadow: 0 30px 80px -30px rgba(255, 122, 47, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  animation: ask-rise 0.3s var(--ease-out);
}
.ask-box h2 {
  margin: 0 0 8px;
  font-family: var(--headline, var(--display));
  font-size: 20px;
}
.ask-box .row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
@keyframes ask-fade {
  from {
    opacity: 0;
  }
}
@keyframes ask-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

/* ---------- Server builder ---------- */
.sb-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.sb-mode,
.sb-tpl {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.sb-mode.active,
.sb-tpl.active {
  border-color: rgba(255, 154, 77, 0.6);
  background: rgba(255, 122, 47, 0.14);
}
.sb-tpls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.sb-tpl {
  display: grid;
  gap: 4px;
  border-radius: 16px;
  text-align: start;
}
.sb-tpl small {
  color: var(--muted);
  font-weight: 500;
}
.sb-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.sb-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}
.sb-role i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.sb-role small {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
}
.sb-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.sb-cat {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 14px;
}
.sb-cat b {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sb-cat span {
  color: var(--muted);
}
.sb-log {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  font-family: var(--mono, monospace);
  font-size: 13px;
}

/* ---------- Website visitors (Admin) ---------- */
.vs-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 7px 14px;
  border: 1px solid rgba(78, 227, 154, 0.3);
  border-radius: 999px;
  background: rgba(78, 227, 154, 0.08);
  color: #b9f5d6;
  font-size: 13px;
  font-weight: 600;
}
.vs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ee39a;
  box-shadow: 0 0 0 0 rgba(78, 227, 154, 0.6);
  animation: vs-pulse 2s infinite;
}
@keyframes vs-pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(78, 227, 154, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(78, 227, 154, 0);
  }
}
.vs-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.vs-stat {
  display: grid;
  gap: 2px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--glass, var(--surface));
}
.vs-stat:first-child {
  border-color: rgba(255, 154, 77, 0.4);
  background: linear-gradient(160deg, rgba(255, 122, 47, 0.16), rgba(255, 122, 47, 0.02) 60%), var(--glass, var(--surface));
}
.vs-stat b {
  font-family: var(--headline, var(--display));
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.vs-stat span {
  font-size: 13px;
  font-weight: 600;
}
.vs-stat small {
  color: var(--muted);
  font-size: 12px;
}
.vs-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}
.vs-legend .k::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}
.vs-legend .visitors::before {
  background: linear-gradient(var(--gold), var(--sun));
}
.vs-legend .views::before {
  background: rgba(92, 200, 255, 0.35);
}
.vs-chart {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  align-items: end;
  gap: 5px;
  height: 200px;
  padding-top: 8px;
  border-bottom: 1px solid var(--border);
}
.vs-bar {
  position: relative;
  height: 100%;
  cursor: default;
}
.vs-bar i {
  position: absolute;
  inset: auto 0 0;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  transform-origin: bottom;
  animation: vs-grow 0.8s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 18ms);
}
.vs-bar .vs-views {
  background: linear-gradient(rgba(92, 200, 255, 0.4), rgba(92, 200, 255, 0.12));
}
.vs-bar .vs-visitors {
  inset-inline: 18%;
  background: linear-gradient(var(--gold), var(--sun));
  box-shadow: 0 0 14px -2px rgba(255, 122, 47, 0.6);
}
.vs-bar:hover .vs-views {
  background: linear-gradient(rgba(92, 200, 255, 0.7), rgba(92, 200, 255, 0.25));
}
.vs-bar.today .vs-visitors {
  background: linear-gradient(#fff3d6, var(--gold));
}
@keyframes vs-grow {
  from {
    transform: scaleY(0);
  }
}
.vs-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.vs-list {
  display: grid;
  gap: 6px;
}
.vs-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
  border-radius: 10px;
  font-size: 14px;
}
.vs-row::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: -1;
  width: var(--w, 0%);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 122, 47, 0.22), rgba(255, 122, 47, 0.06));
}
[dir='rtl'] .vs-row::before {
  background: linear-gradient(270deg, rgba(255, 122, 47, 0.22), rgba(255, 122, 47, 0.06));
}
.vs-row {
  isolation: isolate;
}
.vs-row b {
  font-variant-numeric: tabular-nums;
}
.vs-note {
  margin-top: 14px;
  text-align: center;
}
@media (max-width: 1100px) {
  .vs-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .vs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vs-chart {
    gap: 2px;
    height: 150px;
  }
  body.app .bg-glow {
    width: 300px;
    height: 300px;
    opacity: 0.4;
  }
}

/* Phones: no blur behind panels (it costs too much while scrolling) */
@media (hover: none), (max-width: 760px) {
  body.app .card,
  body.app .sidebar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.app .card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01) 45%), var(--surface) !important;
  }
}

/* ---------- Reduced motion: no animation at all ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  body.home .h-hero h1 > span,
  body.home .h-lead,
  body.home .h-actions,
  body.home .h-tags,
  body.public .plan.premium::before,
  body.app .bg-glow,
  .vs-dot,
  .vs-bar i,
  .ask-overlay,
  .ask-box {
    animation: none !important;
  }
  body.home .h-hero {
    transform: none;
    opacity: 1;
  }
  body.home .reveal .m-card,
  body.home .h-why .why {
    opacity: 1;
    transform: none;
  }
}
