/* ================================================================
   GROUNDR — Design System
   Premium, minimal aesthetic for the Reality Negotiation Protocol
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --bg: #030305;
  --bg-raised: #0a0a0f;
  --bg-card: rgba(24, 24, 27, 0.6);
  --bg-code: #121217;
  --ink: #ffffff;
  --ink-soft: #e4e4e7;
  --muted: #a1a1aa;
  --border: rgba(39, 39, 42, 0.8);
  --green: #4ade80;
  --green-glow: rgba(74, 222, 128, 0.2);
  --blue: #60a5fa;
  --blue-glow: rgba(96, 165, 250, 0.2);
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 16px;
  --radius-sm: 8px;
  --glass: blur(12px) saturate(180%);
  --shadow-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Container ── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Logo ── */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  user-select: none;
  text-decoration: none;
}

.logo-text {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

.logo-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 2px;
  margin-bottom: 4px;
  flex-shrink: 0;
  background: var(--blue);
}

.c-green {
  color: var(--green);
}

.c-blue {
  color: var(--blue);
}

/* ── Nav ── */
nav {
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--bg-card);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(250, 250, 250, .1);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--ink);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 120px 0 80px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, .06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 300;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  line-height: 1.1;
  color: var(--ink);
}

.hero h1 strong {
  font-weight: 500;
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Section ── */
section {
  padding: 80px 0;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 12px;
  text-align: center;
}

.section-title {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-align: center;
  margin-bottom: 56px;
}

/* ── Card Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.card:hover {
  border-color: var(--blue);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 50px -12px rgba(96, 165, 250, 0.25);
}

.progress-container {
  width: 100%;
  height: 8px;
  background: var(--bg-raised);
  border-radius: 4px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 4px;
  transition: width 1s ease-in-out;
  box-shadow: 0 0 10px var(--blue-glow);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 18px;
}

.card-icon.green {
  background: var(--green-dim);
  color: var(--green);
}

.card-icon.blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.card-icon.amber {
  background: var(--amber-dim);
  color: var(--amber);
}

.card-icon.red {
  background: var(--red-dim);
  color: var(--red);
}

.card h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--ink);
}

.card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ── Code Blocks ── */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 20px 24px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.65;
  color: var(--ink-soft);
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Protocol Flow ── */
.flow-section {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 56px;
}

.flow-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}

.flow-step:hover {
  border-color: var(--blue);
  box-shadow: var(--glow-blue);
}

.flow-step .step-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.flow-step h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.flow-step p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: #3f3f46;
}

.stat-value {
  font-size: 36px;
  font-weight: 300;
  color: var(--blue);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 500;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  background: var(--bg-raised);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* ── Badges ── */
.badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  display: inline-block;
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
}

.badge-blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
}

.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
}

/* ── Docs Layout ── */
.docs-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  padding-top: 48px;
}

.sidebar {
  position: sticky;
  top: 32px;
  height: fit-content;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 4px;
}

.sidebar a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--ink);
  background: var(--bg-card);
  border-left-color: var(--blue);
}

.content h1 {
  font-size: 42px;
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 16px;
}

.content h2 {
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 56px;
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.content h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}

.content p {
  margin-bottom: 16px;
}

.content ul,
.content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.content li {
  margin-bottom: 8px;
  color: var(--ink-soft);
}

.content li strong {
  color: var(--ink);
}

/* ── Endpoint Card ── */
.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.endpoint-method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-right: 10px;
}

.method-post {
  background: var(--green-dim);
  color: var(--green);
}

.method-get {
  background: var(--blue-dim);
  color: var(--blue);
}

.method-del {
  background: var(--red-dim);
  color: var(--red);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
}

.endpoint p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 14px;
}

/* ── Live Dot ── */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 8px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .4);
  }

  50% {
    opacity: .7;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

/* ── Auth Styles ── */
.auth-page {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  overflow: hidden;
}

.auth-left {
  flex: 1;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent),
    radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.08), transparent);
  padding: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
}

.auth-left .logo {
  margin-bottom: 48px;
}

.auth-left h2 {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 24px;
}

.auth-left p {
  font-size: 18px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.6;
}

.auth-features {
  margin-top: 64px;
  display: grid;
  gap: 32px;
}

.auth-feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.auth-feature i {
  color: var(--blue);
  font-size: 20px;
  margin-top: 4px;
}

.auth-feature h4 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.auth-feature p {
  font-size: 14px;
  color: var(--muted);
}

.auth-right {
  width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-raised);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.auth-form input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: all 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--bg-code);
  box-shadow: 0 0 0 4px var(--blue-dim);
}

.auth-form .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 14px;
  margin-top: 8px;
  font-size: 14px;
}

.auth-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.error-banner {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 24px;
  text-align: center;
}




/* ── Footer ── */
footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ── Animations ── */
.fade-up {
  animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up:nth-child(1) {
  animation-delay: 0s;
}

.fade-up:nth-child(2) {
  animation-delay: 0.08s;
}

.fade-up:nth-child(3) {
  animation-delay: 0.16s;
}

.fade-up:nth-child(4) {
  animation-delay: 0.24s;
}

.fade-up:nth-child(5) {
  animation-delay: 0.32s;
}

/* ── Algorithm Highlight ── */
.algo-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 16px 0;
}

.algo-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.algo-formula {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--green);
  padding: 12px 0;
}

.algo-box p {
  font-size: 13px;
  color: var(--muted);
}

/* ── Stats Bar (Landing Page Counter) ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 0;
  margin-bottom: 40px;
  backdrop-filter: var(--glass);
}

.stat-item {
  text-align: center;
  padding: 0 24px;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.stat-item .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ── Reliability Dashboard ── */
.reliability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s;
}

.model-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.model-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.model-card-header h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.model-card-header .model-provider {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.model-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 12px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.metric-value {
  font-size: 22px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.model-tag.strength {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.model-tag.weakness {
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ── Enterprise Page ── */
.enterprise-hero {
  text-align: center;
  padding: 100px 0 60px;
}

.enterprise-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.1;
}

.enterprise-hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

.compliance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.compliance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s;
}

.compliance-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.compliance-card h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 12px;
}

.compliance-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.compliance-icon {
  font-size: 28px;
  margin-bottom: 16px;
}

.roi-calculator {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  margin: 48px 0;
}

.roi-calculator h3 {
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 16px;
}

.roi-calculator p {
  color: var(--muted);
  margin-bottom: 24px;
}

.roi-result {
  font-size: 48px;
  font-weight: 300;
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 24px 0;
}

.domain-pack {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s;
}

.domain-pack:hover {
  border-color: var(--green);
}

.domain-pack h4 {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 8px;
}

.domain-pack p {
  font-size: 13px;
  color: var(--muted);
}

.domain-pack .risk-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-right: 6px;
  margin-top: 8px;
}

.risk-badge.critical {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
}

.risk-badge.high {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.risk-badge.medium {
  background: rgba(96, 165, 250, 0.15);
  color: var(--blue);
}

.risk-badge.low {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
}

/* (stats-bar mobile handled in main responsive section below) */

/* ── WebSocket Feed ── */
.ws-feed {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
}

.ws-feed .event {
  padding: 4px 0;
  border-bottom: 1px solid rgba(39, 39, 42, .5);
}

.ws-feed .event:last-child {
  border-bottom: none;
}

.ws-feed .timestamp {
  color: var(--muted);
  margin-right: 12px;
}

/* ── Dashboard Components ── */
.session-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 10px 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}
.session-banner.warning {
  background: rgba(251, 191, 36, 0.12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
.session-banner.danger {
  background: rgba(248, 113, 113, 0.12);
  border-bottom: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  margin-left: 6px;
}
.verified-badge.verified {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.verified-badge.unverified {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}
.quick-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
}
.quick-action:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(96, 165, 250, 0.1);
}
.quick-action .qa-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.quick-action .qa-icon.green { background: rgba(74,222,128,0.1); color: #4ade80; }
.quick-action .qa-icon.blue { background: rgba(96,165,250,0.1); color: #60a5fa; }
.quick-action .qa-icon.amber { background: rgba(251,191,36,0.1); color: #fbbf24; }
.quick-action h4 { color: var(--ink); font-size: 14px; font-weight: 500; }
.quick-action p { color: var(--muted); font-size: 12px; margin-top: 2px; }

.member-since {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px; font-weight: 500;
  z-index: 1000;
  animation: fadeUp 0.3s ease, fadeUp 0.3s ease 2s reverse forwards;
}

/* ── Mobile Navigation Toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 1001;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Table Scroll Wrapper ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================================================================
   RESPONSIVE — Full Mobile Support
   ================================================================ */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .auth-left {
    display: none;
  }
  .auth-right {
    width: 100%;
  }
  .nav-links {
    flex-wrap: wrap;
    gap: 4px;
  }
  .nav-links a {
    font-size: 13px;
    padding: 6px 10px;
  }
  .flow-section {
    grid-template-columns: repeat(3, 1fr);
  }
  .roi-calculator {
    padding: 32px 24px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  /* Navigation → hamburger */
  nav {
    flex-wrap: wrap;
    padding: 16px 0;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    order: 3;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: left;
  }
  .nav-links .btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  /* Hero */
  .hero {
    padding: 60px 0 40px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 15px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Card Grids → single column */
  .grid {
    grid-template-columns: 1fr !important;
  }

  /* Protocol Flow → single column */
  .flow-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Stats bar (landing) → 2 columns */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px 0;
  }
  .stat-number {
    font-size: 28px;
    display: block;
  }
  .stat-item {
    border-right: none;
    text-align: center;
  }

  /* Dashboard / Analytics stats grid → single column */
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .stat-card {
    padding: 22px;
  }
  .usage-card {
    grid-column: span 1 !important;
  }

  /* Dashboard header → stack */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .dashboard-header > div[style*="text-align: right"] {
    text-align: left !important;
  }

  /* Quick actions → single column */
  .quick-actions {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Key section */
  .key-section {
    padding: 24px;
    border-radius: 16px;
  }
  .key-section > div:first-child {
    flex-direction: column !important;
    gap: 12px;
  }
  .api-key-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .key-text {
    font-size: 12px;
    word-break: break-all;
  }

  /* Tables → horizontal scroll */
  .recent-table-container,
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px;
  }
  th, td {
    padding: 12px 14px;
    font-size: 12px;
  }

  /* Docs layout → single column */
  .docs-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sidebar {
    position: static;
  }
  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .sidebar a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 6px 12px;
  }
  .sidebar a.active {
    border-left-color: transparent;
    border-bottom-color: var(--blue);
  }
  .content h1 {
    font-size: 28px;
  }
  .content h2 {
    font-size: 20px;
    margin-top: 36px;
  }

  /* Endpoint cards */
  .endpoint {
    padding: 16px;
  }
  pre {
    font-size: 11px;
    padding: 14px;
    overflow-x: auto;
  }

  /* Enterprise */
  .enterprise-hero {
    padding: 60px 0 40px;
  }
  .enterprise-hero h1 {
    font-size: 32px;
  }
  .compliance-cards {
    grid-template-columns: 1fr;
  }
  .roi-result {
    font-size: 36px;
  }
  .roi-calculator {
    padding: 28px 20px;
  }

  /* Reliability */
  .reliability-grid {
    grid-template-columns: 1fr;
  }

  /* Footer → stack */
  footer {
    flex-direction: column;
    text-align: center;
    padding: 32px 0;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  /* Algo boxes */
  .algo-box {
    padding: 20px;
  }
  .algo-formula {
    font-size: 13px;
    word-break: break-word;
  }

  /* Session banner */
  .session-banner {
    font-size: 12px;
    padding: 8px 16px;
  }

  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  /* Cards */
  .card {
    padding: 24px;
    border-radius: 14px;
  }

  /* Section spacing */
  section {
    padding: 48px 0;
  }
  .section-title {
    font-size: 28px;
    margin-bottom: 36px;
  }

  /* Demo pages */
  .demo-wrap {
    margin: 20px auto 40px;
  }
  .demo-wrap h1 {
    font-size: 28px !important;
  }
  .demo-card .row {
    flex-direction: column;
  }
  .demo-card .row > div {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
  .demo-card .row .btn {
    width: 100%;
    justify-content: center;
  }
  .meta-grid {
    grid-template-columns: 1fr !important;
  }

  /* Domain filter buttons */
  .domain-btn {
    padding: 4px 10px !important;
    font-size: 11px !important;
  }
}

/* ── Small Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .hero h1 {
    font-size: 26px;
  }
  .hero p {
    font-size: 14px;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }
  .stat-number {
    font-size: 24px;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: 16px;
  }
  .auth-card h1 {
    font-size: 22px;
  }
  .auth-right {
    padding: 20px;
  }

  .otp-inputs input {
    width: 42px;
    height: 50px;
    font-size: 20px;
    border-radius: 10px;
  }
  .otp-inputs {
    gap: 6px;
  }

  .user-info h2 {
    font-size: 24px;
  }
  .tier-badge {
    font-size: 10px;
    padding: 4px 10px;
  }

  table {
    min-width: 500px;
  }

  pre {
    font-size: 10px;
    padding: 12px;
    border-radius: 10px;
  }

  .card {
    padding: 20px;
  }
  .card h3 {
    font-size: 16px;
  }

  .section-title {
    font-size: 24px;
  }
  .section-label {
    font-size: 10px;
  }

  .verified-badge {
    font-size: 10px;
    padding: 2px 8px;
  }

  .footer-links {
    gap: 8px;
  }
  .footer-links a {
    font-size: 12px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .demo-wrap h1 {
    font-size: 24px !important;
  }

  .model-metrics {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 20px;
  }
  .stat-card .stat-value {
    font-size: 28px;
  }
}