/* ========== Research Report Styles - Unikode Design System ========== */
/* World-class research UI with navigation, citations, and interactions */

/* ========== Link Reset for Research Pages ========== */
.research-content a,
.sources-section a,
.footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--duration-short-3) var(--easing-standard);
}

.research-content a:hover,
.sources-section a:hover,
.footer a:hover {
  color: var(--color-text);
}

/* Footer section links in research pages */
.footer .footer-section ul {
  list-style: none;
}

.footer .footer-section ul li {
  margin-bottom: var(--space-2);
}

.footer .footer-section ul a {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--duration-short-4) var(--easing-standard);
  display: inline-block;
}

.footer .footer-section ul a:hover {
  color: var(--color-text);
  transform: translateX(4px);
}

/* ========== Reading Progress Bar ========== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-border);
  z-index: 1001;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg,
    var(--color-text-tertiary) 0%,
    var(--color-text-secondary) 50%,
    var(--color-text) 100%
  );
  width: 0%;
  transition: width 0.1s linear;
}

/* ========== Research Layout ========== */
.research-layout {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  transition: margin-left var(--duration-medium-2) var(--easing-standard),
              max-width var(--duration-medium-2) var(--easing-standard);
}

/* ========== Table of Contents Sidebar ========== */
.toc-sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: var(--nav-height);
  bottom: 0;
  width: 280px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-6);
  overflow-y: auto;
  z-index: 100;
  transform: translateX(0);
  transition: transform var(--duration-medium-2) var(--easing-standard),
              width var(--duration-medium-2) var(--easing-standard);
  /* Hide scrollbar but keep scrolling */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.toc-sidebar::-webkit-scrollbar {
  display: none;
}

.toc-sidebar.collapsed {
  transform: translateX(-100%);
}

@media (min-width: 1200px) {
  .toc-sidebar {
    display: block;
  }

  /* Shift content when TOC is open */
  .research-layout {
    margin-left: 280px;
    transition: margin-left var(--duration-medium-2) var(--easing-standard);
  }

  .research-layout.toc-collapsed {
    margin-left: auto;
    margin-right: auto;
  }

  .research-hero,
  .research-intro {
    transition: margin-left var(--duration-medium-2) var(--easing-standard);
  }

  body:not(.toc-hidden) .research-hero,
  body:not(.toc-hidden) .research-intro {
    margin-left: 280px;
  }

  /* Center hero and intro when TOC is collapsed/hidden */
  body.toc-hidden .research-hero,
  body.toc-hidden .research-intro {
    margin-left: auto;
    margin-right: auto;
  }
}

/* TOC Toggle Button - Fixed at top */
.toc-toggle {
  display: none;
  position: fixed;
  left: var(--space-4);
  top: calc(var(--nav-height) + var(--space-4));
  width: 40px;
  height: 40px;
  background: var(--glass-bg-prominent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  color: var(--color-text-secondary);
  cursor: pointer;
  z-index: 101;
  transition: all var(--duration-short-4) var(--easing-standard);
  align-items: center;
  justify-content: center;
}

.toc-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-elevated);
  border-color: var(--color-border-strong);
}

.toc-toggle .material-symbols-outlined {
  font-size: 22px;
  transition: transform var(--duration-short-4) var(--easing-standard);
}

.toc-toggle.active .material-symbols-outlined {
  transform: rotate(180deg);
}

@media (min-width: 1200px) {
  .toc-toggle {
    display: flex;
  }

  /* When TOC is collapsed, move toggle to edge */
  .toc-toggle.collapsed {
    left: var(--space-4);
  }

  /* When TOC is open, position toggle inside */
  .toc-toggle:not(.collapsed) {
    left: 240px;
  }
}

.toc-header {
  font-size: var(--text-label-md);
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: var(--space-1);
}

.toc-link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  text-decoration: none;
  border-radius: var(--radius-element);
  border-left: 2px solid transparent;
  transition: all var(--duration-short-4) var(--easing-standard);
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--color-text-secondary);
  background: var(--glass-bg);
}

.toc-link.active {
  color: var(--color-text);
  background: var(--glass-bg-prominent);
  border-left-color: var(--color-text);
}

.toc-link-number {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  color: var(--color-text-muted);
  min-width: 24px;
}

.toc-link.active .toc-link-number {
  color: var(--color-text-tertiary);
}

/* ========== Article Hero ========== */
.research-hero {
  padding: calc(var(--nav-height) + var(--space-12)) var(--space-6) var(--space-12);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.research-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-label-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--glass-bg-prominent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--color-border);
}

.research-hero-tag .material-symbols-outlined {
  font-size: 16px;
}

.research-hero h1 {
  font-size: clamp(var(--text-headline-lg), 5vw, var(--text-display-md));
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.15;
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

.research-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
}

.research-hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.research-hero-meta-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-text-muted);
}

/* ========== Article Actions Bar ========== */
.article-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  margin-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-label-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-short-4) var(--easing-standard);
  text-decoration: none;
}

.action-btn:hover {
  color: var(--color-text);
  background: var(--glass-bg-prominent);
  border-color: var(--color-border-strong);
}

.action-btn .material-symbols-outlined {
  font-size: 18px;
}

/* ========== Introduction Section ========== */
.research-intro {
  max-width: 800px;
  margin: 0 auto var(--space-10);
  padding: 0 var(--space-6);
}

.research-intro-text {
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.research-intro-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.research-intro-text a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-short-3) var(--easing-standard);
}

.research-intro-text a:hover {
  text-decoration-color: var(--color-text);
}

/* ========== Article Content ========== */
.research-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Section Headers with Anchors */
.section-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: var(--space-12) 0 var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  scroll-margin-top: calc(var(--nav-height) + var(--space-6));
}

.section-header:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.section-number {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-label-md);
  font-weight: 600;
  color: var(--color-text-muted);
  padding-top: 4px;
}

.section-title {
  flex: 1;
  font-size: var(--text-title-xl);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.section-anchor {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-element);
  cursor: pointer;
  opacity: 0;
  transition: all var(--duration-short-3) var(--easing-standard);
}

.section-header:hover .section-anchor {
  opacity: 1;
}

.section-anchor:hover {
  color: var(--color-text);
  background: var(--glass-bg);
}

.section-anchor .material-symbols-outlined {
  font-size: 18px;
}

/* Subsection Headers */
.subsection-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-8) 0 var(--space-4);
  scroll-margin-top: calc(var(--nav-height) + var(--space-6));
}

.subsection-title {
  font-size: var(--text-title-md);
  font-weight: 600;
  color: var(--color-text);
}

/* Body Text */
.research-content p {
  font-size: var(--text-body-md);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-5);
}

.research-content p strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Drop Cap for First Paragraph of Section */
.section-header + p::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  font-weight: 700;
  color: var(--color-text);
  padding-right: var(--space-3);
  padding-top: 4px;
}

/* Pull Quote */
.pull-quote {
  position: relative;
  margin: var(--space-10) 0;
  padding: var(--space-8) var(--space-6);
  font-size: var(--text-title-md);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.6;
  text-align: center;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.pull-quote::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
}

.pull-quote::after {
  content: '"';
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-tertiary);
}

.pull-quote cite {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--text-body-sm);
  font-style: normal;
  font-weight: 400;
  color: var(--color-text-tertiary);
}

/* ========== Enhanced Typography - Sprint 26-50 ========== */

/* Blockquote (standard, not pull-quote) */
.research-content blockquote {
  position: relative;
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-6);
  background: var(--glass-bg);
  border-left: 3px solid var(--color-text-tertiary);
  border-radius: 0 var(--radius-element) var(--radius-element) 0;
  font-style: italic;
}

.research-content blockquote p {
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

.research-content blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-body-sm);
  font-style: normal;
  color: var(--color-text-muted);
}

/* Figure and Caption */
.research-figure {
  margin: var(--space-8) 0;
  padding: var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
}

.research-figure img,
.research-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-component);
}

.research-figure figcaption {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  text-align: center;
}

.research-figure figcaption strong {
  color: var(--color-text-secondary);
}

/* Code and Pre blocks */
.research-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-text);
  background: var(--glass-bg-prominent);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-element);
  border: 1px solid var(--color-border);
}

.research-content pre {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  overflow-x: auto;
}

.research-content pre code {
  padding: 0;
  background: transparent;
  border: none;
  font-size: var(--text-body-sm);
  line-height: 1.6;
}

/* Enhanced Lists */
.research-content ul,
.research-content ol {
  margin: var(--space-5) 0;
  padding-left: var(--space-6);
}

.research-content ul li,
.research-content ol li {
  position: relative;
  margin-bottom: var(--space-3);
  font-size: var(--text-body-md);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.research-content ul li::marker {
  color: var(--color-text-muted);
}

.research-content ol li::marker {
  color: var(--color-text-tertiary);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Nested lists */
.research-content ul ul,
.research-content ol ol,
.research-content ul ol,
.research-content ol ul {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Text Highlight Utility */
.text-highlight {
  background: linear-gradient(180deg, transparent 60%, rgba(255, 255, 255, 0.1) 60%);
  padding: 0 var(--space-1);
}

[data-theme="light"] .text-highlight {
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.08) 60%);
}

/* Small Caps */
.small-caps {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Sidenote / Marginnote */
.sidenote {
  display: block;
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  background: var(--glass-bg);
  border-left: 2px solid var(--color-border-strong);
  border-radius: 0 var(--radius-element) var(--radius-element) 0;
}

.sidenote::before {
  content: 'Note';
  display: block;
  font-size: var(--text-label-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

/* Definition List */
.research-content dl {
  margin: var(--space-6) 0;
}

.research-content dt {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.research-content dd {
  margin-left: var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* Lead Paragraph */
.lead-text {
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  line-height: 1.8;
  font-weight: 400;
}

/* Section Divider */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin: var(--space-10) 0;
  color: var(--color-text-muted);
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.section-divider .material-symbols-outlined {
  font-size: 20px;
}

/* ========== Interactive Citations ========== */
.citation-link {
  position: relative;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px dashed var(--color-border-strong);
  transition: all var(--duration-short-3) var(--easing-standard);
  cursor: pointer;
}

/* Citation superscript number */
.citation-link[data-ref]::before {
  content: attr(data-ref);
  font-size: 0.65em;
  font-weight: 600;
  vertical-align: super;
  color: var(--color-text-tertiary);
  margin-left: 1px;
  transition: color var(--duration-short-3) var(--easing-standard);
}

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

.citation-link:hover {
  border-bottom-style: solid;
  border-bottom-color: var(--color-text);
}

/* Tooltip container */
.citation-link::after {
  content: attr(data-source);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.95);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-elevated);
  color: var(--color-text-secondary);
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: 1.4;
  max-width: 280px;
  white-space: normal;
  text-align: center;
  border-radius: var(--radius-component);
  border: 1px solid var(--color-border);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--duration-medium-1) var(--easing-emphasized-decelerate);
  z-index: 100;
}

/* Tooltip arrow */
.citation-link[data-source]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-medium-1) var(--easing-emphasized-decelerate);
  z-index: 101;
}

.citation-link:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.citation-link:hover[data-source]::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Citation with icon indicator */
.citation-link.with-icon {
  padding-right: 18px;
}

.citation-link.with-icon::after {
  content: 'open_in_new';
  font-family: 'Material Symbols Outlined';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity var(--duration-short-3) var(--easing-standard);
}

.citation-link.with-icon:hover::after {
  opacity: 1;
}

/* External link indicator */
.external-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: all var(--duration-short-3) var(--easing-standard);
}

.external-link:hover {
  border-bottom-color: var(--color-text);
}

.external-link::after {
  content: 'open_in_new';
  font-family: 'Material Symbols Outlined';
  font-size: 14px;
  color: var(--color-text-tertiary);
}

/* ========== Stat Cards ========== */
.stat-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
  padding: var(--space-6);
  margin: var(--space-8) 0;
  transition: all var(--duration-medium-1) var(--easing-standard);
  overflow: hidden;
}

/* Animated gradient border effect */
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 200%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--duration-medium-1) var(--easing-standard);
}

.stat-card:hover::before {
  opacity: 1;
  animation: borderShimmer 2s linear infinite;
  will-change: background-position, opacity; /* GPU compositing hint */
}

@keyframes borderShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.stat-card:hover {
  border-color: var(--color-border-strong);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transform: translateY(-2px);
}

.stat-card-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  z-index: 1;
}

.stat-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(
    135deg,
    var(--glass-bg-prominent) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  color: var(--color-text);
  transition: all var(--duration-short-4) var(--easing-standard);
}

.stat-card:hover .stat-card-icon {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  border-color: var(--color-border-strong);
  transform: scale(1.05);
}

.stat-card-icon .material-symbols-outlined {
  font-size: 28px;
}

.stat-card-content {
  flex: 1;
}

.stat-card-content p {
  margin-bottom: 0;
  font-size: var(--text-body-lg);
}

/* Stat card value highlight */
.stat-card-value {
  font-family: var(--font-mono);
  font-size: var(--text-headline-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.stat-card-label {
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .stat-card::before {
    animation: none;
  }
  .stat-card:hover {
    transform: none;
  }
  .stat-card:hover .stat-card-icon {
    transform: none;
  }
}

/* ========== Enhanced Stat Card Variants - Sprint 26-50 ========== */

/* Compact Stat Card - inline display */
.stat-card.compact {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-2) var(--space-2) var(--space-2) 0;
}

.stat-card.compact .stat-card-icon {
  width: 40px;
  height: 40px;
}

.stat-card.compact .stat-card-icon .material-symbols-outlined {
  font-size: 20px;
}

.stat-card.compact .stat-card-value {
  font-size: var(--text-title-lg);
  margin-bottom: 0;
}

.stat-card.compact .stat-card-label {
  margin-bottom: 0;
}

/* Featured/Highlighted Stat Card */
.stat-card.featured {
  background: linear-gradient(
    135deg,
    var(--glass-bg-prominent) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--glass-bg) 100%
  );
  border-color: var(--color-border-strong);
  padding: var(--space-8);
}

.stat-card.featured::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle at 100% 0%,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.stat-card.featured .stat-card-value {
  font-size: var(--text-display-sm);
}

.stat-card.featured .stat-card-icon {
  width: 72px;
  height: 72px;
}

.stat-card.featured .stat-card-icon .material-symbols-outlined {
  font-size: 36px;
}

/* Stat Card with Trend Indicator */
.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-label-sm);
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.stat-card-trend.up {
  color: var(--color-success);
  background: rgba(74, 222, 128, 0.1);
}

.stat-card-trend.down {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.1);
}

.stat-card-trend.neutral {
  color: var(--color-text-tertiary);
  background: var(--glass-bg);
}

.stat-card-trend::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.stat-card-trend.up::before {
  border-bottom: 5px solid currentColor;
}

.stat-card-trend.down::before {
  border-top: 5px solid currentColor;
}

.stat-card-trend.neutral::before {
  width: 8px;
  height: 2px;
  background: currentColor;
  border: none;
}

/* Horizontal Stat Card */
.stat-card.horizontal {
  display: flex;
  align-items: center;
}

.stat-card.horizontal .stat-card-inner {
  flex-direction: row;
  align-items: center;
  width: 100%;
}

.stat-card.horizontal .stat-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.stat-card.horizontal .stat-card-value {
  margin-bottom: 0;
  font-size: var(--text-title-xl);
}

/* Stat Comparison Card (two values) */
.stat-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}

.stat-comparison-item {
  text-align: center;
}

.stat-comparison-value {
  font-family: var(--font-mono);
  font-size: var(--text-headline-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.stat-comparison-label {
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
}

.stat-comparison-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
}

.stat-comparison-divider::before,
.stat-comparison-divider::after {
  content: '';
  width: 1px;
  height: 20px;
  background: var(--color-border);
}

.stat-comparison-arrow {
  color: var(--color-text-muted);
  font-size: 20px;
}

/* Mini Stat Row (for inline stats) */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.stat-row-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
}

.stat-row-value {
  font-family: var(--font-mono);
  font-size: var(--text-title-md);
  font-weight: 700;
  color: var(--color-text);
}

.stat-row-label {
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
}

/* ========== Key Findings Box ========== */
.key-findings {
  position: relative;
  background: linear-gradient(135deg,
    var(--glass-bg-prominent) 0%,
    var(--glass-bg) 100%
  );
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
  padding: var(--space-6);
  margin: var(--space-8) 0;
  overflow: hidden;
}

/* Animated accent border on left */
.key-findings::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--color-text-tertiary) 0%,
    var(--color-text-secondary) 50%,
    var(--color-text-tertiary) 100%
  );
  background-size: 100% 200%;
  animation: accentPulse 4s ease-in-out infinite;
}

@keyframes accentPulse {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 0% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .key-findings::before {
    animation: none;
    background: var(--color-text-secondary);
  }
}

/* Subtle corner accent */
.key-findings::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(
    circle at 100% 0%,
    rgba(255, 255, 255, 0.03) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.key-findings-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  z-index: 1;
}

.key-findings-header .material-symbols-outlined {
  font-size: 28px;
  color: var(--color-text);
  background: var(--glass-bg);
  padding: var(--space-2);
  border-radius: var(--radius-element);
  border: 1px solid var(--color-border);
}

.key-findings-title {
  font-size: var(--text-title-md);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* Findings count badge */
.key-findings-count {
  margin-left: auto;
  font-size: var(--text-label-sm);
  font-weight: 500;
  color: var(--color-text-tertiary);
  background: var(--glass-bg);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.key-findings ul {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: findings-counter;
  position: relative;
  z-index: 1;
}

.key-findings li {
  position: relative;
  font-size: var(--text-body-md);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  padding-left: var(--space-8);
  counter-increment: findings-counter;
  transition: all var(--duration-short-3) var(--easing-standard);
}

/* Numbered marker */
.key-findings li::before {
  content: counter(findings-counter);
  position: absolute;
  left: 0;
  top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  font-weight: 600;
  color: var(--color-text-tertiary);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--duration-short-3) var(--easing-standard);
}

.key-findings li:hover::before {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--glass-bg-prominent);
}

.key-findings li:hover {
  color: var(--color-text);
}

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

.key-findings li strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Alternative: Key findings with checkmarks */
.key-findings.with-checks li::before {
  content: 'check';
  font-family: 'Material Symbols Outlined';
  font-size: 16px;
}

/* ========== Enhanced Key Findings Variants - Sprint 26-50 ========== */

/* Compact Key Findings */
.key-findings.compact {
  padding: var(--space-4) var(--space-5);
}

.key-findings.compact .key-findings-header {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
}

.key-findings.compact .key-findings-header .material-symbols-outlined {
  font-size: 22px;
  padding: var(--space-1);
}

.key-findings.compact .key-findings-title {
  font-size: var(--text-title-sm);
}

.key-findings.compact li {
  font-size: var(--text-body-sm);
  margin-bottom: var(--space-2);
  padding-left: var(--space-6);
}

.key-findings.compact li::before {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

/* Warning/Caution Key Findings */
.key-findings.warning {
  background: linear-gradient(135deg,
    rgba(251, 191, 36, 0.08) 0%,
    var(--glass-bg) 100%
  );
  border-color: rgba(251, 191, 36, 0.3);
}

.key-findings.warning::before {
  background: linear-gradient(
    180deg,
    rgba(251, 191, 36, 0.5) 0%,
    rgba(251, 191, 36, 0.8) 50%,
    rgba(251, 191, 36, 0.5) 100%
  );
}

.key-findings.warning .key-findings-header .material-symbols-outlined {
  color: rgba(251, 191, 36, 0.9);
}

.key-findings.warning .key-findings-title::before {
  content: 'Caution: ';
  color: rgba(251, 191, 36, 0.9);
}

/* Insight Key Findings */
.key-findings.insight {
  background: linear-gradient(135deg,
    rgba(96, 165, 250, 0.06) 0%,
    var(--glass-bg) 100%
  );
}

.key-findings.insight::before {
  background: linear-gradient(
    180deg,
    var(--color-text-tertiary) 0%,
    var(--color-text) 50%,
    var(--color-text-tertiary) 100%
  );
}

.key-findings.insight .key-findings-header .material-symbols-outlined::before {
  content: 'lightbulb';
}

/* Key Findings with Custom Icons per Item */
.key-findings.with-icons li {
  padding-left: var(--space-9);
}

.key-findings.with-icons li::before {
  content: attr(data-icon);
  font-family: 'Material Symbols Outlined';
  font-size: 18px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
}

/* Collapsible Key Findings */
.key-findings.collapsible .key-findings-header {
  cursor: pointer;
  user-select: none;
}

.key-findings.collapsible .key-findings-header::after {
  content: 'expand_more';
  font-family: 'Material Symbols Outlined';
  font-size: 24px;
  color: var(--color-text-tertiary);
  margin-left: auto;
  transition: transform var(--duration-short-4) var(--easing-standard);
}

.key-findings.collapsible.collapsed .key-findings-header::after {
  transform: rotate(-90deg);
}

.key-findings.collapsible .key-findings-body {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height var(--duration-medium-2) var(--easing-standard),
              opacity var(--duration-medium-1) var(--easing-standard);
}

.key-findings.collapsible.collapsed .key-findings-body {
  max-height: 0;
  opacity: 0;
}

/* Key Findings Grid (multiple boxes side by side) */
.key-findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.key-findings-grid .key-findings {
  margin: 0;
}

/* Highlight Box (simpler alternative to key-findings) */
.highlight-box {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  padding: var(--space-5);
  margin: var(--space-6) 0;
}

.highlight-box::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-4);
  bottom: var(--space-4);
  width: 3px;
  background: var(--color-text-tertiary);
  border-radius: var(--radius-full);
}

.highlight-box-icon {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-label-md);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.highlight-box-icon .material-symbols-outlined {
  font-size: 18px;
}

.highlight-box p {
  margin: 0;
  font-size: var(--text-body-md);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.highlight-box p strong {
  color: var(--color-text);
}

/* Takeaway Box */
.takeaway-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  background: linear-gradient(135deg,
    var(--glass-bg-prominent) 0%,
    var(--glass-bg) 100%
  );
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}

.takeaway-box-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  color: var(--color-text);
}

.takeaway-box-icon .material-symbols-outlined {
  font-size: 24px;
}

.takeaway-box-content {
  flex: 1;
}

.takeaway-box-label {
  font-size: var(--text-label-sm);
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.takeaway-box-text {
  font-size: var(--text-body-lg);
  color: var(--color-text);
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
}

/* ========== Stats Grid ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0;
  align-items: stretch;
}

.stats-grid-item {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--duration-medium-1) var(--easing-standard);
  overflow: hidden;
  /* Flexbox for consistent vertical alignment */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Top accent line */
.stats-grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--color-text-tertiary);
  opacity: 0;
  transition: all var(--duration-short-4) var(--easing-standard);
}

.stats-grid-item:hover::before {
  width: 100%;
  opacity: 1;
}

.stats-grid-item:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.stats-grid-value {
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--text-display-sm);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
  /* Gradient text effect */
  background: linear-gradient(
    135deg,
    var(--color-text) 0%,
    var(--color-text-secondary) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Value suffix styling */
.stats-grid-value .suffix {
  font-size: 0.5em;
  font-weight: 500;
  vertical-align: super;
  -webkit-text-fill-color: var(--color-text-tertiary);
}

.stats-grid-label {
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  line-height: 1.4;
  max-width: 160px;
  margin: 0 auto var(--space-2);
}

.stats-grid-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--text-label-sm);
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-element);
  margin-top: var(--space-2);
}

.stats-grid-change.positive {
  color: var(--color-success);
  background: rgba(var(--color-success-rgb, 74, 222, 128), 0.1);
}

.stats-grid-change.negative {
  color: var(--color-error);
  background: rgba(var(--color-error-rgb, 248, 113, 113), 0.1);
}

/* Change indicator arrow */
.stats-grid-change::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.stats-grid-change.positive::before {
  border-bottom: 6px solid currentColor;
}

.stats-grid-change.negative::before {
  border-top: 6px solid currentColor;
}

/* Featured stat (larger, more prominent) */
.stats-grid-item.featured {
  grid-column: span 2;
  padding: var(--space-8);
}

.stats-grid-item.featured .stats-grid-value {
  font-size: var(--text-display-md);
}

@media (max-width: 640px) {
  .stats-grid-item.featured {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats-grid-item:hover {
    transform: none;
  }
}

/* ========== Sources Section ========== */
.sources-section {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-container);
  padding: var(--space-8);
  margin-top: var(--space-12);
}

.sources-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.sources-header .material-symbols-outlined {
  font-size: 24px;
  color: var(--color-text-secondary);
}

.sources-title {
  font-size: var(--text-title-lg);
  font-weight: 600;
  color: var(--color-text);
}

.sources-count {
  margin-left: auto;
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
  background: var(--glass-bg-prominent);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.sources-category {
  margin-bottom: var(--space-6);
}

.sources-category:last-child {
  margin-bottom: 0;
}

.sources-category-title {
  font-size: var(--text-title-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sources-list li {
  margin: 0;
}

.source-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  background: transparent;
  border-radius: var(--radius-element);
  transition: all var(--duration-short-3) var(--easing-standard);
}

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

.source-link::before {
  content: 'link';
  font-family: 'Material Symbols Outlined';
  font-size: 16px;
  color: var(--color-text-muted);
}

.source-link:hover::before {
  color: var(--color-text-tertiary);
}

/* ========== Back to Top Button ========== */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--glass-bg-prominent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--duration-medium-1) var(--easing-standard);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--color-text);
  background: var(--color-surface-elevated);
  border-color: var(--color-border-strong);
}

.back-to-top .material-symbols-outlined {
  font-size: 24px;
}

/* ========== Mobile TOC Toggle ========== */
.toc-mobile-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  width: 48px;
  height: 48px;
  background: var(--glass-bg-prominent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-short-4) var(--easing-standard);
  z-index: 100;
}

@media (max-width: 1199px) {
  .toc-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.toc-mobile-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-elevated);
}

.toc-mobile-toggle .material-symbols-outlined {
  font-size: 24px;
}

/* Mobile TOC Panel */
.toc-mobile-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-medium-1) var(--easing-standard);
}

@media (max-width: 1199px) {
  .toc-mobile-panel {
    display: block;
  }
}

.toc-mobile-panel.active {
  opacity: 1;
  visibility: visible;
}

.toc-mobile-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-window) var(--radius-window) 0 0;
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--duration-medium-2) var(--easing-emphasized-decelerate);
}

.toc-mobile-panel.active .toc-mobile-content {
  transform: translateY(0);
}

.toc-mobile-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-short-3) var(--easing-standard);
}

.toc-mobile-close:hover {
  background: var(--glass-bg-prominent);
  color: var(--color-text);
}

/* ========== Article Footer ========== */
.article-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.article-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-body-sm);
  color: var(--color-text-tertiary);
  font-style: italic;
}

.article-footer-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ========== Back to Research Link ========== */
.back-to-research {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-body-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-8);
  transition: all var(--duration-short-4) var(--easing-standard);
}

.back-to-research:hover {
  color: var(--color-text);
  background: var(--glass-bg-prominent);
  border-color: var(--color-border-strong);
}

.back-to-research .material-symbols-outlined {
  font-size: 20px;
}

/* ========== Sprint 51-75: Enhanced Citations & Tooltips ========== */

/* Citation Reference Tooltip - Enhanced */
.citation-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 320px;
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--duration-medium-1) var(--easing-emphasized-decelerate);
  z-index: 200;
}

.citation-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-border);
}

.citation-link:hover .citation-tooltip,
.citation-link:focus .citation-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.citation-tooltip-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-label-sm);
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.citation-tooltip-header .material-symbols-outlined {
  font-size: 14px;
}

.citation-tooltip-title {
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.citation-tooltip-source {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.citation-tooltip-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-label-sm);
  color: var(--color-text-muted);
}

.citation-tooltip-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  font-size: var(--text-label-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--duration-short-3) var(--easing-standard);
}

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

.citation-tooltip-link .material-symbols-outlined {
  font-size: 14px;
}

/* Footnote Markers */
.footnote-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  vertical-align: super;
  text-decoration: none;
  transition: all var(--duration-short-3) var(--easing-standard);
  cursor: pointer;
}

.footnote-ref:hover {
  color: var(--color-text);
  background: var(--glass-bg-prominent);
  border-color: var(--color-border-strong);
}

/* Footnote Section */
.footnotes-section {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.footnotes-title {
  font-size: var(--text-title-md);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.footnote-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--color-border);
}

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

.footnote-number {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 24px;
}

.footnote-back {
  margin-left: var(--space-2);
  color: var(--color-text-muted);
  font-size: 12px;
  transition: color var(--duration-short-3) var(--easing-standard);
}

.footnote-back:hover {
  color: var(--color-text);
}

/* ========== Sprint 51-75: Interactive Data Tables ========== */

.research-table-container {
  margin: var(--space-8) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.research-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-body-sm);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  overflow: hidden;
}

.research-table thead {
  background: var(--glass-bg-prominent);
}

.research-table th {
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.research-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-short-3) var(--easing-standard);
}

.research-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.05);
}

.research-table th.sortable::after {
  content: 'unfold_more';
  font-family: 'Material Symbols Outlined';
  font-size: 16px;
  vertical-align: middle;
  margin-left: var(--space-1);
  color: var(--color-text-muted);
  transition: color var(--duration-short-3) var(--easing-standard);
}

.research-table th.sortable.asc::after {
  content: 'expand_less';
  color: var(--color-text);
}

.research-table th.sortable.desc::after {
  content: 'expand_more';
  color: var(--color-text);
}

.research-table td {
  padding: var(--space-4) var(--space-5);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-short-3) var(--easing-standard);
}

.research-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Table number alignment */
.research-table td.number,
.research-table th.number {
  text-align: right;
  font-family: var(--font-mono);
}

/* Table cell highlighting */
.research-table td.highlight {
  color: var(--color-text);
  font-weight: 600;
}

/* Compact table variant */
.research-table.compact th,
.research-table.compact td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-label-md);
}

/* Striped table variant */
.research-table.striped tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ========== Sprint 51-75: Copy to Clipboard ========== */

.copy-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all var(--duration-short-3) var(--easing-standard);
}

.copy-wrapper:hover .copy-btn,
.copy-btn:focus {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--glass-bg-prominent);
  color: var(--color-text-secondary);
  border-color: var(--color-border-strong);
}

.copy-btn .material-symbols-outlined {
  font-size: 16px;
}

.copy-btn.copied {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--color-success);
}

.copy-btn.copied .material-symbols-outlined::before {
  content: 'check';
}

/* Copy feedback tooltip */
.copy-feedback {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-label-sm);
  color: var(--color-text);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-short-4) var(--easing-standard);
}

.copy-btn.copied + .copy-feedback {
  opacity: 1;
  visibility: visible;
}

/* ========== Sprint 51-75: Expandable/Collapsible Sections ========== */

.expandable-section {
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  margin: var(--space-6) 0;
  overflow: hidden;
}

.expandable-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-short-3) var(--easing-standard);
}

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

.expandable-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--glass-bg-prominent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
  color: var(--color-text-secondary);
  transition: all var(--duration-short-4) var(--easing-standard);
}

.expandable-header:hover .expandable-icon {
  border-color: var(--color-border-strong);
}

.expandable-icon .material-symbols-outlined {
  font-size: 18px;
  transition: transform var(--duration-short-4) var(--easing-standard);
}

.expandable-section.open .expandable-icon .material-symbols-outlined {
  transform: rotate(180deg);
}

.expandable-title {
  flex: 1;
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--color-text);
}

.expandable-badge {
  font-size: var(--text-label-sm);
  color: var(--color-text-muted);
  background: var(--glass-bg);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.expandable-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-medium-2) var(--easing-emphasized-decelerate);
}

.expandable-section.open .expandable-body {
  max-height: 2000px;
}

.expandable-content {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

/* Accordion variant (only one open at a time) */
.accordion .expandable-section {
  margin: 0;
  border-radius: 0;
  border-bottom: none;
}

.accordion .expandable-section:first-child {
  border-radius: var(--radius-component) var(--radius-component) 0 0;
}

.accordion .expandable-section:last-child {
  border-bottom: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-component) var(--radius-component);
}

/* ========== Sprint 51-75: Interactive Tooltips ========== */

.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  cursor: help;
  border-bottom: 1px dotted var(--color-border-strong);
}

.tooltip-trigger .tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}

.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 280px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-body-sm);
  font-weight: 400;
  color: var(--color-text-secondary);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--duration-short-4) var(--easing-emphasized-decelerate);
  z-index: 100;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-border);
}

.tooltip-trigger:hover .tooltip-content,
.tooltip-trigger:focus .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip positions */
.tooltip-content.right {
  left: calc(100% + 8px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
}

.tooltip-content.right::after {
  left: -6px;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  border-left: none;
  border-right: 6px solid var(--color-border);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.tooltip-trigger:hover .tooltip-content.right {
  transform: translateY(-50%) translateX(0);
}

/* ========== Sprint 51-75: Progress Indicators ========== */

.reading-time-estimate {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-label-sm);
  color: var(--color-text-tertiary);
}

.reading-time-estimate .material-symbols-outlined {
  font-size: 16px;
}

/* Section progress indicator */
.section-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.section-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.section-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
    var(--color-text-tertiary) 0%,
    var(--color-text) 100%
  );
  border-radius: var(--radius-full);
  transition: width var(--duration-medium-2) var(--easing-standard);
}

.section-progress-text {
  font-size: var(--text-label-sm);
  font-weight: 500;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* ========== Sprint 51-75: Keyboard Navigation Focus States ========== */

/* Enhanced focus visible for interactive elements */
.citation-link:focus-visible,
.footnote-ref:focus-visible,
.expandable-header:focus-visible,
.copy-btn:focus-visible,
.tooltip-trigger:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-component);
  text-decoration: none;
  z-index: 10000;
  transition: top var(--duration-short-4) var(--easing-standard);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Focus trap indicator for modal/panel elements */
[data-focus-trap] {
  outline: 2px dashed transparent;
}

[data-focus-trap]:focus-within {
  outline-color: rgba(255, 255, 255, 0.1);
}

/* ========== Sprint 51-75: Smooth Scroll Behavior ========== */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .expandable-body {
    transition: none;
  }

  .tooltip-content,
  .citation-tooltip,
  .copy-feedback {
    transition: none;
  }
}

/* Scroll snap for sections (optional enhancement) */
.scroll-snap-container {
  scroll-snap-type: y proximity;
}

.scroll-snap-container .section-header {
  scroll-snap-align: start;
}

/* ========== Sprint 51-75: Interactive State Classes ========== */

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

/* Disabled state */
.disabled,
[disabled] {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Selected/Active state */
.selected {
  background: var(--glass-bg-prominent);
  border-color: var(--color-border-strong);
}

/* ========== Print Styles ========== */
@media print {
  .reading-progress,
  .toc-sidebar,
  .back-to-top,
  .toc-mobile-toggle,
  .toc-mobile-panel,
  .article-actions,
  .section-anchor,
  .nav,
  .footer {
    display: none !important;
  }

  .research-layout {
    display: block;
    max-width: none;
  }

  .research-content {
    max-width: none;
  }

  .stat-card,
  .key-findings,
  .sources-section {
    break-inside: avoid;
    background: #f5f5f5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .section-header {
    break-after: avoid;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
  .research-hero {
    padding: calc(var(--nav-height) + var(--space-8)) var(--space-4) var(--space-8);
  }

  .research-hero h1 {
    font-size: var(--text-headline-lg);
  }

  .section-title {
    font-size: var(--text-title-lg);
  }

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

  .article-actions {
    flex-wrap: wrap;
  }

  /* Sprint 26-50 Responsive - Typography */
  .research-figure {
    margin: var(--space-6) calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .sidenote {
    margin-left: 0;
    margin-right: 0;
  }

  .section-divider {
    margin: var(--space-8) 0;
  }

  /* Sprint 26-50 Responsive - Stat Cards */
  .stat-card.compact {
    display: flex;
    width: 100%;
    margin: var(--space-2) 0;
  }

  .stat-card.featured {
    padding: var(--space-6);
  }

  .stat-card.featured .stat-card-value {
    font-size: var(--text-headline-lg);
  }

  .stat-card.featured .stat-card-icon {
    width: 56px;
    height: 56px;
  }

  .stat-card.featured .stat-card-icon .material-symbols-outlined {
    font-size: 28px;
  }

  .stat-card.horizontal .stat-card-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .stat-comparison {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .stat-comparison-divider {
    flex-direction: row;
    padding: var(--space-2) 0;
  }

  .stat-comparison-divider::before,
  .stat-comparison-divider::after {
    width: 40px;
    height: 1px;
  }

  .stat-row {
    flex-direction: column;
    gap: var(--space-2);
  }

  .stat-row-item {
    width: 100%;
    justify-content: space-between;
  }

  /* Sprint 26-50 Responsive - Key Findings */
  .key-findings-grid {
    grid-template-columns: 1fr;
  }

  .takeaway-box {
    flex-direction: column;
    text-align: center;
  }

  .takeaway-box-icon {
    margin: 0 auto var(--space-3);
  }

  .highlight-box {
    padding-left: var(--space-4);
  }

  .highlight-box::before {
    top: var(--space-3);
    bottom: var(--space-3);
  }
}

@media (max-width: 480px) {
  /* Very small screens */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card-inner {
    flex-direction: column;
  }

  .stat-card-icon {
    margin-bottom: var(--space-3);
  }

  .key-findings li {
    padding-left: var(--space-7);
  }

  .key-findings.compact li {
    padding-left: var(--space-5);
  }
}

/* ========== Light Theme Overrides ========== */
[data-theme="light"] .stat-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .citation-link::after {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toc-mobile-panel {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .toc-mobile-content {
  background: #ffffff;
}

/* Light Theme - Sprint 26-50 Components */
[data-theme="light"] .research-content blockquote {
  background: rgba(0, 0, 0, 0.02);
  border-left-color: var(--color-text-tertiary);
}

[data-theme="light"] .research-figure {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .research-content code {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .research-content pre {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidenote {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .stat-card.featured {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.02) 50%,
    rgba(0, 0, 0, 0.01) 100%
  );
}

[data-theme="light"] .stat-comparison {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .stat-row-item {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .highlight-box {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .takeaway-box {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.02) 100%
  );
}

[data-theme="light"] .key-findings.warning {
  background: linear-gradient(135deg,
    rgba(251, 191, 36, 0.12) 0%,
    rgba(0, 0, 0, 0.02) 100%
  );
}

[data-theme="light"] .key-findings.insight {
  background: linear-gradient(135deg,
    rgba(96, 165, 250, 0.08) 0%,
    rgba(0, 0, 0, 0.02) 100%
  );
}

/* ========== Light Theme - Sprint 51-75 Components ========== */

/* Citation Tooltip - Light Theme */
[data-theme="light"] .citation-tooltip {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

[data-theme="light"] .citation-tooltip::after {
  border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .citation-tooltip-source {
  color: var(--color-text-secondary);
}

[data-theme="light"] .citation-tooltip-year {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-tertiary);
}

[data-theme="light"] .citation-tooltip-link {
  color: var(--color-text);
}

[data-theme="light"] .citation-tooltip-link:hover {
  color: var(--color-text-secondary);
}

/* Footnote - Light Theme */
[data-theme="light"] .footnote-ref {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--color-text-tertiary);
}

[data-theme="light"] .footnote-ref:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .footnotes-section {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .footnote-item {
  border-left-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .footnote-item:hover {
  background: rgba(0, 0, 0, 0.02);
  border-left-color: var(--color-text-tertiary);
}

/* Research Table - Light Theme */
[data-theme="light"] .research-table {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .research-table th {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .research-table th.sortable:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .research-table td {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .research-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .research-table tbody tr.selected {
  background: rgba(0, 0, 0, 0.04);
}

/* Copy Button - Light Theme */
[data-theme="light"] .copy-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--color-text-tertiary);
}

[data-theme="light"] .copy-btn:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--color-text);
}

[data-theme="light"] .copy-feedback {
  background: var(--color-text);
  color: #ffffff;
}

/* Expandable Section - Light Theme */
[data-theme="light"] .expandable-section {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .expandable-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .expandable-body {
  border-top-color: rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.01);
}

/* Tooltip - Light Theme */
[data-theme="light"] .tooltip-trigger {
  border-bottom-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .tooltip-trigger .tooltip-icon {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-tertiary);
}

[data-theme="light"] .tooltip-content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .tooltip-content::after {
  border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tooltip-content.right::after {
  border-right-color: rgba(0, 0, 0, 0.1);
  border-top-color: transparent;
}

/* Progress Indicators - Light Theme */
[data-theme="light"] .section-progress {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .section-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .section-progress-fill {
  background: linear-gradient(90deg,
    var(--color-text-tertiary) 0%,
    var(--color-text) 100%
  );
}

/* Skip Link - Light Theme */
[data-theme="light"] .skip-link {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Focus Trap - Light Theme */
[data-theme="light"] [data-focus-trap]:focus-within {
  outline-color: rgba(0, 0, 0, 0.1);
}

/* Loading Spinner - Light Theme */
[data-theme="light"] .loading-spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--color-text);
}

/* Selected State - Light Theme */
[data-theme="light"] .selected {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

/* ========== Sprint 51-75 Responsive Adjustments ========== */

@media (max-width: 768px) {
  /* Citation Tooltip - Mobile */
  .citation-tooltip {
    max-width: calc(100vw - var(--space-8));
    left: var(--space-4);
    right: var(--space-4);
    transform: none;
  }

  .citation-tooltip::after {
    left: auto;
    right: var(--space-6);
  }

  /* Footnotes Section - Mobile */
  .footnotes-section {
    padding: var(--space-4);
    margin: var(--space-6) calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .footnote-item {
    padding: var(--space-3) var(--space-4);
  }

  /* Research Table - Mobile */
  .research-table {
    font-size: var(--text-label-sm);
  }

  .research-table th,
  .research-table td {
    padding: var(--space-2) var(--space-3);
  }

  .research-table-wrapper {
    margin: var(--space-4) calc(-1 * var(--space-4));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .research-table-wrapper .research-table {
    min-width: 500px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Expandable Section - Mobile */
  .expandable-header {
    padding: var(--space-4);
  }

  .expandable-body {
    padding: var(--space-4);
  }

  .expandable-section {
    margin: var(--space-4) calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Tooltip - Mobile */
  .tooltip-content {
    max-width: calc(100vw - var(--space-8));
    font-size: var(--text-label-sm);
  }

  /* Position tooltips above on mobile to avoid cut-off */
  .tooltip-content.right {
    left: 50%;
    bottom: calc(100% + 8px);
    top: auto;
    transform: translateX(-50%) translateY(4px);
  }

  .tooltip-content.right::after {
    left: 50%;
    bottom: -6px;
    top: auto;
    transform: translateX(-50%);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    border-top: 6px solid var(--color-border);
    border-bottom: none;
  }

  .tooltip-trigger:hover .tooltip-content.right {
    transform: translateX(-50%) translateY(0);
  }

  /* Section Progress - Mobile */
  .section-progress {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-3);
  }

  .section-progress-text {
    font-size: 11px;
  }

  /* Copy Button - Mobile */
  .copy-btn {
    opacity: 1;
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  /* Very small screens - Sprint 51-75 */

  .citation-tooltip-meta {
    flex-direction: column;
    gap: var(--space-2);
  }

  .footnotes-section-title {
    font-size: var(--text-body-md);
  }

  .footnote-number {
    min-width: 18px;
    font-size: 10px;
  }

  /* Stack accordion items */
  .accordion {
    gap: var(--space-2);
  }

  .accordion-item {
    margin: 0;
  }

  /* Simplify expandable sections */
  .expandable-toggle {
    font-size: 18px;
  }

  .expandable-title {
    font-size: var(--text-body-md);
  }
}

/* ========== Enhanced Print Styles - Sprint 51-75 ========== */
@media print {
  /* Hide interactive elements */
  .copy-btn,
  .expandable-toggle,
  .tooltip-icon,
  .tooltip-content,
  .citation-tooltip,
  .section-progress,
  .skip-link {
    display: none !important;
  }

  /* Expand all expandable sections for print */
  .expandable-body {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Show footnotes inline for print */
  .footnote-ref::after {
    content: " [" attr(data-footnote) "]";
    font-size: 0.8em;
    vertical-align: baseline;
  }

  /* Table print optimization */
  .research-table {
    page-break-inside: auto;
  }

  .research-table tr {
    page-break-inside: avoid;
  }

  .research-table thead {
    display: table-header-group;
  }

  /* Expandable sections print */
  .expandable-section {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  .expandable-header {
    background: #f5f5f5;
  }
}

/* ========== Sprint 76-100: Performance Optimizations ========== */

/* GPU-accelerated animations */
.fade-in,
.slide-up,
.stat-card,
.research-card,
.citation-tooltip,
.tooltip-content,
.expandable-body {
  will-change: transform, opacity;
}

/* Remove will-change after animation */
.fade-in.visible,
.slide-up.visible {
  will-change: auto;
}

/* Contain layout for independent components */
.stat-card,
.research-card,
.citation-tooltip,
.expandable-section,
.footnotes-section {
  contain: layout style;
}

/* Content-visibility for below-fold content */
.research-content section:nth-child(n+3) {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

/* Optimize font rendering */
.research-content {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== Sprint 76-100: High-DPI/Retina Support ========== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper borders on high-DPI */
  .stat-card,
  .research-card,
  .expandable-section,
  .research-table,
  .footnotes-section {
    border-width: 0.5px;
  }

  /* Crisp dividers */
  .section-divider::before {
    height: 0.5px;
  }

  /* Sharper focus rings */
  :focus-visible {
    outline-width: 1.5px;
  }
}

/* ========== Sprint 76-100: Additional Breakpoints ========== */

/* Large desktop (1440px+) */
@media (min-width: 1440px) {
  .research-content {
    max-width: 800px;
  }

  .stats-grid {
    gap: var(--space-8);
  }

  .research-content blockquote {
    margin-left: calc(-1 * var(--space-8));
    padding-left: var(--space-8);
  }

  .sidenote {
    margin-left: var(--space-12);
    max-width: 300px;
  }
}

/* Ultra-wide (1920px+) */
@media (min-width: 1920px) {
  .research-layout {
    max-width: 1600px;
  }

  .toc-sidebar {
    /* Ensure TOC never goes off-screen on ultra-wide displays */
    left: max(0px, calc((100vw - 1600px) / 2 - 280px));
  }
}

/* Small tablets (600px-768px) */
@media (max-width: 768px) and (min-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card.featured {
    grid-column: span 2;
  }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
  .research-hero {
    min-height: auto;
    padding: calc(var(--nav-height) + var(--space-6)) var(--space-4) var(--space-6);
  }

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

/* ========== Sprint 76-100: Browser Compatibility ========== */

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
  /* Fix backdrop-filter performance */
  .stat-card,
  .research-card,
  .toc-sidebar {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  /* Fix scroll behavior */
  .research-layout {
    -webkit-overflow-scrolling: touch;
  }
}

/* Firefox-specific fixes */
@supports (-moz-appearance: none) {
  /* Firefox scrollbar styling */
  .research-layout {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }

  .toc-content {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }
}

/* Edge/Chrome scrollbar styling */
.research-layout::-webkit-scrollbar,
.toc-content::-webkit-scrollbar,
.research-table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.research-layout::-webkit-scrollbar-track,
.toc-content::-webkit-scrollbar-track,
.research-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.research-layout::-webkit-scrollbar-thumb,
.toc-content::-webkit-scrollbar-thumb,
.research-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.research-layout::-webkit-scrollbar-thumb:hover,
.toc-content::-webkit-scrollbar-thumb:hover,
.research-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-strong);
}

/* ========== Sprint 76-100: Micro-interactions ========== */

/* Subtle hover lift for cards */
.stat-card,
.research-card {
  transition: transform var(--duration-medium-1) var(--easing-emphasized),
              box-shadow var(--duration-medium-1) var(--easing-emphasized);
}

/* Button press feedback */
.btn:active,
.copy-btn:active,
.expandable-header:active {
  transform: scale(0.98);
  transition-duration: var(--duration-short-2);
}

/* Link underline animation */
.research-content a:not(.citation-link):not(.btn) {
  text-decoration: none;
  background-image: linear-gradient(
    transparent calc(100% - 1px),
    var(--color-text-tertiary) 1px
  );
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size var(--duration-short-4) var(--easing-standard);
}

.research-content a:not(.citation-link):not(.btn):hover {
  background-size: 100% 100%;
}

/* Icon rotation on expand */
.expandable-toggle {
  transition: transform var(--duration-short-4) var(--easing-standard);
}

.expandable-section.open .expandable-toggle {
  transform: rotate(180deg);
}

/* Stat card value count-up preparation */
.stat-card-value[data-animate] {
  font-variant-numeric: tabular-nums;
}

/* ========== Sprint 76-100: Enhanced Accessibility ========== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .stat-card,
  .research-card,
  .expandable-section,
  .footnotes-section {
    border-width: 2px;
    border-color: var(--color-text);
  }

  .citation-link {
    text-decoration: underline;
  }

  .tooltip-trigger {
    border-bottom-width: 2px;
    border-bottom-style: solid;
  }

  .expandable-header:focus-visible,
  .copy-btn:focus-visible {
    outline-width: 3px;
    outline-offset: 3px;
  }
}

/* Reduced transparency for better readability */
@media (prefers-reduced-transparency: reduce) {
  .stat-card,
  .research-card,
  .toc-sidebar,
  .expandable-section {
    background: var(--color-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  [data-theme="light"] .stat-card,
  [data-theme="light"] .research-card,
  [data-theme="light"] .expandable-section {
    background: #ffffff;
  }
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators for all interactive elements */
.interactive:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* ========== Sprint 76-100: Dark Mode Refinements ========== */

[data-theme="dark"] {
  /* Subtle glow on interactive elements */
  --glow-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .research-card:hover {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 60px -10px var(--glow-color);
}

[data-theme="dark"] .expandable-section:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .research-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Dark mode code blocks enhancement */
[data-theme="dark"] .research-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .research-content code {
  background: rgba(255, 255, 255, 0.08);
}

/* ========== Sprint 76-100: Final Print Enhancements ========== */

@media print {
  /* Page setup */
  @page {
    margin: 1in;
    size: letter;
  }

  @page :first {
    margin-top: 0.5in;
  }

  /* Force colors for print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Typography adjustments for print */
  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000000;
    background: #ffffff;
  }

  .research-content {
    max-width: none;
    padding: 0;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Stat cards for print */
  .stat-card {
    background: #f8f8f8 !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .stat-card-value {
    color: #000000 !important;
  }

  /* Key findings for print */
  .key-findings {
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
  }

  .key-findings li::before {
    color: #666 !important;
  }

  /* Sources section for print */
  .sources-section {
    background: #f5f5f5 !important;
  }

  .source-item {
    border-bottom: 1px solid #ddd !important;
  }

  /* Links with URLs for print */
  .research-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
    word-break: break-all;
  }

  /* Hide decorative elements */
  .glow::before,
  .glass-shine,
  .section-anchor,
  .reading-progress {
    display: none !important;
  }

  /* Ensure images print */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Avoid orphans and widows */
  p, li {
    orphans: 3;
    widows: 3;
  }

  /* Force page breaks before major sections */
  .section-header[data-print-break="before"] {
    page-break-before: always;
  }
}

/* ========== Sprint 76-100: Selection Styling ========== */

::selection {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

[data-theme="light"] ::selection {
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
}

/* Code selection */
.research-content code::selection,
.research-content pre::selection,
.research-content pre *::selection {
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .research-content code::selection,
[data-theme="light"] .research-content pre::selection,
[data-theme="light"] .research-content pre *::selection {
  background: rgba(0, 0, 0, 0.2);
}

/* ========== Sprint 76-100: Final Utility Classes ========== */

/* Visibility utilities */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.visible {
  visibility: visible;
}

/* Spacing utilities */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-mono {
  font-family: var(--font-mono);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

/* Width utilities */
.w-full { width: 100%; }
.max-w-prose { max-width: 65ch; }
