/* ==========================================================================
   AscendInfraBench — "Silicon Precision" Design System
   Brand Primary: Huawei Red (#CE0E2D)
   Self-hosted Variable Fonts: Space Grotesk, Inter, JetBrains Mono
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
}

:root {
  /* Core Palette — Huawei Red (#CE0E2D) + Precision Architectural Neutrals */
  --accent: #CE0E2D;
  --accent-hover: #A80B24;
  --accent-deep: #84081C;
  --accent-soft: #FDF2F4;
  --accent-tint: #FCE4E8;
  --accent-border: #F2C2CB;
  --accent-glow: rgba(206, 14, 45, 0.16);

  /* Surfaces */
  --bg: #F6F7F9;
  --paper: #FFFFFF;
  --soft: #F0F2F6;
  --hover-row: #FFF6F7;
  --obsidian: #12151C;
  --obsidian-2: #1A1F2A;

  /* Ink & Borders (WCAG AA+ Contrast) */
  --ink: #111318;
  --ink-2: #333B4A;
  --muted: #586375;
  --line: #E2E6EE;
  --line-strong: #CBD2DF;

  /* Semantic Statuses */
  --success: #0F6B43;
  --success-bg: #ECF9F2;
  --success-border: #BEE6D1;

  --amber: #9A5B06;
  --amber-bg: #FEF7EA;
  --amber-border: #F1D5A3;

  --red: #B4172E;
  --red-bg: #FEF1F3;
  --red-border: #F5C3CC;

  --violet: #55408E;
  --violet-bg: #F4F1FC;
  --violet-border: #D6CCF2;

  /* Stage Tokens */
  --stage-s-ink: #0F6B43;
  --stage-s-bg: #ECF9F2;
  --stage-s-border: #C0E6D2;
  --stage-t-ink: #1B4FD0;
  --stage-t-bg: #EFF5FF;
  --stage-t-border: #C5DBFE;
  --stage-r-ink: #9A4D08;
  --stage-r-bg: #FEF5EB;
  --stage-r-border: #F3D1AA;

  /* Typography — Windows ClearType / DirectWrite, macOS & Simplified Chinese Optimized */
  --display: 'Space Grotesk', 'Inter', 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans SC', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --sans: 'Inter', 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans SC', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Cascadia Mono', 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei UI', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Elevation & Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, 0.05), 0 1px 3px rgba(17, 19, 24, 0.04);
  --shadow-md: 0 10px 28px -10px rgba(17, 19, 24, 0.12), 0 2px 6px rgba(17, 19, 24, 0.04);
  --shadow-lg: 0 24px 56px -18px rgba(17, 19, 24, 0.28), 0 4px 12px rgba(17, 19, 24, 0.08);
  --tint: var(--accent-soft);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

main {
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-tint);
  color: var(--accent-deep);
}

/* Custom sleek scrollbars — dramatic polish on Windows Chrome/Edge */
* {
  scrollbar-width: thin;
  scrollbar-color: #C7CEDB transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #C7CEDB;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #98A3B6;
  border: 2px solid transparent;
  background-clip: content-box;
}

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

.wrap {
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
}

.skip {
  position: fixed;
  top: -80px;
  left: 20px;
  padding: 10px 16px;
  background: var(--ink);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  z-index: 60;
}

.skip:focus {
  top: 12px;
}

/* ==========================================================================
   Header & Da Vinci Brand Mark
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}

.brand em {
  font-style: normal;
  color: var(--accent);
}

/* Ascend NPU Chip × Coding Agent Emblem */
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  height: 32px;
  width: 32px;
  padding: 3px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.brand-mark.is-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  height: 34px;
  width: 34px;
}

.brand-mark.is-emblem img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand:hover .brand-mark {
  transform: scale(1.06);
  border-color: var(--accent);
}

.brand-mark i {
  display: block;
  background: var(--accent);
  border-radius: 1.5px;
  transition: opacity 0.2s ease;
}

.brand-mark i:nth-child(3n) {
  opacity: 0.26;
}

.brand-mark i:nth-child(3n + 2) {
  opacity: 0.62;
}

.brand:hover .brand-mark i:nth-child(3n) {
  opacity: 0.48;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

.site-header nav a {
  padding: 7px 12px;
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.site-header nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-header nav .nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 6px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 8px;
  padding: 7px 13px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: var(--shadow-sm);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.site-header nav .nav-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.code-glyph {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.nav-pill-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

/* Prominent Bilingual Switcher (中文 / EN) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin-left: 6px;
  background: #ECEFF4;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  flex-shrink: 0;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 6px -1px rgba(206, 14, 45, 0.38);
}

/* Refined CJK Typographic Rhythm */
html[lang^="zh"] .hero h1 {
  letter-spacing: -0.015em;
  line-height: 1.18;
  font-size: clamp(38px, 4.1vw, 56px);
}

html[lang^="zh"] .section-head h2,
html[lang^="zh"] .detail-hero h1 {
  letter-spacing: -0.01em;
}

html[lang^="zh"] .eyebrow,
html[lang^="zh"] .section-kicker {
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Shared Labels, Kickers, Badges & Buttons
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.live-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(206, 14, 45, 0.18);
  flex-shrink: 0;
}

.section-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-left: 24px;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  background: var(--soft);
  border-color: #B4BECE;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -6px rgba(206, 14, 45, 0.46);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF;
  box-shadow: 0 12px 24px -6px rgba(206, 14, 45, 0.54);
}

/* ==========================================================================
   Hero Band — Silicon Matrix Grid + Obsidian Telemetry Card
   ========================================================================== */

#overview {
  position: relative;
  z-index: 1;
}

#overview::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  z-index: -1;
  background-color: #FFFFFF;
  background-image:
    radial-gradient(640px 380px at 82% 24%, rgba(206, 14, 45, 0.085), transparent 72%),
    radial-gradient(520px 320px at 14% 12%, rgba(206, 14, 45, 0.04), transparent 70%),
    radial-gradient(rgba(17, 19, 24, 0.11) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  border-bottom: 1px solid var(--line);
}

.hero {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0 48px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(44px, 4.7vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 22px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-desc {
  max-width: 560px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.72;
  margin: 0 0 28px;
}

.hero-desc strong {
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .btn {
  padding: 12px 22px;
  font-size: 14.5px;
  border-radius: 10px;
}

.caption {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin: 26px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

.caption span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.caption span + span {
  border-left: 1px solid var(--line-strong);
  padding-left: 14px;
}

/* Obsidian Hardware Telemetry Card (Signature Visual Centerpiece) */
.portfolio-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(155deg, #181C26 0%, #11141C 62%, #191118 100%);
  color: #F4F6FA;
  border-radius: var(--radius-xl);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 64px -22px rgba(17, 19, 24, 0.44),
    0 4px 14px rgba(17, 19, 24, 0.14);
  padding: 28px 26px 22px;
}

.portfolio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #FF4D6A 58%, rgba(206, 14, 45, 0.12) 100%);
}

.portfolio-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(360px 220px at 96% 6%, rgba(206, 14, 45, 0.18), transparent 70%);
}

.card-top,
.card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-top {
  margin-bottom: 22px;
}

.card-top p {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(244, 246, 250, 0.68);
  margin: 0;
}

.portfolio-card .badge {
  background: rgba(206, 14, 45, 0.22);
  border: 1px solid rgba(255, 102, 128, 0.42);
  color: #FF879B;
  font-size: 12px;
  padding: 4px 10px;
}

.matrix {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 128px repeat(3, 1fr);
  gap: 10px;
}

.matrix-head {
  text-align: center;
  color: rgba(244, 246, 250, 0.56);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding-bottom: 4px;
}

.matrix-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: #F4F6FA;
}

.matrix-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
  background: #34D399;
}

.matrix > .matrix-label:nth-child(9)::before {
  background: #60A5FA;
}

.matrix > .matrix-label:nth-child(13)::before {
  background: #FBBF24;
}

.matrix-cell {
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.matrix-cell:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.matrix-cell strong {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.matrix-cell span {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(244, 246, 250, 0.62);
}

.matrix-cell.strong {
  background: linear-gradient(145deg, rgba(206, 14, 45, 0.34), rgba(206, 14, 45, 0.15));
  border-color: rgba(255, 96, 122, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 160, 176, 0.18);
}

.matrix-cell.strong:hover {
  background: linear-gradient(145deg, rgba(206, 14, 45, 0.44), rgba(206, 14, 45, 0.22));
  border-color: rgba(255, 118, 140, 0.65);
}

.matrix-cell.strong strong {
  color: #FFFFFF;
}

.matrix-cell.strong span {
  color: #FFB2BF;
}

.card-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin-top: 22px;
  padding-top: 15px;
  color: rgba(244, 246, 250, 0.68);
  font-size: 13px;
}

.card-bottom strong {
  font-family: var(--mono);
  font-size: 13px;
  color: #FF879B;
  font-weight: 600;
  background: rgba(206, 14, 45, 0.18);
  border: 1px solid rgba(255, 102, 128, 0.32);
  border-radius: 6px;
  padding: 3px 9px;
}

/* Benchmark Facts Strip */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding: 26px 0 32px;
}

.fact {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 4px 26px;
  border-left: 1px solid var(--line);
}

.fact:first-child {
  border-left: 0;
  padding-left: 0;
}

.fact strong {
  font-family: var(--display);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.fact:nth-child(3) strong {
  color: var(--accent);
}

.fact span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.fact small {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

/* ==========================================================================
   Main Sections & Toolbars
   ========================================================================== */

.section {
  padding: 64px 0;
}

.results-section {
  padding-bottom: 36px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(28px, 2.8vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--ink);
}

.section-head p:last-child {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0;
  line-height: 1.55;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.segments {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #ECEFF4;
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}

.board-tabs {
  margin: 0;
}

.segment {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

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

.segment[aria-pressed="true"] {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(17, 19, 24, 0.09);
}

/* ==========================================================================
   Dynamic Leaderboard Visual Snapshot Chart (Injected by site.js)
   ========================================================================== */

.viz-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.viz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
}

.viz-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.viz-kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.viz-title {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.viz-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.viz-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.viz-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.viz-swatch.leader {
  background: var(--accent);
}

.viz-swatch.peer {
  background: #475569;
}

.viz-swatch.base {
  width: 12px;
  height: 0;
  border-top: 2px dashed var(--accent);
  border-radius: 0;
}

.viz-toggle {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.viz-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.viz-body {
  padding: 28px 22px 20px;
}

.viz-body[hidden] {
  display: none;
}

.viz-rows {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.viz-row {
  display: grid;
  grid-template-columns: 32px 188px minmax(0, 1fr) 82px 96px;
  align-items: center;
  gap: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  transition: background 0.14s ease;
}

.viz-row:hover {
  background: var(--hover-row);
}

.viz-row.is-leader {
  background: linear-gradient(90deg, rgba(206, 14, 45, 0.055), transparent 72%);
}

.viz-rank {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.viz-row.is-leader .viz-rank {
  color: #FFFFFF;
  background: var(--accent);
  border-radius: 5px;
  padding: 2px 0;
}

.viz-agent {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viz-agent:hover {
  color: var(--accent);
}

.viz-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.viz-track {
  position: relative;
  height: 24px;
  border-radius: 6px;
  background: #F1F4F8;
  overflow: visible;
}

.viz-baseline {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 0;
  border-left: 1.5px dashed rgba(206, 14, 45, 0.55);
  z-index: 2;
  pointer-events: none;
}

.viz-row:first-child .viz-baseline::after {
  content: "1.00×";
  position: absolute;
  top: -17px;
  left: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.viz-bar {
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #4B576B 0%, #64748B 100%);
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 4px;
}

.viz-row.is-leader .viz-bar {
  background: linear-gradient(90deg, #A80B24 0%, #CE0E2D 65%, #E82746 100%);
  box-shadow: 0 3px 10px -2px rgba(206, 14, 45, 0.38);
}

.viz-row.is-podium .viz-bar {
  background: linear-gradient(90deg, #334155 0%, #475569 100%);
}

.viz-row.is-regress .viz-bar {
  background: #94A3B8;
}

.viz-score {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.viz-row.is-leader .viz-score {
  color: var(--accent);
}

.viz-valid {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}

.viz-valid.full {
  color: var(--success);
}

.viz-empty {
  margin: 0;
  padding: 16px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
   Filter Bar & Multi-select Dropdowns
   ========================================================================== */

.board-panel[hidden] {
  display: none;
}

.board-panel h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 14px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}

.multi-filter {
  position: relative;
  font-size: 13.5px;
  min-width: 0;
}

.multi-filter > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  font-weight: 500;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.multi-filter > summary::-webkit-details-marker {
  display: none;
}

.multi-filter > summary:hover {
  border-color: var(--accent);
}

.multi-filter > summary::after {
  content: '▾';
  color: var(--muted);
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
}

.multi-filter > summary span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.multi-filter[open] > summary {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.multi-filter fieldset {
  position: absolute;
  z-index: 25;
  top: 100%;
  left: 0;
  width: max-content;
  min-width: 268px;
  max-width: calc(100vw - 32px);
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
  padding: 8px;
  margin: 6px 0 0;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 2px 0 8px;
  margin-bottom: 5px;
}

.filter-actions button {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
}

.filter-actions button:hover {
  background: var(--accent-soft);
}

.multi-filter label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.4;
  cursor: pointer;
}

.multi-filter label:hover {
  background: var(--soft);
}

.multi-filter input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.filter-bar .btn {
  padding: 9px 14px;
  font-size: 13.5px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  padding: 9px 14px;
  min-width: 260px;
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(206, 14, 45, 0.12);
  outline: none;
}

.search::placeholder {
  color: var(--muted);
}

.run-filters .search {
  flex: 1;
  min-width: 240px;
  padding: 9px 14px;
  font-size: 14px;
}

.run-filters > .multi-filter:last-of-type fieldset {
  left: auto;
  right: 0;
}

.filter-select {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  max-width: 100%;
}

#overview-count {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: auto;
}

.overview-note {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 14px;
}

.overview-legend {
  display: flex;
  gap: 16px 22px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.overview-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.overview-legend strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
}

.overview-legend > span:nth-child(1) strong {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

.overview-legend > span:nth-child(2) strong {
  color: var(--violet);
  background: var(--violet-bg);
  border-color: var(--violet-border);
}

.overview-legend > span:nth-child(3) strong {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.overview-legend > span:nth-child(4) strong {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line);
}

.board-note {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 18px 0 0;
}

.board-note strong {
  color: var(--ink);
  font-weight: 600;
}

.harness-note {
  margin-top: 12px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--paper);
  border-radius: 8px;
}

/* ==========================================================================
   Tables, Leaderboard, Sticky Columns & Heatmap Matrix
   ========================================================================== */

.table-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

th {
  background: #F3F5F8;
  color: var(--ink-2);
  text-align: right;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 13px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

th:first-child,
td:first-child {
  text-align: left;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid #EDF0F5;
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
  color: var(--ink);
}

tbody tr {
  --row-bg: var(--paper);
  background: var(--row-bg);
  transition: background 0.12s ease;
}

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

tbody tr:hover {
  --row-bg: var(--hover-row);
}

tr[hidden] {
  display: none;
}

/* Leaderboard Base */
.leaderboard-table {
  min-width: 920px;
}

.leaderboard-table.scope-table {
  min-width: 1120px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 14px;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--row-bg, var(--paper));
  z-index: 1;
}

.leaderboard-table th:nth-child(2) {
  background: #F3F5F8;
}

.leaderboard-table .rank {
  width: 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.leaderboard-table tbody tr:first-child .rank {
  color: var(--accent);
  font-weight: 700;
}

/* Agent Cell & Official Brand Logo Badges */
.agent-link {
  display: inline-flex;
  gap: 11px;
  align-items: center;
}

.agent-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(17, 19, 24, 0.05);
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.agent-avatar .agent-logo {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.agent-link:hover .agent-avatar {
  transform: scale(1.06);
  border-color: var(--accent-border);
  box-shadow: 0 3px 10px -2px rgba(17, 19, 24, 0.12);
}

.viz-logo {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex-shrink: 0;
}

.switcher-logo {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.switcher-pill[aria-current="page"] .switcher-logo {
  filter: brightness(0) invert(1);
}

.agent-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.3;
}

.agent-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
  white-space: normal;
  line-height: 1.4;
  max-width: 245px;
}

.agent-link:hover .agent-name,
.cell-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Score Cells */
.score-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

tbody tr:first-child .score-value {
  color: var(--accent);
}

.score-cell {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.score-cell small {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
}

.overall-cell {
  background: #F8F9FB;
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

tbody tr:hover .overall-cell {
  background: var(--hover-row);
}

/* Reference Baseline Row */
.reference-row {
  --row-bg: #F6F7FA;
}

.reference-row td {
  border-top: 2px dashed var(--line-strong);
  background: var(--row-bg);
  color: var(--muted);
}

.reference-row td:nth-child(2) {
  background: var(--row-bg);
}

.reference-row .agent-name {
  font-weight: 600;
  color: var(--ink-2);
}

.reference-row .score-value {
  color: var(--muted);
  font-weight: 600;
}

.reference-row:hover {
  --row-bg: #F1F3F8;
}

/* Overview 24-Task Matrix */
.overview-scroll {
  max-height: 720px;
}

.leaderboard-table.overview-table {
  --rank-width: 48px;
  --name-width: 276px;
  --valid-width: 82px;
  --gm-width: 96px;
  --task-width: 94px;
  table-layout: fixed;
  min-width: 0;
  width: calc(var(--rank-width) + var(--name-width) + var(--valid-width) + var(--gm-width) + var(--task-width) * var(--visible-tasks, 24));
}

.overview-table th,
.overview-table td {
  padding: 13px 10px;
}

.overview-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.overview-table th:nth-child(1),
.overview-table td:nth-child(1) {
  width: var(--rank-width);
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--row-bg, var(--paper));
}

.overview-table th:nth-child(2),
.overview-table td:nth-child(2) {
  width: var(--name-width);
  left: var(--rank-width);
  z-index: 3;
  background: var(--row-bg, var(--paper));
}

.overview-table th:nth-child(3),
.overview-table td:nth-child(3) {
  width: var(--valid-width);
  position: sticky;
  left: calc(var(--rank-width) + var(--name-width));
  z-index: 3;
  background: var(--row-bg, var(--paper));
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.overview-table th:nth-child(4),
.overview-table td:nth-child(4) {
  width: var(--gm-width);
  position: sticky;
  left: calc(var(--rank-width) + var(--name-width) + var(--valid-width));
  z-index: 3;
  background: var(--row-bg, var(--paper));
  box-shadow: 2px 0 0 var(--line);
  transition: box-shadow 0.2s ease, background 0.12s ease;
}

.overview-scroll.is-scrolled-x .overview-table th:nth-child(4),
.overview-scroll.is-scrolled-x .overview-table td:nth-child(4) {
  box-shadow: 2px 0 0 var(--line), 10px 0 20px -8px rgba(17, 19, 24, 0.18);
}

.overview-table thead th:nth-child(-n+4) {
  z-index: 4;
  background: #F3F5F8;
}

.overview-table th[data-task] {
  width: var(--task-width);
  text-align: center;
  vertical-align: top;
}

.overview-table th[data-task] abbr {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  cursor: help;
}

.overview-table th small {
  display: block;
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--muted);
  white-space: normal;
  min-height: 30px;
  margin-top: 4px;
}

/* Subtle stage color top-border accent on task column headers */
.overview-table th[data-stage="S"] {
  border-top: 2.5px solid var(--stage-s-ink);
}

.overview-table th[data-stage="T"] {
  border-top: 2.5px solid var(--stage-t-ink);
}

.overview-table th[data-stage="R"] {
  border-top: 2.5px solid var(--stage-r-ink);
}

.overview-table .agent-link {
  gap: 10px;
}

.overview-table .agent-name {
  white-space: normal;
}

.overview-table .agent-meta {
  font-size: 12px;
}

.overview-table .task-result {
  text-align: center;
  font-family: var(--mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  padding: 7px 6px;
}

.task-result a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 6px;
  border-radius: 7px;
  font-weight: 500;
  position: relative;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.task-result a:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px -2px rgba(206, 14, 45, 0.24);
  z-index: 1;
}

/* Calibrated Speedup Heatmap Tiers (assigned via site.js, zero data edits) */
.task-result.heat-regress a {
  background: #F1F4F8;
  color: #546278;
}

.task-result.heat-flat a {
  background: transparent;
  color: var(--ink-2);
}

.task-result.heat-flat a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.task-result.heat-low a {
  background: #FEF5F7;
  color: #7A1829;
  font-weight: 600;
}

.task-result.heat-mid a {
  background: #FCE5EA;
  color: #9A0D25;
  font-weight: 600;
}

.task-result.heat-high a {
  background: #F6C8D2;
  color: #7D071B;
  font-weight: 700;
}

.task-result.heat-peak a {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px -2px rgba(206, 14, 45, 0.42);
}

.task-result.heat-peak a:hover {
  background: var(--accent-hover);
}

/* Column SOTA leader underline indicator */
.task-result.is-col-best a::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.task-result.heat-peak.is-col-best a::after {
  background: rgba(255, 255, 255, 0.85);
}

/* Rejection Pills in Overview Matrix */
.rejected-result {
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
}

.rejected-result a {
  width: 34px;
  min-height: 30px;
  margin: 0 auto;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.rejected-result.rej-c a {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.rejected-result.rej-m a {
  border-color: var(--violet-border);
  background: var(--violet-bg);
  color: var(--violet);
}

.rejected-result.rej-s a {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

/* Sortable Column Headers */
.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  padding: 5px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: inherit;
  text-align: inherit;
  transition: background 0.14s ease, color 0.14s ease;
}

.sort-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.sort-arrow {
  font-size: 12px;
  opacity: 0.45;
  flex-shrink: 0;
}

.sort-button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.sort-button[aria-pressed="true"] .sort-arrow {
  opacity: 1;
}

.overview-table th[data-task] .sort-button {
  justify-content: center;
}

.leaderboard-table th:has(.sort-button) {
  padding-top: 9px;
  padding-bottom: 9px;
}

/* ==========================================================================
   Run Explorer Table (#runs)
   ========================================================================== */

.run-table {
  min-width: 1080px;
}

.run-table td:nth-child(2) {
  text-align: left;
}

.run-table td:nth-child(2) strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.run-table td:nth-child(4) {
  color: var(--ink-2);
  font-size: 13.5px;
}

.run-table td:nth-child(6) {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.run-table td:nth-child(7) {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-2);
}

.run-table td:nth-child(8) {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.run-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-align: left;
}

.run-icon {
  height: 34px;
  width: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

tr[data-domain="S"] .run-icon {
  background: var(--stage-s-bg);
  border-color: var(--stage-s-border);
  color: var(--stage-s-ink);
}

tr[data-domain="T"] .run-icon {
  background: var(--stage-t-bg);
  border-color: var(--stage-t-border);
  color: var(--stage-t-ink);
}

tr[data-domain="R"] .run-icon {
  background: var(--stage-r-bg);
  border-color: var(--stage-r-border);
  color: var(--stage-r-ink);
}

.run-link:hover .run-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.run-link strong {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.run-link small {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 2px;
}

.run-link:hover strong {
  color: var(--accent);
}

/* Domain & Outcome Status Tags */
.domain-tag,
.status-tag,
.coverage-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  border: 1px solid var(--stage-s-border);
  background: var(--stage-s-bg);
  color: var(--stage-s-ink);
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.domain-tag.T {
  color: var(--stage-t-ink);
  background: var(--stage-t-bg);
  border-color: var(--stage-t-border);
}

.domain-tag.R {
  color: var(--stage-r-ink);
  background: var(--stage-r-bg);
  border-color: var(--stage-r-border);
}

.status-tag.ok {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.status-tag.warn,
.coverage-tag.warn {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

/* Distinct outcome pills via existing data-outcome attribute */
tr[data-outcome="correctness_failure"] .status-tag {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

tr[data-outcome="measurement_failure"] .status-tag {
  color: var(--violet);
  background: var(--violet-bg);
  border-color: var(--violet-border);
}

tr[data-outcome="source_rejection"] .status-tag {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.table-note {
  padding: 13px 18px;
  background: #FAFBFD;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.table-note strong {
  color: var(--accent);
  font-weight: 600;
}

.show-more-row {
  text-align: center;
  margin-top: 22px;
}

.show-more-row[hidden] {
  display: none;
}

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ==========================================================================
   Reading Guide Section & Footer
   ========================================================================== */

.scope-section {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.scope-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.scope-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.18s ease;
}

.scope-card:hover {
  background: var(--paper);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.scope-card:hover::before {
  background: var(--accent);
}

.scope-card .step {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 5px;
  padding: 3px 8px;
}

.scope-card h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 16px 0 10px;
}

.scope-card p {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.72;
  margin: 0;
}

.scope-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
}

.scope-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scope-stats strong {
  color: var(--accent);
  font-weight: 700;
}

/* Evaluation Code Availability Notice & Modal */
.code-notice {
  margin-top: 24px;
  padding: 18px 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3.5px solid var(--accent);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.code-notice-main {
  flex: 1 1 460px;
  min-width: 0;
}

.code-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.code-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(206, 14, 45, 0.16);
}

.code-notice p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}

.code-notice-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.code-notice-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
}

dialog.code-modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

dialog.code-modal::backdrop {
  background: rgba(17, 19, 24, 0.52);
  backdrop-filter: blur(4px);
}

.code-modal-bar {
  height: 3.5px;
  background: linear-gradient(90deg, var(--accent) 0%, #E83855 60%, var(--accent-border) 100%);
}

.code-modal-body {
  padding: 24px 26px 26px;
}

.code-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.code-modal-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.code-modal-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.code-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.code-modal-close:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.code-modal-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.code-modal-quote {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}

.code-modal-sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.code-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.code-modal-actions .btn {
  padding: 9px 15px;
  font-size: 13.5px;
}

.code-modal-actions .code-modal-done {
  margin-left: auto;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 36px 0 44px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: #646F82;
  font-size: 13px;
}

.footer-inner strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.footer-inner strong::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.footer-inner span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #646F82;
}

.footer-inner a {
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.footer-inner a:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

/* ==========================================================================
   Run Detail Pages (runs/*.html) — Automatic Full Upgrade
   ========================================================================== */

.detail-hero {
  padding: 40px 0 28px;
}

.breadcrumb {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 22px;
}

.breadcrumb a {
  color: var(--ink-2);
  font-weight: 600;
}

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

.detail-headline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 6px 0 10px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.detail-subtitle {
  color: var(--ink-2);
  margin: 0 0 24px;
  font-size: 15.5px;
  line-height: 1.55;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.metric:first-child {
  border-top: 3px solid var(--accent);
}

.metric strong {
  display: block;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.metric:first-child strong {
  color: var(--accent);
}

.metric span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 8px;
}

.detail-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 30px 0 0;
  overflow: auto;
}

.detail-nav a {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.detail-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
}

.detail-aside {
  position: sticky;
  top: 90px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 8px;
}

.panel-note {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.68;
  margin: 0 0 20px;
}

/* Process Map Phase Bars */
.phase-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 82px;
  padding: 6px 4px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.phase-bars i {
  flex: 1;
  min-width: 2.5px;
  height: 30px;
  border-radius: 3px 3px 0 0;
  background: #B8C0CC;
  transition: opacity 0.12s ease;
}

.phase-bars i.inspect { background: #3E8E7E; height: 34px; }
.phase-bars i.edit { background: #0E7C5D; height: 64px; }
.phase-bars i.validate { background: #3B73B9; height: 50px; }
.phase-bars i.execute { background: #C28A2C; height: 42px; }
.phase-bars i.build { background: #7E5BB3; height: 48px; }
.phase-bars i.profile { background: #CE5A3C; height: 54px; }
.phase-bars i.rollback { background: #CE0E2D; height: 44px; }

.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: #FAFBFD;
  border-radius: 6px;
  padding: 5px 10px;
}

.legend span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  background: #B8C0CC;
  flex-shrink: 0;
}

.legend span[data-phase="inspect"]::before { background: #3E8E7E; }
.legend span[data-phase="edit"]::before { background: #0E7C5D; }
.legend span[data-phase="validate"]::before { background: #3B73B9; }
.legend span[data-phase="execute"]::before { background: #C28A2C; }
.legend span[data-phase="build"]::before { background: #7E5BB3; }
.legend span[data-phase="profile"]::before { background: #CE5A3C; }
.legend span[data-phase="rollback"]::before { background: #CE0E2D; }
.legend span[data-phase="other"]::before { background: #94A3B8; }

.phase-counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.phase-count {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #94A3B8;
  border-radius: 8px;
  background: #FAFBFD;
}

.phase-count[data-phase="inspect"] { border-left-color: #3E8E7E; }
.phase-count[data-phase="edit"] { border-left-color: #0E7C5D; }
.phase-count[data-phase="validate"] { border-left-color: #3B73B9; }
.phase-count[data-phase="execute"] { border-left-color: #C28A2C; }
.phase-count[data-phase="build"] { border-left-color: #7E5BB3; }
.phase-count[data-phase="profile"] { border-left-color: #CE5A3C; }
.phase-count[data-phase="rollback"] { border-left-color: #CE0E2D; }

.phase-count strong {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.phase-count span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

/* Aside Context Panel */
.detail-aside .panel h2 {
  font-size: 19px;
}

.detail-aside p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

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

.context-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  font-size: 13.5px;
}

.context-list li:last-child {
  border: 0;
}

.context-list span {
  color: var(--muted);
  flex-shrink: 0;
}

.context-list strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 175px;
}

/* Event Timeline */
.event-details > summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.event-timeline {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.timeline-event {
  --event-color: #8892A2;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}

.timeline-event.inspect { --event-color: #3E8E7E; }
.timeline-event.edit { --event-color: #0E7C5D; }
.timeline-event.validate { --event-color: #3B73B9; }
.timeline-event.execute { --event-color: #C28A2C; }
.timeline-event.build { --event-color: #7E5BB3; }
.timeline-event.profile { --event-color: #CE5A3C; }
.timeline-event.rollback { --event-color: #CE0E2D; }

.event-order {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  padding-top: 12px;
  text-align: right;
}

.timeline-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--event-color);
  border-radius: 8px;
  padding: 12px 16px 14px;
  background: #FAFBFD;
}

.timeline-event.attention .timeline-card {
  background: #FEF8EE;
  border-color: #F0D9B0;
  border-left-color: var(--amber);
}

.timeline-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-heading h3 {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}

.event-flag {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border: 1px solid var(--amber-border);
  border-radius: 5px;
  color: var(--amber);
  background: var(--amber-bg);
}

.event-summary {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 6px 0 10px;
}

.event-call-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  margin: 6px 0 8px;
}

.event-density {
  display: block;
  width: 96px;
  height: 4px;
  background: #E2E6EE;
  border-radius: 3px;
  overflow: hidden;
}

.event-density i {
  display: block;
  min-width: 3px;
  width: var(--coverage);
  height: 100%;
  background: var(--event-color);
}

.command-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.command-chips code {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-2);
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}

.command-more {
  margin-top: 8px;
}

.command-more summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 6px;
}

.timeline-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  overflow: hidden;
}

.timeline-disclosure > summary {
  padding: 15px 18px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F6F8FB;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
}

.timeline-disclosure > summary::-webkit-details-marker {
  display: none;
}

.timeline-disclosure > summary::after {
  content: '+';
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
  margin-left: auto;
  color: var(--ink-2);
}

.timeline-disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
}

.timeline-disclosure[open] > summary::after {
  content: '−';
}

.timeline-total {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.timeline-hide,
.timeline-disclosure[open] .timeline-show {
  display: none;
}

.timeline-disclosure[open] .timeline-hide {
  display: inline;
}

.timeline-scroll {
  height: min(600px, 68vh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: 18px;
}

.timeline-scroll .timeline-help {
  margin: 0;
}

.timeline-scroll .timeline-event:last-child {
  margin-bottom: 0;
}

.timeline-help {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--ink-2);
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #F8F9FB;
}

.timeline-help code {
  color: var(--accent);
  font-weight: 600;
}

/* Subagent Activity & Branches */
.agent-activity {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.agent-activity:first-of-type {
  border-top: 0;
}

.agent-activity-label {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 6px;
}

.agent-activity-label strong {
  color: var(--ink);
  font-weight: 600;
}

.agent-activity-label span {
  color: var(--muted);
}

.agent-activity .phase-bars {
  height: 44px;
}

.agent-activity .phase-bars i {
  height: 20px;
}

.agent-activity .phase-bars i.edit { height: 38px; }
.agent-activity .phase-bars i.validate { height: 30px; }
.agent-activity .phase-bars i.execute { height: 26px; }

.agent-branch {
  margin: 14px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  min-width: 0;
}

.agent-branch > summary {
  cursor: pointer;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 12px 14px;
  font-size: 13.5px;
  list-style: none;
  overflow-wrap: anywhere;
}

.agent-branch > summary::before {
  content: '+';
  color: var(--accent);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}

.agent-branch[open] > summary::before {
  content: '−';
}

.agent-branch > summary::-webkit-details-marker {
  display: none;
}

.agent-branch > summary strong {
  color: var(--accent);
  font-weight: 600;
}

.agent-branch > summary span {
  color: var(--muted);
}

.branch-body {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
}

.branch-note {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.agent-reference {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.agent-branch .timeline-event {
  grid-template-columns: minmax(0, 1fr);
}

.agent-branch .event-order {
  display: none;
}

.agent-branch .event-timeline {
  margin-top: 10px;
}

.agent-branch .timeline-card {
  padding: 10px 12px;
  border-left-width: 3px;
}

.agent-branch .agent-branch {
  margin-left: 0;
}

.agent-heading {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 18px 0 4px;
}

.agent-empty {
  background: var(--soft);
  border-radius: 7px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.branch-status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
}

.branch-status.completed {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.branch-status.failed,
.branch-status.stopped {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

.agent-target {
  font-size: 12.5px;
  margin: 8px 0 0;
}

.agent-branch:target {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Agent Clock (Multi-Agent Shared Timeline) */
.agent-clock {
  --lane-label: 206px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  overflow: hidden;
  margin: 18px 0;
}

.clock-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #F8F9FB;
}

.clock-toolbar p {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.clock-toolbar .segments {
  padding: 3px;
}

.clock-toolbar .segment {
  font-size: 12.5px;
  padding: 6px 11px;
}

.clock-scroll {
  overflow: auto;
  max-height: 460px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.clock-grid {
  position: relative;
  min-width: 680px;
}

.clock-axis,
.clock-row {
  display: grid;
  grid-template-columns: var(--lane-label) minmax(0, 1fr);
}

.clock-axis {
  height: 36px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #F8F9FB;
  border-bottom: 1px solid var(--line);
}

.clock-axis-label {
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  position: sticky;
  left: 0;
  background: #F8F9FB;
  z-index: 2;
}

.clock-ticks {
  position: relative;
  margin-right: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

.clock-ticks span {
  position: absolute;
  top: 9px;
  transform: translateX(-50%);
}

.clock-ticks span:first-child {
  transform: none;
}

.clock-ticks span:last-child {
  transform: translateX(-100%);
}

.clock-row {
  min-height: 74px;
  border-bottom: 1px solid #EDF0F5;
}

.clock-row:last-child {
  border: 0;
}

.clock-row:hover {
  background: var(--hover-row);
}

.clock-label {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--paper);
  padding: 10px 12px;
  min-width: 0;
  border-right: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.clock-row:hover .clock-label {
  background: var(--hover-row);
}

.clock-label > a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.clock-label > a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.clock-label small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.clock-parent {
  font-size: 11.5px;
  color: var(--muted);
}

.clock-parent a {
  color: var(--muted);
}

.clock-track {
  position: relative;
  margin-right: 14px;
  min-width: 0;
  background: repeating-linear-gradient(to right, #E8ECF2 0, #E8ECF2 1px, transparent 1px, transparent 25%);
}

.clock-span {
  position: absolute;
  top: 24px;
  height: 26px;
  background: var(--accent-tint);
  border: 1px solid #E58C9C;
  border-radius: 5px;
  min-width: 3px;
}

.clock-span:hover,
.clock-span:focus-visible {
  background: #F6C5CE;
  border-color: var(--accent);
  z-index: 2;
}

.clock-row[data-agent-id="main"] .clock-span {
  top: 30px;
  height: 14px;
  background: #E8ECF2;
  border-color: #CBD2DF;
}

.clock-point {
  position: absolute;
  top: 30px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--paper);
  border: 2px solid #C27430;
  border-radius: 2px;
  z-index: 2;
}

.clock-point.observation {
  background: #FBE0D4;
}

.clock-point:hover,
.clock-point:focus-visible {
  border-color: var(--accent);
}

.clock-mark {
  position: absolute;
  top: 26px;
  height: 22px;
  width: 3px;
  transform: translateX(-1.5px);
  background: #94A3B8;
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
  border-radius: 1.5px;
  opacity: 0.92;
  transition: transform 0.1s ease, height 0.1s ease, opacity 0.14s ease;
}

.clock-mark:hover,
.clock-mark.is-hover-mark {
  top: 20px;
  height: 34px;
  width: 4px;
  transform: translateX(-2px);
  z-index: 6;
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3.5px var(--accent);
  opacity: 1;
}

.clock-mark.is-error::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.agent-clock.is-filtering .clock-mark:not(.is-match) {
  opacity: 0.14;
}

.clock-scrub {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #FAFBFD;
  padding: 8px 16px;
}

.clock-mark.inspect { background: #3E8E7E; }
.clock-mark.edit { background: #0E7C5D; }
.clock-mark.validate { background: #3B73B9; }
.clock-mark.execute { background: #C28A2C; }
.clock-mark.build { background: #7E5BB3; }
.clock-mark.profile { background: #CE5A3C; }
.clock-mark.rollback { background: #CE0E2D; }

.clock-track [hidden] {
  display: none;
}

.clock-note {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  pointer-events: none;
}

.clock-unknown {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.clock-scan {
  display: none;
  position: absolute;
  top: 36px;
  bottom: 0;
  width: 1.5px;
  background: var(--accent);
  pointer-events: none;
  z-index: 4;
}

.clock-grid.scanning .clock-scan {
  display: block;
}

.clock-caption {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  padding: 11px 16px;
  margin: 0;
  border-top: 1px solid var(--line);
  background: #FAFBFD;
}

.clock-help {
  font-size: 13px;
  margin: 0 0 12px;
  color: var(--muted);
}

.clock-no-time {
  padding: 12px 16px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  background: #FAFBFD;
  border-bottom: 1px solid var(--line);
}

.clock-readout {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  min-width: 64px;
  text-align: right;
}

/* Candidate Artifacts & Git Diff Viewer */
.artifacts {
  margin: 24px 0 64px;
}

.artifacts .panel {
  margin: 0 0 16px;
}

.artifacts details {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-md);
  margin: 14px 0;
  overflow: hidden;
}

.artifacts summary {
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: #F4F6FA;
  transition: background 0.14s ease;
}

.artifacts summary:hover {
  background: #ECEFF5;
}

.artifacts details p {
  padding: 0 18px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.artifacts details p code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 5px;
}

.patch {
  overflow: auto;
  max-height: 72vh;
  background: #FAFBFD;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
  white-space: pre;
}

.patch code {
  display: block;
  width: max-content;
  min-width: 100%;
}

.patch .line {
  display: block;
  padding: 0 18px;
  min-height: 1.62em;
}

.patch .add {
  background: #E6F8ED;
  color: #115E38;
}

.patch .del {
  background: #FDECEF;
  color: #9F122B;
}

.patch .hunk {
  background: #EDF4FE;
  color: #1D4ED8;
  font-weight: 600;
}

.patch .meta {
  color: #4B5563;
  background: #F1F4F8;
  font-weight: 600;
}

.binary-list {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}

.binary-list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.binary-list li:last-child {
  border: 0;
}

.callout {
  border-left: 3.5px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ==========================================================================
   Advanced Features: Hero Telemetry, Findings Strip, Multi-View Charts,
   Matrix Crosshair, Runs Presets, Trajectory Profiler & Task Switcher
   ========================================================================== */

/* 1. Hero Obsidian Card Micro-Telemetry */
.matrix-label {
  flex-wrap: wrap;
}

.matrix-peak {
  display: block;
  width: 100%;
  padding-left: 16px;
  margin-top: -2px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: rgba(244, 246, 250, 0.56);
}

.matrix-cell.strong {
  position: relative;
  overflow: hidden;
}

.matrix-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #CE0E2D, #FF6680);
  border-radius: 0 2px 0 0;
}

/* 2. Headline Findings & Breakthrough Highlights Strip */
.highlights-band {
  padding: 28px 0 8px;
}

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

.hl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.hl-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hl-card.is-accent {
  border-top: 3px solid var(--accent);
}

.hl-kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.hl-card.is-accent .hl-kicker {
  color: var(--accent);
}

.hl-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.hl-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hl-card.is-accent .hl-value {
  color: var(--accent);
}

.hl-sub {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.hl-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.hl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.hl-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.hl-chip small {
  font-weight: 500;
  opacity: 0.85;
}

.hl-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.hl-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hl-rel-bar {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--soft);
  gap: 2px;
}

.hl-rel-bar i {
  display: block;
  height: 100%;
}

.hl-rel-bar .seg-ok { background: var(--success); }
.hl-rel-bar .seg-c { background: var(--red); }
.hl-rel-bar .seg-m { background: var(--violet); }
.hl-rel-bar .seg-s { background: var(--amber); }

.hl-rel-legend {
  display: flex;
  gap: 6px 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.hl-rel-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hl-rel-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.hl-rel-legend .dot-c { background: var(--red); }
.hl-rel-legend .dot-m { background: var(--violet); }
.hl-rel-legend .dot-s { background: var(--amber); }

/* 3. Leaderboard Multi-View Charts (Ranking / Pareto Frontier / By Stage) */
.viz-views {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: #ECEFF4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.viz-view-btn {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.14s ease, color 0.14s ease;
}

.viz-view-btn:hover {
  color: var(--ink);
}

.viz-view-btn[aria-pressed="true"] {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(17, 19, 24, 0.10);
}

/* Pareto Scatter Plot */
.pareto-wrap {
  position: relative;
  width: 100%;
}

.pareto-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  overflow: visible;
}

.pareto-grid {
  stroke: #E8ECF2;
  stroke-width: 1;
}

.pareto-axis {
  stroke: #CBD2DF;
  stroke-width: 1.2;
}

.pareto-tick {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
}

.pareto-axis-label {
  fill: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

.pareto-base {
  stroke: rgba(206, 14, 45, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.pareto-frontier {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-dasharray: 6 4;
  opacity: 0.85;
}

.pareto-frontier-label {
  fill: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pareto-node {
  cursor: pointer;
}

.pareto-node circle.dot-main {
  stroke: #FFFFFF;
  stroke-width: 2.5;
  transition: r 0.15s ease;
}

.pareto-node:hover circle.dot-main {
  r: 10.5;
}

.pareto-node text {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
}

.pareto-node.is-leader text {
  fill: var(--accent);
  font-weight: 700;
}

.pareto-tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  min-width: 210px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--obsidian);
  color: #F4F6FA;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  line-height: 1.5;
  transform: translate(-50%, calc(-100% - 14px));
}

.pareto-tip[hidden] {
  display: none;
}

.pareto-tip strong {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.pareto-tip span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(244, 246, 250, 0.78);
}

.pareto-tip em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: #FF879B;
  margin-top: 4px;
}

/* Stage Small-Multiples Comparison Grid */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stage-col {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #FAFBFD;
  padding: 14px 16px 16px;
}

.stage-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.stage-col-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.stage-col-title i {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  display: inline-block;
}

.stage-col-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.stage-mini-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stage-mini-row {
  display: grid;
  grid-template-columns: 114px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.stage-mini-name {
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-mini-name:hover {
  color: var(--accent);
}

.stage-mini-track {
  position: relative;
  height: 16px;
  border-radius: 4px;
  background: #EAEFF5;
}

.stage-mini-base {
  position: absolute;
  top: -2px;
  bottom: -2px;
  border-left: 1.5px dashed rgba(17, 19, 24, 0.32);
  z-index: 2;
}

.stage-mini-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 3px;
}

.stage-mini-val {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* 4. Sub-Table Inline Micro-Bars & Overview Matrix Crosshair + Floating Tooltip */
.cell-meter {
  display: block;
  height: 3.5px;
  width: 100%;
  max-width: 78px;
  margin: 5px 0 0 auto;
  border-radius: 999px;
  background: #EAEFF5;
  overflow: hidden;
}

.cell-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #64748B;
}

tr:first-child .cell-meter i,
.cell-meter.is-top i {
  background: var(--accent);
}

.overview-table th.is-col-hover {
  background: var(--accent-soft) !important;
  color: var(--accent);
}

.overview-table th.is-col-hover abbr {
  color: var(--accent);
}

.matrix-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  max-width: 300px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--obsidian);
  color: #F4F6FA;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  line-height: 1.48;
}

.matrix-tooltip[hidden] {
  display: none;
}

.mt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.mt-code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(206, 14, 45, 0.28);
  color: #FF8EA2;
}

.mt-title {
  font-weight: 600;
  color: #FFFFFF;
}

.mt-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(244, 246, 250, 0.66);
  margin-bottom: 6px;
}

.mt-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--mono);
  font-size: 12.5px;
}

.mt-score strong {
  color: #FFFFFF;
  font-size: 14px;
}

/* 5. Runs Explorer Quick Presets & Ratio Badges */
.run-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.run-presets-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.preset-pill {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.preset-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.preset-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.run-table td.run-ratio-peak {
  color: var(--accent);
}

.run-table td.run-ratio-peak::before {
  content: "★ ";
  font-size: 11px;
}

.run-table td.run-ratio-good {
  color: #8E1126;
}

.run-table td.run-ratio-low {
  color: var(--muted);
  font-weight: 500;
}

/* 6. Run Detail Page: Same-Task 9-Agent Switcher */
.task-switcher {
  margin: 22px 0 0;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.task-switcher-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.task-switcher-head strong {
  color: var(--accent);
}

.task-switcher-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.switcher-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.switcher-pill strong {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}

.switcher-pill.is-rejected strong {
  color: var(--amber);
}

.switcher-pill[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.switcher-pill[aria-current="page"] strong {
  color: #FFFFFF;
}

/* 7. Run Detail Page: Interactive Trajectory Profiler */
.phase-stack-wrap {
  margin: 0 0 16px;
}

.phase-stack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.error-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}

.error-pill.is-clean {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.phase-stack {
  display: flex;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #EAEFF5;
  gap: 2px;
}

.phase-stack span {
  display: block;
  height: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.phase-stack span:hover {
  filter: brightness(1.1);
}

.phase-stack span[data-phase="inspect"] { background: #3E8E7E; }
.phase-stack span[data-phase="edit"] { background: #0E7C5D; }
.phase-stack span[data-phase="validate"] { background: #3B73B9; }
.phase-stack span[data-phase="execute"] { background: #C28A2C; }
.phase-stack span[data-phase="build"] { background: #7E5BB3; }
.phase-stack span[data-phase="profile"] { background: #CE5A3C; }
.phase-stack span[data-phase="rollback"] { background: #CE0E2D; }
.phase-stack span[data-phase="other"] { background: #94A3B8; }

.scrub-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 36px;
  padding: 7px 12px;
  margin: 0 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #FAFBFD;
  font-size: 12.5px;
  color: var(--muted);
}

.scrub-bar .scrub-call {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
}

.scrub-bar .scrub-phase {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink-2);
}

.scrub-bar .scrub-status.is-err {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--red);
}

.scrub-bar .scrub-summary {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 200px;
}

.phase-bars {
  padding-top: 16px;
}

.phase-bars i {
  position: relative;
  cursor: pointer;
}

.phase-bars i:hover {
  filter: brightness(1.12);
  transform: scaleY(1.06);
  transform-origin: bottom;
}

.phase-bars i.is-error::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.phase-bars i.is-missing::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.phase-bars.is-filtering i:not(.is-match) {
  opacity: 0.16;
}

.legend span.is-clickable,
.phase-count.is-clickable {
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.legend span.is-clickable:hover,
.phase-count.is-clickable:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.legend span.is-active,
.phase-count.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.traj-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F6F8FB;
  border: 1px solid var(--line);
}

.traj-filter-bar .traj-filter-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.traj-chip {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.traj-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.traj-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.traj-filter-status {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.timeline-event[hidden] {
  display: none;
}

.timeline-event.is-flash .timeline-card {
  animation: flashCard 1.5s ease;
}

@keyframes flashCard {
  0% {
    box-shadow: 0 0 0 3px var(--accent);
    background: var(--accent-soft);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* 8. Git Diff PR-Style Diffstats & Copy Button */
.artifacts-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}

.artifacts-toolbar .btn {
  padding: 6px 12px;
  font-size: 12.5px;
}

.diff-meta-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.diff-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.diff-add {
  color: #0F6B43;
  background: #E6F8ED;
  border: 1px solid #BCE7D1;
  border-radius: 5px;
  padding: 2px 7px;
}

.diff-del {
  color: #B4172E;
  background: #FDECEF;
  border: 1px solid #F5C3CC;
  border-radius: 5px;
  padding: 2px 7px;
}

.diff-copy {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.diff-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.diff-copy.is-copied {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

/* ==========================================================================
   Information-Density Cleanups (Index & 216 Run Pages)
   ========================================================================== */

/* Trim redundant constant badges & duplicate tab headings on index.html */
#leaderboard .toolbar > .badge,
#runs .section-head > .badge {
  display: none;
}

.board-panel h3.is-caption {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  margin: 0 0 12px;
}

/* Clickable peak cells in Hero Obsidian Matrix */
.matrix-cell.is-link {
  cursor: pointer;
}

.matrix-cell.strong strong {
  font-size: 24px;
}

.matrix-cell strong {
  font-size: 24px;
}

/* Clean Artifact column pills in Runs Explorer */
.artifact-zero {
  color: #94A3B8;
  font-style: italic;
}

.artifact-bin {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
}

/* Upgraded 4 Hero KPI Cards on 216 Run Detail Pages */
.metric-sub {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.metric-diff {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-diff-add {
  color: var(--success);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
}

.metric-diff-del {
  color: var(--red);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
}

.metric.is-rank-top strong {
  color: var(--accent);
}

.metric.is-rejected strong {
  color: var(--amber);
  font-size: 24px;
}

/* Consolidate duplicate .legend when .phase-counts is present */
.has-phase-counts .legend {
  display: none;
}

.phase-count-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.phase-pct {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.phase-count > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  background: #94A3B8;
  flex-shrink: 0;
}

.phase-count[data-phase="inspect"] .phase-dot { background: #3E8E7E; }
.phase-count[data-phase="edit"] .phase-dot { background: #0E7C5D; }
.phase-count[data-phase="validate"] .phase-dot { background: #3B73B9; }
.phase-count[data-phase="execute"] .phase-dot { background: #C28A2C; }
.phase-count[data-phase="build"] .phase-dot { background: #7E5BB3; }
.phase-count[data-phase="profile"] .phase-dot { background: #CE5A3C; }
.phase-count[data-phase="rollback"] .phase-dot { background: #CE0E2D; }

/* High-Signal Run Detail Sidebar (.detail-aside) */
.aside-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aside-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.copy-id-btn {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.copy-id-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.copy-id-btn.is-copied {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.result-panel.is-ok { border-top: 3px solid var(--success); }
.result-panel.is-c { border-top: 3px solid var(--red); }
.result-panel.is-m { border-top: 3px solid var(--violet); }
.result-panel.is-s { border-top: 3px solid var(--amber); }

.task-ctx-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
}

.task-ctx-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.task-ctx-list li:last-child {
  border: 0;
}

.task-ctx-list span {
  color: var(--muted);
}

.task-ctx-list strong,
.task-ctx-list a {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

.task-ctx-list a {
  color: var(--accent);
}

.task-ctx-list a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.task-range {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.task-range-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 7px;
}

.task-range-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #DDE3ED;
}

.task-range-med {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #64748B;
  transform: translateX(-50%);
}

.task-range-pin {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 5px rgba(206, 14, 45, 0.5);
  transform: translate(-50%, -50%);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
  .highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    width: calc(100% - 44px);
  }

  .hero {
    gap: 36px;
  }

  .fact {
    padding: 4px 16px;
  }

  .fact strong {
    font-size: 32px;
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .detail-aside .panel {
    margin: 0;
  }

  .run-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .run-filters .search {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .run-filters > .multi-filter:nth-of-type(even) fieldset {
    left: auto;
    right: 0;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 44px 0 36px;
    gap: 32px;
  }

  .facts {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .fact {
    border-left: 0;
    padding: 0;
  }

  .scope-grid {
    grid-template-columns: 1fr;
  }

  .viz-row {
    grid-template-columns: 28px 146px minmax(0, 1fr) 68px;
    gap: 8px;
  }

  .viz-valid {
    display: none;
  }
}

@media (max-width: 680px) {
  .wrap {
    width: calc(100% - 30px);
  }

  .header-inner {
    height: 62px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    gap: 2px;
  }

  .site-header nav {
    gap: 4px;
    font-size: 13px;
  }

  .site-header nav a {
    padding: 6px 8px;
  }

  .site-header nav .nav-overview,
  .site-header nav .nav-guide,
  .site-header nav .nav-pill-tag {
    display: none;
  }

  .site-header nav .nav-pill {
    margin-left: 2px;
    padding: 6px 10px;
    font-size: 12.5px;
  }

  .lang-switch {
    margin-left: 2px;
    padding: 2px;
  }

  .lang-btn {
    padding: 4px 7px;
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(34px, 9.6vw, 44px);
  }

  .hero-desc {
    font-size: 15.5px;
  }

  .portfolio-card {
    padding: 22px 18px 18px;
  }

  .matrix {
    grid-template-columns: 84px repeat(3, 1fr);
    gap: 7px;
  }

  .matrix-cell {
    height: 66px;
  }

  .matrix-cell strong {
    font-size: 18px;
  }

  .section {
    padding: 44px 0;
  }

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

  .section-head > .badge {
    display: none;
  }

  .toolbar {
    align-items: stretch;
  }

  .leaderboard-table.overview-table {
    --rank-width: 38px;
    --name-width: 196px;
    --task-width: 84px;
  }

  .overview-table th:nth-child(3),
  .overview-table td:nth-child(3),
  .overview-table th:nth-child(4),
  .overview-table td:nth-child(4) {
    position: static;
    box-shadow: none;
  }

  .overview-table thead th:nth-child(3),
  .overview-table thead th:nth-child(4) {
    position: sticky;
    z-index: 2;
  }

  .overview-table .agent-avatar {
    display: none;
  }

  .overview-table th,
  .overview-table td {
    padding: 11px 8px;
  }

  #overview-count {
    width: 100%;
    margin-left: 0;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .multi-filter > summary {
    height: 100%;
    padding: 9px 10px;
  }

  .multi-filter fieldset {
    min-width: 245px;
  }

  .filter-bar > .multi-filter:nth-of-type(even) fieldset {
    left: auto;
    right: 0;
  }

  .run-filters .search,
  #overview-count {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .viz-row {
    grid-template-columns: 26px 124px minmax(0, 1fr) 62px;
    padding: 4px 2px;
  }

  .viz-legend {
    display: none;
  }

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

  .detail-aside {
    grid-template-columns: 1fr;
    margin-bottom: 28px;
  }

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

  .timeline-disclosure > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
    padding: 13px 14px;
  }

  .timeline-total {
    grid-column: 1;
  }

  .timeline-disclosure > summary::after {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .timeline-scroll {
    padding: 12px 10px;
  }

  .timeline-event {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 6px;
  }

  .agent-clock {
    --lane-label: 132px;
  }

  .clock-grid {
    min-width: 540px;
  }

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

@media (max-width: 400px) {
  .brand {
    font-size: 15.5px;
    gap: 8px;
  }

  .site-header nav {
    font-size: 12px;
  }
}

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

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
