:root {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(0.975 0.004 255);
  --surface-strong: oklch(0.94 0.008 255);
  --ink: oklch(0.23 0.035 255);
  --ink-strong: oklch(0.14 0.025 255);
  --muted: oklch(0.44 0.03 255);
  --faint: oklch(0.49 0.025 255);
  --border: oklch(0.875 0.012 255);
  --border-strong: oklch(0.77 0.025 255);
  --accent: oklch(0.48 0.19 258);
  --accent-hover: oklch(0.42 0.19 258);
  --accent-soft: oklch(0.95 0.028 258);
  --accent-ink: oklch(0.31 0.145 258);
  --success: oklch(0.43 0.105 150);
  --success-soft: oklch(0.95 0.025 150);
  --warning: oklch(0.49 0.13 75);
  --warning-soft: oklch(0.95 0.035 80);
  --danger: oklch(0.48 0.17 25);
  --danger-soft: oklch(0.95 0.03 25);
  --info: oklch(0.48 0.12 220);
  --info-soft: oklch(0.95 0.025 220);
  --focus: oklch(0.58 0.2 258);
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --content-width: 1440px;
  --radius: 8px;
  --radius-large: 12px;
  --z-sticky: 20;
}

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

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink-strong);
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-sticky) + 1);
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink-strong);
  color: var(--bg);
  transform: translateY(-160%);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.skip-link:focus {
  color: var(--bg);
  transform: translateY(0);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  width: min(100% - 40px, var(--content-width));
  min-height: 64px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-strong);
  font-size: 0.94rem;
  font-weight: 720;
  letter-spacing: -0.012em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink-strong);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-link::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: transparent;
  content: "";
}

.nav-link:hover {
  color: var(--ink-strong);
}

.nav-link.is-active {
  color: var(--accent-ink);
}

.nav-link.is-active::after {
  background: var(--accent);
}

.nav-toggle {
  display: none;
  min-height: 40px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 0.875rem;
  font-weight: 650;
}

.language-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  margin-left: 12px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.language-switch a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.language-switch a:hover {
  color: var(--ink-strong);
}

.language-switch a[aria-current="true"] {
  background: var(--bg);
  color: var(--accent-ink);
}

.page-shell {
  width: min(100% - 40px, var(--content-width));
  min-height: calc(100vh - 142px);
  margin: 0 auto;
  padding: 42px 0 72px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 2rem;
  font-weight: 740;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}

.page-heading p {
  max-width: 72ch;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  text-wrap: pretty;
}

.page-heading .as-of {
  flex: 0 0 auto;
  margin: 0 0 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: -10px 0 28px;
  padding: 13px 15px;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--ink);
}

.notice p {
  margin: 0;
  font-size: 0.9rem;
}

.notice-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--warning);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 800;
}

section + section,
.split-layout + section,
section + .split-layout {
  margin-top: 48px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.2rem;
  font-weight: 720;
  letter-spacing: -0.018em;
  line-height: 1.25;
  text-wrap: balance;
}

.section-heading h3 {
  margin: 0;
}

.section-heading p {
  max-width: 72ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-wrap: pretty;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.text-link,
.external-link {
  font-size: 0.84rem;
  font-weight: 650;
  white-space: nowrap;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-block: 1px solid var(--border-strong);
}

.metric-strip-wide {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.metric-strip > div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}

.metric-strip > div:first-child {
  padding-left: 0;
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip dt,
.run-counts dt,
.source-strip dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.metric-strip dd {
  margin: 7px 0 0;
  color: var(--ink-strong);
  font-family: var(--font-mono);
  font-size: 1.38rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.metric-strip .date-value {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.value-danger {
  color: var(--danger) !important;
}

.coverage-row {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
}

.coverage-row > div {
  flex: 0 0 auto;
}

.coverage-label {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 650;
}

.muted,
.coverage-row .muted {
  color: var(--muted);
}

.coverage-row .muted {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-strong);
}

progress::-webkit-progress-bar {
  background: var(--surface-strong);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
  transition: width 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 52px;
}

.split-layout > section {
  min-width: 0;
}

.home-sections,
.detail-sections {
  margin-top: 52px;
}

.rank-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  counter-reset: rank;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  border-bottom: 1px solid var(--border);
  counter-increment: rank;
}

.rank-position::before {
  color: var(--faint);
  content: counter(rank, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.repo-name,
.topic-name {
  color: var(--ink-strong);
  font-weight: 680;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.repo-name:hover,
.topic-name:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.rank-main p,
.rank-values span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.rank-values {
  text-align: right;
}

.rank-values strong,
.metric-value,
.metric-delta,
.mono-value,
.mono-list,
.numeric,
.as-of,
.error-code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.rank-values strong {
  display: block;
  color: var(--accent-ink);
  font-size: 0.92rem;
}

.run-summary-list,
.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.run-summary-list {
  border-top: 1px solid var(--border);
}

.run-summary-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border-bottom: 1px solid var(--border);
}

.run-summary-list strong {
  color: var(--ink-strong);
  font-size: 0.84rem;
}

.run-summary-list time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.run-summary-list p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-info {
  background: var(--info-soft);
  color: var(--info);
}

.status-neutral {
  background: var(--surface-strong);
  color: var(--muted);
}

.empty-state {
  padding: 34px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  text-align: center;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1rem;
}

.empty-state p {
  max-width: 58ch;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.empty-state .button {
  margin-top: 18px;
}

.compact-empty {
  margin-top: 16px;
  padding: 28px 20px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(150px, 0.7fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 680;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink-strong);
  font-size: 0.86rem;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:hover,
.field select:hover {
  border-color: var(--muted);
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1), transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.button-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--bg);
}

.button-secondary {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--muted);
  background: var(--surface);
  color: var(--ink-strong);
}

.result-heading {
  margin-top: 30px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-block: 1px solid var(--border-strong);
  scrollbar-gutter: stable;
}

.table-scroll:focus-visible {
  outline-offset: 4px;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 0;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 0;
}

.data-table thead th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

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

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

.data-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.repo-table {
  min-width: 1120px;
}

.repo-cell {
  min-width: 260px;
  max-width: 360px;
}

.repo-cell .external-link {
  margin-left: 8px;
}

.repo-cell p,
.cell-description {
  max-width: 54ch;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.metric-value {
  color: var(--ink-strong);
  font-weight: 650;
}

.metric-delta {
  color: var(--accent-ink);
  font-weight: 620;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
}

.tag:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.pagination > div {
  display: flex;
  gap: 8px;
}

.entity-header {
  margin-top: -12px;
}

.entity-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.entity-description {
  max-width: 72ch;
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.repository-metrics,
.topic-metrics {
  margin-top: 28px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  gap: 52px;
}

.definition-list {
  margin: 0;
  border-top: 1px solid var(--border);
}

.definition-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.definition-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.definition-list dd {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.8rem;
}

.plain-list {
  border-top: 1px solid var(--border);
}

.plain-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.empty-inline {
  margin: 0;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}

.success-inline {
  background: var(--success-soft);
  color: var(--success);
}

.chart-panel {
  margin-top: 48px;
}

.chart-frame {
  position: relative;
  min-width: 0;
  height: 270px;
  padding: 18px 52px 34px;
  border-block: 1px solid var(--border-strong);
  background: var(--surface);
}

.line-chart {
  display: block;
  width: 100%;
  height: 218px;
  overflow: visible;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.chart-dot {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-dot:hover {
  fill: var(--accent);
}

.chart-y-label,
.chart-x-label {
  position: absolute;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.chart-y-label {
  left: 10px;
}

.chart-y-top {
  top: 16px;
}

.chart-y-bottom {
  bottom: 38px;
}

.chart-x-label {
  bottom: 12px;
}

.chart-x-start {
  left: 52px;
}

.chart-x-end {
  right: 52px;
}

.compact-table {
  min-width: 520px;
}

.topic-table {
  min-width: 980px;
}

.parent-link,
.filter-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.entity-section-heading {
  align-items: flex-start;
}

.leader-toggle {
  flex: 0 0 auto;
}

.leader-toggle label {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 620;
  cursor: pointer;
}

.leader-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.source-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0;
  border-block: 1px solid var(--border-strong);
}

.source-strip > div {
  padding: 20px;
  border-right: 1px solid var(--border);
}

.source-strip > div:first-child {
  padding-left: 0;
}

.source-strip > div:last-child {
  border-right: 0;
}

.source-strip dd {
  margin: 5px 0 0;
  color: var(--ink-strong);
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.source-strip p {
  margin: 5px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.run-metrics {
  grid-template-columns: 1.3fr repeat(3, 1fr);
}

.run-list {
  border-top: 1px solid var(--border-strong);
}

.run-row {
  border-bottom: 1px solid var(--border-strong);
}

.run-row-main {
  display: grid;
  grid-template-columns: 86px minmax(180px, 0.85fr) minmax(360px, 1.2fr) minmax(170px, 0.65fr);
  align-items: center;
  gap: 20px;
  min-height: 86px;
}

.run-identity h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.9rem;
}

.run-identity p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.run-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.run-counts dd {
  margin: 3px 0 0;
  color: var(--ink-strong);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 650;
}

.run-time {
  text-align: right;
}

.run-time time,
.run-time span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.run-time span {
  margin-top: 4px;
  color: var(--ink);
}

.run-details {
  margin: 0 0 14px 106px;
  border-radius: var(--radius);
  background: var(--surface);
}

.run-details summary {
  padding: 9px 12px;
  color: var(--accent-ink);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}

.run-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 6px 14px 16px;
}

.run-detail-grid h4 {
  margin: 0 0 8px;
  color: var(--ink-strong);
  font-size: 0.78rem;
}

.run-detail-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.compact-definitions > div {
  grid-template-columns: 1fr auto;
  padding: 6px 0;
}

.error-summary {
  color: var(--danger) !important;
}

.error-page {
  max-width: 620px;
  margin: 48px auto 0;
  padding: 48px 32px;
  border-block: 1px solid var(--border-strong);
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 720;
}

.error-page h2 {
  margin: 8px 0 0;
  color: var(--ink-strong);
  font-size: 1.6rem;
}

.error-page p:not(.error-code) {
  margin: 10px 0 24px;
  color: var(--muted);
}

.app-footer {
  width: min(100% - 40px, var(--content-width));
  margin: 0 auto;
  padding: 22px 0 30px;
  border-top: 1px solid var(--border);
}

.app-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 1180px) {
  .metric-strip-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metric-strip-wide > div:nth-child(4) {
    border-right: 0;
  }

  .metric-strip-wide > div:nth-child(n + 5) {
    border-top: 1px solid var(--border);
  }

  .filter-bar {
    grid-template-columns: minmax(250px, 1.4fr) repeat(3, minmax(140px, 0.8fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .run-row-main {
    grid-template-columns: 86px minmax(180px, 0.8fr) minmax(320px, 1.2fr);
  }

  .run-time {
    grid-column: 2 / -1;
    margin-top: -18px;
    padding-bottom: 14px;
    text-align: left;
  }
}

@media (max-width: 860px) {
  .header-inner,
  .page-shell,
  .app-footer {
    width: min(100% - 28px, var(--content-width));
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .language-switch {
    margin-left: 8px;
  }

  .primary-nav {
    position: absolute;
    top: 64px;
    right: 14px;
    left: 14px;
    display: none;
    flex-direction: column;
    align-self: auto;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-large);
    background: var(--bg);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .nav-link {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 6px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.is-active {
    background: var(--accent-soft);
  }

  .page-shell {
    padding-top: 30px;
  }

  .page-heading {
    display: block;
    margin-bottom: 28px;
  }

  .page-heading h1 {
    font-size: 1.7rem;
  }

  .page-heading .as-of {
    margin-top: 13px;
  }

  .split-layout,
  .evidence-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .split-layout > section + section {
    margin-top: 0;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-search,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .topic-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topic-metrics > div:nth-child(3) {
    border-right: 0;
  }

  .topic-metrics > div:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }

  .source-strip > div {
    border-bottom: 1px solid var(--border);
  }

  .source-strip > div:last-child {
    border-bottom: 0;
  }

  .run-row-main {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0;
  }

  .run-counts {
    grid-column: 1 / -1;
  }

  .run-time {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
  }

  .run-details {
    margin-left: 0;
  }

  .run-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .page-shell,
  .app-footer {
    width: min(100% - 24px, var(--content-width));
  }

  .brand > span:last-child {
    display: none;
  }

  .language-switch a {
    padding: 0 6px;
    font-size: 0.68rem;
  }

  .page-shell {
    padding-bottom: 52px;
  }

  section + section,
  .split-layout + section,
  section + .split-layout,
  .chart-panel,
  .home-sections,
  .detail-sections {
    margin-top: 38px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .metric-strip,
  .metric-strip-wide,
  .topic-metrics,
  .run-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip > div,
  .metric-strip-wide > div,
  .topic-metrics > div,
  .run-metrics > div {
    padding: 15px 12px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .metric-strip > div:nth-child(odd),
  .metric-strip-wide > div:nth-child(odd),
  .topic-metrics > div:nth-child(odd),
  .run-metrics > div:nth-child(odd) {
    padding-left: 0;
  }

  .metric-strip > div:nth-child(even),
  .metric-strip-wide > div:nth-child(even),
  .topic-metrics > div:nth-child(even),
  .run-metrics > div:nth-child(even) {
    border-right: 0;
  }

  .metric-strip > div:nth-child(-n + 2),
  .metric-strip-wide > div:nth-child(-n + 2),
  .topic-metrics > div:nth-child(-n + 2),
  .run-metrics > div:nth-child(-n + 2) {
    border-top: 0;
  }

  .metric-strip dd {
    font-size: 1.15rem;
  }

  .coverage-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .rank-list li {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 12px 0;
  }

  .rank-values {
    grid-column: 2;
    text-align: left;
  }

  .rank-values strong,
  .rank-values span {
    display: inline;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .field-search,
  .filter-actions {
    grid-column: auto;
  }

  .filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination > div {
    width: 100%;
  }

  .pagination .button {
    flex: 1;
  }

  .entity-section-heading {
    display: block;
  }

  .leader-toggle {
    margin-top: 14px;
  }

  .chart-frame {
    height: 230px;
    padding: 16px 20px 32px;
  }

  .line-chart {
    height: 180px;
  }

  .chart-y-label {
    display: none;
  }

  .chart-x-start {
    left: 20px;
  }

  .chart-x-end {
    right: 20px;
  }

  .source-strip {
    grid-template-columns: 1fr;
  }

  .source-strip > div,
  .source-strip > div:first-child {
    padding: 16px 0;
    border-right: 0;
  }

  .run-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .error-page {
    margin-top: 18px;
    padding: 36px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .app-header,
  .app-footer,
  .filter-bar,
  .leader-toggle,
  .pagination,
  .button {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .table-scroll {
    overflow: visible;
  }
}
