.mobile-nav { display: none; }
#workspace-section { color: var(--ink); font-weight: 600; }
.workspace-heading { gap: 18px; align-items: center; }
.workspace-heading h1 { margin-top: 0; }

.evaluation-filters { flex-wrap: wrap; }
.run-source {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  line-height: 1.3;
}
.run-source.local-source { color: #17745e; background: #edf7f3; border-color: #d8ede5; }

.local-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.local-toolbar label { font-weight: 650; }
.local-toolbar select { min-width: 11rem; max-width: 100%; }
.local-metrics, .local-gpus { display: grid; gap: 14px; margin-bottom: 24px; }
.local-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.local-gpus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.local-gpus .panel { margin-bottom: 0; }
.local-body, .local-gpus .panel { padding: 20px 24px; }
.local-body h2, .local-gpus h2 { margin: 0 0 8px; }
.local-body .local-toolbar { margin-top: 16px; }
.local-tasks { min-width: 560px; }
.local-tasks th, .local-tasks td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.local-tasks th:first-child, .local-tasks td:first-child { padding-left: 24px; }
.local-tasks th { color: var(--muted); font-size: 12px; }
.local-tasks tr:last-child td { border: 0; }
#local-view progress { width: 100%; height: 6px; accent-color: var(--accent); }
.local-tasks progress { display: block; max-width: 9rem; margin-top: 7px; }
.local-gpus .workers { display: grid; gap: 7px; margin-top: 12px; }
.local-gpus .worker { display: block; }
.local-instruction { margin: 15px 0 10px; line-height: 1.55; }
.local-instruction b { color: #504952; margin-right: 8px; }
#local-stage[data-stage="succeeded"] { color: #087560; background: #e4f6ee; }
#local-stage:is([data-stage="failed"], [data-stage="incomplete"], [data-stage="offline"]) {
  color: #9b402d; background: #faeee8;
}

.dataset-picker { display: flex; align-items: center; gap: 10px; max-width: 100%; }
.dataset-picker label { color: #414153; font-size: 12px; font-weight: 650; white-space: nowrap; }
.dataset-picker select { max-width: 100%; min-height: 38px; font-size: 12px; }
.dataset-distribution { margin-bottom: 18px; border-radius: 12px; }
.dataset-distribution summary { cursor: pointer; padding: 12px 16px; color: #363b53; }
.dataset-distribution summary span { color: #565d72; margin-left: 12px; font-size: 12px; }
.dataset-distribution table { min-width: 470px; font-variant-numeric: tabular-nums; }
.dataset-distribution th, .dataset-distribution td { border-top: 1px solid var(--line); padding: 9px 16px; text-align: left; white-space: nowrap; }
.dataset-distribution th { color: #565d72; font-size: 12px; }
.dataset-distribution td span { margin-left: 5px; color: #565d72; font-size: 11px; }
.dataset-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.replay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 28%);
  align-items: start;
  gap: 18px;
}
.replay-player, .replay-catalog { border-color: #e3e5ee; border-radius: 12px; }
.replay-instruction { padding: 20px 22px 16px; }
.replay-episode-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding-bottom: 12px;
  margin-bottom: 13px;
  border-bottom: 1px solid #e3e5ee;
}
.replay-episode-meta h2 { font-size: 19px; font-weight: 650; line-height: 1.2; margin: 0; }
#replay-task-label { color: #473bc5; font-size: 12px; font-weight: 650; }
#replay-length { color: #565d72; font-size: 12px; margin-left: auto; }
.instruction-label { font-size: 12px; font-weight: 650; color: #565d72; }
#replay-instruction {
  color: var(--ink);
  font-size: clamp(16px, 1.53vw, 22px);
  line-height: 1.4;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 5px 0 0;
}
.replay-views {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 18px 12px;
}
.replay-views button {
  min-height: 36px;
  border: 1px solid transparent;
  color: #53596d;
  background: transparent;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.replay-views button:hover, .replay-views button[aria-pressed="true"] { background: #efedff; color: #473bc5; }
.replay-views button[aria-pressed="true"] { border-color: #ded9ff; font-weight: 650; }
.replay-stage { position: relative; background: #191b29; color: #fff; }
.replay-stage video {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 65vh;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  object-fit: contain;
  background: #191b29;
}
.replay-stage video[data-camera-view="all"] { aspect-ratio: 16 / 3; min-height: 135px; max-height: none; }
.camera-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #3a3e56;
  color: #eef0fc;
  font-size: 11px;
  text-align: center;
}
.camera-labels span { background: #202438; padding: 6px 2px; }
.replay-loading {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  max-width: 95%;
  background: #202438;
  border: 1px solid #535975;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 12px;
  text-align: center;
}
#replay-video-error .button { margin-top: 5px; }
.replay-transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 13px 19px;
  gap: 10px;
}
.frame-readout { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.frame-readout span { color: #565d72; }
.replay-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.replay-tools .button, .replay-tools select { min-height: 36px; padding: 6px 10px; }
.replay-rubric {
  margin: 0 19px 18px;
  padding: 12px 15px;
  border: 1px solid #e3e5ee;
  border-radius: 8px;
  background: #f8f9fd;
}
.replay-rubric h3 { font-size: 14px; }
.replay-rubric dl { display: grid; grid-template-columns: 1.18fr 1fr; gap: 14px; margin: 10px 0; }
.replay-rubric dl > div + div { border-left: 1px solid #dce0eb; padding-left: 14px; }
.replay-rubric dt { color: #4339a2; font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.replay-rubric dd { color: #343951; margin: 0; font-size: 13px; line-height: 1.65; }
.replay-rubric p { color: #565d72; font-size: 11px; }
.replay-rubric .rubric-summary { color: #343951; font-size: 13px; }
.rubric-items { margin: 9px 0 0; padding: 0; list-style: none; }
.rubric-items li { border-top: 1px solid #e3e5ee; padding: 7px 0; }
.rubric-items strong { display: block; color: #202437; font-size: 12px; font-weight: 650; }
.replay-catalog-head { padding: 16px 14px 11px; }
.replay-catalog-head h2 { margin: 0; font-size: 17px; }
.replay-catalog-head p { margin: 5px 0 11px; font-size: 12px; }
.replay-catalog-head select, .replay-catalog-head .search-field { width: 100%; }
.replay-catalog-head .search-field { margin-top: 7px; gap: 7px; }
.replay-catalog-head .search-field input { min-width: 0; }
.replay-list {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 90px;
  max-height: min(45vh, 440px);
  overflow: auto;
  overscroll-behavior: contain;
  border-block: 1px solid #e3e5ee;
  scrollbar-color: #b8bed2 transparent;
  scrollbar-width: thin;
}
.replay-list:empty { display: none; }
.replay-row {
  flex: none;
  min-height: 41px;
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #edeef4;
  border-left: 3px solid transparent;
  background: #fff;
  color: #373b53;
  padding: 7px 11px;
  text-align: left;
  font-size: 12px;
}
.replay-row b, .replay-row small { font-variant-numeric: tabular-nums; }
.replay-row small { color: #565d72; font-size: 11px; }
.replay-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-row:hover { background: #f6f5fd; }
.replay-row[aria-pressed="true"] { background: #efedff; border-left-color: var(--accent); color: #473bc5; }
.replay-row:focus-visible { outline-offset: -2px; }
.replay-list.replay-empty { padding: 12px 14px; color: #565d72; }
.replay-catalog-footer { display: flex; align-items: center; justify-content: space-between; padding: 7px 13px; color: #565d72; font-size: 12px; }
.replay-catalog-footer .button { padding: 6px 10px; min-width: 35px; font-size: 15px; }

@media (max-width: 1000px) {
  .replay-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .replay-list { max-height: 235px; }
}
@media (max-width: 560px) {
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; border-bottom: 1px solid #dce0eb; }
  .mobile-nav a { text-align: center; padding: 11px 2px; border-bottom: 2px solid transparent; font-size: 12px; white-space: nowrap; color: #51576a; }
  .mobile-nav a.active { color: #473bc5; border-bottom-color: var(--accent); font-weight: 650; }
  #remote-controls .mono { display: none; }
  .dataset-heading { flex-wrap: wrap; gap: 11px; }
  .dataset-picker { width: 100%; }
  .local-metrics, .local-gpus { grid-template-columns: 1fr; gap: 8px; }
  .local-metrics .metric-card { min-height: 0; }
  .local-metrics .metric-value { font-size: 27px; }
  .local-body, .local-gpus .panel { padding: 14px; }
  .replay-instruction { padding: 15px 13px 12px; }
  .replay-views { padding: 0 9px 9px; gap: 2px; }
  .replay-views button { padding: 6px 8px; }
  .replay-transport { padding: 11px 12px; }
  .replay-rubric { margin: 0 12px 12px; padding: 11px 12px; }
  .replay-rubric dl { grid-template-columns: 1fr; gap: 9px; }
  .replay-rubric dl > div + div { border-left: 0; border-top: 1px solid #dce0eb; padding: 9px 0 0; }
}

.video-instruction {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fc;
}
.video-instruction b { color: var(--accent); font-size: 11px; }
.video-instruction p { margin-top: 5px; line-height: 1.55; overflow-wrap: anywhere; }
