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

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --primary: #4f6ef7;
  --primary-hover: #3a57d8;
  --primary-light: #eef1fe;
  --danger: #e53e3e;
  --danger-hover: #c53030;
  --text: #1a202c;
  --muted: #718096;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --input-bg: #fafafa;
}

/* ── Dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1f2e;
  --primary: #738cf9;
  --primary-hover: #5a7ae8;
  --primary-light: #1e2a4a;
  --danger: #fc6b6b;
  --danger-hover: #e85252;
  --text: #e2e8f0;
  --muted: #8899aa;
  --border: #2d3748;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --input-bg: #242936;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Shared brand mark ──────────────────────────────────────── */
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
}

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

/* ── Form elements ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

input.input-valid {
  border-color: #38a169;
  background: #fff;
}

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

.field-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.25rem;
  min-height: 1rem;
}

/* Input wrapper with leading icon */
.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.15s;
}

.input-icon-wrap input {
  padding-left: 2.25rem;
}

.input-icon-wrap input:focus ~ .input-icon,
.input-icon-wrap input:focus + .input-icon {
  color: var(--primary);
}

/* Password input wrapper for show/hide toggle */
.input-pw-wrap {
  position: relative;
}

.input-pw-wrap input {
  padding-right: 2.5rem;
}

/* Combined: icon on left + toggle on right */
.input-pw-wrap.has-icon input {
  padding-left: 2.25rem;
}

.input-pw-wrap.has-icon input:focus ~ button,
.input-pw-wrap.has-icon input:focus + button {
  /* keep toggle colour neutral on focus */
}

.input-icon-wrap input:focus + .input-icon,
.input-pw-wrap.has-icon input:focus ~ .input-icon {
  color: var(--primary);
}

.pw-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.pw-toggle:hover { color: var(--text); }

/* Password strength meter */
.pw-strength {
  margin-top: 0.4rem;
  display: none;
}

.pw-strength.visible { display: block; }

.pw-strength-bar {
  display: flex;
  gap: 3px;
  margin-bottom: 0.2rem;
}

.pw-strength-seg {
  height: 3px;
  flex: 1;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.2s;
}

.pw-strength-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.strength-weak   .pw-strength-seg:nth-child(1)                          { background: #e53e3e; }
.strength-fair   .pw-strength-seg:nth-child(1),
.strength-fair   .pw-strength-seg:nth-child(2)                          { background: #dd6b20; }
.strength-good   .pw-strength-seg:nth-child(1),
.strength-good   .pw-strength-seg:nth-child(2),
.strength-good   .pw-strength-seg:nth-child(3)                          { background: #d69e2e; }
.strength-strong .pw-strength-seg                                       { background: #38a169; }

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.925rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

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

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

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}

.alert.visible { display: block; }

.alert-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
}

.alert-success {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  color: #276749;
}

/* ── Legal consent checkbox ─────────────────────────────────── */
.consent-label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.845rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 0.15rem;
  cursor: pointer;
  accent-color: var(--primary);
  /* Override global input reset */
  padding: 0;
  border: none;
  border-radius: 3px;
  background: none;
  font-size: inherit;
  transition: none;
  box-shadow: none;
}

.consent-label a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-label a:hover { color: var(--primary-hover); }

/* ── Legal notice (below the card) ─────────────────────────── */
.legal-notice {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.775rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.legal-notice a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-notice a:hover { color: var(--primary); }

/* ── Switch link ────────────────────────────────────────────── */
.switch-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.switch-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* ── Dashboard layout ───────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.75rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-user {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  padding-right: 0.6rem;
  border-right: 1px solid var(--border);
  margin-right: 0.15rem;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
}

.main-content {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

/* ── Upload zone ────────────────────────────────────────────── */
.upload-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.upload-row input[type="file"] {
  flex: 1;
  min-width: 0;
}

/* ── File table ─────────────────────────────────────────────── */
.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.file-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.file-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.file-table tr:last-child td {
  border-bottom: none;
}

.file-table tr:hover td {
  background: var(--bg);
}

.file-name {
  max-width: 320px;
  min-width: 140px;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 0;
  font-size: 0.9rem;
}

/* ── Landing page ───────────────────────────────────────────── */
.landing-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg);
}

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 6rem;
  text-align: center;
  background: linear-gradient(160deg, #eef1fe 0%, #f4f6fb 50%, #ffffff 100%);
}

.hero-inner {
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #c7d2fe;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 1.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-accent {
  color: var(--primary);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2.25rem;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 0.8rem 1.85rem;
  font-size: 0.975rem;
  width: auto;
}

.features {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 5rem 1.5rem;
}

.features-header {
  text-align: center;
  margin-bottom: 3rem;
}

.features-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.features-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  max-width: 860px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.75rem;
  text-align: left;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: 0 6px 24px rgba(79, 110, 247, 0.09);
  border-color: #c7d2fe;
  transform: translateY(-2px);
}

.feature-icon-wrap {
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1.1rem;
}

.feature-card h3 {
  font-size: 0.975rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

.landing-footer {
  text-align: center;
  padding: 1.75rem;
  font-size: 0.825rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Pricing page ───────────────────────────────────────────── */
.pricing-hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(160deg, #eef1fe 0%, #f4f6fb 55%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}

.pricing-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.pricing-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
}

/* ── Plan cards ─────────────────────────────────────────────── */
.pricing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 820px;
  margin: 3.5rem auto;
  padding: 0 1.5rem;
  align-items: start;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.plan-card:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
}

.plan-card-premium {
  border-color: #f6d365;
  border-width: 2px;
  box-shadow: 0 4px 24px rgba(246, 211, 101, 0.25);
}

.plan-card-premium:hover {
  box-shadow: 0 8px 32px rgba(246, 211, 101, 0.35);
}

.plan-badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f6d365, #fda085);
  color: #7c3100;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.9rem;
  border-radius: 99px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.plan-header {
  text-align: center;
}

.plan-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.plan-price-num {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.plan-price-per {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.plan-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.btn-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
  border: none;
  width: 100%;
}

.btn-upgrade {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #7c3100;
}

.btn-upgrade:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-already-premium {
  background: #d1fae5 !important;
  color: #065f46 !important;
  cursor: default !important;
  opacity: 1 !important;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.875rem;
}

.plan-features li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.plan-features li::before {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.feat-yes::before { content: '✓'; color: #276749; font-weight: 700; }
.feat-no::before  { content: '—'; color: var(--muted); }
.feat-no          { color: var(--muted); }
.feat-ai          { font-weight: 500; }

.plan-trial {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: -0.5rem 0 0;
}

/* ── Comparison table ───────────────────────────────────────── */
.compare-section {
  max-width: 820px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.compare-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  text-align: center;
}

.compare-wrap {
  overflow-x: auto;
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--surface);
}

.compare-table th {
  padding: 0.75rem 1.1rem;
  text-align: left;
  background: var(--bg);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.compare-table th.col-premium {
  background: #fffbeb;
  color: #92400e;
}

.compare-table td.col-premium {
  background: #fffdf5;
  color: var(--text);
  font-weight: 600;
}

.compare-table td {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.compare-table tr:last-child td { border-bottom: none; }

.compare-group-row td {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.5rem 1.1rem;
}

.tick  { color: #276749; font-weight: 700; }
.cross { color: var(--muted); }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem;
}

.faq-inner {
  max-width: 820px;
  margin: 0 auto;
}

.faq-inner h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  text-align: center;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.5rem;
}

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* ── Bottom CTA banner ──────────────────────────────────────── */
.pricing-bottom-cta {
  padding: 5rem 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, #eef1fe 0%, #f4f6fb 100%);
}

.pricing-bottom-cta-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pricing-bottom-cta h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.pricing-bottom-cta p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.bottom-cta-note {
  font-size: 0.78rem !important;
}

/* ── Pricing toast notification ─────────────────────────────── */
.pricing-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.pricing-toast.hidden  { display: none; }
.pricing-toast-success { background: #276749; color: #fff; }
.pricing-toast-error   { background: var(--danger); color: #fff; }

/* ── Nav premium badge ───────────────────────────────────────── */
.nav-premium-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f6d365, #fda085);
  color: #7c3100;
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
}

/* ── Enhanced landing page ──────────────────────────────────── */

/* Hero enhancements */
.hero-enhanced {
  flex-direction: column;
  padding-bottom: 0;
}

.hero-tag-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
}

.hero-tag.tag-ai {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.hero-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Product mockup */
.hero-mockup {
  max-width: 760px;
  width: 100%;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}

.mockup-browser {
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 0 rgba(0,0,0,0.04),
              0 0 0 1px var(--border),
              0 20px 60px rgba(79, 110, 247, 0.12);
  overflow: hidden;
}

.mockup-chrome {
  background: #f1f3f7;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.mockup-dots { display: flex; gap: 0.35rem; }
.mockup-dot  { width: 10px; height: 10px; border-radius: 50%; }
.mockup-dot:nth-child(1) { background: #ff5f57; }
.mockup-dot:nth-child(2) { background: #ffbd2e; }
.mockup-dot:nth-child(3) { background: #28c840; }

.mockup-url {
  flex: 1;
  background: #fff;
  border-radius: 5px;
  padding: 0.22rem 0.7rem;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mockup-body {
  padding: 0.75rem;
  display: flex;
  gap: 0.6rem;
  background: var(--bg);
  min-height: 195px;
}

.mockup-sidebar {
  width: 130px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 7px;
  padding: 0.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  overflow: hidden;
}

.mockup-folder {
  padding: 0.3rem 0.6rem;
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mockup-folder.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.mockup-main {
  flex: 1;
  background: var(--surface);
  border-radius: 7px;
  padding: 0.6rem 0.75rem;
  overflow: hidden;
}

.mockup-toolbar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  align-items: center;
}

.mockup-searchbar {
  flex: 1;
  background: var(--bg);
  border-radius: 5px;
  height: 20px;
  border: 1px solid var(--border);
}

.mockup-btn {
  width: 22px;
  height: 20px;
  background: var(--primary);
  border-radius: 4px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: #fff;
  flex-shrink: 0;
}

.mockup-file-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.3rem;
  border-radius: 4px;
  font-size: 0.68rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.mockup-file-row:last-child { border-bottom: none; }

.mockup-file-icon {
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.mockup-file-name {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mockup-file-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.58rem;
  padding: 0.05rem 0.32rem;
  border-radius: 99px;
  font-weight: 600;
  flex-shrink: 0;
}

.mockup-file-size {
  font-size: 0.62rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Trust bar */
.landing-trust-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
}

.trust-bar-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.trust-item-icon { font-size: 0.9rem; }

.trust-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

/* Section label chip */
.section-label {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.8rem;
  border-radius: 99px;
  margin-bottom: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* 6-column features grid */
.features-grid-6 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 860px;
}

/* AI spotlight */
.ai-spotlight {
  background: linear-gradient(160deg, #1a202c 0%, #2d3748 60%, #1a365d 100%);
  padding: 5.5rem 1.5rem;
  color: #fff;
}

.ai-spotlight-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 3rem;
}

.ai-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-spotlight-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  color: #fff;
}

.ai-spotlight-header p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.ai-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto 3rem;
}

.ai-feature-tile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.5rem 1.25rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.ai-feature-tile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(165, 180, 252, 0.4);
  transform: translateY(-2px);
}

.ai-feature-tile-icon {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
  display: block;
}

.ai-feature-tile h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #fff;
}

.ai-feature-tile p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.6;
  margin: 0;
}

.ai-spotlight-cta { text-align: center; }

.btn-spotlight {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #7c3100;
  font-weight: 700;
  padding: 0.8rem 2rem;
  font-size: 0.975rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  width: auto;
}

.btn-spotlight:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* How it works */
.how-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5rem 1.5rem;
}

.how-inner    { max-width: 860px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 3rem; }

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-header p { color: var(--muted); font-size: 0.95rem; }

.how-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0;
  align-items: start;
  max-width: 700px;
  margin: 0 auto;
}

.how-step         { text-align: center; padding: 0 1rem; }
.how-step-arrow   { font-size: 1.5rem; color: var(--border); padding-top: 1rem; }

.how-step-num {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 auto 1rem;
}

.how-step h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.how-step p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}

/* Pricing preview */
.pricing-preview {
  padding: 5rem 1.5rem;
  background: var(--bg);
}

.pricing-preview-inner { max-width: 680px; margin: 0 auto; }

.pricing-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.pricing-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pricing-mini-card.highlight {
  border-color: #f6d365;
  border-width: 2px;
  box-shadow: 0 4px 20px rgba(246, 211, 101, 0.2);
}

.pricing-mini-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.pricing-mini-price {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.pricing-mini-price span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.pricing-mini-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.pricing-preview-link {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s;
}

.pricing-preview-link:hover { text-decoration: underline; }

/* Final CTA */
.landing-final-cta {
  padding: 6rem 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, #eef1fe 0%, #f4f6fb 100%);
  border-top: 1px solid var(--border);
}

.landing-final-cta-inner {
  max-width: 520px;
  margin: 0 auto;
}

.landing-final-cta h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.landing-final-cta p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.cta-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1.25rem;
  margin-bottom: 0;
}

/* Full footer */
.landing-footer-full {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2.5rem 1.5rem;
}

.footer-inner   { max-width: 860px; margin: 0 auto; }

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-brand   { max-width: 240px; }

.footer-brand p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.footer-links   { display: flex; gap: 3rem; flex-wrap: wrap; }

.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: color 0.15s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* ── Hamburger button ──────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 11;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.mobile-nav-backdrop.open {
  display: block;
  opacity: 1;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--surface);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav-backdrop.open .mobile-nav {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: var(--bg);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* Landing responsive — tablet (≤ 768px) */
@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger   { display: flex; }
  .landing-nav { padding: 0 1rem; height: 56px; }

  /* Section header text */
  .section-header h2,
  .features-header h2 { font-size: 1.35rem; }

  /* AI spotlight */
  .ai-spotlight { padding: 3.5rem 1rem; }
  .ai-spotlight-header h2 { font-size: 1.4rem; }
  .ai-spotlight-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
  .ai-feature-tile { padding: 1.25rem 1rem; }

  /* Features grid */
  .features { padding: 3.5rem 1rem; }
  .features-grid-6 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

  /* Agent section */
  .agent-section { padding: 3.5rem 1rem; }
}

/* Landing responsive — mobile (≤ 640px) */
@media (max-width: 640px) {
  /* Trust bar */
  .trust-sep          { display: none; }
  .trust-bar-inner    { gap: 0.85rem; justify-content: flex-start; }
  .landing-trust-bar  { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* How it works */
  .how-steps          { grid-template-columns: 1fr; gap: 1.5rem; }
  .how-step-arrow     { display: none; }
  .how-section        { padding: 3.5rem 1rem; }

  /* Pricing */
  .pricing-mini-grid  { grid-template-columns: 1fr; }
  .pricing-preview    { padding: 3.5rem 1rem; }
  .pricing-plans      { grid-template-columns: 1fr; padding: 0 1rem; }

  /* Footer */
  .footer-top         { flex-direction: column; }
  .footer-links       { gap: 1.5rem; }
  .footer-brand       { max-width: 100%; }

  /* Mockup */
  .mockup-sidebar     { display: none; }
  .hero-mockup        { padding: 0 0.25rem; }

  /* Hero */
  .hero               { padding: 3rem 1rem 2.5rem; }
  .hero-sub           { font-size: 0.95rem; }
  .hero-tag           { font-size: 0.68rem; padding: 0.25rem 0.6rem; }

  /* Modals */
  .modal              { margin: 0.5rem; }
  .modal-wide         { max-width: calc(100vw - 1rem); margin: 0.5rem; }

  /* FAQ */
  .faq-grid           { grid-template-columns: 1fr; }

  /* Auth */
  .auth-card          { padding: 1.75rem 1.25rem; }

  /* CTA */
  .landing-final-cta  { padding: 3.5rem 1rem; }

  /* AI spotlight single column */
  .ai-spotlight-grid  { grid-template-columns: 1fr; }

  /* Features single column on small */
  .features-grid-6    { grid-template-columns: 1fr; }
}

/* ── Small phone breakpoint (≤ 480px) ───────────────────────────────────── */
@media (max-width: 480px) {
  /* Increase btn-sm touch targets */
  .btn-sm {
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    min-height: 38px;
  }

  /* Input font size prevents iOS auto-zoom */
  input[type="text"],
  input[type="email"],
  input[type="password"] { font-size: 1rem; }

  /* Full-width CTA buttons on small phones */
  .hero-cta .btn-lg,
  .cta-group .btn-lg { width: 100%; }
  .hero-cta,
  .cta-group { flex-direction: column; }

  /* Pricing comparison table scrolls horizontally */
  .compare-wrap { -webkit-overflow-scrolling: touch; }

  /* File name column narrower */
  .file-name { max-width: 180px; min-width: 100px; }

  /* Auth nav tighter */
  .auth-nav { padding: 0 1rem; }

  /* Footer padding tighter */
  .landing-footer-full { padding: 2rem 1rem 1.25rem; }

  /* Footer columns stack on tiny screens */
  .footer-links { flex-direction: column; gap: 1.25rem; }

  /* Pricing mini cards tighter */
  .pricing-mini-card { padding: 1.25rem; }

  /* Hero title smaller */
  .hero-title { font-size: 1.75rem; }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  display: none;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.modal h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.modal p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-actions .btn {
  flex: 1;
}

/* ── API Guide section ─────────────────────────────────────── */
.api-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 5rem 1.5rem;
}

.api-inner {
  max-width: 860px;
  margin: 0 auto;
}

.api-inline-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.82rem;
  color: var(--primary);
}

.api-auth-note {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.api-auth-note code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.8rem;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.api-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.api-card:hover {
  box-shadow: 0 4px 16px rgba(79, 110, 247, 0.08);
  border-color: #c7d2fe;
}

.api-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.api-method {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.api-method.get    { background: #d1fae5; color: #065f46; }
.api-method.post   { background: #dbeafe; color: #1e40af; }
.api-method.put    { background: #fef3c7; color: #92400e; }
.api-method.patch  { background: #ede9fe; color: #5b21b6; }
.api-method.delete { background: #fee2e2; color: #991b1b; }

.api-path {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.api-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.api-desc code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.78rem;
}

.api-code-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.api-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  letter-spacing: 0;
  text-transform: none;
}

.api-status.ok  { background: #d1fae5; color: #065f46; }
.api-status.err { background: #fee2e2; color: #991b1b; }

.api-code {
  background: #1a202c;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.api-code code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.6;
  white-space: pre;
  word-break: break-word;
  overflow-wrap: break-word;
}

.api-errors-ref {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.5rem;
}

.api-errors-ref h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.api-errors-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.api-error-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .api-grid { grid-template-columns: 1fr; }
  .api-section { padding: 3.5rem 1rem; }
  .api-inner { max-width: 100%; }
}

@media (max-width: 640px) {
  .api-code { padding: 0.6rem 0.75rem; }
  .api-code code { font-size: 0.7rem; }
  .api-card { padding: 1rem; }
  .api-card-header { flex-wrap: wrap; }
  .api-path { font-size: 0.78rem; word-break: break-all; }
  .api-auth-note { font-size: 0.82rem; padding: 0.85rem 1rem; }
  .api-auth-note br { content: ''; display: block; margin-top: 0.4rem; }
  .api-errors-ref { padding: 1.25rem; }
}

/* ── AI Agent Integration section ────────────────────────── */
.agent-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 5rem 1.5rem;
  color: #e2e8f0;
}

.agent-inner {
  max-width: 860px;
  margin: 0 auto;
}

.agent-section .section-header h2 {
  color: #f1f5f9;
}

.agent-section .section-header p {
  color: #94a3b8;
}

.agent-label {
  background: linear-gradient(135deg, #22d3ee, #818cf8) !important;
  color: #0f172a !important;
  font-weight: 700;
}

/* Steps */
.agent-steps {
  margin: 2.5rem 0;
}

.agent-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.agent-step-num {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.agent-step-content {
  flex: 1;
  min-width: 0;
}

.agent-step-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.4rem;
}

.agent-step-content p {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.agent-step-content code {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.8rem;
  color: #a5b4fc;
}

.agent-step-content .api-code {
  background: #0f172a;
  border: 1px solid #334155;
}

/* Capabilities grid */
.agent-capabilities {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.75rem;
  margin: 2.5rem 0;
}

.agent-capabilities h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 1.25rem;
  text-align: center;
}

.agent-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.agent-cap-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #1e293b;
  transition: border-color 0.2s;
}

.agent-cap-item:hover {
  border-color: #475569;
}

.agent-cap-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.agent-cap-item strong {
  color: #e2e8f0;
  font-size: 0.88rem;
}

.agent-cap-item code {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.72rem;
  color: #a5b4fc;
}

.agent-cap-item div {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Example boxes */
.agent-example-box {
  margin-top: 2rem;
}

.agent-example-box h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.agent-example-box .api-code {
  background: #0f172a;
  border: 1px solid #334155;
}

/* Responsive */
@media (max-width: 640px) {
  .agent-section { padding: 3rem 1rem; }
  .agent-step { flex-direction: column; gap: 0.75rem; }
  .agent-cap-grid { grid-template-columns: 1fr; }
  .agent-capabilities { padding: 1.25rem; }
  .agent-capabilities h3 { font-size: 0.95rem; }
  .agent-step-content h3 { font-size: 1rem; }
  .agent-step-content p { font-size: 0.84rem; }
  .agent-step-content .api-code { border-width: 1px; }
  .agent-step-content .api-code code { font-size: 0.68rem; }
  .agent-example-box .api-code code { font-size: 0.68rem; }
  .agent-inner .section-header h2 { font-size: 1.3rem; }
}
