:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --border: #d8dee8;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --code-bg: #f3f4f6;
  --warning: #9a6700;
}

body.dark {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #374151;
  --accent: #60a5fa;
  --accent-soft: #172554;
  --code-bg: #020617;
  --warning: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
}

input,
button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 12px;
}

input[type="search"] {
  width: min(360px, 36vw);
}

button {
  cursor: pointer;
}

.wide-button {
  margin-top: 14px;
  width: 100%;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.summary-row {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.summary-row > .card {
  min-width: 0;
}

.diagram-card {
  align-self: start;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.card h2 {
  margin-top: 0;
}

.job-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 12px;
}

.job-item {
  display: grid;
  gap: 5px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: left;
}

.job-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.job-item.loading {
  opacity: 0.72;
}

.job-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.job-reward {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.job-meta,
.job-path {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.summary-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 12px;
}

.summary-grid.wide {
  grid-template-columns: 140px minmax(0, 1fr);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.trial-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 12px 0 6px;
  text-transform: uppercase;
}

.round-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.round-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  text-align: left;
  width: 100%;
}

.round-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.round-name {
  font-weight: 700;
}

.behavior {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
}

.status,
.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 8px;
}

.status.completed {
  color: #027a48;
}

.status.error {
  color: #b42318;
}

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

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.detail-header h2 {
  margin-bottom: 4px;
}

.detail-header p {
  color: var(--muted);
  margin-top: 0;
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin: 12px -16px 16px;
  padding: 0 16px 12px;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.overview-section {
  margin-top: 18px;
}

.overview-section h3 {
  margin-bottom: 8px;
}

.evidence-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 18px;
}

.evidence-pill {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.evidence-pill.ok {
  background: #ecfdf3;
  border-color: #abefc6;
}

.evidence-pill.warn {
  background: #fffaeb;
  border-color: #fedf89;
}

body.dark .evidence-pill.ok {
  background: #052e1a;
  border-color: #167a42;
}

body.dark .evidence-pill.warn {
  background: #3b2f05;
  border-color: #b08900;
}

.evidence-pill strong,
.evidence-pill span {
  display: block;
}

.evidence-pill span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.actor-flow {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 110px 1fr 110px 1fr 80px 1fr;
  margin: 18px 0;
}

.actor-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
}

.actor-box strong,
.actor-box span {
  display: block;
}

.actor-box span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.flow-arrow {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: center;
  text-align: center;
}

.flow-arrow::before,
.flow-arrow::after {
  background: var(--border);
  content: "";
  flex: 1;
  height: 1px;
}

.flow-arrow span {
  padding: 0 6px;
}

.round-flow {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.interaction-round {
  border-radius: 14px;
  display: block;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.interaction-round:hover {
  border-color: var(--accent);
}

.interaction-round-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.interaction-round h3 {
  margin: 10px 0 6px;
}

.interaction-round p {
  color: var(--muted);
  margin: 0 0 12px;
}

.round-pill {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
}

.round-evidence {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: 110px minmax(0, 1fr);
  margin: 0;
}

.review-step {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  margin: 2px 0 2px 18px;
  padding: 8px 12px;
}

.timeline-section {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.04), transparent 48%);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 18px 0;
  overflow-x: auto;
  padding: 18px;
}

.timeline-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-width: 980px;
}

.timeline-header h3 {
  margin: 0 0 4px;
}

.timeline-header p {
  margin: 0;
}

.timeline-hint {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px !important;
}

.timeline-range {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 700;
  padding: 5px 10px;
  white-space: nowrap;
}

.timeline-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  min-width: 980px;
}

.timeline-summary span {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 9px;
}

.timeline-summary strong {
  color: var(--text);
}

.timeline-scale,
.timeline-lane {
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(820px, 1fr);
  min-width: 980px;
}

.timeline-scale {
  margin-top: 16px;
}

.timeline-track {
  background:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.10));
  background-size: 25% 100%, 100% 100%;
  border-left: 1px solid var(--border);
  border-radius: 10px;
  min-height: 38px;
  position: relative;
}

body.dark .timeline-track {
  background:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  background-size: 25% 100%, 100% 100%;
}

.timeline-scale .timeline-track {
  min-height: 28px;
}

.timeline-tick {
  color: var(--muted);
  font-size: 11px;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-tick i {
  background: var(--border);
  display: block;
  height: 10px;
  margin: 0 auto 4px;
  width: 1px;
}

.timeline-lanes {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.timeline-lane {
  border-radius: 12px;
  padding: 3px 0;
}

.timeline-lane:hover .timeline-track {
  outline: 1px solid var(--accent);
}

.lane-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding-top: 8px;
  text-align: right;
}

.timeline-span {
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 1px;
  height: 32px;
  justify-content: center;
  overflow: hidden;
  padding: 4px 10px;
  position: absolute;
  text-align: left;
  top: 3px;
  transition: filter 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.timeline-span:hover {
  filter: brightness(1.08);
  overflow: visible;
  transform: translateY(-1px);
  z-index: 10;
}

.timeline-span:focus-visible {
  overflow: visible;
  z-index: 10;
}

.timeline-span.selectable {
  cursor: pointer;
}

.timeline-span.selectable::after {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: inherit;
  content: "";
  inset: 3px;
  pointer-events: none;
  position: absolute;
}

.timeline-span.selectable:hover {
  box-shadow: 0 10px 26px rgba(220, 104, 3, 0.32);
}

.timeline-span.selected {
  outline: 3px solid var(--text);
  outline-offset: 2px;
  z-index: 4;
}

body.dark .timeline-span.selected {
  outline-color: #ffffff;
}

.timeline-span span,
.timeline-span small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-floating-tooltip {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  max-width: min(360px, 60vw);
  min-width: 240px;
  opacity: 0;
  overflow: visible;
  padding: 9px 11px;
  pointer-events: none;
  position: fixed;
  text-overflow: clip;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: pre-line;
  z-index: 1000;
}

.timeline-floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-span small {
  font-size: 10px;
  opacity: 0.85;
}

.timeline-span.inferred {
  border: 2px dashed rgba(255, 255, 255, 0.86);
}

.timeline-span.logical {
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.20) 0 7px, transparent 7px 14px);
  border: 1px solid rgba(255, 255, 255, 0.74);
}

.timeline-span.user,
.legend-dot.user {
  background-color: #7c3aed;
}

.timeline-span.harbor,
.legend-dot.harbor {
  background-color: #2563eb;
}

.timeline-span.agent,
.legend-dot.agent {
  background-color: #dc6803;
}

.timeline-span.session,
.legend-dot.session,
.timeline-span.session-missing,
.legend-dot.session-missing {
  background-color: #039855;
}

.timeline-span.sandbox,
.legend-dot.sandbox {
  background-color: #0e7490;
}

.timeline-span.verify,
.legend-dot.verify {
  background-color: #c11574;
}

.timeline-legend {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  min-width: 980px;
}

.timeline-legend span {
  align-items: center;
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.timeline-source-legend {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  min-width: 980px;
  padding-top: 12px;
}

.timeline-source-legend span {
  align-items: center;
  display: inline-flex;
  font-size: 12px;
  gap: 7px;
}

.source-sample {
  background: var(--accent);
  border-radius: 999px;
  display: inline-block;
  height: 12px;
  width: 28px;
}

.source-sample.inferred {
  border: 2px dashed var(--accent);
  background: transparent;
}

.source-sample.logical {
  background:
    repeating-linear-gradient(135deg, var(--accent) 0 5px, transparent 5px 10px),
    var(--accent-soft);
  border: 1px solid var(--accent);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  line-height: 1.45;
  max-height: 70vh;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.event {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
  padding: 10px;
}

.event summary {
  cursor: pointer;
  font-weight: 700;
}

.nested-events {
  margin: 8px 0 16px;
}

.nested-event {
  background: rgba(37, 99, 235, 0.04);
  margin-left: 12px;
}

.sequence-svg-wrap {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 16px 0;
  overflow: auto;
  padding: 12px;
}

.sequence-svg {
  display: block;
  min-width: 1300px;
}

.participant-box {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 1.4;
}

.participant-text {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.lifeline {
  stroke: #b8c7d9;
  stroke-dasharray: 6 6;
  stroke-width: 1.2;
}

.message-line {
  stroke: var(--accent);
  stroke-width: 1.8;
}

.message-line.ok {
  stroke: #168a52;
}

.message-line.missing {
  stroke: var(--warning);
  stroke-dasharray: 5 4;
}

.arrow-head {
  fill: var(--accent);
}

.message-label {
  fill: var(--text);
  font-size: 11px;
}

.fragment-box {
  fill: rgba(42, 127, 255, 0.06);
  stroke: var(--border);
  stroke-dasharray: 5 4;
}

.fragment-label {
  fill: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.mermaid-source {
  margin-top: 14px;
}

.mermaid-source summary {
  cursor: pointer;
  font-weight: 700;
}

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

.warning {
  color: var(--warning);
  font-weight: 700;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .topbar {
    display: block;
  }

  .top-actions {
    margin-top: 12px;
  }

  input[type="search"] {
    width: 100%;
  }

  .content {
    display: flex;
  }

  .evidence-grid,
  .actor-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow::before,
  .flow-arrow::after {
    display: none;
  }

  .sequence-svg {
    min-width: 1100px;
  }
}

/* Dashboard shell aligned with SWE-Lego-Live evaluation dashboard. */
:root {
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --c-bg: #020617;
  --c-bg-2: #0f172a80;
  --c-panel: #0b1226;
  --c-border: #1e293b99;
  --c-fg: #e2e8f0;
  --c-fg-dim: #94a3b8;
  --c-fg-mute: #64748b;
  --c-fg-faint: #475569;
  --c-accent: #6366f1;
  --c-accent-soft: #6366f133;
  --c-accent-border: #6366f180;
  --c-good: #34d399;
  --c-bad: #f87171;
  --c-warn: #fbbf24;
  --c-cyan: #22d3ee;
  --c-violet: #a78bfa;
  --c-pink: #f472b6;
  --bg: var(--c-bg);
  --panel: var(--c-panel);
  --text: var(--c-fg);
  --muted: var(--c-fg-mute);
  --border: var(--c-border);
  --accent: var(--c-accent);
  --accent-soft: var(--c-accent-soft);
  --code-bg: var(--c-bg-2);
  --warning: var(--c-warn);
  font-size: 14px;
}

[data-theme="light"] {
  --c-bg: #f8fafc;
  --c-bg-2: #ffffff;
  --c-panel: #ffffff;
  --c-border: #e2e8f0;
  --c-fg: #0f172a;
  --c-fg-dim: #475569;
  --c-fg-mute: #64748b;
  --c-fg-faint: #94a3b8;
  --c-accent: #4f46e5;
  --c-accent-soft: #6366f122;
  --c-accent-border: #6366f1;
  --bg: var(--c-bg);
  --panel: var(--c-panel);
  --text: var(--c-fg);
  --muted: var(--c-fg-mute);
  --border: var(--c-border);
  --accent: var(--c-accent);
  --accent-soft: var(--c-accent-soft);
  --code-bg: #f3f4f6;
}

html,
body {
  height: 100vh;
  overflow: hidden;
}

body {
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

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

::-webkit-scrollbar-thumb {
  background: var(--c-fg-faint);
  border-radius: 3px;
}

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

.layout {
  display: flex;
  flex-direction: row;
  gap: 0;
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.sidebar {
  background: linear-gradient(180deg, #0a1226 0%, var(--c-bg) 100%);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex: 0 0 300px;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  width: 300px;
}

[data-theme="light"] .sidebar {
  background: var(--c-bg-2);
}

.sidebar-logo {
  align-items: center;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  gap: 10px;
  padding: 16px;
}

.logo-mark {
  align-items: center;
  background: var(--c-accent);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-size: 11px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 38px;
}

.logo-title {
  font-size: 13px;
  font-weight: 600;
}

.logo-sub {
  color: var(--c-fg-mute);
  font-size: 10px;
}

.nav {
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.nav-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--c-fg-dim);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 8px;
  padding: 7px 10px;
  text-align: left;
}

.nav-item:hover {
  background: #1e293b40;
  color: var(--c-fg);
}

[data-theme="light"] .nav-item:hover {
  background: #f1f5f9;
}

.nav-item.active {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-border);
  color: #c7d2fe;
}

[data-theme="light"] .nav-item.active {
  color: var(--c-accent);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 12px 8px 8px;
}

.jobs-panel {
  flex: 1 1 44%;
}

.rounds-panel {
  border-top: 1px solid var(--c-border);
  flex: 1 1 38%;
}

.sidebar-section-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.section-label {
  color: var(--c-fg-mute);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0 8px 6px;
  text-transform: uppercase;
}

.sidebar-count {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  padding-bottom: 6px;
}

.sidebar-count .badge {
  font-size: 9.5px;
  padding: 1px 6px;
}

.filter-input {
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-fg);
  font-size: 12px;
  margin-bottom: 6px;
  outline: none;
  padding: 6px 8px;
  width: 100%;
}

.filter-input:focus {
  border-color: var(--c-accent);
}

.sidebar .job-list,
.sidebar .round-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  margin-top: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar .job-item,
.sidebar .round-item,
.sidebar .task-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--c-fg-dim);
  cursor: pointer;
  display: grid;
  font-size: 11.5px;
  gap: 4px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  line-height: 1.35;
  margin: 0;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}

.sidebar .job-item:hover,
.sidebar .round-item:hover,
.sidebar .task-item:hover {
  background: #1e293b40;
  color: var(--c-fg);
}

[data-theme="light"] .sidebar .job-item:hover,
[data-theme="light"] .sidebar .round-item:hover,
[data-theme="light"] .sidebar .task-item:hover {
  background: #f1f5f9;
}

.sidebar .job-item.selected,
.sidebar .round-item.selected,
.sidebar .task-item.selected {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-border);
  color: #c7d2fe;
}

[data-theme="light"] .sidebar .job-item.selected,
[data-theme="light"] .sidebar .round-item.selected,
[data-theme="light"] .sidebar .task-item.selected {
  color: var(--c-accent);
}

.sidebar .job-title,
.sidebar .round-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar .task-item.compact {
  margin-bottom: 4px;
}

.sidebar .job-reward,
.sidebar .status,
.status,
.badge {
  background: #1e293b80;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-fg-dim);
  display: inline-flex;
  font-size: 10.5px;
  line-height: 1.3;
  padding: 2px 8px;
  white-space: nowrap;
}

.badge {
  background: var(--c-accent-soft);
  border-color: transparent;
  color: #c7d2fe;
}

[data-theme="light"] .badge {
  color: var(--c-accent);
}

.sidebar .job-meta,
.sidebar .job-path,
.sidebar .behavior {
  color: var(--c-fg-mute);
  font-size: 10.5px;
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.sidebar .trial-title {
  color: var(--c-fg-mute);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 10px 8px 5px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.sidebar-footer {
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
}

.row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.muted {
  color: var(--c-fg-mute);
}

.small {
  font-size: 11px;
}

.compare-help {
  line-height: 1.35;
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  align-items: center;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  height: 48px;
  justify-content: space-between;
  padding: 0 16px;
  position: static;
  top: auto;
  z-index: 10;
}

.crumbs {
  align-items: center;
  color: var(--c-fg-dim);
  display: flex;
  font-size: 13px;
  gap: 6px;
  min-width: 0;
}

.crumbs .sep {
  color: var(--c-fg-faint);
}

.crumbs .here {
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.icon-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-fg-dim);
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  width: 28px;
}

.icon-btn:hover {
  border-color: var(--c-accent);
  color: var(--c-fg);
}

.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  overflow-y: auto;
  padding: 20px;
}

.card {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 16px;
}

.card h2 {
  margin-top: 0;
}

.card-title {
  align-items: center;
  color: var(--c-fg-mute);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.section-h {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}

.summary-grid-shell {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 1.35fr) minmax(220px, 0.75fr);
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric .v {
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
}

.metric .v.good {
  color: var(--c-good);
}

.metric .v.bad {
  color: var(--c-bad);
}

.metric .l {
  color: var(--c-fg-mute);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-mini {
  background: var(--c-accent);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 11px;
  padding: 6px 10px;
}

.btn-mini.ghost {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-fg-dim);
}

.task-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
}

.task-stat {
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.task-stat-value {
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.task-stat-value.good,
.score-pill.good {
  color: var(--c-good);
}

.task-stat-value.bad,
.score-pill.bad {
  color: var(--c-bad);
}

.task-stat-value.warn,
.score-pill.warn {
  color: var(--c-warn);
}

.task-stat-label {
  color: var(--c-fg-mute);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 5px;
  text-transform: uppercase;
}

.task-stat-detail {
  color: var(--c-fg-mute);
  font-size: 11px;
  margin-top: 4px;
}

.task-table-bar {
  align-items: center;
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
}

.task-table-bar strong,
.task-table-bar span {
  display: block;
}

.task-table-wrap {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  margin-top: 12px;
  overflow: auto;
}

.task-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.task-table th,
.task-table td {
  border-bottom: 1px solid var(--c-border);
  font-size: 12px;
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.task-table th {
  background: var(--c-bg-2);
  color: var(--c-fg-mute);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

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

.task-row {
  cursor: pointer;
}

.task-row:hover {
  background: #1e293b40;
}

[data-theme="light"] .task-row:hover {
  background: #f8fafc;
}

.task-row.selected {
  background: var(--c-accent-soft);
  outline: 1px solid var(--c-accent-border);
  outline-offset: -1px;
}

.task-row.has-exception {
  box-shadow: inset 3px 0 0 var(--c-bad);
}

.task-link {
  align-items: flex-start;
  background: transparent;
  border: 0;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 320px;
  padding: 0;
  text-align: left;
}

.task-link span {
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.task-link small {
  color: var(--c-fg-mute);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

.num {
  font-family: var(--font-mono);
  text-align: right !important;
  white-space: nowrap;
}

.score-pill {
  background: #1e293b80;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-fg-dim);
  display: inline-flex;
  font-size: 10.5px;
  line-height: 1.3;
  max-width: 180px;
  overflow: hidden;
  padding: 2px 8px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

[data-theme="light"] .score-pill {
  background: #f8fafc;
}

.selection-callout {
  background: var(--c-bg-2);
  border: 1px dashed var(--c-accent-border);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 18px;
}

.selection-callout strong {
  color: var(--c-fg);
}

.selection-callout span {
  color: var(--c-fg-mute);
}

.btn-mini:hover {
  filter: brightness(1.1);
}

.wide-button {
  margin-top: 14px;
  width: 100%;
}

input,
button {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.detail-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.detail-header p {
  color: var(--c-fg-mute);
  margin: 0;
}

.summary-grid,
.summary-grid.wide {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
}

.summary-grid dt {
  color: var(--c-fg-mute);
}

.summary-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.tabs {
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px -16px 16px;
  padding: 0 16px 12px;
}

.tab {
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-fg-dim);
  padding: 6px 10px;
}

.tab.active {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-border);
  color: #c7d2fe;
}

[data-theme="light"] .tab.active {
  color: var(--c-accent);
}

pre {
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-fg);
  font-size: 11.5px;
}

.timeline-section {
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.05), transparent 48%);
  border-color: var(--c-border);
  border-radius: 10px;
}

[data-theme="dark"] .evidence-pill.ok {
  background: #10b98111;
  border-color: #10b98155;
}

[data-theme="dark"] .evidence-pill.warn {
  background: #fbbf2411;
  border-color: #fbbf2455;
}

[data-theme="dark"] .timeline-track {
  background:
    linear-gradient(to right, var(--c-border) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  background-size: 25% 100%, 100% 100%;
}

.timeline-summary span,
.timeline-track {
  background-color: var(--c-panel);
}

.timeline-span.selected {
  box-shadow: 0 0 0 2px var(--c-accent), 0 8px 22px rgba(15, 23, 42, 0.24);
}

.timeline-header h3 {
  font-size: 13px;
}

.timeline-header p {
  font-size: 11.5px;
  line-height: 1.45;
}

.timeline-hint,
.timeline-range,
.timeline-summary span,
.timeline-legend span,
.timeline-source-legend span,
.timeline-tick,
.lane-label {
  font-size: 10.5px;
}

.timeline-range {
  padding: 4px 8px;
}

.timeline-track {
  min-height: 34px;
}

.timeline-scale .timeline-track {
  min-height: 24px;
}

.timeline-span {
  height: 28px;
  padding: 3px 8px;
}

.timeline-span span {
  font-size: 10.5px;
  line-height: 1.1;
}

.timeline-span small {
  font-size: 9px;
}

.actor-box,
.round-pill {
  border-color: var(--c-accent-border);
}

.empty {
  color: var(--c-fg-mute);
  font-size: 13px;
  padding: 40px;
  text-align: center;
}

.hidden {
  display: none !important;
}

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

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

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

@media (max-width: 760px) {
  html,
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    border-bottom: 1px solid var(--c-border);
    border-right: 0;
    flex: none;
    max-height: 58vh;
    width: 100%;
  }

  .main {
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
  }

  .content {
    overflow: visible;
    padding: 14px;
  }

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

  .task-summary-grid {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
  }
}
