:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 12px;
}
.brand-link {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none !important;
}
.logo-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 440px) {
  .brand-link { font-size: 16px; }
  .nav-links { gap: 10px; font-size: 13px; }
}
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 36px 0 22px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0 auto 10px;
  max-width: 720px;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.hero .lead {
  max-width: 620px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 16px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.hero-badges span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
}

/* Cards & Buttons */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-bottom: 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-green { background: var(--green); color: #fff; }
.btn-danger { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Auth / Account Strip */
.account-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.auth-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}
.input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}
.input:focus, select:focus, textarea:focus {
  outline: 2px solid #93c5fd;
  border-color: var(--primary);
}
.auth-form .input { flex: 1; min-width: 200px; }

.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 6px 12px;
}

/* Workspace Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 680px) {
  .form-grid { grid-template-columns: 1fr; }
}
label.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.choice-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.choice-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sample-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.char-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.alert-box {
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  margin-top: 10px;
  display: none;
}
.alert-box.error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.alert-box.info {
  display: block;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* Replies Grid */
.replies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}
@media (max-width: 860px) {
  .replies-grid { grid-template-columns: 1fr; }
}
.reply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reply-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.reply-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: #eff6ff;
  border-radius: 999px;
  padding: 3px 10px;
}
.reply-words {
  font-size: 11.5px;
  color: var(--muted);
}
.reply-card textarea {
  min-height: 195px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

/* Paywall & Docs */
.paywall-banner {
  display: none;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 14px;
}
.paywall-banner.show { display: block; }
.paywall-banner h3 { margin: 0 0 6px; font-size: 18px; }
.paywall-banner p { margin: 0 0 12px; color: #dbeafe; font-size: 14px; }

.doc-page { padding: 28px 16px 40px; max-width: 820px; }
.doc-page h1 { font-size: clamp(24px, 4vw, 32px); margin-top: 0; }
.doc-page h2 { font-size: 19px; margin-top: 24px; }
.sample-quote {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  margin: 12px 0 18px;
  border-radius: 0 10px 10px 0;
  color: #1e293b;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 22px 0;
}
@media (max-width: 680px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.price-card.featured {
  border: 2px solid var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.price-card .tier { font-weight: 800; font-size: 15px; color: var(--primary); }
.price-card .price { font-size: 36px; font-weight: 900; margin: 6px 0; }
.price-card .price span { font-size: 15px; font-weight: 600; color: var(--muted); }
.price-card .sub { font-size: 13px; color: var(--muted); margin-top: 0; }
.price-card ul { padding-left: 18px; font-size: 14px; margin: 14px 0 18px; }
.price-card li { margin-bottom: 6px; }
.fine-print { font-size: 12.5px; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
  margin-top: 32px;
  font-size: 13px;
  color: var(--muted);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #0f172a;
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 99;
}
