/* ─── Custom Properties ─────────────────────────────────────────── */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;

  --color-bg: #ffffff;
  --color-bg-subtle: #f9fafb;
  --color-bg-muted: #f3f4f6;
  --color-bg-overlay: rgba(255, 255, 255, 0.8);

  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-text-inverse: #ffffff;

  --color-border: #e5e7eb;
  --color-border-subtle: #f3f4f6;

  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-subtle: #eef2ff;

  --color-success: #059669;
  --color-warning: #d97706;
  --color-error: #dc2626;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  --max-width: 48rem;
  --max-width-narrow: 36rem;
  --max-width-wide: 64rem;

  /* Tap target minimum (WCAG 2.5.8) */
  --tap-min: 44px;
}

/* ─── Base ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Prevent font-size inflation on mobile landscape */
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Fluid base font size: 15px at 320px, 16px at 768px+ */
  font-size: clamp(0.9375rem, 0.875rem + 0.2vw, 1rem);
  line-height: 1.5;
  /* Prevent overscroll bounce revealing background */
  overscroll-behavior-y: none;
}

#app {
  min-height: 100vh;
  /* Prevent horizontal overflow on mobile */
  overflow-x: hidden;
}

/* ─── Page Container ────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  width: 100%;
  flex: 1;
}

.page-content--narrow {
  max-width: var(--max-width-narrow);
}

.page-content--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-md);
}

.page-title {
  /* Fluid heading: 1.25rem at 320px, 1.5rem at 768px */
  font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xl) 0;
}

/* ─── Site Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-header__logo {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: color var(--transition-fast);
  /* Ensure tap target */
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}

.site-header__logo:hover {
  color: var(--color-text);
}

/* ─── Search Bar ────────────────────────────────────────────────── */
.search-bar {
  width: 100%;
  display: flex;
}

.search-bar__input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: 1.125rem;
  font-family: var(--font-sans);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  outline: none;
  color: var(--color-text);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
  /* Prevent zoom on focus on iOS (font-size >= 16px) */
  min-height: var(--tap-min);
}

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

.search-bar__input:focus {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(79, 70, 229, 0.15);
  transform: scale(1.01);
}

.search-bar--compact .search-bar__input {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9375rem;
  border-radius: var(--radius-lg);
}

.search-bar--compact .search-bar__input:focus {
  transform: none;
}

/* ─── View Toggles ──────────────────────────────────────────────── */
.view-toggles {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.view-toggles::-webkit-scrollbar {
  display: none;
}

.view-toggles__pill {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: 1px solid transparent;
  scroll-snap-align: start;
  /* Ensure tap target */
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}

.view-toggles__pill:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}

.view-toggles__pill--active {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-color: var(--color-accent);
}

.view-toggles__pill--active:hover {
  background: var(--color-accent-hover);
  color: var(--color-text-inverse);
}

/* ─── Home Hero ─────────────────────────────────────────────────── */
.page--home {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  width: 100%;
  max-width: 40rem;
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
}

.home-hero__search {
  width: 100%;
}

.home-hero__brand {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  user-select: none;
}

/* ─── Stats Line ────────────────────────────────────────────────── */
.stats-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.stats-line span {
  font-variant-numeric: tabular-nums;
}

.stats-line__sep {
  color: var(--color-border);
}

/* ─── Entity Cards ─────────────────────────────────────────────── */
.entity-cards {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 var(--space-md);
  margin-top: var(--space-xl);
}

.entity-cards__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.entity-card {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  display: block;
}

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

.entity-card__name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
}

.entity-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  display: block;
}

.entity-card--skeleton {
  pointer-events: none;
}

.entity-card--skeleton .skeleton {
  display: block;
  height: 1rem;
  width: 60%;
  margin-bottom: var(--space-xs);
}

.entity-card--skeleton .skeleton + .skeleton {
  height: 0.75rem;
  width: 40%;
  margin-bottom: 0;
}

/* ─── Ticker ────────────────────────────────────────────────────── */
.ticker {
  width: 100%;
  max-width: var(--max-width);
  padding: var(--space-sm) var(--space-md);
  overflow: hidden;
  position: relative;
}

.ticker__track {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
}

.ticker__item {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0 var(--space-xl);
}

.ticker__item::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-border);
  margin-right: var(--space-sm);
  vertical-align: middle;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}



/* ─── Graph Badge ───────────────────────────────────────────────── */
.graph-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 0.625rem;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  border: 1px solid currentColor;
  background: transparent;
  color: var(--color-text-muted);
}

.graph-badge--web { color: #1e40af; border-color: #93c5fd; }
.graph-badge--citation { color: #9d174d; border-color: #f9a8d4; }
.graph-badge--patent { color: #065f46; border-color: #6ee7b7; }
.graph-badge--social { color: #5b21b6; border-color: #c4b5fd; }
.graph-badge--news { color: #991b1b; border-color: #fca5a5; }
.graph-badge--code { color: #3730a3; border-color: #a5b4fc; }
.graph-badge--financial { color: #92400e; border-color: #fcd34d; }
.graph-badge--gov { color: #374151; border-color: #d1d5db; }
.graph-badge--government { color: #374151; border-color: #d1d5db; }
.graph-badge--medical { color: #134e4a; border-color: #5eead4; }
.graph-badge--dependency { color: #3730a3; border-color: #a5b4fc; }
.graph-badge--infra { color: #92400e; border-color: #fcd34d; }
.graph-badge--ownership { color: #5b21b6; border-color: #c4b5fd; }
.graph-badge--temporal { color: #831843; border-color: #f9a8d4; }
.graph-badge--conversational { color: #115e59; border-color: #5eead4; }



/* ─── Search Content ────────────────────────────────────────────── */
.search-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  width: 100%;
  flex: 1;
}

/* ─── Overview Hero ─────────────────────────────────────────────── */
.overview-hero {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-subtle);
}

.overview-hero__text {
  /* Fluid heading: 1.25rem at 320px, 2rem at 1024px */
  font-size: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--color-text);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  max-width: 40rem;
}

/* ─── Answer Section (restructured overview answer) ────────────── */
.answer-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-subtle);
}

.answer-section__summary {
  font-size: clamp(1.25rem, 1rem + 1.5vw, 1.75rem);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--color-text);
  font-family: Georgia, 'Times New Roman', serif;
  max-width: 40rem;
  margin: 0 0 var(--space-md) 0;
}

.answer-section__details {
  max-width: 40rem;
}

.answer-section__details p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-sm) 0;
}

.answer-section__details p:last-child {
  margin-bottom: 0;
}

/* ─── Section Label ─────────────────────────────────────────────── */
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: var(--space-md);
  margin-top: 0;
}

/* ─── Key Facts ─────────────────────────────────────────────────── */
.key-facts {
  margin-bottom: var(--space-xl);
}

.key-fact {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-sm);
  transition: box-shadow var(--transition-base);
}

.key-fact:hover {
  box-shadow: var(--shadow-sm);
}

.key-fact:last-child {
  margin-bottom: 0;
}

.key-fact__body {
  flex: 1;
  min-width: 0;
}

.key-fact__text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text);
  display: block;
  margin-bottom: var(--space-xs);
}

.key-fact__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.key-fact__challenge {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  font-family: var(--font-sans);
  padding: var(--space-xs);
  /* Tap target for mobile */
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}

.key-fact__challenge:hover {
  color: var(--color-warning);
  text-decoration: underline;
}

.corroboration {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-success);
}

.corroboration__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
}

/* ─── Source Pill ────────────────────────────────────────────────── */
.source-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  min-height: 2rem;
}

a.source-pill:hover {
  background: var(--color-accent-subtle);
  color: var(--color-text);
}

/* ─── Cross-Graph Signals ───────────────────────────────────────── */
.cross-signals {
  margin-bottom: var(--space-xl);
}

.cross-signals__grid {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: var(--space-xs);
}

.cross-signals__grid::-webkit-scrollbar {
  display: none;
}

.signal-card {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
  /* Horizontal scroll card sizing */
  min-width: 16rem;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.signal-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-border);
}

.signal-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.signal-card__body {
  flex: 1;
  min-width: 0;
}

.signal-card__body p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0;
}

.signal-card__graphs {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

/* ─── Sources List ──────────────────────────────────────────────── */
.sources {
  margin-bottom: var(--space-xl);
}

.sources__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ─── Sources Group (collapsible) ──────────────────────────────── */
.sources-group {
  margin-bottom: var(--space-sm);
}

.sources-group__label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xs);
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  min-height: var(--tap-min);
  user-select: none;
  -webkit-user-select: none;
}

.sources-group__toggle {
  font-size: 0.625rem;
  transition: transform var(--transition-fast);
  display: inline-block;
}

.sources-group--collapsed .sources-group__toggle {
  transform: rotate(-90deg);
}

.sources-group__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs) 0 var(--space-sm) var(--space-lg);
}

.sources-group--collapsed .sources-group__items {
  display: none;
}

/* On mobile, sources collapsed by default — handled via JS class */

/* ─── Sources Grid (card layout) ───────────────────────────────── */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}

/* ─── Source Card ───────────────────────────────────────────────── */
.source-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

a.source-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent);
}

.source-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.source-card__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card__detail {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card__type {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.source-card__type--primary {
  background: rgba(52, 211, 153, 0.15);
  color: #059669;
}

.source-card__type--secondary {
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
}

/* ─── Gaps ──────────────────────────────────────────────────────── */
.gaps {
  margin-bottom: var(--space-xl);
}

.gaps__item {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 var(--space-xs) 0;
  padding-left: var(--space-md);
  border-left: 2px solid var(--color-border);
}

.gaps__progress {
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent) 0%, transparent 60%);
  margin-bottom: var(--space-xs);
  border-radius: var(--radius-full);
}

/* ─── Knowledge Debt ────────────────────────────────────────────── */
.knowledge-debt {
  display: block;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.knowledge-debt__score-display {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.knowledge-debt__score-number {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.knowledge-debt__score-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.knowledge-debt__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.knowledge-debt__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.knowledge-debt__badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.knowledge-debt__badge--strong {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.knowledge-debt__badge--moderate {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.knowledge-debt__badge--limited {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.knowledge-debt__badge--early {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.knowledge-debt__bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.knowledge-debt__bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 4rem;
}

.knowledge-debt__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  background: var(--color-accent);
}

.knowledge-debt__fill--strong {
  background: #34d399;
}

.knowledge-debt__fill--moderate {
  background: #fbbf24;
}

.knowledge-debt__fill--limited {
  background: #ef4444;
}

.knowledge-debt__fill--early {
  background: #94a3b8;
}

.knowledge-debt__score {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
}

.knowledge-debt__factors {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.knowledge-debt__factor {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.knowledge-debt__message {
  margin: var(--space-md) 0 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-subtle);
}

/* ─── Meta Info ─────────────────────────────────────────────────── */
.meta-info {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  padding: var(--space-sm) 0;
}

/* ─── Related ───────────────────────────────────────────────────── */
.related {
  margin-bottom: var(--space-xl);
}

.related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.related-card {
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  min-height: 3rem;
  display: flex;
  text-decoration: none;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
  cursor: pointer;
}

.related-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-border);
}

.related-card__insight {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
}

.related-card__graphs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* ─── Rabbit Hole Links ────────────────────────────────────────── */
.rabbit-hole {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.rabbit-hole:hover {
  border-bottom-color: var(--color-accent);
  color: var(--color-accent-hover);
}

a.match-card__name.rabbit-hole {
  display: block;
}

/* ─── Reality Check ────────────────────────────────────────────── */
.reality-check {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.reality-check__desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-md) 0;
}

.reality-check__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.reality-check__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.reality-check__icon {
  flex-shrink: 0;
}

/* ─── Action Bar ────────────────────────────────────────────────── */
.action-bar {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  justify-content: center;
  border-top: 1px solid var(--color-border-subtle);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  /* Fixed bottom on mobile */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: none;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 40;
  /* Safe area for devices with home indicator */
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
}

.action-bar__btn {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}

.action-bar__btn:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}

/* Padding at bottom of search page to account for fixed action bar */
.page--search {
  padding-bottom: calc(var(--tap-min) + var(--space-xl) + env(safe-area-inset-bottom, 0px));
}

/* ─── View Header (shared across all views) ────────────────────── */
.view-header {
  margin-bottom: var(--space-xl);
}

.view-header__title {
  font-size: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
  letter-spacing: -0.02em;
  color: var(--color-text);
  /* Prevent long queries from overflowing */
  overflow-wrap: break-word;
  word-break: break-word;
}

.view-header__subtitle {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ─── View Section (shared) ────────────────────────────────────── */
.view-section {
  margin-bottom: var(--space-xl);
}

.view-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md) 0;
}

/* ─── Data Building Indicator ──────────────────────────────────── */
.data-building {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.5;
}

.data-building__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text-muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ─── Methodology Note ─────────────────────────────────────────── */
.methodology-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-xl);
}

/* ─── Match Card ───────────────────────────────────────────────── */
.match-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition-fast);
}

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

.match-card--placeholder {
  opacity: 0.6;
  border-style: dashed;
}

.match-card__score {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.match-card__body {
  flex: 1;
  min-width: 0;
}

.match-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-xs) 0;
  overflow-wrap: break-word;
}

.match-card__desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ─── Confidence Dots ──────────────────────────────────────────── */
.confidence-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-bg-muted);
  margin-right: 2px;
}

.confidence-dot--filled {
  background: var(--color-accent);
}

/* ─── Confidence Meter ─────────────────────────────────────────── */
.confidence-meter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.confidence-meter__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.confidence-meter__bar {
  flex: 1;
  height: 4px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 4rem;
}

.confidence-meter__fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.confidence-meter__value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
}

/* ─── View: Trace ──────────────────────────────────────────────── */
.trace-view {
  width: 100%;
}

.trace-legend {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.trace-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.trace-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.trace-legend__dot--center { background: var(--color-accent); }
.trace-legend__dot--entity { background: var(--color-success); }
.trace-legend__dot--placeholder { background: var(--color-bg-muted); border: 1px dashed var(--color-border); }

.trace-canvas {
  position: relative;
  width: 100%;
  /* Responsive canvas: smaller on mobile */
  height: 280px;
  margin: var(--space-lg) 0;
  overflow: hidden;
}

.trace-ring {
  position: absolute;
  border: 1px dashed var(--color-border);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.trace-ring--1 { width: 180px; height: 180px; }
.trace-ring--2 { width: 260px; height: 260px; opacity: 0.5; }
.trace-ring--3 { width: 340px; height: 340px; opacity: 0.3; display: none; }

.trace-node {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  white-space: nowrap;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trace-node--center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  font-weight: 600;
  z-index: 2;
  max-width: 8rem;
}

.trace-node--entity {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.trace-node--placeholder {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  font-style: italic;
}

/* ─── View: Timeline ───────────────────────────────────────────── */
.timeline-view {
  width: 100%;
}

.timeline-meta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.timeline-meta__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.timeline-meta__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.timeline-meta__value {
  font-size: 0.875rem;
  color: var(--color-text);
  font-weight: 500;
}

.timeline-rail {
  position: relative;
  padding-left: var(--space-xl);
  border-left: 2px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.timeline-event {
  position: relative;
  padding: var(--space-sm) 0 var(--space-lg) var(--space-md);
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-xl) - 5px);
  top: var(--space-sm);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
}

.timeline-dot--placeholder {
  background: var(--color-bg-muted);
  border-color: var(--color-border);
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.timeline-event__desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.timeline-event__source {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ─── View: Drift ──────────────────────────────────────────────── */
.drift-view {
  width: 100%;
}

.drift-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.drift-arrow {
  font-size: 2rem;
  line-height: 1;
}

.drift-arrow--up { color: var(--color-success); }
.drift-arrow--down { color: var(--color-error); }
.drift-arrow--neutral { color: var(--color-text-muted); }

.drift-indicator__text {
  flex: 1;
  min-width: 0;
}

.drift-indicator__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.drift-indicator__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.drift-chart {
  margin-bottom: var(--space-xl);
}

.drift-chart__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.drift-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  padding: var(--space-sm) 0;
}

.drift-chart__bar {
  flex: 1;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-width: 4px;
  transition: height var(--transition-slow);
}

.drift-chart__bar--positive { background: var(--color-success); opacity: 0.7; }
.drift-chart__bar--negative { background: var(--color-error); opacity: 0.7; }
.drift-chart__bar--neutral { background: var(--color-text-muted); opacity: 0.3; }

.drift-chart__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding-top: var(--space-xs);
}

.drift-driver {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.drift-driver__bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 0.5rem;
  flex-shrink: 0;
}

/* ─── View: Predict ────────────────────────────────────────────── */
.predict-view {
  width: 100%;
}

.predict-disclaimer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-warning);
  padding: var(--space-sm) var(--space-md);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.predict-disclaimer__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.predict-statement {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
}

.predict-trajectory {
  margin-bottom: var(--space-xl);
}

.predict-trajectory__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.predict-bands {
  height: 100px;
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.05) 0%, rgba(5, 150, 105, 0.15) 50%, rgba(5, 150, 105, 0.05) 100%);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.predict-bands__inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.predict-bands__line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-success));
}

.predict-bands__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding-top: var(--space-xs);
}

.predict-methodology {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.predict-methodology__card {
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.predict-methodology__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.predict-methodology__value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-mono);
}

/* ─── View: Verify ─────────────────────────────────────────────── */
.verify-view {
  width: 100%;
}

.verify-columns {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.verify-column {
  flex: 1;
  min-width: 0;
}

.verify-column__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  font-weight: 600;
}

.verify-column__header--supporting {
  background: #d1fae5;
  color: #065f46;
}

.verify-column__header--contradicting {
  background: #fee2e2;
  color: #991b1b;
}

.verify-column__icon {
  font-size: 1rem;
}

.verify-column__title {
  flex: 1;
}

.verify-column__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.evidence-card {
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition-fast);
}

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

.evidence-card__text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.evidence-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.evidence-card__confidence {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ─── Challenge Form ───────────────────────────────────────────── */
.challenge-form {
  padding: var(--space-lg);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.challenge-form__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.challenge-form__desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.challenge-form__textarea {
  width: 100%;
  padding: var(--space-md);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition-base);
  margin-bottom: var(--space-md);
  line-height: 1.5;
  min-height: 4rem;
}

.challenge-form__textarea:focus {
  border-color: var(--color-accent);
}

.challenge-form__submit {
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: var(--tap-min);
}

.challenge-form__submit:hover {
  background: var(--color-accent-hover);
}

/* ─── View: Inverse ────────────────────────────────────────────── */
.inverse-view {
  width: 100%;
}

.pattern-section {
  margin-bottom: var(--space-xl);
}

.pattern-section__desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ─── View: Compare ────────────────────────────────────────────── */
.compare-view {
  width: 100%;
}

.compare-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.compare-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: var(--tap-min);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-tab--active {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.compare-columns {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.compare-column {
  flex: 1;
  min-width: 0;
}

.compare-column--hidden {
  display: none;
}

.compare-column__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
  overflow-wrap: break-word;
}

.compare-column__section {
  margin-bottom: var(--space-md);
}

.compare-column__section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.compare-column__item {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.compare-column__item:last-child {
  border-bottom: none;
}

.compare-connections {
  margin-bottom: var(--space-xl);
}

.compare-connections__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.compare-connections__section {
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.compare-connections__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.compare-connections__item {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
}

.compare-summary {
  padding: var(--space-lg);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.compare-summary__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.compare-summary__text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* ─── View Stubs ────────────────────────────────────────────────── */
.view-stub {
  padding: var(--space-xl) 0;
}

.view-stub h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-sm) 0;
}

.view-stub p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-lg) 0;
}

.view-stub__placeholder {
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.view-stub__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.view-stub__columns h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 var(--space-sm) 0;
}

/* ─── Disclaimer ────────────────────────────────────────────────── */
.disclaimer {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-warning);
  padding: var(--space-sm) var(--space-md);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: var(--space-md);
}

/* ─── About Navigation ─────────────────────────────────────────── */
.about-nav {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.about-nav::-webkit-scrollbar {
  display: none;
}

.about-nav__pill {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  scroll-snap-align: start;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.about-nav__pill:hover {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-color: var(--color-accent);
}

/* ─── About Sections ────────────────────────────────────────────── */
.about-section {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border-subtle);
  scroll-margin-top: 5rem;
}

.about-section:last-child {
  border-bottom: none;
}

.about-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--space-md) 0;
}

.about-section p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-md) 0;
}

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

.about-section ul {
  padding-left: var(--space-lg);
  margin: 0 0 var(--space-md) 0;
}

.about-section li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

/* ─── Changes Page ─────────────────────────────────────────────── */
.changes-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.changes-section {
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-subtle);
}

.changes-section:last-child {
  border-bottom: none;
}

.changes-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md) 0;
}

.changes-section__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.changes-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.changes-item:hover {
  border-color: var(--color-border);
}

.changes-item__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.375rem;
}

.changes-item__indicator--new { background: var(--color-success); }
.changes-item__indicator--growth { background: #3b82f6; }
.changes-item__indicator--decline { background: var(--color-error); }
.changes-item__indicator--connection { background: #8b5cf6; }
.changes-item__indicator--updated { background: var(--color-warning); }

.changes-item__text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  min-width: 0;
}

.changes-item__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.changes-date-range {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xl) 0;
}

.changes-watchlist-note {
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-xl);
}

/* ─── Predictions Page ──────────────────────────────────────────── */
.predictions-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.predictions-scorecard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: linear-gradient(135deg, #111827 0%, #1e3a5f 50%, #111827 100%);
  border-radius: var(--radius-xl);
  color: var(--color-text-inverse);
}

.predictions-scorecard__stat {
  text-align: center;
}

.predictions-scorecard__value {
  font-size: clamp(1.25rem, 1rem + 1.5vw, 1.75rem);
  font-weight: 700;
  display: block;
  letter-spacing: -0.02em;
}

.predictions-scorecard__label {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-xs);
  display: block;
}

.predictions-section {
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-subtle);
}

.predictions-section:last-child {
  border-bottom: none;
}

.predictions-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md) 0;
}

.prediction-card {
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition-fast);
}

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

.prediction-card__entity {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-xs) 0;
}

.prediction-card__claim {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0 0 var(--space-sm) 0;
}

.prediction-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.prediction-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prediction-card__badge--correct { background: #d1fae5; color: #065f46; }
.prediction-card__badge--wrong { background: #fee2e2; color: #991b1b; }
.prediction-card__badge--pending { background: var(--color-bg-muted); color: var(--color-text-muted); }
.prediction-card__badge--high { background: #d1fae5; color: #065f46; }
.prediction-card__badge--medium { background: #fef3c7; color: #92400e; }
.prediction-card__badge--low { background: #fee2e2; color: #991b1b; }

.prediction-card__trajectory {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.prediction-card__confidence-bar {
  height: 4px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-sm);
}

.prediction-card__confidence-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.prediction-card__confidence-fill--high { background: var(--color-success); }
.prediction-card__confidence-fill--medium { background: var(--color-warning); }
.prediction-card__confidence-fill--low { background: var(--color-error); }

/* ─── Status Page ───────────────────────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.status-card {
  padding: var(--space-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast);
}

.status-card:hover {
  border-color: var(--color-text-muted);
}

.status-card--legs { border-top: 3px solid var(--color-accent); }
.status-card--growth { border-top: 3px solid var(--color-success); }
.status-card--connections { border-top: 3px solid #8b5cf6; }
.status-card--frontier { border-top: 3px solid #3b82f6; }
.status-card--quality { border-top: 3px solid var(--color-warning); }

.status-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md) 0;
}

.status-card__value {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-xs) 0;
}

.status-card__trend {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.status-card__trend--up { color: var(--color-success); }
.status-card__trend--down { color: var(--color-error); }

.status-card__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.status-card__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  min-height: 2rem;
}

.status-card__list-item-value {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text);
}

.status-gait-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: var(--space-xs);
}

.status-gait-indicator--walk { background: var(--color-success); }
.status-gait-indicator--trot { background: #3b82f6; }
.status-gait-indicator--canter { background: var(--color-warning); }
.status-gait-indicator--gallop { background: var(--color-error); }
.status-gait-indicator--idle { background: var(--color-text-muted); }

.status-disclaimer {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-lg) 0;
  font-style: italic;
}

/* ─── Playground Editor ─────────────────────────────────────────── */
.playground-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.playground-editor__input {
  width: 100%;
  padding: var(--space-md);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: #e5e7eb;
  background: #111827;
  border: 1px solid #374151;
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-base);
  line-height: 1.6;
  tab-size: 2;
  /* Prevent zoom on iOS */
  font-size: max(0.875rem, 16px);
}

.playground-editor__input:focus {
  border-color: #6b7280;
}

.playground-editor__input::placeholder {
  color: #6b7280;
}

.playground-editor__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.playground-editor__run {
  padding: var(--space-sm) var(--space-xl);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: var(--tap-min);
}

.playground-editor__run:hover {
  background: var(--color-accent-hover);
}

.playground-editor__run--loading {
  opacity: 0.7;
  cursor: wait;
}

.playground-editor__copy-curl {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: var(--tap-min);
}

.playground-editor__copy-curl:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}

.playground-editor__output {
  padding: var(--space-md);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: #e5e7eb;
  background: #111827;
  border: 1px solid #374151;
  border-radius: var(--radius-md);
  min-height: 6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  line-height: 1.6;
}

.playground-meta {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  padding: var(--space-xs) 0;
}

.playground-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-md);
}

/* ─── JSON Syntax Highlighting ──────────────────────────────────── */
.json-output { line-height: 1.6; }
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fde68a; }
.json-boolean { color: #c4b5fd; }
.json-null { color: #9ca3af; }
.json-bracket { color: #9ca3af; }

/* ─── Code Tabs ─────────────────────────────────────────────────── */
.code-tabs {
  margin-top: var(--space-xl);
}

.code-tabs__header {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.code-tabs__header::-webkit-scrollbar {
  display: none;
}

.code-tabs__tab {
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  margin-bottom: -1px;
  white-space: nowrap;
  min-height: var(--tap-min);
}

.code-tabs__tab:hover {
  color: var(--color-text);
}

.code-tabs__tab--active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

.code-tabs__panel {
  display: none;
}

.code-tabs__panel--active {
  display: block;
}

.code-tabs__code {
  padding: var(--space-md);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: #e5e7eb;
  background: #111827;
  border: 1px solid #374151;
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
  line-height: 1.6;
  margin: 0;
}

/* ─── Watchlist Items ───────────────────────────────────────────── */
.watchlist-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.watchlist-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.watchlist-item:hover {
  border-color: var(--color-text-muted);
}

.watchlist-item__info {
  flex: 1;
  min-width: 0;
}

.watchlist-item__name {
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  display: block;
}

.watchlist-item__name:hover {
  text-decoration: underline;
}

.watchlist-item a {
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}

.watchlist-item a:hover {
  text-decoration: underline;
}

.watchlist-item__debt {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.watchlist-item__debt-label {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.watchlist-item__debt-bar {
  flex: 1;
  height: 4px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  max-width: 6rem;
}

.watchlist-item__debt-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: var(--radius-full);
}

.watchlist-item__changes {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.watchlist-item__changes--recent {
  color: var(--color-success);
}

.watchlist-item__remove {
  padding: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  font-family: var(--font-sans);
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.watchlist-item__remove:hover {
  background: var(--color-bg-muted);
  color: var(--color-error);
}

.watchlist-subscriber-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-lg);
}

/* ─── Empty State ───────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
}
.empty-state__icon { font-size: 2.5rem; }
.empty-state__title { font-size: 1rem; font-weight: 600; color: var(--color-text); margin: 0; }
.empty-state__message { font-size: 0.875rem; margin: 0; max-width: 24rem; }

/* ─── Loading ───────────────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  gap: var(--space-md);
}

.loading__spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

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

/* ─── Skeleton ──────────────────────────────────────────────────── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-muted);
  border-radius: var(--radius-md);
  color: transparent;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 1rem;
  border-radius: var(--radius-sm);
}
.skeleton--text { height: 1rem; border-radius: var(--radius-sm); display: block; }
.skeleton--text-sm { height: 0.75rem; border-radius: var(--radius-sm); display: block; margin-top: var(--space-xs); }

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── Search Skeleton ──────────────────────────────────────────── */
.search-skeleton { padding: var(--space-lg) 0; }
.skeleton--answer { height: 4rem; margin-bottom: var(--space-md); }
.skeleton--answer-sm { height: 2rem; width: 60%; margin-bottom: var(--space-xl); }
.search-skeleton__sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.skeleton--card { height: 5rem; }

@media (max-width: 767px) {
  .search-skeleton__sources {
    grid-template-columns: 1fr;
  }
}

/* ─── Error ─────────────────────────────────────────────────────── */
.error {
  padding: var(--space-xl);
  text-align: center;
}

.error p {
  font-size: 0.875rem;
  color: var(--color-error);
  margin: 0;
}

/* ─── Error State ──────────────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  gap: var(--space-sm);
}
.error-state__icon {
  font-size: 2rem;
  color: var(--color-warning);
}
.error-state__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}
.error-state__message {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}
.error-state__retry {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.error-state__retry:hover {
  background: var(--color-accent-hover);
}

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  animation: fadeIn var(--transition-slow);
}

.search-content > section,
.search-content > div {
  animation: slideUp var(--transition-slow);
  animation-fill-mode: both;
}

.search-content > *:nth-child(1) { animation-delay: 0ms; }
.search-content > *:nth-child(2) { animation-delay: 50ms; }
.search-content > *:nth-child(3) { animation-delay: 100ms; }
.search-content > *:nth-child(4) { animation-delay: 150ms; }
.search-content > *:nth-child(5) { animation-delay: 200ms; }
.search-content > *:nth-child(6) { animation-delay: 250ms; }
.search-content > *:nth-child(7) { animation-delay: 300ms; }
.search-content > *:nth-child(8) { animation-delay: 350ms; }

/* ─── 404 Page ──────────────────────────────────────────────────── */
.page--404 h1 {
  font-size: 2rem;
  font-weight: 300;
  color: var(--color-text-muted);
}

.page--404 p {
  color: var(--color-text-muted);
}

.page--404 a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}

.page--404 a:hover {
  text-decoration: underline;
}

/* ─── Reduce motion for users who prefer it ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Responsive: Tablet (768px+) ───────────────────────────────── */
@media (min-width: 768px) {
  /* Page content gets more breathing room */
  .page-content {
    padding: var(--space-xl) var(--space-lg);
  }

  .page-title {
    font-size: 1.75rem;
  }

  /* Header expands */
  .site-header__inner {
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-lg);
  }

  .site-header__logo {
    font-size: 0.875rem;
  }

  /* Search bar larger on tablet */
  .search-bar__input {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.25rem;
  }

  /* Home hero taller */
  .home-hero {
    min-height: 50vh;
    padding: var(--space-3xl) var(--space-lg) var(--space-xl);
  }

  /* Stats line */
  .stats-line {
    font-size: 0.8125rem;
    padding: var(--space-sm) var(--space-lg);
  }

  /* Entity cards: 2 columns on tablet+ */
  .entity-cards {
    padding: 0 var(--space-lg);
  }

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

  /* Cross-graph signals: grid instead of scroll */
  .cross-signals__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
  }

  .signal-card {
    min-width: 0;
    flex-shrink: 1;
  }

  /* Related grid */
  .related__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* View toggles */
  .view-toggles {
    padding: var(--space-sm) var(--space-lg);
  }

  /* View stub columns */
  .view-stub__columns {
    grid-template-columns: 1fr 1fr;
  }

  /* Status grid: 2 columns */
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Predictions scorecard */
  .predictions-scorecard {
    padding: var(--space-xl);
    gap: var(--space-md);
  }

  /* Predict methodology: 4 columns */
  .predict-methodology {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Verify: side-by-side */
  .verify-columns {
    flex-direction: row;
    gap: var(--space-lg);
  }

  /* Compare: side-by-side */
  .compare-columns {
    flex-direction: row;
    gap: var(--space-xl);
  }

  .compare-connections__grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Action bar: no longer fixed on tablet+ */
  .action-bar {
    position: static;
    max-width: var(--max-width);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding-bottom: var(--space-sm);
    gap: var(--space-md);
  }

  .page--search {
    padding-bottom: 0;
  }

  /* Trace canvas larger */
  .trace-canvas {
    height: 340px;
  }

  .trace-ring--3 {
    display: block;
  }

  .trace-node {
    max-width: 7rem;
  }

  /* Drift chart taller */
  .drift-chart__bars {
    height: 160px;
  }

  /* Search content wider padding */
  .search-content {
    padding: var(--space-xl) var(--space-lg);
  }

  /* About nav wraps */
  .about-nav {
    flex-wrap: wrap;
  }

  /* Overview hero text */
  .overview-hero__text {
    font-size: 1.75rem;
  }

  /* Answer section spacing */
  .answer-section {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

  .answer-section__summary {
    font-size: 1.5rem;
  }

  /* Overview spacing */
  .overview-hero {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

  .key-facts {
    margin-bottom: var(--space-2xl);
  }

  .cross-signals {
    margin-bottom: var(--space-2xl);
  }

  .sources {
    margin-bottom: var(--space-2xl);
  }

  .gaps {
    margin-bottom: var(--space-2xl);
  }

  .related {
    margin-bottom: var(--space-2xl);
  }

  .knowledge-debt {
    margin-bottom: var(--space-xl);
  }
}

/* ─── Responsive: Desktop (1024px+) ─────────────────────────────── */
@media (min-width: 1024px) {
  /* Cross-graph signals: 3 columns */
  .cross-signals__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Related: 3 columns */
  .related__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Status: 3 columns */
  .status-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Overview hero text */
  .overview-hero__text {
    font-size: 2rem;
  }

  /* Answer section summary: larger on desktop */
  .answer-section__summary {
    font-size: 1.75rem;
  }

  /* Sources grid: ensure 3 columns on wide screens */
  .sources-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  /* Knowledge debt: larger score number on desktop */
  .knowledge-debt__score-number {
    font-size: 3rem;
  }

  /* Trace canvas full size */
  .trace-canvas {
    height: 400px;
  }

  .trace-ring--1 { width: 220px; height: 220px; }
  .trace-ring--2 { width: 320px; height: 320px; }
  .trace-ring--3 { width: 400px; height: 400px; opacity: 0.3; }

  .trace-node {
    max-width: 8rem;
  }

  /* Knowledge debt factors: wider gap on desktop */
  .knowledge-debt__factors {
    gap: var(--space-lg);
  }

  /* Drift chart even taller */
  .drift-chart__bars {
    height: 200px;
  }
}

/* ─── Discovery Overlay (#23) ───────────────────────── */
.discovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: discovery-fade-in 0.3s ease;
}
@keyframes discovery-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.discovery-overlay__card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 560px;
  width: 90%;
  animation: discovery-slide-up 0.3s ease;
}
@keyframes discovery-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.discovery-overlay__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}
.discovery-overlay__headline {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--space-lg) 0;
}
.discovery-overlay__evidence {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.discovery-overlay__evidence-item {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  padding-left: var(--space-md);
  border-left: 2px solid var(--color-border);
}
.discovery-overlay__graphs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
}
.discovery-overlay__actions {
  display: flex;
  gap: var(--space-md);
}
.discovery-overlay__explore {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.discovery-overlay__dismiss {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
}

/* ─── Status Bar Chart ─────────────────────────────────────────── */
.status-bar-chart {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  grid-column: 1 / -1;
}
.status-bar-chart__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}
.status-bar-chart__label {
  width: 5rem;
  flex-shrink: 0;
}
.status-bar-chart__track {
  flex: 1;
  height: 6px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.status-bar-chart__fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.status-bar-chart__value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  width: 4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
