/* gamerl v2's page, on the micro1 design system's tokens: dark by default, light under [data-theme="light"]. */
:root {
  --surface-1: #121212;
  --surface-2: #191919;
  --surface-3: #313131;
  --white-100: rgba(255, 255, 255, 1);
  --white-80: rgba(255, 255, 255, 0.8);
  --white-60: rgba(255, 255, 255, 0.6);
  --white-40: rgba(255, 255, 255, 0.4);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-6: rgba(255, 255, 255, 0.06);
  --white-2: rgba(255, 255, 255, 0.02);
  --accent-100: #474cb8;
  --accent-80: #7065f0;
  --accent-60: #9fa3fc;
  --accent-40: #cacdfd;
  --accent-30: rgba(112, 101, 240, 0.3);
  --accent-16: rgba(112, 101, 240, 0.16);
  --success: #47b85f;
  --success-10: rgba(71, 184, 95, 0.1);
  --success-30: rgba(71, 184, 95, 0.3);
  --warning: #e6b95f;
  --warning-10: rgba(230, 185, 95, 0.1);
  --warning-30: rgba(230, 185, 95, 0.3);
  --error: #ec6d6d;
  --error-10: rgba(236, 109, 109, 0.1);
  --error-30: rgba(236, 109, 109, 0.3);
  --primary-bg: #ffffff;
  --primary-fg: #121212;
  --primary-hover: rgba(255, 255, 255, 0.8);
  --overlay: rgba(0, 0, 0, 0.6);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  color-scheme: dark;
}
[data-theme="light"] {
  --surface-1: #ebebf4;
  --surface-2: #ffffff;
  --surface-3: #e4e4f5;
  --white-100: rgba(0, 0, 0, 1);
  --white-80: rgba(0, 0, 0, 0.8);
  --white-60: rgba(0, 0, 0, 0.6);
  --white-40: rgba(0, 0, 0, 0.4);
  --white-20: rgba(0, 0, 0, 0.2);
  --white-10: rgba(0, 0, 0, 0.1);
  --white-6: rgba(0, 0, 0, 0.06);
  --white-2: rgba(0, 0, 0, 0.02);
  --primary-bg: #000000;
  --primary-fg: #ffffff;
  --primary-hover: rgba(0, 0, 0, 0.8);
  --overlay: rgba(0, 0, 0, 0.4);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface-1);
  color: var(--white-100);
  font: 16px/1.5 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
}
.top-glow {
  position: fixed; inset: 0 0 auto 0; height: 240px; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, var(--accent-16), transparent 70%);
}
a { color: var(--accent-60); text-decoration: none; }
a:hover { text-decoration: underline; }
[data-theme="light"] a { color: var(--accent-80); }
h1 { font-size: 32px; line-height: 1.2; font-weight: 600; margin: 0; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 600; margin: 0; }
h3 { font-size: 16px; line-height: 1.5; font-weight: 600; margin: 0; }
p { margin: 0; }
code, pre, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }

/* Layout */
header.bar {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-6); border-bottom: 1px solid var(--white-10);
  background: var(--surface-1); position: sticky; top: 0; z-index: 10;
}
header.bar .brand { font-weight: 600; font-size: 16px; color: var(--white-100); display: flex; align-items: center; gap: var(--space-2); }
header.bar .brand .tag { font-size: 12px; color: var(--accent-60); border: 1px solid var(--accent-30); border-radius: var(--radius-sm); padding: 0 var(--space-1); }
header.bar nav { display: flex; gap: var(--space-1); flex: 1; }
header.bar nav a { color: var(--white-60); padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); font-size: 14px; }
header.bar nav a:hover { background: var(--white-6); color: var(--white-100); text-decoration: none; }
header.bar nav a.active { color: var(--white-100); background: var(--white-10); }
header.bar .who { font-size: 14px; color: var(--white-60); display: flex; align-items: center; gap: var(--space-2); }
@media (max-width: 760px) {
  header.bar { flex-wrap: wrap; padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  header.bar nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  header.bar .who { margin-left: auto; }
  header.bar .who .email { display: none; }
}
main.wide { max-width: 2200px; }
main { max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-12); display: flex; flex-direction: column; gap: var(--space-6); }
.page-head { display: flex; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: var(--space-2); }
.sub { color: var(--white-60); font-size: 14px; }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } main { padding: var(--space-6) var(--space-4); } }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }

/* Cards */
.card { background: var(--surface-2); border: 1px solid var(--white-10); border-radius: var(--radius-md); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.card > .card-head { display: flex; align-items: center; gap: var(--space-2); }
.card > .card-head h2 { flex: 1; }
.empty { color: var(--white-60); font-size: 14px; }

/* Buttons */
button { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 38px; padding: 0 var(--space-3); border-radius: 6px; font-size: 16px; font-weight: 500; line-height: 20px;
  border: 1px solid var(--white-20); background: var(--white-6); color: var(--white-100); cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; white-space: nowrap;
}
.btn:hover { border-color: var(--accent-80); }
.btn.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.small { height: 32px; font-size: 14px; line-height: 16px; border-radius: var(--radius-sm); }
.btn:disabled, .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--white-20); background: var(--white-6); color: var(--white-80); cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.icon-btn:hover { border-color: var(--accent-80); color: var(--white-100); }
.icon-btn svg, .btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn.k-play { color: var(--success); }
.icon-btn.k-refresh { color: var(--warning); }
.icon-btn.k-edit { color: var(--accent-60); }
.icon-btn.k-save { color: var(--success); }
.icon-btn.k-delete { color: var(--error); }
[data-theme="light"] .icon-btn.k-edit { color: var(--accent-80); }

/* Forms */
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field > label { font-size: 12px; color: var(--white-80); }
.field .err { font-size: 12px; color: var(--error); }
input[type=text], input[type=email], input[type=number], input[type=search], input[type=date], select, textarea {
  font: inherit; font-size: 14px; color: var(--white-100); background: var(--surface-2);
  border: 1px solid var(--white-20); border-radius: var(--radius-sm); padding: var(--space-2); min-height: 36px; width: 100%;
  transition: border-color 100ms ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--white-40); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-80); box-shadow: 0 0 0 3px var(--accent-16); }
input::placeholder, textarea::placeholder { color: var(--white-40); }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
textarea.tall { min-height: 220px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); }

/* Chips and states */
.chip { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 12px; line-height: 1.4; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--white-10); color: var(--white-80); white-space: nowrap; }
.chip.accent { background: var(--accent-30); color: var(--white-100); }
.chip.ok { background: var(--success-10); color: var(--success); }
.chip.warn { background: var(--warning-10); color: var(--warning); }
.chip.bad { background: var(--error-10); color: var(--error); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.banner { border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); font-size: 14px; display: flex; gap: var(--space-2); align-items: flex-start; }
.banner.bad { background: var(--error-10); border: 1px solid var(--error-30); color: var(--white-100); }
.banner.warn { background: var(--warning-10); border: 1px solid var(--warning-30); color: var(--white-100); }
.banner.ok { background: var(--success-10); border: 1px solid var(--success-30); color: var(--white-100); }
.banner svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.banner.bonuses { margin-bottom: var(--space-4); }
/* The bonuses in equal columns that wrap as whole columns, each description wrapping inside its own, every part marked alike so a part on a new row lines up with the ones above. */
.banner.bonuses .bonus-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); flex: 1; min-width: 0; gap: var(--space-3) var(--space-4); }
.banner.bonuses .bonus { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding-left: var(--space-3); border-left: 2px solid var(--success-30); }
.banner.bad svg { color: var(--error); } .banner.warn svg { color: var(--warning); } .banner.ok svg { color: var(--success); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--white-10); }
table.table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.table th { text-align: left; font-weight: 500; color: var(--white-80); background: var(--white-10); padding: var(--space-2); white-space: nowrap; }
table.table td { padding: var(--space-2); background: var(--white-2); border-top: 1px solid var(--white-10); color: var(--white-80); vertical-align: middle; }
[data-theme="light"] table.table th { background: var(--surface-3); }
[data-theme="light"] table.table td { font-size: 14px; }
table.table tr.clickable { cursor: pointer; }
table.table th .th-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
table.table th .th-sort svg { width: 12px; height: 12px; opacity: 0; }
table.table th .th-sort:hover svg { opacity: 0.5; }
table.table th .th-sort.on { color: var(--white-100); }
table.table th .th-sort.on svg { opacity: 1; }
table.table th .th-sort:focus-visible { outline: 2px solid var(--accent-100); outline-offset: 2px; border-radius: 2px; }
table.table tr.clickable:hover td { background: var(--white-6); }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-verdict { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 2px var(--space-1); border-radius: var(--radius-sm); font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; border: 0; font-family: inherit; }
.v-pass { background: var(--success-10); color: var(--success); }
.v-fail { background: var(--error-10); color: var(--error); }
.v-none { background: var(--white-6); color: var(--white-40); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--white-10); min-width: 0; }
.list > .item:first-child { border-top: 0; }
.list > .item .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list > .item .main .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list > .item .meta { font-size: 12px; color: var(--white-60); }

/* Rubric editor */
.rubric { border: 1px solid var(--white-10); border-radius: var(--radius-sm); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); background: var(--white-2); }
.rubric .head { display: flex; gap: var(--space-2); align-items: flex-start; }
.rubric .head .title { flex: 1; font-weight: 500; }
.rubric .body { color: var(--white-80); font-size: 14px; white-space: pre-wrap; }
.rubric.edit .head input[type=number] { width: 88px; flex: none; }
.points { font-size: 12px; font-variant-numeric: tabular-nums; }

/* Blocks */
pre.block { margin: 0; background: var(--surface-1); border: 1px solid var(--white-10); border-radius: var(--radius-sm); padding: var(--space-3); overflow: auto; max-height: 480px; white-space: pre; color: var(--white-80); line-height: 1.45; }
pre.block.wrap { white-space: pre-wrap; word-break: break-word; }
pre.block .add { color: var(--success); } pre.block .del { color: var(--error); } pre.block .hunk { color: var(--accent-60); }
.prose { white-space: pre-wrap; color: var(--white-80); font-size: 14px; }
/* A judge's reasoning (app.js `reasonView`): its verdict line, the table of what it checked, a last line. */
.reason { display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; color: var(--white-80); }
.reason p { margin: 0; overflow-wrap: anywhere; }
.reason code, .reason-table code { font-family: ui-monospace, monospace; font-size: 12px; padding: 0 4px; border-radius: var(--radius-sm); background: var(--white-6); overflow-wrap: anywhere; }
table.reason-table td { vertical-align: top; overflow-wrap: anywhere; }
table.reason-table td.good { color: var(--success); } table.reason-table td.bad { color: var(--error); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); font-size: 14px; }
.kv > dt { color: var(--white-60); } .kv > dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Long content in a card (lists, tables, the tree, checks, comments, the prompt) scrolls in a box of its own, so one long card does not push the rest of the page away. The matrix is left out: it grows with its rubrics. */
.card .list, .card .table-wrap:not(.mx-wrap), .card .gt, .card .qc-list, .card .comments, .card > .prose { max-height: min(480px, 70vh); overflow-y: auto; }
.card > .prose { padding-right: var(--space-2); }
/* A scrolling table keeps its header in sight. */
.card .table-wrap:not(.mx-wrap) table.table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-3); }

/* Comments */
.comment { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-top: 1px solid var(--white-10); }
.comment:first-child { border-top: 0; }
.comment .by { font-size: 12px; color: var(--white-60); }
.comment .text { font-size: 14px; white-space: pre-wrap; }

/* Drawer and popup */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; opacity: 0; transition: opacity 200ms ease; }
.overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(760px, 100vw); z-index: 51; background: var(--surface-2);
  border-left: 1px solid var(--white-10); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 250ms ease;
}
.drawer.show { transform: translateX(0); }
.drawer .d-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--white-10); }
.drawer .d-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.popup {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px));
  background: var(--surface-2); border: 1px solid var(--white-10); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: var(--space-4);
}
.popup h2 { font-size: 24px; line-height: 1.3; }
.popup .actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.toast { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--surface-3); color: var(--white-100); border: 1px solid var(--white-20); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); font-size: 14px; max-width: calc(100vw - 32px); }
.toast.bad { border-color: var(--error-30); }

/* Sign-in */
.signin { max-width: 420px; margin: 12vh auto 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; color: var(--white-80); }
.copy-line { display: flex; gap: var(--space-2); align-items: stretch; }
.copy-line code { flex: 1; min-width: 0; background: var(--surface-1); border: 1px solid var(--white-10); border-radius: var(--radius-sm); padding: var(--space-2); overflow-x: auto; white-space: nowrap; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--white-20); border-top-color: var(--accent-80); border-radius: 50%; animation: spin 800ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .drawer, .overlay { transition: none; } }
a.icon-btn, [data-theme="light"] a.icon-btn { color: var(--white-80); text-decoration: none; }
a.icon-btn.k-play, [data-theme="light"] a.icon-btn.k-play { color: var(--success); }
a.btn, [data-theme="light"] a.btn { text-decoration: none; }
a.btn.primary, [data-theme="light"] a.btn.primary { color: var(--primary-fg); }
.list > button.item.pick { background: none; border: 0; border-top: 1px solid var(--white-10); font: inherit; color: var(--white-100); text-align: left; cursor: pointer; padding: var(--space-3); border-radius: var(--radius-sm); }
.list > button.item.pick:first-child { border-top: 0; }
.list > button.item.pick:hover { background: var(--white-6); }
.list > button.item.pick.active { background: var(--accent-16); }
.list > button.item.pick .main .t { font-weight: 500; white-space: normal; }
.banner.viewing { align-items: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.banner.viewing > .grow { flex: 1 1 240px; }

/* Git tree */
.gt { display: flex; flex-direction: column; overflow-x: auto; }
/* Capped in a card (max-height), a flex column would shrink its rows to fit, and a gap, whose content is all positioned, to nothing, putting the + and "task starts here" over the commit below: rows keep their height and the tree scrolls. */
.gt > * { flex: none; }
.gt-svg { flex: none; display: block; }
.gt-row { display: flex; align-items: center; gap: var(--space-2); height: 24px; min-width: 0; font-size: 12px; }
.gt-gap { position: relative; height: 14px; }
.gt-gap .gt-svg { position: absolute; left: 0; top: 0; }
.gt-plus { position: absolute; top: -1px; width: 16px; height: 16px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--accent-60); background: var(--surface-2); color: var(--accent-60); cursor: pointer; opacity: 0; transition: opacity 100ms ease; z-index: 1; }
.gt-plus svg { width: 10px; height: 10px; }
.gt-gap:hover .gt-plus, .gt-plus:focus-visible { opacity: 1; }
.gt-plus:hover { background: var(--accent-80); border-color: var(--accent-80); color: #fff; }
.gt-plus.mark { opacity: 1; cursor: default; background: var(--accent-80); border-color: var(--accent-80); color: #fff; }
.gt-mark-label { position: absolute; top: 0; font-size: 11px; line-height: 14px; color: var(--accent-60); white-space: nowrap; }
.gt-refs { display: flex; gap: var(--space-1); flex: none; }
.gt-ref { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; line-height: 16px; padding: 0 var(--space-1); border-radius: var(--radius-sm); border: 1px solid var(--white-20); color: var(--white-80); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.gt-ref svg { width: 10px; height: 10px; }
.gt-ref.main { border-color: var(--accent-60); color: var(--accent-60); }
.gt-ref.tag { color: var(--warning); border-color: var(--warning-30); }
.gt-task { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; line-height: 16px; padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--accent-16); color: var(--accent-60); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.gt-task:hover { background: var(--accent-30); }
.gt-task svg { width: 10px; height: 10px; flex: none; }
.gt-task.review, .gt-task.manager { background: var(--warning-10); color: var(--warning); }
.gt-task.approved { background: var(--success-10); color: var(--success); }
.gt-task.current { background: var(--accent-80); color: #fff; }
.gt-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--white-100); }
.gt-sha { flex: none; color: var(--white-40); font-size: 11px; }
.gt-when { flex: none; color: var(--white-40); width: 72px; text-align: right; }
@media (max-width: 760px) { .gt-when { display: none; } }

/* The matrix: rubrics down the side, runs across the top */
.stack.tight { gap: var(--space-2); }
/* The matrix grows with its rubrics rather than scrolling in a box of its own; it scrolls sideways only when the screen is too narrow for its columns. */
.mx-wrap { overflow-x: auto; overflow-y: hidden; }
table.mx { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
/* The model columns shrink to their content, so the rubric column takes what is left. */
table.mx th.mx-rubric, table.mx td.mx-none { width: 100%; }
table.mx th, table.mx td { padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--white-10); background: var(--surface-2); text-align: center; white-space: nowrap; vertical-align: middle; }
table.mx thead th { position: sticky; z-index: 2; background: var(--surface-3); font-weight: 500; color: var(--white-80); }
table.mx thead tr:first-child th { top: 0; }
table.mx thead tr:nth-child(2) th { top: 49px; }
table.mx .mx-corner { left: 0; z-index: 3; text-align: left; vertical-align: bottom; }
table.mx th.mx-rubric { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 400; border-right: 1px solid var(--white-10); }
table.mx .mx-corner { border-right: 1px solid var(--white-10); }
.mx-rubric-in { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
table.mx th.mx-rubric { min-width: min(36vw, 560px); }
.mx-rubric-in .mx-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.mx-n { flex: none; font-weight: 500; color: var(--white-60); font-variant-numeric: tabular-nums; width: 24px; }
.mx-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--white-100); font-size: 13px; }
.mx-weight { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--success); width: 32px; }
.mx-weight.penalty { color: var(--error); }
.mx-share { display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--white-10); overflow: hidden; }
.mx-share > span { display: block; height: 100%; background: var(--success); }
.mx-rubric-in .icon-btn { width: 28px; height: 28px; flex: none; }
.mx-caret { flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--white-60); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mx-caret svg { width: 14px; height: 14px; transform: rotate(180deg); transition: transform 150ms ease; }
.mx-caret.open svg { transform: rotate(270deg); }
.mx-caret:hover { background: var(--white-6); color: var(--white-100); }
.mx-group { border-left: 1px solid var(--white-10); }
.mx-group-in { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mx-group-state { display: flex; align-items: center; gap: var(--space-1); min-height: 20px; }
.mx-group-state .chip { font-size: 11px; padding: 0 var(--space-1); }
table.mx thead tr:first-child th { height: 49px; box-sizing: border-box; }
.mx-group-in .icon-btn { width: 20px; height: 20px; padding: 0; }
.mx-group-in .icon-btn svg { width: 12px; height: 12px; }
.mx-group-name { font-weight: 600; color: var(--white-100); }
.mx-group.closed .mx-group-name { color: var(--white-40); }
table.mx th.mx-col { min-width: 0; padding: var(--space-1) 2px; vertical-align: top; }
table.mx td.mx-cell { padding: var(--space-1) 2px; }
th.mx-col.selected { box-shadow: inset 0 -2px 0 var(--accent-80); }
th.mx-col.empty { opacity: 0.55; }
.mx-head { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 auto; padding: var(--space-1); border: 0; border-radius: var(--radius-sm); background: none; color: var(--white-100); font: inherit; cursor: pointer; }
.mx-head:disabled { cursor: default; }
.mx-head:not(:disabled):hover { background: var(--white-6); }
.mx-label { display: block; max-width: 64px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--white-60); }
.mx-state { display: block; font-size: 10px; color: var(--white-40); }
.mx-state.bad { color: var(--error); }
.vm { display: block; flex: none; }
.vm-openai { color: var(--white-100); }
td.mx-cell .cell-verdict { min-width: 32px; }
td.mx-cell.selected { box-shadow: inset 0 0 0 1px var(--accent-80); }
tr.mx-score th, tr.mx-score td { border-top: 1px solid var(--white-20); border-bottom: 0; font-weight: 600; }
td.mx-total { color: var(--white-80); font-variant-numeric: tabular-nums; }
td.mx-total.pass { color: var(--success); }
tr.mx-more > td { text-align: left; white-space: normal; background: var(--white-2); }
.mx-more-in { position: sticky; left: var(--space-2); max-width: min(720px, calc(100vw - 96px)); padding: var(--space-1) 0 var(--space-2) 28px; }
.mx-detail-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.mx-detail-rubric { display: flex; flex-direction: column; gap: var(--space-1); padding-bottom: var(--space-3); border-bottom: 1px solid var(--white-10); }
@media (max-width: 760px) {
  table.mx th.mx-rubric { min-width: 168px; }
  .mx-rubric-in { max-width: 168px; gap: var(--space-1); }
  .mx-n { width: 20px; }
  .mx-title { font-size: 12px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mx-rubric-in .icon-btn { display: none; }
  .mx-share { display: none; }
  .mx-weight { width: 22px; }
}

/* Popups of the matrix, rubric bands and notes */
.popup.wide { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.verdict { border-left: 3px solid var(--white-20); padding-left: var(--space-4); }
.verdict[data-v=v-pass] { border-left-color: var(--success); }
.verdict[data-v=v-fail] { border-left-color: var(--error); }
.vm-mask { display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; color: var(--white-100); }
img.vm { display: block; width: 20px; height: 20px; }
.segmented { display: inline-flex; align-self: flex-start; padding: 2px; gap: 2px; border-radius: var(--radius-sm); background: var(--white-6); border: 1px solid var(--white-10); }
.segmented button { border: 0; background: none; color: var(--white-60); font: inherit; font-size: 14px; padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; }
.segmented button[aria-checked=true] { background: var(--surface-3); color: var(--white-100); }
textarea.short { min-height: 72px; }
.mx-sev { flex: none; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px var(--space-1); border-radius: var(--radius-sm); width: 54px; text-align: center; }
.mx-sev.critical { background: var(--error-10); color: var(--error); }
.mx-sev.major { background: var(--warning-10); color: var(--warning); }
.mx-sev.minor { background: var(--white-6); color: var(--white-60); }
.mx-pen { color: var(--error); font-weight: 500; }
.mx-notes { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; height: 24px; padding: 0 var(--space-1); border: 1px solid var(--white-10); border-radius: var(--radius-sm); background: transparent; color: var(--white-40); font: inherit; font-size: 11px; font-variant-numeric: tabular-nums; cursor: pointer; }
.mx-notes svg { width: 12px; height: 12px; }
.mx-notes:hover { background: var(--white-6); color: var(--white-80); }
.mx-notes .good { color: var(--success); } .mx-notes .bad { color: var(--error); }
tr.mx-notes-row th, tr.mx-notes-row td { border-bottom: 0; }
.notes-view { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.notes-side { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.notes-side h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.notes-side.good h3 { color: var(--success); } .notes-side.bad h3 { color: var(--error); }
.notes-side ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; }
.note-line { display: flex; gap: var(--space-1); align-items: center; }
.note-line input { flex: 1; min-width: 0; }
.notes-side.good .note-line input { border-left: 2px solid var(--success); }
.notes-side.bad .note-line input { border-left: 2px solid var(--error); }
.note-line.blank input { border-style: dashed; }
@media (max-width: 760px) { .mx-rubric-in .mx-sev { display: none; } }
table.mx td.mx-none { text-align: left; white-space: normal; color: var(--white-60); font-size: 14px; padding: var(--space-3) var(--space-2); }
tr.mx-actions td .icon-btn { width: 28px; height: 28px; margin: 0 auto; }
tr.mx-actions td .icon-btn svg { width: 14px; height: 14px; }
tr.mx-actions th, tr.mx-actions td { border-bottom: 0; }
tr.mx-notes-row + tr.mx-actions th, tr.mx-notes-row + tr.mx-actions td { border-top: 1px solid var(--white-20); }

/* A run's steps */
.steps-list { display: flex; flex-direction: column; gap: var(--space-3); }
.step { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--white-10); border-radius: var(--radius-sm); background: var(--white-2); }
.step.user { border-color: var(--accent-30); }
.step-head { display: flex; align-items: center; gap: var(--space-2); }
.step-think { font-style: italic; border-left: 2px solid var(--white-20); padding-left: var(--space-2); }
.step-call { display: flex; flex-direction: column; gap: var(--space-1); }
.step-tool code { font-size: 12px; color: var(--accent-60); }
.step-call pre.block { max-height: 240px; font-size: 12px; }
.step-out { color: var(--white-60); }
.mx-draft { flex: none; font-size: 10px; padding: 0 var(--space-1); }

/* Evidence the judges kept */
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); }
.evidence figure { margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.evidence img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: var(--surface-1); border: 1px solid var(--white-10); border-radius: var(--radius-sm); }
.evidence figcaption { font-size: 12px; color: var(--white-60); }
.cell-verdict.has-evidence { position: relative; }
.cell-verdict.has-evidence::after { content: ''; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-60); }

/* Quality checks */
.qc-list { display: flex; flex-direction: column; }
.qc-row { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-top: 1px solid var(--white-10); }
.qc-row:first-child { border-top: 0; }
.qc-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.qc-details { margin: 0; padding-left: 18px; font-size: 13px; color: var(--white-80); display: flex; flex-direction: column; gap: 2px; }

/* The rubric editor's weight slider */
.weight-slider { display: flex; align-items: center; gap: var(--space-2); height: 36px; }
.weight-slider input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent-80); }
.weight-value { min-width: 28px; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--accent-16); color: var(--white-100); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

/* Figures in a row, as on the Jobs page's Workers card. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.stat { padding: var(--space-3); border-radius: var(--radius-md); background: var(--white-2); border: 1px solid var(--white-10); }
.stat-value { font-size: 20px; line-height: 1.4; font-weight: 500; color: var(--white-100); }
.stat-label { font-size: 12px; line-height: 1.4; color: var(--white-60); }
.stat.accent .stat-value { color: var(--accent-60); }
.stat.bad .stat-value { color: var(--error); }

/* The prompt's images and videos on the task's Prompt card. */
.media-strip { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; margin: var(--space-3) 0; }
.media-item { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); width: 112px; }
.media-thumb { position: relative; width: 112px; height: 80px; padding: 0; border: 1px solid var(--white-20); border-radius: var(--radius-sm); background: var(--white-6); overflow: hidden; cursor: zoom-in; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0, 0, 0, 0.3); }
.media-name { font-size: 12px; line-height: 1.4; color: var(--white-60); max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-frame { position: relative; }
.media-frame .icon-btn { position: absolute; top: var(--space-1); right: var(--space-1); width: 28px; height: 28px; background: var(--surface-2); }
.media-add svg, .media-play svg { width: 16px; height: 16px; flex: none; }
.media-add { display: inline-flex; align-items: center; gap: var(--space-2); height: 80px; padding: 0 var(--space-3); border: 1px dashed var(--white-20); border-radius: var(--radius-sm); background: none; color: var(--white-80); font: inherit; font-size: 14px; cursor: pointer; }
.media-add:hover { border-color: var(--accent-60); color: var(--white-100); }
.media-full { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: var(--radius-sm); }

/* Why the models failed: an issue picked marks its runs and rubrics in the matrix. */
.issue-row { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-2); border: 0; border-top: 1px solid var(--white-10); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.issue-row:first-child { border-top: 0; }
.issue-row:hover { background: var(--white-6); }
.issue-row.on { background: var(--accent-16); }
.issue-marks { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
td.mx-cell.mx-focus { outline: 2px solid var(--accent-60); outline-offset: -2px; }
th.mx-col.mx-focus { box-shadow: inset 0 -2px 0 var(--accent-60); }
