/* === CSS Custom Properties — Style B Warm paper dark === */
:root {
  --color-bg: #1c1917;
  --color-bg-gradient: linear-gradient(180deg, #24201c 0%, #1c1917 100%);
  --color-bg-elevated: #292524;
  --color-surface: #292524;
  --color-surface-2: #35302c;
  --color-card: #2c2825;
  --color-card-hover: #35302c;
  --color-input: #1a1714;
  --color-text: #faf7f2;
  --color-text-secondary: #e7e0d6;
  --color-text-muted: #b5aa9c;
  --color-link: #fcd34d;
  --color-border: rgba(255, 248, 240, 0.10);
  --color-border-strong: rgba(255, 248, 240, 0.16);
  --color-border-subtle: rgba(255, 248, 240, 0.08);
  --color-accent: #f59e0b;
  --color-accent-gradient: linear-gradient(135deg, #f59e0b, #fbbf24);
  --color-accent-light: #fbbf24;
  --color-accent-soft: rgba(245, 158, 11, 0.14);
  --color-accent-border: rgba(245, 158, 11, 0.35);
  --color-accent-fill: rgba(245, 158, 11, 0.22);
  --color-fav: #fbbf24;
  --color-success: rgba(52, 211, 153, 0.18);
  --color-danger: #f87171;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --spacing: 22px;
  --spacing-sm: 12px;
  --spacing-xs: 8px;
  --max-width: 1320px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-card-hover: 0 14px 36px rgba(0, 0, 0, 0.34);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --focus-ring: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 14px;
}
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header === */
header {
  padding: 28px var(--spacing) 18px;
  background: var(--color-bg-gradient);
  border-bottom: 1px solid var(--color-border-subtle);
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing);
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
}
h1 {
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.04em;
}
header p {
  color: var(--color-text-secondary);
  font-size: 13px;
  max-width: 56ch;
}
nav {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}
/* Independent report bar under nav */
.report-bar {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}
/* Report entry pills (open centered report modal via app.js) */
nav a[data-report],
.report-bar a[data-report] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  border-radius: 999px;
  padding: 7px 14px;
  line-height: 1.2;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
nav a[data-report]:hover,
.report-bar a[data-report]:hover {
  border-color: var(--color-accent-border);
  color: var(--color-text);
  text-decoration: none;
}
nav a[data-report]:active,
.report-bar a[data-report]:active { transform: scale(0.97); }
nav a[data-report].active,
.report-bar a[data-report].active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent-light);
}
nav .fav-btn { margin-left: 0; }
.lang-switch { display: flex; gap: 6px; }
.lang-switch button {
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-input);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.lang-switch button:hover { border-color: var(--color-accent-border); }
.lang-switch button:active { transform: scale(0.97); }
.lang-switch button.active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent-light);
}

/* === Hero Metrics === */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}
.hero-stat {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.hero-stat b {
  font-size: 26px;
  font-weight: 700;
  display: block;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  /* override old gradient text clip */
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
  background-clip: initial;
}
.hero-stat .muted { font-size: 12px; color: var(--color-text-muted); }

/* === Charts row (under metrics) === */
.charts-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  margin: 14px auto 0;
  max-width: var(--max-width);
}
.chart-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.chart-card-head { margin-bottom: 8px; }
.chart-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.chart-card-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0;
}
.chart-container,
.chart-body {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 0;
}
.chart-container svg,
.chart-body svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* === Main Layout === */
main { padding: var(--spacing); max-width: var(--max-width); margin: 0 auto; }

/* === Utility === */
.hint { color: var(--color-text-muted); font-size: 12px; margin-bottom: 10px; }
.muted { color: var(--color-text-muted); font-size: 0.92em; }

/* === Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--color-card) 25%, var(--color-surface-2) 50%, var(--color-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 20px; margin-bottom: var(--spacing-xs); }

/* === Section === */
section { margin-bottom: 28px; }
section h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

/* === Discovery Zone === */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.discovery-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out),
    transform 160ms var(--ease-out);
  box-shadow: var(--shadow-card);
}
.discovery-card:hover {
  border-color: var(--color-accent-border);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.discovery-card:active { transform: scale(0.97); }

/* === Score Badge === */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-fill);
  color: var(--color-accent-light);
  border: 1px solid var(--color-accent-border);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  min-width: 30px;
  font-variant-numeric: tabular-nums;
}
.score-badge-large {
  font-size: 18px;
  padding: 4px 14px;
  min-width: 44px;
}

/* === Tool Overview === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.tool-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out),
    transform 160ms var(--ease-out);
  box-shadow: var(--shadow-card);
}
.tool-card:hover {
  border-color: var(--color-accent-border);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.tool-card:active { transform: scale(0.97); }
.tool-card h3 {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.tool-stats { font-size: 12px; color: var(--color-text-muted); }

/* === Color-coded Pills (desaturated) === */
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 248, 240, 0.06);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.pill-type-mcp-server { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border-color: transparent; }
.pill-type-skills { background: rgba(251, 191, 36, 0.12); color: #fde68a; border-color: transparent; }
.pill-type-rules { background: rgba(252, 165, 165, 0.12); color: #fecaca; border-color: transparent; }
.pill-type-agent-framework { background: rgba(251, 146, 60, 0.12); color: #fdba74; border-color: transparent; }
.pill-type-cli-tool { background: rgba(45, 212, 191, 0.12); color: #5eead4; border-color: transparent; }
.pill-type-tutorial { background: rgba(214, 211, 209, 0.12); color: #e7e5e4; border-color: transparent; }
.pill-curated {
  background: var(--color-accent-soft);
  color: var(--color-accent-light);
  border-color: var(--color-accent-border);
}

/* === Search Zone === */
.toolbar {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
  align-items: center;
}
input, select {
  padding: 7px 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-input);
  color: var(--color-text);
  font-size: 13px;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--color-accent-border);
  box-shadow: var(--focus-ring);
}
#q { min-width: min(280px, 100%); flex: 1 1 220px; }

/* Tag buttons */
.filter-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 220px;
  min-width: min(220px, 100%);
}
.filter-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 0;
  font-weight: 600;
}
.tag-group { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-btn {
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-input);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.tag-btn:hover { border-color: var(--color-accent-border); color: var(--color-text); }
.tag-btn:active { transform: scale(0.97); }
.tag-btn.active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent-light);
}

/* Mode toggle (radiogroup) */
.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.mode-toggle button {
  border: none;
  padding: 5px 12px;
  cursor: pointer;
  background: var(--color-input);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.mode-toggle button.active {
  background: var(--color-accent-soft);
  color: var(--color-accent-light);
}

/* Active filter chips */
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.filter-chip button {
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* Result count */
.result-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.clear-filters {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out);
  margin-left: 0;
}
.clear-filters:hover { border-color: var(--color-danger); color: var(--color-text); }

/* === Table === */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}
th {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  background: var(--color-card);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr { transition: background-color 100ms var(--ease-out); }
tbody tr:hover { background: var(--color-card-hover); }
.project-name { cursor: pointer; color: var(--color-link); font-size: 13px; }
.project-name:hover { text-decoration: underline; }

/* Sortable headers */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--color-accent-light); }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.page-btn { cursor: pointer; border: 1px solid var(--color-border); background: var(--color-card); color: var(--color-text-secondary); border-radius: var(--radius-xs); padding: 4px 12px; font-size: 13px; min-width: 32px; transition: all 0.15s; }
.page-btn:hover { border-color: var(--color-accent); color: var(--color-text); }
.page-btn.active { background: var(--color-accent); color: white; border-color: var(--color-accent); }
.page-ellipsis { color: var(--color-text-muted); padding: 0 4px; }
.page-info { color: var(--color-text-muted); font-size: 13px; margin-left: 8px; }

/* === Detail Panel === */
.detail-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border-strong);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  z-index: 100;
  overflow-y: auto;
  padding: 22px;
}
.detail-overlay.open {
  display: block;
  animation: slideIn 200ms var(--ease-out);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.detail-overlay h2 { margin-top: 0; font-size: 20px; letter-spacing: -0.02em; }
.detail-close {
  position: absolute;
  top: 14px; right: 14px;
  cursor: pointer;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 18px;
}
.detail-close:hover {
  color: var(--color-text);
  border-color: var(--color-accent-border);
}
.detail-section { margin-bottom: 18px; }
.detail-section h3 {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.score-bar {
  height: 8px;
  background: var(--color-surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.score-bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 4px;
  transition: width 0.3s var(--ease-out);
}

/* Score detail grid */
.score-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-detail-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 12px;
}
.score-detail-item .label { font-size: 12px; color: var(--color-text-muted); }
.score-detail-item .value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Detail loading */
.detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--color-text-muted);
}

/* === Favorites === */
.fav-btn {
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  transition:
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.fav-btn:hover { border-color: var(--color-fav); color: var(--color-fav); }
.fav-btn:active { transform: scale(0.97); }
.fav-btn.active { color: var(--color-fav); border-color: var(--color-fav); }
.fav-export-input {
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-input);
  color: var(--color-text);
  font-size: 12px;
  max-width: 280px;
}

/* === Error & Empty === */
.error-box, .empty-box {
  text-align: center;
  padding: 40px;
  color: var(--color-text-muted);
}
.error-box button, .empty-box button {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  cursor: pointer;
}
.error-box button:hover { border-color: var(--color-accent-border); }

/* === Report content (used in modal body) === */
.report-content { line-height: 1.7; font-size: 14px; }
.report-content h1 { font-size: 22px; margin: 14px 0 8px; letter-spacing: -0.02em; }
.report-content h2 { font-size: 17px; margin: 14px 0 6px; }
.report-content h3 { font-size: 14px; margin: 12px 0 4px; }
.report-content .table-scroll {
  overflow-x: auto;
  margin: 12px 0;
}
.report-content table {
  margin: 0;
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.report-content td, .report-content th {
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border-subtle);
}
.report-content th {
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  position: static;
}
.report-content code {
  background: var(--color-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.report-content ul { margin: 8px 0 8px 20px; }
.report-content pre {
  background: var(--color-surface-2);
  padding: 12px;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

/* === Report Modal (centered) === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 10, 9, 0.62);
  backdrop-filter: blur(2px);
}
.modal {
  position: fixed;
  z-index: 210;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 32px));
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: modalIn 180ms var(--ease-out);
}
.modal-backdrop[hidden],
.modal[hidden] {
  display: none !important;
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--color-border-subtle);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.modal-head .meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}
.modal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.modal-close:hover {
  border-color: var(--color-accent-border);
  color: var(--color-text);
}
.modal-close:active { transform: scale(0.97); }
.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(255, 248, 240, 0.02);
}
.modal-tabs [role="tab"] {
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.modal-tabs [role="tab"]:hover {
  border-color: var(--color-accent-border);
  color: var(--color-text);
}
.modal-tabs [role="tab"]:active { transform: scale(0.97); }
.modal-tabs [role="tab"].active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent-light);
}
.modal-body {
  padding: 14px 18px 20px;
  overflow-y: auto;
  min-height: 120px;
}

/* === Footer === */
footer {
  padding: var(--spacing);
  text-align: center;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
  font-size: 12px;
}
footer a { color: var(--color-link); }

/* === Responsive === */
@media (max-width: 1100px) {
  .charts-row { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  main { padding: 14px; }
  header { padding: 18px 14px 12px; }
  .topbar { flex-direction: column; }
  .lang-switch { margin-top: 0; }
  .detail-overlay { width: 100%; }
  .discovery-grid, .tool-grid { grid-template-columns: 1fr; }
  .table-wrapper table { min-width: 600px; }
  h1 { font-size: 22px; }
  section h2 { font-size: 16px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-stat { padding: 12px; min-width: 0; }
  .hero-stat b { font-size: 22px; }
  .score-detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .discovery-card:hover,
  .tool-card:hover,
  nav a[data-report]:active,
  .tag-btn:active,
  .fav-btn:active,
  .discovery-card:active,
  .tool-card:active,
  .modal-close:active,
  .modal-tabs [role="tab"]:active {
    transform: none;
  }
  .modal { animation: none; }
}
