/* Scoped evaluation affordances; preserve the existing table and theme layout. */
#recentJobs .job-detail-link {
  display: inline;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
#recentJobs .job-detail-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
#run .evaluation-error-meta code {
  white-space: normal;
  overflow-wrap: anywhere;
}
#evaluationParameterHelp { line-height: 1.6; }

/* API guide → track Smoke selector. */
.smoke-track-dialog {
  width: min(620px, calc(100vw - 32px));
  gap: 26px;
  border-radius: 18px;
  padding: 32px;
}
.smoke-track-dialog .integration-test-head h2 {
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -.03em;
}
.smoke-track-dialog .integration-test-head p {
  max-width: 48ch;
  font-size: 14px;
}
.smoke-track-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.smoke-track-option {
  position: relative;
  display: flex;
  min-height: 136px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--theme-line);
  border-radius: 13px;
  padding: 16px;
  background: linear-gradient(145deg, var(--theme-surface) 55%, var(--theme-accent-soft));
  color: var(--theme-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.smoke-track-option:hover,
.smoke-track-option:focus-visible {
  border-color: var(--theme-accent);
  box-shadow: 0 10px 24px rgba(27, 77, 82, .12);
  transform: translateY(-2px);
}
.smoke-track-option:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}
.smoke-track-option-index {
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .1em;
}
.smoke-track-option strong {
  font-size: 19px;
  font-weight: 650;
}
.smoke-track-option small {
  max-width: 16ch;
  color: var(--theme-muted);
  font-size: 12px;
  line-height: 1.45;
}
.smoke-track-option-arrow {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--theme-accent);
  font-size: 18px;
}
@media (max-width: 560px) {
  .smoke-track-dialog { padding: 24px 20px; }
  .smoke-track-options { grid-template-columns: 1fr; }
  .smoke-track-option { min-height: 88px; gap: 4px; }
  .smoke-track-option small { max-width: none; }
}

/* Recent task detail only: presentation, never evaluation state. */
#run .recent-inline-detail .run-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 20px;
}
#run .recent-inline-detail .run-detail-head h3 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#run .recent-inline-detail .run-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
}
#run .recent-inline-detail .run-detail-meta > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#run .recent-inline-detail .run-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
}
#run .recent-inline-detail .job-summary-grid {
  gap: 14px;
}
#run .recent-inline-detail .summary-card {
  min-width: 0;
  min-height: 104px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
#run .recent-inline-detail .summary-card > strong {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#run .recent-inline-detail .task-count-metric { gap: 6px; }
#run .recent-inline-detail .job-task-wrap { scrollbar-gutter: auto; }
#run .recent-inline-detail .job-task-table { width: 100%; min-width: 1000px; }
#run .recent-inline-detail .job-task-table th,
#run .recent-inline-detail .job-task-table td {
  padding: 16px;
  vertical-align: middle;
}
#run .recent-inline-detail .job-task-table th:nth-child(1),
#run .recent-inline-detail .job-task-table td:nth-child(1) { width: 15%; }
#run .recent-inline-detail .job-task-table th:nth-child(2),
#run .recent-inline-detail .job-task-table td:nth-child(2),
#run .recent-inline-detail .job-task-table th:nth-child(3),
#run .recent-inline-detail .job-task-table td:nth-child(3),
#run .recent-inline-detail .job-task-table th:nth-child(6),
#run .recent-inline-detail .job-task-table td:nth-child(6) { width: 9%; }
#run .recent-inline-detail .job-task-table th:nth-child(4),
#run .recent-inline-detail .job-task-table td:nth-child(4) { width: 12%; }
#run .recent-inline-detail .job-task-table th:nth-child(5),
#run .recent-inline-detail .job-task-table td:nth-child(5) { width: 30%; }
#run .recent-inline-detail .job-task-table th:nth-child(7),
#run .recent-inline-detail .job-task-table td:nth-child(7) { width: 16%; }
#run .recent-inline-detail .task-progress { gap: 8px; }
#run .recent-inline-detail .task-progress-head { gap: 12px; }
#run .recent-inline-detail .task-progress-stages {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}
#run .recent-inline-detail .task-progress-stages span {
  padding: 5px 3px;
  font-size: 10px;
  line-height: 1.2;
}
@media (max-width: 1100px) {
  #run .recent-inline-detail .run-detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #run .recent-inline-detail .run-detail-head { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 14px; }
  #run .recent-inline-detail .run-detail-meta { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #run .recent-inline-detail .run-detail-actions { justify-content: flex-end; }
  #run .recent-inline-detail .summary-card { padding: 14px; }
  #run .recent-inline-detail .summary-card > strong { font-size: 17px; }
}

/* Current-task sidebar: compact details shared by all three tracks. */
#run .current-job-panel .job-detail { padding-right: 0; scrollbar-gutter: auto; }
#run .current-job-panel .run-detail-head { gap: 6px 12px; padding: 18px; }
#run .current-job-panel .run-detail-head > div:first-child { display: contents; }
#run .current-job-panel .run-detail-head .section-kicker { grid-column: 1; grid-row: 1; }
#run .current-job-panel .run-detail-head h3 { grid-column: 1; grid-row: 2; margin: 0; font-size: 18px; line-height: 1.45; }
#run .current-job-panel .run-detail-actions { grid-column: 2; grid-row: 1 / span 2; gap: 10px; align-items: center; }
#run .current-job-panel .run-detail-meta {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 12px 0 0;
  line-height: 1.6;
  font-size: 12px;
}
#run .current-job-panel .run-detail-meta > span { min-width: 0; overflow-wrap: anywhere; }
#run .current-job-panel .job-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#run .current-job-panel .summary-card { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; min-height: 90px; padding: 14px 16px; }
#run .current-job-panel .summary-card > strong { margin: 0; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#run .current-job-panel .task-count-metric { gap: 4px; }

/* Keep the original table semantics/data; present each task as a compact card. */
#run .current-job-panel .job-task-wrap { border: 0; background: transparent; overflow: visible; scrollbar-gutter: auto; }
#run .current-job-panel .job-task-table { display: block; width: 100%; min-width: 0; background: transparent; }
#run .current-job-panel .job-task-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#run .current-job-panel .job-task-table tbody { display: grid; gap: 12px; }
#run .current-job-panel .job-task-table tbody tr {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 14px;
  padding: 16px;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  background: var(--theme-surface);
}
#run .current-job-panel .job-task-table tbody td:nth-child(n) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
#run .current-job-panel .job-task-table td::before { font-size: 11px; line-height: 1.4; font-weight: 600; color: var(--theme-muted); }
#run .current-job-panel .job-task-table td:nth-child(1)::before { content: '数据集'; }
#run .current-job-panel .job-task-table td:nth-child(2)::before { content: '状态'; }
#run .current-job-panel .job-task-table td:nth-child(3)::before { content: '阶段'; }
#run .current-job-panel .job-task-table td:nth-child(4)::before { content: '写入缓存'; }
#run .current-job-panel .job-task-table td:nth-child(5)::before { content: '进度'; }
#run .current-job-panel .job-task-table td:nth-child(6)::before { content: '得分'; }
#run .current-job-panel .job-task-table td:nth-child(7)::before { content: '错误'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(1)::before { content: 'Dataset'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(2)::before { content: 'Status'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(3)::before { content: 'Stage'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(4)::before { content: 'Add Cache'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(5)::before { content: 'Progress'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(6)::before { content: 'Score'; }
#run .current-job-panel .job-task-table:lang(en) td:nth-child(7)::before { content: 'Error'; }
#run .current-job-panel .job-task-table td:nth-child(5) { grid-column: 1 / -1; }
#run .current-job-panel .job-task-table td:nth-child(7) { grid-column: 2 / -1; }
#run .current-job-panel .task-progress { width: 100%; min-width: 0; gap: 8px; }
#run .current-job-panel .task-progress-head { gap: 12px; }
#run .current-job-panel .task-progress-stages,
#run .current-job-panel .current-job-pipeline-stages {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
}
#run .current-job-panel .task-progress-stages span { padding: 5px 3px; font-size: 10px; line-height: 1.3; }
#run .current-job-panel .current-job-pipeline-stages span { padding: 8px 3px; font-size: 10px; overflow-wrap: anywhere; }
#run .current-job-panel .evaluation-error-card,
#run .current-job-panel .evaluation-error-content { min-width: 0; }
#run .current-job-panel .evaluation-error-meta { flex-wrap: wrap; }
#run .current-job-panel .evaluation-error-cause pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  #run .current-job-panel .run-detail-head { padding: 14px; }
  #run .current-job-panel .run-detail-head h3 { font-size: 16px; }
  #run .current-job-panel .run-detail-actions { flex-direction: column; gap: 6px; }
  #run .current-job-panel .run-detail-meta { grid-template-columns: minmax(0, 1fr); }
  #run .current-job-panel .summary-card { padding: 12px; }
  #run .current-job-panel .job-task-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; }
}

/* Keep the capability breakdown beside progress in both task-detail contexts. */
#run .run-result-scroll {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-accent) var(--theme-line);
  padding-bottom: 10px;
}
#run .run-result-scroll:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 2px; }
#run .run-result-scroll::-webkit-scrollbar { height: 9px; }
#run .run-result-scroll::-webkit-scrollbar-track { background: var(--theme-line); border-radius: 9px; }
#run .run-result-scroll::-webkit-scrollbar-thumb { background: var(--theme-accent); border-radius: 9px; }
#run .run-result-grid {
  display: grid;
  grid-template-columns: minmax(1000px, 1fr) 320px;
  min-width: 1336px;
  align-items: start;
  gap: 16px;
}
#run .current-job-panel .run-result-grid { grid-template-columns: minmax(420px, 1fr) 320px; min-width: 756px; }
#run .run-result-main { display: grid; gap: 16px; min-width: 0; }
#run .run-result-scores {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  padding: 12px;
  background: var(--theme-surface);
}
#run .run-result-scores .private-score-list { justify-items: stretch; gap: 10px; }
#run .run-result-scores .private-score-item { width: 100%; }
#run .run-result-scores .private-score-detail { min-width: 0; }
#run .run-result-scores .suite-dataset-list { min-width: 0; }
#run .run-result-scores .suite-dataset-grid { grid-template-columns: minmax(0, 1fr); }
#run .run-result-scores .private-score-empty { margin: 0; }

/* Enlarge only the headline capability disclosure in v2 task details. */
#run .track-capability-first .run-result-scores > .private-score-list > .private-score-item > summary {
  min-height: 54px;
  padding: 10px 14px;
}
#run .track-capability-first .run-result-scores > .private-score-list > .private-score-item > summary .private-score-title {
  font-size: 16px;
}
#run .track-capability-first .run-result-scores > .private-score-list > .private-score-item > summary .score-pill {
  min-width: 72px;
  height: 29px;
  font-size: 14px;
}

/* Textual results use the same nested disclosure pattern as Multimodal. */
#run .textual-capability-list .private-score-item > summary {
  grid-template-columns: 12px minmax(0, 1fr) auto;
  text-align: left;
}
#run .textual-capability-list .private-score-title,
#run .textual-capability-list .suite-dataset-row > span {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
  text-align: left;
}
#run .textual-capability-list .private-score-item > .private-score-detail {
  padding: 10px 8px 8px;
  min-width: 0;
}
#run .textual-capability-list .suite-dataset-row > strong,
#run .textual-capability-list .suite-dataset-row > em {
  text-align: right;
  white-space: nowrap;
}

/* Reserve readable columns; keep history overflow inside its own scroll area. */
#run #privateResults { min-width: 0; overflow: visible; }
#run #privateResults .private-table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
#run #privateResults .private-table { min-width: 1906px; }
#run #privateResults .private-table:has(.col-user) { min-width: 2156px; }
#run #privateResults .private-table .col-id { width: 216px; }
#run #privateResults .private-table .col-status { width: 132px; }
#run #privateResults .private-table col:nth-child(3) { width: 144px; }
#run #privateResults .private-table .col-error { width: 420px; }
#run #privateResults .private-table .col-score { width: 104px; }
#run #privateResults .private-table .col-datasets { width: 300px; }
#run #privateResults .private-table .col-version { width: 140px; }
#run #privateResults .private-table col:nth-child(8) { width: 90px; }
#run #privateResults .private-table .col-suite { width: 180px; }
#run #privateResults .private-table .col-time { width: 180px; }
#run #privateResults .private-table td { padding: 16px 14px; }
#run #privateResults .private-table tr:has(.evaluation-error-card) td { vertical-align: top; }
#run #privateResults .private-type-cell .benchmark-type-chip {
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
#run #privateResults .private-failure-cell .evaluation-error-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}
#run #privateResults .evaluation-error-meta code {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
#run #privateResults .evaluation-error-cause pre { box-sizing: border-box; max-width: 100%; }
#run #privateResults .private-score-item { max-width: 100%; }
#run #privateResults .private-score-detail { min-width: 0; max-width: 100%; }
#run #privateResults .table-toolbar { flex-wrap: wrap; gap: 12px; }
#run #privateResults .filter-row { flex-wrap: wrap; gap: 10px; }

/* Evaluation layout guards for long labels, translated badges and small screens. */
#run :is(.form-grid > label, .section-head > div, .run-detail-head > div, .summary-card, .active-job-identity) { min-width: 0; }
#run .form-grid :is(input, select) { min-width: 0; max-width: 100%; box-sizing: border-box; }
#run :is(.section-head, .recent-jobs-head, .active-jobs-head) { flex-wrap: wrap; gap: 10px; }
#run .current-job-panel .active-job-list { max-height: 160px; overflow-y: auto; overscroll-behavior-y: contain; }
#run .current-job-panel .active-job-card { padding-bottom: 22px; }
#run .active-job-identity { flex-wrap: wrap; gap: 6px 8px; }
#run .active-job-identity .mono { flex: 1 1 150px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#run .active-job-identity .benchmark-type-chip { flex: 0 0 auto; max-width: 100%; box-sizing: border-box; }
#run .current-job-panel .active-job-card .active-job-meta {
  grid-column: 1 / -1;
  justify-self: stretch;
  display: flex;
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
}
#run .current-job-panel .active-job-card > small:last-of-type { grid-column: 1 / -1; justify-self: start; }
#run .recent-inline-detail .job-task-table { min-width: 1300px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(1) { width: 150px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(2) { width: 140px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(3) { width: 110px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(4) { width: 130px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(5) { width: 340px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(6) { width: 100px; }
#run .recent-inline-detail .job-task-table :is(th, td):nth-child(7) { width: 330px; }
#run .job-task-table :is(.status-badge, .stage-chip) { box-sizing: border-box; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#run .recent-inline-detail .run-result-grid { grid-template-columns: minmax(1300px, 1fr) 320px; min-width: 1636px; }
#run .job-actions { flex-wrap: wrap; }
#run .job-actions > span { min-width: 0; overflow-wrap: anywhere; }
#run .recent-table .text-strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  #run .current-job-panel .active-job-card { gap: 8px; padding-inline: 12px; }
  #run .current-job-panel .active-job-list { max-height: 240px; }
  #run .recent-inline-detail .job-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
