/* ======================================================
   TRUMP PARDONS EXPLORER — DESIGN SYSTEM
   ====================================================== */

/* --- DESIGN TOKENS --- */
:root {
  /* Light Mode — matches hackingbutlegal.com */
  --bg: #f7f7f2;
  --bg-card: #ffffff;
  --bg-card-alt: #eeeee9;
  --bg-nav: #262a33;
  --bg-nav-hover: #33373f;
  --text: #363737;
  --text-muted: #838482;
  --text-inverse: #f7f7f2;
  --accent: #0f5499;
  --accent-light: #1a6ab8;
  --accent-bg: rgba(15, 84, 153, 0.08);
  --border: #dededa;
  --border-light: #e8e8e3;
  --table-header-bg: #262a33;
  --table-header-text: #f7f7f2;
  --table-stripe: rgba(38, 42, 51, 0.03);
  --table-hover: rgba(15, 84, 153, 0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --search-bg: rgba(255,255,255,0.12);
  --search-bg-focus: rgba(255,255,255,0.2);
  --overlay: rgba(0,0,0,0.4);
  --stat-gradient: linear-gradient(135deg, #ffffff 0%, #f7f7f2 100%);

  /* Typography — system sans headings, Spectral serif body */
  --font-heading: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Spectral', Georgia, 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --max-width: 1280px;
  --header-height: 64px;
}

/* --- DARK MODE --- matches hackingbutlegal.com cover/dark palette */
[data-theme="dark"] {
  --bg: #1a1d24;
  --bg-card: #262a33;
  --bg-card-alt: #2e323b;
  --bg-nav: #1a1d24;
  --bg-nav-hover: #33373f;
  --text: #e8e8e3;
  --text-muted: #9a9b98;
  --text-inverse: #1a1d24;
  --accent: #5a9fd4;
  --accent-light: #78b4e0;
  --accent-bg: rgba(90, 159, 212, 0.12);
  --border: #3a3e47;
  --border-light: #33373f;
  --table-header-bg: #1a1d24;
  --table-header-text: #e8e8e3;
  --table-stripe: rgba(255,255,255,0.02);
  --table-hover: rgba(90, 159, 212, 0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --search-bg: rgba(255,255,255,0.08);
  --search-bg-focus: rgba(255,255,255,0.14);
  --overlay: rgba(0,0,0,0.6);
  --stat-gradient: linear-gradient(135deg, #262a33 0%, #2e323b 100%);
}

/* ======================================================
   GLOBAL TYPOGRAPHY
   ====================================================== */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* UI elements use system sans for crispness in data-heavy views */
.site-header,
.header-brand,
.tab-btn,
.quick-nav-btn,
.stat-card,
.stat-number,
.stat-label,
table,
th,
td,
.table-count,
.tag,
.global-search,
#mobile-search-input,
.search-dropdown,
.mobile-nav,
.back-to-top,
.site-footer,
.note-box,
.source-note,
.theme-toggle,
button,
input,
select {
  font-family: var(--font-ui);
}
h4 { font-size: 1rem; font-weight: 600; }

.prose {
  line-height: 1.7;
  max-width: 100ch;
}
.prose p { margin-bottom: var(--space-4); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}
.prose a:hover { color: var(--accent-light); }

.source-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.source-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

blockquote {
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  margin: var(--space-4) 0;
}
blockquote p { margin: 0; }

/* ======================================================
   HEADER
   ====================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  color: var(--text-inverse);
  height: var(--header-height);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .site-header {
  color: var(--text);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-brand {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  color: #FFFFFF;
}

[data-theme="dark"] .header-brand {
  color: var(--text);
}

/* Tab Navigation in Header */
.header-tabs {
  display: flex;
  gap: var(--space-1);
  margin-left: var(--space-6);
  flex: 1;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.header-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

[data-theme="dark"] .tab-btn {
  color: var(--text-muted);
}

.tab-btn:hover {
  color: #FFFFFF;
  background: var(--bg-nav-hover);
}

[data-theme="dark"] .tab-btn:hover {
  color: var(--text);
  background: var(--bg-nav-hover);
}

.tab-btn.active {
  color: #FFFFFF;
  background: var(--bg-nav-hover);
}

[data-theme="dark"] .tab-btn.active {
  color: var(--text);
  background: var(--bg-nav-hover);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

[data-theme="dark"] .tab-btn.active::after {
  background: var(--accent);
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Global Search */
.global-search-wrapper {
  position: relative;
}

.global-search {
  background: var(--search-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  padding-left: 36px;
  width: 220px;
  font-size: 13px;
  color: #FFFFFF;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .global-search {
  color: var(--text);
}

.global-search::placeholder {
  color: rgba(255,255,255,0.45);
}

[data-theme="dark"] .global-search::placeholder {
  color: var(--text-muted);
}

.global-search:focus {
  background: var(--search-bg-focus);
  border-color: rgba(255,255,255,0.2);
  width: 300px;
  outline: none;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
}

[data-theme="dark"] .search-icon {
  color: var(--text-muted);
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 380px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
}

.search-dropdown.visible { display: block; }

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text);
}

.search-result-item:hover {
  background: var(--table-hover);
}

.search-result-name {
  font-weight: 600;
  font-size: 14px;
}

.search-result-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
}

.tag-pardon { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.tag-commutation { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.tag-first { background: rgba(15, 84, 153, 0.1); color: var(--accent); }
.tag-second { background: rgba(79, 70, 229, 0.1); color: #4f46e5; }
.tag-jan6 { background: rgba(217, 119, 6, 0.1); color: #b45309; }
.tag-electors { background: rgba(168, 85, 247, 0.1); color: #7c3aed; }

[data-theme="dark"] .tag-pardon { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
[data-theme="dark"] .tag-commutation { background: rgba(37, 99, 235, 0.2); color: #60a5fa; }
[data-theme="dark"] .tag-first { background: rgba(184, 76, 76, 0.15); color: var(--accent-light); }
[data-theme="dark"] .tag-second { background: rgba(79, 70, 229, 0.15); color: #818cf8; }
[data-theme="dark"] .tag-jan6 { background: rgba(217, 119, 6, 0.15); color: #f59e0b; }
[data-theme="dark"] .tag-electors { background: rgba(168, 85, 247, 0.15); color: #a78bfa; }

.search-no-results {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: all var(--transition-fast);
}

[data-theme="dark"] .theme-toggle {
  color: var(--text-muted);
}

.theme-toggle:hover {
  background: var(--bg-nav-hover);
  color: #FFFFFF;
}

[data-theme="dark"] .theme-toggle:hover {
  color: var(--text);
}

.theme-toggle svg { width: 20px; height: 20px; }

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .mobile-menu-btn {
  color: var(--text-muted);
}

.mobile-menu-btn:hover {
  background: var(--bg-nav-hover);
}

.mobile-search-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .mobile-search-btn {
  color: var(--text-muted);
}

/* ======================================================
   MOBILE NAV PANEL
   ====================================================== */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 150;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.mobile-nav-overlay.visible {
  display: block;
  opacity: 1;
}

.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-card);
  z-index: 151;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  padding: var(--space-6);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.mobile-nav-panel.open {
  transform: translateX(0);
}

.mobile-nav-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-left: auto;
  margin-bottom: var(--space-4);
}

.mobile-nav-close:hover { background: var(--table-hover); }

.mobile-nav-item {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
}

/* Mobile Search Expansion */
.mobile-search-bar {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--bg-nav);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
}

.mobile-search-bar.visible {
  display: block;
}

.mobile-search-bar input {
  width: 100%;
  background: var(--search-bg-focus);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 15px;
  color: #FFFFFF;
}

[data-theme="dark"] .mobile-search-bar input {
  color: var(--text);
}

.mobile-search-bar input::placeholder {
  color: rgba(255,255,255,0.45);
}

/* Mobile Search Dropdown */
.mobile-search-dropdown {
  display: none;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: var(--space-2);
}

.mobile-search-dropdown.visible {
  display: block;
}

/* ======================================================
   MAIN CONTENT AREA
   ====================================================== */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  min-height: calc(100vh - var(--header-height) - 120px);
}

/* Tab Panels */
.tab-panel {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tab-panel.active {
  display: block;
  opacity: 1;
}

/* Section spacing within panels */
.panel-section {
  margin-bottom: var(--space-12);
}

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

/* ======================================================
   OVERVIEW / DASHBOARD
   ====================================================== */
.hero-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.hero-meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-meta a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hero-rule {
  border: none;
  border-top: 2px solid var(--accent);
  width: 60px;
  margin: var(--space-4) 0;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.stat-card {
  background: var(--stat-gradient);
  border: 1px solid var(--border-light);
  border-bottom: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.01em;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-2);
  line-height: 1.4;
}

/* Summary Tables */
.summary-table-wrap {
  overflow-x: auto;
  margin: var(--space-4) 0;
  position: relative;
}

/* Scroll hint fade for overflowing tables */
.summary-table-wrap.has-scroll::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.summary-table-wrap.scrolled-end::after {
  display: none;
}

.summary-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 14px;
  min-width: 480px;
  width: 100%;
}

.summary-table thead th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  text-align: left;
  font-size: 13px;
}

.summary-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.summary-table tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

.summary-table tbody tr:last-child td {
  border-bottom: none;
  font-weight: 600;
}

/* Note Box */
.note-box {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-muted);
  margin: var(--space-4) 0;
  line-height: 1.6;
}

.note-box a {
  color: var(--accent);
  text-decoration: underline;
}

/* Quick Nav Links */
.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.quick-nav-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.quick-nav-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ======================================================
   DATA TABLES
   ====================================================== */
.section-heading {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 3px solid var(--accent);
}

.subsection-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.date-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.table-search-input {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--transition-fast);
}

.table-search-input:focus {
  border-color: var(--accent);
  outline: none;
}

.table-count {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Table Container */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: var(--space-3) 0 var(--space-6);
}

.data-table {
  font-size: 14px;
  min-width: 600px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table thead th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.data-table thead th:hover {
  background: var(--bg-nav-hover);
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.5;
}

.data-table thead th.sort-asc .sort-indicator,
.data-table thead th.sort-desc .sort-indicator {
  opacity: 1;
}

.data-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.5;
}

.data-table tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

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

.data-table tbody tr.highlight-row {
  background: var(--accent-bg) !important;
  animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
  0% { background: rgba(15, 84, 153, 0.25); }
  100% { background: var(--accent-bg); }
}

.num-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  width: 40px;
}

.name-cell {
  font-weight: 500;
  white-space: nowrap;
}

.data-table a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Pull quote */
.pull-quote {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  padding: var(--space-6);
  border-left: 4px solid var(--accent);
  background: var(--bg-card-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-6) 0;
  line-height: 1.6;
}

/* Analysis heading */
.analysis-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--text);
}

/* Sources list */
.sources-list {
  counter-reset: source-counter;
  padding-left: 0;
}

.sources-list li {
  counter-increment: source-counter;
  margin-bottom: var(--space-3);
  padding-left: var(--space-8);
  position: relative;
  font-size: 14px;
  line-height: 1.6;
}

.sources-list li::before {
  content: counter(source-counter) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
}

.sources-list a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sources-list-offset {
  counter-reset: source-counter 7;
}

/* ======================================================
   BACK TO TOP
   ====================================================== */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-normal);
  z-index: 50;
}

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

.back-to-top:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.back-to-top svg { width: 20px; height: 20px; }

/* ======================================================
   FOOTER
   ====================================================== */
.site-footer {
  background: var(--bg-nav);
  color: rgba(255,255,255,0.6);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  margin-top: var(--space-12);
}

[data-theme="dark"] .site-footer {
  background: #14161c;
  color: var(--text-muted);
}

.site-footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: underline;
  text-underline-offset: 2px;
}

[data-theme="dark"] .site-footer a {
  color: var(--text);
}

.site-footer a:hover { color: #FFFFFF; }

/* ======================================================
   TABLET / INTERMEDIATE RESPONSIVE
   ====================================================== */
@media (min-width: 1025px) and (max-width: 1200px) {
  .global-search {
    width: 160px;
  }
  .global-search:focus {
    width: 200px;
  }
  .tab-btn {
    padding: var(--space-2) var(--space-2);
    font-size: 13px;
  }
}

/* ======================================================
   MOBILE RESPONSIVE
   ====================================================== */
@media (max-width: 1024px) {
  :root {
    --header-height: 56px;
  }

  .header-tabs { display: none; }
  .global-search-wrapper { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-search-btn { display: flex; }

  .header-inner {
    padding: 0 var(--space-4);
  }

  .header-brand { font-size: 1rem; }

  .main-content {
    padding: var(--space-5) var(--space-4);
  }

  .hero-title { font-size: 1.35rem; }

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

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

  .stat-number { font-size: 1.75rem; }

  .section-heading { font-size: 1.25rem; }

  .global-search:focus { width: 220px; }

  /* Mobile Card View for Data Tables */
  .table-container.mobile-cards {
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .table-container.mobile-cards .data-table {
    min-width: 0;
  }

  .table-container.mobile-cards .data-table thead { display: none; }

  .table-container.mobile-cards .data-table tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
  }

  .table-container.mobile-cards .data-table tbody tr:nth-child(even) {
    background: var(--bg-card);
  }

  .table-container.mobile-cards .data-table tbody td {
    display: block;
    padding: var(--space-1) 0;
    border-bottom: none;
    font-size: 13px;
  }

  .table-container.mobile-cards .data-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 2px;
  }

  .table-container.mobile-cards .data-table tbody td.num-cell {
    display: none;
  }

  .table-container.mobile-cards .name-cell {
    font-size: 15px;
    font-weight: 600;
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-light);
  }

  .table-container.mobile-cards .name-cell::before {
    display: none;
  }

  .search-dropdown {
    min-width: auto;
    left: -120px;
    right: -16px;
  }

  .pull-quote {
    font-size: 1rem;
    padding: var(--space-4);
  }


  .quick-nav {
    gap: var(--space-2);
  }

  .quick-nav-btn {
    font-size: 12px;
    padding: var(--space-2) var(--space-3);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

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

  .stat-number { font-size: 1.5rem; }
  .stat-label { font-size: 12px; }

  .hero-title { font-size: 1.2rem; }
}
