:root {
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --surface-strong: #edf1f3;
  --border: #dce2e5;
  --border-strong: #c5ced3;
  --text: #182126;
  --text-muted: #5e6b72;
  --text-faint: #849097;
  --accent: #087e8b;
  --accent-dark: #075e67;
  --accent-soft: #e5f4f4;
  --amber: #a76310;
  --amber-soft: #fff3dd;
  --green: #327a52;
  --green-soft: #eaf5ee;
  --red: #a84242;
  --red-soft: #faeaea;
  --code-bg: #111820;
  --code-surface: #18212a;
  --code-text: #dce5ed;
  --rail-width: 326px;
  --topbar-height: 58px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 126, 139, 0.24);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
}

.brand-mark,
.loading-mark {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  gap: 3px;
  align-content: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent-soft);
}

.brand-mark span,
.loading-mark span {
  width: 5px;
  height: 13px;
  border-radius: 1px;
  background: var(--accent);
}

.brand-mark span:nth-child(2),
.loading-mark span:nth-child(2) {
  height: 18px;
}

.topbar-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.summary-divider {
  width: 1px;
  height: 15px;
  background: var(--border-strong);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.drawer-toggle {
  display: none;
  margin-right: 9px;
}

.catalog-rail {
  position: fixed;
  z-index: 20;
  inset: var(--topbar-height) auto 0 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.rail-controls {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.mode-switch {
  height: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.mode-switch button {
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 680;
}

.mode-switch button.active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: 0 1px 3px rgba(24, 33, 38, 0.12);
}

.search-field {
  position: relative;
  display: block;
}

.search-field svg {
  position: absolute;
  z-index: 1;
  left: 11px;
  top: 11px;
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 11px 0 35px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 126, 139, 0.1);
}

.filter-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.filter-field > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.filter-field select {
  min-width: 0;
  height: 32px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 11px;
}

.rail-heading {
  display: flex;
  justify-content: space-between;
  padding: 13px 17px 9px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 18px;
}

.catalog-pagination {
  display: grid;
  padding: 9px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.catalog-pagination > span {
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-align: center;
}

.catalog-item {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 11px 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.catalog-item:hover {
  background: var(--surface-muted);
}

.catalog-item.active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.catalog-item-title {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-item-summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-discipline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.catalog-discipline-tag {
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid #bfe0e3;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
}

.catalog-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-faint);
  font-size: 10px;
  text-transform: capitalize;
}

.catalog-item-meta span:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.catalog-group + .catalog-group {
  margin-top: 9px;
}

.catalog-group-heading {
  padding: 8px 10px 5px;
  border-left: 3px solid var(--discipline-color, var(--border-strong));
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.catalog-group[data-discipline*="architecture"] {
  --discipline-color: #087e8b;
}

.catalog-group[data-discipline*="rtl"] {
  --discipline-color: #4267a9;
}

.catalog-group[data-discipline*="verification"] {
  --discipline-color: #9b4d68;
}

.catalog-group[data-discipline*="software"] {
  --discipline-color: #368454;
}

.catalog-group[data-discipline*="systems"] {
  --discipline-color: #a76310;
}

.catalog-group[data-discipline*="data"],
.catalog-group[data-discipline*="algorithms"] {
  --discipline-color: #6f58a8;
}

.no-results {
  padding: 28px 18px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.drawer-scrim {
  display: none;
}

.content {
  min-height: 100vh;
  margin-left: var(--rail-width);
  padding-top: var(--topbar-height);
}

#benchmark-view,
#task-view {
  min-height: calc(100vh - var(--topbar-height));
}

.entity-header {
  padding: 38px 54px 29px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}

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

.kind-label,
.discipline-label,
.dataset-label,
.tool-pill,
.benchmark-link {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 750;
}

.kind-label,
.dataset-label {
  color: #85510f;
  background: var(--amber-soft);
  text-transform: capitalize;
}

.discipline-label {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.benchmark-link {
  color: #335e91;
  background: #eaf1f9;
}

.benchmark-link:hover {
  text-decoration: underline;
}

.entity-header h1 {
  max-width: 920px;
  margin: 0;
  color: var(--text);
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.task-header h1 {
  font-size: 30px;
}

.entity-summary {
  max-width: 790px;
  margin: 13px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.entity-id {
  margin: 10px 0 0;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.header-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 24px 0 0;
}

.header-metadata div {
  display: grid;
  gap: 5px;
}

.header-metadata dt {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.header-metadata dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.header-metadata code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.header-metadata a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 650;
}

.header-metadata a:hover {
  text-decoration: underline;
}

.header-metadata svg {
  width: 13px;
  height: 13px;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.tool-pill {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 600;
}

.tabs {
  position: sticky;
  z-index: 10;
  top: var(--topbar-height);
  min-height: 49px;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0 54px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
}

.tab {
  position: relative;
  flex: none;
  min-width: 88px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

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

.tab.active {
  color: var(--accent-dark);
}

.tab.active::after {
  content: "";
  position: absolute;
  inset: auto 9px -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}

.tab-count {
  margin-left: 4px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.readme-panel {
  max-width: 940px;
  min-height: 520px;
  padding: 38px 54px 80px;
}

.markdown-body {
  color: #273238;
  font-size: 14px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.readme-plain {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.8em 0 0.65em;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: 0;
}

.markdown-body h1 {
  margin-top: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 25px;
}

.markdown-body h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
}

.markdown-body h3 {
  font-size: 16px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote {
  margin: 0 0 1.2em;
}

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

.markdown-body img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 17px 19px;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 12px;
  line-height: 1.6;
}

.markdown-body code {
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--surface-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

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

.markdown-body blockquote {
  padding: 2px 0 2px 17px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

.markdown-body table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

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

.benchmark-task-panel {
  padding: 27px 54px 72px;
}

.task-table {
  max-width: 1040px;
  border-top: 1px solid var(--border);
}

.task-row {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 150px 80px;
  align-items: center;
  gap: 20px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
}

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

.task-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row code {
  overflow: hidden;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-discipline {
  color: var(--text-muted);
  font-size: 11px;
}

.task-row-count {
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-align: right;
}

.task-row-origin {
  color: var(--amber);
  font-size: 10px;
}

.infinite-sentinel {
  height: 1px;
  width: 100%;
}

.empty-panel {
  padding: 38px 12px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.overview {
  max-width: 1120px;
  padding: 34px 54px 70px;
}

.prompt-block {
  padding: 24px 27px 26px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.05);
}

.section-label {
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.prompt-block p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.72;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 50px;
  margin-top: 34px;
}

.info-section h2 {
  margin: 0 0 13px;
  font-size: 14px;
  letter-spacing: 0;
}

.info-section p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.66;
}

.source-section dl,
.trace-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.source-section dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 11px;
}

.source-section dt,
.trace-meta dt {
  color: var(--text-faint);
  font-size: 10px;
}

.source-section dd,
.trace-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 11px;
}

.source-section code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.source-paths {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.source-path {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-link {
  color: var(--accent-dark);
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.source-path::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border: 1px solid var(--amber);
  border-radius: 1px;
}

.file-browser,
.trace-browser {
  height: calc(100vh - var(--topbar-height) - 49px);
  min-height: 480px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--surface);
}

.file-list,
.trace-run-list {
  overflow-y: auto;
  padding: 12px 9px;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
}

.file-item {
  width: 100%;
  min-height: 41px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px;
  padding: 5px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
}

.file-item:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.file-item.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.file-glyph {
  width: 21px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.file-name {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.code-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--code-bg);
}

.code-header {
  flex: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border-bottom: 1px solid #26313b;
  background: var(--code-surface);
}

.file-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.file-type {
  flex: none;
  padding: 3px 6px;
  border: 1px solid #3b4a58;
  border-radius: 3px;
  color: #9db0be;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.file-path {
  overflow: hidden;
  color: #b7c4ce;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-text-button,
.text-button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

.icon-text-button svg {
  width: 14px;
  height: 14px;
}

.copy-button {
  flex: none;
  margin-left: auto;
  border-color: #3b4a58;
  background: transparent;
  color: #b7c4ce;
}

.copy-button:hover:not(:disabled) {
  border-color: #617485;
  color: #ffffff;
}

.copy-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.code-scroll {
  flex: 1;
  overflow: auto;
  padding: 15px 0 32px;
}

.code-lines {
  position: relative;
  min-width: max-content;
  min-height: 100%;
  margin: 0;
  padding: 0 24px 0 70px;
  color: var(--code-text);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
}

.code-lines code {
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-shadow: none;
  white-space: inherit;
}

.code-message {
  min-width: 0;
  padding-left: 24px;
  color: #91a0ab;
}

.line-numbers {
  counter-reset: linenumber;
}

.line-numbers .line-numbers-rows {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50px;
  border-right: 1px solid #26313b;
  pointer-events: none;
}

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span::before {
  content: counter(linenumber);
  display: block;
  padding-right: 12px;
  color: #596875;
  text-align: right;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6f8290;
}

.token.punctuation {
  color: #aebbc5;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #e68383;
}

.token.boolean,
.token.number {
  color: #d6a56b;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #88bf8b;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #87b6c9;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #bd91d1;
}

.token.function,
.token.class-name {
  color: #e4c779;
}

.token.regex,
.token.important,
.token.variable {
  color: #d9956d;
}

.trace-browser {
  grid-template-columns: 260px minmax(0, 1fr);
}

.trace-run {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 11px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
}

.trace-run:hover {
  background: var(--surface-strong);
}

.trace-run.active {
  background: var(--accent-soft);
}

.trace-run-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 10px;
}

.trace-run-model {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-run time,
.trace-step time {
  color: var(--text-faint);
  font-size: 9px;
}

.trace-status {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface-strong);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.trace-status.completed,
.trace-status.passed,
.trace-status.success {
  background: var(--green-soft);
  color: var(--green);
}

.trace-status.failed,
.trace-status.error {
  background: var(--red-soft);
  color: var(--red);
}

.trace-detail {
  min-width: 0;
  overflow-y: auto;
  padding: 30px 40px 70px;
  background: var(--bg);
}

.trace-empty {
  padding: 70px 24px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.trace-header {
  max-width: 980px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--border);
}

.trace-header h2 {
  margin: 9px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.trace-meta {
  min-width: 230px;
}

.trace-meta div {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
}

.trace-steps {
  max-width: 980px;
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.trace-step {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.trace-step > header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.step-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.trace-step h3 {
  margin: 0 0 3px;
  font-size: 12px;
}

.trace-block {
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
}

.trace-block:last-child {
  border-bottom: 0;
}

.trace-block pre {
  max-height: 440px;
  overflow: auto;
  margin: 0;
  padding: 13px 15px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.loading-state,
.error-state {
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 30px;
  color: var(--text-muted);
  text-align: center;
}

.loading-state p,
.error-state p {
  max-width: 480px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.loading-mark {
  width: 35px;
  height: 35px;
  animation: loading-pulse 1.2s ease-in-out infinite;
}

.error-state > svg {
  width: 28px;
  height: 28px;
  color: var(--red);
}

.error-state h1 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  letter-spacing: 0;
}

@keyframes loading-pulse {
  50% {
    opacity: 0.45;
  }
}

@media (max-width: 940px) {
  :root {
    --rail-width: 300px;
  }

  .drawer-toggle {
    display: inline-grid;
  }

  .catalog-rail {
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .catalog-rail.open {
    transform: translateX(0);
  }

  .drawer-scrim {
    position: fixed;
    z-index: 35;
    inset: var(--topbar-height) 0 0;
    display: block;
    border: 0;
    background: rgba(17, 24, 32, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .drawer-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    margin-left: 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 12px;
  }

  .brand > span:last-child {
    font-size: 14px;
  }

  .topbar-summary {
    gap: 7px;
    font-size: 9px;
  }

  .summary-divider {
    display: none;
  }

  .entity-header {
    padding: 27px 20px 23px;
  }

  .entity-header h1,
  .task-header h1 {
    font-size: 26px;
  }

  .tabs {
    padding: 0 10px;
  }

  .tab {
    min-width: 80px;
    padding: 0 9px;
    font-size: 11px;
  }

  .readme-panel,
  .benchmark-task-panel,
  .overview {
    padding-right: 20px;
    padding-left: 20px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 31px;
  }

  .prompt-block {
    padding: 20px;
  }

  .task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .task-row-discipline {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .task-row-origin {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .task-row-count {
    grid-column: 2;
    grid-row: 1;
  }

  .file-browser,
  .trace-browser {
    height: auto;
    min-height: calc(100vh - var(--topbar-height) - 49px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(500px, 1fr);
  }

  .file-list,
  .trace-run-list {
    max-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .trace-detail {
    padding: 24px 20px 55px;
  }

  .trace-header {
    display: grid;
  }

  .trace-meta {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .topbar-summary {
    display: none;
  }
}

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