/* ============================================
   ThesisFormatter — Design System
   Dark minimal theme with indigo accents
   ============================================ */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #111114;
  --bg-card: #16161a;
  --bg-elevated: #1c1c22;
  --bg-hover: #22222a;
  --border: #27272f;
  --border-light: #1e1e26;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #63636e;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-subtle: rgba(129, 140, 248, 0.1);
  --green: #34d399;
  --green-subtle: rgba(52, 211, 153, 0.1);
  --amber: #fbbf24;
  --amber-subtle: rgba(251, 191, 36, 0.1);
  --red: #f87171;
  --red-subtle: rgba(248, 113, 113, 0.1);
  --blue: #60a5fa;
  --blue-subtle: rgba(96, 165, 250, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --transition: 180ms ease;
  --sidebar-width: 230px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 100;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-light);
}
.brand-icon { color: var(--accent); display: flex; }
.brand-text { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 450;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition);
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); }

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 0;
}
.view {
  display: none;
  padding: 32px 40px 60px;
  animation: fadeIn 250ms ease;
}
.view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.view-header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.view-tagline { color: var(--text-primary); margin-top: 6px; font-size: 0.95rem; font-weight: 600; }
.view-subtitle { color: var(--text-secondary); margin-top: 4px; font-size: 0.92rem; }
.view-actions { display: flex; gap: 8px; align-items: center; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 14px; }
.section-header h2 { font-size: 1.1rem; font-weight: 600; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: var(--red-subtle); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-subtle); color: var(--green); border-color: transparent; }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 11px 20px; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ============ STAT CARDS ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon--blue { background: var(--blue-subtle); color: var(--blue); }
.stat-icon--amber { background: var(--amber-subtle); color: var(--amber); }
.stat-icon--green { background: var(--green-subtle); color: var(--green); }
.stat-icon--red { background: var(--red-subtle); color: var(--red); }
.stat-value { font-size: 1.5rem; font-weight: 700; display: block; letter-spacing: -0.02em; }
.stat-label { font-size: 0.82rem; color: var(--text-secondary); }

/* ============ TABLES ============ */
.table-container { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { border-bottom: 1px solid var(--border-light); }
th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td { padding: 14px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border-light); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elevated); }
.clickable-row { cursor: pointer; }
.clickable-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ============ STATUS BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
}
.badge--uploaded { background: var(--blue-subtle); color: var(--blue); }
.badge--uploaded::before { background: var(--blue); }
.badge--parsing, .badge--formatting, .badge--detecting, .badge--converting { background: var(--amber-subtle); color: var(--amber); }
.badge--parsing::before, .badge--formatting::before, .badge--detecting::before, .badge--converting::before { background: var(--amber); }
.badge--pending_qa { background: var(--accent-subtle); color: var(--accent); }
.badge--pending_qa::before { background: var(--accent); }
.badge--completed, .badge--qa_approved, .badge--delivered { background: var(--green-subtle); color: var(--green); }
.badge--completed::before, .badge--qa_approved::before, .badge--delivered::before { background: var(--green); }
.badge--failed, .badge--qa_rejected, .badge--cancelled { background: var(--red-subtle); color: var(--red); }
.badge--failed::before, .badge--qa_rejected::before, .badge--cancelled::before { background: var(--red); }

/* ============ UPLOAD ZONE ============ */
.upload-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.upload-icon { color: var(--text-muted); margin-bottom: 14px; display: flex; justify-content: center; }
.upload-zone:hover .upload-icon { color: var(--accent); }
.upload-text { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.upload-subtext { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 12px; }
.upload-formats { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.04em; }

.file-preview {
  margin-top: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.file-preview-info { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.file-name { font-weight: 500; font-size: 0.92rem; }
.file-size { font-size: 0.8rem; color: var(--text-muted); }

/* ============ FORMS ============ */
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.required { color: var(--red); }
input, select {
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-muted); }
select { cursor: pointer; }
option { background: var(--bg-card); }
.filter-select { padding: 7px 12px; font-size: 0.85rem; }

/* ============ PROGRESS ============ */
.upload-progress { margin-top: 20px; }
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.progress-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.88rem; }
.progress-title { font-weight: 500; }
.progress-percent { color: var(--accent); font-weight: 600; }
.progress-bar { height: 4px; background: var(--bg-primary); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 300ms ease;
}

/* ============ UPLOAD RESULT ============ */
.upload-result { margin-top: 20px; }
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.result-card.success { border-color: rgba(52, 211, 153, 0.3); }
.result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.result-header svg { color: var(--green); }
.result-header h3 { font-size: 1rem; font-weight: 600; }
.result-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-item { display: flex; flex-direction: column; gap: 2px; }
.result-item-label { font-size: 0.78rem; color: var(--text-muted); }
.result-item-value { font-weight: 500; font-size: 0.92rem; }
.result-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ============ TEMPLATES GRID ============ */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  transition: all var(--transition);
  cursor: default;
}
.template-card:hover { border-color: var(--border); transform: translateY(-1px); }
.template-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.template-card-title { font-weight: 600; font-size: 1rem; }
.template-card-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 500;
}
.template-card-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.template-meta-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.template-meta-row svg { color: var(--text-muted); flex-shrink: 0; }
.template-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border-light); }
.template-usage { font-size: 0.8rem; color: var(--text-muted); }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 150ms ease;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 820px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 600; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: flex-end; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-value { font-weight: 500; }
.detail-full { grid-column: 1 / -1; }

.qa-panel {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.qa-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.qa-panel-header h3 { font-size: 1rem; font-weight: 600; }
.qa-kicker { font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.qa-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--accent-subtle);
  color: var(--accent);
}
.qa-pill--passed { background: var(--green-subtle); color: var(--green); }
.qa-pill--needs_human_review { background: var(--amber-subtle); color: var(--amber); }
.qa-pill--failed { background: var(--red-subtle); color: var(--red); }
.qa-rule-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.86rem;
}
.qa-rule-card strong { color: var(--text-secondary); font-weight: 600; }
.qa-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.qa-count {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg-card);
}
.qa-count span { display: block; color: var(--text-muted); font-size: 0.75rem; margin-bottom: 4px; }
.qa-count strong { font-size: 0.9rem; }
.qa-details {
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-top: 10px;
}
.qa-details summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}
.qa-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.qa-check {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}
.qa-check span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.qa-check strong { font-size: 0.84rem; font-weight: 600; }
.qa-check small { grid-column: 2; color: var(--text-muted); line-height: 1.35; word-break: break-word; }
.qa-check--passed { border-color: rgba(52, 211, 153, 0.24); }
.qa-check--warning { border-color: rgba(251, 191, 36, 0.26); }
.qa-check--fail { border-color: rgba(248, 113, 113, 0.28); }
.qa-notes { margin: 10px 0 0 18px; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5; }
.qa-muted { color: var(--text-muted); font-size: 0.86rem; margin-top: 8px; }
.qa-reject-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(248, 113, 113, 0.26);
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.08);
}
.qa-reject-header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.qa-reject-header strong {
  color: var(--text-primary);
  font-weight: 600;
}
.qa-reject-header span {
  color: var(--text-secondary);
  font-size: 0.86rem;
}
.qa-reject-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.qa-reject-panel textarea { min-height: 110px; }
.qa-reject-error {
  min-height: 18px;
  margin-top: 8px;
  color: var(--red);
  font-size: 0.84rem;
}

/* ============ TOASTS ============ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 250ms ease;
  min-width: 280px;
}
.toast.success { border-color: rgba(52,211,153,0.3); }
.toast.error { border-color: rgba(248,113,113,0.3); }
.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state svg { opacity: 0.3; }

/* ============ FORM SECTIONS & GRIDS ============ */
.form-section-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.form-section-title:first-child,
.form-section-title:first-of-type { margin-top: 0; }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

textarea {
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
  min-height: 80px;
  resize: vertical;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--text-muted); }

/* ============ BADGE POLLING ============ */
.badge--polling {
  animation: badgePulse 1.8s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ PUBLIC LANDING PAGE ============ */
.landing-body {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f5f7fb;
  color: #111827;
}

.landing-body a {
  color: inherit;
  text-decoration: none;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(20px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid rgba(205, 215, 229, 0.72);
  background: rgba(247, 249, 252, 0.94);
  color: #172033;
  backdrop-filter: blur(14px);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.06rem;
  font-weight: 800;
}

.landing-brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  color: #0f766e;
  background: #ffffff;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 0.94rem;
  font-weight: 650;
}

.landing-nav-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
}

.landing-nav-links a:hover {
  color: #0f766e;
  background: #e9f5f3;
}

.landing-hero,
.landing-band,
.landing-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  gap: 48px;
  align-items: start;
  padding: 56px 0 66px;
}

.landing-hero-visual {
  display: none;
}

.landing-hero-copy {
  min-width: 0;
  max-width: 660px;
  padding-top: 20px;
}

.landing-kicker {
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 650px;
  margin-top: 16px;
  color: #101828;
  font-size: clamp(3rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.landing-lede {
  max-width: 590px;
  margin-top: 22px;
  color: #475467;
  font-size: 1.08rem;
  line-height: 1.68;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.landing-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}

.landing-btn-primary {
  color: #ffffff;
  background: #0f766e;
  border-color: #0f766e;
}

.landing-btn-primary:hover {
  background: #115e59;
}

.landing-btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.landing-btn-secondary {
  color: #172033;
  border-color: #c9d3e1;
  background: #ffffff;
}

.landing-btn-secondary:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.landing-proof {
  max-width: 610px;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.landing-proof div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #d8dfe9;
  border-left: 3px solid #0f766e;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.landing-proof dt {
  color: #101828;
  font-size: 1rem;
  font-weight: 800;
}

.landing-proof dd {
  margin-top: 5px;
  color: #667085;
  font-size: 0.86rem;
}

.landing-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
}

.landing-audit-tool {
  min-width: 0;
  margin-top: 0;
  padding: 22px;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 64px rgba(17, 24, 39, 0.14);
}

.audit-tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.audit-tool-header h2 {
  margin-top: 8px;
  color: #101828;
  font-size: 1.32rem;
  line-height: 1.18;
}

.audit-tool-header > span {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #b45309;
  font-weight: 800;
  font-size: 0.82rem;
  white-space: nowrap;
}

.audit-form-grid,
.audit-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.audit-upload-grid,
.audit-full,
.audit-more-fields {
  margin-top: 14px;
}

.landing-audit-tool label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 750;
  font-size: 0.86rem;
}

.landing-audit-tool input,
.landing-audit-tool select,
.landing-audit-tool textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 0.95rem;
}

.landing-audit-tool textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

.landing-audit-tool input:focus,
.landing-audit-tool select:focus,
.landing-audit-tool textarea:focus,
.landing-upload-zone:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: #0f766e;
}

.landing-upload-zone {
  min-height: 106px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px dashed #9aa8bd;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
  color: #475467;
  cursor: pointer;
}

.landing-upload-zone:hover,
.landing-upload-zone.is-dragging {
  border-color: #0f766e;
  background: #f0fdfa;
}

.landing-upload-zone.has-file {
  border-style: solid;
  border-color: #10b981;
  background: #ecfdf3;
}

.landing-upload-zone strong {
  color: #101828;
  font-size: 1rem;
}

.landing-upload-zone span,
.landing-upload-zone small {
  color: #667085;
  line-height: 1.45;
}

.landing-upload-zone small {
  word-break: break-word;
}

.audit-more-fields {
  border: 1px solid #d8e1ed;
  border-radius: 8px;
  background: #f8fafc;
}

.audit-more-fields summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: #172033;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.audit-more-fields summary::-webkit-details-marker {
  display: none;
}

.audit-more-fields summary::after {
  content: "+";
  color: #0f766e;
  font-size: 1.15rem;
  line-height: 1;
}

.audit-more-fields[open] summary {
  border-bottom: 1px solid #d8e1ed;
}

.audit-more-fields[open] summary::after {
  content: "-";
}

.audit-more-fields .audit-form-grid {
  padding: 14px;
}

.landing-consent {
  margin-top: 16px;
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px !important;
  padding: 12px;
  border: 1px solid #d8dfe9;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  line-height: 1.45;
}

.landing-consent input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.audit-submit-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.audit-submit-row .landing-btn {
  width: 100%;
}

.landing-form-status {
  min-height: 20px;
  color: #667085;
  font-weight: 650;
  line-height: 1.45;
}

.landing-form-status.is-error { color: #b42318; }
.landing-form-status.is-success { color: #047857; }
.landing-form-status.is-pending { color: #175cd3; }
.required { color: #b42318; }

.landing-band {
  padding: 62px 0;
  border-top: 1px solid #d8dfe9;
}

.landing-section-heading {
  max-width: 700px;
  margin-bottom: 28px;
}

.landing-section-heading h2,
.landing-split h2,
.integrity-band h2 {
  margin-top: 10px;
  color: #101828;
  font-size: 2.1rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.landing-section-copy,
.integrity-copy p {
  margin-top: 16px;
  color: #475467;
  font-size: 1.05rem;
  line-height: 1.7;
}

.landing-grid,
.landing-grid-six,
.landing-guide-grid,
.pricing-grid {
  display: grid;
  gap: 16px;
}

.landing-grid,
.landing-grid-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-feature,
.pricing-card,
.faq-list details,
.landing-guide-card,
.problem-list li,
.landing-steps li,
.integrity-band,
.integrity-points div {
  border: 1px solid #d8dfe9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.landing-feature {
  min-height: 152px;
  padding: 20px;
}

.landing-feature h3,
.pricing-card p {
  color: #101828;
  font-size: 1.05rem;
  font-weight: 800;
}

.landing-feature p,
.pricing-card span,
.landing-steps p,
.faq-list p,
.landing-guide-card p {
  margin-top: 10px;
  color: #667085;
  line-height: 1.65;
}

.landing-guide-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.landing-guide-card {
  min-height: 158px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.landing-guide-card:hover {
  border-color: #0f766e;
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.08);
}

.landing-guide-card span {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing-guide-card strong {
  color: #101828;
  font-size: 1rem;
  line-height: 1.3;
}

.landing-guide-card p {
  font-size: 0.94rem;
}

.landing-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 46px;
  align-items: start;
}

.problem-list,
.landing-steps,
.faq-list,
.integrity-points {
  display: grid;
  gap: 10px;
  list-style: none;
}

.problem-list li {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #344054;
  font-weight: 700;
}

.problem-list a:hover {
  color: #0f766e;
}

.problem-list span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  flex: 0 0 auto;
}

.landing-steps {
  gap: 14px;
}

.landing-steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 16px;
  min-height: 122px;
  padding: 22px;
}

.landing-steps span {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #0f2537;
  color: #ffffff;
  font-weight: 800;
}

.landing-steps strong {
  color: #101828;
  font-size: 1.04rem;
}

.pricing-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-card {
  min-height: 184px;
  padding: 22px;
}

.pricing-card h3 {
  margin-top: 10px;
  color: #101828;
  font-size: 1.78rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.pricing-card-primary {
  border-color: #0f766e;
  background: #f0fdfa;
}

.integrity-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: start;
  padding: 34px;
}

.integrity-band .landing-kicker {
  color: #0f766e;
}

.integrity-copy {
  max-width: 520px;
}

.integrity-copy h2 {
  color: #101828;
}

.integrity-copy p {
  font-size: 1.02rem;
  line-height: 1.66;
}

.integrity-points div {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-left: 3px solid #0f766e;
  background: #f8fafc;
}

.integrity-points strong {
  color: #101828;
  font-size: 0.98rem;
}

.integrity-points span {
  color: #667085;
  line-height: 1.5;
}

.integrity-points a {
  width: max-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9d3e1;
  border-radius: 8px;
  padding: 0 14px;
  color: #0f766e;
  font-weight: 800;
  background: #ffffff;
}

.faq-list {
  gap: 12px;
}

.faq-list details {
  padding: 18px 20px;
}

.faq-list summary {
  cursor: pointer;
  color: #101828;
  font-weight: 800;
}

.landing-footer {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #d8dfe9;
  color: #667085;
}

.landing-footer span:first-child {
  color: #101828;
  font-weight: 800;
}

.landing-footer span:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.landing-footer a,
.landing-section-copy a,
.integrity-band a {
  color: #0f766e;
  font-weight: 800;
}

.landing-footer a:hover,
.landing-section-copy a:hover,
.integrity-band a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .landing-hero-copy,
  .landing-audit-tool {
    max-width: 760px;
  }

  .landing-guide-grid,
  .pricing-grid,
  .landing-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .landing-grid,
  .landing-split,
  .integrity-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html,
  body.landing-body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .landing-nav {
    position: relative;
    max-width: 100%;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 14px;
  }

  .landing-nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .landing-nav-links a {
    min-width: 0;
    justify-content: center;
    padding: 0 8px;
    text-align: center;
    white-space: normal;
  }

  .landing-hero,
  .landing-band,
  .landing-footer {
    width: 100%;
    max-width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-hero {
    padding-top: 30px;
    padding-bottom: 48px;
  }

  .landing-hero-copy,
  .landing-audit-tool {
    min-width: 0;
    width: 100%;
  }

  .landing-hero h1 {
    max-width: calc(100vw - 28px);
    font-size: 1.92rem;
    line-height: 1.08;
  }

  .landing-lede {
    max-width: 100%;
    font-size: 1rem;
  }

  .landing-actions {
    display: grid;
  }

  .landing-btn,
  .audit-submit-row .landing-btn {
    width: 100%;
  }

  .landing-proof,
  .landing-grid,
  .landing-grid-six,
  .landing-guide-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .landing-section-heading h2,
  .landing-split h2,
  .integrity-band h2 {
    font-size: 1.85rem;
  }

  .landing-audit-tool,
  .integrity-band {
    padding: 18px;
  }

  .audit-tool-header,
  .landing-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-tool-header > span {
    width: max-content;
  }

  .landing-footer span:last-child {
    justify-content: flex-start;
  }
}

/* ============ SEO GUIDE PAGES ============ */
.seo-body {
  background: #f8fafc;
}

.seo-main {
  width: min(940px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 92px;
}

.seo-article {
  color: #172033;
}

.seo-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 26px;
  color: #667085;
  font-size: 0.92rem;
  line-height: 1.4;
}

.seo-breadcrumb a {
  color: #0f766e;
  text-decoration: none;
}

.seo-breadcrumb a:hover {
  text-decoration: underline;
}

.seo-article h1 {
  margin-top: 14px;
  color: #101828;
  font-size: 3.7rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.seo-lede {
  margin-top: 22px;
  color: #475467;
  font-size: 1.22rem;
  line-height: 1.72;
}

.seo-article section {
  margin-top: 38px;
  padding: 30px;
  border: 1px solid #d8dfe9;
  border-radius: 8px;
  background: #ffffff;
}

.seo-article h2 {
  color: #101828;
  font-size: 1.7rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.seo-article p {
  margin-top: 14px;
  color: #475467;
  font-size: 1.02rem;
  line-height: 1.72;
}

.seo-list,
.seo-checklist {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-left: 20px;
  color: #344054;
  line-height: 1.62;
}

.seo-checklist {
  list-style: none;
  padding-left: 0;
}

.seo-checklist li {
  position: relative;
  padding-left: 28px;
}

.seo-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0f766e;
}

.seo-cta {
  margin-top: 42px;
  padding: 30px;
  border-radius: 8px;
  background: #0f2537;
  color: #ffffff;
}

.seo-cta h2,
.seo-cta p {
  color: #ffffff;
}

.seo-cta .landing-btn {
  margin-top: 20px;
}

.seo-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.seo-table th,
.seo-table td {
  padding: 14px;
  border: 1px solid #d8dfe9;
  text-align: left;
  vertical-align: top;
}

.seo-table th {
  color: #101828;
  background: #f2f6fa;
}

@media (max-width: 760px) {
  .seo-main {
    width: min(100% - 28px, 940px);
    padding-top: 34px;
  }
  .seo-article h1 {
    font-size: 2.45rem;
  }
  .seo-article section,
  .seo-cta {
    padding: 22px;
  }
}
