/* Self-hosted DM Sans (no external CDN dependency) */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Variables ─────────────────────────────────────────────────────────────── */

:root {
  --bg:           #FFFFFF;
  --bg-soft:      #FAFBFC;
  --bg-navy:      #0F1C2E;
  --text:         #0F1C2E;
  --text-muted:   #6B7280;
  --text-on-navy: #FFFFFF;
  --text-on-navy-muted: #94A3B8;
  --accent:       #0D9488;
  --accent-hover: #0B807A;
  --accent-soft:  #F0FDFA;
  --border:       #E5E7EB;
  --border-strong:#D1D5DB;
  --user-bubble:  #EEF2F7;
  --warning:      #B45309;
  --warning-soft: #FEF3C7;
  --error:        #B91C1C;
  --error-soft:   #FEE2E2;
  --radius:       8px;
  --radius-card:  12px;
  --shadow-card:  0 1px 3px rgba(0, 0, 0, 0.06);
  --t:            150ms ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; font-weight: 400; }
input, textarea, select { font-family: inherit; font-weight: 400; }
ul, ol { list-style: none; }
hr { border: none; border-top: 0.5px solid var(--border); }

/* ── Typography ────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5 { font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 3rem; line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-muted); }
small { font-size: 0.8125rem; color: var(--text-muted); }
code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85em; }

/* ── Layout ────────────────────────────────────────────────────────────────── */

.container    { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 480px;  margin: 0 auto; padding: 0 24px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }

.btn-danger { background: #fff; color: var(--error); border-color: var(--border); }
.btn-danger:hover { background: var(--error-soft); border-color: var(--error); }

.btn-outline-accent { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline-accent:hover { background: var(--accent-soft); }

.btn-sm  { padding: 7px 14px; font-size: 0.875rem; }
.btn-lg  { padding: 13px 26px; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.form-input, .form-textarea, .form-select {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  padding: 10px 14px;
  transition: border-color var(--t);
  width: 100%;
  font-weight: 400;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.form-select { appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-help  { font-size: 0.8125rem; color: var(--text-muted); }
.form-error { font-size: 0.875rem; color: var(--error); display: none; }
.form-error.visible { display: block; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.card-title    { font-size: 0.9375rem; font-weight: 500; color: var(--text); }
.card-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }

/* ── Top nav (landing only) ────────────────────────────────────────────────── */

.topnav {
  border-bottom: 0.5px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand-mark {
  height: 36px;
  width: 36px;
  display: block;
  flex-shrink: 0;
}
.brand-mark-sm { height: 28px; width: 28px; }
.topnav-links { display: flex; gap: 28px; }
.topnav-link {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 400;
  transition: color var(--t);
}
.topnav-link:hover { color: var(--text); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */

.hero { padding: 112px 0 96px; text-align: center; }
.hero h1 { max-width: 800px; margin: 0 auto 24px; }
.hero-sub {
  font-size: 1.125rem;
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  line-height: 1.6;
}
.hero-cta { margin-bottom: 28px; }
.trust-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}
.trust-row .dot { color: var(--border-strong); }
.trust-item { display: inline-flex; align-items: center; gap: 6px; }
.trust-item svg { color: var(--accent); }

/* ── Section ───────────────────────────────────────────────────────────────── */

.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-soft  { background: var(--bg-soft); border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.section-navy  { background: var(--bg-navy); color: var(--text-on-navy); }
.section-navy h2, .section-navy h3, .section-navy h4 { color: var(--text-on-navy); }
.section-navy p { color: var(--text-on-navy-muted); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 14px; }
.section-header p { font-size: 1rem; max-width: 560px; margin: 0 auto; }

/* ── Pull quote (social proof) ─────────────────────────────────────────────── */

.pullquote {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
  padding: 56px 24px;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}
.pullquote-text {
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 20px;
  font-weight: 400;
}
.pullquote-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.pullquote-meta strong { color: var(--text); font-weight: 500; }

/* ── How it works ──────────────────────────────────────────────────────────── */

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step h3 { margin-bottom: 8px; font-size: 1.0625rem; }
.step p  { font-size: 0.9375rem; }
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}

/* ── Problem section ───────────────────────────────────────────────────────── */

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.problem-text h2 { margin-bottom: 20px; max-width: 420px; }
.problem-text p  { font-size: 1rem; line-height: 1.7; }

.code-compare { display: flex; flex-direction: column; gap: 16px; }
.code-block {
  background: #0F1C2E;
  border: 0.5px solid #1E293B;
  border-radius: var(--radius);
  overflow: hidden;
}
.code-block-label {
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94A3B8;
  border-bottom: 0.5px solid #1E293B;
  background: #0A1422;
}
.code-block-label.exposed { color: #F87171; }
.code-block-label.protected { color: #5EEAD4; }
.code-block pre {
  padding: 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #E2E8F0;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

/* ── Features grid ─────────────────────────────────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card { padding: 28px; }
.feature-card h4 { margin-bottom: 8px; font-size: 0.9375rem; font-weight: 500; }
.feature-card p  { font-size: 0.875rem; line-height: 1.55; }

/* ── Compliance badges (navy section) ──────────────────────────────────────── */

.compliance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 16px;
}
.compliance-card {
  text-align: center;
  padding: 16px 8px;
}
.compliance-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 0.5px solid rgba(255,255,255,0.2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-on-navy);
  margin-bottom: 16px;
}
.compliance-card p { font-size: 0.9375rem; line-height: 1.55; }

/* ── Pricing ───────────────────────────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.pricing-card {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px 32px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card.featured { border: 1.5px solid var(--accent); }
.pricing-badge {
  position: absolute;
  top: -10px;
  right: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
}
.pricing-name { font-size: 0.9375rem; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.pricing-price { font-size: 2.25rem; font-weight: 500; color: var(--text); line-height: 1; margin-bottom: 4px; letter-spacing: -0.02em; }
.pricing-price small { font-size: 0.875rem; color: var(--text-muted); font-weight: 400; }
.pricing-tagline { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }
.pricing-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; flex: 1; }
.pricing-feature { display: flex; gap: 10px; font-size: 0.875rem; color: var(--text); }
.pricing-feature svg { color: var(--accent); flex-shrink: 0; margin-top: 4px; }

/* ── FAQ ───────────────────────────────────────────────────────────────────── */

.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; }
.faq-item { border-bottom: 0.5px solid var(--border); }
.faq-item:first-child { border-top: 0.5px solid var(--border); }
.faq-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 22px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
}
.faq-icon {
  width: 16px; height: 16px;
  position: relative;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--t);
}
.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.faq-icon::before { width: 12px; height: 1px; }
.faq-icon::after  { width: 1px; height: 12px; transition: transform var(--t); }
.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) scaleY(0); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t), padding var(--t);
}
.faq-item.open .faq-a {
  max-height: 400px;
  padding-bottom: 22px;
}
.faq-a p { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.65; max-width: 680px; }

/* ── Footer ────────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--bg-navy);
  color: var(--text-on-navy);
  padding: 64px 0 24px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-brand .brand { color: var(--text-on-navy); }
.footer-brand .brand-mark { /* image handles its own color */ }
.footer-tagline { color: var(--text-on-navy-muted); font-size: 0.875rem; max-width: 240px; }
.footer-col h5 {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-on-navy);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-on-navy-muted); font-size: 0.875rem; transition: color var(--t); font-weight: 400; }
.footer-col a:hover { color: var(--text-on-navy); }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-on-navy-muted);
}
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { color: var(--text-on-navy-muted); }

/* ── App shell (dashboard, chat, settings) ─────────────────────────────────── */

.app-shell {
  display: flex;
  height: 100vh;
  background: var(--bg);
}
.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-navy);
  color: var(--text-on-navy);
  border-right: 0.5px solid var(--bg-navy);
  display: flex;
  flex-direction: column;
}
.app-sidebar.dashboard-sidebar { width: 240px; }
.app-sidebar-brand {
  padding: 20px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}
.app-sidebar-brand .brand { color: var(--text-on-navy); }
.app-sidebar-nav {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-on-navy-muted);
  font-size: 0.9375rem;
  font-weight: 400;
  transition: background var(--t), color var(--t);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text-on-navy); }
.nav-item.active { background: rgba(13,148,136,0.15); color: var(--accent); font-weight: 500; }

.app-sidebar-section-label {
  padding: 16px 16px 8px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-on-navy-muted);
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  font-size: 0.8125rem;
  color: var(--text-on-navy-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-sidebar-footer .user-email {
  color: var(--text-on-navy);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sidebar-footer button {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-on-navy-muted);
  font-size: 0.8125rem;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--t);
}
.app-sidebar-footer button:hover { color: var(--text-on-navy); }

.app-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.app-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}
.app-page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 0.5px solid var(--border);
}
.app-page-title { font-size: 1.5rem; font-weight: 500; }
.app-page-sub   { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }

/* ── Dashboard metrics ─────────────────────────────────────────────────────── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.metric-card {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.metric-label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 8px; }
.metric-value { font-size: 1.75rem; font-weight: 500; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.metric-sub   { font-size: 0.8125rem; color: var(--text-muted); margin-top: 6px; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

/* ── Tables ────────────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--border);
}
.table td {
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 0.5px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.table-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 0.875rem; }
.table-zebra tbody tr:nth-child(odd) td { background: var(--bg-soft); }

/* ── Badges ────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 0.5px solid var(--border);
  color: var(--text);
  background: #fff;
}
.badge-success { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.badge-warning { color: var(--warning); border-color: #FCD34D; background: var(--warning-soft); }
.badge-error   { color: var(--error); border-color: #FCA5A5; background: var(--error-soft); }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */

.alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 0.5px solid var(--border);
  background: #fff;
  color: var(--text);
  margin-bottom: 24px;
}
.alert-warning { border-color: #FCD34D; background: var(--warning-soft); color: var(--warning); }
.alert-error   { border-color: #FCA5A5; background: var(--error-soft);   color: var(--error); }
.alert-icon { flex-shrink: 0; margin-top: 2px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 500; margin-bottom: 2px; }
.alert p { font-size: 0.875rem; margin: 0; color: inherit; opacity: 0.9; }

/* ── Auth page ─────────────────────────────────────────────────────────────── */

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 28px; border-bottom: 0.5px solid var(--border); }
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -0.5px;
  font-family: inherit;
  transition: color var(--t), border-color var(--t);
}
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-title { font-size: 1.125rem; font-weight: 500; margin-bottom: 6px; }
.auth-sub   { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }

.auth-step { display: none; }
.auth-step.active { display: block; }
.auth-stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.auth-stepper-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
}
.auth-stepper-dot.active { background: var(--accent); }
.auth-stepper-dot.done { background: var(--accent); }

.key-display {
  background: var(--bg-soft);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--text);
  max-height: 160px;
  overflow-y: auto;
  white-space: pre;
  word-break: break-all;
  margin-bottom: 14px;
}
.key-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.key-confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 0.875rem; cursor: pointer; color: var(--text); margin-bottom: 24px; }
.key-confirm input { margin-top: 4px; accent-color: var(--accent); }
.auth-back {
  background: none; border: none; padding: 0; color: var(--text-muted); cursor: pointer;
  font-size: 0.8125rem; font-family: inherit;
}
.auth-back:hover { color: var(--text); }

/* ── Chat page ─────────────────────────────────────────────────────────────── */

.chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}
.chat-header {
  height: 60px;
  border-bottom: 0.5px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.chat-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}
.chat-header-status svg { width: 12px; height: 12px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}
.chat-messages-inner {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  min-height: 300px;
}
.chat-empty p { font-size: 0.9375rem; max-width: 320px; }
.chat-empty-icon { color: var(--accent); }

.msg-row { display: flex; }
.msg-row.user      { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-card);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 400;
  width: fit-content;
  max-width: 100%;
}
.msg-row.user .msg-bubble {
  background: var(--bg-navy);
  color: var(--text-on-navy);
  border-bottom-right-radius: 4px;
}
.msg-row.assistant .msg-bubble {
  background: #fff;
  color: var(--text);
  border: 0.5px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.msg-row.user .msg-meta { text-align: right; }
.msg-col { display: flex; flex-direction: column; max-width: 75%; min-width: 0; }
.msg-row.user      .msg-col { align-items: flex-end; }
.msg-row.assistant .msg-col { align-items: flex-start; }

.typing-indicator {
  display: flex; align-items: center; gap: 5px;
  padding: 14px 18px;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.chat-input-area {
  border-top: 0.5px solid var(--border);
  padding: 16px 24px 20px;
  flex-shrink: 0;
  background: #fff;
}
.chat-input-inner {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  transition: border-color var(--t);
  width: 100%;
}
.chat-input-row:focus-within { border-color: var(--accent); }
.chat-input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9375rem;
  resize: none;
  max-height: 200px;
  min-height: 24px;
  line-height: 1.5;
  font-family: inherit;
  font-weight: 400;
  padding: 4px 0;
}
.chat-input:focus { outline: none; }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t);
}
.chat-send-btn:hover { background: var(--accent-hover); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-input-footer { font-size: 0.6875rem; color: var(--text-muted); text-align: center; margin-top: 10px; }

.chat-no-key {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 14px; color: var(--text-muted); text-align: center; padding: 40px;
}
.chat-no-key h3 { font-size: 1.125rem; color: var(--text); }

/* ── Conversation list (chat sidebar) ──────────────────────────────────────── */

.convo-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.convo-list-empty {
  text-align: center;
  color: var(--text-on-navy-muted);
  font-size: 0.8125rem;
  padding: 24px 12px;
}
.convo-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t);
  position: relative;
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.convo-item:hover { background: rgba(255,255,255,0.05); }
.convo-item.active {
  background: rgba(13,148,136,0.12);
  border-left-color: var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.convo-item.active .convo-item-title { color: var(--accent); font-weight: 500; }
.convo-item-title {
  font-size: 0.875rem;
  color: var(--text-on-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 18px;
  font-weight: 400;
}
.convo-item-meta {
  font-size: 0.75rem;
  color: var(--text-on-navy-muted);
}
.convo-item-delete {
  position: absolute;
  right: 8px;
  top: 12px;
  background: transparent;
  border: none;
  color: var(--text-on-navy-muted);
  opacity: 0;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: opacity var(--t), color var(--t);
  font-family: inherit;
  line-height: 1;
}
.convo-item:hover .convo-item-delete { opacity: 1; }
.convo-item-delete:hover { color: #FCA5A5; }

.new-chat-wrap { padding: 12px 12px 0; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */

#toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-card);
  max-width: 320px;
  transform: translateX(120%);
  transition: transform var(--t);
  color: var(--text);
}
.toast.show { transform: translateX(0); }
.toast-success { border-color: var(--accent); color: var(--accent); }
.toast-error   { border-color: #FCA5A5; color: var(--error); background: var(--error-soft); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,28,46,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-card);
  border: 0.5px solid var(--border);
}
.modal-title { font-size: 1.0625rem; font-weight: 500; margin-bottom: 8px; }
.modal-body  { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */

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

/* ── Utilities ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 0.875rem; }

/* ── Legal pages (privacy, terms) ──────────────────────────────────────────── */

.legal-page { padding: 64px 0 96px; }
.legal-content { max-width: 720px; margin: 0 auto; }
.legal-content h1 { font-size: 2.25rem; margin-bottom: 8px; line-height: 1.15; }
.legal-content .last-updated { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 48px; }
.legal-content h2 {
  font-size: 1.375rem;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 32px;
  border-top: 0.5px solid var(--border);
}
.legal-content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.legal-content h3 { font-size: 1.0625rem; margin-top: 28px; margin-bottom: 10px; }
.legal-content p { margin-bottom: 16px; line-height: 1.7; color: var(--text); }
.legal-content ul { margin: 12px 0 18px 24px; }
.legal-content li { margin-bottom: 10px; line-height: 1.65; color: var(--text); list-style: disc; }
.legal-content a { color: var(--accent); }
.legal-content code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
.legal-content strong { font-weight: 500; }
.legal-content .legal-callout {
  background: var(--bg-soft);
  border-left: 2px solid var(--accent);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.legal-content .legal-callout p:last-child { margin-bottom: 0; }
.legal-content .legal-warning {
  background: var(--warning-soft);
  border-left: 2px solid var(--warning);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--warning);
}
.legal-content .legal-warning p { color: var(--warning); }
.legal-content .legal-warning p:last-child { margin-bottom: 0; }

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  h1 { font-size: 2rem; }
  .hero { padding: 64px 0 56px; }
  .topnav-links { display: none; }
  .steps-grid, .features-grid, .compliance-grid, .pricing-grid { grid-template-columns: 1fr; }
  .features-grid { gap: 16px; }
  .problem-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }

  .app-sidebar {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    z-index: 60;
    transition: transform var(--t);
    box-shadow: var(--shadow-card);
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-content { padding: 24px 20px 60px; }
}
