/* =========================================================
   IntelDocs AI — Design System
   Palette: #222831 (ink) · #393E46 (slate) · #00ADB5 (signal) · #EEEEEE (paper)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #222831;
  --slate: #393E46;
  --signal: #00ADB5;
  --signal-dim: #00838a;
  --paper: #EEEEEE;
  --paper-100: #ffffff;
  --ink-70: rgba(34, 40, 49, 0.7);
  --ink-45: rgba(34, 40, 49, 0.45);
  --paper-70: rgba(238, 238, 238, 0.7);
  --paper-45: rgba(238, 238, 238, 0.45);
  --line: rgba(238, 238, 238, 0.12);
  --line-dark: rgba(34, 40, 49, 0.12);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;

  --shadow-1: 0 1px 2px rgba(34,40,49,0.06), 0 1px 1px rgba(34,40,49,0.04);
  --shadow-2: 0 8px 24px rgba(34,40,49,0.10);
  --shadow-3: 0 20px 48px rgba(34,40,49,0.18);

  --ease: cubic-bezier(.16,.8,.24,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

/* =========================== Buttons =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--signal);
  color: #08181a;
}
.btn-primary:hover { background: #12c2cb; box-shadow: 0 8px 20px rgba(0,173,181,0.35); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-dark);
}
.btn-ghost:hover { border-color: var(--signal); color: var(--signal-dim); }

.btn-ghost-invert {
  background: transparent;
  color: var(--paper);
  border-color: rgba(238,238,238,0.25);
}
.btn-ghost-invert:hover { border-color: var(--signal); color: var(--signal); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: transparent; color: #e2685f; border-color: rgba(226,104,95,0.35); }
.btn-danger:hover { background: rgba(226,104,95,0.1); }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* =========================== Nav =========================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(34,40,49,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--paper);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--signal), #007b81);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.brand-mark::before { width: 12px; height: 2px; top: 10px; left: 9px; border-radius: 2px; }
.brand-mark::after { width: 8px; height: 2px; top: 16px; left: 9px; border-radius: 2px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--paper-70);
  font-size: 14.5px;
  font-weight: 500;
  transition: color .15s var(--ease);
}
.nav-links a:hover { color: var(--paper); }

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

.nav-toggle {
  display: none;
  background: none; border: none; color: var(--paper);
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
}

.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 600;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(34,40,49,0.92);
  color: var(--paper);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-2);
}

/* =========================== Hero =========================== */

.hero {
  background: var(--ink);
  color: var(--paper);
  padding: 96px 0 120px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,173,181,0.22), transparent 70%);
  top: -220px; right: -160px;
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-copy .eyebrow { margin-bottom: 18px; display: inline-block; }
.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}
.hero-copy h1 .accent { color: var(--signal); }
.hero-copy p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--paper-70);
  max-width: 480px;
  margin: 0 0 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-meta {
  display: flex;
  gap: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-meta div strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--signal);
}
.hero-meta div span {
  font-size: 12.5px;
  color: var(--paper-45);
}

/* --- signature element: simulated chat panel --- */
.chat-mock {
  background: var(--slate);
  border: 1px solid rgba(238,238,238,0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: floatIn 0.9s var(--ease) both;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-mock-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(238,238,238,0.08);
}
.chat-mock-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(238,238,238,0.18); }
.chat-mock-title { font-family: var(--font-mono); font-size: 12px; color: var(--paper-45); margin-left: 4px; }
.chat-mock-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

.bubble {
  max-width: 86%;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
}
.bubble-user {
  align-self: flex-end;
  background: var(--signal);
  color: #08181a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.bubble-ai {
  align-self: flex-start;
  background: rgba(238,238,238,0.06);
  color: var(--paper);
  border: 1px solid rgba(238,238,238,0.08);
  border-bottom-left-radius: 4px;
}
.bubble-ai .cite {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal);
  background: rgba(0,173,181,0.12);
  padding: 3px 8px;
  border-radius: 5px;
}
.chat-mock-typing {
  display: flex; gap: 4px; align-self: flex-start;
  padding: 13px 16px;
  background: rgba(238,238,238,0.06);
  border: 1px solid rgba(238,238,238,0.08);
  border-radius: 12px; border-bottom-left-radius: 4px;
}
.chat-mock-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--paper-45);
  animation: blink 1.2s infinite ease-in-out;
}
.chat-mock-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-mock-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* =========================== Proof strip =========================== */

.proof {
  background: var(--paper);
  padding: 64px 0;
  border-bottom: 1px solid var(--line-dark);
}
.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.proof-images { display: block; }
.proof-images img {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 3 / 1;
  height: auto;
  object-fit: cover;
  box-shadow: var(--shadow-2);
}
.proof-text .eyebrow { color: var(--signal-dim); }
.proof-text h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  margin: 12px 0 16px;
  line-height: 1.2;
}
.proof-text p { color: var(--ink-70); line-height: 1.65; font-size: 15.5px; }

/* =========================== Sections =========================== */

.section { padding: 96px 0; }
.section-head { max-width: 640px; margin: 0 0 52px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  margin: 12px 0 14px;
  line-height: 1.15;
}
.section-head p { color: var(--ink-70); font-size: 16px; line-height: 1.6; }
.section-alt { background: var(--paper-100); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--paper-100);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: rgba(0,173,181,0.35); }
.feature-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(0,173,181,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--signal-dim);
  margin-bottom: 18px;
}
.feature-card h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 10px; }
.feature-card p { font-size: 14.5px; color: var(--ink-70); line-height: 1.6; margin: 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
.step {
  padding: 0 22px 0 0;
  position: relative;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-dim);
  border: 1px solid rgba(0,173,181,0.35);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  background: var(--paper-100);
  position: relative; z-index: 1;
}
.steps::before {
  content: "";
  position: absolute;
  top: 15px; left: 0; right: 0;
  height: 1px;
  background: var(--line-dark);
}
.step h4 { font-family: var(--font-display); font-size: 16.5px; margin: 0 0 8px; }
.step p { font-size: 14px; color: var(--ink-70); line-height: 1.55; margin: 0; }

.cta-band {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px circle at 85% 20%, rgba(0,173,181,0.25), transparent 60%);
}
.cta-band-text { position: relative; z-index: 1; }
.cta-band h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 8px; }
.cta-band p { color: var(--paper-70); margin: 0; font-size: 15px; }
.cta-band-actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-shrink: 0; }

/* =========================== Footer =========================== */

.footer {
  background: var(--ink);
  color: var(--paper-45);
  padding: 48px 0 28px;
}
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 32px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: 24px;
}
.footer .brand { margin-bottom: 10px; }
.footer-top p { max-width: 320px; font-size: 14px; line-height: 1.6; }
.footer-links { display: flex; gap: 56px; }
.footer-col h5 {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--paper-70); margin: 0 0 14px;
}
.footer-col a { display: block; font-size: 14px; margin-bottom: 10px; color: var(--paper-45); transition: color .15s; }
.footer-col a:hover { color: var(--signal); }
.footer-bottom { display: flex; justify-content: space-between; font-size: 13px; }

/* =========================== Modals / Auth =========================== */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(34,40,49,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--paper-100);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-3);
  position: relative;
  transform: translateY(14px) scale(0.98);
  transition: transform .22s var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute; top: 18px; right: 18px;
  background: none; border: none;
  color: var(--ink-45);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s;
}
.modal-close:hover { background: var(--paper); color: var(--ink); }

.modal h2 {
  font-family: var(--font-display);
  font-size: 22px; margin: 0 0 6px;
}
.modal .modal-sub { color: var(--ink-70); font-size: 14px; margin: 0 0 24px; }

.tab-switch {
  display: flex; background: var(--paper); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 22px;
}
.tab-switch button {
  flex: 1; border: none; background: none; padding: 9px 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink-70);
  border-radius: 5px; transition: all .15s var(--ease);
}
.tab-switch button.active { background: var(--paper-100); color: var(--ink); box-shadow: var(--shadow-1); }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 7px; color: var(--slate);
}
.field input, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  background: var(--paper-100);
  color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(0,173,181,0.15);
}
.field textarea { resize: vertical; min-height: 70px; }

.form-msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
}
.form-msg.error { display: block; background: rgba(226,104,95,0.1); color: #c8392f; }
.form-msg.success { display: block; background: rgba(0,173,181,0.1); color: var(--signal-dim); }

.form-foot { text-align: center; font-size: 13.5px; color: var(--ink-70); margin-top: 6px; }
.form-foot button { background: none; border: none; color: var(--signal-dim); font-weight: 600; padding: 0; }

/* =========================== App shell (dashboards) =========================== */

.app-shell { min-height: 100vh; display: flex; background: var(--paper); }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 8px 10px 26px; }
.sidebar-section-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--paper-45);
  padding: 14px 12px 8px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--paper-70); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  border: none; background: none; width: 100%; text-align: left;
}
.sidebar-link svg { flex-shrink: 0; opacity: 0.8; }
.sidebar-link:hover { background: rgba(238,238,238,0.06); color: var(--paper); }
.sidebar-link.active { background: rgba(0,173,181,0.14); color: var(--signal); }
.sidebar-link.active svg { opacity: 1; }

.mobile-topbar { display: none; }
.mobile-nav-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 12px;
  scrollbar-width: none;
}
.mobile-nav-strip::-webkit-scrollbar { display: none; }
.mobile-nav-link,
.mobile-logout-btn {
  border: 1px solid var(--line-dark);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.mobile-nav-link.active {
  background: rgba(0,173,181,0.12);
  border-color: rgba(0,173,181,0.35);
  color: var(--signal-dim);
}
.mobile-logout-btn {
  margin-left: auto;
  background: transparent;
  color: var(--ink);
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px; margin-top: 10px;
}
.sidebar-identity {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 14px;
}
.identity-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--slate); color: var(--signal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.identity-info { overflow: hidden; }
.identity-info strong { display: block; font-size: 13.5px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-info span { font-size: 11.5px; color: var(--paper-45); }

.main {
  flex: 1;
  min-width: 0;
  padding: 34px 40px 60px;
}
.main-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 30px; flex-wrap: wrap; gap: 14px;
}
.main-head h1 {
  font-family: var(--font-display); font-size: 26px; margin: 0 0 4px;
}
.main-head p { color: var(--ink-70); font-size: 14.5px; margin: 0; }

.view { display: none; }
.view.active { display: block; animation: viewIn .3s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 34px;
}
.stat-card {
  background: var(--paper-100);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.stat-card .stat-label {
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-45); margin-bottom: 10px;
}
.stat-card .stat-value {
  font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--ink);
}
.stat-card .stat-value.accent { color: var(--signal-dim); }

.panel {
  background: var(--paper-100);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.panel-head h3 { font-family: var(--font-display); font-size: 17px; margin: 0; }
.panel-head p.hint { font-size: 13px; color: var(--ink-45); margin: 2px 0 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-45); font-weight: 600; padding: 0 14px 10px; border-bottom: 1px solid var(--line-dark);
}
.data-table td {
  padding: 13px 14px; font-size: 14px; border-bottom: 1px solid var(--line-dark); color: var(--ink);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td.muted { color: var(--ink-45); font-size: 13px; }
.row-actions { display: flex; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: rgba(0,173,181,0.12); color: var(--signal-dim);
}
.badge-slate { background: rgba(57,62,70,0.1); color: var(--slate); }

.empty-state {
  text-align: center; padding: 48px 20px; color: var(--ink-45);
}
.empty-state svg { margin-bottom: 14px; opacity: 0.5; }
.empty-state p { font-size: 14px; margin: 0 0 4px; }
.empty-state span { font-size: 12.5px; }

.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1.5px dashed var(--line-dark);
  border-radius: var(--radius-md);
  padding: 34px 26px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-drop:hover, .upload-drop.dragover { border-color: var(--signal); background: rgba(0,173,181,0.04); }
.upload-drop svg { margin-bottom: 12px; color: var(--ink-45); }
.upload-drop p { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--ink); }
.upload-drop span { font-size: 12.5px; color: var(--ink-45); }
.upload-drop input[type=file] { display: none; }

/* --- Chat view --- */
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  height: calc(100vh - 210px);
  min-height: 480px;
}
.chat-sessions {
  background: var(--paper-100); border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
  padding: 16px; overflow-y: auto;
}
.chat-session-item {
  padding: 11px 12px; border-radius: var(--radius-sm); font-size: 13.5px;
  color: var(--ink-70); cursor: pointer; margin-bottom: 4px;
  border: none; background: none; width: 100%; text-align: left;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-session-item:hover { background: var(--paper); }
.chat-session-item.active { background: rgba(0,173,181,0.12); color: var(--signal-dim); font-weight: 600; }

.chat-window {
  background: var(--paper-100); border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-bubble {
  max-width: 72%; padding: 13px 16px; border-radius: 12px; font-size: 14.5px; line-height: 1.6;
}
.chat-bubble.user {
  align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
  align-self: flex-start; background: var(--paper); color: var(--ink); border: 1px solid var(--line-dark);
  border-bottom-left-radius: 4px; white-space: pre-wrap;
}
.chat-input-row {
  display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line-dark);
}
.chat-input-row input {
  flex: 1; border: 1px solid var(--line-dark); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14.5px; font-family: inherit;
}
.chat-input-row input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(0,173,181,0.15); }

.toast-stack {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s var(--ease);
  border-left: 3px solid var(--signal);
}
.toast.error { border-left-color: #e2685f; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: currentColor;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================== Responsive =========================== */

@media (max-width: 960px) {
  .mobile-topbar { display: block; }
  .hero-grid { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: 1fr; }
  .proof-images { order: -1; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .steps::before { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .sidebar {
    position: fixed;
    left: -82vw;
    width: min(82vw, 300px);
    z-index: 500;
    transition: left .25s var(--ease);
    box-shadow: var(--shadow-3);
  }
  .sidebar.open { left: 0; }
  .mobile-sidebar-toggle { display: flex; }
  .main { padding: 14px 20px 50px; }
  .main-head,
  .panel-head,
  .cta-band,
  .footer-top,
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .panel-head,
  .main-head {
    gap: 14px;
  }
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .nav-inner { position: relative; }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(34,40,49,0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-2);
    z-index: 30;
  }
  .nav-links.mobile-open { display: flex; }
  .nav-links a { font-size: 15px; }
  .nav-toggle { display: flex; }
  .feature-grid { grid-template-columns: 1fr; }
  .cta-band { text-align: left; }
  .cta-band-actions { width: 100%; }
  .cta-band-actions .btn { flex: 1; }
  .footer-top { flex-direction: column; }
  .footer-links { gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .stat-grid { grid-template-columns: 1fr; }
  .chat-input-row { flex-direction: column; }
  .chat-input-row .btn { width: 100%; }
  .chat-bubble { max-width: 92%; }
  .modal { max-width: calc(100vw - 24px); padding: 28px 18px 22px; }
  .form-foot { font-size: 12.5px; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero { padding-top: 88px; }
  .hero-copy h1 { font-size: 32px; }
  .hero-copy p { font-size: 15px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-meta { flex-direction: column; gap: 16px; }
  .section { padding: 72px 0; }
  .proof { padding: 48px 0; }
  .cta-band { padding: 34px 22px; }
  .panel { padding: 18px; }
  .main { padding: 20px 16px 42px; }
  .stat-card { padding: 18px; }
  .stat-card .stat-value { font-size: 24px; }
  .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
}
