/* ============================================
   FlipIt Digital — Design System
   ============================================ */

:root {
  /* Brand Palette */
  --bg-0: #05060B;
  --bg-1: #0A0E1A;
  --bg-2: #11162A;
  --bg-3: #1A2040;
  --surface: rgba(20, 26, 50, 0.6);
  --surface-2: rgba(28, 36, 66, 0.7);
  --border: rgba(120, 160, 255, 0.12);
  --border-strong: rgba(120, 160, 255, 0.25);

  --text-0: #FFFFFF;
  --text-1: #E6ECFF;
  --text-2: #A8B2D1;
  --text-3: #6B7494;
  --text-muted: #4A5276;

  /* Accents */
  --primary: #6C5CE7;        /* electric violet */
  --primary-2: #8B7FFF;
  --cyan: #00E5FF;           /* trust cyan */
  --emerald: #10F2A0;        /* secure escrow green */
  --emerald-2: #00D17A;
  --amber: #FFB547;
  --rose: #FF5478;

  /* Effects */
  --glow-primary: 0 0 60px rgba(108, 92, 231, 0.45);
  --glow-cyan: 0 0 40px rgba(0, 229, 255, 0.35);
  --glow-emerald: 0 0 40px rgba(16, 242, 160, 0.35);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 10px 40px rgba(0,0,0,0.4);
  --shadow-lg: 0 30px 80px rgba(0,0,0,0.6);

  --container: 1240px;
  --header-h: 72px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-0);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ============== ANIMATED BACKGROUND ============== */
/* Base body background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: var(--bg-0);
  pointer-events: none;
}

/* Drifting grid */
body::after {
  content: "";
  position: fixed;
  inset: -56px;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 70%);
  animation: grid-drift 60s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(56px, 56px); }
}

/* Container injected via JS */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

/* Aurora orbs — soft, blurred gradient blobs that drift */
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora-1 {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.85), transparent 65%);
  top: -180px; left: -160px;
  animation: drift-1 32s ease-in-out infinite;
}

.aurora-2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.6), transparent 65%);
  top: -120px; right: -180px;
  animation: drift-2 38s ease-in-out infinite;
}

.aurora-3 {
  width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(16, 242, 160, 0.45), transparent 65%);
  bottom: -240px; left: 18%;
  animation: drift-3 44s ease-in-out infinite;
}

.aurora-4 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255, 84, 120, 0.42), transparent 65%);
  top: 38%; right: 8%;
  animation: drift-4 36s ease-in-out infinite;
}

.aurora-5 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(255, 181, 71, 0.32), transparent 65%);
  bottom: 18%; right: -120px;
  animation: drift-5 50s ease-in-out infinite;
}

@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0)         scale(1); }
  33%      { transform: translate(220px, 140px) scale(1.12); }
  66%      { transform: translate(80px, 280px)  scale(0.92); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0)          scale(1); }
  50%      { transform: translate(-260px, 200px) scale(1.18); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate(0, 0)          scale(1); }
  40%      { transform: translate(180px, -140px) scale(1.15); }
  75%      { transform: translate(-160px, 60px)  scale(0.95); }
}
@keyframes drift-4 {
  0%, 100% { transform: translate(0, 0)           scale(1); }
  50%      { transform: translate(-180px, -240px) scale(1.2); }
}
@keyframes drift-5 {
  0%, 100% { transform: translate(0, 0)           scale(1); }
  50%      { transform: translate(-120px, -160px) scale(1.08); }
}

/* Twinkling star field */
.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation: twinkle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.star.cyan  { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.star.violet{ background: var(--primary-2); box-shadow: 0 0 8px var(--primary-2); }
.star.green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.star.big   { width: 3px; height: 3px; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: 0.9; transform: scale(1.2); }
}

/* Slow-rising particles (a few drift upward) */
.particle {
  position: absolute;
  bottom: -40px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(108, 92, 231, 0.6);
  filter: blur(1px);
  animation: rise var(--dur, 18s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

.particle.cyan  { background: rgba(0, 229, 255, 0.55); }
.particle.green { background: rgba(16, 242, 160, 0.5); }

@keyframes rise {
  0%   { transform: translateY(0) translateX(0);  opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 40px)); opacity: 0; }
}

/* ============== Shooting stars / meteors ============== */
.meteor {
  position: absolute;
  top: var(--top, 30%);
  left: -180px;
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), var(--cyan));
  transform: rotate(18deg);
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.7));
  opacity: 0;
  animation: shoot var(--dur, 2.4s) ease-in infinite;
  animation-delay: var(--delay, 0s);
}

.meteor::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 14px white, 0 0 24px var(--cyan);
}

.meteor.violet { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), var(--primary-2)); filter: drop-shadow(0 0 6px rgba(108, 92, 231, 0.7)); }
.meteor.violet::after { box-shadow: 0 0 14px white, 0 0 24px var(--primary-2); }
.meteor.green { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), var(--emerald)); filter: drop-shadow(0 0 6px rgba(16, 242, 160, 0.7)); }
.meteor.green::after { box-shadow: 0 0 14px white, 0 0 24px var(--emerald); }

@keyframes shoot {
  0%   { transform: rotate(18deg) translateX(0); opacity: 0; }
  6%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: rotate(18deg) translateX(140vw); opacity: 0; }
}

/* ============== Pulsing rings ============== */
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--primary-2);
  opacity: 0;
  animation: pulse-ring 7s ease-out infinite;
  animation-delay: var(--ring-delay, 0s);
}

.ring-1 { top: 18%;  left: 12%; width: 80px; height: 80px; border-color: rgba(0, 229, 255, 0.6);   --ring-delay: 0s;   }
.ring-2 { top: 68%;  left: 78%; width: 110px; height: 110px; border-color: rgba(108, 92, 231, 0.6); --ring-delay: 2s;   }
.ring-3 { top: 38%;  left: 55%; width: 60px; height: 60px;  border-color: rgba(16, 242, 160, 0.6);  --ring-delay: 4s;   }
.ring-4 { top: 84%;  left: 22%; width: 90px; height: 90px;  border-color: rgba(255, 181, 71, 0.5);  --ring-delay: 5.5s; }
.ring-5 { top: 12%;  left: 70%; width: 70px; height: 70px;  border-color: rgba(255, 84, 120, 0.5);  --ring-delay: 1s;   }

@keyframes pulse-ring {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { opacity: 0.55; }
  100% { transform: scale(3); opacity: 0; }
}

/* ============== Floating themed icons (shield, lock, coin, etc.) ============== */
.f-icon {
  position: absolute;
  bottom: -60px;
  width: 28px;
  height: 28px;
  color: rgba(180, 195, 255, 0.35);
  filter: drop-shadow(0 0 6px rgba(108, 92, 231, 0.4));
  opacity: 0;
  animation: float-up var(--dur, 26s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.f-icon.cyan  { color: rgba(0, 229, 255, 0.45);  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5)); }
.f-icon.green { color: rgba(16, 242, 160, 0.45); filter: drop-shadow(0 0 8px rgba(16, 242, 160, 0.5)); }
.f-icon.amber { color: rgba(255, 181, 71, 0.4);  filter: drop-shadow(0 0 8px rgba(255, 181, 71, 0.45)); }

.f-icon svg { width: 100%; height: 100%; }

@keyframes float-up {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.7; }
  92%  { opacity: 0.7; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 60px)) rotate(var(--rot, 360deg)); opacity: 0; }
}

/* ============== Scanning light beam ============== */
.beam {
  position: absolute;
  top: -40%;
  left: 50%;
  width: 1px;
  height: 200%;
  background: linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.5), transparent);
  filter: blur(2px);
  transform-origin: top center;
  animation: sweep 22s linear infinite;
  opacity: 0.6;
}

@keyframes sweep {
  0%, 8%   { transform: translateX(-50%) rotate(-25deg) translateY(-100%); opacity: 0; }
  12%      { opacity: 0.6; }
  85%      { opacity: 0.6; }
  92%, 100% { transform: translateX(-50%) rotate(-25deg) translateY(100%);  opacity: 0; }
}

/* ============== Mouse parallax wrapper ============== */
/* JS smoothly lerps the transform, so no CSS transition needed here */

/* Performance + accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::after,
  .aurora,
  .star,
  .particle,
  .meteor,
  .ring,
  .f-icon,
  .beam,
  .bg-canvas { animation: none !important; transition: none !important; transform: none !important; }
  .star, .particle, .f-icon { opacity: 0.4; }
}

/* Lite mode for mobile / low-power / coarse-pointer devices.
   Smaller, less blurry orbs, no mix-blend-mode, no heavy effects.
   Avoids the iOS Safari composited-layer crash on filter:blur(90px). */
.bg-canvas.lite .aurora {
  filter: blur(48px);
  opacity: 0.35;
  mix-blend-mode: normal;
}
.bg-canvas.lite .aurora-1 { width: 360px; height: 360px; top: -120px; left: -100px; }
.bg-canvas.lite .aurora-2 { width: 320px; height: 320px; top: -80px; right: -120px; }
.bg-canvas.lite .aurora-3 { width: 380px; height: 380px; bottom: -160px; left: 12%; }
.bg-canvas.lite .meteor,
.bg-canvas.lite .ring,
.bg-canvas.lite .particle,
.bg-canvas.lite .f-icon,
.bg-canvas.lite .beam { display: none !important; }

/* Belt-and-suspenders mobile breakpoint — disables heavy compositing
   even if the .lite class somehow doesn't apply */
@media (max-width: 720px) {
  .aurora {
    filter: blur(48px);
    opacity: 0.35;
    mix-blend-mode: normal;
    animation-duration: 60s !important;
  }
  .aurora-4, .aurora-5 { display: none; }
  .meteor, .ring, .f-icon, .beam { display: none !important; }
  /* Static grid (no animation) on mobile */
  body::after { animation: none !important; }
  /* Prevent any horizontal overflow */
  html, body { overflow-x: hidden; max-width: 100vw; }
  img, svg, video { max-width: 100%; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--primary); color: white; }

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-2); margin: 0 0 1em; }

.gradient-text {
  background: linear-gradient(135deg, #FFFFFF 0%, #C0C8FF 35%, var(--cyan) 65%, var(--emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: shine 8s linear infinite;
}

@keyframes shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.text-gradient-violet {
  background: linear-gradient(135deg, #C7BCFF, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #B2FFE0, var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
  position: relative;
}

.section-sm { padding: 64px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow.cyan { background: rgba(0, 229, 255, 0.08); border-color: rgba(0, 229, 255, 0.3); color: var(--cyan); }
.eyebrow.emerald { background: rgba(16, 242, 160, 0.08); border-color: rgba(16, 242, 160, 0.3); color: var(--emerald); }

.section-title {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}

.section-title .eyebrow { margin-bottom: 16px; }
.section-title p { font-size: 1.05rem; }

/* ============== HEADER ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(5, 6, 11, 0.7);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-0);
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4);
}

.brand-logo svg { width: 22px; height: 22px; }

.brand-name b { color: var(--text-0); }
.brand-name span { color: var(--cyan); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  transition: all .2s ease;
}

.nav-links a:hover { color: var(--text-0); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text-0); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-0);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 960px) {
  .nav-links, .nav-actions .desktop-only { display: none; }
  .menu-toggle { display: inline-flex; }
}

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(5, 6, 11, 0.97);
  backdrop-filter: blur(20px);
  z-index: 40;
  padding: 24px;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
}
.mobile-menu.open { transform: none; opacity: 1; pointer-events: auto; }
.mobile-menu ul { list-style: none; padding: 0; margin: 0 0 24px; }
.mobile-menu li a {
  display: block;
  padding: 14px 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
}
.mobile-menu .stack { display: flex; flex-direction: column; gap: 12px; }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8067FF);
  color: white;
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.35), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(108, 92, 231, 0.55); }

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald-2), var(--emerald));
  color: #04221A;
  box-shadow: 0 10px 30px rgba(16, 242, 160, 0.3), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-emerald:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(16, 242, 160, 0.5); }

.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-strong);
  color: var(--text-1);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(120, 160, 255, 0.5); color: var(--text-0); }

.btn-link {
  background: transparent;
  color: var(--text-1);
  padding: 12px 14px;
}
.btn-link:hover { color: var(--cyan); }

.btn-lg { padding: 16px 28px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ============== CARDS ============== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  transition: all .3s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card.glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.6), rgba(0, 229, 255, 0.6));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.card.glow:hover::before { opacity: 1; }

/* Hero */
.hero {
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(108,92,231,.16), rgba(0,229,255,.16));
  border: 1px solid rgba(108, 92, 231, 0.4);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
}

.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: .6; }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

.hero p.lead {
  font-size: 1.18rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 18px 0 32px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.hero-stats .num {
  font-family: 'Sora', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-0);
  background: linear-gradient(135deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-stats .lab { font-size: 13px; color: var(--text-3); }

/* Floating product card preview */
.preview-stack {
  position: relative;
  aspect-ratio: 5 / 6;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
}

.preview-card {
  position: absolute;
  width: 78%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.preview-card.p1 { top: 5%; left: 0; transform: rotate(-4deg); animation: floaty 7s ease-in-out infinite; }
.preview-card.p2 { top: 28%; right: 0; transform: rotate(3deg); animation: floaty 8s ease-in-out infinite -2s; }
.preview-card.p3 { bottom: 0; left: 12%; transform: rotate(-2deg); animation: floaty 9s ease-in-out infinite -4s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-12px) rotate(var(--r, 0deg)); }
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: grid;
  place-items: center;
  font-size: 32px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.preview-thumb.green { background: linear-gradient(135deg, var(--emerald-2), #36C6FF); }
.preview-thumb.amber { background: linear-gradient(135deg, #FF7E5F, #FFB547); }

.preview-meta { display: flex; align-items: center; justify-content: space-between; }
.preview-price { font-weight: 700; color: var(--text-0); font-size: 1.05rem; }
.preview-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(16, 242, 160, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 242, 160, 0.3);
}
.preview-title { font-weight: 600; color: var(--text-1); font-size: 14px; margin-bottom: 4px; }
.preview-sub { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }

/* ============== ESCROW FLOW ============== */
.escrow-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 56px;
}

@media (max-width: 900px) {
  .escrow-flow { grid-template-columns: 1fr 1fr; gap: 14px; }
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  position: relative;
  backdrop-filter: blur(12px);
}

.flow-num {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 12px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.flow-step h4 { color: var(--text-0); font-size: 1rem; margin-bottom: 6px; }
.flow-step p { font-size: 13px; color: var(--text-2); margin: 0; }

/* ============== CATEGORY GRID ============== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: all .3s ease;
  cursor: pointer;
}

.cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat-gradient, linear-gradient(135deg, var(--primary), var(--cyan)));
  opacity: 0.08;
  transition: opacity .3s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.cat-card:hover::before { opacity: 0.18; }

.cat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 18px;
  background: var(--cat-gradient);
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
  position: relative;
}

.cat-icon svg { width: 28px; height: 28px; color: white; }

.cat-card h3 { font-size: 1.1rem; margin-bottom: 6px; position: relative; }
.cat-card p { font-size: 13px; margin: 0 0 14px; color: var(--text-2); position: relative; }

.cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  position: relative;
}
.cat-meta strong { color: var(--cyan); font-weight: 700; }

/* ============== FEATURE GRID ============== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(12px);
  transition: all .3s ease;
}

.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.feature-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(108, 92, 231, 0.14);
  border: 1px solid rgba(108, 92, 231, 0.3);
  margin-bottom: 16px;
  color: var(--primary-2);
}
.feature-icon.cyan { background: rgba(0, 229, 255, 0.12); border-color: rgba(0, 229, 255, 0.3); color: var(--cyan); }
.feature-icon.emerald { background: rgba(16, 242, 160, 0.12); border-color: rgba(16, 242, 160, 0.3); color: var(--emerald); }
.feature-icon.amber { background: rgba(255, 181, 71, 0.12); border-color: rgba(255, 181, 71, 0.3); color: var(--amber); }
.feature-icon.rose { background: rgba(255, 84, 120, 0.12); border-color: rgba(255, 84, 120, 0.3); color: var(--rose); }

.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.feature-card p { font-size: 14px; margin: 0; }

/* ============== TRUST RIBBON ============== */
.trust-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 229, 255, 0.05));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.trust-item {
  display: flex; align-items: center; gap: 14px;
}

.trust-item .ic {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(16, 242, 160, 0.14);
  color: var(--emerald);
  flex-shrink: 0;
}
.trust-item .ic svg { width: 20px; height: 20px; }
.trust-item h4 { font-size: 14px; margin: 0 0 2px; }
.trust-item p { font-size: 12px; color: var(--text-3); margin: 0; }

/* ============== TESTIMONIALS ============== */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.tm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}

.tm-stars { color: var(--amber); margin-bottom: 12px; font-size: 14px; letter-spacing: 2px; }
.tm-quote { color: var(--text-1); font-size: 15px; line-height: 1.65; margin-bottom: 18px; }
.tm-user { display: flex; align-items: center; gap: 12px; }
.tm-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: grid; place-items: center;
  font-weight: 700;
  color: white;
  font-size: 14px;
}
.tm-name { font-size: 14px; font-weight: 600; color: var(--text-0); }
.tm-role { font-size: 12px; color: var(--text-3); }

/* ============== CTA BANNER ============== */
.cta-banner {
  position: relative;
  padding: 64px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.4), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 229, 255, 0.3), transparent 50%),
    linear-gradient(135deg, #1a1740, #0a1430);
  border: 1px solid rgba(120, 160, 255, 0.25);
  text-align: center;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 80%);
}

.cta-banner > * { position: relative; }
.cta-banner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.cta-banner p { color: var(--text-1); font-size: 1.05rem; max-width: 580px; margin: 0 auto 28px; }
.cta-buttons { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 720px) { .cta-banner { padding: 40px 24px; } }

/* ============== FOOTER ============== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  background: rgba(5, 6, 11, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand p { color: var(--text-3); max-width: 320px; font-size: 14px; }
.footer-col h5 {
  color: var(--text-0);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  font-weight: 700;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  font-size: 14px;
  color: var(--text-2);
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--cyan); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}

.socials { display: flex; gap: 10px; }
.social-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all .2s ease;
}
.social-btn:hover { color: var(--cyan); border-color: var(--border-strong); transform: translateY(-2px); }
.social-btn svg { width: 16px; height: 16px; }

/* ============== PAGE HEADER ============== */
.page-header {
  padding: 80px 0 48px;
  text-align: center;
  position: relative;
}

.page-header h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); margin-bottom: 14px; }
.page-header p { color: var(--text-2); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--cyan); }

/* ============== MARKETPLACE / BROWSE ============== */
.market-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .market-layout { grid-template-columns: 1fr; }
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.filter-panel h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin: 0 0 12px;
  font-weight: 700;
}

.filter-group { margin-bottom: 22px; }
.filter-group:last-child { margin-bottom: 0; }

.filter-list { list-style: none; padding: 0; margin: 0; }
.filter-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text-2);
  font-size: 14px;
  border-radius: 6px;
}
.filter-list li:hover { color: var(--text-0); }
.filter-list li .count { font-size: 12px; color: var(--text-3); }
.filter-list li.active { color: var(--cyan); }

.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.search-input {
  flex: 1; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  position: relative;
}
.search-input:focus { outline: none; border-color: var(--primary); }

.search-wrap { flex: 1; max-width: 460px; position: relative; }
.search-wrap svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-3);
  pointer-events: none;
}

.select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--primary); }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.product-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  position: relative;
  display: grid; place-items: center;
  font-size: 38px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
}

.product-thumb .badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
}

.product-thumb .verified {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(16, 242, 160, 0.92);
  color: #04221A;
  display: inline-flex; align-items: center; gap: 4px;
}
.product-thumb .verified svg { width: 12px; height: 12px; }

.product-body { padding: 16px; }
.product-cat { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.product-title { font-size: 14.5px; color: var(--text-0); font-weight: 600; margin: 6px 0 10px; line-height: 1.35; }

.product-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border);
}

.product-price { font-family: 'Sora', sans-serif; font-weight: 700; color: var(--cyan); font-size: 1.05rem; }
.product-rating { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.product-rating .star { color: var(--amber); }

/* product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}
@media (max-width: 900px) { .product-detail { grid-template-columns: 1fr; } }

.product-gallery {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.product-hero {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 76px;
  margin-bottom: 16px;
}

.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs > div {
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px;
  cursor: pointer;
  transition: all .2s ease;
}
.gallery-thumbs > div:hover, .gallery-thumbs .active { border-color: var(--cyan); transform: scale(1.05); }

.product-buy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.price-now { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 2.4rem; color: var(--text-0); }
.price-was { color: var(--text-3); text-decoration: line-through; font-size: 1.1rem; }
.price-save {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 242, 160, 0.14);
  color: var(--emerald);
  margin-left: 8px;
}

.spec-list { list-style: none; padding: 0; margin: 18px 0 24px; }
.spec-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
}
.spec-list li:last-child { border-bottom: none; }
.spec-list li svg { color: var(--emerald); width: 16px; height: 16px; flex-shrink: 0; }

.seller-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.seller-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  display: grid; place-items: center;
  color: #021;
  font-weight: 700;
}
.seller-name { font-weight: 600; color: var(--text-0); display: flex; align-items: center; gap: 6px; }
.seller-name .verify { color: var(--cyan); }
.seller-meta { font-size: 12px; color: var(--text-3); }

/* ============== FORM (auth) ============== */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 60px 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 44px 38px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.auth-card h1 { font-size: 1.8rem; margin-bottom: 8px; text-align: center; }
.auth-card .lead { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 28px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}

.input, textarea, select.input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 14.5px;
  transition: all .2s ease;
}
.input:focus, textarea:focus { outline: none; border-color: var(--primary); background: rgba(108, 92, 231, 0.08); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0;
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.oauth-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.oauth-btn:hover { background: rgba(255,255,255,0.08); }
.oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); margin: 12px 0 18px; }
.checkbox-row input { accent-color: var(--primary); }

.alt-link { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 16px; }
.alt-link a { color: var(--cyan); font-weight: 600; }

/* ============== DASHBOARD ============== */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .dash-layout { grid-template-columns: 1fr; } }

.dash-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.dash-side ul { list-style: none; padding: 0; margin: 0; }
.dash-side li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
}
.dash-side li a:hover, .dash-side li a.active { background: rgba(108, 92, 231, 0.14); color: var(--text-0); }
.dash-side li a svg { width: 18px; height: 18px; }
.dash-side hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.kpi-lab { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-num { font-family: 'Sora', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--text-0); margin: 6px 0 4px; }
.kpi-trend { font-size: 12px; color: var(--emerald); }
.kpi-trend.down { color: var(--rose); }

.dash-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .dash-row { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.panel-head h3 { margin: 0; font-size: 1.1rem; }

.tx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tx-table th, .tx-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.tx-table th { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.tx-table td { color: var(--text-1); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill.success { background: rgba(16, 242, 160, 0.14); color: var(--emerald); }
.pill.pending { background: rgba(255, 181, 71, 0.14); color: var(--amber); }
.pill.escrow { background: rgba(0, 229, 255, 0.14); color: var(--cyan); }
.pill.dispute { background: rgba(255, 84, 120, 0.14); color: var(--rose); }

.bar-chart { display: flex; align-items: end; gap: 8px; height: 180px; padding: 12px 0; }
.bar {
  flex: 1;
  background: linear-gradient(180deg, var(--cyan), var(--primary));
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all .3s ease;
}
.bar:hover { opacity: 0.8; }

/* ============== FAQ ============== */
.faq-list { max-width: 820px; margin: 0 auto; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text-0);
}
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--text-3);
  transition: transform .2s ease;
  font-weight: 300;
}

.faq-item[open] summary::after { transform: rotate(45deg); color: var(--cyan); }

.faq-item .faq-body {
  padding: 0 24px 22px;
  color: var(--text-2);
  line-height: 1.7;
  font-size: 14.5px;
}

/* ============== PRICING ============== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
  display: flex; flex-direction: column;
}
.price-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(108, 92, 231, 0.18), var(--surface));
  box-shadow: 0 16px 60px rgba(108, 92, 231, 0.22);
}
.price-card .pill {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
}
.price-card h3 { font-size: 1.25rem; }
.price-card .price-val {
  display: flex; align-items: baseline; gap: 6px;
  font-family: 'Sora', sans-serif; font-weight: 700; color: var(--text-0);
  margin: 12px 0;
}
.price-card .price-val .num { font-size: 2.6rem; }
.price-card .price-val .per { color: var(--text-3); font-size: 14px; }

.price-card ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.price-card li { padding: 8px 0; color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.price-card li svg { color: var(--emerald); width: 16px; height: 16px; flex-shrink: 0; }

/* ============== UTILITIES ============== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 16px; }
.gap-1 { gap: 8px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

.divider-line { height: 1px; background: var(--border); margin: 32px 0; }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: all .8s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: rgba(108, 92, 231, 0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108, 92, 231, 0.6); }

/* Animated dot grid for sections */
.section-dot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 160, 255, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 70%);
}

/* ============================================
   CHAT WIDGET — Real-time buyer/seller chat
   ============================================ */

/* Floating Action Button */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  box-shadow:
    0 18px 40px rgba(108, 92, 231, 0.55),
    0 0 0 0 rgba(108, 92, 231, 0.5);
  display: grid;
  place-items: center;
  z-index: 9998;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
  animation: fab-pulse 2.6s ease-in-out infinite;
}
.chat-fab:hover { transform: scale(1.08) rotate(-4deg); }
.chat-fab.open { transform: scale(0.92); }
.chat-fab svg { width: 26px; height: 26px; }
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 18px 40px rgba(108, 92, 231, 0.55), 0 0 0 0 rgba(0, 245, 212, 0.45); }
  50%      { box-shadow: 0 18px 40px rgba(108, 92, 231, 0.55), 0 0 0 14px rgba(0, 245, 212, 0); }
}
.chat-fab .badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff5e5e, #ff2d6f);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: none;
  place-items: center;
  border: 2px solid #0a0c12;
  box-shadow: 0 4px 14px rgba(255, 45, 111, 0.7);
}
.chat-fab.has-unread .badge-dot { display: grid; animation: badge-bounce 0.5s ease; }
@keyframes badge-bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Panel */
.chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 140px);
  background: linear-gradient(180deg, rgba(18, 22, 36, 0.96), rgba(10, 12, 18, 0.98));
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(108, 92, 231, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.2,.8,.2,1);
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chat-panel.drag {
  outline: 2px dashed rgba(0, 245, 212, 0.6);
  outline-offset: -8px;
}
.chat-panel.drag::before {
  content: 'Drop file to attach';
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 18, 0.85);
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}

/* Role indicator badge */
.chat-panel.role-seller::before {
  content: 'SELLER VIEW';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  color: #001a14;
  border-radius: 999px;
  pointer-events: none;
}
.chat-panel.role-buyer::before {
  content: 'BUYER VIEW';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  border-radius: 999px;
  pointer-events: none;
}

/* Header */
.chat-head {
  padding: 26px 16px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(108, 92, 231, 0.10), transparent);
  position: relative;
}
.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  color: #00120c;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 16px rgba(0, 245, 212, 0.3);
  position: relative;
}
.chat-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #14d68f;
  border: 2px solid #14182a;
  box-shadow: 0 0 0 2px rgba(20, 214, 143, 0.25);
}
.chat-meta {
  min-width: 0;
  overflow: hidden;
}
.chat-meta .name {
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-meta .name .verify { color: var(--cyan); flex-shrink: 0; }
.chat-meta .sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.chat-meta .sub.typing { color: var(--cyan); font-weight: 600; }
.chat-meta .sub .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: inline-block;
}
.chat-meta .sub .dot.online { background: #14d68f; box-shadow: 0 0 8px #14d68f; }
.typing-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cyan);
  animation: typing-dot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chat-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.chat-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.chat-icon-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.chat-icon-btn:active { transform: scale(0.92); }
.chat-icon-btn svg { width: 17px; height: 17px; }

/* Header dropdown menu */
.chat-more-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.chat-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: rgba(20, 24, 38, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  padding: 6px;
  display: none !important;
  z-index: 30;
}
.chat-menu.open { display: block !important; animation: menu-in 0.18s ease-out; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-menu button:hover { background: rgba(255,255,255,0.06); }
.chat-menu button svg { width: 14px; height: 14px; opacity: 0.7; }

/* Search bar */
.chat-search-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.chat-search-bar.open { display: flex; }
.chat-search-bar svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.chat-search-bar input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  outline: none;
  padding: 4px 0;
}

/* Order summary card */
.chat-order-card {
  margin: 10px 14px 8px;
  padding: 10px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.08), rgba(108, 92, 231, 0.08));
  border: 1px solid rgba(0, 245, 212, 0.20);
}
.oc-thumb {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
}
.oc-title { font-weight: 700; font-size: 12.5px; }
.oc-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.oc-status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(0, 245, 212, 0.3);
  white-space: nowrap;
}

/* Body */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

.chat-day-divider {
  text-align: center;
  margin: 14px 0 8px;
}
.chat-day-divider span {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Messages */
.msg {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 78%;
  margin: 2px 0;
  animation: msg-in 0.28s cubic-bezier(.2,.8,.2,1);
}
.msg.them { align-self: flex-start; }
.msg.me   { align-self: flex-end; align-items: flex-end; }
.msg.flash .bubble { animation: flash 1.6s ease; }
@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
  20%, 80% { box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.6); }
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg .bubble {
  position: relative;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  transition: box-shadow 0.3s;
}
.msg.them .bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 6px;
  color: var(--text);
}
.msg.me .bubble {
  background: linear-gradient(135deg, var(--primary), #5a4ad6);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}
.msg.deleted .bubble {
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-style: italic;
}
.msg .bubble a { color: inherit; text-decoration: underline; }
.msg .bubble strong { font-weight: 700; }
.msg .bubble em { font-style: italic; }
.deleted-text { color: rgba(255,255,255,0.4); }

/* Reply quote */
.msg-reply {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  max-width: 100%;
  transition: background 0.18s;
}
.msg-reply:hover { background: rgba(255,255,255,0.07); }
.msg-reply .rp-bar { width: 3px; background: var(--cyan); border-radius: 2px; flex-shrink: 0; }
.msg-reply .rp-name { font-size: 11px; font-weight: 700; color: var(--cyan); }
.msg-reply .rp-text { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Attachments inside messages */
.msg-atts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.msg-atts:last-child { margin-bottom: 0; }
.msg-img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 10px;
  cursor: zoom-in;
  display: block;
  transition: transform 0.2s;
}
.msg-img:hover { transform: scale(1.02); }
.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.18s;
}
.msg.me .msg-file { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.18); }
.msg-file:hover { background: rgba(255,255,255,0.1); }
.msg-file .mf-ic {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(0, 245, 212, 0.18);
  color: var(--cyan);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.msg-file .mf-ic svg { width: 16px; height: 16px; }
.mf-name { font-size: 12.5px; font-weight: 600; }
.mf-size { font-size: 10.5px; color: var(--text-muted); }

/* Voice notes */
.msg-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}
.voice-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 0;
  color: white;
  cursor: pointer;
  display: grid; place-items: center;
}
.voice-play svg { width: 12px; height: 12px; margin-left: 2px; }
.voice-bars {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 24px;
  flex: 1;
}
.voice-bars span {
  width: 3px;
  background: rgba(255,255,255,0.55);
  border-radius: 2px;
  animation: voice-bar 1.4s ease-in-out infinite;
}
.voice-bars span:nth-child(odd)  { height: 60%; }
.voice-bars span:nth-child(3n)   { height: 40%; }
.voice-bars span:nth-child(4n)   { height: 80%; }
.voice-bars span:nth-child(5n)   { height: 50%; }
.voice-bars span:nth-child(7n)   { height: 95%; }
@keyframes voice-bar {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.voice-dur { font-size: 11px; opacity: 0.85; }

/* Reactions */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.rx-chip {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: transform 0.15s, background 0.15s;
}
.rx-chip:hover { transform: scale(1.06); }
.rx-chip.mine {
  background: rgba(0, 245, 212, 0.18);
  border-color: rgba(0, 245, 212, 0.4);
}
.rx-chip span { font-size: 10px; opacity: 0.85; font-weight: 700; }

/* Message hover actions */
.msg-actions {
  position: absolute;
  top: -16px;
  right: 6px;
  display: flex;
  gap: 2px;
  background: rgba(20, 24, 38, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 3px;
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 5;
  pointer-events: none;
}
.msg.them .msg-actions { left: 6px; right: auto; }
.msg .bubble:hover ~ .msg-actions,
.msg-actions:hover {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.msg .bubble { position: relative; }
.msg:hover .msg-actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.msg-act {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.msg-act:hover { background: rgba(255,255,255,0.12); }
.msg-act svg { width: 13px; height: 13px; }

/* Reaction popover */
.rx-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  display: none;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(20, 24, 38, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 20;
}
.msg.them .rx-popover { right: auto; left: 0; }
.rx-popover.open {
  display: flex;
  animation: pop-in 0.18s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
.rx-popover button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}
.rx-popover button:hover {
  transform: scale(1.3);
  background: rgba(255,255,255,0.1);
}

/* Meta (time / read receipt) */
.msg .meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.msg .meta .read { color: var(--text-muted); display: inline-flex; }
.msg .meta .read.on { color: #4dd0e1; }
.msg .meta .read svg { width: 13px; height: 13px; }

/* Scroll-to-bottom button */
.chat-scroll-btn {
  position: absolute;
  right: 14px;
  bottom: 110px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 24, 38, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: none;
  place-items: center;
  z-index: 5;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  transition: transform 0.18s;
}
.chat-scroll-btn.show { display: grid; animation: msg-in 0.25s ease; }
.chat-scroll-btn:hover { transform: scale(1.08); }
.chat-scroll-btn svg { width: 16px; height: 16px; }
.chat-scroll-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff5e5e, #ff2d6f);
  color: white;
  display: none;
  place-items: center;
  border: 2px solid #14182a;
}
.chat-scroll-btn .badge.show { display: grid; }

/* Reply preview */
.chat-reply-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 245, 212, 0.06);
  border-top: 1px solid rgba(0, 245, 212, 0.2);
}
.chat-reply-preview.open { display: flex; animation: msg-in 0.2s ease; }
.chat-reply-preview .rp-bar {
  width: 3px;
  height: 32px;
  background: var(--cyan);
  border-radius: 2px;
}
.chat-reply-preview .rp-content { flex: 1; min-width: 0; }
.chat-reply-preview .rp-name { font-size: 11px; font-weight: 700; color: var(--cyan); }
.chat-reply-preview .rp-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pending attachments tray */
.chat-attachments {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-attachments.has { display: flex; }
.att-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.att-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.att-file {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--cyan);
  text-align: center;
  padding: 4px;
}
.att-file svg { width: 18px; height: 18px; }
.att-file span {
  display: block;
  font-size: 9px;
  color: var(--text);
  margin-top: 2px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-rm {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 45, 111, 0.9);
  color: white;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* Templates / quick chips */
.chat-templates {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.chat-templates.open { display: flex; animation: msg-in 0.22s ease; }
.tpl-chip {
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.35);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}
.tpl-chip:hover {
  background: rgba(108, 92, 231, 0.3);
  transform: translateY(-1px);
}

/* Emoji tray */
.chat-emoji-tray {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  max-height: 160px;
  overflow-y: auto;
}
.chat-emoji-tray.open { display: flex; animation: msg-in 0.22s ease; }
.chat-emoji-tray button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, transform 0.15s;
}
.chat-emoji-tray button:hover { background: rgba(255,255,255,0.1); transform: scale(1.2); }

/* Composer */
.chat-input-row {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-panel.recording .chat-input-row { display: none; }
.chat-input {
  flex: 1;
  resize: none;
  min-height: 38px;
  max-height: 120px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  line-height: 1.4;
  transition: border-color 0.18s, background 0.18s;
}
.chat-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 245, 212, 0.4);
}
.chat-input::placeholder { color: rgba(255,255,255,0.35); }
.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-send:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(108, 92, 231, 0.6); }
.chat-send:active { transform: scale(0.93); }
.chat-send svg { width: 16px; height: 16px; }

/* Recording */
.chat-recording {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-recording.open { display: flex; animation: msg-in 0.2s ease; }
.rec-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ff2d6f;
  box-shadow: 0 0 10px #ff2d6f;
  animation: rec-blink 1s ease-in-out infinite;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.rec-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  min-width: 36px;
}
.rec-bars {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: center;
  height: 28px;
}
.rec-bars span {
  flex: 1;
  background: linear-gradient(180deg, var(--cyan), var(--primary));
  border-radius: 2px;
  animation: rec-bar 1.2s ease-in-out infinite;
}
.rec-bars span:nth-child(1) { animation-delay: 0s; height: 30%; }
.rec-bars span:nth-child(2) { animation-delay: 0.1s; height: 60%; }
.rec-bars span:nth-child(3) { animation-delay: 0.2s; height: 80%; }
.rec-bars span:nth-child(4) { animation-delay: 0.3s; height: 40%; }
.rec-bars span:nth-child(5) { animation-delay: 0.4s; height: 90%; }
.rec-bars span:nth-child(6) { animation-delay: 0.5s; height: 60%; }
.rec-bars span:nth-child(7) { animation-delay: 0.4s; height: 70%; }
.rec-bars span:nth-child(8) { animation-delay: 0.3s; height: 30%; }
.rec-bars span:nth-child(9) { animation-delay: 0.2s; height: 80%; }
.rec-bars span:nth-child(10) { animation-delay: 0.1s; height: 50%; }
.rec-bars span:nth-child(11) { animation-delay: 0.3s; height: 70%; }
.rec-bars span:nth-child(12) { animation-delay: 0.5s; height: 40%; }
@keyframes rec-bar {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* Image lightbox */
.chat-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10001;
  display: none;
  place-items: center;
  cursor: zoom-out;
  padding: 40px;
}
.chat-lightbox.open { display: grid; animation: msg-in 0.25s ease; }
.chat-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.chat-lightbox .lb-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

/* Mobile */
@media (max-width: 480px) {
  .chat-panel {
    bottom: 88px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: 78vh;
  }
  .chat-fab { bottom: 16px; right: 16px; width: 56px; height: 56px; }
  .chat-fab svg { width: 22px; height: 22px; }
  .msg-img { max-width: 200px; max-height: 200px; }
}

/* ============================================
   CHAT — Inbox view + view switching (v5)
   ============================================ */

/* Two views inside the same panel */
.chat-panel .chat-view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.chat-panel.view-inbox .chat-inbox { display: flex; }
.chat-panel.view-chat  .chat-conv  { display: flex; }
.chat-panel { display: flex; flex-direction: column; }

/* The chat-conv view needs relative positioning for floating buttons */
.chat-panel .chat-conv {
  position: relative;
}

/* Fix role badge for both views */
.chat-panel.role-seller::before,
.chat-panel.role-buyer::before {
  display: none; /* The badge is now per-conv */
}
.chat-panel[data-conv-type="seller"].role-seller::before {
  content: 'SELLER VIEW';
  display: block;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  color: #001a14;
  border-radius: 999px;
  pointer-events: none;
}
.chat-panel[data-conv-type="seller"].role-buyer::before {
  content: 'BUYER VIEW';
  display: block;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  border-radius: 999px;
  pointer-events: none;
}

/* ====== Inbox header ====== */
.inbox-head {
  padding: 26px 16px 14px !important;
  grid-template-columns: 1fr auto !important;
}
.inbox-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inbox-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
}
.inbox-avatar svg { width: 18px; height: 18px; }
.inbox-title .name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.2px;
}
.inbox-title .sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Inbox search */
.inbox-search {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
.inbox-search.open { display: flex; }
.inbox-search svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.inbox-search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  outline: none;
  padding: 4px 0;
}

/* Inbox banner (escrow protection note) */
.inbox-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 8px 14px 0;
  border-radius: 10px;
  font-size: 11.5px;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.06), rgba(108, 92, 231, 0.06));
  border: 1px solid rgba(0, 245, 212, 0.18);
  color: var(--text-muted);
}
.inbox-banner svg { width: 14px; height: 14px; color: var(--cyan); flex-shrink: 0; }
.inbox-banner strong { color: var(--cyan); font-weight: 700; }

/* Inbox list */
.inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
}
.inbox-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Inbox row */
.inbox-row {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px 10px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  position: relative;
  transition: background 0.18s, transform 0.18s;
}
.inbox-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.inbox-row:active { transform: scale(0.985); }
.inbox-row.unread { background: rgba(108, 92, 231, 0.07); }
.inbox-row.unread:hover { background: rgba(108, 92, 231, 0.12); }

.ir-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.ir-online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid #14182a;
}
.ir-online.online {
  background: #14d68f;
  box-shadow: 0 0 0 2px rgba(20, 214, 143, 0.25), 0 0 8px rgba(20, 214, 143, 0.6);
}
.ir-bot-tag {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  border: 2px solid #14182a;
  letter-spacing: 0.5px;
}

.ir-info { min-width: 0; flex: 1; }
.ir-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.ir-name {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ir-name .verify { color: var(--cyan); flex-shrink: 0; }
.ir-time {
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.inbox-row.unread .ir-time { color: var(--cyan); font-weight: 700; }

.ir-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.inbox-row.unread .ir-preview { color: var(--text); font-weight: 500; }
.ir-preview .you { color: var(--text-muted); }

.ir-order {
  font-size: 10.5px;
  color: var(--cyan);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 245, 212, 0.07);
  padding: 2px 6px;
  border-radius: 999px;
  display: inline-block;
  max-width: 100%;
  border: 1px solid rgba(0, 245, 212, 0.15);
}

.ir-unread {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5e5e, #ff2d6f);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(255, 45, 111, 0.5);
}

/* Back button */
.chat-back {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  margin-right: -4px;
  transition: background 0.18s, transform 0.18s;
}
.chat-back:hover { background: rgba(255, 255, 255, 0.08); }
.chat-back:active { transform: translateX(-2px); }
.chat-back svg { width: 18px; height: 18px; }

/* The chat-conv head needs to make room for back button */
.chat-conv .chat-head {
  grid-template-columns: auto auto 1fr auto;
}

/* Order card now toggles */
.chat-order-card {
  display: none;
}
.chat-order-card.show {
  display: grid;
  margin: 10px 14px 8px;
  padding: 10px;
  border-radius: 12px;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.08), rgba(108, 92, 231, 0.08));
  border: 1px solid rgba(0, 245, 212, 0.20);
  animation: msg-in 0.25s ease;
}

/* Bot tag in name */
.bot-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  vertical-align: middle;
  margin-left: 4px;
}

/* Quick replies bar (above composer) */
.chat-quick-replies {
  display: none;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 245, 212, 0.03);
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick-replies::-webkit-scrollbar { display: none; }
.chat-quick-replies.show { display: flex; }
.qr-chip {
  flex-shrink: 0;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.30);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, transform 0.15s;
}
.qr-chip:hover {
  background: rgba(0, 245, 212, 0.20);
  border-color: rgba(0, 245, 212, 0.5);
  transform: translateY(-1px);
}

/* Bot typing indicator (within messages list) */
.msg.typing-msg .bubble {
  padding: 12px 14px;
}
.msg.typing-msg .typing-dots span {
  background: var(--text-muted);
}

/* Hide seller-only buttons cleanly when bot conv is active */
.chat-panel[data-conv-type="bot"] [data-seller-only] {
  display: none !important;
}

/* ============================================
   MOBILE OPTIMIZATIONS (v7) — keep the GPU happy
   ============================================ */
@media (max-width: 720px) {
  /* Slow down / reduce glassy compositing layers */
  .card, .preview-card, .flow-step, .mobile-menu, .btn-ghost,
  .panel, .feature-card, .price-card, .auth-card,
  .chat-panel, .chat-search-bar, .chat-quick-replies,
  .profile-side, .wallet-card, .ticket-row {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
  }

  /* Tighter section padding on mobile */
  .section { padding: 56px 0; }
  .section-sm { padding: 40px 0; }
  .container { padding: 0 16px; }

  /* Hero stack & breathing room */
  .hero { padding: 48px 0 64px; }
  .hero-stats { gap: 22px; }
  .hero-stats .num { font-size: 1.35rem; }

  /* Site header — keep nav usable */
  .site-header { padding: 8px 0; }
  .nav-actions .btn-sm { padding: 8px 12px; font-size: 12.5px; }

  /* Dashboard / search inside the header — collapse the search on mobile */
  .site-header .search-wrap { display: none !important; }

  /* Field rows: collapse to single column to avoid cramped inputs */
  .field-row { grid-template-columns: 1fr !important; gap: 0 !important; }

  /* Profile page: collapse sidebar above content */
  .profile-layout { grid-template-columns: 1fr !important; }
  .profile-side { position: static !important; }
  .profile-tabs button { font-size: 12.5px; padding: 9px 10px; min-width: 0 !important; }
  .profile-tabs button .pill { display: none; }

  /* Wallet cards stack */
  .profile-layout .wallet-card { grid-column: 1 / -1; }
  .profile-layout div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Make tables scroll horizontally instead of overflowing */
  .panel table, .legal table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Pricing tier columns: stack */
  .price-grid { grid-template-columns: 1fr !important; }

  /* Step rows in how-it-works — stack the visual + content */
  .step-card { grid-template-columns: 1fr !important; }

  /* Feature cards: 1 column under 480, 1col under 720 too if needed */
  .feature-grid { grid-template-columns: 1fr !important; gap: 14px; }
  .category-grid { grid-template-columns: 1fr 1fr !important; gap: 12px; }
  .testimonial-grid { grid-template-columns: 1fr !important; }
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }

  /* Footer columns stack */
  .footer-grid { grid-template-columns: 1fr !important; gap: 24px; }

  /* Chat panel: full screen on small phones */
  .chat-panel {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;        /* Safari fallback */
    height: 100dvh !important;        /* dynamic viewport height */
    border-radius: 0 !important;
  }
  .chat-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }

  /* Headings shrink */
  h1 { font-size: clamp(2rem, 7vw, 2.6rem); }
  h2 { font-size: clamp(1.5rem, 5.5vw, 2rem); }

  /* Page header */
  .page-header { padding: 32px 0 24px; }
  .breadcrumbs { font-size: 12px; }

  /* Auth (login / signup) card */
  .auth-card { padding: 22px !important; margin: 0 4px; }
  .auth-wrap { padding: 24px 12px; }
}

/* Even tighter for very small phones */
@media (max-width: 420px) {
  .category-grid { grid-template-columns: 1fr !important; }
  .kpi-grid { grid-template-columns: 1fr !important; }
  .nav-actions .seller-avatar { display: none; }
  .auth-card h1 { font-size: 1.6rem; }
}
