:root {
  --bg: #eef3ef;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --ink: #16222b;
  --muted: #5d6c76;
  --line: rgba(22, 34, 43, 0.12);
  --accent: #1f6f5f;
  --accent-soft: #d8efe8;
  --warm: #ead7bf;
  --warm-soft: #fbf1e5;
  --bad: #8b2f3d;
  --bad-soft: #f7d8dd;
  --shadow: 0 18px 40px rgba(21, 42, 47, 0.08);
  --topnav-h: 56px;
}

.refresh-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(22, 34, 43, 0.08);
  background: rgba(255, 255, 255, 0.6);
  color: rgba(31, 111, 95, 0.62);
  cursor: pointer;
  box-shadow:
    0 6px 16px rgba(21, 42, 47, 0.06),
    0 1px 2px rgba(21, 42, 47, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.refresh-fab:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(31, 111, 95, 0.16);
  color: rgba(31, 111, 95, 0.88);
  box-shadow:
    0 10px 22px rgba(21, 42, 47, 0.09),
    0 2px 5px rgba(21, 42, 47, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.refresh-fab:active {
  transform: translateY(0) scale(0.96);
  box-shadow:
    0 6px 14px rgba(21, 42, 47, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.refresh-fab:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(31, 111, 95, 0.14),
    0 10px 24px rgba(21, 42, 47, 0.11);
}

.refresh-fab-icon {
  width: 17px;
  height: 17px;
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.2s ease;
}

.refresh-fab.loading {
  pointer-events: none;
}

.refresh-fab.loading .refresh-fab-icon {
  animation: refresh-fab-spin 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes refresh-fab-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 216, 160, 0.25), transparent 28%),
    radial-gradient(circle at right 20%, rgba(150, 215, 197, 0.22), transparent 25%),
    linear-gradient(180deg, #f8fbf8 0%, var(--bg) 100%);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - var(--topnav-h));
}

.sidebar {
  position: sticky;
  top: var(--topnav-h);
  height: calc(100vh - var(--topnav-h));
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(245, 249, 246, 0.92);
  backdrop-filter: blur(14px);
  overflow: auto;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand p {
  margin-top: 6px;
  color: var(--muted);
}

.filter-panel {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filter-head {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.filter-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-row select,
.filter-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--panel-strong);
}

.run-list {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.run-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.run-card:hover,
.run-card.active {
  border-color: rgba(31, 111, 95, 0.5);
  transform: translateY(-1px);
}

.run-top,
.run-meta,
.panel-head,
.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.run-top.simple {
  justify-content: space-between;
}

.run-card-title {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.run-cat-prefix {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 95, 0.16);
  background: rgba(216, 239, 232, 0.62);
  color: #0c5b47;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.run-top.simple .badge {
  flex: 0 0 auto;
}

.run-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.run-meta.compact {
  margin-top: 6px;
  font-size: 12px;
}

.run-subtitle {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 28px;
  display: grid;
  gap: 18px;
}

.hero,
.panel,
.debug {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(31, 111, 95, 0.12), rgba(255, 223, 168, 0.26)),
    var(--panel-strong);
}

.hero-copy h2,
.panel h3 {
  margin: 0;
}

.hero-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.status-line {
  margin-top: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.status-line.subtle {
  color: var(--muted);
  margin-top: 14px;
  font-size: 13px;
}

.summary-lines {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.summary-pill.emphasis {
  background: rgba(216, 239, 232, 0.62);
  border-color: rgba(31, 111, 95, 0.16);
}

.summary-pill.status.ok {
  background: rgba(216, 239, 232, 0.78);
  border-color: rgba(31, 111, 95, 0.18);
  color: #0c5b47;
}

.nested-fold {
  margin: 10px 0 12px;
  background: rgba(248, 251, 248, 0.68);
}

.summary-pill.status.bad {
  background: rgba(247, 216, 221, 0.72);
  border-color: rgba(139, 47, 61, 0.16);
  color: var(--bad);
}

.summary-pill.status.neutral {
  background: rgba(234, 215, 191, 0.52);
  border-color: rgba(122, 85, 34, 0.16);
  color: #6e532c;
}

/* Used for rate_limit (HTTP 429 from upstream model provider) — distinct
   from .neutral (generic infra_error) and .bad (genuine task failure)
   so the WebUI dashboard can call out operator quota problems. */
.summary-pill.status.warn {
  background: var(--warm-soft);
  border-color: rgba(122, 85, 34, 0.28);
  color: #7a5522;
}

/* Used for infra_error and pre_exec_failed: sandbox / container / setup
   broke before the model could legitimately attempt the task. Purple
   distinguishes infrastructure breakage from model failures (.bad red)
   and quota throttling (.warn amber). */
.summary-pill.status.purple {
  background: rgba(216, 198, 240, 0.62);
  border-color: rgba(106, 53, 138, 0.20);
  color: #5a2a83;
}

.eyebrow,
.panel-note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(22, 34, 43, 0.06);
}

.badge.ok {
  background: var(--accent-soft);
  color: #0c5b47;
}

.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.badge.warn {
  background: var(--warm-soft);
  color: #7a5522;
}

.badge.purple {
  background: rgba(216, 198, 240, 0.6);
  color: #5a2a83;
}

.panel {
  padding: 18px;
}

.panel-head > span {
  min-width: 0;
}

.flow-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.flow-panel-head > span {
  width: 100%;
}

.hidden {
  display: none !important;
}

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

.attempt-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.attempt-select select {
  min-width: 120px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(22, 34, 43, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.flow-filter-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  overflow-x: visible;
  padding: 4px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 251, 248, 0.94), rgba(238, 243, 239, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.flow-filter-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  min-width: 78px;
  padding: 8px 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.flow-filter-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(22, 34, 43, 0.08);
}

.flow-filter-btn:focus-visible {
  outline: none;
  border-color: rgba(31, 111, 95, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 111, 95, 0.14);
}

.flow-filter-btn.active {
  background: rgba(216, 239, 232, 0.92);
  border-color: rgba(31, 111, 95, 0.18);
  color: #0c5b47;
  box-shadow: 0 2px 6px rgba(31, 111, 95, 0.08);
}

.flow-filter-btn.active:hover {
  transform: none;
}

.ios-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.ios-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ios-toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(123, 137, 148, 0.34);
  box-shadow: inset 0 1px 2px rgba(22, 34, 43, 0.18);
  transition: background 160ms ease;
}

.ios-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 34, 43, 0.18);
  transition: transform 160ms ease;
}

.ios-toggle input:checked + .ios-toggle-track {
  background: #1f6f5f;
}

.ios-toggle input:checked + .ios-toggle-track::after {
  transform: translateX(18px);
}

.ios-toggle input:focus-visible + .ios-toggle-track {
  outline: 3px solid rgba(31, 111, 95, 0.18);
  outline-offset: 2px;
}

.panel-collapsible {
  padding: 0;
  overflow: hidden;
}

.panel-collapsible[open] {
  padding-bottom: 18px;
}

.collapsible-head {
  list-style: none;
  cursor: pointer;
  padding: 18px;
}

.collapsible-head::-webkit-details-marker {
  display: none;
}

.panel-collapsible .checkpoints,
.panel-collapsible .outputs {
  padding: 0 18px;
}

.flow-stage {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.flow-stage:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.agent-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.agent-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
}

.agent-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.agent-card-emoji {
  font-size: 20px;
}

.agent-card-title {
  font-size: 14px;
  font-weight: 700;
}

.agent-card-subtitle,
.agent-card-metrics {
  color: var(--muted);
  font-size: 12px;
}

.agent-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.agent-card-highlights {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-card-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(22, 34, 43, 0.06);
  color: var(--muted);
  font-size: 11px;
}

.handoff-trace {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.84);
}

.handoff-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.handoff-item {
  border: 1px dashed rgba(22, 34, 43, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(248, 251, 248, 0.88);
}

.handoff-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.handoff-arrow {
  color: var(--muted);
}

.handoff-via {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 111, 95, 0.1);
  color: #0c5b47;
  font-size: 11px;
  font-weight: 600;
}

.handoff-summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.flow-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.flow-stage-meta {
  color: var(--muted);
  font-size: 12px;
}

.continuation-summary {
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.result-summary,
.check-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.result-summary,
.check-summary {
  cursor: pointer;
}

.continuation-summary-status {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.continuation-summary-reason {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding-right: 18px;
}

.result-item,
.check-fold {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel-strong);
  margin-bottom: 12px;
}

/* Round 9 / B4: failure-signal cycles in supervisor trace.  Red left
   border + tinted background so reviewers can scan a multi-cycle
   attempt for the cycle that actually broke. */
.check-fold.check-fold-failure {
  border-color: #b03a4b;
  border-left-width: 4px;
  background: rgba(176, 58, 75, 0.06);
}

/* Round 9 / B4: EDICT upstream-revision badge.  Slightly tinted so
   it visually separates from the generic Backend / Model pills. */
.summary-pill.edict-badge {
  background: rgba(96, 64, 156, 0.12);
  border-color: rgba(96, 64, 156, 0.35);
  color: var(--text-strong, inherit);
}

.result-body,
.check-fold pre {
  margin-top: 12px;
}

.result-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.result-title strong {
  overflow-wrap: anywhere;
}

.result-file-meta {
  color: var(--muted);
  font-size: 11px;
  font-family: "SF Mono", Monaco, monospace;
  text-transform: uppercase;
}

.result-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-actions a,
.result-preview-link {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 7px;
  text-decoration: none;
}

.result-actions a:hover,
.result-preview-link:hover {
  background: var(--accent-soft);
}

.result-unavailable {
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 7px;
  background: rgba(130, 145, 130, 0.1);
}

.result-code {
  max-height: 560px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 251, 248, 0.78);
}

.result-frame {
  width: 100%;
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.result-frame.pdf {
  min-height: 760px;
}

.result-media,
.result-audio {
  width: 100%;
  border-radius: 10px;
  background: #101820;
}

.result-media {
  max-height: 720px;
}

.result-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid rgba(22, 34, 43, 0.08);
  border-right: 1px solid rgba(22, 34, 43, 0.06);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  font-weight: 700;
}

.result-preview-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.result-binary-preview {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(248, 251, 248, 0.78);
}

.result-binary-preview span {
  color: var(--muted);
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.result-binary-preview .result-unavailable {
  font-family: inherit;
  width: fit-content;
}

.result-binary-preview a {
  color: var(--accent);
  width: fit-content;
}

.check-copy {
  margin-top: 12px;
}

.check-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.markdown-body {
  color: var(--ink);
  line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body a {
  color: var(--accent);
}

.md-figure {
  margin: 14px 0;
}

.md-figure button,
.flow-image-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.md-figure img {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.md-figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.stats-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel-strong);
}

.stat-card.emphasis {
  background: linear-gradient(135deg, rgba(31, 111, 95, 0.08), rgba(255, 223, 168, 0.18)), var(--panel-strong);
}

.stat-card.usage {
  background: rgba(216, 239, 232, 0.28);
}

.attempts-card {
  grid-column: span 2;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

.stat-subtle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.stat-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.attempt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.outputs,
.checkpoints,
.continuations {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.timeline {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

/* Flow area is a flex row so the Execution Timeline (Gantt) panel can
   dock on the right side of the main flow column. When collapsed the
   panel shrinks to just a narrow toggle strip. */
.flow-shell {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 16px;
}

.exec-timeline {
  flex: 0 0 460px;
  max-width: 460px;
  border-left: 1px solid var(--line);
  padding: 0 0 0 12px;
  transition: flex-basis 0.2s ease, max-width 0.2s ease, padding 0.2s ease;
  position: relative;
}

.exec-timeline.collapsed {
  flex-basis: 34px;
  max-width: 34px;
  padding: 0 0 0 4px;
  overflow: hidden;
}

.exec-timeline-toggle {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--fg-muted, #64748b);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
}

.exec-timeline-toggle:hover { background: rgba(100, 116, 139, 0.08); }

.exec-timeline.collapsed .exec-timeline-toggle {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  justify-content: center;
}

.exec-timeline-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.exec-timeline:not(.collapsed) .exec-timeline-toggle-icon {
  transform: rotate(90deg);
}

.exec-timeline.collapsed .exec-timeline-body { display: none; }

.exec-timeline-body {
  padding: 8px 4px 12px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 80vh;
}

.exec-timeline-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--fg, #0f172a);
  padding: 2px 6px 10px 6px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 8px;
}

.exec-timeline-summary strong {
  font-weight: 600;
  font-size: 13px;
}

.exec-timeline-status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--fg-muted, #64748b);
  background: rgba(100, 116, 139, 0.12);
}

.exec-timeline-status[data-in-progress="true"] {
  color: #0369a1;
  background: rgba(3, 105, 161, 0.12);
}

.exec-timeline-hint {
  font-size: 11px;
  color: var(--fg-muted, #64748b);
  margin-top: 4px;
  line-height: 1.4;
}

.exec-timeline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 8px 6px;
  margin-bottom: 4px;
}

.exec-timeline-filter {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  background: var(--panel-bg, #fff);
  color: var(--fg, #0f172a);
  outline: none;
}
.exec-timeline-filter:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.exec-timeline-count {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--fg-muted, #64748b);
  white-space: nowrap;
}

.exec-timeline-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
}

.exec-timeline-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--fg-muted, #64748b);
}

/* --- Step rows ---
   Each row: number gutter | colored accent bar | body (head + mini-bar).
   Color is driven entirely by [data-category]. */
.exec-step {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px 2px 4px 0;
  border-radius: 4px;
  background: transparent;
  transition: background 0.12s ease;
  min-height: 28px;
}
.exec-step:hover { background: rgba(148, 163, 184, 0.08); }

.exec-step-num {
  flex: 0 0 22px;
  font-size: 10px;
  color: var(--fg-muted, #64748b);
  text-align: right;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.exec-step-accent {
  flex: 0 0 3px;
  border-radius: 2px;
  align-self: stretch;
  background: #cbd5e1;
}

.exec-step[data-category="container"] .exec-step-accent { background: #94a3b8; }
.exec-step[data-category="executor"] .exec-step-accent { background: #2563eb; }
.exec-step[data-category="browser"] .exec-step-accent { background: #3b82f6; }
.exec-step[data-category="read"] .exec-step-accent { background: #eab308; }
.exec-step[data-category="write"] .exec-step-accent { background: #d97706; }
.exec-step[data-category="exec"] .exec-step-accent { background: #0ea5e9; }
.exec-step[data-category="search"] .exec-step-accent { background: #8b5cf6; }
.exec-step[data-category="meta"] .exec-step-accent { background: #06b6d4; }
.exec-step[data-category="tool_call"] .exec-step-accent { background: #60a5fa; }
.exec-step[data-category="tool"] .exec-step-accent { background: #60a5fa; }
.exec-step[data-category="supervisor"] .exec-step-accent { background: #10b981; }
.exec-step[data-category="user_simulator"] .exec-step-accent { background: #f59e0b; }
.exec-step[data-category="artifact"] .exec-step-accent { background: #a78bfa; }

.exec-step[data-header="true"] {
  background: rgba(37, 99, 235, 0.05);
}
.exec-step[data-skipped="true"] .exec-step-accent {
  background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 2px, transparent 2px, transparent 4px);
}
.exec-step[data-errored="true"] .exec-step-accent {
  background: #ef4444;
}
.exec-step[data-approximate="true"] .exec-step-bar-fill {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.3), rgba(255,255,255,0.3) 3px, transparent 3px, transparent 6px);
}

.exec-step-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exec-step-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.exec-step-icon {
  flex: 0 0 16px;
  font-size: 12px;
  text-align: center;
  opacity: 0.85;
}

.exec-step-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--fg, #0f172a);
  font-weight: 500;
}

.exec-step-agent,
.exec-step-cycle {
  flex: 0 0 auto;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.1);
  color: var(--fg-muted, #64748b);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.exec-step-dur {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--fg-muted, #64748b);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 4px;
}

/* Track spans the full attempt window; fill is absolute-positioned so
   ``left`` shows WHEN the step started (relative to attempt_started_ms)
   and ``width`` shows duration relative to the overall attempt. */
.exec-step-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.exec-step-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: #94a3b8;
  min-width: 2px;
  transition: left 0.15s ease, width 0.15s ease;
}

.exec-step[data-category="executor"] .exec-step-bar-fill { background: #2563eb; }
.exec-step[data-category="browser"] .exec-step-bar-fill { background: #3b82f6; }
.exec-step[data-category="read"] .exec-step-bar-fill { background: #eab308; }
.exec-step[data-category="write"] .exec-step-bar-fill { background: #d97706; }
.exec-step[data-category="exec"] .exec-step-bar-fill { background: #0ea5e9; }
.exec-step[data-category="search"] .exec-step-bar-fill { background: #8b5cf6; }
.exec-step[data-category="meta"] .exec-step-bar-fill { background: #06b6d4; }
.exec-step[data-category="tool_call"] .exec-step-bar-fill { background: #60a5fa; }
.exec-step[data-category="supervisor"] .exec-step-bar-fill { background: #10b981; }
.exec-step[data-category="user_simulator"] .exec-step-bar-fill { background: #f59e0b; }
.exec-step[data-category="artifact"] .exec-step-bar-fill { background: #a78bfa; }
.exec-step[data-category="container"] .exec-step-bar-fill { background: #94a3b8; }

.bubble {
  max-width: 84%;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(21, 42, 47, 0.05);
}

.bubble-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.bubble.user {
  margin-left: auto;
  background: var(--warm-soft);
  border-color: rgba(199, 154, 87, 0.28);
}

.bubble.assistant {
  background: var(--panel-strong);
}

.bubble.tool {
  margin: 0;
  max-width: 74%;
  background: rgba(216, 239, 232, 0.72);
  border-color: rgba(31, 111, 95, 0.18);
}

.bubble.supervisor {
  margin: 0;
  max-width: 76%;
  background: rgba(234, 215, 191, 0.35);
  border-color: rgba(122, 85, 34, 0.18);
}

.bubble.system {
  margin: 0;
  max-width: 70%;
  background: rgba(22, 34, 43, 0.06);
  border-style: dashed;
}

.bubble.simulated-user {
  max-width: 78%;
}

.bubble.tool {
  align-self: flex-start;
}

.bubble.tool-result {
  margin: 0;
  max-width: 78%;
  background: rgba(248, 251, 248, 0.96);
}

.bubble-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 8px;
}

.bubble-title-row .bubble-title {
  margin-bottom: 0;
}

.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(22, 34, 43, 0.08);
  color: var(--ink);
}

.bubble[data-agent="taizi"],
.agent-card[data-agent="taizi"] {
  border-left: 4px solid #f4b400;
}

.bubble[data-agent="zhongshu"],
.agent-card[data-agent="zhongshu"] {
  border-left: 4px solid #4c6ef5;
}

.bubble[data-agent="menxia"],
.agent-card[data-agent="menxia"] {
  border-left: 4px solid #e67700;
}

.bubble[data-agent="shangshu"],
.agent-card[data-agent="shangshu"] {
  border-left: 4px solid #0c8599;
}

.bubble[data-agent="hubu"],
.agent-card[data-agent="hubu"] {
  border-left: 4px solid #2b8a3e;
}

.bubble[data-agent="libu"],
.agent-card[data-agent="libu"] {
  border-left: 4px solid #9c36b5;
}

.bubble[data-agent="bingbu"],
.agent-card[data-agent="bingbu"] {
  border-left: 4px solid #c92a2a;
}

.bubble[data-agent="xingbu"],
.agent-card[data-agent="xingbu"] {
  border-left: 4px solid #495057;
}

.bubble[data-agent="gongbu"],
.agent-card[data-agent="gongbu"] {
  border-left: 4px solid #0b7285;
}

.bubble[data-agent="libu_hr"],
.agent-card[data-agent="libu_hr"] {
  border-left: 4px solid #d9480f;
}

.bubble[data-agent="zaochao"],
.agent-card[data-agent="zaochao"] {
  border-left: 4px solid #364fc7;
}

.bubble-body {
  margin-top: 8px;
}

.flow-image {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-strong);
}

.flow-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #f3f6f3;
}

.flow-image figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.output-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel-strong);
}

.checkpoints {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.artifact-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.artifact-row a {
  color: var(--accent);
  text-decoration: none;
}

.continuations {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.check-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel-strong);
}

.cont-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel-strong);
}

.check-card.ok {
  border-color: rgba(31, 111, 95, 0.22);
  background: rgba(216, 239, 232, 0.36);
}

.check-card.bad {
  border-color: rgba(139, 47, 61, 0.22);
  background: rgba(247, 216, 221, 0.34);
}

.cont-card.ok {
  border-color: rgba(31, 111, 95, 0.22);
  background: rgba(216, 239, 232, 0.36);
}

.check-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.check-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cont-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.output-head a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.debug {
  padding: 12px 16px;
}

.debug summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.recording-player {
  width: 100%;
  max-height: 65vh;
  background: #000;
  border-radius: 12px;
  display: block;
}

/* Per-cycle recording block rendered inline inside the Execution Flow
 * timeline, above each cycle's executor events. */
.cycle-recording {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.cycle-recording-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}

.cycle-recording-meta {
  color: var(--muted);
  font-size: 12px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.lightbox.hidden {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 20, 0.72);
  backdrop-filter: blur(6px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(92vw, 1200px);
  max-height: 92vh;
  margin: 4vh auto;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.lightbox-close {
  justify-self: end;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(92vh - 120px);
  margin: 0 auto;
  border-radius: 16px;
  object-fit: contain;
  background: #f5f7f5;
}

.lightbox-caption {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .quick-stats {
    justify-content: flex-start;
  }

  .attempts-card {
    grid-column: span 1;
  }

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

  .flow-filter-group {
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .flow-shell {
    flex-direction: column;
  }

  .exec-timeline,
  .exec-timeline.collapsed {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .exec-timeline.collapsed {
    max-height: 40px;
  }
}

.debug-body {
  padding-top: 12px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .bubble,
  .bubble.tool {
    max-width: 100%;
  }
}

/* ───────────────────────────────────────────────────────────────────
   Top nav (multi-page shell)
   ─────────────────────────────────────────────────────────────────── */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 28px;
  background: rgba(245, 249, 246, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.topnav .brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.topnav .brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

.topnav .brand-tag {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.topnav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
}

.topnav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease;
}

.topnav-link:hover {
  color: var(--ink);
  background: rgba(31, 111, 95, 0.06);
}

.topnav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.topnav-link.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.page-root {
  min-height: calc(100vh - var(--topnav-h));
}

/* ───────────────────────────────────────────────────────────────────
   Home page
   ─────────────────────────────────────────────────────────────────── */

.home-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 28px 88px;
  display: grid;
  gap: 34px;
  font-size: 14px;
}

.home-hero,
.home-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 34px;
  padding: 42px 0 34px;
  border-bottom: 1px solid rgba(22, 34, 43, 0.1);
}

.home-hero-copy h1 {
  margin: 6px 0 0;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 0.9;
  letter-spacing: 0;
}

.home-hero-copy p,
.home-section-copy p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 760px;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.home-resource-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.home-action,
.home-inline-link,
.home-resource-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(31, 111, 95, 0.18);
  border-radius: 8px;
  background: rgba(216, 239, 232, 0.58);
  color: #0c5b47;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.home-link-arrow {
  margin-left: 6px;
  font-size: 0.95em;
  line-height: 1;
  transform: translateY(-0.5px);
}

.home-resource-badge {
  gap: 7px;
  min-height: 28px;
  padding: 5px 11px;
  border-color: rgba(22, 34, 43, 0.12);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 12px;
  box-shadow:
    0 6px 14px rgba(21, 42, 47, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.home-resource-badge.pending {
  cursor: default;
  filter: saturate(0.72);
}

.home-resource-icon {
  font-size: 14px;
  line-height: 1;
}

.home-resource-badge.project {
  background: linear-gradient(180deg, #128fc3 0%, #0872aa 100%);
  border-color: rgba(8, 114, 170, 0.4);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.home-resource-badge.code {
  background: linear-gradient(180deg, #2c3440 0%, #111827 100%);
  border-color: rgba(17, 24, 39, 0.42);
  color: #fff;
}

.home-resource-badge.daily {
  background: linear-gradient(180deg, #f4b026 0%, #d57226 100%);
  border-color: rgba(213, 114, 38, 0.42);
  color: #fff;
}

.home-resource-badge.arxiv {
  background: linear-gradient(180deg, #fff 0%, #fff7f8 100%);
  border-color: rgba(145, 31, 48, 0.24);
  color: #9f1e35;
}

.home-resource-label,
.home-resource-value {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
}

.home-resource-badge.arxiv .home-resource-label {
  background: #4a4a4a;
  color: #fff;
}

.home-resource-badge.arxiv .home-resource-value {
  background: #af1e2d;
  color: #fff;
}

.home-action.primary {
  border-color: rgba(31, 111, 95, 0.42);
  background: #1f6f5f;
  color: white;
}

.home-action:hover,
.home-inline-link:hover,
.home-resource-badge:hover {
  background: rgba(216, 239, 232, 0.82);
}

.home-resource-badge.project:hover { background: linear-gradient(180deg, #1d9bd0 0%, #0872aa 100%); }
.home-resource-badge.code:hover { background: linear-gradient(180deg, #3a4350 0%, #111827 100%); }
.home-resource-badge.daily:hover { background: linear-gradient(180deg, #ffc03d 0%, #d57226 100%); }
.home-resource-badge.arxiv:hover { background: linear-gradient(180deg, #fff 0%, #fff0f2 100%); }
.home-resource-badge.pending:hover { transform: none; }

.home-citation {
  display: grid;
  gap: 14px;
}

.home-citation-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(31, 111, 95, 0.2);
  border-radius: 7px;
  background: rgba(216, 239, 232, 0.56);
  color: #0c5b47;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.home-citation-copy:hover { background: rgba(216, 239, 232, 0.86); }

.home-citation-code {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid rgba(22, 34, 43, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 249, 0.86);
  color: #26353a;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
}

.home-action.primary:hover {
  background: #175846;
}

.home-hero-panel {
  display: grid;
  gap: 12px;
  align-self: start;
}

.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.home-leader-mini {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 34, 43, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(21, 42, 47, 0.06);
  min-height: 86px;
  align-content: center;
}

.home-leader-mini-row {
  display: grid;
  grid-template-columns: 24px 82px minmax(0, 1fr);
  grid-template-areas:
    "medal label name"
    "medal label sub";
  align-items: baseline;
  column-gap: 9px;
  min-width: 0;
}

.home-leader-mini-medal {
  grid-area: medal;
  font-size: 17px;
  line-height: 1;
}

.home-leader-mini-label {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.home-leader-mini-row strong {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.home-leader-mini-row small {
  grid-area: sub;
  justify-self: start;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.home-stat-tile,
.home-fact,
.role-chip {
  border: 1px solid rgba(22, 34, 43, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.home-stat-tile {
  min-height: 86px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.home-stat-tile strong {
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.home-stat-tile span,
.home-fact span,
.role-chip span,
.demo-kicker,
.demo-pill {
  color: var(--muted);
  font-size: 12px;
}

.home-section {
  padding: 0;
}

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

.home-inline-warning {
  color: #7c5a16;
  font-size: 0.82rem;
  line-height: 1.35;
  max-width: 34rem;
}

.home-section-head h2,
.home-section-copy h2,
.home-chart-card h3,
.demo-copy h3 {
  margin: 0;
  letter-spacing: 0;
}

.home-method-grid,
.home-runtime-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: stretch;
}

.home-runtime-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.home-role-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.role-chip {
  padding: 12px;
  display: grid;
  gap: 4px;
}

.role-chip strong {
  font-size: 13px;
}

.paper-figure {
  margin: 0;
  display: grid;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.figure-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ffffff;
  border-bottom: 1px solid rgba(22, 34, 43, 0.08);
}

.paper-figure img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  object-fit: contain;
  object-position: center;
  display: block;
}

.paper-figure img,
.demo-media img,
.markdown-body img,
.flow-image img {
  cursor: zoom-in;
}

.paper-figure-method .figure-media {
  aspect-ratio: 2.1 / 1;
}

.paper-figure-wide .figure-media {
  aspect-ratio: 1.98 / 1;
}

.paper-figure-strip .figure-media {
  aspect-ratio: 3.25 / 1;
}

.paper-figure-method img {
  object-fit: contain;
}

.paper-figure figcaption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
}

.home-data-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.18fr) minmax(240px, 0.72fr);
  gap: 18px;
}

.home-data-grid .paper-figure {
  grid-row: auto;
}

.home-chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.home-bars {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.home-bar-row {
  display: grid;
  grid-template-columns: 132px 1fr 34px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.home-bar-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(31, 111, 95, 0.1);
  overflow: hidden;
}

.home-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.home-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.home-fact {
  padding: 12px;
  display: grid;
  gap: 5px;
}

.home-fact strong {
  font-size: 18px;
}

.home-leaderboard-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-leader-switch {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.home-leader-toggle {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
}

.home-leader-toggle.active {
  color: #fff;
  background: var(--accent);
}

.home-leaderboard-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  padding: 14px;
}

.home-leaderboard-card.compact {
  max-width: none;
}

.home-leaderboard-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-leaderboard-head div {
  display: grid;
  gap: 3px;
}

.home-leaderboard-head span,
.home-leaderboard-head a {
  color: var(--muted);
  font-size: 12px;
}

.home-leaderboard-head a {
  text-decoration: none;
}

.home-leaderboard {
  display: grid;
  gap: 8px;
}

.home-leader-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px minmax(220px, 1.2fr) minmax(220px, 1fr) 70px 70px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.home-leader-row:hover {
  border-color: var(--row-base, rgba(31, 111, 95, 0.34));
  background: rgba(255, 255, 255, 0.96);
}

.home-rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.home-medal {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.home-rank-number {
  min-width: 1.4em;
}

.home-model {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.home-leader-bars {
  display: grid;
  gap: 6px;
}

.home-leader-bar {
  display: block;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--row-bg, rgba(31, 111, 95, 0.1));
}

.home-leader-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.home-leader-bar.pass b {
  background: var(--row-base, var(--accent));
}

.home-leader-bar.score {
  background: var(--row-bg, rgba(31, 111, 95, 0.08));
}

.home-leader-bar.score b {
  background: var(--row-soft, rgba(31, 111, 95, 0.42));
}

.home-pr,
.home-as {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.home-pr {
  color: #0c5b47;
  font-weight: 700;
}

.home-as {
  color: #5f6f6a;
}

.demo-frame-shell {
  position: relative;
}

.demo-nav {
  position: absolute;
  z-index: 4;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 64px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(12, 91, 71, 0.72);
  cursor: pointer;
  font-size: 46px;
  line-height: 1;
}

.demo-nav:hover {
  color: #0c5b47;
}

.demo-nav-left {
  left: -46px;
}

.demo-nav-right {
  right: -46px;
}

.demo-slide {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  padding: 14px;
  box-shadow: var(--shadow);
}

.demo-media {
  aspect-ratio: 16 / 9;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101820;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-media video,
.demo-media img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.demo-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 4px 2px;
}

.demo-copy h3 {
  font-size: 18px;
  line-height: 1.25;
}

.demo-kicker {
  text-transform: uppercase;
  letter-spacing: 0;
}

.demo-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.58;
}

.demo-links,
.demo-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-run-summary {
  display: grid;
  gap: 10px;
}

.demo-run-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 10px;
  background: rgba(247, 250, 249, 0.62);
}

.demo-info-row {
  display: grid;
  gap: 8px;
}

.demo-info-topline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-info-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-info-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.demo-run-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.demo-run-metric span,
.demo-run-placeholder,
.demo-preview-empty {
  color: var(--muted);
  font-size: 12px;
}

.demo-run-metric strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.demo-run-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(22, 34, 43, 0.08);
}

.demo-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid rgba(31, 111, 95, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #0c5b47;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
}

.demo-action:hover {
  background: rgba(216, 239, 232, 0.58);
  border-color: rgba(31, 111, 95, 0.28);
}

.demo-action:disabled {
  opacity: 0.48;
  cursor: default;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.demo-dots {
  justify-content: center;
  margin-top: 14px;
}

.demo-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(31, 111, 95, 0.22);
  cursor: pointer;
}

.demo-dot.active {
  background: var(--accent);
}

.demo-media-empty {
  color: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 6px;
  text-align: center;
  padding: 18px;
}

.demo-media-empty strong {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.demo-media-empty span {
  font-size: 12px;
}

.demo-inspector {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(22, 34, 43, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 58px rgba(12, 21, 31, 0.18);
  padding: 16px;
  font-size: 13px;
  transition: width 0.18s ease;
}

.demo-inspector.timeline-open {
  width: min(1120px, calc(100vw - 32px));
}

.demo-inspector-close-float {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  box-shadow: 0 8px 20px rgba(12, 21, 31, 0.12);
}

.demo-inspector-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 46px;
}

.demo-inspector-head div {
  display: grid;
  gap: 4px;
}

.demo-inspector-head span {
  color: var(--muted);
  font-size: 12px;
}

.demo-inspector-head strong {
  font-size: 16px;
}

.demo-inspector-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.demo-inspector-head .demo-inspector-close {
  display: none;
}

.demo-inspector-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.demo-inspector-meta,
.demo-inspector-links,
.demo-inspector-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-tool-toggle {
  min-height: 30px;
  border: 1px solid rgba(31, 111, 95, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #0c5b47;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.demo-tool-toggle.active {
  background: var(--accent);
  color: #fff;
}

.demo-inspector-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 14px;
  min-height: 0;
  overflow: hidden;
}

.demo-inspector.timeline-open .demo-inspector-shell {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.demo-inspector-main {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  max-height: calc(min(720px, calc(100vh - 44px)) - 140px);
  overflow: auto;
  padding-right: 4px;
}

.demo-inspector-timeline {
  display: none;
  min-width: 0;
  max-height: calc(min(720px, calc(100vh - 44px)) - 140px);
  overflow: auto;
  border-left: 1px solid rgba(22, 34, 43, 0.1);
  padding-left: 14px;
}

.demo-inspector.timeline-open .demo-inspector-timeline {
  display: grid;
  align-content: start;
  gap: 10px;
}

.demo-inspector-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.demo-inspector-section-head h4 {
  margin: 0;
  font-size: 13px;
}

.demo-inspector-section-head span {
  color: var(--muted);
  font-size: 11.5px;
  text-align: right;
}

.demo-preview-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.demo-preview-list li {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 8px;
  background: rgba(247, 250, 249, 0.72);
}

.demo-preview-list strong {
  font-size: 12px;
}

.demo-preview-list span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.demo-trace-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 12px;
  background: rgba(247, 250, 249, 0.64);
}

.demo-cycle-block {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(22, 34, 43, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.demo-cycle-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(22, 34, 43, 0.1);
}

.demo-cycle-head strong {
  font-size: 12px;
  color: var(--ink);
}

.demo-cycle-head span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.demo-cycle-events {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.demo-trace-flow .bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 16px;
}

.demo-trace-flow .bubble-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  margin: 0;
}

.demo-exec-timeline {
  display: grid;
  gap: 8px;
}

.demo-exec-timeline .exec-timeline-summary {
  margin-bottom: 0;
}

.demo-exec-timeline .exec-timeline-controls {
  padding: 0 4px 4px;
}

/* ───────────────────────────────────────────────────────────────────
   Leaderboard page
   ─────────────────────────────────────────────────────────────────── */

.results-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}

.results-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.results-header .results-note {
  color: var(--muted);
  font-size: 13px;
}

.results-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.results-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.results-tab {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.14s ease, background 0.14s ease;
}

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

.results-tab.active {
  color: #ffffff;
  background: var(--accent);
}

.results-modes-wrap {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.results-mode-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.results-mode-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 13px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease;
}

.results-mode-tab:hover {
  color: var(--ink);
}

.results-mode-tab.active {
  color: #fff;
  background: var(--accent);
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.results-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.results-children {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 20px;
  padding-left: 14px;
  border-left: 2px solid rgba(22, 34, 43, 0.08);
}

.metric-block {
  --row-base: var(--accent);
  --row-soft: rgba(31, 111, 95, 0.42);
  --row-bg: rgba(31, 111, 95, 0.1);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--row-base);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.metric-block.indented {
  padding: 12px 18px;
  box-shadow: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.metric-row {
  display: grid;
  grid-template-columns: 160px 1fr 68px 28px;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "label bars values chevron"
    "meta  bars values chevron"
    "avg   avg  avg    chevron";
  align-items: center;
  gap: 4px 16px;
}

.metric-row .metric-averages {
  grid-area: avg;
  text-align: right;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.metric-row .metric-label {
  grid-area: label;
  align-self: center;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  letter-spacing: 0;
  word-break: break-word;
}

.metric-row .metric-bars {
  grid-area: bars;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
}

.metric-row .metric-values {
  grid-area: values;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
  text-align: right;
}

.metric-row .metric-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 9px;
  padding-top: 2px;
  color: var(--ink);
}

.metric-row .metric-value.pass {
  color: var(--row-base);
}

.metric-row .metric-value.score {
  color: var(--muted);
}

.metric-row .metric-meta {
  grid-area: meta;
  align-self: start;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.metric-row .metric-chevron {
  grid-area: chevron;
  justify-self: end;
  align-self: center;
  color: var(--row-base);
  font-size: 18px;
  line-height: 1;
  transform-origin: center;
  transition: transform 0.16s ease;
}

.metric-block.expanded > .metric-row .metric-chevron {
  transform: rotate(90deg);
}

.metric-row.metric-row-cat {
  grid-template-columns: 150px 1fr 68px 60px;
  grid-template-rows: auto auto;
  grid-template-areas:
    "label bars values meta"
    "avg   avg  avg    avg";
  padding: 2px 0 4px;
}

.metric-row.metric-row-cat .metric-averages {
  font-size: 10.5px;
  padding-top: 1px;
  padding-right: 60px;
}

.metric-row.metric-row-cat .metric-label {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0;
  padding-left: 16px;
  position: relative;
}

.metric-row.metric-row-cat .metric-label::before {
  content: "└";
  position: absolute;
  left: 4px;
  color: rgba(22, 34, 43, 0.35);
}

.metric-row.metric-row-cat .metric-value {
  font-size: 11.5px;
}

.metric-row.metric-row-cat .metric-meta {
  text-align: right;
  font-size: 11px;
}

.metric-row.metric-row-cat.empty {
  opacity: 0.45;
}

.metric-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--row-bg);
  overflow: hidden;
}

.metric-row.metric-row-cat .metric-bar {
  height: 6px;
}

.metric-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width 0.24s ease;
}

.metric-bar-fill.pass {
  background: var(--row-base);
}

.metric-bar-fill.score {
  background: var(--row-soft);
}

.metric-bar-fill.empty {
  background: transparent;
}

.metric-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(22, 34, 43, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.results-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

.results-empty-child {
  color: var(--muted);
  font-size: 12.5px;
  padding: 8px 2px 2px;
}

/* ───────────────────────────────────────────────────────────────────
   Tasks index page
   ─────────────────────────────────────────────────────────────────── */

.tasks-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.tasks-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.tasks-header h2 {
  margin: 0;
  font-size: 22px;
}

.tasks-cat-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.tasks-cat-filter a {
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 7px;
  font-weight: 500;
}

.tasks-cat-filter a:hover {
  color: var(--ink);
}

.tasks-cat-filter a.active {
  color: #ffffff;
  background: var(--accent);
}

.tasks-section {
  margin-bottom: 28px;
}

.tasks-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.tasks-section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.tasks-section-count {
  font-size: 12px;
  color: var(--muted);
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.task-card {
  display: block;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 95, 0.32);
  box-shadow: 0 8px 22px rgba(21, 42, 47, 0.06);
}

.task-card-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  margin-bottom: 6px;
}

.task-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.task-card-skill {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0;
}

.task-card-prompt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-flags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--muted);
}

.task-card-flag {
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(22, 34, 43, 0.06);
}

.task-card-flag.has {
  background: rgba(31, 111, 95, 0.1);
  color: var(--accent);
}

.tasks-empty-cat {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ───────────────────────────────────────────────────────────────────
   Task detail page
   ─────────────────────────────────────────────────────────────────── */

.task-detail-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

.task-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.task-detail-back:hover {
  color: var(--accent);
}

.task-detail-head {
  margin-bottom: 22px;
}

.task-detail-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
  word-break: break-word;
}

.task-detail-head .task-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.task-detail-head .task-detail-meta .pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.task-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}

.task-detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: var(--shadow);
}

.detail-card-head {
  margin-bottom: 12px;
}

.detail-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-card-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
}

.task-detail-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--topnav-h) + 16px);
}

.asset-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.asset-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.asset-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.asset-card-count {
  font-size: 11px;
  color: var(--muted);
}

.asset-card-body {
  max-height: 360px;
  overflow: auto;
}

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

.privacy-list li {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  color: var(--ink);
  padding: 4px 0;
  border-bottom: 1px solid rgba(22, 34, 43, 0.05);
}

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

/* skills list — simple bulletless slugs, matches .privacy look */
.skills-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-list li {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  color: var(--ink);
  padding: 4px 0;
  border-bottom: 1px solid rgba(22, 34, 43, 0.05);
}

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

/* file tree — flat ASCII rows (├── / │ / └──) rendered as a monospace
   block. Prefix glyphs are pre-computed in JS, so CSS just has to keep
   the layout monospaced and stable. */
.file-tree {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  white-space: nowrap;
}

.file-tree-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 1px 4px;
  border-radius: 4px;
}

.file-tree-row.dir {
  color: var(--accent);
  font-weight: 600;
}

.file-tree-row.file {
  text-decoration: none;
  color: var(--ink);
}

.file-tree-row.file:hover {
  background: rgba(31, 111, 95, 0.08);
}

.file-tree-row .ft-prefix {
  color: rgba(22, 34, 43, 0.32);
  white-space: pre;
  flex-shrink: 0;
}

.file-tree-row .ft-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-tree-row .ft-size {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* markdown rendering inside task detail */
.markdown-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
}

.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 20px 0 10px;
  font-weight: 600;
  color: var(--ink);
}

.markdown-body h1 { font-size: 19px; }
.markdown-body h2 { font-size: 16.5px; }
.markdown-body h3 { font-size: 14.5px; }
.markdown-body h4 { font-size: 13px; }

.markdown-body code {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  padding: 1px 5px;
  background: rgba(22, 34, 43, 0.06);
  border-radius: 4px;
}

.markdown-body pre {
  background: rgba(22, 34, 43, 0.06);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 14px;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
  margin: 0 0 12px;
}

.markdown-body li {
  margin: 4px 0;
}

.markdown-body table {
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12.5px;
  width: 100%;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
}

.markdown-body th {
  background: rgba(31, 111, 95, 0.06);
  font-weight: 600;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 12px;
  padding: 4px 14px;
  background: var(--accent-soft);
  color: var(--ink);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.task-prompt-pre {
  white-space: pre-wrap;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
}

.loading-stub,
.error-stub {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.error-stub {
  color: var(--bad);
}

.file-tree-row.file-preview-trigger,
.file-tree-row.image-preview-trigger {
  cursor: zoom-in;
}

/* ───────────────────────────────────────────────────────────────────
   File preview modal (md / txt / json / yaml / log)
   ─────────────────────────────────────────────────────────────────── */

.file-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-modal.hidden {
  display: none;
}

.file-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 34, 0.58);
  backdrop-filter: blur(4px);
}

.file-modal-dialog {
  position: relative;
  max-width: min(920px, 92vw);
  max-height: 88vh;
  width: 100%;
  background: var(--panel-strong);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(10, 22, 28, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.file-modal-title {
  flex: 1;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}

.file-modal-open {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
}

.file-modal-open:hover {
  background: var(--accent-soft);
}

.file-modal-close {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}

.file-modal-close:hover {
  color: var(--ink);
  background: rgba(22, 34, 43, 0.06);
}

.file-modal-body {
  padding: 18px 22px;
  overflow: auto;
  flex: 1;
}

.file-preview-pre {
  margin: 0;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.file-preview-md.markdown-body {
  font-size: 13.5px;
}

.file-preview-frame {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

@media (max-width: 980px) {
  .home-page {
    padding: 24px 16px 64px;
  }
  .home-hero,
  .home-method-grid,
  .home-runtime-grid,
  .home-data-grid,
  .demo-slide {
    grid-template-columns: 1fr;
  }
  .home-hero-stats,
  .home-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .home-leaderboard-tools {
    justify-content: flex-start;
  }
  .home-leaderboard-card.compact {
    max-width: none;
  }
  .home-leader-row {
    grid-template-columns: 30px minmax(0, 1fr) 54px 48px 48px;
    gap: 8px;
    padding: 10px;
  }
  .demo-nav-left {
    left: 4px;
  }
  .demo-nav-right {
    right: 4px;
  }
  .demo-nav {
    width: 38px;
    height: 54px;
    color: rgba(255, 255, 255, 0.86);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  }
  .demo-info-topline,
  .demo-info-result,
  .demo-info-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .demo-inspector {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
  .demo-inspector.timeline-open {
    width: calc(100vw - 24px);
  }
  .demo-inspector.timeline-open .demo-inspector-shell {
    grid-template-columns: 1fr;
  }
  .demo-inspector-timeline {
    border-left: 0;
    border-top: 1px solid rgba(22, 34, 43, 0.1);
    padding-left: 0;
    padding-top: 12px;
  }
  .demo-inspector-toolbar,
  .demo-inspector-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .demo-inspector-section-head span {
    text-align: left;
  }
  .flow-shell {
    flex-direction: column;
  }
  .exec-timeline,
  .exec-timeline.collapsed {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }
  .tasks-page {
    padding: 28px 16px 72px;
  }
  .tasks-header,
  .tasks-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .tasks-cat-filter {
    max-width: 100%;
    overflow-x: auto;
  }
  .tasks-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .demo-media {
    min-height: 220px;
  }
  .task-detail-grid {
    grid-template-columns: 1fr;
  }
  .task-detail-aside {
    position: static;
  }
  .topnav .brand-tag {
    display: none;
  }
  .topnav {
    gap: 16px;
    padding: 0 16px;
    overflow-x: auto;
  }
  .topnav .brand {
    flex: 0 0 auto;
  }
  .topnav-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topnav-links::-webkit-scrollbar {
    display: none;
  }
  .topnav-link {
    flex: 0 0 auto;
    padding: 8px 12px;
    white-space: nowrap;
  }
  .metric-row {
    grid-template-columns: 120px 1fr 60px;
  }
  .metric-row.metric-row-cat {
    grid-template-columns: 120px 1fr 60px 48px;
  }
}

/* Tasks page: stack the two-level filter (ALL/Smoketest/EN/ZH over the
   per-suite sub-row) and give the Results scope tabs a little breathing room. */
#tasks-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}
.tasks-cat-filter.tasks-cat-sub {
  font-size: 0.95em;
  opacity: 0.92;
}
.results-controls .results-scope {
  margin-left: 4px;
}

/* ── Unify the ALL/EN/ZH selectors across Tasks + Results, and give each
   task suite section an ordered (sequenced) accent color. ── */
.tasks-cat-filter { gap: 2px; border-radius: 12px; }
.tasks-cat-filter a { padding: 8px 18px; font-size: 13.5px; border-radius: 8px; }
.tasks-cat-filter.tasks-cat-sub a { padding: 6px 14px; font-size: 12.5px; }
.tasks-section {
  border-left: 3px solid var(--row-base, var(--accent));
  padding-left: 14px;
}
.tasks-section-title { color: var(--row-base, var(--ink)); }
/* Group the dimension tabs + scope tabs together on the left; modes right. */
.results-controls { justify-content: flex-start; }
.results-controls .results-modes-wrap { margin-left: auto; }
