/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --text: #111827;
  --text-secondary: #374151;
  --muted: #6B7280;
  --muted-light: #9CA3AF;
  --bg: #FFFFFF;
  --bg-subtle: #F9FAFB;
  --bg-subtle2: #F3F4F6;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════════════════
   POLISH PRIMITIVES — focus, selection, scrollbar, motion, entrance
   ══════════════════════════════════════════════════════════════ */

/* Keyboard focus rings — only show for keyboard nav, never on mouse click.
   Form controls already render a box-shadow ring on :focus, so they opt out
   of the outline to avoid a doubled indicator. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.checkout-input:focus-visible {
  outline: none;
}
/* The check cards visually hide their real <input>; surface its focus on the card. */
.profile-check-card:has(.profile-check-input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Brand-tinted text selection */
::selection { background: rgba(37, 99, 235, 0.22); }
::-moz-selection { background: rgba(37, 99, 235, 0.22); }

/* Thin custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 100px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-light); }

/* Subtle page entrance */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-main { animation: fadeUp 0.25s ease both; }

/* Respect users who ask for less motion: freeze infinite loops (pulse/spin),
   drop entrances, and neutralize transitions. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .app-main { animation: none; }
}

/* Layout utilities */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-logo-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

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

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
  margin-left: 8px;
}

.nav-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ── HERO ── */
.hero {
  padding: 88px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37,99,235,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--primary-light);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 28px;
  letter-spacing: 0.01em;
}

.hero-eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto 20px;
}

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

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 1px 2px 0 rgb(37 99 235 / 0.4);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgb(37 99 235 / 0.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: white;
  color: var(--text-secondary);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid var(--border-strong);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--muted);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted-light);
}

/* ── SCAN PREVIEW MOCKUP ── */
.hero-preview-wrap {
  margin-top: 64px;
  position: relative;
}

.hero-preview-wrap::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 200px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.scan-preview {
  max-width: 700px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  overflow: hidden;
  text-align: left;
}

.scan-preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
}

.scan-preview-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.verdict-badge.go {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.2);
}

.verdict-badge.no-go {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}

.verdict-badge.review {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(217,119,6,0.2);
}

.scan-rule {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.scan-rule:last-child { border-bottom: none; }
.scan-rule:hover { background: var(--bg-subtle); }

.rule-verdict {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 2px;
}

.rule-verdict.pass {
  background: var(--success-bg);
  color: var(--success);
}
.rule-verdict.fail {
  background: var(--danger-bg);
  color: var(--danger);
}
.rule-verdict.unclear {
  background: var(--warning-bg);
  color: var(--warning);
}

.rule-body { min-width: 0; flex: 1; }

.rule-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.rule-clause {
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.5;
  background: var(--bg-subtle2);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--border-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rule-clause.fail-clause { border-left-color: var(--danger); background: var(--danger-bg); color: #991B1B; }

.rule-location {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted-light);
}

/* ── SOCIAL PROOF STRIP ── */
.social-strip {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.social-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}

.social-item svg { color: var(--success); }

/* ── HOW IT WORKS ── */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-subtle); }

.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
  max-width: 620px;
}

.section-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.65;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 56px;
  background: var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.step {
  background: white;
  padding: 36px 32px;
  position: relative;
}

.step-number {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border: 1.5px solid rgba(37,99,235,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}

.step-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── FEATURES GRID ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 28px 32px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.feature-icon {
  width: 44px; height: 44px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 20px;
}

.feature-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.feature-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── TESTIMONIAL ── */
.testimonial-section {
  padding: 80px 0;
  background: var(--primary);
}

.testimonial-inner {
  text-align: center;
}

.testimonial-quote {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  color: white;
  max-width: 720px;
  margin: 0 auto 28px;
  line-height: 1.45;
  letter-spacing: -0.3px;
}

.testimonial-attr {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

/* ── PRICING ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
  align-items: start;
}

.pricing-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px 32px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg);
}

.pricing-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary);
  color: white;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.pricing-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}

.pricing-amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.pricing-period {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.pricing-note {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.pricing-cta {
  display: block;
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
  background: white;
  color: var(--text);
}

.pricing-cta:hover {
  background: var(--bg-subtle);
  border-color: var(--muted);
}

.pricing-cta.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pricing-cta.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ── CTA BANNER ── */
.cta-banner {
  padding: 88px 0;
  text-align: center;
}

.cta-banner-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
}

.cta-banner-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.15;
}

.cta-banner-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 13.5px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav-links { display: none; }
  .hero { padding: 56px 0 48px; }
  .steps { grid-template-columns: 1fr; gap: 1px; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .cta-banner-box { padding: 40px 24px; }
  .social-strip-inner { gap: 20px; }
}

@media (max-width: 480px) {
  .hero-title { letter-spacing: -0.8px; }
  .scan-preview { border-radius: var(--radius-lg); }
  .hero-actions { flex-direction: column; width: 100%; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   PROFILES & FORM PAGES
   ══════════════════════════════════════════════════════════════ */

/* ── PAGE SHELL ── */
.page-shell {
  padding: 48px 0 80px;
  min-height: calc(100vh - 120px);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
  max-width: 520px;
  line-height: 1.55;
}

/* ── BACK LINK ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.5;
}
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-subtle);
}

.empty-icon {
  width: 56px;
  height: 56px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--muted-light);
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.empty-desc {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ── PROFILES GRID ── */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ── PROFILE CARD ── */
.profile-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.profile-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.profile-card-header {
  padding: 18px 20px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.profile-card-meta {
  min-width: 0;
  flex: 1;
}

.profile-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,0.15);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-body {
  padding: 16px 20px;
  flex: 1;
}

.profile-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.profile-fact-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.profile-fact-value {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-populations {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.55;
  margin-bottom: 14px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.15);
}

.profile-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-subtle);
}

/* ── GHOST BUTTONS ── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: white;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-danger-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  background: transparent;
  border: 1.5px solid rgba(220,38,38,0.2);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}

.btn-danger-ghost:hover {
  background: var(--danger-bg);
  border-color: rgba(220,38,38,0.4);
}

/* ── FORM PAGE ── */
.form-page {
  max-width: 680px;
  margin: 0 auto;
}

.form-page-header {
  margin-bottom: 32px;
}

.profile-form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.form-section {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-section + .form-section {
  border-top: 1px solid var(--border);
}

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label-optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-light);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--text);
  background: white;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted-light);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.form-hint {
  font-size: 12.5px;
  color: var(--muted-light);
  line-height: 1.5;
}

.form-checks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.form-check-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.form-check-desc {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

/* ── RESPONSIVE (profiles & forms) ── */
@media (max-width: 640px) {
  .profiles-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-section { padding: 20px; }
  .form-actions { padding: 16px 20px; }
  .page-header { flex-direction: column; gap: 16px; }
}

/* ══════════════════════════════════════════════════════════════
   SCAN FORM
   ══════════════════════════════════════════════════════════════ */

.scan-form-page { max-width: 760px; }

.form-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.form-section-num {
  width: 24px;
  height: 24px;
  background: var(--primary-light);
  border: 1.5px solid rgba(37,99,235,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.form-required { color: var(--danger); margin-left: 2px; }

.form-hint-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.form-hint-link:hover { text-decoration: underline; }

.scan-textarea {
  min-height: 320px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ── LOADING OVERLAY ── */
.scan-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.scan-loading-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.scan-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(37,99,235,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 24px;
}

.scan-loading-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 10px;
}

.scan-loading-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.scan-loading-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted-light);
  transition: color 0.3s;
}

.lstep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}

.scan-loading-step.active { color: var(--primary); font-weight: 600; }
.scan-loading-step.active .lstep-dot {
  background: var(--primary);
  border-color: var(--primary);
}

/* ══════════════════════════════════════════════════════════════
   SCAN RESULT PAGE
   ══════════════════════════════════════════════════════════════ */

.result-container { max-width: 860px; }

/* ── VERDICT BANNER ── */
.result-banner {
  border-radius: var(--radius-xl);
  border: 1px solid;
  padding: 24px 28px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.result-banner-go {
  background: var(--success-bg);
  border-color: rgba(22,163,74,0.25);
}
.result-banner-nogo {
  background: var(--danger-bg);
  border-color: rgba(220,38,38,0.25);
}
.result-banner-review {
  background: var(--warning-bg);
  border-color: rgba(217,119,6,0.25);
}

.result-banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.result-verdict-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-banner-go .result-verdict-icon {
  background: var(--success);
  color: white;
}
.result-banner-nogo .result-verdict-icon {
  background: var(--danger);
  color: white;
}
.result-banner-review .result-verdict-icon {
  background: var(--warning);
  color: white;
}

.result-banner-text { min-width: 0; }

.result-verdict-label {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.result-banner-go .result-verdict-label { color: var(--success); }
.result-banner-nogo .result-verdict-label { color: var(--danger); }
.result-banner-review .result-verdict-label { color: var(--warning); }

.result-verdict-doc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}

.result-banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.result-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  font-weight: 700;
}

.result-stat-num {
  font-size: 20px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.result-stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-stat-fail {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}
.result-stat-unclear {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(217,119,6,0.2);
}
.result-stat-pass {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.2);
}

.result-meta {
  font-size: 12.5px;
  color: var(--muted);
}

/* ── SECTION LABELS ── */
.result-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.result-section-label-fail { color: var(--danger); }
.result-section-label-unclear { color: var(--warning); }
.result-section-label-pass { color: var(--success); }

/* ── RULE CARDS ── */
.result-rule-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}

.result-rule-card:hover { box-shadow: var(--shadow-sm); }

.result-rule-card-fail {
  border-color: rgba(220,38,38,0.25);
  border-left: 3px solid var(--danger);
}
.result-rule-card-unclear {
  border-color: rgba(217,119,6,0.25);
  border-left: 3px solid var(--warning);
}
.result-rule-card-pass {
  border-left: 3px solid var(--success);
}

.result-rule-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.result-rule-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  flex: 1;
}

.result-rule-quote {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-subtle2);
  border: none;
  border-left: 3px solid var(--border-strong);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 0 0 12px;
  word-break: break-word;
}

.result-rule-quote-fail {
  background: var(--danger-bg);
  border-left-color: var(--danger);
  color: #7f1d1d;
}

.result-rule-quote-unclear {
  background: var(--warning-bg);
  border-left-color: var(--warning);
  color: #78350f;
}

.result-rule-footer {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.result-rule-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted-light);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-rule-reason {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

/* ── DISCLAIMER ── */
.result-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 32px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .result-banner { flex-direction: column; gap: 16px; }
  .result-banner-right { align-items: flex-start; }
  .result-stats { justify-content: flex-start; }
  .result-rule-footer { flex-direction: column; gap: 6px; }
  .scan-loading-card { padding: 32px 24px; }
  .result-verdict-doc { max-width: 100%; white-space: normal; }
}

/* ══════════════════════════════════════════════════════════════
   SCAN RESULT — TRUST-FIRST COMPONENTS
   ══════════════════════════════════════════════════════════════ */

/* ── TRUST SIGNAL BAR ── */
.result-trust-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.trust-divider {
  color: var(--border-strong);
  font-size: 11px;
  user-select: none;
}

/* ── CONTEXTUAL GUIDANCE BLOCK ── */
.result-guidance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.result-guidance-fail {
  background: rgba(220,38,38,0.05);
  border-color: rgba(220,38,38,0.2);
  color: #7f1d1d;
}
.result-guidance-fail svg { color: var(--danger); }

.result-guidance-unclear {
  background: rgba(217,119,6,0.05);
  border-color: rgba(217,119,6,0.2);
  color: #78350f;
}
.result-guidance-unclear svg { color: var(--warning); }

.result-guidance-pass {
  background: rgba(22,163,74,0.05);
  border-color: rgba(22,163,74,0.2);
  color: #14532d;
}
.result-guidance-pass svg { color: var(--success); }

/* ── RULE CARDS: TRUST-FIRST STRUCTURE ── */
.rrc-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.rrc-card:hover { box-shadow: var(--shadow-sm); }

.rrc-card-fail {
  border-color: rgba(220,38,38,0.3);
}
.rrc-card-unclear {
  border-color: rgba(217,119,6,0.25);
}
.rrc-card-pass {
  border-left: 3px solid var(--success);
}

/* ── CARD HEADER STRIP (FAIL / UNCLEAR) ── */
.rrc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid;
}

.rrc-header-fail {
  background: rgba(220,38,38,0.07);
  border-bottom-color: rgba(220,38,38,0.15);
}

.rrc-header-unclear {
  background: rgba(217,119,6,0.07);
  border-bottom-color: rgba(217,119,6,0.15);
}

.rrc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.rrc-badge-fail {
  background: var(--danger);
  color: white;
}

.rrc-badge-unclear {
  background: var(--warning);
  color: white;
}

.rrc-header-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── CARD BODY ── */
.rrc-body {
  padding: 14px 18px 18px;
}

/* ── PASS CARD HEADER (no strip, inline layout) ── */
.rrc-pass-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rrc-pass-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}

/* ── LOCATION CHIP ── */
.rrc-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-subtle2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── VERBATIM QUOTE BLOCK ── */
.rrc-quote {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  border: none;
  border-left: 3px solid;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 0 0 12px;
  word-break: break-word;
  white-space: pre-wrap;
}

.rrc-quote-fail {
  background: rgba(220,38,38,0.05);
  border-left-color: var(--danger);
  color: #7f1d1d;
}

.rrc-quote-unclear {
  background: rgba(217,119,6,0.04);
  border-left-color: var(--warning);
  color: #78350f;
}

.rrc-quote-pass {
  background: var(--bg-subtle2);
  border-left-color: var(--border-strong);
  color: var(--text-secondary);
}

/* ── VERDICT REASON LINE ── */
.rrc-reason {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

.rrc-reason-label {
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 3px;
}

/* ── RESPONSIVE: TRUST-FIRST CARDS ── */
@media (max-width: 640px) {
  .result-trust-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .trust-divider { display: none; }
  .rrc-header-title { white-space: normal; }
  .rrc-location { white-space: normal; max-width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER ACTIONS
   ══════════════════════════════════════════════════════════════ */

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   SMALL GHOST BUTTON VARIANT
   ══════════════════════════════════════════════════════════════ */

.btn-ghost-sm {
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  gap: 4px !important;
}

/* ══════════════════════════════════════════════════════════════
   VERDICT BADGE SIZE VARIANT
   ══════════════════════════════════════════════════════════════ */

.verdict-badge-sm {
  font-size: 11px !important;
  padding: 3px 9px !important;
}

/* ══════════════════════════════════════════════════════════════
   SCAN HISTORY PAGE
   ══════════════════════════════════════════════════════════════ */

.history-section {
  margin-bottom: 8px;
}

.history-section-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.history-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.1px;
}

.history-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--bg-subtle2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

/* ── History list ── */
.history-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.history-list-header {
  display: grid;
  grid-template-columns: 90px 1fr 180px 130px 160px;
  gap: 0;
  padding: 10px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.history-list-header > div {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hdr-actions { text-align: right; }

.history-row {
  display: grid;
  grid-template-columns: 90px 1fr 180px 130px 160px;
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.1s;
}

.history-row:last-child { border-bottom: none; }
.history-row:hover { background: var(--bg-subtle); }

.history-date {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.history-source {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 16px;
}

.history-source-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-batch-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.history-profile {
  padding-right: 16px;
}

.history-profile-name {
  font-size: 13.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.history-verdict {
  display: flex;
  align-items: center;
}

.history-batch-verdicts {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 860px) {
  .history-list-header { display: none; }
  .history-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 16px;
  }
  .history-source { flex-direction: column; align-items: flex-start; gap: 4px; }
  .history-actions { justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════════════
   BATCH FORM PAGE
   ══════════════════════════════════════════════════════════════ */

.batch-form-page { max-width: 800px; }

.form-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-all-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.select-toggle-btn {
  background: none;
  border: none;
  padding: 3px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
}

.select-toggle-btn:hover { opacity: 0.75; }

.select-all-divider {
  font-size: 11px;
  color: var(--border-strong);
  user-select: none;
}

.profile-checks-info {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.select-limit-note {
  color: var(--muted-light);
}

.profile-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.profile-check-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: white;
  position: relative;
  user-select: none;
}

.profile-check-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.profile-check-card.is-checked {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.profile-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pcc-check-icon {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  background: white;
  transition: all 0.15s;
  color: transparent;
}

.profile-check-card.is-checked .pcc-check-icon {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

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

.pcc-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.profile-check-card.is-checked .pcc-name { color: var(--primary-dark); }

.pcc-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .profile-checks-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   BATCH RESULT PAGE
   ══════════════════════════════════════════════════════════════ */

.batch-result-page { max-width: 900px; }

/* ── Header ── */
.batch-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.batch-result-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.batch-chip-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.batch-result-doc-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 5px;
}

.batch-result-meta {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Summary stats ── */
.batch-summary-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.batch-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  min-width: 70px;
}

.batch-stat-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.batch-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.batch-stat-nogo {
  background: var(--danger-bg);
  border-color: rgba(220,38,38,0.2);
  color: var(--danger);
}
.batch-stat-review {
  background: var(--warning-bg);
  border-color: rgba(217,119,6,0.2);
  color: var(--warning);
}
.batch-stat-go {
  background: var(--success-bg);
  border-color: rgba(22,163,74,0.2);
  color: var(--success);
}

/* ── Matrix card ── */
.batch-matrix-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.batch-matrix-list-header {
  display: grid;
  grid-template-columns: 1fr 120px 160px 120px;
  padding: 10px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.batch-matrix-list-header > div {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-light);
}

.bm-col-action { text-align: right; }

.batch-matrix-row {
  display: grid;
  grid-template-columns: 1fr 120px 160px 120px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 12px;
  transition: background 0.1s;
}

.batch-matrix-row:last-child { border-bottom: none; }
.batch-matrix-row:hover { filter: brightness(0.985); }

.bm-row-nogo { background: rgba(220,38,38,0.03); }
.bm-row-go   { background: rgba(22,163,74,0.03); }
.bm-row-review { background: white; }

.bm-col-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bm-profile-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.bm-profile-info { min-width: 0; }

.bm-profile-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-profile-type {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.bm-col-verdict {
  display: flex;
  align-items: center;
}

.bm-col-stats {
  display: flex;
  align-items: center;
}

.bm-rule-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.bm-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.bm-pill-fail {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}
.bm-pill-unclear {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(217,119,6,0.2);
}
.bm-pill-pass {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.2);
}

.bm-no-rules {
  font-size: 13px;
  color: var(--muted-light);
}

.bm-col-action {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .batch-result-header { flex-direction: column; }
  .batch-summary-stats { align-self: flex-start; }
  .batch-matrix-list-header { display: none; }
  .batch-matrix-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }
  .bm-col-action { justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════════════
   METERING: NAV CREDITS BADGE
   ══════════════════════════════════════════════════════════════ */

.nav-credits {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--success-bg);
  border: 1px solid rgba(22,163,74,0.25);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
  margin-right: 4px;
}

.nav-credits:hover {
  background: #dcfce7;
  border-color: var(--success);
}

.nav-credits-empty {
  background: var(--danger-bg);
  border-color: rgba(220,38,38,0.25);
  color: var(--danger);
}

.nav-credits-empty:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

/* ══════════════════════════════════════════════════════════════
   PRICING PAGE (standalone)
   ══════════════════════════════════════════════════════════════ */

.pricing-page-header {
  text-align: center;
  padding: 56px 0 0;
  margin-bottom: 0;
}

.pricing-page-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
  margin: 12px 0 12px;
  line-height: 1.15;
}

.pricing-page-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.gate-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: var(--radius-lg);
  margin-top: 32px;
}

.gate-alert-icon {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 1px;
}

.gate-alert-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.gate-alert-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pricing-value-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.pricing-value-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pricing-value-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-light);
  border: 1px solid rgba(37,99,235,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.pricing-value-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.pricing-value-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 768px) {
  .pricing-value-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   CHECKOUT
   ══════════════════════════════════════════════════════════════ */

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
  margin-top: 32px;
}

.checkout-form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
}

.demo-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: #92400e;
  margin-bottom: 28px;
  line-height: 1.5;
}

.checkout-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 6px;
}

.checkout-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
}

.checkout-field {
  margin-bottom: 20px;
}

.checkout-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.checkout-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font);
  outline: none;
}

.checkout-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.checkout-card-wrap {
  position: relative;
}

.checkout-card-icons {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}

.card-icon {
  padding: 2px 5px;
  background: var(--bg-subtle2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 1px 2px 0 rgb(37 99 235 / 0.4);
  margin-top: 8px;
  font-family: var(--font);
}

.checkout-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgb(37 99 235 / 0.35);
}

.checkout-btn:active { transform: translateY(0); }

.checkout-terms {
  font-size: 11.5px;
  color: var(--muted-light);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

.checkout-summary-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 28px 24px;
  position: sticky;
  top: 80px;
}

.checkout-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.checkout-summary-plan {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.checkout-summary-plan-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.checkout-summary-plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.checkout-summary-period {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.checkout-summary-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.checkout-summary-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.checkout-summary-features li svg { color: var(--success); flex-shrink: 0; margin-top: 1px; }

.checkout-summary-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}

.checkout-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.checkout-summary-total-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.checkout-summary-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-summary-card { position: static; }
  .checkout-form-card { padding: 24px 20px; }
}

/* ══════════════════════════════════════════════════════════════
   ACCOUNT PAGE
   ══════════════════════════════════════════════════════════════ */

.account-balance-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  margin-bottom: 40px;
}

.account-balance-number {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1;
}

.balance-ok { color: var(--success); }
.balance-low { color: var(--warning); }
.balance-empty { color: var(--danger); }

.account-balance-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

.account-balance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 40px;
}

.balance-row-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.balance-row-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.account-balance-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.balance-empty-msg, .balance-low-msg {
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
  text-align: right;
  line-height: 1.5;
}

.account-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.account-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.purchases-list {
  display: flex;
  flex-direction: column;
}

.purchase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

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

.purchase-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.purchase-plan-badge {
  padding: 3px 10px;
  background: var(--primary-light);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.purchase-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.purchase-date {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.purchase-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.alert-success {
  background: var(--success-bg);
  border-color: rgba(22,163,74,0.25);
  color: var(--success);
}

.alert-success svg { stroke: var(--success); }

@media (max-width: 768px) {
  .account-balance-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px;
  }
  .account-balance-cta { align-items: flex-start; }
  .balance-empty-msg, .balance-low-msg { text-align: left; max-width: 100%; }
}
