/* ═══════════════════════════════════════════════════════════════════
   TROLLZ.FUN — Edgerunner Design System
   Canonical CSS variables and utility classes.
   Include this in every page: <link rel="stylesheet" href="/css/theme.css">
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Syne:wght@700;800&family=Space+Grotesk:wght@300;400;500&display=swap');

/* ─── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Brand colors */
  --cyan:   #00e6ff;
  --mag:    #ff00c8;
  --purple: #7c3aed;
  --green:  #0fe058;
  --amber:  #ffb815;
  --red:    #e01a1a;
  --teal:   #0dd99a;

  /* Backgrounds — semi-transparent so scene.js animated wallpaper shows through */
  --bg0: rgba(3,3,8,0.92);
  --bg1: rgba(6,6,14,0.78);
  --bg2: rgba(10,10,20,0.84);
  --bg3: rgba(13,13,26,0.90);

  /* Text */
  --text:  rgba(255, 255, 255, 0.88);
  --sub:   rgba(255, 255, 255, 0.38);
  --faint: rgba(255, 255, 255, 0.07);

  /* Borders */
  --border:      rgba(255, 255, 255, 0.06);
  --border-cyan: rgba(0, 230, 255, 0.18);
  --border-mag:  rgba(255, 0, 200, 0.18);

  /* Typography */
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --font-head: 'Syne', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.15s;
  --t-mid:  0.25s;
  --t-slow: 0.4s;
}

/* ─── CHARACTER THEME COLORS ─────────────────────────────────────── */
/* Set data-char="ZAPP" on any element to propagate --tc */
[data-char="ZAPP"]  { --tc: #00e6ff; --tc-dim: rgba(0,230,255,0.12); }
[data-char="SAGE"]  { --tc: #b464ff; --tc-dim: rgba(180,100,255,0.12); }
[data-char="SPARK"] { --tc: #ffb815; --tc-dim: rgba(255,184,21,0.12); }
[data-char="CACHE"] { --tc: #00e065; --tc-dim: rgba(0,224,101,0.12); }
[data-char="ZERO"]  { --tc: #e01a1a; --tc-dim: rgba(224,26,26,0.12); }
[data-char="TERRA"] { --tc: #0dd99a; --tc-dim: rgba(13,217,154,0.12); }

/* ─── BASE ────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { opacity: 0.8; }

/* ─── SCANLINES ──────────────────────────────────────────────────── */
/* Add class="scanlines" to any positioned container */
.scanlines { position: relative; }
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0, 0, 0, 0.06) 3px, rgba(0, 0, 0, 0.06) 4px
  );
  z-index: 10;
}

/* ─── TYPOGRAPHY UTILITIES ───────────────────────────────────────── */
.font-mono  { font-family: var(--font-mono); }
.font-head  { font-family: var(--font-head); }
.font-body  { font-family: var(--font-body); }
.text-cyan  { color: var(--cyan); }
.text-mag   { color: var(--mag); }
.text-sub   { color: var(--sub); }
.text-faint { color: var(--faint); }
.text-tc    { color: var(--tc, var(--cyan)); }

/* Section label — monospace uppercase overline */
.label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 3px;
  color: rgba(0, 230, 255, 0.35);
  text-transform: uppercase;
}
.label-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.label-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--faint);
}

/* ─── LAYOUT UTILITIES ───────────────────────────────────────────── */
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm    { gap: var(--space-sm); }
.gap-md    { gap: var(--space-md); }
.flex-1    { flex: 1; }

/* ─── CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card:hover { border-color: rgba(255,255,255,0.1); }

/* ─── PANEL ───────────────────────────────────────────────────────── */
.panel {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.panel-section {
  padding: var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--border);
}
.panel-section:last-child { border-bottom: none; }

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  transition: all var(--t-fast);
  user-select: none;
}
.btn-primary {
  background: rgba(0,230,255,0.08);
  border-color: rgba(0,230,255,0.4);
  color: var(--cyan);
}
.btn-primary:hover {
  background: rgba(0,230,255,0.16);
  border-color: rgba(0,230,255,0.7);
  box-shadow: 0 0 20px rgba(0,230,255,0.18);
}
.btn-secondary {
  background: var(--faint);
  border-color: rgba(255,255,255,0.1);
  color: var(--sub);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
.btn-danger {
  background: rgba(224,26,26,0.08);
  border-color: rgba(224,26,26,0.35);
  color: #e05555;
}
.btn-lg { padding: 13px 28px; font-size: 11px; border-radius: var(--r-md); }
.btn-sm { padding: 5px 12px; font-size: 8px; }

/* ─── BADGES ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  border: 1px solid;
}
.badge-cyan   { background: rgba(0,230,255,0.1);  border-color: rgba(0,230,255,0.3);  color: var(--cyan); }
.badge-mag    { background: rgba(255,0,200,0.1);  border-color: rgba(255,0,200,0.3);  color: var(--mag); }
.badge-green  { background: rgba(15,224,88,0.1);  border-color: rgba(15,224,88,0.3);  color: var(--green); }
.badge-amber  { background: rgba(255,184,21,0.1); border-color: rgba(255,184,21,0.3); color: var(--amber); }
.badge-red    { background: rgba(224,26,26,0.1);  border-color: rgba(224,26,26,0.3);  color: #e05555; }
.badge-ghost  { background: var(--faint);         border-color: var(--border);         color: var(--sub); }

/* ─── INPUTS ──────────────────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  transition: border-color var(--t-fast);
}
.input:focus { border-color: var(--border-cyan); }
.input::placeholder { color: var(--sub); }

/* ─── STATUS INDICATORS ───────────────────────────────────────────── */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-active   { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-pending  { background: var(--amber); }
.status-expiring { background: var(--red); animation: pulse-red 1s infinite; }
.status-crystal  { background: var(--cyan); opacity: 0.5; }

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 4px var(--red); }
  50%       { box-shadow: 0 0 12px var(--red); }
}

/* ─── NAVIGATION BAR ──────────────────────────────────────────────── */
.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  background: rgba(6, 6, 14, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 16px;
  color: var(--cyan);
  letter-spacing: 1.5px;
}
.logo em { color: var(--mag); font-style: normal; }

/* ─── PROGRESS STEPPER ────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--sub);
  padding: 0 var(--space-sm);
}
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  font-size: 9px;
  flex-shrink: 0;
}
.step.active { color: var(--cyan); }
.step.active .step-num {
  border-color: var(--cyan);
  background: rgba(0,230,255,0.1);
  color: var(--cyan);
}
.step.done { color: var(--green); }
.step.done .step-num {
  border-color: var(--green);
  background: rgba(15,224,88,0.1);
  color: var(--green);
}
.step-connector { flex: 1; height: 1px; background: var(--border); min-width: 20px; }

/* ─── STAT CARD ───────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-md);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.stat-label { font-size: 9px; color: var(--sub); font-family: var(--font-mono); letter-spacing: 1px; margin-bottom: 4px; }
.stat-value { font-family: var(--font-mono); font-size: 22px; color: var(--text); line-height: 1; }
.stat-value .unit { font-size: 11px; color: var(--sub); margin-left: 4px; }
.stat-delta { font-size: 9px; color: var(--green); margin-top: 4px; }

/* ─── SCROLLBAR ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ════════════════════════════════════════════════════════════════════
   SCENE SYSTEM — background animations, particles, cursor glow, glitch
   ════════════════════════════════════════════════════════════════════ */

/* ─── Particle float ────────────────────────────────────────────────── */
@keyframes particle-float {
  from { transform: translateY(0)   rotate(0deg);   opacity: 1; }
  to   { transform: translateY(-110vh) rotate(4deg); opacity: 0; }
}
.particle {
  position: fixed;
  font-family: var(--font-mono);
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  user-select: none;
  will-change: transform, opacity;
}

/* ─── Grid breathe ──────────────────────────────────────────────────── */
@keyframes grid-breathe {
  0%,100% { background-size: 60px 60px; opacity: 0.7; }
  50%      { background-size: 64px 64px; opacity: 1.0; }
}

/* ─── Cursor glow ───────────────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
  will-change: left, top;
}

/* ─── Glitch burst ──────────────────────────────────────────────────── */
@keyframes glitch-band {
  0%   { clip-path: inset(10% 0 80% 0); transform: translateX(-4px); opacity: 0.7; }
  20%  { clip-path: inset(40% 0 45% 0); transform: translateX( 5px); opacity: 0.5; }
  40%  { clip-path: inset(70% 0 20% 0); transform: translateX(-3px); opacity: 0.6; }
  60%  { clip-path: inset(25% 0 60% 0); transform: translateX( 6px); opacity: 0.4; }
  80%  { clip-path: inset(55% 0 30% 0); transform: translateX(-5px); opacity: 0.5; }
  100% { clip-path: inset(0 0 0 0);     transform: translateX(0);    opacity: 0;   }
}
.glitch-overlay.glitch {
  animation: glitch-band 0.18s steps(3) forwards;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 6px,
    rgba(0,230,255,0.04) 6px,
    rgba(0,230,255,0.04) 7px
  );
  background-position: 0 0;
}

/* ════════════════════════════════════════════════════════════════════
   BUBBLE SYSTEM — character quote bubbles + SYNTH pills
   ════════════════════════════════════════════════════════════════════ */

@keyframes bubble-pop {
  from { opacity: 0; transform: scale(0.6) translateY(4px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);   }
}
@keyframes bubble-fade {
  from { opacity: 1; transform: scale(1)   translateY(0);    }
  to   { opacity: 0; transform: scale(0.88) translateY(-6px); }
}
@keyframes float-up {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0);    }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-48px); }
}

/* Speech bubble */
.quote-bubble {
  position: absolute;
  z-index: 20;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--bc, #00e6ff);
  background: rgba(3, 3, 8, 0.90);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--bc, #00e6ff);
  white-space: nowrap;
  pointer-events: none;
  max-width: 200px;
  white-space: pre-wrap;
  line-height: 1.4;
  box-shadow: 0 0 18px rgba(0,0,0,0.6), 0 0 8px var(--bc, rgba(0,230,255,0.2));
  transform-origin: bottom left;
}
/* Tail — triangle pointing down-left toward the face */
.quote-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 14px;
  width: 0; height: 0;
  border-left:  5px solid transparent;
  border-right: 5px solid transparent;
  border-top:   6px solid var(--bc, #00e6ff);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.4));
}

/* SYNTH floating pill */
.synth-pill {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--green);
  background: rgba(15,224,88,0.1);
  border: 1px solid rgba(15,224,88,0.3);
  border-radius: var(--r-pill);
  padding: 3px 8px;
  transform: translateX(-50%);
  white-space: nowrap;
  will-change: transform, opacity;
}

/* ════════════════════════════════════════════════════════════════════
   SCROLL REVEALS
   ════════════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════════════════════════════════
   CRYSTAL SPARKLE — orbiting stars on crystal agent cards
   ════════════════════════════════════════════════════════════════════ */
@keyframes crystal-sparkle {
  from { transform: rotate(0deg) translateX(22px) rotate(0deg);   opacity: 0.7; }
  to   { transform: rotate(360deg) translateX(22px) rotate(-360deg); opacity: 0.7; }
}
@keyframes crystal-sparkle-ccw {
  from { transform: rotate(0deg) translateX(18px) rotate(0deg);    opacity: 0.5; }
  to   { transform: rotate(-360deg) translateX(18px) rotate(360deg); opacity: 0.5; }
}
.sparkle-star {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  pointer-events: none;
  color: var(--cyan);
  font-size: 8px;
  z-index: 5;
}
.sparkle-star:nth-child(1) { animation: crystal-sparkle     3.2s linear infinite; color: var(--cyan); }
.sparkle-star:nth-child(2) { animation: crystal-sparkle-ccw 2.4s linear infinite; animation-delay: -1.2s; color: var(--mag); }
.sparkle-star:nth-child(3) { animation: crystal-sparkle     4.0s linear infinite; animation-delay: -2.0s; color: var(--amber); }
.sparkle-star:nth-child(4) { animation: crystal-sparkle-ccw 3.6s linear infinite; animation-delay: -0.8s; color: var(--green); }

/* ════════════════════════════════════════════════════════════════════
   CHAT MESSAGE SLIDE-IN
   ════════════════════════════════════════════════════════════════════ */
@keyframes msg-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-animate {
  animation: msg-slide-in 0.2s ease-out forwards;
}

/* ════════════════════════════════════════════════════════════════════
   COUNT-UP  (JS adds .counting class to trigger)
   ════════════════════════════════════════════════════════════════════ */
.counting {
  transition: color 0.3s;
  color: var(--cyan);
}

/* ════════════════════════════════════════════════════════════════════
   Z-DEPTH — all surface elements sit above the canvas layer (z-index:0)
   Canvas: 0 · content: 1 · overlays: 10-20 · topbar: 100 · modals: 200
   ════════════════════════════════════════════════════════════════════ */

/* Page-level wrappers */
#root, .shell, .page-wrap, main {
  position: relative;
  z-index: 1;
}

/* Interactive elements that need their own stacking context */
.btn, .badge, .input {
  position: relative;
  z-index: 1;
}

/* Section-level blocks */
section, header, footer, nav, form {
  position: relative;
  z-index: 1;
}

/* Overlay tier — modals, drawers, tooltips */
.modal, .drawer, .tooltip, .dropdown {
  position: relative;
  z-index: 200;
}

/* ════════════════════════════════════════════════════════════════════
   PAYMENT RAIL CARDS — collapsible panels in PAYMENTS section
   ════════════════════════════════════════════════════════════════════ */
.rail-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 10px;
}
.rail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.rail-card-header:hover { background: var(--faint); }
.rail-chevron { font-size: 10px; color: var(--sub); transition: transform 0.2s; }
.rail-card.open .rail-chevron { transform: rotate(180deg); }
.rail-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.rail-card.open .rail-card-body { display: block; }
/* Start open by default for first two */
.rail-card:nth-child(1) .rail-card-body,
.rail-card:nth-child(2) .rail-card-body { display: block; }
.rail-card:nth-child(1),
.rail-card:nth-child(2) { border-color: rgba(255,255,255,0.1); }

/* ════════════════════════════════════════════════════════════════════
   CONNECTION CARDS — Twilio / Email / MCP blocks
   ════════════════════════════════════════════════════════════════════ */
.connection-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
}
.connection-status {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
}
.connection-status-grey   { background: var(--faint); color: var(--sub); }
.connection-status-green  { background: rgba(15,224,88,0.12); color: var(--green); border: 1px solid rgba(15,224,88,0.3); }
.connection-status-red    { background: rgba(224,26,26,0.12); color: var(--red);   border: 1px solid rgba(224,26,26,0.3); }

/* ════════════════════════════════════════════════════════════════════
   COPY BUTTON — inline copy-to-clipboard
   ════════════════════════════════════════════════════════════════════ */
.copy-btn {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--faint); color: var(--text); border-color: rgba(0,230,255,0.3); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ════════════════════════════════════════════════════════════════════
   ENDPOINT URL — read-only monospace display
   ════════════════════════════════════════════════════════════════════ */
.endpoint-url {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 7px 10px;
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: rgba(0,230,255,0.7);
  word-break: break-all;
  line-height: 1.4;
}

/* ════════════════════════════════════════════════════════════════════
   TAB BAR — mode switchers (SMTP/SendGrid, Install/API/Examples)
   ════════════════════════════════════════════════════════════════════ */
.tab-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { background: var(--faint); color: var(--text); }
.tab-btn.active { background: rgba(0,230,255,0.1); color: var(--cyan); border-color: rgba(0,230,255,0.3); }

/* ════════════════════════════════════════════════════════════════════
   CODE BLOCK — dark code display with copy button
   ════════════════════════════════════════════════════════════════════ */
.code-block {
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 10px;
}
.cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
}
.code-block pre {
  margin: 0;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ════════════════════════════════════════════════════════════════════
   API ENDPOINT — collapsible <details> cards
   ════════════════════════════════════════════════════════════════════ */
.api-endpoint {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  overflow: hidden;
}
.api-endpoint > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.api-endpoint > summary::-webkit-details-marker { display: none; }
.api-endpoint > summary:hover { background: var(--faint); }
.api-endpoint[open] > summary { border-bottom: 1px solid var(--border); }
.api-endpoint-body {
  padding: 12px 14px;
}
.api-endpoint-body p { font-size: 10px; color: var(--sub); line-height: 1.6; margin-bottom: 8px; }
.api-endpoint-body .code-block { margin-bottom: 6px; }

/* ════════════════════════════════════════════════════════════════════
   BUILDER — step indicator, intent chips, rail graph
   ════════════════════════════════════════════════════════════════════ */
.builder-stepper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}
.builder-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 10px;
  color: var(--sub);
}
.builder-step:hover { background: var(--faint); }
.builder-step.active { background: rgba(0,230,255,0.08); color: var(--cyan); }
.builder-step.done   { color: rgba(255,255,255,0.5); }
.bs-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-family: var(--font-mono);
  flex-shrink: 0;
  color: var(--sub);
  transition: all 0.2s;
}
.builder-step.active .bs-dot { border-color: var(--cyan); background: rgba(0,230,255,0.15); color: var(--cyan); }
.builder-step.done   .bs-dot { border-color: var(--green); background: rgba(15,224,88,0.1); color: var(--green); }
.bs-label { font-family: var(--font-mono); letter-spacing: 1px; font-size: 10px; }

.intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.intent-chip.visible { opacity: 1; transform: translateY(0); }
.intent-chip-key { color: var(--cyan); font-size: 8px; }
.intent-chip-val { color: var(--text); }

.rail-node-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.rail-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}
.rail-node-wrap:hover .rail-tooltip { opacity: 1; }

.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.channel-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s;
  user-select: none;
}
.channel-toggle:hover { border-color: rgba(255,255,255,0.15); }
.channel-toggle.on { border-color: rgba(0,230,255,0.4); background: rgba(0,230,255,0.06); color: var(--cyan); }
.channel-check { font-size: 12px; width: 16px; }
.channel-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  animation: msg-slide-in 0.2s ease-out;
}

.payment-rail-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.pay-rail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 10px;
}
.pay-rail-row.on { border-color: rgba(0,230,255,0.3); }

.deploy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .deploy-grid { grid-template-columns: 1fr; }
}
