/* ═══════════════════════════════════════════════════════════════════════════
   KernelScan — "Obsidian Instrument" Design System
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('/static/fonts/fonts.css');

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  --bg:           #09090b;
  --surface:      #18181b;
  --surface-alt:  #111114;
  --border:       #27272a;
  --border-hover: #3f3f46;
  --text:         #e4e4e7;
  --text-dim:     #71717a;
  --text-muted:   #52525b;
  --accent:       #f59e0b;
  --accent-hover: #fbbf24;
  --accent-dim:   #b45309;
  --accent-glow:  rgba(245, 158, 11, 0.15);
  --accent-glow-strong: rgba(245, 158, 11, 0.30);
  --red:          #f43f5e;
  --red-dim:      rgba(244, 63, 94, 0.12);
  --green:        #10b981;
  --green-dim:    rgba(16, 185, 129, 0.12);
  --blue:         #3b82f6;
  --blue-dim:     rgba(59, 130, 246, 0.12);
  --amber-dim:    rgba(245, 158, 11, 0.10);

  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-serif:   'Instrument Serif', Georgia, serif;
  --font-body:    'Lexend', system-ui, sans-serif;
  --font-mono:    'Space Mono', 'SF Mono', 'Fira Code', monospace;

  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    6px;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);

  --page-max:     1200px;
}

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

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  background: var(--amber-dim);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

/* ── Atmospheric background ─────────────────────────────────────────────── */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-glow::before {
  content: '';
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, rgba(245, 158, 11, 0.06), transparent),
    radial-gradient(ellipse 500px 500px at 70% 80%, rgba(59, 130, 246, 0.04), transparent),
    radial-gradient(ellipse 800px 300px at 50% 50%, rgba(245, 158, 11, 0.03), transparent);
  animation: drift 25s ease-in-out infinite alternate;
}

.bg-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.05); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* ── Top bar ────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
  position: relative;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fafafa;
  text-decoration: none;
}

.topbar-brand:hover { color: #fafafa; }

.logo-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow-strong));
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease, background 0.15s ease;
}

.topbar-nav-link svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.topbar-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.topbar-nav-link:hover svg {
  opacity: 0.85;
}

/* ── Account icon button (topbar-right) ──────────────────────────── */

.topbar-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.topbar-account-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.topbar-account-btn--active {
  color: var(--accent);
  background: var(--accent-glow);
}

.topbar-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

.btn-signin {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 100px;
  padding: 6px 18px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-signin:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── Page wrapper ───────────────────────────────────────────────────────── */

.page {
  position: relative;
  z-index: 1;
}

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

.hero {
  position: relative;
  padding: 100px 40px 80px;
  text-align: center;
  overflow: hidden;
}

/* Subtle grid background for hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 20%, transparent 70%);
  pointer-events: none;
}

/* Cinematic glow behind headline */
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 300px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.08), transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  animation: hero-enter 0.8s var(--ease-out) both;
}

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(24px); }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  animation: hero-enter 0.8s 0.1s var(--ease-out) both;
}

.hero-eyebrow svg {
  opacity: 0.7;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: #fafafa;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 24px;
  animation: hero-enter 0.8s 0.15s var(--ease-out) both;
}

.hero-headline em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0;
}

.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 36px;
  animation: hero-enter 0.8s 0.2s var(--ease-out) both;
}

.hero-sub code {
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  animation: hero-enter 0.8s 0.3s var(--ease-out) both;
}

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 28px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.15s var(--ease-spring);
}

.hero-btn-primary:hover {
  color: var(--bg);
  box-shadow: 0 8px 32px -6px var(--accent-glow-strong), 0 0 0 1px var(--accent);
  transform: translateY(-1px);
}

.hero-btn-primary svg {
  opacity: 0.7;
}

.hero-btn-secondary {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hero-btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ── Stats strip ──────────────────────────────────────────────────────── */

.stats-strip {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 0 40px;
  animation: fade-in 0.6s 0.4s var(--ease-out) both;
}

.stats-strip-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 28px 0;
}

.stats-item {
  flex: 1;
  text-align: center;
  padding: 0 24px;
}

.stats-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stats-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.stats-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Feature pillars ──────────────────────────────────────────────────── */

.pillars-section {
  border-bottom: none;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pillar-card {
  position: relative;
  padding: 32px 28px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fade-in 0.6s var(--ease-out) both;
}

.pillar-card:nth-child(1) { animation-delay: 0.5s; }
.pillar-card:nth-child(2) { animation-delay: 0.6s; }
.pillar-card:nth-child(3) { animation-delay: 0.7s; }

.pillar-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px -12px rgba(0, 0, 0, 0.5);
}

.pillar-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
  opacity: 0.6;
}

.pillar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fafafa;
  margin: 0 0 10px;
}

.pillar-desc {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.pillar-desc em {
  font-style: italic;
  color: var(--text-dim);
}

.pillar-desc code {
  font-size: 0.76rem;
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section {
  padding: 56px 40px;
  border-bottom: 1px solid var(--border);
}

.section--alt {
  background: var(--surface-alt);
}

.section-inner {
  max-width: var(--page-max);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fafafa;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-dim);
  margin-bottom: 32px;
}

/* ── Analyze card ───────────────────────────────────────────────────────── */

.analyze-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 24px 80px -12px rgba(0, 0, 0, 0.4), 0 0 120px -40px var(--accent-glow);
}

.analyze-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.analyze-upload {
  position: relative;
  min-width: 0;
}

/* Auth gate overlay */
.auth-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  transition: opacity 0.3s ease;
}

.auth-gate.hidden {
  display: none;
}

.auth-gate-content {
  text-align: center;
  max-width: 360px;
}

.auth-gate-content svg {
  color: var(--accent);
  margin-bottom: 16px;
}

.auth-gate-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fafafa;
  margin-bottom: 8px;
}

.auth-gate-content p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.btn-primary {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 28px;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.15s var(--ease-spring);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px -6px var(--accent-glow-strong);
  transform: translateY(-1px);
}

/* Analyze info column */
.analyze-info h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fafafa;
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-icon {
  color: var(--accent);
  font-size: 0.6rem;
  margin-top: 6px;
  flex-shrink: 0;
}

.feature-list strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 4px;
}

.feature-list p {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Drop zone ──────────────────────────────────────────────────────────── */

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 24px;
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s var(--ease-spring);
}

.drop-zone:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
}

.drop-zone.over {
  border-color: var(--accent);
  background: var(--amber-dim);
  box-shadow: 0 0 30px -8px var(--accent-glow-strong);
  transform: scale(1.01);
}

.drop-zone.has-file {
  border-color: var(--accent);
  border-style: solid;
  background: var(--amber-dim);
}

.drop-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

.drop-or {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  padding: 8px 20px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.15s var(--ease-spring);
}

.file-btn:hover {
  box-shadow: 0 4px 20px -4px var(--accent-glow-strong);
  transform: translateY(-1px);
}

.file-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  min-height: 1.2em;
  margin-top: 4px;
  word-break: break-all;
  text-align: center;
}

.drop-zone.has-file .drop-label,
.drop-zone.has-file .drop-or,
.drop-zone.has-file .file-btn {
  opacity: 0.5;
}

/* ── Version select ─────────────────────────────────────────────────────── */

.field {
  margin-top: 20px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field select {
  width: 100%;
  appearance: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field select:hover { border-color: var(--border-hover); }
.field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field select:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Analyse button ─────────────────────────────────────────────────────── */

#analyse-btn {
  width: 100%;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.15s var(--ease-spring), opacity 0.2s ease;
}

#analyse-btn:not(:disabled):hover {
  box-shadow: 0 8px 30px -6px var(--accent-glow-strong);
  transform: translateY(-1px);
}

#analyse-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Status / spinner ───────────────────────────────────────────────────── */

.status {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--amber-dim);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-sm);
}

.status.hidden { display: none; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

#status-text {
  font-size: 0.82rem;
  color: var(--accent);
}

/* ── Error ──────────────────────────────────────────────────────────────── */

.error {
  margin-top: 20px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-sm);
}

.error.hidden { display: none; }

/* ── Results ────────────────────────────────────────────────────────────── */

.results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.results.hidden { display: none; }

.results h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fafafa;
  margin-bottom: 16px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border-hover);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.stat--red::before  { background: var(--red); }
.stat--green::before { background: var(--green); }
.stat--amber::before { background: var(--blue); }

.stat--red   { background: var(--red-dim); border-color: rgba(244, 63, 94, 0.15); }
.stat--green { background: var(--green-dim); border-color: rgba(16, 185, 129, 0.15); }
.stat--amber { background: var(--blue-dim); border-color: rgba(59, 130, 246, 0.15); }

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  color: #fafafa;
  margin-bottom: 4px;
}

.stat--red .stat-value   { color: var(--red); }
.stat--green .stat-value { color: var(--green); }
.stat--amber .stat-value { color: var(--blue); }

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Download button ────────────────────────────────────────────────────── */

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  padding: 11px 24px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.download-btn:hover {
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 6px 24px -6px var(--accent-glow-strong);
}

/* ── Showcase two-panel layout ──────────────────────────────────────────── */

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.showcase-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-panel .showcase-card {
  flex: 1;
}

.showcase-panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.showcase-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 4px;
  padding: 3px 8px;
  width: fit-content;
}

.showcase-label--product {
  color: var(--blue);
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.15);
}

.showcase-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fafafa;
  margin: 0;
}

.showcase-panel-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

.showcase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.showcase-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4);
}

.showcase-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fafafa;
  margin-bottom: 2px;
}

.showcase-card-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.4;
}

.showcase-card-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.showcase-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Factor tags (used on showcase card + modal) */

.showcase-factors {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.showcase-factor-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
}

.showcase-factor-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  min-width: fit-content;
  margin-right: 2px;
}

.showcase-factor-tag {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.showcase-card-factors {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.showcase-card-factors .showcase-factors {
  gap: 6px;
}

.showcase-card-factors .showcase-factor-tag {
  font-size: 0.58rem;
  padding: 1px 6px;
}

/* ── Sample cards ───────────────────────────────────────────────────────── */

.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.sample-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sample-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4);
}

.sample-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fafafa;
  margin-bottom: 4px;
}

.sample-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.sample-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sample-stat {
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.02);
}

.sample-stat-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}

.sample-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

.sample-stat--red .sample-stat-value { color: var(--red); }
.sample-stat--green .sample-stat-value { color: var(--green); }
.sample-stat--blue .sample-stat-value { color: var(--blue); }
.sample-stat--total .sample-stat-value { color: var(--text-dim); }

.sample-card { cursor: pointer; }

/* Arch pill row */
.sample-arch-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sample-arch-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sample-arch-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-dim);
}

.sample-arch-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--amber-dim);
}

/* Sample modal stats */
.sample-modal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sample-modal-stat {
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.sample-modal-stat-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
}

.sample-modal-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.sample-modal-stat--red .sample-modal-stat-value { color: var(--red); }
.sample-modal-stat--red { border-color: var(--red-dim); background: var(--red-dim); }
.sample-modal-stat--green .sample-modal-stat-value { color: var(--green); }
.sample-modal-stat--green { border-color: var(--green-dim); background: var(--green-dim); }
.sample-modal-stat--blue .sample-modal-stat-value { color: var(--blue); }
.sample-modal-stat--blue { border-color: var(--blue-dim); background: var(--blue-dim); }
.sample-modal-stat--total .sample-modal-stat-value { color: var(--text-dim); }

/* Severity horizontal bar chart */
.severity-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.severity-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.severity-bar-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 64px;
  text-align: right;
  flex-shrink: 0;
}

.severity-bar-track {
  flex: 1;
  height: 18px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.severity-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.severity-bar-fill--critical { background: var(--red); }
.severity-bar-fill--high     { background: #f97316; }
.severity-bar-fill--medium   { background: var(--accent); }
.severity-bar-fill--low      { background: var(--blue); }

.severity-bar-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* KEV + age row */
.sample-modal-kev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sample-modal-kev {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sample-modal-kev-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--red);
}

.sample-modal-kev-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-dim);
  padding: 2px 8px;
  border-radius: 4px;
}

.sample-modal-kev-desc {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
}

.sample-modal-kev.kev-zero .sample-modal-kev-value {
  color: var(--text-muted);
}
.sample-modal-kev.kev-zero .sample-modal-kev-label {
  color: var(--text-muted);
  background: var(--bg-card);
}

.sample-modal-age {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: right;
}

.sample-modal-age strong {
  color: var(--text-dim);
  font-weight: 500;
}

.sample-modal-actions {
  text-align: center;
  padding-top: 8px;
}

.sample-modal-actions .download-btn {
  display: inline-block;
}

#sample-modal .modal {
  max-width: 820px;
  max-height: 90vh;
}

/* ── Sample Modal CVE List ─────────────────────────────────────────────── */

.cve-list-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 12px 0;
}

.cve-list-loading[hidden] { display: none; }

.cve-list-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cve-spin 0.6s linear infinite;
}

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

.cve-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  overflow: hidden;
}

.cve-section:last-child { margin-bottom: 0; }

.cve-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.cve-section-header:hover { background: rgba(255, 255, 255, 0.04); }

.cve-section-chevron {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

.cve-section.open .cve-section-chevron { transform: rotate(90deg); }

.cve-section-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: 1;
}

.cve-section-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Section color accents */
.cve-section--kev .cve-section-title      { color: var(--red); }
.cve-section--kev .cve-section-count       { color: var(--red); background: var(--red-dim); }
.cve-section--affected .cve-section-title  { color: #f97316; }
.cve-section--affected .cve-section-count  { color: #f97316; background: rgba(249,115,22,0.12); }
.cve-section--triage .cve-section-title    { color: var(--blue); }
.cve-section--triage .cve-section-count    { color: var(--blue); background: var(--blue-dim); }
.cve-section--mitigated .cve-section-title { color: #06b6d4; }
.cve-section--mitigated .cve-section-count { color: #06b6d4; background: rgba(6,182,212,0.12); }
.cve-section--fixed .cve-section-title     { color: var(--green); }
.cve-section--fixed .cve-section-count     { color: var(--green); background: var(--green-dim); }

.cve-section-body {
  display: none;
  border-top: 1px solid var(--border);
}

.cve-section.open .cve-section-body { display: block; }

.cve-section-empty {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

/* Individual CVE item */
.cve-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cve-item:last-child { border-bottom: none; }

.cve-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.cve-item-header:hover { background: rgba(255, 255, 255, 0.02); }

.cve-item-chevron {
  font-size: 0.5rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  width: 10px;
  flex-shrink: 0;
}

.cve-item.open .cve-item-chevron { transform: rotate(90deg); }

.cve-item-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.cve-item-id a {
  color: inherit;
  text-decoration: none;
}

.cve-item-id a:hover { color: var(--accent); }

.cve-sev-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cve-sev-badge--critical { color: var(--red);  background: var(--red-dim); }
.cve-sev-badge--high     { color: #f97316;     background: rgba(249,115,22,0.12); }
.cve-sev-badge--medium   { color: var(--accent); background: var(--amber-dim); }
.cve-sev-badge--low      { color: var(--blue);  background: var(--blue-dim); }
.cve-sev-badge--none     { color: var(--text-muted); background: rgba(255,255,255,0.04); }

.cve-item-score {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.cve-item-kev-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-dim);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cve-item-module-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cve-item-desc-preview {
  flex: 1;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Expandable detail */
.cve-item-detail {
  display: none;
  padding: 8px 14px 12px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(0, 0, 0, 0.15);
}

.cve-item.open .cve-item-detail { display: block; }

.cve-item-detail-desc {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 8px;
}

.cve-item-detail-analysis {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--border-hover);
}

/* Factor assessment detail */
.cve-item-factor-assessment {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(6, 182, 212, 0.06);
  border-radius: var(--radius-xs);
  border-left: 2px solid #06b6d4;
}

.cve-item-factor-header {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #06b6d4;
  margin-bottom: 4px;
}

.cve-item-factor-reasoning {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 6px;
}

.cve-item-factor-slugs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cve-factor-slug {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
}

/* Factor assessment in CVE detail modal */
.factor-detail-row {
  margin-bottom: 10px;
}

.factor-detail-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.factor-section-heading {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 4px 0;
}

.factor-prose-block {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 8px 10px;
  background: rgba(6, 182, 212, 0.04);
  border-radius: var(--radius-xs);
  border-left: 2px solid #06b6d4;
}

.factor-slugs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge-mitigates     { color: #06b6d4; background: rgba(6, 182, 212, 0.15); }
.badge-not-affected  { color: var(--green); background: var(--green-dim); }
.badge-increases-risk { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.badge-neutral       { color: var(--text-muted); background: rgba(255, 255, 255, 0.06); }

/* View full details button */
.btn-cve-details {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-cve-details:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Show more button */
.cve-section-more {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}

.cve-section-more:hover { background: rgba(255, 255, 255, 0.05); }

/* ── CVE Browser ────────────────────────────────────────────────────────── */

/* ── CVE Toolbar ───────────────────────────────────────────────────────── */

.cve-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Search row */
.cve-toolbar-search {
  display: flex;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.cve-search-icon {
  position: absolute;
  left: 16px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.cve-toolbar-search:focus-within .cve-search-icon {
  color: var(--accent);
}

.cve-toolbar-search input[type="text"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 14px 16px 14px 44px;
  outline: none;
  letter-spacing: 0.01em;
}

.cve-toolbar-search input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.cve-toolbar-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 100%;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.cve-toolbar-search button:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Filter row */
.cve-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface-alt);
}

.cve-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cve-filter-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.cve-filter-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.cve-filters select {
  appearance: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 28px 6px 10px;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2352525b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cve-filters select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.cve-filters select:not([data-default]) {
  /* active state handled by JS */
}

.cve-score-range {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cve-score-range input[type="number"] {
  width: 58px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 6px;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cve-score-range input[type="number"]::-webkit-inner-spin-button,
.cve-score-range input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cve-score-range input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.cve-score-range input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.cve-range-sep {
  width: 10px;
  height: 1px;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* Clear button */
.cve-clear-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.cve-clear-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.cve-clear-btn svg {
  opacity: 0.6;
}

.cve-clear-btn:hover svg {
  opacity: 1;
}

/* Loading spinner */
.cve-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.cve-loading.active {
  display: flex;
}

.cve-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cve-spin 0.7s linear infinite;
}

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

.cve-table-wrap {
  overflow-x: auto;
  transition: opacity 0.2s ease;
}

.cve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cve-table thead th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.cve-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(39, 39, 42, 0.5);
  color: var(--text);
  vertical-align: top;
}

.cve-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.cve-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cve-table .mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.cve-table .desc-cell {
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
}

/* Severity badges */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.badge-critical { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.badge-high     { background: var(--red-dim); color: var(--red); }
.badge-medium   { background: var(--amber-dim); color: var(--accent); }
.badge-low      { background: var(--blue-dim); color: var(--blue); }

/* CVE pagination */
.cve-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.cve-pagination button {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cve-pagination button:hover:not(:disabled) { background: var(--border); }
.cve-pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

.cve-pagination span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── CVE Detail Modal ───────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] { display: none; }

.modal {
  width: 90%;
  max-width: 720px;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 100px -20px rgba(0, 0, 0, 0.7);
  animation: modal-in 0.25s var(--ease-out) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}


.modal-close {
  font-size: 1.4rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  overflow-y: auto;
  padding: 24px 28px;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.modal-field { }

.modal-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal-value {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
}

.modal-description {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal-mono-block {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  word-break: break-all;
}

.modal-table {
  font-size: 0.78rem;
}

.modal-table a, .cve-table a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-dim);
}

.modal-table a:hover, .cve-table a:hover {
  color: var(--accent-hover);
  border-bottom-style: solid;
}

/* ── NVD pending indicators ─────────────────────────────────────────────── */

.badge-pending {
  background: rgba(113, 113, 122, 0.15);
  color: var(--text-muted);
  font-style: italic;
}

.badge-ai {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  font-size: 0.65rem;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

.assessment-banner {
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.assessment-banner-ai {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.assessment-banner-both {
  color: var(--text-muted);
  background: rgba(113, 113, 122, 0.08);
  border: 1px solid rgba(113, 113, 122, 0.15);
}

.assessment-banner[hidden] { display: none; }

.text-muted {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.78rem;
}

.nvd-banner {
  font-size: 0.82rem;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.nvd-banner[hidden] { display: none; }

/* ── AI Assessment detail section ──────────────────────────────────────── */

.ai-section-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: #a78bfa;
  margin: 0 0 8px 0;
  letter-spacing: 0.02em;
}

.ai-detail-row {
  margin-top: 16px;
}

.ai-prose-block {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0;
}

.ai-prose-block p {
  margin: 0 0 8px 0;
}

.ai-prose-block p:last-child {
  margin-bottom: 0;
}

.ai-prose-block ul {
  margin: 4px 0 8px 0;
  padding-left: 20px;
}

.ai-prose-block li {
  margin-bottom: 4px;
}

.ai-prose-block code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  padding: 1px 5px;
  border-radius: 3px;
}

.ai-prose-block strong {
  color: var(--text);
  font-weight: 600;
}

.ai-meta-row {
  display: flex;
  gap: 1.5rem;
}

.ai-model-label,
.ai-date-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ── AI teaser (gated content) ──────────────────────────────────────────── */

.ai-teaser-block {
  margin-top: 16px;
}

.ai-teaser-block:first-child {
  margin-top: 0;
}

.ai-teaser-block .ai-section-heading {
  margin-bottom: 8px;
}

.ai-teaser-gate {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px dashed rgba(167, 139, 250, 0.3);
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.ai-teaser-gate svg {
  flex-shrink: 0;
  color: #a78bfa;
  opacity: 0.7;
}

.ai-teaser-link {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 500;
}

.ai-teaser-link:hover {
  text-decoration: underline;
  color: #c4b5fd;
}

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

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 40px;
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ── Hidden utility ─────────────────────────────────────────────────────── */

/* ── Auth topbar controls ──────────────────────────────────────────────── */

.btn-register {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 18px;
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-register:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user-email {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-signout {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-signout:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ── Auth modal ───────────────────────────────────────────────────────── */

.auth-modal {
  max-width: 420px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-field input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-field input:focus {
  border-color: var(--accent);
}

.auth-submit {
  margin-top: 4px;
  width: 100%;
  text-align: center;
}

.auth-error {
  font-size: 0.82rem;
  color: var(--red);
  margin: 0;
}

.auth-success {
  font-size: 0.82rem;
  color: var(--green);
  margin: 0;
}

.auth-info {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

.auth-switch {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ── Plans ──────────────────────────────────────────────────────────────── */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.plan-card:hover {
  border-color: var(--border-hover);
}

.plan-card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-header {
  text-align: center;
  margin-bottom: 20px;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
}

.plan-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}

.plan-features li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 20px;
}

.plan-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.plan-btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.plan-btn--accent {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}

.plan-btn--accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
}

.plan-btn--current {
  border-color: var(--green);
  color: var(--green);
  cursor: default;
}

/* ── Account ───────────────────────────────────────────────────────────── */

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

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

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.account-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.account-plan-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.account-tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.account-tier-label {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

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

.account-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.account-stat-label {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.account-stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.account-card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 16px;
  min-height: 20px;
}

.account-card-desc.pending {
  color: var(--accent);
}

.account-plan-select {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.account-plan-select select {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.account-plan-select .plan-btn {
  width: auto;
  white-space: nowrap;
  padding: 8px 20px;
}

.account-card-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.account-card--danger {
  border-color: rgba(244, 63, 94, 0.3);
}

.account-card--danger h3 {
  color: var(--red);
}

.account-delete-form {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.account-input {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.account-input:focus {
  outline: none;
  border-color: var(--red);
}

.account-delete-status {
  font-size: 0.8rem;
  margin: 12px 0 0;
  min-height: 1.2em;
}

.account-delete-status.error { color: var(--red); }
.account-delete-status.success { color: var(--green); }

/* ── API tokens panel ─────────────────────────────────────────────── */

.apikey-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
}

.apikey-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  padding: 8px 0;
}

.apikey-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
}

.apikey-row.is-revoked {
  opacity: 0.5;
}

.apikey-row-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apikey-row-prefix {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.apikey-row-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.apikey-row-revoke {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.apikey-row-revoke:hover {
  border-color: var(--red);
  color: var(--red);
}

.apikey-row-revoke:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.apikey-create {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.apikey-create .account-input {
  flex: 1;
}

.apikey-create .plan-btn {
  width: auto;
  white-space: nowrap;
  padding: 8px 20px;
}

.apikey-status {
  font-size: 0.8rem;
  margin: 10px 0 0;
  min-height: 1.2em;
  color: var(--text-muted);
}

.apikey-status.error { color: var(--red); }
.apikey-status.success { color: var(--green); }

.apikey-reveal {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-xs);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
}

.apikey-reveal-label {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.apikey-reveal-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.apikey-reveal-token {
  flex: 1;
  min-width: 240px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  word-break: break-all;
}

.apikey-reveal-row .plan-btn {
  width: auto;
  padding: 8px 16px;
  white-space: nowrap;
}

.apikey-reveal-example {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.apikey-reveal-example code {
  font-family: var(--font-mono);
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  color: var(--text-dim);
  word-break: break-all;
  user-select: all;
}

.topbar-account-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.topbar-account-link:hover {
  text-decoration: underline;
}

/* ── Plan comparison table ─────────────────────────────────────────── */

.plan-compare-table-wrap {
  overflow-x: auto;
}

.plan-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.plan-compare-table th,
.plan-compare-table td {
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.plan-compare-table th:first-child,
.plan-compare-table td:first-child {
  text-align: left;
  color: var(--text-dim);
  font-weight: 400;
}

.plan-compare-table th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  padding-bottom: 12px;
}

.plan-compare-table tbody td {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.current-tier-cell {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
}

.plan-compare-table--landing .featured-col {
  background: var(--accent-glow);
}
.plan-compare-table--landing thead .featured-col {
  color: var(--accent);
}

.plans-grid--header {
  margin-bottom: 32px;
}
.plans-grid--header .plan-card {
  padding: 22px 22px 18px;
}
.plans-grid--header .plan-header {
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

/* ── Products page ──────────────────────────────────────────────────── */

.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 1px var(--border-hover);
}

.product-card--loading {
  cursor: default;
  opacity: 0.7;
}
.product-card--error {
  cursor: default;
  border-color: var(--red);
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.product-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.product-card-badges {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge--version {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}
.badge--arch {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.product-card-stats {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.product-card-stat {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
}
.stat--affected  { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.stat--ok        { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.stat--triage    { background: var(--blue-dim); color: var(--blue); }
.stat--kev       { background: rgba(244, 63, 94, 0.2); color: var(--red); font-size: 0.7rem; }

.product-card-factors {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.product-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-card-loading,
.product-card-error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  color: var(--text-dim);
}
.product-card-error {
  flex-direction: column;
  align-items: flex-start;
  color: var(--red);
}

/* ── Products empty state ───────────────────────────────────────────── */

.products-empty {
  text-align: center;
  padding: 4rem 2rem;
}
.products-empty .empty-icon {
  margin-bottom: 1.5rem;
  opacity: 0.5;
}
.products-empty h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.products-empty p {
  color: var(--text-dim);
  margin: 0 0 1.5rem;
}

/* ── Tier gate ──────────────────────────────────────────────────────── */

.tier-gate {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.tier-gate p {
  color: var(--text-dim);
  margin: 0 0 1rem;
}

/* ── Product detail ─────────────────────────────────────────────────── */

.btn-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  display: inline-block;
}
.btn-back:hover { color: var(--text); }

.product-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.product-detail-info { flex: 1; }

.product-detail-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.product-detail-desc {
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.product-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.product-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.product-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
}

.product-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.product-stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-stat--affected .product-stat-value  { color: #f97316; }
.product-stat--ok .product-stat-value        { color: var(--green); }
.product-stat--triage .product-stat-value    { color: var(--blue); }
.product-stat--kev .product-stat-value       { color: var(--red); }

/* ── Severity bar ───────────────────────────────────────────────────── */

.product-severity-bar { margin-bottom: 2rem; }

.sev-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-alt);
  margin-bottom: 0.5rem;
}

.sev-segment { min-width: 2px; }
.sev-segment--critical { background: #dc2626; }
.sev-segment--high     { background: #f97316; }
.sev-segment--medium   { background: #eab308; }
.sev-segment--low      { background: #22c55e; }
.sev-segment--none     { background: var(--border); }

.sev-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.sev-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}
.sev-label--critical { color: #dc2626; }
.sev-label--high     { color: #f97316; }
.sev-label--medium   { color: #eab308; }
.sev-label--low      { color: #22c55e; }

/* ── Product factors display ────────────────────────────────────────── */

.product-factors-section {
  margin-bottom: 2rem;
}
.product-factors-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.factor-group {
  margin-bottom: 0.5rem;
}
.factor-group-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-right: 0.25rem;
}

.factor-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  color: var(--text);
  margin: 0.15rem 0.2rem;
}

/* ── Product CVE detail list ──────────────────────────────────────────── */

.product-cve-section {
  margin-bottom: 2rem;
}
.product-cve-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 1rem;
}
.product-cve-loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 1rem 0;
}

/* Pagination controls */
.cve-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 0;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.cve-page-info {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 8ch;
  text-align: center;
}
.cve-page-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cve-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}
.cve-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.product-detail-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Wizard modal ───────────────────────────────────────────────────── */

.modal--wizard {
  max-width: 640px;
  width: 90vw;
}

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 1.5rem 0 2rem;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.wizard-step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}
.wizard-step small {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.wizard-step.active span {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.wizard-step.active small {
  color: var(--accent);
}
.wizard-step.done span {
  border-color: var(--green);
  color: var(--green);
  background: rgba(16, 185, 129, 0.12);
}

.wizard-step-line {
  width: 28px;
  height: 2px;
  background: var(--border);
  margin: 0 0.15rem;
  margin-bottom: 1.2rem;
}

.wizard-panel {
  min-height: 200px;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Form elements ──────────────────────────────────────────────────── */

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}
.form-label:first-child { margin-top: 0; }

.required { color: var(--red); }

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

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

.form-error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(244, 63, 94, 0.1);
  border-radius: var(--radius-xs);
}

/* ── Review grid ────────────────────────────────────────────────────── */

.review-grid {
  display: grid;
  gap: 0.75rem;
}

.review-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.review-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.review-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

/* ── Security factor checkboxes (wizard) ────────────────────────────── */

.factors-categories {
  max-height: 360px;
  overflow-y: auto;
}

.factor-category {
  margin-bottom: 1rem;
}

.factor-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.factor-category-header h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin: 0;
  color: var(--text);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}
.btn-link:hover { text-decoration: underline; }

.factor-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.factor-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: background 0.15s;
}
.factor-checkbox:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.factor-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
}

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

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--text-dim); }

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.25); }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* ── Delete confirmation modal ──────────────────────────────────────── */

.modal--sm {
  max-width: 420px;
  width: 90vw;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

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

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green);
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1100;
  pointer-events: none;
}
.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Active nav link ────────────────────────────────────────────────── */

.topbar-nav-active {
  color: var(--accent) !important;
  background: var(--accent-glow) !important;
}

.topbar-nav-active svg {
  opacity: 1 !important;
  color: var(--accent);
}

/* ── Responsive: Hero ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }

  .hero-stats {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 48px 20px 36px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-pillars {
    gap: 12px;
  }

  .hero-pillars strong {
    font-size: 0.82rem;
  }

  .hero-pillars p {
    font-size: 0.75rem;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stat-value {
    font-size: 1.4rem;
  }
}


/* ── Featured CVEs: editorial vulnerability wire ─────────────────────────── */

/* Distinct featured section on the homepage — dimmer background, faint
   diagonal grain to break up the flat panel. */
.section--featured {
  background:
    repeating-linear-gradient(
      -18deg,
      rgba(255, 255, 255, 0.008) 0 2px,
      transparent 2px 140px
    ),
    var(--surface-alt);
  padding-top: 64px;
  padding-bottom: 64px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.section--featured::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow-strong);
}

.featured-cves {
  margin: 0;
  padding: 0;
  position: relative;
}

.featured-cves-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-dim);
  margin: 0 0 8px;
  letter-spacing: 0.005em;
}

.featured-cves-eyebrow em {
  font-style: italic;
  color: var(--accent);
}

.featured-cves-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.08;
  margin: 0 0 30px;
  color: var(--text);
  max-width: 22ch;
}

.featured-cves-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  padding: 0 0.08em;
}

.featured-cve-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  background: var(--surface-alt);
  border: 1px solid var(--border);
  /* Borders between cards come from each item; collapse outer overlap. */
  counter-reset: featured;
}

.featured-cve-item {
  position: relative;
  counter-increment: featured;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.18s ease;
  animation: featured-reveal 0.5s cubic-bezier(0.22, 0.71, 0.36, 1) both;
  min-height: 168px;
}

.featured-cve-item:nth-child(1)  { animation-delay: 0.04s; }
.featured-cve-item:nth-child(2)  { animation-delay: 0.08s; }
.featured-cve-item:nth-child(3)  { animation-delay: 0.12s; }
.featured-cve-item:nth-child(4)  { animation-delay: 0.16s; }
.featured-cve-item:nth-child(5)  { animation-delay: 0.20s; }
.featured-cve-item:nth-child(6)  { animation-delay: 0.24s; }
.featured-cve-item:nth-child(7)  { animation-delay: 0.28s; }
.featured-cve-item:nth-child(8)  { animation-delay: 0.32s; }
.featured-cve-item:nth-child(9)  { animation-delay: 0.36s; }

@keyframes featured-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .featured-cve-item { animation: none; }
}

.featured-cve-item:hover {
  background: var(--surface);
  z-index: 1;
}

.featured-cve-item > a {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  padding: 18px 24px 20px 32px;
  height: 100%;
  color: inherit;
  text-decoration: none;
  position: relative;
}

/* Left severity stripe */
.featured-cve-item > a::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 20px;
  left: 20px;
  width: 2px;
  background: var(--border);
  transition: box-shadow 0.25s ease;
}
.featured-cve-item:has(.sev-critical) > a::before { background: var(--red);    box-shadow: 0 0 8px rgba(244,63,94,0.5); }
.featured-cve-item:has(.sev-high)     > a::before { background: #f97316;        box-shadow: 0 0 8px rgba(249,115,22,0.45); }
.featured-cve-item:has(.sev-medium)   > a::before { background: var(--accent);  box-shadow: 0 0 8px var(--accent-glow-strong); }

/* Hover-only arrow ornament — bottom-right so it doesn't compete with the source badge */
.featured-cve-item > a::after {
  content: "↗";
  position: absolute;
  bottom: 16px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0;
  transition: transform 0.22s ease, color 0.22s ease, opacity 0.22s ease;
}
.featured-cve-item:hover > a::after {
  color: var(--accent);
  transform: translate(3px, -3px);
  opacity: 1;
}

/* Source attribution (AI vs NVD) — upper right of each card */
.featured-cve-source {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  border-radius: 2px;
  line-height: 1;
  pointer-events: auto;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.featured-cve-source--ai {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.28);
}
.featured-cve-source--nvd {
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.28);
}
.featured-cve-item:hover .featured-cve-source {
  opacity: 1;
  transform: translateY(-1px);
}

/* Top meta row: severity badge · date */
.featured-cve-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 18px;
}

.featured-cve-item .sev {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  border-radius: 2px;
  line-height: 1;
}
.featured-cve-item .sev-critical { color: var(--red);    background: var(--red-dim); }
.featured-cve-item .sev-high     { color: #f97316;       background: rgba(249,115,22,0.14); }
.featured-cve-item .sev-medium   { color: var(--accent); background: var(--amber-dim); }
.featured-cve-item .sev-low,
.featured-cve-item .sev-none     { color: var(--text-muted); background: rgba(255,255,255,0.04); }

.featured-cve-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Headline row: CVE ID (mono) + CVSS (serif italic) */
.featured-cve-headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.featured-cve-headline strong {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.featured-cve-headline .featured-cve-id {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.featured-cve-headline .score-inline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Summary paragraph — clamped to 3 lines */
.featured-cve-item p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
  align-self: start;
}

/* "Browse full database" footer link — serif+mono mix, not a chunky button */
.featured-cves-more {
  margin: 22px 0 0;
  text-align: right;
}

.featured-cves-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 2px;
  border-bottom: 1px solid var(--accent);
  transition: color 0.2s ease, border-color 0.2s ease, letter-spacing 0.2s ease;
}

.featured-cves-more a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
  letter-spacing: 0.18em;
}

.featured-cves-more a span {
  transition: transform 0.22s ease;
}
.featured-cves-more a:hover span {
  transform: translateX(4px);
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .featured-cves { padding-top: 30px; margin: 20px 0 40px; }
  .featured-cve-list { grid-template-columns: 1fr; }
  .featured-cve-item { border-right: none; min-height: 0; }
  .featured-cve-item > a { padding: 16px 22px 18px 28px; }
  .featured-cve-item > a::before { left: 16px; top: 16px; bottom: 18px; }
  .featured-cve-item > a::after { right: 18px; top: 14px; }
}


/* ── SSR page shell (/cve/:id, /showcase/:slug/:arch) ─────────────────────── */

.ssr-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 28px 96px;
}

.ssr-page .breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ssr-page .breadcrumb a {
  color: var(--text-dim);
  transition: color 0.15s ease;
}
.ssr-page .breadcrumb a:hover { color: var(--accent); }
.ssr-page .breadcrumb span[aria-hidden] { color: var(--border-hover); font-size: 0.8rem; }
.ssr-page .breadcrumb span:not([aria-hidden]) { color: var(--text); }


/* ── CVE detail page ──────────────────────────────────────────────────────── */

.cve-detail {
  --sev-color: var(--text-dim);
  --sev-glow: rgba(255, 255, 255, 0.08);
}
.cve-detail.sev-critical { --sev-color: var(--red);    --sev-glow: rgba(244,63,94,0.35); }
.cve-detail.sev-high     { --sev-color: #f97316;        --sev-glow: rgba(249,115,22,0.35); }
.cve-detail.sev-medium   { --sev-color: var(--accent);  --sev-glow: var(--accent-glow-strong); }
.cve-detail.sev-low      { --sev-color: #22c55e;        --sev-glow: rgba(34,197,94,0.30); }

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

.cve-header {
  position: relative;
  margin: 0 0 48px;
  padding: 0 0 30px;
}

.cve-header-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  flex-wrap: wrap;
  font-size: 0.7rem;
}

.cve-header-eyebrow .sev {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px 3px;
  border-radius: 2px;
  line-height: 1;
}
.cve-header-eyebrow .sev-critical { color: var(--red);    background: var(--red-dim); }
.cve-header-eyebrow .sev-high     { color: #f97316;       background: rgba(249,115,22,0.14); }
.cve-header-eyebrow .sev-medium   { color: var(--accent); background: var(--amber-dim); }
.cve-header-eyebrow .sev-low      { color: #22c55e;       background: rgba(34,197,94,0.12); }

.cve-kev-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px 3px;
  color: var(--red);
  background: var(--red-dim);
  border-radius: 2px;
  line-height: 1;
}
.cve-kev-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: kev-pulse 1.6s ease-in-out infinite;
}
@keyframes kev-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.cve-header-date {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-left: auto;
}
.cve-header-date strong {
  color: var(--text-dim);
  font-weight: 500;
}

.cve-header-id {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin: 0 0 18px;
  color: var(--text);
  word-break: break-word;
}

.cve-header-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6.4vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 10px;
  color: var(--text);
  word-break: break-word;
}
.cve-header-id-sub {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.cve-header-id-sub code {
  background: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.cve-header-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.cve-header-score-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  transform: translateY(-6px);
}
.cve-header-score-value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  color: var(--sev-color);
  line-height: 1;
  text-shadow: 0 0 18px var(--sev-glow);
  letter-spacing: -0.02em;
}
.cve-header-score-max {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Source chip (AI / NVD) — same palette as the modal + featured cards */
.cve-source-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 8px 2px;
  border-radius: 2px;
  line-height: 1;
  align-self: center;
  transform: translateY(-6px);
}
.cve-source-chip em {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  text-transform: none;
  vertical-align: baseline;
}
.cve-source-chip--ai {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.28);
}
.cve-source-chip--nvd {
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.28);
}

/* Effective CVSS vector, right under the score */
.cve-header-vector {
  margin: 0 0 14px;
  font-size: 0.72rem;
  word-break: break-all;
  max-width: 70ch;
}
.cve-header-vector code {
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: transparent;
  padding: 0;
}

/* Alt-source row: shown when both NVD + AI exist so the delta is visible */
.cve-header-alt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}
.cve-header-alt-label {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.54rem;
  padding: 3px 7px 2px;
  border-radius: 2px;
  line-height: 1;
}
.cve-header-alt-score {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cve-header-alt .sev {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  border-radius: 2px;
  line-height: 1;
}
.cve-header-alt .sev-critical { color: var(--red);    background: var(--red-dim); }
.cve-header-alt .sev-high     { color: #f97316;       background: rgba(249,115,22,0.14); }
.cve-header-alt .sev-medium   { color: var(--accent); background: var(--amber-dim); }

.cve-header-stripe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--sev-color) 0%,
    var(--sev-color) 35%,
    var(--border) 35%,
    var(--border) 100%);
  box-shadow: 0 0 14px var(--sev-glow);
}

/* ── Numbered section heading ────────────────────────────────────────────── */

.cve-section {
  margin: 0 0 48px;
}

.cve-section-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  font-weight: normal;
}

.cve-section-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.85;
}

.cve-section-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.cve-section-label em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* ── Description ─────────────────────────────────────────────────────────── */

.cve-description-body p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--text);
  white-space: pre-wrap;
  max-width: 68ch;
}

/* ── Scoring panels ──────────────────────────────────────────────────────── */

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.score-panel {
  background: var(--surface-alt);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  grid-column-gap: 14px;
  grid-row-gap: 4px;
  align-items: baseline;
}

.score-panel-source {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.score-panel-source em {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--accent);
}

.score-panel-value {
  grid-row: 2;
  grid-column: 1;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 3rem;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.025em;
}

.score-panel--ai .score-panel-value {
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.score-panel-sev {
  grid-row: 2;
  grid-column: 2;
  margin: 0;
  align-self: end;
}
.score-panel-sev .sev {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  border-radius: 2px;
}
.score-panel-sev .sev-critical { color: var(--red);    background: var(--red-dim); }
.score-panel-sev .sev-high     { color: #f97316;       background: rgba(249,115,22,0.14); }
.score-panel-sev .sev-medium   { color: var(--accent); background: var(--amber-dim); }

.score-panel-vector {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  font-size: 0.68rem;
  word-break: break-all;
}
.score-panel-vector code {
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: transparent;
  padding: 0;
}

/* ── AI analysis block ────────────────────────────────────────────────────── */

.cve-ai-body {
  padding: 26px 28px 28px;
  background: linear-gradient(
    180deg,
    rgba(245, 158, 11, 0.04) 0%,
    rgba(245, 158, 11, 0.015) 100%
  );
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.cve-ai-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow-strong);
}

.cve-ai-header {
  margin: 0 0 16px;
}
.cve-ai-engine {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 8px;
  border: 1px solid var(--accent-dim);
  border-radius: 2px;
  background: var(--amber-dim);
}

.cve-ai-risk {
  margin: 0 0 20px;
  padding: 0 0 18px;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.2);
}
.cve-ai-risk-label {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.cve-ai-risk-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.68;
  color: var(--text);
  letter-spacing: 0;
  max-width: 68ch;
  white-space: pre-wrap;
}

.cve-ai-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.cve-ai-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.cve-ai-chip-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cve-ai-chip-value {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text);
}
.cve-ai-chip-value code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: transparent;
  padding: 0;
}

.cve-ai-analysis h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.005em;
}
.cve-ai-analysis p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.72;
  color: var(--text);
  white-space: pre-wrap;
  max-width: 68ch;
}

/* ── Fix versions table ──────────────────────────────────────────────────── */

.fix-table-wrap {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-alt);
}

.fix-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.fix-table thead th {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.fix-table tbody tr {
  transition: background 0.1s ease;
}
.fix-table tbody tr:hover { background: var(--surface); }
.fix-table tbody tr + tr td { border-top: 1px solid var(--border); }

.fix-table td {
  padding: 11px 18px;
  vertical-align: baseline;
  font-size: 0.8rem;
}

.fix-table .fix-branch {
  color: var(--accent);
  font-weight: 600;
  width: 120px;
}
.fix-table .fix-version {
  color: var(--text);
}
.fix-table .fix-commit {
  width: 170px;
  text-align: right;
}
.fix-table .fix-commit-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}
.fix-table .fix-commit-link code {
  color: inherit;
  font-size: 0.75rem;
  background: transparent;
  padding: 0;
}
.fix-table .fix-commit-link:hover { color: var(--accent); }
.fix-table .fix-commit-arrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.18s ease, color 0.18s ease;
}
.fix-table .fix-commit-link:hover .fix-commit-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}
.fix-table .fix-commit-empty { color: var(--text-muted); }

/* ── References list ─────────────────────────────────────────────────────── */

.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-alt);
}

.ref-list li + li a { border-top: 1px solid var(--border); }

.ref-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.ref-list a:hover {
  background: var(--surface);
  color: var(--accent);
}

.ref-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}
.ref-list a:hover .ref-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.ref-url {
  word-break: break-all;
}

/* ── Teaser (non-qualifying CVE) ─────────────────────────────────────────── */

.cve-teaser {
  max-width: 560px;
  margin: 60px auto;
  padding: 60px 48px 54px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  position: relative;
}
.cve-teaser::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow-strong);
}
.cve-teaser-eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-dim);
}
.cve-teaser-eyebrow em {
  color: var(--accent);
  font-style: italic;
}
.cve-teaser h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}
.cve-teaser-body {
  margin: 0 0 28px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-dim);
}
.cve-teaser-cta a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 8px 0;
  transition: color 0.18s ease, letter-spacing 0.22s ease;
}
.cve-teaser-cta a:hover {
  color: var(--accent-hover);
  letter-spacing: 0.2em;
}
.cve-teaser-cta a span {
  transition: transform 0.22s ease;
}
.cve-teaser-cta a:hover span { transform: translateX(4px); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .ssr-page { padding: 24px 18px 72px; }
  .cve-section { margin-bottom: 36px; }
  .cve-header-eyebrow { gap: 8px; font-size: 0.68rem; }
  .cve-header-date { margin-left: 0; width: 100%; order: 99; }
  .cve-ai-body { padding: 20px 20px 22px; }
  .fix-table td, .fix-table th { padding: 10px 12px; }
  .fix-table .fix-commit { width: auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Docs page (/docs)
   ═══════════════════════════════════════════════════════════════════════════ */

.docs-hero {
  padding: 72px 40px 32px;
  border-bottom: 1px solid var(--border);
}
.docs-hero-inner {
  max-width: var(--page-max);
  margin: 0 auto;
}
.docs-hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.05;
  color: #fafafa;
  letter-spacing: -0.02em;
  margin: 14px 0 14px;
}
.docs-hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 760px;
  font-weight: 300;
}
.docs-hero-sub em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.docs-section { padding-top: 40px; padding-bottom: 96px; }

.docs-tabs-wrap {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.docs-tabs {
  position: sticky;
  top: 64px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.docs-tab {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.docs-tab:hover {
  color: var(--text);
  background: var(--surface);
}
.docs-tab.is-active {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--border-hover);
}
.docs-tab-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.8;
}
.docs-tab.is-active .docs-tab-num { color: var(--accent); opacity: 1; }
.docs-tab-label { font-weight: 500; }

.docs-panel { display: none; }
.docs-panel.is-active { display: block; animation: docs-panel-in 0.2s ease; }
@keyframes docs-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  align-items: start;
}

.docs-toc {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 4px 0;
}
.docs-toc-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.docs-toc nav {
  display: flex;
  flex-direction: column;
}
.docs-toc nav a {
  display: block;
  padding: 7px 12px;
  font-size: 0.88rem;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.docs-toc nav a:hover {
  color: var(--text);
  border-left-color: var(--border-hover);
  background: var(--surface);
}
.docs-toc nav a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.docs-article {
  min-width: 0;
  max-width: 920px;
  width: 100%;
}
.docs-article > .docs-block + .docs-block,
.docs-panel > .docs-block + .docs-block {
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
}
.docs-block { scroll-margin-top: 88px; }

.docs-article h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: #fafafa;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.docs-article h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: #fafafa;
  margin: 32px 0 12px;
}
.docs-article p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
  font-weight: 300;
}
.docs-article p em {
  font-family: var(--font-serif);
  font-style: italic;
  color: #fafafa;
  font-weight: 400;
}
.docs-article p strong { font-weight: 600; color: #fafafa; }

.docs-article ul,
.docs-article ol {
  margin: 8px 0 18px 22px;
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
}
.docs-article li { margin-bottom: 7px; }
.docs-article li strong { font-weight: 600; color: #fafafa; }

.docs-callout {
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--amber-dim);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 300;
}
.docs-callout strong { color: var(--accent); font-weight: 600; }
.docs-callout a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.docs-mute { color: var(--text-muted); font-size: 0.82em; }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.docs-table thead {
  background: var(--surface-alt);
}
.docs-table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.docs-table td {
  padding: 12px 14px;
  vertical-align: top;
  color: var(--text);
  font-weight: 300;
  border-bottom: 1px solid var(--border);
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table td strong { color: #fafafa; font-weight: 600; }

.docs-code {
  display: block;
  margin: 14px 0 22px;
  padding: 16px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
}
.docs-code code {
  font-family: var(--font-mono);
  font-size: inherit;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0;
  white-space: pre;
}

.docs-faq {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.docs-faq[open] { border-color: var(--border-hover); }
.docs-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fafafa;
  position: relative;
  padding-right: 44px;
  transition: background 0.15s ease;
}
.docs-faq summary::-webkit-details-marker { display: none; }
.docs-faq summary:hover { background: var(--surface-alt); }
.docs-faq summary code {
  font-size: 0.85em;
}
.docs-faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  transition: transform 0.18s ease;
}
.docs-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.docs-faq p {
  padding: 0 18px 18px;
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-dim);
}

.docs-faq p a { text-decoration: underline; text-underline-offset: 3px; }
.docs-article a:not(.docs-faq a) { text-decoration: underline; text-underline-offset: 3px; }


/* ════════════════════════════════════════════════════════════════════════
   iPhone responsive support — public-facing pages only.
   Layered below desktop styles; desktop layout is unchanged above 900px.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop, shown ≤640px) ─────────────────── */

.topbar-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 4px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  flex-direction: column;
  gap: 4px;
}

.topbar-burger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.topbar.is-open .topbar-burger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.topbar.is-open .topbar-burger-bar:nth-child(2) {
  opacity: 0;
}
.topbar.is-open .topbar-burger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Lock body scroll while the mobile menu is open */
body.topbar-menu-open {
  overflow: hidden;
}

/* ── ≤900px: stack two-column grids and reduce pillar density ──────────── */

@media (max-width: 900px) {
  .analyze-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analyze-card {
    padding: 28px;
  }

  .stats-strip-inner {
    flex-wrap: wrap;
    gap: 16px 0;
  }
  .stats-divider { display: none; }
  .stats-item { flex: 1 1 40%; padding: 12px 8px; }
}

/* ── ≤640px: hamburger menu, single-column layouts, table card stack ──── */

@media (max-width: 640px) {

  /* Topbar: show hamburger, collapse nav and right cluster into a panel */
  .topbar-burger {
    display: flex;
  }

  .topbar-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .topbar-brand span { font-size: 1rem; }

  /* Hide the desktop nav cluster and right cluster by default on mobile */
  .topbar .topbar-nav,
  .topbar .topbar-right {
    display: none;
  }

  /* When open, expand the topbar into a stacked drawer using flex-wrap */
  .topbar.is-open .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    align-items: stretch;
    padding-top: 0;
    padding-bottom: 12px;
    row-gap: 0;
  }

  /* Brand + burger sit on row 1 at fixed 56px header height.
     Use flex order to keep them ahead of the wrapping nav/right rows. */
  .topbar.is-open .topbar-brand {
    align-self: center;
    height: 56px;
    order: -2;
  }
  .topbar.is-open .topbar-burger {
    align-self: center;
    height: 40px;
    order: -1;
    margin-left: auto;
  }

  /* Nav and right cluster each become full-width rows below the header */
  .topbar.is-open .topbar-nav,
  .topbar.is-open .topbar-right {
    display: flex;
    flex: 1 0 100%;
    position: static;
    left: auto;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
  }
  .topbar.is-open .topbar-right {
    padding-top: 12px;
  }

  /* Hide the small account icon-button in the mobile panel — the nav covers it */
  .topbar.is-open .topbar-account-btn,
  .topbar.is-open .topbar-separator {
    display: none;
  }

  .topbar.is-open .topbar-nav-link {
    padding: 12px 14px;
    font-size: 0.95rem;
    border-radius: var(--radius-xs);
  }

  .topbar.is-open .btn-signin,
  .topbar.is-open .btn-register,
  .topbar.is-open .btn-signout,
  .topbar.is-open .topbar-account-link {
    width: 100%;
    text-align: center;
    padding: 12px 18px;
    font-size: 0.95rem;
  }

  .topbar.is-open .topbar-user {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Hero scaling */
  .hero {
    padding: 56px 16px 32px;
  }
  .hero-headline {
    font-size: 1.9rem;
    margin-bottom: 16px;
  }
  .hero-sub {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hero-btn-primary,
  .hero-btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  .hero-eyebrow {
    margin-bottom: 18px;
    font-size: 0.62rem;
  }
  .hero::after { width: 360px; height: 220px; }

  /* Stats strip: two columns */
  .stats-strip { padding: 0 16px; }
  .stats-strip-inner {
    padding: 18px 0;
  }
  .stats-item { flex: 1 1 45%; padding: 8px 4px; }
  .stats-value { font-size: 1.5rem; }
  .stats-label { font-size: 0.55rem; }

  /* Sections and pillars */
  .section {
    padding: 36px 16px;
  }
  .section-title { font-size: 1.25rem; }
  .pillars-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pillar-card { padding: 24px 20px; }

  /* Analyze upload card */
  .analyze-card { padding: 20px; }

  /* Modals: full-width on phone, tighter padding */
  .modal {
    width: calc(100% - 16px);
    max-width: 100%;
    max-height: calc(100vh - 32px);
  }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ── CVE table → card stack ────────────────────────────────────────── */
  .cve-table-wrap {
    overflow-x: visible;
  }
  .cve-table thead { display: none; }
  .cve-table,
  .cve-table tbody,
  .cve-table tbody tr,
  .cve-table tbody td {
    display: block;
    width: 100%;
  }
  .cve-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 14px 12px;
    margin-bottom: 10px;
  }
  .cve-table tbody td {
    padding: 4px 0;
    border: none;
    color: var(--text-dim);
    font-size: 0.85rem;
  }
  /* CVE ID = card heading */
  .cve-table tbody td:nth-child(1) {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 4px;
  }
  /* Severity badge inline at top */
  .cve-table tbody td:nth-child(2) {
    margin-bottom: 8px;
  }
  /* Description gets full width without ellipsis */
  .cve-table tbody td.desc-cell {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin: 8px 0;
    line-height: 1.5;
  }
  /* Add labels for CVSS / Introduced / Published */
  .cve-table tbody td:nth-child(3)::before {
    content: "CVSS: ";
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-right: 6px;
  }
  .cve-table tbody td:nth-child(5)::before {
    content: "Introduced: ";
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-right: 6px;
  }
  .cve-table tbody td:nth-child(6)::before {
    content: "Published: ";
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-right: 6px;
  }
  /* Empty-state row uses colspan=6 — keep it as a single block */
  .cve-table tbody td[colspan] {
    text-align: center;
    padding: 24px 0;
  }
  .cve-table tbody td[colspan]::before { content: none; }

  /* ── Plan-compare table → card stack ──────────────────────────────── */
  .plan-compare-table-wrap { overflow-x: visible; }
  .plan-compare-table thead { display: none; }
  .plan-compare-table,
  .plan-compare-table tbody,
  .plan-compare-table tbody tr,
  .plan-compare-table tbody td {
    display: block;
    width: 100%;
  }
  .plan-compare-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .plan-compare-table tbody td {
    padding: 4px 0;
    text-align: left;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
  }
  .plan-compare-table tbody td:first-child {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .plan-compare-table tbody td:nth-child(2)::before { content: "Free"; }
  .plan-compare-table tbody td:nth-child(3)::before { content: "Basic"; }
  .plan-compare-table tbody td:nth-child(4)::before { content: "Pro"; }
  .plan-compare-table tbody td:nth-child(5)::before { content: "Enterprise"; }
  .plan-compare-table tbody td:nth-child(n+2)::before {
    display: inline-block;
    min-width: 96px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-right: 8px;
  }
  /* Featured Pro column: subtle highlight on its row chip only */
  .plan-compare-table tbody td.featured-col {
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: var(--radius-xs);
    padding: 6px 8px;
    margin: 2px 0;
  }
  .plan-compare-table tbody td.featured-col::before {
    color: var(--accent);
  }

  /* CVE pagination wraps tighter */
  .cve-pagination { gap: 10px; }

  /* Featured-cves and other landing grids: tighter gaps */
  .featured-cves-eyebrow { font-size: 0.9rem; }
  .featured-cves-title { font-size: 1.4rem; }

  /* Docs hero */
  .docs-hero { padding: 48px 16px 32px; }

  /* Docs tabs: 2-column grid so all six are reachable, drop sticky */
  .docs-tabs-wrap { gap: 28px; }
  .docs-tabs {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
  }
  .docs-tab {
    flex: none;
    padding: 11px 12px;
    font-size: 0.88rem;
    justify-content: flex-start;
    gap: 8px;
  }
  .docs-tab-num { font-size: 0.68rem; }
  .docs-article { max-width: 100%; }
}

/* ── ≤430px: tightest iPhone (SE 375, 12/13/14 390, Pro Max 428) ──────── */

@media (max-width: 430px) {
  .topbar-inner { padding: 0 12px; }
  .topbar-brand span { font-size: 0.95rem; }

  .hero { padding: 44px 12px 28px; }
  .hero-headline { font-size: 1.65rem; }
  .hero-sub { font-size: 0.9rem; }

  .section { padding: 32px 12px; }
  .stats-strip { padding: 0 12px; }
  .stats-value { font-size: 1.3rem; }

  .analyze-card { padding: 16px; }
  .pillar-card { padding: 20px 16px; }

  .cve-table tbody tr,
  .plan-compare-table tbody tr {
    padding: 12px;
  }

  .modal { width: calc(100% - 12px); }
  .modal-header { padding: 12px 14px; }
  .modal-body { padding: 14px; }
}

/* Suppress the burger animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .topbar-burger-bar { transition: none; }
}

