/* ============================================
   DESIGN TOKENS — Dark editorial theme
   ============================================ */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 720px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'Instrument Serif', 'Georgia', serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
}

/* ============================================
   LIGHT MODE (default)
   ============================================ */
:root, [data-theme="light"] {
  --color-bg:             #f7f6f2;
  --color-surface:        #f0eeea;
  --color-surface-2:      #e8e6e1;
  --color-border:         #d4d1ca;
  --color-text:           #1a1815;
  --color-text-muted:     #6b6a65;
  --color-text-faint:     #9e9d98;
  --color-text-inverse:   #f7f6f2;
  --color-primary:        #9b2c2c;
  --color-primary-hover:  #7b2323;
  --color-accent:         #01696f;
  --color-accent-light:   #e6f3f4;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.1);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.14);
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --color-bg:             #0f0e0c;
  --color-surface:        #1a1916;
  --color-surface-2:      #242320;
  --color-border:         #333230;
  --color-text:           #d9d7d2;
  --color-text-muted:     #8a8884;
  --color-text-faint:     #5e5d5a;
  --color-text-inverse:   #0f0e0c;
  --color-primary:        #e05555;
  --color-primary-hover:  #c94444;
  --color-accent:         #5eb8bf;
  --color-accent-light:   #1e2d2e;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0f0e0c;
    --color-surface:        #1a1916;
    --color-surface-2:      #242320;
    --color-border:         #333230;
    --color-text:           #d9d7d2;
    --color-text-muted:     #8a8884;
    --color-text-faint:     #5e5d5a;
    --color-text-inverse:   #0f0e0c;
    --color-primary:        #e05555;
    --color-primary-hover:  #c94444;
    --color-accent:         #5eb8bf;
    --color-accent-light:   #1e2d2e;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  }
}

/* Chart colors (consistent across modes) */
:root {
  --chart-1: #e05555;
  --chart-2: #5eb8bf;
  --chart-3: #d19900;
  --chart-4: #7a39bb;
  --chart-5: #437a22;
  --chart-6: #da7101;
  --chart-7: #006494;
  --chart-8: #a13544;
}

/* ============================================
   LAYOUT
   ============================================ */
.page-wrapper {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.narrow {
  max-width: var(--content-narrow);
  margin-inline: auto;
}

section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-24));
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  /* Needed for reading progress bar positioning */
  isolation: isolate;
}

.header-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}

.header-nav a:hover {
  color: var(--color-text);
}

.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

@media (max-width: 768px) {
  .header-nav a { display: none; }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
  text-align: center;
}

.hero-overline {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 14ch;
  margin-inline: auto;
}

.hero h1 em {
  color: var(--color-primary);
  font-style: italic;
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-10);
  max-width: 800px;
  margin-inline: auto;
}

.hero-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums lining-nums;
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: var(--content-narrow);
  margin-inline: auto;
}

.toc h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

.toc-list {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.toc-list a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.toc-list a:hover {
  color: var(--color-primary);
}

.toc-num {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--color-primary);
  flex-shrink: 0;
  width: 2ch;
}

/* ============================================
   SECTION STYLING
   ============================================ */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

.content-section h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.content-section p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

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

/* ============================================
   CHARTS
   ============================================ */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: var(--space-6);
  margin-block: var(--space-8);
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.chart-card h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.chart-card .chart-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 280px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-full {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-block: var(--space-8);
}

.chart-full h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.chart-full .chart-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

.chart-full .chart-wrapper {
  aspect-ratio: 2.2 / 1;
}

.chart-source-note {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.45;
}

.chart-source-line {
  margin: 0;
}

.chart-source-subnote {
  margin-top: 2px;
  opacity: 0.9;
}

.chart-source-note a {
  color: var(--color-text-faint);
  text-decoration: none;
}

.chart-source-note a:hover {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.chart-wrapper--grievance {
  aspect-ratio: 2 / 1;
}

.chart-wrapper--discrimination {
  aspect-ratio: 3 / 1;
  min-height: 200px;
}

@media (max-width: 600px) {
  .chart-full .chart-wrapper {
    aspect-ratio: 3 / 4;
    min-height: 320px;
    height: 340px;
  }

  .chart-full .chart-wrapper.chart-wrapper--grievance {
    aspect-ratio: 1 / 1;
    min-height: 280px;
    height: 280px;
  }

  .chart-full .chart-wrapper.chart-wrapper--discrimination {
    aspect-ratio: 4 / 3;
    min-height: 220px;
    height: 240px;
  }

  .chart-wrapper {
    aspect-ratio: 1 / 1;
    min-height: 300px;
    height: 300px;
  }

  .chart-card {
    padding: var(--space-5);
  }

  .chart-full {
    padding: var(--space-5);
  }

  .chart-card h4 {
    font-size: var(--text-base);
  }

  .chart-full h4 {
    font-size: var(--text-base);
  }
}

/* ============================================
   DATA TABLE
   ============================================ */
.data-table-wrapper {
  overflow-x: auto;
  margin-block: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.data-table {
  width: 100%;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums lining-nums;
}

.data-table thead {
  background: var(--color-surface-2);
}

.data-table th {
  font-weight: 600;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

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

.data-table tbody tr:hover {
  background: var(--color-surface);
}

.data-table .highlight {
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================
   CALLOUT BOX
   ============================================ */
.callout {
  background: var(--color-surface);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-6);
  margin-block: var(--space-8);
}

.callout p {
  color: var(--color-text);
  margin-bottom: 0;
}

.callout strong {
  color: var(--color-primary);
}

/* ============================================
   BULLET LIST
   ============================================ */
.evidence-list {
  list-style: none;
  display: grid;
  gap: var(--space-4);
  margin-block: var(--space-6);
}

.evidence-list li {
  padding-left: var(--space-6);
  position: relative;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.evidence-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.6;
}

.evidence-list li strong {
  color: var(--color-text);
}

/* ============================================
   SOURCE TAG
   ============================================ */
.source-tag {
  display: inline;
  font-size: var(--text-xs);
  color: var(--color-accent);
  text-decoration: none;
  vertical-align: super;
  line-height: 1;
}

.source-tag:hover {
  text-decoration: underline;
}

/* ============================================
   VERDICT SECTION
   ============================================ */
.verdict {
  text-align: center;
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.verdict h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  max-width: 1000px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  text-align: left;
}

.verdict-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.verdict-item .fail {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.verdict-item h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.verdict-item p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.verdict-closing {
  max-width: 60ch;
  margin-inline: auto;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   SOURCES SECTION
   ============================================ */
.sources-grid {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.source-item {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.5;
}

.source-item .num {
  color: var(--color-accent);
  flex-shrink: 0;
  font-weight: 600;
}

.source-item a {
  color: var(--color-accent);
  text-decoration: none;
  word-break: break-all;
}

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

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.site-footer p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-inline: auto;
}

.site-footer a {
  color: var(--color-text-faint);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-text-muted);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Divider */
.section-divider {
  width: 48px;
  height: 2px;
  background: var(--color-primary);
  margin: var(--space-10) auto;
  opacity: 0.4;
}

/* ============================================
   MOBILE-FIRST EXCELLENCE
   ============================================ */

/* --- Mobile Navigation Drawer --- */
.mobile-nav-toggle {
  display: none;
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

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

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 80vw);
  background: var(--color-bg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: var(--space-8) var(--space-6);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
}

.mobile-nav-drawer.active {
  pointer-events: auto;
  transform: translateX(0);
}

.mobile-nav-drawer .drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav-drawer .drawer-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
}

.mobile-nav-drawer .drawer-close {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-drawer .drawer-close:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.mobile-nav-drawer nav {
  display: grid;
  gap: var(--space-1);
}

.mobile-nav-drawer nav a {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.mobile-nav-drawer nav a:hover,
.mobile-nav-drawer nav a:active {
  color: var(--color-text);
  background: var(--color-surface);
}

.mobile-nav-drawer nav a .nav-num {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: var(--text-sm);
  flex-shrink: 0;
  width: 2.5ch;
}

/* --- Mobile TOC Floating Button --- */
.mobile-toc-fab {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-4);
  z-index: 100;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-toc-fab:active {
  transform: scale(0.92);
}

/* --- Mobile reading progress bar --- */
.reading-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--color-primary);
  z-index: 10;
  transition: width 50ms linear;
}

@media (max-width: 768px) {
  /* Header mobile adjustments */
  .mobile-nav-toggle {
    display: flex !important;
  }

  .mobile-nav-overlay,
  .mobile-nav-drawer {
    display: block !important;
  }

  .mobile-toc-fab {
    display: flex !important;
  }

  .site-header {
    padding: var(--space-3) var(--space-4);
  }

  .header-nav {
    gap: var(--space-3);
  }

  /* Hero mobile refinements */
  .hero {
    padding-block: var(--space-10) var(--space-8);
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
    max-width: 16ch;
  }

  .hero-sub {
    font-size: var(--text-sm);
    max-width: 38ch;
    line-height: 1.6;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-8);
  }

  .hero-stat {
    padding: var(--space-4) var(--space-3);
  }

  .hero-stat-value {
    font-size: var(--text-lg);
  }

  .hero-stat-label {
    font-size: 0.7rem;
    line-height: 1.35;
  }

  /* Section spacing */
  section {
    padding-block: var(--space-8);
  }

  .page-wrapper {
    padding-inline: var(--space-4);
  }

  .section-divider {
    margin: var(--space-6) auto;
  }

  /* Section headings */
  .section-label {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    margin-bottom: var(--space-2);
  }

  .content-section h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
  }

  .content-section h3 {
    font-size: var(--text-base);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
  }

  .content-section p {
    font-size: 0.925rem;
    line-height: 1.65;
    margin-bottom: var(--space-3);
  }

  /* TOC mobile */
  .toc {
    padding: var(--space-5);
  }

  .toc h2 {
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
  }

  .toc-list a {
    font-size: 0.85rem;
    padding: var(--space-1) 0;
  }

  /* Chart improvements */
  .chart-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-block: var(--space-6);
  }

  .chart-card,
  .chart-full {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }

  .chart-card h4,
  .chart-full h4 {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: var(--space-1);
  }

  .chart-card .chart-subtitle,
  .chart-full .chart-subtitle {
    font-size: 0.7rem;
    line-height: 1.4;
    margin-bottom: var(--space-3);
  }

  .chart-source-note {
    font-size: 0.7rem;
  }

  .chart-wrapper {
    aspect-ratio: 4 / 3;
    min-height: 260px;
    /* Safari fallback: explicit height when aspect-ratio fails in grid */
    height: 260px;
  }

  .chart-full .chart-wrapper {
    aspect-ratio: 3 / 4;
    min-height: 300px;
    height: 320px;
  }

  .chart-full .chart-wrapper.chart-wrapper--grievance {
    aspect-ratio: 1 / 1;
    min-height: 280px;
    height: 280px;
  }

  /* Discrimination chart needs more height for labels */
  .chart-full .chart-wrapper.chart-wrapper--discrimination {
    aspect-ratio: 4 / 3;
    min-height: 220px;
    height: 240px;
  }

  /* Data table mobile */
  .data-table-wrapper {
    position: relative;
    margin-block: var(--space-4);
  }

  .data-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, var(--color-bg) 90%);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    pointer-events: none;
    z-index: 1;
  }

  .data-table {
    font-size: 0.8rem;
  }

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

  .data-table th:first-child,
  .data-table td:first-child {
    white-space: normal;
    min-width: 100px;
  }

  /* Callout mobile */
  .callout {
    padding: var(--space-4);
    margin-block: var(--space-6);
    border-left-width: 2px;
  }

  .callout p {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  /* Evidence list mobile */
  .evidence-list {
    gap: var(--space-3);
    margin-block: var(--space-4);
  }

  .evidence-list li {
    font-size: 0.875rem;
    padding-left: var(--space-5);
    line-height: 1.6;
  }

  .evidence-list li::before {
    width: 6px;
    height: 6px;
    top: 0.55em;
  }

  /* Source tags — bigger touch targets */
  .source-tag {
    font-size: 0.7rem;
    padding: 2px 4px;
    margin: 0 1px;
  }

  /* Verdict mobile */
  .verdict {
    padding-block: var(--space-8) var(--space-10);
  }

  .verdict h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-6);
  }

  .verdict-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
  }

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

  .verdict-item h4 {
    font-size: 0.9rem;
  }

  .verdict-item p {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .verdict-closing {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  /* Sources mobile */
  .sources-grid {
    gap: var(--space-3);
  }

  .source-item {
    font-size: 0.75rem;
    gap: var(--space-2);
    line-height: 1.45;
  }

  /* Footer mobile */
  .site-footer {
    padding: var(--space-6) var(--space-4);
    padding-bottom: calc(var(--space-6) + 60px); /* Space for FAB */
  }

  .site-footer p {
    font-size: 0.7rem;
    line-height: 1.5;
  }

  /* SVG feedback loop — prevent clipping */
  .feedback-loop-wrapper {
    overflow: visible;
    padding: var(--space-4) var(--space-2);
  }

  .feedback-loop-wrapper svg {
    max-width: 100%;
    overflow: visible;
  }

  /* Reveal animations — faster on mobile */
  .reveal {
    transform: translateY(12px);
  }
}

/* Extra small phones (< 360px) */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stat-value {
    font-size: var(--text-base);
  }

  .verdict-grid {
    gap: var(--space-2);
  }
}
