:root {
  color-scheme: dark;
  --bg: #060509;
  --bg-2: #0C0A13;
  --panel: rgba(255,255,255,0.025);
  --panel-hover: rgba(255,255,255,0.04);
  --line: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --text: #F5F1E8;
  --text-dim: #A29CB8;
  --text-mute: #6B6485;
  --coral: #FF6B7A;
  --peach: #FFA574;
  --violet: #A78BFA;
  --sky: #7DD3FC;
  --lime: #BEF264;
  --radius: 16px;
  --radius-sm: 10px;
  --pad: clamp(20px, 4vw, 40px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Aurora */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.22; will-change: transform; }
.blob.b1 { width: 620px; height: 620px; background: radial-gradient(circle, #FF6B7A 0%, transparent 70%); top: -180px; left: -140px; animation: f1 22s ease-in-out infinite; }
.blob.b2 { width: 700px; height: 700px; background: radial-gradient(circle, #A78BFA 0%, transparent 70%); top: 20%; right: -220px; animation: f2 28s ease-in-out infinite; }
.blob.b3 { width: 540px; height: 540px; background: radial-gradient(circle, #7DD3FC 0%, transparent 70%); bottom: -200px; left: 30%; animation: f3 32s ease-in-out infinite; }
.blob.b4 { width: 480px; height: 480px; background: radial-gradient(circle, #FFA574 0%, transparent 70%); top: 60%; left: -100px; animation: f1 26s ease-in-out infinite reverse; }
@keyframes f1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px, 80px) scale(1.15); } }
@keyframes f2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-100px, 60px) scale(1.1); } }
@keyframes f3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(80px, -100px) scale(1.2); } }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.15; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='2'/><feColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.55 0 0 0 0 0.7 0 0 0 0.5 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(10,8,18,0.6) 100%);
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); position: relative; }

/* Brand mark */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: url('/logo-96.png') center/cover no-repeat, #0A1410; box-shadow: 0 0 20px rgba(110,231,150,0.35); }

/* Nav */
nav { position: sticky; top: 12px; z-index: 50; margin: 12px auto 0; max-width: 1180px; padding: 0 var(--pad); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 10px 20px;
  background: rgba(15,12,25,0.6);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line);
  border-radius: 100px;
  gap: 20px;
}
.nav-links { display: flex; gap: 22px; font-size: 14px; color: var(--text-dim); margin-right: auto; margin-left: 24px; }
.nav-links a { color: inherit; text-decoration: none; transition: color .2s; padding: 4px 0; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-user { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 100px; font-size: 13px; text-decoration: none; color: var(--text); transition: background .2s, border-color .2s; }
.nav-user:hover { background: rgba(255,255,255,0.07); border-color: var(--line-2); }
.nav-user img { width: 24px; height: 24px; border-radius: 50%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 100px;
  font-family: inherit; font-weight: 600; font-size: 14.5px;
  text-decoration: none; border: none; cursor: pointer;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), box-shadow .2s, background .2s;
}
.btn-primary { background: linear-gradient(135deg, var(--coral), var(--peach)); color: #1a0510; box-shadow: 0 10px 30px -8px rgba(255,107,122,0.5), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(255,107,122,0.7); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); transform: translateY(-2px); }
.btn-discord { background: #5865F2; color: white; }
.btn-discord:hover { background: #4752c4; transform: translateY(-2px); }
.btn-wide { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

/* Landing */
.center-hero {
  min-height: 80vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px var(--pad);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-bottom: 24px;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

h1 {
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 auto 20px;
  max-width: 880px;
}
h1 .grad {
  background: linear-gradient(120deg, var(--coral), var(--peach), var(--violet), var(--sky));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Instrument Serif', serif;
  font-weight: 400; font-style: italic;
}
.lede { font-size: clamp(15px, 1.3vw, 18px); color: var(--text-dim); max-width: 540px; margin: 0 auto 32px; }
.cta-row { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Page containers */
.page { padding: 40px 0 80px; }
.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 0 0 6px; }
.page-head p { color: var(--text-dim); margin: 0; font-size: 15.5px; }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .3s, background .3s;
}
.card:hover { border-color: var(--line-2); background: var(--panel-hover); }
.card-hero { padding: 32px; }
.card-title { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 14px; }

/* Stat */
.stat-value { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin-bottom: 4px; }
.stat-value .grad { background: linear-gradient(120deg, var(--coral), var(--peach)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-sub { color: var(--text-dim); font-size: 13.5px; }

/* Progress bar */
.bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin-top: 16px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--coral), var(--peach)); border-radius: 3px; transition: width .8s cubic-bezier(.2,.9,.3,1); }

/* Plan tag */
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border-radius: 100px; }
.tag-free { background: rgba(255,255,255,0.06); color: var(--text-dim); border: 1px solid var(--line); }
.tag-pro { background: linear-gradient(135deg, rgba(255,107,122,0.2), rgba(167,139,250,0.2)); color: var(--coral); border: 1px solid rgba(255,107,122,0.4); }

/* Profile block */
.profile-head { display: flex; align-items: center; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--line-2); box-shadow: 0 20px 40px -12px rgba(255,107,122,0.4); }
.profile-name { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.profile-handle { font-family: 'JetBrains Mono', monospace; color: var(--text-mute); font-size: 13px; }

/* Data row */
.row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.row:last-child { border-bottom: none; }
.row .k { color: var(--text-dim); }
.row .v { color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* Discord badge */
.connected {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(88,101,242,0.06);
}
.connected-left { display: flex; align-items: center; gap: 12px; }
.discord-icon { width: 40px; height: 40px; border-radius: 10px; background: #5865F2; display: flex; align-items: center; justify-content: center; }
.connected-name { font-weight: 600; font-size: 15px; }
.connected-sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.connected-status { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--lime); }
.connected-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 6px var(--lime); }

/* Empty / activity */
.empty { text-align: center; padding: 40px 20px; color: var(--text-mute); font-size: 14px; }
.empty .icon { font-size: 28px; opacity: 0.5; margin-bottom: 8px; }

/* Footer */
footer { padding: 30px 0 50px; border-top: 1px solid var(--line); color: var(--text-mute); font-size: 13px; margin-top: 60px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.9,.3,1), transform .7s cubic-bezier(.2,.9,.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }

/* Responsive */
@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }

  /* Nav: keep links reachable — wrap to a second scrollable row instead of hiding */
  nav { top: 8px; }
  .nav-inner { flex-wrap: wrap; padding: 10px 14px; row-gap: 8px; border-radius: 20px; }
  .nav-links {
    display: flex; order: 3; width: 100%;
    margin: 0; gap: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; white-space: nowrap;
    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-actions { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01s !important; transition-duration: .01s !important; }
}

/* ============ NAV LINKS with animated underline ============ */
.nav-link {
  position: relative;
  padding: 6px 2px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color .25s;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: linear-gradient(90deg, var(--coral), var(--peach));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.9,.3,1);
  border-radius: 2px;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.nav-signin {
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  padding: 8px 14px; text-decoration: none;
  background: none; border: none; cursor: pointer;
  transition: color .2s;
}
.nav-signin:hover { color: var(--text); }

/* ============ HERO extended ============ */
.hero { padding: clamp(80px, 12vw, 140px) 0 clamp(40px, 6vw, 80px); text-align: center; }
.hero .lede { max-width: 580px; margin: 0 auto 40px; }
.hero-meta {
  margin-top: 44px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center;
  font-size: 12.5px; color: var(--text-mute);
  font-family: 'JetBrains Mono', monospace;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.dot-lime { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 6px var(--lime); }

/* ============ SECTIONS ============ */
section { padding: clamp(60px, 10vw, 120px) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.section-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 18px;
  padding: 4px 12px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--line); border-radius: 100px;
}
h2 { font-family: 'Unbounded', 'Inter', sans-serif; font-size: clamp(26px, 3.6vw, 42px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 20px; }
h2 .grad { background: linear-gradient(120deg, var(--coral), var(--peach), var(--violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-family: 'Instrument Serif', serif; font-weight: 400; font-style: italic; }
.section-lede { font-size: 17px; color: var(--text-dim); max-width: 560px; margin: 0 auto; }

/* ============ STEPS / FEATURES / DEMO ============ */
.step { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .3s, border-color .3s, background .3s; }
.step:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--panel-hover); }
.step-num { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: 0.1em; background: linear-gradient(120deg, var(--coral), var(--peach)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 24px; }
.step h3 { font-size: 19px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.step p { color: var(--text-dim); font-size: 14px; margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; min-height: 200px; transition: transform .3s, border-color .3s, background .3s; }
.feature:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--panel-hover); }
.feature-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 13px; margin-bottom: 20px; background: linear-gradient(135deg, rgba(255,107,122,0.15), rgba(255,165,116,0.15)); color: var(--coral); border: 1px solid rgba(255,107,122,0.25); }
.feature:nth-child(2) .feature-icon { background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(125,211,252,0.15)); color: var(--violet); border-color: rgba(167,139,250,0.25); }
.feature:nth-child(3) .feature-icon { background: linear-gradient(135deg, rgba(190,242,100,0.15), rgba(125,211,252,0.15)); color: var(--lime); border-color: rgba(190,242,100,0.25); }
.feature:nth-child(4) .feature-icon { background: linear-gradient(135deg, rgba(255,165,116,0.15), rgba(255,107,122,0.15)); color: var(--peach); border-color: rgba(255,165,116,0.25); }
.feature:nth-child(5) .feature-icon { background: linear-gradient(135deg, rgba(125,211,252,0.15), rgba(167,139,250,0.15)); color: var(--sky); border-color: rgba(125,211,252,0.25); }
.feature h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.feature p { color: var(--text-dim); font-size: 14px; margin: 0; line-height: 1.5; }

/* ============ DEMO CODE ============ */
.demo-wrap { margin: 60px auto 0; max-width: 780px; position: relative; }
.demo-wrap::before { content: ''; position: absolute; inset: -20px -40px; background: radial-gradient(ellipse at center, rgba(167,139,250,0.25) 0%, transparent 70%); z-index: -1; filter: blur(30px); }
.demo { background: rgba(15,12,25,0.7); backdrop-filter: blur(24px); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0,0,0,0.5); text-align: left; }
.demo-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.demo-tabs { display: flex; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.demo-tabs span { padding: 4px 10px; border-radius: 6px; color: var(--text-mute); }
.demo-tabs .active { background: rgba(167,139,250,0.15); color: var(--violet); }
.demo-model { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-mute); display: flex; align-items: center; gap: 6px; }
.demo-model .badge { padding: 2px 8px; border-radius: 4px; background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(125,211,252,0.2)); color: var(--violet); border: 1px solid rgba(167,139,250,0.3); font-weight: 500; }
.demo-body { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.75; padding: 20px 22px; }
.demo-line { display: flex; gap: 16px; }
.demo-line .ln { color: var(--text-mute); min-width: 20px; text-align: right; user-select: none; }
.demo-line.flagged { background: rgba(255,107,122,0.06); margin: 0 -22px; padding: 0 22px; }
.demo-line.flagged .ln { color: var(--coral); }
.tk-kw { color: #FFA574; } .tk-fn { color: #FDE68A; } .tk-str { color: #BEF264; } .tk-var { color: var(--text); } .tk-glo { color: #A78BFA; }
.callout { margin: 12px 0 4px 36px; padding: 12px 14px; background: rgba(255,107,122,0.08); border-left: 2px solid var(--coral); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: 'Inter', sans-serif; font-size: 13px; }
.callout-2 { border-left-color: var(--peach); background: rgba(255,165,116,0.08); }
.callout-3 { border-left-color: var(--lime); background: rgba(190,242,100,0.08); }
.callout .tag { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); margin-bottom: 6px; }
.callout-2 .tag { color: var(--peach); }
.callout-3 .tag { color: var(--lime); }
.callout code { font-family: 'JetBrains Mono', monospace; color: var(--coral); padding: 1px 4px; background: rgba(255,107,122,0.15); border-radius: 3px; font-size: 12px; }

/* ============ PRICING ============ */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan { position: relative; background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; display: flex; flex-direction: column; transition: transform .3s; }
.plan:hover { transform: translateY(-4px); }
.plan-pro { background: linear-gradient(135deg, rgba(255,107,122,0.08) 0%, rgba(167,139,250,0.08) 100%), var(--panel); border-color: rgba(255,107,122,0.3); box-shadow: 0 20px 60px -20px rgba(255,107,122,0.3); }
.plan-pro::before { content: attr(data-badge); position: absolute; top: -12px; right: 24px; background: linear-gradient(135deg, var(--coral), var(--peach)); color: #1a0510; padding: 5px 14px; border-radius: 100px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; box-shadow: 0 8px 20px -4px rgba(255,107,122,0.5); }
.plan-name { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 24px; }
.plan-price { font-size: 52px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-bottom: 6px; }
.plan-price sup { font-size: 24px; opacity: 0.6; margin-right: 4px; vertical-align: 22px; font-weight: 500; }
.plan-price small { font-size: 15px; color: var(--text-dim); font-weight: 400; letter-spacing: 0; }
.plan-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.plan-features li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.plan-features li svg { flex-shrink: 0; margin-top: 3px; }
.plan-features li.muted { color: var(--text-mute); }
.plan-features li.muted svg path { stroke: var(--text-mute); }

.packs { margin-top: 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px; transition: border-color .2s, transform .2s; cursor: pointer; }
.pack:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pack-price { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 4px; }
.pack-price sup { font-size: 13px; opacity: 0.6; font-weight: 500; }
.pack-credits { font-size: 13px; color: var(--text-dim); }
.pack-bonus { display: inline-block; margin-left: 6px; color: var(--lime); font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }

/* ============ CTA BAND ============ */
.cta-band { background: linear-gradient(135deg, rgba(255,107,122,0.1), rgba(167,139,250,0.1)), var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line-2); border-radius: var(--radius); padding: clamp(50px, 7vw, 84px); text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 30%, rgba(255,107,122,0.2), transparent 50%), radial-gradient(ellipse at 80% 70%, rgba(167,139,250,0.2), transparent 50%); pointer-events: none; }
.cta-band > * { position: relative; }
.cta-band p { color: var(--text-dim); max-width: 520px; margin: 0 auto 32px; font-size: 16px; }

/* ============ RESPONSIVE OVERRIDES ============ */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr; }
}

/* ============ CHAT ============ */
.chat-card { display: flex; flex-direction: column; min-height: 460px; }
.model-select {
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  color: var(--text); padding: 6px 10px; border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; cursor: pointer;
  outline: none; transition: border-color .2s;
}
.model-select:hover { border-color: var(--line-2); }
.model-select option { background: var(--bg-2); color: var(--text); }

.chat-log {
  flex: 1; min-height: 240px; max-height: 380px; overflow-y: auto;
  padding: 14px; margin-bottom: 12px;
  background: rgba(0,0,0,0.15); border: 1px solid var(--line);
  border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 12px;
}
.chat-empty { text-align: center; margin: auto; color: var(--text-mute); font-size: 14px; }
.chat-empty .icon { font-size: 28px; opacity: 0.5; margin-bottom: 8px; }

.chat-msg { display: flex; flex-direction: column; gap: 4px; }
.chat-msg-user .chat-role { color: var(--peach); }
.chat-msg-assistant .chat-role { color: var(--violet); }
.chat-msg-error .chat-body { color: var(--coral); }
.chat-role {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.chat-body {
  font-size: 14px; line-height: 1.55; color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
}

.chat-input-row {
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input-row textarea {
  flex: 1; resize: none; font-family: inherit; font-size: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; transition: border-color .2s;
}
.chat-input-row textarea:focus { border-color: var(--violet); }
.chat-input-row button { padding: 10px 18px; align-self: stretch; }

.chat-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-mute); margin-top: 8px; text-align: right;
}

/* ============ CHAT PAGE ============ */
.chat-page {
  display: grid; grid-template-columns: 280px 1fr;
  max-width: 1400px; margin: 24px auto 40px;
  padding: 0 var(--pad); gap: 16px; min-height: calc(100vh - 120px);
}
.chat-sidebar {
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 120px); position: sticky; top: 90px;
}
.chat-new-btn { width: 100%; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.chat-list-empty { color: var(--text-mute); font-size: 13px; text-align: center; padding: 20px 0; }
.chat-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
}
.chat-list-item:hover { background: rgba(255,255,255,0.05); }
.chat-list-item.active { background: rgba(167,139,250,0.15); border: 1px solid rgba(167,139,250,0.3); }
.chat-list-icon { color: var(--text-dim); display: flex; align-items: center; }
.chat-list-item.active .chat-list-icon { color: var(--violet); }
.chat-list-text { flex: 1; min-width: 0; }
.chat-list-title { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-sub { font-size: 11px; color: var(--text-mute); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.chat-runs-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  color: var(--text-mute); text-align: center; padding: 8px;
  border-top: 1px solid var(--line);
}

.chat-main {
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: calc(100vh - 120px); position: relative;
}
.chat-header { padding: 16px 24px; border-bottom: 1px solid var(--line); }
.chat-title { font-size: 15px; font-weight: 600; color: var(--text); }
.chat-sub { font-size: 12px; color: var(--text-mute); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

.chat-log-full {
  flex: 1; overflow-y: auto;
  padding: 24px 32px 12px;
  display: flex; flex-direction: column; gap: 16px;
}

.chat-composer {
  padding: 12px 24px 20px;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 820px; width: 100%; margin: 0 auto;
}
.chat-controls {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}

.pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 12.5px; color: var(--text);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 100px; cursor: pointer; user-select: none;
  font-family: inherit; transition: all .2s cubic-bezier(.2,.9,.3,1);
}
.pill:hover { border-color: var(--line-2); background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.pill.open { border-color: var(--violet); background: rgba(167,139,250,0.15); }
.pill-icon { display: inline-flex; align-items: center; color: var(--text-dim); }
.pill.open .pill-icon, .pill-on .pill-icon { color: var(--violet); }
.pill-label { font-weight: 500; }
.pill-chev { font-size: 9px; color: var(--text-mute); transition: transform .2s; }
.pill.open .pill-chev { transform: rotate(180deg); color: var(--violet); }

.pill-toggle .pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-mute); transition: all .2s;
}
.pill-toggle.pill-on {
  background: rgba(190,242,100,0.12);
  border-color: rgba(190,242,100,0.4);
}
.pill-toggle.pill-on .pill-icon { color: var(--lime); }
.pill-toggle.pill-on .pill-dot { background: var(--lime); box-shadow: 0 0 8px var(--lime); }

.pill-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  min-width: 200px; max-height: 0;
  background: rgba(15,12,25,0.95); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.5);
  overflow: hidden; opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: max-height .3s cubic-bezier(.2,.9,.3,1), opacity .2s, transform .25s;
  z-index: 20;
}
.pill.open .pill-menu {
  max-height: 400px; opacity: 1; pointer-events: auto; transform: translateY(0);
  overflow-y: auto;
}
.pill-menu-wide { min-width: 340px; }
.pill-menu-header {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute);
  padding: 10px 14px 6px;
}
.pill-menu button, .pill-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 14px; background: none; border: none; color: var(--text);
  font-family: inherit; font-size: 13px; cursor: pointer; text-align: left;
  transition: background .15s;
}
.pill-menu button:hover, .pill-menu-item:hover { background: rgba(255,255,255,0.06); }
.pill-menu button.active, .pill-menu-item.active {
  background: rgba(167,139,250,0.15); color: var(--violet);
}
.pill-menu-icon { display: inline-flex; color: var(--text-dim); flex-shrink: 0; }
.pill-menu-item.active .pill-menu-icon { color: var(--violet); }
.pill-menu-multi { align-items: flex-start; padding: 10px 14px; }
.pill-menu-multi > div { flex: 1; min-width: 0; }
.pill-menu-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; white-space: normal; line-height: 1.35; }
.pill-menu-empty { padding: 14px; text-align: center; color: var(--text-mute); font-size: 12px; }

.chat-input-row {
  display: flex; gap: 10px; align-items: flex-end;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 10px 10px 10px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.chat-input-row:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167,139,250,0.15); }
.chat-input-row textarea {
  flex: 1; resize: none; font-family: inherit; font-size: 14.5px;
  background: transparent; border: none; color: var(--text);
  outline: none; padding: 8px 0;
  min-height: 24px; max-height: 200px; line-height: 1.5;
}
.chat-input-row textarea::placeholder { color: var(--text-mute); }
.chat-input-row button { padding: 10px 22px; }

.chat-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-mute); text-align: center;
}

/* Chat message logos in role label */
.chat-role svg { vertical-align: middle; margin-right: 6px; }
.chat-msg-assistant .chat-role { display: inline-flex; align-items: center; color: var(--violet); }

@media (max-width: 900px) {
  .chat-page { grid-template-columns: 1fr; margin-top: 12px; gap: 12px; }
  .chat-sidebar { position: static; max-height: none; padding: 12px; }
  .chat-list { max-height: 140px; }
  .chat-main { min-height: 70vh; }
  .chat-log-full { padding: 16px 14px 8px; }
  .chat-composer { padding: 10px 12px 14px; }
  .chat-header { padding: 12px 16px; }
}

/* CTA card on dashboard */
.chat-cta { text-decoration: none; display: flex; flex-direction: column; }
.chat-cta:hover .stat-value { color: var(--coral); }
.chip {
  display: inline-block; padding: 4px 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 100px; font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--text-dim);
}

/* ============ PLAYFUL LAYER ============ */
/* Animated gradient text */
.grad-animated, h1 .grad.grad-animated, h2 .grad.grad-animated {
  background: linear-gradient(120deg, var(--coral), var(--peach), var(--violet), var(--sky), var(--peach), var(--coral));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradShift 7s linear infinite;
}
@keyframes gradShift { to { background-position: 300% 0; } }

/* Floating emoji decorations */
.hero { position: relative; }
.floaties { position: absolute; inset: 0; pointer-events: none; user-select: none; }
.floaty {
  position: absolute; font-size: 26px; opacity: 0.45;
  filter: drop-shadow(0 6px 18px rgba(167,139,250,0.35));
  animation: floaty 7s ease-in-out infinite;
}
.floaty.f-1 { top: 16%; left: 6%; font-size: 30px; }
.floaty.f-2 { top: 22%; right: 8%; font-size: 24px; animation-delay: 1.2s; animation-duration: 8.5s; }
.floaty.f-3 { bottom: 20%; left: 12%; font-size: 22px; animation-delay: 2.4s; animation-duration: 9s; }
.floaty.f-4 { top: 9%; right: 23%; font-size: 20px; animation-delay: .8s; animation-duration: 7.5s; }
.floaty.f-5 { bottom: 13%; right: 14%; font-size: 28px; animation-delay: 1.8s; animation-duration: 10s; }
.floaty.f-6 { top: 48%; left: 3%; font-size: 22px; animation-delay: 3s; animation-duration: 8s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* Trust chips */
.trust-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.trust-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 100px;
  font-size: 12.5px; color: var(--text-dim);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

/* "Soon" pill for unavailable models */
.soon-pill {
  margin-left: auto; padding: 2px 8px; border-radius: 100px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sky); background: rgba(125,211,252,0.1);
  border: 1px solid rgba(125,211,252,0.3);
  flex-shrink: 0;
}
.pill-menu-item.disabled { opacity: 0.45; cursor: not-allowed; }
.pill-menu-item.disabled:hover { background: none; }

/* CTA hover bounce */
.btn-primary:hover { animation: ctaBounce .45s cubic-bezier(.3,1.4,.5,1); }
@keyframes ctaBounce {
  0% { transform: translateY(0); }
  40% { transform: translateY(-4px) scale(1.02); }
  100% { transform: translateY(-2px) scale(1); }
}

/* Sticker on the demo card */
.demo-sticker {
  position: absolute; top: -16px; right: -12px; z-index: 2;
  font-size: 34px; transform: rotate(12deg);
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
  animation: floaty 6s ease-in-out infinite;
}

@media (max-width: 700px) {
  .trust-chips { gap: 8px; }
  .trust-chip { font-size: 12px; padding: 6px 12px; }
  .cta-row { width: 100%; }
  .cta-row .btn { flex: 1; min-width: 180px; }
}

/* Phone layer */
@media (max-width: 640px) {
  :root { --pad: 16px; }
  body { font-size: 15px; }

  .hero { padding: clamp(48px, 14vw, 80px) 0 36px; }
  h1 { font-size: clamp(30px, 9vw, 40px); }
  h2 { font-size: clamp(26px, 7.5vw, 36px); }
  section { padding: 44px 0; }
  .section-head { margin-bottom: 32px; }
  .hero-meta { gap: 10px 18px; margin-top: 30px; }

  .card, .card-hero, .plan { padding: 20px; }
  .step, .feature { padding: 20px; min-height: 0; }
  .plan-price { font-size: 42px; }
  .stat-value { font-size: 36px; }

  .demo-body { font-size: 11px; padding: 14px 12px; line-height: 1.7; }
  .demo-line { gap: 10px; }
  .demo-line.flagged { margin: 0 -12px; padding: 0 12px; }
  .callout { margin-left: 18px; font-size: 12.5px; }
  .demo-tabs span:not(.active) { display: none; }
  .cta-band { padding: 36px 20px; }

  .btn { padding: 12px 18px; font-size: 14px; }
  .footer-row { flex-direction: column; align-items: flex-start; }

  .pill { padding: 6px 11px; font-size: 12px; }
  .pill-menu { min-width: 180px; }
  .chat-controls { gap: 6px; }
  .chat-input-row { border-radius: 16px; padding: 8px 8px 8px 12px; }
  .chat-input-row button { padding: 9px 16px; }

  .nav-user span:not([id]) { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }

  /* Tables scroll sideways instead of squishing */
  .tx-table, .docs-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tx-table thead, .tx-table tbody, .tx-table tr { white-space: nowrap; }

  /* Dashboard nav wallet chip */
  #navWallet { font-size: 11px !important; padding: 5px 9px; }

  /* Payment modal fits small screens (inline attribute styles need the override) */
  #payModal { padding: 10px !important; align-items: flex-start !important; }
  #payModal .card { padding: 18px; }
  #payQr { width: 150px !important; height: 150px !important; }
}

/* Touch targets */
@media (pointer: coarse) {
  .btn-sm { padding: 11px 16px; }
  .pill { min-height: 38px; }
  .nav-links a { padding: 8px 0; }
  input[type="range"] { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .grad-animated, h1 .grad.grad-animated, h2 .grad.grad-animated { animation: none; }
  .floaty, .demo-sticker { animation: none; }
  .btn-primary:hover { animation: none; }
}

/* Kill the obvious AI-gen tells but keep the vibe */
.floaties, .demo-sticker { display: none; }

/* Purchase modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(6,5,9,0.82); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 28px; width: 100%; max-width: 440px;
  transform: translateY(12px); transition: transform .2s cubic-bezier(.2,.9,.3,1);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-price { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 600; color: var(--coral); }
.modal-close { background: none; border: none; color: var(--text-mute); cursor: pointer; font-size: 22px; line-height: 1; padding: 0 0 0 12px; transition: color .15s; }
.modal-close:hover { color: var(--text); }
.modal-tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.modal-tab { flex: 1; padding: 8px; border: none; background: none; color: var(--text-mute); border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 13.5px; transition: all .15s; }
.modal-tab.active { background: rgba(255,255,255,0.08); color: var(--text); font-weight: 600; }
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }
.modal-balance-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.modal-balance-row .lbl { color: var(--text-mute); }
.modal-balance-row .val { font-family: 'JetBrains Mono', monospace; }
.modal-deficit { color: var(--coral); font-size: 12.5px; margin-bottom: 12px; }
.modal-promo { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.modal-promo-toggle { background: none; border: none; color: var(--text-mute); font-size: 12.5px; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 6px; transition: color .15s; }
.modal-promo-toggle:hover { color: var(--text); }
.modal-promo-row { display: flex; gap: 8px; margin-top: 10px; }
.modal-promo-input {
  flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 9px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; outline: none;
  text-transform: uppercase; transition: border-color .2s;
}
.modal-promo-input:focus { border-color: var(--violet); }
.modal-promo-msg { font-size: 12px; margin-top: 6px; }
.modal-promo-msg.ok { color: var(--lime); }
.modal-promo-msg.bad { color: var(--coral); }

/* ===== UI polish pass ===== */
html { scroll-behavior: smooth; }

body { -webkit-user-select: none; user-select: none; }
input, textarea, pre, code, p, li, td, blockquote,
h1, h2, h3, h4, .selectable, .chat-body, .chat-body *,
#payAddress, #payAmount, #payComment, #payCodeNote,
#pairCodeValue { -webkit-user-select: text; user-select: text; }

a, img, button, .btn { -webkit-user-drag: none; }
img { user-select: none; -webkit-user-select: none; }

.blob { opacity: 0.13; }

.chat-list, .chat-msgs, .docs-toc, .modal-box, .admin-scroll {
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.chat-list::-webkit-scrollbar, .chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-track, .chat-msgs::-webkit-scrollbar-track { background: transparent; }
.chat-list::-webkit-scrollbar-thumb, .chat-msgs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.chat-list::-webkit-scrollbar-thumb:hover, .chat-msgs::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 28px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--coral), var(--peach)) 0/var(--range-fill, 30%) 100% no-repeat, var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--coral), var(--peach));
  box-shadow: 0 0 0 4px rgba(255,107,122,0.18), 0 2px 8px rgba(0,0,0,0.4);
  transition: box-shadow .15s ease, transform .15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255,107,122,0.25), 0 2px 10px rgba(0,0,0,0.5); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--coral), var(--peach)); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--coral), var(--peach));
  box-shadow: 0 0 0 4px rgba(255,107,122,0.18);
}

.nav-dd { position: relative; }
.nav-dd-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 190px;
  background: var(--bg-2, #14101f); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px; box-shadow: 0 18px 48px -12px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease; z-index: 90;
}
.nav-dd-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.nav-dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: none; background: none; border-radius: 9px;
  color: var(--text); font: inherit; font-size: 13.5px; text-align: left;
  cursor: pointer; text-decoration: none; transition: background .12s ease;
}
.nav-dd-item:hover { background: rgba(255,255,255,0.06); }
.nav-dd-item.danger { color: var(--coral); }
.nav-dd-sep { height: 1px; background: var(--line); margin: 5px 8px; }

.chat-list-item { position: relative; }
.chat-list-actions {
  position: absolute; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px 0 26px; border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, transparent 0%, var(--bg-2, #14101f) 34%);
  opacity: 0; pointer-events: none; transition: opacity .16s ease;
}
.chat-list-item:hover .chat-list-actions { opacity: 1; pointer-events: auto; }
.chat-list-item.active .chat-list-actions { background: linear-gradient(90deg, transparent 0%, #221b36 34%); }
.chat-act-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,0.05); color: var(--text-dim); cursor: pointer;
  transition: all .14s ease;
}
.chat-act-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chat-act-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.chat-act-btn.del:hover { background: rgba(255,107,122,0.14); color: var(--coral); border-color: rgba(255,107,122,0.4); }
.chat-title-input {
  width: 100%; background: var(--bg); border: 1px solid var(--violet); border-radius: 7px;
  color: var(--text); font: inherit; font-size: 13px; padding: 3px 7px; outline: none;
}

.docs-toc a.active { color: var(--peach); }
.docs-toc a { position: relative; transition: color .15s ease; }
.docs-toc a.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--coral), var(--peach));
}

@media (max-width: 640px) {
  nav { position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; margin: 0; padding: 0; max-width: none; }
  .nav-inner { flex-wrap: nowrap; padding: 8px 10px; border-radius: 18px; backdrop-filter: blur(18px); }
  .nav-inner .brand span:last-child { display: none; }
  #navWallet { display: none !important; }
  .nav-links { order: 0; width: auto; flex: 1; justify-content: space-around; gap: 6px; }
  .nav-links a { font-size: 12.5px; padding: 6px 4px; }
  .nav-actions { margin-left: 4px; }
  body { padding-bottom: 76px; }
  .nav-dd-menu { top: auto; bottom: calc(100% + 10px); transform: translateY(6px) scale(0.98); }
  .nav-dd-menu.open { transform: none; }
}

/* ===== Phone density pass ===== */
@media (max-width: 640px) {
  body { font-size: 14px; }

  .page { padding: 18px 0 56px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 13px; }

  h1 { font-size: clamp(25px, 7.6vw, 32px); margin-bottom: 14px; }
  h2 { font-size: clamp(21px, 6vw, 28px); }
  .lede { font-size: 14px; margin-bottom: 22px; }
  .hero { padding: 40px 0 28px; }
  .hero .lede { margin-bottom: 26px; }
  .eyebrow { font-size: 10.5px; }

  .card, .card-hero, .plan, .step, .feature { padding: 15px; border-radius: 16px; }
  .card-title { font-size: 10px; margin-bottom: 9px; }
  .stat-value { font-size: 26px; }
  .plan-price { font-size: 30px; }
  .divider { margin: 12px 0; }

  .btn { padding: 10px 16px; font-size: 13.5px; border-radius: 12px; }
  .btn-sm { padding: 8px 12px; font-size: 12.5px; }

  .profile-avatar { width: 56px; height: 56px; }

  .modal-box { padding: 16px; border-radius: 16px; }
  .modal-title { font-size: 16px; }

  .tx-table { font-size: 12.5px; }
  .footer-row { font-size: 12.5px; gap: 10px; }

  .chat-main { min-height: 58vh; }
  .chat-body { font-size: 14px; }
  .chat-list { max-height: 118px; }
  .chat-list-item { padding: 7px 9px; }
  .chat-header { padding: 10px 12px; }
  .chat-composer { padding: 8px 10px 10px; }
  .pill { padding: 5px 9px; font-size: 11px; min-height: 32px; }

  .docs-layout .docs-toc {
    position: static; flex-direction: row; gap: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; white-space: nowrap;
    margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad) 8px;
  }
  .docs-layout .docs-toc::-webkit-scrollbar { display: none; }
  .docs-layout .docs-toc a { flex: 0 0 auto; font-size: 12.5px; padding: 6px 11px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 999px; }
  .docs-layout .docs-toc a.active { background: rgba(255,165,116,0.12); border-color: rgba(255,165,116,0.4); }
  .docs-layout .docs-toc a.active::before { display: none; }
  .docs-layout .docs-section { padding: 15px; }
  .docs-layout .docs-section h2 { font-size: 18px; }

  nav { bottom: 8px; left: 8px; right: 8px; }
  .nav-inner { padding: 6px 8px; border-radius: 16px; }
  .nav-links a { font-size: 12px; }
  .nav-user img { width: 26px; height: 26px; }
  body { padding-bottom: 68px; }
}

@media (max-width: 640px) {
  .nav-links { overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; scrollbar-width: none; white-space: nowrap; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: 0 0 auto; padding: 6px 7px; }
  .nav-actions { gap: 6px; flex: 0 0 auto; }
  .nav-actions .btn { padding: 8px 12px; font-size: 12px; white-space: nowrap; border-radius: 10px; }
  .nav-signin { font-size: 12px; padding: 6px 4px; white-space: nowrap; }
  .nav-inner .brand { flex: 0 0 auto; }
}

@media (max-width: 640px) {
  h1 { font-size: clamp(23px, 6.8vw, 28px); }
  h2 { font-size: clamp(19px, 5.4vw, 24px); }
  .lede, .section-head p { font-size: 13.5px; }
  .section-head { margin-bottom: 24px; }
  .section-eyebrow { font-size: 10px; padding: 5px 12px; }
  .eyebrow { font-size: 10px; }

  .feature h3, .step h3 { font-size: 15px; }
  .feature p, .step p { font-size: 13px; line-height: 1.55; }
  .feature-icon { width: 34px; height: 34px; font-size: 11px; border-radius: 9px; margin-bottom: 12px; }
  .step-num { font-size: 10px; margin-bottom: 12px; }

  .trust-chip { font-size: 11px; padding: 5px 10px; }
  .hero-meta { font-size: 11px; margin-top: 22px; gap: 8px 14px; }
  .cta-row .btn { min-width: 0; }

  .plan h3 { font-size: 15px; }
  .plan li { font-size: 13px; }
  .pack-chips button, .pack-chips .chip { font-size: 12.5px; }
  .cta-band h2 { font-size: 20px; }
  .cta-band p { font-size: 13px; }
}

/* No horizontal overflow — page must never be wider than the screen */
html, body { overflow-x: hidden; max-width: 100%; }
@media (max-width: 640px) {
  .wrap, .page, section, .card, .hero { max-width: 100%; }
  .demo-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .demo-line { min-width: 0; }
  .callout { max-width: calc(100% - 18px); }
  pre, code { word-break: break-word; }
  .chat-body pre { overflow-x: auto; word-break: normal; }
  img, svg, video { max-width: 100%; height: auto; }
}

@media (max-width: 640px) {
  .docs-layout { grid-template-columns: 1fr !important; }
  .docs-layout > *, .docs-layout .docs-section, .steps li { min-width: 0; max-width: 100%; }
  .docs-layout .docs-section { overflow-wrap: anywhere; }
  .docs-layout .docs-section code { white-space: normal; word-break: break-all; }
  .docs-layout .docs-section pre { overflow-x: auto; }
  .steps li { padding-left: 38px; }
  .card { min-width: 0; overflow-wrap: anywhere; }
}
