:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --text: #e8e8ed;
  --text-muted: #8b8b9a;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --success: #22c55e;
  --border: #2a2a35;
  --radius: 12px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo-plus {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* Nav auth controls */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.nav-user-name {
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.nav-logout:hover {
  color: var(--text);
}

.nav-admin-link {
  color: #eab308;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 6px;
}

.nav-admin-link:hover {
  background: rgba(234,179,8,0.1);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99, 102, 241, 0.15), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 800px;
}

.hero-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-logos span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.model-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.model-badges span {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.95rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Sections */
.section {
  padding: 100px 0;
}

.section h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.section-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Problem */
.problem {
  background: var(--bg-elevated);
}

.problem-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.problem-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 320px;
  text-align: center;
}

.problem-card-bad {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.05);
}

.problem-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.problem-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.problem-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.problem-arrow {
  font-size: 2rem;
  color: var(--text-muted);
}

.problem-stats {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Demo / Video */
.video-wrapper {
  max-width: 800px;
  margin: 0 auto 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.video-placeholder {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-placeholder iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg);
  padding: 24px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.video-overlay.visible {
  display: flex;
}

.video-instruction {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.video-script {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
}

.video-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.demo-cta {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.demo-cta p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.demo-cta .btn {
  display: inline-block;
}

/* Try It Demo */
.tryit {
  background: var(--bg-elevated);
}

.demo-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.demo-panels-two {
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
}

.demo-panels-two .demo-panel {
  min-height: 420px;
}

.demo-panels-two .demo-panel-messages {
  min-height: 260px;
  max-height: 360px;
}

@media (max-width: 900px) {
  .demo-panels,
  .demo-panels-two {
    grid-template-columns: 1fr;
  }
}

.demo-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.demo-panel-header {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  color: white;
}

.demo-panel-header.claude { background: #8b5cf6; }
.demo-panel-header.gemini { background: #4285f4; }
.demo-panel-header.openai { background: #10b981; }

.demo-panel-messages {
  flex: 1;
  min-height: 180px;
  max-height: 280px;
  overflow-y: auto;
  padding: 16px;
}

.demo-panel-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.demo-panel-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
}

.demo-panel-input input::placeholder {
  color: var(--text-muted);
}

.demo-msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  max-width: 95%;
  font-size: 0.9rem;
}

.demo-msg-user {
  background: var(--accent);
  color: white;
  margin-left: auto;
}

.demo-msg-ai {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.demo-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 16px;
}

.demo-pitch {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border-left: 4px solid var(--success);
}

.demo-msg.demo-msg-preserved {
  border-left: 4px solid var(--success);
}

.demo-msg.demo-msg-loading {
  opacity: 0.7;
  animation: demo-loading-pulse 1.2s ease-in-out infinite;
}

@keyframes demo-loading-pulse {
  50% { opacity: 0.4; }
}

/* Solution */
.solution-diagram {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 600px;
  margin: 0 auto 24px;
  text-align: center;
}

.diagram-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.diagram-box {
  padding: 12px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace;
}

.diagram-arrow {
  color: var(--accent);
  font-size: 1.5rem;
  margin: 8px 0;
}

.diagram-core {
  background: var(--accent);
  color: white;
  padding: 20px 32px;
  border-radius: var(--radius);
  font-size: 1.1rem;
}

.diagram-core span {
  font-size: 0.9rem;
  opacity: 0.9;
}

.diagram-storage {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.solution-features {
  list-style: none;
  max-width: 500px;
  margin: 0 auto;
}

.solution-features li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.solution-features li:last-child {
  border-bottom: none;
}

/* Enterprise */
.enterprise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.enterprise-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.enterprise-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.enterprise-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Pricing */
.pricing {
  background: var(--bg-elevated);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 1024px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.pricing-card .badge {
  position: absolute;
  top: -10px;
  right: 0;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.price {
  margin: 16px 0;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 700;
}

.price-period {
  font-size: 1rem;
  color: var(--text-muted);
}

.price-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.pricing-card ul {
  list-style: none;
  flex: 1;
  margin-bottom: 24px;
}

.pricing-card li {
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-left: 20px;
  position: relative;
}

.pricing-card li::before {
  content: "\2713";
  position: absolute;
  left: -20px;
  color: var(--success);
}

.pricing-card .btn {
  margin-top: auto;
  text-align: center;
}

/* Tier accent colors */
.pricing-card.pricing-silver  { border-top: 3px solid #c0c0c0 !important; }
.pricing-card.pricing-gold    { border-top: 3px solid #ffd700 !important; }
.pricing-card.pricing-platinum { border-top: 3px solid #e5e4e2 !important; }
.pricing-card.pricing-enterprise { border-top: 3px solid var(--accent) !important; }

.pricing-silver h3  { color: #c0c0c0; }
.pricing-gold h3    { color: #ffd700; }
.pricing-platinum h3 { color: #e5e4e2; }
.pricing-enterprise h3 { color: var(--accent); }

/* Highlight active tier */
.pricing-card.pricing-highlight {
  border-color: var(--accent) !important;
  box-shadow: 0 0 24px rgba(124,110,240,0.15) !important;
  transform: translateY(-4px) !important;
  transition: all 0.3s ease;
}

/* Token calculator slider */
.token-calc {
  text-align: center;
  margin: 0 auto 40px;
  max-width: 520px;
}
.token-calc-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.token-calc input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}
.token-marks {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 8px;
}

/* Architecture section */
.architecture { background: var(--bg); }

.arch-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: 48px 0;
}
@media (max-width: 768px) {
  .arch-diagram { flex-direction: column; }
  .arch-connector { transform: rotate(90deg); }
}

.arch-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  flex: 1;
  max-width: 360px;
}
.arch-node ul {
  list-style: none;
  margin-top: 16px;
}
.arch-node li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  margin-left: 20px;
}
.arch-node li::before {
  content: "\2713";
  position: absolute;
  left: -20px;
  color: var(--success);
}
.arch-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.arch-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}
.arch-server { border-top: 3px solid var(--accent); }
.arch-client { border-top: 3px solid var(--success); }

.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.arch-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  animation: arch-pulse 2s ease-in-out infinite;
}
@keyframes arch-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.arch-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Install steps */
.install-steps {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 48px 0 0;
}
@media (max-width: 600px) { .install-steps { flex-direction: column; align-items: center; } }

.install-step {
  text-align: center;
  flex: 1;
  max-width: 220px;
}
.install-step h4 { margin: 8px 0 4px; }
.install-step p { color: var(--text-muted); font-size: 0.9rem; }

.step-num {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

/* CTA */
.cta {
  text-align: center;
}

.cta h2 {
  margin-bottom: 12px;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* Footer */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-legal {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================================
   Integration Dashboard
   ============================================================================ */

.int-hero {
  padding: 120px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}

.int-hero h1 {
  font-size: 2.8rem;
  margin-bottom: 16px;
}

.int-hero-sub {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

.int-form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 700px;
  margin: 24px auto 0;
}

.int-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.int-form-group {
  flex: 1;
  margin-bottom: 16px;
}

.int-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.int-form-group input,
.int-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.int-form-group input::placeholder,
.int-form-group textarea::placeholder {
  color: var(--text-muted);
}

.int-result {
  background: #1a1a2e;
  border: 2px solid #22c55e;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 700px;
  margin: 24px auto 0;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

.int-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.int-result-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.int-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
}

.int-badge-success {
  background: var(--success);
}

.int-key-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.int-key-box label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.int-warning {
  color: #f59e0b;
  font-weight: 400;
}

.int-copy-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.int-key-display {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent-light);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-success {
  border-color: var(--success) !important;
  color: var(--success) !important;
}

.int-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.int-hint code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Snippets */
.int-snippets {
  margin-top: 24px;
}

.int-snippets h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.int-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.int-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.int-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.int-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}

.int-code code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

/* Checkboxes */
.int-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.int-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.int-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Memory Cycle */
.int-phases {
  max-width: 700px;
  margin: 24px auto 0;
}

.int-phase {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.int-phase h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--accent-light);
}

.int-augment-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
  font-size: 0.9rem;
}

.int-response {
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.int-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.int-verdict {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 20px;
  margin: 16px auto;
  max-width: 700px;
  border-radius: var(--radius-lg);
}

.int-verdict-pass {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 2px solid var(--success);
}

.int-verdict-fail {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 2px solid #ef4444;
}

.int-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  animation: demo-loading-pulse 1.2s ease-in-out infinite;
}

.int-error {
  color: #ef4444;
  padding: 20px;
  text-align: center;
}

/* Connector Gallery */
.int-connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.int-connector-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}

.int-connector-card:hover {
  border-color: var(--accent);
}

.int-connector-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.int-connector-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.int-connector-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.int-connector-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.78rem;
  overflow-x: auto;
}

.int-connector-code code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

.section-alt {
  background: var(--bg-elevated);
}

@media (max-width: 768px) {
  .int-form-row {
    flex-direction: column;
  }

  .int-hero h1 {
    font-size: 2rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 100px 24px 60px;
  }

  .section {
    padding: 60px 0;
  }

  .problem-grid {
    flex-direction: column;
  }

  .problem-arrow {
    transform: rotate(90deg);
  }
}


/* =========================================================================
   Chat UI — Claude-like full-viewport chat
   ========================================================================= */

.chat-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
}

.chat-layout {
  display: flex;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* --- Sidebar --- */
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-elevated);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.chat-new-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-new-btn:hover {
  background: var(--accent-hover);
}

.chat-session-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  transition: background 0.15s;
}

.chat-session-item:hover {
  background: rgba(255,255,255,0.04);
}

.chat-session-item.active {
  background: rgba(124, 92, 252, 0.1);
  border-left-color: var(--accent);
}

.chat-session-name {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-session-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0 4px;
}

.chat-session-item:hover .chat-session-del {
  opacity: 1;
}

.chat-session-del:hover {
  color: #ef4444;
}

.chat-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
}

.chat-sidebar-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.chat-sidebar-footer a:hover {
  color: var(--accent);
}

/* --- Main Chat Area --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

.chat-header-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-header-badge {
  font-size: 0.7rem;
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: auto;
}

.chat-ns-badge {
  font-size: 0.68rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  cursor: default;
}

/* --- Messages --- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-welcome {
  text-align: center;
  margin: auto;
  max-width: 500px;
  padding: 40px 20px;
}

.chat-welcome h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chat-welcome p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.chat-welcome-sub {
  font-size: 0.85rem !important;
  margin-top: 12px;
}

.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-assistant {
  justify-content: flex-start;
}

.chat-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-msg-user .chat-msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-assistant .chat-msg-bubble {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}

.chat-memory-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  margin-bottom: 8px;
  opacity: 0.8;
}

/* --- Typing indicator --- */
.chat-typing {
  display: flex;
  gap: 5px;
  padding: 14px 20px;
}

.chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chat-bounce 1.4s infinite ease-in-out both;
}

.chat-dot:nth-child(1) { animation-delay: 0s; }
.chat-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --- Input area --- */
.chat-input-area {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.chat-input-wrap {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.chat-input-wrap:focus-within {
  border-color: var(--accent);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
  padding: 4px 0;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: var(--accent-hover);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Debug Panel (right side) --- */
.debug-panel {
  width: 380px;
  min-width: 380px;
  background: #0d0d15;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.debug-upper,
.debug-lower {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.debug-divider {
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.debug-section-title {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  background: #101020;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.debug-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  font-size: 0.78rem;
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
}

.debug-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.debug-label {
  color: var(--accent-light);
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 3px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.debug-label:first-child { margin-top: 0; }

.debug-value {
  color: var(--text);
  padding: 4px 8px;
  background: #15152a;
  border-radius: 6px;
  margin-bottom: 4px;
  word-break: break-word;
}

.debug-model {
  color: var(--success);
  font-weight: 700;
  font-size: 0.9rem;
}

.debug-empty {
  color: var(--text-muted);
  font-style: italic;
}

.debug-list .debug-item {
  padding: 3px 0;
  border-bottom: 1px solid #1a1a2e;
  color: #c8c8d8;
}
.debug-list .debug-item:last-child { border-bottom: none; }

.debug-prompt {
  background: #101025;
  color: #a0a0c0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #1e1e35;
}

.debug-response {
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.05);
}

.debug-mem-item {
  padding: 4px 0;
  border-bottom: 1px solid #1a1a2e;
  word-break: break-word;
}
.debug-mem-item:last-child { border-bottom: none; }

.debug-mem-num {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.debug-src-user {
  color: var(--accent-light);
  font-weight: 600;
  font-size: 0.7rem;
}

.debug-src-assistant {
  color: var(--success);
  font-weight: 600;
  font-size: 0.7rem;
}

.debug-mem-text {
  color: #c8c8d8;
}

/* Phase dynamics debug styles */
.debug-phase-global {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #2a2a3e;
}
.debug-phase-param {
  font-size: 0.7rem;
  color: #8888aa;
  background: #1a1a2e;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.debug-phase-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.debug-phase-liquid {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.debug-phase-gas {
  color: #f44336;
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
}
.debug-phase-meta {
  font-size: 0.65rem;
  color: #6666aa;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  margin-top: 2px;
}
.debug-phase-fact {
  font-size: 0.65rem;
  color: #888;
  font-style: italic;
  margin-top: 2px;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .chat-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: left 0.25s ease;
  }

  .chat-sidebar.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  .chat-menu-btn {
    display: block;
  }

  .chat-msg-bubble {
    max-width: 90%;
  }

  .debug-panel {
    display: none;
  }
}
