:root {
  --bg: #f4f7f6;
  --ink: #18211f;
  --muted: #657571;
  --border: #e1e8e5;
  --soft-border: #edf1ef;
  --panel: #ffffff;
  --accent: #0d9f8e;
  --accent-dark: #087a6e;
  --nav-start: #071418;
  --nav-end: #0e1b1f;
  --danger: #cf3d34;
  --warning: #8a5a00;
  --success: #087a6e;
  --app-sticky-top: 58px;
  --detail-sticky-gap: 10px;
}

/* 2026 redesigned console shell */
:root {
  --bg: #f7f9f8;
  --ink: #101918;
  --muted: #66736f;
  --border: #dde5e2;
  --soft-border: #edf2f0;
  --panel: #ffffff;
  --accent: #007a7a;
  --accent-dark: #00615f;
  --danger: #d92d20;
  --warning: #b26a00;
  --success: #0f8a4b;
  --sidebar: #fbfcfc;
}

body {
  background: var(--bg);
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  gap: 18px;
  padding: 20px 16px;
  color: #14211f;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #111918;
  font-size: 17px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, #00656a, #008a87);
  font-size: 22px;
  letter-spacing: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 760;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: visible;
}

.side-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #25312f;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 650;
}

.side-nav a.active,
.side-nav a.nav-parent-active,
.side-nav a[aria-current="page"],
.side-nav a:hover {
  color: var(--accent-dark);
  background: #eaf7f5;
  border-left-color: var(--accent);
}

.collapse-button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #263432;
  font-size: 14px;
}

.surface {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 80px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.top-controls {
  display: flex;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}

.top-controls label {
  min-width: 180px;
}

.top-controls span,
.field span {
  color: #222c2a;
  font-size: 13px;
  font-weight: 640;
}

input,
select,
textarea {
  min-height: 38px;
  border-radius: 7px;
  border-color: #d5dfdc;
  color: #17211f;
  background: #ffffff;
  font-size: 14px;
}

textarea {
  min-height: 112px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-actions button,
.topbar-actions a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #101918;
  text-decoration: none;
  font-size: 18px;
}

.toast {
  margin: 14px 28px 0;
}

.view {
  display: none;
  min-width: 0;
  padding: 28px;
}

.view.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  color: #0f1817;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 760;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.page-head-actions,
.detail-actions,
.suite-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 18px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 660;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 122, 122, .14);
}

.button.secondary {
  background: #ffffff;
}

.button.danger {
  color: var(--danger);
  border-color: #f2b8b5;
  background: #fff8f7;
}

.button.full {
  width: 100%;
}

.workflow-panel,
.queue-section,
.detail-panel,
.suite-list-panel,
.suite-main-panel,
.case-editor-panel,
.settings-nav,
.config-panel,
.failure-table-panel,
.failure-inspector,
.log-table-panel,
.log-detail-panel,
.recommendation-panel,
.report-empty {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

.workflow-panel {
  display: grid;
  gap: 12px;
  padding: 0;
}

.workflow-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--soft-border);
}

.workflow-step:last-child {
  border-bottom: 0;
}

.step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 760;
}

.step-content h2,
.drawer-head h2,
.recommendation-panel h2,
.config-panel h2 {
  margin: 0;
  color: #151f1e;
  font-size: 18px;
  font-weight: 730;
}

.step-content p {
  margin: 5px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.step-title-row,
.drawer-head,
.organizer-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.text-link,
.default-chip-row a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 650;
}

.suite-meta-grid,
.preflight-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.suite-meta-grid {
  margin-top: 18px;
}

.suite-meta-grid div,
.metric-grid div {
  padding: 0 28px;
  border-left: 1px solid var(--border);
}

.suite-meta-grid div:first-child,
.metric-grid div:first-child {
  padding-left: 0;
  border-left: 0;
}

.suite-meta-grid span,
.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.suite-meta-grid strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.run-config-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
}

.default-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-border);
  flex-wrap: wrap;
}

.default-chip-row > span {
  color: #263230;
  font-weight: 650;
}

.default-chip-row strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
  color: #263230;
  font-size: 13px;
}

.default-editor-row {
  align-items: stretch;
}

.default-edit-chip {
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: auto 52px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
  color: #263230;
  font-size: 13px;
  font-weight: 650;
}

.default-edit-chip > span {
  white-space: nowrap;
}

.default-edit-chip input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #151f1e;
  font: inherit;
  font-weight: 720;
  text-align: center;
}

.default-edit-chip input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(0, 126, 122, 0.14);
}

.default-edit-chip.judge-model-chip {
  grid-template-columns: auto 112px;
}

.preflight-grid {
  gap: 16px;
}

.preflight-item {
  width: 100%;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.preflight-item:hover,
.preflight-item:focus-visible {
  border-color: rgba(0, 126, 122, 0.36);
  box-shadow: 0 8px 18px rgba(15, 38, 37, 0.08);
  outline: none;
}

.preflight-item.failed {
  border-color: rgba(207, 61, 52, 0.38);
  background: #fffafa;
}

.preflight-item.ok strong::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e7f7ec;
  color: var(--success);
}

.preflight-item.failed strong::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ffe8e5;
  color: var(--danger);
}

.preflight-item span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.preflight-item em {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.suite-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 12px;
}

.suite-list-panel,
.suite-main-panel,
.case-editor-panel {
  min-width: 0;
  padding: 14px;
}

.suite-list-toolbar,
.suite-table-toolbar,
.queue-toolbar,
.log-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.suite-list-toolbar input,
.suite-table-toolbar input,
.queue-toolbar input,
.log-filter-bar input {
  flex: 1 1 auto;
}

.suite-list-items {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.suite-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #15201e;
  text-align: left;
}

.suite-list-item.active,
.suite-list-item:hover {
  background: #ecf8f6;
}

.suite-list-item span,
.suite-list-item small {
  color: var(--muted);
  font-size: 12px;
}

.suite-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.subtabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.subtab {
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 660;
}

.subtab.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-right: 5px;
  padding: 0 8px;
  border-radius: 6px;
  background: #e8f7ee;
  color: #0f7a45;
  font-size: 12px;
}

.tag.blue {
  color: #1261a6;
  background: #edf5ff;
}

.tag.violet {
  color: #6b46c1;
  background: #f3f0ff;
}

.status-dot {
  color: var(--success);
  font-weight: 660;
}

.status-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--success);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 14px;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.segment-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.segment-tabs button {
  min-height: 42px;
  min-width: 82px;
  border: 0;
  border-left: 1px solid var(--border);
  background: #ffffff;
  color: #24302e;
  font-weight: 660;
}

.segment-tabs button:first-child {
  border-left: 0;
}

.segment-tabs button.active {
  background: var(--accent);
  color: #ffffff;
}

.segment-tabs.small button {
  min-width: 64px;
}

.queue-section {
  overflow: hidden;
}

table {
  min-width: 960px;
  font-size: 14px;
}

th,
td {
  padding: 14px 18px;
}

th {
  color: #303d3a;
  background: #fbfcfc;
  font-size: 13px;
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  width: 110px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeee;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.detail-panel {
  position: static;
  display: block;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0;
  margin-bottom: 22px;
  border: 0;
  background: transparent;
}

.breadcrumb {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.breadcrumb-path {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.breadcrumb-back,
.breadcrumb-link {
  color: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.breadcrumb-back {
  min-height: 32px;
  padding: 0 10px;
  color: #12211f;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  font-weight: 700;
}

.breadcrumb-link {
  color: var(--accent-dark);
  font-weight: 720;
}

.breadcrumb-back:hover,
.breadcrumb-link:hover {
  color: var(--accent-dark);
}

.detail-title-row h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.metric-grid {
  margin-bottom: 16px;
  padding: 28px 30px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 42px;
  line-height: 1;
  font-weight: 720;
}

.metric-grid small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.recommendation-panel {
  padding: 28px;
}

.recommendation-panel p,
.recommendation-panel li span {
  color: var(--muted);
  line-height: 1.7;
}

.recommendation-ok {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 38px auto 22px;
  border-radius: 50%;
  background: #e7f7ec;
  color: var(--success);
  font-size: 34px;
}

.review-action-panel {
  display: none;
}

.tabs {
  margin-top: 16px;
  padding: 0;
}

.failure-review-layout,
.logs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
}

.failure-table-panel,
.failure-inspector,
.log-table-panel,
.log-detail-panel {
  min-width: 0;
  padding: 16px;
}

.failure-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 96px 96px 150px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.failure-filter-row label {
  display: grid;
  gap: 5px;
}

.failure-inspector-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0;
}

.failure-inspector-metrics div {
  padding: 0 12px;
  border-left: 1px solid var(--border);
}

.failure-inspector-metrics div:first-child {
  padding-left: 0;
  border-left: 0;
}

.failure-inspector-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.failure-inspector-metrics strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
}

.score-alert,
.danger-text {
  color: var(--danger) !important;
}

.inspector-collapse {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.inspector-collapse summary {
  cursor: pointer;
  font-weight: 690;
}

.inspector-collapse p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.shortcomings-panel {
  padding: 12px 0;
}

.shortcomings-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.shortcomings-panel li {
  margin-bottom: 10px;
  color: #202d2a;
}

.shortcomings-panel li::marker {
  color: var(--danger);
}

.failure-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.failure-actions .full {
  grid-column: 1 / -1;
}

.report-empty {
  max-width: 780px;
  padding: 30px;
}

.report-empty strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.log-filter-bar {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.log-filter-bar > input:first-child {
  flex: 0 0 360px;
}

.log-level {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 780;
}

.log-level.error {
  color: var(--danger);
  background: #fff0ef;
}

.log-level.warn {
  color: var(--warning);
  background: #fff6df;
}

.log-level.info {
  color: #1261a6;
  background: #edf5ff;
}

.detail-kv {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
}

.detail-kv dt {
  color: var(--muted);
}

.detail-kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.log-json {
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfc;
  color: #23302d;
  font-size: 12px;
  line-height: 1.55;
}

.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
}

.settings-nav button {
  min-height: 48px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #25302e;
  text-align: left;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 650;
}

.settings-nav button.active {
  color: var(--accent-dark);
  background: #eaf7f5;
  border-left-color: var(--accent);
}

.config-panel {
  padding: 0;
}

.config-panel .panel-head {
  display: flex;
  align-items: center;
  padding: 22px 24px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.config-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "task task"
    "agent judge"
    "output output";
  gap: 0;
}

.config-section {
  padding: 24px;
  border-top: 0;
  border-bottom: 1px solid var(--soft-border);
}

.agent-config {
  border-right: 1px solid var(--soft-border);
}

.judge-config {
  border-left: 0;
}

.output-config {
  border-bottom: 0;
}

.config-fields,
.judge-fields,
.output-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.agent-config .config-fields,
.judge-config .config-fields,
.judge-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field.wide {
  grid-column: 1 / -1;
}

.config-actions-field {
  grid-column: 1 / -1;
}

.config-actions {
  display: flex;
  gap: 12px;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.compact-modal {
  width: min(720px, calc(100vw - 32px));
}

.organizer-modal {
  width: min(1080px, calc(100vw - 32px));
}

.review-modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.download-dialog-body {
  display: grid;
  gap: 20px;
  padding: 22px 28px;
  overflow: auto;
}

.download-dialog-body h4,
.organizer-grid h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.download-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

.download-card,
.download-scope-card {
  min-height: 86px;
  display: grid;
  place-items: start;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.download-card.selected,
.download-scope-card.selected {
  border-color: var(--accent);
  background: #f1fbf9;
}

.download-card span,
.download-scope-card span {
  color: var(--muted);
  font-size: 12px;
}

.download-check-row {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.download-dialog-body small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--border);
}

.organizer-target-strip {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px auto;
  gap: 18px;
  margin: 0 28px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.organizer-target-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.organizer-target-strip strong {
  display: block;
  margin-top: 6px;
}

.organizer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 18px 28px 0;
  overflow: auto;
}

.organizer-textarea {
  min-height: 390px;
}

.organized-preview {
  min-height: 390px;
  max-height: 430px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfc;
}

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

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .collapse-button {
    display: none;
  }

  .suite-layout,
  .failure-review-layout,
  .logs-layout,
  .settings-layout,
  .organizer-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .view {
    padding: 18px;
  }

  .topbar,
  .page-head,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-controls,
  .queue-toolbar,
  .log-filter-bar,
  .suite-list-toolbar,
  .suite-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .run-config-row,
  .suite-form-grid,
  .config-workspace,
  .config-fields,
  .judge-fields,
  .output-fields,
  .failure-filter-row,
  .organizer-target-strip,
  .download-grid,
  .metric-grid,
  .suite-meta-grid,
  .preflight-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: auto;
  }
}

* {
  box-sizing: border-box;
}

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

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 0;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  gap: 18px;
  color: #dce8e4;
  background: linear-gradient(90deg, var(--nav-start), var(--nav-end));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 22px rgba(17, 31, 28, .08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 820;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  background: #163330;
  color: #4de0cf;
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12px;
  font-weight: 900;
}

.side-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

.side-nav a {
  min-height: 34px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 9px;
  color: #9fb0aa;
  text-decoration: none;
  font-size: 12px;
  font-weight: 720;
  border-bottom: 2px solid transparent;
}

.side-nav a.active,
.side-nav a.nav-parent-active,
.side-nav a[aria-current="page"],
.side-nav a:hover {
  background: #1b2b29;
  color: #ffffff;
  border-bottom-color: #12b8a8;
}

.version {
  color: #748781;
  font-size: 11px;
}

.surface {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  min-height: 70px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #ffffff;
  border-bottom: 1px solid #e5ebe8;
}

.title-block h1,
.section-head h2,
.detail-head h2,
.panel-head h2 {
  margin: 0;
  color: #111a18;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 820;
}

.title-block p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-controls {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-controls label,
.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.top-controls span,
.field span,
.step-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid #d7dfdc;
  border-radius: 4px;
  background: #fff;
  color: #27322f;
  padding: 0 9px;
  font-size: 12px;
}

input:disabled {
  color: #73817d;
  background: #f7faf9;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(13, 159, 142, .45);
  outline-offset: 2px;
}

.top-controls select {
  min-width: 116px;
}

.toast {
  display: none;
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid #bce1db;
  border-radius: 6px;
  background: #eff7f5;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 720;
}

.toast.show {
  display: block;
}

.toast.error {
  border-color: #edb5ad;
  background: #fff0ee;
  color: var(--danger);
}

.work-area {
  min-width: 0;
  padding: 14px 18px 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.step-row {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(680px, 1.68fr);
  gap: 12px;
  align-items: start;
}

.panel,
.queue-section,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 0;
}

.step-panel {
  padding: 14px;
}

.config-panel {
  padding: 16px 18px 18px;
}

.panel-head,
.section-head,
.detail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.panel-head {
  display: block;
  margin-bottom: 12px;
}

.config-panel .panel-head {
  margin-bottom: 14px;
}

.config-save-status {
  min-height: 18px;
  margin-top: 5px;
  color: #7a8985;
  font-size: 11px;
  font-weight: 760;
}

.config-save-status.saved {
  color: var(--success);
}

.config-save-status.saving,
.config-save-status.pending {
  color: #49645d;
}

.config-save-status.error {
  color: var(--danger);
}

.detail-identity {
  display: grid;
  gap: 7px;
  min-width: 0;
  align-content: center;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.detail-title-row h2 {
  flex: 0 0 auto;
}

.detail-meta-chip.detail-run-repeat {
  min-height: 42px;
  padding: 6px 10px;
  border-color: #dce9e5;
  background: #fbfefd;
  color: #10211e;
  font-size: 14px;
  font-weight: 820;
}

.detail-meta-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #cfe0dc;
  border-radius: 4px;
  background: #f6fbfa;
  color: #49645d;
  font-weight: 780;
  white-space: nowrap;
}

.detail-meta-chip.strong {
  border-color: #8fcfc4;
  background: #e9f8f5;
  color: #08796d;
}

.detail-run-id {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #e1e9e6;
  border-radius: 5px;
  background: #f8fbfa;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 740;
}

.upload-panel {
  align-self: start;
}

.upload-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "file action"
    "meta meta";
  gap: 12px 14px;
  align-items: end;
  padding: 14px;
  background: #f8fbfa;
  border: 1px dashed #8fb1aa;
  border-radius: 6px;
}

.upload-file-field {
  grid-area: file;
}

.upload-field-stack {
  grid-area: meta;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-composer #uploadButton {
  grid-area: action;
  min-width: 72px;
  align-self: end;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.config-grid {
  display: grid;
  gap: 0 18px;
}

.config-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "task task"
    "agent judge"
    "output output";
  align-items: start;
}

.config-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--soft-border);
}

.config-section:first-child {
  border-top: 0;
}

.task-config {
  grid-area: task;
  padding: 0 0 14px;
}

.agent-config {
  grid-area: agent;
  padding-right: 18px;
}

.judge-config {
  grid-area: judge;
  padding-left: 18px;
  border-left: 1px solid var(--soft-border);
}

.output-config {
  grid-area: output;
  padding: 14px 0 0;
}

.config-section-head {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-section-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #49645d;
  font-size: 11px;
  font-weight: 860;
}

.config-section-head span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9edbd2;
}

.config-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.compact-fields {
  grid-template-columns: minmax(0, 1fr) minmax(142px, .22fr);
}

.judge-fields {
  grid-template-columns: minmax(0, 1fr) minmax(180px, .52fr);
}

.output-fields {
  grid-template-columns: minmax(240px, .42fr) minmax(420px, .58fr);
  gap: 10px 16px;
}

.field.wide {
  grid-column: span 2;
}

.config-actions-field {
  min-width: 0;
}

.config-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-actions .button {
  flex: 1 1 0;
}

.config-actions .button.primary {
  min-width: 160px;
}

.inline-status {
  min-height: 32px;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  align-self: end;
  color: #49645d;
  font-size: 12px;
  font-weight: 760;
}

.inline-status:empty {
  display: none;
}

.button {
  min-height: 32px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dfdc;
  border-radius: 4px;
  padding: 0 12px;
  color: #27322f;
  background: #f5f8f7;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(13, 159, 142, .12);
}

.button:hover {
  filter: brightness(.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.queue-section {
  overflow: visible;
}

.detail-panel {
  position: sticky;
  top: calc(var(--app-sticky-top) + var(--detail-sticky-gap));
  z-index: 12;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: calc(100vh - var(--app-sticky-top) - var(--detail-sticky-gap) - 12px);
  overflow: hidden;
}

.section-head,
.detail-head {
  padding: 12px;
  border-bottom: 1px solid var(--soft-border);
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 220px);
  column-gap: 12px;
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfefd 100%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.queue-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid #eef4f2;
  background: #fbfdfc;
}

.queue-pager[hidden] {
  display: none;
}

.pager-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.pager-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #bfd7d1;
  border-radius: 4px;
  background: #ffffff;
  color: #244b41;
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.pager-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #fbfcfc;
  color: #516a65;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

#overviewTab table {
  min-width: 980px;
  table-layout: fixed;
}

#overviewTab .table-wrap {
  background: #ffffff;
  height: 100%;
  min-height: 260px;
  overflow: auto;
  overscroll-behavior: auto;
}

#overviewTab thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f4faf7;
  border-bottom-color: #d8e8e3;
}

#overviewTab th:nth-child(1) {
  width: 180px;
}

#overviewTab th:nth-child(2),
#overviewTab th:nth-child(3),
#overviewTab th:nth-child(4),
#overviewTab th:nth-child(5),
#overviewTab th:nth-child(6) {
  width: 92px;
}

#overviewTab th:nth-child(7) {
  width: 116px;
}

.sort-button {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sort-indicator {
  color: #0b8276;
  font-size: 12px;
  font-weight: 900;
}

tbody tr {
  transition: background .16s ease;
}

tbody tr[data-run-id] {
  cursor: pointer;
}

tbody tr[data-run-id]:hover,
tbody tr.selected {
  background: #f1fbf9;
}

.truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wrap-text {
  max-width: 360px;
  min-width: 180px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.actions-col {
  width: 156px;
  text-align: right;
}

.row-actions {
  min-width: 142px;
  text-align: right;
  white-space: nowrap;
}

.link-button {
  min-height: 26px;
  margin-left: 6px;
  border: 1px solid #cfded9;
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 820;
}

.link-button:hover {
  background: #eff9f7;
}

.score-breakdown {
  min-width: 260px;
  display: grid;
  gap: 6px;
}

.score-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid #c9ded9;
  border-radius: 4px;
  background: #f3fbf9;
  color: #27443f;
}

.score-breakdown-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 760;
}

.score-breakdown-values {
  display: inline-flex;
  gap: 7px;
  color: #48635e;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.answer-detail-row td {
  padding: 0 10px 10px;
  background: #fbfdfc;
}

.case-summary-row {
  background: #ffffff;
}

.case-summary-row:hover {
  background: #f8fcfb;
}

.case-summary-row td {
  vertical-align: middle;
}

.case-summary-row .score {
  color: #08796d;
  font-weight: 840;
}

.case-summary-row .metric-alert,
.case-summary-row .score.score-alert {
  color: var(--danger);
  font-weight: 860;
}

.pass-status {
  display: inline-flex;
  min-width: 32px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border: 1px solid var(--soft-border);
  border-radius: 6px;
  color: var(--muted);
  background: #f7fbfa;
  font-weight: 820;
}

.pass-status.passed {
  color: var(--success);
  background: #e8fbf7;
  border-color: #a6ded6;
}

.pass-status.failed {
  color: var(--danger);
  background: #fff0ee;
  border-color: #edb5ad;
}

.case-summary-row .actions-col,
.case-summary-row .row-actions {
  text-align: right;
}

.merged-case-cell {
  width: 180px;
  max-width: 180px;
  font-weight: 820;
  color: var(--ink);
  background: #fbfdfc;
  border-right: 1px solid var(--soft-border);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.case-id-cell-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.case-id-label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.case-retry-button {
  flex: 0 0 auto;
  min-width: 48px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #9fcfc8;
  border-radius: 6px;
  color: var(--accent-strong);
  background: #f7fffd;
  font-size: 13px;
  font-weight: 840;
  cursor: pointer;
}

.case-retry-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #eafffb;
}

.case-retry-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.case-fold-detail-row td {
  padding: 7px 10px;
  background: #fbfdfc;
}

.turn-detail-label-row td {
  color: var(--muted);
  background: #f5faf8;
  border-bottom-color: #dce8e4;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.turn-answer-detail-row td {
  vertical-align: top;
}

.turn-detail-expanded-row .turn-detail-cell {
  padding: 0 12px 16px 0;
  background: linear-gradient(90deg, #f1f8f5 0, #fbfdfc 56px, #fbfdfc 100%);
}

.turn-detail-panel {
  display: grid;
  gap: 14px;
  margin: 6px 0 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #d6e6e1;
  border-left: 3px solid #0b9c8a;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(32, 54, 49, .07);
}

.turn-detail-runs {
  display: grid;
  gap: 12px;
}

.turn-run-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 1px solid #dbe9e5;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.turn-run-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px;
  border: 1px solid #dcebe7;
  border-radius: 6px;
  background: #f6faf8;
}

.turn-run-tab {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #526b65;
  cursor: pointer;
  font-size: 12px;
  font-weight: 840;
}

.turn-run-tab.active,
.turn-run-tab[aria-selected="true"] {
  border-color: #a5d6cf;
  background: #ffffff;
  color: #066f64;
  box-shadow: 0 3px 10px rgba(28, 72, 65, .08);
}

.turn-run-tab:focus-visible {
  outline: 2px solid rgba(4, 150, 132, .35);
  outline-offset: 2px;
}

.turn-detail-grid,
.turn-answer-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.turn-detail-grid {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.turn-answer-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(280px, .9fr);
}

.turn-detail-section {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.turn-detail-section-title {
  color: #526c66;
  font-size: 11px;
  font-weight: 860;
}

.turn-detail-section-body {
  min-width: 0;
  color: #263330;
  line-height: 1.55;
}

.turn-detail-text {
  padding: 10px 12px;
  background: #f9fcfb;
  border: 1px solid #dfeae7;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.turn-question-section .turn-detail-text {
  color: #263330;
  font-weight: 640;
}

.shortcoming-section .shortcoming-list {
  padding: 10px 12px;
  border: 1px solid #e8dfc8;
  border-radius: 5px;
  background: #fffdf6;
  max-height: 280px;
  overflow: auto;
}

.turn-run-context {
  display: grid;
  gap: 7px;
  padding: 13px 14px 0;
}

.turn-run-context-kicker {
  color: #607973;
  font-size: 11px;
  font-weight: 860;
}

.turn-run-context .turn-detail-section-title {
  display: none;
}

.turn-review-block {
  display: grid;
  gap: 10px;
  margin: 0 14px;
  padding: 12px;
  border: 1px solid #e0ebe7;
  border-radius: 6px;
  background: #fbfefd;
}

.turn-review-block:last-child {
  margin-bottom: 14px;
}

.turn-review-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf4f2;
}

.turn-review-block-head span {
  color: #21322e;
  font-size: 13px;
  font-weight: 900;
}

.turn-review-block-head small {
  color: #6b817c;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.answer-review-block {
  background: #fffefd;
}

.turn-answer-grid .answer-collapse[open] {
  min-width: 0;
}

.turn-answer-grid .answer-collapse-body {
  width: 100%;
  max-width: none;
  max-height: 360px;
  box-shadow: none;
}

.turn-answer-grid .answer-readable {
  min-width: 0;
}

.review-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 30, 27, .46);
  backdrop-filter: blur(2px);
}

.review-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 61;
  width: min(1480px, calc(100vw - 24px));
  max-height: min(920px, calc(100vh - 32px));
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 1px solid #c8ded8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(18, 36, 32, .28);
}

.review-modal-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(920px, calc(100vh - 32px));
}

.review-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2ede9;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
}

.review-modal-head h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.review-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-modal-meta span,
.review-modal-meta a {
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #cfe0dc;
  border-radius: 4px;
  background: #ffffff;
  color: #4d6861;
  font-size: 12px;
  font-weight: 780;
}

.review-modal-meta a {
  max-width: min(520px, 100%);
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.review-modal-meta a:hover,
.review-modal-meta a:focus-visible {
  border-color: var(--accent);
  background: #f4fbf7;
  outline: none;
}

.review-modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid #cddfda;
  border-radius: 6px;
  background: #ffffff;
  color: #4d625d;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.review-modal-close:hover,
.review-modal-close:focus-visible {
  border-color: #86c9bf;
  color: #08796d;
}

.review-modal-body {
  display: grid;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 24px;
  background: #fbfdfc;
}

.review-modal-section {
  display: grid;
  gap: 8px;
}

.review-modal-section h4,
.review-answer-card h5 {
  margin: 0;
  color: #263d38;
  font-size: 13px;
  font-weight: 900;
}

.review-question-box,
.review-shortcomings-box {
  padding: 12px 14px;
  border-radius: 6px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.review-question-box {
  border: 1px solid #d9e7e3;
  background: #ffffff;
}

.review-shortcomings-box {
  border: 1px solid #ead9b6;
  background: #fffaf0;
}

.review-shortcomings-box.empty {
  border-color: #d9e7e3;
  background: #f7fbfa;
  color: #6b817c;
}

.review-shortcomings-box .shortcoming-list {
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.review-judge-retry-box {
  padding: 12px 14px;
  border: 1px solid #d7e4ec;
  border-radius: 6px;
  background: #f7fbfd;
}

.judge-retry-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.judge-retry-list li {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.judge-retry-title {
  color: #263d38;
  font-weight: 800;
}

.judge-retry-error,
.judge-retry-response {
  color: #536965;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.review-answer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.review-answer-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  min-height: 420px;
  padding: 14px;
  border: 1px solid #d8e6e2;
  border-radius: 7px;
  background: #ffffff;
}

.agent-answer-card {
  border-color: #cbe4df;
  background: #f8fdfb;
}

.agent-answer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agent-answer-head h5 {
  flex: 0 0 auto;
}

.agent-answer-head .agent-session-link {
  min-width: 0;
  max-width: min(520px, 100%);
  padding: 3px 8px;
  border: 1px solid #8fd0c7;
  border-radius: 4px;
  color: var(--accent);
  background: #ffffff;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.agent-answer-head .agent-session-link:hover,
.agent-answer-head .agent-session-link:focus-visible {
  border-color: var(--accent);
  background: #f4fbf7;
  outline: none;
}

.review-answer-body {
  min-height: 0;
  max-height: min(520px, calc(100vh - 360px));
  overflow: auto;
  padding: 12px;
  border: 1px solid #e1ece8;
  border-radius: 6px;
  background: rgba(255, 255, 255, .76);
}

.review-answer-body .answer-readable {
  min-width: 0;
}

.nart-cell {
  color: #284d45;
  font-weight: 720;
}

.nart-list {
  display: grid;
  gap: 0;
}

.nart-line {
  min-height: 20px;
  line-height: 20px;
  white-space: nowrap;
}

.nart-line-empty {
  color: transparent;
}

.answer-collapse {
  min-width: 120px;
  position: relative;
}

.answer-collapse summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 820;
  white-space: nowrap;
}

.answer-collapse[open] {
  min-width: min(560px, calc(100vw - 72px));
}

.answer-collapse-body {
  margin-top: 7px;
  width: min(720px, calc(100vw - 96px));
  max-height: 420px;
  overflow: scroll;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: #b8c8c4 #edf4f2;
  scrollbar-width: auto;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d8e5e1;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(32, 54, 49, .08);
  color: #34423f;
  font-size: 13px;
  line-height: 1.62;
  white-space: normal;
  overflow-wrap: anywhere;
}

.answer-collapse-body::-webkit-scrollbar,
.answer-table-scroll::-webkit-scrollbar,
.answer-table-block::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.answer-collapse-body::-webkit-scrollbar-track,
.answer-table-scroll::-webkit-scrollbar-track,
.answer-table-block::-webkit-scrollbar-track {
  background: #edf4f2;
  border-radius: 6px;
}

.answer-collapse-body::-webkit-scrollbar-thumb,
.answer-table-scroll::-webkit-scrollbar-thumb,
.answer-table-block::-webkit-scrollbar-thumb {
  background: #b8c8c4;
  border: 2px solid #edf4f2;
  border-radius: 6px;
}

.answer-collapse-body::-webkit-scrollbar-corner,
.answer-table-scroll::-webkit-scrollbar-corner,
.answer-table-block::-webkit-scrollbar-corner {
  background: #edf4f2;
}

.answer-readable {
  display: grid;
  gap: 7px;
  min-width: min(520px, 72vw);
}

.answer-heading {
  padding: 2px 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 860;
  border-bottom: 1px solid #edf3f1;
}

.answer-paragraph {
  margin: 0;
}

.answer-list-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
}

.answer-list-marker {
  color: var(--accent);
  font-weight: 860;
}

.answer-spacer {
  height: 4px;
}

.answer-table-block {
  margin: 2px 0;
  padding: 9px 10px;
  max-width: 100%;
  overflow: scroll;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: #b8c8c4 #edf4f2;
  background: #f6faf8;
  border: 1px solid #dce9e5;
  border-radius: 5px;
  color: #263330;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.answer-table-scroll {
  max-width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  scrollbar-color: #b8c8c4 #edf4f2;
  border: 1px solid #d6e4df;
  border-radius: 6px;
  background: #ffffff;
}

.answer-markdown-table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 13px;
}

.answer-markdown-table th,
.answer-markdown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2ece8;
  border-right: 1px solid #e2ece8;
  vertical-align: top;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.answer-markdown-table th:last-child,
.answer-markdown-table td:last-child {
  border-right: 0;
}

.answer-markdown-table tbody tr:last-child td {
  border-bottom: 0;
}

.answer-markdown-table th {
  background: #f3f8f6;
  color: #526b65;
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
}

.answer-markdown-table td {
  background: #ffffff;
  color: #263330;
}

.answer-markdown-table td:first-child {
  color: #244b41;
  font-weight: 760;
}

.answer-readable code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef5f2;
  color: #244b41;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.shortcoming-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shortcoming-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px;
  line-height: 1.5;
}

.shortcoming-index {
  color: var(--muted);
  font-weight: 820;
}

.answer-detail {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f6faf9;
}

.answer-detail strong {
  color: #22322e;
  font-size: 12px;
}

.answer-body {
  color: #34423f;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.empty {
  text-align: center;
  padding: 18px 10px;
}

.badge {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.badge.completed,
.badge.passed {
  color: var(--success);
  background: #e8fbf7;
  border-color: #a6ded6;
}

.badge.running,
.badge.queued,
.badge.agent_completed,
.badge.review {
  color: var(--warning);
  background: #fff6df;
  border-color: #eacb73;
}

.badge.failed {
  color: var(--danger);
  background: #fff0ee;
  border-color: #edb5ad;
}

.score {
  color: var(--accent-dark);
  font-weight: 820;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 9px 10px 0;
  border-bottom: 1px solid var(--soft-border);
}

.review-action-panel {
  grid-column: 2;
  justify-self: end;
  width: min(220px, 100%);
  min-width: 0;
  display: grid;
}

.review-action-grid {
  display: grid;
  grid-template-columns: minmax(190px, 220px);
  gap: 8px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #d8e5e1;
  border-radius: 6px;
  background: #ffffff;
}

.review-action-stage-tools {
  display: contents;
}

.review-action-item {
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border: 0;
  border-bottom: 1px solid #edf1ef;
  border-radius: 0;
  background: transparent;
}

.review-action-stage-tools .review-action-item:last-child {
  border-bottom: 0;
}

.review-action-label {
  min-width: 0;
  overflow: hidden;
  color: #516a65;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.failed-agent-session-link-copy,
.evaluation-stage-retry {
  min-height: 28px;
  cursor: pointer;
  font-size: 12px;
  justify-self: center;
}

.failed-agent-session-link-copy:disabled,
.evaluation-stage-retry:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.tab {
  height: 30px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 820;
}

.tab.active {
  color: #0d8a7d;
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
  min-height: 0;
}

.tab-panel.active {
  display: block;
}

#overviewTab.active {
  overflow: hidden;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
}

.download-card {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent-dark);
  background: #f8fbfa;
  text-decoration: none;
  font-weight: 820;
  font: inherit;
  cursor: pointer;
}

.download-card.disabled {
  pointer-events: none;
  color: #87938f;
  background: #f6f8f7;
  cursor: default;
}

.download-card.loading {
  color: #49625c;
  background: #eef7f5;
  border-color: #b8dcd5;
  cursor: wait;
}

.download-card:focus-visible {
  outline: 3px solid rgba(18, 160, 147, 0.22);
  outline-offset: 2px;
}

.download-status {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.download-status.error {
  color: var(--danger);
}

.download-status.success {
  color: var(--success);
}

.kv-list {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  color: #53635f;
  font-size: 12px;
  line-height: 1.45;
}

.kv-list strong {
  min-width: 0;
  color: #20302c;
  overflow-wrap: anywhere;
}

.progress {
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 6px;
  background: #e5ebe8;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .2s ease;
}

.donut {
  --passed: 0%;
  --review: 0%;
  width: 82px;
  height: 82px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: conic-gradient(#11a66e 0 var(--passed), #e8a72f var(--passed) var(--review), #e55247 var(--review) 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 21px;
  border-radius: 50%;
  background: #fff;
}

@media (max-width: 920px) {
  .sidebar {
    gap: 12px;
    padding: 12px;
  }

  .side-nav {
    overflow-x: auto;
  }

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

  .review-action-panel {
    grid-column: auto;
    width: 100%;
    justify-self: start;
  }

  .review-action-grid {
    grid-template-columns: 1fr;
  }

  .turn-answer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-controls {
    justify-content: stretch;
  }

  .top-controls label {
    flex: 1 1 150px;
  }

  .work-area {
    padding: 12px;
  }

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

  .detail-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  #overviewTab .table-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }

  #overviewTab thead th {
    position: static;
  }

  .detail-run-id {
    max-width: 100%;
    min-width: 0;
    text-align: left;
  }

  .review-action-grid {
    grid-template-columns: 1fr;
  }

  .review-action-panel {
    width: 100%;
  }

  .step-row,
  .field-grid,
  .config-grid,
  .config-fields,
  .compact-fields,
  .judge-fields,
  .output-fields,
  .download-grid,
  .turn-detail-grid,
  .turn-answer-grid {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .config-workspace {
    grid-template-areas:
      "task"
      "agent"
      "judge"
      "output";
  }

  .agent-config {
    padding-right: 0;
  }

  .judge-config {
    padding-left: 0;
    border-left: 0;
  }

  .upload-composer {
    grid-template-columns: 1fr;
    grid-template-areas:
      "file"
      "meta"
      "action";
    align-items: stretch;
  }

  .upload-field-stack {
    grid-template-columns: 1fr;
  }

  .turn-review-block-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .turn-review-block-head small {
    white-space: normal;
  }

  .turn-run-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .review-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .review-answer-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

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

  .version {
    display: none;
  }
}

/* Final cascade layer for the redesigned left-nav console. */
.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  gap: 18px;
  padding: 20px 16px;
  color: #14211f;
  background: #fbfcfc;
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.brand {
  color: #111918;
  font-size: 17px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, #00656a, #008a87);
  font-size: 22px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: visible;
}

.side-nav a {
  min-height: 44px;
  padding: 0 14px;
  color: #25312f;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  font-size: 15px;
}

.side-nav a.active,
.side-nav a.nav-parent-active,
.side-nav a[aria-current="page"],
.side-nav a:hover {
  color: var(--accent-dark);
  background: #eaf7f5;
  border-left-color: var(--accent);
}

.surface {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 80px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.top-controls {
  gap: 24px;
}

.top-controls label {
  min-width: 180px;
}

.view {
  display: none;
  min-width: 0;
  padding: 28px;
}

.view.active {
  display: block;
}

.page-head h1,
.detail-title-row h1 {
  margin: 0;
  color: #0f1817;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 760;
}

.workflow-panel,
.queue-section,
.detail-panel,
.suite-list-panel,
.suite-main-panel,
.case-editor-panel,
.settings-nav,
.config-panel,
.failure-table-panel,
.failure-inspector,
.log-table-panel,
.log-detail-panel,
.recommendation-panel,
.report-empty {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

.detail-panel {
  position: static;
  display: block;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
  padding: 0;
  margin-bottom: 22px;
  border: 0;
  background: transparent;
}

.review-action-panel {
  min-width: 0;
  display: grid;
}

.detail-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.detail-summary-row .metric-grid {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.detail-summary-row .metric-grid div {
  padding: 0 20px;
}

.detail-summary-row .metric-grid strong {
  font-size: 38px;
}

.detail-summary-row .review-action-panel {
  width: 100%;
  align-self: stretch;
}

.detail-summary-row .review-action-grid {
  height: 100%;
  align-content: stretch;
}

.suite-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 12px;
}

.failure-review-layout,
.logs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.metric-grid,
.suite-meta-grid,
.preflight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid {
  margin-bottom: 16px;
  padding: 28px 30px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 42px;
  line-height: 1;
}

.queue-toolbar,
.suite-list-toolbar,
.suite-table-toolbar,
.log-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-toolbar {
  justify-content: flex-end;
  margin-bottom: 16px;
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  width: 110px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeee;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.compact-modal {
  width: min(720px, calc(100vw - 32px));
}

.organizer-modal {
  width: min(1080px, calc(100vw - 32px));
}

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

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .suite-layout,
  .failure-review-layout,
  .logs-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .detail-head,
  .detail-summary-row {
    grid-template-columns: 1fr;
  }

  .detail-summary-row .review-action-grid {
    grid-template-columns: 1fr;
  }
}
